From 059d6700dd1a61a156adb765a7ae0fe95241e72a Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 27 Sep 2017 14:54:55 +0200 Subject: [PATCH] Publish latest versions of all APIs --- .../v1/acceleratedmobilepageurl-api.json | 156 +- .../v1.2/adexchangebuyer-api.json | 6 +- .../v1.3/adexchangebuyer-api.json | 6 +- .../v1.3/crates/1.0.6-api+20170810} | 0 .../v1.3/crates/1.0.6-cli+20170810} | 0 .../v1.4/adexchangebuyer-api.json | 8 +- .../v1.4/crates/1.0.6-api+20170810 | 0 .../v1.4/crates/1.0.6-cli+20170810 | 0 .../v2beta1/adexchangebuyer2-api.json | 3143 +- .../v1.1/adexchangeseller-api.json | 2 +- .../v1/adexchangeseller-api.json | 2 +- .../v2.0/adexchangeseller-api.json | 2 +- .../v1/adexperiencereport-api.json | 283 + .../v1/crates/1.0.6-api+20170918 | 0 .../v1/crates/1.0.6-cli+20170918 | 0 etc/api/admin/datatransfer_v1/admin-api.json | 2 +- etc/api/admin/directory_v1/admin-api.json | 156 +- .../directory_v1/crates/1.0.6-api+20170830 | 0 etc/api/admin/reports_v1/admin-api.json | 10 +- .../reports_v1/crates/1.0.6-api+20170622 | 0 .../reports_v1/crates/1.0.6-cli+20170622 | 0 etc/api/adsense/v1.4/adsense-api.json | 6 +- .../adsense/v1.4/crates/1.0.6-api+20170925 | 0 .../adsense/v1.4/crates/1.0.6-cli+20170925 | 0 etc/api/adsensehost/v4.1/adsensehost-api.json | 6 +- .../v4.1/crates/1.0.6-api+20170925 | 0 .../v4.1/crates/1.0.6-cli+20170925 | 0 etc/api/analytics/v2.4/analytics-api.json | 6 +- etc/api/analytics/v3/analytics-api.json | 23 +- .../analytics/v3/crates/1.0.6-api+20170807 | 0 .../analytics/v3/crates/1.0.6-cli+20170807 | 0 .../v4/analyticsreporting-api.json | 1760 +- .../v1/androiddeviceprovisioning-api.json | 1081 + .../v1/crates/1.0.6-api+20170923 | 0 .../v1/crates/1.0.6-cli+20170923 | 0 .../v1/androidenterprise-api.json | 97 +- .../v1/crates/1.0.6-api+20170922 | 0 .../v1/androidmanagement-api.json | 2363 + .../v1/crates/1.0.6-api+20170918 | 0 .../v1/crates/1.0.6-cli+20170918 | 0 .../v1.1/androidpublisher-api.json | 8 +- .../v1/androidpublisher-api.json | 6 +- .../v2/androidpublisher-api.json | 24 +- .../v2/crates/1.0.6-api+20170913 | 0 .../v2/crates/1.0.6-cli+20170913 | 0 etc/api/api-list.yaml | 43 +- etc/api/appengine/v1/appengine-api.json | 3688 +- .../appengine/v1/crates/1.0.6-api+20170914 | 0 etc/api/appengine/v1alpha/appengine-api.json | 1302 + etc/api/appengine/v1beta/appengine-api.json | 3558 + etc/api/appengine/v1beta4/appengine-api.json | 3002 +- .../v1beta4/crates/1.0.6-api+20170914 | 0 .../v1beta4/crates/1.0.6-cli+20170914 | 0 etc/api/appengine/v1beta5/appengine-api.json | 3204 +- .../v1beta5/crates/1.0.6-api+20170914 | 0 .../v1beta5/crates/1.0.6-cli+20170914 | 0 etc/api/appsactivity/v1/appsactivity-api.json | 6 +- .../appsactivity/v1/crates/1.0.6-api+20170921 | 0 .../appsactivity/v1/crates/1.0.6-cli+20170921 | 0 etc/api/appstate/v1/appstate-api.json | 6 +- etc/api/appstate/v1/crates/1.0.6-api+20170925 | 0 etc/api/appstate/v1/crates/1.0.6-cli+20170925 | 0 etc/api/bigquery/v2/bigquery-api.json | 174 +- etc/api/bigquery/v2/crates/1.0.6-api+20170917 | 0 .../v1/bigquerydatatransfer-api.json | 1761 + .../v1/crates/1.0.6-api+20170921 | 0 .../v1/crates/1.0.6-cli+20170921 | 0 etc/api/blogger/v2/blogger-api.json | 2 +- etc/api/blogger/v3/blogger-api.json | 2 +- etc/api/books/v1/books-api.json | 2 +- etc/api/calendar/v3/calendar-api.json | 124 +- etc/api/calendar/v3/crates/1.0.6-api+20170919 | 0 etc/api/calendar/v3/crates/1.0.6-cli+20170919 | 0 etc/api/civicinfo/v2/civicinfo-api.json | 2 +- etc/api/classroom/v1/classroom-api.json | 4511 +- .../classroom/v1/crates/1.0.6-api+20170926 | 0 etc/api/cloudbilling/v1/cloudbilling-api.json | 365 +- .../cloudbilling/v1/crates/1.0.6-api+20170813 | 0 etc/api/cloudbuild/v1/cloudbuild-api.json | 1751 +- .../clouddebugger/v2/clouddebugger-api.json | 1912 +- .../v2/crates/1.0.6-api+20170919 | 0 .../v2/crates/1.0.6-cli+20170919 | 0 .../v1beta1/clouderrorreporting-api.json | 1144 +- .../cloudfunctions/v1/cloudfunctions-api.json | 410 + .../v1/crates/1.0.6-api+20170920 | 0 .../v1/crates/1.0.6-cli+20170920 | 0 .../v1beta2/cloudfunctions-api.json | 804 + etc/api/cloudkms/v1/cloudkms-api.json | 1353 + etc/api/cloudkms/v1/crates/1.0.6-api+20170919 | 0 etc/api/cloudkms/v1/crates/1.0.6-cli+20170919 | 0 .../v2beta2/cloudmonitoring-api.json | 2 +- .../v1/cloudresourcemanager-api.json | 2707 +- .../v1/crates/1.0.6-api+20170920 | 0 .../v1/crates/1.0.6-cli+20170920 | 0 .../v1beta1/cloudresourcemanager-api.json | 1125 +- .../v1beta1/crates/1.0.6-api+20170920 | 0 .../v1beta1/crates/1.0.6-cli+20170920 | 0 .../v2beta1/cloudresourcemanager-api.json | 848 + .../cloudtasks/v2beta2/cloudtasks-api.json | 1608 + .../v2beta2/crates/1.0.6-api+20170926 | 0 .../v2beta2/crates/1.0.6-cli+20170926 | 0 etc/api/cloudtrace/v1/cloudtrace-api.json | 576 +- etc/api/cloudtrace/v2/cloudtrace-api.json | 604 + .../alpha/clouduseraccounts-api.json | 2 +- .../beta/clouduseraccounts-api.json | 2 +- .../vm_alpha/clouduseraccounts-api.json | 2 +- .../vm_beta/clouduseraccounts-api.json | 2 +- etc/api/compute/alpha/compute-api.json | 10753 ++- etc/api/compute/beta/compute-api.json | 8639 +- etc/api/compute/v1/compute-api.json | 3421 +- .../v2/consumersurveys-api.json | 2 +- etc/api/container/v1/container-api.json | 2818 +- .../container/v1/crates/1.0.6-api+20170915 | 0 etc/api/container/v1beta1/container-api.json | 3084 + etc/api/content/v2/content-api.json | 284 +- etc/api/content/v2/crates/1.0.6-api+20170926 | 0 etc/api/content/v2sandbox/content-api.json | 67 +- .../v2sandbox/crates/1.0.6-api+20170926 | 0 .../v2sandbox/crates/1.0.6-cli+20170926 | 0 .../customsearch/v1/crates/1.0.6-api+20170615 | 0 .../customsearch/v1/crates/1.0.6-cli+20170615 | 0 etc/api/customsearch/v1/customsearch-api.json | 16 +- etc/api/dataflow/v1b3/dataflow-api.json | 5172 +- etc/api/dataproc/v1/crates/1.0.6-api+20170919 | 0 etc/api/dataproc/v1/crates/1.0.6-cli+20170919 | 0 etc/api/dataproc/v1/dataproc-api.json | 2465 +- etc/api/dataproc/v1beta2/dataproc-api.json | 2084 + etc/api/datastore/v1/datastore-api.json | 1893 +- etc/api/datastore/v1beta1/datastore-api.json | 459 + etc/api/datastore/v1beta3/datastore-api.json | 1599 +- .../alpha/deploymentmanager-api.json | 3094 + .../v2/crates/1.0.6-api+20170925 | 0 .../v2/crates/1.0.6-cli+20170925 | 0 .../v2/deploymentmanager-api.json | 194 +- .../v2beta/deploymentmanager-api.json | 2891 + .../v2.7/crates/1.0.6-api+20170818 | 0 .../v2.7/crates/1.0.6-cli+20170818 | 0 .../dfareporting/v2.7/dfareporting-api.json | 18 +- .../v2.8/crates/1.0.6-api+20170818 | 0 .../v2.8/crates/1.0.6-cli+20170818 | 0 .../dfareporting/v2.8/dfareporting-api.json | 19730 +++++ etc/api/discovery/v1/discovery-api.json | 7 +- etc/api/dlp/v2beta1/crates/1.0.6-api+20170918 | 0 etc/api/dlp/v2beta1/crates/1.0.6-cli+20170918 | 0 etc/api/dlp/v2beta1/dlp-api.json | 2596 + etc/api/dns/v1/crates/1.0.6-api+20170921 | 0 etc/api/dns/v1/crates/1.0.6-cli+20170921 | 0 etc/api/dns/v1/dns-api.json | 6 +- etc/api/dns/v2beta1/dns-api.json | 6 +- .../v1/crates/1.0.6-api+20170705 | 0 .../v1/crates/1.0.6-cli+20170705 | 0 .../v1/doubleclickbidmanager-api.json | 16 +- .../v2/crates/1.0.6-api+20170919 | 0 .../v2/crates/1.0.6-cli+20170919 | 0 .../v2/doubleclicksearch-api.json | 6 +- etc/api/drive/v2/crates/1.0.6-api+20170915 | 0 etc/api/drive/v2/crates/1.0.6-cli+20170915 | 0 etc/api/drive/v2/drive-api.json | 19 +- etc/api/drive/v3/crates/1.0.6-api+20170915 | 0 etc/api/drive/v3/crates/1.0.6-cli+20170915 | 0 etc/api/drive/v3/drive-api.json | 17 +- .../v1/crates/1.0.6-api+20170926 | 0 .../v1/firebasedynamiclinks-api.json | 690 +- .../v1/crates/1.0.6-api+20170912 | 0 .../v1/crates/1.0.6-cli+20170912 | 0 .../v1/firebaseremoteconfig-api.json | 275 + .../firebaserules/v1/firebaserules-api.json | 894 +- etc/api/fitness/v1/crates/1.0.6-api+20170830 | 0 etc/api/fitness/v1/fitness-api.json | 98 +- etc/api/fusiontables/v1/fusiontables-api.json | 2 +- etc/api/fusiontables/v2/fusiontables-api.json | 2 +- etc/api/games/v1/crates/1.0.6-api+20170925 | 0 etc/api/games/v1/crates/1.0.6-cli+20170925 | 0 etc/api/games/v1/games-api.json | 6 +- .../v1configuration/crates/1.0.6-api+20170925 | 0 .../v1configuration/crates/1.0.6-cli+20170925 | 0 .../gamesconfiguration-api.json | 6 +- .../v1management/crates/1.0.6-api+20170925 | 0 .../v1management/crates/1.0.6-cli+20170925 | 0 .../v1management/gamesmanagement-api.json | 6 +- etc/api/genomics/v1/crates/1.0.6-api+20170925 | 0 etc/api/genomics/v1/crates/1.0.6-cli+20170925 | 0 etc/api/genomics/v1/genomics-api.json | 5158 +- etc/api/genomics/v1alpha2/genomics-api.json | 1136 +- etc/api/gmail/v1/crates/1.0.6-api+20170913 | 0 etc/api/gmail/v1/crates/1.0.6-cli+20170913 | 0 etc/api/gmail/v1/gmail-api.json | 8 +- .../v1/crates/1.0.6-api+20170607 | 0 .../v1/crates/1.0.6-cli+20170607 | 0 .../v1/groupsmigration-api.json | 10 +- .../v1/crates/1.0.6-api+20170607 | 0 .../v1/crates/1.0.6-cli+20170607 | 0 .../groupssettings/v1/groupssettings-api.json | 8 +- etc/api/iam/v1/crates/1.0.6-api+20170919 | 0 etc/api/iam/v1/iam-api.json | 2049 +- .../v3/crates/1.0.6-api+20170828 | 0 .../v3/identitytoolkit-api.json | 183 +- etc/api/kgsearch/v1/kgsearch-api.json | 210 +- etc/api/language/v1/language-api.json | 1633 +- etc/api/language/v1beta1/language-api.json | 1239 +- etc/api/language/v1beta2/language-api.json | 1251 + etc/api/licensing/v1/licensing-api.json | 2 +- etc/api/logging/v2/crates/1.0.6-api+20170918 | 0 etc/api/logging/v2/logging-api.json | 4080 +- .../logging/v2beta1/crates/1.0.6-api+20170918 | 0 etc/api/logging/v2beta1/logging-api.json | 2961 +- .../v1/crates/1.0.6-api+20170808 | 0 .../manufacturers/v1/manufacturers-api.json | 748 +- etc/api/mirror/v1/mirror-api.json | 2 +- etc/api/ml/v1/crates/1.0.6-api+20170926 | 0 etc/api/ml/v1/crates/1.0.6-cli+20170926 | 0 etc/api/ml/{v1beta1 => v1}/ml-api.json | 2662 +- .../monitoring/v3/crates/1.0.6-api+20170918 | 0 .../monitoring/v3/crates/1.0.6-cli+20170918 | 0 etc/api/monitoring/v3/monitoring-api.json | 1919 +- etc/api/oauth2/v1/oauth2-api.json | 6 +- etc/api/oauth2/v2/oauth2-api.json | 4 +- etc/api/oslogin/v1alpha/oslogin-api.json | 397 + .../oslogin/v1beta/crates/1.0.6-api+20170926 | 0 .../oslogin/v1beta/crates/1.0.6-cli+20170926 | 0 etc/api/oslogin/v1beta/oslogin-api.json | 397 + .../v1/pagespeedonline-api.json | 2 +- .../v2/pagespeedonline-api.json | 2 +- etc/api/partners/v2/crates/1.0.6-api+20170912 | 0 etc/api/partners/v2/crates/1.0.6-cli+20170912 | 0 etc/api/partners/v2/partners-api.json | 4284 +- etc/api/people/v1/crates/1.0.6-api+20170925 | 0 etc/api/people/v1/people-api.json | 1993 +- .../v1/crates/1.0.6-api+20170622 | 0 .../v1/crates/1.0.6-cli+20170622 | 0 .../playcustomapp/v1/playcustomapp-api.json | 149 + .../v1/crates/1.0.6-api+20170919 | 0 .../v1/crates/1.0.6-cli+20170919 | 0 .../v1/playmoviespartner-api.json | 1336 +- etc/api/plus/v1/crates/1.0.6-api+20170828 | 0 etc/api/plus/v1/crates/1.0.6-cli+20170828 | 0 etc/api/plus/v1/plus-api.json | 4 +- .../plusdomains/v1/crates/1.0.6-api+20170828 | 0 .../plusdomains/v1/crates/1.0.6-cli+20170828 | 0 etc/api/plusdomains/v1/plusdomains-api.json | 4 +- etc/api/prediction/v1.2/prediction-api.json | 2 +- etc/api/prediction/v1.3/prediction-api.json | 2 +- etc/api/prediction/v1.4/prediction-api.json | 2 +- etc/api/prediction/v1.5/prediction-api.json | 2 +- etc/api/prediction/v1.6/prediction-api.json | 2 +- .../v1beta1/crates/1.0.6-api+20170913 | 0 .../v1beta1/crates/1.0.6-cli+20170913 | 0 .../v1beta1/proximitybeacon-api.json | 1286 +- etc/api/pubsub/v1/crates/1.0.6-api+20170829 | 0 etc/api/pubsub/v1/crates/1.0.6-cli+20170829 | 0 etc/api/pubsub/v1/pubsub-api.json | 1844 +- etc/api/pubsub/v1beta1a/pubsub-api.json | 734 +- .../pubsub/v1beta2/crates/1.0.6-api+20170829 | 0 .../pubsub/v1beta2/crates/1.0.6-cli+20170829 | 0 etc/api/pubsub/v1beta2/pubsub-api.json | 1874 +- etc/api/qpxexpress/v1/qpxexpress-api.json | 2 +- .../replicapool/v1beta1/replicapool-api.json | 2 +- .../replicapool/v1beta2/replicapool-api.json | 2 +- .../v1beta1/replicapoolupdater-api.json | 2 +- etc/api/reseller/v1/reseller-api.json | 2 +- .../v1beta2/resourceviews-api.json | 2 +- .../runtimeconfig/v1/runtimeconfig-api.json | 301 +- .../v1beta1/runtimeconfig-api.json | 1903 +- .../safebrowsing/v4/crates/1.0.6-api+20170921 | 0 .../safebrowsing/v4/crates/1.0.6-cli+20170921 | 0 etc/api/safebrowsing/v4/safebrowsing-api.json | 1414 +- etc/api/script/v1/script-api.json | 309 +- .../v1/crates/1.0.6-api+20170926 | 0 .../v1/crates/1.0.6-cli+20170926 | 0 .../searchconsole/v1/searchconsole-api.json | 164 +- .../servicecontrol/v1/servicecontrol-api.json | 2510 +- .../v1/servicemanagement-api.json | 4020 +- etc/api/serviceuser/v1/serviceuser-api.json | 2002 + etc/api/shared.yaml | 4 + etc/api/sheets/v4/sheets-api.json | 6428 +- .../v1/siteverification-api.json | 2 +- etc/api/slides/v1/slides-api.json | 6280 +- .../sourcerepo/v1/crates/1.0.6-api+20170908 | 0 .../sourcerepo/v1/crates/1.0.6-cli+20170908 | 0 etc/api/sourcerepo/v1/sourcerepo-api.json | 603 + etc/api/spanner/v1/crates/1.0.6-api+20170914 | 0 etc/api/spanner/v1/crates/1.0.6-cli+20170914 | 0 etc/api/spanner/v1/spanner-api.json | 2476 + etc/api/spectrum/v1explorer/spectrum-api.json | 2 +- etc/api/speech/v1/speech-api.json | 569 + etc/api/speech/v1beta1/speech-api.json | 402 +- etc/api/sqladmin/v1beta3/sqladmin-api.json | 8 +- .../v1beta4/crates/1.0.6-api+20170807 | 0 .../v1beta4/crates/1.0.6-cli+20170807 | 0 etc/api/sqladmin/v1beta4/sqladmin-api.json | 52 +- etc/api/storage/v1/crates/1.0.6-api+20170915 | 0 etc/api/storage/v1/storage-api.json | 180 +- etc/api/storage/v1beta1/storage-api.json | 4 +- etc/api/storage/v1beta2/storage-api.json | 4 +- .../v1/crates/1.0.6-api+20170921 | 0 .../v1/crates/1.0.6-cli+20170921 | 0 .../v1/storagetransfer-api.json | 1292 +- .../v1/streetviewpublish-api.json | 688 + etc/api/surveys/v2/surveys-api.json | 2 +- etc/api/tagmanager/v1/tagmanager-api.json | 2 +- .../tagmanager/v2/crates/1.0.6-api+20170915 | 0 .../tagmanager/v2/crates/1.0.6-cli+20170915 | 0 etc/api/tagmanager/v2/tagmanager-api.json | 4858 ++ etc/api/taskqueue/v1beta1/taskqueue-api.json | 2 +- etc/api/tasks/v1/tasks-api.json | 2 +- etc/api/testing/v1/crates/1.0.6-api+20170922 | 0 etc/api/testing/v1/crates/1.0.6-cli+20170922 | 0 etc/api/testing/v1/testing-api.json | 1347 + .../toolresults/v1beta3/toolresults-api.json | 340 +- .../translate/v2/crates/1.0.6-api+20170525 | 0 etc/api/translate/v2/translate-api.json | 679 +- etc/api/vault/v1/crates/1.0.6-api+20170812 | 0 etc/api/vault/v1/crates/1.0.6-cli+20170812 | 0 etc/api/vault/v1/vault-api.json | 1046 + .../v1beta1/crates/1.0.6-api+20170923 | 0 .../v1beta1/crates/1.0.6-cli+20170923 | 0 .../v1beta1/videointelligence-api.json | 1020 + etc/api/vision/v1/vision-api.json | 1610 +- etc/api/webfonts/v1/webfonts-api.json | 2 +- .../webmasters/v3/crates/1.0.6-api+20170528 | 0 .../webmasters/v3/crates/1.0.6-cli+20170528 | 0 etc/api/webmasters/v3/webmasters-api.json | 4 +- etc/api/youtube/v3/crates/1.0.6-api+20170918 | 0 etc/api/youtube/v3/youtube-api.json | 126 +- .../v1/crates/1.0.6-api+20170925 | 0 .../v1/crates/1.0.6-cli+20170925 | 0 .../v1/youtubeanalytics-api.json | 6 +- .../v1beta1/youtubeanalytics-api.json | 6 +- .../v1/crates/1.0.6-api+20170926 | 0 .../v1/crates/1.0.6-cli+20170926 | 0 .../v1/youtubereporting-api.json | 1150 +- gen/adexchangebuyer1d3-cli/Cargo.toml | 4 +- gen/adexchangebuyer1d3-cli/README.md | 2 +- gen/adexchangebuyer1d3-cli/mkdocs.yml | 2 +- gen/adexchangebuyer1d3-cli/src/main.rs | 2 +- gen/adexchangebuyer1d3/Cargo.toml | 4 +- gen/adexchangebuyer1d3/README.md | 68 +- gen/adexchangebuyer1d3/src/lib.rs | 2 +- gen/adexchangebuyer1d4-cli/Cargo.toml | 4 +- gen/adexchangebuyer1d4-cli/README.md | 2 +- gen/adexchangebuyer1d4-cli/mkdocs.yml | 2 +- gen/adexchangebuyer1d4-cli/src/main.rs | 2 +- gen/adexchangebuyer1d4/Cargo.toml | 4 +- gen/adexchangebuyer1d4/README.md | 80 +- gen/adexchangebuyer1d4/src/lib.rs | 4 +- gen/adexperiencereport1-cli/Cargo.toml | 40 + gen/adexperiencereport1-cli/LICENSE.md | 30 + gen/adexperiencereport1-cli/README.md | 116 + gen/adexperiencereport1-cli/mkdocs.yml | 18 + gen/adexperiencereport1-cli/src/cmn.rs | 799 + gen/adexperiencereport1-cli/src/main.rs | 413 + gen/adexperiencereport1/Cargo.toml | 31 + gen/adexperiencereport1/LICENSE.md | 30 + gen/adexperiencereport1/README.md | 176 + gen/adexperiencereport1/src/cmn.rs | 753 + gen/adexperiencereport1/src/lib.rs | 1037 + gen/admin1_directory-cli/Cargo.toml | 4 +- gen/admin1_directory-cli/README.md | 3 +- gen/admin1_directory-cli/mkdocs.yml | 3 +- gen/admin1_directory-cli/src/main.rs | 132 +- gen/admin1_directory/Cargo.toml | 4 +- gen/admin1_directory/README.md | 114 +- gen/admin1_directory/src/lib.rs | 619 +- gen/admin1_reports-cli/Cargo.toml | 4 +- gen/admin1_reports-cli/README.md | 2 +- gen/admin1_reports-cli/mkdocs.yml | 2 +- gen/admin1_reports-cli/src/main.rs | 2 +- gen/admin1_reports/Cargo.toml | 4 +- gen/admin1_reports/README.md | 56 +- gen/admin1_reports/src/lib.rs | 2 +- gen/adsense1d4-cli/Cargo.toml | 4 +- gen/adsense1d4-cli/README.md | 2 +- gen/adsense1d4-cli/mkdocs.yml | 2 +- gen/adsense1d4-cli/src/main.rs | 2 +- gen/adsense1d4/Cargo.toml | 4 +- gen/adsense1d4/README.md | 72 +- gen/adsense1d4/src/lib.rs | 2 +- gen/adsensehost4d1-cli/Cargo.toml | 4 +- gen/adsensehost4d1-cli/README.md | 2 +- gen/adsensehost4d1-cli/mkdocs.yml | 2 +- gen/adsensehost4d1-cli/src/main.rs | 2 +- gen/adsensehost4d1/Cargo.toml | 4 +- gen/adsensehost4d1/README.md | 56 +- gen/adsensehost4d1/src/lib.rs | 2 +- gen/analytics3-cli/Cargo.toml | 4 +- gen/analytics3-cli/README.md | 2 +- gen/analytics3-cli/mkdocs.yml | 2 +- gen/analytics3-cli/src/main.rs | 2 +- gen/analytics3/Cargo.toml | 4 +- gen/analytics3/README.md | 50 +- gen/analytics3/src/lib.rs | 57 +- gen/androiddeviceprovisioning1-cli/Cargo.toml | 40 + gen/androiddeviceprovisioning1-cli/LICENSE.md | 30 + gen/androiddeviceprovisioning1-cli/README.md | 122 + gen/androiddeviceprovisioning1-cli/mkdocs.yml | 28 + gen/androiddeviceprovisioning1-cli/src/cmn.rs | 799 + .../src/main.rs | 1526 + gen/androiddeviceprovisioning1/Cargo.toml | 31 + gen/androiddeviceprovisioning1/LICENSE.md | 30 + gen/androiddeviceprovisioning1/README.md | 185 + gen/androiddeviceprovisioning1/src/cmn.rs | 753 + gen/androiddeviceprovisioning1/src/lib.rs | 4247 + gen/androidenterprise1-cli/Cargo.toml | 4 +- gen/androidenterprise1-cli/README.md | 4 +- gen/androidenterprise1-cli/mkdocs.yml | 4 +- gen/androidenterprise1-cli/src/main.rs | 200 +- gen/androidenterprise1/Cargo.toml | 4 +- gen/androidenterprise1/README.md | 95 +- gen/androidenterprise1/src/lib.rs | 1843 +- gen/androidmanagement1-cli/Cargo.toml | 40 + gen/androidmanagement1-cli/LICENSE.md | 30 + gen/androidmanagement1-cli/README.md | 135 + gen/androidmanagement1-cli/mkdocs.yml | 37 + gen/androidmanagement1-cli/src/cmn.rs | 799 + gen/androidmanagement1-cli/src/main.rs | 2307 + gen/androidmanagement1/Cargo.toml | 31 + gen/androidmanagement1/LICENSE.md | 30 + gen/androidmanagement1/README.md | 204 + gen/androidmanagement1/src/cmn.rs | 753 + gen/androidmanagement1/src/lib.rs | 7595 ++ gen/androidpublisher2-cli/Cargo.toml | 4 +- gen/androidpublisher2-cli/README.md | 2 +- gen/androidpublisher2-cli/mkdocs.yml | 2 +- gen/androidpublisher2-cli/src/main.rs | 2 +- gen/androidpublisher2/Cargo.toml | 4 +- gen/androidpublisher2/README.md | 62 +- gen/androidpublisher2/src/lib.rs | 26 +- gen/appengine1-cli/Cargo.toml | 4 +- gen/appengine1-cli/README.md | 13 +- gen/appengine1-cli/mkdocs.yml | 13 +- gen/appengine1-cli/src/main.rs | 1151 +- gen/appengine1/Cargo.toml | 4 +- gen/appengine1/README.md | 45 +- gen/appengine1/src/lib.rs | 8702 +- gen/appengine1_beta4-cli/Cargo.toml | 4 +- gen/appengine1_beta4-cli/README.md | 2 +- gen/appengine1_beta4-cli/mkdocs.yml | 2 +- gen/appengine1_beta4-cli/src/main.rs | 62 +- gen/appengine1_beta4/Cargo.toml | 4 +- gen/appengine1_beta4/README.md | 42 +- gen/appengine1_beta4/src/lib.rs | 419 +- gen/appengine1_beta5-cli/Cargo.toml | 4 +- gen/appengine1_beta5-cli/README.md | 2 +- gen/appengine1_beta5-cli/mkdocs.yml | 2 +- gen/appengine1_beta5-cli/src/main.rs | 90 +- gen/appengine1_beta5/Cargo.toml | 4 +- gen/appengine1_beta5/README.md | 42 +- gen/appengine1_beta5/src/lib.rs | 255 +- gen/appsactivity1-cli/Cargo.toml | 4 +- gen/appsactivity1-cli/README.md | 2 +- gen/appsactivity1-cli/mkdocs.yml | 2 +- gen/appsactivity1-cli/src/main.rs | 2 +- gen/appsactivity1/Cargo.toml | 4 +- gen/appsactivity1/README.md | 44 +- gen/appsactivity1/src/lib.rs | 2 +- gen/appstate1-cli/Cargo.toml | 4 +- gen/appstate1-cli/README.md | 2 +- gen/appstate1-cli/mkdocs.yml | 2 +- gen/appstate1-cli/src/main.rs | 2 +- gen/appstate1/Cargo.toml | 4 +- gen/appstate1/README.md | 42 +- gen/appstate1/src/lib.rs | 2 +- gen/bigquery2-cli/Cargo.toml | 4 +- gen/bigquery2-cli/README.md | 3 +- gen/bigquery2-cli/mkdocs.yml | 3 +- gen/bigquery2-cli/src/main.rs | 136 +- gen/bigquery2/Cargo.toml | 4 +- gen/bigquery2/README.md | 58 +- gen/bigquery2/src/lib.rs | 6241 +- gen/bigquerydatatransfer1-cli/Cargo.toml | 40 + gen/bigquerydatatransfer1-cli/LICENSE.md | 30 + gen/bigquerydatatransfer1-cli/README.md | 141 + gen/bigquerydatatransfer1-cli/mkdocs.yml | 44 + gen/bigquerydatatransfer1-cli/src/cmn.rs | 799 + gen/bigquerydatatransfer1-cli/src/main.rs | 2940 + gen/bigquerydatatransfer1/Cargo.toml | 31 + gen/bigquerydatatransfer1/LICENSE.md | 30 + gen/bigquerydatatransfer1/README.md | 187 + gen/bigquerydatatransfer1/src/cmn.rs | 753 + gen/bigquerydatatransfer1/src/lib.rs | 9534 ++ gen/calendar3-cli/Cargo.toml | 4 +- gen/calendar3-cli/README.md | 2 +- gen/calendar3-cli/mkdocs.yml | 2 +- gen/calendar3-cli/src/main.rs | 2 +- gen/calendar3/Cargo.toml | 4 +- gen/calendar3/README.md | 86 +- gen/calendar3/src/lib.rs | 274 +- gen/classroom1-cli/Cargo.toml | 4 +- gen/classroom1-cli/README.md | 12 +- gen/classroom1-cli/mkdocs.yml | 11 +- gen/classroom1-cli/src/main.rs | 1166 +- gen/classroom1/Cargo.toml | 4 +- gen/classroom1/README.md | 65 +- gen/classroom1/src/lib.rs | 5474 +- gen/cloudbilling1-cli/Cargo.toml | 6 +- gen/cloudbilling1-cli/README.md | 9 +- gen/cloudbilling1-cli/mkdocs.yml | 6 +- gen/cloudbilling1-cli/src/main.rs | 179 +- gen/cloudbilling1/Cargo.toml | 6 +- gen/cloudbilling1/README.md | 52 +- gen/cloudbilling1/src/lib.rs | 2045 +- gen/clouddebugger2-cli/Cargo.toml | 4 +- gen/clouddebugger2-cli/README.md | 2 +- gen/clouddebugger2-cli/mkdocs.yml | 2 +- gen/clouddebugger2-cli/src/main.rs | 37 +- gen/clouddebugger2/Cargo.toml | 4 +- gen/clouddebugger2/README.md | 44 +- gen/clouddebugger2/src/lib.rs | 184 +- gen/cloudfunctions1-cli/Cargo.toml | 40 + gen/cloudfunctions1-cli/LICENSE.md | 30 + gen/cloudfunctions1-cli/README.md | 117 + gen/cloudfunctions1-cli/mkdocs.yml | 19 + gen/cloudfunctions1-cli/src/cmn.rs | 799 + gen/cloudfunctions1-cli/src/main.rs | 518 + gen/cloudfunctions1/Cargo.toml | 31 + gen/cloudfunctions1/LICENSE.md | 30 + gen/cloudfunctions1/README.md | 181 + gen/cloudfunctions1/src/cmn.rs | 753 + gen/cloudfunctions1/src/lib.rs | 1522 + gen/cloudkms1-cli/Cargo.toml | 40 + gen/cloudkms1-cli/LICENSE.md | 30 + gen/cloudkms1-cli/README.md | 137 + gen/cloudkms1-cli/mkdocs.yml | 40 + gen/cloudkms1-cli/src/cmn.rs | 799 + gen/cloudkms1-cli/src/main.rs | 2791 + gen/cloudkms1/Cargo.toml | 31 + gen/cloudkms1/LICENSE.md | 30 + gen/cloudkms1/README.md | 185 + gen/cloudkms1/src/cmn.rs | 753 + gen/cloudkms1/src/lib.rs | 8405 ++ gen/cloudresourcemanager1-cli/Cargo.toml | 4 +- gen/cloudresourcemanager1-cli/README.md | 2 +- gen/cloudresourcemanager1-cli/mkdocs.yml | 2 +- gen/cloudresourcemanager1-cli/src/main.rs | 62 +- gen/cloudresourcemanager1/Cargo.toml | 4 +- gen/cloudresourcemanager1/README.md | 58 +- gen/cloudresourcemanager1/src/lib.rs | 2061 +- .../Cargo.toml | 4 +- gen/cloudresourcemanager1_beta1-cli/README.md | 2 +- .../mkdocs.yml | 2 +- .../src/main.rs | 15 +- gen/cloudresourcemanager1_beta1/Cargo.toml | 4 +- gen/cloudresourcemanager1_beta1/README.md | 48 +- gen/cloudresourcemanager1_beta1/src/lib.rs | 295 +- gen/cloudtasks2_beta2-cli/Cargo.toml | 40 + gen/cloudtasks2_beta2-cli/LICENSE.md | 30 + gen/cloudtasks2_beta2-cli/README.md | 135 + gen/cloudtasks2_beta2-cli/mkdocs.yml | 38 + gen/cloudtasks2_beta2-cli/src/cmn.rs | 799 + gen/cloudtasks2_beta2-cli/src/main.rs | 2831 + gen/cloudtasks2_beta2/Cargo.toml | 31 + gen/cloudtasks2_beta2/LICENSE.md | 30 + gen/cloudtasks2_beta2/README.md | 186 + gen/cloudtasks2_beta2/src/cmn.rs | 753 + gen/cloudtasks2_beta2/src/lib.rs | 8967 ++ gen/container1-cli/Cargo.toml | 6 +- gen/container1-cli/README.md | 16 +- gen/container1-cli/mkdocs.yml | 14 +- gen/container1-cli/src/main.rs | 1405 +- gen/container1/Cargo.toml | 6 +- gen/container1/README.md | 72 +- gen/container1/src/lib.rs | 9692 ++- gen/content2-cli/Cargo.toml | 4 +- gen/content2-cli/README.md | 2 +- gen/content2-cli/mkdocs.yml | 2 +- gen/content2-cli/src/main.rs | 69 +- gen/content2/Cargo.toml | 4 +- gen/content2/README.md | 70 +- gen/content2/src/lib.rs | 411 +- gen/content2_sandbox-cli/Cargo.toml | 4 +- gen/content2_sandbox-cli/README.md | 2 +- gen/content2_sandbox-cli/mkdocs.yml | 2 +- gen/content2_sandbox-cli/src/main.rs | 6 +- gen/content2_sandbox/Cargo.toml | 4 +- gen/content2_sandbox/README.md | 44 +- gen/content2_sandbox/src/lib.rs | 100 +- gen/customsearch1-cli/Cargo.toml | 4 +- gen/customsearch1-cli/README.md | 2 +- gen/customsearch1-cli/mkdocs.yml | 2 +- gen/customsearch1-cli/src/main.rs | 9 +- gen/customsearch1/Cargo.toml | 4 +- gen/customsearch1/README.md | 47 +- gen/customsearch1/src/lib.rs | 199 +- gen/dataproc1-cli/Cargo.toml | 4 +- gen/dataproc1-cli/README.md | 2 +- gen/dataproc1-cli/mkdocs.yml | 2 +- gen/dataproc1-cli/src/main.rs | 46 +- gen/dataproc1/Cargo.toml | 4 +- gen/dataproc1/README.md | 42 +- gen/dataproc1/src/lib.rs | 166 +- gen/deploymentmanager2-cli/Cargo.toml | 4 +- gen/deploymentmanager2-cli/README.md | 2 +- gen/deploymentmanager2-cli/mkdocs.yml | 2 +- gen/deploymentmanager2-cli/src/main.rs | 2 +- gen/deploymentmanager2/Cargo.toml | 4 +- gen/deploymentmanager2/README.md | 60 +- gen/deploymentmanager2/src/lib.rs | 1076 +- gen/dfareporting2d7-cli/Cargo.toml | 4 +- gen/dfareporting2d7-cli/README.md | 2 +- gen/dfareporting2d7-cli/mkdocs.yml | 2 +- gen/dfareporting2d7-cli/src/main.rs | 2 +- gen/dfareporting2d7/Cargo.toml | 4 +- gen/dfareporting2d7/README.md | 286 +- gen/dfareporting2d7/src/lib.rs | 38 +- gen/dfareporting2d8-cli/Cargo.toml | 40 + gen/dfareporting2d8-cli/LICENSE.md | 30 + gen/dfareporting2d8-cli/README.md | 377 + gen/dfareporting2d8-cli/mkdocs.yml | 221 + gen/dfareporting2d8-cli/src/cmn.rs | 799 + gen/dfareporting2d8-cli/src/main.rs | 23876 +++++ gen/dfareporting2d8/Cargo.toml | 31 + gen/dfareporting2d8/LICENSE.md | 30 + gen/dfareporting2d8/README.md | 315 + gen/dfareporting2d8/src/cmn.rs | 753 + gen/dfareporting2d8/src/lib.rs | 72604 ++++++++++++++++ gen/dlp2_beta1-cli/Cargo.toml | 40 + gen/dlp2_beta1-cli/LICENSE.md | 30 + gen/dlp2_beta1-cli/README.md | 133 + gen/dlp2_beta1-cli/mkdocs.yml | 32 + gen/dlp2_beta1-cli/src/cmn.rs | 799 + gen/dlp2_beta1-cli/src/main.rs | 1838 + gen/dlp2_beta1/Cargo.toml | 31 + gen/dlp2_beta1/LICENSE.md | 30 + gen/dlp2_beta1/README.md | 191 + gen/dlp2_beta1/src/cmn.rs | 753 + gen/dlp2_beta1/src/lib.rs | 7051 ++ gen/dns1-cli/Cargo.toml | 4 +- gen/dns1-cli/README.md | 2 +- gen/dns1-cli/mkdocs.yml | 2 +- gen/dns1-cli/src/main.rs | 2 +- gen/dns1/Cargo.toml | 4 +- gen/dns1/README.md | 56 +- gen/dns1/src/lib.rs | 2 +- gen/doubleclickbidmanager1-cli/Cargo.toml | 4 +- gen/doubleclickbidmanager1-cli/README.md | 2 +- gen/doubleclickbidmanager1-cli/mkdocs.yml | 2 +- gen/doubleclickbidmanager1-cli/src/main.rs | 2 +- gen/doubleclickbidmanager1/Cargo.toml | 4 +- gen/doubleclickbidmanager1/README.md | 52 +- gen/doubleclickbidmanager1/src/lib.rs | 4 +- gen/doubleclicksearch2-cli/Cargo.toml | 4 +- gen/doubleclicksearch2-cli/README.md | 2 +- gen/doubleclicksearch2-cli/mkdocs.yml | 2 +- gen/doubleclicksearch2-cli/src/main.rs | 2 +- gen/doubleclicksearch2/Cargo.toml | 4 +- gen/doubleclicksearch2/README.md | 54 +- gen/doubleclicksearch2/src/lib.rs | 2 +- gen/drive2-cli/Cargo.toml | 4 +- gen/drive2-cli/README.md | 2 +- gen/drive2-cli/mkdocs.yml | 2 +- gen/drive2-cli/src/main.rs | 16 +- gen/drive2/Cargo.toml | 4 +- gen/drive2/README.md | 110 +- gen/drive2/src/lib.rs | 13 +- gen/drive3-cli/Cargo.toml | 4 +- gen/drive3-cli/README.md | 2 +- gen/drive3-cli/mkdocs.yml | 2 +- gen/drive3-cli/src/main.rs | 13 +- gen/drive3/Cargo.toml | 4 +- gen/drive3/README.md | 96 +- gen/drive3/src/lib.rs | 11 +- gen/firebasedynamiclinks1-cli/Cargo.toml | 4 +- gen/firebasedynamiclinks1-cli/README.md | 5 +- gen/firebasedynamiclinks1-cli/mkdocs.yml | 4 +- gen/firebasedynamiclinks1-cli/src/main.rs | 219 +- gen/firebasedynamiclinks1/Cargo.toml | 4 +- gen/firebasedynamiclinks1/README.md | 54 +- gen/firebasedynamiclinks1/src/lib.rs | 988 +- gen/firebaseremoteconfig1-cli/Cargo.toml | 40 + gen/firebaseremoteconfig1-cli/LICENSE.md | 30 + gen/firebaseremoteconfig1-cli/README.md | 111 + gen/firebaseremoteconfig1-cli/mkdocs.yml | 18 + gen/firebaseremoteconfig1-cli/src/cmn.rs | 799 + gen/firebaseremoteconfig1-cli/src/main.rs | 454 + gen/firebaseremoteconfig1/Cargo.toml | 31 + gen/firebaseremoteconfig1/LICENSE.md | 30 + gen/firebaseremoteconfig1/README.md | 182 + gen/firebaseremoteconfig1/src/cmn.rs | 753 + gen/firebaseremoteconfig1/src/lib.rs | 1090 + gen/fitness1-cli/Cargo.toml | 4 +- gen/fitness1-cli/README.md | 3 +- gen/fitness1-cli/mkdocs.yml | 3 +- gen/fitness1-cli/src/main.rs | 94 +- gen/fitness1/Cargo.toml | 4 +- gen/fitness1/README.md | 42 +- gen/fitness1/src/lib.rs | 472 +- gen/games1-cli/Cargo.toml | 4 +- gen/games1-cli/README.md | 2 +- gen/games1-cli/mkdocs.yml | 2 +- gen/games1-cli/src/main.rs | 2 +- gen/games1/Cargo.toml | 4 +- gen/games1/README.md | 86 +- gen/games1/src/lib.rs | 2 +- .../Cargo.toml | 4 +- .../README.md | 2 +- .../mkdocs.yml | 2 +- .../src/main.rs | 2 +- .../Cargo.toml | 4 +- .../README.md | 54 +- .../src/lib.rs | 2 +- .../Cargo.toml | 4 +- gen/gamesmanagement1_management-cli/README.md | 2 +- .../mkdocs.yml | 2 +- .../src/main.rs | 2 +- gen/gamesmanagement1_management/Cargo.toml | 4 +- gen/gamesmanagement1_management/README.md | 58 +- gen/gamesmanagement1_management/src/lib.rs | 2 +- gen/genomics1-cli/Cargo.toml | 4 +- gen/genomics1-cli/README.md | 2 +- gen/genomics1-cli/mkdocs.yml | 2 +- gen/genomics1-cli/src/main.rs | 30 +- gen/genomics1/Cargo.toml | 4 +- gen/genomics1/README.md | 74 +- gen/genomics1/src/lib.rs | 1035 +- gen/gmail1-cli/Cargo.toml | 4 +- gen/gmail1-cli/README.md | 2 +- gen/gmail1-cli/mkdocs.yml | 2 +- gen/gmail1-cli/src/main.rs | 2 +- gen/gmail1/Cargo.toml | 4 +- gen/gmail1/README.md | 54 +- gen/gmail1/src/lib.rs | 4 +- gen/groupsmigration1-cli/Cargo.toml | 4 +- gen/groupsmigration1-cli/README.md | 2 +- gen/groupsmigration1-cli/mkdocs.yml | 2 +- gen/groupsmigration1-cli/src/main.rs | 2 +- gen/groupsmigration1/Cargo.toml | 4 +- gen/groupsmigration1/README.md | 44 +- gen/groupsmigration1/src/lib.rs | 2 +- gen/groupssettings1-cli/Cargo.toml | 4 +- gen/groupssettings1-cli/README.md | 2 +- gen/groupssettings1-cli/mkdocs.yml | 2 +- gen/groupssettings1-cli/src/main.rs | 2 +- gen/groupssettings1/Cargo.toml | 4 +- gen/groupssettings1/README.md | 42 +- gen/groupssettings1/src/lib.rs | 4 +- gen/iam1-cli/Cargo.toml | 4 +- gen/iam1-cli/README.md | 19 +- gen/iam1-cli/mkdocs.yml | 17 +- gen/iam1-cli/src/main.rs | 1584 +- gen/iam1/Cargo.toml | 4 +- gen/iam1/README.md | 79 +- gen/iam1/src/lib.rs | 8651 +- gen/identitytoolkit3-cli/Cargo.toml | 4 +- gen/identitytoolkit3-cli/README.md | 4 +- gen/identitytoolkit3-cli/mkdocs.yml | 4 +- gen/identitytoolkit3-cli/src/main.rs | 273 +- gen/identitytoolkit3/Cargo.toml | 4 +- gen/identitytoolkit3/README.md | 44 +- gen/identitytoolkit3/src/lib.rs | 1021 +- gen/logging2-cli/Cargo.toml | 4 +- gen/logging2-cli/README.md | 26 +- gen/logging2-cli/mkdocs.yml | 26 +- gen/logging2-cli/src/main.rs | 2686 +- gen/logging2/Cargo.toml | 4 +- gen/logging2/README.md | 69 +- gen/logging2/src/lib.rs | 12977 ++- gen/logging2_beta1-cli/Cargo.toml | 4 +- gen/logging2_beta1-cli/README.md | 2 +- gen/logging2_beta1-cli/mkdocs.yml | 2 +- gen/logging2_beta1-cli/src/main.rs | 61 +- gen/logging2_beta1/Cargo.toml | 4 +- gen/logging2_beta1/README.md | 52 +- gen/logging2_beta1/src/lib.rs | 1414 +- gen/manufacturers1-cli/Cargo.toml | 4 +- gen/manufacturers1-cli/README.md | 4 +- gen/manufacturers1-cli/mkdocs.yml | 4 +- gen/manufacturers1-cli/src/main.rs | 359 +- gen/manufacturers1/Cargo.toml | 4 +- gen/manufacturers1/README.md | 51 +- gen/manufacturers1/src/lib.rs | 765 +- gen/ml1-cli/Cargo.toml | 40 + gen/ml1-cli/LICENSE.md | 30 + gen/ml1-cli/README.md | 138 + gen/ml1-cli/mkdocs.yml | 41 + gen/ml1-cli/src/cmn.rs | 799 + gen/ml1-cli/src/main.rs | 2764 + gen/ml1/Cargo.toml | 31 + gen/ml1/LICENSE.md | 30 + gen/ml1/README.md | 183 + gen/ml1/src/cmn.rs | 753 + gen/ml1/src/lib.rs | 9311 ++ gen/monitoring3-cli/Cargo.toml | 4 +- gen/monitoring3-cli/README.md | 2 +- gen/monitoring3-cli/mkdocs.yml | 2 +- gen/monitoring3-cli/src/main.rs | 2 +- gen/monitoring3/Cargo.toml | 4 +- gen/monitoring3/README.md | 56 +- gen/monitoring3/src/lib.rs | 3746 +- gen/oslogin1_beta-cli/Cargo.toml | 40 + gen/oslogin1_beta-cli/LICENSE.md | 30 + gen/oslogin1_beta-cli/README.md | 118 + gen/oslogin1_beta-cli/mkdocs.yml | 21 + gen/oslogin1_beta-cli/src/cmn.rs | 799 + gen/oslogin1_beta-cli/src/main.rs | 729 + gen/oslogin1_beta/Cargo.toml | 31 + gen/oslogin1_beta/LICENSE.md | 30 + gen/oslogin1_beta/README.md | 183 + gen/oslogin1_beta/src/cmn.rs | 753 + gen/oslogin1_beta/src/lib.rs | 2011 + gen/partners2-cli/Cargo.toml | 4 +- gen/partners2-cli/README.md | 2 +- gen/partners2-cli/mkdocs.yml | 2 +- gen/partners2-cli/src/main.rs | 62 +- gen/partners2/Cargo.toml | 4 +- gen/partners2/README.md | 70 +- gen/partners2/src/lib.rs | 742 +- gen/people1-cli/Cargo.toml | 4 +- gen/people1-cli/README.md | 13 +- gen/people1-cli/mkdocs.yml | 12 +- gen/people1-cli/src/main.rs | 1096 +- gen/people1/Cargo.toml | 4 +- gen/people1/README.md | 58 +- gen/people1/src/lib.rs | 3930 +- gen/playcustomapp1-cli/Cargo.toml | 40 + gen/playcustomapp1-cli/LICENSE.md | 30 + gen/playcustomapp1-cli/README.md | 114 + gen/playcustomapp1-cli/mkdocs.yml | 17 + gen/playcustomapp1-cli/src/cmn.rs | 799 + gen/playcustomapp1-cli/src/main.rs | 383 + gen/playcustomapp1/Cargo.toml | 31 + gen/playcustomapp1/LICENSE.md | 30 + gen/playcustomapp1/README.md | 185 + gen/playcustomapp1/src/cmn.rs | 753 + gen/playcustomapp1/src/lib.rs | 852 + gen/playmoviespartner1-cli/Cargo.toml | 4 +- gen/playmoviespartner1-cli/README.md | 2 +- gen/playmoviespartner1-cli/mkdocs.yml | 2 +- gen/playmoviespartner1-cli/src/main.rs | 2 +- gen/playmoviespartner1/Cargo.toml | 4 +- gen/playmoviespartner1/README.md | 42 +- gen/playmoviespartner1/src/lib.rs | 60 +- gen/plus1-cli/Cargo.toml | 4 +- gen/plus1-cli/README.md | 2 +- gen/plus1-cli/mkdocs.yml | 2 +- gen/plus1-cli/src/main.rs | 2 +- gen/plus1/Cargo.toml | 4 +- gen/plus1/README.md | 50 +- gen/plus1/src/lib.rs | 2 +- gen/plusdomains1-cli/Cargo.toml | 4 +- gen/plusdomains1-cli/README.md | 2 +- gen/plusdomains1-cli/mkdocs.yml | 2 +- gen/plusdomains1-cli/src/main.rs | 2 +- gen/plusdomains1/Cargo.toml | 4 +- gen/plusdomains1/README.md | 64 +- gen/plusdomains1/src/lib.rs | 2 +- gen/proximitybeacon1_beta1-cli/Cargo.toml | 4 +- gen/proximitybeacon1_beta1-cli/README.md | 2 +- gen/proximitybeacon1_beta1-cli/mkdocs.yml | 2 +- gen/proximitybeacon1_beta1-cli/src/main.rs | 12 +- gen/proximitybeacon1_beta1/Cargo.toml | 4 +- gen/proximitybeacon1_beta1/README.md | 52 +- gen/proximitybeacon1_beta1/src/lib.rs | 40 +- gen/pubsub1-cli/Cargo.toml | 4 +- gen/pubsub1-cli/README.md | 2 +- gen/pubsub1-cli/mkdocs.yml | 2 +- gen/pubsub1-cli/src/main.rs | 8 +- gen/pubsub1/Cargo.toml | 4 +- gen/pubsub1/README.md | 42 +- gen/pubsub1/src/lib.rs | 224 +- gen/pubsub1_beta2-cli/Cargo.toml | 4 +- gen/pubsub1_beta2-cli/README.md | 2 +- gen/pubsub1_beta2-cli/mkdocs.yml | 2 +- gen/pubsub1_beta2-cli/src/main.rs | 8 +- gen/pubsub1_beta2/Cargo.toml | 4 +- gen/pubsub1_beta2/README.md | 42 +- gen/pubsub1_beta2/src/lib.rs | 22 +- gen/safebrowsing4-cli/Cargo.toml | 4 +- gen/safebrowsing4-cli/README.md | 2 +- gen/safebrowsing4-cli/mkdocs.yml | 2 +- gen/safebrowsing4-cli/src/main.rs | 12 +- gen/safebrowsing4/Cargo.toml | 4 +- gen/safebrowsing4/README.md | 52 +- gen/safebrowsing4/src/lib.rs | 76 +- gen/searchconsole1-cli/Cargo.toml | 4 +- gen/searchconsole1-cli/README.md | 2 +- gen/searchconsole1-cli/mkdocs.yml | 2 +- gen/searchconsole1-cli/src/main.rs | 2 +- gen/searchconsole1/Cargo.toml | 4 +- gen/searchconsole1/README.md | 42 +- gen/searchconsole1/src/lib.rs | 2 +- gen/serviceuser1-cli/Cargo.toml | 40 + gen/serviceuser1-cli/LICENSE.md | 30 + gen/serviceuser1-cli/README.md | 118 + gen/serviceuser1-cli/mkdocs.yml | 20 + gen/serviceuser1-cli/src/cmn.rs | 799 + gen/serviceuser1-cli/src/main.rs | 675 + gen/serviceuser1/Cargo.toml | 31 + gen/serviceuser1/LICENSE.md | 30 + gen/serviceuser1/README.md | 183 + gen/serviceuser1/src/cmn.rs | 753 + gen/serviceuser1/src/lib.rs | 4212 + gen/sourcerepo1-cli/Cargo.toml | 40 + gen/sourcerepo1-cli/LICENSE.md | 30 + gen/sourcerepo1-cli/README.md | 120 + gen/sourcerepo1-cli/mkdocs.yml | 23 + gen/sourcerepo1-cli/src/cmn.rs | 799 + gen/sourcerepo1-cli/src/main.rs | 935 + gen/sourcerepo1/Cargo.toml | 31 + gen/sourcerepo1/LICENSE.md | 30 + gen/sourcerepo1/README.md | 181 + gen/sourcerepo1/src/cmn.rs | 753 + gen/sourcerepo1/src/lib.rs | 2904 + gen/spanner1-cli/Cargo.toml | 40 + gen/spanner1-cli/LICENSE.md | 30 + gen/spanner1-cli/README.md | 151 + gen/spanner1-cli/mkdocs.yml | 54 + gen/spanner1-cli/src/cmn.rs | 799 + gen/spanner1-cli/src/main.rs | 4273 + gen/spanner1/Cargo.toml | 31 + gen/spanner1/LICENSE.md | 30 + gen/spanner1/README.md | 187 + gen/spanner1/src/cmn.rs | 753 + gen/spanner1/src/lib.rs | 13963 +++ gen/sqladmin1_beta4-cli/Cargo.toml | 4 +- gen/sqladmin1_beta4-cli/README.md | 2 +- gen/sqladmin1_beta4-cli/mkdocs.yml | 2 +- gen/sqladmin1_beta4-cli/src/main.rs | 23 +- gen/sqladmin1_beta4/Cargo.toml | 4 +- gen/sqladmin1_beta4/README.md | 70 +- gen/sqladmin1_beta4/src/lib.rs | 44 +- gen/storage1-cli/Cargo.toml | 4 +- gen/storage1-cli/README.md | 2 +- gen/storage1-cli/mkdocs.yml | 2 +- gen/storage1-cli/src/main.rs | 74 +- gen/storage1/Cargo.toml | 4 +- gen/storage1/README.md | 85 +- gen/storage1/src/lib.rs | 630 +- gen/storagetransfer1-cli/Cargo.toml | 4 +- gen/storagetransfer1-cli/README.md | 2 +- gen/storagetransfer1-cli/mkdocs.yml | 2 +- gen/storagetransfer1-cli/src/main.rs | 15 +- gen/storagetransfer1/Cargo.toml | 4 +- gen/storagetransfer1/README.md | 52 +- gen/storagetransfer1/src/lib.rs | 167 +- gen/streetviewpublish1-cli/Cargo.toml | 40 + gen/streetviewpublish1-cli/LICENSE.md | 30 + gen/streetviewpublish1-cli/README.md | 123 + gen/streetviewpublish1-cli/mkdocs.yml | 25 + gen/streetviewpublish1-cli/src/cmn.rs | 799 + gen/streetviewpublish1-cli/src/main.rs | 1285 + gen/streetviewpublish1/Cargo.toml | 31 + gen/streetviewpublish1/LICENSE.md | 30 + gen/streetviewpublish1/README.md | 186 + gen/streetviewpublish1/src/cmn.rs | 753 + gen/streetviewpublish1/src/lib.rs | 3716 + gen/tagmanager2-cli/Cargo.toml | 40 + gen/tagmanager2-cli/LICENSE.md | 30 + gen/tagmanager2-cli/README.md | 186 + gen/tagmanager2-cli/mkdocs.yml | 89 + gen/tagmanager2-cli/src/cmn.rs | 799 + gen/tagmanager2-cli/src/main.rs | 7229 ++ gen/tagmanager2/Cargo.toml | 31 + gen/tagmanager2/LICENSE.md | 30 + gen/tagmanager2/README.md | 255 + gen/tagmanager2/src/cmn.rs | 753 + gen/tagmanager2/src/lib.rs | 22473 +++++ gen/testing1-cli/Cargo.toml | 40 + gen/testing1-cli/LICENSE.md | 30 + gen/testing1-cli/README.md | 118 + gen/testing1-cli/mkdocs.yml | 20 + gen/testing1-cli/src/cmn.rs | 799 + gen/testing1-cli/src/main.rs | 692 + gen/testing1/Cargo.toml | 31 + gen/testing1/LICENSE.md | 30 + gen/testing1/README.md | 184 + gen/testing1/src/cmn.rs | 753 + gen/testing1/src/lib.rs | 2750 + gen/translate2-cli/Cargo.toml | 8 +- gen/translate2-cli/README.md | 14 +- gen/translate2-cli/mkdocs.yml | 6 +- gen/translate2-cli/src/main.rs | 280 +- gen/translate2/Cargo.toml | 8 +- gen/translate2/README.md | 61 +- gen/translate2/src/lib.rs | 1032 +- gen/vault1-cli/Cargo.toml | 40 + gen/vault1-cli/LICENSE.md | 30 + gen/vault1-cli/README.md | 131 + gen/vault1-cli/mkdocs.yml | 34 + gen/vault1-cli/src/cmn.rs | 799 + gen/vault1-cli/src/main.rs | 2123 + gen/vault1/Cargo.toml | 31 + gen/vault1/LICENSE.md | 30 + gen/vault1/README.md | 195 + gen/vault1/src/cmn.rs | 753 + gen/vault1/src/lib.rs | 6150 ++ gen/videointelligence1_beta1-cli/Cargo.toml | 40 + gen/videointelligence1_beta1-cli/LICENSE.md | 30 + gen/videointelligence1_beta1-cli/README.md | 114 + gen/videointelligence1_beta1-cli/mkdocs.yml | 17 + gen/videointelligence1_beta1-cli/src/cmn.rs | 799 + gen/videointelligence1_beta1-cli/src/main.rs | 370 + gen/videointelligence1_beta1/Cargo.toml | 31 + gen/videointelligence1_beta1/LICENSE.md | 30 + gen/videointelligence1_beta1/README.md | 180 + gen/videointelligence1_beta1/src/cmn.rs | 753 + gen/videointelligence1_beta1/src/lib.rs | 902 + gen/webmasters3-cli/Cargo.toml | 4 +- gen/webmasters3-cli/README.md | 2 +- gen/webmasters3-cli/mkdocs.yml | 2 +- gen/webmasters3-cli/src/main.rs | 2 +- gen/webmasters3/Cargo.toml | 4 +- gen/webmasters3/README.md | 50 +- gen/webmasters3/src/lib.rs | 2 +- gen/youtube3-cli/Cargo.toml | 4 +- gen/youtube3-cli/README.md | 2 +- gen/youtube3-cli/mkdocs.yml | 2 +- gen/youtube3-cli/src/main.rs | 55 +- gen/youtube3/Cargo.toml | 4 +- gen/youtube3/README.md | 158 +- gen/youtube3/src/lib.rs | 319 +- gen/youtubeanalytics1-cli/Cargo.toml | 4 +- gen/youtubeanalytics1-cli/README.md | 2 +- gen/youtubeanalytics1-cli/mkdocs.yml | 2 +- gen/youtubeanalytics1-cli/src/main.rs | 2 +- gen/youtubeanalytics1/Cargo.toml | 4 +- gen/youtubeanalytics1/README.md | 50 +- gen/youtubeanalytics1/src/lib.rs | 2 +- gen/youtubereporting1-cli/Cargo.toml | 4 +- gen/youtubereporting1-cli/README.md | 2 +- gen/youtubereporting1-cli/mkdocs.yml | 2 +- gen/youtubereporting1-cli/src/main.rs | 2 +- gen/youtubereporting1/Cargo.toml | 4 +- gen/youtubereporting1/README.md | 54 +- gen/youtubereporting1/src/lib.rs | 40 +- 1024 files changed, 515705 insertions(+), 77998 deletions(-) rename etc/api/{datastore/v1beta2/datastore-api.json => adexchangebuyer/v1.3/crates/1.0.6-api+20170810} (100%) rename etc/api/{freebase/v1/freebase-api.json => adexchangebuyer/v1.3/crates/1.0.6-cli+20170810} (100%) create mode 100644 etc/api/adexchangebuyer/v1.4/crates/1.0.6-api+20170810 create mode 100644 etc/api/adexchangebuyer/v1.4/crates/1.0.6-cli+20170810 create mode 100644 etc/api/adexperiencereport/v1/adexperiencereport-api.json create mode 100644 etc/api/adexperiencereport/v1/crates/1.0.6-api+20170918 create mode 100644 etc/api/adexperiencereport/v1/crates/1.0.6-cli+20170918 create mode 100644 etc/api/admin/directory_v1/crates/1.0.6-api+20170830 create mode 100644 etc/api/admin/reports_v1/crates/1.0.6-api+20170622 create mode 100644 etc/api/admin/reports_v1/crates/1.0.6-cli+20170622 create mode 100644 etc/api/adsense/v1.4/crates/1.0.6-api+20170925 create mode 100644 etc/api/adsense/v1.4/crates/1.0.6-cli+20170925 create mode 100644 etc/api/adsensehost/v4.1/crates/1.0.6-api+20170925 create mode 100644 etc/api/adsensehost/v4.1/crates/1.0.6-cli+20170925 create mode 100644 etc/api/analytics/v3/crates/1.0.6-api+20170807 create mode 100644 etc/api/analytics/v3/crates/1.0.6-cli+20170807 create mode 100644 etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json create mode 100644 etc/api/androiddeviceprovisioning/v1/crates/1.0.6-api+20170923 create mode 100644 etc/api/androiddeviceprovisioning/v1/crates/1.0.6-cli+20170923 create mode 100644 etc/api/androidenterprise/v1/crates/1.0.6-api+20170922 create mode 100644 etc/api/androidmanagement/v1/androidmanagement-api.json create mode 100644 etc/api/androidmanagement/v1/crates/1.0.6-api+20170918 create mode 100644 etc/api/androidmanagement/v1/crates/1.0.6-cli+20170918 create mode 100644 etc/api/androidpublisher/v2/crates/1.0.6-api+20170913 create mode 100644 etc/api/androidpublisher/v2/crates/1.0.6-cli+20170913 create mode 100644 etc/api/appengine/v1/crates/1.0.6-api+20170914 create mode 100644 etc/api/appengine/v1alpha/appengine-api.json create mode 100644 etc/api/appengine/v1beta/appengine-api.json create mode 100644 etc/api/appengine/v1beta4/crates/1.0.6-api+20170914 create mode 100644 etc/api/appengine/v1beta4/crates/1.0.6-cli+20170914 create mode 100644 etc/api/appengine/v1beta5/crates/1.0.6-api+20170914 create mode 100644 etc/api/appengine/v1beta5/crates/1.0.6-cli+20170914 create mode 100644 etc/api/appsactivity/v1/crates/1.0.6-api+20170921 create mode 100644 etc/api/appsactivity/v1/crates/1.0.6-cli+20170921 create mode 100644 etc/api/appstate/v1/crates/1.0.6-api+20170925 create mode 100644 etc/api/appstate/v1/crates/1.0.6-cli+20170925 create mode 100644 etc/api/bigquery/v2/crates/1.0.6-api+20170917 create mode 100644 etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json create mode 100644 etc/api/bigquerydatatransfer/v1/crates/1.0.6-api+20170921 create mode 100644 etc/api/bigquerydatatransfer/v1/crates/1.0.6-cli+20170921 create mode 100644 etc/api/calendar/v3/crates/1.0.6-api+20170919 create mode 100644 etc/api/calendar/v3/crates/1.0.6-cli+20170919 create mode 100644 etc/api/classroom/v1/crates/1.0.6-api+20170926 create mode 100644 etc/api/cloudbilling/v1/crates/1.0.6-api+20170813 create mode 100644 etc/api/clouddebugger/v2/crates/1.0.6-api+20170919 create mode 100644 etc/api/clouddebugger/v2/crates/1.0.6-cli+20170919 create mode 100644 etc/api/cloudfunctions/v1/cloudfunctions-api.json create mode 100644 etc/api/cloudfunctions/v1/crates/1.0.6-api+20170920 create mode 100644 etc/api/cloudfunctions/v1/crates/1.0.6-cli+20170920 create mode 100644 etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json create mode 100644 etc/api/cloudkms/v1/cloudkms-api.json create mode 100644 etc/api/cloudkms/v1/crates/1.0.6-api+20170919 create mode 100644 etc/api/cloudkms/v1/crates/1.0.6-cli+20170919 create mode 100644 etc/api/cloudresourcemanager/v1/crates/1.0.6-api+20170920 create mode 100644 etc/api/cloudresourcemanager/v1/crates/1.0.6-cli+20170920 create mode 100644 etc/api/cloudresourcemanager/v1beta1/crates/1.0.6-api+20170920 create mode 100644 etc/api/cloudresourcemanager/v1beta1/crates/1.0.6-cli+20170920 create mode 100644 etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json create mode 100644 etc/api/cloudtasks/v2beta2/cloudtasks-api.json create mode 100644 etc/api/cloudtasks/v2beta2/crates/1.0.6-api+20170926 create mode 100644 etc/api/cloudtasks/v2beta2/crates/1.0.6-cli+20170926 create mode 100644 etc/api/cloudtrace/v2/cloudtrace-api.json create mode 100644 etc/api/container/v1/crates/1.0.6-api+20170915 create mode 100644 etc/api/container/v1beta1/container-api.json create mode 100644 etc/api/content/v2/crates/1.0.6-api+20170926 create mode 100644 etc/api/content/v2sandbox/crates/1.0.6-api+20170926 create mode 100644 etc/api/content/v2sandbox/crates/1.0.6-cli+20170926 create mode 100644 etc/api/customsearch/v1/crates/1.0.6-api+20170615 create mode 100644 etc/api/customsearch/v1/crates/1.0.6-cli+20170615 create mode 100644 etc/api/dataproc/v1/crates/1.0.6-api+20170919 create mode 100644 etc/api/dataproc/v1/crates/1.0.6-cli+20170919 create mode 100644 etc/api/dataproc/v1beta2/dataproc-api.json create mode 100644 etc/api/deploymentmanager/alpha/deploymentmanager-api.json create mode 100644 etc/api/deploymentmanager/v2/crates/1.0.6-api+20170925 create mode 100644 etc/api/deploymentmanager/v2/crates/1.0.6-cli+20170925 create mode 100644 etc/api/deploymentmanager/v2beta/deploymentmanager-api.json create mode 100644 etc/api/dfareporting/v2.7/crates/1.0.6-api+20170818 create mode 100644 etc/api/dfareporting/v2.7/crates/1.0.6-cli+20170818 create mode 100644 etc/api/dfareporting/v2.8/crates/1.0.6-api+20170818 create mode 100644 etc/api/dfareporting/v2.8/crates/1.0.6-cli+20170818 create mode 100644 etc/api/dfareporting/v2.8/dfareporting-api.json create mode 100644 etc/api/dlp/v2beta1/crates/1.0.6-api+20170918 create mode 100644 etc/api/dlp/v2beta1/crates/1.0.6-cli+20170918 create mode 100644 etc/api/dlp/v2beta1/dlp-api.json create mode 100644 etc/api/dns/v1/crates/1.0.6-api+20170921 create mode 100644 etc/api/dns/v1/crates/1.0.6-cli+20170921 create mode 100644 etc/api/doubleclickbidmanager/v1/crates/1.0.6-api+20170705 create mode 100644 etc/api/doubleclickbidmanager/v1/crates/1.0.6-cli+20170705 create mode 100644 etc/api/doubleclicksearch/v2/crates/1.0.6-api+20170919 create mode 100644 etc/api/doubleclicksearch/v2/crates/1.0.6-cli+20170919 create mode 100644 etc/api/drive/v2/crates/1.0.6-api+20170915 create mode 100644 etc/api/drive/v2/crates/1.0.6-cli+20170915 create mode 100644 etc/api/drive/v3/crates/1.0.6-api+20170915 create mode 100644 etc/api/drive/v3/crates/1.0.6-cli+20170915 create mode 100644 etc/api/firebasedynamiclinks/v1/crates/1.0.6-api+20170926 create mode 100644 etc/api/firebaseremoteconfig/v1/crates/1.0.6-api+20170912 create mode 100644 etc/api/firebaseremoteconfig/v1/crates/1.0.6-cli+20170912 create mode 100644 etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json create mode 100644 etc/api/fitness/v1/crates/1.0.6-api+20170830 create mode 100644 etc/api/games/v1/crates/1.0.6-api+20170925 create mode 100644 etc/api/games/v1/crates/1.0.6-cli+20170925 create mode 100644 etc/api/gamesconfiguration/v1configuration/crates/1.0.6-api+20170925 create mode 100644 etc/api/gamesconfiguration/v1configuration/crates/1.0.6-cli+20170925 create mode 100644 etc/api/gamesmanagement/v1management/crates/1.0.6-api+20170925 create mode 100644 etc/api/gamesmanagement/v1management/crates/1.0.6-cli+20170925 create mode 100644 etc/api/genomics/v1/crates/1.0.6-api+20170925 create mode 100644 etc/api/genomics/v1/crates/1.0.6-cli+20170925 create mode 100644 etc/api/gmail/v1/crates/1.0.6-api+20170913 create mode 100644 etc/api/gmail/v1/crates/1.0.6-cli+20170913 create mode 100644 etc/api/groupsmigration/v1/crates/1.0.6-api+20170607 create mode 100644 etc/api/groupsmigration/v1/crates/1.0.6-cli+20170607 create mode 100644 etc/api/groupssettings/v1/crates/1.0.6-api+20170607 create mode 100644 etc/api/groupssettings/v1/crates/1.0.6-cli+20170607 create mode 100644 etc/api/iam/v1/crates/1.0.6-api+20170919 create mode 100644 etc/api/identitytoolkit/v3/crates/1.0.6-api+20170828 create mode 100644 etc/api/language/v1beta2/language-api.json create mode 100644 etc/api/logging/v2/crates/1.0.6-api+20170918 create mode 100644 etc/api/logging/v2beta1/crates/1.0.6-api+20170918 create mode 100644 etc/api/manufacturers/v1/crates/1.0.6-api+20170808 create mode 100644 etc/api/ml/v1/crates/1.0.6-api+20170926 create mode 100644 etc/api/ml/v1/crates/1.0.6-cli+20170926 rename etc/api/ml/{v1beta1 => v1}/ml-api.json (66%) create mode 100644 etc/api/monitoring/v3/crates/1.0.6-api+20170918 create mode 100644 etc/api/monitoring/v3/crates/1.0.6-cli+20170918 create mode 100644 etc/api/oslogin/v1alpha/oslogin-api.json create mode 100644 etc/api/oslogin/v1beta/crates/1.0.6-api+20170926 create mode 100644 etc/api/oslogin/v1beta/crates/1.0.6-cli+20170926 create mode 100644 etc/api/oslogin/v1beta/oslogin-api.json create mode 100644 etc/api/partners/v2/crates/1.0.6-api+20170912 create mode 100644 etc/api/partners/v2/crates/1.0.6-cli+20170912 create mode 100644 etc/api/people/v1/crates/1.0.6-api+20170925 create mode 100644 etc/api/playcustomapp/v1/crates/1.0.6-api+20170622 create mode 100644 etc/api/playcustomapp/v1/crates/1.0.6-cli+20170622 create mode 100644 etc/api/playcustomapp/v1/playcustomapp-api.json create mode 100644 etc/api/playmoviespartner/v1/crates/1.0.6-api+20170919 create mode 100644 etc/api/playmoviespartner/v1/crates/1.0.6-cli+20170919 create mode 100644 etc/api/plus/v1/crates/1.0.6-api+20170828 create mode 100644 etc/api/plus/v1/crates/1.0.6-cli+20170828 create mode 100644 etc/api/plusdomains/v1/crates/1.0.6-api+20170828 create mode 100644 etc/api/plusdomains/v1/crates/1.0.6-cli+20170828 create mode 100644 etc/api/proximitybeacon/v1beta1/crates/1.0.6-api+20170913 create mode 100644 etc/api/proximitybeacon/v1beta1/crates/1.0.6-cli+20170913 create mode 100644 etc/api/pubsub/v1/crates/1.0.6-api+20170829 create mode 100644 etc/api/pubsub/v1/crates/1.0.6-cli+20170829 create mode 100644 etc/api/pubsub/v1beta2/crates/1.0.6-api+20170829 create mode 100644 etc/api/pubsub/v1beta2/crates/1.0.6-cli+20170829 create mode 100644 etc/api/safebrowsing/v4/crates/1.0.6-api+20170921 create mode 100644 etc/api/safebrowsing/v4/crates/1.0.6-cli+20170921 create mode 100644 etc/api/searchconsole/v1/crates/1.0.6-api+20170926 create mode 100644 etc/api/searchconsole/v1/crates/1.0.6-cli+20170926 create mode 100644 etc/api/serviceuser/v1/serviceuser-api.json create mode 100644 etc/api/sourcerepo/v1/crates/1.0.6-api+20170908 create mode 100644 etc/api/sourcerepo/v1/crates/1.0.6-cli+20170908 create mode 100644 etc/api/sourcerepo/v1/sourcerepo-api.json create mode 100644 etc/api/spanner/v1/crates/1.0.6-api+20170914 create mode 100644 etc/api/spanner/v1/crates/1.0.6-cli+20170914 create mode 100644 etc/api/spanner/v1/spanner-api.json create mode 100644 etc/api/speech/v1/speech-api.json create mode 100644 etc/api/sqladmin/v1beta4/crates/1.0.6-api+20170807 create mode 100644 etc/api/sqladmin/v1beta4/crates/1.0.6-cli+20170807 create mode 100644 etc/api/storage/v1/crates/1.0.6-api+20170915 create mode 100644 etc/api/storagetransfer/v1/crates/1.0.6-api+20170921 create mode 100644 etc/api/storagetransfer/v1/crates/1.0.6-cli+20170921 create mode 100644 etc/api/streetviewpublish/v1/streetviewpublish-api.json create mode 100644 etc/api/tagmanager/v2/crates/1.0.6-api+20170915 create mode 100644 etc/api/tagmanager/v2/crates/1.0.6-cli+20170915 create mode 100644 etc/api/tagmanager/v2/tagmanager-api.json create mode 100644 etc/api/testing/v1/crates/1.0.6-api+20170922 create mode 100644 etc/api/testing/v1/crates/1.0.6-cli+20170922 create mode 100644 etc/api/testing/v1/testing-api.json create mode 100644 etc/api/translate/v2/crates/1.0.6-api+20170525 create mode 100644 etc/api/vault/v1/crates/1.0.6-api+20170812 create mode 100644 etc/api/vault/v1/crates/1.0.6-cli+20170812 create mode 100644 etc/api/vault/v1/vault-api.json create mode 100644 etc/api/videointelligence/v1beta1/crates/1.0.6-api+20170923 create mode 100644 etc/api/videointelligence/v1beta1/crates/1.0.6-cli+20170923 create mode 100644 etc/api/videointelligence/v1beta1/videointelligence-api.json create mode 100644 etc/api/webmasters/v3/crates/1.0.6-api+20170528 create mode 100644 etc/api/webmasters/v3/crates/1.0.6-cli+20170528 create mode 100644 etc/api/youtube/v3/crates/1.0.6-api+20170918 create mode 100644 etc/api/youtubeanalytics/v1/crates/1.0.6-api+20170925 create mode 100644 etc/api/youtubeanalytics/v1/crates/1.0.6-cli+20170925 create mode 100644 etc/api/youtubereporting/v1/crates/1.0.6-api+20170926 create mode 100644 etc/api/youtubereporting/v1/crates/1.0.6-cli+20170926 create mode 100644 gen/adexperiencereport1-cli/Cargo.toml create mode 100644 gen/adexperiencereport1-cli/LICENSE.md create mode 100644 gen/adexperiencereport1-cli/README.md create mode 100644 gen/adexperiencereport1-cli/mkdocs.yml create mode 100644 gen/adexperiencereport1-cli/src/cmn.rs create mode 100644 gen/adexperiencereport1-cli/src/main.rs create mode 100644 gen/adexperiencereport1/Cargo.toml create mode 100644 gen/adexperiencereport1/LICENSE.md create mode 100644 gen/adexperiencereport1/README.md create mode 100644 gen/adexperiencereport1/src/cmn.rs create mode 100644 gen/adexperiencereport1/src/lib.rs create mode 100644 gen/androiddeviceprovisioning1-cli/Cargo.toml create mode 100644 gen/androiddeviceprovisioning1-cli/LICENSE.md create mode 100644 gen/androiddeviceprovisioning1-cli/README.md create mode 100644 gen/androiddeviceprovisioning1-cli/mkdocs.yml create mode 100644 gen/androiddeviceprovisioning1-cli/src/cmn.rs create mode 100644 gen/androiddeviceprovisioning1-cli/src/main.rs create mode 100644 gen/androiddeviceprovisioning1/Cargo.toml create mode 100644 gen/androiddeviceprovisioning1/LICENSE.md create mode 100644 gen/androiddeviceprovisioning1/README.md create mode 100644 gen/androiddeviceprovisioning1/src/cmn.rs create mode 100644 gen/androiddeviceprovisioning1/src/lib.rs create mode 100644 gen/androidmanagement1-cli/Cargo.toml create mode 100644 gen/androidmanagement1-cli/LICENSE.md create mode 100644 gen/androidmanagement1-cli/README.md create mode 100644 gen/androidmanagement1-cli/mkdocs.yml create mode 100644 gen/androidmanagement1-cli/src/cmn.rs create mode 100644 gen/androidmanagement1-cli/src/main.rs create mode 100644 gen/androidmanagement1/Cargo.toml create mode 100644 gen/androidmanagement1/LICENSE.md create mode 100644 gen/androidmanagement1/README.md create mode 100644 gen/androidmanagement1/src/cmn.rs create mode 100644 gen/androidmanagement1/src/lib.rs create mode 100644 gen/bigquerydatatransfer1-cli/Cargo.toml create mode 100644 gen/bigquerydatatransfer1-cli/LICENSE.md create mode 100644 gen/bigquerydatatransfer1-cli/README.md create mode 100644 gen/bigquerydatatransfer1-cli/mkdocs.yml create mode 100644 gen/bigquerydatatransfer1-cli/src/cmn.rs create mode 100644 gen/bigquerydatatransfer1-cli/src/main.rs create mode 100644 gen/bigquerydatatransfer1/Cargo.toml create mode 100644 gen/bigquerydatatransfer1/LICENSE.md create mode 100644 gen/bigquerydatatransfer1/README.md create mode 100644 gen/bigquerydatatransfer1/src/cmn.rs create mode 100644 gen/bigquerydatatransfer1/src/lib.rs create mode 100644 gen/cloudfunctions1-cli/Cargo.toml create mode 100644 gen/cloudfunctions1-cli/LICENSE.md create mode 100644 gen/cloudfunctions1-cli/README.md create mode 100644 gen/cloudfunctions1-cli/mkdocs.yml create mode 100644 gen/cloudfunctions1-cli/src/cmn.rs create mode 100644 gen/cloudfunctions1-cli/src/main.rs create mode 100644 gen/cloudfunctions1/Cargo.toml create mode 100644 gen/cloudfunctions1/LICENSE.md create mode 100644 gen/cloudfunctions1/README.md create mode 100644 gen/cloudfunctions1/src/cmn.rs create mode 100644 gen/cloudfunctions1/src/lib.rs create mode 100644 gen/cloudkms1-cli/Cargo.toml create mode 100644 gen/cloudkms1-cli/LICENSE.md create mode 100644 gen/cloudkms1-cli/README.md create mode 100644 gen/cloudkms1-cli/mkdocs.yml create mode 100644 gen/cloudkms1-cli/src/cmn.rs create mode 100644 gen/cloudkms1-cli/src/main.rs create mode 100644 gen/cloudkms1/Cargo.toml create mode 100644 gen/cloudkms1/LICENSE.md create mode 100644 gen/cloudkms1/README.md create mode 100644 gen/cloudkms1/src/cmn.rs create mode 100644 gen/cloudkms1/src/lib.rs create mode 100644 gen/cloudtasks2_beta2-cli/Cargo.toml create mode 100644 gen/cloudtasks2_beta2-cli/LICENSE.md create mode 100644 gen/cloudtasks2_beta2-cli/README.md create mode 100644 gen/cloudtasks2_beta2-cli/mkdocs.yml create mode 100644 gen/cloudtasks2_beta2-cli/src/cmn.rs create mode 100644 gen/cloudtasks2_beta2-cli/src/main.rs create mode 100644 gen/cloudtasks2_beta2/Cargo.toml create mode 100644 gen/cloudtasks2_beta2/LICENSE.md create mode 100644 gen/cloudtasks2_beta2/README.md create mode 100644 gen/cloudtasks2_beta2/src/cmn.rs create mode 100644 gen/cloudtasks2_beta2/src/lib.rs create mode 100644 gen/dfareporting2d8-cli/Cargo.toml create mode 100644 gen/dfareporting2d8-cli/LICENSE.md create mode 100644 gen/dfareporting2d8-cli/README.md create mode 100644 gen/dfareporting2d8-cli/mkdocs.yml create mode 100644 gen/dfareporting2d8-cli/src/cmn.rs create mode 100644 gen/dfareporting2d8-cli/src/main.rs create mode 100644 gen/dfareporting2d8/Cargo.toml create mode 100644 gen/dfareporting2d8/LICENSE.md create mode 100644 gen/dfareporting2d8/README.md create mode 100644 gen/dfareporting2d8/src/cmn.rs create mode 100644 gen/dfareporting2d8/src/lib.rs create mode 100644 gen/dlp2_beta1-cli/Cargo.toml create mode 100644 gen/dlp2_beta1-cli/LICENSE.md create mode 100644 gen/dlp2_beta1-cli/README.md create mode 100644 gen/dlp2_beta1-cli/mkdocs.yml create mode 100644 gen/dlp2_beta1-cli/src/cmn.rs create mode 100644 gen/dlp2_beta1-cli/src/main.rs create mode 100644 gen/dlp2_beta1/Cargo.toml create mode 100644 gen/dlp2_beta1/LICENSE.md create mode 100644 gen/dlp2_beta1/README.md create mode 100644 gen/dlp2_beta1/src/cmn.rs create mode 100644 gen/dlp2_beta1/src/lib.rs create mode 100644 gen/firebaseremoteconfig1-cli/Cargo.toml create mode 100644 gen/firebaseremoteconfig1-cli/LICENSE.md create mode 100644 gen/firebaseremoteconfig1-cli/README.md create mode 100644 gen/firebaseremoteconfig1-cli/mkdocs.yml create mode 100644 gen/firebaseremoteconfig1-cli/src/cmn.rs create mode 100644 gen/firebaseremoteconfig1-cli/src/main.rs create mode 100644 gen/firebaseremoteconfig1/Cargo.toml create mode 100644 gen/firebaseremoteconfig1/LICENSE.md create mode 100644 gen/firebaseremoteconfig1/README.md create mode 100644 gen/firebaseremoteconfig1/src/cmn.rs create mode 100644 gen/firebaseremoteconfig1/src/lib.rs create mode 100644 gen/ml1-cli/Cargo.toml create mode 100644 gen/ml1-cli/LICENSE.md create mode 100644 gen/ml1-cli/README.md create mode 100644 gen/ml1-cli/mkdocs.yml create mode 100644 gen/ml1-cli/src/cmn.rs create mode 100644 gen/ml1-cli/src/main.rs create mode 100644 gen/ml1/Cargo.toml create mode 100644 gen/ml1/LICENSE.md create mode 100644 gen/ml1/README.md create mode 100644 gen/ml1/src/cmn.rs create mode 100644 gen/ml1/src/lib.rs create mode 100644 gen/oslogin1_beta-cli/Cargo.toml create mode 100644 gen/oslogin1_beta-cli/LICENSE.md create mode 100644 gen/oslogin1_beta-cli/README.md create mode 100644 gen/oslogin1_beta-cli/mkdocs.yml create mode 100644 gen/oslogin1_beta-cli/src/cmn.rs create mode 100644 gen/oslogin1_beta-cli/src/main.rs create mode 100644 gen/oslogin1_beta/Cargo.toml create mode 100644 gen/oslogin1_beta/LICENSE.md create mode 100644 gen/oslogin1_beta/README.md create mode 100644 gen/oslogin1_beta/src/cmn.rs create mode 100644 gen/oslogin1_beta/src/lib.rs create mode 100644 gen/playcustomapp1-cli/Cargo.toml create mode 100644 gen/playcustomapp1-cli/LICENSE.md create mode 100644 gen/playcustomapp1-cli/README.md create mode 100644 gen/playcustomapp1-cli/mkdocs.yml create mode 100644 gen/playcustomapp1-cli/src/cmn.rs create mode 100644 gen/playcustomapp1-cli/src/main.rs create mode 100644 gen/playcustomapp1/Cargo.toml create mode 100644 gen/playcustomapp1/LICENSE.md create mode 100644 gen/playcustomapp1/README.md create mode 100644 gen/playcustomapp1/src/cmn.rs create mode 100644 gen/playcustomapp1/src/lib.rs create mode 100644 gen/serviceuser1-cli/Cargo.toml create mode 100644 gen/serviceuser1-cli/LICENSE.md create mode 100644 gen/serviceuser1-cli/README.md create mode 100644 gen/serviceuser1-cli/mkdocs.yml create mode 100644 gen/serviceuser1-cli/src/cmn.rs create mode 100644 gen/serviceuser1-cli/src/main.rs create mode 100644 gen/serviceuser1/Cargo.toml create mode 100644 gen/serviceuser1/LICENSE.md create mode 100644 gen/serviceuser1/README.md create mode 100644 gen/serviceuser1/src/cmn.rs create mode 100644 gen/serviceuser1/src/lib.rs create mode 100644 gen/sourcerepo1-cli/Cargo.toml create mode 100644 gen/sourcerepo1-cli/LICENSE.md create mode 100644 gen/sourcerepo1-cli/README.md create mode 100644 gen/sourcerepo1-cli/mkdocs.yml create mode 100644 gen/sourcerepo1-cli/src/cmn.rs create mode 100644 gen/sourcerepo1-cli/src/main.rs create mode 100644 gen/sourcerepo1/Cargo.toml create mode 100644 gen/sourcerepo1/LICENSE.md create mode 100644 gen/sourcerepo1/README.md create mode 100644 gen/sourcerepo1/src/cmn.rs create mode 100644 gen/sourcerepo1/src/lib.rs create mode 100644 gen/spanner1-cli/Cargo.toml create mode 100644 gen/spanner1-cli/LICENSE.md create mode 100644 gen/spanner1-cli/README.md create mode 100644 gen/spanner1-cli/mkdocs.yml create mode 100644 gen/spanner1-cli/src/cmn.rs create mode 100644 gen/spanner1-cli/src/main.rs create mode 100644 gen/spanner1/Cargo.toml create mode 100644 gen/spanner1/LICENSE.md create mode 100644 gen/spanner1/README.md create mode 100644 gen/spanner1/src/cmn.rs create mode 100644 gen/spanner1/src/lib.rs create mode 100644 gen/streetviewpublish1-cli/Cargo.toml create mode 100644 gen/streetviewpublish1-cli/LICENSE.md create mode 100644 gen/streetviewpublish1-cli/README.md create mode 100644 gen/streetviewpublish1-cli/mkdocs.yml create mode 100644 gen/streetviewpublish1-cli/src/cmn.rs create mode 100644 gen/streetviewpublish1-cli/src/main.rs create mode 100644 gen/streetviewpublish1/Cargo.toml create mode 100644 gen/streetviewpublish1/LICENSE.md create mode 100644 gen/streetviewpublish1/README.md create mode 100644 gen/streetviewpublish1/src/cmn.rs create mode 100644 gen/streetviewpublish1/src/lib.rs create mode 100644 gen/tagmanager2-cli/Cargo.toml create mode 100644 gen/tagmanager2-cli/LICENSE.md create mode 100644 gen/tagmanager2-cli/README.md create mode 100644 gen/tagmanager2-cli/mkdocs.yml create mode 100644 gen/tagmanager2-cli/src/cmn.rs create mode 100644 gen/tagmanager2-cli/src/main.rs create mode 100644 gen/tagmanager2/Cargo.toml create mode 100644 gen/tagmanager2/LICENSE.md create mode 100644 gen/tagmanager2/README.md create mode 100644 gen/tagmanager2/src/cmn.rs create mode 100644 gen/tagmanager2/src/lib.rs create mode 100644 gen/testing1-cli/Cargo.toml create mode 100644 gen/testing1-cli/LICENSE.md create mode 100644 gen/testing1-cli/README.md create mode 100644 gen/testing1-cli/mkdocs.yml create mode 100644 gen/testing1-cli/src/cmn.rs create mode 100644 gen/testing1-cli/src/main.rs create mode 100644 gen/testing1/Cargo.toml create mode 100644 gen/testing1/LICENSE.md create mode 100644 gen/testing1/README.md create mode 100644 gen/testing1/src/cmn.rs create mode 100644 gen/testing1/src/lib.rs create mode 100644 gen/vault1-cli/Cargo.toml create mode 100644 gen/vault1-cli/LICENSE.md create mode 100644 gen/vault1-cli/README.md create mode 100644 gen/vault1-cli/mkdocs.yml create mode 100644 gen/vault1-cli/src/cmn.rs create mode 100644 gen/vault1-cli/src/main.rs create mode 100644 gen/vault1/Cargo.toml create mode 100644 gen/vault1/LICENSE.md create mode 100644 gen/vault1/README.md create mode 100644 gen/vault1/src/cmn.rs create mode 100644 gen/vault1/src/lib.rs create mode 100644 gen/videointelligence1_beta1-cli/Cargo.toml create mode 100644 gen/videointelligence1_beta1-cli/LICENSE.md create mode 100644 gen/videointelligence1_beta1-cli/README.md create mode 100644 gen/videointelligence1_beta1-cli/mkdocs.yml create mode 100644 gen/videointelligence1_beta1-cli/src/cmn.rs create mode 100644 gen/videointelligence1_beta1-cli/src/main.rs create mode 100644 gen/videointelligence1_beta1/Cargo.toml create mode 100644 gen/videointelligence1_beta1/LICENSE.md create mode 100644 gen/videointelligence1_beta1/README.md create mode 100644 gen/videointelligence1_beta1/src/cmn.rs create mode 100644 gen/videointelligence1_beta1/src/lib.rs diff --git a/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json b/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json index 5fccb21399..b69a099ab3 100644 --- a/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json +++ b/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json @@ -1,12 +1,11 @@ { + "ownerName": "Google", + "discoveryVersion": "v1", + "version_module": true, "resources": { "ampUrls": { "methods": { "batchGet": { - "request": { - "$ref": "BatchGetAmpUrlsRequest" - }, - "description": "Returns AMP URL(s) and equivalent\n[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).", "httpMethod": "POST", "parameterOrder": [], "response": { @@ -14,13 +13,38 @@ }, "parameters": {}, "flatPath": "v1/ampUrls:batchGet", + "path": "v1/ampUrls:batchGet", "id": "acceleratedmobilepageurl.ampUrls.batchGet", - "path": "v1/ampUrls:batchGet" + "description": "Returns AMP URL(s) and equivalent\n[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).", + "request": { + "$ref": "BatchGetAmpUrlsRequest" + } } } } }, "parameters": { + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", @@ -28,39 +52,40 @@ }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "fields": { - "location": "query", "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "type": "string", + "location": "query" }, "uploadType": { + "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "description": "JSONP", "type": "string", "location": "query" }, "$.xgafv": { + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format." - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" + "location": "query" }, "alt": { + "description": "Data format for response.", "default": "json", "enum": [ "json", @@ -73,39 +98,17 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query", - "description": "Data format for response." + "location": "query" }, "key": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "access_token": { "location": "query", "description": "OAuth access token.", "type": "string" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" } }, "schemas": { @@ -113,49 +116,49 @@ "description": "Batch AMP URL response.", "type": "object", "properties": { - "ampUrls": { - "description": "For each URL in BatchAmpUrlsRequest, the URL response. The response might\nnot be in the same order as URLs in the batch request.\nIf BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated\nonly once.", - "type": "array", - "items": { - "$ref": "AmpUrl" - } - }, "urlErrors": { "description": "The errors for requested URLs that have no AMP URL.", - "type": "array", "items": { "$ref": "AmpUrlError" - } + }, + "type": "array" + }, + "ampUrls": { + "description": "For each URL in BatchAmpUrlsRequest, the URL response. The response might\nnot be in the same order as URLs in the batch request.\nIf BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated\nonly once.", + "items": { + "$ref": "AmpUrl" + }, + "type": "array" } }, "id": "BatchGetAmpUrlsResponse" }, "AmpUrl": { + "description": "AMP URL response for a requested URL.", "type": "object", "properties": { "cdnAmpUrl": { "description": "The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to\nthe cached document in the Google AMP Cache.", "type": "string" }, - "originalUrl": { - "description": "The original non-AMP URL.", - "type": "string" - }, "ampUrl": { "description": "The AMP URL pointing to the publisher's web server.", "type": "string" + }, + "originalUrl": { + "description": "The original non-AMP URL.", + "type": "string" } }, - "id": "AmpUrl", - "description": "AMP URL response for a requested URL." + "id": "AmpUrl" }, "AmpUrlError": { "description": "AMP URL Error resource for a requested URL that couldn't be found.", "type": "object", "properties": { "errorMessage": { - "type": "string", - "description": "An optional descriptive error message." + "description": "An optional descriptive error message.", + "type": "string" }, "errorCode": { "enumDescriptions": [ @@ -185,52 +188,49 @@ "id": "AmpUrlError" }, "BatchGetAmpUrlsRequest": { + "description": "AMP URL request for a batch of URLs.", + "type": "object", "properties": { "urls": { "description": "List of URLs to look up for the paired AMP URLs.\nThe URLs are case-sensitive. Up to 50 URLs per lookup\n(see [Usage Limits](/amp/cache/reference/limits)).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "lookupStrategy": { + "enumDescriptions": [ + "FETCH_LIVE_DOC strategy involves live document fetch of URLs not found in\nthe index. Any request URL not found in the index is crawled in realtime\nto validate if there is a corresponding AMP URL. This strategy has higher\ncoverage but with extra latency introduced by realtime crawling. This is\nthe default strategy. Applications using this strategy should set higher\nHTTP timeouts of the API calls.", + "IN_INDEX_DOC strategy skips fetching live documents of URL(s) not found\nin index. For applications which need low latency use of IN_INDEX_DOC\nstrategy is recommended." + ], "enum": [ "FETCH_LIVE_DOC", "IN_INDEX_DOC" ], "description": "The lookup_strategy being requested.", - "type": "string", - "enumDescriptions": [ - "FETCH_LIVE_DOC strategy involves live document fetch of URLs not found in\nthe index. Any request URL not found in the index is crawled in realtime\nto validate if there is a corresponding AMP URL. This strategy has higher\ncoverage but with extra latency introduced by realtime crawling. This is\nthe default strategy. Applications using this strategy should set higher\nHTTP timeouts of the API calls.", - "IN_INDEX_DOC strategy skips fetching live documents of URL(s) not found\nin index. For applications which need low latency use of IN_INDEX_DOC\nstrategy is recommended." - ] + "type": "string" } }, - "id": "BatchGetAmpUrlsRequest", - "description": "AMP URL request for a batch of URLs.", - "type": "object" + "id": "BatchGetAmpUrlsRequest" } }, - "protocol": "rest", "icons": { "x32": "http://www.google.com/images/icons/product/search-32.gif", "x16": "http://www.google.com/images/icons/product/search-16.gif" }, + "protocol": "rest", "version": "v1", "baseUrl": "https://acceleratedmobilepageurl.googleapis.com/", "servicePath": "", - "description": "Retrieves the list of AMP URL (and equivalent AMP Cache URL) for a given list of public URL(s).\n", + "description": "Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s).\n", "kind": "discovery#restDescription", "rootUrl": "https://acceleratedmobilepageurl.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "acceleratedmobilepageurl", "batchPath": "batch", - "revision": "20170504", "documentationLink": "https://developers.google.com/amp/cache/", + "revision": "20170921", "id": "acceleratedmobilepageurl:v1", - "title": "Accelerated Mobile Pages (AMP) URL API", - "discoveryVersion": "v1", - "ownerName": "Google", - "version_module": "True" + "title": "Accelerated Mobile Pages (AMP) URL API" } diff --git a/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json b/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json index 77b7e86529..cb383ac18d 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/0_pkDGZUigw6P9-q8PUQy4V9Lvo\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/-1DKqIhPUpLfO8DBj8P3gNrIPtE\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.2", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.2", - "revision": "20170504", + "revision": "20170810", "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", @@ -21,7 +21,7 @@ "basePath": "/adexchangebuyer/v1.2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adexchangebuyer/v1.2/", - "batchPath": "batch", + "batchPath": "batch/adexchangebuyer/v1.2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/adexchangebuyer/v1.3/adexchangebuyer-api.json b/etc/api/adexchangebuyer/v1.3/adexchangebuyer-api.json index a9f3eaa2d3..1edf96a397 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/AyER-m-NeyHqidJeSDw3qhKYlvg\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/_RwUq281eKa7d-tJKPdh-IE_OEk\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.3", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.3", - "revision": "20170504", + "revision": "20170810", "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", @@ -21,7 +21,7 @@ "basePath": "/adexchangebuyer/v1.3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adexchangebuyer/v1.3/", - "batchPath": "batch", + "batchPath": "batch/adexchangebuyer/v1.3", "parameters": { "alt": { "type": "string", diff --git a/etc/api/datastore/v1beta2/datastore-api.json b/etc/api/adexchangebuyer/v1.3/crates/1.0.6-api+20170810 similarity index 100% rename from etc/api/datastore/v1beta2/datastore-api.json rename to etc/api/adexchangebuyer/v1.3/crates/1.0.6-api+20170810 diff --git a/etc/api/freebase/v1/freebase-api.json b/etc/api/adexchangebuyer/v1.3/crates/1.0.6-cli+20170810 similarity index 100% rename from etc/api/freebase/v1/freebase-api.json rename to etc/api/adexchangebuyer/v1.3/crates/1.0.6-cli+20170810 diff --git a/etc/api/adexchangebuyer/v1.4/adexchangebuyer-api.json b/etc/api/adexchangebuyer/v1.4/adexchangebuyer-api.json index 723786341b..239a0bb7dd 100644 --- a/etc/api/adexchangebuyer/v1.4/adexchangebuyer-api.json +++ b/etc/api/adexchangebuyer/v1.4/adexchangebuyer-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/XvWFbU-Khae3KqVnoqt96DoRPGo\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/nD15-sVgx0hSdEaD_RN4E40IFV8\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.4", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.4", - "revision": "20170504", + "revision": "20170810", "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", @@ -21,7 +21,7 @@ "basePath": "/adexchangebuyer/v1.4/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adexchangebuyer/v1.4/", - "batchPath": "batch", + "batchPath": "batch/adexchangebuyer/v1.4", "parameters": { "alt": { "type": "string", @@ -2160,7 +2160,7 @@ "properties": { "accountId": { "type": "string", - "description": "The account id of the seller." + "description": "Deprecated: use the seller.account_id. The account id of the seller." }, "audience": { "type": "string", diff --git a/etc/api/adexchangebuyer/v1.4/crates/1.0.6-api+20170810 b/etc/api/adexchangebuyer/v1.4/crates/1.0.6-api+20170810 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adexchangebuyer/v1.4/crates/1.0.6-cli+20170810 b/etc/api/adexchangebuyer/v1.4/crates/1.0.6-cli+20170810 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json b/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json index bb4d050ab5..0416c57876 100644 --- a/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json +++ b/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json @@ -1,4 +1,15 @@ { + "canonicalName": "AdExchangeBuyerII", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/adexchange.buyer": { + "description": "Manage your Ad Exchange buyer account configuration" + } + } + } + }, + "rootUrl": "https://adexchangebuyer.googleapis.com/", "ownerDomain": "google.com", "name": "adexchangebuyer2", "batchPath": "batch", @@ -7,19 +18,455 @@ "resources": { "accounts": { "resources": { - "creatives": { + "clients": { "methods": { - "create": { + "list": { "response": { - "$ref": "Creative" + "$ref": "ListClientsResponse" + }, + "parameterOrder": [ + "accountId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientsResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.list method.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Unique numerical account ID of the sponsor buyer to list the clients for.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/clients", + "id": "adexchangebuyer2.accounts.clients.list", + "path": "v2beta1/accounts/{accountId}/clients", + "description": "Lists all the clients for the current sponsor buyer." + }, + "get": { + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "id": "adexchangebuyer2.accounts.clients.get", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "description": "Gets a client buyer with a given client account ID.", + "response": { + "$ref": "Client" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "httpMethod": "GET", + "parameters": { + "accountId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Numerical account ID of the client's sponsor buyer. (required)" + }, + "clientAccountId": { + "format": "int64", + "description": "Numerical account ID of the client buyer to retrieve. (required)", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "response": { + "$ref": "Client" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "accountId": { + "format": "int64", + "description": "Unique numerical account ID for the buyer of which the client buyer\nis a customer; the sponsor buyer to update a client for. (required)", + "type": "string", + "required": true, + "location": "path" + }, + "clientAccountId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Unique numerical account ID of the client to update. (required)" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "id": "adexchangebuyer2.accounts.clients.update", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "request": { + "$ref": "Client" + }, + "description": "Updates an existing client buyer." + }, + "create": { + "description": "Creates a new client buyer.", + "request": { + "$ref": "Client" + }, + "response": { + "$ref": "Client" }, "parameterOrder": [ "accountId" ], "httpMethod": "POST", + "parameters": { + "accountId": { + "format": "int64", + "description": "Unique numerical account ID for the buyer of which the client buyer\nis a customer; the sponsor buyer to create a client for. (required)", + "type": "string", + "required": true, + "location": "path" + } + }, "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" ], + "flatPath": "v2beta1/accounts/{accountId}/clients", + "id": "adexchangebuyer2.accounts.clients.create", + "path": "v2beta1/accounts/{accountId}/clients" + } + }, + "resources": { + "users": { + "methods": { + "get": { + "httpMethod": "GET", + "response": { + "$ref": "ClientUser" + }, + "parameterOrder": [ + "accountId", + "clientAccountId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "userId": { + "location": "path", + "format": "int64", + "description": "Numerical identifier of the user to retrieve. (required)", + "type": "string", + "required": true + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "type": "string", + "required": true + }, + "clientAccountId": { + "format": "int64", + "description": "Numerical account ID of the client buyer\nthat the user to be retrieved is associated with. (required)", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", + "id": "adexchangebuyer2.accounts.clients.users.get", + "description": "Retrieves an existing client user." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "response": { + "$ref": "ListClientUsersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientUsersResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.users.list method.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer", + "location": "query" + }, + "accountId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Numerical account ID of the sponsor buyer of the client to list users for.\n(required)" + }, + "clientAccountId": { + "location": "path", + "description": "The account ID of the client buyer to list users for. (required)\nYou must specify either a string representation of a\nnumerical account identifier or the `-` character\nto list all the client users for all the clients\nof a given sponsor buyer.", + "type": "string", + "required": true + } + }, + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users", + "id": "adexchangebuyer2.accounts.clients.users.list", + "description": "Lists all the known client users for a specified\nsponsor buyer account ID." + }, + "update": { + "response": { + "$ref": "ClientUser" + }, + "parameterOrder": [ + "accountId", + "clientAccountId", + "userId" + ], + "httpMethod": "PUT", + "parameters": { + "userId": { + "location": "path", + "format": "int64", + "description": "Numerical identifier of the user to retrieve. (required)", + "type": "string", + "required": true + }, + "accountId": { + "format": "int64", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "type": "string", + "required": true, + "location": "path" + }, + "clientAccountId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Numerical account ID of the client buyer that the user to be retrieved\nis associated with. (required)" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", + "id": "adexchangebuyer2.accounts.clients.users.update", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", + "description": "Updates an existing client user.\nOnly the user status can be changed on update.", + "request": { + "$ref": "ClientUser" + } + } + } + }, + "invitations": { + "methods": { + "list": { + "description": "Lists all the client users invitations for a client\nwith a given account ID.", + "response": { + "$ref": "ListClientUserInvitationsResponse" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientUserInvitationsResponse.nextPageToken\nreturned from the previous call to the\nclients.invitations.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. Server may return fewer clients than requested.\nIf unspecified, server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "type": "string", + "required": true + }, + "clientAccountId": { + "type": "string", + "required": true, + "location": "path", + "description": "Numerical account ID of the client buyer to list invitations for.\n(required)\nYou must either specify a string representation of a\nnumerical account identifier or the `-` character\nto list all the invitations for all the clients\nof a given sponsor buyer." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "id": "adexchangebuyer2.accounts.clients.invitations.list", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations" + }, + "get": { + "response": { + "$ref": "ClientUserInvitation" + }, + "parameterOrder": [ + "accountId", + "clientAccountId", + "invitationId" + ], + "httpMethod": "GET", + "parameters": { + "invitationId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Numerical identifier of the user invitation to retrieve. (required)" + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "type": "string", + "required": true + }, + "clientAccountId": { + "format": "int64", + "description": "Numerical account ID of the client buyer that the user invitation\nto be retrieved is associated with. (required)", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}", + "id": "adexchangebuyer2.accounts.clients.invitations.get", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}", + "description": "Retrieves an existing client user invitation." + }, + "create": { + "response": { + "$ref": "ClientUserInvitation" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "accountId": { + "format": "int64", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "type": "string", + "required": true, + "location": "path" + }, + "clientAccountId": { + "format": "int64", + "description": "Numerical account ID of the client buyer that the user\nshould be associated with. (required)", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "id": "adexchangebuyer2.accounts.clients.invitations.create", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "request": { + "$ref": "ClientUserInvitation" + }, + "description": "Creates and sends out an email invitation to access\nan Ad Exchange client buyer account." + } + } + } + } + }, + "creatives": { + "methods": { + "list": { + "flatPath": "v2beta1/accounts/{accountId}/creatives", + "id": "adexchangebuyer2.accounts.creatives.list", + "path": "v2beta1/accounts/{accountId}/creatives", + "description": "Lists creatives.", + "response": { + "$ref": "ListCreativesResponse" + }, + "parameterOrder": [ + "accountId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageToken": { + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativesResponse.next_page_token\nreturned from the previous call to 'ListCreatives' method.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer creatives than requested\n(due to timeout constraint) even if more are available via another call.\nIf unspecified, server will pick an appropriate default.\nAcceptable values are 1 to 1000, inclusive.", + "type": "integer" + }, + "accountId": { + "location": "path", + "description": "The account to list the creatives from.\nSpecify \"-\" to list all creatives the current user has access to.", + "type": "string", + "required": true + }, + "query": { + "location": "query", + "description": "An optional query string to filter creatives. If no filter is specified,\nall active creatives will be returned.\nSupported queries are:\n\u003cul\u003e\n\u003cli\u003eaccountId=\u003ci\u003eaccount_id_string\u003c/i\u003e\n\u003cli\u003ecreativeId=\u003ci\u003ecreative_id_string\u003c/i\u003e\n\u003cli\u003edealsStatus: {approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eopenAuctionStatus: {approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eattribute: {a numeric attribute from the list of attributes}\n\u003cli\u003edisapprovalReason: {a reason from\nDisapprovalReason\n\u003c/ul\u003e\nExample: 'accountId=12345 AND (dealsStatus:disapproved AND\ndisapprovalReason:unacceptable_content) OR attribute:47'", + "type": "string" + } + } + }, + "create": { + "description": "Creates a creative.", + "request": { + "$ref": "Creative" + }, + "httpMethod": "POST", + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Creative" + }, "parameters": { "duplicateIdMode": { "description": "Indicates if multiple creatives can share an ID or not. Default is\nNO_DUPLICATES (one ID per creative).", @@ -33,82 +480,81 @@ "accountId": { "location": "path", "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], "flatPath": "v2beta1/accounts/{accountId}/creatives", "path": "v2beta1/accounts/{accountId}/creatives", - "id": "adexchangebuyer2.accounts.creatives.create", - "description": "Creates a creative.", - "request": { - "$ref": "Creative" - } + "id": "adexchangebuyer2.accounts.creatives.create" }, "stopWatching": { - "httpMethod": "POST", + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching", + "id": "adexchangebuyer2.accounts.creatives.stopWatching", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching", + "description": "Stops watching a creative. Will stop push notifications being sent to the\ntopics when the creative changes status.", + "request": { + "$ref": "StopWatchingCreativeRequest" + }, + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "accountId", "creativeId" ], - "response": { - "$ref": "Empty" - }, + "httpMethod": "POST", "parameters": { "accountId": { - "required": true, - "type": "string", "location": "path", - "description": "The account of the creative to stop notifications for." + "description": "The account of the creative to stop notifications for.", + "type": "string", + "required": true }, "creativeId": { - "required": true, "type": "string", + "required": true, "location": "path", "description": "The creative ID of the creative to stop notifications for.\nSpecify \"-\" to specify stopping account level notifications." } }, "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching", - "id": "adexchangebuyer2.accounts.creatives.stopWatching", - "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching", - "request": { - "$ref": "StopWatchingCreativeRequest" - }, - "description": "Stops watching a creative. Will stop push notifications being sent to the\ntopics when the creative changes status." + ] }, "get": { - "description": "Gets a creative.", - "parameterOrder": [ - "accountId", - "creativeId" + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" ], + "parameters": { + "accountId": { + "type": "string", + "required": true, + "location": "path", + "description": "The account the creative belongs to." + }, + "creativeId": { + "type": "string", + "required": true, + "location": "path", + "description": "The ID of the creative to retrieve." + } + }, + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}", + "id": "adexchangebuyer2.accounts.creatives.get", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}", + "description": "Gets a creative.", "response": { "$ref": "Creative" }, "httpMethod": "GET", - "parameters": { - "accountId": { - "location": "path", - "description": "The account the creative belongs to.", - "required": true, - "type": "string" - }, - "creativeId": { - "description": "The ID of the creative to retrieve.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}", - "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}", - "id": "adexchangebuyer2.accounts.creatives.get" + "parameterOrder": [ + "accountId", + "creativeId" + ] }, "watch": { "httpMethod": "POST", @@ -119,157 +565,117 @@ "response": { "$ref": "Empty" }, - "parameters": { - "accountId": { - "description": "The account of the creative to watch.", - "required": true, - "type": "string", - "location": "path" - }, - "creativeId": { - "location": "path", - "description": "The creative ID to watch for status changes.\nSpecify \"-\" to watch all creatives under the above account.\nIf both creative-level and account-level notifications are\nsent, only a single notification will be sent to the\ncreative-level notification topic.", - "required": true, - "type": "string" - } - }, "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" ], + "parameters": { + "accountId": { + "location": "path", + "description": "The account of the creative to watch.", + "type": "string", + "required": true + }, + "creativeId": { + "description": "The creative ID to watch for status changes.\nSpecify \"-\" to watch all creatives under the above account.\nIf both creative-level and account-level notifications are\nsent, only a single notification will be sent to the\ncreative-level notification topic.", + "type": "string", + "required": true, + "location": "path" + } + }, "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch", - "id": "adexchangebuyer2.accounts.creatives.watch", "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch", + "id": "adexchangebuyer2.accounts.creatives.watch", "request": { "$ref": "WatchCreativeRequest" }, "description": "Watches a creative. Will result in push notifications being sent to the\ntopic when the creative changes status." }, "update": { - "response": { - "$ref": "Creative" - }, - "parameterOrder": [ - "accountId", - "creativeId" - ], - "httpMethod": "PUT", - "parameters": { - "accountId": { - "location": "path", - "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "required": true, - "type": "string" - }, - "creativeId": { - "required": true, - "type": "string", - "location": "path", - "description": "The buyer-defined creative ID of this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}", "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}", "id": "adexchangebuyer2.accounts.creatives.update", "request": { "$ref": "Creative" }, - "description": "Updates a creative." - }, - "list": { - "httpMethod": "GET", + "description": "Updates a creative.", + "httpMethod": "PUT", "parameterOrder": [ - "accountId" + "accountId", + "creativeId" ], "response": { - "$ref": "ListCreativesResponse" - }, - "parameters": { - "pageToken": { - "location": "query", - "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativesResponse.next_page_token\nreturned from the previous call to 'ListCreatives' method.", - "type": "string" - }, - "accountId": { - "location": "path", - "description": "The account to list the creatives from.\nSpecify \"-\" to list all creatives the current user has access to.", - "required": true, - "type": "string" - }, - "pageSize": { - "description": "Requested page size. The server may return fewer creatives than requested\n(due to timeout constraint) even if more are available via another call.\nIf unspecified, server will pick an appropriate default.\nAcceptable values are 1 to 1000, inclusive.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "query": { - "description": "An optional query string to filter creatives. If no filter is specified,\nall active creatives will be returned.\nSupported queries are:\n\u003cul\u003e\n\u003cli\u003eaccountId=\u003ci\u003eaccount_id_string\u003c/i\u003e\n\u003cli\u003ecreativeId=\u003ci\u003ecreative_id_string\u003c/i\u003e\n\u003cli\u003edealsStatus: {approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eopenAuctionStatus: {approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eattribute: {a numeric attribute from the list of attributes}\n\u003cli\u003edisapprovalReason: {a reason from DisapprovalReason\n\u003c/ul\u003e\nExample: 'accountId=12345 AND (dealsStatus:disapproved AND disapprovalReason:unacceptable_content) OR attribute:47'", - "type": "string", - "location": "query" - } + "$ref": "Creative" }, "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" ], - "flatPath": "v2beta1/accounts/{accountId}/creatives", - "id": "adexchangebuyer2.accounts.creatives.list", - "path": "v2beta1/accounts/{accountId}/creatives", - "description": "Lists creatives." + "parameters": { + "accountId": { + "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "type": "string", + "required": true, + "location": "path" + }, + "creativeId": { + "description": "The buyer-defined creative ID of this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}" } }, "resources": { "dealAssociations": { "methods": { "list": { - "parameterOrder": [ - "accountId", - "creativeId" + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" ], - "httpMethod": "GET", - "response": { - "$ref": "ListDealAssociationsResponse" - }, "parameters": { "pageToken": { "location": "query", "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListDealAssociationsResponse.next_page_token\nreturned from the previous call to 'ListDealAssociations' method.", "type": "string" }, - "accountId": { - "location": "path", - "description": "The account to list the associations from.\nSpecify \"-\" to list all creatives the current user has access to.", - "required": true, - "type": "string" - }, "pageSize": { "location": "query", - "description": "Requested page size. Server may return fewer associations than requested.\nIf unspecified, server will pick an appropriate default.", "format": "int32", + "description": "Requested page size. Server may return fewer associations than requested.\nIf unspecified, server will pick an appropriate default.", "type": "integer" }, - "query": { - "description": "An optional query string to filter deal associations. If no filter is\nspecified, all associations will be returned.\nSupported queries are:\n\u003cul\u003e\n\u003cli\u003eaccountId=\u003ci\u003eaccount_id_string\u003c/i\u003e\n\u003cli\u003ecreativeId=\u003ci\u003ecreative_id_string\u003c/i\u003e\n\u003cli\u003edealsId=\u003ci\u003edeals_id_string\u003c/i\u003e\n\u003cli\u003edealsStatus:{approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eopenAuctionStatus:{approved, conditionally_approved, disapproved,\n not_checked}\n\u003c/ul\u003e\nExample: 'dealsId=12345 AND dealsStatus:disapproved'", + "accountId": { + "description": "The account to list the associations from.\nSpecify \"-\" to list all creatives the current user has access to.", "type": "string", - "location": "query" + "required": true, + "location": "path" + }, + "query": { + "location": "query", + "description": "An optional query string to filter deal associations. If no filter is\nspecified, all associations will be returned.\nSupported queries are:\n\u003cul\u003e\n\u003cli\u003eaccountId=\u003ci\u003eaccount_id_string\u003c/i\u003e\n\u003cli\u003ecreativeId=\u003ci\u003ecreative_id_string\u003c/i\u003e\n\u003cli\u003edealsId=\u003ci\u003edeals_id_string\u003c/i\u003e\n\u003cli\u003edealsStatus:{approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eopenAuctionStatus:{approved, conditionally_approved, disapproved,\n not_checked}\n\u003c/ul\u003e\nExample: 'dealsId=12345 AND dealsStatus:disapproved'", + "type": "string" }, "creativeId": { - "required": true, + "description": "The creative ID to list the associations from.\nSpecify \"-\" to list all creatives under the above account.", "type": "string", - "location": "path", - "description": "The creative ID to list the associations from.\nSpecify \"-\" to list all creatives under the above account." + "required": true, + "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations", - "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations", "id": "adexchangebuyer2.accounts.creatives.dealAssociations.list", - "description": "List all creative-deal associations." + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations", + "description": "List all creative-deal associations.", + "response": { + "$ref": "ListDealAssociationsResponse" + }, + "parameterOrder": [ + "accountId", + "creativeId" + ], + "httpMethod": "GET" }, - "add": { + "remove": { "httpMethod": "POST", "parameterOrder": [ "accountId", @@ -280,16 +686,50 @@ }, "parameters": { "accountId": { - "description": "The account the creative belongs to.", - "required": true, "type": "string", + "required": true, + "location": "path", + "description": "The account the creative belongs to." + }, + "creativeId": { + "type": "string", + "required": true, + "location": "path", + "description": "The ID of the creative associated with the deal." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove", + "id": "adexchangebuyer2.accounts.creatives.dealAssociations.remove", + "description": "Remove the association between a deal and a creative.", + "request": { + "$ref": "RemoveDealAssociationRequest" + } + }, + "add": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "accountId", + "creativeId" + ], + "httpMethod": "POST", + "parameters": { + "accountId": { + "description": "The account the creative belongs to.", + "type": "string", + "required": true, "location": "path" }, "creativeId": { "location": "path", "description": "The ID of the creative associated with the deal.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, "scopes": [ @@ -298,97 +738,89 @@ "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add", "id": "adexchangebuyer2.accounts.creatives.dealAssociations.add", "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add", + "description": "Associate an existing deal with a creative.", "request": { "$ref": "AddDealAssociationRequest" - }, - "description": "Associate an existing deal with a creative." - }, - "remove": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "accountId", - "creativeId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "parameters": { - "creativeId": { - "location": "path", - "description": "The ID of the creative associated with the deal.", - "required": true, - "type": "string" - }, - "accountId": { - "description": "The account the creative belongs to.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove", - "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove", - "id": "adexchangebuyer2.accounts.creatives.dealAssociations.remove", - "description": "Remove the association between a deal and a creative.", - "request": { - "$ref": "RemoveDealAssociationRequest" } } } } } }, - "clients": { + "filterSets": { "methods": { - "update": { - "description": "Updates an existing client buyer.", - "request": { - "$ref": "Client" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "accountId", - "clientAccountId" - ], + "list": { "response": { - "$ref": "Client" + "$ref": "ListFilterSetsResponse" + }, + "parameterOrder": [ + "accountId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilterSetsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.list\nmethod.", + "type": "string" + } }, "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" ], + "flatPath": "v2beta1/accounts/{accountId}/filterSets", + "id": "adexchangebuyer2.accounts.filterSets.list", + "path": "v2beta1/accounts/{accountId}/filterSets", + "description": "Lists all filter sets for the account with the given account ID." + }, + "get": { + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}", + "id": "adexchangebuyer2.accounts.filterSets.get", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}", + "description": "Retrieves the requested filter set for the account with the given account\nID.", + "response": { + "$ref": "FilterSet" + }, + "parameterOrder": [ + "accountId", + "filterSetId" + ], + "httpMethod": "GET", "parameters": { - "clientAccountId": { - "location": "path", - "description": "Unique numerical account ID of the client to update. (required)", + "filterSetId": { "format": "int64", + "description": "The ID of the filter set to get.", + "type": "string", "required": true, - "type": "string" + "location": "path" }, "accountId": { "location": "path", - "description": "Unique numerical account ID for the buyer of which the client buyer\nis a customer; the sponsor buyer to update a client for. (required)", "format": "int64", - "required": true, - "type": "string" + "description": "Account ID of the buyer.", + "type": "string", + "required": true } }, - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", - "id": "adexchangebuyer2.accounts.clients.update", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}" + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] }, "create": { - "flatPath": "v2beta1/accounts/{accountId}/clients", - "path": "v2beta1/accounts/{accountId}/clients", - "id": "adexchangebuyer2.accounts.clients.create", - "description": "Creates a new client buyer.", - "request": { - "$ref": "Client" - }, "response": { - "$ref": "Client" + "$ref": "FilterSet" }, "parameterOrder": [ "accountId" @@ -398,339 +830,557 @@ "https://www.googleapis.com/auth/adexchange.buyer" ], "parameters": { - "accountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Unique numerical account ID for the buyer of which the client buyer\nis a customer; the sponsor buyer to create a client for. (required)", - "format": "int64" - } - } - }, - "get": { - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", - "id": "adexchangebuyer2.accounts.clients.get", - "description": "Gets a client buyer with a given client account ID.", - "response": { - "$ref": "Client" - }, - "httpMethod": "GET", - "parameterOrder": [ - "accountId", - "clientAccountId" - ], - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "parameters": { - "accountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Numerical account ID of the client's sponsor buyer. (required)", - "format": "int64" - }, - "clientAccountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Numerical account ID of the client buyer to retrieve. (required)", - "format": "int64" - } - } - }, - "list": { - "description": "Lists all the clients for the current sponsor buyer.", - "httpMethod": "GET", - "parameterOrder": [ - "accountId" - ], - "response": { - "$ref": "ListClientsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "parameters": { - "pageToken": { - "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientsResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.list method.", - "type": "string", + "isTransient": { + "description": "Whether the filter set is transient, or should be persisted indefinitely.\nBy default, filter sets are not transient.\nIf transient, it will be available for at least 1 hour after creation.", + "type": "boolean", "location": "query" }, "accountId": { - "description": "Unique numerical account ID of the sponsor buyer to list the clients for.", + "location": "path", "format": "int64", - "required": true, + "description": "Account ID of the buyer.", "type": "string", - "location": "path" - }, - "pageSize": { - "location": "query", - "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.", - "format": "int32", - "type": "integer" + "required": true } }, - "flatPath": "v2beta1/accounts/{accountId}/clients", - "id": "adexchangebuyer2.accounts.clients.list", - "path": "v2beta1/accounts/{accountId}/clients" + "flatPath": "v2beta1/accounts/{accountId}/filterSets", + "id": "adexchangebuyer2.accounts.filterSets.create", + "path": "v2beta1/accounts/{accountId}/filterSets", + "request": { + "$ref": "FilterSet" + }, + "description": "Creates the specified filter set for the account with the given account ID." + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "accountId", + "filterSetId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "accountId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Account ID of the buyer." + }, + "filterSetId": { + "location": "path", + "format": "int64", + "description": "The ID of the filter set to delete.", + "type": "string", + "required": true + } + }, + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}", + "id": "adexchangebuyer2.accounts.filterSets.delete", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}", + "description": "Deletes the requested filter set from the account with the given account\nID." } }, "resources": { - "invitations": { + "filteredBids": { "methods": { - "get": { - "description": "Retrieves an existing client user invitation.", - "httpMethod": "GET", + "list": { + "id": "adexchangebuyer2.accounts.filterSets.filteredBids.list", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBids", + "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason.", + "response": { + "$ref": "ListFilteredBidsResponse" + }, "parameterOrder": [ "accountId", - "clientAccountId", - "invitationId" + "filterSetId" ], - "response": { - "$ref": "ClientUserInvitation" - }, + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" ], "parameters": { - "invitationId": { + "filterSetId": { + "type": "string", + "required": true, "location": "path", - "description": "Numerical identifier of the user invitation to retrieve. (required)", "format": "int64", - "required": true, - "type": "string" + "description": "The ID of the filter set to apply." }, - "accountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Numerical account ID of the client's sponsor buyer. (required)", - "format": "int64" - }, - "clientAccountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Numerical account ID of the client buyer that the user invitation\nto be retrieved is associated with. (required)", - "format": "int64" - } - }, - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}", - "id": "adexchangebuyer2.accounts.clients.invitations.get", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}" - }, - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListClientUserInvitationsResponse" - }, - "parameterOrder": [ - "accountId", - "clientAccountId" - ], - "parameters": { "pageToken": { - "location": "query", - "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientUserInvitationsResponse.nextPageToken\nreturned from the previous call to the\nclients.invitations.list\nmethod.", - "type": "string" - }, - "accountId": { - "description": "Numerical account ID of the client's sponsor buyer. (required)", - "format": "int64", - "required": true, + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilteredBidsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.filteredBids.list\nmethod.", "type": "string", - "location": "path" + "location": "query" }, "pageSize": { - "location": "query", - "description": "Requested page size. Server may return fewer clients than requested.\nIf unspecified, server will pick an appropriate default.", "format": "int32", - "type": "integer" + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer", + "location": "query" }, - "clientAccountId": { - "location": "path", - "description": "Numerical account ID of the client buyer to list invitations for.\n(required)\nYou must either specify a string representation of a\nnumerical account identifier or the `-` character\nto list all the invitations for all the clients\nof a given sponsor buyer.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", - "id": "adexchangebuyer2.accounts.clients.invitations.list", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", - "description": "Lists all the client users invitations for a client\nwith a given account ID." - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "accountId", - "clientAccountId" - ], - "response": { - "$ref": "ClientUserInvitation" - }, - "parameters": { "accountId": { - "description": "Numerical account ID of the client's sponsor buyer. (required)", + "location": "path", "format": "int64", - "required": true, + "description": "Account ID of the buyer.", "type": "string", - "location": "path" - }, - "clientAccountId": { - "description": "Numerical account ID of the client buyer that the user\nshould be associated with. (required)", - "format": "int64", - "required": true, - "type": "string", - "location": "path" + "required": true } }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", - "id": "adexchangebuyer2.accounts.clients.invitations.create", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", - "request": { - "$ref": "ClientUserInvitation" - }, - "description": "Creates and sends out an email invitation to access\nan Ad Exchange client buyer account." + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBids" + } + }, + "resources": { + "creatives": { + "methods": { + "list": { + "response": { + "$ref": "ListCreativeStatusBreakdownByCreativeResponse" + }, + "parameterOrder": [ + "accountId", + "filterSetId", + "creativeStatusId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "filterSetId": { + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativeStatusBreakdownByCreativeResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.filteredBids.creatives.list\nmethod.", + "type": "string", + "location": "query" + }, + "creativeStatusId": { + "format": "int32", + "description": "The ID of the creative status for which to retrieve a breakdown by\ncreative.\nSee\n[creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).", + "type": "integer", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default." + }, + "accountId": { + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBids/{creativeStatusId}/creatives", + "id": "adexchangebuyer2.accounts.filterSets.filteredBids.creatives.list", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBids/{creativeStatusId}/creatives", + "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative." + } + } + }, + "details": { + "methods": { + "list": { + "description": "List all details associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each detail.", + "response": { + "$ref": "ListCreativeStatusBreakdownByDetailResponse" + }, + "parameterOrder": [ + "accountId", + "filterSetId", + "creativeStatusId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "filterSetId": { + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativeStatusBreakdownByDetailResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.filteredBids.details.list\nmethod.", + "type": "string" + }, + "creativeStatusId": { + "location": "path", + "format": "int32", + "description": "The ID of the creative status for which to retrieve a breakdown by detail.\nSee\n[creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).\nDetails are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87.", + "type": "integer", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true + } + }, + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBids/{creativeStatusId}/details", + "id": "adexchangebuyer2.accounts.filterSets.filteredBids.details.list", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBids/{creativeStatusId}/details" + } + } } } }, - "users": { + "nonBillableWinningBids": { "methods": { "list": { + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/nonBillableWinningBids", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/nonBillableWinningBids", + "id": "adexchangebuyer2.accounts.filterSets.nonBillableWinningBids.list", + "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.", + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "filterSetId" + ], "response": { - "$ref": "ListClientUsersResponse" + "$ref": "ListNonBillableWinningBidsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageToken": { + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListNonBillableWinningBidsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.nonBillableWinningBids.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true, + "location": "path" + }, + "filterSetId": { + "location": "path", + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true + } + } + } + } + }, + "losingBids": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "filterSetId" + ], + "response": { + "$ref": "ListLosingBidsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "filterSetId": { + "location": "path", + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListLosingBidsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.losingBids.list\nmethod.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer", + "location": "query" + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true + } + }, + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/losingBids", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/losingBids", + "id": "adexchangebuyer2.accounts.filterSets.losingBids.list", + "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason." + } + } + }, + "impressionMetrics": { + "methods": { + "list": { + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/impressionMetrics", + "id": "adexchangebuyer2.accounts.filterSets.impressionMetrics.list", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/impressionMetrics", + "description": "Lists all metrics that are measured in terms of number of impressions.", + "response": { + "$ref": "ListImpressionMetricsResponse" }, "parameterOrder": [ "accountId", - "clientAccountId" + "filterSetId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageToken": { + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListImpressionMetricsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.impressionMetrics.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true + }, + "filterSetId": { + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true, + "location": "path" + } + } + } + } + }, + "bidMetrics": { + "methods": { + "list": { + "id": "adexchangebuyer2.accounts.filterSets.bidMetrics.list", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/bidMetrics", + "description": "Lists all metrics that are measured in terms of number of bids.", + "response": { + "$ref": "ListBidMetricsResponse" + }, + "parameterOrder": [ + "accountId", + "filterSetId" + ], + "httpMethod": "GET", + "parameters": { + "filterSetId": { + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidMetricsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.bidMetrics.list\nmethod.", + "type": "string" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default." + }, + "accountId": { + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/bidMetrics" + } + } + }, + "bidResponseErrors": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "filterSetId" + ], + "response": { + "$ref": "ListBidResponseErrorsResponse" + }, + "parameters": { + "pageToken": { + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidResponseErrorsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.bidResponseErrors.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "accountId": { + "type": "string", + "required": true, + "location": "path", + "format": "int64", + "description": "Account ID of the buyer." + }, + "filterSetId": { + "location": "path", + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/bidResponseErrors", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/bidResponseErrors", + "id": "adexchangebuyer2.accounts.filterSets.bidResponseErrors.list", + "description": "List all errors that occurred in bid responses, with the number of bid\nresponses affected for each reason." + } + } + }, + "bidResponsesWithoutBids": { + "methods": { + "list": { + "description": "List all reasons for which bid responses were considered to have no\napplicable bids, with the number of bid responses affected for each reason.", + "response": { + "$ref": "ListBidResponsesWithoutBidsResponse" + }, + "parameterOrder": [ + "accountId", + "filterSetId" ], "httpMethod": "GET", "parameters": { "pageToken": { "type": "string", "location": "query", - "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientUsersResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.users.list method." - }, - "accountId": { - "description": "Numerical account ID of the sponsor buyer of the client to list users for.\n(required)", - "format": "int64", - "required": true, - "type": "string", - "location": "path" + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidResponsesWithoutBidsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.bidResponsesWithoutBids.list\nmethod." }, "pageSize": { + "type": "integer", "location": "query", - "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.", "format": "int32", - "type": "integer" - }, - "clientAccountId": { - "location": "path", - "description": "The account ID of the client buyer to list users for. (required)\nYou must specify either a string representation of a\nnumerical account identifier or the `-` character\nto list all the client users for all the clients\nof a given sponsor buyer.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users", - "id": "adexchangebuyer2.accounts.clients.users.list", - "description": "Lists all the known client users for a specified\nsponsor buyer account ID." - }, - "get": { - "response": { - "$ref": "ClientUser" - }, - "httpMethod": "GET", - "parameterOrder": [ - "accountId", - "clientAccountId", - "userId" - ], - "parameters": { - "userId": { - "location": "path", - "description": "Numerical identifier of the user to retrieve. (required)", - "format": "int64", - "required": true, - "type": "string" + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default." }, "accountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Numerical account ID of the client's sponsor buyer. (required)", - "format": "int64" - }, - "clientAccountId": { - "required": true, - "type": "string", - "location": "path", - "description": "Numerical account ID of the client buyer\nthat the user to be retrieved is associated with. (required)", - "format": "int64" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", - "id": "adexchangebuyer2.accounts.clients.users.get", - "description": "Retrieves an existing client user." - }, - "update": { - "request": { - "$ref": "ClientUser" - }, - "description": "Updates an existing client user.\nOnly the user status can be changed on update.", - "httpMethod": "PUT", - "parameterOrder": [ - "accountId", - "clientAccountId", - "userId" - ], - "response": { - "$ref": "ClientUser" - }, - "parameters": { - "accountId": { - "description": "Numerical account ID of the client's sponsor buyer. (required)", "format": "int64", - "required": true, + "description": "Account ID of the buyer.", "type": "string", + "required": true, "location": "path" }, - "clientAccountId": { - "location": "path", - "description": "Numerical account ID of the client buyer that the user to be retrieved\nis associated with. (required)", + "filterSetId": { "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", "required": true, - "type": "string" - }, - "userId": { - "location": "path", - "description": "Numerical identifier of the user to retrieve. (required)", - "format": "int64", - "required": true, - "type": "string" + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/adexchange.buyer" ], - "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", - "id": "adexchangebuyer2.accounts.clients.users.update", - "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}" + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/bidResponsesWithoutBids", + "id": "adexchangebuyer2.accounts.filterSets.bidResponsesWithoutBids.list", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/bidResponsesWithoutBids" + } + } + }, + "filteredBidRequests": { + "methods": { + "list": { + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilteredBidRequestsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.filteredBidRequests.list\nmethod." + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default." + }, + "accountId": { + "location": "path", + "format": "int64", + "description": "Account ID of the buyer.", + "type": "string", + "required": true + }, + "filterSetId": { + "format": "int64", + "description": "The ID of the filter set to apply.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBidRequests", + "path": "v2beta1/accounts/{accountId}/filterSets/{filterSetId}/filteredBidRequests", + "id": "adexchangebuyer2.accounts.filterSets.filteredBidRequests.list", + "description": "List all reasons that caused a bid request not to be sent for an\nimpression, with the number of bid requests not sent for each reason.", + "httpMethod": "GET", + "response": { + "$ref": "ListFilteredBidRequestsResponse" + }, + "parameterOrder": [ + "accountId", + "filterSetId" + ] } } } @@ -740,61 +1390,6 @@ } }, "parameters": { - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." - }, - "uploadType": { - "type": "string", - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "alt": { - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string" - }, "key": { "location": "query", "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.", @@ -813,18 +1408,73 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" }, "oauth_token": { - "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "description": "OAuth bearer token.", "type": "string", "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" } }, "version": "v2beta1", @@ -833,33 +1483,326 @@ "description": "Accesses the latest features for managing Ad Exchange accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals.", "kind": "discovery#restDescription", "basePath": "", - "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest/guides/client-access/", - "revision": "20170519", + "revision": "20170922", + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest/reference/rest/", "id": "adexchangebuyer2:v2beta1", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "AuctionContext": { - "description": "@OutputOnly The auction type the restriction applies to.", + "AddDealAssociationRequest": { + "description": "A request for associating a deal and a creative.", "type": "object", "properties": { - "auctionTypes": { - "description": "The auction types this restriction applies to.", - "type": "array", - "items": { - "enum": [ - "OPEN_AUCTION", - "DIRECT_DEALS" - ], - "type": "string" - }, - "enumDescriptions": [ - "The restriction applies to open auction.", - "The restriction applies to direct deals." - ] + "association": { + "description": "The association between a creative and a deal that should be added.", + "$ref": "CreativeDealAssociation" } }, - "id": "AuctionContext" + "id": "AddDealAssociationRequest" + }, + "WatchCreativeRequest": { + "description": "A request for watching changes to creative Status.", + "type": "object", + "properties": { + "topic": { + "description": "The Pub/Sub topic to publish notifications to.\nThis topic must already exist and must give permission to\nad-exchange-buyside-reports@google.com to write to the topic.\nThis should be the full resource name in\n\"projects/{project_id}/topics/{topic_id}\" format.", + "type": "string" + } + }, + "id": "WatchCreativeRequest" + }, + "TimeInterval": { + "type": "object", + "properties": { + "endTime": { + "type": "string", + "format": "google-datetime", + "description": "The timestamp marking the end of the range (exclusive) for which data is\nincluded." + }, + "startTime": { + "format": "google-datetime", + "description": "The timestamp marking the start of the range (inclusive) for which data is\nincluded.", + "type": "string" + } + }, + "id": "TimeInterval", + "description": "An interval of time, with an absolute start and end." + }, + "FilteredBidCreativeRow": { + "description": "The number of filtered bids with the specified dimension values that have the\nspecified creative.", + "type": "object", + "properties": { + "bidCount": { + "description": "The number of bids with the specified creative.", + "$ref": "MetricValue" + }, + "creativeId": { + "description": "The ID of the creative.", + "type": "string" + }, + "rowDimensions": { + "$ref": "RowDimensions", + "description": "The values of all dimensions associated with metric values in this row." + } + }, + "id": "FilteredBidCreativeRow" + }, + "RelativeDateRange": { + "description": "A relative date range, specified by an offset and a duration.\nThe supported range of dates begins 30 days before today and ends today.\nI.e. the limits for these values are:\noffset_days \u003e= 0\nduration_days \u003e= 1\noffset_days + duration_days \u003c= 30", + "type": "object", + "properties": { + "durationDays": { + "format": "int32", + "description": "The number of days in the requested date range. E.g. for a range spanning\ntoday, 1. For a range spanning the last 7 days, 7.", + "type": "integer" + }, + "offsetDays": { + "type": "integer", + "format": "int32", + "description": "The end date of the filter set, specified as the number of days before\ntoday. E.g. for a range where the last date is today, 0." + } + }, + "id": "RelativeDateRange" + }, + "NativeContent": { + "properties": { + "clickLinkUrl": { + "description": "The URL that the browser/SDK will load when the user clicks the ad.", + "type": "string" + }, + "logo": { + "$ref": "Image", + "description": "A smaller image, for the advertiser's logo." + }, + "priceDisplayText": { + "description": "The price of the promoted app including currency info.", + "type": "string" + }, + "image": { + "$ref": "Image", + "description": "A large image." + }, + "clickTrackingUrl": { + "type": "string", + "description": "The URL to use for click tracking." + }, + "advertiserName": { + "description": "The name of the advertiser or sponsor, to be displayed in the ad creative.", + "type": "string" + }, + "storeUrl": { + "type": "string", + "description": "The URL to the app store to purchase/download the promoted app." + }, + "headline": { + "description": "A short title for the ad.", + "type": "string" + }, + "appIcon": { + "$ref": "Image", + "description": "The app icon, for app download ads." + }, + "callToAction": { + "description": "A label for the button that the user is supposed to click.", + "type": "string" + }, + "body": { + "description": "A long description of the ad.", + "type": "string" + }, + "starRating": { + "format": "double", + "description": "The app rating in the app store. Must be in the range [0-5].", + "type": "number" + }, + "videoUrl": { + "description": "The URL to fetch a native video ad.", + "type": "string" + } + }, + "id": "NativeContent", + "description": "Native content for a creative.", + "type": "object" + }, + "ListClientsResponse": { + "id": "ListClientsResponse", + "type": "object", + "properties": { + "clients": { + "description": "The returned list of clients.", + "items": { + "$ref": "Client" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListClientsRequest.pageToken\nfield in the subsequent call to the\naccounts.clients.list method\nto retrieve the next page of results.", + "type": "string" + } + } + }, + "ListBidResponsesWithoutBidsResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListBidResponsesWithoutBidsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.bidResponsesWithoutBids.list\nmethod to retrieve the next page of results.", + "type": "string" + }, + "bidResponseWithoutBidsStatusRows": { + "description": "List of rows, with counts of bid responses without bids aggregated by\nstatus.", + "items": { + "$ref": "BidResponseWithoutBidsStatusRow" + }, + "type": "array" + } + }, + "id": "ListBidResponsesWithoutBidsResponse", + "description": "Response message for listing all reasons that bid responses were considered\nto have no applicable bids." + }, + "ServingContext": { + "id": "ServingContext", + "description": "The serving context for this restriction.", + "type": "object", + "properties": { + "auctionType": { + "$ref": "AuctionContext", + "description": "Matches impressions for a particular auction type." + }, + "all": { + "enumDescriptions": [ + "A simple context." + ], + "enum": [ + "SIMPLE_CONTEXT" + ], + "description": "Matches all contexts.", + "type": "string" + }, + "appType": { + "$ref": "AppContext", + "description": "Matches impressions for a particular app type." + }, + "securityType": { + "description": "Matches impressions for a particular security type.", + "$ref": "SecurityContext" + }, + "platform": { + "$ref": "PlatformContext", + "description": "Matches impressions coming from a particular platform." + }, + "location": { + "$ref": "LocationContext", + "description": "Matches impressions coming from users *or* publishers in a specific\nlocation." + } + } + }, + "Image": { + "description": "An image resource. You may provide a larger image than was requested,\nso long as the aspect ratio is preserved.", + "type": "object", + "properties": { + "url": { + "description": "The URL of the image.", + "type": "string" + }, + "height": { + "format": "int32", + "description": "Image height in pixels.", + "type": "integer" + }, + "width": { + "type": "integer", + "format": "int32", + "description": "Image width in pixels." + } + }, + "id": "Image" + }, + "ListFilterSetsResponse": { + "description": "Response message for listing filter sets.", + "type": "object", + "properties": { + "filterSets": { + "description": "The filter sets belonging to the buyer.", + "items": { + "$ref": "FilterSet" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListFilterSetsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListFilterSetsResponse" + }, + "BidResponseWithoutBidsStatusRow": { + "description": "The number of impressions with the specified dimension values that were\nconsidered to have no applicable bids, as described by the specified status.", + "type": "object", + "properties": { + "impressionCount": { + "$ref": "MetricValue", + "description": "The number of impressions for which there was a bid response with the\nspecified status." + }, + "status": { + "enumDescriptions": [ + "A placeholder for an undefined status.\nThis value will never be returned in responses.", + "The response had no bids.", + "The response had no bids for the specified account, though it may have\nincluded bids on behalf of other accounts.", + "The response had no bids for the specified deal, though it may have\nincluded bids on other deals on behalf of the account to which the deal\nbelongs." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "RESPONSES_WITHOUT_BIDS", + "RESPONSES_WITHOUT_BIDS_FOR_ACCOUNT", + "RESPONSES_WITHOUT_BIDS_FOR_DEAL" + ], + "description": "The status specifying why the bid responses were considered to have no\napplicable bids.", + "type": "string" + }, + "rowDimensions": { + "$ref": "RowDimensions", + "description": "The values of all dimensions associated with metric values in this row." + } + }, + "id": "BidResponseWithoutBidsStatusRow" + }, + "ClientUserInvitation": { + "description": "An invitation for a new client user to get access to the Ad Exchange\nBuyer UI.\nAll fields are required unless otherwise specified.", + "type": "object", + "properties": { + "invitationId": { + "format": "int64", + "description": "The unique numerical ID of the invitation that is sent to the user.\nThe value of this field is ignored in create operations.", + "type": "string" + }, + "email": { + "type": "string", + "description": "The email address to which the invitation is sent. Email\naddresses should be unique among all client users under each sponsor\nbuyer." + }, + "clientAccountId": { + "format": "int64", + "description": "Numerical account ID of the client buyer\nthat the invited user is associated with.\nThe value of this field is ignored in create operations.", + "type": "string" + } + }, + "id": "ClientUserInvitation" + }, + "ListClientUsersResponse": { + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListClientUsersRequest.pageToken\nfield in the subsequent call to the\nclients.invitations.list\nmethod to retrieve the next\npage of results.", + "type": "string" + }, + "users": { + "description": "The returned list of client users.", + "items": { + "$ref": "ClientUser" + }, + "type": "array" + } + }, + "id": "ListClientUsersResponse", + "type": "object" }, "ListClientUserInvitationsResponse": { "properties": { @@ -868,55 +1811,80 @@ "type": "string" }, "invitations": { - "type": "array", + "description": "The returned list of client users.", "items": { "$ref": "ClientUserInvitation" }, - "description": "The returned list of client users." + "type": "array" } }, "id": "ListClientUserInvitationsResponse", "type": "object" }, - "ListClientUsersResponse": { - "id": "ListClientUsersResponse", + "ListCreativeStatusBreakdownByDetailResponse": { + "description": "Response message for listing all details associated with a given filtered bid\nreason.", "type": "object", "properties": { "nextPageToken": { - "description": "A token to retrieve the next page of results.\nPass this value in the\nListClientUsersRequest.pageToken\nfield in the subsequent call to the\nclients.invitations.list\nmethod to retrieve the next\npage of results.", + "description": "A token to retrieve the next page of results.\nPass this value in the\nListCreativeStatusBreakdownByDetailRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.filteredBids.details.list\nmethod to retrieve the next page of results.", "type": "string" }, - "users": { - "description": "The returned list of client users.", - "type": "array", + "filteredBidDetailRows": { + "description": "List of rows, with counts of bids with a given creative status aggregated\nby detail.", "items": { - "$ref": "ClientUser" - } + "$ref": "FilteredBidDetailRow" + }, + "type": "array" + }, + "detailType": { + "description": "The type of detail that the detail IDs represent.", + "type": "string", + "enumDescriptions": [ + "A placeholder for an undefined status.\nThis value will never be returned in responses.", + "Indicates that the detail ID refers to a creative attribute; see\n[publisher-excludable-creative-attributes](https://developers.google.com/ad-exchange/rtb/downloads/publisher-excludable-creative-attributes).", + "Indicates that the detail ID refers to a vendor; see\n[vendors](https://developers.google.com/ad-exchange/rtb/downloads/vendors).", + "Indicates that the detail ID refers to a sensitive category; see\n[ad-sensitive-categories](https://developers.google.com/ad-exchange/rtb/downloads/ad-sensitive-categories).", + "Indicates that the detail ID refers to a product category; see\n[ad-product-categories](https://developers.google.com/ad-exchange/rtb/downloads/ad-product-categories).", + "Indicates that the detail ID refers to a disapproval reason; see\nDisapprovalReason enum in [snippet-status-report-proto](https://developers.google.com/ad-exchange/rtb/downloads/snippet-status-report-proto)." + ], + "enum": [ + "DETAIL_TYPE_UNSPECIFIED", + "CREATIVE_ATTRIBUTE", + "VENDOR", + "SENSITIVE_CATEGORY", + "PRODUCT_CATEGORY", + "DISAPPROVAL_REASON" + ] } - } + }, + "id": "ListCreativeStatusBreakdownByDetailResponse" }, "LocationContext": { + "description": "@OutputOnly The Geo criteria the restriction applies to.", "type": "object", "properties": { "geoCriteriaIds": { "description": "IDs representing the geo location for this context.\nPlease refer to the\n[geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv)\nfile for different geo criteria IDs.", - "type": "array", "items": { "format": "int32", "type": "integer" - } + }, + "type": "array" } }, - "id": "LocationContext", - "description": "@OutputOnly The Geo criteria the restriction applies to." + "id": "LocationContext" }, "PlatformContext": { "description": "@OutputOnly The type of platform the restriction applies to.", "type": "object", "properties": { "platforms": { + "enumDescriptions": [ + "Desktop platform.", + "Android platform.", + "iOS platform." + ], "description": "The platforms this restriction applies to.", - "type": "array", "items": { "enum": [ "DESKTOP", @@ -925,32 +1893,32 @@ ], "type": "string" }, - "enumDescriptions": [ - "Desktop platform.", - "Android platform.", - "iOS platform." - ] + "type": "array" } }, "id": "PlatformContext" }, - "ClientUser": { + "MetricValue": { + "description": "A metric value, with an expected value and a variance; represents a count\nthat may be either exact or estimated (i.e. when sampled).", "type": "object", "properties": { - "userId": { - "description": "The unique numerical ID of the client user\nthat has accepted an invitation.\nThe value of this field is ignored in an update operation.", + "variance": { "format": "int64", + "description": "The variance (i.e. square of the standard deviation) of the metric value.\nIf value is exact, variance is 0.\nCan be used to calculate margin of error as a percentage of value, using\nthe following formula, where Z is the standard constant that depends on the\ndesired size of the confidence interval (e.g. for 90% confidence interval,\nuse Z = 1.645):\n\n marginOfError = 100 * Z * sqrt(variance) / value", "type": "string" }, - "email": { - "description": "User's email address. The value of this field\nis ignored in an update operation.", - "type": "string" - }, - "clientAccountId": { - "description": "Numerical account ID of the client buyer\nwith which the user is associated; the\nbuyer must be a client of the current sponsor buyer.\nThe value of this field is ignored in an update operation.", + "value": { + "type": "string", "format": "int64", - "type": "string" - }, + "description": "The expected value of the metric." + } + }, + "id": "MetricValue" + }, + "ClientUser": { + "description": "A client user is created under a client buyer and has restricted access to\nthe Ad Exchange Marketplace and certain other sections\nof the Ad Exchange Buyer UI based on the role\ngranted to the associated client buyer.\n\nThe only way a new client user can be created is via accepting an\nemail invitation\n(see the\naccounts.clients.invitations.create\nmethod).\n\nAll fields are required unless otherwise specified.", + "type": "object", + "properties": { "status": { "enum": [ "USER_STATUS_UNSPECIFIED", @@ -966,80 +1934,110 @@ "A user that is currently active.", "A user that is currently disabled." ] + }, + "email": { + "description": "User's email address. The value of this field\nis ignored in an update operation.", + "type": "string" + }, + "userId": { + "format": "int64", + "description": "The unique numerical ID of the client user\nthat has accepted an invitation.\nThe value of this field is ignored in an update operation.", + "type": "string" + }, + "clientAccountId": { + "format": "int64", + "description": "Numerical account ID of the client buyer\nwith which the user is associated; the\nbuyer must be a client of the current sponsor buyer.\nThe value of this field is ignored in an update operation.", + "type": "string" } }, - "id": "ClientUser", - "description": "A client user is created under a client buyer and has restricted access to\nthe Ad Exchange Marketplace and certain other sections\nof the Ad Exchange Buyer UI based on the role\ngranted to the associated client buyer.\n\nThe only way a new client user can be created is via accepting an\nemail invitation\n(see the\naccounts.clients.invitations.create\nmethod).\n\nAll fields are required unless otherwise specified." + "id": "ClientUser" }, "CreativeDealAssociation": { "description": "The association between a creative and a deal.", "type": "object", "properties": { - "dealsId": { - "description": "The externalDealId for the deal associated with the creative.", - "type": "string" - }, "accountId": { "description": "The account the creative belongs to.", "type": "string" }, "creativeId": { - "description": "The ID of the creative associated with the deal.", - "type": "string" + "type": "string", + "description": "The ID of the creative associated with the deal." + }, + "dealsId": { + "type": "string", + "description": "The externalDealId for the deal associated with the creative." } }, "id": "CreativeDealAssociation" }, + "FilteringStats": { + "description": "@OutputOnly Filtering reasons for this creative during a period of a single\nday (from midnight to midnight Pacific).", + "type": "object", + "properties": { + "date": { + "$ref": "Date", + "description": "The day during which the data was collected.\nThe data is collected from 00:00:00 to 23:59:59 PT.\nDuring switches from PST to PDT and back, the day may\ncontain 23 or 25 hours of data instead of the usual 24." + }, + "reasons": { + "description": "The set of filtering reasons for this date.", + "items": { + "$ref": "Reason" + }, + "type": "array" + } + }, + "id": "FilteringStats" + }, "Creative": { "description": "A creative and its classification data.", "type": "object", "properties": { - "accountId": { - "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "type": "string" - }, "native": { "description": "A native creative.", "$ref": "NativeContent" }, "servingRestrictions": { "description": "@OutputOnly The granular status of this ad in specific contexts.\nA context here relates to where something ultimately serves (for example,\na physical location, a platform, an HTTPS vs HTTP request, or the type\nof auction).", - "type": "array", "items": { "$ref": "ServingRestriction" - } + }, + "type": "array" }, "video": { - "$ref": "VideoContent", - "description": "A video creative." + "description": "A video creative.", + "$ref": "VideoContent" }, "agencyId": { - "description": "The agency ID for this creative.", "format": "int64", + "description": "The agency ID for this creative.", "type": "string" }, "clickThroughUrls": { "description": "The set of destination URLs for the creative.", - "type": "array", "items": { "type": "string" - } - }, - "detectedSensitiveCategories": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" }, - "description": "@OutputOnly Detected sensitive categories, if any.\nSee the ad-sensitive-categories.txt file in the technical documentation for\na list of IDs. You should use these IDs along with the\nexcluded-sensitive-category field in the bid request to filter your bids." + "type": "array" }, "adChoicesDestinationUrl": { "description": "The link to AdChoices destination page.", "type": "string" }, + "detectedSensitiveCategories": { + "description": "@OutputOnly Detected sensitive categories, if any.\nSee the ad-sensitive-categories.txt file in the technical documentation for\na list of IDs. You should use these IDs along with the\nexcluded-sensitive-category field in the bid request to filter your bids.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + }, "restrictedCategories": { + "enumDescriptions": [ + "The ad has no restricted categories", + "The alcohol restricted category." + ], "description": "All restricted categories for the ads that may be shown from this creative.", - "type": "array", "items": { "enum": [ "NO_RESTRICTED_CATEGORIES", @@ -1047,45 +2045,40 @@ ], "type": "string" }, - "enumDescriptions": [ - "The ad has no restricted categories", - "The alcohol restricted category." - ] + "type": "array" }, "corrections": { "description": "@OutputOnly Shows any corrections that were applied to this creative.", - "type": "array", "items": { "$ref": "Correction" - } + }, + "type": "array" }, "version": { - "type": "integer", + "format": "int32", "description": "@OutputOnly The version of this creative.", - "format": "int32" + "type": "integer" }, "vendorIds": { "description": "All vendor IDs for the ads that may be shown from this creative.\nSee https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt\nfor possible values.", - "type": "array", "items": { "format": "int32", "type": "integer" - } + }, + "type": "array" }, "impressionTrackingUrls": { - "type": "array", + "description": "The set of URLs to be called to record an impression.", "items": { "type": "string" }, - "description": "The set of URLs to be called to record an impression." + "type": "array" }, "html": { - "$ref": "HtmlContent", - "description": "An HTML creative." + "description": "An HTML creative.", + "$ref": "HtmlContent" }, "dealsStatus": { - "description": "@OutputOnly The top-level deals status of this creative.\nIf disapproved, an entry for 'auctionType=DIRECT_DEALS' (or 'ALL') in\nserving_restrictions will also exist. Note\nthat this may be nuanced with other contextual restrictions, in which case,\nit may be preferable to read from serving_restrictions directly.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "type": "string", "enumDescriptions": [ "The status is unknown.", "The creative has not been checked.", @@ -1099,19 +2092,19 @@ "CONDITIONALLY_APPROVED", "APPROVED", "DISAPPROVED" - ] + ], + "description": "@OutputOnly The top-level deals status of this creative.\nIf disapproved, an entry for 'auctionType=DIRECT_DEALS' (or 'ALL') in\nserving_restrictions will also exist. Note\nthat this may be nuanced with other contextual restrictions, in which case,\nit may be preferable to read from serving_restrictions directly.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "type": "string" }, "detectedProductCategories": { - "type": "array", + "description": "@OutputOnly Detected product categories, if any.\nSee the ad-product-categories.txt file in the technical documentation\nfor a list of IDs.", "items": { - "format": "int32", - "type": "integer" + "type": "integer", + "format": "int32" }, - "description": "@OutputOnly Detected product categories, if any.\nSee the ad-product-categories.txt file in the technical documentation\nfor a list of IDs." + "type": "array" }, "openAuctionStatus": { - "description": "@OutputOnly The top-level open auction status of this creative.\nIf disapproved, an entry for 'auctionType = OPEN_AUCTION' (or 'ALL') in\nserving_restrictions will also exist. Note\nthat this may be nuanced with other contextual restrictions, in which case,\nit may be preferable to read from serving_restrictions directly.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "type": "string", "enumDescriptions": [ "The status is unknown.", "The creative has not been checked.", @@ -1125,34 +2118,35 @@ "CONDITIONALLY_APPROVED", "APPROVED", "DISAPPROVED" - ] + ], + "description": "@OutputOnly The top-level open auction status of this creative.\nIf disapproved, an entry for 'auctionType = OPEN_AUCTION' (or 'ALL') in\nserving_restrictions will also exist. Note\nthat this may be nuanced with other contextual restrictions, in which case,\nit may be preferable to read from serving_restrictions directly.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "type": "string" }, "advertiserName": { "description": "The name of the company being advertised in the creative.", "type": "string" }, + "detectedDomains": { + "description": "@OutputOnly\nThe detected domains for this creative.", + "items": { + "type": "string" + }, + "type": "array" + }, "detectedAdvertiserIds": { "description": "@OutputOnly Detected advertiser IDs, if any.", - "type": "array", "items": { "format": "int64", "type": "string" - } - }, - "detectedDomains": { - "description": "@OutputOnly\nThe detected domains for this creative.", - "type": "array", - "items": { - "type": "string" - } + }, + "type": "array" }, "filteringStats": { - "$ref": "FilteringStats", - "description": "@OutputOnly The filtering stats for this creative." + "description": "@OutputOnly The filtering stats for this creative.", + "$ref": "FilteringStats" }, "attributes": { "description": "All attributes for the ads that may be shown from this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "type": "array", "items": { "enum": [ "ATTRIBUTE_UNSPECIFIED", @@ -1182,6 +2176,7 @@ ], "type": "string" }, + "type": "array", "enumDescriptions": [ "Do not use. This is a placeholder value only.", "The creative is tagged.", @@ -1210,60 +2205,54 @@ ] }, "apiUpdateTime": { - "description": "@OutputOnly The last update timestamp of the creative via API.", "format": "google-datetime", + "description": "@OutputOnly The last update timestamp of the creative via API.", "type": "string" }, "detectedLanguages": { "description": "@OutputOnly\nThe detected languages for this creative. The order is arbitrary. The codes\nare 2 or 5 characters and are documented at\nhttps://developers.google.com/adwords/api/docs/appendix/languagecodes.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "creativeId": { "description": "The buyer-defined creative ID of this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod.", "type": "string" + }, + "accountId": { + "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "type": "string" } }, "id": "Creative" }, - "FilteringStats": { - "id": "FilteringStats", - "description": "@OutputOnly Filtering reasons for this creative during a period of a single\nday (from midnight to midnight Pacific).", - "type": "object", - "properties": { - "reasons": { - "description": "The set of filtering reasons for this date.", - "type": "array", - "items": { - "$ref": "Reason" - } - }, - "date": { - "$ref": "Date", - "description": "The day during which the data was collected.\nThe data is collected from 00:00:00 to 23:59:59 PT.\nDuring switches from PST to PDT and back, the day may\ncontain 23 or 25 hours of data instead of the usual 24." - } - } - }, "RemoveDealAssociationRequest": { "description": "A request for removing the association between a deal and a creative.", "type": "object", "properties": { "association": { - "description": "The association between a creative and a deal that should be removed.", - "$ref": "CreativeDealAssociation" + "$ref": "CreativeDealAssociation", + "description": "The association between a creative and a deal that should be removed." } }, "id": "RemoveDealAssociationRequest" }, "Client": { + "description": "A client resource represents a client buyer—an agency,\na brand, or an advertiser customer of the sponsor buyer.\nUsers associated with the client buyer have restricted access to\nthe Ad Exchange Marketplace and certain other sections\nof the Ad Exchange Buyer UI based on the role\ngranted to the client buyer.\nAll fields are required unless otherwise specified.", + "type": "object", "properties": { "clientName": { "description": "Name used to represent this client to publishers.\nYou may have multiple clients that map to the same entity,\nbut for each client the combination of `clientName` and entity\nmust be unique.\nYou can specify this field as empty.", "type": "string" }, "role": { + "enumDescriptions": [ + "A placeholder for an undefined client role.", + "Users associated with this client can see publisher deal offers\nin the Marketplace.\nThey can neither negotiate proposals nor approve deals.\nIf this client is visible to publishers, they can send deal proposals\nto this client.", + "Users associated with this client can respond to deal proposals\nsent to them by publishers. They can also initiate deal proposals\nof their own.", + "Users associated with this client can approve eligible deals\non your behalf. Some deals may still explicitly require publisher\nfinalization. If this role is not selected, the sponsor buyer\nwill need to manually approve each of their deals." + ], "enum": [ "CLIENT_ROLE_UNSPECIFIED", "CLIENT_DEAL_VIEWER", @@ -1271,26 +2260,20 @@ "CLIENT_DEAL_APPROVER" ], "description": "The role which is assigned to the client buyer. Each role implies a set of\npermissions granted to the client. Must be one of `CLIENT_DEAL_VIEWER`,\n`CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`.", - "type": "string", - "enumDescriptions": [ - "A placeholder for an undefined client role.", - "Users associated with this client can see publisher deal offers\nin the Marketplace.\nThey can neither negotiate proposals nor approve deals.\nIf this client is visible to publishers, they can send deal proposals\nto this client.", - "Users associated with this client can respond to deal proposals\nsent to them by publishers. They can also initiate deal proposals\nof their own.", - "Users associated with this client can approve eligible deals\non your behalf. Some deals may still explicitly require publisher\nfinalization. If this role is not selected, the sponsor buyer\nwill need to manually approve each of their deals." - ] + "type": "string" }, "visibleToSeller": { "description": "Whether the client buyer will be visible to sellers.", "type": "boolean" }, "entityId": { - "description": "Numerical identifier of the client entity.\nThe entity can be an advertiser, a brand, or an agency.\nThis identifier is unique among all the entities with the same type.\n\nA list of all known advertisers with their identifiers is available in the\n[advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt)\nfile.\n\nA list of all known brands with their identifiers is available in the\n[brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt)\nfile.\n\nA list of all known agencies with their identifiers is available in the\n[agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt)\nfile.", "format": "int64", + "description": "Numerical identifier of the client entity.\nThe entity can be an advertiser, a brand, or an agency.\nThis identifier is unique among all the entities with the same type.\n\nA list of all known advertisers with their identifiers is available in the\n[advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt)\nfile.\n\nA list of all known brands with their identifiers is available in the\n[brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt)\nfile.\n\nA list of all known agencies with their identifiers is available in the\n[agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt)\nfile.", "type": "string" }, "clientAccountId": { - "description": "The globally-unique numerical ID of the client.\nThe value of this field is ignored in create and update operations.", "format": "int64", + "description": "The globally-unique numerical ID of the client.\nThe value of this field is ignored in create and update operations.", "type": "string" }, "entityName": { @@ -1298,18 +2281,18 @@ "type": "string" }, "status": { - "enum": [ - "CLIENT_STATUS_UNSPECIFIED", - "DISABLED", - "ACTIVE" - ], - "description": "The status of the client buyer.", "type": "string", "enumDescriptions": [ "A placeholder for an undefined client status.", "A client that is currently disabled.", "A client that is currently active." - ] + ], + "enum": [ + "CLIENT_STATUS_UNSPECIFIED", + "DISABLED", + "ACTIVE" + ], + "description": "The status of the client buyer." }, "entityType": { "description": "The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`.", @@ -1328,9 +2311,25 @@ ] } }, - "id": "Client", - "description": "A client resource represents a client buyer—an agency,\na brand, or an advertiser customer of the sponsor buyer.\nUsers associated with the client buyer have restricted access to\nthe Ad Exchange Marketplace and certain other sections\nof the Ad Exchange Buyer UI based on the role\ngranted to the client buyer.\nAll fields are required unless otherwise specified.", - "type": "object" + "id": "Client" + }, + "ListCreativeStatusBreakdownByCreativeResponse": { + "description": "Response message for listing all creatives associated with a given filtered\nbid reason.", + "type": "object", + "properties": { + "filteredBidCreativeRows": { + "description": "List of rows, with counts of bids with a given creative status aggregated\nby creative.", + "items": { + "$ref": "FilteredBidCreativeRow" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListCreativeStatusBreakdownByCreativeRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.filteredBids.creatives.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListCreativeStatusBreakdownByCreativeResponse" }, "Correction": { "description": "@OutputOnly Shows any corrections that were applied to this creative.", @@ -1338,12 +2337,13 @@ "properties": { "details": { "description": "Additional details about what was corrected.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "type": { + "type": "string", "enumDescriptions": [ "The correction type is unknown. Refer to the details for more information.", "The ad's declared vendors did not match the vendors that were detected.\nThe detected vendors were added.", @@ -1372,44 +2372,164 @@ "FLASH_ATTRIBUTE_REMOVED", "VIDEO_IN_SNIPPET_ATTRIBUTE_ADDED" ], - "description": "The type of correction that was applied to the creative.", - "type": "string" + "description": "The type of correction that was applied to the creative." }, "contexts": { "description": "The contexts for the correction.", - "type": "array", "items": { "$ref": "ServingContext" - } + }, + "type": "array" } }, "id": "Correction" }, - "AddDealAssociationRequest": { - "description": "A request for associating a deal and a creative.", - "type": "object", + "FilterSet": { "properties": { - "association": { - "$ref": "CreativeDealAssociation", - "description": "The association between a creative and a deal that should be added." + "sellerNetworkIds": { + "description": "The list of IDs of the seller (publisher) networks on which to filter;\nmay be empty. The filters represented by multiple seller network IDs are\nORed together (i.e. if non-empty, results must match any one of the\npublisher networks).\nSee [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids)\nfile for the set of existing seller network IDs.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + }, + "ownerAccountId": { + "format": "int64", + "description": "The account ID of the buyer who owns this filter set.\nThe value of this field is ignored in create operations.", + "type": "string" + }, + "buyerAccountId": { + "format": "int64", + "description": "The ID of the buyer account on which to filter; optional.", + "type": "string" + }, + "absoluteDateRange": { + "description": "An absolute date range, defined by a start date and an end date.\nInterpreted relative to Pacific time zone.", + "$ref": "AbsoluteDateRange" + }, + "environment": { + "enumDescriptions": [ + "A placeholder for an undefined environment; indicates that no environment\nfilter will be applied.", + "The ad impression appears on the web.", + "The ad impression appears in an app." + ], + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "WEB", + "APP" + ], + "description": "The environment on which to filter; optional.", + "type": "string" + }, + "dealId": { + "format": "int64", + "description": "The ID of the deal on which to filter; optional.", + "type": "string" + }, + "format": { + "enumDescriptions": [ + "A placeholder for an undefined format; indicates that no format filter\nwill be applied.", + "The ad impression is display format (i.e. an image).", + "The ad impression is video format." + ], + "enum": [ + "FORMAT_UNSPECIFIED", + "DISPLAY", + "VIDEO" + ], + "description": "The format on which to filter; optional.", + "type": "string" + }, + "timeSeriesGranularity": { + "enum": [ + "TIME_SERIES_GRANULARITY_UNSPECIFIED", + "HOURLY", + "DAILY" + ], + "description": "The granularity of time intervals if a time series breakdown is desired;\noptional.", + "type": "string", + "enumDescriptions": [ + "A placeholder for an unspecified interval; no time series is applied.\nAll rows in response will contain data for the entire requested time range.", + "Indicates that data will be broken down by the hour.", + "Indicates that data will be broken down by the day." + ] + }, + "filterSetId": { + "format": "int64", + "description": "The ID of the filter set; unique within the account of the filter set\nowner.\nThe value of this field is ignored in create operations.", + "type": "string" + }, + "realtimeTimeRange": { + "description": "An open-ended realtime time range, defined by the aggregation start\ntimestamp.", + "$ref": "RealtimeTimeRange" + }, + "creativeId": { + "description": "The ID of the creative on which to filter; optional.", + "type": "string" + }, + "relativeDateRange": { + "$ref": "RelativeDateRange", + "description": "A relative date range, defined by an offset from today and a duration.\nInterpreted relative to Pacific time zone." + }, + "platforms": { + "description": "The list of platforms on which to filter; may be empty. The filters\nrepresented by multiple platforms are ORed together (i.e. if non-empty,\nresults must match any one of the platforms).", + "items": { + "type": "string", + "enum": [ + "PLATFORM_UNSPECIFIED", + "DESKTOP", + "TABLET", + "MOBILE" + ] + }, + "type": "array", + "enumDescriptions": [ + "A placeholder for an undefined platform; indicates that no platform\nfilter will be applied.", + "The ad impression appears on a desktop.", + "The ad impression appears on a tablet.", + "The ad impression appears on a mobile device." + ] } }, - "id": "AddDealAssociationRequest" + "id": "FilterSet", + "description": "A set of filters that is applied to a request for data.\nWithin a filter set, an AND operation is performed across the filters\nrepresented by each field. An OR operation is performed across the filters\nrepresented by the multiple values of a repeated field. E.g.\n\"format=VIDEO AND deal_id=12 AND (seller_network_id=34 OR\nseller_network_id=56)\"", + "type": "object" + }, + "CalloutStatusRow": { + "description": "The number of impressions with the specified dimension values where the\ncorresponding bid request or bid response was not successful, as described by\nthe specified callout status.", + "type": "object", + "properties": { + "calloutStatusId": { + "format": "int32", + "description": "The ID of the callout status.\nSee [callout-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/callout-status-codes).", + "type": "integer" + }, + "impressionCount": { + "$ref": "MetricValue", + "description": "The number of impressions for which there was a bid request or bid response\nwith the specified callout status." + }, + "rowDimensions": { + "$ref": "RowDimensions", + "description": "The values of all dimensions associated with metric values in this row." + } + }, + "id": "CalloutStatusRow" }, "ListDealAssociationsResponse": { "description": "A response for listing creative and deal associations", "type": "object", "properties": { "nextPageToken": { - "type": "string", - "description": "A token to retrieve the next page of results.\nPass this value in the\nListDealAssociationsRequest.page_token\nfield in the subsequent call to 'ListDealAssociation' method to retrieve\nthe next page of results." + "description": "A token to retrieve the next page of results.\nPass this value in the\nListDealAssociationsRequest.page_token\nfield in the subsequent call to 'ListDealAssociation' method to retrieve\nthe next page of results.", + "type": "string" }, "associations": { "description": "The list of associations.", - "type": "array", "items": { "$ref": "CreativeDealAssociation" - } + }, + "type": "array" } }, "id": "ListDealAssociationsResponse" @@ -1421,18 +2541,18 @@ "id": "StopWatchingCreativeRequest" }, "Disapproval": { - "id": "Disapproval", "description": "@OutputOnly The reason and details for a disapproval.", "type": "object", "properties": { "details": { "description": "Additional details about the reason for disapproval.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "reason": { + "type": "string", "enumDescriptions": [ "The length of the image animation is longer than allowed.", "The click through URL doesn't work properly.", @@ -1625,30 +2745,18 @@ "PERSONAL_LOANS", "UNSUPPORTED_FLASH_CONTENT" ], - "description": "The categorized reason for disapproval.", - "type": "string" + "description": "The categorized reason for disapproval." } - } + }, + "id": "Disapproval" }, "ServingRestriction": { "description": "@OutputOnly A representation of the status of an ad in a\nspecific context. A context here relates to where something ultimately serves\n(for example, a user or publisher geo, a platform, an HTTPS vs HTTP request,\nor the type of auction).", "type": "object", "properties": { - "disapprovalReasons": { - "description": "Any disapprovals bound to this restriction.\nOnly present if status=DISAPPROVED.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "type": "array", - "items": { - "$ref": "Disapproval" - } - }, - "contexts": { - "description": "The contexts for the restriction.", - "type": "array", - "items": { - "$ref": "ServingContext" - } - }, "status": { + "description": "The status of the creative in this context (for example, it has been\nexplicitly disapproved or is pending review).", + "type": "string", "enumDescriptions": [ "The status is not known.", "The ad was disapproved in this context.", @@ -1658,51 +2766,63 @@ "STATUS_UNSPECIFIED", "DISAPPROVAL", "PENDING_REVIEW" - ], - "description": "The status of the creative in this context (for example, it has been\nexplicitly disapproved or is pending review).", - "type": "string" + ] + }, + "disapprovalReasons": { + "description": "Any disapprovals bound to this restriction.\nOnly present if status=DISAPPROVED.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "items": { + "$ref": "Disapproval" + }, + "type": "array" + }, + "contexts": { + "description": "The contexts for the restriction.", + "items": { + "$ref": "ServingContext" + }, + "type": "array" } }, "id": "ServingRestriction" }, "Date": { + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", "type": "object", "properties": { - "year": { - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "day": { "format": "int32", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", "type": "integer" }, - "day": { - "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", + "year": { + "type": "integer", "format": "int32", - "type": "integer" + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year." }, "month": { - "description": "Month of year. Must be from 1 to 12.", "format": "int32", + "description": "Month of year. Must be from 1 to 12.", "type": "integer" } }, - "id": "Date", - "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`." + "id": "Date" }, - "Empty": { - "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {} - }, - "WatchCreativeRequest": { - "description": "A request for watching changes to creative Status.", + "RowDimensions": { + "id": "RowDimensions", + "description": "A response may include multiple rows, breaking down along various dimensions.\nEncapsulates the values of all dimensions for a given row.", "type": "object", "properties": { - "topic": { - "description": "The Pub/Sub topic to publish notifications to.\nThis topic must already exist and must give permission to\nad-exchange-buyside-reports@google.com to write to the topic.\nThis should be the full resource name in\n\"projects/{project_id}/topics/{topic_id}\" format.", - "type": "string" + "timeInterval": { + "$ref": "TimeInterval", + "description": "The time interval that this row represents." } - }, - "id": "WatchCreativeRequest" + } + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" }, "AppContext": { "description": "@OutputOnly The app type the restriction applies to for mobile device.", @@ -1710,7 +2830,6 @@ "properties": { "appTypes": { "description": "The app types this restriction applies to.", - "type": "array", "items": { "enum": [ "NATIVE", @@ -1718,6 +2837,7 @@ ], "type": "string" }, + "type": "array", "enumDescriptions": [ "Native app context.", "Mobile web app context." @@ -1726,115 +2846,58 @@ }, "id": "AppContext" }, - "NativeContent": { - "description": "Native content for a creative.", + "ListFilteredBidsResponse": { + "description": "Response message for listing all reasons that bids were filtered from the\nauction.", "type": "object", "properties": { - "storeUrl": { - "description": "The URL to the app store to purchase/download the promoted app.", - "type": "string" - }, - "headline": { - "description": "A short title for the ad.", - "type": "string" - }, - "appIcon": { - "$ref": "Image", - "description": "The app icon, for app download ads." - }, - "callToAction": { - "description": "A label for the button that the user is supposed to click.", - "type": "string" - }, - "body": { - "description": "A long description of the ad.", - "type": "string" - }, - "starRating": { - "description": "The app rating in the app store. Must be in the range [0-5].", - "format": "double", - "type": "number" - }, - "videoUrl": { - "description": "The URL to fetch a native video ad.", - "type": "string" - }, - "clickLinkUrl": { - "description": "The URL that the browser/SDK will load when the user clicks the ad.", - "type": "string" - }, - "logo": { - "description": "A smaller image, for the advertiser's logo.", - "$ref": "Image" - }, - "priceDisplayText": { - "description": "The price of the promoted app including currency info.", - "type": "string" - }, - "clickTrackingUrl": { - "type": "string", - "description": "The URL to use for click tracking." - }, - "image": { - "$ref": "Image", - "description": "A large image." - }, - "advertiserName": { - "description": "The name of the advertiser or sponsor, to be displayed in the ad creative.", - "type": "string" - } - }, - "id": "NativeContent" - }, - "ListClientsResponse": { - "type": "object", - "properties": { - "nextPageToken": { - "description": "A token to retrieve the next page of results.\nPass this value in the\nListClientsRequest.pageToken\nfield in the subsequent call to the\naccounts.clients.list method\nto retrieve the next page of results.", - "type": "string" - }, - "clients": { - "description": "The returned list of clients.", - "type": "array", + "creativeStatusRows": { "items": { - "$ref": "Client" - } + "$ref": "CreativeStatusRow" + }, + "type": "array", + "description": "List of rows, with counts of filtered bids aggregated by filtering reason\n(i.e. creative status)." + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListFilteredBidsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.filteredBids.list\nmethod to retrieve the next page of results.", + "type": "string" } }, - "id": "ListClientsResponse" + "id": "ListFilteredBidsResponse" }, "SecurityContext": { - "id": "SecurityContext", "description": "@OutputOnly A security context.", "type": "object", "properties": { "securities": { - "description": "The security types in this context.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "INSECURE", - "SSL" - ] - }, "enumDescriptions": [ "Matches impressions that require insecure compatibility.", "Matches impressions that require SSL compatibility." - ] + ], + "description": "The security types in this context.", + "items": { + "enum": [ + "INSECURE", + "SSL" + ], + "type": "string" + }, + "type": "array" } - } + }, + "id": "SecurityContext" }, "HtmlContent": { + "description": "HTML content for a creative.", + "type": "object", "properties": { "height": { - "description": "The height of the HTML snippet in pixels.", + "type": "integer", "format": "int32", - "type": "integer" + "description": "The height of the HTML snippet in pixels." }, "width": { - "description": "The width of the HTML snippet in pixels.", "format": "int32", + "description": "The width of the HTML snippet in pixels.", "type": "integer" }, "snippet": { @@ -1842,9 +2905,7 @@ "type": "string" } }, - "id": "HtmlContent", - "description": "HTML content for a creative.", - "type": "object" + "id": "HtmlContent" }, "ListCreativesResponse": { "description": "A response for listing creatives.", @@ -1852,93 +2913,107 @@ "properties": { "creatives": { "description": "The list of creatives.", - "type": "array", "items": { "$ref": "Creative" - } + }, + "type": "array" }, "nextPageToken": { - "type": "string", - "description": "A token to retrieve the next page of results.\nPass this value in the\nListCreativesRequest.page_token\nfield in the subsequent call to `ListCreatives` method to retrieve the next\npage of results." + "description": "A token to retrieve the next page of results.\nPass this value in the\nListCreativesRequest.page_token\nfield in the subsequent call to `ListCreatives` method to retrieve the next\npage of results.", + "type": "string" } }, "id": "ListCreativesResponse" }, - "ServingContext": { - "description": "The serving context for this restriction.", + "ListFilteredBidRequestsResponse": { + "description": "Response message for listing all reasons that bid requests were filtered and\nnot sent to the buyer.", "type": "object", "properties": { - "location": { - "description": "Matches impressions coming from users *or* publishers in a specific\nlocation.", - "$ref": "LocationContext" + "calloutStatusRows": { + "description": "List of rows, with counts of filtered bid requests aggregated by callout\nstatus.", + "items": { + "$ref": "CalloutStatusRow" + }, + "type": "array" }, - "auctionType": { - "description": "Matches impressions for a particular auction type.", - "$ref": "AuctionContext" - }, - "all": { - "enumDescriptions": [ - "A simple context." - ], - "enum": [ - "SIMPLE_CONTEXT" - ], - "description": "Matches all contexts.", + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListFilteredBidRequestsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.filteredBidRequests.list\nmethod to retrieve the next page of results.", "type": "string" - }, - "appType": { - "description": "Matches impressions for a particular app type.", - "$ref": "AppContext" - }, - "securityType": { - "description": "Matches impressions for a particular security type.", - "$ref": "SecurityContext" - }, - "platform": { - "description": "Matches impressions coming from a particular platform.", - "$ref": "PlatformContext" } }, - "id": "ServingContext" + "id": "ListFilteredBidRequestsResponse" }, - "Image": { - "id": "Image", - "description": "An image resource. You may provide a larger image than was requested,\nso long as the aspect ratio is preserved.", + "ListBidMetricsResponse": { + "description": "Response message for listing the metrics that are measured in number of bids.", "type": "object", "properties": { - "width": { - "description": "Image width in pixels.", - "format": "int32", - "type": "integer" + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListBidMetricsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.bidMetrics.list\nmethod to retrieve the next page of results.", + "type": "string" }, - "url": { - "type": "string", - "description": "The URL of the image." - }, - "height": { - "description": "Image height in pixels.", - "format": "int32", - "type": "integer" + "bidMetricsRows": { + "description": "List of rows, each containing a set of bid metrics.", + "items": { + "$ref": "BidMetricsRow" + }, + "type": "array" } - } + }, + "id": "ListBidMetricsResponse" }, "Reason": { "description": "A specific filtering status and how many times it occurred.", "type": "object", "properties": { - "count": { - "description": "The number of times the creative was filtered for the status. The\ncount is aggregated across all publishers on the exchange.", - "format": "int64", - "type": "string" - }, "status": { - "type": "integer", + "format": "int32", "description": "The filtering status code. Please refer to the\n[creative-status-codes.txt](https://storage.googleapis.com/adx-rtb-dictionaries/creative-status-codes.txt)\nfile for different statuses.", - "format": "int32" + "type": "integer" + }, + "count": { + "format": "int64", + "description": "The number of times the creative was filtered for the status. The\ncount is aggregated across all publishers on the exchange.", + "type": "string" } }, "id": "Reason" }, + "ListNonBillableWinningBidsResponse": { + "description": "Response message for listing all reasons for which a buyer was not billed for\na winning bid.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListNonBillableWinningBidsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.nonBillableWinningBids.list\nmethod to retrieve the next page of results.", + "type": "string" + }, + "nonBillableWinningBidStatusRows": { + "description": "List of rows, with counts of bids not billed aggregated by reason.", + "items": { + "$ref": "NonBillableWinningBidStatusRow" + }, + "type": "array" + } + }, + "id": "ListNonBillableWinningBidsResponse" + }, + "ListLosingBidsResponse": { + "description": "Response message for listing all reasons that bids lost in the auction.", + "type": "object", + "properties": { + "creativeStatusRows": { + "description": "List of rows, with counts of losing bids aggregated by loss reason (i.e.\ncreative status).", + "items": { + "$ref": "CreativeStatusRow" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListLosingBidsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.losingBids.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListLosingBidsResponse" + }, "VideoContent": { "description": "Video content for a creative.", "type": "object", @@ -1950,42 +3025,230 @@ }, "id": "VideoContent" }, - "ClientUserInvitation": { - "description": "An invitation for a new client user to get access to the Ad Exchange\nBuyer UI.\nAll fields are required unless otherwise specified.", + "ImpressionMetricsRow": { + "description": "The set of metrics that are measured in numbers of impressions, representing\nhow many impressions with the specified dimension values were considered\neligible at each stage of the bidding funnel.", "type": "object", "properties": { - "clientAccountId": { - "description": "Numerical account ID of the client buyer\nthat the invited user is associated with.\nThe value of this field is ignored in create operations.", - "format": "int64", + "rowDimensions": { + "description": "The values of all dimensions associated with metric values in this row.", + "$ref": "RowDimensions" + }, + "availableImpressions": { + "$ref": "MetricValue", + "description": "The number of impressions available to the buyer on Ad Exchange.\nIn some cases this value may be unavailable." + }, + "inventoryMatches": { + "description": "The number of impressions that match the buyer's inventory pretargeting.", + "$ref": "MetricValue" + }, + "bidRequests": { + "$ref": "MetricValue", + "description": "The number of impressions for which Ad Exchange sent the buyer a bid\nrequest." + }, + "responsesWithBids": { + "description": "The number of impressions for which Ad Exchange received a response from\nthe buyer that contained at least one applicable bid.", + "$ref": "MetricValue" + }, + "successfulResponses": { + "description": "The number of impressions for which the buyer successfully sent a response\nto Ad Exchange.", + "$ref": "MetricValue" + } + }, + "id": "ImpressionMetricsRow" + }, + "AuctionContext": { + "description": "@OutputOnly The auction type the restriction applies to.", + "type": "object", + "properties": { + "auctionTypes": { + "enumDescriptions": [ + "The restriction applies to open auction.", + "The restriction applies to direct deals." + ], + "description": "The auction types this restriction applies to.", + "items": { + "enum": [ + "OPEN_AUCTION", + "DIRECT_DEALS" + ], + "type": "string" + }, + "type": "array" + } + }, + "id": "AuctionContext" + }, + "ListImpressionMetricsResponse": { + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListImpressionMetricsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.impressionMetrics.list\nmethod to retrieve the next page of results.", "type": "string" }, - "invitationId": { - "description": "The unique numerical ID of the invitation that is sent to the user.\nThe value of this field is ignored in create operations.", - "format": "int64", - "type": "string" + "impressionMetricsRows": { + "description": "List of rows, each containing a set of impression metrics.", + "items": { + "$ref": "ImpressionMetricsRow" + }, + "type": "array" + } + }, + "id": "ListImpressionMetricsResponse", + "description": "Response message for listing the metrics that are measured in number of\nimpressions.", + "type": "object" + }, + "BidMetricsRow": { + "properties": { + "impressionsWon": { + "$ref": "MetricValue", + "description": "The number of bids that won an impression." }, - "email": { - "description": "The email address to which the invitation is sent. Email\naddresses should be unique among all client users under each sponsor\nbuyer.", + "viewableImpressions": { + "$ref": "MetricValue", + "description": "The number of bids for which the corresponding impression was viewable (as\ndefined by Active View)." + }, + "measurableImpressions": { + "$ref": "MetricValue", + "description": "The number of bids for which the corresponding impression was measurable\nfor viewability (as defined by Active View)." + }, + "bids": { + "description": "The number of bids that Ad Exchange received from the buyer.", + "$ref": "MetricValue" + }, + "billedImpressions": { + "description": "The number of bids for which the buyer was billed.", + "$ref": "MetricValue" + }, + "bidsInAuction": { + "description": "The number of bids that were permitted to compete in the auction.", + "$ref": "MetricValue" + }, + "rowDimensions": { + "description": "The values of all dimensions associated with metric values in this row.", + "$ref": "RowDimensions" + } + }, + "id": "BidMetricsRow", + "description": "The set of metrics that are measured in numbers of bids, representing how\nmany bids with the specified dimension values were considered eligible at\neach stage of the bidding funnel;", + "type": "object" + }, + "ListBidResponseErrorsResponse": { + "description": "Response message for listing all reasons that bid responses resulted in an\nerror.", + "type": "object", + "properties": { + "calloutStatusRows": { + "description": "List of rows, with counts of bid responses aggregated by callout status.", + "items": { + "$ref": "CalloutStatusRow" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListBidResponseErrorsRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.bidResponseErrors.list\nmethod to retrieve the next page of results.", "type": "string" } }, - "id": "ClientUserInvitation" + "id": "ListBidResponseErrorsResponse" + }, + "CreativeStatusRow": { + "description": "The number of bids with the specified dimension values that did not win the\nauction (either were filtered pre-auction or lost the auction), as described\nby the specified creative status.", + "type": "object", + "properties": { + "rowDimensions": { + "description": "The values of all dimensions associated with metric values in this row.", + "$ref": "RowDimensions" + }, + "creativeStatusId": { + "format": "int32", + "description": "The ID of the creative status.\nSee [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).", + "type": "integer" + }, + "bidCount": { + "description": "The number of bids with the specified status.", + "$ref": "MetricValue" + } + }, + "id": "CreativeStatusRow" + }, + "RealtimeTimeRange": { + "description": "An open-ended realtime time range specified by the start timestamp.\nFor filter sets that specify a realtime time range RTB metrics continue to\nbe aggregated throughout the lifetime of the filter set.", + "type": "object", + "properties": { + "startTimestamp": { + "format": "google-datetime", + "description": "The start timestamp of the real-time RTB metrics aggregation.", + "type": "string" + } + }, + "id": "RealtimeTimeRange" + }, + "NonBillableWinningBidStatusRow": { + "description": "The number of winning bids with the specified dimension values for which the\nbuyer was not billed, as described by the specified status.", + "type": "object", + "properties": { + "status": { + "enumDescriptions": [ + "A placeholder for an undefined status.\nThis value will never be returned in responses.", + "The buyer was not billed because the ad was not rendered by the\npublisher.", + "The buyer was not billed because the impression won by the bid was\ndetermined to be invalid." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "AD_NOT_RENDERED", + "INVALID_IMPRESSION" + ], + "description": "The status specifying why the winning bids were not billed.", + "type": "string" + }, + "rowDimensions": { + "description": "The values of all dimensions associated with metric values in this row.", + "$ref": "RowDimensions" + }, + "bidCount": { + "$ref": "MetricValue", + "description": "The number of bids with the specified status." + } + }, + "id": "NonBillableWinningBidStatusRow" + }, + "FilteredBidDetailRow": { + "description": "The number of filtered bids with the specified dimension values, among those\nfiltered due to the requested filtering reason (i.e. creative status), that\nhave the specified detail.", + "type": "object", + "properties": { + "rowDimensions": { + "$ref": "RowDimensions", + "description": "The values of all dimensions associated with metric values in this row." + }, + "detailId": { + "format": "int32", + "description": "The ID of the detail. The associated value can be looked up in the\ndictionary file corresponding to the DetailType in the response message.", + "type": "integer" + }, + "bidCount": { + "description": "The number of bids with the specified detail.", + "$ref": "MetricValue" + } + }, + "id": "FilteredBidDetailRow" + }, + "AbsoluteDateRange": { + "description": "An absolute date range, specified by its start date and end date.\nThe supported range of dates begins 30 days before today and ends today.\nValidity checked upon filter set creation. If a filter set with an absolute\ndate range is run at a later date more than 30 days after start_date, it will\nfail.", + "type": "object", + "properties": { + "endDate": { + "description": "The end date of the range (inclusive).\nMust be within the 30 days leading up to current date, and must be equal to\nor after start_date.", + "$ref": "Date" + }, + "startDate": { + "$ref": "Date", + "description": "The start date of the range (inclusive).\nMust be within the 30 days leading up to current date, and must be equal to\nor before end_date." + } + }, + "id": "AbsoluteDateRange" } }, "protocol": "rest", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, - "canonicalName": "AdExchangeBuyerII", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/adexchange.buyer": { - "description": "Manage your Ad Exchange buyer account configuration" - } - } - } - }, - "rootUrl": "https://adexchangebuyer.googleapis.com/" + } } diff --git a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json index e2032b9caf..9dae67df86 100644 --- a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json @@ -21,7 +21,7 @@ "basePath": "/adexchangeseller/v1.1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adexchangeseller/v1.1/", - "batchPath": "batch", + "batchPath": "batch/adexchangeseller/v1.1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/adexchangeseller/v1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1/adexchangeseller-api.json index bed2ec9cef..19545cba9c 100644 --- a/etc/api/adexchangeseller/v1/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v1/adexchangeseller-api.json @@ -21,7 +21,7 @@ "basePath": "/adexchangeseller/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adexchangeseller/v1/", - "batchPath": "batch", + "batchPath": "batch/adexchangeseller/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json b/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json index cc30a1ea58..99d812aed9 100644 --- a/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json @@ -21,7 +21,7 @@ "basePath": "/adexchangeseller/v2.0/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adexchangeseller/v2.0/", - "batchPath": "batch", + "batchPath": "batch/adexchangeseller/v2.0", "parameters": { "alt": { "type": "string", diff --git a/etc/api/adexperiencereport/v1/adexperiencereport-api.json b/etc/api/adexperiencereport/v1/adexperiencereport-api.json new file mode 100644 index 0000000000..073895c30f --- /dev/null +++ b/etc/api/adexperiencereport/v1/adexperiencereport-api.json @@ -0,0 +1,283 @@ +{ + "version": "v1", + "baseUrl": "https://adexperiencereport.googleapis.com/", + "servicePath": "", + "description": "View Ad Experience Report data, and get a list of sites that have a significant number of annoying ads.", + "kind": "discovery#restDescription", + "basePath": "", + "documentationLink": "https://developers.google.com/ad-experience-report/", + "revision": "20170918", + "id": "adexperiencereport:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "PlatformSummary": { + "description": "Summary of the ad experience rating of a site for a specific platform.", + "type": "object", + "properties": { + "filterStatus": { + "enumDescriptions": [ + "N/A.", + "Ad filtering is on.", + "Ad filtering is off.", + "Ad filtering is paused.", + "Ad filtering is pending." + ], + "enum": [ + "UNKNOWN", + "ON", + "OFF", + "PAUSED", + "PENDING" + ], + "description": "The ad filtering status of the site.", + "type": "string" + }, + "underReview": { + "description": "Whether the site is currently under review.", + "type": "boolean" + }, + "reportUrl": { + "description": "A link that leads to a full ad experience report.", + "type": "string" + }, + "lastChangeTime": { + "format": "google-datetime", + "description": "The last time that the site changed status.", + "type": "string" + }, + "betterAdsStatus": { + "enum": [ + "UNKNOWN", + "PASSING", + "WARNING", + "FAILING" + ], + "description": "The status of the site reviewed for the Better Ads Standards.", + "type": "string", + "enumDescriptions": [ + "Not reviewed.", + "Passing.", + "Warning.", + "Failing." + ] + }, + "enforcementTime": { + "format": "google-datetime", + "description": "The date on which ad filtering begins.", + "type": "string" + }, + "region": { + "description": "The assigned regions for the site and platform.", + "items": { + "enum": [ + "REGION_UNKNOWN", + "REGION_A", + "REGION_B" + ], + "type": "string" + }, + "type": "array", + "enumDescriptions": [ + "Ad standard not yet defined for your region.", + "Region A.", + "Region B." + ] + } + }, + "id": "PlatformSummary" + }, + "ViolatingSitesResponse": { + "properties": { + "violatingSites": { + "description": "A list of summaries of violating sites.", + "items": { + "$ref": "SiteSummaryResponse" + }, + "type": "array" + } + }, + "id": "ViolatingSitesResponse", + "description": "Response message for ListViolatingSites.", + "type": "object" + }, + "SiteSummaryResponse": { + "description": "Response message for GetSiteSummary.", + "type": "object", + "properties": { + "mobileSummary": { + "description": "Summary for the mobile review of the site.", + "$ref": "PlatformSummary" + }, + "reviewedSite": { + "description": "The name of the site reviewed.", + "type": "string" + }, + "desktopSummary": { + "description": "Summary for the desktop review of the site.", + "$ref": "PlatformSummary" + } + }, + "id": "SiteSummaryResponse" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Ad Experience Report", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/xapi.zoo": { + "description": "Test scope for access to the Zoo service" + } + } + } + }, + "rootUrl": "https://adexperiencereport.googleapis.com/", + "ownerDomain": "google.com", + "name": "adexperiencereport", + "batchPath": "batch", + "title": "Google Ad Experience Report API", + "ownerName": "Google", + "resources": { + "violatingSites": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ViolatingSitesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/xapi.zoo" + ], + "flatPath": "v1/violatingSites", + "path": "v1/violatingSites", + "id": "adexperiencereport.violatingSites.list", + "description": "Lists sites with Ad Experience Report statuses of \"Failing\" or \"Warning\"." + } + } + }, + "sites": { + "methods": { + "get": { + "response": { + "$ref": "SiteSummaryResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^sites/[^/]+$", + "location": "path", + "description": "The required site name. It should be the site property whose ad experiences\nmay have been reviewed, and it should be URL-encoded. For example,\nsites/https%3A%2F%2Fwww.google.com. The server will return an error of\nBAD_REQUEST if this field is not filled in. Note that if the site property\nis not yet verified in Search Console, the reportUrl field returned by the\nAPI will lead to the verification page, prompting the user to go through\nthat process before they can gain access to the Ad Experience Report.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/xapi.zoo" + ], + "flatPath": "v1/sites/{sitesId}", + "id": "adexperiencereport.sites.get", + "path": "v1/{+name}", + "description": "Gets a summary of the ad experience rating of a site." + } + } + } + }, + "parameters": { + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + } + } +} diff --git a/etc/api/adexperiencereport/v1/crates/1.0.6-api+20170918 b/etc/api/adexperiencereport/v1/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adexperiencereport/v1/crates/1.0.6-cli+20170918 b/etc/api/adexperiencereport/v1/crates/1.0.6-cli+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/admin/datatransfer_v1/admin-api.json b/etc/api/admin/datatransfer_v1/admin-api.json index 085b196376..0f43659eb2 100644 --- a/etc/api/admin/datatransfer_v1/admin-api.json +++ b/etc/api/admin/datatransfer_v1/admin-api.json @@ -22,7 +22,7 @@ "basePath": "/admin/datatransfer/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "admin/datatransfer/v1/", - "batchPath": "batch", + "batchPath": "batch/admin/datatransfer_v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/admin/directory_v1/admin-api.json b/etc/api/admin/directory_v1/admin-api.json index ad22207d51..33fcb8713d 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Hgzlsu38y56tOKi_wO3_mjV37MM\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/JB19efQGH5f-JRT49yZz7BTyNQU\"", "discoveryVersion": "v1", "id": "admin:directory_v1", "name": "admin", "canonicalName": "directory", "version": "directory_v1", - "revision": "20170419", + "revision": "20170830", "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", @@ -22,7 +22,7 @@ "basePath": "/admin/directory/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "admin/directory/v1/", - "batchPath": "batch", + "batchPath": "batch/admin/directory_v1", "parameters": { "alt": { "type": "string", @@ -277,6 +277,10 @@ "type": "string", "description": "ETag of the resource." }, + "generatedResourceName": { + "type": "string", + "description": "The auto-generated name of the calendar resource which includes metadata about the resource such as building name, floor, capacity, etc. For example, NYC-2-Training Room 1A (16)" + }, "kind": { "type": "string", "description": "The type of the resource. For calendar resources, the value is admin#directory#resources#calendars#CalendarResource.", @@ -292,21 +296,11 @@ }, "resourceId": { "type": "string", - "description": "The unique ID for the calendar resource.", - "annotations": { - "required": [ - "directory.resources.calendars.insert" - ] - } + "description": "The unique ID for the calendar resource." }, "resourceName": { "type": "string", - "description": "The name of the calendar resource. For example, Training Room 1A", - "annotations": { - "required": [ - "directory.resources.calendars.insert" - ] - } + "description": "The name of the calendar resource. For example, Training Room 1A" }, "resourceType": { "type": "string", @@ -579,6 +573,25 @@ } } }, + "ChromeOsMoveDevicesToOu": { + "id": "ChromeOsMoveDevicesToOu", + "type": "object", + "description": "JSON request template for moving ChromeOs Device to given OU in Directory Devices API.", + "properties": { + "deviceIds": { + "type": "array", + "description": "ChromeOs Devices to be moved to OU", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "directory.chromeosdevices.moveDevicesToOu" + ] + } + } + } + }, "Customer": { "id": "Customer", "type": "object", @@ -1824,6 +1837,9 @@ "externalIds": { "type": "any" }, + "gender": { + "type": "any" + }, "hashFunction": { "type": "string", "description": "Hash function name for password. Supported are MD5, SHA-1 and crypt" @@ -1868,12 +1884,18 @@ "description": "Is mailbox setup (Read-only)", "readOnly": true }, + "keywords": { + "type": "any" + }, "kind": { "type": "string", "description": "Kind of resource this is.", "default": "admin#directory#user", "readOnly": true }, + "languages": { + "type": "any" + }, "lastLoginTime": { "type": "string", "description": "User's last login time. (Read-only)", @@ -2088,6 +2110,24 @@ } } }, + "UserGender": { + "id": "UserGender", + "type": "object", + "properties": { + "addressMeAs": { + "type": "string", + "description": "AddressMeAs. A human-readable string containing the proper way to refer to the profile owner by humans, for example \"he/him/his\" or \"they/them/their\"." + }, + "customGender": { + "type": "string", + "description": "Custom gender." + }, + "type": { + "type": "string", + "description": "Gender." + } + } + }, "UserIm": { "id": "UserIm", "type": "object", @@ -2119,6 +2159,40 @@ } } }, + "UserKeyword": { + "id": "UserKeyword", + "type": "object", + "description": "JSON template for a keyword entry.", + "properties": { + "customType": { + "type": "string", + "description": "Custom Type." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard type of that entry. For example, keyword could be of type occupation or outlook. In addition to the standard type, an entry can have a custom type and can give it any name. Such types should have the CUSTOM value as type and also have a customType value." + }, + "value": { + "type": "string", + "description": "Keyword." + } + } + }, + "UserLanguage": { + "id": "UserLanguage", + "type": "object", + "description": "JSON template for a language entry.", + "properties": { + "customLanguage": { + "type": "string", + "description": "Other language. User can provide own language name if there is no corresponding Google III language code. If this is set LanguageCode can't be set" + }, + "languageCode": { + "type": "string", + "description": "Language Code. Should be used for storing Google III LanguageCode string representation for language. Illegal values cause SchemaException." + } + } + }, "UserLocation": { "id": "UserLocation", "type": "object", @@ -2126,7 +2200,7 @@ "properties": { "area": { "type": "string", - "description": "Textual location. This is most useful for display purposes to concisely describe the location. E.g. \"Mountain View, CA\", \"Near Seattle\", \"US-NYC-9TH 9A209A\"." + "description": "Textual location. This is most useful for display purposes to concisely describe the location. For example, \"Mountain View, CA\", \"Near Seattle\", \"US-NYC-9TH 9A209A\"." }, "buildingId": { "type": "string", @@ -2146,7 +2220,7 @@ }, "floorSection": { "type": "string", - "description": "Floor Section. More specific location within the floor. E.g. if a floor is divided into sections \"A\", \"B\", and \"C\", this field would identify one of those values." + "description": "Floor section. More specific location within the floor. For example, if a floor is divided into sections \"A\", \"B\", and \"C\", this field would identify one of those values." }, "type": { "type": "string", @@ -2224,6 +2298,11 @@ "type": "string", "description": "The domain to which the organization belongs to." }, + "fullTimeEquivalent": { + "type": "integer", + "description": "The full-time equivalent percent within the organization (100000 = 100%).", + "format": "int32" + }, "location": { "type": "string", "description": "Location of the organization. This need not be fully qualified address." @@ -2331,9 +2410,9 @@ "description": "The GECOS (user information) for this account." }, "gid": { - "type": "integer", + "type": "string", "description": "The default group ID.", - "format": "int32" + "format": "uint64" }, "homeDirectory": { "type": "string", @@ -2352,9 +2431,9 @@ "description": "System identifier for which account Username or Uid apply to." }, "uid": { - "type": "integer", + "type": "string", "description": "The POSIX compliant user ID.", - "format": "int32" + "format": "uint64" }, "username": { "type": "string", @@ -2740,6 +2819,11 @@ ], "location": "query" }, + "orgUnitPath": { + "type": "string", + "description": "Full path of the organization unit or its Id", + "location": "query" + }, "pageToken": { "type": "string", "description": "Token to specify next page in the list", @@ -2788,6 +2872,36 @@ "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" ] }, + "moveDevicesToOu": { + "id": "directory.chromeosdevices.moveDevicesToOu", + "path": "customer/{customerId}/devices/chromeos/moveDevicesToOu", + "httpMethod": "POST", + "description": "Move or insert multiple Chrome OS Devices to Organization Unit", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable ID of the G Suite account", + "required": true, + "location": "path" + }, + "orgUnitPath": { + "type": "string", + "description": "Full path of the target organization unit or its Id", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "customerId", + "orgUnitPath" + ], + "request": { + "$ref": "ChromeOsMoveDevicesToOu" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.device.chromeos" + ] + }, "patch": { "id": "directory.chromeosdevices.patch", "path": "customer/{customerId}/devices/chromeos/{deviceId}", diff --git a/etc/api/admin/directory_v1/crates/1.0.6-api+20170830 b/etc/api/admin/directory_v1/crates/1.0.6-api+20170830 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/admin/reports_v1/admin-api.json b/etc/api/admin/reports_v1/admin-api.json index 6d41b826d6..b37a057687 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/-tkaOVzArVVhbxGreMOY21mRaV8\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/YvMEbSpUd5h8xmSpskCE_HPECco\"", "discoveryVersion": "v1", "id": "admin:reports_v1", "name": "admin", "canonicalName": "reports", "version": "reports_v1", - "revision": "20170320", + "revision": "20170622", "title": "Admin Reports API", "description": "Fetches reports for the administrators of G Suite customers 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)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)", + "pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)", "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)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)", + "pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)", "location": "path" }, "customerId": { @@ -659,7 +659,7 @@ "parameters": { "type": "string", "description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.", - "pattern": "(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+)", + "pattern": "(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+,)*(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+)", "location": "query" } }, diff --git a/etc/api/admin/reports_v1/crates/1.0.6-api+20170622 b/etc/api/admin/reports_v1/crates/1.0.6-api+20170622 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/admin/reports_v1/crates/1.0.6-cli+20170622 b/etc/api/admin/reports_v1/crates/1.0.6-cli+20170622 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adsense/v1.4/adsense-api.json b/etc/api/adsense/v1.4/adsense-api.json index f4c29a8d11..2b410eaafe 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/SYLcZPFITtF3qnr7oH0sREd1ZNs\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/KcNIBZHjmrxC6P-EEua8ut8cKOA\"", "discoveryVersion": "v1", "id": "adsense:v1.4", "name": "adsense", "canonicalName": "AdSense", "version": "v1.4", - "revision": "20170517", + "revision": "20170925", "title": "AdSense Management API", "description": "Accesses AdSense publishers' inventory and generates performance reports.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/adsense/v1.4/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adsense/v1.4/", - "batchPath": "batch", + "batchPath": "batch/adsense/v1.4", "parameters": { "alt": { "type": "string", diff --git a/etc/api/adsense/v1.4/crates/1.0.6-api+20170925 b/etc/api/adsense/v1.4/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adsense/v1.4/crates/1.0.6-cli+20170925 b/etc/api/adsense/v1.4/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adsensehost/v4.1/adsensehost-api.json b/etc/api/adsensehost/v4.1/adsensehost-api.json index bf60e26cb1..6e6fecefbc 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/7o6hFUe6SUm7cHL7vB3J6QdI-Uw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/iemUiWYyEAAnHZQnYAy7r56NBIk\"", "discoveryVersion": "v1", "id": "adsensehost:v4.1", "name": "adsensehost", "canonicalName": "AdSense Host", "version": "v4.1", - "revision": "20170517", + "revision": "20170925", "title": "AdSense Host API", "description": "Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.", "ownerDomain": "google.com", @@ -24,7 +24,7 @@ "basePath": "/adsensehost/v4.1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "adsensehost/v4.1/", - "batchPath": "batch", + "batchPath": "batch/adsensehost/v4.1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/adsensehost/v4.1/crates/1.0.6-api+20170925 b/etc/api/adsensehost/v4.1/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/adsensehost/v4.1/crates/1.0.6-cli+20170925 b/etc/api/adsensehost/v4.1/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/analytics/v2.4/analytics-api.json b/etc/api/analytics/v2.4/analytics-api.json index 0e35423a9e..92506614da 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/uF7o_i10s0Ir7WGM7zLi8NwSHXI\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/kYN47VW3boRYzE7pkj4HK3FyEC0\"", "discoveryVersion": "v1", "id": "analytics:v2.4", "name": "analytics", "version": "v2.4", - "revision": "20170321", + "revision": "20170807", "title": "Google Analytics API", "description": "Views and manages your Google Analytics data.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/analytics/v2.4/", "rootUrl": "https://www.googleapis.com/", "servicePath": "analytics/v2.4/", - "batchPath": "batch", + "batchPath": "batch/analytics/v2.4", "parameters": { "alt": { "type": "string", diff --git a/etc/api/analytics/v3/analytics-api.json b/etc/api/analytics/v3/analytics-api.json index 4bf0619ff5..dd5559ae33 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/kNCxeHzf8zHSdahaoD4fNF__mRA\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/DSG2TEF18bxTdYooKf_C2-FmmME\"", "discoveryVersion": "v1", "id": "analytics:v3", "name": "analytics", "version": "v3", - "revision": "20170321", + "revision": "20170807", "title": "Google Analytics API", "description": "Views and manages your Google Analytics data.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/analytics/v3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "analytics/v3/", - "batchPath": "batch", + "batchPath": "batch/analytics/v3", "parameters": { "alt": { "type": "string", @@ -505,6 +505,13 @@ "type": "string" } }, + "schema": { + "type": "array", + "description": "Collection of schema headers of the custom data source.", + "items": { + "type": "string" + } + }, "selfLink": { "type": "string", "description": "Link for this Analytics custom data source." @@ -519,7 +526,8 @@ "format": "date-time" }, "uploadType": { - "type": "string" + "type": "string", + "description": "Upload type of the custom data source." }, "webPropertyId": { "type": "string", @@ -2115,7 +2123,7 @@ }, "type": { "type": "string", - "description": "The type of the foreign account. For example `ADWORDS_LINKS`." + "description": "The type of the foreign account. For example, `ADWORDS_LINKS`, `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`." }, "webPropertyId": { "type": "string", @@ -3253,6 +3261,11 @@ "status": { "type": "string", "description": "Upload status. Possible values: PENDING, COMPLETED, FAILED, DELETING, DELETED." + }, + "uploadTime": { + "type": "string", + "description": "Time this file is uploaded.", + "format": "date-time" } } }, diff --git a/etc/api/analytics/v3/crates/1.0.6-api+20170807 b/etc/api/analytics/v3/crates/1.0.6-api+20170807 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/analytics/v3/crates/1.0.6-cli+20170807 b/etc/api/analytics/v3/crates/1.0.6-cli+20170807 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/analyticsreporting/v4/analyticsreporting-api.json b/etc/api/analyticsreporting/v4/analyticsreporting-api.json index 08dba54e05..96844adece 100644 --- a/etc/api/analyticsreporting/v4/analyticsreporting-api.json +++ b/etc/api/analyticsreporting/v4/analyticsreporting-api.json @@ -1,577 +1,158 @@ { + "canonicalName": "AnalyticsReporting", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/analytics": { + "description": "View and manage your Google Analytics data" + }, + "https://www.googleapis.com/auth/analytics.readonly": { + "description": "View your Google Analytics data" + } + } + } + }, + "rootUrl": "https://analyticsreporting.googleapis.com/", + "ownerDomain": "google.com", + "name": "analyticsreporting", + "batchPath": "batch", + "title": "Google Analytics Reporting API", + "ownerName": "Google", + "resources": { + "reports": { + "methods": { + "batchGet": { + "request": { + "$ref": "GetReportsRequest" + }, + "description": "Returns the Analytics data.", + "response": { + "$ref": "GetReportsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ], + "parameters": {}, + "flatPath": "v4/reports:batchGet", + "id": "analyticsreporting.reports.batchGet", + "path": "v4/reports:batchGet" + } + } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "key": { + "type": "string", + "location": "query", + "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." + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + }, + "version": "v4", + "baseUrl": "https://analyticsreporting.googleapis.com/", + "servicePath": "", + "description": "Accesses Analytics report data.", + "kind": "discovery#restDescription", "basePath": "", "id": "analyticsreporting:v4", - "revision": "20170427", + "revision": "20170925", "documentationLink": "https://developers.google.com/analytics/devguides/reporting/core/v4/", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "Report": { - "description": "The data response corresponding to the request.", - "type": "object", - "properties": { - "columnHeader": { - "$ref": "ColumnHeader", - "description": "The column headers." - }, - "data": { - "$ref": "ReportData", - "description": "Response data." - }, - "nextPageToken": { - "description": "Page token to retrieve the next page of results in the list.", - "type": "string" - } - }, - "id": "Report" - }, - "PivotHeader": { - "description": "The headers for each of the pivot sections defined in the request.", - "type": "object", - "properties": { - "pivotHeaderEntries": { - "description": "A single pivot section header.", - "type": "array", - "items": { - "$ref": "PivotHeaderEntry" - } - }, - "totalPivotGroupsCount": { - "description": "The total number of groups for this pivot.", - "format": "int32", - "type": "integer" - } - }, - "id": "PivotHeader" - }, - "DateRange": { - "description": "A contiguous set of days: startDate, startDate + 1 day, ..., endDate.\nThe start and end dates are specified in\n[ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`.", - "type": "object", - "properties": { - "startDate": { - "description": "The start date for the query in the format `YYYY-MM-DD`.", - "type": "string" - }, - "endDate": { - "description": "The end date for the query in the format `YYYY-MM-DD`.", - "type": "string" - } - }, - "id": "DateRange" - }, - "ReportRequest": { - "description": "The main request class which specifies the Reporting API request.", - "type": "object", - "properties": { - "pivots": { - "description": "The pivot definitions. Requests can have a maximum of 2 pivots.", - "type": "array", - "items": { - "$ref": "Pivot" - } - }, - "includeEmptyRows": { - "description": "If set to false, the response does not include rows if all the retrieved\nmetrics are equal to zero. The default is false which will exclude these\nrows.", - "type": "boolean" - }, - "metricFilterClauses": { - "description": "The metric filter clauses. They are logically combined with the `AND`\noperator. Metric filters look at only the first date range and not the\ncomparing date range. Note that filtering on metrics occurs after the\nmetrics are aggregated.", - "type": "array", - "items": { - "$ref": "MetricFilterClause" - } - }, - "pageSize": { - "description": "Page size is for paging and specifies the maximum number of returned rows.\nPage size should be \u003e= 0. A query returns the default of 1,000 rows.\nThe Analytics Core Reporting API returns a maximum of 10,000 rows per\nrequest, no matter how many you ask for. It can also return fewer rows\nthan requested, if there aren't as many dimension segments as you expect.\nFor instance, there are fewer than 300 possible values for `ga:country`,\nso when segmenting only by country, you can't get more than 300 rows,\neven if you set `pageSize` to a higher value.", - "format": "int32", - "type": "integer" - }, - "hideTotals": { - "description": "If set to true, hides the total of all metrics for all the matching rows,\nfor every date range. The default false and will return the totals.", - "type": "boolean" - }, - "hideValueRanges": { - "description": "If set to true, hides the minimum and maximum across all matching rows.\nThe default is false and the value ranges are returned.", - "type": "boolean" - }, - "cohortGroup": { - "description": "Cohort group associated with this request. If there is a cohort group\nin the request the `ga:cohort` dimension must be present.\nEvery [ReportRequest](#ReportRequest) within a `batchGet` method must\ncontain the same `cohortGroup` definition.", - "$ref": "CohortGroup" - }, - "filtersExpression": { - "description": "Dimension or metric filters that restrict the data returned for your\nrequest. To use the `filtersExpression`, supply a dimension or metric on\nwhich to filter, followed by the filter expression. For example, the\nfollowing expression selects `ga:browser` dimension which starts with\nFirefox; `ga:browser=~^Firefox`. For more information on dimensions\nand metric filters, see\n[Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters).", - "type": "string" - }, - "viewId": { - "description": "The Analytics\n[view ID](https://support.google.com/analytics/answer/1009618)\nfrom which to retrieve data. Every [ReportRequest](#ReportRequest)\nwithin a `batchGet` method must contain the same `viewId`.", - "type": "string" - }, - "metrics": { - "description": "The metrics requested.\nRequests must specify at least one metric. Requests can have a\ntotal of 10 metrics.", - "type": "array", - "items": { - "$ref": "Metric" - } - }, - "dimensionFilterClauses": { - "description": "The dimension filter clauses for filtering Dimension Values. They are\nlogically combined with the `AND` operator. Note that filtering occurs\nbefore any dimensions are aggregated, so that the returned metrics\nrepresent the total for only the relevant dimensions.", - "type": "array", - "items": { - "$ref": "DimensionFilterClause" - } - }, - "orderBys": { - "description": "Sort order on output rows. To compare two rows, the elements of the\nfollowing are applied in order until a difference is found. All date\nranges in the output get the same row order.", - "type": "array", - "items": { - "$ref": "OrderBy" - } - }, - "segments": { - "description": "Segment the data returned for the request. A segment definition helps look\nat a subset of the segment request. A request can contain up to four\nsegments. Every [ReportRequest](#ReportRequest) within a\n`batchGet` method must contain the same `segments` definition. Requests\nwith segments must have the `ga:segment` dimension.", - "type": "array", - "items": { - "$ref": "Segment" - } - }, - "samplingLevel": { - "description": "The desired report\n[sample](https://support.google.com/analytics/answer/2637192) size.\nIf the the `samplingLevel` field is unspecified the `DEFAULT` sampling\nlevel is used. Every [ReportRequest](#ReportRequest) within a\n`batchGet` method must contain the same `samplingLevel` definition. See\n[developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)\n for details.", - "type": "string", - "enumDescriptions": [ - "If the `samplingLevel` field is unspecified the `DEFAULT` sampling level\nis used.", - "Returns response with a sample size that balances speed and\naccuracy.", - "It returns a fast response with a smaller sampling size.", - "Returns a more accurate response using a large sampling size. But this\nmay result in response being slower." - ], - "enum": [ - "SAMPLING_UNSPECIFIED", - "DEFAULT", - "SMALL", - "LARGE" - ] - }, - "dimensions": { - "description": "The dimensions requested.\nRequests can have a total of 7 dimensions.", - "type": "array", - "items": { - "$ref": "Dimension" - } - }, - "dateRanges": { - "description": "Date ranges in the request. The request can have a maximum of 2 date\nranges. The response will contain a set of metric values for each\ncombination of the dimensions for each date range in the request. So, if\nthere are two date ranges, there will be two set of metric values, one for\nthe original date range and one for the second date range.\nThe `reportRequest.dateRanges` field should not be specified for cohorts\nor Lifetime value requests.\nIf a date range is not provided, the default date range is (startDate:\ncurrent date - 7 days, endDate: current date - 1 day). Every\n[ReportRequest](#ReportRequest) within a `batchGet` method must\ncontain the same `dateRanges` definition.", - "type": "array", - "items": { - "$ref": "DateRange" - } - }, - "pageToken": { - "description": "A continuation token to get the next page of the results. Adding this to\nthe request will return the rows after the pageToken. The pageToken should\nbe the value returned in the nextPageToken parameter in the response to\nthe GetReports request.", - "type": "string" - } - }, - "id": "ReportRequest" - }, - "MetricFilter": { - "description": "MetricFilter specifies the filter on a metric.", - "type": "object", - "properties": { - "metricName": { - "description": "The metric that will be filtered on. A metricFilter must contain a metric\nname. A metric name can be an alias earlier defined as a metric or it can\nalso be a metric expression.", - "type": "string" - }, - "comparisonValue": { - "description": "The value to compare against.", - "type": "string" - }, - "operator": { - "description": "Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the\ncomparisonValue, the default is `EQUAL`. If the operator is\n`IS_MISSING`, checks if the metric is missing and would ignore the\ncomparisonValue.", - "type": "string", - "enumDescriptions": [ - "If the operator is not specified, it is treated as `EQUAL`.", - "Should the value of the metric be exactly equal to the comparison value.", - "Should the value of the metric be less than to the comparison value.", - "Should the value of the metric be greater than to the comparison value.", - "Validates if the metric is missing.\nDoesn't take comparisonValue into account." - ], - "enum": [ - "OPERATOR_UNSPECIFIED", - "EQUAL", - "LESS_THAN", - "GREATER_THAN", - "IS_MISSING" - ] - }, - "not": { - "description": "Logical `NOT` operator. If this boolean is set to true, then the matching\nmetric values will be excluded in the report. The default is false.", - "type": "boolean" - } - }, - "id": "MetricFilter" - }, - "Dimension": { - "description": "[Dimensions](https://support.google.com/analytics/answer/1033861)\nare attributes of your data. For example, the dimension `ga:city`\nindicates the city, for example, \"Paris\" or \"New York\", from which\na session originates.", - "type": "object", - "properties": { - "histogramBuckets": { - "description": "If non-empty, we place dimension values into buckets after string to\nint64. Dimension values that are not the string representation of an\nintegral value will be converted to zero. The bucket values have to be in\nincreasing order. Each bucket is closed on the lower end, and open on the\nupper end. The \"first\" bucket includes all values less than the first\nboundary, the \"last\" bucket includes all values up to infinity. Dimension\nvalues that fall in a bucket get transformed to a new dimension value. For\nexample, if one gives a list of \"0, 1, 3, 4, 7\", then we return the\nfollowing buckets:\n\n- bucket #1: values \u003c 0, dimension value \"\u003c0\"\n- bucket #2: values in [0,1), dimension value \"0\"\n- bucket #3: values in [1,3), dimension value \"1-2\"\n- bucket #4: values in [3,4), dimension value \"3\"\n- bucket #5: values in [4,7), dimension value \"4-6\"\n- bucket #6: values \u003e= 7, dimension value \"7+\"\n\nNOTE: If you are applying histogram mutation on any dimension, and using\nthat dimension in sort, you will want to use the sort type\n`HISTOGRAM_BUCKET` for that purpose. Without that the dimension values\nwill be sorted according to dictionary\n(lexicographic) order. For example the ascending dictionary order is:\n\n \"\u003c50\", \"1001+\", \"121-1000\", \"50-120\"\n\nAnd the ascending `HISTOGRAM_BUCKET` order is:\n\n \"\u003c50\", \"50-120\", \"121-1000\", \"1001+\"\n\nThe client has to explicitly request `\"orderType\": \"HISTOGRAM_BUCKET\"`\nfor a histogram-mutated dimension.", - "type": "array", - "items": { - "format": "int64", - "type": "string" - } - }, - "name": { - "description": "Name of the dimension to fetch, for example `ga:browser`.", - "type": "string" - } - }, - "id": "Dimension" - }, - "SimpleSegment": { - "description": "A Simple segment conditions consist of one or more dimension/metric\nconditions that can be combined.", - "type": "object", - "properties": { - "orFiltersForSegment": { - "description": "A list of segment filters groups which are combined with logical `AND`\noperator.", - "type": "array", - "items": { - "$ref": "OrFiltersForSegment" - } - } - }, - "id": "SimpleSegment" - }, - "DynamicSegment": { - "description": "Dynamic segment definition for defining the segment within the request.\nA segment can select users, sessions or both.", - "type": "object", - "properties": { - "sessionSegment": { - "$ref": "SegmentDefinition", - "description": "Session Segment to select sessions to include in the segment." - }, - "name": { - "description": "The name of the dynamic segment.", - "type": "string" - }, - "userSegment": { - "description": "User Segment to select users to include in the segment.", - "$ref": "SegmentDefinition" - } - }, - "id": "DynamicSegment" - }, - "ColumnHeader": { - "description": "Column headers.", - "type": "object", - "properties": { - "dimensions": { - "description": "The dimension names in the response.", - "type": "array", - "items": { - "type": "string" - } - }, - "metricHeader": { - "$ref": "MetricHeader", - "description": "Metric headers for the metrics in the response." - } - }, - "id": "ColumnHeader" - }, - "SegmentFilterClause": { - "description": "Filter Clause to be used in a segment definition, can be wither a metric or\na dimension filter.", - "type": "object", - "properties": { - "dimensionFilter": { - "$ref": "SegmentDimensionFilter", - "description": "Dimension Filter for the segment definition." - }, - "metricFilter": { - "$ref": "SegmentMetricFilter", - "description": "Metric Filter for the segment definition." - }, - "not": { - "description": "Matches the complement (`!`) of the filter.", - "type": "boolean" - } - }, - "id": "SegmentFilterClause" - }, - "MetricFilterClause": { - "description": "Represents a group of metric filters.\nSet the operator value to specify how the filters are logically combined.", - "type": "object", - "properties": { - "operator": { - "enumDescriptions": [ - "Unspecified operator. It is treated as an `OR`.", - "The logical `OR` operator.", - "The logical `AND` operator." - ], - "enum": [ - "OPERATOR_UNSPECIFIED", - "OR", - "AND" - ], - "description": "The operator for combining multiple metric filters. If unspecified, it is\ntreated as an `OR`.", - "type": "string" - }, - "filters": { - "description": "The repeated set of filters. They are logically combined based on the\noperator specified.", - "type": "array", - "items": { - "$ref": "MetricFilter" - } - } - }, - "id": "MetricFilterClause" - }, - "Cohort": { - "description": "Defines a cohort. A cohort is a group of users who share a common\ncharacteristic. For example, all users with the same acquisition date\nbelong to the same cohort.", - "type": "object", - "properties": { - "type": { - "description": "Type of the cohort. The only supported type as of now is\n`FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated\nas `FIRST_VISIT_DATE` type cohort.", - "type": "string", - "enumDescriptions": [ - "If unspecified it's treated as `FIRST_VISIT_DATE`.", - "Cohorts that are selected based on first visit date." - ], - "enum": [ - "UNSPECIFIED_COHORT_TYPE", - "FIRST_VISIT_DATE" - ] - }, - "name": { - "description": "A unique name for the cohort. If not defined name will be auto-generated\nwith values cohort_[1234...].", - "type": "string" - }, - "dateRange": { - "description": "This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users\nwhose first visit date is between start date and end date defined in the\nDateRange. The date ranges should be aligned for cohort requests. If the\nrequest contains `ga:cohortNthDay` it should be exactly one day long,\nif `ga:cohortNthWeek` it should be aligned to the week boundary (starting\nat Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range\nshould be aligned to the month (starting at the first and ending on the\nlast day of the month).\nFor LTV requests there are no such restrictions.\nYou do not need to supply a date range for the\n`reportsRequest.dateRanges` field.", - "$ref": "DateRange" - } - }, - "id": "Cohort" - }, - "ReportRow": { - "description": "A row in the report.", - "type": "object", - "properties": { - "metrics": { - "description": "List of metrics for each requested DateRange.", - "type": "array", - "items": { - "$ref": "DateRangeValues" - } - }, - "dimensions": { - "description": "List of requested dimensions.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "ReportRow" - }, - "OrFiltersForSegment": { - "description": "A list of segment filters in the `OR` group are combined with the logical OR\noperator.", - "type": "object", - "properties": { - "segmentFilterClauses": { - "description": "List of segment filters to be combined with a `OR` operator.", - "type": "array", - "items": { - "$ref": "SegmentFilterClause" - } - } - }, - "id": "OrFiltersForSegment" - }, - "MetricHeader": { - "description": "The headers for the metrics.", - "type": "object", - "properties": { - "metricHeaderEntries": { - "description": "Headers for the metrics in the response.", - "type": "array", - "items": { - "$ref": "MetricHeaderEntry" - } - }, - "pivotHeaders": { - "description": "Headers for the pivots in the response.", - "type": "array", - "items": { - "$ref": "PivotHeader" - } - } - }, - "id": "MetricHeader" - }, - "DimensionFilterClause": { - "description": "A group of dimension filters. Set the operator value to specify how\nthe filters are logically combined.", - "type": "object", - "properties": { - "operator": { - "enumDescriptions": [ - "Unspecified operator. It is treated as an `OR`.", - "The logical `OR` operator.", - "The logical `AND` operator." - ], - "enum": [ - "OPERATOR_UNSPECIFIED", - "OR", - "AND" - ], - "description": "The operator for combining multiple dimension filters. If unspecified, it\nis treated as an `OR`.", - "type": "string" - }, - "filters": { - "description": "The repeated set of filters. They are logically combined based on the\noperator specified.", - "type": "array", - "items": { - "$ref": "DimensionFilter" - } - } - }, - "id": "DimensionFilterClause" - }, - "GetReportsResponse": { - "description": "The main response class which holds the reports from the Reporting API\n`batchGet` call.", - "type": "object", - "properties": { - "reports": { - "description": "Responses corresponding to each of the request.", - "type": "array", - "items": { - "$ref": "Report" - } - } - }, - "id": "GetReportsResponse" - }, - "SequenceSegment": { - "description": "Sequence conditions consist of one or more steps, where each step is defined\nby one or more dimension/metric conditions. Multiple steps can be combined\nwith special sequence operators.", - "type": "object", - "properties": { - "segmentSequenceSteps": { - "description": "The list of steps in the sequence.", - "type": "array", - "items": { - "$ref": "SegmentSequenceStep" - } - }, - "firstStepShouldMatchFirstHit": { - "description": "If set, first step condition must match the first hit of the visitor (in\nthe date range).", - "type": "boolean" - } - }, - "id": "SequenceSegment" - }, - "SegmentMetricFilter": { - "description": "Metric filter to be used in a segment filter clause.", - "type": "object", - "properties": { - "maxComparisonValue": { - "description": "Max comparison value is only used for `BETWEEN` operator.", - "type": "string" - }, - "comparisonValue": { - "description": "The value to compare against. If the operator is `BETWEEN`, this value is\ntreated as minimum comparison value.", - "type": "string" - }, - "operator": { - "enumDescriptions": [ - "Unspecified operator is treated as `LESS_THAN` operator.", - "Checks if the metric value is less than comparison value.", - "Checks if the metric value is greater than comparison value.", - "Equals operator.", - "For between operator, both the minimum and maximum are exclusive.\nWe will use `LT` and `GT` for comparison." - ], - "enum": [ - "UNSPECIFIED_OPERATOR", - "LESS_THAN", - "GREATER_THAN", - "EQUAL", - "BETWEEN" - ], - "description": "Specifies is the operation to perform to compare the metric. The default\nis `EQUAL`.", - "type": "string" - }, - "metricName": { - "description": "The metric that will be filtered on. A `metricFilter` must contain a\nmetric name.", - "type": "string" - }, - "scope": { - "description": "Scope for a metric defines the level at which that metric is defined. The\nspecified metric scope must be equal to or greater than its primary scope\nas defined in the data model. The primary scope is defined by if the\nsegment is selecting users or sessions.", - "type": "string", - "enumDescriptions": [ - "If the scope is unspecified, it defaults to the condition scope,\n`USER` or `SESSION` depending on if the segment is trying to choose\nusers or sessions.", - "Product scope.", - "Hit scope.", - "Session scope.", - "User scope." - ], - "enum": [ - "UNSPECIFIED_SCOPE", - "PRODUCT", - "HIT", - "SESSION", - "USER" - ] - } - }, - "id": "SegmentMetricFilter" - }, - "DateRangeValues": { - "description": "Used to return a list of metrics for a single DateRange / dimension\ncombination", - "type": "object", - "properties": { - "values": { - "description": "Each value corresponds to each Metric in the request.", - "type": "array", - "items": { - "type": "string" - } - }, - "pivotValueRegions": { - "description": "The values of each pivot region.", - "type": "array", - "items": { - "$ref": "PivotValueRegion" - } - } - }, - "id": "DateRangeValues" - }, - "CohortGroup": { - "description": "Defines a cohort group.\nFor example:\n\n \"cohortGroup\": {\n \"cohorts\": [{\n \"name\": \"cohort 1\",\n \"type\": \"FIRST_VISIT_DATE\",\n \"dateRange\": { \"startDate\": \"2015-08-01\", \"endDate\": \"2015-08-01\" }\n },{\n \"name\": \"cohort 2\"\n \"type\": \"FIRST_VISIT_DATE\"\n \"dateRange\": { \"startDate\": \"2015-07-01\", \"endDate\": \"2015-07-01\" }\n }]\n }", - "type": "object", - "properties": { - "cohorts": { - "description": "The definition for the cohort.", - "type": "array", - "items": { - "$ref": "Cohort" - } - }, - "lifetimeValue": { - "description": "Enable Life Time Value (LTV). LTV measures lifetime value for users\nacquired through different channels.\nPlease see:\n[Cohort Analysis](https://support.google.com/analytics/answer/6074676) and\n[Lifetime Value](https://support.google.com/analytics/answer/6182550)\nIf the value of lifetimeValue is false:\n\n- The metric values are similar to the values in the web interface cohort\n report.\n- The cohort definition date ranges must be aligned to the calendar week\n and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in\n the cohort definition should be a Sunday and the `endDate` should be the\n following Saturday, and for `ga:cohortNthMonth`, the `startDate`\n should be the 1st of the month and `endDate` should be the last day\n of the month.\n\nWhen the lifetimeValue is true:\n\n- The metric values will correspond to the values in the web interface\n LifeTime value report.\n- The Lifetime Value report shows you how user value (Revenue) and\n engagement (Appviews, Goal Completions, Sessions, and Session Duration)\n grow during the 90 days after a user is acquired.\n- The metrics are calculated as a cumulative average per user per the time\n increment.\n- The cohort definition date ranges need not be aligned to the calendar\n week and month boundaries.\n- The `viewId` must be an\n [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews)", - "type": "boolean" - } - }, - "id": "CohortGroup" - }, "GetReportsRequest": { "description": "The batch request containing multiple report request.", "type": "object", "properties": { "reportRequests": { "description": "Requests, each request will have a separate response.\nThere can be a maximum of 5 requests. All requests should have the same\n`dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`.", - "type": "array", "items": { "$ref": "ReportRequest" - } + }, + "type": "array" } }, "id": "GetReportsRequest" @@ -580,66 +161,67 @@ "description": "The Pivot describes the pivot section in the request.\nThe Pivot helps rearrange the information in the table for certain reports\nby pivoting your data on a second dimension.", "type": "object", "properties": { - "metrics": { - "description": "The pivot metrics. Pivot metrics are part of the\nrestriction on total number of metrics allowed in the request.", - "type": "array", - "items": { - "$ref": "Metric" - } - }, - "dimensions": { - "description": "A list of dimensions to show as pivot columns. A Pivot can have a maximum\nof 4 dimensions. Pivot dimensions are part of the restriction on the\ntotal number of dimensions allowed in the request.", - "type": "array", - "items": { - "$ref": "Dimension" - } - }, - "dimensionFilterClauses": { - "description": "DimensionFilterClauses are logically combined with an `AND` operator: only\ndata that is included by all these DimensionFilterClauses contributes to\nthe values in this pivot region. Dimension filters can be used to restrict\nthe columns shown in the pivot region. For example if you have\n`ga:browser` as the requested dimension in the pivot region, and you\nspecify key filters to restrict `ga:browser` to only \"IE\" or \"Firefox\",\nthen only those two browsers would show up as columns.", - "type": "array", - "items": { - "$ref": "DimensionFilterClause" - } - }, "maxGroupCount": { - "description": "Specifies the maximum number of groups to return.\nThe default value is 10, also the maximum value is 1,000.", "format": "int32", + "description": "Specifies the maximum number of groups to return.\nThe default value is 10, also the maximum value is 1,000.", "type": "integer" }, "startGroup": { - "description": "If k metrics were requested, then the response will contain some\ndata-dependent multiple of k columns in the report. E.g., if you pivoted\non the dimension `ga:browser` then you'd get k columns for \"Firefox\", k\ncolumns for \"IE\", k columns for \"Chrome\", etc. The ordering of the groups\nof columns is determined by descending order of \"total\" for the first of\nthe k values. Ties are broken by lexicographic ordering of the first\npivot dimension, then lexicographic ordering of the second pivot\ndimension, and so on. E.g., if the totals for the first value for\nFirefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns\nwould be Chrome, Firefox, IE.\n\nThe following let you choose which of the groups of k columns are\nincluded in the response.", "format": "int32", + "description": "If k metrics were requested, then the response will contain some\ndata-dependent multiple of k columns in the report. E.g., if you pivoted\non the dimension `ga:browser` then you'd get k columns for \"Firefox\", k\ncolumns for \"IE\", k columns for \"Chrome\", etc. The ordering of the groups\nof columns is determined by descending order of \"total\" for the first of\nthe k values. Ties are broken by lexicographic ordering of the first\npivot dimension, then lexicographic ordering of the second pivot\ndimension, and so on. E.g., if the totals for the first value for\nFirefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns\nwould be Chrome, Firefox, IE.\n\nThe following let you choose which of the groups of k columns are\nincluded in the response.", "type": "integer" + }, + "metrics": { + "description": "The pivot metrics. Pivot metrics are part of the\nrestriction on total number of metrics allowed in the request.", + "items": { + "$ref": "Metric" + }, + "type": "array" + }, + "dimensionFilterClauses": { + "description": "DimensionFilterClauses are logically combined with an `AND` operator: only\ndata that is included by all these DimensionFilterClauses contributes to\nthe values in this pivot region. Dimension filters can be used to restrict\nthe columns shown in the pivot region. For example if you have\n`ga:browser` as the requested dimension in the pivot region, and you\nspecify key filters to restrict `ga:browser` to only \"IE\" or \"Firefox\",\nthen only those two browsers would show up as columns.", + "items": { + "$ref": "DimensionFilterClause" + }, + "type": "array" + }, + "dimensions": { + "items": { + "$ref": "Dimension" + }, + "type": "array", + "description": "A list of dimensions to show as pivot columns. A Pivot can have a maximum\nof 4 dimensions. Pivot dimensions are part of the restriction on the\ntotal number of dimensions allowed in the request." } }, "id": "Pivot" }, "PivotHeaderEntry": { - "description": "The headers for the each of the metric column corresponding to the metrics\nrequested in the pivots section of the response.", - "type": "object", "properties": { + "metric": { + "$ref": "MetricHeaderEntry", + "description": "The metric header for the metric in the pivot." + }, "dimensionNames": { "description": "The name of the dimensions in the pivot response.", - "type": "array", "items": { "type": "string" - } - }, - "metric": { - "description": "The metric header for the metric in the pivot.", - "$ref": "MetricHeaderEntry" + }, + "type": "array" }, "dimensionValues": { "description": "The values for the dimensions in the pivot.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "PivotHeaderEntry" + "id": "PivotHeaderEntry", + "description": "The headers for the each of the metric column corresponding to the metrics\nrequested in the pivots section of the response.", + "type": "object" }, "SegmentFilter": { + "id": "SegmentFilter", "description": "SegmentFilter defines the segment to be either a simple or a sequence\nsegment. A simple segment condition contains dimension and metric conditions\nto select the sessions or users. A sequence segment condition can be used to\nselect users or sessions based on sequential conditions.", "type": "object", "properties": { @@ -648,15 +230,14 @@ "description": "Sequence conditions consist of one or more steps, where each step is\ndefined by one or more dimension/metric conditions. Multiple steps can\nbe combined with special sequence operators." }, "not": { - "description": "If true, match the complement of simple or sequence segment.\nFor example, to match all visits not from \"New York\", we can define the\nsegment as follows:\n\n \"sessionSegment\": {\n \"segmentFilters\": [{\n \"simpleSegment\" :{\n \"orFiltersForSegment\": [{\n \"segmentFilterClauses\":[{\n \"dimensionFilter\": {\n \"dimensionName\": \"ga:city\",\n \"expressions\": [\"New York\"]\n }\n }]\n }]\n },\n \"not\": \"True\"\n }]\n },", - "type": "boolean" + "type": "boolean", + "description": "If true, match the complement of simple or sequence segment.\nFor example, to match all visits not from \"New York\", we can define the\nsegment as follows:\n\n \"sessionSegment\": {\n \"segmentFilters\": [{\n \"simpleSegment\" :{\n \"orFiltersForSegment\": [{\n \"segmentFilterClauses\":[{\n \"dimensionFilter\": {\n \"dimensionName\": \"ga:city\",\n \"expressions\": [\"New York\"]\n }\n }]\n }]\n },\n \"not\": \"True\"\n }]\n }," }, "simpleSegment": { - "$ref": "SimpleSegment", - "description": "A Simple segment conditions consist of one or more dimension/metric\nconditions that can be combined" + "description": "A Simple segment conditions consist of one or more dimension/metric\nconditions that can be combined", + "$ref": "SimpleSegment" } - }, - "id": "SegmentFilter" + } }, "SegmentDefinition": { "description": "SegmentDefinition defines the segment to be a set of SegmentFilters which\nare combined together with a logical `AND` operation.", @@ -664,19 +245,29 @@ "properties": { "segmentFilters": { "description": "A segment is defined by a set of segment filters which are combined\ntogether with a logical `AND` operation.", - "type": "array", "items": { "$ref": "SegmentFilter" - } + }, + "type": "array" } }, "id": "SegmentDefinition" }, "MetricHeaderEntry": { - "description": "Header for the metrics.", - "type": "object", "properties": { + "name": { + "description": "The name of the header.", + "type": "string" + }, "type": { + "enum": [ + "METRIC_TYPE_UNSPECIFIED", + "INTEGER", + "FLOAT", + "CURRENCY", + "PERCENT", + "TIME" + ], "description": "The type of the metric, for example `INTEGER`.", "type": "string", "enumDescriptions": [ @@ -686,100 +277,97 @@ "Currency metric.", "Percentage metric.", "Time metric in `HH:MM:SS` format." - ], - "enum": [ - "METRIC_TYPE_UNSPECIFIED", - "INTEGER", - "FLOAT", - "CURRENCY", - "PERCENT", - "TIME" ] - }, - "name": { - "description": "The name of the header.", - "type": "string" } }, - "id": "MetricHeaderEntry" + "id": "MetricHeaderEntry", + "description": "Header for the metrics.", + "type": "object" }, "ReportData": { + "id": "ReportData", "description": "The data part of the report.", "type": "object", "properties": { - "totals": { - "description": "For each requested date range, for the set of all rows that match\nthe query, every requested value format gets a total. The total\nfor a value format is computed by first totaling the metrics\nmentioned in the value format and then evaluating the value\nformat as a scalar expression. E.g., The \"totals\" for\n`3 / (ga:sessions + 2)` we compute\n`3 / ((sum of all relevant ga:sessions) + 2)`.\nTotals are computed before pagination.", - "type": "array", - "items": { - "$ref": "DateRangeValues" - } - }, - "samplesReadCounts": { - "description": "If the results are\n[sampled](https://support.google.com/analytics/answer/2637192),\nthis returns the total number of samples read, one entry per date range.\nIf the results are not sampled this field will not be defined. See\n[developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)\nfor details.", - "type": "array", - "items": { - "format": "int64", - "type": "string" - } - }, - "rowCount": { - "description": "Total number of matching rows for this query.", - "format": "int32", - "type": "integer" + "isDataGolden": { + "type": "boolean", + "description": "Indicates if response to this request is golden or not. Data is\ngolden when the exact same request will not produce any new results if\nasked at a later point in time." }, "rows": { "description": "There's one ReportRow for every unique combination of dimensions.", - "type": "array", "items": { "$ref": "ReportRow" - } + }, + "type": "array" }, - "isDataGolden": { - "description": "Indicates if response to this request is golden or not. Data is\ngolden when the exact same request will not produce any new results if\nasked at a later point in time.", - "type": "boolean" + "rowCount": { + "format": "int32", + "description": "Total number of matching rows for this query.", + "type": "integer" }, "dataLastRefreshed": { - "description": "The last time the data in the report was refreshed. All the hits received\nbefore this timestamp are included in the calculation of the report.", "format": "google-datetime", + "description": "The last time the data in the report was refreshed. All the hits received\nbefore this timestamp are included in the calculation of the report.", "type": "string" }, "maximums": { "description": "Minimum and maximum values seen over all matching rows. These are both\nempty when `hideValueRanges` in the request is false, or when\nrowCount is zero.", - "type": "array", "items": { "$ref": "DateRangeValues" - } + }, + "type": "array" }, "samplingSpaceSizes": { "description": "If the results are\n[sampled](https://support.google.com/analytics/answer/2637192),\nthis returns the total number of\nsamples present, one entry per date range. If the results are not sampled\nthis field will not be defined. See\n[developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)\nfor details.", - "type": "array", "items": { "format": "int64", "type": "string" - } + }, + "type": "array" }, "minimums": { "description": "Minimum and maximum values seen over all matching rows. These are both\nempty when `hideValueRanges` in the request is false, or when\nrowCount is zero.", - "type": "array", "items": { "$ref": "DateRangeValues" - } + }, + "type": "array" + }, + "totals": { + "description": "For each requested date range, for the set of all rows that match\nthe query, every requested value format gets a total. The total\nfor a value format is computed by first totaling the metrics\nmentioned in the value format and then evaluating the value\nformat as a scalar expression. E.g., The \"totals\" for\n`3 / (ga:sessions + 2)` we compute\n`3 / ((sum of all relevant ga:sessions) + 2)`.\nTotals are computed before pagination.", + "items": { + "$ref": "DateRangeValues" + }, + "type": "array" + }, + "samplesReadCounts": { + "description": "If the results are\n[sampled](https://support.google.com/analytics/answer/2637192),\nthis returns the total number of samples read, one entry per date range.\nIf the results are not sampled this field will not be defined. See\n[developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)\nfor details.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" } - }, - "id": "ReportData" + } }, "DimensionFilter": { "description": "Dimension filter specifies the filtering options on a dimension.", "type": "object", "properties": { + "expressions": { + "description": "Strings or regular expression to match against. Only the first value of\nthe list is used for comparison unless the operator is `IN_LIST`.\nIf `IN_LIST` operator, then the entire list is used to filter the\ndimensions as explained in the description of the `IN_LIST` operator.", + "items": { + "type": "string" + }, + "type": "array" + }, + "not": { + "description": "Logical `NOT` operator. If this boolean is set to true, then the matching\ndimension values will be excluded in the report. The default is false.", + "type": "boolean" + }, "caseSensitive": { "description": "Should the match be case sensitive? Default is false.", "type": "boolean" }, - "dimensionName": { - "description": "The dimension to filter on. A DimensionFilter must contain a dimension.", - "type": "string" - }, "operator": { "enumDescriptions": [ "If the match type is unspecified, it is treated as a `REGEXP`.", @@ -808,28 +396,77 @@ "description": "How to match the dimension to the expression. The default is REGEXP.", "type": "string" }, - "not": { - "description": "Logical `NOT` operator. If this boolean is set to true, then the matching\ndimension values will be excluded in the report. The default is false.", - "type": "boolean" - }, - "expressions": { - "description": "Strings or regular expression to match against. Only the first value of\nthe list is used for comparison unless the operator is `IN_LIST`.\nIf `IN_LIST` operator, then the entire list is used to filter the\ndimensions as explained in the description of the `IN_LIST` operator.", - "type": "array", - "items": { - "type": "string" - } + "dimensionName": { + "type": "string", + "description": "The dimension to filter on. A DimensionFilter must contain a dimension." } }, "id": "DimensionFilter" }, + "Segment": { + "type": "object", + "properties": { + "dynamicSegment": { + "$ref": "DynamicSegment", + "description": "A dynamic segment definition in the request." + }, + "segmentId": { + "description": "The segment ID of a built-in or custom segment, for example `gaid::-3`.", + "type": "string" + } + }, + "id": "Segment", + "description": "The segment definition, if the report needs to be segmented.\nA Segment is a subset of the Analytics data. For example, of the entire\nset of users, one Segment might be users from a particular country or city." + }, + "OrderBy": { + "description": "Specifies the sorting options.", + "type": "object", + "properties": { + "orderType": { + "enum": [ + "ORDER_TYPE_UNSPECIFIED", + "VALUE", + "DELTA", + "SMART", + "HISTOGRAM_BUCKET", + "DIMENSION_AS_INTEGER" + ], + "description": "The order type. The default orderType is `VALUE`.", + "type": "string", + "enumDescriptions": [ + "Unspecified order type will be treated as sort based on value.", + "The sort order is based on the value of the chosen column; looks only at\nthe first date range.", + "The sort order is based on the difference of the values of the chosen\ncolumn between the first two date ranges. Usable only if there are\nexactly two date ranges.", + "The sort order is based on weighted value of the chosen column. If\ncolumn has n/d format, then weighted value of this ratio will\nbe `(n + totals.n)/(d + totals.d)` Usable only for metrics that\nrepresent ratios.", + "Histogram order type is applicable only to dimension columns with\nnon-empty histogram-buckets.", + "If the dimensions are fixed length numbers, ordinary sort would just\nwork fine. `DIMENSION_AS_INTEGER` can be used if the dimensions are\nvariable length numbers." + ] + }, + "fieldName": { + "description": "The field which to sort by. The default sort order is ascending. Example:\n`ga:browser`.\nNote, that you can only specify one field for sort here. For example,\n`ga:browser, ga:city` is not valid.", + "type": "string" + }, + "sortOrder": { + "enumDescriptions": [ + "If the sort order is unspecified, the default is ascending.", + "Ascending sort. The field will be sorted in an ascending manner.", + "Descending sort. The field will be sorted in a descending manner." + ], + "enum": [ + "SORT_ORDER_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ], + "description": "The sorting order for the field.", + "type": "string" + } + }, + "id": "OrderBy" + }, "SegmentDimensionFilter": { "description": "Dimension filter specifies the filtering options on a dimension.", "type": "object", "properties": { - "caseSensitive": { - "description": "Should the match be case sensitive, ignored for `IN_LIST` operator.", - "type": "boolean" - }, "minComparisonValue": { "description": "Minimum comparison values for `BETWEEN` match type.", "type": "string" @@ -872,88 +509,30 @@ }, "expressions": { "description": "The list of expressions, only the first element is used for all operators", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "caseSensitive": { + "description": "Should the match be case sensitive, ignored for `IN_LIST` operator.", + "type": "boolean" } }, "id": "SegmentDimensionFilter" }, - "OrderBy": { - "description": "Specifies the sorting options.", - "type": "object", - "properties": { - "fieldName": { - "description": "The field which to sort by. The default sort order is ascending. Example:\n`ga:browser`.\nNote, that you can only specify one field for sort here. For example,\n`ga:browser, ga:city` is not valid.", - "type": "string" - }, - "orderType": { - "description": "The order type. The default orderType is `VALUE`.", - "type": "string", - "enumDescriptions": [ - "Unspecified order type will be treated as sort based on value.", - "The sort order is based on the value of the chosen column; looks only at\nthe first date range.", - "The sort order is based on the difference of the values of the chosen\ncolumn between the first two date ranges. Usable only if there are\nexactly two date ranges.", - "The sort order is based on weighted value of the chosen column. If\ncolumn has n/d format, then weighted value of this ratio will\nbe `(n + totals.n)/(d + totals.d)` Usable only for metrics that\nrepresent ratios.", - "Histogram order type is applicable only to dimension columns with\nnon-empty histogram-buckets.", - "If the dimensions are fixed length numbers, ordinary sort would just\nwork fine. `DIMENSION_AS_INTEGER` can be used if the dimensions are\nvariable length numbers." - ], - "enum": [ - "ORDER_TYPE_UNSPECIFIED", - "VALUE", - "DELTA", - "SMART", - "HISTOGRAM_BUCKET", - "DIMENSION_AS_INTEGER" - ] - }, - "sortOrder": { - "enumDescriptions": [ - "If the sort order is unspecified, the default is ascending.", - "Ascending sort. The field will be sorted in an ascending manner.", - "Descending sort. The field will be sorted in a descending manner." - ], - "enum": [ - "SORT_ORDER_UNSPECIFIED", - "ASCENDING", - "DESCENDING" - ], - "description": "The sorting order for the field.", - "type": "string" - } - }, - "id": "OrderBy" - }, - "Segment": { - "description": "The segment definition, if the report needs to be segmented.\nA Segment is a subset of the Analytics data. For example, of the entire\nset of users, one Segment might be users from a particular country or city.", - "type": "object", - "properties": { - "segmentId": { - "description": "The segment ID of a built-in or custom segment, for example `gaid::-3`.", - "type": "string" - }, - "dynamicSegment": { - "description": "A dynamic segment definition in the request.", - "$ref": "DynamicSegment" - } - }, - "id": "Segment" - }, "SegmentSequenceStep": { "description": "A segment sequence definition.", "type": "object", "properties": { "orFiltersForSegment": { "description": "A sequence is specified with a list of Or grouped filters which are\ncombined with `AND` operator.", - "type": "array", "items": { "$ref": "OrFiltersForSegment" - } + }, + "type": "array" }, "matchType": { - "description": "Specifies if the step immediately precedes or can be any time before the\nnext step.", - "type": "string", "enumDescriptions": [ "Unspecified match type is treated as precedes.", "Operator indicates that the previous step precedes the next step.", @@ -963,21 +542,25 @@ "UNSPECIFIED_MATCH_TYPE", "PRECEDES", "IMMEDIATELY_PRECEDES" - ] + ], + "description": "Specifies if the step immediately precedes or can be any time before the\nnext step.", + "type": "string" } }, "id": "SegmentSequenceStep" }, "Metric": { - "description": "[Metrics](https://support.google.com/analytics/answer/1033861)\nare the quantitative measurements. For example, the metric `ga:users`\nindicates the total number of users for the requested time period.", "type": "object", "properties": { + "alias": { + "description": "An alias for the metric expression is an alternate name for the\nexpression. The alias can be used for filtering and sorting. This field\nis optional and is useful if the expression is not a single metric but\na complex expression which cannot be used in filtering and sorting.\nThe alias is also used in the response column header.", + "type": "string" + }, "expression": { "description": "A metric expression in the request. An expression is constructed from one\nor more metrics and numbers. Accepted operators include: Plus (+), Minus\n(-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis,\nPositive cardinal numbers (0-9), can include decimals and is limited to\n1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the\nmetric expression is just a single metric name like `ga:users`.\nAdding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics\nwill result in unexpected results.", "type": "string" }, "formattingType": { - "description": "Specifies how the metric expression should be formatted, for example\n`INTEGER`.", "type": "string", "enumDescriptions": [ "Metric type is unspecified.", @@ -994,170 +577,587 @@ "CURRENCY", "PERCENT", "TIME" - ] - }, - "alias": { - "description": "An alias for the metric expression is an alternate name for the\nexpression. The alias can be used for filtering and sorting. This field\nis optional and is useful if the expression is not a single metric but\na complex expression which cannot be used in filtering and sorting.\nThe alias is also used in the response column header.", - "type": "string" + ], + "description": "Specifies how the metric expression should be formatted, for example\n`INTEGER`." } }, - "id": "Metric" + "id": "Metric", + "description": "[Metrics](https://support.google.com/analytics/answer/1033861)\nare the quantitative measurements. For example, the metric `ga:users`\nindicates the total number of users for the requested time period." }, "PivotValueRegion": { + "id": "PivotValueRegion", "description": "The metric values in the pivot region.", "type": "object", "properties": { "values": { "description": "The values of the metrics in each of the pivot regions.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + } + } + }, + "Report": { + "properties": { + "columnHeader": { + "description": "The column headers.", + "$ref": "ColumnHeader" + }, + "nextPageToken": { + "description": "Page token to retrieve the next page of results in the list.", + "type": "string" + }, + "data": { + "$ref": "ReportData", + "description": "Response data." } }, - "id": "PivotValueRegion" - } - }, - "protocol": "rest", - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, - "canonicalName": "AnalyticsReporting", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/analytics": { - "description": "View and manage your Google Analytics data" + "id": "Report", + "description": "The data response corresponding to the request.", + "type": "object" + }, + "PivotHeader": { + "description": "The headers for each of the pivot sections defined in the request.", + "type": "object", + "properties": { + "totalPivotGroupsCount": { + "format": "int32", + "description": "The total number of groups for this pivot.", + "type": "integer" }, - "https://www.googleapis.com/auth/analytics.readonly": { - "description": "View your Google Analytics data" + "pivotHeaderEntries": { + "description": "A single pivot section header.", + "items": { + "$ref": "PivotHeaderEntry" + }, + "type": "array" + } + }, + "id": "PivotHeader" + }, + "DateRange": { + "description": "A contiguous set of days: startDate, startDate + 1 day, ..., endDate.\nThe start and end dates are specified in\n[ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`.", + "type": "object", + "properties": { + "endDate": { + "description": "The end date for the query in the format `YYYY-MM-DD`.", + "type": "string" + }, + "startDate": { + "description": "The start date for the query in the format `YYYY-MM-DD`.", + "type": "string" + } + }, + "id": "DateRange" + }, + "MetricFilter": { + "description": "MetricFilter specifies the filter on a metric.", + "type": "object", + "properties": { + "comparisonValue": { + "description": "The value to compare against.", + "type": "string" + }, + "operator": { + "enum": [ + "OPERATOR_UNSPECIFIED", + "EQUAL", + "LESS_THAN", + "GREATER_THAN", + "IS_MISSING" + ], + "description": "Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the\ncomparisonValue, the default is `EQUAL`. If the operator is\n`IS_MISSING`, checks if the metric is missing and would ignore the\ncomparisonValue.", + "type": "string", + "enumDescriptions": [ + "If the operator is not specified, it is treated as `EQUAL`.", + "Should the value of the metric be exactly equal to the comparison value.", + "Should the value of the metric be less than to the comparison value.", + "Should the value of the metric be greater than to the comparison value.", + "Validates if the metric is missing.\nDoesn't take comparisonValue into account." + ] + }, + "not": { + "description": "Logical `NOT` operator. If this boolean is set to true, then the matching\nmetric values will be excluded in the report. The default is false.", + "type": "boolean" + }, + "metricName": { + "description": "The metric that will be filtered on. A metricFilter must contain a metric\nname. A metric name can be an alias earlier defined as a metric or it can\nalso be a metric expression.", + "type": "string" + } + }, + "id": "MetricFilter" + }, + "ReportRequest": { + "description": "The main request class which specifies the Reporting API request.", + "type": "object", + "properties": { + "dimensions": { + "description": "The dimensions requested.\nRequests can have a total of 7 dimensions.", + "items": { + "$ref": "Dimension" + }, + "type": "array" + }, + "pageToken": { + "description": "A continuation token to get the next page of the results. Adding this to\nthe request will return the rows after the pageToken. The pageToken should\nbe the value returned in the nextPageToken parameter in the response to\nthe GetReports request.", + "type": "string" + }, + "dateRanges": { + "description": "Date ranges in the request. The request can have a maximum of 2 date\nranges. The response will contain a set of metric values for each\ncombination of the dimensions for each date range in the request. So, if\nthere are two date ranges, there will be two set of metric values, one for\nthe original date range and one for the second date range.\nThe `reportRequest.dateRanges` field should not be specified for cohorts\nor Lifetime value requests.\nIf a date range is not provided, the default date range is (startDate:\ncurrent date - 7 days, endDate: current date - 1 day). Every\n[ReportRequest](#ReportRequest) within a `batchGet` method must\ncontain the same `dateRanges` definition.", + "items": { + "$ref": "DateRange" + }, + "type": "array" + }, + "pivots": { + "items": { + "$ref": "Pivot" + }, + "type": "array", + "description": "The pivot definitions. Requests can have a maximum of 2 pivots." + }, + "includeEmptyRows": { + "description": "If set to false, the response does not include rows if all the retrieved\nmetrics are equal to zero. The default is false which will exclude these\nrows.", + "type": "boolean" + }, + "metricFilterClauses": { + "description": "The metric filter clauses. They are logically combined with the `AND`\noperator. Metric filters look at only the first date range and not the\ncomparing date range. Note that filtering on metrics occurs after the\nmetrics are aggregated.", + "items": { + "$ref": "MetricFilterClause" + }, + "type": "array" + }, + "pageSize": { + "type": "integer", + "format": "int32", + "description": "Page size is for paging and specifies the maximum number of returned rows.\nPage size should be \u003e= 0. A query returns the default of 1,000 rows.\nThe Analytics Core Reporting API returns a maximum of 10,000 rows per\nrequest, no matter how many you ask for. It can also return fewer rows\nthan requested, if there aren't as many dimension segments as you expect.\nFor instance, there are fewer than 300 possible values for `ga:country`,\nso when segmenting only by country, you can't get more than 300 rows,\neven if you set `pageSize` to a higher value." + }, + "hideTotals": { + "description": "If set to true, hides the total of all metrics for all the matching rows,\nfor every date range. The default false and will return the totals.", + "type": "boolean" + }, + "hideValueRanges": { + "description": "If set to true, hides the minimum and maximum across all matching rows.\nThe default is false and the value ranges are returned.", + "type": "boolean" + }, + "filtersExpression": { + "description": "Dimension or metric filters that restrict the data returned for your\nrequest. To use the `filtersExpression`, supply a dimension or metric on\nwhich to filter, followed by the filter expression. For example, the\nfollowing expression selects `ga:browser` dimension which starts with\nFirefox; `ga:browser=~^Firefox`. For more information on dimensions\nand metric filters, see\n[Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters).", + "type": "string" + }, + "cohortGroup": { + "$ref": "CohortGroup", + "description": "Cohort group associated with this request. If there is a cohort group\nin the request the `ga:cohort` dimension must be present.\nEvery [ReportRequest](#ReportRequest) within a `batchGet` method must\ncontain the same `cohortGroup` definition." + }, + "viewId": { + "description": "The Analytics\n[view ID](https://support.google.com/analytics/answer/1009618)\nfrom which to retrieve data. Every [ReportRequest](#ReportRequest)\nwithin a `batchGet` method must contain the same `viewId`.", + "type": "string" + }, + "metrics": { + "description": "The metrics requested.\nRequests must specify at least one metric. Requests can have a\ntotal of 10 metrics.", + "items": { + "$ref": "Metric" + }, + "type": "array" + }, + "dimensionFilterClauses": { + "description": "The dimension filter clauses for filtering Dimension Values. They are\nlogically combined with the `AND` operator. Note that filtering occurs\nbefore any dimensions are aggregated, so that the returned metrics\nrepresent the total for only the relevant dimensions.", + "items": { + "$ref": "DimensionFilterClause" + }, + "type": "array" + }, + "orderBys": { + "description": "Sort order on output rows. To compare two rows, the elements of the\nfollowing are applied in order until a difference is found. All date\nranges in the output get the same row order.", + "items": { + "$ref": "OrderBy" + }, + "type": "array" + }, + "segments": { + "description": "Segment the data returned for the request. A segment definition helps look\nat a subset of the segment request. A request can contain up to four\nsegments. Every [ReportRequest](#ReportRequest) within a\n`batchGet` method must contain the same `segments` definition. Requests\nwith segments must have the `ga:segment` dimension.", + "items": { + "$ref": "Segment" + }, + "type": "array" + }, + "samplingLevel": { + "enumDescriptions": [ + "If the `samplingLevel` field is unspecified the `DEFAULT` sampling level\nis used.", + "Returns response with a sample size that balances speed and\naccuracy.", + "It returns a fast response with a smaller sampling size.", + "Returns a more accurate response using a large sampling size. But this\nmay result in response being slower." + ], + "enum": [ + "SAMPLING_UNSPECIFIED", + "DEFAULT", + "SMALL", + "LARGE" + ], + "description": "The desired report\n[sample](https://support.google.com/analytics/answer/2637192) size.\nIf the the `samplingLevel` field is unspecified the `DEFAULT` sampling\nlevel is used. Every [ReportRequest](#ReportRequest) within a\n`batchGet` method must contain the same `samplingLevel` definition. See\n[developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)\n for details.", + "type": "string" + } + }, + "id": "ReportRequest" + }, + "Dimension": { + "description": "[Dimensions](https://support.google.com/analytics/answer/1033861)\nare attributes of your data. For example, the dimension `ga:city`\nindicates the city, for example, \"Paris\" or \"New York\", from which\na session originates.", + "type": "object", + "properties": { + "histogramBuckets": { + "description": "If non-empty, we place dimension values into buckets after string to\nint64. Dimension values that are not the string representation of an\nintegral value will be converted to zero. The bucket values have to be in\nincreasing order. Each bucket is closed on the lower end, and open on the\nupper end. The \"first\" bucket includes all values less than the first\nboundary, the \"last\" bucket includes all values up to infinity. Dimension\nvalues that fall in a bucket get transformed to a new dimension value. For\nexample, if one gives a list of \"0, 1, 3, 4, 7\", then we return the\nfollowing buckets:\n\n- bucket #1: values \u003c 0, dimension value \"\u003c0\"\n- bucket #2: values in [0,1), dimension value \"0\"\n- bucket #3: values in [1,3), dimension value \"1-2\"\n- bucket #4: values in [3,4), dimension value \"3\"\n- bucket #5: values in [4,7), dimension value \"4-6\"\n- bucket #6: values \u003e= 7, dimension value \"7+\"\n\nNOTE: If you are applying histogram mutation on any dimension, and using\nthat dimension in sort, you will want to use the sort type\n`HISTOGRAM_BUCKET` for that purpose. Without that the dimension values\nwill be sorted according to dictionary\n(lexicographic) order. For example the ascending dictionary order is:\n\n \"\u003c50\", \"1001+\", \"121-1000\", \"50-120\"\n\nAnd the ascending `HISTOGRAM_BUCKET` order is:\n\n \"\u003c50\", \"50-120\", \"121-1000\", \"1001+\"\n\nThe client has to explicitly request `\"orderType\": \"HISTOGRAM_BUCKET\"`\nfor a histogram-mutated dimension.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Name of the dimension to fetch, for example `ga:browser`.", + "type": "string" + } + }, + "id": "Dimension" + }, + "SimpleSegment": { + "description": "A Simple segment conditions consist of one or more dimension/metric\nconditions that can be combined.", + "type": "object", + "properties": { + "orFiltersForSegment": { + "description": "A list of segment filters groups which are combined with logical `AND`\noperator.", + "items": { + "$ref": "OrFiltersForSegment" + }, + "type": "array" + } + }, + "id": "SimpleSegment" + }, + "DynamicSegment": { + "properties": { + "name": { + "description": "The name of the dynamic segment.", + "type": "string" + }, + "userSegment": { + "$ref": "SegmentDefinition", + "description": "User Segment to select users to include in the segment." + }, + "sessionSegment": { + "$ref": "SegmentDefinition", + "description": "Session Segment to select sessions to include in the segment." + } + }, + "id": "DynamicSegment", + "description": "Dynamic segment definition for defining the segment within the request.\nA segment can select users, sessions or both.", + "type": "object" + }, + "ColumnHeader": { + "properties": { + "metricHeader": { + "description": "Metric headers for the metrics in the response.", + "$ref": "MetricHeader" + }, + "dimensions": { + "description": "The dimension names in the response.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ColumnHeader", + "description": "Column headers.", + "type": "object" + }, + "SegmentFilterClause": { + "id": "SegmentFilterClause", + "description": "Filter Clause to be used in a segment definition, can be wither a metric or\na dimension filter.", + "type": "object", + "properties": { + "metricFilter": { + "$ref": "SegmentMetricFilter", + "description": "Metric Filter for the segment definition." + }, + "not": { + "description": "Matches the complement (`!`) of the filter.", + "type": "boolean" + }, + "dimensionFilter": { + "$ref": "SegmentDimensionFilter", + "description": "Dimension Filter for the segment definition." } } - } - }, - "rootUrl": "https://analyticsreporting.googleapis.com/", - "ownerDomain": "google.com", - "name": "analyticsreporting", - "batchPath": "batch", - "title": "Google Analytics Reporting API", - "ownerName": "Google", - "resources": { - "reports": { - "methods": { - "batchGet": { - "flatPath": "v4/reports:batchGet", - "id": "analyticsreporting.reports.batchGet", - "path": "v4/reports:batchGet", - "request": { - "$ref": "GetReportsRequest" + }, + "MetricFilterClause": { + "description": "Represents a group of metric filters.\nSet the operator value to specify how the filters are logically combined.", + "type": "object", + "properties": { + "filters": { + "description": "The repeated set of filters. They are logically combined based on the\noperator specified.", + "items": { + "$ref": "MetricFilter" }, - "description": "Returns the Analytics data.", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "GetReportsResponse" + "type": "array" + }, + "operator": { + "enumDescriptions": [ + "Unspecified operator. It is treated as an `OR`.", + "The logical `OR` operator.", + "The logical `AND` operator." + ], + "enum": [ + "OPERATOR_UNSPECIFIED", + "OR", + "AND" + ], + "description": "The operator for combining multiple metric filters. If unspecified, it is\ntreated as an `OR`.", + "type": "string" + } + }, + "id": "MetricFilterClause" + }, + "ReportRow": { + "description": "A row in the report.", + "type": "object", + "properties": { + "dimensions": { + "description": "List of requested dimensions.", + "items": { + "type": "string" }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/analytics", - "https://www.googleapis.com/auth/analytics.readonly" + "type": "array" + }, + "metrics": { + "items": { + "$ref": "DateRangeValues" + }, + "type": "array", + "description": "List of metrics for each requested DateRange." + } + }, + "id": "ReportRow" + }, + "Cohort": { + "properties": { + "type": { + "description": "Type of the cohort. The only supported type as of now is\n`FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated\nas `FIRST_VISIT_DATE` type cohort.", + "type": "string", + "enumDescriptions": [ + "If unspecified it's treated as `FIRST_VISIT_DATE`.", + "Cohorts that are selected based on first visit date." + ], + "enum": [ + "UNSPECIFIED_COHORT_TYPE", + "FIRST_VISIT_DATE" + ] + }, + "dateRange": { + "description": "This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users\nwhose first visit date is between start date and end date defined in the\nDateRange. The date ranges should be aligned for cohort requests. If the\nrequest contains `ga:cohortNthDay` it should be exactly one day long,\nif `ga:cohortNthWeek` it should be aligned to the week boundary (starting\nat Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range\nshould be aligned to the month (starting at the first and ending on the\nlast day of the month).\nFor LTV requests there are no such restrictions.\nYou do not need to supply a date range for the\n`reportsRequest.dateRanges` field.", + "$ref": "DateRange" + }, + "name": { + "type": "string", + "description": "A unique name for the cohort. If not defined name will be auto-generated\nwith values cohort_[1234...]." + } + }, + "id": "Cohort", + "description": "Defines a cohort. A cohort is a group of users who share a common\ncharacteristic. For example, all users with the same acquisition date\nbelong to the same cohort.", + "type": "object" + }, + "OrFiltersForSegment": { + "description": "A list of segment filters in the `OR` group are combined with the logical OR\noperator.", + "type": "object", + "properties": { + "segmentFilterClauses": { + "description": "List of segment filters to be combined with a `OR` operator.", + "items": { + "$ref": "SegmentFilterClause" + }, + "type": "array" + } + }, + "id": "OrFiltersForSegment" + }, + "MetricHeader": { + "type": "object", + "properties": { + "metricHeaderEntries": { + "description": "Headers for the metrics in the response.", + "items": { + "$ref": "MetricHeaderEntry" + }, + "type": "array" + }, + "pivotHeaders": { + "description": "Headers for the pivots in the response.", + "items": { + "$ref": "PivotHeader" + }, + "type": "array" + } + }, + "id": "MetricHeader", + "description": "The headers for the metrics." + }, + "DimensionFilterClause": { + "description": "A group of dimension filters. Set the operator value to specify how\nthe filters are logically combined.", + "type": "object", + "properties": { + "filters": { + "description": "The repeated set of filters. They are logically combined based on the\noperator specified.", + "items": { + "$ref": "DimensionFilter" + }, + "type": "array" + }, + "operator": { + "enum": [ + "OPERATOR_UNSPECIFIED", + "OR", + "AND" + ], + "description": "The operator for combining multiple dimension filters. If unspecified, it\nis treated as an `OR`.", + "type": "string", + "enumDescriptions": [ + "Unspecified operator. It is treated as an `OR`.", + "The logical `OR` operator.", + "The logical `AND` operator." ] } - } + }, + "id": "DimensionFilterClause" + }, + "GetReportsResponse": { + "type": "object", + "properties": { + "reports": { + "description": "Responses corresponding to each of the request.", + "items": { + "$ref": "Report" + }, + "type": "array" + } + }, + "id": "GetReportsResponse", + "description": "The main response class which holds the reports from the Reporting API\n`batchGet` call." + }, + "SequenceSegment": { + "description": "Sequence conditions consist of one or more steps, where each step is defined\nby one or more dimension/metric conditions. Multiple steps can be combined\nwith special sequence operators.", + "type": "object", + "properties": { + "firstStepShouldMatchFirstHit": { + "description": "If set, first step condition must match the first hit of the visitor (in\nthe date range).", + "type": "boolean" + }, + "segmentSequenceSteps": { + "description": "The list of steps in the sequence.", + "items": { + "$ref": "SegmentSequenceStep" + }, + "type": "array" + } + }, + "id": "SequenceSegment" + }, + "SegmentMetricFilter": { + "description": "Metric filter to be used in a segment filter clause.", + "type": "object", + "properties": { + "maxComparisonValue": { + "description": "Max comparison value is only used for `BETWEEN` operator.", + "type": "string" + }, + "comparisonValue": { + "description": "The value to compare against. If the operator is `BETWEEN`, this value is\ntreated as minimum comparison value.", + "type": "string" + }, + "operator": { + "enumDescriptions": [ + "Unspecified operator is treated as `LESS_THAN` operator.", + "Checks if the metric value is less than comparison value.", + "Checks if the metric value is greater than comparison value.", + "Equals operator.", + "For between operator, both the minimum and maximum are exclusive.\nWe will use `LT` and `GT` for comparison." + ], + "enum": [ + "UNSPECIFIED_OPERATOR", + "LESS_THAN", + "GREATER_THAN", + "EQUAL", + "BETWEEN" + ], + "description": "Specifies is the operation to perform to compare the metric. The default\nis `EQUAL`.", + "type": "string" + }, + "metricName": { + "description": "The metric that will be filtered on. A `metricFilter` must contain a\nmetric name.", + "type": "string" + }, + "scope": { + "enumDescriptions": [ + "If the scope is unspecified, it defaults to the condition scope,\n`USER` or `SESSION` depending on if the segment is trying to choose\nusers or sessions.", + "Product scope.", + "Hit scope.", + "Session scope.", + "User scope." + ], + "enum": [ + "UNSPECIFIED_SCOPE", + "PRODUCT", + "HIT", + "SESSION", + "USER" + ], + "description": "Scope for a metric defines the level at which that metric is defined. The\nspecified metric scope must be equal to or greater than its primary scope\nas defined in the data model. The primary scope is defined by if the\nsegment is selecting users or sessions.", + "type": "string" + } + }, + "id": "SegmentMetricFilter" + }, + "DateRangeValues": { + "description": "Used to return a list of metrics for a single DateRange / dimension\ncombination", + "type": "object", + "properties": { + "pivotValueRegions": { + "description": "The values of each pivot region.", + "items": { + "$ref": "PivotValueRegion" + }, + "type": "array" + }, + "values": { + "description": "Each value corresponds to each Metric in the request.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "DateRangeValues" + }, + "CohortGroup": { + "description": "Defines a cohort group.\nFor example:\n\n \"cohortGroup\": {\n \"cohorts\": [{\n \"name\": \"cohort 1\",\n \"type\": \"FIRST_VISIT_DATE\",\n \"dateRange\": { \"startDate\": \"2015-08-01\", \"endDate\": \"2015-08-01\" }\n },{\n \"name\": \"cohort 2\"\n \"type\": \"FIRST_VISIT_DATE\"\n \"dateRange\": { \"startDate\": \"2015-07-01\", \"endDate\": \"2015-07-01\" }\n }]\n }", + "type": "object", + "properties": { + "cohorts": { + "description": "The definition for the cohort.", + "items": { + "$ref": "Cohort" + }, + "type": "array" + }, + "lifetimeValue": { + "description": "Enable Life Time Value (LTV). LTV measures lifetime value for users\nacquired through different channels.\nPlease see:\n[Cohort Analysis](https://support.google.com/analytics/answer/6074676) and\n[Lifetime Value](https://support.google.com/analytics/answer/6182550)\nIf the value of lifetimeValue is false:\n\n- The metric values are similar to the values in the web interface cohort\n report.\n- The cohort definition date ranges must be aligned to the calendar week\n and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in\n the cohort definition should be a Sunday and the `endDate` should be the\n following Saturday, and for `ga:cohortNthMonth`, the `startDate`\n should be the 1st of the month and `endDate` should be the last day\n of the month.\n\nWhen the lifetimeValue is true:\n\n- The metric values will correspond to the values in the web interface\n LifeTime value report.\n- The Lifetime Value report shows you how user value (Revenue) and\n engagement (Appviews, Goal Completions, Sessions, and Session Duration)\n grow during the 90 days after a user is acquired.\n- The metrics are calculated as a cumulative average per user per the time\n increment.\n- The cohort definition date ranges need not be aligned to the calendar\n week and month boundaries.\n- The `viewId` must be an\n [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews)", + "type": "boolean" + } + }, + "id": "CohortGroup" } }, - "parameters": { - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "alt": { - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - } + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "version": "v4", - "baseUrl": "https://analyticsreporting.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Accesses Analytics report data.", - "servicePath": "" + "protocol": "rest" } diff --git a/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json b/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json new file mode 100644 index 0000000000..a950be2693 --- /dev/null +++ b/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json @@ -0,0 +1,1081 @@ +{ + "version": "v1", + "baseUrl": "https://androiddeviceprovisioning.googleapis.com/", + "canonicalName": "Android Provisioning Partner", + "kind": "discovery#restDescription", + "description": "Automates reseller integration into zero-touch enrollment by assigning devices to customers and creating device reports.", + "servicePath": "", + "rootUrl": "https://androiddeviceprovisioning.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "androiddeviceprovisioning", + "batchPath": "batch", + "revision": "20170923", + "documentationLink": "https://developers.google.com/zero-touch/", + "id": "androiddeviceprovisioning:v1", + "title": "Android Device Provisioning Partner API", + "ownerName": "Google", + "discoveryVersion": "v1", + "version_module": true, + "resources": { + "partners": { + "resources": { + "devices": { + "methods": { + "claimAsync": { + "description": "Claim devices asynchronously.", + "request": { + "$ref": "ClaimDevicesRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string", + "location": "path", + "description": "Partner ID." + } + }, + "flatPath": "v1/partners/{partnersId}/devices:claimAsync", + "path": "v1/partners/{+partnerId}/devices:claimAsync", + "id": "androiddeviceprovisioning.partners.devices.claimAsync" + }, + "findByIdentifier": { + "response": { + "$ref": "FindDevicesByDeviceIdentifierResponse" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string", + "location": "path", + "description": "ID of the partner." + } + }, + "flatPath": "v1/partners/{partnersId}/devices:findByIdentifier", + "path": "v1/partners/{+partnerId}/devices:findByIdentifier", + "id": "androiddeviceprovisioning.partners.devices.findByIdentifier", + "description": "Find devices by device identifier.", + "request": { + "$ref": "FindDevicesByDeviceIdentifierRequest" + } + }, + "unclaimAsync": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "location": "path", + "description": "Partner ID.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/partners/{partnersId}/devices:unclaimAsync", + "path": "v1/partners/{+partnerId}/devices:unclaimAsync", + "id": "androiddeviceprovisioning.partners.devices.unclaimAsync", + "description": "Unclaim devices asynchronously.", + "request": { + "$ref": "UnclaimDevicesRequest" + } + }, + "metadata": { + "response": { + "$ref": "DeviceMetadata" + }, + "parameterOrder": [ + "metadataOwnerId", + "deviceId" + ], + "httpMethod": "POST", + "parameters": { + "deviceId": { + "format": "int64", + "required": true, + "type": "string", + "location": "path", + "description": "ID of the partner.", + "pattern": "^[^/]+$" + }, + "metadataOwnerId": { + "description": "The owner of the newly set metadata. Set this to the partner ID.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/partners/{partnersId}/devices/{devicesId}/metadata", + "path": "v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata", + "id": "androiddeviceprovisioning.partners.devices.metadata", + "request": { + "$ref": "UpdateDeviceMetadataRequest" + }, + "description": "Update the metadata." + }, + "updateMetadataAsync": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "location": "path", + "description": "Partner ID.", + "pattern": "^[^/]+$", + "format": "int64", + "type": "string", + "required": true + } + }, + "flatPath": "v1/partners/{partnersId}/devices:updateMetadataAsync", + "path": "v1/partners/{+partnerId}/devices:updateMetadataAsync", + "id": "androiddeviceprovisioning.partners.devices.updateMetadataAsync", + "request": { + "$ref": "UpdateDeviceMetadataInBatchRequest" + }, + "description": "Set metadata in batch asynchronously." + }, + "get": { + "description": "Get a device.", + "response": { + "$ref": "Device" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^partners/[^/]+/devices/[^/]+$", + "location": "path", + "description": "Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/partners/{partnersId}/devices/{devicesId}", + "path": "v1/{+name}", + "id": "androiddeviceprovisioning.partners.devices.get" + }, + "unclaim": { + "path": "v1/partners/{+partnerId}/devices:unclaim", + "id": "androiddeviceprovisioning.partners.devices.unclaim", + "description": "Unclaim the device identified by the `device_id` or the `deviceIdentifier`.", + "request": { + "$ref": "UnclaimDeviceRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "location": "path", + "description": "ID of the partner.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/partners/{partnersId}/devices:unclaim" + }, + "findByOwner": { + "httpMethod": "POST", + "parameterOrder": [ + "partnerId" + ], + "response": { + "$ref": "FindDevicesByOwnerResponse" + }, + "parameters": { + "partnerId": { + "location": "path", + "description": "ID of the partner.", + "pattern": "^[^/]+$", + "format": "int64", + "type": "string", + "required": true + } + }, + "flatPath": "v1/partners/{partnersId}/devices:findByOwner", + "id": "androiddeviceprovisioning.partners.devices.findByOwner", + "path": "v1/partners/{+partnerId}/devices:findByOwner", + "request": { + "$ref": "FindDevicesByOwnerRequest" + }, + "description": "Find devices by ownership." + }, + "claim": { + "description": "Claim the device identified by device identifier.", + "request": { + "$ref": "ClaimDeviceRequest" + }, + "response": { + "$ref": "ClaimDeviceResponse" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "location": "path", + "description": "ID of the partner.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/partners/{partnersId}/devices:claim", + "path": "v1/partners/{+partnerId}/devices:claim", + "id": "androiddeviceprovisioning.partners.devices.claim" + } + } + }, + "customers": { + "methods": { + "list": { + "description": "Lists the customers that are enrolled to the reseller identified by the\n`partnerId` argument. This list includes customers that the reseller\ncreated and customers that enrolled themselves using the portal.", + "response": { + "$ref": "ListCustomersResponse" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "GET", + "parameters": { + "partnerId": { + "location": "path", + "description": "The ID of the partner.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/partners/{partnersId}/customers", + "path": "v1/partners/{+partnerId}/customers", + "id": "androiddeviceprovisioning.partners.customers.list" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Company" + }, + "parameters": { + "parent": { + "description": "Required. The parent resource ID in format `partners/[PARTNER_ID]` that\nidentifies the reseller.", + "required": true, + "type": "string", + "pattern": "^partners/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/partners/{partnersId}/customers", + "id": "androiddeviceprovisioning.partners.customers.create", + "path": "v1/{+parent}/customers", + "request": { + "$ref": "CreateCustomerRequest" + }, + "description": "Creates a customer for zero-touch enrollment. After the method returns\nsuccessfully, admin and owner roles can manage devices and EMM configs\nby calling API methods or using their zero-touch enrollment portal. The API\ndoesn't notify the customer that they have access." + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^operations/.+$", + "location": "path", + "description": "The name of the operation resource.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", + "id": "androiddeviceprovisioning.operations.get", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + } + } + } + }, + "parameters": { + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "description": "Pretty-print response.", + "type": "boolean", + "default": "true", + "location": "query" + } + }, + "schemas": { + "ClaimDeviceRequest": { + "description": "Request message to claim a device on behalf of a customer.", + "type": "object", + "properties": { + "deviceIdentifier": { + "description": "The device identifier of the device to claim.", + "$ref": "DeviceIdentifier" + }, + "sectionType": { + "enumDescriptions": [ + "Unspecified section type.", + "Zero touch section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ], + "description": "The section to claim.", + "type": "string" + }, + "customerId": { + "description": "The customer to claim for.", + "format": "int64", + "type": "string" + } + }, + "id": "ClaimDeviceRequest" + }, + "DevicesLongRunningOperationMetadata": { + "properties": { + "processingStatus": { + "enumDescriptions": [ + "Invalid code. Shouldn't be used.", + "Pending.", + "In progress.", + "Processed.\nThis doesn't mean all items were processed sucessfully, you should\ncheck the `response` field for the result of every item." + ], + "enum": [ + "BATCH_PROCESS_STATUS_UNSPECIFIED", + "BATCH_PROCESS_PENDING", + "BATCH_PROCESS_IN_PROGRESS", + "BATCH_PROCESS_PROCESSED" + ], + "description": "The overall processing status.", + "type": "string" + }, + "progress": { + "description": "Processing progress from 0 to 100.", + "format": "int32", + "type": "integer" + }, + "devicesCount": { + "description": "Number of devices parsed in your requests.", + "format": "int32", + "type": "integer" + } + }, + "id": "DevicesLongRunningOperationMetadata", + "description": "Long running operation metadata.", + "type": "object" + }, + "UpdateDeviceMetadataInBatchRequest": { + "properties": { + "updates": { + "description": "List of metadata updates.", + "type": "array", + "items": { + "$ref": "UpdateMetadataArguments" + } + } + }, + "id": "UpdateDeviceMetadataInBatchRequest", + "description": "Request to update device metadata in batch.", + "type": "object" + }, + "ListCustomersResponse": { + "description": "Response message of all customers related to this partner.", + "type": "object", + "properties": { + "customers": { + "description": "List of customers related to this partner.", + "type": "array", + "items": { + "$ref": "Company" + } + } + }, + "id": "ListCustomersResponse" + }, + "ClaimDeviceResponse": { + "description": "Response message containing device id of the claim.", + "type": "object", + "properties": { + "deviceName": { + "description": "The resource name of the device in the format\n`partners/[PARTNER_ID]/devices/[DEVICE_ID]`.", + "type": "string" + }, + "deviceId": { + "description": "The device ID of the claimed device.", + "format": "int64", + "type": "string" + } + }, + "id": "ClaimDeviceResponse" + }, + "UpdateMetadataArguments": { + "description": "Identifies metdata updates to one device.", + "type": "object", + "properties": { + "deviceIdentifier": { + "description": "Device identifier.", + "$ref": "DeviceIdentifier" + }, + "deviceMetadata": { + "$ref": "DeviceMetadata", + "description": "The metadata to update." + }, + "deviceId": { + "description": "Device ID of the device.", + "format": "int64", + "type": "string" + } + }, + "id": "UpdateMetadataArguments" + }, + "Device": { + "description": "An Android device.", + "type": "object", + "properties": { + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "Device identifier." + }, + "deviceMetadata": { + "$ref": "DeviceMetadata", + "description": "Device metadata." + }, + "name": { + "description": "Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.", + "type": "string" + }, + "deviceId": { + "description": "Device ID.", + "format": "int64", + "type": "string" + }, + "configuration": { + "description": "The resource name of the configuration.\nOnly set for customers.", + "type": "string" + }, + "claims": { + "description": "Claims.", + "type": "array", + "items": { + "$ref": "DeviceClaim" + } + } + }, + "id": "Device" + }, + "CreateCustomerRequest": { + "description": "Request message to create a customer.", + "type": "object", + "properties": { + "customer": { + "$ref": "Company", + "description": "Required. The company data to populate the new customer. Must contain a\nvalue for `companyName` and at least one `owner_email` that's associated\nwith a Google Account. The values for `companyId` and `name` must be empty." + } + }, + "id": "CreateCustomerRequest" + }, + "Company": { + "properties": { + "companyName": { + "description": "Required. The name of the company. For example _XYZ Corp_. Characters\nallowed are: Latin letters, numerals, hyphens, and spaces. Displayed to the\ncustomer's employees in the zero-touch enrollment portal.", + "type": "string" + }, + "name": { + "description": "Output only. The API resource name of the company in the format\n`partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server.", + "type": "string" + }, + "adminEmails": { + "description": "Input only. Optional. Email address of customer's users in the admin role.\nEach email address must be associated with a Google Account.", + "type": "array", + "items": { + "type": "string" + } + }, + "ownerEmails": { + "description": "Input only. Email address of customer's users in the owner role. At least\none `owner_email` is required. Each email address must be associated with a\nGoogle Account. Owners share the same access as admins but can also add,\ndelete, and edit your organization's portal users.", + "type": "array", + "items": { + "type": "string" + } + }, + "companyId": { + "description": "Output only. The ID of the company. Assigned by the server.", + "format": "int64", + "type": "string" + } + }, + "id": "Company", + "description": "A customer resource in the zero-touch enrollment API.", + "type": "object" + }, + "UpdateDeviceMetadataRequest": { + "properties": { + "deviceMetadata": { + "description": "The metdata to set.", + "$ref": "DeviceMetadata" + } + }, + "id": "UpdateDeviceMetadataRequest", + "description": "Request to set metadata for a device.", + "type": "object" + }, + "PartnerUnclaim": { + "properties": { + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "Device identifier of the device." + }, + "sectionType": { + "enumDescriptions": [ + "Unspecified section type.", + "Zero touch section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ], + "description": "Section type to unclaim.", + "type": "string" + }, + "deviceId": { + "description": "Device ID of the device.", + "format": "int64", + "type": "string" + } + }, + "id": "PartnerUnclaim", + "description": "Identifies one unclaim request.", + "type": "object" + }, + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object" + }, + "FindDevicesByDeviceIdentifierResponse": { + "properties": { + "devices": { + "description": "Found devices.", + "type": "array", + "items": { + "$ref": "Device" + } + }, + "nextPageToken": { + "description": "Page token of the next page.", + "type": "string" + } + }, + "id": "FindDevicesByDeviceIdentifierResponse", + "description": "Response containing found devices.", + "type": "object" + }, + "PartnerClaim": { + "properties": { + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "Device identifier of the device." + }, + "deviceMetadata": { + "$ref": "DeviceMetadata", + "description": "Metadata to set at claim." + }, + "sectionType": { + "enumDescriptions": [ + "Unspecified section type.", + "Zero touch section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ], + "description": "Section type to claim.", + "type": "string" + }, + "customerId": { + "description": "Customer ID to claim for.", + "format": "int64", + "type": "string" + } + }, + "id": "PartnerClaim", + "description": "Identifies one claim request.", + "type": "object" + }, + "UnclaimDeviceRequest": { + "description": "Request message to unclaim a device.", + "type": "object", + "properties": { + "deviceId": { + "description": "The device ID returned by `ClaimDevice`.", + "format": "int64", + "type": "string" + }, + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "The device identifier you used when you claimed this device." + }, + "sectionType": { + "enumDescriptions": [ + "Unspecified section type.", + "Zero touch section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ], + "description": "The section type to unclaim for.", + "type": "string" + } + }, + "id": "UnclaimDeviceRequest" + }, + "DeviceMetadata": { + "properties": { + "entries": { + "additionalProperties": { + "type": "string" + }, + "description": "Metadata entries", + "type": "object" + } + }, + "id": "DeviceMetadata", + "description": "A key-value pair of the device metadata.", + "type": "object" + }, + "DevicesLongRunningOperationResponse": { + "properties": { + "successCount": { + "description": "Number of succeesfully processed ones.", + "format": "int32", + "type": "integer" + }, + "perDeviceStatus": { + "description": "Processing status for each device.\nOne `PerDeviceStatus` per device. The order is the same as in your requests.", + "type": "array", + "items": { + "$ref": "OperationPerDevice" + } + } + }, + "id": "DevicesLongRunningOperationResponse", + "description": "Long running operation response.", + "type": "object" + }, + "DeviceClaim": { + "properties": { + "sectionType": { + "enumDescriptions": [ + "Unspecified section type.", + "Zero touch section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ], + "description": "Section type of the device claim.", + "type": "string" + }, + "ownerCompanyId": { + "description": "Owner ID.", + "format": "int64", + "type": "string" + } + }, + "id": "DeviceClaim", + "description": "Information about a device claimed for a partner.", + "type": "object" + }, + "PerDeviceStatusInBatch": { + "properties": { + "deviceId": { + "description": "Device ID of the device if process succeeds.", + "format": "int64", + "type": "string" + }, + "status": { + "enum": [ + "SINGLE_DEVICE_STATUS_UNSPECIFIED", + "SINGLE_DEVICE_STATUS_UNKNOWN_ERROR", + "SINGLE_DEVICE_STATUS_OTHER_ERROR", + "SINGLE_DEVICE_STATUS_SUCCESS", + "SINGLE_DEVICE_STATUS_PERMISSION_DENIED", + "SINGLE_DEVICE_STATUS_INVALID_DEVICE_IDENTIFIER", + "SINGLE_DEVICE_STATUS_INVALID_SECTION_TYPE", + "SINGLE_DEVICE_STATUS_SECTION_NOT_YOURS" + ], + "description": "Process result.", + "type": "string", + "enumDescriptions": [ + "Invalid code. Shouldn't be used.", + "Unknown error.\nWe don't expect this error to occur here.", + "Other error.\nWe know/expect this error, but there's no defined error code for the\nerror.", + "Success.", + "Permission denied.", + "Invalid device identifier.", + "Invalid section type.", + "This section is claimed by another company." + ] + }, + "errorIdentifier": { + "description": "Error identifier.", + "type": "string" + }, + "errorMessage": { + "description": "Error message.", + "type": "string" + } + }, + "id": "PerDeviceStatusInBatch", + "description": "Stores the processing result for each device.", + "type": "object" + }, + "FindDevicesByOwnerRequest": { + "properties": { + "pageToken": { + "description": "Page token.", + "type": "string" + }, + "sectionType": { + "enumDescriptions": [ + "Unspecified section type.", + "Zero touch section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ], + "description": "The section type.", + "type": "string" + }, + "customerId": { + "description": "List of customer IDs to search for.", + "type": "array", + "items": { + "format": "int64", + "type": "string" + } + }, + "limit": { + "description": "The number of devices to show in the result.", + "format": "int64", + "type": "string" + } + }, + "id": "FindDevicesByOwnerRequest", + "description": "Request to find devices by customers.", + "type": "object" + }, + "ClaimDevicesRequest": { + "description": "Request to claim devices asynchronously in batch.", + "type": "object", + "properties": { + "claims": { + "description": "List of claims.", + "type": "array", + "items": { + "$ref": "PartnerClaim" + } + } + }, + "id": "ClaimDevicesRequest" + }, + "DeviceIdentifier": { + "properties": { + "imei": { + "description": "IMEI number.", + "type": "string" + }, + "meid": { + "description": "MEID number.", + "type": "string" + }, + "manufacturer": { + "description": "Manufacturer name to match `android.os.Build.MANUFACTURER` (required).\nAllowed values listed in\n[manufacturer names](/zero-touch/resources/manufacturer-names).", + "type": "string" + }, + "serialNumber": { + "description": "Serial number (optional).", + "type": "string" + } + }, + "id": "DeviceIdentifier", + "description": "Identifies a unique device.", + "type": "object" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "This field will contain a `DevicesLongRunningOperationResponse` object if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "This field will always be not set if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error information for each device is set in `response.perDeviceStatus.result.status`." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "This field will contain a `DevicesLongRunningOperationMetadata` object if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`.", + "type": "object" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + } + }, + "id": "Operation" + }, + "UnclaimDevicesRequest": { + "description": "Request to unclaim devices asynchronously in batch.", + "type": "object", + "properties": { + "unclaims": { + "description": "List of devices to unclaim.", + "type": "array", + "items": { + "$ref": "PartnerUnclaim" + } + } + }, + "id": "UnclaimDevicesRequest" + }, + "FindDevicesByDeviceIdentifierRequest": { + "properties": { + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "The device identifier to search." + }, + "pageToken": { + "description": "Page token.", + "type": "string" + }, + "limit": { + "description": "Number of devices to show.", + "format": "int64", + "type": "string" + } + }, + "id": "FindDevicesByDeviceIdentifierRequest", + "description": "Request to find devices.", + "type": "object" + }, + "Status": { + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "type": "array", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + } + }, + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + } + }, + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object" + }, + "OperationPerDevice": { + "properties": { + "claim": { + "$ref": "PartnerClaim", + "description": "Request to claim a device." + }, + "updateMetadata": { + "description": "Request to set metadata for a device.", + "$ref": "UpdateMetadataArguments" + }, + "unclaim": { + "$ref": "PartnerUnclaim", + "description": "Request to unclaim a device." + }, + "result": { + "$ref": "PerDeviceStatusInBatch", + "description": "Processing result for every device." + } + }, + "id": "OperationPerDevice", + "description": "Operation the server received for every device.", + "type": "object" + }, + "FindDevicesByOwnerResponse": { + "description": "Response containing found devices.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Page token of the next page.", + "type": "string" + }, + "devices": { + "description": "Devices found.", + "type": "array", + "items": { + "$ref": "Device" + } + } + }, + "id": "FindDevicesByOwnerResponse" + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + } +} diff --git a/etc/api/androiddeviceprovisioning/v1/crates/1.0.6-api+20170923 b/etc/api/androiddeviceprovisioning/v1/crates/1.0.6-api+20170923 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/androiddeviceprovisioning/v1/crates/1.0.6-cli+20170923 b/etc/api/androiddeviceprovisioning/v1/crates/1.0.6-cli+20170923 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/androidenterprise/v1/androidenterprise-api.json b/etc/api/androidenterprise/v1/androidenterprise-api.json index d1aab1e11f..333a7d6ae3 100644 --- a/etc/api/androidenterprise/v1/androidenterprise-api.json +++ b/etc/api/androidenterprise/v1/androidenterprise-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/yataDr640bpajGP_lh8edeYDi-w\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/sBqnEugV9meeDd_JBciPAzCelAY\"", "discoveryVersion": "v1", "id": "androidenterprise:v1", "name": "androidenterprise", "canonicalName": "Android Enterprise", "version": "v1", - "revision": "20170516", + "revision": "20170922", "title": "Google Play EMM API", "description": "Manages the deployment of apps to Android for Work users.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/androidenterprise/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "androidenterprise/v1/", - "batchPath": "batch", + "batchPath": "batch/androidenterprise/v1", "parameters": { "alt": { "type": "string", @@ -127,6 +127,22 @@ } } }, + "AndroidDevicePolicyConfig": { + "id": "AndroidDevicePolicyConfig", + "type": "object", + "description": "The Android Device Policy configuration of an enterprise.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#androidDevicePolicyConfig\".", + "default": "androidenterprise#androidDevicePolicyConfig" + }, + "state": { + "type": "string", + "description": "The state of Android Device Policy. \"enabled\" indicates that Android Device Policy is enabled for the enterprise and the EMM is allowed to manage devices with Android Device Policy, while \"disabled\" means that it cannot." + } + } + }, "AppRestrictionsSchema": { "id": "AppRestrictionsSchema", "type": "object", @@ -477,7 +493,7 @@ "GroupLicense": { "id": "GroupLicense", "type": "object", - "description": "A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play by the enterprise admin.\n\nThe API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, that is, the total number of user entitlements in existence for the product.\n\nGroup license objects are never deleted. If, for example, a free app is added to a collection and then removed, the group license will remain, allowing the enterprise admin to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play.", + "description": "Group license objects allow you to keep track of licenses (called entitlements) for both free and paid apps. For a free app, a group license is created when an enterprise admin first approves the product in Google Play or when the first entitlement for the product is created for a user via the API. For a paid app, a group license object is only created when an enterprise admin purchases the product in Google Play for the first time.\n\nUse the API to query group licenses. A Grouplicenses resource includes the total number of licenses purchased (paid apps only) and the total number of licenses currently in use. Iyn other words, the total number of Entitlements that exist for the product.\n\nOnly one group license object is created per product and group license objects are never deleted. If a product is unapproved, its group license remains. This allows enterprise admins to keep track of any remaining entitlements for the product.", "properties": { "acquisitionKind": { "type": "string", @@ -917,7 +933,7 @@ "properties": { "appVersion": { "type": "array", - "description": "App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included.", + "description": "App versions currently available for this product.", "items": { "$ref": "AppVersion" } @@ -955,6 +971,10 @@ "type": "boolean", "description": "Deprecated." }, + "signingCertificate": { + "$ref": "ProductSigningCertificate", + "description": "The certificate used to sign this product." + }, "smallIconUrl": { "type": "string", "description": "A link to a smaller image that can be used as an icon for the product. This image is suitable for use at up to 128px x 128px." @@ -1056,7 +1076,21 @@ }, "productSetBehavior": { "type": "string", - "description": "The interpretation of this product set. \"unknown\" should never be sent and is ignored if received. \"whitelist\" means that the user is entitled to access the product set. \"includeAll\" means that all products are accessible, including products that are approved, products with revoked approval, and products that have never been approved. \"allApproved\" means that the user is entitled to access all products that are approved for the enterprise. If the value is \"allApproved\" or \"includeAll\", the productId field is ignored. If no value is provided, it is interpreted as \"whitelist\" for backwards compatibility." + "description": "The interpretation of this product set. \"unknown\" should never be sent and is ignored if received. \"whitelist\" means that the user is entitled to access the product set. \"includeAll\" means that all products are accessible, including products that are approved, products with revoked approval, and products that have never been approved. \"allApproved\" means that the user is entitled to access all products that are approved for the enterprise. If the value is \"allApproved\" or \"includeAll\", the productId field is ignored. If no value is provided, it is interpreted as \"whitelist\" for backwards compatibility. Further \"allApproved\" or \"includeAll\" does not enable automatic visibility of \"alpha\" or \"beta\" tracks for Android app. Use ProductVisibility to enable \"alpha\" or \"beta\" tracks per user." + } + } + }, + "ProductSigningCertificate": { + "id": "ProductSigningCertificate", + "type": "object", + "properties": { + "certificateHashSha1": { + "type": "string", + "description": "The base64 urlsafe encoded SHA1 hash of the certificate. (This field is deprecated in favor of SHA2-256. It should not be used and may be removed at any time.)" + }, + "certificateHashSha256": { + "type": "string", + "description": "The base64 urlsafe encoded SHA2-256 hash of the certificate." } } }, @@ -1722,6 +1756,29 @@ "https://www.googleapis.com/auth/androidenterprise" ] }, + "getAndroidDevicePolicyConfig": { + "id": "androidenterprise.enterprises.getAndroidDevicePolicyConfig", + "path": "enterprises/{enterpriseId}/androidDevicePolicyConfig", + "httpMethod": "GET", + "description": "Returns the Android Device Policy config resource.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "response": { + "$ref": "AndroidDevicePolicyConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, "getServiceAccount": { "id": "androidenterprise.enterprises.getServiceAccount", "path": "enterprises/{enterpriseId}/serviceAccount", @@ -1861,7 +1918,7 @@ "id": "androidenterprise.enterprises.sendTestPushNotification", "path": "enterprises/{enterpriseId}/sendTestPushNotification", "httpMethod": "POST", - "description": "Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.", + "description": "Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.", "parameters": { "enterpriseId": { "type": "string", @@ -1906,6 +1963,32 @@ "https://www.googleapis.com/auth/androidenterprise" ] }, + "setAndroidDevicePolicyConfig": { + "id": "androidenterprise.enterprises.setAndroidDevicePolicyConfig", + "path": "enterprises/{enterpriseId}/androidDevicePolicyConfig", + "httpMethod": "PUT", + "description": "Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "request": { + "$ref": "AndroidDevicePolicyConfig" + }, + "response": { + "$ref": "AndroidDevicePolicyConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, "setStoreLayout": { "id": "androidenterprise.enterprises.setStoreLayout", "path": "enterprises/{enterpriseId}/storeLayout", diff --git a/etc/api/androidenterprise/v1/crates/1.0.6-api+20170922 b/etc/api/androidenterprise/v1/crates/1.0.6-api+20170922 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/androidmanagement/v1/androidmanagement-api.json b/etc/api/androidmanagement/v1/androidmanagement-api.json new file mode 100644 index 0000000000..d26c4af830 --- /dev/null +++ b/etc/api/androidmanagement/v1/androidmanagement-api.json @@ -0,0 +1,2363 @@ +{ + "id": "androidmanagement:v1", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/androidmanagement": { + "description": "Manage Android devices and apps for your customers" + } + } + } + }, + "description": "The Android Management API provides remote enterprise management of Android devices and apps.", + "protocol": "rest", + "title": "Android Management API", + "resources": { + "signupUrls": { + "methods": { + "create": { + "id": "androidmanagement.signupUrls.create", + "response": { + "$ref": "SignupUrl" + }, + "parameterOrder": [], + "description": "Creates an enterprise signup URL.", + "flatPath": "v1/signupUrls", + "httpMethod": "POST", + "parameters": { + "callbackUrl": { + "description": "The callback URL to which the admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes.", + "location": "query", + "type": "string" + }, + "projectId": { + "description": "The id of the Google Cloud Platform project which will own the enterprise.", + "location": "query", + "type": "string" + } + }, + "path": "v1/signupUrls", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + }, + "enterprises": { + "resources": { + "policies": { + "methods": { + "get": { + "id": "androidmanagement.enterprises.policies.get", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "name" + ], + "description": "Gets a policy.", + "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}", + "required": true, + "pattern": "^enterprises/[^/]+/policies/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "list": { + "id": "androidmanagement.enterprises.policies.list", + "response": { + "$ref": "ListPoliciesResponse" + }, + "parameterOrder": [ + "parent" + ], + "description": "Lists policies for a given enterprise.", + "flatPath": "v1/enterprises/{enterprisesId}/policies", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "The requested page size. The actual page size may be fixed to a min or max value.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "parent": { + "description": "The name of the enterprise in the form enterprises/{enterpriseId}", + "required": true, + "pattern": "^enterprises/[^/]+$", + "location": "path", + "type": "string" + }, + "pageToken": { + "description": "A token identifying a page of results the server should return.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+parent}/policies", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "patch": { + "id": "androidmanagement.enterprises.policies.patch", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "name" + ], + "description": "Updates or creates a policy.", + "request": { + "$ref": "Policy" + }, + "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}", + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + }, + "name": { + "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}", + "required": true, + "pattern": "^enterprises/[^/]+/policies/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "delete": { + "id": "androidmanagement.enterprises.policies.delete", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "description": "Deletes a policy. This operation is only permitted if no devices are currently referencing the policy.", + "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}", + "required": true, + "pattern": "^enterprises/[^/]+/policies/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + }, + "applications": { + "methods": { + "get": { + "id": "androidmanagement.enterprises.applications.get", + "response": { + "$ref": "Application" + }, + "parameterOrder": [ + "name" + ], + "description": "Gets info about an application.", + "flatPath": "v1/enterprises/{enterprisesId}/applications/{applicationsId}", + "httpMethod": "GET", + "parameters": { + "languageCode": { + "description": "The preferred language for localized application info, as a BCP47 tag (e.g. \"en-US\", \"de\"). If not specified the default language of the application will be used.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}", + "required": true, + "pattern": "^enterprises/[^/]+/applications/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + }, + "enrollmentTokens": { + "methods": { + "create": { + "id": "androidmanagement.enterprises.enrollmentTokens.create", + "response": { + "$ref": "EnrollmentToken" + }, + "parameterOrder": [ + "parent" + ], + "description": "Creates an enrollment token for a given enterprise.", + "request": { + "$ref": "EnrollmentToken" + }, + "flatPath": "v1/enterprises/{enterprisesId}/enrollmentTokens", + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "The name of the enterprise in the form enterprises/{enterpriseId}", + "required": true, + "pattern": "^enterprises/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+parent}/enrollmentTokens", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "delete": { + "id": "androidmanagement.enterprises.enrollmentTokens.delete", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "description": "Deletes an enrollment token, which prevents future use of the token.", + "flatPath": "v1/enterprises/{enterprisesId}/enrollmentTokens/{enrollmentTokensId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}", + "required": true, + "pattern": "^enterprises/[^/]+/enrollmentTokens/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + }, + "webTokens": { + "methods": { + "create": { + "id": "androidmanagement.enterprises.webTokens.create", + "response": { + "$ref": "WebToken" + }, + "parameterOrder": [ + "parent" + ], + "description": "Creates a web token to access an embeddable managed Google Play web UI for a given enterprise.", + "request": { + "$ref": "WebToken" + }, + "flatPath": "v1/enterprises/{enterprisesId}/webTokens", + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "The name of the enterprise in the form enterprises/{enterpriseId}", + "required": true, + "pattern": "^enterprises/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+parent}/webTokens", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + }, + "devices": { + "resources": { + "operations": { + "methods": { + "get": { + "id": "androidmanagement.enterprises.devices.operations.get", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "list": { + "id": "androidmanagement.enterprises.devices.operations.list", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "The standard list page size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+/operations$", + "location": "path", + "type": "string" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "delete": { + "id": "androidmanagement.enterprises.devices.operations.delete", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.", + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "cancel": { + "id": "androidmanagement.enterprises.devices.operations.cancel", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}:cancel", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + } + }, + "methods": { + "get": { + "id": "androidmanagement.enterprises.devices.get", + "response": { + "$ref": "Device" + }, + "parameterOrder": [ + "name" + ], + "description": "Gets a device.", + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "list": { + "id": "androidmanagement.enterprises.devices.list", + "response": { + "$ref": "ListDevicesResponse" + }, + "parameterOrder": [ + "parent" + ], + "description": "Lists devices for a given enterprise.", + "flatPath": "v1/enterprises/{enterprisesId}/devices", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "The requested page size. The actual page size may be fixed to a min or max value.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "parent": { + "description": "The name of the enterprise in the form enterprises/{enterpriseId}", + "required": true, + "pattern": "^enterprises/[^/]+$", + "location": "path", + "type": "string" + }, + "pageToken": { + "description": "A token identifying a page of results the server should return.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+parent}/devices", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "issueCommand": { + "id": "androidmanagement.enterprises.devices.issueCommand", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "description": "Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command.", + "request": { + "$ref": "Command" + }, + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}:issueCommand", + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}:issueCommand", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "patch": { + "id": "androidmanagement.enterprises.devices.patch", + "response": { + "$ref": "Device" + }, + "parameterOrder": [ + "name" + ], + "description": "Updates a device.", + "request": { + "$ref": "Device" + }, + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + }, + "name": { + "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "delete": { + "id": "androidmanagement.enterprises.devices.delete", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "description": "Deletes a device, which causes the device to be wiped.", + "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}", + "required": true, + "pattern": "^enterprises/[^/]+/devices/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + } + }, + "methods": { + "create": { + "id": "androidmanagement.enterprises.create", + "response": { + "$ref": "Enterprise" + }, + "parameterOrder": [], + "description": "Creates an enterprise by completing the enterprise signup flow.", + "request": { + "$ref": "Enterprise" + }, + "flatPath": "v1/enterprises", + "httpMethod": "POST", + "parameters": { + "signupUrlName": { + "description": "The name of the SignupUrl used to sign up for the enterprise.", + "location": "query", + "type": "string" + }, + "enterpriseToken": { + "description": "The enterprise token appended to the callback URL.", + "location": "query", + "type": "string" + }, + "projectId": { + "description": "The id of the Google Cloud Platform project which will own the enterprise.", + "location": "query", + "type": "string" + } + }, + "path": "v1/enterprises", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "get": { + "id": "androidmanagement.enterprises.get", + "response": { + "$ref": "Enterprise" + }, + "parameterOrder": [ + "name" + ], + "description": "Gets an enterprise.", + "flatPath": "v1/enterprises/{enterprisesId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the enterprise in the form enterprises/{enterpriseId}", + "required": true, + "pattern": "^enterprises/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + }, + "patch": { + "id": "androidmanagement.enterprises.patch", + "response": { + "$ref": "Enterprise" + }, + "parameterOrder": [ + "name" + ], + "description": "Updates an enterprise.", + "request": { + "$ref": "Enterprise" + }, + "flatPath": "v1/enterprises/{enterprisesId}", + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + }, + "name": { + "description": "The name of the enterprise in the form enterprises/{enterpriseId}", + "required": true, + "pattern": "^enterprises/[^/]+$", + "location": "path", + "type": "string" + } + }, + "path": "v1/{+name}", + "scopes": [ + "https://www.googleapis.com/auth/androidmanagement" + ] + } + } + } + }, + "schemas": { + "Device": { + "description": "A device owned by an enterprise. Unless otherwise noted, all fields are read-only and cannot be modified by an update device request.", + "type": "object", + "properties": { + "userName": { + "description": "The resource name of the user of the device in the form enterprises/{enterpriseId}/users/{userId}. This is the name of the device account automatically created for this device.", + "type": "string" + }, + "disabledReason": { + "description": "If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field may be modified by an update request.", + "$ref": "UserFacingMessage" + }, + "policyName": { + "description": "The name of the policy that is intended to be applied to the device. If empty, the policy with id default is applied. This field may be modified by an update request. The name of the policy is in the form enterprises/{enterpriseId}/policies/{policyId}. It is also permissible to only specify the policyId when updating this field as long as the policyId contains no slashes since the rest of the policy name can be inferred from context.", + "type": "string" + }, + "lastPolicyComplianceReportTime": { + "description": "The last time the device sent a policy compliance report.", + "type": "string", + "format": "google-datetime" + }, + "nonComplianceDetails": { + "description": "Details about policy settings for which the device is not in compliance.", + "type": "array", + "items": { + "$ref": "NonComplianceDetail" + } + }, + "lastPolicySyncTime": { + "description": "The last time the device fetched its policy.", + "type": "string", + "format": "google-datetime" + }, + "networkInfo": { + "description": "Device network information. This information is only available when networkInfoEnabled is true in the device's policy.", + "$ref": "NetworkInfo" + }, + "appliedState": { + "description": "The state that is currently applied by the device.", + "enum": [ + "DEVICE_STATE_UNSPECIFIED", + "ACTIVE", + "DISABLED", + "DELETED", + "PROVISIONING" + ], + "enumDescriptions": [ + "This value is disallowed.", + "The device is active.", + "The device is disabled.", + "The device was deleted. This state will never be returned by an API call, but will be used in the final policy compliance report published to Cloud Pub/Sub when the device acknowledges the deletion.", + "The device is being provisioned. Newly enrolled devices will be in this state until they have applied policy." + ], + "type": "string" + }, + "enrollmentTokenData": { + "description": "If this device was enrolled with an enrollment token with additional data provided, this field contains that data.", + "type": "string" + }, + "enrollmentTokenName": { + "description": "If this device was enrolled with an enrollment token, this field contains the name of the token.", + "type": "string" + }, + "memoryInfo": { + "description": "Memory information. This information is only available when memoryInfoEnabled is true in the device's policy.", + "$ref": "MemoryInfo" + }, + "state": { + "description": "The state that is intended to be applied to the device. This field may be modified by an update request. Note that UpdateDevice only handles toggling between ACTIVE and DISABLED states. Use the delete device method to cause the device to enter the DELETED state.", + "enum": [ + "DEVICE_STATE_UNSPECIFIED", + "ACTIVE", + "DISABLED", + "DELETED", + "PROVISIONING" + ], + "enumDescriptions": [ + "This value is disallowed.", + "The device is active.", + "The device is disabled.", + "The device was deleted. This state will never be returned by an API call, but will be used in the final policy compliance report published to Cloud Pub/Sub when the device acknowledges the deletion.", + "The device is being provisioned. Newly enrolled devices will be in this state until they have applied policy." + ], + "type": "string" + }, + "softwareInfo": { + "description": "Detailed information about the device software. This information is only available when softwareInfoEnabled is true in the device's policy.", + "$ref": "SoftwareInfo" + }, + "memoryEvents": { + "description": "Events related to memory and storage measurements in chronological order. This information is only available when memoryInfoEnabled is true in the device's policy.", + "type": "array", + "items": { + "$ref": "MemoryEvent" + } + }, + "previousDeviceNames": { + "description": "The previous device names used for the same physical device when it has been enrolled multiple times. The serial number is used as the unique identifier to determine if the same physical device has enrolled previously. The names are in chronological order.", + "type": "array", + "items": { + "type": "string" + } + }, + "policyCompliant": { + "description": "Whether the device is compliant with its policy.", + "type": "boolean" + }, + "lastStatusReportTime": { + "description": "The last time the device sent a status report.", + "type": "string", + "format": "google-datetime" + }, + "name": { + "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}", + "type": "string" + }, + "hardwareStatusSamples": { + "description": "Hardware status samples in chronological order. This information is only available when hardwareStatusEnabled is true in the device's policy.", + "type": "array", + "items": { + "$ref": "HardwareStatus" + } + }, + "enrollmentTime": { + "description": "The time of device enrollment.", + "type": "string", + "format": "google-datetime" + }, + "appliedPolicyVersion": { + "description": "The version of the policy that is currently applied by the device.", + "type": "string", + "format": "int64" + }, + "apiLevel": { + "description": "The API level of the Android platform version running on the device.", + "type": "integer", + "format": "int32" + }, + "hardwareInfo": { + "description": "Detailed information about the device hardware.", + "$ref": "HardwareInfo" + }, + "appliedPolicyName": { + "description": "The name of the policy that is currently applied by the device.", + "type": "string" + }, + "displays": { + "description": "Displays on the device. This information is only available when displayInfoEnabled is true in the device's policy.", + "type": "array", + "items": { + "$ref": "Display" + } + }, + "powerManagementEvents": { + "description": "Power management events on the device in chronological order. This information is only available when powerManagementEventsEnabled is true in the device's policy.", + "type": "array", + "items": { + "$ref": "PowerManagementEvent" + } + } + }, + "id": "Device" + }, + "PermissionGrant": { + "description": "Configuration for an Android permission and its grant state.", + "type": "object", + "properties": { + "permission": { + "description": "The android permission, e.g. android.permission.READ_CALENDAR.", + "type": "string" + }, + "policy": { + "description": "The policy for granting the permission.", + "enum": [ + "PERMISSION_POLICY_UNSPECIFIED", + "PROMPT", + "GRANT", + "DENY" + ], + "enumDescriptions": [ + "Policy not specified. If no policy is specified for a permission at any level, then the PROMPT behavior is used by default.", + "Prompt the user to grant a permission.", + "Automatically grant a permission.", + "Automatically deny a permission." + ], + "type": "string" + } + }, + "id": "PermissionGrant" + }, + "Application": { + "description": "Application information.", + "type": "object", + "properties": { + "managedProperties": { + "description": "The set of managed properties available to be pre-configured for the application.", + "type": "array", + "items": { + "$ref": "ManagedProperty" + } + }, + "title": { + "description": "The title of the application. Localized.", + "type": "string" + }, + "permissions": { + "description": "The permissions required by the app.", + "type": "array", + "items": { + "$ref": "ApplicationPermission" + } + }, + "name": { + "description": "The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}", + "type": "string" + } + }, + "id": "Application" + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer", + "format": "int32" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "type": "array", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + } + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "Status" + }, + "ApplicationPolicy": { + "description": "Policy for an individual app.", + "type": "object", + "properties": { + "lockTaskAllowed": { + "description": "Whether the application is allowed to lock itself in full-screen mode.", + "type": "boolean" + }, + "permissionGrants": { + "description": "Explicit permission grants or denials for the app. These values override the default_permission_policy.", + "type": "array", + "items": { + "$ref": "PermissionGrant" + } + }, + "managedConfiguration": { + "description": "Managed configuration applied to the app. The format for the configuration is dictated by the ManagedProperty values supported by the app. Each field name in the managed configuration must match the key field of the ManagedProperty. The field value must be compatible with the type of the ManagedProperty: \u003ctable\u003e \u003ctr\u003e\u003ctd\u003e\u003ci\u003etype\u003c/i\u003e\u003c/td\u003e\u003ctd\u003e\u003ci\u003eJSON value\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eBOOL\u003c/td\u003e\u003ctd\u003etrue or false\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eSTRING\u003c/td\u003e\u003ctd\u003estring\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eINTEGER\u003c/td\u003e\u003ctd\u003enumber\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eCHOICE\u003c/td\u003e\u003ctd\u003estring\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eMULTISELECT\u003c/td\u003e\u003ctd\u003earray of strings\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eHIDDEN\u003c/td\u003e\u003ctd\u003estring\u003c/td\u003e\u003c/tr\u003e \u003ctr\u003e\u003ctd\u003eBUNDLE_ARRAY\u003c/td\u003e\u003ctd\u003earray of objects\u003c/td\u003e\u003c/tr\u003e \u003c/table\u003e", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "type": "object" + }, + "packageName": { + "description": "The package name of the app, e.g. com.google.android.youtube for the YouTube app.", + "type": "string" + }, + "installType": { + "description": "The type of installation to perform.", + "enum": [ + "INSTALL_TYPE_UNSPECIFIED", + "PREINSTALLED", + "FORCE_INSTALLED" + ], + "enumDescriptions": [ + "No automatic installation is performed. Any other app policies will be applied if the user installs the app.", + "The application is automatically installed and can be removed by the user.", + "The application is automatically installed and cannot be removed by the user." + ], + "type": "string" + }, + "defaultPermissionPolicy": { + "description": "The default policy for all permissions requested by the app. If specified, this overrides the policy-level default_permission_policy which applies to all apps.", + "enum": [ + "PERMISSION_POLICY_UNSPECIFIED", + "PROMPT", + "GRANT", + "DENY" + ], + "enumDescriptions": [ + "Policy not specified. If no policy is specified for a permission at any level, then the PROMPT behavior is used by default.", + "Prompt the user to grant a permission.", + "Automatically grant a permission.", + "Automatically deny a permission." + ], + "type": "string" + } + }, + "id": "ApplicationPolicy" + }, + "ApplicationPermission": { + "description": "Application permission.", + "type": "object", + "properties": { + "description": { + "description": "A longer description of the permission, giving more details of what it affects. Localized.", + "type": "string" + }, + "permissionId": { + "description": "An opaque string uniquely identifying the permission. Not localized.", + "type": "string" + }, + "name": { + "description": "The name of the permission. Localized.", + "type": "string" + } + }, + "id": "ApplicationPermission" + }, + "ManagedProperty": { + "description": "Managed property.", + "type": "object", + "properties": { + "nestedProperties": { + "description": "For BUNDLE_ARRAY properties, the list of nested properties. A BUNDLE_ARRAY property is at most two levels deep.", + "type": "array", + "items": { + "$ref": "ManagedProperty" + } + }, + "description": { + "description": "A longer description of the property, giving more detail of what it affects. Localized.", + "type": "string" + }, + "defaultValue": { + "description": "The default value of the properties. BUNDLE_ARRAY properties never have a default value.", + "type": "any" + }, + "title": { + "description": "The name of the property. Localized.", + "type": "string" + }, + "key": { + "description": "The unique key that the application uses to identify the property, e.g. \"com.google.android.gm.fieldname\".", + "type": "string" + }, + "entries": { + "description": "For CHOICE or MULTISELECT properties, the list of possible entries.", + "type": "array", + "items": { + "$ref": "ManagedPropertyEntry" + } + }, + "type": { + "description": "The type of the property.", + "enum": [ + "MANAGED_PROPERTY_TYPE_UNSPECIFIED", + "BOOL", + "STRING", + "INTEGER", + "CHOICE", + "MULTISELECT", + "HIDDEN", + "BUNDLE_ARRAY" + ], + "enumDescriptions": [ + "Not used.", + "A property of boolean type.", + "A property of string type.", + "A property of integer type.", + "A choice of one item from a set.", + "A choice of multiple items from a set.", + "A hidden restriction of string type (the default value can be used to pass along information that cannot be modified, such as a version code).", + "An array of property bundles." + ], + "type": "string" + } + }, + "id": "ManagedProperty" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object", + "properties": { + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "response": { + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", + "type": "string" + } + }, + "id": "Operation" + }, + "NonComplianceDetailCondition": { + "description": "A compliance rule condition which is satisfied if there exists any matching NonComplianceDetail for the device. A NonComplianceDetail matches a NonComplianceDetailCondition if all the fields which are set within the NonComplianceDetailCondition match the corresponding NonComplianceDetail fields.", + "type": "object", + "properties": { + "nonComplianceReason": { + "description": "The reason the device is not in compliance with the setting. If not set, then this condition matches any reason.", + "enum": [ + "NON_COMPLIANCE_REASON_UNSPECIFIED", + "API_LEVEL", + "ADMIN_TYPE", + "USER_ACTION", + "INVALID_VALUE", + "APP_NOT_INSTALLED", + "UNSUPPORTED", + "APP_INSTALLED", + "PENDING", + "APP_INCOMPATIBLE", + "APP_NOT_UPDATED" + ], + "enumDescriptions": [ + "This value is disallowed.", + "The setting is not supported in the API level of Android OS version the device is running.", + "The admin type (profile owner, device owner, etc.) does not support the setting.", + "The user has not taken required action to comply with the setting.", + "The setting has an invalid value.", + "The application required to implement the policy is not installed.", + "The policy is not supported by the version of Android Device Policy on the device.", + "A blocked application is installed.", + "The setting was not applied yet at the time of the report, but is expected to be applied shortly.", + "The setting cannot be applied to the application because the application doesn't support it, for example because its target SDK version is not high enough.", + "The application is installed but not updated to the minimum version code specified by policy" + ], + "type": "string" + }, + "settingName": { + "description": "The name of the policy setting. This is the JSON field name of a top-level Policy field. If not set, then this condition matches any setting name.", + "type": "string" + }, + "packageName": { + "description": "The package name indicating which application is out of compliance. If not set, then this condition matches any package name.", + "type": "string" + } + }, + "id": "NonComplianceDetailCondition" + }, + "NonComplianceDetail": { + "description": "Provides detail about non-compliance with a policy setting.", + "type": "object", + "properties": { + "settingName": { + "description": "The name of the policy setting. This is the JSON field name of a top-level Policy field.", + "type": "string" + }, + "currentValue": { + "description": "If the policy setting could not be applied, the current value of the setting on the device.", + "type": "any" + }, + "packageName": { + "description": "The package name indicating which application is out of compliance, if applicable.", + "type": "string" + }, + "installationFailureReason": { + "description": "If package_name is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app cannot be installed or updated.", + "enum": [ + "INSTALLATION_FAILURE_REASON_UNSPECIFIED", + "INSTALLATION_FAILURE_REASON_UNKNOWN", + "IN_PROGRESS", + "NOT_FOUND", + "NOT_COMPATIBLE_WITH_DEVICE", + "NOT_APPROVED", + "PERMISSIONS_NOT_ACCEPTED", + "NOT_AVAILABLE_IN_COUNTRY", + "NO_LICENSES_REMAINING", + "NOT_ENROLLED", + "USER_INVALID" + ], + "enumDescriptions": [ + "This value is disallowed.", + "An unknown condition is preventing the app from being installed. Some potential reaons are that the device does not have enough storage, the device network connection is unreliable, or the installation is taking longer than expected. The installation will be retried automatically.", + "The installation is still in progress.", + "The app was not found in Play.", + "The app is incompatible with the device.", + "The app has not been approved by the admin.", + "The app has new permissions that have not been accepted by the admin.", + "The app is not available in the user's country.", + "There are no more licenses to assign to the user.", + "The enterprise is no longer enrolled with Play for Work or Android Device Policy is not enabled for the enterprise.", + "The user is no longer valid. The user may have been deleted or disabled." + ], + "type": "string" + }, + "fieldPath": { + "description": "For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url", + "type": "string" + }, + "nonComplianceReason": { + "description": "The reason the device is not in compliance with the setting.", + "enum": [ + "NON_COMPLIANCE_REASON_UNSPECIFIED", + "API_LEVEL", + "ADMIN_TYPE", + "USER_ACTION", + "INVALID_VALUE", + "APP_NOT_INSTALLED", + "UNSUPPORTED", + "APP_INSTALLED", + "PENDING", + "APP_INCOMPATIBLE", + "APP_NOT_UPDATED" + ], + "enumDescriptions": [ + "This value is disallowed.", + "The setting is not supported in the API level of Android OS version the device is running.", + "The admin type (profile owner, device owner, etc.) does not support the setting.", + "The user has not taken required action to comply with the setting.", + "The setting has an invalid value.", + "The application required to implement the policy is not installed.", + "The policy is not supported by the version of Android Device Policy on the device.", + "A blocked application is installed.", + "The setting was not applied yet at the time of the report, but is expected to be applied shortly.", + "The setting cannot be applied to the application because the application doesn't support it, for example because its target SDK version is not high enough.", + "The application is installed but not updated to the minimum version code specified by policy" + ], + "type": "string" + } + }, + "id": "NonComplianceDetail" + }, + "ListDevicesResponse": { + "description": "Response to a request to list devices for a given enterprise.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If there are more results, a token to retrieve next page of results.", + "type": "string" + }, + "devices": { + "description": "The list of devices.", + "type": "array", + "items": { + "$ref": "Device" + } + } + }, + "id": "ListDevicesResponse" + }, + "PersistentPreferredActivity": { + "description": "A default activity for handling intents that match a particular intent filter.", + "type": "object", + "properties": { + "receiverActivity": { + "description": "The activity that should be the default intent handler. This should be an Android component name, e.g. com.android.enterprise.app/.MainActivity. Alternatively, the value may be the package name of an app, which causes Android Device Policy to choose an appropriate activity from the app to handle the intent.", + "type": "string" + }, + "actions": { + "description": "The intent actions to match in the filter. If any actions are included in the filter, then an intent's action must be one of those values for it to match. If no actions are included, the intent action is ignored.", + "type": "array", + "items": { + "type": "string" + } + }, + "categories": { + "description": "The intent categories to match in the filter. An intent includes the categories that it requires, all of which must be included in the filter in order to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "PersistentPreferredActivity" + }, + "Policy": { + "description": "A policy, which governs behavior for a device.", + "type": "object", + "properties": { + "openNetworkConfiguration": { + "description": "Network configuration for the device. See configure networks for more information.", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "type": "object" + }, + "adjustVolumeDisabled": { + "description": "Whether adjusting the master volume is disabled.", + "type": "boolean" + }, + "passwordRequirements": { + "description": "Password requirements.", + "$ref": "PasswordRequirements" + }, + "modifyAccountsDisabled": { + "description": "Whether adding or removing accounts is disabled.", + "type": "boolean" + }, + "statusReportingSettings": { + "description": "Status reporting settings", + "$ref": "StatusReportingSettings" + }, + "factoryResetDisabled": { + "description": "Whether factory resetting from settings is disabled.", + "type": "boolean" + }, + "funDisabled": { + "description": "Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled.", + "type": "boolean" + }, + "applications": { + "description": "Policy applied to apps.", + "type": "array", + "items": { + "$ref": "ApplicationPolicy" + } + }, + "safeBootDisabled": { + "description": "Whether rebooting the device into safe boot is disabled.", + "type": "boolean" + }, + "wifiConfigsLockdownEnabled": { + "description": "Whether WiFi networks defined in Open Network Configuration are locked so they cannot be edited by the user.", + "type": "boolean" + }, + "complianceRules": { + "description": "Rules declaring which mitigating actions to take when a device is not compliant with its policy. When the conditions for multiple rules are satisfied, all of the mitigating actions for the rules are taken. There is a maximum limit of 100 rules.", + "type": "array", + "items": { + "$ref": "ComplianceRule" + } + }, + "wifiConfigDisabled": { + "description": "Whether configuring WiFi access points is disabled.", + "type": "boolean" + }, + "unmuteMicrophoneDisabled": { + "description": "Whether the microphone is muted and adjusting microphone volume is disabled.", + "type": "boolean" + }, + "installUnknownSourcesAllowed": { + "description": "Whether the user is allowed to enable the \"Unknown Sources\" setting, which allows installation of apps from unknown sources.", + "type": "boolean" + }, + "autoTimeRequired": { + "description": "Whether auto time is required, which prevents the user from manually setting the date and time.", + "type": "boolean" + }, + "removeUserDisabled": { + "description": "Whether removing other users is disabled.", + "type": "boolean" + }, + "statusBarDisabled": { + "description": "Whether the status bar is disabled. This disables notifications, quick settings and other screen overlays that allow escape from full-screen mode.", + "type": "boolean" + }, + "stayOnPluggedModes": { + "description": "The battery plugged in modes for which the device stays on. When using this setting, it is recommended to clear maximum_time_to_lock so that the device doesn't lock itself while it stays on.", + "enumDescriptions": [ + "This value is ignored.", + "Power source is an AC charger.", + "Power source is a USB port.", + "Power source is wireless." + ], + "type": "array", + "items": { + "enum": [ + "BATTERY_PLUGGED_MODE_UNSPECIFIED", + "AC", + "USB", + "WIRELESS" + ], + "type": "string" + } + }, + "cameraDisabled": { + "description": "Whether all cameras on the device are disabled.", + "type": "boolean" + }, + "blockApplicationsEnabled": { + "description": "Whether applications other than the ones configured in applications are blocked from being installed. When set, applications that were installed under a previous policy but no longer appear in the policy are automatically uninstalled.", + "type": "boolean" + }, + "debuggingFeaturesAllowed": { + "description": "Whether the user is allowed to enable debugging features.", + "type": "boolean" + }, + "maximumTimeToLock": { + "description": "Maximum time in milliseconds for user activity until the device will lock. A value of 0 means there is no restriction.", + "type": "string", + "format": "int64" + }, + "name": { + "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}", + "type": "string" + }, + "defaultPermissionPolicy": { + "description": "The default permission policy for requests for runtime permissions.", + "enum": [ + "PERMISSION_POLICY_UNSPECIFIED", + "PROMPT", + "GRANT", + "DENY" + ], + "enumDescriptions": [ + "Policy not specified. If no policy is specified for a permission at any level, then the PROMPT behavior is used by default.", + "Prompt the user to grant a permission.", + "Automatically grant a permission.", + "Automatically deny a permission." + ], + "type": "string" + }, + "persistentPreferredActivities": { + "description": "Default intent handler activities.", + "type": "array", + "items": { + "$ref": "PersistentPreferredActivity" + } + }, + "networkEscapeHatchEnabled": { + "description": "Whether the network escape hatch is enabled. If a network connection can't be made at boot time, the escape hatch prompts the user to temporarily connect to a network in order to refresh the device policy. After applying policy, the temporary network will be forgotten and the device will continue booting. This prevents being unable to connect to a network if there is no suitable network in the last policy and the device boots into an app in lock task mode, or the user is otherwise unable to reach device settings.", + "type": "boolean" + }, + "systemUpdate": { + "description": "The system update policy, which controls how OS updates are applied. If the update type is WINDOWED and the device has a device account, the update window will automatically apply to Play app updates as well.", + "$ref": "SystemUpdate" + }, + "frpAdminEmails": { + "description": "Email addresses of device administrators for factory reset protection. When the device is factory reset, it will require one of these admins to log in with the Google account email and password to unlock the device. If no admins are specified, the device will not provide factory reset protection.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the policy. This is a read-only field. The version is incremented each time the policy is updated.", + "type": "string", + "format": "int64" + }, + "screenCaptureDisabled": { + "description": "Whether screen capture is disabled.", + "type": "boolean" + }, + "keyguardDisabled": { + "description": "Whether the keyguard is disabled.", + "type": "boolean" + }, + "addUserDisabled": { + "description": "Whether adding new users and profiles is disabled.", + "type": "boolean" + } + }, + "id": "Policy" + }, + "Command": { + "description": "A command.", + "type": "object", + "properties": { + "duration": { + "description": "The duration for which the command is valid. The command will expire if not executed by the device during this time. The default duration if unspecified is ten minutes. There is no maximum duration.", + "type": "string", + "format": "google-duration" + }, + "newPassword": { + "description": "For commands of type RESET_PASSWORD, optionally specifies the new password.", + "type": "string" + }, + "type": { + "description": "The type of the command.", + "enum": [ + "COMMAND_TYPE_UNSPECIFIED", + "LOCK", + "RESET_PASSWORD", + "REBOOT" + ], + "enumDescriptions": [ + "This value is disallowed.", + "Lock the device, as if the lock screen timeout had expired.", + "Reset the user's password.", + "Reboot the device. Only supported on API level 24+." + ], + "type": "string" + }, + "createTime": { + "description": "The timestamp at which the command was created. The timestamp is automatically generated by the server.", + "type": "string", + "format": "google-datetime" + }, + "resetPasswordFlags": { + "description": "For commands of type RESET_PASSWORD, optionally specifies flags.", + "enumDescriptions": [ + "This value is ignored.", + "Don't allow other admins to change the password again until the user has entered it.", + "Don't ask for user credentials on device boot.", + "Lock the device after password reset." + ], + "type": "array", + "items": { + "enum": [ + "RESET_PASSWORD_FLAG_UNSPECIFIED", + "REQUIRE_ENTRY", + "DO_NOT_ASK_CREDENTIALS_ON_BOOT", + "LOCK_NOW" + ], + "type": "string" + } + } + }, + "id": "Command" + }, + "ComplianceRule": { + "description": "A rule declaring which mitigating actions to take when a device is not compliant with its policy. For every rule, there is always an implicit mitigating action to set policy_compliant to false for the Device resource, and display a message on the device indicating that the device is not compliant with its policy. Other mitigating actions may optionally be taken as well, depending on the field values in the rule.", + "type": "object", + "properties": { + "nonComplianceDetailCondition": { + "description": "A condition which is satisfied if there exists any matching NonComplianceDetail for the device.", + "$ref": "NonComplianceDetailCondition" + }, + "disableApps": { + "description": "If set to true, the rule includes a mitigating action to disable applications so that the device is effectively disabled, but application data is preserved. If the device is running an app in locked task mode, the app will be closed and a UI showing the reason for non-compliance will be displayed.", + "type": "boolean" + }, + "apiLevelCondition": { + "description": "A condition which is satisfied if the Android Framework API level on the device does not meet a minimum requirement.", + "$ref": "ApiLevelCondition" + } + }, + "id": "ComplianceRule" + }, + "ListPoliciesResponse": { + "description": "Response to a request to list policies for a given enterprise.", + "type": "object", + "properties": { + "policies": { + "description": "The list of policies.", + "type": "array", + "items": { + "$ref": "Policy" + } + }, + "nextPageToken": { + "description": "If there are more results, a token to retrieve next page of results.", + "type": "string" + } + }, + "id": "ListPoliciesResponse" + }, + "StatusReportingSettings": { + "description": "Settings controlling the behavior of status reports.", + "type": "object", + "properties": { + "displayInfoEnabled": { + "description": "Whether displays reporting is enabled.", + "type": "boolean" + }, + "hardwareStatusEnabled": { + "description": "Whether hardware status reporting is enabled.", + "type": "boolean" + }, + "softwareInfoEnabled": { + "description": "Whether software info reporting is enabled.", + "type": "boolean" + }, + "memoryInfoEnabled": { + "description": "Whether memory info reporting is enabled.", + "type": "boolean" + }, + "powerManagementEventsEnabled": { + "description": "Whether power management event reporting is enabled.", + "type": "boolean" + }, + "networkInfoEnabled": { + "description": "Whether network info reporting is enabled.", + "type": "boolean" + } + }, + "id": "StatusReportingSettings" + }, + "Display": { + "description": "Device display information.", + "type": "object", + "properties": { + "refreshRate": { + "description": "Refresh rate of the display in frames per second.", + "type": "integer", + "format": "int32" + }, + "state": { + "description": "State of the display.", + "enum": [ + "DISPLAY_STATE_UNSPECIFIED", + "OFF", + "ON", + "DOZE", + "SUSPENDED" + ], + "enumDescriptions": [ + "This value is disallowed.", + "Display is off.", + "Display is on.", + "Display is dozing in a low power state", + "Display is dozing in a suspended low power state." + ], + "type": "string" + }, + "width": { + "description": "Display width in pixels.", + "type": "integer", + "format": "int32" + }, + "displayId": { + "description": "Unique display id.", + "type": "integer", + "format": "int32" + }, + "name": { + "description": "Name of the display.", + "type": "string" + }, + "density": { + "description": "Display density expressed as dots-per-inch.", + "type": "integer", + "format": "int32" + }, + "height": { + "description": "Display height in pixels.", + "type": "integer", + "format": "int32" + } + }, + "id": "Display" + }, + "SignupUrl": { + "description": "An enterprise signup URL.", + "type": "object", + "properties": { + "url": { + "description": "A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe.", + "type": "string" + }, + "name": { + "description": "The name of the resource. This must be included in the create enterprise request at the end of the signup flow.", + "type": "string" + } + }, + "id": "SignupUrl" + }, + "EnrollmentToken": { + "description": "An enrollment token.", + "type": "object", + "properties": { + "expirationTimestamp": { + "description": "The expiration time of the token. This is a read-only field generated by the server.", + "type": "string", + "format": "google-datetime" + }, + "policyName": { + "description": "The name of the policy that will be initially applied to the enrolled device in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy with id default is applied. It is permissible to only specify the policyId when updating this field as long as the policyId contains no slashes since the rest of the policy name can be inferred from context.", + "type": "string" + }, + "name": { + "description": "The name of the enrollment token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}", + "type": "string" + }, + "duration": { + "description": "The duration of the token. If not specified, the duration will be 1 hour. The allowed range is 1 minute to 30 days.", + "type": "string", + "format": "google-duration" + }, + "value": { + "description": "The token value which is passed to the device and authorizes the device to enroll. This is a read-only field generated by the server.", + "type": "string" + }, + "additionalData": { + "description": "Optional, arbitrary data associated with the enrollment token. This could contain, for example, the id of an org unit to which the device is assigned after enrollment. After a device enrolls with the token, this data will be exposed in the enrollment_token_data field of the Device resource. The data must be 1024 characters or less; otherwise, the creation request will fail.", + "type": "string" + }, + "qrCode": { + "description": "A JSON string whose UTF-8 representation can be used to generate a QR code to enroll a device with this enrollment token. To enroll a device using NFC, the NFC record must contain a serialized java.util.Properties representation of the properties in the JSON.", + "type": "string" + } + }, + "id": "EnrollmentToken" + }, + "SoftwareInfo": { + "description": "Information about device software.", + "type": "object", + "properties": { + "androidVersion": { + "description": "The user visible Android version string, e.g. 6.0.1.", + "type": "string" + }, + "androidBuildNumber": { + "description": "Android build Id string meant for displaying to the user, e.g. shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys.", + "type": "string" + }, + "androidBuildTime": { + "description": "Build time.", + "type": "string", + "format": "google-datetime" + }, + "bootloaderVersion": { + "description": "The system bootloader version number, e.g. 0.6.7.", + "type": "string" + }, + "securityPatchLevel": { + "description": "Security patch level, e.g. 2016-05-01.", + "type": "string" + }, + "deviceKernelVersion": { + "description": "Kernel version, e.g. 2.6.32.9-g103d848.", + "type": "string" + } + }, + "id": "SoftwareInfo" + }, + "ManagedPropertyEntry": { + "description": "An entry of a managed property.", + "type": "object", + "properties": { + "value": { + "description": "The machine-readable value of the entry, which should be used in the configuration. Not localized.", + "type": "string" + }, + "name": { + "description": "The human-readable name of the value. Localized.", + "type": "string" + } + }, + "id": "ManagedPropertyEntry" + }, + "WebToken": { + "description": "A web token used to access an embeddable managed Google Play web UI.", + "type": "object", + "properties": { + "value": { + "description": "The token value which is used in the hosting page to generate the iframe with the embedded UI. This is a read-only field generated by the server.", + "type": "string" + }, + "permissions": { + "description": "Permissions the admin may exercise in the embedded UI. The admin must have all of these permissions in order to view the UI.", + "enumDescriptions": [ + "This value is ignored.", + "The permission to approve apps for the enterprise." + ], + "type": "array", + "items": { + "enum": [ + "WEB_TOKEN_PERMISSION_UNSPECIFIED", + "APPROVE_APPS" + ], + "type": "string" + } + }, + "name": { + "description": "The name of the web token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/webTokens/{webTokenId}.", + "type": "string" + }, + "parentFrameUrl": { + "description": "The URL of the parent frame hosting the iframe with the embedded UI. To prevent XSS, the iframe may not be hosted at other URLs. The URL must use the https scheme.", + "type": "string" + } + }, + "id": "WebToken" + }, + "Enterprise": { + "description": "The configuration applied to an enterprise.", + "type": "object", + "properties": { + "pubsubTopic": { + "description": "When Cloud Pub/Sub notifications are enabled, this field is required to indicate the topic to which the notifications will be published. The format of this field is projects/{project}/topics/{topic}. You must have granted the publish permission on this topic to android-cloud-policy@system.gserviceaccount.com", + "type": "string" + }, + "logo": { + "description": "An image displayed as a logo during device provisioning. Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, image/vnd.wap.wbmp, image/x-adobe-dng.", + "$ref": "ExternalData" + }, + "enabledNotificationTypes": { + "description": "The notification types to enable via Google Cloud Pub/Sub.", + "enumDescriptions": [ + "This value is ignored.", + "A notification sent when a device enrolls.", + "A notification sent when a device issues a policy compliance report.", + "A notification sent when a device issues a status report.", + "A notification sent when a device command has completed." + ], + "type": "array", + "items": { + "enum": [ + "NOTIFICATION_TYPE_UNSPECIFIED", + "ENROLLMENT", + "COMPLIANCE_REPORT", + "STATUS_REPORT", + "COMMAND" + ], + "type": "string" + } + }, + "name": { + "description": "The name of the enterprise which is generated by the server during creation, in the form enterprises/{enterpriseId}", + "type": "string" + }, + "primaryColor": { + "description": "A color in RGB format indicating the predominant color to display in the device management app UI. The color components are stored as follows: (red \u003c\u003c 16) | (green \u003c\u003c 8) | blue, where each component may take a value between 0 and 255 inclusive.", + "type": "integer", + "format": "int32" + }, + "appAutoApprovalEnabled": { + "description": "Whether app auto-approval is enabled. When enabled, apps installed via policy for this enterprise have all permissions automatically approved. When enabled, it is the caller's responsibility to display the permissions required by an app to the enterprise admin before setting the app to be installed in a policy.", + "type": "boolean" + }, + "enterpriseDisplayName": { + "description": "The name of the enterprise as it will appear to users.", + "type": "string" + } + }, + "id": "Enterprise" + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "Operation" + } + } + }, + "id": "ListOperationsResponse" + }, + "MemoryEvent": { + "description": "An event related to memory and storage measurements.", + "type": "object", + "properties": { + "byteCount": { + "description": "The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium.", + "type": "string", + "format": "int64" + }, + "eventType": { + "description": "Event type.", + "enum": [ + "MEMORY_EVENT_TYPE_UNSPECIFIED", + "RAM_MEASURED", + "INTERNAL_STORAGE_MEASURED", + "EXTERNAL_STORAGE_DETECTED", + "EXTERNAL_STORAGE_REMOVED", + "EXTERNAL_STORAGE_MEASURED" + ], + "enumDescriptions": [ + "Unspecified. No events have this type.", + "Free space in RAM was measured.", + "Free space in internal storage was measured.", + "A new external storage medium was detected. The reported byte count is the total capacity of the storage medium.", + "An external storage medium was removed. The reported byte count is zero.", + "Free space in an external storage medium was measured." + ], + "type": "string" + }, + "createTime": { + "description": "The creation time of the event.", + "type": "string", + "format": "google-datetime" + } + }, + "id": "MemoryEvent" + }, + "ExternalData": { + "description": "Data hosted at an external location. The data is to be downloaded by Android Device Policy and verified against the hash.", + "type": "object", + "properties": { + "url": { + "description": "The absolute URL to the data, which must use either the http or https scheme. Android Device Policy does not provide any credentials in the GET request, so the URL must be publicly accessible. Including a long, random component in the URL may be used to prevent attackers from discovering the URL.", + "type": "string" + }, + "sha256Hash": { + "description": "The base-64 encoded SHA-256 hash of the content hosted at url. If the content does not match this hash, Android Device Policy will not use the data.", + "type": "string" + } + }, + "id": "ExternalData" + }, + "UserFacingMessage": { + "description": "Provides user facing message with locale info. The maximum message length is 4096 characters.", + "type": "object", + "properties": { + "localizedMessages": { + "description": "A map which contains \u003clocale, message\u003e pairs. The locale is a BCP 47 language code, e.g. en-US, es-ES, fr.", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "defaultMessage": { + "description": "The default message that gets displayed if no localized message is specified, or the user's locale does not match with any of the localized messages. A default message must be provided if any localized messages are provided.", + "type": "string" + } + }, + "id": "UserFacingMessage" + }, + "PowerManagementEvent": { + "description": "A power management event.", + "type": "object", + "properties": { + "batteryLevel": { + "description": "For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage.", + "type": "number", + "format": "float" + }, + "eventType": { + "description": "Event type.", + "enum": [ + "POWER_MANAGEMENT_EVENT_TYPE_UNSPECIFIED", + "BATTERY_LEVEL_COLLECTED", + "POWER_CONNECTED", + "POWER_DISCONNECTED", + "BATTERY_LOW", + "BATTERY_OKAY", + "BOOT_COMPLETED", + "SHUTDOWN" + ], + "enumDescriptions": [ + "Unspecified. No events have this type.", + "Battery level was measured.", + "The device started charging.", + "The device stopped charging.", + "The device entered low-power mode.", + "The device exited low-power mode.", + "The device booted.", + "The device shut down." + ], + "type": "string" + }, + "createTime": { + "description": "The creation time of the event.", + "type": "string", + "format": "google-datetime" + } + }, + "id": "PowerManagementEvent" + }, + "PasswordRequirements": { + "description": "Requirements for the password used to unlock a device.", + "type": "object", + "properties": { + "passwordMinimumNumeric": { + "description": "Minimum number of numerical digits required in the password. Only enforced when password_quality is COMPLEX.", + "type": "integer", + "format": "int32" + }, + "passwordMinimumNonLetter": { + "description": "Minimum number of non-letter characters (numerical digits or symbols) required in the password. Only enforced when password_quality is COMPLEX.", + "type": "integer", + "format": "int32" + }, + "maximumFailedPasswordsForWipe": { + "description": "A device will be wiped after too many incorrect device-unlock passwords have been entered. A value of 0 means there is no restriction.", + "type": "integer", + "format": "int32" + }, + "passwordMinimumLetters": { + "description": "Minimum number of letters required in the password. Only enforced when password_quality is COMPLEX.", + "type": "integer", + "format": "int32" + }, + "passwordMinimumUpperCase": { + "description": "Minimum number of upper case letters required in the password. Only enforced when password_quality is COMPLEX.", + "type": "integer", + "format": "int32" + }, + "passwordQuality": { + "description": "The required password quality.", + "enum": [ + "PASSWORD_QUALITY_UNSPECIFIED", + "SOMETHING", + "NUMERIC", + "NUMERIC_COMPLEX", + "ALPHABETIC", + "ALPHANUMERIC", + "COMPLEX" + ], + "enumDescriptions": [ + "There are no requirements for the password.", + "There must be a password, but there are no restrictions on its characters.", + "The password must contain numeric characters.", + "The password must contain numeric characters with no repeating (4444) or ordered (1234, 4321, 2468) sequences.", + "The password must contain alphabetic (or symbol) characters.", + "The password must contain at both numeric and alphabetic (or symbol) characters.", + "The password must contain at least a letter, a numerical digit and a special symbol. Other password constraints, for example, password_minimum_letters are enforced." + ], + "type": "string" + }, + "passwordMinimumLength": { + "description": "The minimum allowed password length. A value of 0 means there is no restriction. Only enforced when password_quality is NUMERIC, NUMERIC_COMPLEX, ALPHABETIC, ALPHANUMERIC, or COMPLEX.", + "type": "integer", + "format": "int32" + }, + "passwordExpirationTimeout": { + "description": "Password expiration timeout.", + "type": "string", + "format": "google-duration" + }, + "passwordMinimumSymbols": { + "description": "Minimum number of symbols required in the password. Only enforced when password_quality is COMPLEX.", + "type": "integer", + "format": "int32" + }, + "passwordHistoryLength": { + "description": "The length of the password history. After setting this, the user will not be able to enter a new password that is the same as any password in the history. A value of 0 means there is no restriction.", + "type": "integer", + "format": "int32" + }, + "passwordMinimumLowerCase": { + "description": "Minimum number of lower case letters required in the password. Only enforced when password_quality is COMPLEX.", + "type": "integer", + "format": "int32" + } + }, + "id": "PasswordRequirements" + }, + "HardwareInfo": { + "description": "Information about device hardware. The fields related to temperature thresholds are only available when hardwareStatusEnabled is true in the device's policy.", + "type": "object", + "properties": { + "gpuThrottlingTemperatures": { + "description": "GPU throttling temperature thresholds in Celsius for each GPU on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "cpuShutdownTemperatures": { + "description": "CPU shutdown temperature thresholds in Celsius for each CPU on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "gpuShutdownTemperatures": { + "description": "GPU shutdown temperature thresholds in Celsius for each GPU on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "manufacturer": { + "description": "Manufacturer, e.g. Motorola.", + "type": "string" + }, + "model": { + "description": "The model of the device, e.g. Asus Nexus 7.", + "type": "string" + }, + "serialNumber": { + "description": "The device serial number.", + "type": "string" + }, + "brand": { + "description": "Brand of the device, e.g. Google.", + "type": "string" + }, + "cpuThrottlingTemperatures": { + "description": "CPU throttling temperature thresholds in Celsius for each CPU on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "skinThrottlingTemperatures": { + "description": "Device skin throttling temperature thresholds in Celsius.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "deviceBasebandVersion": { + "description": "Baseband version, e.g. MDM9625_104662.22.05.34p.", + "type": "string" + }, + "hardware": { + "description": "Name of the hardware, e.g. Angler.", + "type": "string" + }, + "skinShutdownTemperatures": { + "description": "Device skin shutdown temperature thresholds in Celsius.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "batteryShutdownTemperatures": { + "description": "Battery shutdown temperature thresholds in Celsius for each battery on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "batteryThrottlingTemperatures": { + "description": "Battery throttling temperature thresholds in Celsius for each battery on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + } + }, + "id": "HardwareInfo" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "NetworkInfo": { + "description": "Device network info.", + "type": "object", + "properties": { + "meid": { + "description": "MEID number of the CDMA device, e.g. A00000292788E1.", + "type": "string" + }, + "wifiMacAddress": { + "description": "WiFi MAC address of the device, e.g. 7c:11:11:11:11:11.", + "type": "string" + }, + "imei": { + "description": "IMEI number of the GSM device, e.g. A1000031212.", + "type": "string" + } + }, + "id": "NetworkInfo" + }, + "MemoryInfo": { + "description": "Information about device memory and storage.", + "type": "object", + "properties": { + "totalRam": { + "description": "Total RAM on device in bytes.", + "type": "string", + "format": "int64" + }, + "totalInternalStorage": { + "description": "Total internal storage on device in bytes.", + "type": "string", + "format": "int64" + } + }, + "id": "MemoryInfo" + }, + "ApiLevelCondition": { + "description": "A compliance rule condition which is satisfied if the Android Framework API level on the device does not meet a minimum requirement. There can only be one rule with this type of condition per policy.", + "type": "object", + "properties": { + "minApiLevel": { + "description": "The minimum desired Android Framework API level. If the device does not meet the minimum requirement, this condition is satisfied. Must be greater than zero.", + "type": "integer", + "format": "int32" + } + }, + "id": "ApiLevelCondition" + }, + "SystemUpdate": { + "description": "Configuration for managing system updates", + "type": "object", + "properties": { + "startMinutes": { + "description": "If the type is WINDOWED, the start of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be between 0 and 1439, inclusive.", + "type": "integer", + "format": "int32" + }, + "type": { + "description": "The type of system update to configure.", + "enum": [ + "SYSTEM_UPDATE_TYPE_UNSPECIFIED", + "AUTOMATIC", + "WINDOWED", + "POSTPONE" + ], + "enumDescriptions": [ + "Follow the default update behavior for the device, which typically requires the user to accept system updates.", + "Install automatically as soon as an update is available.", + "Install automatically within a daily maintenance window. If the device has a device account, this also configures Play apps to be updated within the window. This is strongly recommended for kiosk devices because this is the only way apps persistently pinned to the foreground can be updated by Play.", + "Postpone automatic install up to a maximum of 30 days." + ], + "type": "string" + }, + "endMinutes": { + "description": "If the type is WINDOWED, the end of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be between 0 and 1439, inclusive. If this value is less than start_minutes, then the maintenance window spans midnight. If the maintenance window specified is smaller than 30 minutes, the actual window is extended to 30 minutes beyond the start time.", + "type": "integer", + "format": "int32" + } + }, + "id": "SystemUpdate" + }, + "HardwareStatus": { + "description": "Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health.", + "type": "object", + "properties": { + "fanSpeeds": { + "description": "Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "skinTemperatures": { + "description": "Current device skin temperatures in Celsius.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "createTime": { + "description": "The time the measurements were taken.", + "type": "string", + "format": "google-datetime" + }, + "batteryTemperatures": { + "description": "Current battery temperatures in Celsius for each battery on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "cpuTemperatures": { + "description": "Current CPU temperatures in Celsius for each CPU on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "gpuTemperatures": { + "description": "Current GPU temperatures in Celsius for each GPU on the device.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "cpuUsages": { + "description": "CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported in the system.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + } + }, + "id": "HardwareStatus" + } + }, + "revision": "20170918", + "basePath": "", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "version_module": true, + "canonicalName": "Android Management", + "discoveryVersion": "v1", + "fullyEncodeReservedExpansion": true, + "baseUrl": "https://androidmanagement.googleapis.com/", + "name": "androidmanagement", + "parameters": { + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "alt": { + "description": "Data format for response.", + "location": "query", + "enum": [ + "json", + "media", + "proto" + ], + "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" + ], + "type": "string" + }, + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "type": "string", + "location": "query" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + } + }, + "documentationLink": "https://developers.google.com/android/management", + "ownerDomain": "google.com", + "batchPath": "batch", + "servicePath": "", + "ownerName": "Google", + "version": "v1", + "rootUrl": "https://androidmanagement.googleapis.com/", + "kind": "discovery#restDescription" +} diff --git a/etc/api/androidmanagement/v1/crates/1.0.6-api+20170918 b/etc/api/androidmanagement/v1/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/androidmanagement/v1/crates/1.0.6-cli+20170918 b/etc/api/androidmanagement/v1/crates/1.0.6-cli+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/androidpublisher/v1.1/androidpublisher-api.json b/etc/api/androidpublisher/v1.1/androidpublisher-api.json index 30d5c2a560..a9b442f12b 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/BgmM1OT-KHhvjiDWu7WvxnqRVeE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/EKUDjWuy8xhU5dHne-WullXJgWw\"", "discoveryVersion": "v1", "id": "androidpublisher:v1.1", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v1.1", - "revision": "20170425", + "revision": "20170913", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", @@ -96,6 +96,10 @@ "description": "This kind represents an inappPurchase object in the androidpublisher service.", "default": "androidpublisher#inappPurchase" }, + "orderId": { + "type": "string", + "description": "The order id associated with the purchase of the inapp product." + }, "purchaseState": { "type": "integer", "description": "The purchase state of the order. Possible values are: \n- Purchased \n- Cancelled", diff --git a/etc/api/androidpublisher/v1/androidpublisher-api.json b/etc/api/androidpublisher/v1/androidpublisher-api.json index 3268d20c94..6090f92a60 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/EHPUFMgwVHTdOk4cp40HksrOITo\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Ex2nsAPYjRP0NRWSGg4yyxwNJ18\"", "discoveryVersion": "v1", "id": "androidpublisher:v1", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v1", - "revision": "20170425", + "revision": "20170913", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/androidpublisher/v1/applications/", "rootUrl": "https://www.googleapis.com/", "servicePath": "androidpublisher/v1/applications/", - "batchPath": "batch", + "batchPath": "batch/androidpublisher/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/androidpublisher/v2/androidpublisher-api.json b/etc/api/androidpublisher/v2/androidpublisher-api.json index 9e6fd04684..d537259540 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/dYMiE8hKqa-VooV0hGawF9oUXnw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/QjVvqrUMRW1tTVdJHVqdnKd9gLQ\"", "discoveryVersion": "v1", "id": "androidpublisher:v2", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v2", - "revision": "20170425", + "revision": "20170913", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", @@ -100,6 +100,10 @@ "sha1": { "type": "string", "description": "A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command." + }, + "sha256": { + "type": "string", + "description": "A sha256 hash of the APK payload, encoded as a hex string and matching the output of the sha256sum command." } } }, @@ -830,6 +834,10 @@ "description": "This kind represents an inappPurchase object in the androidpublisher service.", "default": "androidpublisher#productPurchase" }, + "orderId": { + "type": "string", + "description": "The order id associated with the purchase of the inapp product." + }, "purchaseState": { "type": "integer", "description": "The purchase state of the order. Possible values are: \n- Purchased \n- Cancelled", @@ -977,7 +985,7 @@ }, "cancelReason": { "type": "integer", - "description": "The reason why a subscription was cancelled or is not auto-renewing. Possible values are: \n- User cancelled the subscription \n- Subscription was cancelled by the system, for example because of a billing problem", + "description": "The reason why a subscription was cancelled or is not auto-renewing. Possible values are: \n- User cancelled the subscription \n- Subscription was cancelled by the system, for example because of a billing problem \n- Subscription was replaced with a new subscription", "format": "int32" }, "countryCode": { @@ -998,9 +1006,13 @@ "description": "This kind represents a subscriptionPurchase object in the androidpublisher service.", "default": "androidpublisher#subscriptionPurchase" }, + "orderId": { + "type": "string", + "description": "The order id of the latest recurring order associated with the purchase of the subscription." + }, "paymentState": { "type": "integer", - "description": "The payment state of the subscription. Possible values are: \n- Payment pending \n- Payment received", + "description": "The payment state of the subscription. Possible values are: \n- Payment pending \n- Payment received \n- Free trial", "format": "int32" }, "priceAmountMicros": { @@ -3491,7 +3503,7 @@ "parameters": { "endTime": { "type": "string", - "description": "The time, in milliseconds since the Epoch, of the newest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time.", + "description": "The time, in milliseconds since the Epoch, of the newest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.", "format": "int64", "location": "query" }, @@ -3513,7 +3525,7 @@ }, "startTime": { "type": "string", - "description": "The time, in milliseconds since the Epoch, of the oldest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days.", + "description": "The time, in milliseconds since the Epoch, of the oldest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.", "format": "int64", "location": "query" }, diff --git a/etc/api/androidpublisher/v2/crates/1.0.6-api+20170913 b/etc/api/androidpublisher/v2/crates/1.0.6-api+20170913 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/androidpublisher/v2/crates/1.0.6-cli+20170913 b/etc/api/androidpublisher/v2/crates/1.0.6-cli+20170913 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/api-list.yaml b/etc/api/api-list.yaml index 560605c22c..55575441ff 100644 --- a/etc/api/api-list.yaml +++ b/etc/api/api-list.yaml @@ -12,6 +12,8 @@ api: - v2beta1 adexchangeseller: - v2.0 + adexperiencereport: + - v1 admin: - directory_v1 - reports_v1 @@ -23,8 +25,12 @@ api: - v3 analyticsreporting: - v4 + androiddeviceprovisioning: + - v1 androidenterprise: - v1 + androidmanagement: + - v1 androidpublisher: - v2 appengine: @@ -41,6 +47,8 @@ api: - v1beta2 bigquery: - v2 + bigquerydatatransfer: + - v1 blogger: - v3 books: @@ -59,7 +67,10 @@ api: - v2 clouderrorreporting: - v1beta1 + cloudfunctions: + - v1 cloudkms: + - v1 - v1beta1 cloudlatencytest: - v2 @@ -70,8 +81,11 @@ api: - v1beta1 cloudsearch: - v1 + cloudtasks: + - v2beta2 cloudtrace: - v1 + - v2 clouduseraccounts: - vm_beta compute: @@ -93,7 +107,6 @@ api: - v1 datastore: - v1 - - v1beta2 - v1beta3 deploymentmanager: - v2 @@ -106,8 +119,11 @@ api: - v2.5 - v2.6 - v2.7 + - v2.8 discovery: - v1 + dlp: + - v2beta1 dns: - v1 doubleclickbidmanager: @@ -119,12 +135,13 @@ api: - v3 firebasedynamiclinks: - v1 + firebaseremoteconfig: + - v1 firebaserules: - v1 fitness: - v1 freebase: - - v1 - v1sandbox fusiontables: - v2 @@ -167,17 +184,21 @@ api: mirror: - v1 ml: - - v1beta1 + - v1 monitoring: - v3 oauth2: - v2 + oslogin: + - v1beta pagespeedonline: - v2 partners: - v2 people: - v1 + playcustomapp: + - v1 playmoviespartner: - v1 plus: @@ -216,15 +237,22 @@ api: - v1 serviceregistry: - alpha + serviceuser: + - v1 sheets: - v4 siteverification: - v1 slides: - v1 + sourcerepo: + - v1 + spanner: + - v1 spectrum: - v1explorer speech: + - v1 - v1beta1 sqladmin: - v1beta4 @@ -232,20 +260,29 @@ api: - v1 storagetransfer: - v1 + streetviewpublish: + - v1 surveys: - v2 tagmanager: - v1 + - v2 taskqueue: - v1beta2 tasks: - v1 + testing: + - v1 toolresults: - v1beta3 translate: - v2 urlshortener: - v1 + vault: + - v1 + videointelligence: + - v1beta1 vision: - v1 webfonts: diff --git a/etc/api/appengine/v1/appengine-api.json b/etc/api/appengine/v1/appengine-api.json index db7ffedfc6..082c4027a0 100644 --- a/etc/api/appengine/v1/appengine-api.json +++ b/etc/api/appengine/v1/appengine-api.json @@ -1,11 +1,15 @@ { "discoveryVersion": "v1", "ownerName": "Google", - "version_module": "True", + "version_module": true, "resources": { "apps": { "methods": { "repair": { + "request": { + "$ref": "RepairApplicationRequest" + }, + "description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.", "response": { "$ref": "Operation" }, @@ -18,35 +22,64 @@ ], "parameters": { "appsId": { - "location": "path", "description": "Part of `name`. Name of the application to repair. Example: apps/myapp", + "type": "string", "required": true, - "type": "string" + "location": "path" } }, "flatPath": "v1/apps/{appsId}:repair", - "path": "v1/apps/{appsId}:repair", "id": "appengine.apps.repair", - "description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.", + "path": "v1/apps/{appsId}:repair" + }, + "patch": { + "flatPath": "v1/apps/{appsId}", + "id": "appengine.apps.patch", + "path": "v1/apps/{appsId}", + "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain - Google authentication domain for controlling user access to the application.\ndefault_cookie_expiration - Cookie expiration policy for the application.", "request": { - "$ref": "RepairApplicationRequest" - } + "$ref": "Application" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, "get": { "description": "Gets information about an application.", - "response": { - "$ref": "Application" - }, "httpMethod": "GET", "parameterOrder": [ "appsId" ], + "response": { + "$ref": "Application" + }, "parameters": { "appsId": { + "location": "path", "description": "Part of `name`. Name of the Application resource to get. Example: apps/myapp.", - "required": true, "type": "string", - "location": "path" + "required": true } }, "scopes": [ @@ -58,93 +91,1004 @@ "path": "v1/apps/{appsId}", "id": "appengine.apps.get" }, - "patch": { - "httpMethod": "PATCH", - "parameterOrder": [ - "appsId" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", - "required": true, - "type": "string", - "location": "path" - }, - "updateMask": { - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1/apps/{appsId}", - "id": "appengine.apps.patch", - "path": "v1/apps/{appsId}", - "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain - Google authentication domain for controlling user access to the application.\ndefault_cookie_expiration - Cookie expiration policy for the application.", - "request": { - "$ref": "Application" - } - }, "create": { - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "flatPath": "v1/apps", "path": "v1/apps", "id": "appengine.apps.create", + "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).", "request": { "$ref": "Application" }, - "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).", + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "Operation" }, - "parameterOrder": [], - "httpMethod": "POST" + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } }, "resources": { - "services": { + "domainMappings": { "methods": { "delete": { - "description": "Deletes the specified service and all enclosed versions.", + "flatPath": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "path": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.delete", + "description": "Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource.", + "httpMethod": "DELETE", "response": { "$ref": "Operation" }, - "httpMethod": "DELETE", "parameterOrder": [ "appsId", - "servicesId" + "domainMappingsId" ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", - "required": true, + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com.", "type": "string", + "required": true, + "location": "path" + }, + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + } + }, + "patch": { + "flatPath": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.patch", + "path": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "description": "Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource.", + "request": { + "$ref": "DomainMapping" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "PATCH", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true, + "location": "path" + }, + "domainMappingsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the specified domain mapping.", + "response": { + "$ref": "DomainMapping" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true, + "location": "path" + }, + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.get", + "path": "v1/apps/{appsId}/domainMappings/{domainMappingsId}" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListDomainMappingsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + }, + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/apps/{appsId}/domainMappings", + "path": "v1/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.list", + "description": "Lists the domain mappings on an application." + }, + "create": { + "description": "Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains.", + "request": { + "$ref": "DomainMapping" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.create", + "path": "v1/apps/{appsId}/domainMappings" + } + } + }, + "locations": { + "methods": { + "get": { + "description": "Get information about a location.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "locationsId" + ], + "response": { + "$ref": "Location" + }, + "parameters": { + "locationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Resource name for the location.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/apps/{appsId}/locations/{locationsId}", + "path": "v1/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.get" + }, + "list": { + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + }, + "flatPath": "v1/apps/{appsId}/locations", + "id": "appengine.apps.locations.list", + "path": "v1/apps/{appsId}/locations" + } + } + }, + "authorizedCertificates": { + "methods": { + "patch": { + "description": "Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated.", + "request": { + "$ref": "AuthorizedCertificate" + }, + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "PATCH", + "parameters": { + "authorizedCertificatesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.patch", + "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "get": { + "description": "Gets the specified SSL certificate.", + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true, + "location": "path" + }, + "view": { + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the GET response.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.get", + "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "list": { + "response": { + "$ref": "ListAuthorizedCertificatesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "view": { + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the LIST response.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.list", + "path": "v1/apps/{appsId}/authorizedCertificates", + "description": "Lists all SSL certificates the user is authorized to administer." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "AuthorizedCertificate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/apps/{appsId}/authorizedCertificates", + "path": "v1/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.create", + "request": { + "$ref": "AuthorizedCertificate" + }, + "description": "Uploads the specified SSL certificate." + }, + "delete": { + "description": "Deletes the specified SSL certificate.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true, + "location": "path" + }, + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.delete", + "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + } + } + }, + "services": { + "resources": { + "versions": { + "resources": { + "instances": { + "methods": { + "debug": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "POST", + "parameters": { + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "id": "appengine.apps.services.versions.instances.debug", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment.", + "request": { + "$ref": "DebugInstanceRequest" + } + }, + "delete": { + "description": "Stops a running instance.", + "httpMethod": "DELETE", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.delete" + }, + "get": { + "description": "Gets instance information.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Instance" + }, + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.get" + }, + "list": { + "response": { + "$ref": "ListInstancesResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "versionsId": { + "location": "path", + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "location": "path", + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "id": "appengine.apps.services.versions.instances.list", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)." + } + } + } + }, + "methods": { + "delete": { + "description": "Deletes an existing Version resource.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.delete", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}" + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.patch", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.\nautomatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.\nautomatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.\nautomatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.", + "request": { + "$ref": "Version" + } + }, + "get": { + "id": "appengine.apps.services.versions.get", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource.", + "response": { + "$ref": "Version" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "view": { + "description": "Controls the set of fields returned in the Get response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "FULL" + ] + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}" + }, + "list": { + "response": { + "$ref": "ListVersionsResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the List response.", + "type": "string", + "location": "query" + }, + "servicesId": { + "location": "path", + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.list", + "path": "v1/apps/{appsId}/services/{servicesId}/versions", + "description": "Lists the versions of a service." + }, + "create": { + "id": "appengine.apps.services.versions.create", + "path": "v1/apps/{appsId}/services/{servicesId}/versions", + "description": "Deploys code and resource files to a new version.", + "request": { + "$ref": "Version" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "POST", + "parameters": { + "servicesId": { + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions" + } + } + } + }, + "methods": { + "delete": { + "flatPath": "v1/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.delete", + "path": "v1/apps/{appsId}/services/{servicesId}", + "description": "Deletes the specified service and all enclosed versions.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "DELETE", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true, "location": "path" }, "servicesId": { + "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "required": true, "type": "string", - "location": "path" + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "id": "appengine.apps.services.patch", + "path": "v1/apps/{appsId}/services/{servicesId}", + "description": "Updates the configuration of the specified service.", + "request": { + "$ref": "Service" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "PATCH", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", + "type": "string", + "required": true + }, + "migrateTraffic": { + "location": "query", + "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", + "type": "boolean" + }, + "updateMask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true } }, "flatPath": "v1/apps/{appsId}/services/{servicesId}", "path": "v1/apps/{appsId}/services/{servicesId}", - "id": "appengine.apps.services.delete" + "id": "appengine.apps.services.get", + "description": "Gets the current configuration of the specified service." }, "list": { + "description": "Lists all the services in the application.", "httpMethod": "GET", "parameterOrder": [ "appsId" @@ -158,665 +1102,83 @@ "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" + }, "appsId": { "location": "path", "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Continuation token for fetching the next page of results.", - "type": "string" + "type": "string", + "required": true }, "pageSize": { - "description": "Maximum results to return per page.", "format": "int32", + "description": "Maximum results to return per page.", "type": "integer", "location": "query" } }, "flatPath": "v1/apps/{appsId}/services", - "id": "appengine.apps.services.list", "path": "v1/apps/{appsId}/services", - "description": "Lists all the services in the application." - }, - "get": { - "description": "Gets the current configuration of the specified service.", - "httpMethod": "GET", - "parameterOrder": [ - "appsId", - "servicesId" - ], + "id": "appengine.apps.services.list" + } + } + }, + "authorizedDomains": { + "methods": { + "list": { + "id": "appengine.apps.authorizedDomains.list", + "path": "v1/apps/{appsId}/authorizedDomains", + "description": "Lists all domains the user is authorized to administer.", "response": { - "$ref": "Service" - }, - "parameters": { - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", - "required": true, - "type": "string", - "location": "path" - } + "$ref": "ListAuthorizedDomainsResponse" }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/appengine.admin", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], - "flatPath": "v1/apps/{appsId}/services/{servicesId}", - "id": "appengine.apps.services.get", - "path": "v1/apps/{appsId}/services/{servicesId}" - }, - "patch": { - "request": { - "$ref": "Service" - }, - "description": "Updates the configuration of the specified service.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId" - ], - "httpMethod": "PATCH", "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", - "required": true, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", "type": "string" }, - "migrateTraffic": { - "location": "query", - "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", - "type": "boolean" - }, - "updateMask": { - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", "type": "string", + "required": true + }, + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", "location": "query" - }, - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/apps/{appsId}/services/{servicesId}", - "path": "v1/apps/{appsId}/services/{servicesId}", - "id": "appengine.apps.services.patch" - } - }, - "resources": { - "versions": { - "methods": { - "delete": { - "description": "Deletes an existing Version resource.", - "httpMethod": "DELETE", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "id": "appengine.apps.services.versions.delete", - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}" - }, - "list": { - "id": "appengine.apps.services.versions.list", - "path": "v1/apps/{appsId}/services/{servicesId}/versions", - "description": "Lists the versions of a service.", - "httpMethod": "GET", - "response": { - "$ref": "ListVersionsResponse" - }, - "parameterOrder": [ - "appsId", - "servicesId" - ], - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "servicesId": { - "description": "Part of `parent`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "appsId": { - "location": "path", - "description": "Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Continuation token for fetching the next page of results.", - "type": "string" - }, - "pageSize": { - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "view": { - "description": "Controls the set of fields returned in the List response.", - "type": "string", - "location": "query", - "enum": [ - "BASIC", - "FULL" - ] - } - }, - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions" - }, - "get": { - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "id": "appengine.apps.services.versions.get", - "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource.", - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ], - "httpMethod": "GET", - "response": { - "$ref": "Version" - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "view": { - "location": "query", - "enum": [ - "BASIC", - "FULL" - ], - "description": "Controls the set of fields returned in the Get response.", - "type": "string" - } - }, - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}" - }, - "patch": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "updateMask": { - "location": "query", - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "id": "appengine.apps.services.versions.patch", - "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.", - "request": { - "$ref": "Version" - } - }, - "create": { - "path": "v1/apps/{appsId}/services/{servicesId}/versions", - "id": "appengine.apps.services.versions.create", - "request": { - "$ref": "Version" - }, - "description": "Deploys code and resource files to a new version.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId" - ], - "httpMethod": "POST", - "parameters": { - "servicesId": { - "location": "path", - "description": "Part of `parent`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "appsId": { - "description": "Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions" - } - }, - "resources": { - "instances": { - "methods": { - "delete": { - "parameters": { - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string", - "location": "path" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "id": "appengine.apps.services.versions.instances.delete", - "description": "Stops a running instance.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId", - "instancesId" - ], - "httpMethod": "DELETE" - }, - "list": { - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "servicesId": { - "location": "path", - "description": "Part of `parent`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "appsId": { - "description": "Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "description": "Continuation token for fetching the next page of results.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer" - }, - "versionsId": { - "description": "Part of `parent`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", - "id": "appengine.apps.services.versions.instances.list", - "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ], - "httpMethod": "GET", - "response": { - "$ref": "ListInstancesResponse" - } - }, - "get": { - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId", - "instancesId" - ], - "response": { - "$ref": "Instance" - }, - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string", - "location": "path" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "id": "appengine.apps.services.versions.instances.get", - "description": "Gets instance information." - }, - "debug": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId", - "instancesId" - ], - "httpMethod": "POST", - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", - "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", - "id": "appengine.apps.services.versions.instances.debug", - "request": { - "$ref": "DebugInstanceRequest" - }, - "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment." - } - } - } - } + "flatPath": "v1/apps/{appsId}/authorizedDomains" } } }, "operations": { "methods": { - "list": { - "parameters": { - "filter": { - "description": "The standard list filter.", - "type": "string", - "location": "query" - }, - "appsId": { - "description": "Part of `name`. The name of the operation collection.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "description": "The standard list page size.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/apps/{appsId}/operations", - "path": "v1/apps/{appsId}/operations", - "id": "appengine.apps.operations.list", - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations.", - "response": { - "$ref": "ListOperationsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [ - "appsId" - ] - }, "get": { - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. The name of the operation resource.", - "required": true, - "type": "string" - }, - "operationsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/apps/{appsId}/operations/{operationsId}", - "id": "appengine.apps.operations.get", - "path": "v1/apps/{appsId}/operations/{operationsId}", "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "httpMethod": "GET", + "response": { + "$ref": "Operation" + }, "parameterOrder": [ "appsId", "operationsId" ], - "response": { - "$ref": "Operation" - } - } - } - }, - "locations": { - "methods": { - "list": { - "id": "appengine.apps.locations.list", - "path": "v1/apps/{appsId}/locations", - "description": "Lists information about the supported locations for this service.", "httpMethod": "GET", - "parameterOrder": [ - "appsId" - ], - "response": { - "$ref": "ListLocationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "filter": { - "location": "query", - "description": "The standard list filter.", - "type": "string" - }, - "appsId": { - "description": "Part of `name`. The resource that owns the locations collection, if applicable.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "The standard list page token.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "The standard list page size.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v1/apps/{appsId}/locations" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "appsId", - "locationsId" - ], - "response": { - "$ref": "Location" - }, "scopes": [ "https://www.googleapis.com/auth/appengine.admin", "https://www.googleapis.com/auth/cloud-platform", @@ -825,21 +1187,62 @@ "parameters": { "appsId": { "location": "path", - "description": "Part of `name`. Resource name for the location.", - "required": true, - "type": "string" - }, - "locationsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, + "description": "Part of `name`. The name of the operation resource.", "type": "string", - "location": "path" + "required": true + }, + "operationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true } }, - "flatPath": "v1/apps/{appsId}/locations/{locationsId}", - "id": "appengine.apps.locations.get", - "path": "v1/apps/{appsId}/locations/{locationsId}", - "description": "Get information about a location." + "flatPath": "v1/apps/{appsId}/operations/{operationsId}", + "id": "appengine.apps.operations.get", + "path": "v1/apps/{appsId}/operations/{operationsId}" + }, + "list": { + "id": "appengine.apps.operations.list", + "path": "v1/apps/{appsId}/operations", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/apps/{appsId}/operations" } } } @@ -853,24 +1256,27 @@ "location": "query" }, "prettyPrint": { + "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", "location": "query" }, "uploadType": { + "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "description": "JSONP", "type": "string", "location": "query" }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, "$.xgafv": { - "description": "V1 error format.", - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -879,15 +1285,11 @@ "enum": [ "1", "2" - ] - }, - "callback": { - "location": "query", - "description": "JSONP", + ], + "description": "V1 error format.", "type": "string" }, "alt": { - "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -900,18 +1302,19 @@ "json", "media", "proto" - ] + ], + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" }, "key": { "location": "query", "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.", "type": "string" }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, "quotaUser": { "location": "query", "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.", @@ -919,22 +1322,448 @@ }, "pp": { "description": "Pretty-print response.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "oauth_token": { - "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string" + "type": "string", + "location": "query" }, "bearer_token": { - "location": "query", "description": "OAuth bearer token.", - "type": "string" + "type": "string", + "location": "query" } }, "schemas": { + "LivenessCheck": { + "properties": { + "timeout": { + "format": "google-duration", + "description": "Time before the check is considered failed.", + "type": "string" + }, + "failureThreshold": { + "format": "uint32", + "description": "Number of consecutive failed checks required before considering the VM unhealthy.", + "type": "integer" + }, + "initialDelay": { + "format": "google-duration", + "description": "The initial delay before starting to execute the checks.", + "type": "string" + }, + "path": { + "description": "The request path.", + "type": "string" + }, + "host": { + "description": "Host header to send when performing a HTTP Liveness check. Example: \"myapp.appspot.com\"", + "type": "string" + }, + "successThreshold": { + "format": "uint32", + "description": "Number of consecutive successful checks required before considering the VM healthy.", + "type": "integer" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", + "type": "string" + } + }, + "id": "LivenessCheck", + "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances.", + "type": "object" + }, + "Location": { + "description": "A resource that represents Google Cloud Platform location.", + "type": "object", + "properties": { + "locationId": { + "description": "The canonical id for this location. For example: \"us-east1\".", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata. For example the available capacity at the given location.", + "type": "object" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", + "type": "object" + }, + "name": { + "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"", + "type": "string" + } + }, + "id": "Location" + }, + "NetworkUtilization": { + "description": "Target scaling by network usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetSentBytesPerSecond": { + "format": "int32", + "description": "Target bytes sent per second.", + "type": "integer" + }, + "targetReceivedBytesPerSecond": { + "format": "int32", + "description": "Target bytes received per second.", + "type": "integer" + }, + "targetSentPacketsPerSecond": { + "format": "int32", + "description": "Target packets sent per second.", + "type": "integer" + }, + "targetReceivedPacketsPerSecond": { + "format": "int32", + "description": "Target packets received per second.", + "type": "integer" + } + }, + "id": "NetworkUtilization" + }, + "HealthCheck": { + "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.", + "type": "object", + "properties": { + "healthyThreshold": { + "format": "uint32", + "description": "Number of consecutive successful health checks required before receiving traffic.", + "type": "integer" + }, + "restartThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before an instance is restarted.", + "type": "integer" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", + "type": "string" + }, + "timeout": { + "format": "google-duration", + "description": "Time before the health check is considered failed.", + "type": "string" + }, + "unhealthyThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before removing traffic.", + "type": "integer" + }, + "disableHealthCheck": { + "description": "Whether to explicitly disable health checks for this instance.", + "type": "boolean" + }, + "host": { + "description": "Host header to send when performing an HTTP health check. Example: \"myapp.appspot.com\"", + "type": "string" + } + }, + "id": "HealthCheck" + }, + "ReadinessCheck": { + "properties": { + "appStartTimeout": { + "format": "google-duration", + "description": "A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to serve traffic.", + "type": "string" + }, + "path": { + "description": "The request path.", + "type": "string" + }, + "successThreshold": { + "format": "uint32", + "description": "Number of consecutive successful checks required before receiving traffic.", + "type": "integer" + }, + "host": { + "description": "Host header to send when performing a HTTP Readiness check. Example: \"myapp.appspot.com\"", + "type": "string" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", + "type": "string" + }, + "failureThreshold": { + "format": "uint32", + "description": "Number of consecutive failed checks required before removing traffic.", + "type": "integer" + }, + "timeout": { + "format": "google-duration", + "description": "Time before the check is considered failed.", + "type": "string" + } + }, + "id": "ReadinessCheck", + "description": "Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation.", + "type": "object" + }, + "DebugInstanceRequest": { + "description": "Request message for Instances.DebugInstance.", + "type": "object", + "properties": { + "sshKey": { + "description": "Public SSH key to add to the instance. Examples:\n[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]\n[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {\"userName\":\"[USERNAME]\",\"expireOn\":\"[EXPIRE_TIME]\"}For more information, see Adding and Removing SSH Keys (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).", + "type": "string" + } + }, + "id": "DebugInstanceRequest" + }, + "OperationMetadataV1Beta5": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "method": { + "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Beta5" + }, + "Version": { + "properties": { + "env": { + "description": "App Engine execution environment for this version.Defaults to standard.", + "type": "string" + }, + "handlers": { + "description": "An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set.", + "items": { + "$ref": "UrlMap" + }, + "type": "array" + }, + "automaticScaling": { + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", + "$ref": "AutomaticScaling" + }, + "diskUsageBytes": { + "format": "int64", + "description": "Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly", + "type": "string" + }, + "healthCheck": { + "$ref": "HealthCheck", + "description": "Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set." + }, + "threadsafe": { + "description": "Whether multiple requests can be dispatched to this version at once.", + "type": "boolean" + }, + "readinessCheck": { + "description": "Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests if view=FULL is set.", + "$ref": "ReadinessCheck" + }, + "manualScaling": { + "$ref": "ManualScaling", + "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time." + }, + "name": { + "description": "Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly", + "type": "string" + }, + "apiConfig": { + "description": "Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set.", + "$ref": "ApiConfigHandler" + }, + "endpointsApiService": { + "$ref": "EndpointsApiService", + "description": "Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app." + }, + "vm": { + "description": "Whether to deploy this version in a container on a virtual machine.", + "type": "boolean" + }, + "versionUrl": { + "description": "Serving URL for this version. Example: \"https://myversion-dot-myservice-dot-myapp.appspot.com\"@OutputOnly", + "type": "string" + }, + "instanceClass": { + "description": "Instance class that is used to run this version. Valid values are:\nAutomaticScaling: F1, F2, F4, F4_1G\nManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling.", + "type": "string" + }, + "servingStatus": { + "description": "Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Currently serving. Instances are created according to the scaling settings of the version.", + "Disabled. No instances will be created and the scaling settings are ignored until the state of the version changes to SERVING." + ], + "enum": [ + "SERVING_STATUS_UNSPECIFIED", + "SERVING", + "STOPPED" + ] + }, + "runtimeApiVersion": { + "description": "The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard/\u003clanguage\u003e/config/appref", + "type": "string" + }, + "deployment": { + "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set.", + "$ref": "Deployment" + }, + "createTime": { + "format": "google-datetime", + "description": "Time that this version was created.@OutputOnly", + "type": "string" + }, + "inboundServices": { + "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", + "items": { + "enum": [ + "INBOUND_SERVICE_UNSPECIFIED", + "INBOUND_SERVICE_MAIL", + "INBOUND_SERVICE_MAIL_BOUNCE", + "INBOUND_SERVICE_XMPP_ERROR", + "INBOUND_SERVICE_XMPP_MESSAGE", + "INBOUND_SERVICE_XMPP_SUBSCRIBE", + "INBOUND_SERVICE_XMPP_PRESENCE", + "INBOUND_SERVICE_CHANNEL_PRESENCE", + "INBOUND_SERVICE_WARMUP" + ], + "type": "string" + }, + "type": "array", + "enumDescriptions": [ + "Not specified.", + "Allows an application to receive mail.", + "Allows an application to receive email-bound notifications.", + "Allows an application to receive error stanzas.", + "Allows an application to receive instant messages.", + "Allows an application to receive user subscription POSTs.", + "Allows an application to receive a user's chat presence.", + "Registers an application for notifications when a client connects or disconnects from a channel.", + "Enables warmup requests." + ] + }, + "resources": { + "$ref": "Resources", + "description": "Machine resources for this version. Only applicable for VM runtimes." + }, + "errorHandlers": { + "description": "Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set.", + "items": { + "$ref": "ErrorHandler" + }, + "type": "array" + }, + "defaultExpiration": { + "format": "google-duration", + "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", + "type": "string" + }, + "libraries": { + "description": "Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set.", + "items": { + "$ref": "Library" + }, + "type": "array" + }, + "nobuildFilesRegex": { + "description": "Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set.", + "type": "string" + }, + "basicScaling": { + "description": "A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", + "$ref": "BasicScaling" + }, + "runtime": { + "description": "Desired runtime. Example: python27.", + "type": "string" + }, + "createdBy": { + "description": "Email address of the user who created this version.@OutputOnly", + "type": "string" + }, + "id": { + "description": "Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: \"default\", \"latest\", and any name with the prefix \"ah-\".", + "type": "string" + }, + "envVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Environment variables available to the application.Only returned in GET requests if view=FULL is set.", + "type": "object" + }, + "livenessCheck": { + "description": "Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if view=FULL is set.", + "$ref": "LivenessCheck" + }, + "network": { + "description": "Extra network settings. Only applicable for App Engine flexible environment versions.", + "$ref": "Network" + }, + "betaSettings": { + "additionalProperties": { + "type": "string" + }, + "description": "Metadata settings that are supplied to this version to enable beta runtime features.", + "type": "object" + } + }, + "id": "Version", + "description": "A Version resource is a specific set of source code and configuration files that are deployed into a service.", + "type": "object" + }, + "RepairApplicationRequest": { + "description": "Request message for 'Applications.RepairApplication'.", + "type": "object", + "properties": {}, + "id": "RepairApplicationRequest" + }, + "CertificateRawData": { + "description": "An SSL certificate obtained from a certificate authority.", + "type": "object", + "properties": { + "privateKey": { + "description": "Unencrypted PEM encoded RSA private key. This field is set once on certificate creation and then encrypted. The key size must be 2048 bits or fewer. Must include the header and footer. Example: \u003cpre\u003e -----BEGIN RSA PRIVATE KEY----- \u003cunencrypted_key_value\u003e -----END RSA PRIVATE KEY----- \u003c/pre\u003e @InputOnly", + "type": "string" + }, + "publicCertificate": { + "description": "PEM encoded x.509 public key certificate. This field is set once on certificate creation. Must include the header and footer. Example: \u003cpre\u003e -----BEGIN CERTIFICATE----- \u003ccertificate_value\u003e -----END CERTIFICATE----- \u003c/pre\u003e", + "type": "string" + } + }, + "id": "CertificateRawData" + }, "ScriptHandler": { "description": "Executes a script to handle the request that matches the URL pattern.", "type": "object", @@ -950,6 +1779,10 @@ "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", "type": "object", "properties": { + "sourceUrl": { + "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "type": "string" + }, "sha1Sum": { "description": "The SHA1 hash of the file, in hex.", "type": "string" @@ -957,16 +1790,11 @@ "mimeType": { "description": "The MIME type of the file.Defaults to the value from Google Cloud Storage.", "type": "string" - }, - "sourceUrl": { - "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", - "type": "string" } }, "id": "FileInfo" }, "OperationMetadataExperimental": { - "id": "OperationMetadataExperimental", "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { @@ -975,32 +1803,52 @@ "type": "string" }, "insertTime": { - "description": "Time that this operation was created.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", - "type": "string" - }, - "user": { - "description": "User who requested this operation.@OutputOnly", + "description": "Time that this operation completed.@OutputOnly", "type": "string" }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly", "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" } - } + }, + "id": "OperationMetadataExperimental" }, - "TrafficSplit": { - "description": "Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions.", + "AuthorizedDomain": { + "description": "A domain that a user has been authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (https://www.google.com/webmasters/verification/home).", "type": "object", "properties": { + "name": { + "description": "Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly", + "type": "string" + }, + "id": { + "description": "Fully qualified domain name of the domain authorized for use. Example: example.com.", + "type": "string" + } + }, + "id": "AuthorizedDomain" + }, + "TrafficSplit": { + "properties": { + "allocations": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "description": "Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", + "type": "object" + }, "shardBy": { - "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", - "type": "string", "enumDescriptions": [ "Diversion method unspecified.", "Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or no diversion will occur.", @@ -1012,43 +1860,39 @@ "COOKIE", "IP", "RANDOM" - ] - }, - "allocations": { - "additionalProperties": { - "format": "double", - "type": "number" - }, - "description": "Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", - "type": "object" + ], + "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", + "type": "string" } }, - "id": "TrafficSplit" + "id": "TrafficSplit", + "description": "Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions.", + "type": "object" }, "OperationMetadataV1Beta": { "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, "warning": { "description": "Durable messages that persist on every operation poll. @OutputOnly", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", + "user": { + "description": "User who requested this operation.@OutputOnly", "type": "string" }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", "type": "string" }, - "user": { - "description": "User who requested this operation.@OutputOnly", - "type": "string" - }, "ephemeralMessage": { "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", "type": "string" @@ -1058,191 +1902,283 @@ "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", "type": "string" } }, "id": "OperationMetadataV1Beta" }, "ListServicesResponse": { - "id": "ListServicesResponse", "description": "Response message for Services.ListServices.", "type": "object", "properties": { - "services": { - "description": "The services belonging to the requested application.", - "type": "array", - "items": { - "$ref": "Service" - } - }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", "type": "string" + }, + "services": { + "description": "The services belonging to the requested application.", + "items": { + "$ref": "Service" + }, + "type": "array" } - } + }, + "id": "ListServicesResponse" }, "Resources": { - "id": "Resources", "description": "Machine resources for a version.", "type": "object", "properties": { - "diskGb": { - "description": "Disk size (GB) needed.", + "memoryGb": { "format": "double", + "description": "Memory (GB) needed.", "type": "number" }, "cpu": { + "format": "double", "description": "Number of CPU cores needed.", - "format": "double", - "type": "number" - }, - "memoryGb": { - "description": "Memory (GB) needed.", - "format": "double", "type": "number" }, "volumes": { "description": "User specified volumes.", - "type": "array", "items": { "$ref": "Volume" - } + }, + "type": "array" + }, + "diskGb": { + "format": "double", + "description": "Disk size (GB) needed.", + "type": "number" } - } + }, + "id": "Resources" }, "Deployment": { - "id": "Deployment", "description": "Code and application artifacts used to deploy a version to App Engine.", "type": "object", "properties": { - "zip": { - "description": "The zip file for this deployment, if this is a zip deployment.", - "$ref": "ZipInfo" - }, - "container": { - "$ref": "ContainerInfo", - "description": "The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment." - }, "files": { "additionalProperties": { "$ref": "FileInfo" }, "description": "Manifest of the files stored in Google Cloud Storage that are included as part of this version. All files must be readable using the credentials supplied with this call.", "type": "object" + }, + "zip": { + "$ref": "ZipInfo", + "description": "The zip file for this deployment, if this is a zip deployment." + }, + "container": { + "description": "The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment.", + "$ref": "ContainerInfo" } - } + }, + "id": "Deployment" }, "Volume": { - "id": "Volume", - "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", - "type": "object", "properties": { "volumeType": { "description": "Underlying volume type, e.g. 'tmpfs'.", "type": "string" }, "sizeGb": { - "description": "Volume size in gigabytes.", "format": "double", + "description": "Volume size in gigabytes.", "type": "number" }, "name": { "description": "Unique name for the volume.", "type": "string" } - } + }, + "id": "Volume", + "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", + "type": "object" }, "ListInstancesResponse": { "description": "Response message for Instances.ListInstances.", "type": "object", "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, "instances": { "description": "The instances belonging to the requested version.", - "type": "array", "items": { "$ref": "Instance" - } + }, + "type": "array" + } + }, + "id": "ListInstancesResponse" + }, + "ListDomainMappingsResponse": { + "description": "Response message for DomainMappings.ListDomainMappings.", + "type": "object", + "properties": { + "domainMappings": { + "description": "The domain mappings for the application.", + "items": { + "$ref": "DomainMapping" + }, + "type": "array" }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", "type": "string" } }, - "id": "ListInstancesResponse" + "id": "ListDomainMappingsResponse" + }, + "OperationMetadataV1Alpha": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Alpha" }, "UrlDispatchRule": { - "id": "UrlDispatchRule", "description": "Rules to match an HTTP request and dispatch that request to a service.", "type": "object", "properties": { - "path": { - "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path.The sum of the lengths of the domain and path may not exceed 100 characters.", + "service": { + "description": "Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default.", "type": "string" }, "domain": { "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", "type": "string" }, - "service": { - "description": "Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default.", + "path": { + "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path.The sum of the lengths of the domain and path may not exceed 100 characters.", "type": "string" } - } + }, + "id": "UrlDispatchRule" }, "ListVersionsResponse": { - "id": "ListVersionsResponse", "description": "Response message for Versions.ListVersions.", "type": "object", "properties": { "versions": { "description": "The versions belonging to the requested service.", - "type": "array", "items": { "$ref": "Version" - } + }, + "type": "array" }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", "type": "string" } - } + }, + "id": "ListVersionsResponse" + }, + "ListAuthorizedDomainsResponse": { + "description": "Response message for AuthorizedDomains.ListAuthorizedDomains.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "domains": { + "description": "The authorized domains belonging to the user.", + "items": { + "$ref": "AuthorizedDomain" + }, + "type": "array" + } + }, + "id": "ListAuthorizedDomainsResponse" }, "ApiEndpointHandler": { - "description": "Uses Google Cloud Endpoints to handle requests.", - "type": "object", "properties": { "scriptPath": { "description": "Path to the script from the application root directory.", "type": "string" } }, - "id": "ApiEndpointHandler" + "id": "ApiEndpointHandler", + "description": "Uses Google Cloud Endpoints to handle requests.", + "type": "object" }, - "ZipInfo": { - "id": "ZipInfo", - "description": "The zip file information for a zip deployment.", + "DomainMapping": { + "description": "A domain serving an App Engine application.", "type": "object", "properties": { - "sourceUrl": { - "description": "URL of the zip file to deploy from. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "sslSettings": { + "$ref": "SslSettings", + "description": "SSL configuration for this domain. If unconfigured, this domain will not serve with SSL." + }, + "name": { + "description": "Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly", "type": "string" }, - "filesCount": { - "description": "An estimate of the number of files in a zip for a zip deployment. If set, must be greater than or equal to the actual number of files. Used for optimizing performance; if not provided, deployment may be slow.", - "format": "int32", - "type": "integer" + "resourceRecords": { + "description": "The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the application via this domain mapping.@OutputOnly", + "items": { + "$ref": "ResourceRecord" + }, + "type": "array" + }, + "id": { + "description": "Relative name of the domain serving the application. Example: example.com.", + "type": "string" } - } + }, + "id": "DomainMapping" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object", + "properties": {}, + "id": "Empty" }, "AutomaticScaling": { "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", "type": "object", "properties": { "minTotalInstances": { - "description": "Minimum number of instances that should be maintained for this version.", "format": "int32", + "description": "Minimum number of instances that should be maintained for this version.", "type": "integer" }, "networkUtilization": { @@ -1250,66 +2186,160 @@ "$ref": "NetworkUtilization" }, "maxConcurrentRequests": { - "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", "format": "int32", + "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", "type": "integer" }, "coolDownPeriod": { - "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", "format": "google-duration", + "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", "type": "string" }, "maxPendingLatency": { - "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", "format": "google-duration", + "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", "type": "string" }, "cpuUtilization": { - "description": "Target scaling by CPU usage.", - "$ref": "CpuUtilization" + "$ref": "CpuUtilization", + "description": "Target scaling by CPU usage." }, "diskUtilization": { - "$ref": "DiskUtilization", - "description": "Target scaling by disk usage." + "description": "Target scaling by disk usage.", + "$ref": "DiskUtilization" }, "minPendingLatency": { - "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", "format": "google-duration", + "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", "type": "string" }, + "maxIdleInstances": { + "format": "int32", + "description": "Maximum number of idle instances that should be maintained for this version.", + "type": "integer" + }, "requestUtilization": { "$ref": "RequestUtilization", "description": "Target scaling by request utilization." }, - "maxIdleInstances": { - "description": "Maximum number of idle instances that should be maintained for this version.", - "format": "int32", - "type": "integer" - }, "minIdleInstances": { - "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a service.", "format": "int32", + "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a service.", "type": "integer" }, "maxTotalInstances": { - "description": "Maximum number of instances that should be started to handle requests.", "format": "int32", + "description": "Maximum number of instances that should be started to handle requests.", "type": "integer" } }, "id": "AutomaticScaling" }, + "ZipInfo": { + "description": "The zip file information for a zip deployment.", + "type": "object", + "properties": { + "filesCount": { + "format": "int32", + "description": "An estimate of the number of files in a zip for a zip deployment. If set, must be greater than or equal to the actual number of files. Used for optimizing performance; if not provided, deployment may be slow.", + "type": "integer" + }, + "sourceUrl": { + "description": "URL of the zip file to deploy from. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "type": "string" + } + }, + "id": "ZipInfo" + }, + "AuthorizedCertificate": { + "properties": { + "domainMappingsCount": { + "format": "int32", + "description": "Aggregate count of the domain mappings with this certificate mapped. This count includes domain mappings on applications for which the user does not have VIEWER permissions.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly", + "type": "integer" + }, + "domainNames": { + "description": "Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 12345.@OutputOnly", + "type": "string" + }, + "displayName": { + "description": "The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate.", + "type": "string" + }, + "certificateRawData": { + "description": "The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority.", + "$ref": "CertificateRawData" + }, + "visibleDomainMappings": { + "description": "The full paths to user visible Domain Mapping resources that have this certificate mapped. Example: apps/myapp/domainMappings/example.com.This may not represent the full list of mapped domain mappings if the user does not have VIEWER permissions on all of the applications that have this certificate mapped. See domain_mappings_count for a complete count.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "expireTime": { + "format": "google-datetime", + "description": "The time when this certificate expires. To update the renewal time on this certificate, upload an SSL certificate with a different expiration time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly", + "type": "string" + }, + "name": { + "description": "Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly", + "type": "string" + } + }, + "id": "AuthorizedCertificate", + "description": "An SSL certificate that a user has been authorized to administer. A user is authorized to administer any certificate that applies to one of their authorized domains.", + "type": "object" + }, + "ResourceRecord": { + "properties": { + "type": { + "enum": [ + "RECORD_TYPE_UNSPECIFIED", + "A", + "AAAA", + "CNAME" + ], + "description": "Resource record type. Example: AAAA.", + "type": "string", + "enumDescriptions": [ + "An unknown resource record.", + "An A resource record. Data is an IPv4 address.", + "An AAAA resource record. Data is an IPv6 address.", + "A CNAME resource record. Data is a domain name to be aliased." + ] + }, + "rrdata": { + "description": "Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1).", + "type": "string" + }, + "name": { + "description": "Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'.", + "type": "string" + } + }, + "id": "ResourceRecord", + "description": "A DNS resource record.", + "type": "object" + }, "Library": { "description": "Third-party Python runtime library that is required by the application.", "type": "object", "properties": { - "version": { - "description": "Version of the library to select, or \"latest\".", - "type": "string" - }, "name": { "description": "Name of the library. Example: \"django\".", "type": "string" + }, + "version": { + "description": "Version of the library to select, or \"latest\".", + "type": "string" } }, "id": "Library" @@ -1324,16 +2354,15 @@ }, "locations": { "description": "A list of locations that matches the specified filter in the request.", - "type": "array", "items": { "$ref": "Location" - } + }, + "type": "array" } }, "id": "ListLocationsResponse" }, "ContainerInfo": { - "id": "ContainerInfo", "description": "Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment.", "type": "object", "properties": { @@ -1341,20 +2370,21 @@ "description": "URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: \"gcr.io/my-project/image:tag\" or \"gcr.io/my-project/image@digest\"", "type": "string" } - } + }, + "id": "ContainerInfo" }, "RequestUtilization": { "description": "Target scaling by request utilization. Only applicable for VM runtimes.", "type": "object", "properties": { "targetRequestCountPerSecond": { - "description": "Target requests per second.", "format": "int32", + "description": "Target requests per second.", "type": "integer" }, "targetConcurrentRequests": { - "description": "Target number of concurrent requests.", "format": "int32", + "description": "Target number of concurrent requests.", "type": "integer" } }, @@ -1364,7 +2394,31 @@ "description": "URL pattern and description of how the URL should be handled. App Engine can handle URLs by executing application code or by serving static files uploaded with the version, such as images, CSS, or JavaScript.", "type": "object", "properties": { + "staticFiles": { + "$ref": "StaticFilesHandler", + "description": "Returns the contents of a file, such as an image, as the response." + }, + "redirectHttpResponseCode": { + "enumDescriptions": [ + "Not specified. 302 is assumed.", + "301 Moved Permanently code.", + "302 Moved Temporarily code.", + "303 See Other code.", + "307 Temporary Redirect code." + ], + "enum": [ + "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", + "REDIRECT_HTTP_RESPONSE_CODE_301", + "REDIRECT_HTTP_RESPONSE_CODE_302", + "REDIRECT_HTTP_RESPONSE_CODE_303", + "REDIRECT_HTTP_RESPONSE_CODE_307" + ], + "description": "30x code to use when performing redirects for the secure field. Defaults to 302.", + "type": "string" + }, "securityLevel": { + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string", "enumDescriptions": [ "Not specified.", "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", @@ -1378,9 +2432,7 @@ "SECURE_NEVER", "SECURE_OPTIONAL", "SECURE_ALWAYS" - ], - "description": "Security (HTTPS) enforcement for this URL.", - "type": "string" + ] }, "authFailAction": { "enumDescriptions": [ @@ -1405,8 +2457,6 @@ "type": "string" }, "login": { - "description": "Level of login required to access this resource.", - "type": "string", "enumDescriptions": [ "Not specified. LOGIN_OPTIONAL is assumed.", "Does not require that the user is signed in.", @@ -1418,33 +2468,13 @@ "LOGIN_OPTIONAL", "LOGIN_ADMIN", "LOGIN_REQUIRED" - ] + ], + "description": "Level of login required to access this resource.", + "type": "string" }, "apiEndpoint": { - "description": "Uses API Endpoints to handle requests.", - "$ref": "ApiEndpointHandler" - }, - "staticFiles": { - "description": "Returns the contents of a file, such as an image, as the response.", - "$ref": "StaticFilesHandler" - }, - "redirectHttpResponseCode": { - "enumDescriptions": [ - "Not specified. 302 is assumed.", - "301 Moved Permanently code.", - "302 Moved Temporarily code.", - "303 See Other code.", - "307 Temporary Redirect code." - ], - "enum": [ - "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", - "REDIRECT_HTTP_RESPONSE_CODE_301", - "REDIRECT_HTTP_RESPONSE_CODE_302", - "REDIRECT_HTTP_RESPONSE_CODE_303", - "REDIRECT_HTTP_RESPONSE_CODE_307" - ], - "description": "30x code to use when performing redirects for the secure field. Defaults to 302.", - "type": "string" + "$ref": "ApiEndpointHandler", + "description": "Uses API Endpoints to handle requests." } }, "id": "UrlMap" @@ -1453,21 +2483,31 @@ "description": "Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The Endpoints API Service provides tooling for serving Open API and gRPC endpoints via an NGINX proxy.The fields here refer to the name and configuration id of a \"service\" resource in the Service Management API (https://cloud.google.com/service-management/overview).", "type": "object", "properties": { - "name": { - "description": "Endpoints service name which is the name of the \"service\" resource in the Service Management API. For example \"myapi.endpoints.myproject.cloud.goog\"", - "type": "string" - }, "configId": { "description": "Endpoints service configuration id as specified by the Service Management API. For example \"2016-09-19r1\"", "type": "string" + }, + "name": { + "description": "Endpoints service name which is the name of the \"service\" resource in the Service Management API. For example \"myapi.endpoints.myproject.cloud.goog\"", + "type": "string" } }, "id": "EndpointsApiService" }, "Operation": { - "description": "This resource represents a long-running operation that is the result of a network API call.", - "type": "object", "properties": { + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" + }, "done": { "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", "type": "boolean" @@ -1483,30 +2523,16 @@ "name": { "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", "type": "string" - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." - }, - "metadata": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object" } }, - "id": "Operation" + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object" }, "ApiConfigHandler": { "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", "type": "object", "properties": { - "url": { - "description": "URL to serve the endpoint at.", - "type": "string" - }, "securityLevel": { "description": "Security (HTTPS) enforcement for this URL.", "type": "string", @@ -1558,18 +2584,25 @@ ], "description": "Level of login required to access this resource. Defaults to optional.", "type": "string" + }, + "url": { + "description": "URL to serve the endpoint at.", + "type": "string" } }, "id": "ApiConfigHandler" }, "StaticFilesHandler": { - "id": "StaticFilesHandler", "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.", "type": "object", "properties": { + "requireMatchingFile": { + "description": "Whether this handler should match the request if the file referenced by the handler does not exist.", + "type": "boolean" + }, "expiration": { - "description": "Time a static file served by this handler should be cached by web proxies and browsers.", "format": "google-duration", + "description": "Time a static file served by this handler should be cached by web proxies and browsers.", "type": "string" }, "applicationReadable": { @@ -1594,82 +2627,102 @@ "mimeType": { "description": "MIME type used to serve all files served by this handler.Defaults to file-specific MIME types, which are derived from each file's filename extension.", "type": "string" - }, - "requireMatchingFile": { - "description": "Whether this handler should match the request if the file referenced by the handler does not exist.", - "type": "boolean" } - } - }, - "DiskUtilization": { - "id": "DiskUtilization", - "description": "Target scaling by disk usage. Only applicable for VM runtimes.", - "type": "object", - "properties": { - "targetWriteBytesPerSecond": { - "description": "Target bytes written per second.", - "format": "int32", - "type": "integer" - }, - "targetReadBytesPerSecond": { - "description": "Target bytes read per second.", - "format": "int32", - "type": "integer" - }, - "targetReadOpsPerSecond": { - "description": "Target ops read per seconds.", - "format": "int32", - "type": "integer" - }, - "targetWriteOpsPerSecond": { - "description": "Target ops written per second.", - "format": "int32", - "type": "integer" - } - } + }, + "id": "StaticFilesHandler" }, "BasicScaling": { - "id": "BasicScaling", "description": "A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", "type": "object", "properties": { "maxInstances": { - "description": "Maximum number of instances to create for this version.", "format": "int32", + "description": "Maximum number of instances to create for this version.", "type": "integer" }, "idleTimeout": { - "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", "format": "google-duration", + "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", "type": "string" } - } + }, + "id": "BasicScaling" + }, + "DiskUtilization": { + "properties": { + "targetWriteOpsPerSecond": { + "format": "int32", + "description": "Target ops written per second.", + "type": "integer" + }, + "targetWriteBytesPerSecond": { + "format": "int32", + "description": "Target bytes written per second.", + "type": "integer" + }, + "targetReadOpsPerSecond": { + "format": "int32", + "description": "Target ops read per seconds.", + "type": "integer" + }, + "targetReadBytesPerSecond": { + "format": "int32", + "description": "Target bytes read per second.", + "type": "integer" + } + }, + "id": "DiskUtilization", + "description": "Target scaling by disk usage. Only applicable for VM runtimes.", + "type": "object" }, "CpuUtilization": { - "id": "CpuUtilization", - "description": "Target scaling by CPU usage.", - "type": "object", "properties": { "aggregationWindowLength": { - "description": "Period of time over which CPU utilization is calculated.", "format": "google-duration", + "description": "Period of time over which CPU utilization is calculated.", "type": "string" }, "targetUtilization": { - "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", "format": "double", + "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", "type": "number" } - } + }, + "id": "CpuUtilization", + "description": "Target scaling by CPU usage.", + "type": "object" + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" }, "IdentityAwareProxy": { "description": "Identity-Aware Proxy", "type": "object", "properties": { - "enabled": { - "description": "Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields must be non-empty.", - "type": "boolean" - }, "oauth2ClientSecret": { "description": "OAuth2 client secret to use for the authentication flow.For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2_client_secret_sha256 field.@InputOnly", "type": "string" @@ -1681,51 +2734,27 @@ "oauth2ClientSecretSha256": { "description": "Hex-encoded SHA-256 hash of the client secret.@OutputOnly", "type": "string" + }, + "enabled": { + "description": "Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields must be non-empty.", + "type": "boolean" } }, "id": "IdentityAwareProxy" }, - "Status": { - "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" - }, - "details": { - "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - } - }, - "id": "Status" - }, "ManualScaling": { - "id": "ManualScaling", "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", "type": "object", "properties": { "instances": { - "description": "Number of instances to assign to the service at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", "format": "int32", + "description": "Number of instances to assign to the service at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", "type": "integer" } - } + }, + "id": "ManualScaling" }, "LocationMetadata": { - "id": "LocationMetadata", "description": "Metadata for the given google.cloud.location.Location.", "type": "object", "properties": { @@ -1737,12 +2766,10 @@ "description": "App Engine Standard Environment is available in the given location.@OutputOnly", "type": "boolean" } - } + }, + "id": "LocationMetadata" }, "Service": { - "id": "Service", - "description": "A Service resource is a logical component of an application that can share state and communicate in a secure fashion with other services. For example, an application that handles customer requests might include separate services to handle tasks such as backend data analysis or API requests from mobile devices. Each service has a collection of versions that define a specific set of code used to implement the functionality of that service.", - "type": "object", "properties": { "name": { "description": "Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly", @@ -1756,7 +2783,10 @@ "description": "Relative name of the service within the application. Example: default.@OutputOnly", "type": "string" } - } + }, + "id": "Service", + "description": "A Service resource is a logical component of an application that can share state and communicate in a secure fashion with other services. For example, an application that handles customer requests might include separate services to handle tasks such as backend data analysis or API requests from mobile devices. Each service has a collection of versions that define a specific set of code used to implement the functionality of that service.", + "type": "object" }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", @@ -1768,10 +2798,10 @@ }, "operations": { "description": "A list of operations that matches the specified filter in the request.", - "type": "array", "items": { "$ref": "Operation" - } + }, + "type": "array" } }, "id": "ListOperationsResponse" @@ -1781,8 +2811,8 @@ "type": "object", "properties": { "insertTime": { - "description": "Timestamp that this operation was created.@OutputOnly", "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", "type": "string" }, "user": { @@ -1798,8 +2828,8 @@ "type": "string" }, "endTime": { - "description": "Timestamp that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", "type": "string" }, "operationType": { @@ -1809,55 +2839,48 @@ }, "id": "OperationMetadata" }, - "ErrorHandler": { - "description": "Custom static error page to be served when an error occurs.", + "ListAuthorizedCertificatesResponse": { + "description": "Response message for AuthorizedCertificates.ListAuthorizedCertificates.", "type": "object", "properties": { - "errorCode": { - "description": "Error condition this handler applies to.", - "type": "string", - "enumDescriptions": [ - "Not specified. ERROR_CODE_DEFAULT is assumed.", - "All other error types.", - "Application has exceeded a resource quota.", - "Client blocked by the application's Denial of Service protection configuration.", - "Deadline reached before the application responds." - ], - "enum": [ - "ERROR_CODE_UNSPECIFIED", - "ERROR_CODE_DEFAULT", - "ERROR_CODE_OVER_QUOTA", - "ERROR_CODE_DOS_API_DENIAL", - "ERROR_CODE_TIMEOUT" - ] - }, - "mimeType": { - "description": "MIME type of file. Defaults to text/html.", + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", "type": "string" }, - "staticFile": { - "description": "Static file content to be served for this error.", - "type": "string" + "certificates": { + "description": "The SSL certificates the user is authorized to administer.", + "items": { + "$ref": "AuthorizedCertificate" + }, + "type": "array" } }, - "id": "ErrorHandler" + "id": "ListAuthorizedCertificatesResponse" + }, + "FeatureSettings": { + "properties": { + "splitHealthChecks": { + "description": "Boolean value indicating if split health checks should be used instead of the legacy health checks. At an app.yaml level, this means defaulting to 'readiness_check' and 'liveness_check' values instead of 'health_check' ones. Once the legacy 'health_check' behavior is deprecated, and this value is always true, this setting can be removed.", + "type": "boolean" + } + }, + "id": "FeatureSettings", + "description": "The feature specific settings to be used in the application. These define behaviors that are user configurable.", + "type": "object" }, "OperationMetadataV1": { - "id": "OperationMetadataV1", - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", "properties": { - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, "warning": { "description": "Durable messages that persist on every operation poll. @OutputOnly", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" }, "user": { "description": "User who requested this operation.@OutputOnly", @@ -1876,42 +2899,133 @@ "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", "type": "string" } - } + }, + "id": "OperationMetadataV1", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "SslSettings": { + "description": "SSL configuration for a DomainMapping resource.", + "type": "object", + "properties": { + "certificateId": { + "description": "ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support. Example: 12345.", + "type": "string" + } + }, + "id": "SslSettings" + }, + "ErrorHandler": { + "description": "Custom static error page to be served when an error occurs.", + "type": "object", + "properties": { + "mimeType": { + "description": "MIME type of file. Defaults to text/html.", + "type": "string" + }, + "errorCode": { + "enumDescriptions": [ + "Not specified. ERROR_CODE_DEFAULT is assumed.", + "All other error types.", + "Application has exceeded a resource quota.", + "Client blocked by the application's Denial of Service protection configuration.", + "Deadline reached before the application responds." + ], + "enum": [ + "ERROR_CODE_UNSPECIFIED", + "ERROR_CODE_DEFAULT", + "ERROR_CODE_OVER_QUOTA", + "ERROR_CODE_DOS_API_DENIAL", + "ERROR_CODE_TIMEOUT" + ], + "description": "Error condition this handler applies to.", + "type": "string" + }, + "staticFile": { + "description": "Static file content to be served for this error.", + "type": "string" + } + }, + "id": "ErrorHandler" }, "Network": { - "id": "Network", - "description": "Extra network settings. Only applicable for VM runtimes.", + "description": "Extra network settings. Only applicable for App Engine flexible environment versions", "type": "object", "properties": { - "forwardedPorts": { - "description": "List of ports, or port pairs, to forward from the virtual machine to the application container.", - "type": "array", - "items": { - "type": "string" - } + "subnetworkName": { + "description": "Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network.\nIf the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range.\nIf the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network.\nIf the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the App Engine flexible environment application.", + "type": "string" }, "instanceTag": { - "description": "Tag to apply to the VM instance during creation.", + "description": "Tag to apply to the VM instance during creation. Only applicable for for App Engine flexible environment versions.", "type": "string" }, - "subnetworkName": { - "description": "Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network.\nIf the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range.\nIf the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network.\nIf the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app.", - "type": "string" + "forwardedPorts": { + "description": "List of ports, or port pairs, to forward from the virtual machine to the application container. Only applicable for App Engine flexible environment versions.", + "items": { + "type": "string" + }, + "type": "array" }, "name": { - "description": "Google Cloud Platform network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.", + "description": "Google Compute Engine network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.", "type": "string" } - } + }, + "id": "Network" }, "Application": { - "description": "An Application resource contains the top-level configuration of an App Engine application.", + "description": "An Application resource contains the top-level configuration of an App Engine application. Next tag: 20", "type": "object", "properties": { + "id": { + "description": "Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp.", + "type": "string" + }, + "defaultCookieExpiration": { + "format": "google-duration", + "description": "Cookie expiration policy for this application.", + "type": "string" + }, + "locationId": { + "description": "Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US", + "type": "string" + }, + "servingStatus": { + "enum": [ + "UNSPECIFIED", + "SERVING", + "USER_DISABLED", + "SYSTEM_DISABLED" + ], + "description": "Serving status of this application.", + "type": "string", + "enumDescriptions": [ + "Serving status is unspecified.", + "Application is serving.", + "Application has been disabled by the user.", + "Application has been disabled by the system." + ] + }, + "defaultHostname": { + "description": "Hostname used to reach this application, as resolved by App Engine.@OutputOnly", + "type": "string" + }, + "featureSettings": { + "description": "The feature specific settings to be used in the application.", + "$ref": "FeatureSettings" + }, + "authDomain": { + "description": "Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account.", + "type": "string" + }, + "iap": { + "$ref": "IdentityAwareProxy" + }, "codeBucket": { "description": "Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly", "type": "string" @@ -1922,10 +3036,10 @@ }, "dispatchRules": { "description": "HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 dispatch rules can be supported.@OutputOnly", - "type": "array", "items": { "$ref": "UrlDispatchRule" - } + }, + "type": "array" }, "gcrDomain": { "description": "The Google Container Registry domain used for storing managed build docker images for this application.", @@ -1934,64 +3048,14 @@ "name": { "description": "Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly", "type": "string" - }, - "defaultCookieExpiration": { - "description": "Cookie expiration policy for this application.", - "format": "google-duration", - "type": "string" - }, - "id": { - "description": "Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp.", - "type": "string" - }, - "locationId": { - "description": "Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US", - "type": "string" - }, - "servingStatus": { - "enumDescriptions": [ - "Serving status is unspecified.", - "Application is serving.", - "Application has been disabled by the user.", - "Application has been disabled by the system." - ], - "enum": [ - "UNSPECIFIED", - "SERVING", - "USER_DISABLED", - "SYSTEM_DISABLED" - ], - "description": "Serving status of this application.", - "type": "string" - }, - "defaultHostname": { - "description": "Hostname used to reach this application, as resolved by App Engine.@OutputOnly", - "type": "string" - }, - "authDomain": { - "description": "Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account.", - "type": "string" - }, - "iap": { - "$ref": "IdentityAwareProxy" } }, "id": "Application" }, "Instance": { - "id": "Instance", "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", "type": "object", "properties": { - "vmDebugEnabled": { - "description": "Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "boolean" - }, - "requests": { - "description": "Number of requests since this instance was started.@OutputOnly", - "format": "int32", - "type": "integer" - }, "appEngineRelease": { "description": "App Engine release this instance is running on.@OutputOnly", "type": "string" @@ -2000,26 +3064,26 @@ "description": "Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, - "vmId": { - "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" - }, "qps": { - "description": "Average queries per second (QPS) over the last minute.@OutputOnly", "format": "float", + "description": "Average queries per second (QPS) over the last minute.@OutputOnly", "type": "number" }, - "name": { - "description": "Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly", + "vmId": { + "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, "vmZoneName": { "description": "Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, + "name": { + "description": "Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly", + "type": "string" + }, "averageLatency": { - "description": "Average latency (ms) over the last minute.@OutputOnly", "format": "int32", + "description": "Average latency (ms) over the last minute.@OutputOnly", "type": "integer" }, "id": { @@ -2027,26 +3091,20 @@ "type": "string" }, "memoryUsage": { - "description": "Total memory in use (bytes).@OutputOnly", "format": "int64", + "description": "Total memory in use (bytes).@OutputOnly", "type": "string" }, "vmIp": { "description": "The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, - "vmStatus": { - "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" - }, "errors": { - "description": "Number of errors since this instance was started.@OutputOnly", "format": "int32", + "description": "Number of errors since this instance was started.@OutputOnly", "type": "integer" }, "availability": { - "description": "Availability of the instance.@OutputOnly", - "type": "string", "enumDescriptions": [ "", "", @@ -2056,416 +3114,30 @@ "UNSPECIFIED", "RESIDENT", "DYNAMIC" - ] + ], + "description": "Availability of the instance.@OutputOnly", + "type": "string" + }, + "vmStatus": { + "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" }, "startTime": { + "format": "google-datetime", "description": "Time that this instance was started.@OutputOnly", - "format": "google-datetime", - "type": "string" - } - } - }, - "LivenessCheck": { - "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances.", - "type": "object", - "properties": { - "timeout": { - "description": "Time before the check is considered failed.", - "format": "google-duration", "type": "string" }, - "failureThreshold": { - "description": "Number of consecutive failed checks required before considering the VM unhealthy.", - "format": "uint32", - "type": "integer" - }, - "initialDelay": { - "description": "The initial delay before starting to execute the checks.", - "format": "google-duration", - "type": "string" - }, - "path": { - "description": "The request path.", - "type": "string" - }, - "successThreshold": { - "description": "Number of consecutive successful checks required before considering the VM healthy.", - "format": "uint32", - "type": "integer" - }, - "host": { - "description": "Host header to send when performing a HTTP Liveness check. Example: \"myapp.appspot.com\"", - "type": "string" - }, - "checkInterval": { - "description": "Interval between health checks.", - "format": "google-duration", - "type": "string" - } - }, - "id": "LivenessCheck" - }, - "NetworkUtilization": { - "id": "NetworkUtilization", - "description": "Target scaling by network usage. Only applicable for VM runtimes.", - "type": "object", - "properties": { - "targetSentBytesPerSecond": { - "description": "Target bytes sent per second.", - "format": "int32", - "type": "integer" - }, - "targetSentPacketsPerSecond": { - "description": "Target packets sent per second.", - "format": "int32", - "type": "integer" - }, - "targetReceivedBytesPerSecond": { - "description": "Target bytes received per second.", - "format": "int32", - "type": "integer" - }, - "targetReceivedPacketsPerSecond": { - "description": "Target packets received per second.", - "format": "int32", - "type": "integer" - } - } - }, - "Location": { - "id": "Location", - "description": "A resource that represents Google Cloud Platform location.", - "type": "object", - "properties": { - "name": { - "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"", - "type": "string" - }, - "locationId": { - "description": "The canonical id for this location. For example: \"us-east1\".", - "type": "string" - }, - "metadata": { - "description": "Service-specific metadata. For example the available capacity at the given location.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", - "type": "object" - } - } - }, - "HealthCheck": { - "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.", - "type": "object", - "properties": { - "unhealthyThreshold": { - "description": "Number of consecutive failed health checks required before removing traffic.", - "format": "uint32", - "type": "integer" - }, - "disableHealthCheck": { - "description": "Whether to explicitly disable health checks for this instance.", + "vmDebugEnabled": { + "description": "Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "boolean" }, - "host": { - "description": "Host header to send when performing an HTTP health check. Example: \"myapp.appspot.com\"", - "type": "string" - }, - "healthyThreshold": { - "description": "Number of consecutive successful health checks required before receiving traffic.", - "format": "uint32", + "requests": { + "format": "int32", + "description": "Number of requests since this instance was started.@OutputOnly", "type": "integer" - }, - "restartThreshold": { - "description": "Number of consecutive failed health checks required before an instance is restarted.", - "format": "uint32", - "type": "integer" - }, - "checkInterval": { - "description": "Interval between health checks.", - "format": "google-duration", - "type": "string" - }, - "timeout": { - "description": "Time before the health check is considered failed.", - "format": "google-duration", - "type": "string" } }, - "id": "HealthCheck" - }, - "ReadinessCheck": { - "id": "ReadinessCheck", - "description": "Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation.", - "type": "object", - "properties": { - "timeout": { - "description": "Time before the check is considered failed.", - "format": "google-duration", - "type": "string" - }, - "failureThreshold": { - "description": "Number of consecutive failed checks required before removing traffic.", - "format": "uint32", - "type": "integer" - }, - "path": { - "description": "The request path.", - "type": "string" - }, - "successThreshold": { - "description": "Number of consecutive successful checks required before receiving traffic.", - "format": "uint32", - "type": "integer" - }, - "host": { - "description": "Host header to send when performing a HTTP Readiness check. Example: \"myapp.appspot.com\"", - "type": "string" - }, - "checkInterval": { - "description": "Interval between health checks.", - "format": "google-duration", - "type": "string" - } - } - }, - "DebugInstanceRequest": { - "id": "DebugInstanceRequest", - "description": "Request message for Instances.DebugInstance.", - "type": "object", - "properties": { - "sshKey": { - "description": "Public SSH key to add to the instance. Examples:\n[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]\n[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {\"userName\":\"[USERNAME]\",\"expireOn\":\"[EXPIRE_TIME]\"}For more information, see Adding and Removing SSH Keys (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).", - "type": "string" - } - } - }, - "OperationMetadataV1Beta5": { - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", - "properties": { - "user": { - "description": "User who requested this operation.@OutputOnly", - "type": "string" - }, - "target": { - "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", - "type": "string" - }, - "method": { - "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", - "type": "string" - }, - "insertTime": { - "description": "Timestamp that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "endTime": { - "description": "Timestamp that this operation completed.@OutputOnly", - "format": "google-datetime", - "type": "string" - } - }, - "id": "OperationMetadataV1Beta5" - }, - "Version": { - "description": "A Version resource is a specific set of source code and configuration files that are deployed into a service.", - "type": "object", - "properties": { - "deployment": { - "$ref": "Deployment", - "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set." - }, - "createTime": { - "description": "Time that this version was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "resources": { - "$ref": "Resources", - "description": "Machine resources for this version. Only applicable for VM runtimes." - }, - "inboundServices": { - "enumDescriptions": [ - "Not specified.", - "Allows an application to receive mail.", - "Allows an application to receive email-bound notifications.", - "Allows an application to receive error stanzas.", - "Allows an application to receive instant messages.", - "Allows an application to receive user subscription POSTs.", - "Allows an application to receive a user's chat presence.", - "Registers an application for notifications when a client connects or disconnects from a channel.", - "Enables warmup requests." - ], - "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", - "type": "array", - "items": { - "enum": [ - "INBOUND_SERVICE_UNSPECIFIED", - "INBOUND_SERVICE_MAIL", - "INBOUND_SERVICE_MAIL_BOUNCE", - "INBOUND_SERVICE_XMPP_ERROR", - "INBOUND_SERVICE_XMPP_MESSAGE", - "INBOUND_SERVICE_XMPP_SUBSCRIBE", - "INBOUND_SERVICE_XMPP_PRESENCE", - "INBOUND_SERVICE_CHANNEL_PRESENCE", - "INBOUND_SERVICE_WARMUP" - ], - "type": "string" - } - }, - "errorHandlers": { - "description": "Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set.", - "type": "array", - "items": { - "$ref": "ErrorHandler" - } - }, - "defaultExpiration": { - "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", - "format": "google-duration", - "type": "string" - }, - "libraries": { - "description": "Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set.", - "type": "array", - "items": { - "$ref": "Library" - } - }, - "nobuildFilesRegex": { - "description": "Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set.", - "type": "string" - }, - "basicScaling": { - "description": "A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", - "$ref": "BasicScaling" - }, - "runtime": { - "description": "Desired runtime. Example: python27.", - "type": "string" - }, - "createdBy": { - "description": "Email address of the user who created this version.@OutputOnly", - "type": "string" - }, - "id": { - "description": "Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: \"default\", \"latest\", and any name with the prefix \"ah-\".", - "type": "string" - }, - "envVariables": { - "additionalProperties": { - "type": "string" - }, - "description": "Environment variables available to the application.Only returned in GET requests if view=FULL is set.", - "type": "object" - }, - "livenessCheck": { - "$ref": "LivenessCheck", - "description": "Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if view=FULL is set." - }, - "network": { - "description": "Extra network settings. Only applicable for VM runtimes.", - "$ref": "Network" - }, - "betaSettings": { - "additionalProperties": { - "type": "string" - }, - "description": "Metadata settings that are supplied to this version to enable beta runtime features.", - "type": "object" - }, - "env": { - "description": "App Engine execution environment for this version.Defaults to standard.", - "type": "string" - }, - "handlers": { - "description": "An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set.", - "type": "array", - "items": { - "$ref": "UrlMap" - } - }, - "automaticScaling": { - "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", - "$ref": "AutomaticScaling" - }, - "diskUsageBytes": { - "description": "Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly", - "format": "int64", - "type": "string" - }, - "healthCheck": { - "$ref": "HealthCheck", - "description": "Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set." - }, - "threadsafe": { - "description": "Whether multiple requests can be dispatched to this version at once.", - "type": "boolean" - }, - "readinessCheck": { - "description": "Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests if view=FULL is set.", - "$ref": "ReadinessCheck" - }, - "manualScaling": { - "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", - "$ref": "ManualScaling" - }, - "name": { - "description": "Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly", - "type": "string" - }, - "apiConfig": { - "description": "Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set.", - "$ref": "ApiConfigHandler" - }, - "endpointsApiService": { - "description": "Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app.", - "$ref": "EndpointsApiService" - }, - "vm": { - "description": "Whether to deploy this version in a container on a virtual machine.", - "type": "boolean" - }, - "versionUrl": { - "description": "Serving URL for this version. Example: \"https://myversion-dot-myservice-dot-myapp.appspot.com\"@OutputOnly", - "type": "string" - }, - "instanceClass": { - "description": "Instance class that is used to run this version. Valid values are:\nAutomaticScaling: F1, F2, F4, F4_1G\nManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling.", - "type": "string" - }, - "servingStatus": { - "enumDescriptions": [ - "Not specified.", - "Currently serving. Instances are created according to the scaling settings of the version.", - "Disabled. No instances will be created and the scaling settings are ignored until the state of the version changes to SERVING." - ], - "enum": [ - "SERVING_STATUS_UNSPECIFIED", - "SERVING", - "STOPPED" - ], - "description": "Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING.", - "type": "string" - } - }, - "id": "Version" - }, - "RepairApplicationRequest": { - "description": "Request message for 'Applications.RepairApplication'.", - "type": "object", - "properties": {}, - "id": "RepairApplicationRequest" + "id": "Instance" } }, "protocol": "rest", @@ -2490,15 +3162,15 @@ } } }, - "kind": "discovery#restDescription", - "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", "servicePath": "", + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "kind": "discovery#restDescription", "rootUrl": "https://appengine.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "appengine", "batchPath": "batch", - "revision": "20170522", + "revision": "20170914", "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", "id": "appengine:v1", "title": "Google App Engine Admin API" diff --git a/etc/api/appengine/v1/crates/1.0.6-api+20170914 b/etc/api/appengine/v1/crates/1.0.6-api+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appengine/v1alpha/appengine-api.json b/etc/api/appengine/v1alpha/appengine-api.json new file mode 100644 index 0000000000..2986c8ae65 --- /dev/null +++ b/etc/api/appengine/v1alpha/appengine-api.json @@ -0,0 +1,1302 @@ +{ + "parameters": { + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "type": "string", + "location": "query", + "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." + } + }, + "schemas": { + "AuthorizedCertificate": { + "description": "An SSL certificate that a user has been authorized to administer. A user is authorized to administer any certificate that applies to one of their authorized domains.", + "type": "object", + "properties": { + "displayName": { + "description": "The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate.", + "type": "string" + }, + "managedCertificate": { + "$ref": "ManagedCertificate", + "description": "Only applicable if this certificate is managed by App Engine. Managed certificates are tied to the lifecycle of a DomainMapping and cannot be updated or deleted via the AuthorizedCertificates API. If this certificate is manually administered by the user, this field will be empty.@OutputOnly" + }, + "certificateRawData": { + "description": "The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority.", + "$ref": "CertificateRawData" + }, + "visibleDomainMappings": { + "description": "The full paths to user visible Domain Mapping resources that have this certificate mapped. Example: apps/myapp/domainMappings/example.com.This may not represent the full list of mapped domain mappings if the user does not have VIEWER permissions on all of the applications that have this certificate mapped. See domain_mappings_count for a complete count.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "expireTime": { + "format": "google-datetime", + "description": "The time when this certificate expires. To update the renewal time on this certificate, upload an SSL certificate with a different expiration time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly", + "type": "string" + }, + "name": { + "description": "Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly", + "type": "string" + }, + "domainMappingsCount": { + "format": "int32", + "description": "Aggregate count of the domain mappings with this certificate mapped. This count includes domain mappings on applications for which the user does not have VIEWER permissions.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly", + "type": "integer" + }, + "domainNames": { + "description": "Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 12345.@OutputOnly", + "type": "string" + } + }, + "id": "AuthorizedCertificate" + }, + "ResourceRecord": { + "description": "A DNS resource record.", + "type": "object", + "properties": { + "type": { + "description": "Resource record type. Example: AAAA.", + "type": "string", + "enumDescriptions": [ + "An A resource record. Data is an IPv4 address.", + "An AAAA resource record. Data is an IPv6 address.", + "A CNAME resource record. Data is a domain name to be aliased." + ], + "enum": [ + "A", + "AAAA", + "CNAME" + ] + }, + "rrdata": { + "description": "Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1).", + "type": "string" + }, + "name": { + "description": "Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'.", + "type": "string" + } + }, + "id": "ResourceRecord" + }, + "ListOperationsResponse": { + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations." + }, + "OperationMetadata": { + "type": "object", + "properties": { + "endTime": { + "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", + "type": "string" + }, + "operationType": { + "description": "Type of this operation. Deprecated, use method field instead. Example: \"create_version\".@OutputOnly", + "type": "string" + }, + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1beta4.Version.CreateVersion.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadata", + "description": "Metadata for the given google.longrunning.Operation." + }, + "ListAuthorizedCertificatesResponse": { + "description": "Response message for AuthorizedCertificates.ListAuthorizedCertificates.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "certificates": { + "description": "The SSL certificates the user is authorized to administer.", + "items": { + "$ref": "AuthorizedCertificate" + }, + "type": "array" + } + }, + "id": "ListAuthorizedCertificatesResponse" + }, + "OperationMetadataV1Beta5": { + "id": "OperationMetadataV1Beta5", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "method": { + "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", + "type": "string" + }, + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + } + } + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + }, + "locations": { + "items": { + "$ref": "Location" + }, + "type": "array", + "description": "A list of locations that matches the specified filter in the request." + } + }, + "id": "ListLocationsResponse" + }, + "ManagedCertificate": { + "description": "A certificate managed by App Engine.", + "type": "object", + "properties": { + "lastRenewalTime": { + "format": "google-datetime", + "description": "Time at which the certificate was last renewed. The renewal process is fully managed. Certificate renewal will automatically occur before the certificate expires. Renewal errors can be tracked via ManagementStatus.@OutputOnly", + "type": "string" + }, + "status": { + "type": "string", + "enumDescriptions": [ + "", + "Certificate was successfully obtained and inserted into the serving system.", + "Certificate is under active attempts to acquire or renew.", + "Most recent renewal failed due to a system failure and will be retried. System failure is likely transient, and subsequent renewal attempts may succeed. The last successfully provisioned certificate may still be serving.", + "Most recent renewal failed due to an invalid DNS setup and will be retried. Renewal attempts will continue to fail until the certificate domain's DNS configuration is fixed. The last successfully provisioned certificate may still be serving.", + "All renewal attempts have been exhausted. Most recent renewal failed due to an invalid DNS setup and will not be retried. The last successfully provisioned certificate may still be serving." + ], + "enum": [ + "UNSPECIFIED_STATUS", + "OK", + "PENDING", + "FAILED_RETRYING_INTERNAL", + "FAILED_RETRYING_NOT_VISIBLE", + "FAILED_PERMANENTLY_NOT_VISIBLE" + ], + "description": "Status of certificate management. Refers to the most recent certificate acquisition or renewal attempt.@OutputOnly" + } + }, + "id": "ManagedCertificate" + }, + "OperationMetadataV1": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1" + }, + "SslSettings": { + "description": "SSL configuration for a DomainMapping resource.", + "type": "object", + "properties": { + "isManagedCertificate": { + "description": "Whether the mapped certificate is an App Engine managed certificate. Managed certificates are created by default with a domain mapping. To opt out, specify no_managed_certificate on a CREATE or UPDATE request.@OutputOnly", + "type": "boolean" + }, + "certificateId": { + "description": "ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support.By default, a managed certificate is automatically created for every domain mapping. To omit SSL support or to configure SSL manually, specify no_managed_certificate on a CREATE or UPDATE request. You must be authorized to administer the AuthorizedCertificate resource to manually map it to a DomainMapping resource. Example: 12345.", + "type": "string" + } + }, + "id": "SslSettings" + }, + "CertificateRawData": { + "description": "An SSL certificate obtained from a certificate authority.", + "type": "object", + "properties": { + "privateKey": { + "description": "Unencrypted PEM encoded RSA private key. This field is set once on certificate creation and then encrypted. The key size must be 2048 bits or fewer. Must include the header and footer. Example: \u003cpre\u003e -----BEGIN RSA PRIVATE KEY----- \u003cunencrypted_key_value\u003e -----END RSA PRIVATE KEY----- \u003c/pre\u003e @InputOnly", + "type": "string" + }, + "publicCertificate": { + "description": "PEM encoded x.509 public key certificate. This field is set once on certificate creation. Must include the header and footer. Example: \u003cpre\u003e -----BEGIN CERTIFICATE----- \u003ccertificate_value\u003e -----END CERTIFICATE----- \u003c/pre\u003e", + "type": "string" + } + }, + "id": "CertificateRawData" + }, + "Operation": { + "type": "object", + "properties": { + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, + "response": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse." + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" + } + }, + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a network API call." + }, + "ListDomainMappingsResponse": { + "id": "ListDomainMappingsResponse", + "description": "Response message for DomainMappings.ListDomainMappings.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "domainMappings": { + "description": "The domain mappings for the application.", + "items": { + "$ref": "DomainMapping" + }, + "type": "array" + } + } + }, + "OperationMetadataV1Alpha": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "OperationMetadataV1Alpha" + }, + "OperationMetadataExperimental": { + "id": "OperationMetadataExperimental", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly", + "type": "string" + }, + "user": { + "type": "string", + "description": "User who requested this operation.@OutputOnly" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.experimental.CustomDomains.CreateCustomDomain.@OutputOnly", + "type": "string" + } + } + }, + "ListAuthorizedDomainsResponse": { + "description": "Response message for AuthorizedDomains.ListAuthorizedDomains.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "domains": { + "description": "The authorized domains belonging to the user.", + "items": { + "$ref": "AuthorizedDomain" + }, + "type": "array" + } + }, + "id": "ListAuthorizedDomainsResponse" + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "AuthorizedDomain": { + "id": "AuthorizedDomain", + "description": "A domain that a user has been authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (https://www.google.com/webmasters/verification/home).", + "type": "object", + "properties": { + "id": { + "description": "Fully qualified domain name of the domain authorized for use. Example: example.com.", + "type": "string" + }, + "name": { + "type": "string", + "description": "Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly" + } + } + }, + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object" + }, + "DomainMapping": { + "description": "A domain serving an App Engine application.", + "type": "object", + "properties": { + "sslSettings": { + "description": "SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.", + "$ref": "SslSettings" + }, + "name": { + "description": "Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly", + "type": "string" + }, + "resourceRecords": { + "description": "The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the application via this domain mapping.@OutputOnly", + "items": { + "$ref": "ResourceRecord" + }, + "type": "array" + }, + "id": { + "type": "string", + "description": "Relative name of the domain serving the application. Example: example.com." + } + }, + "id": "DomainMapping" + }, + "LocationMetadata": { + "id": "LocationMetadata", + "description": "Metadata for the given google.cloud.location.Location.", + "type": "object", + "properties": { + "standardEnvironmentAvailable": { + "description": "App Engine Standard Environment is available in the given location.@OutputOnly", + "type": "boolean" + }, + "flexibleEnvironmentAvailable": { + "description": "App Engine Flexible Environment is available in the given location.@OutputOnly", + "type": "boolean" + } + } + }, + "OperationMetadataV1Beta": { + "type": "object", + "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1beta.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Beta", + "description": "Metadata for the given google.longrunning.Operation." + }, + "Location": { + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", + "type": "object" + }, + "name": { + "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"", + "type": "string" + }, + "locationId": { + "description": "The canonical id for this location. For example: \"us-east1\".", + "type": "string" + }, + "metadata": { + "description": "Service-specific metadata. For example the available capacity at the given location.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + } + }, + "id": "Location", + "description": "A resource that represents Google Cloud Platform location.", + "type": "object" + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "version": "v1alpha", + "baseUrl": "https://appengine.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/appengine.admin": { + "description": "View and manage your applications deployed on Google App Engine" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "servicePath": "", + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "kind": "discovery#restDescription", + "rootUrl": "https://appengine.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "appengine", + "batchPath": "batch", + "id": "appengine:v1alpha", + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "revision": "20170914", + "title": "Google App Engine Admin API", + "ownerName": "Google", + "discoveryVersion": "v1", + "resources": { + "apps": { + "resources": { + "operations": { + "methods": { + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "operationsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation resource.", + "type": "string", + "required": true + }, + "operationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1alpha/apps/{appsId}/operations/{operationsId}", + "id": "appengine.apps.operations.get", + "path": "v1alpha/apps/{appsId}/operations/{operationsId}", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. The name of the operation's parent resource.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1alpha/apps/{appsId}/operations", + "id": "appengine.apps.operations.list", + "path": "v1alpha/apps/{appsId}/operations" + } + } + }, + "locations": { + "methods": { + "get": { + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "appsId", + "locationsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Resource name for the location.", + "type": "string", + "required": true, + "location": "path" + }, + "locationsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1alpha/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.get", + "path": "v1alpha/apps/{appsId}/locations/{locationsId}", + "description": "Get information about a location." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListLocationsResponse" + }, + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "appsId": { + "type": "string", + "required": true, + "location": "path", + "description": "Part of `name`. The resource that owns the locations collection, if applicable." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1alpha/apps/{appsId}/locations", + "path": "v1alpha/apps/{appsId}/locations", + "id": "appengine.apps.locations.list", + "description": "Lists information about the supported locations for this service." + } + } + }, + "domainMappings": { + "methods": { + "delete": { + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true, + "location": "path" + }, + "domainMappingsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.delete", + "path": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "description": "Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "DELETE" + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "domainMappingsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "noManagedCertificate": { + "description": "Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. Only applicable if ssl_settings.certificate_id is specified in the update mask.", + "type": "boolean", + "location": "query" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.patch", + "path": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "request": { + "$ref": "DomainMapping" + }, + "description": "Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource." + }, + "get": { + "response": { + "$ref": "DomainMapping" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true, + "location": "path" + }, + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.get", + "path": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "description": "Gets the specified domain mapping." + }, + "list": { + "path": "v1alpha/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.list", + "description": "Lists the domain mappings on an application.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListDomainMappingsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + }, + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1alpha/apps/{appsId}/domainMappings" + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + }, + "noManagedCertificate": { + "type": "boolean", + "location": "query", + "description": "Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manaually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated." + } + }, + "flatPath": "v1alpha/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.create", + "path": "v1alpha/apps/{appsId}/domainMappings", + "request": { + "$ref": "DomainMapping" + }, + "description": "Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains." + } + } + }, + "authorizedCertificates": { + "methods": { + "delete": { + "description": "Deletes the specified SSL certificate.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "DELETE", + "parameters": { + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.delete", + "path": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "patch": { + "description": "Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated.", + "request": { + "$ref": "AuthorizedCertificate" + }, + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "PATCH", + "parameters": { + "authorizedCertificatesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.patch", + "path": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "get": { + "description": "Gets the specified SSL certificate.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "response": { + "$ref": "AuthorizedCertificate" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true, + "location": "path" + }, + "view": { + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the GET response.", + "type": "string" + } + }, + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "path": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.get" + }, + "list": { + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates", + "path": "v1alpha/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.list", + "description": "Lists all SSL certificates the user is authorized to administer.", + "httpMethod": "GET", + "response": { + "$ref": "ListAuthorizedCertificatesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "view": { + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the LIST response.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "create": { + "id": "appengine.apps.authorizedCertificates.create", + "path": "v1alpha/apps/{appsId}/authorizedCertificates", + "description": "Uploads the specified SSL certificate.", + "request": { + "$ref": "AuthorizedCertificate" + }, + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates" + } + } + }, + "authorizedDomains": { + "methods": { + "list": { + "description": "Lists all domains the user is authorized to administer.", + "httpMethod": "GET", + "response": { + "$ref": "ListAuthorizedDomainsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + }, + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1alpha/apps/{appsId}/authorizedDomains", + "path": "v1alpha/apps/{appsId}/authorizedDomains", + "id": "appengine.apps.authorizedDomains.list" + } + } + } + } + } + } +} diff --git a/etc/api/appengine/v1beta/appengine-api.json b/etc/api/appengine/v1beta/appengine-api.json new file mode 100644 index 0000000000..97e2decb93 --- /dev/null +++ b/etc/api/appengine/v1beta/appengine-api.json @@ -0,0 +1,3558 @@ +{ + "resources": { + "apps": { + "methods": { + "repair": { + "request": { + "$ref": "RepairApplicationRequest" + }, + "description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the application to repair. Example: apps/myapp", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}:repair", + "id": "appengine.apps.repair", + "path": "v1beta/apps/{appsId}:repair" + }, + "patch": { + "request": { + "$ref": "Application" + }, + "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain - Google authentication domain for controlling user access to the application.\ndefault_cookie_expiration - Cookie expiration policy for the application.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}", + "id": "appengine.apps.patch", + "path": "v1beta/apps/{appsId}" + }, + "get": { + "flatPath": "v1beta/apps/{appsId}", + "id": "appengine.apps.get", + "path": "v1beta/apps/{appsId}", + "description": "Gets information about an application.", + "response": { + "$ref": "Application" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the Application resource to get. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "create": { + "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).", + "request": { + "$ref": "Application" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps", + "id": "appengine.apps.create", + "path": "v1beta/apps" + } + }, + "resources": { + "locations": { + "methods": { + "get": { + "path": "v1beta/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.get", + "description": "Get information about a location.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "locationsId" + ], + "response": { + "$ref": "Location" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Resource name for the location.", + "type": "string", + "required": true + }, + "locationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/locations/{locationsId}" + }, + "list": { + "flatPath": "v1beta/apps/{appsId}/locations", + "id": "appengine.apps.locations.list", + "path": "v1beta/apps/{appsId}/locations", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + } + } + } + }, + "authorizedCertificates": { + "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true, + "location": "path" + }, + "authorizedCertificatesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.delete", + "path": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "description": "Deletes the specified SSL certificate." + }, + "patch": { + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "PATCH", + "parameters": { + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "updateMask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields.", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.patch", + "path": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "description": "Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated.", + "request": { + "$ref": "AuthorizedCertificate" + } + }, + "get": { + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "GET", + "parameters": { + "view": { + "description": "Controls the set of fields returned in the GET response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ] + }, + "authorizedCertificatesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.get", + "path": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "description": "Gets the specified SSL certificate." + }, + "list": { + "response": { + "$ref": "ListAuthorizedCertificatesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "view": { + "description": "Controls the set of fields returned in the LIST response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ] + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.list", + "path": "v1beta/apps/{appsId}/authorizedCertificates", + "description": "Lists all SSL certificates the user is authorized to administer." + }, + "create": { + "description": "Uploads the specified SSL certificate.", + "request": { + "$ref": "AuthorizedCertificate" + }, + "httpMethod": "POST", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates", + "path": "v1beta/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.create" + } + } + }, + "services": { + "methods": { + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "migrateTraffic": { + "location": "query", + "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", + "type": "boolean" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.patch", + "path": "v1beta/apps/{appsId}/services/{servicesId}", + "request": { + "$ref": "Service" + }, + "description": "Updates the configuration of the specified service." + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "parameters": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}", + "path": "v1beta/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.get", + "description": "Gets the current configuration of the specified service." + }, + "list": { + "description": "Lists all the services in the application.", + "response": { + "$ref": "ListServicesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + } + }, + "flatPath": "v1beta/apps/{appsId}/services", + "id": "appengine.apps.services.list", + "path": "v1beta/apps/{appsId}/services" + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true + }, + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}", + "path": "v1beta/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.delete", + "description": "Deletes the specified service and all enclosed versions." + } + }, + "resources": { + "versions": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.delete", + "description": "Deletes an existing Version resource." + }, + "patch": { + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.patch", + "request": { + "$ref": "Version" + }, + "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.\nautomatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.\nautomatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.\nautomatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment.", + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Version" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the Get response.", + "type": "string", + "location": "query" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.get", + "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource." + }, + "list": { + "response": { + "$ref": "ListVersionsResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default.", + "type": "string", + "required": true + }, + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the List response.", + "type": "string" + }, + "servicesId": { + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.list", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions", + "description": "Lists the versions of a service." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId", + "servicesId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.create", + "request": { + "$ref": "Version" + }, + "description": "Deploys code and resource files to a new version." + } + }, + "resources": { + "instances": { + "methods": { + "get": { + "response": { + "$ref": "Instance" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "GET", + "parameters": { + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.get", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "description": "Gets instance information." + }, + "list": { + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "id": "appengine.apps.services.versions.instances.list", + "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "response": { + "$ref": "ListInstancesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "versionsId": { + "location": "path", + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "location": "path", + "description": "Part of `parent`. See documentation of `appsId`.", + "type": "string", + "required": true + } + } + }, + "debug": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "POST", + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "id": "appengine.apps.services.versions.instances.debug", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment.", + "request": { + "$ref": "DebugInstanceRequest" + } + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.delete", + "description": "Stops a running instance." + } + } + } + } + } + } + }, + "authorizedDomains": { + "methods": { + "list": { + "flatPath": "v1beta/apps/{appsId}/authorizedDomains", + "id": "appengine.apps.authorizedDomains.list", + "path": "v1beta/apps/{appsId}/authorizedDomains", + "description": "Lists all domains the user is authorized to administer.", + "response": { + "$ref": "ListAuthorizedDomainsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "operationsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "operationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation resource.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/operations/{operationsId}", + "id": "appengine.apps.operations.get", + "path": "v1beta/apps/{appsId}/operations/{operationsId}" + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + }, + "flatPath": "v1beta/apps/{appsId}/operations", + "id": "appengine.apps.operations.list", + "path": "v1beta/apps/{appsId}/operations" + } + } + }, + "domainMappings": { + "methods": { + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "domainMappingsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.delete", + "path": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "description": "Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource." + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "path": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.patch", + "description": "Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource.", + "request": { + "$ref": "DomainMapping" + } + }, + "get": { + "description": "Gets the specified domain mapping.", + "httpMethod": "GET", + "response": { + "$ref": "DomainMapping" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com.", + "type": "string", + "required": true + }, + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "path": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.get" + }, + "list": { + "description": "Lists the domain mappings on an application.", + "response": { + "$ref": "ListDomainMappingsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.list", + "path": "v1beta/apps/{appsId}/domainMappings" + }, + "create": { + "description": "Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains.", + "request": { + "$ref": "DomainMapping" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.create", + "path": "v1beta/apps/{appsId}/domainMappings" + } + } + }, + "firewall": { + "resources": { + "ingressRules": { + "methods": { + "batchUpdate": { + "description": "Replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules.If the final rule does not match traffic with the '*' wildcard IP range, then an \"allow all\" rule is explicitly added to the end of the list.", + "request": { + "$ref": "BatchUpdateIngressRulesRequest" + }, + "response": { + "$ref": "BatchUpdateIngressRulesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules:batchUpdate", + "id": "appengine.apps.firewall.ingressRules.batchUpdate", + "path": "v1beta/apps/{appsId}/firewall/ingressRules:batchUpdate" + }, + "delete": { + "parameterOrder": [ + "appsId", + "ingressRulesId" + ], + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "ingressRulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "id": "appengine.apps.firewall.ingressRules.delete", + "path": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "description": "Deletes the specified firewall rule." + }, + "list": { + "description": "Lists the firewall rules of an application.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListIngressRulesResponse" + }, + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "matchingAddress": { + "location": "query", + "description": "A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules", + "path": "v1beta/apps/{appsId}/firewall/ingressRules", + "id": "appengine.apps.firewall.ingressRules.list" + }, + "create": { + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules", + "id": "appengine.apps.firewall.ingressRules.create", + "path": "v1beta/apps/{appsId}/firewall/ingressRules", + "request": { + "$ref": "FirewallRule" + }, + "description": "Creates a firewall rule for the application.", + "response": { + "$ref": "FirewallRule" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules.", + "type": "string", + "required": true + } + } + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "FirewallRule" + }, + "parameterOrder": [ + "appsId", + "ingressRulesId" + ], + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100.", + "type": "string", + "required": true + }, + "ingressRulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "path": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "id": "appengine.apps.firewall.ingressRules.get", + "description": "Gets the specified firewall rule." + }, + "patch": { + "id": "appengine.apps.firewall.ingressRules.patch", + "path": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "request": { + "$ref": "FirewallRule" + }, + "description": "Updates the specified firewall rule.", + "response": { + "$ref": "FirewallRule" + }, + "parameterOrder": [ + "appsId", + "ingressRulesId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100.", + "type": "string", + "required": true + }, + "ingressRulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}" + } + } + } + } + } + } + } + }, + "parameters": { + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + } + }, + "schemas": { + "ListServicesResponse": { + "description": "Response message for Services.ListServices.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "services": { + "description": "The services belonging to the requested application.", + "items": { + "$ref": "Service" + }, + "type": "array" + } + }, + "id": "ListServicesResponse" + }, + "ListIngressRulesResponse": { + "description": "Response message for Firewall.ListIngressRules.", + "type": "object", + "properties": { + "ingressRules": { + "description": "The ingress FirewallRules for this application.", + "items": { + "$ref": "FirewallRule" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + } + }, + "id": "ListIngressRulesResponse" + }, + "Resources": { + "description": "Machine resources for a version.", + "type": "object", + "properties": { + "memoryGb": { + "format": "double", + "description": "Memory (GB) needed.", + "type": "number" + }, + "cpu": { + "format": "double", + "description": "Number of CPU cores needed.", + "type": "number" + }, + "volumes": { + "description": "User specified volumes.", + "items": { + "$ref": "Volume" + }, + "type": "array" + }, + "diskGb": { + "format": "double", + "description": "Disk size (GB) needed.", + "type": "number" + } + }, + "id": "Resources" + }, + "Deployment": { + "description": "Code and application artifacts used to deploy a version to App Engine.", + "type": "object", + "properties": { + "build": { + "$ref": "BuildInfo", + "description": "Google Cloud Container Builder build information." + }, + "files": { + "description": "Manifest of the files stored in Google Cloud Storage that are included as part of this version. All files must be readable using the credentials supplied with this call.", + "type": "object", + "additionalProperties": { + "$ref": "FileInfo" + } + }, + "zip": { + "description": "The zip file for this deployment, if this is a zip deployment.", + "$ref": "ZipInfo" + }, + "container": { + "$ref": "ContainerInfo", + "description": "The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment." + } + }, + "id": "Deployment" + }, + "Volume": { + "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "sizeGb": { + "format": "double", + "description": "Volume size in gigabytes.", + "type": "number" + }, + "name": { + "description": "Unique name for the volume.", + "type": "string" + }, + "volumeType": { + "description": "Underlying volume type, e.g. 'tmpfs'.", + "type": "string" + } + }, + "id": "Volume" + }, + "BatchUpdateIngressRulesResponse": { + "properties": { + "ingressRules": { + "description": "The full list of ingress FirewallRules for this application.", + "items": { + "$ref": "FirewallRule" + }, + "type": "array" + } + }, + "id": "BatchUpdateIngressRulesResponse", + "description": "Response message for Firewall.UpdateAllIngressRules.", + "type": "object" + }, + "ManagedCertificate": { + "properties": { + "lastRenewalTime": { + "format": "google-datetime", + "description": "Time at which the certificate was last renewed. The renewal process is fully managed. Certificate renewal will automatically occur before the certificate expires. Renewal errors can be tracked via ManagementStatus.@OutputOnly", + "type": "string" + }, + "status": { + "description": "Status of certificate management. Refers to the most recent certificate acquisition or renewal attempt.@OutputOnly", + "type": "string", + "enumDescriptions": [ + "", + "Certificate was successfully obtained and inserted into the serving system.", + "Certificate is under active attempts to acquire or renew.", + "Most recent renewal failed due to an invalid DNS setup and will be retried. Renewal attempts will continue to fail until the certificate domain's DNS configuration is fixed. The last successfully provisioned certificate may still be serving.", + "All renewal attempts have been exhausted, likely due to an invalid DNS setup." + ], + "enum": [ + "MANAGEMENT_STATUS_UNSPECIFIED", + "OK", + "PENDING", + "FAILED_RETRYING_NOT_VISIBLE", + "FAILED_PERMANENT" + ] + } + }, + "id": "ManagedCertificate", + "description": "A certificate managed by App Engine.", + "type": "object" + }, + "ListInstancesResponse": { + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "instances": { + "description": "The instances belonging to the requested version.", + "items": { + "$ref": "Instance" + }, + "type": "array" + } + }, + "id": "ListInstancesResponse", + "description": "Response message for Instances.ListInstances.", + "type": "object" + }, + "ListDomainMappingsResponse": { + "description": "Response message for DomainMappings.ListDomainMappings.", + "type": "object", + "properties": { + "domainMappings": { + "description": "The domain mappings for the application.", + "items": { + "$ref": "DomainMapping" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + } + }, + "id": "ListDomainMappingsResponse" + }, + "OperationMetadataV1Alpha": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Alpha" + }, + "UrlDispatchRule": { + "properties": { + "path": { + "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path.The sum of the lengths of the domain and path may not exceed 100 characters.", + "type": "string" + }, + "service": { + "description": "Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default.", + "type": "string" + }, + "domain": { + "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", + "type": "string" + } + }, + "id": "UrlDispatchRule", + "description": "Rules to match an HTTP request and dispatch that request to a service.", + "type": "object" + }, + "ListVersionsResponse": { + "description": "Response message for Versions.ListVersions.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "versions": { + "description": "The versions belonging to the requested service.", + "items": { + "$ref": "Version" + }, + "type": "array" + } + }, + "id": "ListVersionsResponse" + }, + "ListAuthorizedDomainsResponse": { + "description": "Response message for AuthorizedDomains.ListAuthorizedDomains.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "domains": { + "description": "The authorized domains belonging to the user.", + "items": { + "$ref": "AuthorizedDomain" + }, + "type": "array" + } + }, + "id": "ListAuthorizedDomainsResponse" + }, + "ApiEndpointHandler": { + "description": "Uses Google Cloud Endpoints to handle requests.", + "type": "object", + "properties": { + "scriptPath": { + "description": "Path to the script from the application root directory.", + "type": "string" + } + }, + "id": "ApiEndpointHandler" + }, + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object" + }, + "DomainMapping": { + "properties": { + "resourceRecords": { + "description": "The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the application via this domain mapping.@OutputOnly", + "items": { + "$ref": "ResourceRecord" + }, + "type": "array" + }, + "id": { + "description": "Relative name of the domain serving the application. Example: example.com.", + "type": "string" + }, + "sslSettings": { + "$ref": "SslSettings", + "description": "SSL configuration for this domain. If unconfigured, this domain will not serve with SSL." + }, + "name": { + "description": "Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly", + "type": "string" + } + }, + "id": "DomainMapping", + "description": "A domain serving an App Engine application.", + "type": "object" + }, + "AutomaticScaling": { + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", + "type": "object", + "properties": { + "coolDownPeriod": { + "format": "google-duration", + "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", + "type": "string" + }, + "maxConcurrentRequests": { + "format": "int32", + "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", + "type": "integer" + }, + "maxPendingLatency": { + "format": "google-duration", + "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", + "type": "string" + }, + "cpuUtilization": { + "description": "Target scaling by CPU usage.", + "$ref": "CpuUtilization" + }, + "diskUtilization": { + "$ref": "DiskUtilization", + "description": "Target scaling by disk usage." + }, + "minPendingLatency": { + "format": "google-duration", + "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", + "type": "string" + }, + "requestUtilization": { + "$ref": "RequestUtilization", + "description": "Target scaling by request utilization." + }, + "maxIdleInstances": { + "format": "int32", + "description": "Maximum number of idle instances that should be maintained for this version.", + "type": "integer" + }, + "standardSchedulerSettings": { + "description": "Scheduler settings for standard environment.", + "$ref": "StandardSchedulerSettings" + }, + "minIdleInstances": { + "format": "int32", + "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a service.", + "type": "integer" + }, + "maxTotalInstances": { + "format": "int32", + "description": "Maximum number of instances that should be started to handle requests.", + "type": "integer" + }, + "minTotalInstances": { + "format": "int32", + "description": "Minimum number of instances that should be maintained for this version.", + "type": "integer" + }, + "networkUtilization": { + "description": "Target scaling by network usage.", + "$ref": "NetworkUtilization" + } + }, + "id": "AutomaticScaling" + }, + "ZipInfo": { + "description": "The zip file information for a zip deployment.", + "type": "object", + "properties": { + "sourceUrl": { + "description": "URL of the zip file to deploy from. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "type": "string" + }, + "filesCount": { + "format": "int32", + "description": "An estimate of the number of files in a zip for a zip deployment. If set, must be greater than or equal to the actual number of files. Used for optimizing performance; if not provided, deployment may be slow.", + "type": "integer" + } + }, + "id": "ZipInfo" + }, + "AuthorizedCertificate": { + "properties": { + "visibleDomainMappings": { + "description": "The full paths to user visible Domain Mapping resources that have this certificate mapped. Example: apps/myapp/domainMappings/example.com.This may not represent the full list of mapped domain mappings if the user does not have VIEWER permissions on all of the applications that have this certificate mapped. See domain_mappings_count for a complete count.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "expireTime": { + "format": "google-datetime", + "description": "The time when this certificate expires. To update the renewal time on this certificate, upload an SSL certificate with a different expiration time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly", + "type": "string" + }, + "name": { + "description": "Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly", + "type": "string" + }, + "domainMappingsCount": { + "format": "int32", + "description": "Aggregate count of the domain mappings with this certificate mapped. This count includes domain mappings on applications for which the user does not have VIEWER permissions.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly", + "type": "integer" + }, + "domainNames": { + "description": "Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 12345.@OutputOnly", + "type": "string" + }, + "displayName": { + "description": "The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate.", + "type": "string" + }, + "certificateRawData": { + "description": "The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority.", + "$ref": "CertificateRawData" + }, + "managedCertificate": { + "description": "Only applicable if this certificate is managed by App Engine. Managed certificates are tied to the lifecycle of a DomainMapping and cannot be updated or deleted via the AuthorizedCertificates API. If this certificate is manually administered by the user, this field will be empty.@OutputOnly", + "$ref": "ManagedCertificate" + } + }, + "id": "AuthorizedCertificate", + "description": "An SSL certificate that a user has been authorized to administer. A user is authorized to administer any certificate that applies to one of their authorized domains.", + "type": "object" + }, + "ResourceRecord": { + "description": "A DNS resource record.", + "type": "object", + "properties": { + "name": { + "description": "Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'.", + "type": "string" + }, + "type": { + "enum": [ + "A", + "AAAA", + "CNAME" + ], + "description": "Resource record type. Example: AAAA.", + "type": "string", + "enumDescriptions": [ + "An A resource record. Data is an IPv4 address.", + "An AAAA resource record. Data is an IPv6 address.", + "A CNAME resource record. Data is a domain name to be aliased." + ] + }, + "rrdata": { + "description": "Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1).", + "type": "string" + } + }, + "id": "ResourceRecord" + }, + "Library": { + "description": "Third-party Python runtime library that is required by the application.", + "type": "object", + "properties": { + "version": { + "description": "Version of the library to select, or \"latest\".", + "type": "string" + }, + "name": { + "description": "Name of the library. Example: \"django\".", + "type": "string" + } + }, + "id": "Library" + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + } + }, + "id": "ListLocationsResponse" + }, + "ContainerInfo": { + "description": "Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment.", + "type": "object", + "properties": { + "image": { + "description": "URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: \"gcr.io/my-project/image:tag\" or \"gcr.io/my-project/image@digest\"", + "type": "string" + } + }, + "id": "ContainerInfo" + }, + "RequestUtilization": { + "description": "Target scaling by request utilization. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetConcurrentRequests": { + "format": "int32", + "description": "Target number of concurrent requests.", + "type": "integer" + }, + "targetRequestCountPerSecond": { + "format": "int32", + "description": "Target requests per second.", + "type": "integer" + } + }, + "id": "RequestUtilization" + }, + "EndpointsApiService": { + "description": "Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The Endpoints API Service provides tooling for serving Open API and gRPC endpoints via an NGINX proxy.The fields here refer to the name and configuration id of a \"service\" resource in the Service Management API (https://cloud.google.com/service-management/overview).", + "type": "object", + "properties": { + "configId": { + "description": "Endpoints service configuration id as specified by the Service Management API. For example \"2016-09-19r1\"", + "type": "string" + }, + "name": { + "description": "Endpoints service name which is the name of the \"service\" resource in the Service Management API. For example \"myapi.endpoints.myproject.cloud.goog\"", + "type": "string" + } + }, + "id": "EndpointsApiService" + }, + "UrlMap": { + "description": "URL pattern and description of how the URL should be handled. App Engine can handle URLs by executing application code or by serving static files uploaded with the version, such as images, CSS, or JavaScript.", + "type": "object", + "properties": { + "script": { + "description": "Executes a script to handle the request that matches this URL pattern.", + "$ref": "ScriptHandler" + }, + "urlRegex": { + "description": "URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path.", + "type": "string" + }, + "login": { + "enumDescriptions": [ + "Not specified. LOGIN_OPTIONAL is assumed.", + "Does not require that the user is signed in.", + "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", + "If the user has signed in, the handler proceeds normally. Otherwise, the auth_fail_action is taken." + ], + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ], + "description": "Level of login required to access this resource.", + "type": "string" + }, + "apiEndpoint": { + "$ref": "ApiEndpointHandler", + "description": "Uses API Endpoints to handle requests." + }, + "staticFiles": { + "$ref": "StaticFilesHandler", + "description": "Returns the contents of a file, such as an image, as the response." + }, + "redirectHttpResponseCode": { + "enum": [ + "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", + "REDIRECT_HTTP_RESPONSE_CODE_301", + "REDIRECT_HTTP_RESPONSE_CODE_302", + "REDIRECT_HTTP_RESPONSE_CODE_303", + "REDIRECT_HTTP_RESPONSE_CODE_307" + ], + "description": "30x code to use when performing redirects for the secure field. Defaults to 302.", + "type": "string", + "enumDescriptions": [ + "Not specified. 302 is assumed.", + "301 Moved Permanently code.", + "302 Moved Temporarily code.", + "303 See Other code.", + "307 Temporary Redirect code." + ] + }, + "securityLevel": { + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", + "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", + "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." + ], + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ] + }, + "authFailAction": { + "enum": [ + "AUTH_FAIL_ACTION_UNSPECIFIED", + "AUTH_FAIL_ACTION_REDIRECT", + "AUTH_FAIL_ACTION_UNAUTHORIZED" + ], + "description": "Action to take when users access resources that require authentication. Defaults to redirect.", + "type": "string", + "enumDescriptions": [ + "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", + "Redirects user to \"accounts.google.com\". The user is redirected back to the application URL after signing in or creating an account.", + "Rejects request with a 401 HTTP status code and an error message." + ] + } + }, + "id": "UrlMap" + }, + "ApiConfigHandler": { + "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", + "type": "object", + "properties": { + "login": { + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ], + "description": "Level of login required to access this resource. Defaults to optional.", + "type": "string", + "enumDescriptions": [ + "Not specified. LOGIN_OPTIONAL is assumed.", + "Does not require that the user is signed in.", + "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", + "If the user has signed in, the handler proceeds normally. Otherwise, the auth_fail_action is taken." + ] + }, + "url": { + "description": "URL to serve the endpoint at.", + "type": "string" + }, + "securityLevel": { + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ], + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", + "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", + "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." + ] + }, + "authFailAction": { + "enumDescriptions": [ + "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", + "Redirects user to \"accounts.google.com\". The user is redirected back to the application URL after signing in or creating an account.", + "Rejects request with a 401 HTTP status code and an error message." + ], + "enum": [ + "AUTH_FAIL_ACTION_UNSPECIFIED", + "AUTH_FAIL_ACTION_REDIRECT", + "AUTH_FAIL_ACTION_UNAUTHORIZED" + ], + "description": "Action to take when users access resources that require authentication. Defaults to redirect.", + "type": "string" + }, + "script": { + "description": "Path to the script from the application root directory.", + "type": "string" + } + }, + "id": "ApiConfigHandler" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object", + "properties": { + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" + } + }, + "id": "Operation" + }, + "StaticFilesHandler": { + "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.", + "type": "object", + "properties": { + "expiration": { + "format": "google-duration", + "description": "Time a static file served by this handler should be cached by web proxies and browsers.", + "type": "string" + }, + "applicationReadable": { + "description": "Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.", + "type": "boolean" + }, + "httpHeaders": { + "additionalProperties": { + "type": "string" + }, + "description": "HTTP headers to use for all responses from these URLs.", + "type": "object" + }, + "uploadPathRegex": { + "description": "Regular expression that matches the file paths for all files that should be referenced by this handler.", + "type": "string" + }, + "path": { + "description": "Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern.", + "type": "string" + }, + "mimeType": { + "description": "MIME type used to serve all files served by this handler.Defaults to file-specific MIME types, which are derived from each file's filename extension.", + "type": "string" + }, + "requireMatchingFile": { + "description": "Whether this handler should match the request if the file referenced by the handler does not exist.", + "type": "boolean" + } + }, + "id": "StaticFilesHandler" + }, + "DiskUtilization": { + "description": "Target scaling by disk usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetWriteBytesPerSecond": { + "format": "int32", + "description": "Target bytes written per second.", + "type": "integer" + }, + "targetReadOpsPerSecond": { + "format": "int32", + "description": "Target ops read per seconds.", + "type": "integer" + }, + "targetReadBytesPerSecond": { + "format": "int32", + "description": "Target bytes read per second.", + "type": "integer" + }, + "targetWriteOpsPerSecond": { + "format": "int32", + "description": "Target ops written per second.", + "type": "integer" + } + }, + "id": "DiskUtilization" + }, + "BasicScaling": { + "description": "A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", + "type": "object", + "properties": { + "idleTimeout": { + "format": "google-duration", + "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", + "type": "string" + }, + "maxInstances": { + "format": "int32", + "description": "Maximum number of instances to create for this version.", + "type": "integer" + } + }, + "id": "BasicScaling" + }, + "CpuUtilization": { + "description": "Target scaling by CPU usage.", + "type": "object", + "properties": { + "aggregationWindowLength": { + "format": "google-duration", + "description": "Period of time over which CPU utilization is calculated.", + "type": "string" + }, + "targetUtilization": { + "format": "double", + "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", + "type": "number" + } + }, + "id": "CpuUtilization" + }, + "IdentityAwareProxy": { + "description": "Identity-Aware Proxy", + "type": "object", + "properties": { + "enabled": { + "description": "Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields must be non-empty.", + "type": "boolean" + }, + "oauth2ClientSecret": { + "description": "OAuth2 client secret to use for the authentication flow.For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2_client_secret_sha256 field.@InputOnly", + "type": "string" + }, + "oauth2ClientId": { + "description": "OAuth2 client ID to use for the authentication flow.", + "type": "string" + }, + "oauth2ClientSecretSha256": { + "description": "Hex-encoded SHA-256 hash of the client secret.@OutputOnly", + "type": "string" + } + }, + "id": "IdentityAwareProxy" + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + } + }, + "id": "Status" + }, + "ManualScaling": { + "properties": { + "instances": { + "format": "int32", + "description": "Number of instances to assign to the service at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", + "type": "integer" + } + }, + "id": "ManualScaling", + "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", + "type": "object" + }, + "LocationMetadata": { + "properties": { + "standardEnvironmentAvailable": { + "description": "App Engine Standard Environment is available in the given location.@OutputOnly", + "type": "boolean" + }, + "flexibleEnvironmentAvailable": { + "description": "App Engine Flexible Environment is available in the given location.@OutputOnly", + "type": "boolean" + } + }, + "id": "LocationMetadata", + "description": "Metadata for the given google.cloud.location.Location.", + "type": "object" + }, + "Service": { + "description": "A Service resource is a logical component of an application that can share state and communicate in a secure fashion with other services. For example, an application that handles customer requests might include separate services to handle tasks such as backend data analysis or API requests from mobile devices. Each service has a collection of versions that define a specific set of code used to implement the functionality of that service.", + "type": "object", + "properties": { + "name": { + "description": "Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "split": { + "description": "Mapping that defines fractional HTTP traffic diversion to different versions within the service.", + "$ref": "TrafficSplit" + }, + "id": { + "description": "Relative name of the service within the application. Example: default.@OutputOnly", + "type": "string" + } + }, + "id": "Service" + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + } + }, + "id": "ListOperationsResponse" + }, + "FirewallRule": { + "description": "A single firewall rule that is evaluated against incoming traffic and provides an action to take on matched requests.", + "type": "object", + "properties": { + "priority": { + "format": "int32", + "description": "A positive integer between 1, Int32.MaxValue-1 that defines the order of rule evaluation. Rules with the lowest priority are evaluated first.A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic when no previous rule matches. Only the action of this rule can be modified by the user.", + "type": "integer" + }, + "action": { + "description": "The action to take on matched requests.", + "type": "string", + "enumDescriptions": [ + "", + "Matching requests are allowed.", + "Matching requests are denied." + ], + "enum": [ + "UNSPECIFIED_ACTION", + "ALLOW", + "DENY" + ] + }, + "description": { + "description": "An optional string description of this rule. This field has a maximum length of 100 characters.", + "type": "string" + }, + "sourceRange": { + "description": "IP address or range, defined using CIDR notation, of requests that this rule applies to. You can use the wildcard character \"*\" to match all IPs equivalent to \"0/0\" and \"::/0\" together. Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or 2001:0db8:0000:0042:0000:8a2e:0370:7334.\u003cp\u003eTruncation will be silently performed on addresses which are not properly truncated. For example, 1.2.3.4/24 is accepted as the same address as 1.2.3.0/24. Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as 2001:db8::/32.", + "type": "string" + } + }, + "id": "FirewallRule" + }, + "OperationMetadata": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1beta4.Version.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", + "type": "string" + }, + "operationType": { + "description": "Type of this operation. Deprecated, use method field instead. Example: \"create_version\".@OutputOnly", + "type": "string" + }, + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadata" + }, + "ListAuthorizedCertificatesResponse": { + "description": "Response message for AuthorizedCertificates.ListAuthorizedCertificates.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "certificates": { + "description": "The SSL certificates the user is authorized to administer.", + "items": { + "$ref": "AuthorizedCertificate" + }, + "type": "array" + } + }, + "id": "ListAuthorizedCertificatesResponse" + }, + "FeatureSettings": { + "properties": { + "splitHealthChecks": { + "description": "Boolean value indicating if split health checks should be used instead of the legacy health checks. At an app.yaml level, this means defaulting to 'readiness_check' and 'liveness_check' values instead of 'health_check' ones. Once the legacy 'health_check' behavior is deprecated, and this value is always true, this setting can be removed.", + "type": "boolean" + } + }, + "id": "FeatureSettings", + "description": "The feature specific settings to be used in the application. These define behaviors that are user configurable.", + "type": "object" + }, + "ErrorHandler": { + "properties": { + "mimeType": { + "description": "MIME type of file. Defaults to text/html.", + "type": "string" + }, + "errorCode": { + "enumDescriptions": [ + "Not specified. ERROR_CODE_DEFAULT is assumed.", + "All other error types.", + "Application has exceeded a resource quota.", + "Client blocked by the application's Denial of Service protection configuration.", + "Deadline reached before the application responds." + ], + "enum": [ + "ERROR_CODE_UNSPECIFIED", + "ERROR_CODE_DEFAULT", + "ERROR_CODE_OVER_QUOTA", + "ERROR_CODE_DOS_API_DENIAL", + "ERROR_CODE_TIMEOUT" + ], + "description": "Error condition this handler applies to.", + "type": "string" + }, + "staticFile": { + "description": "Static file content to be served for this error.", + "type": "string" + } + }, + "id": "ErrorHandler", + "description": "Custom static error page to be served when an error occurs.", + "type": "object" + }, + "SslSettings": { + "description": "SSL configuration for a DomainMapping resource.", + "type": "object", + "properties": { + "pendingManagedCertificateId": { + "description": "ID of the managed AuthorizedCertificate resource currently being provisioned, if applicable. Until the new managed certificate has been successfully provisioned, the previous SSL state will be preserved. Once the provisioning process completes, the certificate_id field will reflect the new managed certificate and this field will be left empty. To remove SSL support while there is still a pending managed certificate, clear the certificate_id field with an UpdateDomainMappingRequest.@OutputOnly", + "type": "string" + }, + "sslManagementType": { + "enumDescriptions": [ + "SSL support for this domain is configured automatically. The mapped SSL certificate will be automatically renewed.", + "SSL support for this domain is configured manually by the user. Either the domain has no SSL support or a user-obtained SSL certificate has been explictly mapped to this domain." + ], + "enum": [ + "AUTOMATIC", + "MANUAL" + ], + "description": "SSL management type for this domain. If AUTOMATIC, a managed certificate is automatically provisioned. If MANUAL, certificate_id must be manually specified in order to configure SSL for this domain.", + "type": "string" + }, + "certificateId": { + "description": "ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support.By default, a managed certificate is automatically created for every domain mapping. To omit SSL support or to configure SSL manually, specify SslManagementType.MANUAL on a CREATE or UPDATE request. You must be authorized to administer the AuthorizedCertificate resource to manually map it to a DomainMapping resource. Example: 12345.", + "type": "string" + } + }, + "id": "SslSettings" + }, + "OperationMetadataV1": { + "properties": { + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "Application": { + "description": "An Application resource contains the top-level configuration of an App Engine application. Next tag: 20", + "type": "object", + "properties": { + "servingStatus": { + "description": "Serving status of this application.", + "type": "string", + "enumDescriptions": [ + "Serving status is unspecified.", + "Application is serving.", + "Application has been disabled by the user.", + "Application has been disabled by the system." + ], + "enum": [ + "UNSPECIFIED", + "SERVING", + "USER_DISABLED", + "SYSTEM_DISABLED" + ] + }, + "defaultHostname": { + "description": "Hostname used to reach this application, as resolved by App Engine.@OutputOnly", + "type": "string" + }, + "featureSettings": { + "description": "The feature specific settings to be used in the application.", + "$ref": "FeatureSettings" + }, + "iap": { + "$ref": "IdentityAwareProxy" + }, + "authDomain": { + "description": "Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account.", + "type": "string" + }, + "codeBucket": { + "description": "Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly", + "type": "string" + }, + "defaultBucket": { + "description": "Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly", + "type": "string" + }, + "dispatchRules": { + "description": "HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 dispatch rules can be supported.@OutputOnly", + "items": { + "$ref": "UrlDispatchRule" + }, + "type": "array" + }, + "gcrDomain": { + "description": "The Google Container Registry domain used for storing managed build docker images for this application.", + "type": "string" + }, + "name": { + "description": "Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly", + "type": "string" + }, + "defaultCookieExpiration": { + "format": "google-duration", + "description": "Cookie expiration policy for this application.", + "type": "string" + }, + "id": { + "description": "Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp.", + "type": "string" + }, + "locationId": { + "description": "Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US", + "type": "string" + } + }, + "id": "Application" + }, + "Network": { + "description": "Extra network settings. Only applicable for App Engine flexible environment versions", + "type": "object", + "properties": { + "subnetworkName": { + "description": "Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network.\nIf the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range.\nIf the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network.\nIf the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the App Engine flexible environment application.", + "type": "string" + }, + "instanceTag": { + "description": "Tag to apply to the VM instance during creation. Only applicable for for App Engine flexible environment versions.", + "type": "string" + }, + "forwardedPorts": { + "description": "List of ports, or port pairs, to forward from the virtual machine to the application container. Only applicable for App Engine flexible environment versions.", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Google Compute Engine network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.", + "type": "string" + } + }, + "id": "Network" + }, + "Instance": { + "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", + "type": "object", + "properties": { + "vmDebugEnabled": { + "description": "Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "boolean" + }, + "requests": { + "format": "int32", + "description": "Number of requests since this instance was started.@OutputOnly", + "type": "integer" + }, + "appEngineRelease": { + "description": "App Engine release this instance is running on.@OutputOnly", + "type": "string" + }, + "vmName": { + "description": "Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "vmId": { + "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "qps": { + "format": "float", + "description": "Average queries per second (QPS) over the last minute.@OutputOnly", + "type": "number" + }, + "name": { + "description": "Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly", + "type": "string" + }, + "vmZoneName": { + "description": "Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "averageLatency": { + "format": "int32", + "description": "Average latency (ms) over the last minute.@OutputOnly", + "type": "integer" + }, + "vmIp": { + "description": "The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "memoryUsage": { + "format": "int64", + "description": "Total memory in use (bytes).@OutputOnly", + "type": "string" + }, + "id": { + "description": "Relative name of the instance within the version. Example: instance-1.@OutputOnly", + "type": "string" + }, + "errors": { + "format": "int32", + "description": "Number of errors since this instance was started.@OutputOnly", + "type": "integer" + }, + "vmStatus": { + "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "availability": { + "enumDescriptions": [ + "", + "", + "" + ], + "enum": [ + "UNSPECIFIED", + "RESIDENT", + "DYNAMIC" + ], + "description": "Availability of the instance.@OutputOnly", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time that this instance was started.@OutputOnly", + "type": "string" + } + }, + "id": "Instance" + }, + "LivenessCheck": { + "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances.", + "type": "object", + "properties": { + "path": { + "description": "The request path.", + "type": "string" + }, + "successThreshold": { + "format": "uint32", + "description": "Number of consecutive successful checks required before considering the VM healthy.", + "type": "integer" + }, + "host": { + "description": "Host header to send when performing a HTTP Liveness check. Example: \"myapp.appspot.com\"", + "type": "string" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", + "type": "string" + }, + "failureThreshold": { + "format": "uint32", + "description": "Number of consecutive failed checks required before considering the VM unhealthy.", + "type": "integer" + }, + "timeout": { + "format": "google-duration", + "description": "Time before the check is considered failed.", + "type": "string" + }, + "initialDelay": { + "format": "google-duration", + "description": "The initial delay before starting to execute the checks.", + "type": "string" + } + }, + "id": "LivenessCheck" + }, + "BatchUpdateIngressRulesRequest": { + "description": "Request message for Firewall.BatchUpdateIngressRules.", + "type": "object", + "properties": { + "ingressRules": { + "description": "A list of FirewallRules to replace the existing set.", + "items": { + "$ref": "FirewallRule" + }, + "type": "array" + } + }, + "id": "BatchUpdateIngressRulesRequest" + }, + "NetworkUtilization": { + "description": "Target scaling by network usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetSentBytesPerSecond": { + "format": "int32", + "description": "Target bytes sent per second.", + "type": "integer" + }, + "targetReceivedBytesPerSecond": { + "format": "int32", + "description": "Target bytes received per second.", + "type": "integer" + }, + "targetSentPacketsPerSecond": { + "format": "int32", + "description": "Target packets sent per second.", + "type": "integer" + }, + "targetReceivedPacketsPerSecond": { + "format": "int32", + "description": "Target packets received per second.", + "type": "integer" + } + }, + "id": "NetworkUtilization" + }, + "Location": { + "properties": { + "locationId": { + "description": "The canonical id for this location. For example: \"us-east1\".", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata. For example the available capacity at the given location.", + "type": "object" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", + "type": "object" + }, + "name": { + "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"", + "type": "string" + } + }, + "id": "Location", + "description": "A resource that represents Google Cloud Platform location.", + "type": "object" + }, + "HealthCheck": { + "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.", + "type": "object", + "properties": { + "host": { + "description": "Host header to send when performing an HTTP health check. Example: \"myapp.appspot.com\"", + "type": "string" + }, + "healthyThreshold": { + "format": "uint32", + "description": "Number of consecutive successful health checks required before receiving traffic.", + "type": "integer" + }, + "restartThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before an instance is restarted.", + "type": "integer" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", + "type": "string" + }, + "timeout": { + "format": "google-duration", + "description": "Time before the health check is considered failed.", + "type": "string" + }, + "unhealthyThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before removing traffic.", + "type": "integer" + }, + "disableHealthCheck": { + "description": "Whether to explicitly disable health checks for this instance.", + "type": "boolean" + } + }, + "id": "HealthCheck" + }, + "ReadinessCheck": { + "description": "Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation.", + "type": "object", + "properties": { + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", + "type": "string" + }, + "timeout": { + "format": "google-duration", + "description": "Time before the check is considered failed.", + "type": "string" + }, + "failureThreshold": { + "format": "uint32", + "description": "Number of consecutive failed checks required before removing traffic.", + "type": "integer" + }, + "appStartTimeout": { + "format": "google-duration", + "description": "A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to serve traffic.", + "type": "string" + }, + "path": { + "description": "The request path.", + "type": "string" + }, + "successThreshold": { + "format": "uint32", + "description": "Number of consecutive successful checks required before receiving traffic.", + "type": "integer" + }, + "host": { + "description": "Host header to send when performing a HTTP Readiness check. Example: \"myapp.appspot.com\"", + "type": "string" + } + }, + "id": "ReadinessCheck" + }, + "DebugInstanceRequest": { + "description": "Request message for Instances.DebugInstance.", + "type": "object", + "properties": { + "sshKey": { + "description": "Public SSH key to add to the instance. Examples:\n[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]\n[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {\"userName\":\"[USERNAME]\",\"expireOn\":\"[EXPIRE_TIME]\"}For more information, see Adding and Removing SSH Keys (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).", + "type": "string" + } + }, + "id": "DebugInstanceRequest" + }, + "StandardSchedulerSettings": { + "description": "Scheduler settings for standard environment.", + "type": "object", + "properties": { + "minInstances": { + "format": "int32", + "description": "Minimum number of instances for an app version. Set to a non-positive value (0 by convention) to disable min_instances configuration.", + "type": "integer" + }, + "targetCpuUtilization": { + "format": "double", + "description": "Target CPU utilization ratio to maintain when scaling.", + "type": "number" + }, + "targetThroughputUtilization": { + "format": "double", + "description": "Target throughput utilization ratio to maintain when scaling", + "type": "number" + }, + "maxInstances": { + "format": "int32", + "description": "Maximum number of instances for an app version. Set to a non-positive value (0 by convention) to disable max_instances configuration.", + "type": "integer" + } + }, + "id": "StandardSchedulerSettings" + }, + "OperationMetadataV1Beta5": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "method": { + "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Beta5" + }, + "Version": { + "description": "A Version resource is a specific set of source code and configuration files that are deployed into a service.", + "type": "object", + "properties": { + "libraries": { + "description": "Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set.", + "items": { + "$ref": "Library" + }, + "type": "array" + }, + "nobuildFilesRegex": { + "description": "Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set.", + "type": "string" + }, + "basicScaling": { + "$ref": "BasicScaling", + "description": "A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity." + }, + "runtime": { + "description": "Desired runtime. Example: python27.", + "type": "string" + }, + "id": { + "description": "Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: \"default\", \"latest\", and any name with the prefix \"ah-\".", + "type": "string" + }, + "createdBy": { + "description": "Email address of the user who created this version.@OutputOnly", + "type": "string" + }, + "envVariables": { + "description": "Environment variables available to the application.Only returned in GET requests if view=FULL is set.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "livenessCheck": { + "description": "Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if view=FULL is set.", + "$ref": "LivenessCheck" + }, + "network": { + "description": "Extra network settings. Only applicable for App Engine flexible environment versions.", + "$ref": "Network" + }, + "betaSettings": { + "description": "Metadata settings that are supplied to this version to enable beta runtime features.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "env": { + "description": "App Engine execution environment for this version.Defaults to standard.", + "type": "string" + }, + "handlers": { + "description": "An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set.", + "items": { + "$ref": "UrlMap" + }, + "type": "array" + }, + "automaticScaling": { + "$ref": "AutomaticScaling", + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics." + }, + "diskUsageBytes": { + "format": "int64", + "description": "Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly", + "type": "string" + }, + "healthCheck": { + "$ref": "HealthCheck", + "description": "Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set." + }, + "threadsafe": { + "description": "Whether multiple requests can be dispatched to this version at once.", + "type": "boolean" + }, + "readinessCheck": { + "description": "Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests if view=FULL is set.", + "$ref": "ReadinessCheck" + }, + "manualScaling": { + "$ref": "ManualScaling", + "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time." + }, + "name": { + "description": "Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly", + "type": "string" + }, + "apiConfig": { + "$ref": "ApiConfigHandler", + "description": "Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set." + }, + "endpointsApiService": { + "description": "Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app.", + "$ref": "EndpointsApiService" + }, + "vm": { + "description": "Whether to deploy this version in a container on a virtual machine.", + "type": "boolean" + }, + "versionUrl": { + "description": "Serving URL for this version. Example: \"https://myversion-dot-myservice-dot-myapp.appspot.com\"@OutputOnly", + "type": "string" + }, + "instanceClass": { + "description": "Instance class that is used to run this version. Valid values are:\nAutomaticScaling: F1, F2, F4, F4_1G\nManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling.", + "type": "string" + }, + "servingStatus": { + "enum": [ + "SERVING_STATUS_UNSPECIFIED", + "SERVING", + "STOPPED" + ], + "description": "Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Currently serving. Instances are created according to the scaling settings of the version.", + "Disabled. No instances will be created and the scaling settings are ignored until the state of the version changes to SERVING." + ] + }, + "runtimeApiVersion": { + "description": "The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard/\u003clanguage\u003e/config/appref", + "type": "string" + }, + "deployment": { + "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set.", + "$ref": "Deployment" + }, + "createTime": { + "format": "google-datetime", + "description": "Time that this version was created.@OutputOnly", + "type": "string" + }, + "inboundServices": { + "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", + "items": { + "enum": [ + "INBOUND_SERVICE_UNSPECIFIED", + "INBOUND_SERVICE_MAIL", + "INBOUND_SERVICE_MAIL_BOUNCE", + "INBOUND_SERVICE_XMPP_ERROR", + "INBOUND_SERVICE_XMPP_MESSAGE", + "INBOUND_SERVICE_XMPP_SUBSCRIBE", + "INBOUND_SERVICE_XMPP_PRESENCE", + "INBOUND_SERVICE_CHANNEL_PRESENCE", + "INBOUND_SERVICE_WARMUP" + ], + "type": "string" + }, + "type": "array", + "enumDescriptions": [ + "Not specified.", + "Allows an application to receive mail.", + "Allows an application to receive email-bound notifications.", + "Allows an application to receive error stanzas.", + "Allows an application to receive instant messages.", + "Allows an application to receive user subscription POSTs.", + "Allows an application to receive a user's chat presence.", + "Registers an application for notifications when a client connects or disconnects from a channel.", + "Enables warmup requests." + ] + }, + "resources": { + "description": "Machine resources for this version. Only applicable for VM runtimes.", + "$ref": "Resources" + }, + "errorHandlers": { + "description": "Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set.", + "items": { + "$ref": "ErrorHandler" + }, + "type": "array" + }, + "defaultExpiration": { + "format": "google-duration", + "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", + "type": "string" + } + }, + "id": "Version" + }, + "RepairApplicationRequest": { + "description": "Request message for 'Applications.RepairApplication'.", + "type": "object", + "properties": {}, + "id": "RepairApplicationRequest" + }, + "CertificateRawData": { + "description": "An SSL certificate obtained from a certificate authority.", + "type": "object", + "properties": { + "privateKey": { + "description": "Unencrypted PEM encoded RSA private key. This field is set once on certificate creation and then encrypted. The key size must be 2048 bits or fewer. Must include the header and footer. Example: \u003cpre\u003e -----BEGIN RSA PRIVATE KEY----- \u003cunencrypted_key_value\u003e -----END RSA PRIVATE KEY----- \u003c/pre\u003e @InputOnly", + "type": "string" + }, + "publicCertificate": { + "description": "PEM encoded x.509 public key certificate. This field is set once on certificate creation. Must include the header and footer. Example: \u003cpre\u003e -----BEGIN CERTIFICATE----- \u003ccertificate_value\u003e -----END CERTIFICATE----- \u003c/pre\u003e", + "type": "string" + } + }, + "id": "CertificateRawData" + }, + "BuildInfo": { + "description": "Google Cloud Container Builder build information.", + "type": "object", + "properties": { + "cloudBuildId": { + "description": "The Google Cloud Container Builder build id. Example: \"f966068f-08b2-42c8-bdfe-74137dff2bf9\"", + "type": "string" + } + }, + "id": "BuildInfo" + }, + "FileInfo": { + "properties": { + "mimeType": { + "description": "The MIME type of the file.Defaults to the value from Google Cloud Storage.", + "type": "string" + }, + "sourceUrl": { + "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "type": "string" + }, + "sha1Sum": { + "description": "The SHA1 hash of the file, in hex.", + "type": "string" + } + }, + "id": "FileInfo", + "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", + "type": "object" + }, + "ScriptHandler": { + "description": "Executes a script to handle the request that matches the URL pattern.", + "type": "object", + "properties": { + "scriptPath": { + "description": "Path to the script from the application root directory.", + "type": "string" + } + }, + "id": "ScriptHandler" + }, + "OperationMetadataExperimental": { + "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.experimental.CustomDomains.CreateCustomDomain.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataExperimental", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "AuthorizedDomain": { + "properties": { + "name": { + "description": "Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly", + "type": "string" + }, + "id": { + "description": "Fully qualified domain name of the domain authorized for use. Example: example.com.", + "type": "string" + } + }, + "id": "AuthorizedDomain", + "description": "A domain that a user has been authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (https://www.google.com/webmasters/verification/home).", + "type": "object" + }, + "TrafficSplit": { + "description": "Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions.", + "type": "object", + "properties": { + "allocations": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "description": "Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", + "type": "object" + }, + "shardBy": { + "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", + "type": "string", + "enumDescriptions": [ + "Diversion method unspecified.", + "Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or no diversion will occur.", + "Diversion based on applying the modulus operation to a fingerprint of the IP address.", + "Diversion based on weighted random assignment. An incoming request is randomly routed to a version in the traffic split, with probability proportional to the version's traffic share." + ], + "enum": [ + "UNSPECIFIED", + "COOKIE", + "IP", + "RANDOM" + ] + } + }, + "id": "TrafficSplit" + }, + "OperationMetadataV1Beta": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1beta.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Beta" + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "version": "v1beta", + "baseUrl": "https://appengine.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/appengine.admin": { + "description": "View and manage your applications deployed on Google App Engine" + } + } + } + }, + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "servicePath": "", + "kind": "discovery#restDescription", + "rootUrl": "https://appengine.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "appengine", + "batchPath": "batch", + "id": "appengine:v1beta", + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "revision": "20170914", + "title": "Google App Engine Admin API", + "ownerName": "Google", + "discoveryVersion": "v1" +} diff --git a/etc/api/appengine/v1beta4/appengine-api.json b/etc/api/appengine/v1beta4/appengine-api.json index 74539d0574..4c59c075c5 100644 --- a/etc/api/appengine/v1beta4/appengine-api.json +++ b/etc/api/appengine/v1beta4/appengine-api.json @@ -1,673 +1,126 @@ { - "rootUrl": "https://appengine.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "appengine", - "batchPath": "batch", - "revision": "20170522", - "id": "appengine:v1beta4", - "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", - "title": "Google App Engine Admin API", "ownerName": "Google", "discoveryVersion": "v1", "resources": { "apps": { - "resources": { - "modules": { - "resources": { - "versions": { - "resources": { - "instances": { - "methods": { - "debug": { - "httpMethod": "POST", - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId", - "instancesId" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}:debug", - "id": "appengine.apps.modules.versions.instances.debug", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}:debug", - "request": { - "$ref": "DebugInstanceRequest" - }, - "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment." - }, - "delete": { - "httpMethod": "DELETE", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId", - "instancesId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", - "id": "appengine.apps.modules.versions.instances.delete", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", - "description": "Stops a running instance." - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Instance" - }, - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId", - "instancesId" - ], - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string", - "location": "path" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", - "id": "appengine.apps.modules.versions.instances.get", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", - "description": "Gets instance information." - }, - "list": { - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances", - "id": "appengine.apps.modules.versions.instances.list", - "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", - "response": { - "$ref": "ListInstancesResponse" - }, - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId" - ], - "httpMethod": "GET", - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "description": "Continuation token for fetching the next page of results.", - "type": "string", - "location": "query" - }, - "pageSize": { - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances" - } - } - } - }, - "methods": { - "delete": { - "description": "Deletes an existing version.", - "httpMethod": "DELETE", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1.", - "required": true, - "type": "string", - "location": "path" - }, - "modulesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", - "id": "appengine.apps.modules.versions.delete", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}" - }, - "get": { - "response": { - "$ref": "Version" - }, - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1.", - "required": true, - "type": "string" - }, - "modulesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "view": { - "location": "query", - "enum": [ - "BASIC", - "FULL" - ], - "description": "Controls the set of fields returned in the Get response.", - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", - "id": "appengine.apps.modules.versions.get", - "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource." - }, - "list": { - "description": "Lists the versions of a module.", - "response": { - "$ref": "ListVersionsResponse" - }, - "parameterOrder": [ - "appsId", - "modulesId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "Continuation token for fetching the next page of results.", - "type": "string" - }, - "pageSize": { - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "modulesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "view": { - "location": "query", - "enum": [ - "BASIC", - "FULL" - ], - "description": "Controls the set of fields returned in the List response.", - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", - "id": "appengine.apps.modules.versions.list" - }, - "patch": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId" - ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default/versions/1.", - "required": true, - "type": "string" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "mask": { - "location": "query", - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", - "id": "appengine.apps.modules.versions.patch", - "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.", - "request": { - "$ref": "Version" - } - }, - "create": { - "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", - "id": "appengine.apps.modules.versions.create", - "description": "Deploys code and resource files to a new version.", - "request": { - "$ref": "Version" - }, - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "modulesId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default.", - "required": true, - "type": "string", - "location": "path" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions" - } - } + "methods": { + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "type": "string", + "required": true + }, + "mask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" } }, - "methods": { - "delete": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "modulesId" - ], - "httpMethod": "DELETE", - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", - "required": true, - "type": "string", - "location": "path" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}", - "id": "appengine.apps.modules.delete", - "description": "Deletes the specified module and all enclosed versions." - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Module" - }, - "parameterOrder": [ - "appsId", - "modulesId" - ], - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", - "required": true, - "type": "string" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}", - "id": "appengine.apps.modules.get", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}", - "description": "Gets the current configuration of the specified module." - }, - "list": { - "path": "v1beta4/apps/{appsId}/modules", - "id": "appengine.apps.modules.list", - "description": "Lists all the modules in the application.", - "response": { - "$ref": "ListModulesResponse" - }, - "parameterOrder": [ - "appsId" - ], - "httpMethod": "GET", - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Continuation token for fetching the next page of results.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1beta4/apps/{appsId}/modules" - }, - "patch": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "modulesId" - ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default.", - "required": true, - "type": "string" - }, - "migrateTraffic": { - "location": "query", - "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules#shardby) field in the Module resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", - "type": "boolean" - }, - "modulesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "mask": { - "location": "query", - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}", - "path": "v1beta4/apps/{appsId}/modules/{modulesId}", - "id": "appengine.apps.modules.patch", - "description": "Updates the configuration of the specified module.", - "request": { - "$ref": "Module" - } - } - } + "flatPath": "v1beta4/apps/{appsId}", + "path": "v1beta4/apps/{appsId}", + "id": "appengine.apps.patch", + "request": { + "$ref": "Application" + }, + "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain)\ndefault_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration)" }, - "operations": { - "methods": { - "list": { - "id": "appengine.apps.operations.list", - "path": "v1beta4/apps/{appsId}/operations", - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations.", - "httpMethod": "GET", - "response": { - "$ref": "ListOperationsResponse" - }, - "parameterOrder": [ - "appsId" - ], - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "filter": { - "description": "The standard list filter.", - "type": "string", - "location": "query" - }, - "appsId": { - "description": "Part of `name`. The name of the operation collection.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The standard list page size.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v1beta4/apps/{appsId}/operations" + "get": { + "response": { + "$ref": "Application" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "ensureResourcesExist": { + "description": "Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete.", + "type": "boolean", + "location": "query" }, - "get": { - "id": "appengine.apps.operations.get", - "path": "v1beta4/apps/{appsId}/operations/{operationsId}", - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "httpMethod": "GET", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "operationsId" - ], - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. The name of the operation resource.", - "required": true, - "type": "string" - }, - "operationsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta4/apps/{appsId}/operations/{operationsId}" + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the application to get. Example: apps/myapp.", + "type": "string", + "required": true } - } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}", + "id": "appengine.apps.get", + "path": "v1beta4/apps/{appsId}", + "description": "Gets information about an application." }, + "create": { + "flatPath": "v1beta4/apps", + "id": "appengine.apps.create", + "path": "v1beta4/apps", + "request": { + "$ref": "Application" + }, + "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {} + } + }, + "resources": { "locations": { "methods": { + "get": { + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "appsId", + "locationsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Resource name for the location.", + "type": "string", + "required": true, + "location": "path" + }, + "locationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta4/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.get", + "path": "v1beta4/apps/{appsId}/locations/{locationsId}", + "description": "Get information about a location." + }, "list": { "response": { "$ref": "ListLocationsResponse" @@ -687,36 +140,615 @@ "type": "string", "location": "query" }, - "appsId": { - "description": "Part of `name`. The resource that owns the locations collection, if applicable.", - "required": true, - "type": "string", - "location": "path" - }, "pageToken": { "description": "The standard list page token.", "type": "string", "location": "query" }, + "appsId": { + "location": "path", + "description": "Part of `name`. The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true + }, "pageSize": { - "location": "query", - "description": "The standard list page size.", "format": "int32", - "type": "integer" + "description": "The standard list page size.", + "type": "integer", + "location": "query" } }, "flatPath": "v1beta4/apps/{appsId}/locations", - "path": "v1beta4/apps/{appsId}/locations", "id": "appengine.apps.locations.list", + "path": "v1beta4/apps/{appsId}/locations", "description": "Lists information about the supported locations for this service." - }, - "get": { + } + } + }, + "modules": { + "methods": { + "delete": { + "id": "appengine.apps.modules.delete", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "description": "Deletes the specified module and all enclosed versions.", "response": { - "$ref": "Location" + "$ref": "Operation" }, "parameterOrder": [ "appsId", - "locationsId" + "modulesId" + ], + "httpMethod": "DELETE", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", + "type": "string", + "required": true + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}" + }, + "patch": { + "description": "Updates the configuration of the specified module.", + "request": { + "$ref": "Module" + }, + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "modulesId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default.", + "type": "string", + "required": true, + "location": "path" + }, + "migrateTraffic": { + "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules#shardby) field in the Module resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", + "type": "boolean", + "location": "query" + }, + "mask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + }, + "modulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "id": "appengine.apps.modules.patch" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1beta4/apps/{appsId}/modules", + "path": "v1beta4/apps/{appsId}/modules", + "id": "appengine.apps.modules.list", + "description": "Lists all the modules in the application." + }, + "get": { + "description": "Gets the current configuration of the specified module.", + "response": { + "$ref": "Module" + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", + "type": "string", + "required": true, + "location": "path" + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}", + "id": "appengine.apps.modules.get", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}" + } + }, + "resources": { + "versions": { + "methods": { + "create": { + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "id": "appengine.apps.modules.versions.create", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "request": { + "$ref": "Version" + }, + "description": "Deploys code and resource files to a new version.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default.", + "type": "string", + "required": true + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + } + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "modulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "id": "appengine.apps.modules.versions.delete", + "description": "Deletes an existing version." + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "mask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "modulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default/versions/1.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "id": "appengine.apps.modules.versions.patch", + "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.", + "request": { + "$ref": "Version" + } + }, + "list": { + "description": "Lists the versions of a module.", + "httpMethod": "GET", + "response": { + "$ref": "ListVersionsResponse" + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the List response.", + "type": "string", + "location": "query" + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "id": "appengine.apps.modules.versions.list" + }, + "get": { + "response": { + "$ref": "Version" + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the Get response.", + "type": "string" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "modulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "id": "appengine.apps.modules.versions.get", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource." + } + }, + "resources": { + "instances": { + "methods": { + "debug": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "instancesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}:debug", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}:debug", + "id": "appengine.apps.modules.versions.instances.debug", + "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment.", + "request": { + "$ref": "DebugInstanceRequest" + } + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId", + "instancesId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.modules.versions.instances.delete", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", + "description": "Stops a running instance." + }, + "list": { + "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", + "response": { + "$ref": "ListInstancesResponse" + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances", + "id": "appengine.apps.modules.versions.instances.list", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances" + }, + "get": { + "response": { + "$ref": "Instance" + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId", + "instancesId" + ], + "httpMethod": "GET", + "parameters": { + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "modulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.modules.versions.instances.get", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", + "description": "Gets instance information." + } + } + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "operationsId" ], "httpMethod": "GET", "scopes": [ @@ -725,176 +757,80 @@ "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { - "locationsId": { + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation resource.", + "type": "string", + "required": true + }, + "operationsId": { "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "required": true, + "type": "string", + "required": true + } + }, + "flatPath": "v1beta4/apps/{appsId}/operations/{operationsId}", + "id": "appengine.apps.operations.get", + "path": "v1beta4/apps/{appsId}/operations/{operationsId}" + }, + "list": { + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", "type": "string" }, "appsId": { - "location": "path", - "description": "Part of `name`. Resource name for the location.", + "description": "Part of `name`. The name of the operation's parent resource.", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" } }, - "flatPath": "v1beta4/apps/{appsId}/locations/{locationsId}", - "path": "v1beta4/apps/{appsId}/locations/{locationsId}", - "id": "appengine.apps.locations.get", - "description": "Get information about a location." + "flatPath": "v1beta4/apps/{appsId}/operations", + "id": "appengine.apps.operations.list", + "path": "v1beta4/apps/{appsId}/operations", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id." } } } - }, - "methods": { - "create": { - "id": "appengine.apps.create", - "path": "v1beta4/apps", - "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).", - "request": { - "$ref": "Application" - }, - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {}, - "flatPath": "v1beta4/apps" - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Application" - }, - "parameterOrder": [ - "appsId" - ], - "parameters": { - "ensureResourcesExist": { - "location": "query", - "description": "Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete.", - "type": "boolean" - }, - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the application to get. Example: apps/myapp.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta4/apps/{appsId}", - "id": "appengine.apps.get", - "path": "v1beta4/apps/{appsId}", - "description": "Gets information about an application." - }, - "patch": { - "id": "appengine.apps.patch", - "path": "v1beta4/apps/{appsId}", - "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain)\ndefault_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration)", - "request": { - "$ref": "Application" - }, - "httpMethod": "PATCH", - "parameterOrder": [ - "appsId" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", - "required": true, - "type": "string" - }, - "mask": { - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1beta4/apps/{appsId}" - } } } }, "parameters": { - "upload_protocol": { + "access_token": { "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "description": "OAuth access token.", "type": "string" }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, "key": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "quotaUser": { "location": "query", @@ -904,43 +840,84 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" }, "bearer_token": { "location": "query", "description": "OAuth bearer token.", "type": "string" }, - "oauth_token": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { "location": "query", - "description": "OAuth 2.0 token for the current user.", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], "type": "string" } }, "schemas": { - "ListInstancesResponse": { - "description": "Response message for Instances.ListInstances.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "Continuation token for fetching the next page of results.", - "type": "string" - }, - "instances": { - "description": "The instances belonging to the requested version.", - "type": "array", - "items": { - "$ref": "Instance" - } - } - }, - "id": "ListInstancesResponse" - }, "ErrorHandler": { "description": "Custom static error page to be served when an error occurs.", "type": "object", "properties": { + "mimeType": { + "description": "MIME type of file. Defaults to text/html.", + "type": "string" + }, "errorCode": { "enum": [ "ERROR_CODE_UNSPECIFIED", @@ -959,10 +936,6 @@ "Deadline reached before the application responds." ] }, - "mimeType": { - "description": "MIME type of file. Defaults to text/html.", - "type": "string" - }, "staticFile": { "description": "Static file content to be served for this error.", "type": "string" @@ -971,20 +944,18 @@ "id": "ErrorHandler" }, "OperationMetadataV1": { - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", "properties": { - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, "warning": { "description": "Durable messages that persist on every operation poll. @OutputOnly", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" }, "user": { "description": "User who requested this operation.@OutputOnly", @@ -1003,31 +974,73 @@ "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", "type": "string" } }, - "id": "OperationMetadataV1" + "id": "OperationMetadataV1", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "OperationMetadataV1Alpha": { + "properties": { + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Alpha", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" }, "Application": { "description": "An Application resource contains the top-level configuration of an App Engine application.", "type": "object", "properties": { - "iap": { - "$ref": "IdentityAwareProxy" - }, "authDomain": { "description": "Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account.", "type": "string" }, - "id": { - "description": "Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp.", - "type": "string" + "iap": { + "$ref": "IdentityAwareProxy" }, "defaultCookieExpiration": { - "description": "Cookie expiration policy for this application.", "format": "google-duration", + "description": "Cookie expiration policy for this application.", + "type": "string" + }, + "id": { + "description": "Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp.", "type": "string" }, "codeBucket": { @@ -1044,10 +1057,10 @@ }, "dispatchRules": { "description": "HTTP path dispatch rules for requests to the application that do not explicitly target a module or version. Rules are order-dependent.@OutputOnly", - "type": "array", "items": { "$ref": "UrlDispatchRule" - } + }, + "type": "array" }, "defaultHostname": { "description": "Hostname used to reach the application, as resolved by App Engine.@OutputOnly", @@ -1061,107 +1074,65 @@ "id": "Application" }, "Network": { + "description": "Extra network settings. Only applicable for VM runtimes.", + "type": "object", "properties": { - "forwardedPorts": { - "description": "List of ports, or port pairs, to forward from the virtual machine to the application container.", - "type": "array", - "items": { - "type": "string" - } - }, "instanceTag": { "description": "Tag to apply to the VM instance during creation.", "type": "string" }, + "forwardedPorts": { + "description": "List of ports, or port pairs, to forward from the virtual machine to the application container.", + "items": { + "type": "string" + }, + "type": "array" + }, "name": { "description": "Google Cloud Platform network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.", "type": "string" } }, - "id": "Network", - "description": "Extra network settings. Only applicable for VM runtimes.", - "type": "object" - }, - "UrlDispatchRule": { - "properties": { - "path": { - "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters.", - "type": "string" - }, - "domain": { - "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", - "type": "string" - }, - "module": { - "description": "Resource ID of a module in this application that should serve the matched request. The module must already exist. Example: default.", - "type": "string" - } - }, - "id": "UrlDispatchRule", - "description": "Rules to match an HTTP request and dispatch that request to a module.", - "type": "object" + "id": "Network" }, "Instance": { "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", "type": "object", "properties": { - "appEngineRelease": { - "description": "App Engine release this instance is running on.@OutputOnly", - "type": "string" - }, - "startTimestamp": { - "description": "Time that this instance was started.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "vmName": { - "description": "Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" - }, - "vmId": { - "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" - }, - "qps": { - "description": "Average queries per second (QPS) over the last minute.@OutputOnly", - "format": "float", - "type": "number" - }, - "vmZoneName": { - "description": "Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" + "vmUnlocked": { + "description": "Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "boolean" }, "name": { "description": "Full path to the Instance resource in the API. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly", "type": "string" }, - "vmUnlocked": { - "description": "Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "boolean" + "vmZoneName": { + "description": "Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" }, "averageLatency": { - "description": "Average latency (ms) over the last minute.@OutputOnly", "format": "int32", + "description": "Average latency (ms) over the last minute.@OutputOnly", "type": "integer" }, "vmIp": { "description": "The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, + "memoryUsage": { + "format": "int64", + "description": "Total memory in use (bytes).@OutputOnly", + "type": "string" + }, "id": { "description": "Relative name of the instance within the version. Example: instance-1.@OutputOnly", "type": "string" }, - "memoryUsage": { - "description": "Total memory in use (bytes).@OutputOnly", - "format": "int64", + "vmStatus": { + "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, - "errors": { - "description": "Number of errors since this instance was started.@OutputOnly", - "format": "uint32", - "type": "integer" - }, "availability": { "enumDescriptions": [ "", @@ -1176,20 +1147,66 @@ "description": "Availability of the instance.@OutputOnly", "type": "string" }, - "vmStatus": { - "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" + "errors": { + "format": "uint32", + "description": "Number of errors since this instance was started.@OutputOnly", + "type": "integer" }, "requests": { - "description": "Number of requests since this instance was started.@OutputOnly", "format": "int32", + "description": "Number of requests since this instance was started.@OutputOnly", "type": "integer" + }, + "appEngineRelease": { + "description": "App Engine release this instance is running on.@OutputOnly", + "type": "string" + }, + "startTimestamp": { + "format": "google-datetime", + "description": "Time that this instance was started.@OutputOnly", + "type": "string" + }, + "vmName": { + "description": "Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "vmId": { + "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "qps": { + "format": "float", + "description": "Average queries per second (QPS) over the last minute.@OutputOnly", + "type": "number" } }, "id": "Instance" }, + "UrlDispatchRule": { + "description": "Rules to match an HTTP request and dispatch that request to a module.", + "type": "object", + "properties": { + "path": { + "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters.", + "type": "string" + }, + "module": { + "description": "Resource ID of a module in this application that should serve the matched request. The module must already exist. Example: default.", + "type": "string" + }, + "domain": { + "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", + "type": "string" + } + }, + "id": "UrlDispatchRule" + }, "Module": { "properties": { + "split": { + "$ref": "TrafficSplit", + "description": "Mapping that defines fractional HTTP traffic diversion to different versions within the module." + }, "id": { "description": "Relative name of the module within the application. Example: default.@OutputOnly", "type": "string" @@ -1197,10 +1214,6 @@ "name": { "description": "Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly", "type": "string" - }, - "split": { - "description": "Mapping that defines fractional HTTP traffic diversion to different versions within the module.", - "$ref": "TrafficSplit" } }, "id": "Module", @@ -1208,107 +1221,38 @@ "type": "object" }, "ListVersionsResponse": { + "description": "Response message for Versions.ListVersions.", + "type": "object", "properties": { + "versions": { + "description": "The versions belonging to the requested module.", + "items": { + "$ref": "Version" + }, + "type": "array" + }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", "type": "string" - }, - "versions": { - "description": "The versions belonging to the requested module.", - "type": "array", - "items": { - "$ref": "Version" - } } }, - "id": "ListVersionsResponse", - "description": "Response message for Versions.ListVersions.", - "type": "object" + "id": "ListVersionsResponse" }, "ApiEndpointHandler": { + "description": "Uses Google Cloud Endpoints to handle requests.", + "type": "object", "properties": { "scriptPath": { "description": "Path to the script from the application root directory.", "type": "string" } }, - "id": "ApiEndpointHandler", - "description": "Uses Google Cloud Endpoints to handle requests.", - "type": "object" - }, - "StaticDirectoryHandler": { - "properties": { - "applicationReadable": { - "description": "Whether files should also be uploaded as code data. By default, files declared in static directory handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.", - "type": "boolean" - }, - "httpHeaders": { - "additionalProperties": { - "type": "string" - }, - "description": "HTTP headers to use for all responses from these URLs.", - "type": "object" - }, - "directory": { - "description": "Path to the directory containing the static files from the application root directory. Everything after the end of the matched URL pattern is appended to static_dir to form the full path to the requested file.", - "type": "string" - }, - "mimeType": { - "description": "MIME type used to serve all files served by this handler. Defaults to file-specific MIME types, which are direved from each file's filename extension.", - "type": "string" - }, - "requireMatchingFile": { - "description": "Whether this handler should match the request if the file referenced by the handler does not exist.", - "type": "boolean" - }, - "expiration": { - "description": "Time a static file served by this handler should be cached.", - "format": "google-duration", - "type": "string" - } - }, - "id": "StaticDirectoryHandler", - "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static directory handlers make it easy to serve the entire contents of a directory as static files.", - "type": "object" + "id": "ApiEndpointHandler" }, "AutomaticScaling": { "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", "type": "object", "properties": { - "minIdleInstances": { - "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module.", - "format": "int32", - "type": "integer" - }, - "maxTotalInstances": { - "description": "Maximum number of instances that should be started to handle requests.", - "format": "int32", - "type": "integer" - }, - "minTotalInstances": { - "description": "Minimum number of instances that should be maintained for this version.", - "format": "int32", - "type": "integer" - }, - "networkUtilization": { - "$ref": "NetworkUtilization", - "description": "Target scaling by network usage." - }, - "maxConcurrentRequests": { - "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", - "format": "int32", - "type": "integer" - }, - "coolDownPeriod": { - "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", - "format": "google-duration", - "type": "string" - }, - "maxPendingLatency": { - "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", - "format": "google-duration", - "type": "string" - }, "cpuUtilization": { "$ref": "CpuUtilization", "description": "Target scaling by CPU usage." @@ -1318,52 +1262,92 @@ "description": "Target scaling by disk usage." }, "minPendingLatency": { - "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", "format": "google-duration", + "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", "type": "string" }, + "maxIdleInstances": { + "format": "int32", + "description": "Maximum number of idle instances that should be maintained for this version.", + "type": "integer" + }, "requestUtilization": { "$ref": "RequestUtilization", "description": "Target scaling by request utilization." }, - "maxIdleInstances": { - "description": "Maximum number of idle instances that should be maintained for this version.", + "minIdleInstances": { "format": "int32", + "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module.", "type": "integer" + }, + "maxTotalInstances": { + "format": "int32", + "description": "Maximum number of instances that should be started to handle requests.", + "type": "integer" + }, + "minTotalInstances": { + "format": "int32", + "description": "Minimum number of instances that should be maintained for this version.", + "type": "integer" + }, + "networkUtilization": { + "$ref": "NetworkUtilization", + "description": "Target scaling by network usage." + }, + "maxConcurrentRequests": { + "format": "int32", + "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", + "type": "integer" + }, + "coolDownPeriod": { + "format": "google-duration", + "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", + "type": "string" + }, + "maxPendingLatency": { + "format": "google-duration", + "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", + "type": "string" } }, "id": "AutomaticScaling" }, - "NetworkUtilization": { + "StaticDirectoryHandler": { + "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static directory handlers make it easy to serve the entire contents of a directory as static files.", + "type": "object", "properties": { - "targetSentBytesPerSec": { - "description": "Target bytes sent per second.", - "format": "int32", - "type": "integer" + "mimeType": { + "description": "MIME type used to serve all files served by this handler. Defaults to file-specific MIME types, which are direved from each file's filename extension.", + "type": "string" }, - "targetReceivedPacketsPerSec": { - "description": "Target packets received per second.", - "format": "int32", - "type": "integer" + "requireMatchingFile": { + "description": "Whether this handler should match the request if the file referenced by the handler does not exist.", + "type": "boolean" }, - "targetReceivedBytesPerSec": { - "description": "Target bytes received per second.", - "format": "int32", - "type": "integer" + "expiration": { + "format": "google-duration", + "description": "Time a static file served by this handler should be cached.", + "type": "string" }, - "targetSentPacketsPerSec": { - "description": "Target packets sent per second.", - "format": "int32", - "type": "integer" + "applicationReadable": { + "description": "Whether files should also be uploaded as code data. By default, files declared in static directory handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.", + "type": "boolean" + }, + "httpHeaders": { + "description": "HTTP headers to use for all responses from these URLs.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "directory": { + "description": "Path to the directory containing the static files from the application root directory. Everything after the end of the matched URL pattern is appended to static_dir to form the full path to the requested file.", + "type": "string" } }, - "id": "NetworkUtilization", - "description": "Target scaling by network usage. Only applicable for VM runtimes.", - "type": "object" + "id": "StaticDirectoryHandler" }, "Location": { - "description": "A resource that represents Google Cloud Platform location.", - "type": "object", "properties": { "labels": { "additionalProperties": { @@ -1389,37 +1373,39 @@ "type": "object" } }, - "id": "Location" + "id": "Location", + "description": "A resource that represents Google Cloud Platform location.", + "type": "object" }, - "HealthCheck": { - "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.", + "NetworkUtilization": { + "description": "Target scaling by network usage. Only applicable for VM runtimes.", "type": "object", "properties": { - "restartThreshold": { - "description": "Number of consecutive failed health checks required before an instance is restarted.", - "format": "uint32", + "targetReceivedPacketsPerSec": { + "format": "int32", + "description": "Target packets received per second.", "type": "integer" }, - "healthyThreshold": { - "description": "Number of consecutive successful health checks required before receiving traffic.", - "format": "uint32", + "targetSentBytesPerSec": { + "format": "int32", + "description": "Target bytes sent per second.", "type": "integer" }, - "checkInterval": { - "description": "Interval between health checks.", - "format": "google-duration", - "type": "string" - }, - "timeout": { - "description": "Time before the health check is considered failed.", - "format": "google-duration", - "type": "string" - }, - "unhealthyThreshold": { - "description": "Number of consecutive failed health checks required before removing traffic.", - "format": "uint32", + "targetReceivedBytesPerSec": { + "format": "int32", + "description": "Target bytes received per second.", "type": "integer" }, + "targetSentPacketsPerSec": { + "format": "int32", + "description": "Target packets sent per second.", + "type": "integer" + } + }, + "id": "NetworkUtilization" + }, + "HealthCheck": { + "properties": { "disableHealthCheck": { "description": "Whether to explicitly disable health checks for this instance.", "type": "boolean" @@ -1427,23 +1413,35 @@ "host": { "description": "Host header to send when performing an HTTP health check. Example: \"myapp.appspot.com\"", "type": "string" - } - }, - "id": "HealthCheck" - }, - "SourceReference": { - "properties": { - "revisionId": { - "description": "The canonical, persistent identifier of the deployed revision. Aliases that include tags or branch names are not allowed. Example (git): \"2198322f89e0bb2e25021667c2ed489d1fd34e6b\"", + }, + "healthyThreshold": { + "format": "uint32", + "description": "Number of consecutive successful health checks required before receiving traffic.", + "type": "integer" + }, + "restartThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before an instance is restarted.", + "type": "integer" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", "type": "string" }, - "repository": { - "description": "URI string identifying the repository. Example: \"https://source.developers.google.com/p/app-123/r/default\"", + "timeout": { + "format": "google-duration", + "description": "Time before the health check is considered failed.", "type": "string" + }, + "unhealthyThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before removing traffic.", + "type": "integer" } }, - "id": "SourceReference", - "description": "Reference to a particular snapshot of the source tree used to build and deploy the application.", + "id": "HealthCheck", + "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.", "type": "object" }, "DebugInstanceRequest": { @@ -1457,6 +1455,36 @@ "description": "Request message for Instances.DebugInstance.", "type": "object" }, + "SourceReference": { + "properties": { + "repository": { + "description": "URI string identifying the repository. Example: \"https://source.developers.google.com/p/app-123/r/default\"", + "type": "string" + }, + "revisionId": { + "description": "The canonical, persistent identifier of the deployed revision. Aliases that include tags or branch names are not allowed. Example (git): \"2198322f89e0bb2e25021667c2ed489d1fd34e6b\"", + "type": "string" + } + }, + "id": "SourceReference", + "description": "Reference to a particular snapshot of the source tree used to build and deploy the application.", + "type": "object" + }, + "Library": { + "description": "Third-party Python runtime library that is required by the application.", + "type": "object", + "properties": { + "name": { + "description": "Name of the library. Example: \"django\".", + "type": "string" + }, + "version": { + "description": "Version of the library to select, or \"latest\".", + "type": "string" + } + }, + "id": "Library" + }, "OperationMetadataV1Beta5": { "properties": { "method": { @@ -1464,142 +1492,78 @@ "type": "string" }, "insertTime": { - "description": "Timestamp that this operation was created.@OutputOnly", "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", "type": "string" }, "endTime": { - "description": "Timestamp that this operation completed.@OutputOnly", "format": "google-datetime", - "type": "string" - }, - "user": { - "description": "User who requested this operation.@OutputOnly", + "description": "Timestamp that this operation completed.@OutputOnly", "type": "string" }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" } }, "id": "OperationMetadataV1Beta5", "description": "Metadata for the given google.longrunning.Operation.", "type": "object" }, - "Library": { - "properties": { - "version": { - "description": "Version of the library to select, or \"latest\".", - "type": "string" - }, - "name": { - "description": "Name of the library. Example: \"django\".", - "type": "string" - } - }, - "id": "Library", - "description": "Third-party Python runtime library that is required by the application.", - "type": "object" - }, "ListLocationsResponse": { "description": "The response message for Locations.ListLocations.", "type": "object", "properties": { + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + }, "nextPageToken": { "description": "The standard List next-page token.", "type": "string" - }, - "locations": { - "description": "A list of locations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Location" - } } }, "id": "ListLocationsResponse" }, "Version": { + "description": "A Version resource is a specific set of source code and configuration files that are deployed into a module.", + "type": "object", "properties": { - "servingStatus": { - "enumDescriptions": [ - "Not specified.", - "Currently serving. Instances are created according to the scaling settings of the version.", - "Disabled. No instances will be created and the scaling settings are ignored until the state of the version changes to SERVING." - ], - "enum": [ - "SERVING_STATUS_UNSPECIFIED", - "SERVING", - "STOPPED" - ], - "description": "Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING.", - "type": "string" - }, - "deployment": { - "$ref": "Deployment", - "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set." - }, - "resources": { - "description": "Machine resources for this version. Only applicable for VM runtimes.", - "$ref": "Resources" - }, - "inboundServices": { - "enumDescriptions": [ - "Not specified.", - "Allows an application to receive mail.", - "Allows an application to receive email-bound notifications.", - "Allows an application to receive error stanzas.", - "Allows an application to receive instant messages.", - "Allows an application to receive user subscription POSTs.", - "Allows an application to receive a user's chat presence.", - "Registers an application for notifications when a client connects or disconnects from a channel.", - "Enables warmup requests." - ], - "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", - "type": "array", - "items": { - "enum": [ - "INBOUND_SERVICE_UNSPECIFIED", - "INBOUND_SERVICE_MAIL", - "INBOUND_SERVICE_MAIL_BOUNCE", - "INBOUND_SERVICE_XMPP_ERROR", - "INBOUND_SERVICE_XMPP_MESSAGE", - "INBOUND_SERVICE_XMPP_SUBSCRIBE", - "INBOUND_SERVICE_XMPP_PRESENCE", - "INBOUND_SERVICE_CHANNEL_PRESENCE", - "INBOUND_SERVICE_WARMUP" - ], - "type": "string" - } - }, "errorHandlers": { "description": "Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set.", - "type": "array", "items": { "$ref": "ErrorHandler" - } + }, + "type": "array" }, "defaultExpiration": { - "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", "format": "google-duration", + "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", "type": "string" }, "libraries": { "description": "Configuration for third-party Python runtime libraries required by the application.Only returned in GET requests if view=FULL is set.", - "type": "array", "items": { "$ref": "Library" - } + }, + "type": "array" + }, + "creationTime": { + "format": "google-datetime", + "description": "Time that this version was created.@OutputOnly", + "type": "string" }, "nobuildFilesRegex": { "description": "Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set.", "type": "string" }, - "creationTime": { - "description": "Time that this version was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, "basicScaling": { "description": "A module with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", "$ref": "BasicScaling" @@ -1620,15 +1584,15 @@ "type": "object" }, "network": { - "description": "Extra network settings. Only applicable for VM runtimes.", - "$ref": "Network" + "$ref": "Network", + "description": "Extra network settings. Only applicable for VM runtimes." }, "betaSettings": { + "description": "Metadata settings that are supplied to this version to enable beta runtime features.", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Metadata settings that are supplied to this version to enable beta runtime features.", - "type": "object" + } }, "env": { "description": "App Engine execution environment to use for this version.Defaults to 1.", @@ -1636,10 +1600,10 @@ }, "handlers": { "description": "An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set.", - "type": "array", "items": { "$ref": "UrlMap" - } + }, + "type": "array" }, "deployer": { "description": "Email address of the user who created this version.@OutputOnly", @@ -1658,16 +1622,16 @@ "type": "boolean" }, "manualScaling": { - "$ref": "ManualScaling", - "description": "A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time." + "description": "A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", + "$ref": "ManualScaling" }, "name": { "description": "Full path to the Version resource in the API. Example: apps/myapp/modules/default/versions/v1.@OutputOnly", "type": "string" }, "apiConfig": { - "description": "Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set.", - "$ref": "ApiConfigHandler" + "$ref": "ApiConfigHandler", + "description": "Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set." }, "vm": { "description": "Whether to deploy this version in a container on a virtual machine.", @@ -1676,86 +1640,98 @@ "instanceClass": { "description": "Instance class that is used to run this version. Valid values are:\nAutomaticScaling: F1, F2, F4, F4_1G\nManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling.", "type": "string" + }, + "servingStatus": { + "enumDescriptions": [ + "Not specified.", + "Currently serving. Instances are created according to the scaling settings of the version.", + "Disabled. No instances will be created and the scaling settings are ignored until the state of the version changes to SERVING." + ], + "enum": [ + "SERVING_STATUS_UNSPECIFIED", + "SERVING", + "STOPPED" + ], + "description": "Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING.", + "type": "string" + }, + "deployment": { + "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set.", + "$ref": "Deployment" + }, + "runtimeApiVersion": { + "description": "The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard/\u003clanguage\u003e/config/appref", + "type": "string" + }, + "resources": { + "description": "Machine resources for this version. Only applicable for VM runtimes.", + "$ref": "Resources" + }, + "inboundServices": { + "enumDescriptions": [ + "Not specified.", + "Allows an application to receive mail.", + "Allows an application to receive email-bound notifications.", + "Allows an application to receive error stanzas.", + "Allows an application to receive instant messages.", + "Allows an application to receive user subscription POSTs.", + "Allows an application to receive a user's chat presence.", + "Registers an application for notifications when a client connects or disconnects from a channel.", + "Enables warmup requests." + ], + "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", + "items": { + "enum": [ + "INBOUND_SERVICE_UNSPECIFIED", + "INBOUND_SERVICE_MAIL", + "INBOUND_SERVICE_MAIL_BOUNCE", + "INBOUND_SERVICE_XMPP_ERROR", + "INBOUND_SERVICE_XMPP_MESSAGE", + "INBOUND_SERVICE_XMPP_SUBSCRIBE", + "INBOUND_SERVICE_XMPP_PRESENCE", + "INBOUND_SERVICE_CHANNEL_PRESENCE", + "INBOUND_SERVICE_WARMUP" + ], + "type": "string" + }, + "type": "array" } }, - "id": "Version", - "description": "A Version resource is a specific set of source code and configuration files that are deployed into a module.", - "type": "object" + "id": "Version" }, "ContainerInfo": { + "description": "Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment.", + "type": "object", "properties": { "image": { "description": "URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: \"gcr.io/my-project/image:tag\" or \"gcr.io/my-project/image@digest\"", "type": "string" } }, - "id": "ContainerInfo", - "description": "Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment.", - "type": "object" + "id": "ContainerInfo" }, "RequestUtilization": { + "description": "Target scaling by request utilization. Only applicable for VM runtimes.", + "type": "object", "properties": { - "targetRequestCountPerSec": { - "description": "Target requests per second.", + "targetConcurrentRequests": { "format": "int32", + "description": "Target number of concurrent requests.", "type": "integer" }, - "targetConcurrentRequests": { - "description": "Target number of concurrent requests.", + "targetRequestCountPerSec": { "format": "int32", + "description": "Target requests per second.", "type": "integer" } }, - "id": "RequestUtilization", - "description": "Target scaling by request utilization. Only applicable for VM runtimes.", - "type": "object" + "id": "RequestUtilization" }, "UrlMap": { + "description": "URL pattern and description of how the URL should be handled. App Engine can handle URLs by executing application code, or by serving static files uploaded with the version, such as images, CSS, or JavaScript.", + "type": "object", "properties": { - "script": { - "description": "Executes a script to handle the request that matches this URL pattern.", - "$ref": "ScriptHandler" - }, - "urlRegex": { - "description": "A URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path.", - "type": "string" - }, - "login": { - "enum": [ - "LOGIN_UNSPECIFIED", - "LOGIN_OPTIONAL", - "LOGIN_ADMIN", - "LOGIN_REQUIRED" - ], - "description": "Level of login required to access this resource.", - "type": "string", - "enumDescriptions": [ - "Not specified. LOGIN_OPTIONAL is assumed.", - "Does not require that the user is signed in.", - "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", - "If the user has signed in, the handler proceeds normally. Otherwise, the auth_fail_action is taken." - ] - }, - "apiEndpoint": { - "$ref": "ApiEndpointHandler", - "description": "Uses API Endpoints to handle requests." - }, - "staticDirectory": { - "description": "Serves the entire contents of a directory as static files.This attribute is deprecated. You can mimic the behavior of static directories using static files.", - "$ref": "StaticDirectoryHandler" - }, - "staticFiles": { - "description": "Returns the contents of a file, such as an image, as the response.", - "$ref": "StaticFilesHandler" - }, "redirectHttpResponseCode": { - "enumDescriptions": [ - "Not specified. 302 is assumed.", - "301 Moved Permanently code.", - "302 Moved Temporarily code.", - "303 See Other code.", - "307 Temporary Redirect code." - ], "enum": [ "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", "REDIRECT_HTTP_RESPONSE_CODE_301", @@ -1764,9 +1740,18 @@ "REDIRECT_HTTP_RESPONSE_CODE_307" ], "description": "30x code to use when performing redirects for the secure field. Defaults to 302.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Not specified. 302 is assumed.", + "301 Moved Permanently code.", + "302 Moved Temporarily code.", + "303 See Other code.", + "307 Temporary Redirect code." + ] }, "securityLevel": { + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string", "enumDescriptions": [ "Not specified.", "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", @@ -1780,10 +1765,85 @@ "SECURE_NEVER", "SECURE_OPTIONAL", "SECURE_ALWAYS" + ] + }, + "authFailAction": { + "enum": [ + "AUTH_FAIL_ACTION_UNSPECIFIED", + "AUTH_FAIL_ACTION_REDIRECT", + "AUTH_FAIL_ACTION_UNAUTHORIZED" ], - "description": "Security (HTTPS) enforcement for this URL.", + "description": "Action to take when users access resources that require authentication. Defaults to redirect.", + "type": "string", + "enumDescriptions": [ + "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", + "Redirects user to \"accounts.google.com\". The user is redirected back to the application URL after signing in or creating an account.", + "Rejects request with a 401 HTTP status code and an error message." + ] + }, + "script": { + "description": "Executes a script to handle the request that matches this URL pattern.", + "$ref": "ScriptHandler" + }, + "urlRegex": { + "description": "A URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path.", "type": "string" }, + "login": { + "description": "Level of login required to access this resource.", + "type": "string", + "enumDescriptions": [ + "Not specified. LOGIN_OPTIONAL is assumed.", + "Does not require that the user is signed in.", + "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", + "If the user has signed in, the handler proceeds normally. Otherwise, the auth_fail_action is taken." + ], + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ] + }, + "apiEndpoint": { + "description": "Uses API Endpoints to handle requests.", + "$ref": "ApiEndpointHandler" + }, + "staticDirectory": { + "description": "Serves the entire contents of a directory as static files.This attribute is deprecated. You can mimic the behavior of static directories using static files.", + "$ref": "StaticDirectoryHandler" + }, + "staticFiles": { + "$ref": "StaticFilesHandler", + "description": "Returns the contents of a file, such as an image, as the response." + } + }, + "id": "UrlMap" + }, + "ApiConfigHandler": { + "properties": { + "url": { + "description": "URL to serve the endpoint at.", + "type": "string" + }, + "securityLevel": { + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", + "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", + "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." + ], + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ] + }, "authFailAction": { "enumDescriptions": [ "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", @@ -1797,14 +1857,40 @@ ], "description": "Action to take when users access resources that require authentication. Defaults to redirect.", "type": "string" + }, + "script": { + "description": "Path to the script from the application root directory.", + "type": "string" + }, + "login": { + "enumDescriptions": [ + "Not specified. LOGIN_OPTIONAL is assumed.", + "Does not require that the user is signed in.", + "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", + "If the user has signed in, the handler proceeds normally. Otherwise, the auth_fail_action is taken." + ], + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ], + "description": "Level of login required to access this resource. Defaults to optional.", + "type": "string" } }, - "id": "UrlMap", - "description": "URL pattern and description of how the URL should be handled. App Engine can handle URLs by executing application code, or by serving static files uploaded with the version, such as images, CSS, or JavaScript.", + "id": "ApiConfigHandler", + "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", "type": "object" }, "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object", "properties": { + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, "response": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", @@ -1828,101 +1914,11 @@ }, "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", "type": "object" - }, - "done": { - "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", - "type": "boolean" } }, - "id": "Operation", - "description": "This resource represents a long-running operation that is the result of a network API call.", - "type": "object" - }, - "ApiConfigHandler": { - "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", - "type": "object", - "properties": { - "script": { - "description": "Path to the script from the application root directory.", - "type": "string" - }, - "login": { - "enum": [ - "LOGIN_UNSPECIFIED", - "LOGIN_OPTIONAL", - "LOGIN_ADMIN", - "LOGIN_REQUIRED" - ], - "description": "Level of login required to access this resource. Defaults to optional.", - "type": "string", - "enumDescriptions": [ - "Not specified. LOGIN_OPTIONAL is assumed.", - "Does not require that the user is signed in.", - "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", - "If the user has signed in, the handler proceeds normally. Otherwise, the auth_fail_action is taken." - ] - }, - "url": { - "description": "URL to serve the endpoint at.", - "type": "string" - }, - "securityLevel": { - "enumDescriptions": [ - "Not specified.", - "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", - "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", - "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", - "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." - ], - "enum": [ - "SECURE_UNSPECIFIED", - "SECURE_DEFAULT", - "SECURE_NEVER", - "SECURE_OPTIONAL", - "SECURE_ALWAYS" - ], - "description": "Security (HTTPS) enforcement for this URL.", - "type": "string" - }, - "authFailAction": { - "enumDescriptions": [ - "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", - "Redirects user to \"accounts.google.com\". The user is redirected back to the application URL after signing in or creating an account.", - "Rejects request with a 401 HTTP status code and an error message." - ], - "enum": [ - "AUTH_FAIL_ACTION_UNSPECIFIED", - "AUTH_FAIL_ACTION_REDIRECT", - "AUTH_FAIL_ACTION_UNAUTHORIZED" - ], - "description": "Action to take when users access resources that require authentication. Defaults to redirect.", - "type": "string" - } - }, - "id": "ApiConfigHandler" - }, - "FileInfo": { - "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", - "type": "object", - "properties": { - "sourceUrl": { - "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", - "type": "string" - }, - "sha1Sum": { - "description": "The SHA1 hash of the file, in hex.", - "type": "string" - }, - "mimeType": { - "description": "The MIME type of the file.Defaults to the value from Google Cloud Storage.", - "type": "string" - } - }, - "id": "FileInfo" + "id": "Operation" }, "StaticFilesHandler": { - "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.", - "type": "object", "properties": { "uploadPathRegex": { "description": "Regular expression that matches the file paths for all files that should be referenced by this handler.", @@ -1941,8 +1937,8 @@ "type": "boolean" }, "expiration": { - "description": "Time a static file served by this handler should be cached.", "format": "google-duration", + "description": "Time a static file served by this handler should be cached.", "type": "string" }, "applicationReadable": { @@ -1957,7 +1953,28 @@ "type": "object" } }, - "id": "StaticFilesHandler" + "id": "StaticFilesHandler", + "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.", + "type": "object" + }, + "FileInfo": { + "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", + "type": "object", + "properties": { + "mimeType": { + "description": "The MIME type of the file.Defaults to the value from Google Cloud Storage.", + "type": "string" + }, + "sourceUrl": { + "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "type": "string" + }, + "sha1Sum": { + "description": "The SHA1 hash of the file, in hex.", + "type": "string" + } + }, + "id": "FileInfo" }, "ScriptHandler": { "description": "Executes a script to handle the request that matches the URL pattern.", @@ -1971,44 +1988,44 @@ "id": "ScriptHandler" }, "DiskUtilization": { + "description": "Target scaling by disk usage. Only applicable for VM runtimes.", + "type": "object", "properties": { - "targetReadOpsPerSec": { - "description": "Target ops read per second.", - "format": "int32", - "type": "integer" - }, "targetReadBytesPerSec": { - "description": "Target bytes read per second.", "format": "int32", + "description": "Target bytes read per second.", "type": "integer" }, "targetWriteOpsPerSec": { - "description": "Target ops written per second.", "format": "int32", + "description": "Target ops written per second.", "type": "integer" }, "targetWriteBytesPerSec": { - "description": "Target bytes written per second.", "format": "int32", + "description": "Target bytes written per second.", + "type": "integer" + }, + "targetReadOpsPerSec": { + "format": "int32", + "description": "Target ops read per second.", "type": "integer" } }, - "id": "DiskUtilization", - "description": "Target scaling by disk usage. Only applicable for VM runtimes.", - "type": "object" + "id": "DiskUtilization" }, "BasicScaling": { "description": "A module with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", "type": "object", "properties": { "maxInstances": { - "description": "Maximum number of instances to create for this version.", "format": "int32", + "description": "Maximum number of instances to create for this version.", "type": "integer" }, "idleTimeout": { - "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", "format": "google-duration", + "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", "type": "string" } }, @@ -2018,78 +2035,76 @@ "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { - "user": { - "description": "User who requested this operation.@OutputOnly", + "method": { + "description": "API method that initiated this operation. Example: google.appengine.experimental.CustomDomains.CreateCustomDomain.@OutputOnly", + "type": "string" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", "type": "string" }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly", "type": "string" }, - "method": { - "description": "API method that initiated this operation. Example: google.appengine.experimental.CustomDomains.CreateCustomDomain.@OutputOnly", - "type": "string" - }, - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "endTime": { - "description": "Time that this operation completed.@OutputOnly", - "format": "google-datetime", + "user": { + "description": "User who requested this operation.@OutputOnly", "type": "string" } }, "id": "OperationMetadataExperimental" }, "CpuUtilization": { - "description": "Target scaling by CPU usage.", - "type": "object", "properties": { "aggregationWindowLength": { - "description": "Period of time over which CPU utilization is calculated.", "format": "google-duration", + "description": "Period of time over which CPU utilization is calculated.", "type": "string" }, "targetUtilization": { - "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", "format": "double", + "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", "type": "number" } }, - "id": "CpuUtilization" + "id": "CpuUtilization", + "description": "Target scaling by CPU usage.", + "type": "object" }, "Status": { "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + }, "details": { - "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", "items": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, "type": "object" - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" + }, + "type": "array" } }, "id": "Status" }, "IdentityAwareProxy": { - "description": "Identity-Aware Proxy", - "type": "object", "properties": { "oauth2ClientSecret": { "description": "For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2_client_secret_sha256 field.@InputOnly", @@ -2108,23 +2123,35 @@ "type": "boolean" } }, - "id": "IdentityAwareProxy" + "id": "IdentityAwareProxy", + "description": "Identity-Aware Proxy", + "type": "object" }, "ManualScaling": { + "description": "A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", + "type": "object", "properties": { "instances": { - "description": "Number of instances to assign to the module at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", "format": "int32", + "description": "Number of instances to assign to the module at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", "type": "integer" } }, - "id": "ManualScaling", - "description": "A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", - "type": "object" + "id": "ManualScaling" }, "TrafficSplit": { "properties": { + "allocations": { + "description": "Mapping from version IDs within the module to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the module may not have any traffic allocation. Modules that have traffic allocated cannot be deleted until either the module is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", + "type": "object", + "additionalProperties": { + "format": "double", + "type": "number" + } + }, "shardBy": { + "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", + "type": "string", "enumDescriptions": [ "Diversion method unspecified.", "Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or else no diversion will occur.", @@ -2134,17 +2161,7 @@ "UNSPECIFIED", "COOKIE", "IP" - ], - "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", - "type": "string" - }, - "allocations": { - "additionalProperties": { - "format": "double", - "type": "number" - }, - "description": "Mapping from version IDs within the module to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the module may not have any traffic allocation. Modules that have traffic allocated cannot be deleted until either the module is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", - "type": "object" + ] } }, "id": "TrafficSplit", @@ -2170,6 +2187,18 @@ "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", "type": "string" @@ -2187,26 +2216,16 @@ "type": "string" }, "endTime": { + "format": "google-datetime", "description": "Time that this operation completed.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "warning": { - "description": "Durable messages that persist on every operation poll. @OutputOnly", - "type": "array", - "items": { - "type": "string" - } - }, - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", "type": "string" } }, "id": "OperationMetadataV1Beta" }, "ListModulesResponse": { + "description": "Response message for Modules.ListModules.", + "type": "object", "properties": { "nextPageToken": { "description": "Continuation token for fetching the next page of results.", @@ -2214,89 +2233,87 @@ }, "modules": { "description": "The modules belonging to the requested application.", - "type": "array", "items": { "$ref": "Module" - } + }, + "type": "array" } }, - "id": "ListModulesResponse", - "description": "Response message for Modules.ListModules.", + "id": "ListModulesResponse" + }, + "Resources": { + "properties": { + "volumes": { + "description": "User specified volumes.", + "items": { + "$ref": "Volume" + }, + "type": "array" + }, + "diskGb": { + "format": "double", + "description": "Disk size (GB) needed.", + "type": "number" + }, + "memoryGb": { + "format": "double", + "description": "Memory (GB) needed.", + "type": "number" + }, + "cpu": { + "format": "double", + "description": "Number of CPU cores needed.", + "type": "number" + } + }, + "id": "Resources", + "description": "Machine resources for a version.", "type": "object" }, "Deployment": { - "description": "Code and application artifacts used to deploy a version to App Engine.", - "type": "object", "properties": { + "sourceReferences": { + "description": "Origin of the source code for this deployment. There can be more than one source reference per version if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + }, + "type": "array" + }, + "container": { + "$ref": "ContainerInfo", + "description": "The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment." + }, "files": { "additionalProperties": { "$ref": "FileInfo" }, "description": "Manifest of the files stored in Google Cloud Storage that are included as part of this version. All files must be readable using the credentials supplied with this call.", "type": "object" - }, - "container": { - "$ref": "ContainerInfo", - "description": "The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment." - }, - "sourceReferences": { - "description": "Origin of the source code for this deployment. There can be more than one source reference per version if source code is distributed among multiple repositories.", - "type": "array", - "items": { - "$ref": "SourceReference" - } } }, - "id": "Deployment" - }, - "Resources": { - "description": "Machine resources for a version.", - "type": "object", - "properties": { - "volumes": { - "description": "User specified volumes.", - "type": "array", - "items": { - "$ref": "Volume" - } - }, - "diskGb": { - "description": "Disk size (GB) needed.", - "format": "double", - "type": "number" - }, - "cpu": { - "description": "Number of CPU cores needed.", - "format": "double", - "type": "number" - }, - "memoryGb": { - "description": "Memory (GB) needed.", - "format": "double", - "type": "number" - } - }, - "id": "Resources" + "id": "Deployment", + "description": "Code and application artifacts used to deploy a version to App Engine.", + "type": "object" }, "Volume": { + "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", + "type": "object", "properties": { - "volumeType": { - "description": "Underlying volume type, e.g. 'tmpfs'.", - "type": "string" - }, "sizeGb": { - "description": "Volume size in gigabytes.", "format": "double", + "description": "Volume size in gigabytes.", "type": "number" }, "name": { "description": "Unique name for the volume.", "type": "string" + }, + "volumeType": { + "description": "Underlying volume type, e.g. 'tmpfs'.", + "type": "string" } }, - "id": "Volume", - "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", - "type": "object" + "id": "Volume" }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", @@ -2308,16 +2325,21 @@ }, "operations": { "description": "A list of operations that matches the specified filter in the request.", - "type": "array", "items": { "$ref": "Operation" - } + }, + "type": "array" } }, "id": "ListOperationsResponse" }, "OperationMetadata": { "properties": { + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" + }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly", "type": "string" @@ -2331,48 +2353,70 @@ "type": "string" }, "endTime": { - "description": "Timestamp that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", "type": "string" }, "operationType": { "description": "Type of this operation. Deprecated, use method field instead. Example: \"create_version\".@OutputOnly", "type": "string" - }, - "insertTime": { - "description": "Timestamp that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" } }, "id": "OperationMetadata", "description": "Metadata for the given google.longrunning.Operation.", "type": "object" + }, + "ListInstancesResponse": { + "description": "Response message for Instances.ListInstances.", + "type": "object", + "properties": { + "instances": { + "description": "The instances belonging to the requested version.", + "items": { + "$ref": "Instance" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + } + }, + "id": "ListInstancesResponse" } }, - "protocol": "rest", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, + "protocol": "rest", "version": "v1beta4", "baseUrl": "https://appengine.googleapis.com/", "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/appengine.admin": { - "description": "View and manage your applications deployed on Google App Engine" - }, "https://www.googleapis.com/auth/cloud-platform.read-only": { "description": "View your data across Google Cloud Platform services" }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/appengine.admin": { + "description": "View and manage your applications deployed on Google App Engine" } } } }, - "servicePath": "", "kind": "discovery#restDescription", - "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications." + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "servicePath": "", + "rootUrl": "https://appengine.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "appengine", + "batchPath": "batch", + "id": "appengine:v1beta4", + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "revision": "20170914", + "title": "Google App Engine Admin API" } diff --git a/etc/api/appengine/v1beta4/crates/1.0.6-api+20170914 b/etc/api/appengine/v1beta4/crates/1.0.6-api+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appengine/v1beta4/crates/1.0.6-cli+20170914 b/etc/api/appengine/v1beta4/crates/1.0.6-cli+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appengine/v1beta5/appengine-api.json b/etc/api/appengine/v1beta5/appengine-api.json index b87e5e3b37..cfd1eee629 100644 --- a/etc/api/appengine/v1beta5/appengine-api.json +++ b/etc/api/appengine/v1beta5/appengine-api.json @@ -1,26 +1,827 @@ { + "ownerName": "Google", + "discoveryVersion": "v1", + "resources": { + "apps": { + "methods": { + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + }, + "mask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1beta5/apps/{appsId}", + "path": "v1beta5/apps/{appsId}", + "id": "appengine.apps.patch", + "request": { + "$ref": "Application" + }, + "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain)\ndefault_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration)" + }, + "get": { + "description": "Gets information about an application.", + "response": { + "$ref": "Application" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "ensureResourcesExist": { + "location": "query", + "description": "Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. Note: This parameter will be deprecated in a future version of the API.", + "type": "boolean" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the application to get. Example: apps/myapp.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta5/apps/{appsId}", + "id": "appengine.apps.get", + "path": "v1beta5/apps/{appsId}" + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta5/apps", + "id": "appengine.apps.create", + "path": "v1beta5/apps", + "request": { + "$ref": "Application" + }, + "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/)." + } + }, + "resources": { + "locations": { + "methods": { + "get": { + "description": "Get information about a location.", + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "appsId", + "locationsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "locationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Resource name for the location.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta5/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.get", + "path": "v1beta5/apps/{appsId}/locations/{locationsId}" + }, + "list": { + "id": "appengine.apps.locations.list", + "path": "v1beta5/apps/{appsId}/locations", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true + }, + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + } + }, + "flatPath": "v1beta5/apps/{appsId}/locations" + } + } + }, + "services": { + "methods": { + "delete": { + "description": "Deletes the specified service and all enclosed versions.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "DELETE", + "parameters": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.delete", + "path": "v1beta5/apps/{appsId}/services/{servicesId}" + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "PATCH", + "parameters": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + }, + "migrateTraffic": { + "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", + "type": "boolean", + "location": "query" + }, + "mask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.patch", + "path": "v1beta5/apps/{appsId}/services/{servicesId}", + "description": "Updates the configuration of the specified service.", + "request": { + "$ref": "Service" + } + }, + "list": { + "response": { + "$ref": "ListServicesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp.", + "type": "string", + "required": true, + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta5/apps/{appsId}/services", + "id": "appengine.apps.services.list", + "path": "v1beta5/apps/{appsId}/services", + "description": "Lists all the services in the application." + }, + "get": { + "description": "Gets the current configuration of the specified service.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "servicesId" + ], + "response": { + "$ref": "Service" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", + "path": "v1beta5/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.get" + } + }, + "resources": { + "versions": { + "methods": { + "create": { + "description": "Deploys new code and resource files to a new version.", + "request": { + "$ref": "Version" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/services/default\".", + "type": "string", + "required": true, + "location": "path" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.create", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions" + }, + "delete": { + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "response": { + "$ref": "Operation" + }, + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.delete", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "description": "Deletes an existing version." + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "PATCH", + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", + "type": "string", + "required": true + }, + "mask": { + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.", + "type": "string", + "location": "query" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.patch", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.", + "request": { + "$ref": "Version" + } + }, + "list": { + "description": "Lists the versions of a service.", + "response": { + "$ref": "ListVersionsResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer" + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the List response.", + "type": "string" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.list", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Version" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true + }, + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "description": "Controls the set of fields returned in the Get response.", + "type": "string", + "location": "query" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.get", + "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource." + } + }, + "resources": { + "instances": { + "methods": { + "list": { + "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", + "response": { + "$ref": "ListInstancesResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageSize": { + "format": "int32", + "description": "Maximum results to return per page.", + "type": "integer", + "location": "query" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "id": "appengine.apps.services.versions.instances.list", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances" + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Instance" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "instancesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.get", + "description": "Gets instance information." + }, + "debug": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "instancesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", + "type": "string", + "required": true + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "id": "appengine.apps.services.versions.instances.debug", + "request": { + "$ref": "DebugInstanceRequest" + }, + "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment." + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "instancesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/services/default/versions/v1/instances/instance-1\".", + "type": "string", + "required": true, + "location": "path" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.delete", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "description": "Stops a running instance." + } + } + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "id": "appengine.apps.operations.get", + "path": "v1beta5/apps/{appsId}/operations/{operationsId}", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "operationsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. The name of the operation resource.", + "type": "string", + "required": true, + "location": "path" + }, + "operationsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta5/apps/{appsId}/operations/{operationsId}" + }, + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + } + }, + "flatPath": "v1beta5/apps/{appsId}/operations", + "id": "appengine.apps.operations.list", + "path": "v1beta5/apps/{appsId}/operations", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id." + } + } + } + } + } + }, "parameters": { - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", @@ -29,20 +830,27 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", "location": "query" }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", + "callback": { + "description": "JSONP", "type": "string", "location": "query" }, "$.xgafv": { + "description": "V1 error format.", + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -51,22 +859,9 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" + ] }, "alt": { - "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", "description": "Data format for response.", "default": "json", "enum": [ @@ -74,6 +869,17 @@ "media", "proto" ], + "type": "string", + "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" + }, + "key": { + "location": "query", + "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.", "type": "string" }, "access_token": { @@ -81,161 +887,48 @@ "type": "string", "location": "query" }, - "key": { + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { "location": "query", - "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.", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", "type": "string" } }, "schemas": { - "CpuUtilization": { - "id": "CpuUtilization", - "description": "Target scaling by CPU usage.", - "type": "object", - "properties": { - "aggregationWindowLength": { - "description": "Period of time over which CPU utilization is calculated.", - "format": "google-duration", - "type": "string" - }, - "targetUtilization": { - "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", - "format": "double", - "type": "number" - } - } - }, - "Status": { - "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" - }, - "details": { - "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - } - }, - "id": "Status" - }, - "IdentityAwareProxy": { - "id": "IdentityAwareProxy", - "description": "Identity-Aware Proxy", - "type": "object", - "properties": { - "enabled": { - "description": "Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields must be non-empty.", - "type": "boolean" - }, - "oauth2ClientSecret": { - "description": "For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2_client_secret_sha256 field.@InputOnly", - "type": "string" - }, - "oauth2ClientId": { - "description": "OAuth2 client ID to use for the authentication flow.", - "type": "string" - }, - "oauth2ClientSecretSha256": { - "description": "Hex-encoded SHA-256 hash of the client secret.@OutputOnly", - "type": "string" - } - } - }, - "TrafficSplit": { - "id": "TrafficSplit", - "description": "Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions.", - "type": "object", - "properties": { - "shardBy": { - "enumDescriptions": [ - "Diversion method unspecified.", - "Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or else no diversion will occur.", - "Diversion based on applying the modulus operation to a fingerprint of the IP address." - ], - "enum": [ - "UNSPECIFIED", - "COOKIE", - "IP" - ], - "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", - "type": "string" - }, - "allocations": { - "description": "Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", - "type": "object", - "additionalProperties": { - "format": "double", - "type": "number" - } - } - } - }, - "ManualScaling": { - "id": "ManualScaling", - "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", - "type": "object", - "properties": { - "instances": { - "description": "Number of instances to assign to the service at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", - "format": "int32", - "type": "integer" - } - } - }, "LocationMetadata": { - "id": "LocationMetadata", "description": "Metadata for the given google.cloud.location.Location.", "type": "object", "properties": { - "standardEnvironmentAvailable": { - "description": "App Engine Standard Environment is available in the given location.@OutputOnly", - "type": "boolean" - }, "flexibleEnvironmentAvailable": { "description": "App Engine Flexible Environment is available in the given location.@OutputOnly", "type": "boolean" + }, + "standardEnvironmentAvailable": { + "description": "App Engine Standard Environment is available in the given location.@OutputOnly", + "type": "boolean" } - } + }, + "id": "LocationMetadata" }, "OperationMetadataV1Beta": { - "id": "OperationMetadataV1Beta", "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { - "warning": { - "description": "Durable messages that persist on every operation poll. @OutputOnly", - "type": "array", - "items": { - "type": "string" - } - }, - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "user": { - "description": "User who requested this operation.@OutputOnly", - "type": "string" - }, - "target": { - "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", - "type": "string" - }, "ephemeralMessage": { "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", "type": "string" @@ -245,45 +938,66 @@ "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", "type": "string" } - } + }, + "id": "OperationMetadataV1Beta" }, "ListServicesResponse": { - "id": "ListServicesResponse", - "description": "Response message for Services.ListServices.", - "type": "object", "properties": { - "services": { - "description": "The services belonging to the requested application.", - "type": "array", - "items": { - "$ref": "Service" - } - }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", "type": "string" + }, + "services": { + "description": "The services belonging to the requested application.", + "items": { + "$ref": "Service" + }, + "type": "array" } - } + }, + "id": "ListServicesResponse", + "description": "Response message for Services.ListServices.", + "type": "object" }, "Deployment": { "description": "Code and application artifacts used to deploy a version to App Engine.", "type": "object", "properties": { + "sourceReferences": { + "description": "Origin of the source code for this deployment. There can be more than one source reference per version if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + }, + "type": "array" + }, "container": { "description": "The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment.", "$ref": "ContainerInfo" }, - "sourceReferences": { - "description": "Origin of the source code for this deployment. There can be more than one source reference per version if source code is distributed among multiple repositories.", - "type": "array", - "items": { - "$ref": "SourceReference" - } - }, "files": { "additionalProperties": { "$ref": "FileInfo" @@ -295,33 +1009,52 @@ "id": "Deployment" }, "Resources": { - "id": "Resources", - "description": "Machine resources for a version.", - "type": "object", "properties": { - "volumes": { - "description": "Volumes mounted within the app container.", - "type": "array", - "items": { - "$ref": "Volume" - } - }, - "diskGb": { - "description": "Disk size (GB) needed.", + "memoryGb": { "format": "double", + "description": "Memory (GB) needed.", "type": "number" }, "cpu": { - "description": "Number of CPU cores needed.", "format": "double", + "description": "Number of CPU cores needed.", "type": "number" }, - "memoryGb": { - "description": "Memory (GB) needed.", + "volumes": { + "description": "Volumes mounted within the app container.", + "items": { + "$ref": "Volume" + }, + "type": "array" + }, + "diskGb": { "format": "double", + "description": "Disk size (GB) needed.", "type": "number" } - } + }, + "id": "Resources", + "description": "Machine resources for a version.", + "type": "object" + }, + "Service": { + "description": "A Service resource is a logical component of an application that can share state and communicate in a secure fashion with other services. For example, an application that handles customer requests might include separate services to handle other tasks such as API requests from mobile devices or backend data analysis. Each service has a collection of versions that define a specific set of code used to implement the functionality of that service.", + "type": "object", + "properties": { + "split": { + "description": "Mapping that defines fractional HTTP traffic diversion to different versions within the service.", + "$ref": "TrafficSplit" + }, + "id": { + "description": "Relative name of the service within the application. Example: default.@OutputOnly", + "type": "string" + }, + "name": { + "description": "Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + } + }, + "id": "Service" }, "Volume": { "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", @@ -332,8 +1065,8 @@ "type": "string" }, "sizeGb": { - "description": "Volume size in gigabytes.", "format": "double", + "description": "Volume size in gigabytes.", "type": "number" }, "name": { @@ -343,28 +1076,7 @@ }, "id": "Volume" }, - "Service": { - "id": "Service", - "description": "A Service resource is a logical component of an application that can share state and communicate in a secure fashion with other services. For example, an application that handles customer requests might include separate services to handle other tasks such as API requests from mobile devices or backend data analysis. Each service has a collection of versions that define a specific set of code used to implement the functionality of that service.", - "type": "object", - "properties": { - "id": { - "description": "Relative name of the service within the application. Example: default.@OutputOnly", - "type": "string" - }, - "name": { - "description": "Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly", - "type": "string" - }, - "split": { - "description": "Mapping that defines fractional HTTP traffic diversion to different versions within the service.", - "$ref": "TrafficSplit" - } - } - }, "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", "properties": { "nextPageToken": { "description": "The standard List next-page token.", @@ -372,43 +1084,45 @@ }, "operations": { "description": "A list of operations that matches the specified filter in the request.", - "type": "array", "items": { "$ref": "Operation" - } + }, + "type": "array" } }, - "id": "ListOperationsResponse" + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations.", + "type": "object" }, "OperationMetadata": { "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { - "target": { - "description": "Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly", + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", "type": "string" }, "user": { "description": "User who requested this operation.@OutputOnly", "type": "string" }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly", + "type": "string" + }, "method": { "description": "API method that initiated this operation. Example: google.appengine.v1beta4.Version.CreateVersion.@OutputOnly", "type": "string" }, "endTime": { - "description": "Timestamp that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", "type": "string" }, "operationType": { "description": "Type of this operation. Deprecated, use method field instead. Example: \"create_version\".@OutputOnly", "type": "string" - }, - "insertTime": { - "description": "Timestamp that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" } }, "id": "OperationMetadata" @@ -417,16 +1131,16 @@ "description": "Response message for Instances.ListInstances.", "type": "object", "properties": { - "instances": { - "description": "The instances belonging to the requested version.", - "type": "array", - "items": { - "$ref": "Instance" - } - }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", "type": "string" + }, + "instances": { + "description": "The instances belonging to the requested version.", + "items": { + "$ref": "Instance" + }, + "type": "array" } }, "id": "ListInstancesResponse" @@ -435,14 +1149,11 @@ "description": "Custom static error page to be served when an error occurs.", "type": "object", "properties": { + "mimeType": { + "description": "MIME type of file. Defaults to text/html.", + "type": "string" + }, "errorCode": { - "enumDescriptions": [ - "Not specified. ERROR_CODE_DEFAULT is assumed.", - "All other error types.", - "Application has exceeded a resource quota.", - "Client blocked by the application's Denial of Service protection configuration.", - "Deadline reached before the application responds." - ], "enum": [ "ERROR_CODE_UNSPECIFIED", "ERROR_CODE_DEFAULT", @@ -451,11 +1162,14 @@ "ERROR_CODE_TIMEOUT" ], "description": "Error condition this handler applies to.", - "type": "string" - }, - "mimeType": { - "description": "MIME type of file. Defaults to text/html.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Not specified. ERROR_CODE_DEFAULT is assumed.", + "All other error types.", + "Application has exceeded a resource quota.", + "Client blocked by the application's Denial of Service protection configuration.", + "Deadline reached before the application responds." + ] }, "staticFile": { "description": "Static file content to be served for this error.", @@ -465,21 +1179,18 @@ "id": "ErrorHandler" }, "OperationMetadataV1": { - "id": "OperationMetadataV1", - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", "properties": { - "insertTime": { - "description": "Time that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, "warning": { "description": "Durable messages that persist on every operation poll. @OutputOnly", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" }, "user": { "description": "User who requested this operation.@OutputOnly", @@ -498,31 +1209,59 @@ "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", "type": "string" } - } + }, + "id": "OperationMetadataV1", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "OperationMetadataV1Alpha": { + "properties": { + "endTime": { + "format": "google-datetime", + "description": "Time that this operation completed.@OutputOnly", + "type": "string" + }, + "warning": { + "description": "Durable messages that persist on every operation poll. @OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertTime": { + "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "ephemeralMessage": { + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly", + "type": "string" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + } + }, + "id": "OperationMetadataV1Alpha", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" }, "Application": { "description": "An Application resource contains the top-level configuration of an App Engine application.", "type": "object", "properties": { - "dispatchRules": { - "description": "HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent.@OutputOnly", - "type": "array", - "items": { - "$ref": "UrlDispatchRule" - } - }, - "defaultHostname": { - "description": "Hostname used to reach the application, as resolved by App Engine.@OutputOnly", - "type": "string" - }, - "name": { - "description": "Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly", - "type": "string" - }, "iap": { "$ref": "IdentityAwareProxy" }, @@ -535,8 +1274,8 @@ "type": "string" }, "defaultCookieExpiration": { - "description": "Cookie expiration policy for this application.", "format": "google-duration", + "description": "Cookie expiration policy for this application.", "type": "string" }, "codeBucket": { @@ -550,67 +1289,64 @@ "defaultBucket": { "description": "A Google Cloud Storage bucket that can be used by the application to store content.@OutputOnly", "type": "string" + }, + "dispatchRules": { + "description": "HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent.@OutputOnly", + "items": { + "$ref": "UrlDispatchRule" + }, + "type": "array" + }, + "defaultHostname": { + "description": "Hostname used to reach the application, as resolved by App Engine.@OutputOnly", + "type": "string" + }, + "name": { + "description": "Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly", + "type": "string" } }, "id": "Application" }, "Network": { - "id": "Network", "description": "Extra network settings. Only applicable for VM runtimes.", "type": "object", "properties": { - "name": { - "description": "Google Cloud Platform network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.", + "subnetworkName": { + "description": "Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network.\nIf the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range.\nIf the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network.\nIf the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app.", "type": "string" }, - "forwardedPorts": { - "description": "List of ports, or port pairs, to forward from the virtual machine to the application container.", - "type": "array", - "items": { - "type": "string" - } - }, "instanceTag": { "description": "Tag to apply to the VM instance during creation.", "type": "string" }, - "subnetworkName": { - "description": "Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network.\nIf the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range.\nIf the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network.\nIf the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app.", + "forwardedPorts": { + "description": "List of ports, or port pairs, to forward from the virtual machine to the application container.", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Google Cloud Platform network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.", "type": "string" } - } + }, + "id": "Network" }, "Instance": { "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", "type": "object", "properties": { - "requests": { - "description": "Number of requests since this instance was started.@OutputOnly", - "format": "int32", - "type": "integer" - }, - "appEngineRelease": { - "description": "App Engine release this instance is running on.@OutputOnly", - "type": "string" - }, - "startTimestamp": { - "description": "Time that this instance was started.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "vmName": { - "description": "Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" - }, - "qps": { - "description": "Average queries per second (QPS) over the last minute.@OutputOnly", - "format": "float", - "type": "number" - }, "vmId": { "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" }, + "qps": { + "format": "float", + "description": "Average queries per second (QPS) over the last minute.@OutputOnly", + "type": "number" + }, "vmZoneName": { "description": "Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" @@ -624,85 +1360,103 @@ "type": "string" }, "averageLatency": { - "description": "Average latency (ms) over the last minute.@OutputOnly", "format": "int32", + "description": "Average latency (ms) over the last minute.@OutputOnly", "type": "integer" }, - "vmIp": { - "description": "The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", - "type": "string" - }, - "memoryUsage": { - "description": "Total memory in use (bytes).@OutputOnly", - "format": "int64", - "type": "string" - }, "id": { "description": "Relative name of the instance within the version. Example: instance-1.@OutputOnly", "type": "string" }, + "memoryUsage": { + "format": "int64", + "description": "Total memory in use (bytes).@OutputOnly", + "type": "string" + }, + "vmIp": { + "description": "The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + }, + "errors": { + "format": "uint32", + "description": "Number of errors since this instance was started.@OutputOnly", + "type": "integer" + }, "availability": { - "enumDescriptions": [ - "", - "", - "" - ], "enum": [ "UNSPECIFIED", "RESIDENT", "DYNAMIC" ], "description": "Availability of the instance.@OutputOnly", - "type": "string" - }, - "errors": { - "description": "Number of errors since this instance was started.@OutputOnly", - "format": "uint32", - "type": "integer" + "type": "string", + "enumDescriptions": [ + "", + "", + "" + ] }, "vmStatus": { "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", "type": "string" + }, + "requests": { + "format": "int32", + "description": "Number of requests since this instance was started.@OutputOnly", + "type": "integer" + }, + "appEngineRelease": { + "description": "App Engine release this instance is running on.@OutputOnly", + "type": "string" + }, + "startTimestamp": { + "format": "google-datetime", + "description": "Time that this instance was started.@OutputOnly", + "type": "string" + }, + "vmName": { + "description": "Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" } }, "id": "Instance" }, "UrlDispatchRule": { - "id": "UrlDispatchRule", "description": "Rules to match an HTTP request and dispatch that request to a service.", "type": "object", "properties": { - "path": { - "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters.", + "service": { + "description": "Resource id of a service in this application that should serve the matched request. The service must already exist. Example: default.", "type": "string" }, "domain": { "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", "type": "string" }, - "service": { - "description": "Resource id of a service in this application that should serve the matched request. The service must already exist. Example: default.", - "type": "string" - } - } - }, - "ListVersionsResponse": { - "description": "Response message for Versions.ListVersions.", - "type": "object", - "properties": { - "versions": { - "description": "The versions belonging to the requested service.", - "type": "array", - "items": { - "$ref": "Version" - } - }, - "nextPageToken": { - "description": "Continuation token for fetching the next page of results.", + "path": { + "description": "Pathname within the host. Must start with a \"/\". A single \"*\" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters.", "type": "string" } }, - "id": "ListVersionsResponse" + "id": "UrlDispatchRule" + }, + "ListVersionsResponse": { + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "versions": { + "description": "The versions belonging to the requested service.", + "items": { + "$ref": "Version" + }, + "type": "array" + } + }, + "id": "ListVersionsResponse", + "description": "Response message for Versions.ListVersions.", + "type": "object" }, "ApiEndpointHandler": { "description": "Uses Google Cloud Endpoints to handle requests.", @@ -719,9 +1473,33 @@ "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", "type": "object", "properties": { - "minTotalInstances": { - "description": "Minimum number of instances that should be maintained for this version.", + "minPendingLatency": { + "format": "google-duration", + "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", + "type": "string" + }, + "maxIdleInstances": { "format": "int32", + "description": "Maximum number of idle instances that should be maintained for this version.", + "type": "integer" + }, + "requestUtilization": { + "$ref": "RequestUtilization", + "description": "Target scaling by request utilization." + }, + "minIdleInstances": { + "format": "int32", + "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module.", + "type": "integer" + }, + "maxTotalInstances": { + "format": "int32", + "description": "Maximum number of instances that should be started to handle requests.", + "type": "integer" + }, + "minTotalInstances": { + "format": "int32", + "description": "Minimum number of instances that should be maintained for this version.", "type": "integer" }, "networkUtilization": { @@ -729,142 +1507,92 @@ "$ref": "NetworkUtilization" }, "maxConcurrentRequests": { - "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", "format": "int32", + "description": "Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value.", "type": "integer" }, "coolDownPeriod": { - "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", "format": "google-duration", + "description": "Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Only applicable for VM runtimes.", "type": "string" }, "maxPendingLatency": { - "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", "format": "google-duration", + "description": "Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it.", "type": "string" }, "cpuUtilization": { - "description": "Target scaling by CPU usage.", - "$ref": "CpuUtilization" + "$ref": "CpuUtilization", + "description": "Target scaling by CPU usage." }, "diskUtilization": { - "$ref": "DiskUtilization", - "description": "Target scaling by disk usage." - }, - "minPendingLatency": { - "description": "Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it.", - "format": "google-duration", - "type": "string" - }, - "requestUtilization": { - "$ref": "RequestUtilization", - "description": "Target scaling by request utilization." - }, - "maxIdleInstances": { - "description": "Maximum number of idle instances that should be maintained for this version.", - "format": "int32", - "type": "integer" - }, - "minIdleInstances": { - "description": "Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module.", - "format": "int32", - "type": "integer" - }, - "maxTotalInstances": { - "description": "Maximum number of instances that should be started to handle requests.", - "format": "int32", - "type": "integer" + "description": "Target scaling by disk usage.", + "$ref": "DiskUtilization" } }, "id": "AutomaticScaling" }, "NetworkUtilization": { - "id": "NetworkUtilization", "description": "Target scaling by network usage. Only applicable for VM runtimes.", "type": "object", "properties": { - "targetSentBytesPerSec": { - "description": "Target bytes sent per second.", - "format": "int32", - "type": "integer" - }, - "targetReceivedPacketsPerSec": { - "description": "Target packets received per second.", - "format": "int32", - "type": "integer" - }, "targetReceivedBytesPerSec": { - "description": "Target bytes received per second.", "format": "int32", + "description": "Target bytes received per second.", "type": "integer" }, "targetSentPacketsPerSec": { - "description": "Target packets sent per second.", "format": "int32", + "description": "Target packets sent per second.", + "type": "integer" + }, + "targetReceivedPacketsPerSec": { + "format": "int32", + "description": "Target packets received per second.", + "type": "integer" + }, + "targetSentBytesPerSec": { + "format": "int32", + "description": "Target bytes sent per second.", "type": "integer" } - } + }, + "id": "NetworkUtilization" }, "Location": { "description": "A resource that represents Google Cloud Platform location.", "type": "object", "properties": { - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", - "type": "object" - }, - "name": { - "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"", - "type": "string" - }, "locationId": { "description": "The canonical id for this location. For example: \"us-east1\".", "type": "string" }, "metadata": { - "description": "Service-specific metadata. For example the available capacity at the given location.", - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" + }, + "description": "Service-specific metadata. For example the available capacity at the given location.", + "type": "object" + }, + "labels": { + "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", + "type": "object", + "additionalProperties": { + "type": "string" } + }, + "name": { + "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"", + "type": "string" } }, "id": "Location" }, "HealthCheck": { - "id": "HealthCheck", "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.", "type": "object", "properties": { - "restartThreshold": { - "description": "Number of consecutive failed health checks required before an instance is restarted.", - "format": "uint32", - "type": "integer" - }, - "healthyThreshold": { - "description": "Number of consecutive successful health checks required before receiving traffic.", - "format": "uint32", - "type": "integer" - }, - "checkInterval": { - "description": "Interval between health checks.", - "format": "google-duration", - "type": "string" - }, - "timeout": { - "description": "Time before the health check is considered failed.", - "format": "google-duration", - "type": "string" - }, - "unhealthyThreshold": { - "description": "Number of consecutive failed health checks required before removing traffic.", - "format": "uint32", - "type": "integer" - }, "disableHealthCheck": { "description": "Whether to explicitly disable health checks for this instance.", "type": "boolean" @@ -872,63 +1600,60 @@ "host": { "description": "Host header to send when performing an HTTP health check. Example: \"myapp.appspot.com\"", "type": "string" - } - } - }, - "DebugInstanceRequest": { - "id": "DebugInstanceRequest", - "description": "Request message for Instances.DebugInstance.", - "type": "object", - "properties": { - "sshKey": { - "description": "Public SSH key to add to the instance. Examples:\n[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]\n[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {\"userName\":\"[USERNAME]\",\"expireOn\":\"[EXPIRE_TIME]\"}For more information, see Adding and Removing SSH Keys (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).", + }, + "healthyThreshold": { + "format": "uint32", + "description": "Number of consecutive successful health checks required before receiving traffic.", + "type": "integer" + }, + "restartThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before an instance is restarted.", + "type": "integer" + }, + "checkInterval": { + "format": "google-duration", + "description": "Interval between health checks.", "type": "string" + }, + "timeout": { + "format": "google-duration", + "description": "Time before the health check is considered failed.", + "type": "string" + }, + "unhealthyThreshold": { + "format": "uint32", + "description": "Number of consecutive failed health checks required before removing traffic.", + "type": "integer" } - } + }, + "id": "HealthCheck" }, "SourceReference": { "description": "Reference to a particular snapshot of the source tree used to build and deploy the application.", "type": "object", "properties": { - "repository": { - "description": "URI string identifying the repository. Example: \"https://source.developers.google.com/p/app-123/r/default\"", - "type": "string" - }, "revisionId": { "description": "The canonical, persistent identifier of the deployed revision. Aliases that include tags or branch names are not allowed. Example (git): \"2198322f89e0bb2e25021667c2ed489d1fd34e6b\"", "type": "string" + }, + "repository": { + "description": "URI string identifying the repository. Example: \"https://source.developers.google.com/p/app-123/r/default\"", + "type": "string" } }, "id": "SourceReference" }, - "OperationMetadataV1Beta5": { - "id": "OperationMetadataV1Beta5", - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", + "DebugInstanceRequest": { "properties": { - "user": { - "description": "User who requested this operation.@OutputOnly", - "type": "string" - }, - "target": { - "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", - "type": "string" - }, - "method": { - "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", - "type": "string" - }, - "insertTime": { - "description": "Timestamp that this operation was created.@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "endTime": { - "description": "Timestamp that this operation completed.@OutputOnly", - "format": "google-datetime", + "sshKey": { + "description": "Public SSH key to add to the instance. Examples:\n[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]\n[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {\"userName\":\"[USERNAME]\",\"expireOn\":\"[EXPIRE_TIME]\"}For more information, see Adding and Removing SSH Keys (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).", "type": "string" } - } + }, + "id": "DebugInstanceRequest", + "description": "Request message for Instances.DebugInstance.", + "type": "object" }, "Library": { "description": "Third-party Python runtime library that is required by the application.", @@ -945,36 +1670,100 @@ }, "id": "Library" }, - "ListLocationsResponse": { - "description": "The response message for Locations.ListLocations.", + "OperationMetadataV1Beta5": { + "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { - "locations": { - "description": "A list of locations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Location" - } + "insertTime": { + "format": "google-datetime", + "description": "Timestamp that this operation was created.@OutputOnly", + "type": "string" }, - "nextPageToken": { - "description": "The standard List next-page token.", + "endTime": { + "format": "google-datetime", + "description": "Timestamp that this operation completed.@OutputOnly", + "type": "string" + }, + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "method": { + "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", "type": "string" } }, - "id": "ListLocationsResponse" + "id": "OperationMetadataV1Beta5" + }, + "ListLocationsResponse": { + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + } + }, + "id": "ListLocationsResponse", + "description": "The response message for Locations.ListLocations.", + "type": "object" + }, + "ContainerInfo": { + "description": "Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment.", + "type": "object", + "properties": { + "image": { + "description": "URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: \"gcr.io/my-project/image:tag\" or \"gcr.io/my-project/image@digest\"", + "type": "string" + } + }, + "id": "ContainerInfo" }, "Version": { - "id": "Version", "description": "A Version resource is a specific set of source code and configuration files that are deployed into a service.", "type": "object", "properties": { + "automaticScaling": { + "$ref": "AutomaticScaling", + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics." + }, + "diskUsageBytes": { + "format": "int64", + "description": "Total size of version files hosted on App Engine disk in bytes.@OutputOnly", + "type": "string" + }, + "healthCheck": { + "description": "Configures health checking for VM instances. Unhealthy instances are be stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set.", + "$ref": "HealthCheck" + }, + "threadsafe": { + "description": "Whether multiple requests can be dispatched to this version at once.", + "type": "boolean" + }, + "manualScaling": { + "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", + "$ref": "ManualScaling" + }, + "name": { + "description": "Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly", + "type": "string" + }, "apiConfig": { "description": "Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set.", "$ref": "ApiConfigHandler" }, "endpointsApiService": { - "$ref": "EndpointsApiService", - "description": "Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app." + "description": "Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app.", + "$ref": "EndpointsApiService" }, "vm": { "description": "Whether to deploy this version in a container on a virtual machine.", @@ -999,16 +1788,30 @@ "type": "string" }, "deployment": { - "$ref": "Deployment", - "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set." + "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set.", + "$ref": "Deployment" + }, + "runtimeApiVersion": { + "description": "The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard/\u003clanguage\u003e/config/appref", + "type": "string" }, "resources": { - "$ref": "Resources", - "description": "Machine resources for this version. Only applicable for VM runtimes." + "description": "Machine resources for this version. Only applicable for VM runtimes.", + "$ref": "Resources" }, "inboundServices": { + "enumDescriptions": [ + "Not specified.", + "Allows an application to receive mail.", + "Allows an application to receive email-bound notifications.", + "Allows an application to receive error stanzas.", + "Allows an application to receive instant messages.", + "Allows an application to receive user subscription POSTs.", + "Allows an application to receive a user's chat presence.", + "Registers an application for notifications when a client connects or disconnects from a channel.", + "Enables warmup requests." + ], "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", - "type": "array", "items": { "enum": [ "INBOUND_SERVICE_UNSPECIFIED", @@ -1023,40 +1826,30 @@ ], "type": "string" }, - "enumDescriptions": [ - "Not specified.", - "Allows an application to receive mail.", - "Allows an application to receive email-bound notifications.", - "Allows an application to receive error stanzas.", - "Allows an application to receive instant messages.", - "Allows an application to receive user subscription POSTs.", - "Allows an application to receive a user's chat presence.", - "Registers an application for notifications when a client connects or disconnects from a channel.", - "Enables warmup requests." - ] + "type": "array" }, "errorHandlers": { "description": "Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set.", - "type": "array", "items": { "$ref": "ErrorHandler" - } + }, + "type": "array" }, "defaultExpiration": { - "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", "format": "google-duration", + "description": "Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set.", "type": "string" }, "libraries": { "description": "Configuration for third-party Python runtime libraries required by the application.Only returned in GET requests if view=FULL is set.", - "type": "array", "items": { "$ref": "Library" - } + }, + "type": "array" }, "creationTime": { - "description": "Time that this version was created.@OutputOnly", "format": "google-datetime", + "description": "Time that this version was created.@OutputOnly", "type": "string" }, "nobuildFilesRegex": { @@ -1099,111 +1892,55 @@ }, "handlers": { "description": "An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set.", - "type": "array", "items": { "$ref": "UrlMap" - } + }, + "type": "array" }, "deployer": { "description": "Email address of the user who created this version.@OutputOnly", "type": "string" - }, - "automaticScaling": { - "$ref": "AutomaticScaling", - "description": "Automatic scaling is based on request rate, response latencies, and other application metrics." - }, - "diskUsageBytes": { - "description": "Total size of version files hosted on App Engine disk in bytes.@OutputOnly", - "format": "int64", - "type": "string" - }, - "healthCheck": { - "$ref": "HealthCheck", - "description": "Configures health checking for VM instances. Unhealthy instances are be stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set." - }, - "threadsafe": { - "description": "Whether multiple requests can be dispatched to this version at once.", - "type": "boolean" - }, - "manualScaling": { - "$ref": "ManualScaling", - "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time." - }, - "name": { - "description": "Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly", - "type": "string" } - } - }, - "ContainerInfo": { - "id": "ContainerInfo", - "description": "Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment.", - "type": "object", - "properties": { - "image": { - "description": "URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: \"gcr.io/my-project/image:tag\" or \"gcr.io/my-project/image@digest\"", - "type": "string" - } - } + }, + "id": "Version" }, "RequestUtilization": { "description": "Target scaling by request utilization. Only applicable for VM runtimes.", "type": "object", "properties": { - "targetRequestCountPerSec": { - "description": "Target requests per second.", + "targetConcurrentRequests": { "format": "int32", + "description": "Target number of concurrent requests.", "type": "integer" }, - "targetConcurrentRequests": { - "description": "Target number of concurrent requests.", + "targetRequestCountPerSec": { "format": "int32", + "description": "Target requests per second.", "type": "integer" } }, "id": "RequestUtilization" }, + "EndpointsApiService": { + "description": "Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The Endpoints API Service provides tooling for serving Open API and gRPC endpoints via an NGINX proxy.The fields here refer to the name and configuration id of a \"service\" resource in the Service Management API (https://cloud.google.com/service-management/overview).", + "type": "object", + "properties": { + "configId": { + "description": "Endpoints service configuration id as specified by the Service Management API. For example \"2016-09-19r1\"", + "type": "string" + }, + "name": { + "description": "Endpoints service name which is the name of the \"service\" resource in the Service Management API. For example \"myapi.endpoints.myproject.cloud.goog\"", + "type": "string" + } + }, + "id": "EndpointsApiService" + }, "UrlMap": { - "id": "UrlMap", "description": "URL pattern and description of how the URL should be handled. App Engine can handle URLs by executing application code, or by serving static files uploaded with the version, such as images, CSS, or JavaScript.", "type": "object", "properties": { - "urlRegex": { - "description": "A URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path.", - "type": "string" - }, - "login": { - "description": "Level of login required to access this resource.", - "type": "string", - "enumDescriptions": [ - "Not specified. LOGIN_OPTIONAL is assumed.", - "Does not require that the user is signed in.", - "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", - "If the user has signed in, the handler proceeds normally. Otherwise, the action given in auth_fail_action is taken." - ], - "enum": [ - "LOGIN_UNSPECIFIED", - "LOGIN_OPTIONAL", - "LOGIN_ADMIN", - "LOGIN_REQUIRED" - ] - }, - "apiEndpoint": { - "$ref": "ApiEndpointHandler", - "description": "Uses API Endpoints to handle requests." - }, - "staticFiles": { - "description": "Returns the contents of a file, such as an image, as the response.", - "$ref": "StaticFilesHandler" - }, "redirectHttpResponseCode": { - "enumDescriptions": [ - "Not specified. 302 is assumed.", - "301 Moved Permanently code.", - "302 Moved Temporarily code.", - "303 See Other code.", - "307 Temporary Redirect code." - ], "enum": [ "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", "REDIRECT_HTTP_RESPONSE_CODE_301", @@ -1212,9 +1949,23 @@ "REDIRECT_HTTP_RESPONSE_CODE_307" ], "description": "30x code to use when performing redirects for the secure field. Defaults to 302.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Not specified. 302 is assumed.", + "301 Moved Permanently code.", + "302 Moved Temporarily code.", + "303 See Other code.", + "307 Temporary Redirect code." + ] }, "securityLevel": { + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ], "description": "Security (HTTPS) enforcement for this URL.", "type": "string", "enumDescriptions": [ @@ -1223,13 +1974,6 @@ "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." - ], - "enum": [ - "SECURE_UNSPECIFIED", - "SECURE_DEFAULT", - "SECURE_NEVER", - "SECURE_OPTIONAL", - "SECURE_ALWAYS" ] }, "authFailAction": { @@ -1249,71 +1993,12 @@ "script": { "description": "Executes a script to handle the request that matches this URL pattern.", "$ref": "ScriptHandler" - } - } - }, - "EndpointsApiService": { - "description": "Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The Endpoints API Service provides tooling for serving Open API and gRPC endpoints via an NGINX proxy.The fields here refer to the name and configuration id of a \"service\" resource in the Service Management API (https://cloud.google.com/service-management/overview).", - "type": "object", - "properties": { - "name": { - "description": "Endpoints service name which is the name of the \"service\" resource in the Service Management API. For example \"myapi.endpoints.myproject.cloud.goog\"", - "type": "string" }, - "configId": { - "description": "Endpoints service configuration id as specified by the Service Management API. For example \"2016-09-19r1\"", - "type": "string" - } - }, - "id": "EndpointsApiService" - }, - "ApiConfigHandler": { - "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", - "type": "object", - "properties": { - "url": { - "description": "URL to serve the endpoint at.", - "type": "string" - }, - "securityLevel": { - "description": "Security (HTTPS) enforcement for this URL.", - "type": "string", - "enumDescriptions": [ - "Not specified.", - "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", - "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", - "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", - "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." - ], - "enum": [ - "SECURE_UNSPECIFIED", - "SECURE_DEFAULT", - "SECURE_NEVER", - "SECURE_OPTIONAL", - "SECURE_ALWAYS" - ] - }, - "authFailAction": { - "description": "Action to take when users access resources that require authentication. Defaults to redirect.", - "type": "string", - "enumDescriptions": [ - "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", - "Redirects user to \"accounts.google.com\". The user is redirected back to the application URL after signing in or creating an account.", - "Rejects request with an401 HTTP status code and an error message." - ], - "enum": [ - "AUTH_FAIL_ACTION_UNSPECIFIED", - "AUTH_FAIL_ACTION_REDIRECT", - "AUTH_FAIL_ACTION_UNAUTHORIZED" - ] - }, - "script": { - "description": "Path to the script from the application root directory.", + "urlRegex": { + "description": "A URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path.", "type": "string" }, "login": { - "description": "Level of login required to access this resource. Defaults to optional.", - "type": "string", "enumDescriptions": [ "Not specified. LOGIN_OPTIONAL is assumed.", "Does not require that the user is signed in.", @@ -1325,15 +2010,98 @@ "LOGIN_OPTIONAL", "LOGIN_ADMIN", "LOGIN_REQUIRED" + ], + "description": "Level of login required to access this resource.", + "type": "string" + }, + "apiEndpoint": { + "$ref": "ApiEndpointHandler", + "description": "Uses API Endpoints to handle requests." + }, + "staticFiles": { + "description": "Returns the contents of a file, such as an image, as the response.", + "$ref": "StaticFilesHandler" + } + }, + "id": "UrlMap" + }, + "ApiConfigHandler": { + "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", + "type": "object", + "properties": { + "script": { + "description": "Path to the script from the application root directory.", + "type": "string" + }, + "login": { + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ], + "description": "Level of login required to access this resource. Defaults to optional.", + "type": "string", + "enumDescriptions": [ + "Not specified. LOGIN_OPTIONAL is assumed.", + "Does not require that the user is signed in.", + "If the user is not signed in, the auth_fail_action is taken. In addition, if the user is not an administrator for the application, they are given an error message regardless of auth_fail_action. If the user is an administrator, the handler proceeds.", + "If the user has signed in, the handler proceeds normally. Otherwise, the action given in auth_fail_action is taken." ] + }, + "url": { + "description": "URL to serve the endpoint at.", + "type": "string" + }, + "securityLevel": { + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ], + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used, and respond accordingly.", + "Requests for a URL that match this handler that use HTTPS are automatically redirected to the HTTP equivalent URL.", + "Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.", + "Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect." + ] + }, + "authFailAction": { + "enumDescriptions": [ + "Not specified. AUTH_FAIL_ACTION_REDIRECT is assumed.", + "Redirects user to \"accounts.google.com\". The user is redirected back to the application URL after signing in or creating an account.", + "Rejects request with an401 HTTP status code and an error message." + ], + "enum": [ + "AUTH_FAIL_ACTION_UNSPECIFIED", + "AUTH_FAIL_ACTION_REDIRECT", + "AUTH_FAIL_ACTION_UNAUTHORIZED" + ], + "description": "Action to take when users access resources that require authentication. Defaults to redirect.", + "type": "string" } }, "id": "ApiConfigHandler" }, "Operation": { - "description": "This resource represents a long-running operation that is the result of a network API call.", - "type": "object", "properties": { + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", + "type": "object" + }, "name": { "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", "type": "string" @@ -1343,48 +2111,41 @@ "description": "The error result of the operation in case of failure or cancellation." }, "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "done": { - "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", - "type": "boolean" - }, - "response": { - "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } + "type": "object" } }, - "id": "Operation" + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object" }, - "ScriptHandler": { - "description": "Executes a script to handle the request that matches the URL pattern.", + "FileInfo": { + "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", "type": "object", "properties": { - "scriptPath": { - "description": "Path to the script from the application root directory.", + "sha1Sum": { + "description": "The SHA1 hash of the file, in hex.", + "type": "string" + }, + "mimeType": { + "description": "The MIME type of the file.Defaults to the value from Google Cloud Storage.", + "type": "string" + }, + "sourceUrl": { + "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", "type": "string" } }, - "id": "ScriptHandler" + "id": "FileInfo" }, "StaticFilesHandler": { "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.", "type": "object", "properties": { - "expiration": { - "description": "Time a static file served by this handler should be cached.", - "format": "google-duration", - "type": "string" - }, "applicationReadable": { "description": "Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.", "type": "boolean" @@ -1411,75 +2172,71 @@ "requireMatchingFile": { "description": "Whether this handler should match the request if the file referenced by the handler does not exist.", "type": "boolean" + }, + "expiration": { + "format": "google-duration", + "description": "Time a static file served by this handler should be cached.", + "type": "string" } }, "id": "StaticFilesHandler" }, - "FileInfo": { - "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", - "type": "object", + "ScriptHandler": { "properties": { - "sha1Sum": { - "description": "The SHA1 hash of the file, in hex.", - "type": "string" - }, - "mimeType": { - "description": "The MIME type of the file.Defaults to the value from Google Cloud Storage.", - "type": "string" - }, - "sourceUrl": { - "description": "URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form 'http(s)://storage.googleapis.com/\u003cbucket\u003e/\u003cobject\u003e'.", + "scriptPath": { + "description": "Path to the script from the application root directory.", "type": "string" } }, - "id": "FileInfo" + "id": "ScriptHandler", + "description": "Executes a script to handle the request that matches the URL pattern.", + "type": "object" }, "BasicScaling": { - "id": "BasicScaling", "description": "A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", "type": "object", "properties": { "maxInstances": { - "description": "Maximum number of instances to create for this version.", "format": "int32", + "description": "Maximum number of instances to create for this version.", "type": "integer" }, "idleTimeout": { - "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", "format": "google-duration", + "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", "type": "string" } - } + }, + "id": "BasicScaling" }, "DiskUtilization": { "description": "Target scaling by disk usage. Only applicable for VM runtimes.", "type": "object", "properties": { - "targetWriteOpsPerSec": { - "description": "Target ops written per second.", - "format": "int32", - "type": "integer" - }, - "targetWriteBytesPerSec": { - "description": "Target bytes written per second.", - "format": "int32", - "type": "integer" - }, "targetReadOpsPerSec": { - "description": "Target ops read per second.", "format": "int32", + "description": "Target ops read per second.", "type": "integer" }, "targetReadBytesPerSec": { - "description": "Target bytes read per second.", "format": "int32", + "description": "Target bytes read per second.", + "type": "integer" + }, + "targetWriteOpsPerSec": { + "format": "int32", + "description": "Target ops written per second.", + "type": "integer" + }, + "targetWriteBytesPerSec": { + "format": "int32", + "description": "Target bytes written per second.", "type": "integer" } }, "id": "DiskUtilization" }, "OperationMetadataExperimental": { - "id": "OperationMetadataExperimental", "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { @@ -1488,24 +2245,133 @@ "type": "string" }, "insertTime": { - "description": "Time that this operation was created.@OutputOnly", "format": "google-datetime", + "description": "Time that this operation was created.@OutputOnly", "type": "string" }, "endTime": { - "description": "Time that this operation completed.@OutputOnly", "format": "google-datetime", - "type": "string" - }, - "user": { - "description": "User who requested this operation.@OutputOnly", + "description": "Time that this operation completed.@OutputOnly", "type": "string" }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly", "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" } - } + }, + "id": "OperationMetadataExperimental" + }, + "CpuUtilization": { + "description": "Target scaling by CPU usage.", + "type": "object", + "properties": { + "aggregationWindowLength": { + "format": "google-duration", + "description": "Period of time over which CPU utilization is calculated.", + "type": "string" + }, + "targetUtilization": { + "format": "double", + "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", + "type": "number" + } + }, + "id": "CpuUtilization" + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "Status" + }, + "IdentityAwareProxy": { + "properties": { + "enabled": { + "description": "Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields must be non-empty.", + "type": "boolean" + }, + "oauth2ClientSecret": { + "description": "For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2_client_secret_sha256 field.@InputOnly", + "type": "string" + }, + "oauth2ClientId": { + "description": "OAuth2 client ID to use for the authentication flow.", + "type": "string" + }, + "oauth2ClientSecretSha256": { + "description": "Hex-encoded SHA-256 hash of the client secret.@OutputOnly", + "type": "string" + } + }, + "id": "IdentityAwareProxy", + "description": "Identity-Aware Proxy", + "type": "object" + }, + "ManualScaling": { + "properties": { + "instances": { + "format": "int32", + "description": "Number of instances to assign to the service at the start. This number can later be altered by using the Modules API (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function.", + "type": "integer" + } + }, + "id": "ManualScaling", + "description": "A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", + "type": "object" + }, + "TrafficSplit": { + "description": "Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions.", + "type": "object", + "properties": { + "allocations": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "description": "Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.", + "type": "object" + }, + "shardBy": { + "enum": [ + "UNSPECIFIED", + "COOKIE", + "IP" + ], + "description": "Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.", + "type": "string", + "enumDescriptions": [ + "Diversion method unspecified.", + "Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or else no diversion will occur.", + "Diversion based on applying the modulus operation to a fingerprint of the IP address." + ] + } + }, + "id": "TrafficSplit" } }, "protocol": "rest", @@ -1518,850 +2384,28 @@ "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/appengine.admin": { - "description": "View and manage your applications deployed on Google App Engine" - }, "https://www.googleapis.com/auth/cloud-platform.read-only": { "description": "View your data across Google Cloud Platform services" }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/appengine.admin": { + "description": "View and manage your applications deployed on Google App Engine" } } } }, - "kind": "discovery#restDescription", - "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", "servicePath": "", + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "kind": "discovery#restDescription", "rootUrl": "https://appengine.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "appengine", "batchPath": "batch", - "revision": "20170522", - "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", "id": "appengine:v1beta5", - "title": "Google App Engine Admin API", - "discoveryVersion": "v1", - "ownerName": "Google", - "resources": { - "apps": { - "methods": { - "create": { - "request": { - "$ref": "Application" - }, - "description": "Creates an App Engine application for a Google Cloud Platform project. Required fields:\nid - The ID of the target Cloud Platform project.\nlocation - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta5/apps", - "path": "v1beta5/apps", - "id": "appengine.apps.create" - }, - "get": { - "parameterOrder": [ - "appsId" - ], - "response": { - "$ref": "Application" - }, - "httpMethod": "GET", - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the application to get. Example: apps/myapp.", - "required": true, - "type": "string", - "location": "path" - }, - "ensureResourcesExist": { - "location": "query", - "description": "Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. Note: This parameter will be deprecated in a future version of the API.", - "type": "boolean" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta5/apps/{appsId}", - "path": "v1beta5/apps/{appsId}", - "id": "appengine.apps.get", - "description": "Gets information about an application." - }, - "patch": { - "description": "Updates the specified Application resource. You can update the following fields:\nauth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain)\ndefault_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration)", - "request": { - "$ref": "Application" - }, - "httpMethod": "PATCH", - "parameterOrder": [ - "appsId" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", - "required": true, - "type": "string" - }, - "mask": { - "location": "query", - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string" - } - }, - "flatPath": "v1beta5/apps/{appsId}", - "id": "appengine.apps.patch", - "path": "v1beta5/apps/{appsId}" - } - }, - "resources": { - "services": { - "methods": { - "delete": { - "parameters": { - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", - "id": "appengine.apps.services.delete", - "path": "v1beta5/apps/{appsId}/services/{servicesId}", - "description": "Deletes the specified service and all enclosed versions.", - "httpMethod": "DELETE", - "parameterOrder": [ - "appsId", - "servicesId" - ], - "response": { - "$ref": "Operation" - } - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "appsId", - "servicesId" - ], - "response": { - "$ref": "Service" - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", - "required": true, - "type": "string", - "location": "path" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", - "id": "appengine.apps.services.get", - "path": "v1beta5/apps/{appsId}/services/{servicesId}", - "description": "Gets the current configuration of the specified service." - }, - "list": { - "description": "Lists all the services in the application.", - "httpMethod": "GET", - "response": { - "$ref": "ListServicesResponse" - }, - "parameterOrder": [ - "appsId" - ], - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "Continuation token for fetching the next page of results.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services", - "id": "appengine.apps.services.list", - "path": "v1beta5/apps/{appsId}/services" - }, - "patch": { - "request": { - "$ref": "Service" - }, - "description": "Updates the configuration of the specified service.", - "httpMethod": "PATCH", - "parameterOrder": [ - "appsId", - "servicesId" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "appsId": { - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", - "required": true, - "type": "string", - "location": "path" - }, - "migrateTraffic": { - "location": "query", - "description": "Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).", - "type": "boolean" - }, - "mask": { - "location": "query", - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", - "id": "appengine.apps.services.patch", - "path": "v1beta5/apps/{appsId}/services/{servicesId}" - } - }, - "resources": { - "versions": { - "methods": { - "create": { - "description": "Deploys new code and resource files to a new version.", - "request": { - "$ref": "Version" - }, - "httpMethod": "POST", - "parameterOrder": [ - "appsId", - "servicesId" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/services/default\".", - "required": true, - "type": "string" - }, - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions", - "id": "appengine.apps.services.versions.create", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions" - }, - "delete": { - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ], - "httpMethod": "DELETE", - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "id": "appengine.apps.services.versions.delete", - "description": "Deletes an existing version." - }, - "get": { - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", - "required": true, - "type": "string" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "view": { - "location": "query", - "enum": [ - "BASIC", - "FULL" - ], - "description": "Controls the set of fields returned in the Get response.", - "type": "string" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "id": "appengine.apps.services.versions.get", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "description": "Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource.", - "httpMethod": "GET", - "response": { - "$ref": "Version" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ] - }, - "list": { - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions", - "id": "appengine.apps.services.versions.list", - "description": "Lists the versions of a service.", - "parameterOrder": [ - "appsId", - "servicesId" - ], - "httpMethod": "GET", - "response": { - "$ref": "ListVersionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", - "required": true, - "type": "string" - }, - "pageToken": { - "description": "Continuation token for fetching the next page of results.", - "type": "string", - "location": "query" - }, - "pageSize": { - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "view": { - "description": "Controls the set of fields returned in the List response.", - "type": "string", - "location": "query", - "enum": [ - "BASIC", - "FULL" - ] - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions" - }, - "patch": { - "id": "appengine.apps.services.versions.patch", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}", - "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:\nserving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment.\ninstance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment.\nautomatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.\nautomatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.", - "request": { - "$ref": "Version" - }, - "httpMethod": "PATCH", - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", - "required": true, - "type": "string" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "mask": { - "description": "Standard field mask for the set of fields to be updated.", - "format": "google-fieldmask", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}" - } - }, - "resources": { - "instances": { - "methods": { - "delete": { - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/services/default/versions/v1/instances/instance-1\".", - "required": true, - "type": "string" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "id": "appengine.apps.services.versions.instances.delete", - "description": "Stops a running instance.", - "response": { - "$ref": "Operation" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId", - "instancesId" - ] - }, - "get": { - "response": { - "$ref": "Instance" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId", - "instancesId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string", - "location": "path" - }, - "instancesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", - "id": "appengine.apps.services.versions.instances.get", - "description": "Gets instance information." - }, - "list": { - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "servicesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "appsId": { - "location": "path", - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Continuation token for fetching the next page of results.", - "type": "string" - }, - "pageSize": { - "description": "Maximum results to return per page.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "versionsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", - "id": "appengine.apps.services.versions.instances.list", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", - "description": "Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", - "httpMethod": "GET", - "response": { - "$ref": "ListInstancesResponse" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId" - ] - }, - "debug": { - "parameters": { - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - }, - "appsId": { - "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", - "required": true, - "type": "string", - "location": "path" - }, - "instancesId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", - "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", - "id": "appengine.apps.services.versions.instances.debug", - "request": { - "$ref": "DebugInstanceRequest" - }, - "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "servicesId", - "versionsId", - "instancesId" - ], - "httpMethod": "POST" - } - } - } - } - } - } - }, - "operations": { - "methods": { - "list": { - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "filter": { - "description": "The standard list filter.", - "type": "string", - "location": "query" - }, - "appsId": { - "location": "path", - "description": "Part of `name`. The name of the operation collection.", - "required": true, - "type": "string" - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "description": "The standard list page size.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "flatPath": "v1beta5/apps/{appsId}/operations", - "path": "v1beta5/apps/{appsId}/operations", - "id": "appengine.apps.operations.list", - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations.", - "parameterOrder": [ - "appsId" - ], - "httpMethod": "GET", - "response": { - "$ref": "ListOperationsResponse" - } - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "appsId", - "operationsId" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. The name of the operation resource.", - "required": true, - "type": "string" - }, - "operationsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1beta5/apps/{appsId}/operations/{operationsId}", - "id": "appengine.apps.operations.get", - "path": "v1beta5/apps/{appsId}/operations/{operationsId}", - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." - } - } - }, - "locations": { - "methods": { - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListLocationsResponse" - }, - "parameterOrder": [ - "appsId" - ], - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. The resource that owns the locations collection, if applicable.", - "required": true, - "type": "string" - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The standard list page size.", - "format": "int32", - "type": "integer" - }, - "filter": { - "description": "The standard list filter.", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1beta5/apps/{appsId}/locations", - "id": "appengine.apps.locations.list", - "path": "v1beta5/apps/{appsId}/locations", - "description": "Lists information about the supported locations for this service." - }, - "get": { - "path": "v1beta5/apps/{appsId}/locations/{locationsId}", - "id": "appengine.apps.locations.get", - "description": "Get information about a location.", - "response": { - "$ref": "Location" - }, - "parameterOrder": [ - "appsId", - "locationsId" - ], - "httpMethod": "GET", - "parameters": { - "appsId": { - "location": "path", - "description": "Part of `name`. Resource name for the location.", - "required": true, - "type": "string" - }, - "locationsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/appengine.admin", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1beta5/apps/{appsId}/locations/{locationsId}" - } - } - } - } - } - } + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "revision": "20170914", + "title": "Google App Engine Admin API" } diff --git a/etc/api/appengine/v1beta5/crates/1.0.6-api+20170914 b/etc/api/appengine/v1beta5/crates/1.0.6-api+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appengine/v1beta5/crates/1.0.6-cli+20170914 b/etc/api/appengine/v1beta5/crates/1.0.6-cli+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appsactivity/v1/appsactivity-api.json b/etc/api/appsactivity/v1/appsactivity-api.json index d475776b34..2f18078768 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/y29Ei9gfsS6BekrALyS-uw4tzTU\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/w7NCayi3_pNAp4Ux8jkCMtBwaIM\"", "discoveryVersion": "v1", "id": "appsactivity:v1", "name": "appsactivity", "version": "v1", - "revision": "20170215", + "revision": "20170921", "title": "G Suite Activity API", "description": "Provides a historical view of activity.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/appsactivity/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "appsactivity/v1/", - "batchPath": "batch", + "batchPath": "batch/appsactivity/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/appsactivity/v1/crates/1.0.6-api+20170921 b/etc/api/appsactivity/v1/crates/1.0.6-api+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appsactivity/v1/crates/1.0.6-cli+20170921 b/etc/api/appsactivity/v1/crates/1.0.6-cli+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appstate/v1/appstate-api.json b/etc/api/appstate/v1/appstate-api.json index e80b5a7ab8..46ed3affc0 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/FdkanktExV3oAOPPZT7FjY9Da58\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/sPKhgH8GZHaw4C3xgNYIIazdfPU\"", "discoveryVersion": "v1", "id": "appstate:v1", "name": "appstate", "canonicalName": "App State", "version": "v1", - "revision": "20170511", + "revision": "20170925", "title": "Google App State API", "description": "The Google App State API.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/appstate/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "appstate/v1/", - "batchPath": "batch", + "batchPath": "batch/appstate/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/appstate/v1/crates/1.0.6-api+20170925 b/etc/api/appstate/v1/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/appstate/v1/crates/1.0.6-cli+20170925 b/etc/api/appstate/v1/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/bigquery/v2/bigquery-api.json b/etc/api/bigquery/v2/bigquery-api.json index d2a6488771..1cc101f22e 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/g_G3eD_OgD8-ScdUNw6NbiklXmE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/6KmyniE-DVTht1WBAWvasoVbs7Y\"", "discoveryVersion": "v1", "id": "bigquery:v2", "name": "bigquery", "version": "v2", - "revision": "20170511", + "revision": "20170917", "title": "BigQuery API", "description": "A data platform for customers to create, manage, share and query data.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/bigquery/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "bigquery/v2/", - "batchPath": "batch", + "batchPath": "batch/bigquery/v2", "parameters": { "alt": { "type": "string", @@ -377,6 +377,16 @@ } } }, + "EncryptionConfiguration": { + "id": "EncryptionConfiguration", + "type": "object", + "properties": { + "kmsKeyName": { + "type": "string", + "description": "[Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key." + } + } + }, "ErrorProto": { "id": "ErrorProto", "type": "object", @@ -403,6 +413,16 @@ "id": "ExplainQueryStage", "type": "object", "properties": { + "computeMsAvg": { + "type": "string", + "description": "Milliseconds the average shard spent on CPU-bound tasks.", + "format": "int64" + }, + "computeMsMax": { + "type": "string", + "description": "Milliseconds the slowest shard spent on CPU-bound tasks.", + "format": "int64" + }, "computeRatioAvg": { "type": "number", "description": "Relative amount of time the average shard spent on CPU-bound tasks.", @@ -422,6 +442,16 @@ "type": "string", "description": "Human-readable name for stage." }, + "readMsAvg": { + "type": "string", + "description": "Milliseconds the average shard spent reading input.", + "format": "int64" + }, + "readMsMax": { + "type": "string", + "description": "Milliseconds the slowest shard spent reading input.", + "format": "int64" + }, "readRatioAvg": { "type": "number", "description": "Relative amount of time the average shard spent reading input.", @@ -442,6 +472,16 @@ "description": "Number of records written by the stage.", "format": "int64" }, + "shuffleOutputBytes": { + "type": "string", + "description": "Total number of bytes written to shuffle.", + "format": "int64" + }, + "shuffleOutputBytesSpilled": { + "type": "string", + "description": "Total number of bytes written to shuffle and spilled to disk.", + "format": "int64" + }, "status": { "type": "string", "description": "Current status for the stage." @@ -453,6 +493,16 @@ "$ref": "ExplainQueryStep" } }, + "waitMsAvg": { + "type": "string", + "description": "Milliseconds the average shard spent waiting to be scheduled.", + "format": "int64" + }, + "waitMsMax": { + "type": "string", + "description": "Milliseconds the slowest shard spent waiting to be scheduled.", + "format": "int64" + }, "waitRatioAvg": { "type": "number", "description": "Relative amount of time the average shard spent waiting to be scheduled.", @@ -463,6 +513,16 @@ "description": "Relative amount of time the slowest shard spent waiting to be scheduled.", "format": "double" }, + "writeMsAvg": { + "type": "string", + "description": "Milliseconds the average shard spent on writing output.", + "format": "int64" + }, + "writeMsMax": { + "type": "string", + "description": "Milliseconds the slowest shard spent on writing output.", + "format": "int64" + }, "writeRatioAvg": { "type": "number", "description": "Relative amount of time the average shard spent on writing output.", @@ -535,7 +595,7 @@ }, "sourceUris": { "type": "array", - "description": "[Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed.", + "description": "[Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed.", "items": { "type": "string" } @@ -552,7 +612,7 @@ }, "errors": { "type": "array", - "description": "[Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.", + "description": "[Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.", "items": { "$ref": "ErrorProto" } @@ -606,6 +666,21 @@ } } }, + "GetServiceAccountResponse": { + "id": "GetServiceAccountResponse", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The service account email address." + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#getServiceAccountResponse" + } + } + }, "GoogleSheetsOptions": { "id": "GoogleSheetsOptions", "type": "object", @@ -766,6 +841,10 @@ "type": "string", "description": "[Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion." }, + "destinationEncryptionConfiguration": { + "$ref": "EncryptionConfiguration", + "description": "[Experimental] Custom encryption configuration (e.g., Cloud KMS keys)." + }, "destinationTable": { "$ref": "TableReference", "description": "[Required] The destination table to load the data into." @@ -818,7 +897,7 @@ }, "schemaUpdateOptions": { "type": "array", - "description": "[Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.", + "description": "[Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job if a schema is autodetected or supplied in the job configuration. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.", "items": { "type": "string" } @@ -834,11 +913,15 @@ }, "sourceUris": { "type": "array", - "description": "[Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.", + "description": "[Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one URI can be specified. Also, the '*' wildcard character is not allowed.", "items": { "type": "string" } }, + "timePartitioning": { + "$ref": "TimePartitioning", + "description": "[Experimental] If specified, configures time-based partitioning for the destination table." + }, "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_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." @@ -851,7 +934,7 @@ "properties": { "allowLargeResults": { "type": "boolean", - "description": "[Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed.", + "description": "[Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size.", "default": "false" }, "createDisposition": { @@ -862,9 +945,13 @@ "$ref": "DatasetReference", "description": "[Optional] Specifies the default dataset to use for unqualified table names in the query." }, + "destinationEncryptionConfiguration": { + "$ref": "EncryptionConfiguration", + "description": "[Experimental] Custom encryption configuration (e.g., Cloud KMS keys)." + }, "destinationTable": { "$ref": "TableReference", - "description": "[Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results." + "description": "[Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This property must be set for large results that exceed the maximum response size." }, "flattenResults": { "type": "boolean", @@ -919,9 +1006,13 @@ "$ref": "ExternalDataConfiguration" } }, + "timePartitioning": { + "$ref": "TimePartitioning", + "description": "[Experimental] If specified, configures time-based partitioning for the destination table." + }, "useLegacySql": { "type": "boolean", - "description": "Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false." + "description": "Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false." }, "useQueryCache": { "type": "boolean", @@ -937,7 +1028,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 and uses the schema from the query result. 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." } } }, @@ -949,6 +1040,10 @@ "type": "string", "description": "[Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion." }, + "destinationEncryptionConfiguration": { + "$ref": "EncryptionConfiguration", + "description": "[Experimental] Custom encryption configuration (e.g., Cloud KMS keys)." + }, "destinationTable": { "$ref": "TableReference", "description": "[Required] The destination table" @@ -1147,6 +1242,11 @@ "description": "[Output-only] Total bytes processed for the job.", "format": "int64" }, + "totalSlotMs": { + "type": "string", + "description": "[Output-only] Slot-milliseconds for the job.", + "format": "int64" + }, "undeclaredQueryParameters": { "type": "array", "description": "[Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation.", @@ -1160,6 +1260,11 @@ "id": "JobStatistics3", "type": "object", "properties": { + "badRecords": { + "type": "string", + "description": "[Output-only] The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed in the load job configuration, then this number can be less than the total number of bad records present in the input data.", + "format": "int64" + }, "inputFileBytes": { "type": "string", "description": "[Output-only] Number of bytes of source data in a load job.", @@ -1206,7 +1311,7 @@ }, "errors": { "type": "array", - "description": "[Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.", + "description": "[Output-only] The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.", "items": { "$ref": "ErrorProto" } @@ -1424,7 +1529,7 @@ }, "useLegacySql": { "type": "boolean", - "description": "Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.", + "description": "Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.", "default": "true" }, "useQueryCache": { @@ -1444,7 +1549,7 @@ }, "errors": { "type": "array", - "description": "[Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.", + "description": "[Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.", "items": { "$ref": "ErrorProto" } @@ -1528,6 +1633,10 @@ "type": "string", "description": "[Optional] A user-friendly description of this table." }, + "encryptionConfiguration": { + "$ref": "EncryptionConfiguration", + "description": "[Experimental] Custom encryption configuration (e.g., Cloud KMS keys)." + }, "etag": { "type": "string", "description": "[Output-only] A hash of this resource." @@ -1733,7 +1842,7 @@ "properties": { "description": { "type": "string", - "description": "[Optional] The field description. The maximum length is 512 characters." + "description": "[Optional] The field description. The maximum length is 1,024 characters." }, "fields": { "type": "array", @@ -1803,6 +1912,10 @@ "$ref": "TableReference", "description": "A reference uniquely identifying the table." }, + "timePartitioning": { + "$ref": "TimePartitioning", + "description": "[Experimental] The time-based partitioning for this table." + }, "type": { "type": "string", "description": "The type of table. Possible values are: TABLE, VIEW." @@ -1895,9 +2008,13 @@ "description": "[Optional] Number of milliseconds for which to keep the storage for a partition.", "format": "int64" }, + "field": { + "type": "string", + "description": "[Experimental] [Optional] If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if set, the table is partitioned by this field. The field must be a top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED." + }, "type": { "type": "string", - "description": "[Required] The only type supported is DAY, which will generate one partition per day based on data loading time." + "description": "[Required] The only type supported is DAY, which will generate one partition per day." } } }, @@ -2416,6 +2533,31 @@ }, "projects": { "methods": { + "getServiceAccount": { + "id": "bigquery.projects.getServiceAccount", + "path": "projects/{projectId}/serviceAccount", + "httpMethod": "GET", + "description": "Returns the email address of the service account for your project used for interactions with Google Cloud KMS.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID for which the service account is requested.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "GetServiceAccountResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, "list": { "id": "bigquery.projects.list", "path": "projects", diff --git a/etc/api/bigquery/v2/crates/1.0.6-api+20170917 b/etc/api/bigquery/v2/crates/1.0.6-api+20170917 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json b/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json new file mode 100644 index 0000000000..3ffea66867 --- /dev/null +++ b/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json @@ -0,0 +1,1761 @@ +{ + "ownerDomain": "google.com", + "name": "bigquerydatatransfer", + "batchPath": "batch", + "title": "BigQuery Data Transfer API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "methods": { + "get": { + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "Resource name for the location.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + "id": "bigquerydatatransfer.projects.locations.get", + "path": "v1/{+name}", + "description": "Get information about a location.", + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET" + }, + "list": { + "description": "Lists information about the supported locations for this service.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListLocationsResponse" + }, + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "The standard list page size." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/locations", + "path": "v1/{+name}/locations", + "id": "bigquerydatatransfer.projects.locations.list" + } + }, + "resources": { + "transferConfigs": { + "methods": { + "delete": { + "id": "bigquerydatatransfer.projects.locations.transferConfigs.delete", + "path": "v1/{+name}", + "description": "Deletes a data transfer configuration,\nincluding any associated transfer runs and logs.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListTransferConfigsResponse" + }, + "parameters": { + "pageToken": { + "description": "Pagination token, which can be used to request a specific page\nof `ListTransfersRequest` list results. For multiple-page\nresults, `ListTransfersResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer" + }, + "dataSourceIds": { + "description": "When specified, only configurations of requested data sources are returned.", + "type": "string", + "repeated": true, + "location": "query" + }, + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The BigQuery project id for which data sources\nshould be returned: `projects/{project_id}`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs", + "path": "v1/{+parent}/transferConfigs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.list", + "description": "Returns information about all data transfers in the project." + }, + "create": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs", + "path": "v1/{+parent}/transferConfigs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.create", + "description": "Creates a new data transfer configuration.", + "request": { + "$ref": "TransferConfig" + }, + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "TransferConfig" + }, + "parameters": { + "parent": { + "location": "path", + "description": "The BigQuery project id where the transfer configuration should be created.\nMust be in the format /projects/{project_id}/locations/{location_id}\nor\n/projects/{project_id}/locations/-\nIn case when '-' is specified as location_id, location is infered from\nthe destination dataset region.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$" + }, + "authorizationCode": { + "location": "query", + "description": "Optional OAuth2 authorization code to use with this transfer configuration.\nThis is required if new credentials are needed, as indicated by\n`CheckValidCreds`.\nIn order to obtain authorization_code, please make a\nrequest to\nhttps://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=\u003cdatatransferapiclientid\u003e&scope=\u003cdata_source_scopes\u003e&redirect_uri=\u003credirect_uri\u003e\n\n* client_id should be OAuth client_id of BigQuery DTS API for the given\n data source returned by ListDataSources method.\n* data_source_scopes are the scopes returned by ListDataSources method.\n* redirect_uri is an optional parameter. If not specified, then\n authorization code is posted to the opener of authorization flow window.\n Otherwise it will be sent to the redirect uri. A special value of\n urn:ietf:wg:oauth:2.0:oob means that authorization code should be\n returned in the title bar of the browser, with the page text prompting\n the user to copy the code and paste it in the application.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "scheduleRuns": { + "request": { + "$ref": "ScheduleTransferRunsRequest" + }, + "description": "Creates transfer runs for a time range [range_start_time, range_end_time].\nFor each date - or whatever granularity the data source supports - in the\nrange, one transfer run is created.\nNote that runs are created per UTC time in the time range.", + "response": { + "$ref": "ScheduleTransferRunsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Transfer configuration name in the form:\n`projects/{project_id}/transferConfigs/{config_id}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}:scheduleRuns", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns", + "path": "v1/{+parent}:scheduleRuns" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "TransferConfig" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "The resource name of the transfer config.\nTransfer config names have the form\n`projects/{project_id}/transferConfigs/{config_id}`.\nWhere `config_id` is usually a uuid, even though it is not\nguaranteed or required. The name is ignored when creating a transfer\nconfig.", + "type": "string", + "required": true + }, + "authorizationCode": { + "description": "Optional OAuth2 authorization code to use with this transfer configuration.\nIf it is provided, the transfer configuration will be associated with the\ngaia id of the authorizing user.\nIn order to obtain authorization_code, please make a\nrequest to\nhttps://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=\u003cdatatransferapiclientid\u003e&scope=\u003cdata_source_scopes\u003e&redirect_uri=\u003credirect_uri\u003e\n\n* client_id should be OAuth client_id of BigQuery DTS API for the given\n data source returned by ListDataSources method.\n* data_source_scopes are the scopes returned by ListDataSources method.\n* redirect_uri is an optional parameter. If not specified, then\n authorization code is posted to the opener of authorization flow window.\n Otherwise it will be sent to the redirect uri. A special value of\n urn:ietf:wg:oauth:2.0:oob means that authorization code should be\n returned in the title bar of the browser, with the page text prompting\n the user to copy the code and paste it in the application.", + "type": "string", + "location": "query" + }, + "updateMask": { + "format": "google-fieldmask", + "description": "Required list of fields to be updated in this request.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.patch", + "description": "Updates a data transfer configuration.\nAll fields must be set, even if they are not updated.", + "request": { + "$ref": "TransferConfig" + } + }, + "get": { + "description": "Returns information about a data transfer config.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "TransferConfig" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}`", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.get" + } + }, + "resources": { + "runs": { + "methods": { + "delete": { + "description": "Deletes the specified transfer run.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.delete" + }, + "list": { + "response": { + "$ref": "ListTransferRunsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListTransferRunsRequest` list results. For multiple-page\nresults, `ListTransferRunsResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer", + "location": "query" + }, + "states": { + "repeated": true, + "location": "query", + "enum": [ + "TRANSFER_STATE_UNSPECIFIED", + "INACTIVE", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "CANCELLED" + ], + "description": "When specified, only transfer runs with requested states are returned.", + "type": "string" + }, + "runAttempt": { + "description": "Indicates how run attempts are to be pulled.", + "type": "string", + "location": "query", + "enum": [ + "RUN_ATTEMPT_UNSPECIFIED", + "LATEST" + ] + }, + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "Name of transfer configuration for which transfer runs should be retrieved.\nFormat of transfer configuration resource name is:\n`projects/{project_id}/transferConfigs/{config_id}`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.list", + "path": "v1/{+parent}/runs", + "description": "Returns information about running and completed jobs." + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "TransferRun" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.get", + "description": "Returns information about the particular transfer run." + } + }, + "resources": { + "transferLogs": { + "methods": { + "list": { + "description": "Returns user facing log messages for the data transfer run.", + "httpMethod": "GET", + "response": { + "$ref": "ListTransferLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Transfer run name in the form:\n`projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListTransferLogsRequest` list results. For multiple-page\nresults, `ListTransferLogsResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer", + "location": "query" + }, + "messageTypes": { + "description": "Message types to return. If not populated - INFO, WARNING and ERROR\nmessages are returned.", + "type": "string", + "repeated": true, + "location": "query", + "enum": [ + "MESSAGE_SEVERITY_UNSPECIFIED", + "INFO", + "WARNING", + "ERROR" + ] + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs/{runsId}/transferLogs", + "path": "v1/{+parent}/transferLogs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list" + } + } + } + } + } + } + }, + "dataSources": { + "methods": { + "checkValidCreds": { + "request": { + "$ref": "CheckValidCredsRequest" + }, + "description": "Returns true if valid credentials exist for the given data source and\nrequesting user.\nSome data sources doesn't support service account, so we need to talk to\nthem on behalf of the end user. This API just checks whether we have OAuth\ntoken for the particular user, which is a pre-requisite before user can\ncreate a transfer config.", + "response": { + "$ref": "CheckValidCredsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$", + "location": "path", + "description": "The data source in the form:\n`projects/{project_id}/dataSources/{data_source_id}`", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataSources/{dataSourcesId}:checkValidCreds", + "id": "bigquerydatatransfer.projects.locations.dataSources.checkValidCreds", + "path": "v1/{+name}:checkValidCreds" + }, + "list": { + "description": "Lists supported data sources and returns their settings,\nwhich can be used for UI rendering.", + "response": { + "$ref": "ListDataSourcesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "description": "The BigQuery project id for which data sources should be returned.\nMust be in the form: `projects/{project_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListDataSourcesRequest` list results. For multiple-page\nresults, `ListDataSourcesResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results." + }, + "pageSize": { + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataSources", + "id": "bigquerydatatransfer.projects.locations.dataSources.list", + "path": "v1/{+parent}/dataSources" + }, + "get": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataSources/{dataSourcesId}", + "id": "bigquerydatatransfer.projects.locations.dataSources.get", + "path": "v1/{+name}", + "description": "Retrieves a supported data source and returns its settings,\nwhich can be used for UI rendering.", + "response": { + "$ref": "DataSource" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/dataSources/{data_source_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + } + } + } + }, + "transferConfigs": { + "methods": { + "get": { + "response": { + "$ref": "TransferConfig" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}`", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}", + "id": "bigquerydatatransfer.projects.transferConfigs.get", + "path": "v1/{+name}", + "description": "Returns information about a data transfer config." + }, + "patch": { + "description": "Updates a data transfer configuration.\nAll fields must be set, even if they are not updated.", + "request": { + "$ref": "TransferConfig" + }, + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "TransferConfig" + }, + "parameters": { + "authorizationCode": { + "location": "query", + "description": "Optional OAuth2 authorization code to use with this transfer configuration.\nIf it is provided, the transfer configuration will be associated with the\ngaia id of the authorizing user.\nIn order to obtain authorization_code, please make a\nrequest to\nhttps://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=\u003cdatatransferapiclientid\u003e&scope=\u003cdata_source_scopes\u003e&redirect_uri=\u003credirect_uri\u003e\n\n* client_id should be OAuth client_id of BigQuery DTS API for the given\n data source returned by ListDataSources method.\n* data_source_scopes are the scopes returned by ListDataSources method.\n* redirect_uri is an optional parameter. If not specified, then\n authorization code is posted to the opener of authorization flow window.\n Otherwise it will be sent to the redirect uri. A special value of\n urn:ietf:wg:oauth:2.0:oob means that authorization code should be\n returned in the title bar of the browser, with the page text prompting\n the user to copy the code and paste it in the application.", + "type": "string" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Required list of fields to be updated in this request.", + "type": "string" + }, + "name": { + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "The resource name of the transfer config.\nTransfer config names have the form\n`projects/{project_id}/transferConfigs/{config_id}`.\nWhere `config_id` is usually a uuid, even though it is not\nguaranteed or required. The name is ignored when creating a transfer\nconfig.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.transferConfigs.patch" + }, + "delete": { + "description": "Deletes a data transfer configuration,\nincluding any associated transfer runs and logs.", + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}`", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.transferConfigs.delete" + }, + "list": { + "flatPath": "v1/projects/{projectsId}/transferConfigs", + "path": "v1/{+parent}/transferConfigs", + "id": "bigquerydatatransfer.projects.transferConfigs.list", + "description": "Returns information about all data transfers in the project.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListTransferConfigsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListTransfersRequest` list results. For multiple-page\nresults, `ListTransfersResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer" + }, + "dataSourceIds": { + "description": "When specified, only configurations of requested data sources are returned.", + "type": "string", + "repeated": true, + "location": "query" + }, + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The BigQuery project id for which data sources\nshould be returned: `projects/{project_id}`.", + "type": "string", + "required": true + } + } + }, + "create": { + "request": { + "$ref": "TransferConfig" + }, + "description": "Creates a new data transfer configuration.", + "response": { + "$ref": "TransferConfig" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "The BigQuery project id where the transfer configuration should be created.\nMust be in the format /projects/{project_id}/locations/{location_id}\nor\n/projects/{project_id}/locations/-\nIn case when '-' is specified as location_id, location is infered from\nthe destination dataset region.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "authorizationCode": { + "description": "Optional OAuth2 authorization code to use with this transfer configuration.\nThis is required if new credentials are needed, as indicated by\n`CheckValidCreds`.\nIn order to obtain authorization_code, please make a\nrequest to\nhttps://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=\u003cdatatransferapiclientid\u003e&scope=\u003cdata_source_scopes\u003e&redirect_uri=\u003credirect_uri\u003e\n\n* client_id should be OAuth client_id of BigQuery DTS API for the given\n data source returned by ListDataSources method.\n* data_source_scopes are the scopes returned by ListDataSources method.\n* redirect_uri is an optional parameter. If not specified, then\n authorization code is posted to the opener of authorization flow window.\n Otherwise it will be sent to the redirect uri. A special value of\n urn:ietf:wg:oauth:2.0:oob means that authorization code should be\n returned in the title bar of the browser, with the page text prompting\n the user to copy the code and paste it in the application.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/transferConfigs", + "id": "bigquerydatatransfer.projects.transferConfigs.create", + "path": "v1/{+parent}/transferConfigs" + }, + "scheduleRuns": { + "response": { + "$ref": "ScheduleTransferRunsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path", + "description": "Transfer configuration name in the form:\n`projects/{project_id}/transferConfigs/{config_id}`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}:scheduleRuns", + "id": "bigquerydatatransfer.projects.transferConfigs.scheduleRuns", + "path": "v1/{+parent}:scheduleRuns", + "description": "Creates transfer runs for a time range [range_start_time, range_end_time].\nFor each date - or whatever granularity the data source supports - in the\nrange, one transfer run is created.\nNote that runs are created per UTC time in the time range.", + "request": { + "$ref": "ScheduleTransferRunsRequest" + } + } + }, + "resources": { + "runs": { + "methods": { + "delete": { + "description": "Deletes the specified transfer run.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.delete" + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListTransferRunsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Name of transfer configuration for which transfer runs should be retrieved.\nFormat of transfer configuration resource name is:\n`projects/{project_id}/transferConfigs/{config_id}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListTransferRunsRequest` list results. For multiple-page\nresults, `ListTransferRunsResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results." + }, + "pageSize": { + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer", + "location": "query" + }, + "states": { + "description": "When specified, only transfer runs with requested states are returned.", + "type": "string", + "repeated": true, + "location": "query", + "enum": [ + "TRANSFER_STATE_UNSPECIFIED", + "INACTIVE", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "CANCELLED" + ] + }, + "runAttempt": { + "type": "string", + "location": "query", + "enum": [ + "RUN_ATTEMPT_UNSPECIFIED", + "LATEST" + ], + "description": "Indicates how run attempts are to be pulled." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs", + "path": "v1/{+parent}/runs", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.list", + "description": "Returns information about running and completed jobs." + }, + "get": { + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.get", + "path": "v1/{+name}", + "description": "Returns information about the particular transfer run.", + "response": { + "$ref": "TransferRun" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + }, + "resources": { + "transferLogs": { + "methods": { + "list": { + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs/{runsId}/transferLogs", + "path": "v1/{+parent}/transferLogs", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list", + "description": "Returns user facing log messages for the data transfer run.", + "httpMethod": "GET", + "response": { + "$ref": "ListTransferLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "messageTypes": { + "repeated": true, + "location": "query", + "enum": [ + "MESSAGE_SEVERITY_UNSPECIFIED", + "INFO", + "WARNING", + "ERROR" + ], + "description": "Message types to return. If not populated - INFO, WARNING and ERROR\nmessages are returned.", + "type": "string" + }, + "parent": { + "description": "Transfer run name in the form:\n`projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListTransferLogsRequest` list results. For multiple-page\nresults, `ListTransferLogsResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + } + } + } + } + } + }, + "dataSources": { + "methods": { + "list": { + "description": "Lists supported data sources and returns their settings,\nwhich can be used for UI rendering.", + "response": { + "$ref": "ListDataSourcesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "Pagination token, which can be used to request a specific page\nof `ListDataSourcesRequest` list results. For multiple-page\nresults, `ListDataSourcesResponse` outputs\na `next_page` token, which can be used as the\n`page_token` value to request the next page of list results." + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "type": "integer" + }, + "parent": { + "description": "The BigQuery project id for which data sources should be returned.\nMust be in the form: `projects/{project_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/dataSources", + "id": "bigquerydatatransfer.projects.dataSources.list", + "path": "v1/{+parent}/dataSources" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "DataSource" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/dataSources/{data_source_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/dataSources/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/dataSources/{dataSourcesId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.dataSources.get", + "description": "Retrieves a supported data source and returns its settings,\nwhich can be used for UI rendering." + }, + "checkValidCreds": { + "request": { + "$ref": "CheckValidCredsRequest" + }, + "description": "Returns true if valid credentials exist for the given data source and\nrequesting user.\nSome data sources doesn't support service account, so we need to talk to\nthem on behalf of the end user. This API just checks whether we have OAuth\ntoken for the particular user, which is a pre-requisite before user can\ncreate a transfer config.", + "response": { + "$ref": "CheckValidCredsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "The data source in the form:\n`projects/{project_id}/dataSources/{data_source_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/dataSources/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/dataSources/{dataSourcesId}:checkValidCreds", + "id": "bigquerydatatransfer.projects.dataSources.checkValidCreds", + "path": "v1/{+name}:checkValidCreds" + } + } + } + } + } + }, + "parameters": { + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "upload_protocol": { + "type": "string", + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + } + }, + "version": "v1", + "baseUrl": "https://bigquerydatatransfer.googleapis.com/", + "servicePath": "", + "description": "Transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170921", + "documentationLink": "https://cloud.google.com/bigquery/", + "id": "bigquerydatatransfer:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ListTransferConfigsResponse": { + "description": "The returned list of pipelines in the project.", + "type": "object", + "properties": { + "transferConfigs": { + "items": { + "$ref": "TransferConfig" + }, + "type": "array", + "description": "The stored pipeline transfer configurations.\nOutput only." + }, + "nextPageToken": { + "description": "The next-pagination token. For multiple-page list results,\nthis token can be used as the\n`ListTransferConfigsRequest.page_token`\nto request the next page of list results.\nOutput only.", + "type": "string" + } + }, + "id": "ListTransferConfigsResponse" + }, + "DataSource": { + "properties": { + "dataRefreshType": { + "enum": [ + "DATA_REFRESH_TYPE_UNSPECIFIED", + "SLIDING_WINDOW", + "CUSTOM_SLIDING_WINDOW" + ], + "description": "Specifies whether the data source supports automatic data refresh for the\npast few days, and how it's supported.\nFor some data sources, data might not be complete until a few days later,\nso it's useful to refresh data automatically.", + "type": "string", + "enumDescriptions": [ + "The data source won't support data auto refresh, which is default value.", + "The data source supports data auto refresh, and runs will be scheduled\nfor the past few days. Does not allow custom values to be set for each\ntransfer config.", + "The data source supports data auto refresh, and runs will be scheduled\nfor the past few days. Allows custom values to be set for each transfer\nconfig." + ] + }, + "parameters": { + "items": { + "$ref": "DataSourceParameter" + }, + "type": "array", + "description": "Data source parameters." + }, + "helpUrl": { + "description": "Url for the help document for this data source.", + "type": "string" + }, + "defaultSchedule": { + "description": "Default data transfer schedule.\nExamples of valid schedules include:\n`1st,3rd monday of month 15:30`,\n`every wed,fri of jan,jun 13:15`, and\n`first sunday of quarter 00:00`.", + "type": "string" + }, + "supportsMultipleTransfers": { + "description": "Indicates whether the data source supports multiple transfers\nto different BigQuery targets.", + "type": "boolean" + }, + "manualRunsDisabled": { + "description": "Disables backfilling and manual run scheduling\nfor the data source.", + "type": "boolean" + }, + "defaultDataRefreshWindowDays": { + "format": "int32", + "description": "Default data refresh window on days.\nOnly meaningful when `data_refresh_type` = `SLIDING_WINDOW`.", + "type": "integer" + }, + "transferType": { + "description": "Transfer type. Currently supports only batch transfers,\nwhich are transfers that use the BigQuery batch APIs (load or\nquery) to ingest the data.", + "type": "string", + "enumDescriptions": [ + "Invalid or Unknown transfer type placeholder.", + "Batch data transfer.", + "Streaming data transfer. Streaming data source currently doesn't\nsupport multiple transfer configs per project." + ], + "enum": [ + "TRANSFER_TYPE_UNSPECIFIED", + "BATCH", + "STREAMING" + ] + }, + "description": { + "description": "User friendly data source description string.", + "type": "string" + }, + "dataSourceId": { + "description": "Data source id.", + "type": "string" + }, + "scopes": { + "description": "Api auth scopes for which refresh token needs to be obtained. Only valid\nwhen `client_id` is specified. Ignored otherwise. These are scopes needed\nby a data source to prepare data and ingest them into BigQuery,\ne.g., https://www.googleapis.com/auth/bigquery", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Data source resource name.", + "type": "string" + }, + "minimumScheduleInterval": { + "format": "google-duration", + "description": "The minimum interval between two consecutive scheduled runs.", + "type": "string" + }, + "clientId": { + "description": "Data source client id which should be used to receive refresh token.\nWhen not supplied, no offline credentials are populated for data transfer.", + "type": "string" + }, + "authorizationType": { + "enumDescriptions": [ + "Type unspecified.", + "Use OAuth 2 authorization codes that can be exchanged\nfor a refresh token on the backend.", + "Return an authorization code for a given Google+ page that can then be\nexchanged for a refresh token on the backend." + ], + "enum": [ + "AUTHORIZATION_TYPE_UNSPECIFIED", + "AUTHORIZATION_CODE", + "GOOGLE_PLUS_AUTHORIZATION_CODE" + ], + "description": "Indicates the type of authorization.", + "type": "string" + }, + "supportsCustomSchedule": { + "type": "boolean", + "description": "Specifies whether the data source supports a user defined schedule, or\noperates on the default schedule.\nWhen set to `true`, user can override default schedule." + }, + "displayName": { + "description": "User friendly data source name.", + "type": "string" + }, + "updateDeadlineSeconds": { + "format": "int32", + "description": "The number of seconds to wait for an update from the data source\nbefore BigQuery marks the transfer as failed.", + "type": "integer" + } + }, + "id": "DataSource", + "description": "Represents data source metadata. Metadata is sufficient to\nrender UI and request proper OAuth tokens.", + "type": "object" + }, + "ScheduleTransferRunsRequest": { + "description": "A request to schedule transfer runs for a time range.", + "type": "object", + "properties": { + "endTime": { + "format": "google-datetime", + "description": "End time of the range of transfer runs. For example,\n`\"2017-05-30T00:00:00+00:00\"`.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Start time of the range of transfer runs. For example,\n`\"2017-05-25T00:00:00+00:00\"`.", + "type": "string" + } + }, + "id": "ScheduleTransferRunsRequest" + }, + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {} + }, + "Location": { + "description": "A resource that represents Google Cloud Platform location.", + "type": "object", + "properties": { + "name": { + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", + "type": "string" + }, + "locationId": { + "description": "The canonical id for this location. For example: `\"us-east1\"`.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", + "type": "object" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object" + } + }, + "id": "Location" + }, + "TransferConfig": { + "properties": { + "params": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Data transfer specific parameters." + }, + "datasetRegion": { + "description": "Region in which BigQuery dataset is located. Currently possible values are:\n\"US\" and \"EU\".\nOutput only.", + "type": "string" + }, + "displayName": { + "description": "User specified display name for the data transfer.", + "type": "string" + }, + "disabled": { + "description": "Is this config disabled. When set to true, no runs are scheduled\nfor a given transfer.", + "type": "boolean" + }, + "nextRunTime": { + "format": "google-datetime", + "description": "Next time when data transfer will run.\nOutput only.", + "type": "string" + }, + "schedule": { + "description": "Data transfer schedule.\nIf the data source does not support a custom schedule, this should be\nempty. If it is empty, the default value for the data source will be\nused.\nThe specified times are in UTC.\nExamples of valid format:\n`1st,3rd monday of month 15:30`,\n`every wed,fri of jan,jun 13:15`, and\n`first sunday of quarter 00:00`.\nSee more explanation about the format here:\nhttps://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format\nNOTE: the granularity should be at least 8 hours, or less frequent.", + "type": "string" + }, + "updateTime": { + "format": "google-datetime", + "description": "Data transfer modification time. Ignored by server on input.\nOutput only.", + "type": "string" + }, + "dataRefreshWindowDays": { + "format": "int32", + "description": "The number of days to look back to automatically refresh the data.\nFor example, if `data_refresh_window_days = 10`, then every day\nBigQuery reingests data for [today-10, today-1], rather than ingesting data\nfor just [today-1].\nOnly valid if the data source supports the feature. Set the value to 0\nto use the default value.", + "type": "integer" + }, + "dataSourceId": { + "description": "Data source id. Cannot be changed once data transfer is created.", + "type": "string" + }, + "state": { + "enumDescriptions": [ + "State placeholder.", + "Data transfer is inactive.", + "Data transfer is scheduled and is waiting to be picked up by\ndata transfer backend.", + "Data transfer is in progress.", + "Data transfer completed successsfully.", + "Data transfer failed.", + "Data transfer is cancelled." + ], + "enum": [ + "TRANSFER_STATE_UNSPECIFIED", + "INACTIVE", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "CANCELLED" + ], + "description": "State of the most recently updated transfer run.\nOutput only.", + "type": "string" + }, + "destinationDatasetId": { + "description": "The BigQuery target dataset id.", + "type": "string" + }, + "userId": { + "format": "int64", + "description": "Unique ID of the user on whose behalf transfer is done. Applicable only\nto data sources that do not support service accounts. When set to 0,\nthe data source service account credentials are used.\nOutput only.", + "type": "string" + }, + "name": { + "description": "The resource name of the transfer config.\nTransfer config names have the form\n`projects/{project_id}/transferConfigs/{config_id}`.\nWhere `config_id` is usually a uuid, even though it is not\nguaranteed or required. The name is ignored when creating a transfer\nconfig.", + "type": "string" + } + }, + "id": "TransferConfig", + "description": "Represents a data transfer configuration. A transfer configuration\ncontains all metadata needed to perform a data transfer. For example,\n`destination_dataset_id` specifies where data should be stored.\nWhen a new transfer configuration is created, the specified\n`destination_dataset_id` is created when needed and shared with the\nappropriate data source service account.", + "type": "object" + }, + "TransferRun": { + "type": "object", + "properties": { + "updateTime": { + "format": "google-datetime", + "description": "Last time the data transfer run state was updated.\nOutput only.", + "type": "string" + }, + "schedule": { + "description": "Describes the schedule of this transfer run if it was created as part of\na regular schedule. For batch transfer runs that are directly created,\nthis is empty.\nNOTE: the system might choose to delay the schedule depending on the\ncurrent load, so `schedule_time` doesn't always matches this.\nOutput only.", + "type": "string" + }, + "runTime": { + "format": "google-datetime", + "description": "For batch transfer runs, specifies the date and time that\ndata should be ingested.", + "type": "string" + }, + "dataSourceId": { + "description": "Data source id.\nOutput only.", + "type": "string" + }, + "state": { + "enumDescriptions": [ + "State placeholder.", + "Data transfer is inactive.", + "Data transfer is scheduled and is waiting to be picked up by\ndata transfer backend.", + "Data transfer is in progress.", + "Data transfer completed successsfully.", + "Data transfer failed.", + "Data transfer is cancelled." + ], + "enum": [ + "TRANSFER_STATE_UNSPECIFIED", + "INACTIVE", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "CANCELLED" + ], + "description": "Data transfer run state. Ignored for input requests.\nOutput only.", + "type": "string" + }, + "userId": { + "format": "int64", + "description": "Unique ID of the user on whose behalf transfer is done. Applicable only\nto data sources that do not support service accounts. When set to 0,\nthe data source service account credentials are used.\nOutput only.", + "type": "string" + }, + "name": { + "description": "The resource name of the transfer run.\nTransfer run names have the form\n`projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`.\nThe name is ignored when creating a transfer run.", + "type": "string" + }, + "destinationDatasetId": { + "description": "The BigQuery target dataset id.", + "type": "string" + }, + "params": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Data transfer specific parameters.", + "type": "object" + }, + "endTime": { + "format": "google-datetime", + "description": "Time when transfer run ended. Parameter ignored by server for input\nrequests.\nOutput only.", + "type": "string" + }, + "datasetRegion": { + "description": "Region in which BigQuery dataset is located. Currently possible values are:\n\"US\" and \"EU\".\nOutput only.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time when transfer run was started. Parameter ignored by server for input\nrequests.\nOutput only.", + "type": "string" + }, + "scheduleTime": { + "format": "google-datetime", + "description": "Minimum time after which a transfer run can be started.", + "type": "string" + } + }, + "id": "TransferRun", + "description": "Represents a data transfer run." + }, + "CheckValidCredsRequest": { + "description": "A request to determine whether the user has valid credentials. This method\nis used to limit the number of OAuth popups in the user interface. The\nuser id is inferred from the API call context.\nIf the data source has the Google+ authorization type, this method\nreturns false, as it cannot be determined whether the credentials are\nalready valid merely based on the user id.", + "type": "object", + "properties": {}, + "id": "CheckValidCredsRequest" + }, + "CheckValidCredsResponse": { + "id": "CheckValidCredsResponse", + "description": "A response indicating whether the credentials exist and are valid.", + "type": "object", + "properties": { + "hasValidCreds": { + "description": "If set to `true`, the credentials exist and are valid.", + "type": "boolean" + } + } + }, + "ScheduleTransferRunsResponse": { + "description": "A response to schedule transfer runs for a time range.", + "type": "object", + "properties": { + "runs": { + "description": "The transfer runs that were scheduled.", + "items": { + "$ref": "TransferRun" + }, + "type": "array" + } + }, + "id": "ScheduleTransferRunsResponse" + }, + "TransferMessage": { + "id": "TransferMessage", + "description": "Represents a user facing message for a particular data transfer run.", + "type": "object", + "properties": { + "messageText": { + "description": "Message text.", + "type": "string" + }, + "severity": { + "enumDescriptions": [ + "No severity specified.", + "Informational message.", + "Warning message.", + "Error message." + ], + "enum": [ + "MESSAGE_SEVERITY_UNSPECIFIED", + "INFO", + "WARNING", + "ERROR" + ], + "description": "Message severity.", + "type": "string" + }, + "messageTime": { + "format": "google-datetime", + "description": "Time when message was logged.", + "type": "string" + } + } + }, + "ListTransferLogsResponse": { + "id": "ListTransferLogsResponse", + "description": "The returned list transfer run messages.", + "type": "object", + "properties": { + "transferMessages": { + "description": "The stored pipeline transfer messages.\nOutput only.", + "items": { + "$ref": "TransferMessage" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The next-pagination token. For multiple-page list results,\nthis token can be used as the\n`GetTransferRunLogRequest.page_token`\nto request the next page of list results.\nOutput only.", + "type": "string" + } + } + }, + "ListDataSourcesResponse": { + "id": "ListDataSourcesResponse", + "description": "Returns list of supported data sources and their metadata.", + "type": "object", + "properties": { + "dataSources": { + "items": { + "$ref": "DataSource" + }, + "type": "array", + "description": "List of supported data sources and their transfer settings." + }, + "nextPageToken": { + "description": "The next-pagination token. For multiple-page list results,\nthis token can be used as the\n`ListDataSourcesRequest.page_token`\nto request the next page of list results.\nOutput only.", + "type": "string" + } + } + }, + "DataSourceParameter": { + "description": "Represents a data source parameter with validation rules, so that\nparameters can be rendered in the UI. These parameters are given to us by\nsupported data sources, and include all needed information for rendering\nand validation.\nThus, whoever uses this api can decide to generate either generic ui,\nor custom data source specific forms.", + "type": "object", + "properties": { + "description": { + "description": "Parameter description.", + "type": "string" + }, + "allowedValues": { + "description": "All possible values for the parameter.", + "items": { + "type": "string" + }, + "type": "array" + }, + "validationHelpUrl": { + "description": "URL to a help document to further explain the naming requirements.", + "type": "string" + }, + "minValue": { + "format": "double", + "description": "For integer and double values specifies minimum allowed value.", + "type": "number" + }, + "validationRegex": { + "description": "Regular expression which can be used for parameter validation.", + "type": "string" + }, + "paramId": { + "description": "Parameter identifier.", + "type": "string" + }, + "required": { + "description": "Is parameter required.", + "type": "boolean" + }, + "repeated": { + "description": "Can parameter have multiple values.", + "type": "boolean" + }, + "displayName": { + "type": "string", + "description": "Parameter display name in the user interface." + }, + "immutable": { + "type": "boolean", + "description": "Cannot be changed after initial creation." + }, + "validationDescription": { + "description": "Description of the requirements for this field, in case the user input does\nnot fulfill the regex pattern or min/max values.", + "type": "string" + }, + "fields": { + "description": "When parameter is a record, describes child fields.", + "items": { + "$ref": "DataSourceParameter" + }, + "type": "array" + }, + "maxValue": { + "format": "double", + "description": "For integer and double values specifies maxminum allowed value.", + "type": "number" + }, + "type": { + "enumDescriptions": [ + "Type unspecified.", + "String parameter.", + "Integer parameter (64-bits).\nWill be serialized to json as string.", + "Double precision floating point parameter.", + "Boolean parameter.", + "Record parameter.", + "Page ID for a Google+ Page." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "STRING", + "INTEGER", + "DOUBLE", + "BOOLEAN", + "RECORD", + "PLUS_PAGE" + ], + "description": "Parameter type.", + "type": "string" + }, + "recurse": { + "description": "If set to true, schema should be taken from the parent with the same\nparameter_id. Only applicable when parameter type is RECORD.", + "type": "boolean" + } + }, + "id": "DataSourceParameter" + }, + "ListTransferRunsResponse": { + "properties": { + "nextPageToken": { + "type": "string", + "description": "The next-pagination token. For multiple-page list results,\nthis token can be used as the\n`ListTransferRunsRequest.page_token`\nto request the next page of list results.\nOutput only." + }, + "transferRuns": { + "description": "The stored pipeline transfer runs.\nOutput only.", + "items": { + "$ref": "TransferRun" + }, + "type": "array" + } + }, + "id": "ListTransferRunsResponse", + "description": "The returned list of pipelines in the project.", + "type": "object" + }, + "ListLocationsResponse": { + "type": "object", + "properties": { + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListLocationsResponse", + "description": "The response message for Locations.ListLocations." + } + }, + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "canonicalName": "BigQuery Data Transfer", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/bigquery": { + "description": "View and manage your data in Google BigQuery" + } + } + } + }, + "rootUrl": "https://bigquerydatatransfer.googleapis.com/" +} diff --git a/etc/api/bigquerydatatransfer/v1/crates/1.0.6-api+20170921 b/etc/api/bigquerydatatransfer/v1/crates/1.0.6-api+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/bigquerydatatransfer/v1/crates/1.0.6-cli+20170921 b/etc/api/bigquerydatatransfer/v1/crates/1.0.6-cli+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/blogger/v2/blogger-api.json b/etc/api/blogger/v2/blogger-api.json index a6a47ae0a5..74e820248d 100644 --- a/etc/api/blogger/v2/blogger-api.json +++ b/etc/api/blogger/v2/blogger-api.json @@ -23,7 +23,7 @@ "basePath": "/blogger/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "blogger/v2/", - "batchPath": "batch", + "batchPath": "batch/blogger/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/blogger/v3/blogger-api.json b/etc/api/blogger/v3/blogger-api.json index 427da6e659..795f53243f 100644 --- a/etc/api/blogger/v3/blogger-api.json +++ b/etc/api/blogger/v3/blogger-api.json @@ -23,7 +23,7 @@ "basePath": "/blogger/v3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "blogger/v3/", - "batchPath": "batch", + "batchPath": "batch/blogger/v3", "parameters": { "alt": { "type": "string", diff --git a/etc/api/books/v1/books-api.json b/etc/api/books/v1/books-api.json index 1e043022d5..1e26675172 100644 --- a/etc/api/books/v1/books-api.json +++ b/etc/api/books/v1/books-api.json @@ -20,7 +20,7 @@ "basePath": "/books/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "books/v1/", - "batchPath": "batch", + "batchPath": "batch/books/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/calendar/v3/calendar-api.json b/etc/api/calendar/v3/calendar-api.json index 474238ba9b..20afa5a389 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/9T19oRJaub8kQ0DM1Id4nnnZ16I\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/VYSEPWa0diltjt4R-I-9BxST4qQ\"", "discoveryVersion": "v1", "id": "calendar:v3", "name": "calendar", "version": "v3", - "revision": "20170514", + "revision": "20170919", "title": "Calendar API", "description": "Manipulates events and other calendar data.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/calendar/v3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "calendar/v3/", - "batchPath": "batch", + "batchPath": "batch/calendar/v3", "parameters": { "alt": { "type": "string", @@ -455,42 +455,6 @@ } } }, - "DeepLinkData": { - "id": "DeepLinkData", - "type": "object", - "properties": { - "links": { - "type": "array", - "items": { - "$ref": "Link" - } - }, - "url": { - "type": "string" - } - } - }, - "DisplayInfo": { - "id": "DisplayInfo", - "type": "object", - "properties": { - "appIconUrl": { - "type": "string" - }, - "appShortTitle": { - "type": "string" - }, - "appTitle": { - "type": "string" - }, - "linkShortTitle": { - "type": "string" - }, - "linkTitle": { - "type": "string" - } - } - }, "Error": { "id": "Error", "type": "object", @@ -805,7 +769,7 @@ }, "transparency": { "type": "string", - "description": "Whether the event blocks time on the calendar. Optional. Possible values are: \n- \"opaque\" - The event blocks time on the calendar. This is the default value. \n- \"transparent\" - The event does not block time on the calendar.", + "description": "Whether the event blocks time on the calendar. Optional. Possible values are: \n- \"opaque\" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI. \n- \"transparent\" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI.", "default": "opaque" }, "updated": { @@ -931,20 +895,6 @@ } } }, - "EventHabitInstance": { - "id": "EventHabitInstance", - "type": "object", - "properties": { - "data": { - "$ref": "HabitInstanceData", - "description": "Metadata specific to this instance." - }, - "parentId": { - "type": "string", - "description": "Id of the habit this instance belongs to." - } - } - }, "EventReminder": { "id": "EventReminder", "type": "object", @@ -1161,60 +1111,6 @@ } } }, - "HabitInstanceData": { - "id": "HabitInstanceData", - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "statusInferred": { - "type": "boolean" - }, - "type": { - "type": "string" - } - } - }, - "LaunchInfo": { - "id": "LaunchInfo", - "type": "object", - "properties": { - "appId": { - "type": "string" - }, - "installUrl": { - "type": "string" - }, - "intentAction": { - "type": "string" - }, - "uri": { - "type": "string" - } - } - }, - "Link": { - "id": "Link", - "type": "object", - "properties": { - "applinkingSource": { - "type": "string" - }, - "displayInfo": { - "$ref": "DisplayInfo" - }, - "launchInfo": { - "$ref": "LaunchInfo" - }, - "platform": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, "Setting": { "id": "Setting", "type": "object", @@ -2232,7 +2128,7 @@ }, "maxResults": { "type": "integer", - "description": "Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.", + "description": "Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.", "default": "250", "format": "int32", "minimum": "1", @@ -2295,13 +2191,13 @@ }, "timeMax": { "type": "string", - "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin.", "format": "date-time", "location": "query" }, "timeMin": { "type": "string", - "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax.", "format": "date-time", "location": "query" }, @@ -2547,7 +2443,7 @@ }, "maxResults": { "type": "integer", - "description": "Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.", + "description": "Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.", "default": "250", "format": "int32", "minimum": "1", @@ -2610,13 +2506,13 @@ }, "timeMax": { "type": "string", - "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin.", "format": "date-time", "location": "query" }, "timeMin": { "type": "string", - "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax.", "format": "date-time", "location": "query" }, diff --git a/etc/api/calendar/v3/crates/1.0.6-api+20170919 b/etc/api/calendar/v3/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/calendar/v3/crates/1.0.6-cli+20170919 b/etc/api/calendar/v3/crates/1.0.6-cli+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/civicinfo/v2/civicinfo-api.json b/etc/api/civicinfo/v2/civicinfo-api.json index a77032073c..f09c4eb4c5 100644 --- a/etc/api/civicinfo/v2/civicinfo-api.json +++ b/etc/api/civicinfo/v2/civicinfo-api.json @@ -21,7 +21,7 @@ "basePath": "/civicinfo/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "civicinfo/v2/", - "batchPath": "batch", + "batchPath": "batch/civicinfo/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/classroom/v1/classroom-api.json b/etc/api/classroom/v1/classroom-api.json index 9d5f9f15a7..14b3630672 100644 --- a/etc/api/classroom/v1/classroom-api.json +++ b/etc/api/classroom/v1/classroom-api.json @@ -1,41 +1,98 @@ { - "kind": "discovery#restDescription", - "description": "Manages classes, rosters, and invitations in Google Classroom.", - "servicePath": "", - "rootUrl": "https://classroom.googleapis.com/", - "basePath": "", "ownerDomain": "google.com", "name": "classroom", "batchPath": "batch", "id": "classroom:v1", "documentationLink": "https://developers.google.com/classroom/", - "revision": "20170510", + "revision": "20170926", "title": "Google Classroom API", "ownerName": "Google", "discoveryVersion": "v1", "resources": { "invitations": { "methods": { - "create": { - "request": { - "$ref": "Invitation" + "list": { + "description": "Returns a list of invitations that the requesting user is permitted to\nview, restricted to those that match the list request.\n\n*Note:* At least one of `user_id` or `course_id` must be supplied. Both\nfields can be supplied.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` for access errors.", + "response": { + "$ref": "ListInvitationsResponse" }, - "description": "Creates an invitation. Only one invitation for a user and course may exist\nat a time. Delete and re-create an invitation to make changes.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\ninvitations for this course or for access errors.\n* `NOT_FOUND` if the course or the user does not exist.\n* `FAILED_PRECONDITION` if the requested user's account is disabled or if\nthe user already has this role or a role with greater permissions.\n* `ALREADY_EXISTS` if an invitation for the specified user and course\nalready exists.", - "httpMethod": "POST", "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "parameters": { + "courseId": { + "description": "Restricts returned invitations to those for a course with the specified\nidentifier.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "nextPageToken\nvalue returned from a previous\nlist call, indicating\nthat the subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", + "type": "string" + }, + "userId": { + "description": "Restricts returned invitations to those for a specific user. The identifier\ncan be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum number of items to return. Zero means no maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer" + } + }, + "flatPath": "v1/invitations", + "id": "classroom.invitations.list", + "path": "v1/invitations" + }, + "get": { "response": { "$ref": "Invitation" }, + "parameterOrder": [ + "id" + ], + "httpMethod": "GET", + "parameters": { + "id": { + "location": "path", + "description": "Identifier of the invitation to return.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "flatPath": "v1/invitations/{id}", + "id": "classroom.invitations.get", + "path": "v1/invitations/{id}", + "description": "Returns an invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view the\nrequested invitation or for access errors.\n* `NOT_FOUND` if no invitation exists with the requested ID." + }, + "create": { + "id": "classroom.invitations.create", + "path": "v1/invitations", + "description": "Creates an invitation. Only one invitation for a user and course may exist\nat a time. Delete and re-create an invitation to make changes.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\ninvitations for this course or for access errors.\n* `NOT_FOUND` if the course or the user does not exist.\n* `FAILED_PRECONDITION` if the requested user's account is disabled or if\nthe user already has this role or a role with greater permissions.\n* `ALREADY_EXISTS` if an invitation for the specified user and course\nalready exists.", + "request": { + "$ref": "Invitation" + }, + "response": { + "$ref": "Invitation" + }, + "parameterOrder": [], + "httpMethod": "POST", "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/classroom.rosters" ], - "flatPath": "v1/invitations", - "id": "classroom.invitations.create", - "path": "v1/invitations" + "flatPath": "v1/invitations" }, "accept": { - "description": "Accepts an invitation, removing it and adding the invited user to the\nteachers or students (as appropriate) of the specified course. Only the\ninvited user may accept an invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to accept the\nrequested invitation or for access errors.\n* `FAILED_PRECONDITION` for the following request errors:\n * CourseMemberLimitReached\n * CourseNotModifiable\n * CourseTeacherLimitReached\n * UserGroupsMembershipLimitReached\n* `NOT_FOUND` if no invitation exists with the requested ID.", "response": { "$ref": "Empty" }, @@ -48,17 +105,19 @@ ], "parameters": { "id": { + "location": "path", "description": "Identifier of the invitation to accept.", - "required": true, "type": "string", - "location": "path" + "required": true } }, "flatPath": "v1/invitations/{id}:accept", + "id": "classroom.invitations.accept", "path": "v1/invitations/{id}:accept", - "id": "classroom.invitations.accept" + "description": "Accepts an invitation, removing it and adding the invited user to the\nteachers or students (as appropriate) of the specified course. Only the\ninvited user may accept an invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to accept the\nrequested invitation or for access errors.\n* `FAILED_PRECONDITION` for the following request errors:\n * CourseMemberLimitReached\n * CourseNotModifiable\n * CourseTeacherLimitReached\n * UserGroupsMembershipLimitReached\n* `NOT_FOUND` if no invitation exists with the requested ID." }, "delete": { + "description": "Deletes an invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete the\nrequested invitation or for access errors.\n* `NOT_FOUND` if no invitation exists with the requested ID.", "response": { "$ref": "Empty" }, @@ -73,1184 +132,79 @@ "id": { "location": "path", "description": "Identifier of the invitation to delete.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, "flatPath": "v1/invitations/{id}", - "path": "v1/invitations/{id}", "id": "classroom.invitations.delete", - "description": "Deletes an invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete the\nrequested invitation or for access errors.\n* `NOT_FOUND` if no invitation exists with the requested ID." - }, - "get": { - "parameters": { - "id": { - "description": "Identifier of the invitation to return.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "flatPath": "v1/invitations/{id}", - "path": "v1/invitations/{id}", - "id": "classroom.invitations.get", - "description": "Returns an invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view the\nrequested invitation or for access errors.\n* `NOT_FOUND` if no invitation exists with the requested ID.", - "response": { - "$ref": "Invitation" - }, - "httpMethod": "GET", - "parameterOrder": [ - "id" - ] - }, - "list": { - "response": { - "$ref": "ListInvitationsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "pageSize": { - "location": "query", - "description": "Maximum number of items to return. Zero means no maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer" - }, - "courseId": { - "location": "query", - "description": "Restricts returned invitations to those for a course with the specified\nidentifier.", - "type": "string" - }, - "userId": { - "description": "Restricts returned invitations to those for a specific user. The identifier\ncan be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "type": "string", - "location": "query" - }, - "pageToken": { - "description": "nextPageToken\nvalue returned from a previous\nlist call, indicating\nthat the subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "flatPath": "v1/invitations", - "path": "v1/invitations", - "id": "classroom.invitations.list", - "description": "Returns a list of invitations that the requesting user is permitted to\nview, restricted to those that match the list request.\n\n*Note:* At least one of `user_id` or `course_id` must be supplied. Both\nfields can be supplied.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` for access errors." + "path": "v1/invitations/{id}" } } }, - "courses": { + "registrations": { "methods": { - "get": { - "response": { - "$ref": "Course" - }, - "httpMethod": "GET", - "parameterOrder": [ - "id" - ], - "parameters": { - "id": { - "description": "Identifier of the course to return.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses", - "https://www.googleapis.com/auth/classroom.courses.readonly" - ], - "flatPath": "v1/courses/{id}", - "path": "v1/courses/{id}", - "id": "classroom.courses.get", - "description": "Returns a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID." - }, - "patch": { - "description": "Updates one or more fields in a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to modify the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID.\n* `INVALID_ARGUMENT` if invalid fields are specified in the update mask or\nif no update mask is supplied.\n* `FAILED_PRECONDITION` for the following request errors:\n * CourseNotModifiable", - "request": { - "$ref": "Course" - }, - "response": { - "$ref": "Course" - }, - "parameterOrder": [ - "id" - ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses" - ], - "parameters": { - "id": { - "location": "path", - "description": "Identifier of the course to update.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - }, - "updateMask": { - "location": "query", - "description": "Mask that identifies which fields on the course to update.\nThis field is required to do an update. The update will fail if invalid\nfields are specified. The following fields are valid:\n\n* `name`\n* `section`\n* `descriptionHeading`\n* `description`\n* `room`\n* `courseState`\n\nWhen set in a query parameter, this field should be specified as\n\n`updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...`", - "format": "google-fieldmask", - "type": "string" - } - }, - "flatPath": "v1/courses/{id}", - "path": "v1/courses/{id}", - "id": "classroom.courses.patch" - }, - "update": { - "path": "v1/courses/{id}", - "id": "classroom.courses.update", - "description": "Updates a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to modify the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID.\n* `FAILED_PRECONDITION` for the following request errors:\n * CourseNotModifiable", - "request": { - "$ref": "Course" - }, - "response": { - "$ref": "Course" - }, - "parameterOrder": [ - "id" - ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses" - ], - "parameters": { - "id": { - "description": "Identifier of the course to update.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/courses/{id}" - }, "delete": { - "description": "Deletes a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID.", "response": { "$ref": "Empty" }, "parameterOrder": [ - "id" + "registrationId" ], "httpMethod": "DELETE", - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses" - ], "parameters": { - "id": { - "description": "Identifier of the course to delete.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, + "registrationId": { + "location": "path", + "description": "The `registration_id` of the `Registration` to be deleted.", "type": "string", - "location": "path" + "required": true } }, - "flatPath": "v1/courses/{id}", - "path": "v1/courses/{id}", - "id": "classroom.courses.delete" - }, - "list": { - "flatPath": "v1/courses", - "path": "v1/courses", - "id": "classroom.courses.list", - "description": "Returns a list of courses that the requesting user is permitted to view,\nrestricted to those that match the request.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` for access errors.\n* `INVALID_ARGUMENT` if the query argument is malformed.\n* `NOT_FOUND` if any users specified in the query arguments do not exist.", - "response": { - "$ref": "ListCoursesResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", "scopes": [ - "https://www.googleapis.com/auth/classroom.courses", - "https://www.googleapis.com/auth/classroom.courses.readonly" + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" ], - "parameters": { - "studentId": { - "location": "query", - "description": "Restricts returned courses to those having a student with the specified\nidentifier. The identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer" - }, - "teacherId": { - "description": "Restricts returned courses to those having a teacher with the specified\nidentifier. The identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "type": "string", - "location": "query" - }, - "courseStates": { - "repeated": true, - "location": "query", - "enum": [ - "COURSE_STATE_UNSPECIFIED", - "ACTIVE", - "ARCHIVED", - "PROVISIONED", - "DECLINED", - "SUSPENDED" - ], - "description": "Restricts returned courses to those in one of the specified states\nThe default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED.", - "type": "string" - } - } + "flatPath": "v1/registrations/{registrationId}", + "id": "classroom.registrations.delete", + "path": "v1/registrations/{registrationId}", + "description": "Deletes a `Registration`, causing Classroom to stop sending notifications\nfor that `Registration`." }, "create": { "response": { - "$ref": "Course" + "$ref": "Registration" }, "parameterOrder": [], "httpMethod": "POST", - "parameters": {}, "scopes": [ - "https://www.googleapis.com/auth/classroom.courses" + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" ], - "flatPath": "v1/courses", - "path": "v1/courses", - "id": "classroom.courses.create", + "parameters": {}, + "flatPath": "v1/registrations", + "id": "classroom.registrations.create", + "path": "v1/registrations", "request": { - "$ref": "Course" + "$ref": "Registration" }, - "description": "Creates a course.\n\nThe user specified in `ownerId` is the owner of the created course\nand added as a teacher.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\ncourses or for access errors.\n* `NOT_FOUND` if the primary teacher is not a valid user.\n* `FAILED_PRECONDITION` if the course owner's account is disabled or for\nthe following request errors:\n * UserGroupsMembershipLimitReached\n* `ALREADY_EXISTS` if an alias was specified in the `id` and\nalready exists." - } - }, - "resources": { - "aliases": { - "methods": { - "delete": { - "description": "Deletes an alias of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to remove the\nalias or for access errors.\n* `NOT_FOUND` if the alias does not exist.\n* `FAILED_PRECONDITION` if the alias requested does not make sense for the\n requesting user or course (for example, if a user not in a domain\n attempts to delete a domain-scoped alias).", - "httpMethod": "DELETE", - "parameterOrder": [ - "courseId", - "alias" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses" - ], - "parameters": { - "alias": { - "description": "Alias to delete.\nThis may not be the Classroom-assigned identifier.", - "required": true, - "type": "string", - "location": "path" - }, - "courseId": { - "location": "path", - "description": "Identifier of the course whose alias should be deleted.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/courses/{courseId}/aliases/{alias}", - "id": "classroom.courses.aliases.delete", - "path": "v1/courses/{courseId}/aliases/{alias}" - }, - "list": { - "description": "Returns a list of aliases for a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\ncourse or for access errors.\n* `NOT_FOUND` if the course does not exist.", - "httpMethod": "GET", - "response": { - "$ref": "ListCourseAliasesResponse" - }, - "parameterOrder": [ - "courseId" - ], - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses", - "https://www.googleapis.com/auth/classroom.courses.readonly" - ], - "parameters": { - "pageToken": { - "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer" - }, - "courseId": { - "location": "path", - "description": "The identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/courses/{courseId}/aliases", - "id": "classroom.courses.aliases.list", - "path": "v1/courses/{courseId}/aliases" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "courseId" - ], - "response": { - "$ref": "CourseAlias" - }, - "parameters": { - "courseId": { - "required": true, - "type": "string", - "location": "path", - "description": "Identifier of the course to alias.\nThis identifier can be either the Classroom-assigned identifier or an\nalias." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.courses" - ], - "flatPath": "v1/courses/{courseId}/aliases", - "id": "classroom.courses.aliases.create", - "path": "v1/courses/{courseId}/aliases", - "request": { - "$ref": "CourseAlias" - }, - "description": "Creates an alias for a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create the\nalias or for access errors.\n* `NOT_FOUND` if the course does not exist.\n* `ALREADY_EXISTS` if the alias already exists.\n* `FAILED_PRECONDITION` if the alias requested does not make sense for the\n requesting user or course (for example, if a user not in a domain\n attempts to access a domain-scoped alias)." - } - } - }, - "students": { - "methods": { - "delete": { - "parameters": { - "userId": { - "location": "path", - "description": "Identifier of the student to delete. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, - "type": "string" - }, - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters" - ], - "flatPath": "v1/courses/{courseId}/students/{userId}", - "path": "v1/courses/{courseId}/students/{userId}", - "id": "classroom.courses.students.delete", - "description": "Deletes a student of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete\nstudents of this course or for access errors.\n* `NOT_FOUND` if no student of this course has the requested ID or if the\ncourse does not exist.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "courseId", - "userId" - ], - "httpMethod": "DELETE" - }, - "get": { - "path": "v1/courses/{courseId}/students/{userId}", - "id": "classroom.courses.students.get", - "description": "Returns a student of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view\nstudents of this course or for access errors.\n* `NOT_FOUND` if no student of this course has the requested ID or if the\ncourse does not exist.", - "response": { - "$ref": "Student" - }, - "parameterOrder": [ - "courseId", - "userId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/classroom.profile.emails", - "https://www.googleapis.com/auth/classroom.profile.photos", - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "parameters": { - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - }, - "userId": { - "description": "Identifier of the student to return. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/courses/{courseId}/students/{userId}" - }, - "list": { - "description": "Returns a list of students of this course that the requester\nis permitted to view.\n\nThis method returns the following error codes:\n\n* `NOT_FOUND` if the course does not exist.\n* `PERMISSION_DENIED` for access errors.", - "response": { - "$ref": "ListStudentsResponse" - }, - "parameterOrder": [ - "courseId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/classroom.profile.emails", - "https://www.googleapis.com/auth/classroom.profile.photos", - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "parameters": { - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "nextPageToken\nvalue returned from a previous\nlist call, indicating that\nthe subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", - "type": "string" - }, - "pageSize": { - "description": "Maximum number of items to return. Zero means no maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "flatPath": "v1/courses/{courseId}/students", - "path": "v1/courses/{courseId}/students", - "id": "classroom.courses.students.list" - }, - "create": { - "response": { - "$ref": "Student" - }, - "parameterOrder": [ - "courseId" - ], - "httpMethod": "POST", - "parameters": { - "courseId": { - "description": "Identifier of the course to create the student in.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "enrollmentCode": { - "location": "query", - "description": "Enrollment code of the course to create the student in.\nThis code is required if userId\ncorresponds to the requesting user; it may be omitted if the requesting\nuser has administrative permissions to create students for any user.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.profile.emails", - "https://www.googleapis.com/auth/classroom.profile.photos", - "https://www.googleapis.com/auth/classroom.rosters" - ], - "flatPath": "v1/courses/{courseId}/students", - "path": "v1/courses/{courseId}/students", - "id": "classroom.courses.students.create", - "request": { - "$ref": "Student" - }, - "description": "Adds a user as a student of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\nstudents in this course or for access errors.\n* `NOT_FOUND` if the requested course ID does not exist.\n* `FAILED_PRECONDITION` if the requested user's account is disabled,\nfor the following request errors:\n * CourseMemberLimitReached\n * CourseNotModifiable\n * UserGroupsMembershipLimitReached\n* `ALREADY_EXISTS` if the user is already a student or teacher in the\ncourse." - } - } - }, - "courseWork": { - "resources": { - "studentSubmissions": { - "methods": { - "patch": { - "request": { - "$ref": "StudentSubmission" - }, - "description": "Updates one or more fields of a student submission.\n\nSee google.classroom.v1.StudentSubmission for details\nof which fields may be updated and who may change them.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding course work, if the user is not permitted to make the\nrequested modification to the student submission, or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", - "response": { - "$ref": "StudentSubmission" - }, - "parameterOrder": [ - "courseId", - "courseWorkId", - "id" - ], - "httpMethod": "PATCH", - "parameters": { - "id": { - "location": "path", - "description": "Identifier of the student submission.", - "required": true, - "type": "string" - }, - "updateMask": { - "description": "Mask that identifies which fields on the student submission to update.\nThis field is required to do an update. The update fails if invalid\nfields are specified.\n\nThe following fields may be specified by teachers:\n* `draft_grade`\n* `assigned_grade`", - "format": "google-fieldmask", - "type": "string", - "location": "query" - }, - "courseWorkId": { - "required": true, - "type": "string", - "location": "path", - "description": "Identifier of the course work." - }, - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.students" - ], - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", - "id": "classroom.courses.courseWork.studentSubmissions.patch" - }, - "get": { - "description": "Returns a student submission.\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course, course work, or student submission or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", - "httpMethod": "GET", - "parameterOrder": [ - "courseId", - "courseWorkId", - "id" - ], - "response": { - "$ref": "StudentSubmission" - }, - "parameters": { - "courseWorkId": { - "location": "path", - "description": "Identifier of the course work.", - "required": true, - "type": "string" - }, - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "id": { - "location": "path", - "description": "Identifier of the student submission.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.me.readonly", - "https://www.googleapis.com/auth/classroom.coursework.students", - "https://www.googleapis.com/auth/classroom.coursework.students.readonly", - "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", - "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" - ], - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", - "id": "classroom.courses.courseWork.studentSubmissions.get", - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}" - }, - "return": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "courseId", - "courseWorkId", - "id" - ], - "httpMethod": "POST", - "parameters": { - "courseWorkId": { - "location": "path", - "description": "Identifier of the course work.", - "required": true, - "type": "string" - }, - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "id": { - "description": "Identifier of the student submission.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.students" - ], - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return", - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return", - "id": "classroom.courses.courseWork.studentSubmissions.return", - "request": { - "$ref": "ReturnStudentSubmissionRequest" - }, - "description": "Returns a student submission.\n\nReturning a student submission transfers ownership of attached Drive\nfiles to the student and may also update the submission state.\nUnlike the Classroom application, returning a student submission does not\nset assignedGrade to the draftGrade value.\n\nOnly a teacher of the course that contains the requested student submission\nmay call this method.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, return the requested student submission,\nor for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist." - }, - "reclaim": { - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim", - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim", - "id": "classroom.courses.courseWork.studentSubmissions.reclaim", - "request": { - "$ref": "ReclaimStudentSubmissionRequest" - }, - "description": "Reclaims a student submission on behalf of the student that owns it.\n\nReclaiming a student submission transfers ownership of attached Drive\nfiles to the student and update the submission state.\n\nOnly the student that owns the requested student submission may call this\nmethod, and only for a student submission that has been turned in.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, unsubmit the requested student submission,\nor for access errors.\n* `FAILED_PRECONDITION` if the student submission has not been turned in.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "courseId", - "courseWorkId", - "id" - ], - "httpMethod": "POST", - "parameters": { - "id": { - "location": "path", - "description": "Identifier of the student submission.", - "required": true, - "type": "string" - }, - "courseWorkId": { - "description": "Identifier of the course work.", - "required": true, - "type": "string", - "location": "path" - }, - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me" - ] - }, - "turnIn": { - "httpMethod": "POST", - "parameterOrder": [ - "courseId", - "courseWorkId", - "id" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "courseWorkId": { - "required": true, - "type": "string", - "location": "path", - "description": "Identifier of the course work." - }, - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - }, - "id": { - "description": "Identifier of the student submission.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me" - ], - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn", - "id": "classroom.courses.courseWork.studentSubmissions.turnIn", - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn", - "request": { - "$ref": "TurnInStudentSubmissionRequest" - }, - "description": "Turns in a student submission.\n\nTurning in a student submission transfers ownership of attached Drive\nfiles to the teacher and may also update the submission state.\n\nThis may only be called by the student that owns the specified student\nsubmission.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, turn in the requested student submission,\nor for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist." - }, - "modifyAttachments": { - "httpMethod": "POST", - "parameterOrder": [ - "courseId", - "courseWorkId", - "id" - ], - "response": { - "$ref": "StudentSubmission" - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.students" - ], - "parameters": { - "courseWorkId": { - "location": "path", - "description": "Identifier of the course work.", - "required": true, - "type": "string" - }, - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "id": { - "description": "Identifier of the student submission.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments", - "id": "classroom.courses.courseWork.studentSubmissions.modifyAttachments", - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments", - "description": "Modifies attachments of student submission.\n\nAttachments may only be added to student submissions belonging to course\nwork objects with a `workType` of `ASSIGNMENT`.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, if the user is not permitted to modify\nattachments on the requested student submission, or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", - "request": { - "$ref": "ModifyAttachmentsRequest" - } - }, - "list": { - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", - "id": "classroom.courses.courseWork.studentSubmissions.list", - "description": "Returns a list of student submissions that the requester is permitted to\nview, factoring in the OAuth scopes of the request.\n`-` may be specified as the `course_work_id` to include student\nsubmissions for multiple course work items.\n\nCourse students may only view their own work. Course teachers\nand domain administrators may view all student submissions.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.", - "parameterOrder": [ - "courseId", - "courseWorkId" - ], - "httpMethod": "GET", - "response": { - "$ref": "ListStudentSubmissionsResponse" - }, - "parameters": { - "states": { - "location": "query", - "enum": [ - "SUBMISSION_STATE_UNSPECIFIED", - "NEW", - "CREATED", - "TURNED_IN", - "RETURNED", - "RECLAIMED_BY_STUDENT" - ], - "description": "Requested submission states. If specified, returned student submissions\nmatch one of the specified submission states.", - "type": "string", - "repeated": true - }, - "pageSize": { - "location": "query", - "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer" - }, - "userId": { - "location": "query", - "description": "Optional argument to restrict returned student work to those owned by the\nstudent with the specified identifier. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "type": "string" - }, - "courseWorkId": { - "location": "path", - "description": "Identifer of the student work to request.\nThis may be set to the string literal `\"-\"` to request student work for\nall course work in the specified course.", - "required": true, - "type": "string" - }, - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - }, - "late": { - "location": "query", - "enum": [ - "LATE_VALUES_UNSPECIFIED", - "LATE_ONLY", - "NOT_LATE_ONLY" - ], - "description": "Requested lateness value. If specified, returned student submissions are\nrestricted by the requested value.\nIf unspecified, submissions are returned regardless of `late` value.", - "type": "string" - }, - "pageToken": { - "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.me.readonly", - "https://www.googleapis.com/auth/classroom.coursework.students", - "https://www.googleapis.com/auth/classroom.coursework.students.readonly", - "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", - "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" - ], - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions" - } - } - } - }, - "methods": { - "delete": { - "description": "Deletes a course work.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding course work, if the requesting user is not permitted\nto delete the requested course or for access errors.\n* `FAILED_PRECONDITION` if the requested course work has already been\ndeleted.\n* `NOT_FOUND` if no course exists with the requested ID.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "courseId", - "id" - ], - "httpMethod": "DELETE", - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.students" - ], - "parameters": { - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "id": { - "location": "path", - "description": "Identifier of the course work to delete.\nThis identifier is a Classroom-assigned identifier.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/courses/{courseId}/courseWork/{id}", - "path": "v1/courses/{courseId}/courseWork/{id}", - "id": "classroom.courses.courseWork.delete" - }, - "patch": { - "description": "Updates one or more fields of a course work.\n\nSee google.classroom.v1.CourseWork for details\nof which fields may be updated and who may change them.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding course work, if the user is not permitted to make the\nrequested modification to the student submission, or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `FAILED_PRECONDITION` if the requested course work has already been\ndeleted.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", - "request": { - "$ref": "CourseWork" - }, - "response": { - "$ref": "CourseWork" - }, - "parameterOrder": [ - "courseId", - "id" - ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.students" - ], - "parameters": { - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "id": { - "required": true, - "type": "string", - "location": "path", - "description": "Identifier of the course work." - }, - "updateMask": { - "type": "string", - "location": "query", - "description": "Mask that identifies which fields on the course work to update.\nThis field is required to do an update. The update fails if invalid\nfields are specified. If a field supports empty values, it can be cleared\nby specifying it in the update mask and not in the CourseWork object. If a\nfield that does not support empty values is included in the update mask and\nnot set in the CourseWork object, an `INVALID_ARGUMENT` error will be\nreturned.\n\nThe following fields may be specified by teachers:\n* `title`\n* `description`\n* `state`\n* `due_date`\n* `due_time`\n* `max_points`\n* `submission_modification_mode`", - "format": "google-fieldmask" - } - }, - "flatPath": "v1/courses/{courseId}/courseWork/{id}", - "path": "v1/courses/{courseId}/courseWork/{id}", - "id": "classroom.courses.courseWork.patch" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "courseId", - "id" - ], - "response": { - "$ref": "CourseWork" - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.me.readonly", - "https://www.googleapis.com/auth/classroom.coursework.students", - "https://www.googleapis.com/auth/classroom.coursework.students.readonly" - ], - "parameters": { - "courseId": { - "required": true, - "type": "string", - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias." - }, - "id": { - "location": "path", - "description": "Identifier of the course work.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/courses/{courseId}/courseWork/{id}", - "id": "classroom.courses.courseWork.get", - "path": "v1/courses/{courseId}/courseWork/{id}", - "description": "Returns course work.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or course work does not exist." - }, - "list": { - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.me.readonly", - "https://www.googleapis.com/auth/classroom.coursework.students", - "https://www.googleapis.com/auth/classroom.coursework.students.readonly" - ], - "parameters": { - "orderBy": { - "description": "Optional sort ordering for results. A comma-separated list of fields with\nan optional sort direction keyword. Supported fields are `updateTime`\nand `dueDate`. Supported direction keywords are `asc` and `desc`.\nIf not specified, `updateTime desc` is the default behavior.\nExamples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc`", - "type": "string", - "location": "query" - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token." - }, - "pageSize": { - "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "courseWorkStates": { - "location": "query", - "enum": [ - "COURSE_WORK_STATE_UNSPECIFIED", - "PUBLISHED", - "DRAFT", - "DELETED" - ], - "description": "Restriction on the work status to return. Only courseWork that matches\nis returned. If unspecified, items with a work status of `PUBLISHED`\nis returned.", - "type": "string", - "repeated": true - }, - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/courses/{courseId}/courseWork", - "path": "v1/courses/{courseId}/courseWork", - "id": "classroom.courses.courseWork.list", - "description": "Returns a list of course work that the requester is permitted to view.\n\nCourse students may only view `PUBLISHED` course work. Course teachers\nand domain administrators may view all course work.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthe requested course or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.", - "response": { - "$ref": "ListCourseWorkResponse" - }, - "parameterOrder": [ - "courseId" - ], - "httpMethod": "GET" - }, - "create": { - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.students" - ], - "parameters": { - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/courses/{courseId}/courseWork", - "id": "classroom.courses.courseWork.create", - "path": "v1/courses/{courseId}/courseWork", - "description": "Creates course work.\n\nThe resulting course work (and corresponding student submissions) are\nassociated with the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\nmake the request. Classroom API requests to modify course work and student\nsubmissions must be made with an OAuth client ID from the associated\nDeveloper Console project.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course, create course work in the requested course, share a\nDrive attachment, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.\n* `FAILED_PRECONDITION` for the following request error:\n * AttachmentNotVisible", - "request": { - "$ref": "CourseWork" - }, - "httpMethod": "POST", - "parameterOrder": [ - "courseId" - ], - "response": { - "$ref": "CourseWork" - } - } - } - }, - "teachers": { - "methods": { - "create": { - "request": { - "$ref": "Teacher" - }, - "description": "Creates a teacher of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\nteachers in this course or for access errors.\n* `NOT_FOUND` if the requested course ID does not exist.\n* `FAILED_PRECONDITION` if the requested user's account is disabled,\nfor the following request errors:\n * CourseMemberLimitReached\n * CourseNotModifiable\n * CourseTeacherLimitReached\n * UserGroupsMembershipLimitReached\n* `ALREADY_EXISTS` if the user is already a teacher or student in the\ncourse.", - "response": { - "$ref": "Teacher" - }, - "parameterOrder": [ - "courseId" - ], - "httpMethod": "POST", - "parameters": { - "courseId": { - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.profile.emails", - "https://www.googleapis.com/auth/classroom.profile.photos", - "https://www.googleapis.com/auth/classroom.rosters" - ], - "flatPath": "v1/courses/{courseId}/teachers", - "path": "v1/courses/{courseId}/teachers", - "id": "classroom.courses.teachers.create" - }, - "delete": { - "parameterOrder": [ - "courseId", - "userId" - ], - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameters": { - "userId": { - "description": "Identifier of the teacher to delete. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, - "type": "string", - "location": "path" - }, - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters" - ], - "flatPath": "v1/courses/{courseId}/teachers/{userId}", - "path": "v1/courses/{courseId}/teachers/{userId}", - "id": "classroom.courses.teachers.delete", - "description": "Deletes a teacher of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete\nteachers of this course or for access errors.\n* `NOT_FOUND` if no teacher of this course has the requested ID or if the\ncourse does not exist.\n* `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher\nof this course." - }, - "get": { - "scopes": [ - "https://www.googleapis.com/auth/classroom.profile.emails", - "https://www.googleapis.com/auth/classroom.profile.photos", - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "parameters": { - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "required": true, - "type": "string", - "location": "path" - }, - "userId": { - "description": "Identifier of the teacher to return. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/courses/{courseId}/teachers/{userId}", - "id": "classroom.courses.teachers.get", - "path": "v1/courses/{courseId}/teachers/{userId}", - "description": "Returns a teacher of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view\nteachers of this course or for access errors.\n* `NOT_FOUND` if no teacher of this course has the requested ID or if the\ncourse does not exist.", - "httpMethod": "GET", - "parameterOrder": [ - "courseId", - "userId" - ], - "response": { - "$ref": "Teacher" - } - }, - "list": { - "description": "Returns a list of teachers of this course that the requester\nis permitted to view.\n\nThis method returns the following error codes:\n\n* `NOT_FOUND` if the course does not exist.\n* `PERMISSION_DENIED` for access errors.", - "response": { - "$ref": "ListTeachersResponse" - }, - "parameterOrder": [ - "courseId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/classroom.profile.emails", - "https://www.googleapis.com/auth/classroom.profile.photos", - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "parameters": { - "pageToken": { - "description": "nextPageToken\nvalue returned from a previous\nlist call, indicating that\nthe subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "description": "Maximum number of items to return. Zero means no maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "courseId": { - "required": true, - "type": "string", - "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias." - } - }, - "flatPath": "v1/courses/{courseId}/teachers", - "path": "v1/courses/{courseId}/teachers", - "id": "classroom.courses.teachers.list" - } - } + "description": "Creates a `Registration`, causing Classroom to start sending notifications\nfrom the provided `feed` to the provided `destination`.\n\nReturns the created `Registration`. Currently, this will be the same as\nthe argument, but with server-assigned fields such as `expiry_time` and\n`id` filled in.\n\nNote that any value specified for the `expiry_time` or `id` fields will be\nignored.\n\nWhile Classroom may validate the `destination` and return errors on a best\neffort basis, it is the caller's responsibility to ensure that it exists\nand that Classroom has permission to publish to it.\n\nThis method may return the following error codes:\n\n* `PERMISSION_DENIED` if:\n * the authenticated user does not have permission to receive\n notifications from the requested field; or\n * the credential provided does not include the appropriate scope for the\n requested feed.\n * another access error is encountered.\n* `INVALID_ARGUMENT` if:\n * no `destination` is specified, or the specified `destination` is not\n valid; or\n * no `feed` is specified, or the specified `feed` is not valid.\n* `NOT_FOUND` if:\n * the specified `feed` cannot be located, or the requesting user does not\n have permission to determine whether or not it exists; or\n * the specified `destination` cannot be located, or Classroom has not\n been granted permission to publish to it." } } }, "userProfiles": { "methods": { "get": { - "httpMethod": "GET", "response": { "$ref": "UserProfile" }, "parameterOrder": [ "userId" ], + "httpMethod": "GET", "parameters": { "userId": { "description": "Identifier of the profile to return. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, "type": "string", + "required": true, "location": "path" } }, @@ -1269,83 +223,13 @@ "resources": { "guardianInvitations": { "methods": { - "list": { - "path": "v1/userProfiles/{studentId}/guardianInvitations", - "id": "classroom.userProfiles.guardianInvitations.list", - "description": "Returns a list of guardian invitations that the requesting user is\npermitted to view, filtered by the parameters provided.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if a `student_id` is specified, and the requesting\n user is not permitted to view guardian invitations for that student, if\n `\"-\"` is specified as the `student_id` and the user is not a domain\n administrator, if guardians are not enabled for the domain in question,\n or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`). May also be returned if an invalid\n `page_token` or `state` is provided.\n* `NOT_FOUND` if a `student_id` is specified, and its format can be\n recognized, but Classroom has no record of that student.", - "response": { - "$ref": "ListGuardianInvitationsResponse" - }, - "parameterOrder": [ - "studentId" - ], - "httpMethod": "GET", - "parameters": { - "studentId": { - "description": "The ID of the student whose guardian invitations are to be returned.\nThe identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user\n* the string literal `\"-\"`, indicating that results should be returned for\n all students that the requesting user is permitted to view guardian\n invitations.", - "required": true, - "type": "string", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", - "type": "string" - }, - "invitedEmailAddress": { - "location": "query", - "description": "If specified, only results with the specified `invited_email_address`\nwill be returned.", - "type": "string" - }, - "states": { - "enum": [ - "GUARDIAN_INVITATION_STATE_UNSPECIFIED", - "PENDING", - "COMPLETE" - ], - "description": "If specified, only results with the specified `state` values will be\nreturned. Otherwise, results with a `state` of `PENDING` will be returned.", - "type": "string", - "repeated": true, - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v1/userProfiles/{studentId}/guardianInvitations" - }, - "get": { - "response": { + "patch": { + "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", + "id": "classroom.userProfiles.guardianInvitations.patch", + "request": { "$ref": "GuardianInvitation" }, - "parameterOrder": [ - "studentId", - "invitationId" - ], - "httpMethod": "GET", - "parameters": { - "studentId": { - "description": "The ID of the student whose guardian invitation is being requested.", - "required": true, - "type": "string", - "location": "path" - }, - "invitationId": { - "location": "path", - "description": "The `id` field of the `GuardianInvitation` being requested.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", - "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", - "id": "classroom.userProfiles.guardianInvitations.get", - "description": "Returns a specific guardian invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view\n guardian invitations for the student identified by the `student_id`, if\n guardians are not enabled for the domain in question, or for other\n access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`).\n* `NOT_FOUND` if Classroom cannot find any record of the given student or\n `invitation_id`. May also be returned if the student exists, but the\n requesting user does not have access to see that student." - }, - "patch": { + "description": "Modifies a guardian invitation.\n\nCurrently, the only valid modification is to change the `state` from\n`PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the current user does not have permission to\n manage guardians, if guardians are not enabled for the domain in question\n or for other access errors.\n* `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.\n* `INVALID_ARGUMENT` if the format of the student ID provided\n cannot be recognized (it is not an email address, nor a `user_id` from\n this API), or if the passed `GuardianInvitation` has a `state` other than\n `COMPLETE`, or if it modifies fields other than `state`.\n* `NOT_FOUND` if the student ID provided is a valid student ID, but\n Classroom has no record of that student, or if the `id` field does not\n refer to a guardian invitation known to Classroom.", "httpMethod": "PATCH", "parameterOrder": [ "studentId", @@ -1354,63 +238,223 @@ "response": { "$ref": "GuardianInvitation" }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students" + ], "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Mask that identifies which fields on the course to update.\nThis field is required to do an update. The update will fail if invalid\nfields are specified. The following fields are valid:\n\n* `state`\n\nWhen set in a query parameter, this field should be specified as\n\n`updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...`", + "type": "string", + "location": "query" + }, "invitationId": { "description": "The `id` field of the `GuardianInvitation` to be modified.", - "required": true, "type": "string", + "required": true, "location": "path" }, - "updateMask": { - "location": "query", - "description": "Mask that identifies which fields on the course to update.\nThis field is required to do an update. The update will fail if invalid\nfields are specified. The following fields are valid:\n\n* `state`\n\nWhen set in a query parameter, this field should be specified as\n\n`updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...`", - "format": "google-fieldmask", - "type": "string" - }, "studentId": { "description": "The ID of the student whose guardian invitation is to be modified.", - "required": true, "type": "string", + "required": true, "location": "path" } }, - "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", - "id": "classroom.userProfiles.guardianInvitations.patch", - "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", - "request": { - "$ref": "GuardianInvitation" - }, - "description": "Modifies a guardian invitation.\n\nCurrently, the only valid modification is to change the `state` from\n`PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the current user does not have permission to\n manage guardians, if guardians are not enabled for the domain in question\n or for other access errors.\n* `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.\n* `INVALID_ARGUMENT` if the format of the student ID provided\n cannot be recognized (it is not an email address, nor a `user_id` from\n this API), or if the passed `GuardianInvitation` has a `state` other than\n `COMPLETE`, or if it modifies fields other than `state`.\n* `NOT_FOUND` if the student ID provided is a valid student ID, but\n Classroom has no record of that student, or if the `id` field does not\n refer to a guardian invitation known to Classroom." + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}" }, - "create": { - "request": { - "$ref": "GuardianInvitation" - }, - "description": "Creates a guardian invitation, and sends an email to the guardian asking\nthem to confirm that they are the student's guardian.\n\nOnce the guardian accepts the invitation, their `state` will change to\n`COMPLETED` and they will start receiving guardian notifications. A\n`Guardian` resource will also be created to represent the active guardian.\n\nThe request object must have the `student_id` and\n`invited_email_address` fields set. Failing to set these fields, or\nsetting any other fields in the request, will result in an error.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the current user does not have permission to\n manage guardians, if the guardian in question has already rejected\n too many requests for that student, if guardians are not enabled for the\n domain in question, or for other access errors.\n* `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian\n link limit.\n* `INVALID_ARGUMENT` if the guardian email address is not valid (for\n example, if it is too long), or if the format of the student ID provided\n cannot be recognized (it is not an email address, nor a `user_id` from\n this API). This error will also be returned if read-only fields are set,\n or if the `state` field is set to to a value other than `PENDING`.\n* `NOT_FOUND` if the student ID provided is a valid student ID, but\n Classroom has no record of that student.\n* `ALREADY_EXISTS` if there is already a pending guardian invitation for\n the student and `invited_email_address` provided, or if the provided\n `invited_email_address` matches the Google account of an existing\n `Guardian` for this user.", + "get": { + "description": "Returns a specific guardian invitation.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view\n guardian invitations for the student identified by the `student_id`, if\n guardians are not enabled for the domain in question, or for other\n access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`).\n* `NOT_FOUND` if Classroom cannot find any record of the given student or\n `invitation_id`. May also be returned if the student exists, but the\n requesting user does not have access to see that student.", "response": { "$ref": "GuardianInvitation" }, + "parameterOrder": [ + "studentId", + "invitationId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students", + "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly" + ], + "parameters": { + "invitationId": { + "description": "The `id` field of the `GuardianInvitation` being requested.", + "type": "string", + "required": true, + "location": "path" + }, + "studentId": { + "description": "The ID of the student whose guardian invitation is being requested.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", + "id": "classroom.userProfiles.guardianInvitations.get", + "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}" + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListGuardianInvitationsResponse" + }, "parameterOrder": [ "studentId" ], + "parameters": { + "studentId": { + "description": "The ID of the student whose guardian invitations are to be returned.\nThe identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user\n* the string literal `\"-\"`, indicating that results should be returned for\n all students that the requesting user is permitted to view guardian\n invitations.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer", + "location": "query" + }, + "states": { + "repeated": true, + "location": "query", + "enum": [ + "GUARDIAN_INVITATION_STATE_UNSPECIFIED", + "PENDING", + "COMPLETE" + ], + "description": "If specified, only results with the specified `state` values will be\nreturned. Otherwise, results with a `state` of `PENDING` will be returned.", + "type": "string" + }, + "invitedEmailAddress": { + "description": "If specified, only results with the specified `invited_email_address`\nwill be returned.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students", + "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly" + ], + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations", + "path": "v1/userProfiles/{studentId}/guardianInvitations", + "id": "classroom.userProfiles.guardianInvitations.list", + "description": "Returns a list of guardian invitations that the requesting user is\npermitted to view, filtered by the parameters provided.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if a `student_id` is specified, and the requesting\n user is not permitted to view guardian invitations for that student, if\n `\"-\"` is specified as the `student_id` and the user is not a domain\n administrator, if guardians are not enabled for the domain in question,\n or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`). May also be returned if an invalid\n `page_token` or `state` is provided.\n* `NOT_FOUND` if a `student_id` is specified, and its format can be\n recognized, but Classroom has no record of that student." + }, + "create": { + "path": "v1/userProfiles/{studentId}/guardianInvitations", + "id": "classroom.userProfiles.guardianInvitations.create", + "description": "Creates a guardian invitation, and sends an email to the guardian asking\nthem to confirm that they are the student's guardian.\n\nOnce the guardian accepts the invitation, their `state` will change to\n`COMPLETED` and they will start receiving guardian notifications. A\n`Guardian` resource will also be created to represent the active guardian.\n\nThe request object must have the `student_id` and\n`invited_email_address` fields set. Failing to set these fields, or\nsetting any other fields in the request, will result in an error.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the current user does not have permission to\n manage guardians, if the guardian in question has already rejected\n too many requests for that student, if guardians are not enabled for the\n domain in question, or for other access errors.\n* `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian\n link limit.\n* `INVALID_ARGUMENT` if the guardian email address is not valid (for\n example, if it is too long), or if the format of the student ID provided\n cannot be recognized (it is not an email address, nor a `user_id` from\n this API). This error will also be returned if read-only fields are set,\n or if the `state` field is set to to a value other than `PENDING`.\n* `NOT_FOUND` if the student ID provided is a valid student ID, but\n Classroom has no record of that student.\n* `ALREADY_EXISTS` if there is already a pending guardian invitation for\n the student and `invited_email_address` provided, or if the provided\n `invited_email_address` matches the Google account of an existing\n `Guardian` for this user.", + "request": { + "$ref": "GuardianInvitation" + }, "httpMethod": "POST", + "parameterOrder": [ + "studentId" + ], + "response": { + "$ref": "GuardianInvitation" + }, "parameters": { "studentId": { "location": "path", "description": "ID of the student (in standard format)", - "required": true, - "type": "string" + "type": "string", + "required": true } }, - "flatPath": "v1/userProfiles/{studentId}/guardianInvitations", - "path": "v1/userProfiles/{studentId}/guardianInvitations", - "id": "classroom.userProfiles.guardianInvitations.create" + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students" + ], + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations" } } }, "guardians": { "methods": { + "get": { + "description": "Returns a specific guardian.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if no user that matches the provided `student_id`\n is visible to the requesting user, if the requesting user is not\n permitted to view guardian information for the student identified by the\n `student_id`, if guardians are not enabled for the domain in question,\n or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`).\n* `NOT_FOUND` if the requesting user is permitted to view guardians for\n the requested `student_id`, but no `Guardian` record exists for that\n student that matches the provided `guardian_id`.", + "httpMethod": "GET", + "response": { + "$ref": "Guardian" + }, + "parameterOrder": [ + "studentId", + "guardianId" + ], + "parameters": { + "studentId": { + "location": "path", + "description": "The student whose guardian is being requested. One of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "required": true + }, + "guardianId": { + "description": "The `id` field from a `Guardian`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly", + "https://www.googleapis.com/auth/classroom.guardianlinks.students", + "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly" + ], + "flatPath": "v1/userProfiles/{studentId}/guardians/{guardianId}", + "path": "v1/userProfiles/{studentId}/guardians/{guardianId}", + "id": "classroom.userProfiles.guardians.get" + }, + "list": { + "description": "Returns a list of guardians that the requesting user is permitted to\nview, restricted to those that match the request.\n\nTo list guardians for any student that the requesting user may view\nguardians for, use the literal character `-` for the student ID.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if a `student_id` is specified, and the requesting\n user is not permitted to view guardian information for that student, if\n `\"-\"` is specified as the `student_id` and the user is not a domain\n administrator, if guardians are not enabled for the domain in question,\n if the `invited_email_address` filter is set by a user who is not a\n domain administrator, or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`). May also be returned if an invalid\n `page_token` is provided.\n* `NOT_FOUND` if a `student_id` is specified, and its format can be\n recognized, but Classroom has no record of that student.", + "response": { + "$ref": "ListGuardiansResponse" + }, + "parameterOrder": [ + "studentId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly", + "https://www.googleapis.com/auth/classroom.guardianlinks.students", + "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly" + ], + "parameters": { + "studentId": { + "description": "Filter results by the student who the guardian is linked to.\nThe identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user\n* the string literal `\"-\"`, indicating that results should be returned for\n all students that the requesting user has access to view.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer" + }, + "invitedEmailAddress": { + "description": "Filter results by the email address that the original invitation was sent\nto, resulting in this guardian link.\nThis filter can only be used by domain administrators.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/userProfiles/{studentId}/guardians", + "id": "classroom.userProfiles.guardians.list", + "path": "v1/userProfiles/{studentId}/guardians" + }, "delete": { + "description": "Deletes a guardian.\n\nThe guardian will no longer receive guardian notifications and the guardian\nwill no longer be accessible via the API.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if no user that matches the provided `student_id`\n is visible to the requesting user, if the requesting user is not\n permitted to manage guardians for the student identified by the\n `student_id`, if guardians are not enabled for the domain in question,\n or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API).\n* `NOT_FOUND` if the requesting user is permitted to modify guardians for\n the requested `student_id`, but no `Guardian` record exists for that\n student with the provided `guardian_id`.", "response": { "$ref": "Empty" }, @@ -1421,36 +465,725 @@ "httpMethod": "DELETE", "parameters": { "studentId": { + "location": "path", "description": "The student whose guardian is to be deleted. One of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, "type": "string", - "location": "path" + "required": true }, "guardianId": { + "location": "path", "description": "The `id` field from a `Guardian`.", - "required": true, "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students" + ], + "flatPath": "v1/userProfiles/{studentId}/guardians/{guardianId}", + "id": "classroom.userProfiles.guardians.delete", + "path": "v1/userProfiles/{studentId}/guardians/{guardianId}" + } + } + } + } + }, + "courses": { + "methods": { + "delete": { + "description": "Deletes a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID.", + "httpMethod": "DELETE", + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "id": { + "description": "Identifier of the course to delete.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], + "flatPath": "v1/courses/{id}", + "path": "v1/courses/{id}", + "id": "classroom.courses.delete" + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListCoursesResponse" + }, + "parameterOrder": [], + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses", + "https://www.googleapis.com/auth/classroom.courses.readonly" + ], + "parameters": { + "studentId": { + "description": "Restricts returned courses to those having a student with the specified\nidentifier. The identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer" + }, + "courseStates": { + "location": "query", + "enum": [ + "COURSE_STATE_UNSPECIFIED", + "ACTIVE", + "ARCHIVED", + "PROVISIONED", + "DECLINED", + "SUSPENDED" + ], + "description": "Restricts returned courses to those in one of the specified states\nThe default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED.", + "type": "string", + "repeated": true + }, + "teacherId": { + "location": "query", + "description": "Restricts returned courses to those having a teacher with the specified\nidentifier. The identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string" + } + }, + "flatPath": "v1/courses", + "path": "v1/courses", + "id": "classroom.courses.list", + "description": "Returns a list of courses that the requesting user is permitted to view,\nrestricted to those that match the request. Returned courses are ordered by\ncreation time, with the most recently created coming first.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` for access errors.\n* `INVALID_ARGUMENT` if the query argument is malformed.\n* `NOT_FOUND` if any users specified in the query arguments do not exist." + }, + "create": { + "request": { + "$ref": "Course" + }, + "description": "Creates a course.\n\nThe user specified in `ownerId` is the owner of the created course\nand added as a teacher.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\ncourses or for access errors.\n* `NOT_FOUND` if the primary teacher is not a valid user.\n* `FAILED_PRECONDITION` if the course owner's account is disabled or for\nthe following request errors:\n * UserGroupsMembershipLimitReached\n* `ALREADY_EXISTS` if an alias was specified in the `id` and\nalready exists.", + "response": { + "$ref": "Course" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], + "parameters": {}, + "flatPath": "v1/courses", + "id": "classroom.courses.create", + "path": "v1/courses" + }, + "patch": { + "path": "v1/courses/{id}", + "id": "classroom.courses.patch", + "description": "Updates one or more fields in a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to modify the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID.\n* `INVALID_ARGUMENT` if invalid fields are specified in the update mask or\nif no update mask is supplied.\n* `FAILED_PRECONDITION` for the following request errors:\n * CourseNotModifiable", + "request": { + "$ref": "Course" + }, + "httpMethod": "PATCH", + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Course" + }, + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Mask that identifies which fields on the course to update.\nThis field is required to do an update. The update will fail if invalid\nfields are specified. The following fields are valid:\n\n* `name`\n* `section`\n* `descriptionHeading`\n* `description`\n* `room`\n* `courseState`\n* `ownerId`\n\nNote: patches to ownerId are treated as being effective immediately, but in\npractice it may take some time for the ownership transfer of all affected\nresources to complete.\n\nWhen set in a query parameter, this field should be specified as\n\n`updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...`", + "type": "string", + "location": "query" + }, + "id": { + "location": "path", + "description": "Identifier of the course to update.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], + "flatPath": "v1/courses/{id}" + }, + "get": { + "response": { + "$ref": "Course" + }, + "parameterOrder": [ + "id" + ], + "httpMethod": "GET", + "parameters": { + "id": { + "location": "path", + "description": "Identifier of the course to return.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses", + "https://www.googleapis.com/auth/classroom.courses.readonly" + ], + "flatPath": "v1/courses/{id}", + "id": "classroom.courses.get", + "path": "v1/courses/{id}", + "description": "Returns a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID." + }, + "update": { + "httpMethod": "PUT", + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Course" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], + "parameters": { + "id": { + "location": "path", + "description": "Identifier of the course to update.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{id}", + "path": "v1/courses/{id}", + "id": "classroom.courses.update", + "request": { + "$ref": "Course" + }, + "description": "Updates a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to modify the\nrequested course or for access errors.\n* `NOT_FOUND` if no course exists with the requested ID.\n* `FAILED_PRECONDITION` for the following request errors:\n * CourseNotModifiable" + } + }, + "resources": { + "announcements": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "ListAnnouncementsResponse" + }, + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "announcementStates": { + "location": "query", + "enum": [ + "ANNOUNCEMENT_STATE_UNSPECIFIED", + "PUBLISHED", + "DRAFT", + "DELETED" + ], + "description": "Restriction on the `state` of announcements returned.\nIf this argument is left unspecified, the default value is `PUBLISHED`.", + "type": "string", + "repeated": true + }, + "pageToken": { + "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", + "type": "string", + "location": "query" + }, + "orderBy": { + "location": "query", + "description": "Optional sort ordering for results. A comma-separated list of fields with\nan optional sort direction keyword. Supported field is `updateTime`.\nSupported direction keywords are `asc` and `desc`.\nIf not specified, `updateTime desc` is the default behavior.\nExamples: `updateTime asc`, `updateTime`", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements", + "https://www.googleapis.com/auth/classroom.announcements.readonly" + ], + "flatPath": "v1/courses/{courseId}/announcements", + "path": "v1/courses/{courseId}/announcements", + "id": "classroom.courses.announcements.list", + "description": "Returns a list of announcements that the requester is permitted to view.\n\nCourse students may only view `PUBLISHED` announcements. Course teachers\nand domain administrators may view all announcements.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthe requested course or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist." + }, + "create": { + "description": "Creates an announcement.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course, create announcements in the requested course, share a\nDrive attachment, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.\n* `FAILED_PRECONDITION` for the following request error:\n * AttachmentNotVisible", + "request": { + "$ref": "Announcement" + }, + "response": { + "$ref": "Announcement" + }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "POST", + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, "location": "path" } }, - "flatPath": "v1/userProfiles/{studentId}/guardians/{guardianId}", - "path": "v1/userProfiles/{studentId}/guardians/{guardianId}", - "id": "classroom.userProfiles.guardians.delete", - "description": "Deletes a guardian.\n\nThe guardian will no longer receive guardian notifications and the guardian\nwill no longer be accessible via the API.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if no user that matches the provided `student_id`\n is visible to the requesting user, if the requesting user is not\n permitted to manage guardians for the student identified by the\n `student_id`, if guardians are not enabled for the domain in question,\n or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API).\n* `NOT_FOUND` if the requesting user is permitted to modify guardians for\n the requested `student_id`, but no `Guardian` record exists for that\n student with the provided `guardian_id`." + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements" + ], + "flatPath": "v1/courses/{courseId}/announcements", + "id": "classroom.courses.announcements.create", + "path": "v1/courses/{courseId}/announcements" }, - "list": { + "modifyAssignees": { + "request": { + "$ref": "ModifyAnnouncementAssigneesRequest" + }, + "description": "Modifies assignee mode and options of an announcement.\n\nOnly a teacher of the course that contains the announcement may\ncall this method.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or course work does not exist.", "response": { - "$ref": "ListGuardiansResponse" + "$ref": "Announcement" }, "parameterOrder": [ - "studentId" + "courseId", + "id" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "location": "path", + "description": "Identifier of the announcement.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{courseId}/announcements/{id}:modifyAssignees", + "id": "classroom.courses.announcements.modifyAssignees", + "path": "v1/courses/{courseId}/announcements/{id}:modifyAssignees" + }, + "patch": { + "response": { + "$ref": "Announcement" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "Identifier of the announcement.", + "type": "string", + "required": true, + "location": "path" + }, + "updateMask": { + "format": "google-fieldmask", + "description": "Mask that identifies which fields on the announcement to update.\nThis field is required to do an update. The update fails if invalid\nfields are specified. If a field supports empty values, it can be cleared\nby specifying it in the update mask and not in the Announcement object. If\na field that does not support empty values is included in the update mask\nand not set in the Announcement object, an `INVALID_ARGUMENT` error will be\nreturned.\n\nThe following fields may be specified by teachers:\n\n* `text`\n* `state`\n* `scheduled_time`", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/courses/{courseId}/announcements/{id}", + "id": "classroom.courses.announcements.patch", + "path": "v1/courses/{courseId}/announcements/{id}", + "request": { + "$ref": "Announcement" + }, + "description": "Updates one or more fields of an announcement.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding announcement or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `FAILED_PRECONDITION` if the requested announcement has already been\ndeleted.\n* `NOT_FOUND` if the requested course or announcement does not exist" + }, + "get": { + "description": "Returns an announcement.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or announcement, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or announcement does not exist.", + "response": { + "$ref": "Announcement" + }, + "parameterOrder": [ + "courseId", + "id" ], "httpMethod": "GET", "parameters": { - "studentId": { - "description": "Filter results by the student who the guardian is linked to.\nThe identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user\n* the string literal `\"-\"`, indicating that results should be returned for\n all students that the requesting user has access to view.", - "required": true, + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", "type": "string", + "required": true + }, + "id": { + "description": "Identifier of the announcement.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements", + "https://www.googleapis.com/auth/classroom.announcements.readonly" + ], + "flatPath": "v1/courses/{courseId}/announcements/{id}", + "id": "classroom.courses.announcements.get", + "path": "v1/courses/{courseId}/announcements/{id}" + }, + "delete": { + "id": "classroom.courses.announcements.delete", + "path": "v1/courses/{courseId}/announcements/{id}", + "description": "Deletes an announcement.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding announcement item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding announcement, if the requesting user is not permitted\nto delete the requested course or for access errors.\n* `FAILED_PRECONDITION` if the requested announcement has already been\ndeleted.\n* `NOT_FOUND` if no course exists with the requested ID.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "httpMethod": "DELETE", + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "id": { + "description": "Identifier of the announcement to delete.\nThis identifier is a Classroom-assigned identifier.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements" + ], + "flatPath": "v1/courses/{courseId}/announcements/{id}" + } + } + }, + "aliases": { + "methods": { + "delete": { + "description": "Deletes an alias of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to remove the\nalias or for access errors.\n* `NOT_FOUND` if the alias does not exist.\n* `FAILED_PRECONDITION` if the alias requested does not make sense for the\n requesting user or course (for example, if a user not in a domain\n attempts to delete a domain-scoped alias).", + "httpMethod": "DELETE", + "parameterOrder": [ + "courseId", + "alias" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course whose alias should be deleted.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "alias": { + "location": "path", + "description": "Alias to delete.\nThis may not be the Classroom-assigned identifier.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{courseId}/aliases/{alias}", + "path": "v1/courses/{courseId}/aliases/{alias}", + "id": "classroom.courses.aliases.delete" + }, + "list": { + "parameterOrder": [ + "courseId" + ], + "httpMethod": "GET", + "response": { + "$ref": "ListCourseAliasesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses", + "https://www.googleapis.com/auth/classroom.courses.readonly" + ], + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer" + }, + "courseId": { + "location": "path", + "description": "The identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", + "type": "string" + } + }, + "flatPath": "v1/courses/{courseId}/aliases", + "id": "classroom.courses.aliases.list", + "path": "v1/courses/{courseId}/aliases", + "description": "Returns a list of aliases for a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\ncourse or for access errors.\n* `NOT_FOUND` if the course does not exist." + }, + "create": { + "description": "Creates an alias for a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create the\nalias or for access errors.\n* `NOT_FOUND` if the course does not exist.\n* `ALREADY_EXISTS` if the alias already exists.\n* `FAILED_PRECONDITION` if the alias requested does not make sense for the\n requesting user or course (for example, if a user not in a domain\n attempts to access a domain-scoped alias).", + "request": { + "$ref": "CourseAlias" + }, + "httpMethod": "POST", + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "CourseAlias" + }, + "parameters": { + "courseId": { + "description": "Identifier of the course to alias.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], + "flatPath": "v1/courses/{courseId}/aliases", + "path": "v1/courses/{courseId}/aliases", + "id": "classroom.courses.aliases.create" + } + } + }, + "students": { + "methods": { + "delete": { + "description": "Deletes a student of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete\nstudents of this course or for access errors.\n* `NOT_FOUND` if no student of this course has the requested ID or if the\ncourse does not exist.", + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "userId": { + "location": "path", + "description": "Identifier of the student to delete. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{courseId}/students/{userId}", + "path": "v1/courses/{courseId}/students/{userId}", + "id": "classroom.courses.students.delete" + }, + "list": { + "description": "Returns a list of students of this course that the requester\nis permitted to view.\n\nThis method returns the following error codes:\n\n* `NOT_FOUND` if the course does not exist.\n* `PERMISSION_DENIED` for access errors.", + "response": { + "$ref": "ListStudentsResponse" + }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "nextPageToken\nvalue returned from a previous\nlist call, indicating that\nthe subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of items to return. Zero means no maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer", + "location": "query" + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "flatPath": "v1/courses/{courseId}/students", + "id": "classroom.courses.students.list", + "path": "v1/courses/{courseId}/students" + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "courseId", + "userId" + ], + "response": { + "$ref": "Student" + }, + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "userId": { + "location": "path", + "description": "Identifier of the student to return. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "flatPath": "v1/courses/{courseId}/students/{userId}", + "path": "v1/courses/{courseId}/students/{userId}", + "id": "classroom.courses.students.get", + "description": "Returns a student of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view\nstudents of this course or for access errors.\n* `NOT_FOUND` if no student of this course has the requested ID or if the\ncourse does not exist." + }, + "create": { + "description": "Adds a user as a student of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\nstudents in this course or for access errors.\n* `NOT_FOUND` if the requested course ID does not exist.\n* `FAILED_PRECONDITION` if the requested user's account is disabled,\nfor the following request errors:\n * CourseMemberLimitReached\n * CourseNotModifiable\n * UserGroupsMembershipLimitReached\n* `ALREADY_EXISTS` if the user is already a student or teacher in the\ncourse.", + "request": { + "$ref": "Student" + }, + "httpMethod": "POST", + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "Student" + }, + "parameters": { + "enrollmentCode": { + "location": "query", + "description": "Enrollment code of the course to create the student in.\nThis code is required if userId\ncorresponds to the requesting user; it may be omitted if the requesting\nuser has administrative permissions to create students for any user.", + "type": "string" + }, + "courseId": { + "location": "path", + "description": "Identifier of the course to create the student in.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters" + ], + "flatPath": "v1/courses/{courseId}/students", + "path": "v1/courses/{courseId}/students", + "id": "classroom.courses.students.create" + } + } + }, + "courseWork": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "id": { + "location": "path", + "description": "Identifier of the course work to delete.\nThis identifier is a Classroom-assigned identifier.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "flatPath": "v1/courses/{courseId}/courseWork/{id}", + "path": "v1/courses/{courseId}/courseWork/{id}", + "id": "classroom.courses.courseWork.delete", + "description": "Deletes a course work.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding course work, if the requesting user is not permitted\nto delete the requested course or for access errors.\n* `FAILED_PRECONDITION` if the requested course work has already been\ndeleted.\n* `NOT_FOUND` if no course exists with the requested ID." + }, + "list": { + "description": "Returns a list of course work that the requester is permitted to view.\n\nCourse students may only view `PUBLISHED` course work. Course teachers\nand domain administrators may view all course work.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthe requested course or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.", + "response": { + "$ref": "ListCourseWorkResponse" + }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + "https://www.googleapis.com/auth/classroom.coursework.students", + "https://www.googleapis.com/auth/classroom.coursework.students.readonly" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, "location": "path" }, "pageToken": { @@ -1458,50 +1191,642 @@ "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", "type": "string" }, - "invitedEmailAddress": { + "orderBy": { "location": "query", - "description": "Filter results by the email address that the original invitation was sent\nto, resulting in this guardian link.\nThis filter can only be used by domain administrators.", + "description": "Optional sort ordering for results. A comma-separated list of fields with\nan optional sort direction keyword. Supported fields are `updateTime`\nand `dueDate`. Supported direction keywords are `asc` and `desc`.\nIf not specified, `updateTime desc` is the default behavior.\nExamples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc`", "type": "string" }, "pageSize": { - "location": "query", - "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", "format": "int32", - "type": "integer" + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer", + "location": "query" + }, + "courseWorkStates": { + "enum": [ + "COURSE_WORK_STATE_UNSPECIFIED", + "PUBLISHED", + "DRAFT", + "DELETED" + ], + "description": "Restriction on the work status to return. Only courseWork that matches\nis returned. If unspecified, items with a work status of `PUBLISHED`\nis returned.", + "type": "string", + "repeated": true, + "location": "query" } }, - "flatPath": "v1/userProfiles/{studentId}/guardians", - "path": "v1/userProfiles/{studentId}/guardians", - "id": "classroom.userProfiles.guardians.list", - "description": "Returns a list of guardians that the requesting user is permitted to\nview, restricted to those that match the request.\n\nTo list guardians for any student that the requesting user may view\nguardians for, use the literal character `-` for the student ID.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if a `student_id` is specified, and the requesting\n user is not permitted to view guardian information for that student, if\n `\"-\"` is specified as the `student_id` and the user is not a domain\n administrator, if guardians are not enabled for the domain in question,\n if the `invited_email_address` filter is set by a user who is not a\n domain administrator, or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`). May also be returned if an invalid\n `page_token` is provided.\n* `NOT_FOUND` if a `student_id` is specified, and its format can be\n recognized, but Classroom has no record of that student." + "flatPath": "v1/courses/{courseId}/courseWork", + "id": "classroom.courses.courseWork.list", + "path": "v1/courses/{courseId}/courseWork" }, - "get": { + "create": { + "id": "classroom.courses.courseWork.create", + "path": "v1/courses/{courseId}/courseWork", + "request": { + "$ref": "CourseWork" + }, + "description": "Creates course work.\n\nThe resulting course work (and corresponding student submissions) are\nassociated with the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\nmake the request. Classroom API requests to modify course work and student\nsubmissions must be made with an OAuth client ID from the associated\nDeveloper Console project.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course, create course work in the requested course, share a\nDrive attachment, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist.\n* `FAILED_PRECONDITION` for the following request error:\n * AttachmentNotVisible", "response": { - "$ref": "Guardian" + "$ref": "CourseWork" }, "parameterOrder": [ - "studentId", - "guardianId" + "courseId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" ], - "httpMethod": "GET", "parameters": { - "guardianId": { - "location": "path", - "description": "The `id` field from a `Guardian`.", - "required": true, - "type": "string" - }, - "studentId": { - "description": "The student whose guardian is being requested. One of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "required": true, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", "type": "string", + "required": true, "location": "path" } }, - "flatPath": "v1/userProfiles/{studentId}/guardians/{guardianId}", - "path": "v1/userProfiles/{studentId}/guardians/{guardianId}", - "id": "classroom.userProfiles.guardians.get", - "description": "Returns a specific guardian.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if no user that matches the provided `student_id`\n is visible to the requesting user, if the requesting user is not\n permitted to view guardian information for the student identified by the\n `student_id`, if guardians are not enabled for the domain in question,\n or for other access errors.\n* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot\n be recognized (it is not an email address, nor a `student_id` from the\n API, nor the literal string `me`).\n* `NOT_FOUND` if the requesting user is permitted to view guardians for\n the requested `student_id`, but no `Guardian` record exists for that\n student that matches the provided `guardian_id`." + "flatPath": "v1/courses/{courseId}/courseWork" + }, + "modifyAssignees": { + "response": { + "$ref": "CourseWork" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "httpMethod": "POST", + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "id": { + "location": "path", + "description": "Identifier of the coursework.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "flatPath": "v1/courses/{courseId}/courseWork/{id}:modifyAssignees", + "id": "classroom.courses.courseWork.modifyAssignees", + "path": "v1/courses/{courseId}/courseWork/{id}:modifyAssignees", + "description": "Modifies assignee mode and options of a coursework.\n\nOnly a teacher of the course that contains the coursework may\ncall this method.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or course work does not exist.", + "request": { + "$ref": "ModifyCourseWorkAssigneesRequest" + } + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "CourseWork" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + "https://www.googleapis.com/auth/classroom.coursework.students", + "https://www.googleapis.com/auth/classroom.coursework.students.readonly" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "Identifier of the course work.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{id}", + "path": "v1/courses/{courseId}/courseWork/{id}", + "id": "classroom.courses.courseWork.get", + "description": "Returns course work.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course or course work does not exist." + }, + "patch": { + "flatPath": "v1/courses/{courseId}/courseWork/{id}", + "id": "classroom.courses.courseWork.patch", + "path": "v1/courses/{courseId}/courseWork/{id}", + "request": { + "$ref": "CourseWork" + }, + "description": "Updates one or more fields of a course work.\n\nSee google.classroom.v1.CourseWork for details\nof which fields may be updated and who may change them.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding course work, if the user is not permitted to make the\nrequested modification to the student submission, or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `FAILED_PRECONDITION` if the requested course work has already been\ndeleted.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", + "response": { + "$ref": "CourseWork" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Mask that identifies which fields on the course work to update.\nThis field is required to do an update. The update fails if invalid\nfields are specified. If a field supports empty values, it can be cleared\nby specifying it in the update mask and not in the CourseWork object. If a\nfield that does not support empty values is included in the update mask and\nnot set in the CourseWork object, an `INVALID_ARGUMENT` error will be\nreturned.\n\nThe following fields may be specified by teachers:\n\n* `title`\n* `description`\n* `state`\n* `due_date`\n* `due_time`\n* `max_points`\n* `scheduled_time`\n* `submission_modification_mode`", + "type": "string", + "location": "query" + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "Identifier of the course work.", + "type": "string", + "required": true, + "location": "path" + } + } + } + }, + "resources": { + "studentSubmissions": { + "methods": { + "turnIn": { + "id": "classroom.courses.courseWork.studentSubmissions.turnIn", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn", + "request": { + "$ref": "TurnInStudentSubmissionRequest" + }, + "description": "Turns in a student submission.\n\nTurning in a student submission transfers ownership of attached Drive\nfiles to the teacher and may also update the submission state.\n\nThis may only be called by the student that owns the specified student\nsubmission.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, turn in the requested student submission,\nor for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me" + ], + "parameters": { + "courseWorkId": { + "location": "path", + "description": "Identifier of the course work.", + "type": "string", + "required": true + }, + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "id": { + "description": "Identifier of the student submission.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn" + }, + "list": { + "response": { + "$ref": "ListStudentSubmissionsResponse" + }, + "parameterOrder": [ + "courseId", + "courseWorkId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + "https://www.googleapis.com/auth/classroom.coursework.students", + "https://www.googleapis.com/auth/classroom.coursework.students.readonly", + "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", + "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "nextPageToken\nvalue returned from a previous\nlist call,\nindicating that the subsequent page of results should be returned.\n\nThe list request\nmust be otherwise identical to the one that resulted in this token.", + "type": "string" + }, + "states": { + "repeated": true, + "location": "query", + "enum": [ + "SUBMISSION_STATE_UNSPECIFIED", + "NEW", + "CREATED", + "TURNED_IN", + "RETURNED", + "RECLAIMED_BY_STUDENT" + ], + "description": "Requested submission states. If specified, returned student submissions\nmatch one of the specified submission states.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of items to return. Zero or unspecified indicates that the\nserver may assign a maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer", + "location": "query" + }, + "userId": { + "description": "Optional argument to restrict returned student work to those owned by the\nstudent with the specified identifier. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "location": "query" + }, + "courseWorkId": { + "description": "Identifier of the student work to request.\nThis may be set to the string literal `\"-\"` to request student work for\nall course work in the specified course.", + "type": "string", + "required": true, + "location": "path" + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "late": { + "location": "query", + "enum": [ + "LATE_VALUES_UNSPECIFIED", + "LATE_ONLY", + "NOT_LATE_ONLY" + ], + "description": "Requested lateness value. If specified, returned student submissions are\nrestricted by the requested value.\nIf unspecified, submissions are returned regardless of `late` value.", + "type": "string" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", + "id": "classroom.courses.courseWork.studentSubmissions.list", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", + "description": "Returns a list of student submissions that the requester is permitted to\nview, factoring in the OAuth scopes of the request.\n`-` may be specified as the `course_work_id` to include student\nsubmissions for multiple course work items.\n\nCourse students may only view their own work. Course teachers\nand domain administrators may view all student submissions.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, or for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course does not exist." + }, + "modifyAttachments": { + "response": { + "$ref": "StudentSubmission" + }, + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "Identifier of the student submission.", + "type": "string", + "required": true, + "location": "path" + }, + "courseWorkId": { + "location": "path", + "description": "Identifier of the course work.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments", + "id": "classroom.courses.courseWork.studentSubmissions.modifyAttachments", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments", + "request": { + "$ref": "ModifyAttachmentsRequest" + }, + "description": "Modifies attachments of student submission.\n\nAttachments may only be added to student submissions belonging to course\nwork objects with a `workType` of `ASSIGNMENT`.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, if the user is not permitted to modify\nattachments on the requested student submission, or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist." + }, + "patch": { + "request": { + "$ref": "StudentSubmission" + }, + "description": "Updates one or more fields of a student submission.\n\nSee google.classroom.v1.StudentSubmission for details\nof which fields may be updated and who may change them.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting developer project did not create\nthe corresponding course work, if the user is not permitted to make the\nrequested modification to the student submission, or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", + "response": { + "$ref": "StudentSubmission" + }, + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "parameters": { + "courseWorkId": { + "description": "Identifier of the course work.", + "type": "string", + "required": true, + "location": "path" + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "location": "path", + "description": "Identifier of the student submission.", + "type": "string", + "required": true + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Mask that identifies which fields on the student submission to update.\nThis field is required to do an update. The update fails if invalid\nfields are specified.\n\nThe following fields may be specified by teachers:\n\n* `draft_grade`\n* `assigned_grade`", + "type": "string" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", + "id": "classroom.courses.courseWork.studentSubmissions.patch", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}" + }, + "get": { + "description": "Returns a student submission.\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course, course work, or student submission or for\naccess errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist.", + "response": { + "$ref": "StudentSubmission" + }, + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + "https://www.googleapis.com/auth/classroom.coursework.students", + "https://www.googleapis.com/auth/classroom.coursework.students.readonly", + "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", + "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" + ], + "parameters": { + "courseWorkId": { + "description": "Identifier of the course work.", + "type": "string", + "required": true, + "location": "path" + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "Identifier of the student submission.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", + "id": "classroom.courses.courseWork.studentSubmissions.get", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}" + }, + "return": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "parameters": { + "courseWorkId": { + "location": "path", + "description": "Identifier of the course work.", + "type": "string", + "required": true + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "location": "path", + "description": "Identifier of the student submission.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return", + "id": "classroom.courses.courseWork.studentSubmissions.return", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return", + "request": { + "$ref": "ReturnStudentSubmissionRequest" + }, + "description": "Returns a student submission.\n\nReturning a student submission transfers ownership of attached Drive\nfiles to the student and may also update the submission state.\nUnlike the Classroom application, returning a student submission does not\nset assignedGrade to the draftGrade value.\n\nOnly a teacher of the course that contains the requested student submission\nmay call this method.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, return the requested student submission,\nor for access errors.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist." + }, + "reclaim": { + "httpMethod": "POST", + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me" + ], + "parameters": { + "courseWorkId": { + "location": "path", + "description": "Identifier of the course work.", + "type": "string", + "required": true + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "Identifier of the student submission.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim", + "id": "classroom.courses.courseWork.studentSubmissions.reclaim", + "request": { + "$ref": "ReclaimStudentSubmissionRequest" + }, + "description": "Reclaims a student submission on behalf of the student that owns it.\n\nReclaiming a student submission transfers ownership of attached Drive\nfiles to the student and update the submission state.\n\nOnly the student that owns the requested student submission may call this\nmethod, and only for a student submission that has been turned in.\n\nThis request must be made by the Developer Console project of the\n[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to\ncreate the corresponding course work item.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access the\nrequested course or course work, unsubmit the requested student submission,\nor for access errors.\n* `FAILED_PRECONDITION` if the student submission has not been turned in.\n* `INVALID_ARGUMENT` if the request is malformed.\n* `NOT_FOUND` if the requested course, course work, or student submission\ndoes not exist." + } + } + } + } + }, + "teachers": { + "methods": { + "delete": { + "description": "Deletes a teacher of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to delete\nteachers of this course or for access errors.\n* `NOT_FOUND` if no teacher of this course has the requested ID or if the\ncourse does not exist.\n* `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher\nof this course.", + "httpMethod": "DELETE", + "parameterOrder": [ + "courseId", + "userId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ], + "parameters": { + "userId": { + "description": "Identifier of the teacher to delete. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "required": true, + "location": "path" + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/teachers/{userId}", + "path": "v1/courses/{courseId}/teachers/{userId}", + "id": "classroom.courses.teachers.delete" + }, + "list": { + "flatPath": "v1/courses/{courseId}/teachers", + "id": "classroom.courses.teachers.list", + "path": "v1/courses/{courseId}/teachers", + "description": "Returns a list of teachers of this course that the requester\nis permitted to view.\n\nThis method returns the following error codes:\n\n* `NOT_FOUND` if the course does not exist.\n* `PERMISSION_DENIED` for access errors.", + "response": { + "$ref": "ListTeachersResponse" + }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "nextPageToken\nvalue returned from a previous\nlist call, indicating that\nthe subsequent page of results should be returned.\n\nThe list request must be\notherwise identical to the one that resulted in this token.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of items to return. Zero means no maximum.\n\nThe server may return fewer than the specified number of results.", + "type": "integer", + "location": "query" + }, + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + } + } + }, + "get": { + "response": { + "$ref": "Teacher" + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + }, + "userId": { + "location": "path", + "description": "Identifier of the teacher to return. The identifier can be one of the\nfollowing:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string", + "required": true + } + }, + "flatPath": "v1/courses/{courseId}/teachers/{userId}", + "id": "classroom.courses.teachers.get", + "path": "v1/courses/{courseId}/teachers/{userId}", + "description": "Returns a teacher of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to view\nteachers of this course or for access errors.\n* `NOT_FOUND` if no teacher of this course has the requested ID or if the\ncourse does not exist." + }, + "create": { + "description": "Creates a teacher of a course.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to create\nteachers in this course or for access errors.\n* `NOT_FOUND` if the requested course ID does not exist.\n* `FAILED_PRECONDITION` if the requested user's account is disabled,\nfor the following request errors:\n * CourseMemberLimitReached\n * CourseNotModifiable\n * CourseTeacherLimitReached\n * UserGroupsMembershipLimitReached\n* `ALREADY_EXISTS` if the user is already a teacher or student in the\ncourse.", + "request": { + "$ref": "Teacher" + }, + "httpMethod": "POST", + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "Teacher" + }, + "parameters": { + "courseId": { + "location": "path", + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters" + ], + "flatPath": "v1/courses/{courseId}/teachers", + "path": "v1/courses/{courseId}/teachers", + "id": "classroom.courses.teachers.create" } } } @@ -1509,26 +1834,15 @@ } }, "parameters": { - "upload_protocol": { - "type": "string", - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, "fields": { "location": "query", "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, "uploadType": { + "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" + "type": "string" }, "callback": { "location": "query", @@ -1536,6 +1850,8 @@ "type": "string" }, "$.xgafv": { + "description": "V1 error format.", + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -1544,11 +1860,10 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", - "type": "string" + ] }, "alt": { + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -1561,7 +1876,11 @@ "json", "media", "proto" - ], + ] + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", "type": "string" }, "key": { @@ -1569,67 +1888,451 @@ "type": "string", "location": "query" }, - "access_token": { - "type": "string", - "location": "query", - "description": "OAuth access token." - }, "quotaUser": { - "type": "string", "location": "query", - "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." + "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.", + "type": "string" }, "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "bearer_token": { - "type": "string", "location": "query", - "description": "OAuth bearer token." + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" }, "oauth_token": { "location": "query", "description": "OAuth 2.0 token for the current user.", "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" } }, "schemas": { + "Feed": { + "properties": { + "courseRosterChangesInfo": { + "description": "Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`.\nThis field must be specified if `feed_type` is `COURSE_ROSTER_CHANGES`.", + "$ref": "CourseRosterChangesInfo" + }, + "feedType": { + "enumDescriptions": [ + "Should never be returned or provided.", + "All roster changes for a particular domain.\n\nNotifications will be generated whenever a user joins or leaves a course.\n\nNo notifications will be generated when an invitation is created or\ndeleted, but notifications will be generated when a user joins a course\nby accepting an invitation.", + "All roster changes for a particular course.\n\nNotifications will be generated whenever a user joins or leaves a course.\n\nNo notifications will be generated when an invitation is created or\ndeleted, but notifications will be generated when a user joins a course\nby accepting an invitation." + ], + "enum": [ + "FEED_TYPE_UNSPECIFIED", + "DOMAIN_ROSTER_CHANGES", + "COURSE_ROSTER_CHANGES" + ], + "description": "The type of feed.", + "type": "string" + } + }, + "id": "Feed", + "description": "A class of notifications that an application can register to receive.\nFor example: \"all roster changes for a domain\".", + "type": "object" + }, + "Student": { + "description": "Student in a course.", + "type": "object", + "properties": { + "userId": { + "description": "Identifier of the user.\n\nWhen specified as a parameter of a request, this identifier can be one of\nthe following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string" + }, + "courseId": { + "description": "Identifier of the course.\n\nRead-only.", + "type": "string" + }, + "studentWorkFolder": { + "$ref": "DriveFolder", + "description": "Information about a Drive Folder for this student's work in this course.\nOnly visible to the student and domain administrators.\n\nRead-only." + }, + "profile": { + "$ref": "UserProfile", + "description": "Global user information for the student.\n\nRead-only." + } + }, + "id": "Student" + }, + "Invitation": { + "description": "An invitation to join a course.", + "type": "object", + "properties": { + "userId": { + "description": "Identifier of the invited user.\n\nWhen specified as a parameter of a request, this identifier can be set to\none of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string" + }, + "courseId": { + "description": "Identifier of the course to invite the user to.", + "type": "string" + }, + "id": { + "description": "Identifier assigned by Classroom.\n\nRead-only.", + "type": "string" + }, + "role": { + "enumDescriptions": [ + "No course role.", + "Student in the course.", + "Teacher of the course.", + "Owner of the course." + ], + "enum": [ + "COURSE_ROLE_UNSPECIFIED", + "STUDENT", + "TEACHER", + "OWNER" + ], + "description": "Role to invite the user to have.\nMust not be `COURSE_ROLE_UNSPECIFIED`.", + "type": "string" + } + }, + "id": "Invitation" + }, + "TurnInStudentSubmissionRequest": { + "description": "Request to turn in a student submission.", + "type": "object", + "properties": {}, + "id": "TurnInStudentSubmissionRequest" + }, + "ListCourseWorkResponse": { + "description": "Response when listing course work.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + }, + "courseWork": { + "description": "Course work items that match the request.", + "items": { + "$ref": "CourseWork" + }, + "type": "array" + } + }, + "id": "ListCourseWorkResponse" + }, + "Attachment": { + "properties": { + "form": { + "$ref": "Form", + "description": "Google Forms attachment." + }, + "link": { + "$ref": "Link", + "description": "Link attachment." + }, + "youTubeVideo": { + "$ref": "YouTubeVideo", + "description": "Youtube video attachment." + }, + "driveFile": { + "description": "Google Drive file attachment.", + "$ref": "DriveFile" + } + }, + "id": "Attachment", + "description": "Attachment added to student assignment work.\n\nWhen creating attachments, setting the `form` field is not supported.", + "type": "object" + }, + "ListAnnouncementsResponse": { + "properties": { + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + }, + "announcements": { + "description": "Announcement items that match the request.", + "items": { + "$ref": "Announcement" + }, + "type": "array" + } + }, + "id": "ListAnnouncementsResponse", + "description": "Response when listing course work.", + "type": "object" + }, + "TimeOfDay": { + "description": "Represents a time of day. The date and time zone are either not significant\nor are specified elsewhere. An API may choose to allow leap seconds. Related\ntypes are google.type.Date and `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "hours": { + "format": "int32", + "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose\nto allow the value \"24:00:00\" for scenarios like business closing time.", + "type": "integer" + }, + "nanos": { + "format": "int32", + "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", + "type": "integer" + }, + "seconds": { + "format": "int32", + "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may\nallow the value 60 if it allows leap-seconds.", + "type": "integer" + }, + "minutes": { + "format": "int32", + "description": "Minutes of hour of day. Must be from 0 to 59.", + "type": "integer" + } + }, + "id": "TimeOfDay" + }, + "ListCoursesResponse": { + "properties": { + "courses": { + "description": "Courses that match the list request.", + "items": { + "$ref": "Course" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + } + }, + "id": "ListCoursesResponse", + "description": "Response when listing courses.", + "type": "object" + }, + "Form": { + "description": "Google Forms item.", + "type": "object", + "properties": { + "thumbnailUrl": { + "description": "URL of a thumbnail image of the Form.\n\nRead-only.", + "type": "string" + }, + "responseUrl": { + "description": "URL of the form responses document.\nOnly set if respsonses have been recorded and only when the\nrequesting user is an editor of the form.\n\nRead-only.", + "type": "string" + }, + "formUrl": { + "description": "URL of the form.", + "type": "string" + }, + "title": { + "description": "Title of the Form.\n\nRead-only.", + "type": "string" + } + }, + "id": "Form" + }, + "ModifyCourseWorkAssigneesRequest": { + "properties": { + "assigneeMode": { + "enumDescriptions": [ + "No mode specified. This is never returned.", + "All students can see the item.\nThis is the default state.", + "A subset of the students can see the item." + ], + "enum": [ + "ASSIGNEE_MODE_UNSPECIFIED", + "ALL_STUDENTS", + "INDIVIDUAL_STUDENTS" + ], + "description": "Mode of the coursework describing whether it will be assigned to all\nstudents or specified individual students.", + "type": "string" + }, + "modifyIndividualStudentsOptions": { + "description": "Set which students are assigned or not assigned to the coursework.\nMust be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`.", + "$ref": "ModifyIndividualStudentsOptions" + } + }, + "id": "ModifyCourseWorkAssigneesRequest", + "description": "Request to modify assignee mode and options of a coursework.", + "type": "object" + }, + "ListGuardiansResponse": { + "description": "Response when listing guardians.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + }, + "guardians": { + "description": "Guardians on this page of results that met the criteria specified in\nthe request.", + "items": { + "$ref": "Guardian" + }, + "type": "array" + } + }, + "id": "ListGuardiansResponse" + }, + "CourseAlias": { + "description": "Alternative identifier for a course.\n\nAn alias uniquely identifies a course. It must be unique within one of the\nfollowing scopes:\n\n* domain: A domain-scoped alias is visible to all users within the alias\ncreator's domain and can be created only by a domain admin. A domain-scoped\nalias is often used when a course has an identifier external to Classroom.\n\n* project: A project-scoped alias is visible to any request from an\napplication using the Developer Console project ID that created the alias\nand can be created by any project. A project-scoped alias is often used when\nan application has alternative identifiers. A random value can also be used\nto avoid duplicate courses in the event of transmission failures, as retrying\na request will return `ALREADY_EXISTS` if a previous one has succeeded.", + "type": "object", + "properties": { + "alias": { + "description": "Alias string. The format of the string indicates the desired alias scoping.\n\n* `d:\u003cname\u003e` indicates a domain-scoped alias.\n Example: `d:math_101`\n* `p:\u003cname\u003e` indicates a project-scoped alias.\n Example: `p:abc123`\n\nThis field has a maximum length of 256 characters.", + "type": "string" + } + }, + "id": "CourseAlias" + }, + "ListGuardianInvitationsResponse": { + "description": "Response when listing guardian invitations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + }, + "guardianInvitations": { + "description": "Guardian invitations that matched the list request.", + "items": { + "$ref": "GuardianInvitation" + }, + "type": "array" + } + }, + "id": "ListGuardianInvitationsResponse" + }, + "ListCourseAliasesResponse": { + "properties": { + "aliases": { + "description": "The course aliases.", + "items": { + "$ref": "CourseAlias" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + } + }, + "id": "ListCourseAliasesResponse", + "description": "Response when listing course aliases.", + "type": "object" + }, + "IndividualStudentsOptions": { + "description": "Assignee details about a coursework/announcement.\nThis field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.", + "type": "object", + "properties": { + "studentIds": { + "description": "Identifiers for the students that have access to the\ncoursework/announcement.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "IndividualStudentsOptions" + }, + "MultipleChoiceSubmission": { + "description": "Student work for a multiple-choice question.", + "type": "object", + "properties": { + "answer": { + "description": "Student's select choice.", + "type": "string" + } + }, + "id": "MultipleChoiceSubmission" + }, + "Registration": { + "description": "An instruction to Classroom to send notifications from the `feed` to the\nprovided `destination`.", + "type": "object", + "properties": { + "feed": { + "description": "Specification for the class of notifications that Classroom should deliver\nto the `destination`.", + "$ref": "Feed" + }, + "registrationId": { + "description": "A server-generated unique identifier for this `Registration`.\n\nRead-only.", + "type": "string" + }, + "expiryTime": { + "format": "google-datetime", + "description": "The time until which the `Registration` is effective.\n\nThis is a read-only field assigned by the server.", + "type": "string" + }, + "cloudPubsubTopic": { + "description": "The Cloud Pub/Sub topic that notifications are to be sent to.", + "$ref": "CloudPubsubTopic" + } + }, + "id": "Registration" + }, + "CourseMaterial": { + "description": "A material attached to a course as part of a material set.", + "type": "object", + "properties": { + "youTubeVideo": { + "$ref": "YouTubeVideo", + "description": "Youtube video attachment." + }, + "driveFile": { + "description": "Google Drive file attachment.", + "$ref": "DriveFile" + }, + "form": { + "$ref": "Form", + "description": "Google Forms attachment." + }, + "link": { + "$ref": "Link", + "description": "Link atatchment." + } + }, + "id": "CourseMaterial" + }, + "MultipleChoiceQuestion": { + "description": "Additional details for multiple-choice questions.", + "type": "object", + "properties": { + "choices": { + "description": "Possible choices.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "MultipleChoiceQuestion" + }, "Course": { - "id": "Course", "description": "A Course in Classroom.", "type": "object", "properties": { - "description": { - "description": "Optional description.\nFor example, \"We'll be learning about the structure of living\ncreatures from a combination of textbooks, guest lectures, and lab work.\nExpect to be excited!\"\nIf set, this field must be a valid UTF-8 string and no longer than 30,000\ncharacters.", - "type": "string" - }, - "teacherGroupEmail": { - "description": "The email address of a Google group containing all teachers of the course.\nThis group does not accept email and can only be used for permissions.\n\nRead-only.", - "type": "string" - }, - "creationTime": { - "description": "Creation time of the course.\nSpecifying this field in a course update mask results in an error.\n\nRead-only.", - "format": "google-datetime", - "type": "string" + "teacherFolder": { + "description": "Information about a Drive Folder that is shared with all teachers of the\ncourse.\n\nThis field will only be set for teachers of the course and domain administrators.\n\nRead-only.", + "$ref": "DriveFolder" }, "name": { "description": "Name of the course.\nFor example, \"10th Grade Biology\".\nThe name is required. It must be between 1 and 750 characters and a valid\nUTF-8 string.", "type": "string" }, - "teacherFolder": { - "$ref": "DriveFolder", - "description": "Information about a Drive Folder that is shared with all teachers of the\ncourse.\n\nThis field will only be set for teachers of the course and domain administrators.\n\nRead-only." - }, "section": { "description": "Section of the course.\nFor example, \"Period 2\".\nIf set, this field must be a valid UTF-8 string and no longer than 2800\ncharacters.", "type": "string" }, "id": { - "type": "string", - "description": "Identifier for this course assigned by Classroom.\n\nWhen\ncreating a course,\nyou may optionally set this identifier to an\nalias string in the\nrequest to create a corresponding alias. The `id` is still assigned by\nClassroom and cannot be updated after the course is created.\n\nSpecifying this field in a course update mask results in an error." + "description": "Identifier for this course assigned by Classroom.\n\nWhen\ncreating a course,\nyou may optionally set this identifier to an\nalias string in the\nrequest to create a corresponding alias. The `id` is still assigned by\nClassroom and cannot be updated after the course is created.\n\nSpecifying this field in a course update mask results in an error.", + "type": "string" }, "room": { "description": "Optional room location.\nFor example, \"301\".\nIf set, this field must be a valid UTF-8 string and no longer than 650\ncharacters.", @@ -1639,24 +2342,28 @@ "description": "The email address of a Google group containing all members of the course.\nThis group does not accept email and can only be used for permissions.\n\nRead-only.", "type": "string" }, - "enrollmentCode": { - "type": "string", - "description": "Enrollment code to use when joining this course.\nSpecifying this field in a course update mask results in an error.\n\nRead-only." - }, "courseMaterialSets": { "description": "Sets of materials that appear on the \"about\" page of this course.\n\nRead-only.", - "type": "array", "items": { "$ref": "CourseMaterialSet" - } + }, + "type": "array" + }, + "enrollmentCode": { + "description": "Enrollment code to use when joining this course.\nSpecifying this field in a course update mask results in an error.\n\nRead-only.", + "type": "string" }, "descriptionHeading": { "description": "Optional heading for the description.\nFor example, \"Welcome to 10th Grade Biology.\"\nIf set, this field must be a valid UTF-8 string and no longer than 3600\ncharacters.", "type": "string" }, + "calendarId": { + "description": "The Calendar ID for a calendar that all course members can see, to which\nClassroom adds events for course work and announcements in the course.\n\nRead-only.", + "type": "string" + }, "updateTime": { - "description": "Time of the most recent update to this course.\nSpecifying this field in a course update mask results in an error.\n\nRead-only.", "format": "google-datetime", + "description": "Time of the most recent update to this course.\nSpecifying this field in a course update mask results in an error.\n\nRead-only.", "type": "string" }, "alternateLink": { @@ -1667,7 +2374,13 @@ "description": "Whether or not guardian notifications are enabled for this course.\n\nRead-only.", "type": "boolean" }, + "ownerId": { + "description": "The identifier of the owner of a course.\n\nWhen specified as a parameter of a\ncreate course request, this\nfield is required.\nThe identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user\n\nThis must be set in a create request. Admins can also specify this field\nin a patch course request to\ntransfer ownership. In other contexts, it is read-only.", + "type": "string" + }, "courseState": { + "description": "State of the course.\nIf unspecified, the default state is `PROVISIONED`.", + "type": "string", "enumDescriptions": [ "No course state. No returned Course message will use this value.", "The course is active.", @@ -1683,28 +2396,26 @@ "PROVISIONED", "DECLINED", "SUSPENDED" - ], - "description": "State of the course.\nIf unspecified, the default state is `PROVISIONED`.", + ] + }, + "description": { + "description": "Optional description.\nFor example, \"We'll be learning about the structure of living\ncreatures from a combination of textbooks, guest lectures, and lab work.\nExpect to be excited!\"\nIf set, this field must be a valid UTF-8 string and no longer than 30,000\ncharacters.", "type": "string" }, - "ownerId": { - "description": "The identifier of the owner of a course.\n\nWhen specified as a parameter of a\ncreate course request, this\nfield is required.\nThe identifier can be one of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user\n\nThis must be set in a create request. Specifying this field in a course\nupdate mask results in an `INVALID_ARGUMENT` error.", + "teacherGroupEmail": { + "description": "The email address of a Google group containing all teachers of the course.\nThis group does not accept email and can only be used for permissions.\n\nRead-only.", + "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "Creation time of the course.\nSpecifying this field in a course update mask results in an error.\n\nRead-only.", "type": "string" } - } + }, + "id": "Course" }, "DriveFile": { - "description": "Representation of a Google Drive file.", - "type": "object", "properties": { - "id": { - "description": "Drive API resource ID.", - "type": "string" - }, - "title": { - "description": "Title of the Drive item.\n\nRead-only.", - "type": "string" - }, "alternateLink": { "description": "URL that can be used to access the Drive item.\n\nRead-only.", "type": "string" @@ -1712,9 +2423,19 @@ "thumbnailUrl": { "description": "URL of a thumbnail image of the Drive item.\n\nRead-only.", "type": "string" + }, + "id": { + "description": "Drive API resource ID.", + "type": "string" + }, + "title": { + "description": "Title of the Drive item.\n\nRead-only.", + "type": "string" } }, - "id": "DriveFile" + "id": "DriveFile", + "description": "Representation of a Google Drive file.", + "type": "object" }, "ReturnStudentSubmissionRequest": { "description": "Request to return a student submission.", @@ -1722,108 +2443,67 @@ "properties": {}, "id": "ReturnStudentSubmissionRequest" }, - "GlobalPermission": { - "description": "Global user permission description.", - "type": "object", - "properties": { - "permission": { - "enumDescriptions": [ - "No permission is specified. This is not returned and is not a\nvalid value.", - "User is permitted to create a course." - ], - "enum": [ - "PERMISSION_UNSPECIFIED", - "CREATE_COURSE" - ], - "description": "Permission value.", - "type": "string" - } - }, - "id": "GlobalPermission" - }, - "Teacher": { - "description": "Teacher of a course.", - "type": "object", - "properties": { - "userId": { - "description": "Identifier of the user.\n\nWhen specified as a parameter of a request, this identifier can be one of\nthe following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "type": "string" - }, - "courseId": { - "description": "Identifier of the course.\n\nRead-only.", - "type": "string" - }, - "profile": { - "$ref": "UserProfile", - "description": "Global user information for the teacher.\n\nRead-only." - } - }, - "id": "Teacher" - }, "ReclaimStudentSubmissionRequest": { "description": "Request to reclaim a student submission.", "type": "object", "properties": {}, "id": "ReclaimStudentSubmissionRequest" }, - "AssignmentSubmission": { - "description": "Student work for an assignment.", + "CourseRosterChangesInfo": { + "description": "Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`.", "type": "object", "properties": { - "attachments": { - "description": "Attachments added by the student.\nDrive files that correspond to materials with a share mode of\nSTUDENT_COPY may not exist yet if the student has not accessed the\nassignment in Classroom.\n\nSome attachment metadata is only populated if the requesting user has\npermission to access it. Identifier and alternate_link fields are always\navailable, but others (e.g. title) may not be.", - "type": "array", - "items": { - "$ref": "Attachment" - } + "courseId": { + "description": "The `course_id` of the course to subscribe to roster changes for.", + "type": "string" } }, - "id": "AssignmentSubmission" - }, - "Material": { - "description": "Material attached to course work.\n\nWhen creating attachments, setting the `form` field is not supported.", - "type": "object", - "properties": { - "link": { - "$ref": "Link", - "description": "Link material. On creation, will be upgraded to a more appropriate type\nif possible, and this will be reflected in the response." - }, - "youtubeVideo": { - "description": "YouTube video material.", - "$ref": "YouTubeVideo" - }, - "driveFile": { - "$ref": "SharedDriveFile", - "description": "Google Drive file material." - }, - "form": { - "description": "Google Forms material.", - "$ref": "Form" - } - }, - "id": "Material" + "id": "CourseRosterChangesInfo" }, "CourseWork": { "description": "Course work created by a teacher for students of the course.", "type": "object", "properties": { + "associatedWithDeveloper": { + "description": "Whether this course work item is associated with the Developer Console\nproject making the request.\n\nSee google.classroom.Work.CreateCourseWork for more\ndetails.\n\nRead-only.", + "type": "boolean" + }, + "materials": { + "description": "Additional materials.\n\nCourseWork must have no more than 20 material items.", + "items": { + "$ref": "Material" + }, + "type": "array" + }, "updateTime": { - "description": "Timestamp of the most recent change to this course work.\n\nRead-only.", "format": "google-datetime", + "description": "Timestamp of the most recent change to this course work.\n\nRead-only.", "type": "string" }, + "assigneeMode": { + "description": "Assignee mode of the coursework.\nIf unspecified, the default value is `ALL_STUDENTS`.", + "type": "string", + "enumDescriptions": [ + "No mode specified. This is never returned.", + "All students can see the item.\nThis is the default state.", + "A subset of the students can see the item." + ], + "enum": [ + "ASSIGNEE_MODE_UNSPECIFIED", + "ALL_STUDENTS", + "INDIVIDUAL_STUDENTS" + ] + }, "alternateLink": { "description": "Absolute link to this course work in the Classroom web UI.\nThis is only populated if `state` is `PUBLISHED`.\n\nRead-only.", "type": "string" }, "maxPoints": { - "description": "Maximum grade for this course work.\nIf zero or unspecified, this assignment is considered ungraded.\nThis must be a non-negative integer value.", "format": "double", + "description": "Maximum grade for this course work.\nIf zero or unspecified, this assignment is considered ungraded.\nThis must be a non-negative integer value.", "type": "number" }, "workType": { - "description": "Type of this course work.\n\nThe type is set when the course work is created and cannot be changed.", - "type": "string", "enumDescriptions": [ "No work type specified. This is never returned.", "An assignment.", @@ -1835,29 +2515,44 @@ "ASSIGNMENT", "SHORT_ANSWER_QUESTION", "MULTIPLE_CHOICE_QUESTION" - ] - }, - "multipleChoiceQuestion": { - "$ref": "MultipleChoiceQuestion", - "description": "Multiple choice question details.\nFor read operations, this field is populated only when `work_type` is\n`MULTIPLE_CHOICE_QUESTION`.\nFor write operations, this field must be specified when creating course\nwork with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be\nset otherwise." + ], + "description": "Type of this course work.\n\nThe type is set when the course work is created and cannot be changed.", + "type": "string" }, "assignment": { "description": "Assignment details.\nThis is populated only when `work_type` is `ASSIGNMENT`.\n\nRead-only.", "$ref": "Assignment" }, + "multipleChoiceQuestion": { + "$ref": "MultipleChoiceQuestion", + "description": "Multiple choice question details.\nFor read operations, this field is populated only when `work_type` is\n`MULTIPLE_CHOICE_QUESTION`.\nFor write operations, this field must be specified when creating course\nwork with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be\nset otherwise." + }, "description": { - "type": "string", - "description": "Optional description of this course work.\nIf set, the description must be a valid UTF-8 string containing no more\nthan 30,000 characters." + "description": "Optional description of this course work.\nIf set, the description must be a valid UTF-8 string containing no more\nthan 30,000 characters.", + "type": "string" + }, + "scheduledTime": { + "format": "google-datetime", + "description": "Optional timestamp when this course work is scheduled to be published.", + "type": "string" }, "creationTime": { - "description": "Timestamp when this course work was created.\n\nRead-only.", "format": "google-datetime", + "description": "Timestamp when this course work was created.\n\nRead-only.", "type": "string" }, "dueDate": { "description": "Optional date, in UTC, that submissions for this this course work are due.\nThis must be specified if `due_time` is specified.", "$ref": "Date" }, + "individualStudentsOptions": { + "description": "Identifiers of students with access to the coursework.\nThis field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.\nIf the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students\nspecified in this field will be assigned the coursework.", + "$ref": "IndividualStudentsOptions" + }, + "creatorUserId": { + "description": "Identifier for the user that created the coursework.\n\nRead-only.", + "type": "string" + }, "state": { "enumDescriptions": [ "No state specified. This is never returned.", @@ -1897,156 +2592,203 @@ "type": "string" }, "dueTime": { - "description": "Optional time of day, in UTC, that submissions for this this course work\nare due.\nThis must be specified if `due_date` is specified.", - "$ref": "TimeOfDay" + "$ref": "TimeOfDay", + "description": "Optional time of day, in UTC, that submissions for this this course work\nare due.\nThis must be specified if `due_date` is specified." }, "title": { - "type": "string", - "description": "Title of this course work.\nThe title must be a valid UTF-8 string containing between 1 and 3000\ncharacters." - }, - "associatedWithDeveloper": { - "description": "Whether this course work item is associated with the Developer Console\nproject making the request.\n\nSee google.classroom.Work.CreateCourseWork for more\ndetails.\n\nRead-only.", - "type": "boolean" - }, - "materials": { - "description": "Additional materials.\n\nCourseWork must have no more than 20 material items.", - "type": "array", - "items": { - "$ref": "Material" - } + "description": "Title of this course work.\nThe title must be a valid UTF-8 string containing between 1 and 3000\ncharacters.", + "type": "string" } }, "id": "CourseWork" }, "Guardian": { - "description": "Association between a student and a guardian of that student. The guardian\nmay receive information about the student's course work.", - "type": "object", "properties": { + "invitedEmailAddress": { + "description": "The email address to which the initial guardian invitation was sent.\nThis field is only visible to domain administrators.", + "type": "string" + }, + "guardianId": { + "description": "Identifier for the guardian.", + "type": "string" + }, "guardianProfile": { - "$ref": "UserProfile", - "description": "User profile for the guardian." + "description": "User profile for the guardian.", + "$ref": "UserProfile" }, "studentId": { "description": "Identifier for the student to whom the guardian relationship applies.", "type": "string" - }, - "guardianId": { - "type": "string", - "description": "Identifier for the guardian." - }, - "invitedEmailAddress": { - "description": "The email address to which the initial guardian invitation was sent.\nThis field is only visible to domain administrators.", - "type": "string" } }, - "id": "Guardian" + "id": "Guardian", + "description": "Association between a student and a guardian of that student. The guardian\nmay receive information about the student's course work.", + "type": "object" }, - "UserProfile": { + "ListStudentsResponse": { + "description": "Response when listing students.", "type": "object", "properties": { + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + }, + "students": { + "description": "Students who match the list request.", + "items": { + "$ref": "Student" + }, + "type": "array" + } + }, + "id": "ListStudentsResponse" + }, + "UserProfile": { + "properties": { + "id": { + "description": "Identifier of the user.\n\nRead-only.", + "type": "string" + }, + "verifiedTeacher": { + "description": "Represents whether a G Suite for Education user's domain administrator has\nexplicitly verified them as being a teacher. If the user is not a member of\na G Suite for Education domain, than this field will always be false.\n\nRead-only", + "type": "boolean" + }, + "emailAddress": { + "description": "Email address of the user.\n\nRead-only.", + "type": "string" + }, "photoUrl": { "description": "URL of user's profile photo.\n\nRead-only.", "type": "string" }, "permissions": { "description": "Global permissions of the user.\n\nRead-only.", - "type": "array", "items": { "$ref": "GlobalPermission" - } + }, + "type": "array" }, "name": { - "description": "Name of the user.\n\nRead-only.", - "$ref": "Name" - }, - "id": { - "type": "string", - "description": "Identifier of the user.\n\nRead-only." - }, - "emailAddress": { - "description": "Email address of the user.\n\nRead-only.", - "type": "string" + "$ref": "Name", + "description": "Name of the user.\n\nRead-only." } }, "id": "UserProfile", - "description": "Global information for a user." + "description": "Global information for a user.", + "type": "object" }, - "ListStudentsResponse": { - "id": "ListStudentsResponse", - "description": "Response when listing students.", + "Announcement": { + "description": "Announcement created by a teacher for students of the course", "type": "object", "properties": { - "students": { - "description": "Students who match the list request.", - "type": "array", - "items": { - "$ref": "Student" - } + "scheduledTime": { + "format": "google-datetime", + "description": "Optional timestamp when this announcement is scheduled to be published.", + "type": "string" }, - "nextPageToken": { + "creationTime": { + "format": "google-datetime", + "description": "Timestamp when this announcement was created.\n\nRead-only.", + "type": "string" + }, + "creatorUserId": { + "description": "Identifier for the user that created the announcement.\n\nRead-only.", + "type": "string" + }, + "individualStudentsOptions": { + "description": "Identifiers of students with access to the announcement.\nThis field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.\nIf the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this\nfield will be able to see the announcement.", + "$ref": "IndividualStudentsOptions" + }, + "state": { + "enum": [ + "ANNOUNCEMENT_STATE_UNSPECIFIED", + "PUBLISHED", + "DRAFT", + "DELETED" + ], + "description": "Status of this announcement.\nIf unspecified, the default state is `DRAFT`.", "type": "string", - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available." - } - } - }, - "Student": { - "description": "Student in a course.", - "type": "object", - "properties": { - "userId": { - "type": "string", - "description": "Identifier of the user.\n\nWhen specified as a parameter of a request, this identifier can be one of\nthe following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user" + "enumDescriptions": [ + "No state specified. This is never returned.", + "Status for announcement that has been published.\nThis is the default state.", + "Status for an announcement that is not yet published.\nAnnouncement in this state is visible only to course teachers and domain\nadministrators.", + "Status for announcement that was published but is now deleted.\nAnnouncement in this state is visible only to course teachers and domain\nadministrators.\nAnnouncement in this state is deleted after some time." + ] + }, + "text": { + "description": "Description of this announcement.\nThe text must be a valid UTF-8 string containing no more\nthan 30,000 characters.", + "type": "string" }, "courseId": { - "type": "string", - "description": "Identifier of the course.\n\nRead-only." + "description": "Identifier of the course.\n\nRead-only.", + "type": "string" }, - "profile": { - "description": "Global user information for the student.\n\nRead-only.", - "$ref": "UserProfile" + "id": { + "description": "Classroom-assigned identifier of this announcement, unique per course.\n\nRead-only.", + "type": "string" }, - "studentWorkFolder": { - "description": "Information about a Drive Folder for this student's work in this course.\nOnly visible to the student and domain administrators.\n\nRead-only.", - "$ref": "DriveFolder" + "materials": { + "description": "Additional materials.\n\nAnnouncements must have no more than 20 material items.", + "items": { + "$ref": "Material" + }, + "type": "array" + }, + "updateTime": { + "format": "google-datetime", + "description": "Timestamp of the most recent change to this announcement.\n\nRead-only.", + "type": "string" + }, + "alternateLink": { + "description": "Absolute link to this announcement in the Classroom web UI.\nThis is only populated if `state` is `PUBLISHED`.\n\nRead-only.", + "type": "string" + }, + "assigneeMode": { + "enumDescriptions": [ + "No mode specified. This is never returned.", + "All students can see the item.\nThis is the default state.", + "A subset of the students can see the item." + ], + "enum": [ + "ASSIGNEE_MODE_UNSPECIFIED", + "ALL_STUDENTS", + "INDIVIDUAL_STUDENTS" + ], + "description": "Assignee mode of the announcement.\nIf unspecified, the default value is `ALL_STUDENTS`.", + "type": "string" } }, - "id": "Student" + "id": "Announcement" }, - "Invitation": { - "description": "An invitation to join a course.", + "ModifyIndividualStudentsOptions": { + "properties": { + "addStudentIds": { + "description": "Ids of students to be added as having access to this\ncoursework/announcement.", + "items": { + "type": "string" + }, + "type": "array" + }, + "removeStudentIds": { + "description": "Ids of students to be removed from having access to this\ncoursework/announcement.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ModifyIndividualStudentsOptions", + "description": "Contains fields to add or remove students from a course work or announcement\nwhere the `assigneeMode` is set to `INDIVIDUAL_STUDENTS`.", + "type": "object" + }, + "DriveFolder": { + "description": "Representation of a Google Drive folder.", "type": "object", "properties": { "id": { - "description": "Identifier assigned by Classroom.\n\nRead-only.", + "description": "Drive API resource ID.", "type": "string" }, - "role": { - "description": "Role to invite the user to have.\nMust not be `COURSE_ROLE_UNSPECIFIED`.", - "type": "string", - "enumDescriptions": [ - "No course role.", - "Student in the course.", - "Teacher of the course." - ], - "enum": [ - "COURSE_ROLE_UNSPECIFIED", - "STUDENT", - "TEACHER" - ] - }, - "userId": { - "description": "Identifier of the invited user.\n\nWhen specified as a parameter of a request, this identifier can be set to\none of the following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", - "type": "string" - }, - "courseId": { - "description": "Identifier of the course to invite the user to.", - "type": "string" - } - }, - "id": "Invitation" - }, - "DriveFolder": { - "properties": { "title": { "description": "Title of the Drive folder.\n\nRead-only.", "type": "string" @@ -2054,17 +2796,27 @@ "alternateLink": { "description": "URL that can be used to access the Drive folder.\n\nRead-only.", "type": "string" - }, - "id": { - "description": "Drive API resource ID.", - "type": "string" } }, - "id": "DriveFolder", - "description": "Representation of a Google Drive folder.", - "type": "object" + "id": "DriveFolder" + }, + "SubmissionHistory": { + "description": "The history of the submission. This currently includes state and grade\nhistories.", + "type": "object", + "properties": { + "gradeHistory": { + "description": "The grade history information of the submission, if present.", + "$ref": "GradeHistory" + }, + "stateHistory": { + "$ref": "StateHistory", + "description": "The state history information of the submission, if present." + } + }, + "id": "SubmissionHistory" }, "ShortAnswerSubmission": { + "description": "Student work for a short answer question.", "type": "object", "properties": { "answer": { @@ -2072,11 +2824,9 @@ "type": "string" } }, - "id": "ShortAnswerSubmission", - "description": "Student work for a short answer question." + "id": "ShortAnswerSubmission" }, "ListStudentSubmissionsResponse": { - "id": "ListStudentSubmissionsResponse", "description": "Response when listing student submissions.", "type": "object", "properties": { @@ -2086,12 +2836,13 @@ }, "studentSubmissions": { "description": "Student work that matches the request.", - "type": "array", "items": { "$ref": "StudentSubmission" - } + }, + "type": "array" } - } + }, + "id": "ListStudentSubmissionsResponse" }, "StudentSubmission": { "description": "Student submission for course work.\n\nStudentSubmission items are generated when a CourseWork item is created.\n\nStudentSubmissions that have never been accessed (i.e. with `state` = NEW)\nmay not have a creation time or update time.", @@ -2102,13 +2853,11 @@ "type": "boolean" }, "draftGrade": { - "description": "Optional pending grade. If unset, no grade was set.\nThis must be a non-negative integer value.\n\nThis is only visible to and modifiable by course teachers.", "format": "double", + "description": "Optional pending grade. If unset, no grade was set.\nThis value must be non-negative. Decimal (i.e. non-integer) values are\nallowed, but will be rounded to two decimal places.\n\nThis is only visible to and modifiable by course teachers.", "type": "number" }, "courseWorkType": { - "description": "Type of course work this submission is for.\n\nRead-only.", - "type": "string", "enumDescriptions": [ "No work type specified. This is never returned.", "An assignment.", @@ -2120,23 +2869,16 @@ "ASSIGNMENT", "SHORT_ANSWER_QUESTION", "MULTIPLE_CHOICE_QUESTION" - ] + ], + "description": "Type of course work this submission is for.\n\nRead-only.", + "type": "string" }, "creationTime": { - "description": "Creation time of this submission.\nThis may be unset if the student has not accessed this item.\n\nRead-only.", "format": "google-datetime", + "description": "Creation time of this submission.\nThis may be unset if the student has not accessed this item.\n\nRead-only.", "type": "string" }, "state": { - "type": "string", - "enumDescriptions": [ - "No state specified. This should never be returned.", - "The student has never accessed this submission. Attachments are not\nreturned and timestamps is not set.", - "Has been created.", - "Has been turned in to the teacher.", - "Has been returned to the student.", - "Student chose to \"unsubmit\" the assignment." - ], "enum": [ "SUBMISSION_STATE_UNSPECIFIED", "NEW", @@ -2145,7 +2887,16 @@ "RETURNED", "RECLAIMED_BY_STUDENT" ], - "description": "State of this submission.\n\nRead-only." + "description": "State of this submission.\n\nRead-only.", + "type": "string", + "enumDescriptions": [ + "No state specified. This should never be returned.", + "The student has never accessed this submission. Attachments are not\nreturned and timestamps is not set.", + "Has been created.", + "Has been turned in to the teacher.", + "Has been returned to the student.", + "Student chose to \"unsubmit\" the assignment." + ] }, "userId": { "description": "Identifier for the student that owns this submission.\n\nRead-only.", @@ -2163,30 +2914,37 @@ "description": "Classroom-assigned Identifier for the student submission.\nThis is unique among submissions for the relevant course work.\n\nRead-only.", "type": "string" }, + "submissionHistory": { + "description": "The history of the submission (includes state and grade histories).\n\nRead-only.", + "items": { + "$ref": "SubmissionHistory" + }, + "type": "array" + }, "assignedGrade": { - "description": "Optional grade. If unset, no grade was set.\nThis must be a non-negative integer value.\n\nThis may be modified only by course teachers.", "format": "double", + "description": "Optional grade. If unset, no grade was set.\nThis value must be non-negative. Decimal (i.e. non-integer) values are\nallowed, but will be rounded to two decimal places.\n\nThis may be modified only by course teachers.", "type": "number" }, "multipleChoiceSubmission": { - "description": "Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.", - "$ref": "MultipleChoiceSubmission" + "$ref": "MultipleChoiceSubmission", + "description": "Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION." }, "assignmentSubmission": { "$ref": "AssignmentSubmission", - "description": "Submission content when course_work_type is ASSIGNMENT ." - }, - "associatedWithDeveloper": { - "description": "Whether this student submission is associated with the Developer Console\nproject making the request.\n\nSee google.classroom.Work.CreateCourseWork for more\ndetails.\n\nRead-only.", - "type": "boolean" + "description": "Submission content when course_work_type is ASSIGNMENT.\n\nStudents can modify this content using\ngoogle.classroom.Work.ModifyAttachments." }, "shortAnswerSubmission": { "$ref": "ShortAnswerSubmission", "description": "Submission content when course_work_type is SHORT_ANSWER_QUESTION." }, + "associatedWithDeveloper": { + "description": "Whether this student submission is associated with the Developer Console\nproject making the request.\n\nSee google.classroom.Work.CreateCourseWork for more\ndetails.\n\nRead-only.", + "type": "boolean" + }, "updateTime": { - "description": "Last update time of this submission.\nThis may be unset if the student has not accessed this item.\n\nRead-only.", "format": "google-datetime", + "description": "Last update time of this submission.\nThis may be unset if the student has not accessed this item.\n\nRead-only.", "type": "string" }, "alternateLink": { @@ -2196,56 +2954,22 @@ }, "id": "StudentSubmission" }, - "TurnInStudentSubmissionRequest": { - "description": "Request to turn in a student submission.", - "type": "object", - "properties": {}, - "id": "TurnInStudentSubmissionRequest" - }, - "ListCourseWorkResponse": { - "properties": { - "courseWork": { - "description": "Course work items that match the request.", - "type": "array", - "items": { - "$ref": "CourseWork" - } - }, - "nextPageToken": { - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", - "type": "string" - } - }, - "id": "ListCourseWorkResponse", - "description": "Response when listing course work.", - "type": "object" - }, "ModifyAttachmentsRequest": { "description": "Request to modify the attachments of a student submission.", "type": "object", "properties": { "addAttachments": { "description": "Attachments to add.\nA student submission may not have more than 20 attachments.\n\nForm attachments are not supported.", - "type": "array", "items": { "$ref": "Attachment" - } + }, + "type": "array" } }, "id": "ModifyAttachmentsRequest" }, "YouTubeVideo": { - "description": "YouTube video item.", - "type": "object", "properties": { - "alternateLink": { - "description": "URL that can be used to view the YouTube video.\n\nRead-only.", - "type": "string" - }, - "thumbnailUrl": { - "description": "URL of a thumbnail image of the YouTube video.\n\nRead-only.", - "type": "string" - }, "id": { "description": "YouTube API resource ID.", "type": "string" @@ -2253,34 +2977,64 @@ "title": { "description": "Title of the YouTube video.\n\nRead-only.", "type": "string" + }, + "alternateLink": { + "description": "URL that can be used to view the YouTube video.\n\nRead-only.", + "type": "string" + }, + "thumbnailUrl": { + "description": "URL of a thumbnail image of the YouTube video.\n\nRead-only.", + "type": "string" } }, - "id": "YouTubeVideo" + "id": "YouTubeVideo", + "description": "YouTube video item.", + "type": "object" }, "ListInvitationsResponse": { "description": "Response when listing invitations.", "type": "object", "properties": { - "invitations": { - "description": "Invitations that match the list request.", - "type": "array", - "items": { - "$ref": "Invitation" - } - }, "nextPageToken": { "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", "type": "string" + }, + "invitations": { + "description": "Invitations that match the list request.", + "items": { + "$ref": "Invitation" + }, + "type": "array" } }, "id": "ListInvitationsResponse" }, + "CloudPubsubTopic": { + "description": "A reference to a Cloud Pub/Sub topic.\n\nTo register for notifications, the owner of the topic must grant\n`classroom-notifications@system.gserviceaccount.com` the\n `projects.topics.publish` permission.", + "type": "object", + "properties": { + "topicName": { + "description": "The `name` field of a Cloud Pub/Sub\n[Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic).", + "type": "string" + } + }, + "id": "CloudPubsubTopic" + }, "GuardianInvitation": { "description": "An invitation to become the guardian of a specified user, sent to a specified\nemail address.", "type": "object", "properties": { - "studentId": { - "description": "ID of the student (in standard format)", + "invitedEmailAddress": { + "description": "Email address that the invitation was sent to.\nThis field is only visible to domain administrators.", + "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "The time that this invitation was created.\n\nRead-only.", + "type": "string" + }, + "invitationId": { + "description": "Unique identifier for this invitation.\n\nRead-only.", "type": "string" }, "state": { @@ -2297,153 +3051,93 @@ "COMPLETE" ] }, - "invitedEmailAddress": { - "description": "Email address that the invitation was sent to.\nThis field is only visible to domain administrators.", - "type": "string" - }, - "creationTime": { - "type": "string", - "description": "The time that this invitation was created.\n\nRead-only.", - "format": "google-datetime" - }, - "invitationId": { - "description": "Unique identifier for this invitation.\n\nRead-only.", + "studentId": { + "description": "ID of the student (in standard format)", "type": "string" } }, "id": "GuardianInvitation" }, - "Attachment": { - "description": "Attachment added to student assignment work.\n\nWhen creating attachments, setting the `form` field is not supported.", + "StateHistory": { + "description": "The history of each state this submission has been in.", "type": "object", "properties": { - "driveFile": { - "$ref": "DriveFile", - "description": "Google Drive file attachment." + "state": { + "enumDescriptions": [ + "No state specified. This should never be returned.", + "The Submission has been created.", + "The student has turned in an assigned document, which may or may not be\na template.", + "The teacher has returned the assigned document to the student.", + "The student turned in the assigned document, and then chose to\n\"unsubmit\" the assignment, giving the student control again as the\nowner.", + "The student edited their submission after turning it in. Currently,\nonly used by Questions, when the student edits their answer." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATED", + "TURNED_IN", + "RETURNED", + "RECLAIMED_BY_STUDENT", + "STUDENT_EDITED_AFTER_TURN_IN" + ], + "description": "The workflow pipeline stage.", + "type": "string" }, - "youTubeVideo": { - "description": "Youtube video attachment.", - "$ref": "YouTubeVideo" + "stateTimestamp": { + "format": "google-datetime", + "description": "When the submission entered this state.", + "type": "string" }, - "form": { - "description": "Google Forms attachment.", - "$ref": "Form" - }, - "link": { - "$ref": "Link", - "description": "Link attachment." + "actorUserId": { + "description": "The teacher or student who made the change", + "type": "string" } }, - "id": "Attachment" + "id": "StateHistory" }, "CourseMaterialSet": { "description": "A set of materials that appears on the \"About\" page of the course.\nThese materials might include a syllabus, schedule, or other background\ninformation relating to the course as a whole.", "type": "object", "properties": { + "materials": { + "description": "Materials attached to this set.", + "items": { + "$ref": "CourseMaterial" + }, + "type": "array" + }, "title": { "description": "Title for this set.", "type": "string" - }, - "materials": { - "description": "Materials attached to this set.", - "type": "array", - "items": { - "$ref": "CourseMaterial" - } } }, "id": "CourseMaterialSet" }, - "TimeOfDay": { - "description": "Represents a time of day. The date and time zone are either not significant\nor are specified elsewhere. An API may choose to allow leap seconds. Related\ntypes are google.type.Date and `google.protobuf.Timestamp`.", - "type": "object", - "properties": { - "hours": { - "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose\nto allow the value \"24:00:00\" for scenarios like business closing time.", - "format": "int32", - "type": "integer" - }, - "nanos": { - "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", - "format": "int32", - "type": "integer" - }, - "seconds": { - "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may\nallow the value 60 if it allows leap-seconds.", - "format": "int32", - "type": "integer" - }, - "minutes": { - "description": "Minutes of hour of day. Must be from 0 to 59.", - "format": "int32", - "type": "integer" - } - }, - "id": "TimeOfDay" - }, - "ListCoursesResponse": { - "properties": { - "nextPageToken": { - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", - "type": "string" - }, - "courses": { - "description": "Courses that match the list request.", - "type": "array", - "items": { - "$ref": "Course" - } - } - }, - "id": "ListCoursesResponse", - "description": "Response when listing courses.", - "type": "object" - }, - "Form": { - "type": "object", - "properties": { - "title": { - "description": "Title of the Form.\n\nRead-only.", - "type": "string" - }, - "thumbnailUrl": { - "description": "URL of a thumbnail image of the Form.\n\nRead-only.", - "type": "string" - }, - "responseUrl": { - "description": "URL of the form responses document.\nOnly set if respsonses have been recorded and only when the\nrequesting user is an editor of the form.\n\nRead-only.", - "type": "string" - }, - "formUrl": { - "description": "URL of the form.", - "type": "string" - } - }, - "id": "Form", - "description": "Google Forms item." - }, "ListTeachersResponse": { - "id": "ListTeachersResponse", "description": "Response when listing teachers.", "type": "object", "properties": { - "teachers": { - "description": "Teachers who match the list request.", - "type": "array", - "items": { - "$ref": "Teacher" - } - }, "nextPageToken": { "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", "type": "string" + }, + "teachers": { + "description": "Teachers who match the list request.", + "items": { + "$ref": "Teacher" + }, + "type": "array" } - } + }, + "id": "ListTeachersResponse" }, "Link": { "description": "URL item.", "type": "object", "properties": { + "thumbnailUrl": { + "description": "URL of a thumbnail image of the target URL.\n\nRead-only.", + "type": "string" + }, "url": { "description": "URL to link to.\nThis must be a valid UTF-8 string containing between 1 and 2024 characters.", "type": "string" @@ -2451,173 +3145,66 @@ "title": { "description": "Title of the target of the URL.\n\nRead-only.", "type": "string" - }, - "thumbnailUrl": { - "description": "URL of a thumbnail image of the target URL.\n\nRead-only.", - "type": "string" } }, "id": "Link" }, - "ListGuardiansResponse": { - "description": "Response when listing guardians.", - "type": "object", - "properties": { - "guardians": { - "description": "Guardians on this page of results that met the criteria specified in\nthe request.", - "type": "array", - "items": { - "$ref": "Guardian" - } - }, - "nextPageToken": { - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", - "type": "string" - } - }, - "id": "ListGuardiansResponse" - }, - "CourseAlias": { - "description": "Alternative identifier for a course.\n\nAn alias uniquely identifies a course. It must be unique within one of the\nfollowing scopes:\n\n* domain: A domain-scoped alias is visible to all users within the alias\ncreator's domain and can be created only by a domain admin. A domain-scoped\nalias is often used when a course has an identifier external to Classroom.\n\n* project: A project-scoped alias is visible to any request from an\napplication using the Developer Console project ID that created the alias\nand can be created by any project. A project-scoped alias is often used when\nan application has alternative identifiers. A random value can also be used\nto avoid duplicate courses in the event of transmission failures, as retrying\na request will return `ALREADY_EXISTS` if a previous one has succeeded.", - "type": "object", - "properties": { - "alias": { - "description": "Alias string. The format of the string indicates the desired alias scoping.\n\n* `d:\u003cname\u003e` indicates a domain-scoped alias.\n Example: `d:math_101`\n* `p:\u003cname\u003e` indicates a project-scoped alias.\n Example: `p:abc123`\n\nThis field has a maximum length of 256 characters.", - "type": "string" - } - }, - "id": "CourseAlias" - }, - "ListCourseAliasesResponse": { - "description": "Response when listing course aliases.", - "type": "object", - "properties": { - "aliases": { - "description": "The course aliases.", - "type": "array", - "items": { - "$ref": "CourseAlias" - } - }, - "nextPageToken": { - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", - "type": "string" - } - }, - "id": "ListCourseAliasesResponse" - }, - "ListGuardianInvitationsResponse": { - "description": "Response when listing guardian invitations.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", - "type": "string" - }, - "guardianInvitations": { - "description": "Guardian invitations that matched the list request.", - "type": "array", - "items": { - "$ref": "GuardianInvitation" - } - } - }, - "id": "ListGuardianInvitationsResponse" - }, "Date": { "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", "type": "object", "properties": { - "year": { - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "month": { "format": "int32", + "description": "Month of year. Must be from 1 to 12.", "type": "integer" }, "day": { - "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", "format": "int32", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", "type": "integer" }, - "month": { - "description": "Month of year. Must be from 1 to 12.", + "year": { "format": "int32", + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", "type": "integer" } }, "id": "Date" }, - "MultipleChoiceSubmission": { - "description": "Student work for a multiple-choice question.", - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "Student's select choice." - } - }, - "id": "MultipleChoiceSubmission" - }, - "CourseMaterial": { - "type": "object", - "properties": { - "driveFile": { - "$ref": "DriveFile", - "description": "Google Drive file attachment." - }, - "youTubeVideo": { - "$ref": "YouTubeVideo", - "description": "Youtube video attachment." - }, - "form": { - "description": "Google Forms attachment.", - "$ref": "Form" - }, - "link": { - "$ref": "Link", - "description": "Link atatchment." - } - }, - "id": "CourseMaterial", - "description": "A material attached to a course as part of a material set." - }, "Name": { - "id": "Name", - "description": "Details of the user's name.", - "type": "object", "properties": { - "givenName": { - "description": "The user's first name.\n\nRead-only.", - "type": "string" - }, "familyName": { "description": "The user's last name.\n\nRead-only.", "type": "string" }, + "givenName": { + "description": "The user's first name.\n\nRead-only.", + "type": "string" + }, "fullName": { "description": "The user's full name formed by concatenating the first and last name\nvalues.\n\nRead-only.", "type": "string" } - } + }, + "id": "Name", + "description": "Details of the user's name.", + "type": "object" }, "Assignment": { + "description": "Additional details for assignments.", "type": "object", "properties": { "studentWorkFolder": { - "$ref": "DriveFolder", - "description": "Drive folder where attachments from student submissions are placed.\nThis is only populated for course teachers." + "description": "Drive folder where attachments from student submissions are placed.\nThis is only populated for course teachers and administrators.", + "$ref": "DriveFolder" } }, - "id": "Assignment", - "description": "Additional details for assignments." + "id": "Assignment" }, "SharedDriveFile": { "description": "Drive file that is used as material for course work.", "type": "object", "properties": { - "driveFile": { - "$ref": "DriveFile", - "description": "Drive file details." - }, "shareMode": { "description": "Mechanism by which students access the Drive item.", "type": "string", @@ -2633,29 +3220,161 @@ "EDIT", "STUDENT_COPY" ] + }, + "driveFile": { + "$ref": "DriveFile", + "description": "Drive file details." } }, "id": "SharedDriveFile" }, "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", "properties": {}, - "id": "Empty" + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object" }, - "MultipleChoiceQuestion": { - "description": "Additional details for multiple-choice questions.", - "type": "object", + "ModifyAnnouncementAssigneesRequest": { "properties": { - "choices": { - "description": "Possible choices.", - "type": "array", - "items": { - "type": "string" - } + "modifyIndividualStudentsOptions": { + "description": "Set which students can view or cannot view the announcement.\nMust be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`.", + "$ref": "ModifyIndividualStudentsOptions" + }, + "assigneeMode": { + "enumDescriptions": [ + "No mode specified. This is never returned.", + "All students can see the item.\nThis is the default state.", + "A subset of the students can see the item." + ], + "enum": [ + "ASSIGNEE_MODE_UNSPECIFIED", + "ALL_STUDENTS", + "INDIVIDUAL_STUDENTS" + ], + "description": "Mode of the announcement describing whether it will be accessible by all\nstudents or specified individual students.", + "type": "string" } }, - "id": "MultipleChoiceQuestion" + "id": "ModifyAnnouncementAssigneesRequest", + "description": "Request to modify assignee mode and options of an announcement.", + "type": "object" + }, + "GlobalPermission": { + "properties": { + "permission": { + "enum": [ + "PERMISSION_UNSPECIFIED", + "CREATE_COURSE" + ], + "description": "Permission value.", + "type": "string", + "enumDescriptions": [ + "No permission is specified. This is not returned and is not a\nvalid value.", + "User is permitted to create a course." + ] + } + }, + "id": "GlobalPermission", + "description": "Global user permission description.", + "type": "object" + }, + "Teacher": { + "properties": { + "userId": { + "description": "Identifier of the user.\n\nWhen specified as a parameter of a request, this identifier can be one of\nthe following:\n\n* the numeric identifier for the user\n* the email address of the user\n* the string literal `\"me\"`, indicating the requesting user", + "type": "string" + }, + "courseId": { + "description": "Identifier of the course.\n\nRead-only.", + "type": "string" + }, + "profile": { + "$ref": "UserProfile", + "description": "Global user information for the teacher.\n\nRead-only." + } + }, + "id": "Teacher", + "description": "Teacher of a course.", + "type": "object" + }, + "GradeHistory": { + "properties": { + "actorUserId": { + "description": "The teacher who made the grade change.", + "type": "string" + }, + "gradeChangeType": { + "enumDescriptions": [ + "No grade change type specified. This should never be returned.", + "A change in the numerator of the draft grade.", + "A change in the numerator of the assigned grade.", + "A change in the denominator of the grade." + ], + "enum": [ + "UNKNOWN_GRADE_CHANGE_TYPE", + "DRAFT_GRADE_POINTS_EARNED_CHANGE", + "ASSIGNED_GRADE_POINTS_EARNED_CHANGE", + "MAX_POINTS_CHANGE" + ], + "description": "The type of grade change at this time in the submission grade history.", + "type": "string" + }, + "gradeTimestamp": { + "format": "google-datetime", + "description": "When the grade of the submission was changed.", + "type": "string" + }, + "maxPoints": { + "format": "double", + "description": "The denominator of the grade at this time in the submission grade\nhistory.", + "type": "number" + }, + "pointsEarned": { + "format": "double", + "description": "The numerator of the grade at this time in the submission grade history.", + "type": "number" + } + }, + "id": "GradeHistory", + "description": "The history of each grade on this submission.", + "type": "object" + }, + "AssignmentSubmission": { + "description": "Student work for an assignment.", + "type": "object", + "properties": { + "attachments": { + "description": "Attachments added by the student.\nDrive files that correspond to materials with a share mode of\nSTUDENT_COPY may not exist yet if the student has not accessed the\nassignment in Classroom.\n\nSome attachment metadata is only populated if the requesting user has\npermission to access it. Identifier and alternate_link fields are always\navailable, but others (e.g. title) may not be.", + "items": { + "$ref": "Attachment" + }, + "type": "array" + } + }, + "id": "AssignmentSubmission" + }, + "Material": { + "description": "Material attached to course work.\n\nWhen creating attachments, setting the `form` field is not supported.", + "type": "object", + "properties": { + "driveFile": { + "description": "Google Drive file material.", + "$ref": "SharedDriveFile" + }, + "form": { + "description": "Google Forms material.", + "$ref": "Form" + }, + "link": { + "description": "Link material. On creation, will be upgraded to a more appropriate type\nif possible, and this will be reflected in the response.", + "$ref": "Link" + }, + "youtubeVideo": { + "$ref": "YouTubeVideo", + "description": "YouTube video material." + } + }, + "id": "Material" } }, "protocol": "rest", @@ -2668,15 +3387,30 @@ "auth": { "oauth2": { "scopes": { + "https://www.googleapis.com/auth/classroom.profile.photos": { + "description": "View the profile photos of people in your classes" + }, + "https://www.googleapis.com/auth/classroom.rosters.readonly": { + "description": "View your Google Classroom class rosters" + }, + "https://www.googleapis.com/auth/classroom.announcements.readonly": { + "description": "View announcements in Google Classroom" + }, + "https://www.googleapis.com/auth/classroom.guardianlinks.students": { + "description": "View and manage guardians for students in your Google Classroom classes" + }, "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly": { "description": "View your course work and grades in Google Classroom" }, - "https://www.googleapis.com/auth/classroom.coursework.students": { - "description": "Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer" + "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly": { + "description": "View your Google Classroom guardians" }, "https://www.googleapis.com/auth/classroom.coursework.students.readonly": { "description": "View course work and grades for students in the Google Classroom classes you teach or administer" }, + "https://www.googleapis.com/auth/classroom.coursework.students": { + "description": "Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer" + }, "https://www.googleapis.com/auth/classroom.coursework.me.readonly": { "description": "View your course work and grades in Google Classroom" }, @@ -2692,19 +3426,24 @@ "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly": { "description": "View course work and grades for students in the Google Classroom classes you teach or administer" }, + "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly": { + "description": "View guardians for students in your Google Classroom classes" + }, "https://www.googleapis.com/auth/classroom.courses": { "description": "Manage your Google Classroom classes" }, "https://www.googleapis.com/auth/classroom.courses.readonly": { "description": "View your Google Classroom classes" }, - "https://www.googleapis.com/auth/classroom.rosters.readonly": { - "description": "View your Google Classroom class rosters" - }, - "https://www.googleapis.com/auth/classroom.profile.photos": { - "description": "View the profile photos of people in your classes" + "https://www.googleapis.com/auth/classroom.announcements": { + "description": "View and manage announcements in Google Classroom" } } } - } + }, + "servicePath": "", + "description": "Manages classes, rosters, and invitations in Google Classroom.", + "kind": "discovery#restDescription", + "rootUrl": "https://classroom.googleapis.com/", + "basePath": "" } diff --git a/etc/api/classroom/v1/crates/1.0.6-api+20170926 b/etc/api/classroom/v1/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudbilling/v1/cloudbilling-api.json b/etc/api/cloudbilling/v1/cloudbilling-api.json index ee9670772f..16f22bc75a 100644 --- a/etc/api/cloudbilling/v1/cloudbilling-api.json +++ b/etc/api/cloudbilling/v1/cloudbilling-api.json @@ -167,9 +167,233 @@ ] } } + }, + "services": { + "resources": { + "skus": { + "methods": { + "list": { + "id": "cloudbilling.services.skus.list", + "response": { + "$ref": "ListSkusResponse" + }, + "parameterOrder": [ + "parent" + ], + "description": "Lists all publicly available SKUs for a given cloud service.", + "flatPath": "v1/services/{servicesId}/skus", + "httpMethod": "GET", + "parameters": { + "parent": { + "description": "The name of the service.\nExample: \"services/DA34-426B-A397\"", + "required": true, + "pattern": "^services/[^/]+$", + "location": "path", + "type": "string" + }, + "currencyCode": { + "description": "The ISO 4217 currency code for the pricing info in the response proto.\nWill use the conversion rate as of start_time.\nOptional. If not specified USD will be used.", + "location": "query", + "type": "string" + }, + "endTime": { + "description": "Optional exclusive end time of the time range for which the pricing\nversions will be returned. Timestamps in the future are not allowed.\nMaximum allowable time range is 1 month (31 days). Time range as a whole\nis optional. If not specified, the latest pricing will be returned (up to\n12 hours old at most).", + "location": "query", + "type": "string", + "format": "google-datetime" + }, + "pageSize": { + "description": "Requested page size. Defaults to 5000.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "startTime": { + "description": "Optional inclusive start time of the time range for which the pricing\nversions will be returned. Timestamps in the future are not allowed.\nMaximum allowable time range is 1 month (31 days). Time range as a whole\nis optional. If not specified, the latest pricing will be returned (up to\n12 hours old at most).", + "location": "query", + "type": "string", + "format": "google-datetime" + }, + "pageToken": { + "description": "A token identifying a page of results to return. This should be a\n`next_page_token` value returned from a previous `ListSkus`\ncall. If unspecified, the first page of results is returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+parent}/skus" + } + } + } + }, + "methods": { + "list": { + "id": "cloudbilling.services.list", + "response": { + "$ref": "ListServicesResponse" + }, + "parameterOrder": [], + "description": "Lists all public cloud services.", + "flatPath": "v1/services", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Requested page size. Defaults to 5000.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "A token identifying a page of results to return. This should be a\n`next_page_token` value returned from a previous `ListServices`\ncall. If unspecified, the first page of results is returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1/services" + } + } } }, "schemas": { + "PricingExpression": { + "description": "Expresses a mathematical pricing formula. For Example:-\n\n`usage_unit: GBy`\n`tiered_rates:`\n `[start_usage_amount: 20, unit_price: $10]`\n `[start_usage_amount: 100, unit_price: $5]`\n\nThe above expresses a pricing formula where the first 20GB is free, the\nnext 80GB is priced at $10 per GB followed by $5 per GB for additional\nusage.", + "type": "object", + "properties": { + "displayQuantity": { + "description": "The recommended quantity of units for displaying pricing info. When\ndisplaying pricing info it is recommended to display:\n(unit_price * display_quantity) per display_quantity usage_unit.\nThis field does not affect the pricing formula and is for display purposes\nonly.\nExample: If the unit_price is \"0.0001 USD\", the usage_unit is \"GB\" and\nthe display_quantity is \"1000\" then the recommended way of displaying the\npricing info is \"0.10 USD per 1000 GB\"", + "type": "number", + "format": "double" + }, + "baseUnitDescription": { + "description": "The base unit in human readable form.\nExample: \"byte\".", + "type": "string" + }, + "baseUnitConversionFactor": { + "description": "Conversion factor for converting from price per usage_unit to price per\nbase_unit, and start_usage_amount to start_usage_amount in base_unit.\nunit_price / base_unit_conversion_factor = price per base_unit.\nstart_usage_amount * base_unit_conversion_factor = start_usage_amount in\nbase_unit.", + "type": "number", + "format": "double" + }, + "usageUnit": { + "description": "The short hand for unit of usage this pricing is specified in.\nExample: usage_unit of \"GiBy\" means that usage is specified in \"Gibi Byte\".", + "type": "string" + }, + "baseUnit": { + "description": "The base unit for the SKU which is the unit used in usage exports.\nExample: \"By\"", + "type": "string" + }, + "usageUnitDescription": { + "description": "The unit of usage in human readable form.\nExample: \"gibi byte\".", + "type": "string" + }, + "tieredRates": { + "description": "The list of tiered rates for this pricing. The total cost is computed by\napplying each of the tiered rates on usage. This repeated list is sorted\nby ascending order of start_usage_amount.", + "type": "array", + "items": { + "$ref": "TierRate" + } + } + }, + "id": "PricingExpression" + }, + "Sku": { + "description": "Encapsulates a single SKU in Google Cloud Platform", + "type": "object", + "properties": { + "description": { + "description": "A human readable description of the SKU, has a maximum length of 256\ncharacters.", + "type": "string" + }, + "serviceRegions": { + "description": "List of service regions this SKU is offered at.\nExample: \"asia-east1\"\nService regions can be found at https://cloud.google.com/about/locations/", + "type": "array", + "items": { + "type": "string" + } + }, + "serviceProviderName": { + "description": "Identifies the service provider.\nThis is 'Google' for first party services in Google Cloud Platform.", + "type": "string" + }, + "pricingInfo": { + "description": "A timeline of pricing info for this SKU in chronological order.", + "type": "array", + "items": { + "$ref": "PricingInfo" + } + }, + "skuId": { + "description": "The identifier for the SKU.\nExample: \"AA95-CD31-42FE\"", + "type": "string" + }, + "name": { + "description": "The resource name for the SKU.\nExample: \"services/DA34-426B-A397/skus/AA95-CD31-42FE\"", + "type": "string" + }, + "category": { + "description": "The category hierarchy of this SKU, purely for organizational purpose.", + "$ref": "Category" + } + }, + "id": "Sku" + }, + "Money": { + "description": "Represents an amount of money with its currency type.", + "type": "object", + "properties": { + "currencyCode": { + "description": "The 3-letter currency code defined in ISO 4217.", + "type": "string" + }, + "units": { + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "type": "string", + "format": "int64" + }, + "nanos": { + "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "type": "integer", + "format": "int32" + } + }, + "id": "Money" + }, + "AggregationInfo": { + "description": "Represents the aggregation level and interval for pricing of a single SKU.", + "type": "object", + "properties": { + "aggregationInterval": { + "enum": [ + "AGGREGATION_INTERVAL_UNSPECIFIED", + "DAILY", + "MONTHLY" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "type": "string" + }, + "aggregationLevel": { + "enum": [ + "AGGREGATION_LEVEL_UNSPECIFIED", + "ACCOUNT", + "PROJECT" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "type": "string" + }, + "aggregationCount": { + "description": "The number of intervals to aggregate over.\nExample: If aggregation_level is \"DAILY\" and aggregation_count is 14,\naggregation will be over 14 days.", + "type": "integer", + "format": "int32" + } + }, + "id": "AggregationInfo" + }, "ProjectBillingInfo": { "description": "Encapsulation of billing information for a Cloud Console project. A project\nhas at most one associated billing account at a time (but a billing account\ncan be assigned to multiple projects).", "type": "object", @@ -193,6 +417,106 @@ }, "id": "ProjectBillingInfo" }, + "ListBillingAccountsResponse": { + "description": "Response message for `ListBillingAccounts`.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results. To retrieve the next page,\ncall `ListBillingAccounts` again with the `page_token` field set to this\nvalue. This field is empty if there are no more results to retrieve.", + "type": "string" + }, + "billingAccounts": { + "description": "A list of billing accounts.", + "type": "array", + "items": { + "$ref": "BillingAccount" + } + } + }, + "id": "ListBillingAccountsResponse" + }, + "ListSkusResponse": { + "description": "Response message for `ListSkus`.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results. To retrieve the next page,\ncall `ListSkus` again with the `page_token` field set to this\nvalue. This field is empty if there are no more results to retrieve.", + "type": "string" + }, + "skus": { + "description": "The list of public SKUs of the given service.", + "type": "array", + "items": { + "$ref": "Sku" + } + } + }, + "id": "ListSkusResponse" + }, + "Service": { + "description": "Encapsulates a single service in Google Cloud Platform.", + "type": "object", + "properties": { + "displayName": { + "description": "A human readable display name for this service.", + "type": "string" + }, + "serviceId": { + "description": "The identifier for the service.\nExample: \"DA34-426B-A397\"", + "type": "string" + }, + "name": { + "description": "The resource name for the service.\nExample: \"services/DA34-426B-A397\"", + "type": "string" + } + }, + "id": "Service" + }, + "TierRate": { + "description": "The price rate indicating starting usage and its corresponding price.", + "type": "object", + "properties": { + "unitPrice": { + "description": "The price per unit of usage.\nExample: unit_price of amount $10 indicates that each unit will cost $10.", + "$ref": "Money" + }, + "startUsageAmount": { + "description": "Usage is priced at this rate only after this amount.\nExample: start_usage_amount of 10 indicates that the usage will be priced\nat the unit_price after the first 10 usage_units.", + "type": "number", + "format": "double" + } + }, + "id": "TierRate" + }, + "PricingInfo": { + "description": "Represents the pricing information for a SKU at a single point of time.", + "type": "object", + "properties": { + "effectiveTime": { + "description": "The timestamp from which this pricing was effective.", + "type": "string", + "format": "google-datetime" + }, + "aggregationInfo": { + "description": "Aggregation Info. This can be left unspecified if the pricing expression\ndoesn't require aggregation.", + "$ref": "AggregationInfo" + }, + "currencyConversionRate": { + "description": "Conversion rate for currency conversion, from USD to the currency specified\nin the request. If the currency is not specified this defaults to 1.0.\nExample: USD * currency_conversion_rate = JPY", + "type": "number", + "format": "double" + }, + "pricingExpression": { + "description": "Expresses the pricing formula. See `PricingExpression` for an example.", + "$ref": "PricingExpression" + }, + "summary": { + "description": "An optional human readable summary of the pricing information, has a\nmaximum length of 256 characters.", + "type": "string" + } + }, + "id": "PricingInfo" + }, "ListProjectBillingInfoResponse": { "description": "Request message for `ListProjectBillingInfoResponse`.", "type": "object", @@ -211,23 +535,23 @@ }, "id": "ListProjectBillingInfoResponse" }, - "ListBillingAccountsResponse": { - "description": "Response message for `ListBillingAccounts`.", + "ListServicesResponse": { + "description": "Response message for `ListServices`.", "type": "object", "properties": { "nextPageToken": { - "description": "A token to retrieve the next page of results. To retrieve the next page,\ncall `ListBillingAccounts` again with the `page_token` field set to this\nvalue. This field is empty if there are no more results to retrieve.", + "description": "A token to retrieve the next page of results. To retrieve the next page,\ncall `ListServices` again with the `page_token` field set to this\nvalue. This field is empty if there are no more results to retrieve.", "type": "string" }, - "billingAccounts": { - "description": "A list of billing accounts.", + "services": { + "description": "A list of services.", "type": "array", "items": { - "$ref": "BillingAccount" + "$ref": "Service" } } }, - "id": "ListBillingAccountsResponse" + "id": "ListServicesResponse" }, "BillingAccount": { "description": "A billing account in [Google Cloud\nConsole](https://console.cloud.google.com/). You can assign a billing account\nto one or more projects.", @@ -247,15 +571,40 @@ } }, "id": "BillingAccount" + }, + "Category": { + "description": "Represents the category hierarchy of a SKU.", + "type": "object", + "properties": { + "resourceFamily": { + "description": "The type of product the SKU refers to.\nExample: \"Compute\", \"Storage\", \"Network\", \"ApplicationServices\" etc.", + "type": "string" + }, + "usageType": { + "description": "Represents how the SKU is consumed.\nExample: \"OnDemand\", \"Preemptible\", \"Commit1Mo\", \"Commit1Yr\" etc.", + "type": "string" + }, + "resourceGroup": { + "description": "A group classification for related SKUs.\nExample: \"RAM\", \"GPU\", \"Prediction\", \"Ops\", \"GoogleEgress\" etc.", + "type": "string" + }, + "serviceDisplayName": { + "description": "The display name of the service this SKU belongs to.", + "type": "string" + } + }, + "id": "Category" } }, - "revision": "20170504", + "revision": "20170813", "basePath": "", "icons": { "x32": "http://www.google.com/images/icons/product/search-32.gif", "x16": "http://www.google.com/images/icons/product/search-16.gif" }, + "canonicalName": "Cloudbilling", "discoveryVersion": "v1", + "fullyEncodeReservedExpansion": true, "baseUrl": "https://cloudbilling.googleapis.com/", "name": "cloudbilling", "parameters": { diff --git a/etc/api/cloudbilling/v1/crates/1.0.6-api+20170813 b/etc/api/cloudbilling/v1/crates/1.0.6-api+20170813 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudbuild/v1/cloudbuild-api.json b/etc/api/cloudbuild/v1/cloudbuild-api.json index fff0ef57f0..870ea76eb2 100644 --- a/etc/api/cloudbuild/v1/cloudbuild-api.json +++ b/etc/api/cloudbuild/v1/cloudbuild-api.json @@ -1,496 +1,341 @@ { - "ownerName": "Google", - "resources": { - "operations": { - "methods": { - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ListOperationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "filter": { - "location": "query", - "description": "The standard list filter.", - "type": "string" - }, - "name": { - "required": true, - "type": "string", - "pattern": "^operations$", - "location": "path", - "description": "The name of the operation collection." - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "The standard list page token." - }, - "pageSize": { - "description": "The standard list page size.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "flatPath": "v1/operations", - "id": "cloudbuild.operations.list", - "path": "v1/{+name}", - "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding below allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`." + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "BuildTrigger": { + "description": "Configuration for an automated build in response to source repository\nchanges.", + "type": "object", + "properties": { + "disabled": { + "description": "If true, the trigger will never result in a build.", + "type": "boolean" }, - "get": { - "path": "v1/{+name}", - "id": "cloudbuild.operations.get", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "response": { + "createTime": { + "format": "google-datetime", + "description": "Time when the trigger was created.\n\n@OutputOnly", + "type": "string" + }, + "triggerTemplate": { + "description": "Template describing the types of source changes to trigger a build.\n\nBranch and tag names in trigger templates are interpreted as regular\nexpressions. Any branch or tag change that matches that regular expression\nwill trigger a build.", + "$ref": "RepoSource" + }, + "filename": { + "description": "Path, from the source root, to a file whose contents is used for the\ntemplate.", + "type": "string" + }, + "id": { + "description": "Unique identifier of the trigger.\n\n@OutputOnly", + "type": "string" + }, + "build": { + "$ref": "Build", + "description": "Contents of the build template." + }, + "substitutions": { + "additionalProperties": { + "type": "string" + }, + "description": "Substitutions data for Build resource.", + "type": "object" + }, + "description": { + "description": "Human-readable description of this trigger.", + "type": "string" + } + }, + "id": "BuildTrigger" + }, + "Build": { + "description": "A build resource in the Container Builder API.\n\nAt a high level, a Build describes where to find source code, how to build\nit (for example, the builder image to run on the source), and what tag to\napply to the built image when it is pushed to Google Container Registry.\n\nFields can include the following variables which will be expanded when the\nbuild is created:\n\n- $PROJECT_ID: the project ID of the build.\n- $BUILD_ID: the autogenerated ID of the build.\n- $REPO_NAME: the source repository name specified by RepoSource.\n- $BRANCH_NAME: the branch name specified by RepoSource.\n- $TAG_NAME: the tag name specified by RepoSource.\n- $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or\n resolved from the specified branch or tag.\n- $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.", + "type": "object", + "properties": { + "options": { + "$ref": "BuildOptions", + "description": "Special options for this build." + }, + "source": { + "description": "Describes where to find the source files to build.", + "$ref": "Source" + }, + "timeout": { + "format": "google-duration", + "description": "Amount of time that this build should be allowed to run, to second\ngranularity. If this amount of time elapses, work on the build will cease\nand the build status will be TIMEOUT.\n\nDefault time is ten minutes.", + "type": "string" + }, + "status": { + "description": "Status of the build.\n@OutputOnly", + "type": "string", + "enumDescriptions": [ + "Status of the build is unknown.", + "Build is queued; work has not yet begun.", + "Build is being executed.", + "Build finished successfully.", + "Build failed to complete successfully.", + "Build failed due to an internal cause.", + "Build took longer than was allowed.", + "Build was canceled by a user." + ], + "enum": [ + "STATUS_UNKNOWN", + "QUEUED", + "WORKING", + "SUCCESS", + "FAILURE", + "INTERNAL_ERROR", + "TIMEOUT", + "CANCELLED" + ] + }, + "statusDetail": { + "description": "Customer-readable message about the current status.\n@OutputOnly", + "type": "string" + }, + "secrets": { + "description": "Secrets to decrypt using Cloud KMS.", + "items": { + "$ref": "Secret" + }, + "type": "array" + }, + "logsBucket": { + "description": "Google Cloud Storage bucket where logs should be written (see\n[Bucket Name\nRequirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).\nLogs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.", + "type": "string" + }, + "results": { + "$ref": "Results", + "description": "Results of the build.\n@OutputOnly" + }, + "steps": { + "description": "Describes the operations to be performed on the workspace.", + "items": { + "$ref": "BuildStep" + }, + "type": "array" + }, + "buildTriggerId": { + "description": "The ID of the BuildTrigger that triggered this build, if it was\ntriggered automatically.\n@OutputOnly", + "type": "string" + }, + "id": { + "description": "Unique identifier of the build.\n@OutputOnly", + "type": "string" + }, + "tags": { + "description": "Tags for annotation of a Build. These are not docker tags.", + "items": { + "type": "string" + }, + "type": "array" + }, + "substitutions": { + "additionalProperties": { + "type": "string" + }, + "description": "Substitutions data for Build resource.", + "type": "object" + }, + "startTime": { + "format": "google-datetime", + "description": "Time at which execution of the build was started.\n@OutputOnly", + "type": "string" + }, + "sourceProvenance": { + "description": "A permanent fixed identifier for source.\n@OutputOnly", + "$ref": "SourceProvenance" + }, + "createTime": { + "format": "google-datetime", + "description": "Time at which the request to create the build was received.\n@OutputOnly", + "type": "string" + }, + "images": { + "description": "A list of images to be pushed upon the successful completion of all build\nsteps.\n\nThe images will be pushed using the builder service account's credentials.\n\nThe digests of the pushed images will be stored in the Build resource's\nresults field.\n\nIf any of the images fail to be pushed, the build is marked FAILURE.", + "items": { + "type": "string" + }, + "type": "array" + }, + "projectId": { + "description": "ID of the project.\n@OutputOnly.", + "type": "string" + }, + "logUrl": { + "description": "URL to logs for this build in Google Cloud Logging.\n@OutputOnly", + "type": "string" + }, + "finishTime": { + "format": "google-datetime", + "description": "Time at which execution of the build was finished.\n\nThe difference between finish_time and start_time is the duration of the\nbuild's execution.\n@OutputOnly", + "type": "string" + } + }, + "id": "Build" + }, + "CancelBuildRequest": { + "description": "Request to cancel an ongoing build.", + "type": "object", + "properties": {}, + "id": "CancelBuildRequest" + }, + "Volume": { + "description": "Volume describes a Docker container volume which is mounted into build steps\nin order to persist files across build step execution.", + "type": "object", + "properties": { + "path": { + "description": "Path at which to mount the volume.\n\nPaths must be absolute and cannot conflict with other volume paths on the\nsame build step or with certain reserved volume paths.", + "type": "string" + }, + "name": { + "description": "Name of the volume to mount.\n\nVolume names must be unique per build step and must be valid names for\nDocker volumes. Each named volume must be used by at least two build steps.", + "type": "string" + } + }, + "id": "Volume" + }, + "ListBuildsResponse": { + "description": "Response including listed builds.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token to receive the next page of results.", + "type": "string" + }, + "builds": { + "description": "Builds will be sorted by create_time, descending.", + "items": { + "$ref": "Build" + }, + "type": "array" + } + }, + "id": "ListBuildsResponse" + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { "$ref": "Operation" }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation resource.", - "required": true, - "type": "string", - "pattern": "^operations/.+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/operations/{operationsId}" + "type": "array" }, - "cancel": { - "flatPath": "v1/operations/{operationsId}:cancel", - "id": "cloudbuild.operations.cancel", - "path": "v1/{+name}:cancel", - "request": { - "$ref": "CancelOperationRequest" - }, - "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", - "httpMethod": "POST", - "parameterOrder": [ - "name" + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListOperationsResponse" + }, + "Source": { + "description": "Source describes the location of the source in a supported storage\nservice.", + "type": "object", + "properties": { + "storageSource": { + "description": "If provided, get the source from this location in Google Cloud Storage.", + "$ref": "StorageSource" + }, + "repoSource": { + "description": "If provided, get source from this location in a Cloud Repo.", + "$ref": "RepoSource" + } + }, + "id": "Source" + }, + "BuildOptions": { + "description": "Optional arguments to enable specific features of builds.", + "type": "object", + "properties": { + "substitutionOption": { + "enumDescriptions": [ + "Fails the build if error in substitutions checks, like missing\na substitution in the template or in the map.", + "Do not fail the build if error in substitutions checks." ], - "response": { - "$ref": "Empty" + "enum": [ + "MUST_MATCH", + "ALLOW_LOOSE" + ], + "description": "SubstitutionOption to allow unmatch substitutions.", + "type": "string" + }, + "requestedVerifyOption": { + "description": "Requested verifiability options.", + "type": "string", + "enumDescriptions": [ + "Not a verifiable build. (default)", + "Verified build." + ], + "enum": [ + "NOT_VERIFIED", + "VERIFIED" + ] + }, + "sourceProvenanceHash": { + "description": "Requested hash for SourceProvenance.", + "items": { + "enum": [ + "NONE", + "SHA256" + ], + "type": "string" }, - "parameters": { - "name": { - "pattern": "^operations/.+$", - "location": "path", - "description": "The name of the operation resource to be cancelled.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "type": "array", + "enumDescriptions": [ + "No hash requested.", + "Use a sha256 hash." ] } - } + }, + "id": "BuildOptions" }, - "projects": { - "resources": { - "builds": { - "methods": { - "cancel": { - "request": { - "$ref": "CancelBuildRequest" - }, - "description": "Cancels a requested build in progress.", - "httpMethod": "POST", - "parameterOrder": [ - "projectId", - "id" - ], - "response": { - "$ref": "Build" - }, - "parameters": { - "projectId": { - "location": "path", - "description": "ID of the project.", - "required": true, - "type": "string" - }, - "id": { - "description": "ID of the build.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/builds/{id}:cancel", - "id": "cloudbuild.projects.builds.cancel", - "path": "v1/projects/{projectId}/builds/{id}:cancel" - }, - "get": { - "response": { - "$ref": "Build" - }, - "parameterOrder": [ - "projectId", - "id" - ], - "httpMethod": "GET", - "parameters": { - "projectId": { - "location": "path", - "description": "ID of the project.", - "required": true, - "type": "string" - }, - "id": { - "location": "path", - "description": "ID of the build.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/builds/{id}", - "path": "v1/projects/{projectId}/builds/{id}", - "id": "cloudbuild.projects.builds.get", - "description": "Returns information about a previously requested build.\n\nThe Build that is returned includes its status (e.g., success or failure,\nor in-progress), and timing information." - }, - "list": { - "response": { - "$ref": "ListBuildsResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "filter": { - "description": "The raw filter text to constrain the results.", - "type": "string", - "location": "query" - }, - "pageToken": { - "location": "query", - "description": "Token to provide to skip to a particular spot in the list.", - "type": "string" - }, - "pageSize": { - "description": "Number of results to return in the list.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "projectId": { - "location": "path", - "description": "ID of the project.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/builds", - "path": "v1/projects/{projectId}/builds", - "id": "cloudbuild.projects.builds.list", - "description": "Lists previously requested builds.\n\nPreviously requested builds may still be in-progress, or may have finished\nsuccessfully or unsuccessfully." - }, - "create": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "ID of the project.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/builds", - "path": "v1/projects/{projectId}/builds", - "id": "cloudbuild.projects.builds.create", - "description": "Starts a build with the specified configuration.\n\nThe long-running Operation returned by this method will include the ID of\nthe build, which can be passed to GetBuild to determine its status (e.g.,\nsuccess or failure).", - "request": { - "$ref": "Build" - } - } - } + "StorageSource": { + "description": "StorageSource describes the location of the source in an archive file in\nGoogle Cloud Storage.", + "type": "object", + "properties": { + "generation": { + "format": "int64", + "description": "Google Cloud Storage generation for the object. If the generation is\nomitted, the latest generation will be used.", + "type": "string" }, - "triggers": { - "methods": { - "create": { - "flatPath": "v1/projects/{projectId}/triggers", - "path": "v1/projects/{projectId}/triggers", - "id": "cloudbuild.projects.triggers.create", - "description": "Creates a new BuildTrigger.\n\nThis API is experimental.", - "request": { - "$ref": "BuildTrigger" - }, - "response": { - "$ref": "BuildTrigger" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "ID of the project for which to configure automatic builds.", - "required": true, - "type": "string" - } - } - }, - "delete": { - "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", - "path": "v1/projects/{projectId}/triggers/{triggerId}", - "id": "cloudbuild.projects.triggers.delete", - "description": "Deletes an BuildTrigger by its project ID and trigger ID.\n\nThis API is experimental.", - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "projectId", - "triggerId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "triggerId": { - "location": "path", - "description": "ID of the BuildTrigger to delete.", - "required": true, - "type": "string" - }, - "projectId": { - "description": "ID of the project that owns the trigger.", - "required": true, - "type": "string", - "location": "path" - } - } - }, - "get": { - "description": "Gets information about a BuildTrigger.\n\nThis API is experimental.", - "response": { - "$ref": "BuildTrigger" - }, - "parameterOrder": [ - "projectId", - "triggerId" - ], - "httpMethod": "GET", - "parameters": { - "triggerId": { - "location": "path", - "description": "ID of the BuildTrigger to get.", - "required": true, - "type": "string" - }, - "projectId": { - "required": true, - "type": "string", - "location": "path", - "description": "ID of the project that owns the trigger." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", - "path": "v1/projects/{projectId}/triggers/{triggerId}", - "id": "cloudbuild.projects.triggers.get" - }, - "list": { - "description": "Lists existing BuildTrigger.\n\nThis API is experimental.", - "response": { - "$ref": "ListBuildTriggersResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "projectId": { - "description": "ID of the project for which to list BuildTriggers.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectId}/triggers", - "path": "v1/projects/{projectId}/triggers", - "id": "cloudbuild.projects.triggers.list" - }, - "patch": { - "request": { - "$ref": "BuildTrigger" - }, - "description": "Updates an BuildTrigger by its project ID and trigger ID.\n\nThis API is experimental.", - "response": { - "$ref": "BuildTrigger" - }, - "parameterOrder": [ - "projectId", - "triggerId" - ], - "httpMethod": "PATCH", - "parameters": { - "triggerId": { - "description": "ID of the BuildTrigger to update.", - "required": true, - "type": "string", - "location": "path" - }, - "projectId": { - "location": "path", - "description": "ID of the project that owns the trigger.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", - "path": "v1/projects/{projectId}/triggers/{triggerId}", - "id": "cloudbuild.projects.triggers.patch" - } - } + "bucket": { + "description": "Google Cloud Storage bucket containing source (see\n[Bucket Name\nRequirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).", + "type": "string" + }, + "object": { + "description": "Google Cloud Storage object containing source.\n\nThis object must be a gzipped archive file (.tar.gz) containing source to\nbuild.", + "type": "string" } - } - } - }, - "parameters": { - "quotaUser": { - "location": "query", - "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.", - "type": "string" + }, + "id": "StorageSource" }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "Results": { + "description": "Results describes the artifacts created by the build pipeline.", + "type": "object", + "properties": { + "buildStepImages": { + "description": "List of build step digests, in order corresponding to build step indices.", + "items": { + "type": "string" + }, + "type": "array" + }, + "images": { + "description": "Images that were built as a part of the build.", + "items": { + "$ref": "BuiltImage" + }, + "type": "array" + } + }, + "id": "Results" }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "alt": { - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" - } - }, - "version": "v1", - "baseUrl": "https://cloudbuild.googleapis.com/", - "description": "Builds container images in the cloud.", - "kind": "discovery#restDescription", - "servicePath": "", - "basePath": "", - "revision": "20170522", - "documentationLink": "https://cloud.google.com/container-builder/docs/", - "id": "cloudbuild:v1", - "discoveryVersion": "v1", - "version_module": "True", - "schemas": { "BuildOperationMetadata": { "description": "Metadata for build operations.", "type": "object", @@ -506,6 +351,13 @@ "description": "Provenance of the source. Ways to find the original source, or verify that\nsome source was used for this build.", "type": "object", "properties": { + "fileHashes": { + "additionalProperties": { + "$ref": "FileHashes" + }, + "description": "Hash(es) of the build source, which can be used to verify that the original\nsource integrity was maintained in the build. Note that FileHashes will\nonly be populated if BuildOptions has requested a SourceProvenanceHash.\n\nThe keys to this map are file paths used as build source and the values\ncontain the hash values for those files.\n\nIf the build source came in a single package such as a gzipped tarfile\n(.tar.gz), the FileHash will be for the single path to that file.\n@OutputOnly", + "type": "object" + }, "resolvedRepoSource": { "$ref": "RepoSource", "description": "A copy of the build's source.repo_source, if exists, with any\nrevisions resolved." @@ -513,13 +365,6 @@ "resolvedStorageSource": { "$ref": "StorageSource", "description": "A copy of the build's source.storage_source, if exists, with any\ngenerations resolved." - }, - "fileHashes": { - "additionalProperties": { - "$ref": "FileHashes" - }, - "description": "Hash(es) of the build source, which can be used to verify that the original\nsource integrity was maintained in the build. Note that FileHashes will\nonly be populated if BuildOptions has requested a SourceProvenanceHash.\n\nThe keys to this map are file paths used as build source and the values\ncontain the hash values for those files.\n\nIf the build source came in a single package such as a gzipped tarfile\n(.tar.gz), the FileHash will be for the single path to that file.\n@OutputOnly", - "type": "object" } }, "id": "SourceProvenance" @@ -531,50 +376,50 @@ "id": "CancelOperationRequest" }, "ListBuildTriggersResponse": { - "id": "ListBuildTriggersResponse", "description": "Response containing existing BuildTriggers.", "type": "object", "properties": { "triggers": { "description": "BuildTriggers for the project, sorted by create_time descending.", - "type": "array", "items": { "$ref": "BuildTrigger" - } + }, + "type": "array" } - } + }, + "id": "ListBuildTriggersResponse" }, "Operation": { "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" }, "response": { - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`." + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" }, "name": { "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", "type": "string" }, "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, "metadata": { - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any." + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" } }, "id": "Operation" @@ -602,34 +447,48 @@ "description": "Optional entrypoint to be used instead of the build step image's default\nIf unset, the image's default will be used.", "type": "string" }, + "secretEnv": { + "description": "A list of environment variables which are encrypted using a Cloud KMS\ncrypto key. These values must be specified in the build's secrets.", + "items": { + "type": "string" + }, + "type": "array" + }, "id": { "description": "Optional unique identifier for this build step, used in wait_for to\nreference this build step as a dependency.", "type": "string" }, + "volumes": { + "description": "List of volumes to mount into the build step.\n\nEach volume will be created as an empty volume prior to execution of the\nbuild step. Upon completion of the build, volumes and their contents will\nbe discarded.\n\nUsing a named volume in only one step is not valid as it is indicative\nof a mis-configured build request.", + "items": { + "$ref": "Volume" + }, + "type": "array" + }, "dir": { "description": "Working directory (relative to project source root) to use when running\nthis operation's container.", "type": "string" }, "waitFor": { "description": "The ID(s) of the step(s) that this build step depends on.\nThis build step will not start until all the build steps in wait_for\nhave completed successfully. If wait_for is empty, this build step will\nstart when all previous build steps in the Build.Steps list have completed\nsuccessfully.", - "type": "array", - "items": { - "type": "string" - } - }, - "env": { - "type": "array", "items": { "type": "string" }, - "description": "A list of environment variable definitions to be used when running a step.\n\nThe elements are of the form \"KEY=VALUE\" for the environment variable \"KEY\"\nbeing given the value \"VALUE\"." + "type": "array" + }, + "env": { + "description": "A list of environment variable definitions to be used when running a step.\n\nThe elements are of the form \"KEY=VALUE\" for the environment variable \"KEY\"\nbeing given the value \"VALUE\".", + "items": { + "type": "string" + }, + "type": "array" }, "args": { "description": "A list of arguments that will be presented to the step when it is started.\n\nIf the image used to run the step's container has an entrypoint, these args\nwill be used as arguments to that entrypoint. If the image does not define\nan entrypoint, the first element in args will be used as the entrypoint,\nand the remainder will be used as arguments.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "name": { "description": "The name of the container image that will run this particular build step.\n\nIf the image is already available in the host's Docker daemon's cache, it\nwill be run directly. If not, the host will attempt to pull the image\nfirst, using the builder service account's credentials if necessary.\n\nThe Docker daemon's cache will already have the latest versions of all of\nthe officially supported build steps\n([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)).\nThe Docker daemon will also have cached many of the layers for some popular\nimages, like \"ubuntu\", \"debian\", but they will be refreshed at the time you\nattempt to use them.\n\nIf you built an image in a previous build step, it will be stored in the\nhost's Docker daemon's cache and is available to use as the name for a\nlater build step.", @@ -639,37 +498,37 @@ "id": "BuildStep" }, "RepoSource": { - "id": "RepoSource", "description": "RepoSource describes the location of the source in a Google Cloud Source\nRepository.", "type": "object", "properties": { - "projectId": { - "description": "ID of the project that owns the repo. If omitted, the project ID requesting\nthe build is assumed.", - "type": "string" - }, - "repoName": { - "type": "string", - "description": "Name of the repo. If omitted, the name \"default\" is assumed." - }, "branchName": { "description": "Name of the branch to build.", "type": "string" }, - "tagName": { - "description": "Name of the tag to build.", + "repoName": { + "description": "Name of the repo. If omitted, the name \"default\" is assumed.", + "type": "string" + }, + "projectId": { + "description": "ID of the project that owns the repo. If omitted, the project ID requesting\nthe build is assumed.", "type": "string" }, "commitSha": { "description": "Explicit commit SHA to build.", "type": "string" + }, + "tagName": { + "description": "Name of the tag to build.", + "type": "string" } - } + }, + "id": "RepoSource" }, "Hash": { + "description": "Container message for hash values.", "type": "object", "properties": { "type": { - "type": "string", "enumDescriptions": [ "No hash requested.", "Use a sha256 hash." @@ -678,357 +537,76 @@ "NONE", "SHA256" ], - "description": "The type of hash that was performed." + "description": "The type of hash that was performed.", + "type": "string" }, "value": { - "description": "The hash value.", "format": "byte", + "description": "The hash value.", "type": "string" } }, - "id": "Hash", - "description": "Container message for hash values." + "id": "Hash" }, "FileHashes": { + "description": "Container message for hashes of byte content of files, used in\nSourceProvenance messages to verify integrity of source input to the build.", + "type": "object", "properties": { "fileHash": { - "type": "array", + "description": "Collection of file hashes.", "items": { "$ref": "Hash" }, - "description": "Collection of file hashes." + "type": "array" } }, - "id": "FileHashes", - "description": "Container message for hashes of byte content of files, used in\nSourceProvenance messages to verify integrity of source input to the build.", - "type": "object" + "id": "FileHashes" }, - "Status": { + "Secret": { + "description": "Secret pairs a set of secret environment variables containing encrypted\nvalues with the Cloud KMS key to use to decrypt the value.", "type": "object", "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client." + "secretEnv": { + "additionalProperties": { + "format": "byte", + "type": "string" + }, + "description": "Map of environment variable name to its encrypted value.\n\nSecret environment variables must be unique across all of a build's\nsecrets, and must be used by at least one build step. Values can be at most\n1 KB in size. There can be at most ten secret values across all of a\nbuild's secrets.", + "type": "object" }, + "kmsKeyName": { + "description": "Cloud KMS key name to use to decrypt these envs.", + "type": "string" + } + }, + "id": "Secret" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { "details": { - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - } + }, + "type": "object" }, - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use." - } - }, - "id": "Status", - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons." - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - }, - "BuildTrigger": { - "description": "Configuration for an automated build in response to source repository\nchanges.", - "type": "object", - "properties": { - "substitutions": { - "additionalProperties": { - "type": "string" - }, - "description": "Substitutions data for Build resource.", - "type": "object" + "type": "array" }, - "description": { - "description": "Human-readable description of this trigger.", - "type": "string" + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" }, - "disabled": { - "description": "If true, the trigger will never result in a build.", - "type": "boolean" - }, - "createTime": { - "type": "string", - "description": "Time when the trigger was created.\n\n@OutputOnly", - "format": "google-datetime" - }, - "triggerTemplate": { - "$ref": "RepoSource", - "description": "Template describing the types of source changes to trigger a build.\n\nBranch and tag names in trigger templates are interpreted as regular\nexpressions. Any branch or tag change that matches that regular expression\nwill trigger a build." - }, - "filename": { - "description": "Path, from the source root, to a file whose contents is used for the\ntemplate.", - "type": "string" - }, - "id": { - "description": "Unique identifier of the trigger.\n\n@OutputOnly", - "type": "string" - }, - "build": { - "$ref": "Build", - "description": "Contents of the build template." - } - }, - "id": "BuildTrigger" - }, - "Build": { - "description": "A build resource in the Container Builder API.\n\nAt a high level, a Build describes where to find source code, how to build\nit (for example, the builder image to run on the source), and what tag to\napply to the built image when it is pushed to Google Container Registry.\n\nFields can include the following variables which will be expanded when the\nbuild is created:\n\n- $PROJECT_ID: the project ID of the build.\n- $BUILD_ID: the autogenerated ID of the build.\n- $REPO_NAME: the source repository name specified by RepoSource.\n- $BRANCH_NAME: the branch name specified by RepoSource.\n- $TAG_NAME: the tag name specified by RepoSource.\n- $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or\n resolved from the specified branch or tag.", - "type": "object", - "properties": { - "logsBucket": { - "description": "Google Cloud Storage bucket where logs should be written (see\n[Bucket Name\nRequirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).\nLogs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.", - "type": "string" - }, - "results": { - "$ref": "Results", - "description": "Results of the build.\n@OutputOnly" - }, - "steps": { - "description": "Describes the operations to be performed on the workspace.", - "type": "array", - "items": { - "$ref": "BuildStep" - } - }, - "buildTriggerId": { - "description": "The ID of the BuildTrigger that triggered this build, if it was\ntriggered automatically.\n@OutputOnly", - "type": "string" - }, - "id": { - "description": "Unique identifier of the build.\n@OutputOnly", - "type": "string" - }, - "tags": { - "description": "Tags for annotation of a Build. These are not docker tags.", - "type": "array", - "items": { - "type": "string" - } - }, - "startTime": { - "description": "Time at which execution of the build was started.\n@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "substitutions": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Substitutions data for Build resource." - }, - "createTime": { - "description": "Time at which the request to create the build was received.\n@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "sourceProvenance": { - "$ref": "SourceProvenance", - "description": "A permanent fixed identifier for source.\n@OutputOnly" - }, - "images": { - "description": "A list of images to be pushed upon the successful completion of all build\nsteps.\n\nThe images will be pushed using the builder service account's credentials.\n\nThe digests of the pushed images will be stored in the Build resource's\nresults field.\n\nIf any of the images fail to be pushed, the build is marked FAILURE.", - "type": "array", - "items": { - "type": "string" - } - }, - "projectId": { - "description": "ID of the project.\n@OutputOnly.", - "type": "string" - }, - "finishTime": { - "description": "Time at which execution of the build was finished.\n\nThe difference between finish_time and start_time is the duration of the\nbuild's execution.\n@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "logUrl": { - "description": "URL to logs for this build in Google Cloud Logging.\n@OutputOnly", - "type": "string" - }, - "source": { - "$ref": "Source", - "description": "Describes where to find the source files to build." - }, - "options": { - "description": "Special options for this build.", - "$ref": "BuildOptions" - }, - "statusDetail": { - "description": "Customer-readable message about the current status.\n@OutputOnly", - "type": "string" - }, - "status": { - "type": "string", - "enumDescriptions": [ - "Status of the build is unknown.", - "Build is queued; work has not yet begun.", - "Build is being executed.", - "Build finished successfully.", - "Build failed to complete successfully.", - "Build failed due to an internal cause.", - "Build took longer than was allowed.", - "Build was canceled by a user." - ], - "enum": [ - "STATUS_UNKNOWN", - "QUEUED", - "WORKING", - "SUCCESS", - "FAILURE", - "INTERNAL_ERROR", - "TIMEOUT", - "CANCELLED" - ], - "description": "Status of the build.\n@OutputOnly" - }, - "timeout": { - "description": "Amount of time that this build should be allowed to run, to second\ngranularity. If this amount of time elapses, work on the build will cease\nand the build status will be TIMEOUT.\n\nDefault time is ten minutes.", - "format": "google-duration", + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", "type": "string" } }, - "id": "Build" - }, - "CancelBuildRequest": { - "description": "Request to cancel an ongoing build.", - "type": "object", - "properties": {}, - "id": "CancelBuildRequest" - }, - "ListBuildsResponse": { - "id": "ListBuildsResponse", - "description": "Response including listed builds.", - "type": "object", - "properties": { - "builds": { - "description": "Builds will be sorted by create_time, descending.", - "type": "array", - "items": { - "$ref": "Build" - } - }, - "nextPageToken": { - "description": "Token to receive the next page of results.", - "type": "string" - } - } - }, - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Operation" - } - } - }, - "id": "ListOperationsResponse" - }, - "Source": { - "description": "Source describes the location of the source in a supported storage\nservice.", - "type": "object", - "properties": { - "repoSource": { - "$ref": "RepoSource", - "description": "If provided, get source from this location in a Cloud Repo." - }, - "storageSource": { - "description": "If provided, get the source from this location in in Google Cloud\nStorage.", - "$ref": "StorageSource" - } - }, - "id": "Source" - }, - "BuildOptions": { - "description": "Optional arguments to enable specific features of builds.", - "type": "object", - "properties": { - "requestedVerifyOption": { - "type": "string", - "enumDescriptions": [ - "Not a verifiable build. (default)", - "Verified build." - ], - "enum": [ - "NOT_VERIFIED", - "VERIFIED" - ], - "description": "Requested verifiability options." - }, - "sourceProvenanceHash": { - "enumDescriptions": [ - "No hash requested.", - "Use a sha256 hash." - ], - "description": "Requested hash for SourceProvenance.", - "type": "array", - "items": { - "enum": [ - "NONE", - "SHA256" - ], - "type": "string" - } - } - }, - "id": "BuildOptions" - }, - "StorageSource": { - "description": "StorageSource describes the location of the source in an archive file in\nGoogle Cloud Storage.", - "type": "object", - "properties": { - "bucket": { - "description": "Google Cloud Storage bucket containing source (see\n[Bucket Name\nRequirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).", - "type": "string" - }, - "object": { - "description": "Google Cloud Storage object containing source.\n\nThis object must be a gzipped archive file (.tar.gz) containing source to\nbuild.", - "type": "string" - }, - "generation": { - "description": "Google Cloud Storage generation for the object. If the generation is\nomitted, the latest generation will be used.", - "format": "int64", - "type": "string" - } - }, - "id": "StorageSource" - }, - "Results": { - "description": "Results describes the artifacts created by the build pipeline.", - "type": "object", - "properties": { - "images": { - "description": "Images that were built as a part of the build.", - "type": "array", - "items": { - "$ref": "BuiltImage" - } - }, - "buildStepImages": { - "description": "List of build step digests, in order corresponding to build step indices.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "Results" + "id": "Status" } }, "icons": { @@ -1050,5 +628,494 @@ "ownerDomain": "google.com", "name": "cloudbuild", "batchPath": "batch", - "title": "Google Cloud Container Builder API" + "title": "Google Cloud Container Builder API", + "ownerName": "Google", + "resources": { + "operations": { + "methods": { + "cancel": { + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "type": "string", + "required": true, + "pattern": "^operations/.+$" + } + }, + "flatPath": "v1/operations/{operationsId}:cancel", + "id": "cloudbuild.operations.cancel", + "path": "v1/{+name}:cancel" + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^operations/.+$" + } + }, + "flatPath": "v1/operations/{operationsId}", + "id": "cloudbuild.operations.get", + "path": "v1/{+name}" + }, + "list": { + "flatPath": "v1/operations", + "id": "cloudbuild.operations.list", + "path": "v1/{+name}", + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true, + "pattern": "^operations$", + "location": "path" + } + } + } + } + }, + "projects": { + "resources": { + "builds": { + "methods": { + "list": { + "description": "Lists previously requested builds.\n\nPreviously requested builds may still be in-progress, or may have finished\nsuccessfully or unsuccessfully.", + "httpMethod": "GET", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListBuildsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageSize": { + "format": "int32", + "description": "Number of results to return in the list.", + "type": "integer", + "location": "query" + }, + "projectId": { + "description": "ID of the project.", + "type": "string", + "required": true, + "location": "path" + }, + "filter": { + "location": "query", + "description": "The raw filter text to constrain the results.", + "type": "string" + }, + "pageToken": { + "description": "Token to provide to skip to a particular spot in the list.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectId}/builds", + "path": "v1/projects/{projectId}/builds", + "id": "cloudbuild.projects.builds.list" + }, + "get": { + "flatPath": "v1/projects/{projectId}/builds/{id}", + "id": "cloudbuild.projects.builds.get", + "path": "v1/projects/{projectId}/builds/{id}", + "description": "Returns information about a previously requested build.\n\nThe Build that is returned includes its status (e.g., success or failure,\nor in-progress), and timing information.", + "response": { + "$ref": "Build" + }, + "parameterOrder": [ + "projectId", + "id" + ], + "httpMethod": "GET", + "parameters": { + "projectId": { + "location": "path", + "description": "ID of the project.", + "type": "string", + "required": true + }, + "id": { + "description": "ID of the build.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "request": { + "$ref": "Build" + }, + "description": "Starts a build with the specified configuration.\n\nThe long-running Operation returned by this method will include the ID of\nthe build, which can be passed to GetBuild to determine its status (e.g.,\nsuccess or failure).", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "ID of the project.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/builds", + "id": "cloudbuild.projects.builds.create", + "path": "v1/projects/{projectId}/builds" + }, + "cancel": { + "description": "Cancels a requested build in progress.", + "request": { + "$ref": "CancelBuildRequest" + }, + "response": { + "$ref": "Build" + }, + "parameterOrder": [ + "projectId", + "id" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "ID of the project.", + "type": "string", + "required": true, + "location": "path" + }, + "id": { + "description": "ID of the build.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/builds/{id}:cancel", + "id": "cloudbuild.projects.builds.cancel", + "path": "v1/projects/{projectId}/builds/{id}:cancel" + } + } + }, + "triggers": { + "methods": { + "patch": { + "request": { + "$ref": "BuildTrigger" + }, + "description": "Updates an BuildTrigger by its project ID and trigger ID.\n\nThis API is experimental.", + "response": { + "$ref": "BuildTrigger" + }, + "parameterOrder": [ + "projectId", + "triggerId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "triggerId": { + "description": "ID of the BuildTrigger to update.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "ID of the project that owns the trigger.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", + "id": "cloudbuild.projects.triggers.patch", + "path": "v1/projects/{projectId}/triggers/{triggerId}" + }, + "list": { + "description": "Lists existing BuildTrigger.\n\nThis API is experimental.", + "httpMethod": "GET", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListBuildTriggersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "ID of the project for which to list BuildTriggers.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/triggers", + "path": "v1/projects/{projectId}/triggers", + "id": "cloudbuild.projects.triggers.list" + }, + "get": { + "description": "Gets information about a BuildTrigger.\n\nThis API is experimental.", + "response": { + "$ref": "BuildTrigger" + }, + "parameterOrder": [ + "projectId", + "triggerId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "triggerId": { + "description": "ID of the BuildTrigger to get.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "ID of the project that owns the trigger.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", + "id": "cloudbuild.projects.triggers.get", + "path": "v1/projects/{projectId}/triggers/{triggerId}" + }, + "create": { + "request": { + "$ref": "BuildTrigger" + }, + "description": "Creates a new BuildTrigger.\n\nThis API is experimental.", + "response": { + "$ref": "BuildTrigger" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "ID of the project for which to configure automatic builds.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/triggers", + "id": "cloudbuild.projects.triggers.create", + "path": "v1/projects/{projectId}/triggers" + }, + "delete": { + "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", + "id": "cloudbuild.projects.triggers.delete", + "path": "v1/projects/{projectId}/triggers/{triggerId}", + "description": "Deletes an BuildTrigger by its project ID and trigger ID.\n\nThis API is experimental.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId", + "triggerId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "triggerId": { + "description": "ID of the BuildTrigger to delete.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "ID of the project that owns the trigger.", + "type": "string", + "required": true + } + } + } + } + } + } + } + }, + "parameters": { + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + } + }, + "version": "v1", + "baseUrl": "https://cloudbuild.googleapis.com/", + "servicePath": "", + "description": "Builds container images in the cloud.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170926", + "documentationLink": "https://cloud.google.com/container-builder/docs/", + "id": "cloudbuild:v1" } diff --git a/etc/api/clouddebugger/v2/clouddebugger-api.json b/etc/api/clouddebugger/v2/clouddebugger-api.json index b3d1326122..e534a8b4bf 100644 --- a/etc/api/clouddebugger/v2/clouddebugger-api.json +++ b/etc/api/clouddebugger/v2/clouddebugger-api.json @@ -1,466 +1,560 @@ { - "resources": { - "debugger": { - "resources": { - "debuggees": { - "methods": { - "list": { - "description": "Lists all the debuggees that the user can set breakpoints to.", - "response": { - "$ref": "ListDebuggeesResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "includeInactive": { - "description": "When set to `true`, the result includes all debuggees. Otherwise, the\nresult includes only debuggees that are active.", - "type": "boolean", - "location": "query" - }, - "project": { - "location": "query", - "description": "Project number of a Google Cloud project whose debuggees to list.", - "type": "string" - }, - "clientVersion": { - "location": "query", - "description": "The client version making the call.\nFollowing: `domain/type/version` (e.g., `google.com/intellij/v1`).", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "flatPath": "v2/debugger/debuggees", - "path": "v2/debugger/debuggees", - "id": "clouddebugger.debugger.debuggees.list" - } - }, - "resources": { - "breakpoints": { - "methods": { - "set": { - "response": { - "$ref": "SetBreakpointResponse" - }, - "parameterOrder": [ - "debuggeeId" - ], - "httpMethod": "POST", - "parameters": { - "clientVersion": { - "description": "The client version making the call.\nFollowing: `domain/type/version` (e.g., `google.com/intellij/v1`).", - "type": "string", - "location": "query" - }, - "debuggeeId": { - "description": "ID of the debuggee where the breakpoint is to be set.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", - "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", - "id": "clouddebugger.debugger.debuggees.breakpoints.set", - "request": { - "$ref": "Breakpoint" - }, - "description": "Sets the breakpoint to the debuggee." - }, - "delete": { - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "debuggeeId", - "breakpointId" - ], - "parameters": { - "breakpointId": { - "description": "ID of the breakpoint to delete.", - "required": true, - "type": "string", - "location": "path" - }, - "debuggeeId": { - "location": "path", - "description": "ID of the debuggee whose breakpoint to delete.", - "required": true, - "type": "string" - }, - "clientVersion": { - "location": "query", - "description": "The client version making the call.\nFollowing: `domain/type/version` (e.g., `google.com/intellij/v1`).", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", - "id": "clouddebugger.debugger.debuggees.breakpoints.delete", - "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", - "description": "Deletes the breakpoint from the debuggee." - }, - "get": { - "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", - "id": "clouddebugger.debugger.debuggees.breakpoints.get", - "description": "Gets breakpoint information.", - "response": { - "$ref": "GetBreakpointResponse" - }, - "parameterOrder": [ - "debuggeeId", - "breakpointId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "parameters": { - "breakpointId": { - "description": "ID of the breakpoint to get.", - "required": true, - "type": "string", - "location": "path" - }, - "debuggeeId": { - "location": "path", - "description": "ID of the debuggee whose breakpoint to get.", - "required": true, - "type": "string" - }, - "clientVersion": { - "description": "The client version making the call.\nFollowing: `domain/type/version` (e.g., `google.com/intellij/v1`).", - "type": "string", - "location": "query" - } - }, - "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}" - }, - "list": { - "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints", - "id": "clouddebugger.debugger.debuggees.breakpoints.list", - "description": "Lists all breakpoints for the debuggee.", - "response": { - "$ref": "ListBreakpointsResponse" - }, - "parameterOrder": [ - "debuggeeId" - ], - "httpMethod": "GET", - "parameters": { - "debuggeeId": { - "description": "ID of the debuggee whose breakpoints to list.", - "required": true, - "type": "string", - "location": "path" - }, - "waitToken": { - "description": "A wait token that, if specified, blocks the call until the breakpoints\nlist has changed, or a server selected timeout has expired. The value\nshould be set from the last response. The error code\n`google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which\nshould be called again with the same `wait_token`.", - "type": "string", - "location": "query" - }, - "clientVersion": { - "location": "query", - "description": "The client version making the call.\nFollowing: `domain/type/version` (e.g., `google.com/intellij/v1`).", - "type": "string" - }, - "action.value": { - "location": "query", - "enum": [ - "CAPTURE", - "LOG" - ], - "description": "Only breakpoints with the specified action will pass the filter.", - "type": "string" - }, - "includeAllUsers": { - "description": "When set to `true`, the response includes the list of breakpoints set by\nany user. Otherwise, it includes only breakpoints set by the caller.", - "type": "boolean", - "location": "query" - }, - "includeInactive": { - "description": "When set to `true`, the response includes active and inactive\nbreakpoints. Otherwise, it includes only active breakpoints.", - "type": "boolean", - "location": "query" - }, - "stripResults": { - "location": "query", - "description": "This field is deprecated. The following fields are always stripped out of\nthe result: `stack_frames`, `evaluated_expressions` and `variable_table`.", - "type": "boolean" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints" - } - } - } - } - } - } - }, - "controller": { - "resources": { - "debuggees": { - "methods": { - "register": { - "response": { - "$ref": "RegisterDebuggeeResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "parameters": {}, - "flatPath": "v2/controller/debuggees/register", - "path": "v2/controller/debuggees/register", - "id": "clouddebugger.controller.debuggees.register", - "description": "Registers the debuggee with the controller service.\n\nAll agents attached to the same application should call this method with\nthe same request content to get back the same stable `debuggee_id`. Agents\nshould call this method again whenever `google.rpc.Code.NOT_FOUND` is\nreturned from any controller method.\n\nThis allows the controller service to disable the agent or recover from any\ndata loss. If the debuggee is disabled by the server, the response will\nhave `is_disabled` set to `true`.", - "request": { - "$ref": "RegisterDebuggeeRequest" - } - } - }, - "resources": { - "breakpoints": { - "methods": { - "update": { - "description": "Updates the breakpoint state or mutable fields.\nThe entire Breakpoint message must be sent back to the controller\nservice.\n\nUpdates to active breakpoint fields are only allowed if the new value\ndoes not change the breakpoint specification. Updates to the `location`,\n`condition` and `expression` fields should not alter the breakpoint\nsemantics. These may only make changes such as canonicalizing a value\nor snapping the location to the correct line of code.", - "request": { - "$ref": "UpdateActiveBreakpointRequest" - }, - "response": { - "$ref": "UpdateActiveBreakpointResponse" - }, - "parameterOrder": [ - "debuggeeId", - "id" - ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "parameters": { - "debuggeeId": { - "location": "path", - "description": "Identifies the debuggee being debugged.", - "required": true, - "type": "string" - }, - "id": { - "location": "path", - "description": "Breakpoint identifier, unique in the scope of the debuggee.", - "required": true, - "type": "string" - } - }, - "flatPath": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", - "path": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", - "id": "clouddebugger.controller.debuggees.breakpoints.update" - }, - "list": { - "description": "Returns the list of all active breakpoints for the debuggee.\n\nThe breakpoint specification (location, condition, and expression\nfields) is semantically immutable, although the field values may\nchange. For example, an agent may update the location line number\nto reflect the actual line where the breakpoint was set, but this\ndoesn't change the breakpoint semantics.\n\nThis means that an agent does not need to check if a breakpoint has changed\nwhen it encounters the same breakpoint on a successive call.\nMoreover, an agent should remember the breakpoints that are completed\nuntil the controller removes them from the active list to avoid\nsetting those breakpoints again.", - "response": { - "$ref": "ListActiveBreakpointsResponse" - }, - "parameterOrder": [ - "debuggeeId" - ], - "httpMethod": "GET", - "parameters": { - "waitToken": { - "location": "query", - "description": "A wait token that, if specified, blocks the method call until the list\nof active breakpoints has changed, or a server selected timeout has\nexpired. The value should be set from the last returned response.", - "type": "string" - }, - "debuggeeId": { - "description": "Identifies the debuggee.", - "required": true, - "type": "string", - "location": "path" - }, - "successOnTimeout": { - "description": "If set to `true`, returns `google.rpc.Code.OK` status and sets the\n`wait_expired` response field to `true` when the server-selected timeout\nhas expired (recommended).\n\nIf set to `false`, returns `google.rpc.Code.ABORTED` status when the\nserver-selected timeout has expired (deprecated).", - "type": "boolean", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud_debugger" - ], - "flatPath": "v2/controller/debuggees/{debuggeeId}/breakpoints", - "path": "v2/controller/debuggees/{debuggeeId}/breakpoints", - "id": "clouddebugger.controller.debuggees.breakpoints.list" - } - } - } - } - } - } - } - }, - "parameters": { - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - } - }, "version": "v2", "baseUrl": "https://clouddebugger.googleapis.com/", - "servicePath": "", - "description": "Examines the call stack and variables of a running application without stopping or slowing it down.\n", "kind": "discovery#restDescription", + "description": "Examines the call stack and variables of a running application without stopping or slowing it down.\n", + "servicePath": "", "basePath": "", "id": "clouddebugger:v2", "documentationLink": "http://cloud.google.com/debugger", - "revision": "20170413", + "revision": "20170919", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "SourceContext": { + "GitSourceContext": { + "type": "object", "properties": { - "git": { - "description": "A SourceContext referring to any third party Git repo (e.g. GitHub).", - "$ref": "GitSourceContext" + "revisionId": { + "type": "string", + "description": "Git commit hash.\nrequired." }, - "gerrit": { - "$ref": "GerritSourceContext", - "description": "A SourceContext referring to a Gerrit project." + "url": { + "type": "string", + "description": "Git repository URL." + } + }, + "id": "GitSourceContext", + "description": "A GitSourceContext denotes a particular revision in a third party Git\nrepository (e.g. GitHub)." + }, + "Variable": { + "description": "Represents a variable or an argument possibly of a compound object type.\nNote how the following variables are represented:\n\n1) A simple variable:\n\n int x = 5\n\n { name: \"x\", value: \"5\", type: \"int\" } // Captured variable\n\n2) A compound object:\n\n struct T {\n int m1;\n int m2;\n };\n T x = { 3, 7 };\n\n { // Captured variable\n name: \"x\",\n type: \"T\",\n members { name: \"m1\", value: \"3\", type: \"int\" },\n members { name: \"m2\", value: \"7\", type: \"int\" }\n }\n\n3) A pointer where the pointee was captured:\n\n T x = { 3, 7 };\n T* p = &x;\n\n { // Captured variable\n name: \"p\",\n type: \"T*\",\n value: \"0x00500500\",\n members { name: \"m1\", value: \"3\", type: \"int\" },\n members { name: \"m2\", value: \"7\", type: \"int\" }\n }\n\n4) A pointer where the pointee was not captured:\n\n T* p = new T;\n\n { // Captured variable\n name: \"p\",\n type: \"T*\",\n value: \"0x00400400\"\n status { is_error: true, description { format: \"unavailable\" } }\n }\n\nThe status should describe the reason for the missing value,\nsuch as `\u003coptimized out\u003e`, `\u003cinaccessible\u003e`, `\u003cpointers limit reached\u003e`.\n\nNote that a null pointer should not have members.\n\n5) An unnamed value:\n\n int* p = new int(7);\n\n { // Captured variable\n name: \"p\",\n value: \"0x00500500\",\n type: \"int*\",\n members { value: \"7\", type: \"int\" } }\n\n6) An unnamed pointer where the pointee was not captured:\n\n int* p = new int(7);\n int** pp = &p;\n\n { // Captured variable\n name: \"pp\",\n value: \"0x00500500\",\n type: \"int**\",\n members {\n value: \"0x00400400\",\n type: \"int*\"\n status {\n is_error: true,\n description: { format: \"unavailable\" } }\n }\n }\n }\n\nTo optimize computation, memory and network traffic, variables that\nrepeat in the output multiple times can be stored once in a shared\nvariable table and be referenced using the `var_table_index` field. The\nvariables stored in the shared table are nameless and are essentially\na partition of the complete variable. To reconstruct the complete\nvariable, merge the referencing variable with the referenced variable.\n\nWhen using the shared variable table, the following variables:\n\n T x = { 3, 7 };\n T* p = &x;\n T& r = x;\n\n { name: \"x\", var_table_index: 3, type: \"T\" } // Captured variables\n { name: \"p\", value \"0x00500500\", type=\"T*\", var_table_index: 3 }\n { name: \"r\", type=\"T&\", var_table_index: 3 }\n\n { // Shared variable table entry #3:\n members { name: \"m1\", value: \"3\", type: \"int\" },\n members { name: \"m2\", value: \"7\", type: \"int\" }\n }\n\nNote that the pointer address is stored with the referencing variable\nand not with the referenced variable. This allows the referenced variable\nto be shared between pointers and references.\n\nThe type field is optional. The debugger agent may or may not support it.", + "type": "object", + "properties": { + "members": { + "description": "Members contained or pointed to by the variable.", + "items": { + "$ref": "Variable" + }, + "type": "array" + }, + "status": { + "$ref": "StatusMessage", + "description": "Status associated with the variable. This field will usually stay\nunset. A status of a single variable only applies to that variable or\nexpression. The rest of breakpoint data still remains valid. Variables\nmight be reported in error state even when breakpoint is not in final\nstate.\n\nThe message may refer to variable name with `refers_to` set to\n`VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`.\nIn either case variable value and members will be unset.\n\nExample of error message applied to name: `Invalid expression syntax`.\n\nExample of information message applied to value: `Not captured`.\n\nExamples of error message applied to value:\n\n* `Malformed string`,\n* `Field f not found in class C`\n* `Null pointer dereference`" + }, + "name": { + "description": "Name of the variable, if any.", + "type": "string" + }, + "type": { + "description": "Variable type (e.g. `MyClass`). If the variable is split with\n`var_table_index`, `type` goes next to `value`. The interpretation of\na type is agent specific. It is recommended to include the dynamic type\nrather than a static type of an object.", + "type": "string" + }, + "varTableIndex": { + "type": "integer", + "format": "int32", + "description": "Reference to a variable in the shared variable table. More than\none variable can reference the same variable in the table. The\n`var_table_index` field is an index into `variable_table` in Breakpoint." + }, + "value": { + "description": "Simple value of the variable.", + "type": "string" + } + }, + "id": "Variable" + }, + "StackFrame": { + "type": "object", + "properties": { + "location": { + "$ref": "SourceLocation", + "description": "Source location of the call site." + }, + "function": { + "description": "Demangled function name at the call site.", + "type": "string" + }, + "arguments": { + "description": "Set of arguments passed to this function.\nNote that this might not be populated for all stack frames.", + "items": { + "$ref": "Variable" + }, + "type": "array" + }, + "locals": { + "items": { + "$ref": "Variable" + }, + "type": "array", + "description": "Set of local variables at the stack frame location.\nNote that this might not be populated for all stack frames." + } + }, + "id": "StackFrame", + "description": "Represents a stack frame context." + }, + "RepoId": { + "type": "object", + "properties": { + "projectRepoId": { + "$ref": "ProjectRepoId", + "description": "A combination of a project ID and a repo name." + }, + "uid": { + "type": "string", + "description": "A server-assigned, globally unique identifier." + } + }, + "id": "RepoId", + "description": "A unique identifier for a cloud repo." + }, + "FormatMessage": { + "description": "Represents a message with parameters.", + "type": "object", + "properties": { + "parameters": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Optional parameters to be embedded into the message." + }, + "format": { + "description": "Format template for the message. The `format` uses placeholders `$0`,\n`$1`, etc. to reference parameters. `$$` can be used to denote the `$`\ncharacter.\n\nExamples:\n\n* `Failed to load '$0' which helps debug $1 the first time it\n is loaded. Again, $0 is very important.`\n* `Please pay $$10 to use $0 instead of $1.`", + "type": "string" + } + }, + "id": "FormatMessage" + }, + "ExtendedSourceContext": { + "description": "An ExtendedSourceContext is a SourceContext combined with additional\ndetails describing the context.", + "type": "object", + "properties": { + "context": { + "$ref": "SourceContext", + "description": "Any source context." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels with user defined metadata.", + "type": "object" + } + }, + "id": "ExtendedSourceContext" + }, + "AliasContext": { + "description": "An alias to a repo revision.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The alias name." + }, + "kind": { + "enum": [ + "ANY", + "FIXED", + "MOVABLE", + "OTHER" + ], + "description": "The alias kind.", + "type": "string", + "enumDescriptions": [ + "Do not use.", + "Git tag", + "Git branch", + "OTHER is used to specify non-standard aliases, those not of the kinds\nabove. For example, if a Git repo has a ref named \"refs/foo/bar\", it\nis considered to be of kind OTHER." + ] + } + }, + "id": "AliasContext" + }, + "ListDebuggeesResponse": { + "type": "object", + "properties": { + "debuggees": { + "description": "List of debuggees accessible to the calling user.\nThe fields `debuggee.id` and `description` are guaranteed to be set.\nThe `description` field is a human readable field provided by agents and\ncan be displayed to users.", + "items": { + "$ref": "Debuggee" + }, + "type": "array" + } + }, + "id": "ListDebuggeesResponse", + "description": "Response for listing debuggees." + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "SourceLocation": { + "description": "Represents a location in the source code.", + "type": "object", + "properties": { + "line": { + "format": "int32", + "description": "Line inside the file. The first line in the file has the value `1`.", + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the source file within the source context of the target binary." + } + }, + "id": "SourceLocation" + }, + "Debuggee": { + "type": "object", + "properties": { + "uniquifier": { + "type": "string", + "description": "Uniquifier to further distiguish the application.\nIt is possible that different applications might have identical values in\nthe debuggee message, thus, incorrectly identified as a single application\nby the Controller service. This field adds salt to further distiguish the\napplication. Agents should consider seeding this field with value that\nidentifies the code, binary, configuration and environment." + }, + "description": { + "type": "string", + "description": "Human readable description of the debuggee.\nIncluding a human-readable project name, environment name and version\ninformation is recommended." + }, + "sourceContexts": { + "items": { + "$ref": "SourceContext" + }, + "type": "array", + "description": "References to the locations and revisions of the source code used in the\ndeployed application." + }, + "extSourceContexts": { + "items": { + "$ref": "ExtendedSourceContext" + }, + "type": "array", + "description": "References to the locations and revisions of the source code used in the\ndeployed application.\n\nNOTE: this field is experimental and can be ignored." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "A set of custom debuggee properties, populated by the agent, to be\ndisplayed to the user.", + "type": "object" + }, + "status": { + "$ref": "StatusMessage", + "description": "Human readable message to be displayed to the user about this debuggee.\nAbsence of this field indicates no status. The message can be either\ninformational or an error status." + }, + "isInactive": { + "description": "If set to `true`, indicates that Controller service does not detect any\nactivity from the debuggee agents and the application is possibly stopped.", + "type": "boolean" + }, + "project": { + "type": "string", + "description": "Project the debuggee is associated with.\nUse project number or id when registering a Google Cloud Platform project." + }, + "isDisabled": { + "description": "If set to `true`, indicates that the agent should disable itself and\ndetach from the debuggee.", + "type": "boolean" + }, + "agentVersion": { + "type": "string", + "description": "Version ID of the agent.\nSchema: `domain/language-platform/vmajor.minor` (for example\n`google.com/java-gcp/v1.1`)." + }, + "id": { + "description": "Unique identifier for the debuggee generated by the controller service.", + "type": "string" + } + }, + "id": "Debuggee", + "description": "Represents the debugged application. The application may include one or more\nreplicated processes executing the same code. Each of these processes is\nattached with a debugger agent, carrying out the debugging commands.\nAgents attached to the same debuggee identify themselves as such by using\nexactly the same Debuggee message value when registering." + }, + "ListActiveBreakpointsResponse": { + "type": "object", + "properties": { + "breakpoints": { + "items": { + "$ref": "Breakpoint" + }, + "type": "array", + "description": "List of all active breakpoints.\nThe fields `id` and `location` are guaranteed to be set on each breakpoint." + }, + "waitExpired": { + "type": "boolean", + "description": "If set to `true`, indicates that there is no change to the\nlist of active breakpoints and the server-selected timeout has expired.\nThe `breakpoints` field would be empty and should be ignored." + }, + "nextWaitToken": { + "type": "string", + "description": "A token that can be used in the next method call to block until\nthe list of breakpoints changes." + } + }, + "id": "ListActiveBreakpointsResponse", + "description": "Response for listing active breakpoints." + }, + "ProjectRepoId": { + "description": "Selects a repo using a Google Cloud Platform project ID\n(e.g. winged-cargo-31) and a repo name within that project.", + "type": "object", + "properties": { + "repoName": { + "description": "The name of the repo. Leave empty for the default repo.", + "type": "string" + }, + "projectId": { + "type": "string", + "description": "The ID of the project." + } + }, + "id": "ProjectRepoId" + }, + "CloudWorkspaceSourceContext": { + "description": "A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.", + "type": "object", + "properties": { + "workspaceId": { + "$ref": "CloudWorkspaceId", + "description": "The ID of the workspace." + }, + "snapshotId": { + "type": "string", + "description": "The ID of the snapshot.\nAn empty snapshot_id refers to the most recent snapshot." + } + }, + "id": "CloudWorkspaceSourceContext" + }, + "GerritSourceContext": { + "description": "A SourceContext referring to a Gerrit project.", + "type": "object", + "properties": { + "aliasContext": { + "$ref": "AliasContext", + "description": "An alias, which may be a branch or tag." + }, + "gerritProject": { + "type": "string", + "description": "The full project name within the host. Projects may be nested, so\n\"project/subproject\" is a valid project name.\nThe \"repo name\" is hostURI/project." + }, + "revisionId": { + "description": "A revision (commit) ID.", + "type": "string" + }, + "hostUri": { + "type": "string", + "description": "The URI of a running Gerrit instance." + }, + "aliasName": { + "description": "The name of an alias (branch, tag, etc.).", + "type": "string" + } + }, + "id": "GerritSourceContext" + }, + "UpdateActiveBreakpointResponse": { + "type": "object", + "properties": {}, + "id": "UpdateActiveBreakpointResponse", + "description": "Response for updating an active breakpoint.\nThe message is defined to allow future extensions." + }, + "CloudWorkspaceId": { + "type": "object", + "properties": { + "repoId": { + "$ref": "RepoId", + "description": "The ID of the repo containing the workspace." + }, + "name": { + "type": "string", + "description": "The unique name of the workspace within the repo. This is the name\nchosen by the client in the Source API's CreateWorkspace method." + } + }, + "id": "CloudWorkspaceId", + "description": "A CloudWorkspaceId is a unique identifier for a cloud workspace.\nA cloud workspace is a place associated with a repo where modified files\ncan be stored before they are committed." + }, + "ListBreakpointsResponse": { + "description": "Response for listing breakpoints.", + "type": "object", + "properties": { + "breakpoints": { + "description": "List of breakpoints matching the request.\nThe fields `id` and `location` are guaranteed to be set on each breakpoint.\nThe fields: `stack_frames`, `evaluated_expressions` and `variable_table`\nare cleared on each breakpoint regardless of its status.", + "items": { + "$ref": "Breakpoint" + }, + "type": "array" + }, + "nextWaitToken": { + "description": "A wait token that can be used in the next call to `list` (REST) or\n`ListBreakpoints` (RPC) to block until the list of breakpoints has changes.", + "type": "string" + } + }, + "id": "ListBreakpointsResponse" + }, + "Breakpoint": { + "type": "object", + "properties": { + "status": { + "$ref": "StatusMessage", + "description": "Breakpoint status.\n\nThe status includes an error flag and a human readable message.\nThis field is usually unset. The message can be either\ninformational or an error message. Regardless, clients should always\ndisplay the text message back to the user.\n\nError status indicates complete failure of the breakpoint.\n\nExample (non-final state): `Still loading symbols...`\n\nExamples (final state):\n\n* `Invalid line number` referring to location\n* `Field f not found in class C` referring to condition" + }, + "userEmail": { + "description": "E-mail address of the user that created this breakpoint", + "type": "string" + }, + "action": { + "type": "string", + "enumDescriptions": [ + "Capture stack frame and variables and update the breakpoint.\nThe data is only captured once. After that the breakpoint is set\nin a final state.", + "Log each breakpoint hit. The breakpoint remains active until\ndeleted or expired." + ], + "enum": [ + "CAPTURE", + "LOG" + ], + "description": "Action that the agent should perform when the code at the\nbreakpoint location is hit." + }, + "logLevel": { + "type": "string", + "enumDescriptions": [ + "Information log message.", + "Warning log message.", + "Error log message." + ], + "enum": [ + "INFO", + "WARNING", + "ERROR" + ], + "description": "Indicates the severity of the log. Only relevant when action is `LOG`." + }, + "id": { + "type": "string", + "description": "Breakpoint identifier, unique in the scope of the debuggee." + }, + "location": { + "$ref": "SourceLocation", + "description": "Breakpoint source location." + }, + "finalTime": { + "format": "google-datetime", + "description": "Time this breakpoint was finalized as seen by the server in seconds\nresolution.", + "type": "string" + }, + "variableTable": { + "description": "The `variable_table` exists to aid with computation, memory and network\ntraffic optimization. It enables storing a variable once and reference\nit from multiple variables, including variables stored in the\n`variable_table` itself.\nFor example, the same `this` object, which may appear at many levels of\nthe stack, can have all of its data stored once in this table. The\nstack frame variables then would hold only a reference to it.\n\nThe variable `var_table_index` field is an index into this repeated field.\nThe stored objects are nameless and get their name from the referencing\nvariable. The effective variable is a merge of the referencing variable\nand the referenced variable.", + "items": { + "$ref": "Variable" + }, + "type": "array" + }, + "logMessageFormat": { + "type": "string", + "description": "Only relevant when action is `LOG`. Defines the message to log when\nthe breakpoint hits. The message may include parameter placeholders `$0`,\n`$1`, etc. These placeholders are replaced with the evaluated value\nof the appropriate expression. Expressions not referenced in\n`log_message_format` are not logged.\n\nExample: `Message received, id = $0, count = $1` with\n`expressions` = `[ message.id, message.count ]`." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "A set of custom breakpoint properties, populated by the agent, to be\ndisplayed to the user.", + "type": "object" + }, + "createTime": { + "type": "string", + "format": "google-datetime", + "description": "Time this breakpoint was created by the server in seconds resolution." + }, + "expressions": { + "items": { + "type": "string" + }, + "type": "array", + "description": "List of read-only expressions to evaluate at the breakpoint location.\nThe expressions are composed using expressions in the programming language\nat the source location. If the breakpoint action is `LOG`, the evaluated\nexpressions are included in log statements." + }, + "evaluatedExpressions": { + "items": { + "$ref": "Variable" + }, + "type": "array", + "description": "Values of evaluated expressions at breakpoint time.\nThe evaluated expressions appear in exactly the same order they\nare listed in the `expressions` field.\nThe `name` field holds the original expression text, the `value` or\n`members` field holds the result of the evaluated expression.\nIf the expression cannot be evaluated, the `status` inside the `Variable`\nwill indicate an error and contain the error text." + }, + "isFinalState": { + "type": "boolean", + "description": "When true, indicates that this is a final result and the\nbreakpoint state will not change from here on." + }, + "stackFrames": { + "items": { + "$ref": "StackFrame" + }, + "type": "array", + "description": "The stack at breakpoint time." + }, + "condition": { + "type": "string", + "description": "Condition that triggers the breakpoint.\nThe condition is a compound boolean expression composed using expressions\nin a programming language at the source location." + } + }, + "id": "Breakpoint", + "description": "Represents the breakpoint specification, status and results." + }, + "SetBreakpointResponse": { + "type": "object", + "properties": { + "breakpoint": { + "$ref": "Breakpoint", + "description": "Breakpoint resource.\nThe field `id` is guaranteed to be set (in addition to the echoed fileds)." + } + }, + "id": "SetBreakpointResponse", + "description": "Response for setting a breakpoint." + }, + "UpdateActiveBreakpointRequest": { + "type": "object", + "properties": { + "breakpoint": { + "$ref": "Breakpoint", + "description": "Updated breakpoint information.\nThe field `id` must be set.\nThe agent must echo all Breakpoint specification fields in the update." + } + }, + "id": "UpdateActiveBreakpointRequest", + "description": "Request to update an active breakpoint." + }, + "SourceContext": { + "type": "object", + "properties": { + "cloudWorkspace": { + "$ref": "CloudWorkspaceSourceContext", + "description": "A SourceContext referring to a snapshot in a cloud workspace." }, "cloudRepo": { "$ref": "CloudRepoSourceContext", "description": "A SourceContext referring to a revision in a cloud repo." }, - "cloudWorkspace": { - "$ref": "CloudWorkspaceSourceContext", - "description": "A SourceContext referring to a snapshot in a cloud workspace." + "git": { + "$ref": "GitSourceContext", + "description": "A SourceContext referring to any third party Git repo (e.g. GitHub)." + }, + "gerrit": { + "$ref": "GerritSourceContext", + "description": "A SourceContext referring to a Gerrit project." } }, "id": "SourceContext", - "description": "A SourceContext is a reference to a tree of files. A SourceContext together\nwith a path point to a unique revision of a single file or directory.", - "type": "object" + "description": "A SourceContext is a reference to a tree of files. A SourceContext together\nwith a path point to a unique revision of a single file or directory." }, "CloudRepoSourceContext": { + "description": "A CloudRepoSourceContext denotes a particular revision in a cloud\nrepo (a repo hosted by the Google Cloud Platform).", + "type": "object", "properties": { + "repoId": { + "$ref": "RepoId", + "description": "The ID of the repo." + }, "aliasContext": { - "description": "An alias, which may be a branch or tag.", - "$ref": "AliasContext" + "$ref": "AliasContext", + "description": "An alias, which may be a branch or tag." }, "revisionId": { - "description": "A revision ID.", - "type": "string" + "type": "string", + "description": "A revision ID." }, "aliasName": { - "description": "The name of an alias (branch, tag, etc.).", - "type": "string" - }, - "repoId": { - "description": "The ID of the repo.", - "$ref": "RepoId" + "type": "string", + "description": "The name of an alias (branch, tag, etc.)." } }, - "id": "CloudRepoSourceContext", - "description": "A CloudRepoSourceContext denotes a particular revision in a cloud\nrepo (a repo hosted by the Google Cloud Platform).", - "type": "object" + "id": "CloudRepoSourceContext" }, "RegisterDebuggeeResponse": { "description": "Response for registering a debuggee.", @@ -468,7 +562,7 @@ "properties": { "debuggee": { "$ref": "Debuggee", - "description": "Debuggee resource.\nThe field `id` is guranteed to be set (in addition to the echoed fields)." + "description": "Debuggee resource.\nThe field `id` is guranteed to be set (in addition to the echoed fields).\nIf the field `is_disabled` is set to `true`, the agent should disable\nitself by removing all breakpoints and detaching from the application.\nIt should however continue to poll `RegisterDebuggee` until reenabled." } }, "id": "RegisterDebuggeeResponse" @@ -485,37 +579,21 @@ "id": "RegisterDebuggeeRequest" }, "GetBreakpointResponse": { + "description": "Response for getting breakpoint information.", + "type": "object", "properties": { "breakpoint": { "$ref": "Breakpoint", "description": "Complete breakpoint state.\nThe fields `id` and `location` are guaranteed to be set." } }, - "id": "GetBreakpointResponse", - "description": "Response for getting breakpoint information.", - "type": "object" + "id": "GetBreakpointResponse" }, "StatusMessage": { + "description": "Represents a contextual status message.\nThe message can indicate an error or informational status, and refer to\nspecific parts of the containing object.\nFor example, the `Breakpoint.status` field can indicate an error referring\nto the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`.", + "type": "object", "properties": { - "isError": { - "description": "Distinguishes errors from informational messages.", - "type": "boolean" - }, - "description": { - "$ref": "FormatMessage", - "description": "Status message text." - }, "refersTo": { - "enum": [ - "UNSPECIFIED", - "BREAKPOINT_SOURCE_LOCATION", - "BREAKPOINT_CONDITION", - "BREAKPOINT_EXPRESSION", - "BREAKPOINT_AGE", - "VARIABLE_NAME", - "VARIABLE_VALUE" - ], - "description": "Reference to which the message applies.", "type": "string", "enumDescriptions": [ "Status doesn't refer to any particular input.", @@ -525,516 +603,33 @@ "Status applies to the breakpoint and is related to its age.", "Status applies to the entire variable.", "Status applies to variable value (variable name is valid)." - ] - } - }, - "id": "StatusMessage", - "description": "Represents a contextual status message.\nThe message can indicate an error or informational status, and refer to\nspecific parts of the containing object.\nFor example, the `Breakpoint.status` field can indicate an error referring\nto the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`.", - "type": "object" - }, - "GitSourceContext": { - "description": "A GitSourceContext denotes a particular revision in a third party Git\nrepository (e.g. GitHub).", - "type": "object", - "properties": { - "revisionId": { - "description": "Git commit hash.\nrequired.", - "type": "string" - }, - "url": { - "description": "Git repository URL.", - "type": "string" - } - }, - "id": "GitSourceContext" - }, - "Variable": { - "description": "Represents a variable or an argument possibly of a compound object type.\nNote how the following variables are represented:\n\n1) A simple variable:\n\n int x = 5\n\n { name: \"x\", value: \"5\", type: \"int\" } // Captured variable\n\n2) A compound object:\n\n struct T {\n int m1;\n int m2;\n };\n T x = { 3, 7 };\n\n { // Captured variable\n name: \"x\",\n type: \"T\",\n members { name: \"m1\", value: \"3\", type: \"int\" },\n members { name: \"m2\", value: \"7\", type: \"int\" }\n }\n\n3) A pointer where the pointee was captured:\n\n T x = { 3, 7 };\n T* p = &x;\n\n { // Captured variable\n name: \"p\",\n type: \"T*\",\n value: \"0x00500500\",\n members { name: \"m1\", value: \"3\", type: \"int\" },\n members { name: \"m2\", value: \"7\", type: \"int\" }\n }\n\n4) A pointer where the pointee was not captured:\n\n T* p = new T;\n\n { // Captured variable\n name: \"p\",\n type: \"T*\",\n value: \"0x00400400\"\n status { is_error: true, description { format: \"unavailable\" } }\n }\n\nThe status should describe the reason for the missing value,\nsuch as `\u003coptimized out\u003e`, `\u003cinaccessible\u003e`, `\u003cpointers limit reached\u003e`.\n\nNote that a null pointer should not have members.\n\n5) An unnamed value:\n\n int* p = new int(7);\n\n { // Captured variable\n name: \"p\",\n value: \"0x00500500\",\n type: \"int*\",\n members { value: \"7\", type: \"int\" } }\n\n6) An unnamed pointer where the pointee was not captured:\n\n int* p = new int(7);\n int** pp = &p;\n\n { // Captured variable\n name: \"pp\",\n value: \"0x00500500\",\n type: \"int**\",\n members {\n value: \"0x00400400\",\n type: \"int*\"\n status {\n is_error: true,\n description: { format: \"unavailable\" } }\n }\n }\n }\n\nTo optimize computation, memory and network traffic, variables that\nrepeat in the output multiple times can be stored once in a shared\nvariable table and be referenced using the `var_table_index` field. The\nvariables stored in the shared table are nameless and are essentially\na partition of the complete variable. To reconstruct the complete\nvariable, merge the referencing variable with the referenced variable.\n\nWhen using the shared variable table, the following variables:\n\n T x = { 3, 7 };\n T* p = &x;\n T& r = x;\n\n { name: \"x\", var_table_index: 3, type: \"T\" } // Captured variables\n { name: \"p\", value \"0x00500500\", type=\"T*\", var_table_index: 3 }\n { name: \"r\", type=\"T&\", var_table_index: 3 }\n\n { // Shared variable table entry #3:\n members { name: \"m1\", value: \"3\", type: \"int\" },\n members { name: \"m2\", value: \"7\", type: \"int\" }\n }\n\nNote that the pointer address is stored with the referencing variable\nand not with the referenced variable. This allows the referenced variable\nto be shared between pointers and references.\n\nThe type field is optional. The debugger agent may or may not support it.", - "type": "object", - "properties": { - "name": { - "description": "Name of the variable, if any.", - "type": "string" - }, - "type": { - "description": "Variable type (e.g. `MyClass`). If the variable is split with\n`var_table_index`, `type` goes next to `value`. The interpretation of\na type is agent specific. It is recommended to include the dynamic type\nrather than a static type of an object.", - "type": "string" - }, - "varTableIndex": { - "description": "Reference to a variable in the shared variable table. More than\none variable can reference the same variable in the table. The\n`var_table_index` field is an index into `variable_table` in Breakpoint.", - "format": "int32", - "type": "integer" - }, - "value": { - "description": "Simple value of the variable.", - "type": "string" - }, - "members": { - "description": "Members contained or pointed to by the variable.", - "type": "array", - "items": { - "$ref": "Variable" - } - }, - "status": { - "$ref": "StatusMessage", - "description": "Status associated with the variable. This field will usually stay\nunset. A status of a single variable only applies to that variable or\nexpression. The rest of breakpoint data still remains valid. Variables\nmight be reported in error state even when breakpoint is not in final\nstate.\n\nThe message may refer to variable name with `refers_to` set to\n`VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`.\nIn either case variable value and members will be unset.\n\nExample of error message applied to name: `Invalid expression syntax`.\n\nExample of information message applied to value: `Not captured`.\n\nExamples of error message applied to value:\n\n* `Malformed string`,\n* `Field f not found in class C`\n* `Null pointer dereference`" - } - }, - "id": "Variable" - }, - "StackFrame": { - "properties": { - "function": { - "description": "Demangled function name at the call site.", - "type": "string" - }, - "arguments": { - "description": "Set of arguments passed to this function.\nNote that this might not be populated for all stack frames.", - "type": "array", - "items": { - "$ref": "Variable" - } - }, - "locals": { - "description": "Set of local variables at the stack frame location.\nNote that this might not be populated for all stack frames.", - "type": "array", - "items": { - "$ref": "Variable" - } - }, - "location": { - "description": "Source location of the call site.", - "$ref": "SourceLocation" - } - }, - "id": "StackFrame", - "description": "Represents a stack frame context.", - "type": "object" - }, - "RepoId": { - "description": "A unique identifier for a cloud repo.", - "type": "object", - "properties": { - "projectRepoId": { - "$ref": "ProjectRepoId", - "description": "A combination of a project ID and a repo name." - }, - "uid": { - "description": "A server-assigned, globally unique identifier.", - "type": "string" - } - }, - "id": "RepoId" - }, - "FormatMessage": { - "description": "Represents a message with parameters.", - "type": "object", - "properties": { - "parameters": { - "description": "Optional parameters to be embedded into the message.", - "type": "array", - "items": { - "type": "string" - } - }, - "format": { - "description": "Format template for the message. The `format` uses placeholders `$0`,\n`$1`, etc. to reference parameters. `$$` can be used to denote the `$`\ncharacter.\n\nExamples:\n\n* `Failed to load '$0' which helps debug $1 the first time it\n is loaded. Again, $0 is very important.`\n* `Please pay $$10 to use $0 instead of $1.`", - "type": "string" - } - }, - "id": "FormatMessage" - }, - "ExtendedSourceContext": { - "properties": { - "context": { - "description": "Any source context.", - "$ref": "SourceContext" - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Labels with user defined metadata.", - "type": "object" - } - }, - "id": "ExtendedSourceContext", - "description": "An ExtendedSourceContext is a SourceContext combined with additional\ndetails describing the context.", - "type": "object" - }, - "AliasContext": { - "properties": { - "name": { - "description": "The alias name.", - "type": "string" - }, - "kind": { - "enumDescriptions": [ - "Do not use.", - "Git tag", - "Git branch", - "OTHER is used to specify non-standard aliases, those not of the kinds\nabove. For example, if a Git repo has a ref named \"refs/foo/bar\", it\nis considered to be of kind OTHER." ], "enum": [ - "ANY", - "FIXED", - "MOVABLE", - "OTHER" + "UNSPECIFIED", + "BREAKPOINT_SOURCE_LOCATION", + "BREAKPOINT_CONDITION", + "BREAKPOINT_EXPRESSION", + "BREAKPOINT_AGE", + "VARIABLE_NAME", + "VARIABLE_VALUE" ], - "description": "The alias kind.", - "type": "string" - } - }, - "id": "AliasContext", - "description": "An alias to a repo revision.", - "type": "object" - }, - "ListDebuggeesResponse": { - "properties": { - "debuggees": { - "description": "List of debuggees accessible to the calling user.\nNote that the `description` field is the only human readable field\nthat should be displayed to the user.\nThe fields `debuggee.id` and `description` fields are guaranteed to be\nset on each debuggee.", - "type": "array", - "items": { - "$ref": "Debuggee" - } - } - }, - "id": "ListDebuggeesResponse", - "description": "Response for listing debuggees.", - "type": "object" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - }, - "SourceLocation": { - "description": "Represents a location in the source code.", - "type": "object", - "properties": { - "path": { - "description": "Path to the source file within the source context of the target binary.", - "type": "string" - }, - "line": { - "description": "Line inside the file. The first line in the file has the value `1`.", - "format": "int32", - "type": "integer" - } - }, - "id": "SourceLocation" - }, - "Debuggee": { - "properties": { - "extSourceContexts": { - "description": "References to the locations and revisions of the source code used in the\ndeployed application.\n\nContexts describing a remote repo related to the source code\nhave a `category` label of `remote_repo`. Source snapshot source\ncontexts have a `category` of `snapshot`.", - "type": "array", - "items": { - "$ref": "ExtendedSourceContext" - } - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "A set of custom debuggee properties, populated by the agent, to be\ndisplayed to the user.", - "type": "object" - }, - "status": { - "$ref": "StatusMessage", - "description": "Human readable message to be displayed to the user about this debuggee.\nAbsence of this field indicates no status. The message can be either\ninformational or an error status." - }, - "isInactive": { - "description": "If set to `true`, indicates that the debuggee is considered as inactive by\nthe Controller service.", - "type": "boolean" - }, - "project": { - "description": "Project the debuggee is associated with.\nUse the project number when registering a Google Cloud Platform project.", - "type": "string" - }, - "agentVersion": { - "description": "Version ID of the agent release. The version ID is structured as\nfollowing: `domain/type/vmajor.minor` (for example\n`google.com/gcp-java/v1.1`).", - "type": "string" - }, - "isDisabled": { - "description": "If set to `true`, indicates that the agent should disable itself and\ndetach from the debuggee.", - "type": "boolean" - }, - "id": { - "description": "Unique identifier for the debuggee generated by the controller service.", - "type": "string" - }, - "uniquifier": { - "description": "Debuggee uniquifier within the project.\nAny string that identifies the application within the project can be used.\nIncluding environment and version or build IDs is recommended.", - "type": "string" + "description": "Reference to which the message applies." }, "description": { - "description": "Human readable description of the debuggee.\nIncluding a human-readable project name, environment name and version\ninformation is recommended.", - "type": "string" + "$ref": "FormatMessage", + "description": "Status message text." }, - "sourceContexts": { - "description": "References to the locations and revisions of the source code used in the\ndeployed application.\n\nNOTE: This field is deprecated. Consumers should use\n`ext_source_contexts` if it is not empty. Debug agents should populate\nboth this field and `ext_source_contexts`.", - "type": "array", - "items": { - "$ref": "SourceContext" - } + "isError": { + "type": "boolean", + "description": "Distinguishes errors from informational messages." } }, - "id": "Debuggee", - "description": "Represents the application to debug. The application may include one or more\nreplicated processes executing the same code. Each of these processes is\nattached with a debugger agent, carrying out the debugging commands.\nThe agents attached to the same debuggee are identified by using exactly the\nsame field values when registering.", - "type": "object" - }, - "ProjectRepoId": { - "properties": { - "projectId": { - "description": "The ID of the project.", - "type": "string" - }, - "repoName": { - "description": "The name of the repo. Leave empty for the default repo.", - "type": "string" - } - }, - "id": "ProjectRepoId", - "description": "Selects a repo using a Google Cloud Platform project ID\n(e.g. winged-cargo-31) and a repo name within that project.", - "type": "object" - }, - "ListActiveBreakpointsResponse": { - "properties": { - "breakpoints": { - "description": "List of all active breakpoints.\nThe fields `id` and `location` are guaranteed to be set on each breakpoint.", - "type": "array", - "items": { - "$ref": "Breakpoint" - } - }, - "waitExpired": { - "description": "The `wait_expired` field is set to true by the server when the\nrequest times out and the field `success_on_timeout` is set to true.", - "type": "boolean" - }, - "nextWaitToken": { - "description": "A wait token that can be used in the next method call to block until\nthe list of breakpoints changes.", - "type": "string" - } - }, - "id": "ListActiveBreakpointsResponse", - "description": "Response for listing active breakpoints.", - "type": "object" - }, - "CloudWorkspaceSourceContext": { - "description": "A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.", - "type": "object", - "properties": { - "snapshotId": { - "description": "The ID of the snapshot.\nAn empty snapshot_id refers to the most recent snapshot.", - "type": "string" - }, - "workspaceId": { - "description": "The ID of the workspace.", - "$ref": "CloudWorkspaceId" - } - }, - "id": "CloudWorkspaceSourceContext" - }, - "UpdateActiveBreakpointResponse": { - "description": "Response for updating an active breakpoint.\nThe message is defined to allow future extensions.", - "type": "object", - "properties": {}, - "id": "UpdateActiveBreakpointResponse" - }, - "GerritSourceContext": { - "properties": { - "gerritProject": { - "description": "The full project name within the host. Projects may be nested, so\n\"project/subproject\" is a valid project name.\nThe \"repo name\" is hostURI/project.", - "type": "string" - }, - "aliasContext": { - "$ref": "AliasContext", - "description": "An alias, which may be a branch or tag." - }, - "hostUri": { - "description": "The URI of a running Gerrit instance.", - "type": "string" - }, - "revisionId": { - "description": "A revision (commit) ID.", - "type": "string" - }, - "aliasName": { - "description": "The name of an alias (branch, tag, etc.).", - "type": "string" - } - }, - "id": "GerritSourceContext", - "description": "A SourceContext referring to a Gerrit project.", - "type": "object" - }, - "CloudWorkspaceId": { - "description": "A CloudWorkspaceId is a unique identifier for a cloud workspace.\nA cloud workspace is a place associated with a repo where modified files\ncan be stored before they are committed.", - "type": "object", - "properties": { - "repoId": { - "description": "The ID of the repo containing the workspace.", - "$ref": "RepoId" - }, - "name": { - "description": "The unique name of the workspace within the repo. This is the name\nchosen by the client in the Source API's CreateWorkspace method.", - "type": "string" - } - }, - "id": "CloudWorkspaceId" - }, - "ListBreakpointsResponse": { - "description": "Response for listing breakpoints.", - "type": "object", - "properties": { - "breakpoints": { - "description": "List of breakpoints matching the request.\nThe fields `id` and `location` are guaranteed to be set on each breakpoint.\nThe fields: `stack_frames`, `evaluated_expressions` and `variable_table`\nare cleared on each breakpoint regardless of it's status.", - "type": "array", - "items": { - "$ref": "Breakpoint" - } - }, - "nextWaitToken": { - "description": "A wait token that can be used in the next call to `list` (REST) or\n`ListBreakpoints` (RPC) to block until the list of breakpoints has changes.", - "type": "string" - } - }, - "id": "ListBreakpointsResponse" - }, - "Breakpoint": { - "properties": { - "userEmail": { - "description": "E-mail address of the user that created this breakpoint", - "type": "string" - }, - "action": { - "enumDescriptions": [ - "Capture stack frame and variables and update the breakpoint.\nThe data is only captured once. After that the breakpoint is set\nin a final state.", - "Log each breakpoint hit. The breakpoint remains active until\ndeleted or expired." - ], - "enum": [ - "CAPTURE", - "LOG" - ], - "description": "Action that the agent should perform when the code at the\nbreakpoint location is hit.", - "type": "string" - }, - "logLevel": { - "enumDescriptions": [ - "Information log message.", - "Warning log message.", - "Error log message." - ], - "enum": [ - "INFO", - "WARNING", - "ERROR" - ], - "description": "Indicates the severity of the log. Only relevant when action is `LOG`.", - "type": "string" - }, - "id": { - "description": "Breakpoint identifier, unique in the scope of the debuggee.", - "type": "string" - }, - "location": { - "description": "Breakpoint source location.", - "$ref": "SourceLocation" - }, - "finalTime": { - "description": "Time this breakpoint was finalized as seen by the server in seconds\nresolution.", - "format": "google-datetime", - "type": "string" - }, - "variableTable": { - "description": "The `variable_table` exists to aid with computation, memory and network\ntraffic optimization. It enables storing a variable once and reference\nit from multiple variables, including variables stored in the\n`variable_table` itself.\nFor example, the same `this` object, which may appear at many levels of\nthe stack, can have all of its data stored once in this table. The\nstack frame variables then would hold only a reference to it.\n\nThe variable `var_table_index` field is an index into this repeated field.\nThe stored objects are nameless and get their name from the referencing\nvariable. The effective variable is a merge of the referencing variable\nand the referenced variable.", - "type": "array", - "items": { - "$ref": "Variable" - } - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "A set of custom breakpoint properties, populated by the agent, to be\ndisplayed to the user.", - "type": "object" - }, - "createTime": { - "description": "Time this breakpoint was created by the server in seconds resolution.", - "format": "google-datetime", - "type": "string" - }, - "logMessageFormat": { - "description": "Only relevant when action is `LOG`. Defines the message to log when\nthe breakpoint hits. The message may include parameter placeholders `$0`,\n`$1`, etc. These placeholders are replaced with the evaluated value\nof the appropriate expression. Expressions not referenced in\n`log_message_format` are not logged.\n\nExample: `Message received, id = $0, count = $1` with\n`expressions` = `[ message.id, message.count ]`.", - "type": "string" - }, - "expressions": { - "description": "List of read-only expressions to evaluate at the breakpoint location.\nThe expressions are composed using expressions in the programming language\nat the source location. If the breakpoint action is `LOG`, the evaluated\nexpressions are included in log statements.", - "type": "array", - "items": { - "type": "string" - } - }, - "evaluatedExpressions": { - "description": "Values of evaluated expressions at breakpoint time.\nThe evaluated expressions appear in exactly the same order they\nare listed in the `expressions` field.\nThe `name` field holds the original expression text, the `value` or\n`members` field holds the result of the evaluated expression.\nIf the expression cannot be evaluated, the `status` inside the `Variable`\nwill indicate an error and contain the error text.", - "type": "array", - "items": { - "$ref": "Variable" - } - }, - "isFinalState": { - "description": "When true, indicates that this is a final result and the\nbreakpoint state will not change from here on.", - "type": "boolean" - }, - "stackFrames": { - "description": "The stack at breakpoint time.", - "type": "array", - "items": { - "$ref": "StackFrame" - } - }, - "condition": { - "description": "Condition that triggers the breakpoint.\nThe condition is a compound boolean expression composed using expressions\nin a programming language at the source location.", - "type": "string" - }, - "status": { - "$ref": "StatusMessage", - "description": "Breakpoint status.\n\nThe status includes an error flag and a human readable message.\nThis field is usually unset. The message can be either\ninformational or an error message. Regardless, clients should always\ndisplay the text message back to the user.\n\nError status indicates complete failure of the breakpoint.\n\nExample (non-final state): `Still loading symbols...`\n\nExamples (final state):\n\n* `Invalid line number` referring to location\n* `Field f not found in class C` referring to condition" - } - }, - "id": "Breakpoint", - "description": "Represents the breakpoint specification, status and results.", - "type": "object" - }, - "SetBreakpointResponse": { - "properties": { - "breakpoint": { - "$ref": "Breakpoint", - "description": "Breakpoint resource.\nThe field `id` is guaranteed to be set (in addition to the echoed fileds)." - } - }, - "id": "SetBreakpointResponse", - "description": "Response for setting a breakpoint.", - "type": "object" - }, - "UpdateActiveBreakpointRequest": { - "description": "Request to update an active breakpoint.", - "type": "object", - "properties": { - "breakpoint": { - "description": "Updated breakpoint information.\nThe field 'id' must be set.", - "$ref": "Breakpoint" - } - }, - "id": "UpdateActiveBreakpointRequest" + "id": "StatusMessage" } }, "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "protocol": "rest", "canonicalName": "Cloud Debugger", @@ -1055,5 +650,410 @@ "name": "clouddebugger", "batchPath": "batch", "title": "Stackdriver Debugger API", - "ownerName": "Google" + "ownerName": "Google", + "resources": { + "controller": { + "resources": { + "debuggees": { + "methods": { + "register": { + "response": { + "$ref": "RegisterDebuggeeResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "parameters": {}, + "flatPath": "v2/controller/debuggees/register", + "id": "clouddebugger.controller.debuggees.register", + "path": "v2/controller/debuggees/register", + "request": { + "$ref": "RegisterDebuggeeRequest" + }, + "description": "Registers the debuggee with the controller service.\n\nAll agents attached to the same application must call this method with\nexactly the same request content to get back the same stable `debuggee_id`.\nAgents should call this method again whenever `google.rpc.Code.NOT_FOUND`\nis returned from any controller method.\n\nThis protocol allows the controller service to disable debuggees, recover\nfrom data loss, or change the `debuggee_id` format. Agents must handle\n`debuggee_id` value changing upon re-registration." + } + }, + "resources": { + "breakpoints": { + "methods": { + "list": { + "description": "Returns the list of all active breakpoints for the debuggee.\n\nThe breakpoint specification (`location`, `condition`, and `expressions`\nfields) is semantically immutable, although the field values may\nchange. For example, an agent may update the location line number\nto reflect the actual line where the breakpoint was set, but this\ndoesn't change the breakpoint semantics.\n\nThis means that an agent does not need to check if a breakpoint has changed\nwhen it encounters the same breakpoint on a successive call.\nMoreover, an agent should remember the breakpoints that are completed\nuntil the controller removes them from the active list to avoid\nsetting those breakpoints again.", + "response": { + "$ref": "ListActiveBreakpointsResponse" + }, + "parameterOrder": [ + "debuggeeId" + ], + "httpMethod": "GET", + "parameters": { + "successOnTimeout": { + "type": "boolean", + "location": "query", + "description": "If set to `true` (recommended), returns `google.rpc.Code.OK` status and\nsets the `wait_expired` response field to `true` when the server-selected\ntimeout has expired.\n\nIf set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status\nwhen the server-selected timeout has expired." + }, + "debuggeeId": { + "location": "path", + "description": "Identifies the debuggee.", + "type": "string", + "required": true + }, + "waitToken": { + "type": "string", + "location": "query", + "description": "A token that, if specified, blocks the method call until the list\nof active breakpoints has changed, or a server-selected timeout has\nexpired. The value should be set from the `next_wait_token` field in\nthe last response. The initial value should be set to `\"init\"`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "flatPath": "v2/controller/debuggees/{debuggeeId}/breakpoints", + "id": "clouddebugger.controller.debuggees.breakpoints.list", + "path": "v2/controller/debuggees/{debuggeeId}/breakpoints" + }, + "update": { + "request": { + "$ref": "UpdateActiveBreakpointRequest" + }, + "description": "Updates the breakpoint state or mutable fields.\nThe entire Breakpoint message must be sent back to the controller service.\n\nUpdates to active breakpoint fields are only allowed if the new value\ndoes not change the breakpoint specification. Updates to the `location`,\n`condition` and `expressions` fields should not alter the breakpoint\nsemantics. These may only make changes such as canonicalizing a value\nor snapping the location to the correct line of code.", + "response": { + "$ref": "UpdateActiveBreakpointResponse" + }, + "parameterOrder": [ + "debuggeeId", + "id" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "parameters": { + "debuggeeId": { + "location": "path", + "description": "Identifies the debuggee being debugged.", + "type": "string", + "required": true + }, + "id": { + "location": "path", + "description": "Breakpoint identifier, unique in the scope of the debuggee.", + "type": "string", + "required": true + } + }, + "flatPath": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", + "id": "clouddebugger.controller.debuggees.breakpoints.update", + "path": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}" + } + } + } + } + } + } + }, + "debugger": { + "resources": { + "debuggees": { + "methods": { + "list": { + "description": "Lists all the debuggees that the user has access to.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListDebuggeesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "parameters": { + "project": { + "location": "query", + "description": "Project number of a Google Cloud project whose debuggees to list.", + "type": "string" + }, + "clientVersion": { + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`).", + "type": "string" + }, + "includeInactive": { + "type": "boolean", + "location": "query", + "description": "When set to `true`, the result includes all debuggees. Otherwise, the\nresult includes only debuggees that are active." + } + }, + "flatPath": "v2/debugger/debuggees", + "path": "v2/debugger/debuggees", + "id": "clouddebugger.debugger.debuggees.list" + } + }, + "resources": { + "breakpoints": { + "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "debuggeeId", + "breakpointId" + ], + "httpMethod": "DELETE", + "parameters": { + "clientVersion": { + "type": "string", + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`)." + }, + "breakpointId": { + "location": "path", + "description": "ID of the breakpoint to delete.", + "type": "string", + "required": true + }, + "debuggeeId": { + "location": "path", + "description": "ID of the debuggee whose breakpoint to delete.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "id": "clouddebugger.debugger.debuggees.breakpoints.delete", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "description": "Deletes the breakpoint from the debuggee." + }, + "set": { + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", + "id": "clouddebugger.debugger.debuggees.breakpoints.set", + "request": { + "$ref": "Breakpoint" + }, + "description": "Sets the breakpoint to the debuggee.", + "httpMethod": "POST", + "parameterOrder": [ + "debuggeeId" + ], + "response": { + "$ref": "SetBreakpointResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "parameters": { + "clientVersion": { + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`).", + "type": "string" + }, + "debuggeeId": { + "location": "path", + "description": "ID of the debuggee where the breakpoint is to be set.", + "type": "string", + "required": true + } + } + }, + "list": { + "description": "Lists all breakpoints for the debuggee.", + "httpMethod": "GET", + "parameterOrder": [ + "debuggeeId" + ], + "response": { + "$ref": "ListBreakpointsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "parameters": { + "clientVersion": { + "type": "string", + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`)." + }, + "action.value": { + "location": "query", + "enum": [ + "CAPTURE", + "LOG" + ], + "description": "Only breakpoints with the specified action will pass the filter.", + "type": "string" + }, + "includeAllUsers": { + "type": "boolean", + "location": "query", + "description": "When set to `true`, the response includes the list of breakpoints set by\nany user. Otherwise, it includes only breakpoints set by the caller." + }, + "includeInactive": { + "type": "boolean", + "location": "query", + "description": "When set to `true`, the response includes active and inactive\nbreakpoints. Otherwise, it includes only active breakpoints." + }, + "stripResults": { + "type": "boolean", + "location": "query", + "description": "This field is deprecated. The following fields are always stripped out of\nthe result: `stack_frames`, `evaluated_expressions` and `variable_table`." + }, + "debuggeeId": { + "location": "path", + "description": "ID of the debuggee whose breakpoints to list.", + "type": "string", + "required": true + }, + "waitToken": { + "type": "string", + "location": "query", + "description": "A wait token that, if specified, blocks the call until the breakpoints\nlist has changed, or a server selected timeout has expired. The value\nshould be set from the last response. The error code\n`google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which\nshould be called again with the same `wait_token`." + } + }, + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints", + "id": "clouddebugger.debugger.debuggees.breakpoints.list" + }, + "get": { + "response": { + "$ref": "GetBreakpointResponse" + }, + "parameterOrder": [ + "debuggeeId", + "breakpointId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "parameters": { + "clientVersion": { + "type": "string", + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`)." + }, + "breakpointId": { + "type": "string", + "required": true, + "location": "path", + "description": "ID of the breakpoint to get." + }, + "debuggeeId": { + "location": "path", + "description": "ID of the debuggee whose breakpoint to get.", + "type": "string", + "required": true + } + }, + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "id": "clouddebugger.debugger.debuggees.breakpoints.get", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "description": "Gets breakpoint information." + } + } + } + } + } + } + } + }, + "parameters": { + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "upload_protocol": { + "type": "string", + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + }, + "prettyPrint": { + "default": "true", + "type": "boolean", + "location": "query", + "description": "Returns response with indentations and line breaks." + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "uploadType": { + "type": "string", + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "alt": { + "location": "query", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ] + }, + "key": { + "type": "string", + "location": "query", + "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." + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "quotaUser": { + "type": "string", + "location": "query", + "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." + } + } } diff --git a/etc/api/clouddebugger/v2/crates/1.0.6-api+20170919 b/etc/api/clouddebugger/v2/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/clouddebugger/v2/crates/1.0.6-cli+20170919 b/etc/api/clouddebugger/v2/crates/1.0.6-cli+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json b/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json index 8db9cdb2f1..6d2f95fc81 100644 --- a/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json +++ b/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json @@ -1,4 +1,349 @@ { + "version": "v1beta1", + "baseUrl": "https://clouderrorreporting.googleapis.com/", + "servicePath": "", + "description": "Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors.\n", + "kind": "discovery#restDescription", + "basePath": "", + "documentationLink": "https://cloud.google.com/error-reporting/", + "revision": "20170914", + "id": "clouderrorreporting:v1beta1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ErrorGroup": { + "type": "object", + "properties": { + "name": { + "description": "The group resource name.\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-groupid\u003c/code\u003e", + "type": "string" + }, + "trackingIssues": { + "description": "Associated tracking issues.", + "items": { + "$ref": "TrackingIssue" + }, + "type": "array" + }, + "groupId": { + "description": "Group IDs are unique for a given project. If the same kind of error\noccurs in different service contexts, it will receive the same group ID.", + "type": "string" + } + }, + "id": "ErrorGroup", + "description": "Description of a group of similar error events." + }, + "ServiceContext": { + "description": "Describes a running service that sends errors.\nIts version changes over time and multiple versions can run in parallel.", + "type": "object", + "properties": { + "service": { + "description": "An identifier of the service, such as the name of the\nexecutable, job, or Google App Engine service name. This field is expected\nto have a low number of values that are relatively stable over time, as\nopposed to `version`, which can be changed whenever new code is deployed.\n\nContains the service name for error reports extracted from Google\nApp Engine logs or `default` if the App Engine default service is used.", + "type": "string" + }, + "resourceType": { + "type": "string", + "description": "Type of the MonitoredResource. List of possible values:\nhttps://cloud.google.com/monitoring/api/resources\n\nValue is set automatically for incoming errors and must not be set when\nreporting errors." + }, + "version": { + "description": "Represents the source code version that the developer provided,\nwhich could represent a version label or a Git SHA-1 hash, for example.\nFor App Engine standard environment, the version is set to the version of\nthe app.", + "type": "string" + } + }, + "id": "ServiceContext" + }, + "SourceLocation": { + "id": "SourceLocation", + "description": "Indicates a location in the source code of the service for which errors are\nreported. `functionName` must be provided by the application when reporting\nan error, unless the error report contains a `message` with a supported\nexception stack trace. All fields are optional for the later case.", + "type": "object", + "properties": { + "functionName": { + "description": "Human-readable name of a function or method.\nThe value can include optional context like the class or package name.\nFor example, `my.package.MyClass.method` in case of Java.", + "type": "string" + }, + "filePath": { + "description": "The source code filename, which can include a truncated relative\npath, or a full path from a production machine.", + "type": "string" + }, + "lineNumber": { + "format": "int32", + "description": "1-based. 0 indicates that the line number is unknown.", + "type": "integer" + } + } + }, + "ReportErrorEventResponse": { + "description": "Response for reporting an individual error event.\nData may be added to this message in the future.", + "type": "object", + "properties": {}, + "id": "ReportErrorEventResponse" + }, + "HttpRequestContext": { + "description": "HTTP request data that is related to a reported error.\nThis data should be provided by the application when reporting an error,\nunless the\nerror report has been generated automatically from Google App Engine logs.", + "type": "object", + "properties": { + "method": { + "description": "The type of HTTP request, such as `GET`, `POST`, etc.", + "type": "string" + }, + "remoteIp": { + "description": "The IP address from which the request originated.\nThis can be IPv4, IPv6, or a token which is derived from the\nIP address, depending on the data that has been provided\nin the error report.", + "type": "string" + }, + "referrer": { + "description": "The referrer information that is provided with the request.", + "type": "string" + }, + "userAgent": { + "description": "The user agent information that is provided with the request.", + "type": "string" + }, + "url": { + "type": "string", + "description": "The URL of the request." + }, + "responseStatusCode": { + "format": "int32", + "description": "The HTTP response status code for the request.", + "type": "integer" + } + }, + "id": "HttpRequestContext" + }, + "ListGroupStatsResponse": { + "description": "Contains a set of requested error group stats.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If non-empty, more results are available.\nPass this token, along with the same query parameters as the first\nrequest, to view the next page of results.", + "type": "string" + }, + "timeRangeBegin": { + "format": "google-datetime", + "description": "The timestamp specifies the start time to which the request was restricted.\nThe start time is set based on the requested time range. It may be adjusted\nto a later time if a project has exceeded the storage quota and older data\nhas been deleted.", + "type": "string" + }, + "errorGroupStats": { + "description": "The error group stats which match the given request.", + "items": { + "$ref": "ErrorGroupStats" + }, + "type": "array" + } + }, + "id": "ListGroupStatsResponse" + }, + "SourceReference": { + "properties": { + "revisionId": { + "type": "string", + "description": "The canonical and persistent identifier of the deployed revision.\nExample (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"" + }, + "repository": { + "description": "Optional. A URI string identifying the repository.\nExample: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", + "type": "string" + } + }, + "id": "SourceReference", + "description": "A reference to a particular snapshot of the source tree used to build and\ndeploy an application.", + "type": "object" + }, + "DeleteEventsResponse": { + "description": "Response message for deleting error events.", + "type": "object", + "properties": {}, + "id": "DeleteEventsResponse" + }, + "ErrorEvent": { + "type": "object", + "properties": { + "context": { + "description": "Data about the context in which the error occurred.", + "$ref": "ErrorContext" + }, + "message": { + "description": "The stack trace that was reported or logged by the service.", + "type": "string" + }, + "serviceContext": { + "$ref": "ServiceContext", + "description": "The `ServiceContext` for which this error was reported." + }, + "eventTime": { + "format": "google-datetime", + "description": "Time when the event occurred as provided in the error report.\nIf the report did not contain a timestamp, the time the error was received\nby the Error Reporting system is used.", + "type": "string" + } + }, + "id": "ErrorEvent", + "description": "An error event which is returned by the Error Reporting system." + }, + "ReportedErrorEvent": { + "properties": { + "message": { + "description": "[Required] The error message.\nIf no `context.reportLocation` is provided, the message must contain a\nheader (typically consisting of the exception type name and an error\nmessage) and an exception stack trace in one of the supported programming\nlanguages and formats.\nSupported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go.\nSupported stack trace formats are:\n\n* **Java**: Must be the return value of [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29).\n* **Python**: Must be the return value of [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc).\n* **JavaScript**: Must be the value of [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API)\nas returned by V8.\n* **Ruby**: Must contain frames returned by [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace).\n* **C#**: Must be the return value of [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx).\n* **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)`\nand contain the result of [`(string)$exception`](http://php.net/manual/en/exception.tostring.php).\n* **Go**: Must be the return value of [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack).", + "type": "string" + }, + "serviceContext": { + "description": "[Required] The service context in which this error has occurred.", + "$ref": "ServiceContext" + }, + "eventTime": { + "format": "google-datetime", + "description": "[Optional] Time when the event occurred.\nIf not provided, the time when the event was received by the\nError Reporting system will be used.", + "type": "string" + }, + "context": { + "$ref": "ErrorContext", + "description": "[Optional] A description of the context in which the error occurred." + } + }, + "id": "ReportedErrorEvent", + "description": "An error event which is reported to the Error Reporting system.", + "type": "object" + }, + "ErrorContext": { + "description": "A description of the context in which an error occurred.\nThis data should be provided by the application when reporting an error,\nunless the\nerror report has been generated automatically from Google App Engine logs.", + "type": "object", + "properties": { + "httpRequest": { + "$ref": "HttpRequestContext", + "description": "The HTTP request which was processed when the error was\ntriggered." + }, + "user": { + "description": "The user who caused or was affected by the crash.\nThis can be a user ID, an email address, or an arbitrary token that\nuniquely identifies the user.\nWhen sending an error report, leave this field empty if the user was not\nlogged in. In this case the\nError Reporting system will use other data, such as remote IP address, to\ndistinguish affected users. See `affected_users_count` in\n`ErrorGroupStats`.", + "type": "string" + }, + "sourceReferences": { + "description": "Source code that was used to build the executable which has\ncaused the given error message.", + "items": { + "$ref": "SourceReference" + }, + "type": "array" + }, + "reportLocation": { + "$ref": "SourceLocation", + "description": "The location in the source code where the decision was made to\nreport the error, usually the place where it was logged.\nFor a logged exception this would be the source line where the\nexception is logged, usually close to the place where it was\ncaught." + } + }, + "id": "ErrorContext" + }, + "TrackingIssue": { + "id": "TrackingIssue", + "description": "Information related to tracking the progress on resolving the error.", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "A URL pointing to a related entry in an issue tracking system.\nExample: https://github.com/user/project/issues/4" + } + } + }, + "ErrorGroupStats": { + "description": "Data extracted for a specific group based on certain filter criteria,\nsuch as a given time period and/or service filter.", + "type": "object", + "properties": { + "group": { + "description": "Group data that is independent of the filter criteria.", + "$ref": "ErrorGroup" + }, + "firstSeenTime": { + "format": "google-datetime", + "description": "Approximate first occurrence that was ever seen for this group\nand which matches the given filter criteria, ignoring the\ntime_range that was specified in the request.", + "type": "string" + }, + "count": { + "format": "int64", + "description": "Approximate total number of events in the given group that match\nthe filter criteria.", + "type": "string" + }, + "affectedUsersCount": { + "format": "int64", + "description": "Approximate number of affected users in the given group that\nmatch the filter criteria.\nUsers are distinguished by data in the `ErrorContext` of the\nindividual error events, such as their login name or their remote\nIP address in case of HTTP requests.\nThe number of affected users can be zero even if the number of\nerrors is non-zero if no data was provided from which the\naffected user could be deduced.\nUsers are counted based on data in the request\ncontext that was provided in the error report. If more users are\nimplicitly affected, such as due to a crash of the whole service,\nthis is not reflected here.", + "type": "string" + }, + "lastSeenTime": { + "format": "google-datetime", + "description": "Approximate last occurrence that was ever seen for this group and\nwhich matches the given filter criteria, ignoring the time_range\nthat was specified in the request.", + "type": "string" + }, + "affectedServices": { + "description": "Service contexts with a non-zero error count for the given filter\ncriteria. This list can be truncated if multiple services are affected.\nRefer to `num_affected_services` for the total count.", + "items": { + "$ref": "ServiceContext" + }, + "type": "array" + }, + "numAffectedServices": { + "format": "int32", + "description": "The total number of services with a non-zero error count for the given\nfilter criteria.", + "type": "integer" + }, + "representative": { + "$ref": "ErrorEvent", + "description": "An arbitrary event that is chosen as representative for the whole group.\nThe representative event is intended to be used as a quick preview for\nthe whole group. Events in the group are usually sufficiently similar\nto each other such that showing an arbitrary representative provides\ninsight into the characteristics of the group as a whole." + }, + "timedCounts": { + "description": "Approximate number of occurrences over time.\nTimed counts returned by ListGroups are guaranteed to be:\n\n- Inside the requested time interval\n- Non-overlapping, and\n- Ordered by ascending time.", + "items": { + "$ref": "TimedCount" + }, + "type": "array" + } + }, + "id": "ErrorGroupStats" + }, + "ListEventsResponse": { + "description": "Contains a set of requested error events.", + "type": "object", + "properties": { + "errorEvents": { + "description": "The error events which match the given request.", + "items": { + "$ref": "ErrorEvent" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If non-empty, more results are available.\nPass this token, along with the same query parameters as the first\nrequest, to view the next page of results.", + "type": "string" + }, + "timeRangeBegin": { + "format": "google-datetime", + "description": "The timestamp specifies the start time to which the request was restricted.", + "type": "string" + } + }, + "id": "ListEventsResponse" + }, + "TimedCount": { + "id": "TimedCount", + "description": "The number of errors in a given time period.\nAll numbers are approximate since the error events are sampled\nbefore counting them.", + "type": "object", + "properties": { + "endTime": { + "type": "string", + "format": "google-datetime", + "description": "End of the time period to which `count` refers (excluded)." + }, + "startTime": { + "type": "string", + "format": "google-datetime", + "description": "Start of the time period to which `count` refers (included)." + }, + "count": { + "format": "int64", + "description": "Approximate number of occurrences in the given time period.", + "type": "string" + } + } + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, "canonicalName": "Clouderrorreporting", "auth": { "oauth2": { @@ -19,120 +364,81 @@ "projects": { "methods": { "deleteEvents": { - "flatPath": "v1beta1/projects/{projectsId}/events", - "id": "clouderrorreporting.projects.deleteEvents", - "path": "v1beta1/{+projectName}/events", "description": "Deletes all error events of a given project.", - "httpMethod": "DELETE", "response": { "$ref": "DeleteEventsResponse" }, "parameterOrder": [ "projectName" ], + "httpMethod": "DELETE", "parameters": { "projectName": { "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas `projects/` plus the\n[Google Cloud Platform project\nID](https://support.google.com/cloud/answer/6158840).\nExample: `projects/my-project-123`.", - "required": true, "type": "string", + "required": true, "pattern": "^projects/[^/]+$", "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] + ], + "flatPath": "v1beta1/projects/{projectsId}/events", + "id": "clouderrorreporting.projects.deleteEvents", + "path": "v1beta1/{+projectName}/events" } }, "resources": { - "groups": { - "methods": { - "update": { - "description": "Replace the data for the specified group.\nFails if the group does not exist.", - "request": { - "$ref": "ErrorGroup" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ErrorGroup" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "description": "The group resource name.\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-groupid\u003c/code\u003e", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/groups/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/groups/{groupsId}", - "id": "clouderrorreporting.projects.groups.update", - "path": "v1beta1/{+name}" - }, - "get": { - "description": "Get the specified group.", - "response": { - "$ref": "ErrorGroup" - }, - "parameterOrder": [ - "groupName" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "groupName": { - "location": "path", - "description": "[Required] The group resource name. Written as\n\u003ccode\u003eprojects/\u003cvar\u003eprojectID\u003c/var\u003e/groups/\u003cvar\u003egroup_name\u003c/var\u003e\u003c/code\u003e.\nCall\n\u003ca href=\"/error-reporting/reference/rest/v1beta1/projects.groupStats/list\"\u003e\n\u003ccode\u003egroupStats.list\u003c/code\u003e\u003c/a\u003e to return a list of groups belonging to\nthis project.\n\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-group\u003c/code\u003e", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/groups/[^/]+$" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/groups/{groupsId}", - "path": "v1beta1/{+groupName}", - "id": "clouderrorreporting.projects.groups.get" - } - } - }, - "groupStats": { + "events": { "methods": { "list": { - "description": "Lists the specified groups.", + "description": "Lists the specified events.", + "httpMethod": "GET", "parameterOrder": [ "projectName" ], "response": { - "$ref": "ListGroupStatsResponse" + "$ref": "ListEventsResponse" }, - "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { - "projectName": { - "location": "path", - "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas \u003ccode\u003eprojects/\u003c/code\u003e plus the\n\u003ca href=\"https://support.google.com/cloud/answer/6158840\"\u003eGoogle Cloud\nPlatform project ID\u003c/a\u003e.\n\nExample: \u003ccode\u003eprojects/my-project-123\u003c/code\u003e.", - "required": true, + "groupId": { "type": "string", - "pattern": "^projects/[^/]+$" + "location": "query", + "description": "[Required] The group for which events shall be returned." }, - "timedCountDuration": { - "description": "[Optional] The preferred duration for a single returned `TimedCount`.\nIf not set, no timed counts are returned.", - "format": "google-duration", + "serviceFilter.service": { "type": "string", - "location": "query" + "location": "query", + "description": "[Optional] The exact value to match against\n[`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service)." }, "pageToken": { "location": "query", - "description": "[Optional] A `next_page_token` provided by a previous response. To view\nadditional results, pass this token along with the identical query\nparameters as the first request.", + "description": "[Optional] A `next_page_token` provided by a previous response.", + "type": "string" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "[Optional] The maximum number of results to return per response." + }, + "serviceFilter.version": { + "description": "[Optional] The exact value to match against\n[`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).", + "type": "string", + "location": "query" + }, + "serviceFilter.resourceType": { + "location": "query", + "description": "[Optional] The exact value to match against\n[`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).", "type": "string" }, "timeRange.period": { + "type": "string", + "location": "query", "enum": [ "PERIOD_UNSPECIFIED", "PERIOD_1_HOUR", @@ -141,39 +447,110 @@ "PERIOD_1_WEEK", "PERIOD_30_DAYS" ], + "description": "Restricts the query to the specified time range." + }, + "projectName": { + "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas `projects/` plus the\n[Google Cloud Platform project\nID](https://support.google.com/cloud/answer/6158840).\nExample: `projects/my-project-123`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/events", + "path": "v1beta1/{+projectName}/events", + "id": "clouderrorreporting.projects.events.list" + }, + "report": { + "description": "Report an individual error event.\n\nThis endpoint accepts \u003cstrong\u003eeither\u003c/strong\u003e an OAuth token,\n\u003cstrong\u003eor\u003c/strong\u003e an\n\u003ca href=\"https://support.google.com/cloud/answer/6158862\"\u003eAPI key\u003c/a\u003e\nfor authentication. To use an API key, append it to the URL as the value of\na `key` parameter. For example:\n\u003cpre\u003ePOST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456\u003c/pre\u003e", + "request": { + "$ref": "ReportedErrorEvent" + }, + "response": { + "$ref": "ReportErrorEventResponse" + }, + "parameterOrder": [ + "projectName" + ], + "httpMethod": "POST", + "parameters": { + "projectName": { + "location": "path", + "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas `projects/` plus the\n[Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840).\nExample: `projects/my-project-123`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/events:report", + "id": "clouderrorreporting.projects.events.report", + "path": "v1beta1/{+projectName}/events:report" + } + } + }, + "groupStats": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListGroupStatsResponse" + }, + "parameterOrder": [ + "projectName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "timeRange.period": { "description": "Restricts the query to the specified time range.", "type": "string", - "location": "query" + "location": "query", + "enum": [ + "PERIOD_UNSPECIFIED", + "PERIOD_1_HOUR", + "PERIOD_6_HOURS", + "PERIOD_1_DAY", + "PERIOD_1_WEEK", + "PERIOD_30_DAYS" + ] }, "alignment": { + "description": "[Optional] The alignment of the timed counts to be returned.\nDefault is `ALIGNMENT_EQUAL_AT_END`.", "type": "string", "location": "query", "enum": [ "ERROR_COUNT_ALIGNMENT_UNSPECIFIED", "ALIGNMENT_EQUAL_ROUNDED", "ALIGNMENT_EQUAL_AT_END" - ], - "description": "[Optional] The alignment of the timed counts to be returned.\nDefault is `ALIGNMENT_EQUAL_AT_END`." + ] }, "groupId": { - "description": "[Optional] List all \u003ccode\u003eErrorGroupStats\u003c/code\u003e with these IDs.", - "type": "string", "repeated": true, - "location": "query" + "location": "query", + "description": "[Optional] List all \u003ccode\u003eErrorGroupStats\u003c/code\u003e with these IDs.", + "type": "string" }, "serviceFilter.service": { + "location": "query", "description": "[Optional] The exact value to match against\n[`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).", - "type": "string", - "location": "query" + "type": "string" }, "pageSize": { - "description": "[Optional] The maximum number of results to return per response.\nDefault is 20.", + "location": "query", "format": "int32", - "type": "integer", - "location": "query" + "description": "[Optional] The maximum number of results to return per response.\nDefault is 20.", + "type": "integer" + }, + "serviceFilter.version": { + "location": "query", + "description": "[Optional] The exact value to match against\n[`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).", + "type": "string" }, "order": { - "description": "[Optional] The sort order in which the results are returned.\nDefault is `COUNT_DESC`.", "type": "string", "location": "query", "enum": [ @@ -182,132 +559,100 @@ "LAST_SEEN_DESC", "CREATED_DESC", "AFFECTED_USERS_DESC" - ] - }, - "serviceFilter.version": { - "location": "query", - "description": "[Optional] The exact value to match against\n[`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).", - "type": "string" - }, - "serviceFilter.resourceType": { - "location": "query", - "description": "[Optional] The exact value to match against\n[`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).", - "type": "string" + ], + "description": "[Optional] The sort order in which the results are returned.\nDefault is `COUNT_DESC`." }, "alignmentTime": { - "location": "query", - "description": "[Optional] Time where the timed counts shall be aligned if rounded\nalignment is chosen. Default is 00:00 UTC.", "format": "google-datetime", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/groupStats", - "path": "v1beta1/{+projectName}/groupStats", - "id": "clouderrorreporting.projects.groupStats.list" - } - } - }, - "events": { - "methods": { - "list": { - "response": { - "$ref": "ListEventsResponse" - }, - "parameterOrder": [ - "projectName" - ], - "httpMethod": "GET", - "parameters": { - "serviceFilter.service": { - "location": "query", - "description": "[Optional] The exact value to match against\n[`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).", - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "[Optional] A `next_page_token` provided by a previous response.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "[Optional] The maximum number of results to return per response.", - "format": "int32", - "type": "integer" - }, - "serviceFilter.version": { - "type": "string", - "location": "query", - "description": "[Optional] The exact value to match against\n[`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version)." - }, - "serviceFilter.resourceType": { - "location": "query", - "description": "[Optional] The exact value to match against\n[`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).", - "type": "string" - }, - "timeRange.period": { - "enum": [ - "PERIOD_UNSPECIFIED", - "PERIOD_1_HOUR", - "PERIOD_6_HOURS", - "PERIOD_1_DAY", - "PERIOD_1_WEEK", - "PERIOD_30_DAYS" - ], - "description": "Restricts the query to the specified time range.", + "description": "[Optional] Time where the timed counts shall be aligned if rounded\nalignment is chosen. Default is 00:00 UTC.", "type": "string", "location": "query" }, + "serviceFilter.resourceType": { + "location": "query", + "description": "[Optional] The exact value to match against\n[`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).", + "type": "string" + }, "projectName": { - "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas `projects/` plus the\n[Google Cloud Platform project\nID](https://support.google.com/cloud/answer/6158840).\nExample: `projects/my-project-123`.", - "required": true, + "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas \u003ccode\u003eprojects/\u003c/code\u003e plus the\n\u003ca href=\"https://support.google.com/cloud/answer/6158840\"\u003eGoogle Cloud\nPlatform project ID\u003c/a\u003e.\n\nExample: \u003ccode\u003eprojects/my-project-123\u003c/code\u003e.", "type": "string", + "required": true, "pattern": "^projects/[^/]+$", "location": "path" }, - "groupId": { + "timedCountDuration": { + "type": "string", "location": "query", - "description": "[Required] The group for which events shall be returned.", - "type": "string" + "format": "google-duration", + "description": "[Optional] The preferred duration for a single returned `TimedCount`.\nIf not set, no timed counts are returned." + }, + "pageToken": { + "description": "[Optional] A `next_page_token` provided by a previous response. To view\nadditional results, pass this token along with the identical query\nparameters as the first request.", + "type": "string", + "location": "query" } }, + "flatPath": "v1beta1/projects/{projectsId}/groupStats", + "path": "v1beta1/{+projectName}/groupStats", + "id": "clouderrorreporting.projects.groupStats.list", + "description": "Lists the specified groups." + } + } + }, + "groups": { + "methods": { + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "groupName" + ], + "response": { + "$ref": "ErrorGroup" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta1/projects/{projectsId}/events", - "path": "v1beta1/{+projectName}/events", - "id": "clouderrorreporting.projects.events.list", - "description": "Lists the specified events." - }, - "report": { - "httpMethod": "POST", - "parameterOrder": [ - "projectName" - ], - "response": { - "$ref": "ReportErrorEventResponse" - }, "parameters": { - "projectName": { - "description": "[Required] The resource name of the Google Cloud Platform project. Written\nas `projects/` plus the\n[Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840).\nExample: `projects/my-project-123`.", - "required": true, + "groupName": { + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path", + "description": "[Required] The group resource name. Written as\n\u003ccode\u003eprojects/\u003cvar\u003eprojectID\u003c/var\u003e/groups/\u003cvar\u003egroup_name\u003c/var\u003e\u003c/code\u003e.\nCall\n\u003ca href=\"/error-reporting/reference/rest/v1beta1/projects.groupStats/list\"\u003e\n\u003ccode\u003egroupStats.list\u003c/code\u003e\u003c/a\u003e to return a list of groups belonging to\nthis project.\n\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-group\u003c/code\u003e", "type": "string", - "pattern": "^projects/[^/]+$", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/groups/{groupsId}", + "path": "v1beta1/{+groupName}", + "id": "clouderrorreporting.projects.groups.get", + "description": "Get the specified group." + }, + "update": { + "response": { + "$ref": "ErrorGroup" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The group resource name.\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-groupid\u003c/code\u003e", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/groups/[^/]+$", "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/events:report", - "id": "clouderrorreporting.projects.events.report", - "path": "v1beta1/{+projectName}/events:report", + "flatPath": "v1beta1/projects/{projectsId}/groups/{groupsId}", + "id": "clouderrorreporting.projects.groups.update", + "path": "v1beta1/{+name}", "request": { - "$ref": "ReportedErrorEvent" + "$ref": "ErrorGroup" }, - "description": "Report an individual error event.\n\nThis endpoint accepts \u003cstrong\u003eeither\u003c/strong\u003e an OAuth token,\n\u003cstrong\u003eor\u003c/strong\u003e an\n\u003ca href=\"https://support.google.com/cloud/answer/6158862\"\u003eAPI key\u003c/a\u003e\nfor authentication. To use an API key, append it to the URL as the value of\na `key` parameter. For example:\n\u003cpre\u003ePOST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456\u003c/pre\u003e" + "description": "Replace the data for the specified group.\nFails if the group does not exist." } } } @@ -315,42 +660,21 @@ } }, "parameters": { - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Pretty-print response." - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, "upload_protocol": { - "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "fields": { + "location": "query", "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" + "type": "string" }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", @@ -358,13 +682,11 @@ "location": "query" }, "callback": { - "location": "query", "description": "JSONP", - "type": "string" + "type": "string", + "location": "query" }, "$.xgafv": { - "description": "V1 error format.", - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -373,7 +695,9 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format.", + "type": "string" }, "alt": { "enum": [ @@ -391,360 +715,36 @@ "description": "Data format for response.", "default": "json" }, - "key": { - "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.", - "type": "string", - "location": "query" - }, "access_token": { "location": "query", "description": "OAuth access token.", "type": "string" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." } - }, - "version": "v1beta1", - "baseUrl": "https://clouderrorreporting.googleapis.com/", - "servicePath": "", - "description": "Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors.\n", - "kind": "discovery#restDescription", - "basePath": "", - "id": "clouderrorreporting:v1beta1", - "revision": "20170517", - "documentationLink": "https://cloud.google.com/error-reporting/", - "discoveryVersion": "v1", - "version_module": "True", - "schemas": { - "ErrorContext": { - "type": "object", - "properties": { - "reportLocation": { - "description": "The location in the source code where the decision was made to\nreport the error, usually the place where it was logged.\nFor a logged exception this would be the source line where the\nexception is logged, usually close to the place where it was\ncaught. This value is in contrast to `Exception.cause_location`,\nwhich describes the source line where the exception was thrown.", - "$ref": "SourceLocation" - }, - "sourceReferences": { - "description": "Source code that was used to build the executable which has\ncaused the given error message.", - "type": "array", - "items": { - "$ref": "SourceReference" - } - }, - "httpRequest": { - "description": "The HTTP request which was processed when the error was\ntriggered.", - "$ref": "HttpRequestContext" - }, - "user": { - "description": "The user who caused or was affected by the crash.\nThis can be a user ID, an email address, or an arbitrary token that\nuniquely identifies the user.\nWhen sending an error report, leave this field empty if the user was not\nlogged in. In this case the\nError Reporting system will use other data, such as remote IP address, to\ndistinguish affected users. See `affected_users_count` in\n`ErrorGroupStats`.", - "type": "string" - } - }, - "id": "ErrorContext", - "description": "A description of the context in which an error occurred.\nThis data should be provided by the application when reporting an error,\nunless the\nerror report has been generated automatically from Google App Engine logs." - }, - "TrackingIssue": { - "properties": { - "url": { - "type": "string", - "description": "A URL pointing to a related entry in an issue tracking system.\nExample: https://github.com/user/project/issues/4" - } - }, - "id": "TrackingIssue", - "description": "Information related to tracking the progress on resolving the error.", - "type": "object" - }, - "ErrorGroupStats": { - "description": "Data extracted for a specific group based on certain filter criteria,\nsuch as a given time period and/or service filter.", - "type": "object", - "properties": { - "representative": { - "$ref": "ErrorEvent", - "description": "An arbitrary event that is chosen as representative for the whole group.\nThe representative event is intended to be used as a quick preview for\nthe whole group. Events in the group are usually sufficiently similar\nto each other such that showing an arbitrary representative provides\ninsight into the characteristics of the group as a whole." - }, - "timedCounts": { - "description": "Approximate number of occurrences over time.\nTimed counts returned by ListGroups are guaranteed to be:\n\n- Inside the requested time interval\n- Non-overlapping, and\n- Ordered by ascending time.", - "type": "array", - "items": { - "$ref": "TimedCount" - } - }, - "group": { - "$ref": "ErrorGroup", - "description": "Group data that is independent of the filter criteria." - }, - "firstSeenTime": { - "description": "Approximate first occurrence that was ever seen for this group\nand which matches the given filter criteria, ignoring the\ntime_range that was specified in the request.", - "format": "google-datetime", - "type": "string" - }, - "count": { - "description": "Approximate total number of events in the given group that match\nthe filter criteria.", - "format": "int64", - "type": "string" - }, - "affectedUsersCount": { - "description": "Approximate number of affected users in the given group that\nmatch the filter criteria.\nUsers are distinguished by data in the `ErrorContext` of the\nindividual error events, such as their login name or their remote\nIP address in case of HTTP requests.\nThe number of affected users can be zero even if the number of\nerrors is non-zero if no data was provided from which the\naffected user could be deduced.\nUsers are counted based on data in the request\ncontext that was provided in the error report. If more users are\nimplicitly affected, such as due to a crash of the whole service,\nthis is not reflected here.", - "format": "int64", - "type": "string" - }, - "lastSeenTime": { - "description": "Approximate last occurrence that was ever seen for this group and\nwhich matches the given filter criteria, ignoring the time_range\nthat was specified in the request.", - "format": "google-datetime", - "type": "string" - }, - "affectedServices": { - "description": "Service contexts with a non-zero error count for the given filter\ncriteria. This list can be truncated if multiple services are affected.\nRefer to `num_affected_services` for the total count.", - "type": "array", - "items": { - "$ref": "ServiceContext" - } - }, - "numAffectedServices": { - "description": "The total number of services with a non-zero error count for the given\nfilter criteria.", - "format": "int32", - "type": "integer" - } - }, - "id": "ErrorGroupStats" - }, - "ListEventsResponse": { - "description": "Contains a set of requested error events.", - "type": "object", - "properties": { - "errorEvents": { - "description": "The error events which match the given request.", - "type": "array", - "items": { - "$ref": "ErrorEvent" - } - }, - "nextPageToken": { - "description": "If non-empty, more results are available.\nPass this token, along with the same query parameters as the first\nrequest, to view the next page of results.", - "type": "string" - }, - "timeRangeBegin": { - "description": "The timestamp specifies the start time to which the request was restricted.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "ListEventsResponse" - }, - "TimedCount": { - "description": "The number of errors in a given time period.\nAll numbers are approximate since the error events are sampled\nbefore counting them.", - "type": "object", - "properties": { - "endTime": { - "description": "End of the time period to which `count` refers (excluded).", - "format": "google-datetime", - "type": "string" - }, - "count": { - "description": "Approximate number of occurrences in the given time period.", - "format": "int64", - "type": "string" - }, - "startTime": { - "description": "Start of the time period to which `count` refers (included).", - "format": "google-datetime", - "type": "string" - } - }, - "id": "TimedCount" - }, - "ErrorGroup": { - "type": "object", - "properties": { - "groupId": { - "description": "Group IDs are unique for a given project. If the same kind of error\noccurs in different service contexts, it will receive the same group ID.", - "type": "string" - }, - "trackingIssues": { - "description": "Associated tracking issues.", - "type": "array", - "items": { - "$ref": "TrackingIssue" - } - }, - "name": { - "description": "The group resource name.\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-groupid\u003c/code\u003e", - "type": "string" - } - }, - "id": "ErrorGroup", - "description": "Description of a group of similar error events." - }, - "ServiceContext": { - "description": "Describes a running service that sends errors.\nIts version changes over time and multiple versions can run in parallel.", - "type": "object", - "properties": { - "resourceType": { - "description": "Type of the MonitoredResource. List of possible values:\nhttps://cloud.google.com/monitoring/api/resources\n\nValue is set automatically for incoming errors and must not be set when\nreporting errors.", - "type": "string" - }, - "version": { - "description": "Represents the source code version that the developer provided,\nwhich could represent a version label or a Git SHA-1 hash, for example.\nFor App Engine standard environment, the version is set to the version of\nthe app.", - "type": "string" - }, - "service": { - "description": "An identifier of the service, such as the name of the\nexecutable, job, or Google App Engine service name. This field is expected\nto have a low number of values that are relatively stable over time, as\nopposed to `version`, which can be changed whenever new code is deployed.\n\nContains the service name for error reports extracted from Google\nApp Engine logs or `default` if the App Engine default service is used.", - "type": "string" - } - }, - "id": "ServiceContext" - }, - "SourceLocation": { - "description": "Indicates a location in the source code of the service for which errors are\nreported. `functionName` must be provided by the application when reporting\nan error, unless the error report contains a `message` with a supported\nexception stack trace. All fields are optional for the later case.", - "type": "object", - "properties": { - "lineNumber": { - "type": "integer", - "description": "1-based. 0 indicates that the line number is unknown.", - "format": "int32" - }, - "functionName": { - "description": "Human-readable name of a function or method.\nThe value can include optional context like the class or package name.\nFor example, `my.package.MyClass.method` in case of Java.", - "type": "string" - }, - "filePath": { - "description": "The source code filename, which can include a truncated relative\npath, or a full path from a production machine.", - "type": "string" - } - }, - "id": "SourceLocation" - }, - "ReportErrorEventResponse": { - "description": "Response for reporting an individual error event.\nData may be added to this message in the future.", - "type": "object", - "properties": {}, - "id": "ReportErrorEventResponse" - }, - "HttpRequestContext": { - "description": "HTTP request data that is related to a reported error.\nThis data should be provided by the application when reporting an error,\nunless the\nerror report has been generated automatically from Google App Engine logs.", - "type": "object", - "properties": { - "responseStatusCode": { - "description": "The HTTP response status code for the request.", - "format": "int32", - "type": "integer" - }, - "method": { - "description": "The type of HTTP request, such as `GET`, `POST`, etc.", - "type": "string" - }, - "remoteIp": { - "description": "The IP address from which the request originated.\nThis can be IPv4, IPv6, or a token which is derived from the\nIP address, depending on the data that has been provided\nin the error report.", - "type": "string" - }, - "referrer": { - "description": "The referrer information that is provided with the request.", - "type": "string" - }, - "userAgent": { - "description": "The user agent information that is provided with the request.", - "type": "string" - }, - "url": { - "type": "string", - "description": "The URL of the request." - } - }, - "id": "HttpRequestContext" - }, - "ListGroupStatsResponse": { - "description": "Contains a set of requested error group stats.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If non-empty, more results are available.\nPass this token, along with the same query parameters as the first\nrequest, to view the next page of results.", - "type": "string" - }, - "timeRangeBegin": { - "description": "The timestamp specifies the start time to which the request was restricted.\nThe start time is set based on the requested time range. It may be adjusted\nto a later time if a project has exceeded the storage quota and older data\nhas been deleted.", - "format": "google-datetime", - "type": "string" - }, - "errorGroupStats": { - "description": "The error group stats which match the given request.", - "type": "array", - "items": { - "$ref": "ErrorGroupStats" - } - } - }, - "id": "ListGroupStatsResponse" - }, - "SourceReference": { - "description": "A reference to a particular snapshot of the source tree used to build and\ndeploy an application.", - "type": "object", - "properties": { - "revisionId": { - "description": "The canonical and persistent identifier of the deployed revision.\nExample (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"", - "type": "string" - }, - "repository": { - "description": "Optional. A URI string identifying the repository.\nExample: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", - "type": "string" - } - }, - "id": "SourceReference" - }, - "DeleteEventsResponse": { - "description": "Response message for deleting error events.", - "type": "object", - "properties": {}, - "id": "DeleteEventsResponse" - }, - "ErrorEvent": { - "description": "An error event which is returned by the Error Reporting system.", - "type": "object", - "properties": { - "serviceContext": { - "$ref": "ServiceContext", - "description": "The `ServiceContext` for which this error was reported." - }, - "eventTime": { - "description": "Time when the event occurred as provided in the error report.\nIf the report did not contain a timestamp, the time the error was received\nby the Error Reporting system is used.", - "format": "google-datetime", - "type": "string" - }, - "context": { - "$ref": "ErrorContext", - "description": "Data about the context in which the error occurred." - }, - "message": { - "description": "The stack trace that was reported or logged by the service.", - "type": "string" - } - }, - "id": "ErrorEvent" - }, - "ReportedErrorEvent": { - "description": "An error event which is reported to the Error Reporting system.", - "type": "object", - "properties": { - "context": { - "$ref": "ErrorContext", - "description": "[Optional] A description of the context in which the error occurred." - }, - "message": { - "description": "[Required] The error message.\nIf no `context.reportLocation` is provided, the message must contain a\nheader (typically consisting of the exception type name and an error\nmessage) and an exception stack trace in one of the supported programming\nlanguages and formats.\nSupported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go.\nSupported stack trace formats are:\n\n* **Java**: Must be the return value of [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29).\n* **Python**: Must be the return value of [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc).\n* **JavaScript**: Must be the value of [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API)\nas returned by V8.\n* **Ruby**: Must contain frames returned by [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace).\n* **C#**: Must be the return value of [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx).\n* **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)`\nand contain the result of [`(string)$exception`](http://php.net/manual/en/exception.tostring.php).\n* **Go**: Must be the return value of [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack).", - "type": "string" - }, - "serviceContext": { - "$ref": "ServiceContext", - "description": "[Required] The service context in which this error has occurred." - }, - "eventTime": { - "description": "[Optional] Time when the event occurred.\nIf not provided, the time when the event was received by the\nError Reporting system will be used.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "ReportedErrorEvent" - } - }, - "protocol": "rest", - "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" } } diff --git a/etc/api/cloudfunctions/v1/cloudfunctions-api.json b/etc/api/cloudfunctions/v1/cloudfunctions-api.json new file mode 100644 index 0000000000..79d21ea93c --- /dev/null +++ b/etc/api/cloudfunctions/v1/cloudfunctions-api.json @@ -0,0 +1,410 @@ +{ + "schemas": { + "Location": { + "type": "object", + "properties": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "Service-specific metadata. For example the available capacity at the given\nlocation." + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}" + }, + "name": { + "type": "string", + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`" + }, + "locationId": { + "type": "string", + "description": "The canonical id for this location. For example: `\"us-east1\"`." + } + }, + "id": "Location", + "description": "A resource that represents Google Cloud Platform location." + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "operations": { + "items": { + "$ref": "Operation" + }, + "type": "array", + "description": "A list of operations that matches the specified filter in the request." + }, + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + } + }, + "id": "ListOperationsResponse" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`." + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + } + }, + "id": "Operation" + }, + "OperationMetadataV1Beta2": { + "type": "object", + "properties": { + "target": { + "type": "string", + "description": "Target of the operation - for example\nprojects/project-1/locations/region-1/functions/function-1" + }, + "versionId": { + "type": "string", + "format": "int64", + "description": "Version id of the function created or updated by an API call.\nThis field is only pupulated for Create and Update operations." + }, + "request": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The original request that started the operation.", + "type": "object" + }, + "type": { + "enum": [ + "OPERATION_UNSPECIFIED", + "CREATE_FUNCTION", + "UPDATE_FUNCTION", + "DELETE_FUNCTION" + ], + "description": "Type of operation.", + "type": "string", + "enumDescriptions": [ + "Unknown operation type.", + "Triggered by CreateFunction call", + "Triggered by UpdateFunction call", + "Triggered by DeleteFunction call." + ] + } + }, + "id": "OperationMetadataV1Beta2", + "description": "Metadata describing an Operation" + }, + "Status": { + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": "array" + } + }, + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons." + }, + "ListLocationsResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + }, + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + } + }, + "id": "ListLocationsResponse", + "description": "The response message for Locations.ListLocations." + } + }, + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "canonicalName": "Cloud Functions", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudfunctions.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudfunctions", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Functions API", + "ownerName": "Google", + "resources": { + "operations": { + "methods": { + "get": { + "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", + "id": "cloudfunctions.operations.get", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^operations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListOperationsResponse" + }, + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "The standard list page token." + }, + "name": { + "type": "string", + "location": "query", + "description": "The name of the operation's parent resource." + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "The standard list page size." + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/operations", + "path": "v1/operations", + "id": "cloudfunctions.operations.list" + } + } + }, + "projects": { + "resources": { + "locations": { + "methods": { + "list": { + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "The standard list page token." + }, + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The resource that owns the locations collection, if applicable." + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "The standard list page size." + } + }, + "flatPath": "v1/projects/{projectsId}/locations", + "id": "cloudfunctions.projects.locations.list", + "path": "v1/{+name}/locations", + "description": "Lists information about the supported locations for this service." + } + } + } + } + } + }, + "parameters": { + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "key": { + "type": "string", + "location": "query", + "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." + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + } + }, + "version": "v1", + "baseUrl": "https://cloudfunctions.googleapis.com/", + "kind": "discovery#restDescription", + "description": "API for managing lightweight user-provided functions executed in response to events.", + "servicePath": "", + "basePath": "", + "documentationLink": "https://cloud.google.com/functions", + "id": "cloudfunctions:v1", + "revision": "20170920", + "discoveryVersion": "v1", + "version_module": true +} diff --git a/etc/api/cloudfunctions/v1/crates/1.0.6-api+20170920 b/etc/api/cloudfunctions/v1/crates/1.0.6-api+20170920 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudfunctions/v1/crates/1.0.6-cli+20170920 b/etc/api/cloudfunctions/v1/crates/1.0.6-cli+20170920 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json b/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json new file mode 100644 index 0000000000..d69a0005f4 --- /dev/null +++ b/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json @@ -0,0 +1,804 @@ +{ + "resources": { + "operations": { + "methods": { + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/operations/{operationsId}", + "path": "v1beta2/{+name}", + "id": "cloudfunctions.operations.get", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + }, + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "location": "query", + "description": "The name of the operation's parent resource.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + }, + "flatPath": "v1beta2/operations", + "id": "cloudfunctions.operations.list", + "path": "v1beta2/operations", + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id." + } + } + }, + "projects": { + "resources": { + "locations": { + "methods": { + "list": { + "flatPath": "v1beta2/projects/{projectsId}/locations", + "path": "v1beta2/{+name}/locations", + "id": "cloudfunctions.projects.locations.list", + "description": "Lists information about the supported locations for this service.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListLocationsResponse" + }, + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "name": { + "location": "path", + "description": "The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "functions": { + "methods": { + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the function which should be deleted.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + "id": "cloudfunctions.projects.locations.functions.delete", + "path": "v1beta2/{+name}", + "description": "Deletes a function with the given name from the specified project. If the\ngiven function is used by some trigger, the trigger will be updated to\nremove this function." + }, + "list": { + "description": "Returns a list of functions that belong to the requested project.", + "httpMethod": "GET", + "parameterOrder": [ + "location" + ], + "response": { + "$ref": "ListFunctionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageSize": { + "format": "int32", + "description": "Maximum number of functions to return per call.", + "type": "integer", + "location": "query" + }, + "location": { + "description": "The project and location from which the function should be listed,\nspecified in the format `projects/*/locations/*`\nIf you want to list functions in all locations, use \"-\" in place of a\nlocation.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "The value returned by the last\n`ListFunctionsResponse`; indicates that\nthis is a continuation of a prior `ListFunctions` call, and that the\nsystem should return the next page of data.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions", + "path": "v1beta2/{+location}/functions", + "id": "cloudfunctions.projects.locations.functions.list" + }, + "call": { + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:call", + "path": "v1beta2/{+name}:call", + "id": "cloudfunctions.projects.locations.functions.call", + "request": { + "$ref": "CallFunctionRequest" + }, + "description": "Invokes synchronously deployed function. To be used for testing, very\nlimited traffic allowed.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "CallFunctionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the function to be called.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$" + } + } + }, + "create": { + "description": "Creates a new function. If a function with the given name already exists in\nthe specified project, the long running operation will return\n`ALREADY_EXISTS` error.", + "request": { + "$ref": "CloudFunction" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "location" + ], + "httpMethod": "POST", + "parameters": { + "location": { + "location": "path", + "description": "The project and location in which the function should be created, specified\nin the format `projects/*/locations/*`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions", + "id": "cloudfunctions.projects.locations.functions.create", + "path": "v1beta2/{+location}/functions" + }, + "get": { + "description": "Returns a function with the given name from the requested project.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "CloudFunction" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name of the function which details should be obtained.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + "path": "v1beta2/{+name}", + "id": "cloudfunctions.projects.locations.functions.get" + }, + "update": { + "description": "Updates existing function.", + "request": { + "$ref": "CloudFunction" + }, + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "location": "path", + "description": "The name of the function to be updated.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + "path": "v1beta2/{+name}", + "id": "cloudfunctions.projects.locations.functions.update" + } + } + } + } + } + } + } + }, + "parameters": { + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + } + }, + "version": "v1beta2", + "baseUrl": "https://cloudfunctions.googleapis.com/", + "servicePath": "", + "description": "API for managing lightweight user-provided functions executed in response to events.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "cloudfunctions:v1beta2", + "documentationLink": "https://cloud.google.com/functions", + "revision": "20170920", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "CloudFunction": { + "description": "Describes a Cloud Function that contains user computation executed in\nresponse to an event. It encapsulate function and triggers configurations.", + "type": "object", + "properties": { + "timeout": { + "format": "google-duration", + "description": "The function execution timeout. Execution is considered failed and\ncan be terminated if the function is not completed at the end of the\ntimeout period. Defaults to 60 seconds.", + "type": "string" + }, + "status": { + "enumDescriptions": [ + "Status not specified.", + "Successfully deployed.", + "Not deployed correctly - behavior is undefined. The item should be updated\nor deleted to move it out of this state.", + "Creation or update in progress.", + "Deletion in progress." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "READY", + "FAILED", + "DEPLOYING", + "DELETING" + ], + "description": "Output only. Status of the function deployment.", + "type": "string" + }, + "eventTrigger": { + "$ref": "EventTrigger", + "description": "A source that fires events in response to a condition in another service." + }, + "availableMemoryMb": { + "format": "int32", + "description": "The amount of memory in MB available for a function.\nDefaults to 256MB.", + "type": "integer" + }, + "name": { + "description": "A user-defined name of the function. Function names must be unique\nglobally and match pattern `projects/*/locations/*/functions/*`", + "type": "string" + }, + "versionId": { + "format": "int64", + "description": "Output only.\nThe version identifier of the Cloud Function. Each deployment attempt\nresults in a new version of a function being created.", + "type": "string" + }, + "serviceAccount": { + "description": "Output only. The service account of the function.", + "type": "string" + }, + "sourceArchiveUrl": { + "description": "The Google Cloud Storage URL, starting with gs://, pointing to the zip\narchive which contains the function.", + "type": "string" + }, + "sourceRepository": { + "description": "The hosted repository where the function is defined.", + "$ref": "SourceRepository" + }, + "entryPoint": { + "description": "The name of the function (as defined in source code) that will be\nexecuted. Defaults to the resource name suffix, if not specified. For\nbackward compatibility, if function with given name is not found, then the\nsystem will try to use function named \"function\".\nFor Node.js this is name of a function exported by the module specified\nin `source_location`.", + "type": "string" + }, + "labels": { + "description": "Labels associated with this Cloud Function.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "sourceRepositoryUrl": { + "description": "The URL pointing to the hosted repository where the function is defined.\nThere are supported Cloud Source Repository URLs in the following\nformats:\n\nTo refer to a specific commit:\n`https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`\nTo refer to a moveable alias (branch):\n`https://source.developers.google.com/projects/*/repos/*/aliases/movable/*/paths/*`\nIn particular, to refer to HEAD use `master` moveable alias.\nTo refer to a specific fixed alias (tag):\n`https://source.developers.google.com/projects/*/repos/*/aliases/fixed/*/paths/*`\n\nYou may omit `paths/*` if you want to use the main directory.", + "type": "string" + }, + "updateTime": { + "format": "google-datetime", + "description": "Output only. The last update timestamp of a Cloud Function.", + "type": "string" + }, + "latestOperation": { + "description": "Output only. Name of the most recent operation modifying the function. If\nthe function status is `DEPLOYING` or `DELETING`, then it points to the\nactive operation.", + "type": "string" + }, + "httpsTrigger": { + "$ref": "HTTPSTrigger", + "description": "An HTTPS endpoint type of source that can be triggered via URL." + } + }, + "id": "CloudFunction" + }, + "Location": { + "description": "A resource that represents Google Cloud Platform location.", + "type": "object", + "properties": { + "locationId": { + "description": "The canonical id for this location. For example: `\"us-east1\"`.", + "type": "string" + }, + "metadata": { + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object" + }, + "name": { + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", + "type": "string" + } + }, + "id": "Location" + }, + "Retry": { + "description": "Describes the retry policy in case of function's execution failure.\nA function execution will be retried on any failure.\nA failed execution will be retried up to 7 days with an exponential backoff\n(capped at 10 seconds).\nRetried execution is charged as any other execution.", + "type": "object", + "properties": {}, + "id": "Retry" + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListOperationsResponse" + }, + "ListFunctionsResponse": { + "description": "Response for the `ListFunctions` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If not empty, indicates that there may be more functions that match\nthe request; this value should be passed in a new\ngoogle.cloud.functions.v1beta2.ListFunctionsRequest\nto get more functions.", + "type": "string" + }, + "functions": { + "description": "The functions that match the request.", + "items": { + "$ref": "CloudFunction" + }, + "type": "array" + } + }, + "id": "ListFunctionsResponse" + }, + "CallFunctionResponse": { + "description": "Response of `CallFunction` method.", + "type": "object", + "properties": { + "executionId": { + "description": "Execution id of function invocation.", + "type": "string" + }, + "error": { + "description": "Either system or user-function generated error. Set if execution\nwas not successful.", + "type": "string" + }, + "result": { + "description": "Result populated for successful execution of synchronous function. Will\nnot be populated if function does not return a result through context.", + "type": "string" + } + }, + "id": "CallFunctionResponse" + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + } + }, + "id": "ListLocationsResponse" + }, + "EventTrigger": { + "description": "Describes EventTrigger, used to request events be sent from another\nservice.", + "type": "object", + "properties": { + "resource": { + "description": "Which instance of the source's service should send events. E.g. for Pub/Sub\nthis would be a Pub/Sub topic at `projects/*/topics/*`. For Google Cloud\nStorage this would be a bucket at `projects/*/buckets/*`. For any source\nthat only supports one instance per-project, this should be the name of the\nproject (`projects/*`)", + "type": "string" + }, + "service": { + "description": "The hostname of the service that should be observed.\n\nIf no string is provided, the default service implementing the API will\nbe used. For example, `storage.googleapis.com` is the default for all\nevent types in the 'google.storage` namespace.", + "type": "string" + }, + "failurePolicy": { + "$ref": "FailurePolicy", + "description": "Specifies policy for failed executions." + }, + "eventType": { + "description": "`event_type` names contain the service that is sending an event and the\nkind of event that was fired. Must be of the form\n`providers/*/eventTypes/*` e.g. Directly handle a Message published to\nGoogle Cloud Pub/Sub `providers/cloud.pubsub/eventTypes/topic.publish`\n\n Handle an object changing in Google Cloud Storage\n `providers/cloud.storage/eventTypes/object.change`\n\n Handle a write to the Firebase Realtime Database\n `providers/firebase.database/eventTypes/data.write`", + "type": "string" + } + }, + "id": "EventTrigger" + }, + "HTTPSTrigger": { + "description": "Describes HTTPSTrigger, could be used to connect web hooks to function.", + "type": "object", + "properties": { + "url": { + "description": "Output only. The deployed url for the function.", + "type": "string" + } + }, + "id": "HTTPSTrigger" + }, + "FailurePolicy": { + "description": "Describes the policy in case of function's execution failure.\nIf empty, then defaults to ignoring failures (i.e. not retrying them).", + "type": "object", + "properties": { + "retry": { + "$ref": "Retry", + "description": "If specified, then the function will be retried in case of a failure." + } + }, + "id": "FailurePolicy" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "response": { + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + } + }, + "id": "Operation" + }, + "OperationMetadataV1Beta2": { + "description": "Metadata describing an Operation", + "type": "object", + "properties": { + "target": { + "description": "Target of the operation - for example\nprojects/project-1/locations/region-1/functions/function-1", + "type": "string" + }, + "versionId": { + "format": "int64", + "description": "Version id of the function created or updated by an API call.\nThis field is only pupulated for Create and Update operations.", + "type": "string" + }, + "request": { + "description": "The original request that started the operation.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": { + "description": "Type of operation.", + "type": "string", + "enumDescriptions": [ + "Unknown operation type.", + "Triggered by CreateFunction call", + "Triggered by UpdateFunction call", + "Triggered by DeleteFunction call." + ], + "enum": [ + "OPERATION_UNSPECIFIED", + "CREATE_FUNCTION", + "UPDATE_FUNCTION", + "DELETE_FUNCTION" + ] + } + }, + "id": "OperationMetadataV1Beta2" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "SourceRepository": { + "description": "Describes the location of the function source in a remote repository.", + "type": "object", + "properties": { + "repositoryUrl": { + "description": "URL to the hosted repository where the function is defined. Only paths in\nhttps://source.developers.google.com domain are supported. The path should\ncontain the name of the repository.", + "type": "string" + }, + "tag": { + "description": "The name of the tag that captures the state of the repository from\nwhich the function should be fetched.", + "type": "string" + }, + "branch": { + "description": "The name of the branch from which the function should be fetched.", + "type": "string" + }, + "sourcePath": { + "description": "The path within the repository where the function is defined. The path\nshould point to the directory where Cloud Functions files are located. Use\n\"/\" if the function is defined directly in the root directory of a\nrepository.", + "type": "string" + }, + "deployedRevision": { + "description": "Output only. The id of the revision that was resolved at the moment of\nfunction creation or update. For example when a user deployed from a\nbranch, it will be the revision id of the latest change on this branch at\nthat time. If user deployed from revision then this value will be always\nequal to the revision specified by the user.", + "type": "string" + }, + "revision": { + "description": "The id of the revision that captures the state of the repository from\nwhich the function should be fetched.", + "type": "string" + } + }, + "id": "SourceRepository" + }, + "CallFunctionRequest": { + "description": "Request for the `CallFunction` method.", + "type": "object", + "properties": { + "data": { + "description": "Input to be passed to the function.", + "type": "string" + } + }, + "id": "CallFunctionRequest" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "canonicalName": "Cloud Functions", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudfunctions.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudfunctions", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Functions API", + "ownerName": "Google" +} diff --git a/etc/api/cloudkms/v1/cloudkms-api.json b/etc/api/cloudkms/v1/cloudkms-api.json new file mode 100644 index 0000000000..5fe4bf1167 --- /dev/null +++ b/etc/api/cloudkms/v1/cloudkms-api.json @@ -0,0 +1,1353 @@ +{ + "version": "v1", + "baseUrl": "https://cloudkms.googleapis.com/", + "servicePath": "", + "description": "Manages encryption for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256 encryption keys.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170919", + "id": "cloudkms:v1", + "documentationLink": "https://cloud.google.com/kms/", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "RestoreCryptoKeyVersionRequest": { + "properties": {}, + "id": "RestoreCryptoKeyVersionRequest", + "description": "Request message for KeyManagementService.RestoreCryptoKeyVersion.", + "type": "object" + }, + "UpdateCryptoKeyPrimaryVersionRequest": { + "description": "Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion.", + "type": "object", + "properties": { + "cryptoKeyVersionId": { + "description": "The id of the child CryptoKeyVersion to use as primary.", + "type": "string" + } + }, + "id": "UpdateCryptoKeyPrimaryVersionRequest" + }, + "ListKeyRingsResponse": { + "description": "Response message for KeyManagementService.ListKeyRings.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this value in\nListKeyRingsRequest.page_token to retrieve the next page of results.", + "type": "string" + }, + "totalSize": { + "format": "int32", + "description": "The total number of KeyRings that matched the query.", + "type": "integer" + }, + "keyRings": { + "description": "The list of KeyRings.", + "items": { + "$ref": "KeyRing" + }, + "type": "array" + } + }, + "id": "ListKeyRingsResponse" + }, + "AuditConfig": { + "properties": { + "exemptedMembers": { + "items": { + "type": "string" + }, + "type": "array" + }, + "service": { + "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services.", + "type": "string" + }, + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.\nNext ID: 4", + "items": { + "$ref": "AuditLogConfig" + }, + "type": "array" + } + }, + "id": "AuditConfig", + "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", + "type": "object" + }, + "CryptoKeyVersion": { + "properties": { + "state": { + "enumDescriptions": [ + "Not specified.", + "This version may be used in Encrypt and\nDecrypt requests.", + "This version may not be used, but the key material is still available,\nand the version can be placed back into the ENABLED state.", + "This version is destroyed, and the key material is no longer stored.\nA version may not leave this state once entered.", + "This version is scheduled for destruction, and will be destroyed soon.\nCall\nRestoreCryptoKeyVersion\nto put it back into the DISABLED state." + ], + "enum": [ + "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED", + "ENABLED", + "DISABLED", + "DESTROYED", + "DESTROY_SCHEDULED" + ], + "description": "The current state of the CryptoKeyVersion.", + "type": "string" + }, + "name": { + "description": "Output only. The resource name for this CryptoKeyVersion in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.", + "type": "string" + }, + "destroyEventTime": { + "format": "google-datetime", + "description": "Output only. The time this CryptoKeyVersion's key material was\ndestroyed. Only present if state is\nDESTROYED.", + "type": "string" + }, + "destroyTime": { + "format": "google-datetime", + "description": "Output only. The time this CryptoKeyVersion's key material is scheduled\nfor destruction. Only present if state is\nDESTROY_SCHEDULED.", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "Output only. The time at which this CryptoKeyVersion was created.", + "type": "string" + } + }, + "id": "CryptoKeyVersion", + "description": "A CryptoKeyVersion represents an individual cryptographic key, and the\nassociated key material.\n\nIt can be used for cryptographic operations either directly, or via its\nparent CryptoKey, in which case the server will choose the appropriate\nversion for the operation.\n\nFor security reasons, the raw cryptographic key material represented by a\nCryptoKeyVersion can never be viewed or exported. It can only be used to\nencrypt or decrypt data when an authorized user or application invokes Cloud\nKMS.", + "type": "object" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them.", + "$ref": "Policy" + }, + "updateMask": { + "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", + "type": "string" + } + }, + "id": "SetIamPolicyRequest" + }, + "DecryptRequest": { + "properties": { + "additionalAuthenticatedData": { + "format": "byte", + "description": "Optional data that must match the data originally supplied in\nEncryptRequest.additional_authenticated_data.", + "type": "string" + }, + "ciphertext": { + "format": "byte", + "description": "Required. The encrypted data originally returned in\nEncryptResponse.ciphertext.", + "type": "string" + } + }, + "id": "DecryptRequest", + "description": "Request message for KeyManagementService.Decrypt.", + "type": "object" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "condition": { + "description": "The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently.\nThis field is GOOGLE_INTERNAL.", + "$ref": "Expr" + }, + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" + }, + "Expr": { + "description": "Represents an expression text. Example:\n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\"", + "type": "object", + "properties": { + "description": { + "description": "An optional description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI.", + "type": "string" + }, + "expression": { + "description": "Textual representation of an expression in\nCommon Expression Language syntax.\n\nThe application context of the containing message determines which\nwell-known feature set of CEL is supported.", + "type": "string" + }, + "location": { + "description": "An optional string indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file.", + "type": "string" + }, + "title": { + "description": "An optional title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.", + "type": "string" + } + }, + "id": "Expr" + }, + "EncryptRequest": { + "description": "Request message for KeyManagementService.Encrypt.", + "type": "object", + "properties": { + "plaintext": { + "format": "byte", + "description": "Required. The data to encrypt. Must be no larger than 64KiB.", + "type": "string" + }, + "additionalAuthenticatedData": { + "format": "byte", + "description": "Optional data that, if specified, must also be provided during decryption\nthrough DecryptRequest.additional_authenticated_data. Must be no\nlarger than 64KiB.", + "type": "string" + } + }, + "id": "EncryptRequest" + }, + "ListCryptoKeyVersionsResponse": { + "description": "Response message for KeyManagementService.ListCryptoKeyVersions.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this value in\nListCryptoKeyVersionsRequest.page_token to retrieve the next page of\nresults.", + "type": "string" + }, + "totalSize": { + "format": "int32", + "description": "The total number of CryptoKeyVersions that matched the\nquery.", + "type": "integer" + }, + "cryptoKeyVersions": { + "description": "The list of CryptoKeyVersions.", + "items": { + "$ref": "CryptoKeyVersion" + }, + "type": "array" + } + }, + "id": "ListCryptoKeyVersionsResponse" + }, + "Location": { + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object" + }, + "name": { + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", + "type": "string" + }, + "locationId": { + "description": "The canonical id for this location. For example: `\"us-east1\"`.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", + "type": "object" + } + }, + "id": "Location", + "description": "A resource that represents Google Cloud Platform location.", + "type": "object" + }, + "ListCryptoKeysResponse": { + "description": "Response message for KeyManagementService.ListCryptoKeys.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this value in\nListCryptoKeysRequest.page_token to retrieve the next page of results.", + "type": "string" + }, + "totalSize": { + "format": "int32", + "description": "The total number of CryptoKeys that matched the query.", + "type": "integer" + }, + "cryptoKeys": { + "description": "The list of CryptoKeys.", + "items": { + "$ref": "CryptoKey" + }, + "type": "array" + } + }, + "id": "ListCryptoKeysResponse" + }, + "TestIamPermissionsResponse": { + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse", + "description": "Response message for `TestIamPermissions` method.", + "type": "object" + }, + "DestroyCryptoKeyVersionRequest": { + "properties": {}, + "id": "DestroyCryptoKeyVersionRequest", + "description": "Request message for KeyManagementService.DestroyCryptoKeyVersion.", + "type": "object" + }, + "AuditLogConfig": { + "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", + "type": "object", + "properties": { + "exemptedMembers": { + "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members.", + "items": { + "type": "string" + }, + "type": "array" + }, + "logType": { + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ], + "enum": [ + "LOG_TYPE_UNSPECIFIED", + "ADMIN_READ", + "DATA_WRITE", + "DATA_READ" + ], + "description": "The log type that this config enables.", + "type": "string" + } + }, + "id": "AuditLogConfig" + }, + "CryptoKey": { + "properties": { + "purpose": { + "enum": [ + "CRYPTO_KEY_PURPOSE_UNSPECIFIED", + "ENCRYPT_DECRYPT" + ], + "description": "The immutable purpose of this CryptoKey. Currently, the only acceptable\npurpose is ENCRYPT_DECRYPT.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "CryptoKeys with this purpose may be used with\nEncrypt and\nDecrypt." + ] + }, + "nextRotationTime": { + "format": "google-datetime", + "description": "At next_rotation_time, the Key Management Service will automatically:\n\n1. Create a new version of this CryptoKey.\n2. Mark the new version as primary.\n\nKey rotations performed manually via\nCreateCryptoKeyVersion and\nUpdateCryptoKeyPrimaryVersion\ndo not affect next_rotation_time.", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "Output only. The time at which this CryptoKey was created.", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels with user defined metadata.", + "type": "object" + }, + "rotationPeriod": { + "format": "google-duration", + "description": "next_rotation_time will be advanced by this period when the service\nautomatically rotates a key. Must be at least one day.\n\nIf rotation_period is set, next_rotation_time must also be set.", + "type": "string" + }, + "primary": { + "$ref": "CryptoKeyVersion", + "description": "Output only. A copy of the \"primary\" CryptoKeyVersion that will be used\nby Encrypt when this CryptoKey is given\nin EncryptRequest.name.\n\nThe CryptoKey's primary version can be updated via\nUpdateCryptoKeyPrimaryVersion." + }, + "name": { + "description": "Output only. The resource name for this CryptoKey in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*`.", + "type": "string" + } + }, + "id": "CryptoKey", + "description": "A CryptoKey represents a logical key that can be used for cryptographic\noperations.\n\nA CryptoKey is made up of one or more versions, which\nrepresent the actual key material used in cryptographic operations.", + "type": "object" + }, + "DecryptResponse": { + "properties": { + "plaintext": { + "format": "byte", + "description": "The decrypted data originally supplied in EncryptRequest.plaintext.", + "type": "string" + } + }, + "id": "DecryptResponse", + "description": "Response message for KeyManagementService.Decrypt.", + "type": "object" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + }, + "type": "array" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, + "iamOwned": { + "type": "boolean" + } + }, + "id": "Policy" + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + } + }, + "id": "ListLocationsResponse" + }, + "KeyRing": { + "description": "A KeyRing is a toplevel logical grouping of CryptoKeys.", + "type": "object", + "properties": { + "createTime": { + "format": "google-datetime", + "description": "Output only. The time at which this KeyRing was created.", + "type": "string" + }, + "name": { + "description": "Output only. The resource name for the KeyRing in the format\n`projects/*/locations/*/keyRings/*`.", + "type": "string" + } + }, + "id": "KeyRing" + }, + "EncryptResponse": { + "description": "Response message for KeyManagementService.Encrypt.", + "type": "object", + "properties": { + "name": { + "description": "The resource name of the CryptoKeyVersion used in encryption.", + "type": "string" + }, + "ciphertext": { + "format": "byte", + "description": "The encrypted data.", + "type": "string" + } + }, + "id": "EncryptResponse" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Cloud KMS", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudkms.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudkms", + "batchPath": "batch", + "title": "Google Cloud Key Management Service (KMS) API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "methods": { + "get": { + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "response": { + "$ref": "Location" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Resource name for the location.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + "id": "cloudkms.projects.locations.get", + "path": "v1/{+name}", + "description": "Get information about a location." + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "name": { + "description": "The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + }, + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations", + "path": "v1/{+name}/locations", + "id": "cloudkms.projects.locations.list", + "description": "Lists information about the supported locations for this service." + } + }, + "resources": { + "keyRings": { + "methods": { + "create": { + "response": { + "$ref": "KeyRing" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Required. The resource name of the location associated with the\nKeyRings, in the format `projects/*/locations/*`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + }, + "keyRingId": { + "description": "Required. It must be unique within a location and match the regular\nexpression `[a-zA-Z0-9_-]{1,63}`", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings", + "id": "cloudkms.projects.locations.keyRings.create", + "path": "v1/{+parent}/keyRings", + "description": "Create a new KeyRing in a given Project and Location.", + "request": { + "$ref": "KeyRing" + } + }, + "setIamPolicy": { + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:setIamPolicy", + "id": "cloudkms.projects.locations.keyRings.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy" + }, + "getIamPolicy": { + "httpMethod": "GET", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "cloudkms.projects.locations.keyRings.getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset." + }, + "get": { + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.keyRings.get", + "description": "Returns metadata for a given KeyRing.", + "httpMethod": "GET", + "response": { + "$ref": "KeyRing" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the KeyRing to get.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}" + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "cloudkms.projects.locations.keyRings.testIamPermissions" + }, + "list": { + "description": "Lists KeyRings.", + "response": { + "$ref": "ListKeyRingsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "Required. The resource name of the location associated with the\nKeyRings, in the format `projects/*/locations/*`.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "Optional pagination token, returned earlier via\nListKeyRingsResponse.next_page_token.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional limit on the number of KeyRings to include in the\nresponse. Further KeyRings can subsequently be obtained by\nincluding the ListKeyRingsResponse.next_page_token in a subsequent\nrequest. If unspecified, the server will pick an appropriate default.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings", + "id": "cloudkms.projects.locations.keyRings.list", + "path": "v1/{+parent}/keyRings" + } + }, + "resources": { + "cryptoKeys": { + "methods": { + "updatePrimaryVersion": { + "response": { + "$ref": "CryptoKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "The resource name of the CryptoKey to update.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:updatePrimaryVersion", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion", + "path": "v1/{+name}:updatePrimaryVersion", + "request": { + "$ref": "UpdateCryptoKeyPrimaryVersionRequest" + }, + "description": "Update the version of a CryptoKey that will be used in Encrypt" + }, + "getIamPolicy": { + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:getIamPolicy", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy" + }, + "get": { + "description": "Returns metadata for a given CryptoKey, as well as its\nprimary CryptoKeyVersion.", + "response": { + "$ref": "CryptoKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "The name of the CryptoKey to get.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.get", + "path": "v1/{+name}" + }, + "patch": { + "request": { + "$ref": "CryptoKey" + }, + "description": "Update a CryptoKey.", + "response": { + "$ref": "CryptoKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Required list of fields to be updated in this request.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "Output only. The resource name for this CryptoKey in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.patch", + "path": "v1/{+name}" + }, + "testIamPermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." + }, + "decrypt": { + "path": "v1/{+name}:decrypt", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.decrypt", + "description": "Decrypts data that was protected by Encrypt.", + "request": { + "$ref": "DecryptRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "DecryptResponse" + }, + "parameters": { + "name": { + "description": "Required. The resource name of the CryptoKey to use for decryption.\nThe server will choose the appropriate version.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:decrypt" + }, + "list": { + "description": "Lists CryptoKeys.", + "response": { + "$ref": "ListCryptoKeysResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "Optional pagination token, returned earlier via\nListCryptoKeysResponse.next_page_token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional limit on the number of CryptoKeys to include in the\nresponse. Further CryptoKeys can subsequently be obtained by\nincluding the ListCryptoKeysResponse.next_page_token in a subsequent\nrequest. If unspecified, the server will pick an appropriate default.", + "type": "integer" + }, + "parent": { + "description": "Required. The resource name of the KeyRing to list, in the format\n`projects/*/locations/*/keyRings/*`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.list", + "path": "v1/{+parent}/cryptoKeys" + }, + "encrypt": { + "request": { + "$ref": "EncryptRequest" + }, + "description": "Encrypts data, so that it can only be recovered by a call to Decrypt.", + "response": { + "$ref": "EncryptResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/.+$", + "location": "path", + "description": "Required. The resource name of the CryptoKey or CryptoKeyVersion\nto use for encryption.\n\nIf a CryptoKey is specified, the server will use its\nprimary version.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:encrypt", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.encrypt", + "path": "v1/{+name}:encrypt" + }, + "create": { + "description": "Create a new CryptoKey within a KeyRing.\n\nCryptoKey.purpose is required.", + "request": { + "$ref": "CryptoKey" + }, + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "CryptoKey" + }, + "parameters": { + "cryptoKeyId": { + "description": "Required. It must be unique within a KeyRing and match the regular\nexpression `[a-zA-Z0-9_-]{1,63}`", + "type": "string", + "location": "query" + }, + "parent": { + "description": "Required. The name of the KeyRing associated with the\nCryptoKeys.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys", + "path": "v1/{+parent}/cryptoKeys", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.create" + }, + "setIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:setIamPolicy", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "SetIamPolicyRequest" + } + } + }, + "resources": { + "cryptoKeyVersions": { + "methods": { + "restore": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$", + "location": "path", + "description": "The resource name of the CryptoKeyVersion to restore.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}:restore", + "path": "v1/{+name}:restore", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore", + "description": "Restore a CryptoKeyVersion in the\nDESTROY_SCHEDULED,\nstate.\n\nUpon restoration of the CryptoKeyVersion, state\nwill be set to DISABLED,\nand destroy_time will be cleared.", + "request": { + "$ref": "RestoreCryptoKeyVersionRequest" + } + }, + "patch": { + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch", + "path": "v1/{+name}", + "description": "Update a CryptoKeyVersion's metadata.\n\nstate may be changed between\nENABLED and\nDISABLED using this\nmethod. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to\nmove between other states.", + "request": { + "$ref": "CryptoKeyVersion" + }, + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Required list of fields to be updated in this request.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$", + "location": "path", + "description": "Output only. The resource name for this CryptoKeyVersion in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}" + }, + "get": { + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get", + "path": "v1/{+name}", + "description": "Returns metadata for a given CryptoKeyVersion.", + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$", + "location": "path", + "description": "The name of the CryptoKeyVersion to get.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}" + }, + "list": { + "path": "v1/{+parent}/cryptoKeyVersions", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list", + "description": "Lists CryptoKeyVersions.", + "httpMethod": "GET", + "response": { + "$ref": "ListCryptoKeyVersionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageToken": { + "description": "Optional pagination token, returned earlier via\nListCryptoKeyVersionsResponse.next_page_token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Optional limit on the number of CryptoKeyVersions to\ninclude in the response. Further CryptoKeyVersions can\nsubsequently be obtained by including the\nListCryptoKeyVersionsResponse.next_page_token in a subsequent request.\nIf unspecified, the server will pick an appropriate default.", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The resource name of the CryptoKey to list, in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions" + }, + "destroy": { + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$", + "location": "path", + "description": "The resource name of the CryptoKeyVersion to destroy.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}:destroy", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy", + "path": "v1/{+name}:destroy", + "request": { + "$ref": "DestroyCryptoKeyVersionRequest" + }, + "description": "Schedule a CryptoKeyVersion for destruction.\n\nUpon calling this method, CryptoKeyVersion.state will be set to\nDESTROY_SCHEDULED\nand destroy_time will be set to a time 24\nhours in the future, at which point the state\nwill be changed to\nDESTROYED, and the key\nmaterial will be irrevocably destroyed.\n\nBefore the destroy_time is reached,\nRestoreCryptoKeyVersion may be called to reverse the process." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "CryptoKeyVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "Required. The name of the CryptoKey associated with\nthe CryptoKeyVersions.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions", + "path": "v1/{+parent}/cryptoKeyVersions", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create", + "request": { + "$ref": "CryptoKeyVersion" + }, + "description": "Create a new CryptoKeyVersion in a CryptoKey.\n\nThe server will assign the next sequential id. If unset,\nstate will be set to\nENABLED." + } + } + } + } + } + } + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + } + } +} diff --git a/etc/api/cloudkms/v1/crates/1.0.6-api+20170919 b/etc/api/cloudkms/v1/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudkms/v1/crates/1.0.6-cli+20170919 b/etc/api/cloudkms/v1/crates/1.0.6-cli+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json b/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json index 8910233454..16d7b4fb80 100644 --- a/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json +++ b/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json @@ -21,7 +21,7 @@ "basePath": "/cloudmonitoring/v2beta2/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "cloudmonitoring/v2beta2/projects/", - "batchPath": "batch", + "batchPath": "batch/cloudmonitoring/v2beta2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json index 915d414a31..58e88fdf8d 100644 --- a/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json +++ b/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json @@ -1,581 +1,19 @@ { - "id": "cloudresourcemanager:v1", - "documentationLink": "https://cloud.google.com/resource-manager", - "revision": "20170517", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, "title": "Google Cloud Resource Manager API", - "discoveryVersion": "v1", "ownerName": "Google", "resources": { - "liens": { - "methods": { - "create": { - "flatPath": "v1/liens", - "path": "v1/liens", - "id": "cloudresourcemanager.liens.create", - "description": "Create a Lien which applies to the resource denoted by the `parent` field.\n\nCallers of this method will require permission on the `parent` resource.\nFor example, applying to `projects/1234` requires permission\n`resourcemanager.projects.updateLiens`.\n\nNOTE: Some resources may limit the number of Liens which may be applied.", - "request": { - "$ref": "Lien" - }, - "response": { - "$ref": "Lien" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": {} - }, - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "DELETE", - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^liens/.+$", - "location": "path", - "description": "The name/identifier of the Lien to delete." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/liens/{liensId}", - "path": "v1/{+name}", - "id": "cloudresourcemanager.liens.delete", - "description": "Delete a Lien by `name`.\n\nCallers of this method will require permission on the `parent` resource.\nFor example, a Lien with a `parent` of `projects/1234` requires permission\n`resourcemanager.projects.updateLiens`." - }, - "list": { - "description": "List all Liens applied to the `parent` resource.\n\nCallers of this method will require permission on the `parent` resource.\nFor example, a Lien with a `parent` of `projects/1234` requires permission\n`resourcemanager.projects.get`.", - "httpMethod": "GET", - "response": { - "$ref": "ListLiensResponse" - }, - "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "pageToken": { - "description": "The `next_page_token` value returned from a previous List request, if any.", - "type": "string", - "location": "query" - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "The maximum number of items to return. This is a suggestion for the server.", - "format": "int32" - }, - "parent": { - "type": "string", - "location": "query", - "description": "The name of the resource to list all attached Liens.\nFor example, `projects/1234`." - } - }, - "flatPath": "v1/liens", - "id": "cloudresourcemanager.liens.list", - "path": "v1/liens" - } - } - }, - "operations": { - "methods": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation resource.", - "required": true, - "type": "string", - "pattern": "^operations/.+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/operations/{operationsId}", - "id": "cloudresourcemanager.operations.get", - "path": "v1/{+name}" - } - } - }, - "folders": { - "methods": { - "listAvailableOrgPolicyConstraints": { - "description": "Lists `Constraints` that could be applied on the specified resource.", - "request": { - "$ref": "ListAvailableOrgPolicyConstraintsRequest" - }, - "response": { - "$ref": "ListAvailableOrgPolicyConstraintsResponse" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "resource": { - "pattern": "^folders/[^/]+$", - "location": "path", - "description": "Name of the resource to list `Constraints` for.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/folders/{foldersId}:listAvailableOrgPolicyConstraints", - "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", - "id": "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints" - }, - "listOrgPolicies": { - "description": "Lists all the `Policies` set for a particular resource.", - "request": { - "$ref": "ListOrgPoliciesRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "ListOrgPoliciesResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$", - "location": "path", - "description": "Name of the resource to list Policies for." - } - }, - "flatPath": "v1/folders/{foldersId}:listOrgPolicies", - "id": "cloudresourcemanager.folders.listOrgPolicies", - "path": "v1/{+resource}:listOrgPolicies" - }, - "getOrgPolicy": { - "response": { - "$ref": "OrgPolicy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "resource": { - "location": "path", - "description": "Name of the resource the `Policy` is set on.", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$" - } - }, - "flatPath": "v1/folders/{foldersId}:getOrgPolicy", - "path": "v1/{+resource}:getOrgPolicy", - "id": "cloudresourcemanager.folders.getOrgPolicy", - "description": "Gets a `Policy` on a resource.\n\nIf no `Policy` is set on the resource, a `Policy` is returned with default\nvalues including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The\n`etag` value can be used with `SetOrgPolicy()` to create or update a\n`Policy` during read-modify-write.", - "request": { - "$ref": "GetOrgPolicyRequest" - } - }, - "getEffectiveOrgPolicy": { - "request": { - "$ref": "GetEffectiveOrgPolicyRequest" - }, - "description": "Gets the effective `Policy` on a resource. This is the result of merging\n`Policies` in the resource hierarchy. The returned `Policy` will not have\nan `etag`set because it is a computed `Policy` across multiple resources.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "OrgPolicy" - }, - "parameters": { - "resource": { - "location": "path", - "description": "The name of the resource to start computing the effective `Policy`.", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/folders/{foldersId}:getEffectiveOrgPolicy", - "id": "cloudresourcemanager.folders.getEffectiveOrgPolicy", - "path": "v1/{+resource}:getEffectiveOrgPolicy" - }, - "clearOrgPolicy": { - "description": "Clears a `Policy` from a resource.", - "request": { - "$ref": "ClearOrgPolicyRequest" - }, - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "resource": { - "pattern": "^folders/[^/]+$", - "location": "path", - "description": "Name of the resource for the `Policy` to clear.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/folders/{foldersId}:clearOrgPolicy", - "path": "v1/{+resource}:clearOrgPolicy", - "id": "cloudresourcemanager.folders.clearOrgPolicy" - }, - "setOrgPolicy": { - "request": { - "$ref": "SetOrgPolicyRequest" - }, - "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for\nthat `Constraint` on the resource if one does not exist.\n\nNot supplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "OrgPolicy" - }, - "parameters": { - "resource": { - "location": "path", - "description": "Resource name of the resource to attach the `Policy`.", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/folders/{foldersId}:setOrgPolicy", - "id": "cloudresourcemanager.folders.setOrgPolicy", - "path": "v1/{+resource}:setOrgPolicy" - } - } - }, "projects": { "methods": { - "listOrgPolicies": { - "request": { - "$ref": "ListOrgPoliciesRequest" - }, - "description": "Lists all the `Policies` set for a particular resource.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "ListOrgPoliciesResponse" - }, - "parameters": { - "resource": { - "description": "Name of the resource to list Policies for.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/projects/{projectsId}:listOrgPolicies", - "id": "cloudresourcemanager.projects.listOrgPolicies", - "path": "v1/{+resource}:listOrgPolicies" - }, - "get": { - "parameterOrder": [ - "projectId" - ], - "httpMethod": "GET", - "response": { - "$ref": "Project" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "projectId": { - "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectId}", - "path": "v1/projects/{projectId}", - "id": "cloudresourcemanager.projects.get", - "description": "Retrieves the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project." - }, - "getAncestry": { - "path": "v1/projects/{projectId}:getAncestry", - "id": "cloudresourcemanager.projects.getAncestry", - "request": { - "$ref": "GetAncestryRequest" - }, - "description": "Gets a list of ancestors in the resource hierarchy for the Project\nidentified by the specified `project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project.", - "response": { - "$ref": "GetAncestryResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "location": "path", - "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/projects/{projectId}:getAncestry" - }, - "testIamPermissions": { - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "description": "Returns permissions that a caller has on the specified Project.", - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/projects/{resource}:testIamPermissions", - "path": "v1/projects/{resource}:testIamPermissions", - "id": "cloudresourcemanager.projects.testIamPermissions" - }, - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "DELETE", - "parameters": { - "projectId": { - "description": "The Project ID (for example, `foo-bar-123`).\n\nRequired.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}", - "path": "v1/projects/{projectId}", - "id": "cloudresourcemanager.projects.delete", - "description": "Marks the Project identified by the specified\n`project_id` (for example, `my-project-123`) for deletion.\nThis method will only affect the Project if the following criteria are met:\n\n+ The Project does not have a billing account associated with it.\n+ The Project has a lifecycle state of\nACTIVE.\n\nThis method changes the Project's lifecycle state from\nACTIVE\nto DELETE_REQUESTED.\nThe deletion starts at an unspecified time,\nat which point the Project is no longer accessible.\n\nUntil the deletion completes, you can check the lifecycle state\nchecked by retrieving the Project with GetProject,\nand the Project remains visible to ListProjects.\nHowever, you cannot update the project.\n\nAfter the deletion completes, the Project is not retrievable by\nthe GetProject and\nListProjects methods.\n\nThe caller must have modify permissions for this Project." - }, - "clearOrgPolicy": { - "request": { - "$ref": "ClearOrgPolicyRequest" - }, - "description": "Clears a `Policy` from a resource.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Name of the resource for the `Policy` to clear." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}:clearOrgPolicy", - "id": "cloudresourcemanager.projects.clearOrgPolicy", - "path": "v1/{+resource}:clearOrgPolicy" - }, - "setIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{resource}:setIamPolicy", - "id": "cloudresourcemanager.projects.setIamPolicy", - "path": "v1/projects/{resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the IAM access control policy for the specified Project. Replaces\nany existing policy.\n\nThe following constraints apply when using `setIamPolicy()`:\n\n+ Project does not support `allUsers` and `allAuthenticatedUsers` as\n`members` in a `Binding` of a `Policy`.\n\n+ The owner role can be granted only to `user` and `serviceAccount`.\n\n+ Service accounts can be made owners of a project directly\nwithout any restrictions. However, to be added as an owner, a user must be\ninvited via Cloud Platform console and must accept the invitation.\n\n+ A user cannot be granted the owner role using `setIamPolicy()`. The user\nmust be granted the owner role using the Cloud Platform Console and must\nexplicitly accept the invitation.\n\n+ Invitations to grant the owner role cannot be sent using\n`setIamPolicy()`;\nthey must be sent only using the Cloud Platform Console.\n\n+ Membership changes that leave the project without any owners that have\naccepted the Terms of Service (ToS) will be rejected.\n\n+ There must be at least one owner who has accepted the Terms of\nService (ToS) agreement in the policy. Calling `setIamPolicy()` to\nremove the last ToS-accepted owner from the policy will fail. This\nrestriction also applies to legacy projects that no longer have owners\nwho have accepted the ToS. Edits to IAM policies will be rejected until\nthe lack of a ToS-accepting owner is rectified.\n\n+ Calling this method requires enabling the App Engine Admin API.\n\nNote: Removing service accounts from policies or changing their roles\ncan render services completely inoperable. It is important to understand\nhow the service account is being used before removing or updating its\nroles." - }, - "listAvailableOrgPolicyConstraints": { - "request": { - "$ref": "ListAvailableOrgPolicyConstraintsRequest" - }, - "description": "Lists `Constraints` that could be applied on the specified resource.", - "response": { - "$ref": "ListAvailableOrgPolicyConstraintsResponse" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Name of the resource to list `Constraints` for." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/projects/{projectsId}:listAvailableOrgPolicyConstraints", - "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", - "id": "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints" - }, - "getIamPolicy": { - "request": { - "$ref": "GetIamPolicyRequest" - }, - "description": "Returns the IAM access control policy for the specified Project.\nPermission is denied if the policy or the resource does not exist.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "required": true, - "type": "string", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/projects/{resource}:getIamPolicy", - "id": "cloudresourcemanager.projects.getIamPolicy", - "path": "v1/projects/{resource}:getIamPolicy" - }, "getOrgPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "OrgPolicy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "resource": { - "description": "Name of the resource the `Policy` is set on.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - } - }, "flatPath": "v1/projects/{projectsId}:getOrgPolicy", "id": "cloudresourcemanager.projects.getOrgPolicy", "path": "v1/{+resource}:getOrgPolicy", "description": "Gets a `Policy` on a resource.\n\nIf no `Policy` is set on the resource, a `Policy` is returned with default\nvalues including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The\n`etag` value can be used with `SetOrgPolicy()` to create or update a\n`Policy` during read-modify-write.", "request": { "$ref": "GetOrgPolicyRequest" - } - }, - "getEffectiveOrgPolicy": { - "request": { - "$ref": "GetEffectiveOrgPolicyRequest" }, - "description": "Gets the effective `Policy` on a resource. This is the result of merging\n`Policies` in the resource hierarchy. The returned `Policy` will not have\nan `etag`set because it is a computed `Policy` across multiple resources.", "response": { "$ref": "OrgPolicy" }, @@ -585,25 +23,22 @@ "httpMethod": "POST", "parameters": { "resource": { - "description": "The name of the resource to start computing the effective `Policy`.", - "required": true, + "location": "path", + "description": "Name of the resource the `Policy` is set on.", "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" + "required": true, + "pattern": "^projects/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/projects/{projectsId}:getEffectiveOrgPolicy", - "path": "v1/{+resource}:getEffectiveOrgPolicy", - "id": "cloudresourcemanager.projects.getEffectiveOrgPolicy" + ] }, "undelete": { "flatPath": "v1/projects/{projectId}:undelete", - "path": "v1/projects/{projectId}:undelete", "id": "cloudresourcemanager.projects.undelete", + "path": "v1/projects/{projectId}:undelete", "description": "Restores the Project identified by the specified\n`project_id` (for example, `my-project-123`).\nYou can only use this method for a Project that has a lifecycle state of\nDELETE_REQUESTED.\nAfter deletion starts, the Project cannot be restored.\n\nThe caller must have modify permissions for this Project.", "request": { "$ref": "UndeleteProjectRequest" @@ -615,19 +50,55 @@ "projectId" ], "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { "projectId": { "location": "path", "description": "The project ID (for example, `foo-bar-123`).\n\nRequired.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "getEffectiveOrgPolicy": { + "flatPath": "v1/projects/{projectsId}:getEffectiveOrgPolicy", + "id": "cloudresourcemanager.projects.getEffectiveOrgPolicy", + "path": "v1/{+resource}:getEffectiveOrgPolicy", + "request": { + "$ref": "GetEffectiveOrgPolicyRequest" + }, + "description": "Gets the effective `Policy` on a resource. This is the result of merging\n`Policies` in the resource hierarchy. The returned `Policy` will not have\nan `etag`set because it is a computed `Policy` across multiple resources.", + "response": { + "$ref": "OrgPolicy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "location": "path", + "description": "The name of the resource to start computing the effective `Policy`.", + "type": "string", "required": true, - "type": "string" + "pattern": "^projects/[^/]+$" } } }, "update": { + "flatPath": "v1/projects/{projectId}", + "path": "v1/projects/{projectId}", + "id": "cloudresourcemanager.projects.update", + "description": "Updates the attributes of the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have modify permissions for this Project.", + "request": { + "$ref": "Project" + }, "httpMethod": "PUT", "parameterOrder": [ "projectId" @@ -637,24 +108,18 @@ }, "parameters": { "projectId": { - "location": "path", "description": "The project ID (for example, `my-project-123`).\n\nRequired.", + "type": "string", "required": true, - "type": "string" + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}", - "id": "cloudresourcemanager.projects.update", - "path": "v1/projects/{projectId}", - "request": { - "$ref": "Project" - }, - "description": "Updates the attributes of the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have modify permissions for this Project." + ] }, "list": { + "description": "Lists Projects that are visible to the user and satisfy the\nspecified filter. This method returns Projects in an unspecified order.\nNew Projects do not necessarily appear at the end of the list.", "httpMethod": "GET", "parameterOrder": [], "response": { @@ -662,18 +127,18 @@ }, "parameters": { "filter": { - "location": "query", - "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red labels.size:big|The project's label `color` has the\nvalue `red` and its label `size` has the value `big`.\n\nOptional.", - "type": "string" + "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`.\n\nIf you specify a filter that has both `parent.type` and `parent.id`, then\nthe `resourcemanager.projects.list` permission is checked on the parent.\nIf the user has this permission, all projects under the parent will be\nreturned after remaining filters have been applied. If the user lacks this\npermission, then all projects for which the user has the\n`resourcemanager.projects.get` permission will be returned after remaining\nfilters have been applied. If no filter is specified, the call will return\nprojects for which the user has `resourcemanager.projects.get` permissions.\n\nOptional.", + "type": "string", + "location": "query" }, "pageToken": { - "location": "query", "description": "A pagination token returned from a previous call to ListProjects\nthat indicates from where listing should continue.\n\nOptional.", - "type": "string" + "type": "string", + "location": "query" }, "pageSize": { - "description": "The maximum number of Projects to return in the response.\nThe server can return fewer Projects than requested.\nIf unspecified, server picks an appropriate default.\n\nOptional.", "format": "int32", + "description": "The maximum number of Projects to return in the response.\nThe server can return fewer Projects than requested.\nIf unspecified, server picks an appropriate default.\n\nOptional.", "type": "integer", "location": "query" } @@ -683,32 +148,31 @@ "https://www.googleapis.com/auth/cloud-platform.read-only" ], "flatPath": "v1/projects", - "id": "cloudresourcemanager.projects.list", "path": "v1/projects", - "description": "Lists Projects that are visible to the user and satisfy the\nspecified filter. This method returns Projects in an unspecified order.\nNew Projects do not necessarily appear at the end of the list." + "id": "cloudresourcemanager.projects.list" }, "setOrgPolicy": { "flatPath": "v1/projects/{projectsId}:setOrgPolicy", "id": "cloudresourcemanager.projects.setOrgPolicy", "path": "v1/{+resource}:setOrgPolicy", + "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for\nthat `Constraint` on the resource if one does not exist.\n\nNot supplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`.", "request": { "$ref": "SetOrgPolicyRequest" }, - "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for\nthat `Constraint` on the resource if one does not exist.\n\nNot supplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], "response": { "$ref": "OrgPolicy" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", "parameters": { "resource": { - "pattern": "^projects/[^/]+$", "location": "path", "description": "Resource name of the resource to attach the `Policy`.", + "type": "string", "required": true, - "type": "string" + "pattern": "^projects/[^/]+$" } }, "scopes": [ @@ -716,218 +180,110 @@ ] }, "create": { - "path": "v1/projects", - "id": "cloudresourcemanager.projects.create", "request": { "$ref": "Project" }, - "description": "Request that a new Project be created. The result is an Operation which\ncan be used to track the creation process. It is automatically deleted\nafter a few hours, so there is no need to call DeleteOperation.\n\nOur SLO permits Project creation to take up to 30 seconds at the 90th\npercentile. As of 2016-08-29, we are observing 6 seconds 50th percentile\nlatency. 95th percentile latency is around 11 seconds. We recommend\npolling at the 5th second with an exponential backoff.", + "description": "Request that a new Project be created. The result is an Operation which\ncan be used to track the creation process. It is automatically deleted\nafter a few hours, so there is no need to call DeleteOperation.\n\nOur SLO permits Project creation to take up to 30 seconds at the 90th\npercentile. As of 2016-08-29, we are observing 6 seconds 50th percentile\nlatency. 95th percentile latency is around 11 seconds. We recommend\npolling at the 5th second with an exponential backoff.\n\nAuthorization requires the Google IAM permission\n`resourcemanager.projects.create` on the specified parent for the new\nproject.", "response": { "$ref": "Operation" }, "parameterOrder": [], "httpMethod": "POST", - "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects" - } - } - }, - "organizations": { - "methods": { - "listAvailableOrgPolicyConstraints": { - "request": { - "$ref": "ListAvailableOrgPolicyConstraintsRequest" - }, - "description": "Lists `Constraints` that could be applied on the specified resource.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "ListAvailableOrgPolicyConstraintsResponse" - }, - "parameters": { - "resource": { - "pattern": "^organizations/[^/]+$", - "location": "path", - "description": "Name of the resource to list `Constraints` for.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/organizations/{organizationsId}:listAvailableOrgPolicyConstraints", - "id": "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints", - "path": "v1/{+resource}:listAvailableOrgPolicyConstraints" + "parameters": {}, + "flatPath": "v1/projects", + "id": "cloudresourcemanager.projects.create", + "path": "v1/projects" }, "listOrgPolicies": { "request": { "$ref": "ListOrgPoliciesRequest" }, "description": "Lists all the `Policies` set for a particular resource.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], "response": { "$ref": "ListOrgPoliciesResponse" }, - "parameterOrder": [ - "resource" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" ], - "httpMethod": "POST", "parameters": { "resource": { - "pattern": "^organizations/[^/]+$", - "location": "path", "description": "Name of the resource to list Policies for.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/organizations/{organizationsId}:listOrgPolicies", - "path": "v1/{+resource}:listOrgPolicies", - "id": "cloudresourcemanager.organizations.listOrgPolicies" - }, - "getIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "pattern": "^organizations/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/organizations/{organizationsId}:getIamPolicy", - "id": "cloudresourcemanager.organizations.getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "request": { - "$ref": "GetIamPolicyRequest" - }, - "description": "Gets the access control policy for an Organization resource. May be empty\nif no such policy or resource exists. The `resource` field should be the\norganization's resource name, e.g. \"organizations/123\"." - }, - "getOrgPolicy": { - "flatPath": "v1/organizations/{organizationsId}:getOrgPolicy", - "path": "v1/{+resource}:getOrgPolicy", - "id": "cloudresourcemanager.organizations.getOrgPolicy", - "description": "Gets a `Policy` on a resource.\n\nIf no `Policy` is set on the resource, a `Policy` is returned with default\nvalues including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The\n`etag` value can be used with `SetOrgPolicy()` to create or update a\n`Policy` during read-modify-write.", - "request": { - "$ref": "GetOrgPolicyRequest" - }, - "response": { - "$ref": "OrgPolicy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "resource": { - "location": "path", - "description": "Name of the resource the `Policy` is set on.", - "required": true, "type": "string", - "pattern": "^organizations/[^/]+$" - } - } - }, - "search": { - "description": "Searches Organization resources that are visible to the user and satisfy\nthe specified filter. This method returns Organizations in an unspecified\norder. New Organizations do not necessarily appear at the end of the\nresults.", - "request": { - "$ref": "SearchOrganizationsRequest" - }, - "response": { - "$ref": "SearchOrganizationsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": {}, - "flatPath": "v1/organizations:search", - "path": "v1/organizations:search", - "id": "cloudresourcemanager.organizations.search" - }, - "getEffectiveOrgPolicy": { - "request": { - "$ref": "GetEffectiveOrgPolicyRequest" - }, - "description": "Gets the effective `Policy` on a resource. This is the result of merging\n`Policies` in the resource hierarchy. The returned `Policy` will not have\nan `etag`set because it is a computed `Policy` across multiple resources.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "OrgPolicy" - }, - "parameters": { - "resource": { - "pattern": "^organizations/[^/]+$", - "location": "path", - "description": "The name of the resource to start computing the effective `Policy`.", "required": true, - "type": "string" + "pattern": "^projects/[^/]+$", + "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1/organizations/{organizationsId}:getEffectiveOrgPolicy", - "id": "cloudresourcemanager.organizations.getEffectiveOrgPolicy", - "path": "v1/{+resource}:getEffectiveOrgPolicy" + "flatPath": "v1/projects/{projectsId}:listOrgPolicies", + "path": "v1/{+resource}:listOrgPolicies", + "id": "cloudresourcemanager.projects.listOrgPolicies" }, "get": { - "id": "cloudresourcemanager.organizations.get", - "path": "v1/{+name}", - "description": "Fetches an Organization resource identified by the specified resource name.", - "httpMethod": "GET", "response": { - "$ref": "Organization" + "$ref": "Project" }, "parameterOrder": [ - "name" + "projectId" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { - "name": { - "location": "path", - "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".", - "required": true, + "projectId": { + "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", "type": "string", - "pattern": "^organizations/[^/]+$" + "required": true, + "location": "path" } }, - "flatPath": "v1/organizations/{organizationsId}" + "flatPath": "v1/projects/{projectId}", + "id": "cloudresourcemanager.projects.get", + "path": "v1/projects/{projectId}", + "description": "Retrieves the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project." + }, + "getAncestry": { + "request": { + "$ref": "GetAncestryRequest" + }, + "description": "Gets a list of ancestors in the resource hierarchy for the Project\nidentified by the specified `project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "GetAncestryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}:getAncestry", + "path": "v1/projects/{projectId}:getAncestry", + "id": "cloudresourcemanager.projects.getAncestry" }, "testIamPermissions": { + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified Project.\n\nThere are no permissions required for making this API call.", "response": { "$ref": "TestIamPermissionsResponse" }, @@ -935,90 +291,79 @@ "resource" ], "httpMethod": "POST", - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$" - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], - "flatPath": "v1/organizations/{organizationsId}:testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", - "id": "cloudresourcemanager.organizations.testIamPermissions", - "request": { - "$ref": "TestIamPermissionsRequest" + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "location": "path" + } }, - "description": "Returns permissions that a caller has on the specified Organization.\nThe `resource` field should be the organization's resource name,\ne.g. \"organizations/123\"." + "flatPath": "v1/projects/{resource}:testIamPermissions", + "id": "cloudresourcemanager.projects.testIamPermissions", + "path": "v1/projects/{resource}:testIamPermissions" + }, + "delete": { + "flatPath": "v1/projects/{projectId}", + "id": "cloudresourcemanager.projects.delete", + "path": "v1/projects/{projectId}", + "description": "Marks the Project identified by the specified\n`project_id` (for example, `my-project-123`) for deletion.\nThis method will only affect the Project if the following criteria are met:\n\n+ The Project does not have a billing account associated with it.\n+ The Project has a lifecycle state of\nACTIVE.\n\nThis method changes the Project's lifecycle state from\nACTIVE\nto DELETE_REQUESTED.\nThe deletion starts at an unspecified time,\nat which point the Project is no longer accessible.\n\nUntil the deletion completes, you can check the lifecycle state\nchecked by retrieving the Project with GetProject,\nand the Project remains visible to ListProjects.\nHowever, you cannot update the project.\n\nAfter the deletion completes, the Project is not retrievable by\nthe GetProject and\nListProjects methods.\n\nThe caller must have modify permissions for this Project.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Project ID (for example, `foo-bar-123`).\n\nRequired.", + "type": "string", + "required": true, + "location": "path" + } + } }, "clearOrgPolicy": { + "flatPath": "v1/projects/{projectsId}:clearOrgPolicy", + "path": "v1/{+resource}:clearOrgPolicy", + "id": "cloudresourcemanager.projects.clearOrgPolicy", + "request": { + "$ref": "ClearOrgPolicyRequest" + }, + "description": "Clears a `Policy` from a resource.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Empty" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "resource": { "description": "Name of the resource for the `Policy` to clear.", - "required": true, "type": "string", - "pattern": "^organizations/[^/]+$", + "required": true, + "pattern": "^projects/[^/]+$", "location": "path" } - }, - "flatPath": "v1/organizations/{organizationsId}:clearOrgPolicy", - "path": "v1/{+resource}:clearOrgPolicy", - "id": "cloudresourcemanager.organizations.clearOrgPolicy", - "description": "Clears a `Policy` from a resource.", - "request": { - "$ref": "ClearOrgPolicyRequest" - }, - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST" - }, - "setOrgPolicy": { - "response": { - "$ref": "OrgPolicy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "parameters": { - "resource": { - "description": "Resource name of the resource to attach the `Policy`.", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/organizations/{organizationsId}:setOrgPolicy", - "path": "v1/{+resource}:setOrgPolicy", - "id": "cloudresourcemanager.organizations.setOrgPolicy", - "request": { - "$ref": "SetOrgPolicyRequest" - }, - "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for\nthat `Constraint` on the resource if one does not exist.\n\nNot supplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`." + } }, "setIamPolicy": { - "path": "v1/{+resource}:setIamPolicy", - "id": "cloudresourcemanager.organizations.setIamPolicy", - "description": "Sets the access control policy on an Organization resource. Replaces any\nexisting policy. The `resource` field should be the organization's resource\nname, e.g. \"organizations/123\".", "request": { "$ref": "SetIamPolicyRequest" }, + "description": "Sets the IAM access control policy for the specified Project. Replaces\nany existing policy.\n\nThe following constraints apply when using `setIamPolicy()`:\n\n+ Project does not support `allUsers` and `allAuthenticatedUsers` as\n`members` in a `Binding` of a `Policy`.\n\n+ The owner role can be granted only to `user` and `serviceAccount`.\n\n+ Service accounts can be made owners of a project directly\nwithout any restrictions. However, to be added as an owner, a user must be\ninvited via Cloud Platform console and must accept the invitation.\n\n+ A user cannot be granted the owner role using `setIamPolicy()`. The user\nmust be granted the owner role using the Cloud Platform Console and must\nexplicitly accept the invitation.\n\n+ Invitations to grant the owner role cannot be sent using\n`setIamPolicy()`;\nthey must be sent only using the Cloud Platform Console.\n\n+ Membership changes that leave the project without any owners that have\naccepted the Terms of Service (ToS) will be rejected.\n\n+ If the project is not part of an organization, there must be at least\none owner who has accepted the Terms of Service (ToS) agreement in the\npolicy. Calling `setIamPolicy()` to remove the last ToS-accepted owner\nfrom the policy will fail. This restriction also applies to legacy\nprojects that no longer have owners who have accepted the ToS. Edits to\nIAM policies will be rejected until the lack of a ToS-accepting owner is\nrectified.\n\n+ Calling this method requires enabling the App Engine Admin API.\n\nNote: Removing service accounts from policies or changing their roles\ncan render services completely inoperable. It is important to understand\nhow the service account is being used before removing or updating its\nroles.\n\nAuthorization requires the Google IAM permission\n`resourcemanager.projects.setIamPolicy` on the project", "response": { "$ref": "Policy" }, @@ -1032,28 +377,702 @@ "parameters": { "resource": { "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{resource}:setIamPolicy", + "id": "cloudresourcemanager.projects.setIamPolicy", + "path": "v1/projects/{resource}:setIamPolicy" + }, + "listAvailableOrgPolicyConstraints": { + "description": "Lists `Constraints` that could be applied on the specified resource.", + "request": { + "$ref": "ListAvailableOrgPolicyConstraintsRequest" + }, + "response": { + "$ref": "ListAvailableOrgPolicyConstraintsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "Name of the resource to list `Constraints` for.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/projects/{projectsId}:listAvailableOrgPolicyConstraints", + "id": "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints", + "path": "v1/{+resource}:listAvailableOrgPolicyConstraints" + }, + "getIamPolicy": { + "flatPath": "v1/projects/{resource}:getIamPolicy", + "id": "cloudresourcemanager.projects.getIamPolicy", + "path": "v1/projects/{resource}:getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Returns the IAM access control policy for the specified Project.\nPermission is denied if the policy or the resource does not exist.\n\nAuthorization requires the Google IAM permission\n`resourcemanager.projects.getIamPolicy` on the project", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + } + } + } + }, + "organizations": { + "methods": { + "clearOrgPolicy": { + "description": "Clears a `Policy` from a resource.", + "request": { + "$ref": "ClearOrgPolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "resource": { + "location": "path", + "description": "Name of the resource for the `Policy` to clear.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}:clearOrgPolicy", + "path": "v1/{+resource}:clearOrgPolicy", + "id": "cloudresourcemanager.organizations.clearOrgPolicy" + }, + "setOrgPolicy": { + "request": { + "$ref": "SetOrgPolicyRequest" + }, + "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for\nthat `Constraint` on the resource if one does not exist.\n\nNot supplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "OrgPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "Resource name of the resource to attach the `Policy`.", + "type": "string", + "required": true, "pattern": "^organizations/[^/]+$", "location": "path" } }, - "flatPath": "v1/organizations/{organizationsId}:setIamPolicy" + "flatPath": "v1/organizations/{organizationsId}:setOrgPolicy", + "path": "v1/{+resource}:setOrgPolicy", + "id": "cloudresourcemanager.organizations.setOrgPolicy" + }, + "setIamPolicy": { + "flatPath": "v1/organizations/{organizationsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "cloudresourcemanager.organizations.setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on an Organization resource. Replaces any\nexisting policy. The `resource` field should be the organization's resource\nname, e.g. \"organizations/123\".\n\nAuthorization requires the Google IAM permission\n`resourcemanager.organizations.setIamPolicy` on the specified organization", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + } + }, + "listAvailableOrgPolicyConstraints": { + "flatPath": "v1/organizations/{organizationsId}:listAvailableOrgPolicyConstraints", + "id": "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints", + "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", + "request": { + "$ref": "ListAvailableOrgPolicyConstraintsRequest" + }, + "description": "Lists `Constraints` that could be applied on the specified resource.", + "response": { + "$ref": "ListAvailableOrgPolicyConstraintsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "location": "path", + "description": "Name of the resource to list `Constraints` for.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$" + } + } + }, + "listOrgPolicies": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "ListOrgPoliciesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "description": "Name of the resource to list Policies for.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}:listOrgPolicies", + "path": "v1/{+resource}:listOrgPolicies", + "id": "cloudresourcemanager.organizations.listOrgPolicies", + "request": { + "$ref": "ListOrgPoliciesRequest" + }, + "description": "Lists all the `Policies` set for a particular resource." + }, + "getIamPolicy": { + "description": "Gets the access control policy for an Organization resource. May be empty\nif no such policy or resource exists. The `resource` field should be the\norganization's resource name, e.g. \"organizations/123\".\n\nAuthorization requires the Google IAM permission\n`resourcemanager.organizations.getIamPolicy` on the specified organization", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/organizations/{organizationsId}:getIamPolicy", + "id": "cloudresourcemanager.organizations.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy" + }, + "getOrgPolicy": { + "flatPath": "v1/organizations/{organizationsId}:getOrgPolicy", + "id": "cloudresourcemanager.organizations.getOrgPolicy", + "path": "v1/{+resource}:getOrgPolicy", + "request": { + "$ref": "GetOrgPolicyRequest" + }, + "description": "Gets a `Policy` on a resource.\n\nIf no `Policy` is set on the resource, a `Policy` is returned with default\nvalues including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The\n`etag` value can be used with `SetOrgPolicy()` to create or update a\n`Policy` during read-modify-write.", + "response": { + "$ref": "OrgPolicy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "description": "Name of the resource the `Policy` is set on.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + } + }, + "search": { + "request": { + "$ref": "SearchOrganizationsRequest" + }, + "description": "Searches Organization resources that are visible to the user and satisfy\nthe specified filter. This method returns Organizations in an unspecified\norder. New Organizations do not necessarily appear at the end of the\nresults.\n\nSearch will only return organizations on which the user has the permission\n`resourcemanager.organizations.get`", + "response": { + "$ref": "SearchOrganizationsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": {}, + "flatPath": "v1/organizations:search", + "id": "cloudresourcemanager.organizations.search", + "path": "v1/organizations:search" + }, + "getEffectiveOrgPolicy": { + "flatPath": "v1/organizations/{organizationsId}:getEffectiveOrgPolicy", + "id": "cloudresourcemanager.organizations.getEffectiveOrgPolicy", + "path": "v1/{+resource}:getEffectiveOrgPolicy", + "request": { + "$ref": "GetEffectiveOrgPolicyRequest" + }, + "description": "Gets the effective `Policy` on a resource. This is the result of merging\n`Policies` in the resource hierarchy. The returned `Policy` will not have\nan `etag`set because it is a computed `Policy` across multiple resources.", + "response": { + "$ref": "OrgPolicy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "description": "The name of the resource to start computing the effective `Policy`.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + } + }, + "get": { + "flatPath": "v1/organizations/{organizationsId}", + "id": "cloudresourcemanager.organizations.get", + "path": "v1/{+name}", + "description": "Fetches an Organization resource identified by the specified resource name.", + "response": { + "$ref": "Organization" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + } + }, + "testIamPermissions": { + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified Organization.\nThe `resource` field should be the organization's resource name,\ne.g. \"organizations/123\".\n\nThere are no permissions required for making this API call.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$" + } + }, + "flatPath": "v1/organizations/{organizationsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "cloudresourcemanager.organizations.testIamPermissions" + } + } + }, + "operations": { + "methods": { + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^operations/.+$", + "location": "path" + } + }, + "flatPath": "v1/operations/{operationsId}", + "id": "cloudresourcemanager.operations.get", + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + } + } + }, + "liens": { + "methods": { + "delete": { + "flatPath": "v1/liens/{liensId}", + "path": "v1/{+name}", + "id": "cloudresourcemanager.liens.delete", + "description": "Delete a Lien by `name`.\n\nCallers of this method will require permission on the `parent` resource.\nFor example, a Lien with a `parent` of `projects/1234` requires permission\n`resourcemanager.projects.updateLiens`.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "description": "The name/identifier of the Lien to delete.", + "type": "string", + "required": true, + "pattern": "^liens/.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "list": { + "description": "List all Liens applied to the `parent` resource.\n\nCallers of this method will require permission on the `parent` resource.\nFor example, a Lien with a `parent` of `projects/1234` requires permission\n`resourcemanager.projects.get`.", + "response": { + "$ref": "ListLiensResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "The `next_page_token` value returned from a previous List request, if any.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of items to return. This is a suggestion for the server.", + "type": "integer", + "location": "query" + }, + "parent": { + "location": "query", + "description": "The name of the resource to list all attached Liens.\nFor example, `projects/1234`.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/liens", + "id": "cloudresourcemanager.liens.list", + "path": "v1/liens" + }, + "create": { + "description": "Create a Lien which applies to the resource denoted by the `parent` field.\n\nCallers of this method will require permission on the `parent` resource.\nFor example, applying to `projects/1234` requires permission\n`resourcemanager.projects.updateLiens`.\n\nNOTE: Some resources may limit the number of Liens which may be applied.", + "request": { + "$ref": "Lien" + }, + "response": { + "$ref": "Lien" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/liens", + "id": "cloudresourcemanager.liens.create", + "path": "v1/liens" + } + } + }, + "folders": { + "methods": { + "clearOrgPolicy": { + "request": { + "$ref": "ClearOrgPolicyRequest" + }, + "description": "Clears a `Policy` from a resource.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "Name of the resource for the `Policy` to clear.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/folders/{foldersId}:clearOrgPolicy", + "id": "cloudresourcemanager.folders.clearOrgPolicy", + "path": "v1/{+resource}:clearOrgPolicy" + }, + "setOrgPolicy": { + "response": { + "$ref": "OrgPolicy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "Resource name of the resource to attach the `Policy`.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/folders/{foldersId}:setOrgPolicy", + "id": "cloudresourcemanager.folders.setOrgPolicy", + "path": "v1/{+resource}:setOrgPolicy", + "request": { + "$ref": "SetOrgPolicyRequest" + }, + "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for\nthat `Constraint` on the resource if one does not exist.\n\nNot supplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`." + }, + "listOrgPolicies": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "ListOrgPoliciesResponse" + }, + "parameters": { + "resource": { + "description": "Name of the resource to list Policies for.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/folders/{foldersId}:listOrgPolicies", + "path": "v1/{+resource}:listOrgPolicies", + "id": "cloudresourcemanager.folders.listOrgPolicies", + "description": "Lists all the `Policies` set for a particular resource.", + "request": { + "$ref": "ListOrgPoliciesRequest" + } + }, + "listAvailableOrgPolicyConstraints": { + "flatPath": "v1/folders/{foldersId}:listAvailableOrgPolicyConstraints", + "id": "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints", + "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", + "description": "Lists `Constraints` that could be applied on the specified resource.", + "request": { + "$ref": "ListAvailableOrgPolicyConstraintsRequest" + }, + "response": { + "$ref": "ListAvailableOrgPolicyConstraintsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "Name of the resource to list `Constraints` for.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "getOrgPolicy": { + "description": "Gets a `Policy` on a resource.\n\nIf no `Policy` is set on the resource, a `Policy` is returned with default\nvalues including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The\n`etag` value can be used with `SetOrgPolicy()` to create or update a\n`Policy` during read-modify-write.", + "request": { + "$ref": "GetOrgPolicyRequest" + }, + "response": { + "$ref": "OrgPolicy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "location": "path", + "description": "Name of the resource the `Policy` is set on.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1/folders/{foldersId}:getOrgPolicy", + "id": "cloudresourcemanager.folders.getOrgPolicy", + "path": "v1/{+resource}:getOrgPolicy" + }, + "getEffectiveOrgPolicy": { + "request": { + "$ref": "GetEffectiveOrgPolicyRequest" + }, + "description": "Gets the effective `Policy` on a resource. This is the result of merging\n`Policies` in the resource hierarchy. The returned `Policy` will not have\nan `etag`set because it is a computed `Policy` across multiple resources.", + "response": { + "$ref": "OrgPolicy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "description": "The name of the resource to start computing the effective `Policy`.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/folders/{foldersId}:getEffectiveOrgPolicy", + "id": "cloudresourcemanager.folders.getEffectiveOrgPolicy", + "path": "v1/{+resource}:getEffectiveOrgPolicy" } } } }, "parameters": { - "uploadType": { + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string" }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, "fields": { "description": "Selector specifying which fields to include in a partial response.", "type": "string", "location": "query" }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, "callback": { "description": "JSONP", "type": "string", @@ -1088,361 +1107,39 @@ "description": "Data format for response.", "default": "json" }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, "key": { "location": "query", "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.", "type": "string" }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, "quotaUser": { + "location": "query", "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string" }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", + "pp": { + "description": "Pretty-print response.", "default": "true", + "type": "boolean", "location": "query" } }, + "version": "v1", + "baseUrl": "https://cloudresourcemanager.googleapis.com/", + "servicePath": "", + "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "cloudresourcemanager:v1", + "documentationLink": "https://cloud.google.com/resource-manager", + "revision": "20170920", + "discoveryVersion": "v1", "schemas": { - "Status": { - "properties": { - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - }, - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - } - }, - "id": "Status", - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object" - }, - "ListLiensResponse": { - "description": "The response message for Liens.ListLiens.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "Token to retrieve the next page of results, or empty if there are no more\nresults in the list.", - "type": "string" - }, - "liens": { - "description": "A list of Liens.", - "type": "array", - "items": { - "$ref": "Lien" - } - } - }, - "id": "ListLiensResponse" - }, - "Constraint": { - "id": "Constraint", - "description": "A `Constraint` describes a way in which a resource's configuration can be\nrestricted. For example, it controls which cloud services can be activated\nacross an organization, or whether a Compute Engine instance can have\nserial port connections established. `Constraints` can be configured by the\norganization's policy adminstrator to fit the needs of the organzation by\nsetting Policies for `Constraints` at different locations in the\norganization's resource hierarchy. Policies are inherited down the resource\nhierarchy from higher levels, but can also be overridden. For details about\nthe inheritance rules please read about\nPolicies.\n\n`Constraints` have a default behavior determined by the `constraint_default`\nfield, which is the enforcement behavior that is used in the absence of a\n`Policy` being defined or inherited for the resource in question.", - "type": "object", - "properties": { - "description": { - "description": "Detailed description of what this `Constraint` controls as well as how and\nwhere it is enforced.\n\nMutable.", - "type": "string" - }, - "displayName": { - "description": "The human readable name.\n\nMutable.", - "type": "string" - }, - "booleanConstraint": { - "$ref": "BooleanConstraint", - "description": "Defines this constraint as being a BooleanConstraint." - }, - "constraintDefault": { - "enumDescriptions": [ - "This is only used for distinguishing unset values and should never be\nused.", - "Indicate that all values are allowed for list constraints.\nIndicate that enforcement is off for boolean constraints.", - "Indicate that all values are denied for list constraints.\nIndicate that enforcement is on for boolean constraints." - ], - "enum": [ - "CONSTRAINT_DEFAULT_UNSPECIFIED", - "ALLOW", - "DENY" - ], - "description": "The evaluation behavior of this constraint in the absense of 'Policy'.", - "type": "string" - }, - "name": { - "type": "string", - "description": "Immutable value, required to globally be unique. For example,\n`constraints/serviceuser.services`" - }, - "listConstraint": { - "$ref": "ListConstraint", - "description": "Defines this constraint as being a ListConstraint." - }, - "version": { - "description": "Version of the `Constraint`. Default version is 0;", - "format": "int32", - "type": "integer" - } - } - }, - "Binding": { - "description": "Associates `members` with a `role`.", - "type": "object", - "properties": { - "members": { - "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", - "items": { - "type": "string" - } - }, - "role": { - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", - "type": "string" - } - }, - "id": "Binding" - }, - "RestoreDefault": { - "description": "Ignores policies set above this resource and restores the\n`constraint_default` enforcement behavior of the specific `Constraint` at\nthis resource.\n\nSuppose that `constraint_default` is set to `ALLOW` for the\n`Constraint` `constraints/serviceuser.services`. Suppose that organization\nfoo.com sets a `Policy` at their Organization resource node that restricts\nthe allowed service activations to deny all service activations. They\ncould then set a `Policy` with the `policy_type` `restore_default` on\nseveral experimental projects, restoring the `constraint_default`\nenforcement of the `Constraint` for only those projects, allowing those\nprojects to have all services activated.", - "type": "object", - "properties": {}, - "id": "RestoreDefault" - }, - "GetOrgPolicyRequest": { - "type": "object", - "properties": { - "constraint": { - "type": "string", - "description": "Name of the `Constraint` to get the `Policy`." - } - }, - "id": "GetOrgPolicyRequest", - "description": "The request sent to the GetOrgPolicy method." - }, - "UndeleteProjectRequest": { - "description": "The request sent to the UndeleteProject\nmethod.", - "type": "object", - "properties": {}, - "id": "UndeleteProjectRequest" - }, - "ClearOrgPolicyRequest": { - "description": "The request sent to the ClearOrgPolicy method.", - "type": "object", - "properties": { - "etag": { - "description": "The current version, for concurrency control. Not sending an `etag`\nwill cause the `Policy` to be cleared blindly.", - "format": "byte", - "type": "string" - }, - "constraint": { - "description": "Name of the `Constraint` of the `Policy` to clear.", - "type": "string" - } - }, - "id": "ClearOrgPolicyRequest" - }, - "ProjectCreationStatus": { - "type": "object", - "properties": { - "createTime": { - "description": "Creation time of the project creation workflow.", - "format": "google-datetime", - "type": "string" - }, - "gettable": { - "description": "True if the project can be retrieved using GetProject. No other operations\non the project are guaranteed to work until the project creation is\ncomplete.", - "type": "boolean" - }, - "ready": { - "description": "True if the project creation process is complete.", - "type": "boolean" - } - }, - "id": "ProjectCreationStatus", - "description": "A status object which is used as the `metadata` field for the Operation\nreturned by CreateProject. It provides insight for when significant phases of\nProject creation have completed." - }, - "BooleanConstraint": { - "description": "A `Constraint` that is either enforced or not.\n\nFor example a constraint `constraints/compute.disableSerialPortAccess`.\nIf it is enforced on a VM instance, serial port connections will not be\nopened to that instance.", - "type": "object", - "properties": {}, - "id": "BooleanConstraint" - }, - "GetIamPolicyRequest": { - "description": "Request message for `GetIamPolicy` method.", - "type": "object", - "properties": {}, - "id": "GetIamPolicyRequest" - }, - "TestIamPermissionsResponse": { - "description": "Response message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "TestIamPermissionsResponse" - }, - "OrganizationOwner": { - "properties": { - "directoryCustomerId": { - "description": "The Google for Work customer id used in the Directory API.", - "type": "string" - } - }, - "id": "OrganizationOwner", - "description": "The entity that owns an Organization. The lifetime of the Organization and\nall of its descendants are bound to the `OrganizationOwner`. If the\n`OrganizationOwner` is deleted, the Organization and all its descendants will\nbe deleted.", - "type": "object" - }, - "ListProjectsResponse": { - "description": "A page of the response received from the\nListProjects\nmethod.\n\nA paginated response where more pages are available has\n`next_page_token` set. This token can be used in a subsequent request to\nretrieve the next request page.", - "type": "object", - "properties": { - "projects": { - "description": "The list of Projects that matched the list filter. This list can\nbe paginated.", - "type": "array", - "items": { - "$ref": "Project" - } - }, - "nextPageToken": { - "type": "string", - "description": "Pagination token.\n\nIf the result set is too large to fit in a single response, this token\nis returned. It encodes the position of the current result cursor.\nFeeding this value into a new list request with the `page_token` parameter\ngives the next page of the results.\n\nWhen `next_page_token` is not filled in, there is no next page and\nthe list returned is the last page in the result set.\n\nPagination tokens have a limited lifetime." - } - }, - "id": "ListProjectsResponse" - }, - "Project": { - "description": "A Project is a high-level Google Cloud Platform entity. It is a\ncontainer for ACLs, APIs, App Engine Apps, VMs, and other\nGoogle Cloud Platform resources.", - "type": "object", - "properties": { - "projectNumber": { - "description": "The number uniquely identifying the project.\n\nExample: \u003ccode\u003e415104041262\u003c/code\u003e\nRead-only.", - "format": "int64", - "type": "string" - }, - "parent": { - "$ref": "ResourceId", - "description": "An optional reference to a parent Resource.\n\nThe only supported parent type is \"organization\". Once set, the parent\ncannot be modified. The `parent` can be set on creation or using the\n`UpdateProject` method; the end user must have the\n`resourcemanager.projects.create` permission on the parent.\n\nRead-write." - }, - "createTime": { - "type": "string", - "description": "Creation time.\n\nRead-only.", - "format": "google-datetime" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "The labels associated with this Project.\n\nLabel keys must be between 1 and 63 characters long and must conform\nto the following regular expression: \\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?.\n\nLabel values must be between 0 and 63 characters long and must conform\nto the regular expression (\\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?)?.\n\nNo more than 256 labels can be associated with a given resource.\n\nClients should store labels in a representation such as JSON that does not\ndepend on specific characters being disallowed.\n\nExample: \u003ccode\u003e\"environment\" : \"dev\"\u003c/code\u003e\nRead-write." - }, - "name": { - "description": "The user-assigned display name of the Project.\nIt must be 4 to 30 characters.\nAllowed characters are: lowercase and uppercase letters, numbers,\nhyphen, single-quote, double-quote, space, and exclamation point.\n\nExample: \u003ccode\u003eMy Project\u003c/code\u003e\nRead-write.", - "type": "string" - }, - "projectId": { - "description": "The unique, user-assigned ID of the Project.\nIt must be 6 to 30 lowercase letters, digits, or hyphens.\nIt must start with a letter.\nTrailing hyphens are prohibited.\n\nExample: \u003ccode\u003etokyo-rain-123\u003c/code\u003e\nRead-only after creation.", - "type": "string" - }, - "lifecycleState": { - "description": "The Project lifecycle state.\n\nRead-only.", - "type": "string", - "enumDescriptions": [ - "Unspecified state. This is only used/useful for distinguishing\nunset values.", - "The normal and active state.", - "The project has been marked for deletion by the user\n(by invoking\nDeleteProject)\nor by the system (Google Cloud Platform).\nThis can generally be reversed by invoking UndeleteProject.", - "This lifecycle state is no longer used and not returned by the API." - ], - "enum": [ - "LIFECYCLE_STATE_UNSPECIFIED", - "ACTIVE", - "DELETE_REQUESTED", - "DELETE_IN_PROGRESS" - ] - } - }, - "id": "Project" - }, - "ListOrgPoliciesResponse": { - "description": "The response returned from the ListOrgPolicies method. It will be empty\nif no `Policies` are set on the resource.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "Page token used to retrieve the next page. This is currently not used, but\nthe server may at any point start supplying a valid token.", - "type": "string" - }, - "policies": { - "description": "The `Policies` that are set on the resource. It will be empty if no\n`Policies` are set.", - "type": "array", - "items": { - "$ref": "OrgPolicy" - } - } - }, - "id": "ListOrgPoliciesResponse" - }, - "SearchOrganizationsResponse": { - "description": "The response returned from the `SearchOrganizations` method.", - "type": "object", - "properties": { - "organizations": { - "description": "The list of Organizations that matched the search query, possibly\npaginated.", - "type": "array", - "items": { - "$ref": "Organization" - } - }, - "nextPageToken": { - "description": "A pagination token to be used to retrieve the next page of results. If the\nresult is too large to fit within the page size specified in the request,\nthis field will be set with a token that can be used to fetch the next page\nof results. If this field is empty, it indicates that this response\ncontains the last page of results.", - "type": "string" - } - }, - "id": "SearchOrganizationsResponse" - }, "FolderOperationError": { "description": "A classification of the Folder Operation error.", "type": "object", @@ -1482,35 +1179,35 @@ "description": "Defines a Cloud Organization `Policy` which is used to specify `Constraints`\nfor configurations of Cloud Platform resources.", "type": "object", "properties": { - "version": { - "description": "Version of the `Policy`. Default version is 0;", - "format": "int32", - "type": "integer" - }, - "restoreDefault": { - "description": "Restores the default behavior of the constraint; independent of\n`Constraint` type.", - "$ref": "RestoreDefault" - }, - "listPolicy": { - "$ref": "ListPolicy", - "description": "List of values either allowed or disallowed." - }, - "etag": { - "description": "An opaque tag indicating the current version of the `Policy`, used for\nconcurrency control.\n\nWhen the `Policy` is returned from either a `GetPolicy` or a\n`ListOrgPolicy` request, this `etag` indicates the version of the current\n`Policy` to use when executing a read-modify-write loop.\n\nWhen the `Policy` is returned from a `GetEffectivePolicy` request, the\n`etag` will be unset.\n\nWhen the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value\nthat was returned from a `GetOrgPolicy` request as part of a\nread-modify-write loop for concurrency control. Not setting the `etag`in a\n`SetOrgPolicy` request will result in an unconditional write of the\n`Policy`.", - "format": "byte", - "type": "string" + "booleanPolicy": { + "description": "For boolean `Constraints`, whether to enforce the `Constraint` or not.", + "$ref": "BooleanPolicy" }, "constraint": { "description": "The name of the `Constraint` the `Policy` is configuring, for example,\n`constraints/serviceuser.services`.\n\nImmutable after creation.", "type": "string" }, - "booleanPolicy": { - "$ref": "BooleanPolicy", - "description": "For boolean `Constraints`, whether to enforce the `Constraint` or not." - }, "updateTime": { - "description": "The time stamp the `Policy` was previously updated. This is set by the\nserver, not specified by the caller, and represents the last time a call to\n`SetOrgPolicy` was made for that `Policy`. Any value set by the client will\nbe ignored.", "format": "google-datetime", + "description": "The time stamp the `Policy` was previously updated. This is set by the\nserver, not specified by the caller, and represents the last time a call to\n`SetOrgPolicy` was made for that `Policy`. Any value set by the client will\nbe ignored.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the `Policy`. Default version is 0;", + "type": "integer" + }, + "restoreDefault": { + "$ref": "RestoreDefault", + "description": "Restores the default behavior of the constraint; independent of\n`Constraint` type." + }, + "listPolicy": { + "description": "List of values either allowed or disallowed.", + "$ref": "ListPolicy" + }, + "etag": { + "format": "byte", + "description": "An opaque tag indicating the current version of the `Policy`, used for\nconcurrency control.\n\nWhen the `Policy` is returned from either a `GetPolicy` or a\n`ListOrgPolicy` request, this `etag` indicates the version of the current\n`Policy` to use when executing a read-modify-write loop.\n\nWhen the `Policy` is returned from a `GetEffectivePolicy` request, the\n`etag` will be unset.\n\nWhen the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value\nthat was returned from a `GetOrgPolicy` request as part of a\nread-modify-write loop for concurrency control. Not setting the `etag`in a\n`SetOrgPolicy` request will result in an unconditional write of the\n`Policy`.", "type": "string" } }, @@ -1531,9 +1228,18 @@ "description": "A Lien represents an encumbrance on the actions that can be performed on a\nresource.", "type": "object", "properties": { + "parent": { + "description": "A reference to the resource this Lien is attached to. The server will\nvalidate the parent against those for which Liens are supported.\n\nExample: `projects/1234`", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "The creation time of this Lien.", + "type": "string" + }, "name": { - "type": "string", - "description": "A system-generated unique identifier for this Lien.\n\nExample: `liens/1234abcd`" + "description": "A system-generated unique identifier for this Lien.\n\nExample: `liens/1234abcd`", + "type": "string" }, "reason": { "description": "Concise user-visible strings indicating why an action cannot be performed\non a resource. Maximum lenth of 200 characters.\n\nExample: 'Holds production API key'", @@ -1545,19 +1251,10 @@ }, "restrictions": { "description": "The types of operations which should be blocked as a result of this Lien.\nEach value should correspond to an IAM permission. The server will\nvalidate the permissions against those for which Liens are supported.\n\nAn empty list is meaningless and will be rejected.\n\nExample: ['resourcemanager.projects.delete']", - "type": "array", "items": { "type": "string" - } - }, - "parent": { - "description": "A reference to the resource this Lien is attached to. The server will\nvalidate the parent against those for which Liens are supported.\n\nExample: `projects/1234`", - "type": "string" - }, - "createTime": { - "description": "The creation time of this Lien.", - "format": "google-datetime", - "type": "string" + }, + "type": "array" } }, "id": "Lien" @@ -1567,8 +1264,8 @@ "type": "object", "properties": { "resourceId": { - "description": "Resource id of the ancestor.", - "$ref": "ResourceId" + "$ref": "ResourceId", + "description": "Resource id of the ancestor." } }, "id": "Ancestor" @@ -1578,8 +1275,8 @@ "type": "object", "properties": { "suggestedValue": { - "type": "string", - "description": "Optional. The Google Cloud Console will try to default to a configuration\nthat matches the value specified in this `Constraint`." + "description": "Optional. The Google Cloud Console will try to default to a configuration\nthat matches the value specified in this `Constraint`.", + "type": "string" } }, "id": "ListConstraint" @@ -1589,45 +1286,48 @@ "type": "object", "properties": { "policy": { - "$ref": "OrgPolicy", - "description": "`Policy` to set on the resource." + "description": "`Policy` to set on the resource.", + "$ref": "OrgPolicy" } }, "id": "SetOrgPolicyRequest" }, "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", "properties": { + "updateMask": { + "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", + "type": "string" + }, "policy": { "$ref": "Policy", "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." - }, - "updateMask": { - "type": "string", - "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", - "format": "google-fieldmask" } }, - "id": "SetIamPolicyRequest", - "description": "Request message for `SetIamPolicy` method.", - "type": "object" + "id": "SetIamPolicyRequest" }, "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object", "properties": {}, - "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`." + "id": "Empty" }, "Organization": { "description": "The root node in the resource hierarchy to which a particular entity's\n(e.g., company) resources belong.", "type": "object", "properties": { - "owner": { - "description": "The owner of this Organization. The owner should be specified on\ncreation. Once set, it cannot be changed.\nThis field is required.", - "$ref": "OrganizationOwner" + "displayName": { + "description": "A friendly string to be used to refer to the Organization in the UI.\nAssigned by the server, set to the primary domain of the G Suite\ncustomer that owns the organization.\n@OutputOnly", + "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "Timestamp when the Organization was created. Assigned by the server.\n@OutputOnly", + "type": "string" }, "lifecycleState": { - "description": "The organization's current lifecycle state. Assigned by the server.\n@OutputOnly", - "type": "string", "enumDescriptions": [ "Unspecified state. This is only useful for distinguishing unset values.", "The normal and active state.", @@ -1637,20 +1337,17 @@ "LIFECYCLE_STATE_UNSPECIFIED", "ACTIVE", "DELETE_REQUESTED" - ] + ], + "description": "The organization's current lifecycle state. Assigned by the server.\n@OutputOnly", + "type": "string" + }, + "owner": { + "description": "The owner of this Organization. The owner should be specified on\ncreation. Once set, it cannot be changed.\nThis field is required.", + "$ref": "OrganizationOwner" }, "name": { "description": "Output Only. The resource name of the organization. This is the\norganization's relative path in the API. Its format is\n\"organizations/[organization_id]\". For example, \"organizations/1234\".", "type": "string" - }, - "displayName": { - "type": "string", - "description": "A friendly string to be used to refer to the Organization in the UI.\nAssigned by the server, set to the primary domain of the G Suite\ncustomer that owns the organization.\n@OutputOnly" - }, - "creationTime": { - "description": "Timestamp when the Organization was created. Assigned by the server.\n@OutputOnly", - "format": "google-datetime", - "type": "string" } }, "id": "Organization" @@ -1659,16 +1356,16 @@ "description": "The response returned from the ListAvailableOrgPolicyConstraints method.\nReturns all `Constraints` that could be set at this level of the hierarchy\n(contrast with the response from `ListPolicies`, which returns all policies\nwhich are set).", "type": "object", "properties": { + "constraints": { + "description": "The collection of constraints that are settable on the request resource.", + "items": { + "$ref": "Constraint" + }, + "type": "array" + }, "nextPageToken": { "description": "Page token used to retrieve the next page. This is currently not used.", "type": "string" - }, - "constraints": { - "description": "The collection of constraints that are settable on the request resource.", - "type": "array", - "items": { - "$ref": "Constraint" - } } }, "id": "ListAvailableOrgPolicyConstraintsResponse" @@ -1677,7 +1374,31 @@ "description": "Used in `policy_type` to specify how `list_policy` behaves at this\nresource.\n\nA `ListPolicy` can define specific values that are allowed or denied by\nsetting either the `allowed_values` or `denied_values` fields. It can also\nbe used to allow or deny all values, by setting the `all_values` field. If\n`all_values` is `ALL_VALUES_UNSPECIFIED`, exactly one of `allowed_values`\nor `denied_values` must be set (attempting to set both or neither will\nresult in a failed request). If `all_values` is set to either `ALLOW` or\n`DENY`, `allowed_values` and `denied_values` must be unset.", "type": "object", "properties": { + "allowedValues": { + "description": "List of values allowed at this resource. Can only be set if no values\nare set for `denied_values` and `all_values` is set to\n`ALL_VALUES_UNSPECIFIED`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "inheritFromParent": { + "description": "Determines the inheritance behavior for this `Policy`.\n\nBy default, a `ListPolicy` set at a resource supercedes any `Policy` set\nanywhere up the resource hierarchy. However, if `inherit_from_parent` is\nset to `true`, then the values from the effective `Policy` of the parent\nresource are inherited, meaning the values set in this `Policy` are\nadded to the values inherited up the hierarchy.\n\nSetting `Policy` hierarchies that inherit both allowed values and denied\nvalues isn't recommended in most circumstances to keep the configuration\nsimple and understandable. However, it is possible to set a `Policy` with\n`allowed_values` set that inherits a `Policy` with `denied_values` set.\nIn this case, the values that are allowed must be in `allowed_values` and\nnot present in `denied_values`.\n\nFor example, suppose you have a `Constraint`\n`constraints/serviceuser.services`, which has a `constraint_type` of\n`list_constraint`, and with `constraint_default` set to `ALLOW`.\nSuppose that at the Organization level, a `Policy` is applied that\nrestricts the allowed API activations to {`E1`, `E2`}. Then, if a\n`Policy` is applied to a project below the Organization that has\n`inherit_from_parent` set to `false` and field all_values set to DENY,\nthen an attempt to activate any API will be denied.\n\nThe following examples demonstrate different possible layerings:\n\nExample 1 (no inherited values):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values:”E2”}\n ``projects/bar`` has `inherit_from_parent` `false` and values:\n {allowed_values: \"E3\" allowed_values: \"E4\"}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe accepted values at `projects/bar` are `E3`, and `E4`.\n\nExample 2 (inherited values):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values:”E2”}\n `projects/bar` has a `Policy` with values:\n {value: “E3” value: ”E4” inherit_from_parent: true}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.\n\nExample 3 (inheriting both allowed and denied values):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: \"E1\" allowed_values: \"E2\"}\n `projects/bar` has a `Policy` with:\n {denied_values: \"E1\"}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe value accepted at `projects/bar` is `E2`.\n\nExample 4 (RestoreDefault):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values:”E2”}\n `projects/bar` has a `Policy` with values:\n {RestoreDefault: {}}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe accepted values at `projects/bar` are either all or none depending on\nthe value of `constraint_default` (if `ALLOW`, all; if\n`DENY`, none).\n\nExample 5 (no policy inherits parent policy):\n `organizations/foo` has no `Policy` set.\n `projects/bar` has no `Policy` set.\nThe accepted values at both levels are either all or none depending on\nthe value of `constraint_default` (if `ALLOW`, all; if\n`DENY`, none).\n\nExample 6 (ListConstraint allowing all):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values: ”E2”}\n `projects/bar` has a `Policy` with:\n {all: ALLOW}\nThe accepted values at `organizations/foo` are `E1`, E2`.\nAny value is accepted at `projects/bar`.\n\nExample 7 (ListConstraint allowing none):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values: ”E2”}\n `projects/bar` has a `Policy` with:\n {all: DENY}\nThe accepted values at `organizations/foo` are `E1`, E2`.\nNo value is accepted at `projects/bar`.", + "type": "boolean" + }, + "suggestedValue": { + "description": "Optional. The Google Cloud Console will try to default to a configuration\nthat matches the value specified in this `Policy`. If `suggested_value`\nis not set, it will inherit the value specified higher in the hierarchy,\nunless `inherit_from_parent` is `false`.", + "type": "string" + }, + "deniedValues": { + "description": "List of values denied at this resource. Can only be set if no values are\nset for `allowed_values` and `all_values` is set to\n`ALL_VALUES_UNSPECIFIED`.", + "items": { + "type": "string" + }, + "type": "array" + }, "allValues": { + "description": "The policy all_values state.", + "type": "string", "enumDescriptions": [ "Indicates that either allowed_values or denied_values must be set.", "A policy with this set allows all values.", @@ -1687,31 +1408,7 @@ "ALL_VALUES_UNSPECIFIED", "ALLOW", "DENY" - ], - "description": "The policy all_values state.", - "type": "string" - }, - "allowedValues": { - "description": "List of values allowed at this resource. an only be set if no values are\nset for `denied_values` and `all_values` is set to\n`ALL_VALUES_UNSPECIFIED`.", - "type": "array", - "items": { - "type": "string" - } - }, - "suggestedValue": { - "type": "string", - "description": "Optional. The Google Cloud Console will try to default to a configuration\nthat matches the value specified in this `Policy`. If `suggested_value`\nis not set, it will inherit the value specified higher in the hierarchy,\nunless `inherit_from_parent` is `false`." - }, - "inheritFromParent": { - "description": "Determines the inheritance behavior for this `Policy`.\n\nBy default, a `ListPolicy` set at a resource supercedes any `Policy` set\nanywhere up the resource hierarchy. However, if `inherit_from_parent` is\nset to `true`, then the values from the effective `Policy` of the parent\nresource are inherited, meaning the values set in this `Policy` are\nadded to the values inherited up the hierarchy.\n\nSetting `Policy` hierarchies that inherit both allowed values and denied\nvalues isn't recommended in most circumstances to keep the configuration\nsimple and understandable. However, it is possible to set a `Policy` with\n`allowed_values` set that inherits a `Policy` with `denied_values` set.\nIn this case, the values that are allowed must be in `allowed_values` and\nnot present in `denied_values`.\n\nFor example, suppose you have a `Constraint`\n`constraints/serviceuser.services`, which has a `constraint_type` of\n`list_constraint`, and with `constraint_default` set to `ALLOW`.\nSuppose that at the Organization level, a `Policy` is applied that\nrestricts the allowed API activations to {`E1`, `E2`}. Then, if a\n`Policy` is applied to a project below the Organization that has\n`inherit_from_parent` set to `false` and field all_values set to DENY,\nthen an attempt to activate any API will be denied.\n\nThe following examples demonstrate different possible layerings:\n\nExample 1 (no inherited values):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values:”E2”}\n ``projects/bar`` has `inherit_from_parent` `false` and values:\n {allowed_values: \"E3\" allowed_values: \"E4\"}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe accepted values at `projects/bar` are `E3`, and `E4`.\n\nExample 2 (inherited values):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values:”E2”}\n `projects/bar` has a `Policy` with values:\n {value: “E3” value: ”E4” inherit_from_parent: true}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`.\n\nExample 3 (inheriting both allowed and denied values):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: \"E1\" allowed_values: \"E2\"}\n `projects/bar` has a `Policy` with:\n {denied_values: \"E1\"}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe value accepted at `projects/bar` is `E2`.\n\nExample 4 (RestoreDefault):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values:”E2”}\n `projects/bar` has a `Policy` with values:\n {RestoreDefault: {}}\nThe accepted values at `organizations/foo` are `E1`, `E2`.\nThe accepted values at `projects/bar` are either all or none depending on\nthe value of `constraint_default` (if `ALLOW`, all; if\n`DENY`, none).\n\nExample 5 (no policy inherits parent policy):\n `organizations/foo` has no `Policy` set.\n `projects/bar` has no `Policy` set.\nThe accepted values at both levels are either all or none depending on\nthe value of `constraint_default` (if `ALLOW`, all; if\n`DENY`, none).\n\nExample 6 (ListConstraint allowing all):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values: ”E2”}\n `projects/bar` has a `Policy` with:\n {all: ALLOW}\nThe accepted values at `organizations/foo` are `E1`, E2`.\nAny value is accepted at `projects/bar`.\n\nExample 7 (ListConstraint allowing none):\n `organizations/foo` has a `Policy` with values:\n {allowed_values: “E1” allowed_values: ”E2”}\n `projects/bar` has a `Policy` with:\n {all: DENY}\nThe accepted values at `organizations/foo` are `E1`, E2`.\nNo value is accepted at `projects/bar`.", - "type": "boolean" - }, - "deniedValues": { - "description": "List of values denied at this resource. Can only be set if no values are\nset for `allowed_values` and `all_values` is set to\n`ALL_VALUES_UNSPECIFIED`.", - "type": "array", - "items": { - "type": "string" - } + ] } }, "id": "ListPolicy" @@ -1722,10 +1419,10 @@ "properties": { "ancestor": { "description": "Ancestors are ordered from bottom to top of the resource hierarchy. The\nfirst ancestor is the project itself, followed by the project's parent,\netc.", - "type": "array", "items": { "$ref": "Ancestor" - } + }, + "type": "array" } }, "id": "GetAncestryResponse" @@ -1734,14 +1431,9 @@ "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", "type": "object", "properties": { - "exemptedMembers": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members." - }, "logType": { + "description": "The log type that this config enables.", + "type": "string", "enumDescriptions": [ "Default case. Should never be this.", "Admin reads. Example: CloudIAM getIamPolicy", @@ -1753,65 +1445,70 @@ "ADMIN_READ", "DATA_WRITE", "DATA_READ" - ], - "description": "The log type that this config enables.", - "type": "string" + ] + }, + "exemptedMembers": { + "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members.", + "items": { + "type": "string" + }, + "type": "array" } }, "id": "AuditLogConfig" }, "SearchOrganizationsRequest": { - "id": "SearchOrganizationsRequest", "description": "The request sent to the `SearchOrganizations` method.", "type": "object", "properties": { + "filter": { + "description": "An optional query string used to filter the Organizations to return in\nthe response. Filter rules are case-insensitive.\n\n\nOrganizations may be filtered by `owner.directoryCustomerId` or by\n`domain`, where the domain is a Google for Work domain, for example:\n\n|Filter|Description|\n|------|-----------|\n|owner.directorycustomerid:123456789|Organizations with\n`owner.directory_customer_id` equal to `123456789`.|\n|domain:google.com|Organizations corresponding to the domain `google.com`.|\n\nThis field is optional.", + "type": "string" + }, "pageToken": { "description": "A pagination token returned from a previous call to `SearchOrganizations`\nthat indicates from where listing should continue.\nThis field is optional.", "type": "string" }, "pageSize": { - "type": "integer", + "format": "int32", "description": "The maximum number of Organizations to return in the response.\nThis field is optional.", - "format": "int32" - }, - "filter": { - "description": "An optional query string used to filter the Organizations to return in\nthe response. Filter rules are case-insensitive.\n\n\nOrganizations may be filtered by `owner.directoryCustomerId` or by\n`domain`, where the domain is a Google for Work domain, for example:\n\n|Filter|Description|\n|------|-----------|\n|owner.directorycustomerid:123456789|Organizations with\n`owner.directory_customer_id` equal to `123456789`.|\n|domain:google.com|Organizations corresponding to the domain `google.com`.|\n\nThis field is optional.", - "type": "string" + "type": "integer" } - } + }, + "id": "SearchOrganizationsRequest" }, "GetAncestryRequest": { + "description": "The request sent to the\nGetAncestry\nmethod.", "type": "object", "properties": {}, - "id": "GetAncestryRequest", - "description": "The request sent to the\nGetAncestry\nmethod." + "id": "GetAncestryRequest" }, "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", "properties": { "permissions": { "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "TestIamPermissionsRequest", - "description": "Request message for `TestIamPermissions` method.", - "type": "object" + "id": "TestIamPermissionsRequest" }, "ListAvailableOrgPolicyConstraintsRequest": { "description": "The request sent to the [ListAvailableOrgPolicyConstraints]\ngoogle.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method.", "type": "object", "properties": { - "pageToken": { - "type": "string", - "description": "Page token used to retrieve the next page. This is currently unsupported\nand will be ignored. The server may at any point start using this field." - }, "pageSize": { - "description": "Size of the pages to be returned. This is currently unsupported and will\nbe ignored. The server may at any point start using this field to limit\npage size.", "format": "int32", + "description": "Size of the pages to be returned. This is currently unsupported and will\nbe ignored. The server may at any point start using this field to limit\npage size.", "type": "integer" + }, + "pageToken": { + "description": "Page token used to retrieve the next page. This is currently unsupported\nand will be ignored. The server may at any point start using this field.", + "type": "string" } }, "id": "ListAvailableOrgPolicyConstraintsRequest" @@ -1820,29 +1517,29 @@ "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", "type": "object", "properties": { + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + }, + "type": "array" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "type": "string" }, "version": { - "description": "Version of the `Policy`. The default version is 0.", "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", "type": "integer" - }, - "auditConfigs": { - "description": "Specifies cloud audit logging configuration for this policy.", - "type": "array", - "items": { - "$ref": "AuditConfig" - } - }, - "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", - "items": { - "$ref": "Binding" - } } }, "id": "Policy" @@ -1852,6 +1549,7 @@ "type": "object", "properties": { "operationType": { + "description": "The type of this operation.", "type": "string", "enumDescriptions": [ "Operation type not specified.", @@ -1862,16 +1560,15 @@ "OPERATION_TYPE_UNSPECIFIED", "CREATE", "MOVE" - ], - "description": "The type of this operation." - }, - "displayName": { - "type": "string", - "description": "The display name of the folder." + ] }, "sourceParent": { - "type": "string", - "description": "The resource name of the folder's parent.\nOnly applicable when the operation_type is MOVE." + "description": "The resource name of the folder's parent.\nOnly applicable when the operation_type is MOVE.", + "type": "string" + }, + "displayName": { + "description": "The display name of the folder.", + "type": "string" }, "destinationParent": { "description": "The resource name of the folder or organization we are either creating\nthe folder under or moving the folder to.", @@ -1881,6 +1578,8 @@ "id": "FolderOperation" }, "ResourceId": { + "description": "A container to reference an id for any resource type. A `resource` in Google\nCloud Platform is a generic term for something you (a developer) may want to\ninteract with through one of our API's. Some examples are an App Engine app,\na Compute Engine instance, a Cloud SQL database, and so on.", + "type": "object", "properties": { "type": { "description": "Required field representing the resource type this id is for.\nAt present, the valid types are: \"organization\"", @@ -1891,9 +1590,7 @@ "type": "string" } }, - "id": "ResourceId", - "description": "A container to reference an id for any resource type. A `resource` in Google\nCloud Platform is a generic term for something you (a developer) may want to\ninteract with through one of our API's. Some examples are an App Engine app,\na Compute Engine instance, a Cloud SQL database, and so on.", - "type": "object" + "id": "ResourceId" }, "GetEffectiveOrgPolicyRequest": { "description": "The request sent to the GetEffectiveOrgPolicy method.", @@ -1910,14 +1607,14 @@ "description": "The request sent to the ListOrgPolicies method.", "type": "object", "properties": { - "pageToken": { - "type": "string", - "description": "Page token used to retrieve the next page. This is currently unsupported\nand will be ignored. The server may at any point start using this field." - }, "pageSize": { - "description": "Size of the pages to be returned. This is currently unsupported and will\nbe ignored. The server may at any point start using this field to limit\npage size.", "format": "int32", + "description": "Size of the pages to be returned. This is currently unsupported and will\nbe ignored. The server may at any point start using this field to limit\npage size.", "type": "integer" + }, + "pageToken": { + "description": "Page token used to retrieve the next page. This is currently unsupported\nand will be ignored. The server may at any point start using this field.", + "type": "string" } }, "id": "ListOrgPoliciesRequest" @@ -1927,7 +1624,7 @@ "type": "object", "properties": { "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" }, "response": { @@ -1963,17 +1660,328 @@ "properties": { "auditLogConfigs": { "description": "The configuration for logging of each type of permission.\nNext ID: 4", - "type": "array", "items": { "$ref": "AuditLogConfig" - } + }, + "type": "array" }, "service": { - "type": "string", - "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services." + "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services.", + "type": "string" } }, "id": "AuditConfig" + }, + "Constraint": { + "description": "A `Constraint` describes a way in which a resource's configuration can be\nrestricted. For example, it controls which cloud services can be activated\nacross an organization, or whether a Compute Engine instance can have\nserial port connections established. `Constraints` can be configured by the\norganization's policy adminstrator to fit the needs of the organzation by\nsetting Policies for `Constraints` at different locations in the\norganization's resource hierarchy. Policies are inherited down the resource\nhierarchy from higher levels, but can also be overridden. For details about\nthe inheritance rules please read about\nPolicies.\n\n`Constraints` have a default behavior determined by the `constraint_default`\nfield, which is the enforcement behavior that is used in the absence of a\n`Policy` being defined or inherited for the resource in question.", + "type": "object", + "properties": { + "constraintDefault": { + "enumDescriptions": [ + "This is only used for distinguishing unset values and should never be\nused.", + "Indicate that all values are allowed for list constraints.\nIndicate that enforcement is off for boolean constraints.", + "Indicate that all values are denied for list constraints.\nIndicate that enforcement is on for boolean constraints." + ], + "enum": [ + "CONSTRAINT_DEFAULT_UNSPECIFIED", + "ALLOW", + "DENY" + ], + "description": "The evaluation behavior of this constraint in the absense of 'Policy'.", + "type": "string" + }, + "name": { + "description": "Immutable value, required to globally be unique. For example,\n`constraints/serviceuser.services`", + "type": "string" + }, + "listConstraint": { + "description": "Defines this constraint as being a ListConstraint.", + "$ref": "ListConstraint" + }, + "version": { + "format": "int32", + "description": "Version of the `Constraint`. Default version is 0;", + "type": "integer" + }, + "displayName": { + "description": "The human readable name.\n\nMutable.", + "type": "string" + }, + "description": { + "description": "Detailed description of what this `Constraint` controls as well as how and\nwhere it is enforced.\n\nMutable.", + "type": "string" + }, + "booleanConstraint": { + "description": "Defines this constraint as being a BooleanConstraint.", + "$ref": "BooleanConstraint" + } + }, + "id": "Constraint" + }, + "ListLiensResponse": { + "description": "The response message for Liens.ListLiens.", + "type": "object", + "properties": { + "liens": { + "description": "A list of Liens.", + "items": { + "$ref": "Lien" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no more\nresults in the list.", + "type": "string" + } + }, + "id": "ListLiensResponse" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "Status" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" + }, + "RestoreDefault": { + "description": "Ignores policies set above this resource and restores the\n`constraint_default` enforcement behavior of the specific `Constraint` at\nthis resource.\n\nSuppose that `constraint_default` is set to `ALLOW` for the\n`Constraint` `constraints/serviceuser.services`. Suppose that organization\nfoo.com sets a `Policy` at their Organization resource node that restricts\nthe allowed service activations to deny all service activations. They\ncould then set a `Policy` with the `policy_type` `restore_default` on\nseveral experimental projects, restoring the `constraint_default`\nenforcement of the `Constraint` for only those projects, allowing those\nprojects to have all services activated.", + "type": "object", + "properties": {}, + "id": "RestoreDefault" + }, + "GetOrgPolicyRequest": { + "description": "The request sent to the GetOrgPolicy method.", + "type": "object", + "properties": { + "constraint": { + "description": "Name of the `Constraint` to get the `Policy`.", + "type": "string" + } + }, + "id": "GetOrgPolicyRequest" + }, + "UndeleteProjectRequest": { + "description": "The request sent to the UndeleteProject\nmethod.", + "type": "object", + "properties": {}, + "id": "UndeleteProjectRequest" + }, + "ClearOrgPolicyRequest": { + "description": "The request sent to the ClearOrgPolicy method.", + "type": "object", + "properties": { + "constraint": { + "description": "Name of the `Constraint` of the `Policy` to clear.", + "type": "string" + }, + "etag": { + "format": "byte", + "description": "The current version, for concurrency control. Not sending an `etag`\nwill cause the `Policy` to be cleared blindly.", + "type": "string" + } + }, + "id": "ClearOrgPolicyRequest" + }, + "ProjectCreationStatus": { + "description": "A status object which is used as the `metadata` field for the Operation\nreturned by CreateProject. It provides insight for when significant phases of\nProject creation have completed.", + "type": "object", + "properties": { + "gettable": { + "description": "True if the project can be retrieved using GetProject. No other operations\non the project are guaranteed to work until the project creation is\ncomplete.", + "type": "boolean" + }, + "createTime": { + "format": "google-datetime", + "description": "Creation time of the project creation workflow.", + "type": "string" + }, + "ready": { + "description": "True if the project creation process is complete.", + "type": "boolean" + } + }, + "id": "ProjectCreationStatus" + }, + "BooleanConstraint": { + "description": "A `Constraint` that is either enforced or not.\n\nFor example a constraint `constraints/compute.disableSerialPortAccess`.\nIf it is enforced on a VM instance, serial port connections will not be\nopened to that instance.", + "type": "object", + "properties": {}, + "id": "BooleanConstraint" + }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse" + }, + "OrganizationOwner": { + "description": "The entity that owns an Organization. The lifetime of the Organization and\nall of its descendants are bound to the `OrganizationOwner`. If the\n`OrganizationOwner` is deleted, the Organization and all its descendants will\nbe deleted.", + "type": "object", + "properties": { + "directoryCustomerId": { + "description": "The Google for Work customer id used in the Directory API.", + "type": "string" + } + }, + "id": "OrganizationOwner" + }, + "ListProjectsResponse": { + "description": "A page of the response received from the\nListProjects\nmethod.\n\nA paginated response where more pages are available has\n`next_page_token` set. This token can be used in a subsequent request to\nretrieve the next request page.", + "type": "object", + "properties": { + "projects": { + "description": "The list of Projects that matched the list filter. This list can\nbe paginated.", + "items": { + "$ref": "Project" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pagination token.\n\nIf the result set is too large to fit in a single response, this token\nis returned. It encodes the position of the current result cursor.\nFeeding this value into a new list request with the `page_token` parameter\ngives the next page of the results.\n\nWhen `next_page_token` is not filled in, there is no next page and\nthe list returned is the last page in the result set.\n\nPagination tokens have a limited lifetime.", + "type": "string" + } + }, + "id": "ListProjectsResponse" + }, + "Project": { + "description": "A Project is a high-level Google Cloud Platform entity. It is a\ncontainer for ACLs, APIs, App Engine Apps, VMs, and other\nGoogle Cloud Platform resources.", + "type": "object", + "properties": { + "projectId": { + "description": "The unique, user-assigned ID of the Project.\nIt must be 6 to 30 lowercase letters, digits, or hyphens.\nIt must start with a letter.\nTrailing hyphens are prohibited.\n\nExample: \u003ccode\u003etokyo-rain-123\u003c/code\u003e\nRead-only after creation.", + "type": "string" + }, + "lifecycleState": { + "description": "The Project lifecycle state.\n\nRead-only.", + "type": "string", + "enumDescriptions": [ + "Unspecified state. This is only used/useful for distinguishing\nunset values.", + "The normal and active state.", + "The project has been marked for deletion by the user\n(by invoking\nDeleteProject)\nor by the system (Google Cloud Platform).\nThis can generally be reversed by invoking UndeleteProject.", + "This lifecycle state is no longer used and not returned by the API." + ], + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED", + "DELETE_IN_PROGRESS" + ] + }, + "projectNumber": { + "format": "int64", + "description": "The number uniquely identifying the project.\n\nExample: \u003ccode\u003e415104041262\u003c/code\u003e\nRead-only.", + "type": "string" + }, + "parent": { + "$ref": "ResourceId", + "description": "An optional reference to a parent Resource.\n\nThe only supported parent type is \"organization\". Once set, the parent\ncannot be modified. The `parent` can be set on creation or using the\n`UpdateProject` method; the end user must have the\n`resourcemanager.projects.create` permission on the parent.\n\nRead-write." + }, + "labels": { + "description": "The labels associated with this Project.\n\nLabel keys must be between 1 and 63 characters long and must conform\nto the following regular expression: \\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?.\n\nLabel values must be between 0 and 63 characters long and must conform\nto the regular expression (\\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?)?.\n\nNo more than 256 labels can be associated with a given resource.\n\nClients should store labels in a representation such as JSON that does not\ndepend on specific characters being disallowed.\n\nExample: \u003ccode\u003e\"environment\" : \"dev\"\u003c/code\u003e\nRead-write.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "createTime": { + "format": "google-datetime", + "description": "Creation time.\n\nRead-only.", + "type": "string" + }, + "name": { + "description": "The user-assigned display name of the Project.\nIt must be 4 to 30 characters.\nAllowed characters are: lowercase and uppercase letters, numbers,\nhyphen, single-quote, double-quote, space, and exclamation point.\n\nExample: \u003ccode\u003eMy Project\u003c/code\u003e\nRead-write.", + "type": "string" + } + }, + "id": "Project" + }, + "ListOrgPoliciesResponse": { + "description": "The response returned from the ListOrgPolicies method. It will be empty\nif no `Policies` are set on the resource.", + "type": "object", + "properties": { + "policies": { + "description": "The `Policies` that are set on the resource. It will be empty if no\n`Policies` are set.", + "items": { + "$ref": "OrgPolicy" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Page token used to retrieve the next page. This is currently not used, but\nthe server may at any point start supplying a valid token.", + "type": "string" + } + }, + "id": "ListOrgPoliciesResponse" + }, + "SearchOrganizationsResponse": { + "description": "The response returned from the `SearchOrganizations` method.", + "type": "object", + "properties": { + "organizations": { + "description": "The list of Organizations that matched the search query, possibly\npaginated.", + "items": { + "$ref": "Organization" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A pagination token to be used to retrieve the next page of results. If the\nresult is too large to fit within the page size specified in the request,\nthis field will be set with a token that can be used to fetch the next page\nof results. If this field is empty, it indicates that this response\ncontains the last page of results.", + "type": "string" + } + }, + "id": "SearchOrganizationsResponse" } }, "protocol": "rest", @@ -1981,8 +1989,6 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "version": "v1", - "baseUrl": "https://cloudresourcemanager.googleapis.com/", "canonicalName": "Cloud Resource Manager", "auth": { "oauth2": { @@ -1996,12 +2002,7 @@ } } }, - "kind": "discovery#restDescription", - "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.", - "servicePath": "", "rootUrl": "https://cloudresourcemanager.googleapis.com/", - "basePath": "", "ownerDomain": "google.com", - "name": "cloudresourcemanager", - "batchPath": "batch" + "name": "cloudresourcemanager" } diff --git a/etc/api/cloudresourcemanager/v1/crates/1.0.6-api+20170920 b/etc/api/cloudresourcemanager/v1/crates/1.0.6-api+20170920 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudresourcemanager/v1/crates/1.0.6-cli+20170920 b/etc/api/cloudresourcemanager/v1/crates/1.0.6-cli+20170920 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json index e1d3809c58..8bd387cef9 100644 --- a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json +++ b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json @@ -1,89 +1,25 @@ { + "version": "v1beta1", + "baseUrl": "https://cloudresourcemanager.googleapis.com/", + "kind": "discovery#restDescription", + "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.", + "servicePath": "", + "basePath": "", + "revision": "20170920", + "documentationLink": "https://cloud.google.com/resource-manager", + "id": "cloudresourcemanager:v1beta1", + "discoveryVersion": "v1", "schemas": { - "Ancestor": { - "description": "Identifying information for a single ancestor of a project.", - "type": "object", - "properties": { - "resourceId": { - "$ref": "ResourceId", - "description": "Resource id of the ancestor." - } - }, - "id": "Ancestor" - }, - "SetIamPolicyRequest": { - "description": "Request message for `SetIamPolicy` method.", - "type": "object", - "properties": { - "policy": { - "$ref": "Policy", - "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." - }, - "updateMask": { - "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", - "format": "google-fieldmask", - "type": "string" - } - }, - "id": "SetIamPolicyRequest" - }, - "ListOrganizationsResponse": { - "description": "The response returned from the `ListOrganizations` method.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "A pagination token to be used to retrieve the next page of results. If the\nresult is too large to fit within the page size specified in the request,\nthis field will be set with a token that can be used to fetch the next page\nof results. If this field is empty, it indicates that this response\ncontains the last page of results.", - "type": "string" - }, - "organizations": { - "type": "array", - "items": { - "$ref": "Organization" - }, - "description": "The list of Organizations that matched the list query, possibly paginated." - } - }, - "id": "ListOrganizationsResponse" - }, - "Binding": { - "properties": { - "members": { - "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", - "items": { - "type": "string" - } - }, - "role": { - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", - "type": "string" - } - }, - "id": "Binding", - "description": "Associates `members` with a `role`.", - "type": "object" - }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object", "properties": {}, "id": "Empty" }, - "UndeleteProjectRequest": { - "description": "The request sent to the UndeleteProject\nmethod.", - "type": "object", - "properties": {}, - "id": "UndeleteProjectRequest" - }, "Organization": { "description": "The root node in the resource hierarchy to which a particular entity's\n(e.g., company) resources belong.", "type": "object", "properties": { - "creationTime": { - "description": "Timestamp when the Organization was created. Assigned by the server.\n@OutputOnly", - "format": "google-datetime", - "type": "string" - }, "owner": { "$ref": "OrganizationOwner", "description": "The owner of this Organization. The owner should be specified on\ncreation. Once set, it cannot be changed.\nThis field is required." @@ -97,42 +33,53 @@ "type": "string" }, "lifecycleState": { + "enumDescriptions": [ + "Unspecified state. This is only useful for distinguishing unset values.", + "The normal and active state.", + "The organization has been marked for deletion by the user." + ], "enum": [ "LIFECYCLE_STATE_UNSPECIFIED", "ACTIVE", "DELETE_REQUESTED" ], "description": "The organization's current lifecycle state. Assigned by the server.\n@OutputOnly", - "type": "string", - "enumDescriptions": [ - "Unspecified state. This is only useful for distinguishing unset values.", - "The normal and active state.", - "The organization has been marked for deletion by the user." - ] + "type": "string" }, "displayName": { "description": "A friendly string to be used to refer to the Organization in the UI.\nAssigned by the server, set to the primary domain of the G Suite\ncustomer that owns the organization.\n@OutputOnly", "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "Timestamp when the Organization was created. Assigned by the server.\n@OutputOnly", + "type": "string" } }, "id": "Organization" }, + "UndeleteProjectRequest": { + "description": "The request sent to the UndeleteProject\nmethod.", + "type": "object", + "properties": {}, + "id": "UndeleteProjectRequest" + }, "ProjectCreationStatus": { "description": "A status object which is used as the `metadata` field for the Operation\nreturned by CreateProject. It provides insight for when significant phases of\nProject creation have completed.", "type": "object", "properties": { "ready": { - "type": "boolean", - "description": "True if the project creation process is complete." - }, - "createTime": { - "description": "Creation time of the project creation workflow.", - "format": "google-datetime", - "type": "string" + "description": "True if the project creation process is complete.", + "type": "boolean" }, "gettable": { "description": "True if the project can be retrieved using GetProject. No other operations\non the project are guaranteed to work until the project creation is\ncomplete.", "type": "boolean" + }, + "createTime": { + "format": "google-datetime", + "description": "Creation time of the project creation workflow.", + "type": "string" } }, "id": "ProjectCreationStatus" @@ -143,10 +90,10 @@ "properties": { "permissions": { "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "TestIamPermissionsResponse" @@ -157,20 +104,6 @@ "properties": {}, "id": "GetIamPolicyRequest" }, - "GetAncestryResponse": { - "description": "Response from the GetAncestry method.", - "type": "object", - "properties": { - "ancestor": { - "description": "Ancestors are ordered from bottom to top of the resource hierarchy. The\nfirst ancestor is the project itself, followed by the project's parent,\netc.", - "type": "array", - "items": { - "$ref": "Ancestor" - } - } - }, - "id": "GetAncestryResponse" - }, "OrganizationOwner": { "description": "The entity that owns an Organization. The lifetime of the Organization and\nall of its descendants are bound to the `OrganizationOwner`. If the\n`OrganizationOwner` is deleted, the Organization and all its descendants will\nbe deleted.", "type": "object", @@ -182,16 +115,48 @@ }, "id": "OrganizationOwner" }, + "GetAncestryResponse": { + "description": "Response from the GetAncestry method.", + "type": "object", + "properties": { + "ancestor": { + "description": "Ancestors are ordered from bottom to top of the resource hierarchy. The\nfirst ancestor is the project itself, followed by the project's parent,\netc.", + "items": { + "$ref": "Ancestor" + }, + "type": "array" + } + }, + "id": "GetAncestryResponse" + }, + "ListProjectsResponse": { + "description": "A page of the response received from the\nListProjects\nmethod.\n\nA paginated response where more pages are available has\n`next_page_token` set. This token can be used in a subsequent request to\nretrieve the next request page.", + "type": "object", + "properties": { + "projects": { + "description": "The list of Projects that matched the list filter. This list can\nbe paginated.", + "items": { + "$ref": "Project" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pagination token.\n\nIf the result set is too large to fit in a single response, this token\nis returned. It encodes the position of the current result cursor.\nFeeding this value into a new list request with the `page_token` parameter\ngives the next page of the results.\n\nWhen `next_page_token` is not filled in, there is no next page and\nthe list returned is the last page in the result set.\n\nPagination tokens have a limited lifetime.", + "type": "string" + } + }, + "id": "ListProjectsResponse" + }, "AuditLogConfig": { "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", "type": "object", "properties": { "exemptedMembers": { "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "logType": { "description": "The log type that this config enables.", @@ -212,36 +177,21 @@ }, "id": "AuditLogConfig" }, - "ListProjectsResponse": { - "description": "A page of the response received from the\nListProjects\nmethod.\n\nA paginated response where more pages are available has\n`next_page_token` set. This token can be used in a subsequent request to\nretrieve the next request page.", - "type": "object", - "properties": { - "projects": { - "description": "The list of Projects that matched the list filter. This list can\nbe paginated.", - "type": "array", - "items": { - "$ref": "Project" - } - }, - "nextPageToken": { - "description": "Pagination token.\n\nIf the result set is too large to fit in a single response, this token\nis returned. It encodes the position of the current result cursor.\nFeeding this value into a new list request with the `page_token` parameter\ngives the next page of the results.\n\nWhen `next_page_token` is not filled in, there is no next page and\nthe list returned is the last page in the result set.\n\nPagination tokens have a limited lifetime.", - "type": "string" - } - }, - "id": "ListProjectsResponse" - }, "GetAncestryRequest": { - "properties": {}, - "id": "GetAncestryRequest", "description": "The request sent to the\nGetAncestry\nmethod.", - "type": "object" + "type": "object", + "properties": {}, + "id": "GetAncestryRequest" }, "Project": { "description": "A Project is a high-level Google Cloud Platform entity. It is a\ncontainer for ACLs, APIs, App Engine Apps, VMs, and other\nGoogle Cloud Platform resources.", "type": "object", "properties": { + "projectId": { + "description": "The unique, user-assigned ID of the Project.\nIt must be 6 to 30 lowercase letters, digits, or hyphens.\nIt must start with a letter.\nTrailing hyphens are prohibited.\n\nExample: \u003ccode\u003etokyo-rain-123\u003c/code\u003e\nRead-only after creation.", + "type": "string" + }, "lifecycleState": { - "type": "string", "enumDescriptions": [ "Unspecified state. This is only used/useful for distinguishing\nunset values.", "The normal and active state.", @@ -254,16 +204,22 @@ "DELETE_REQUESTED", "DELETE_IN_PROGRESS" ], - "description": "The Project lifecycle state.\n\nRead-only." + "description": "The Project lifecycle state.\n\nRead-only.", + "type": "string" }, "projectNumber": { - "type": "string", + "format": "int64", "description": "The number uniquely identifying the project.\n\nExample: \u003ccode\u003e415104041262\u003c/code\u003e\nRead-only.", - "format": "int64" + "type": "string" }, "parent": { - "$ref": "ResourceId", - "description": "An optional reference to a parent Resource.\n\nThe only supported parent type is \"organization\". Once set, the parent\ncannot be modified. The `parent` can be set on creation or using the\n`UpdateProject` method; the end user must have the\n`resourcemanager.projects.create` permission on the parent.\n\nRead-write." + "description": "An optional reference to a parent Resource.\n\nThe only supported parent type is \"organization\". Once set, the parent\ncannot be modified. The `parent` can be set on creation or using the\n`UpdateProject` method; the end user must have the\n`resourcemanager.projects.create` permission on the parent.\n\nRead-write.", + "$ref": "ResourceId" + }, + "createTime": { + "format": "google-datetime", + "description": "Creation time.\n\nRead-only.", + "type": "string" }, "labels": { "description": "The labels associated with this Project.\n\nLabel keys must be between 1 and 63 characters long and must conform\nto the following regular expression: \\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?.\n\nLabel values must be between 0 and 63 characters long and must conform\nto the regular expression (\\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?)?.\n\nNo more than 256 labels can be associated with a given resource.\n\nClients should store labels in a representation such as JSON that does not\ndepend on specific characters being disallowed.\n\nExample: \u003ccode\u003e\"environment\" : \"dev\"\u003c/code\u003e\nRead-write.", @@ -272,105 +228,64 @@ "type": "string" } }, - "createTime": { - "description": "Creation time.\n\nRead-only.", - "format": "google-datetime", - "type": "string" - }, "name": { "description": "The user-assigned display name of the Project.\nIt must be 4 to 30 characters.\nAllowed characters are: lowercase and uppercase letters, numbers,\nhyphen, single-quote, double-quote, space, and exclamation point.\n\nExample: \u003ccode\u003eMy Project\u003c/code\u003e\nRead-write.", "type": "string" - }, - "projectId": { - "description": "The unique, user-assigned ID of the Project.\nIt must be 6 to 30 lowercase letters, digits, or hyphens.\nIt must start with a letter.\nTrailing hyphens are prohibited.\n\nExample: \u003ccode\u003etokyo-rain-123\u003c/code\u003e\nRead-only after creation.", - "type": "string" } }, "id": "Project" }, "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", "properties": { "permissions": { "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "TestIamPermissionsRequest", - "description": "Request message for `TestIamPermissions` method.", - "type": "object" + "id": "TestIamPermissionsRequest" }, "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", "type": "object", "properties": { + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + }, + "type": "array" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "type": "string" }, "version": { - "description": "Version of the `Policy`. The default version is 0.", "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", "type": "integer" - }, - "auditConfigs": { - "description": "Specifies cloud audit logging configuration for this policy.", - "type": "array", - "items": { - "$ref": "AuditConfig" - } - }, - "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", - "items": { - "$ref": "Binding" - } } }, - "id": "Policy", - "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam)." - }, - "FolderOperation": { - "description": "Metadata describing a long running folder operation", - "type": "object", - "properties": { - "displayName": { - "description": "The display name of the folder.", - "type": "string" - }, - "sourceParent": { - "description": "The resource name of the folder's parent.\nOnly applicable when the operation_type is MOVE.", - "type": "string" - }, - "destinationParent": { - "description": "The resource name of the folder or organization we are either creating\nthe folder under or moving the folder to.", - "type": "string" - }, - "operationType": { - "enumDescriptions": [ - "Operation type not specified.", - "A create folder operation.", - "A move folder operation." - ], - "enum": [ - "OPERATION_TYPE_UNSPECIFIED", - "CREATE", - "MOVE" - ], - "description": "The type of this operation.", - "type": "string" - } - }, - "id": "FolderOperation" + "id": "Policy" }, "FolderOperationError": { "description": "A classification of the Folder Operation error.", "type": "object", "properties": { "errorMessageId": { + "description": "The type of operation error experienced.", "type": "string", "enumDescriptions": [ "The error type was unrecognized or unspecified.", @@ -395,44 +310,139 @@ "FOLDER_BEING_MOVED_VIOLATION", "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION", "DELETED_FOLDER_HEIGHT_VIOLATION" - ], - "description": "The type of operation error experienced." + ] } }, "id": "FolderOperationError" }, - "ResourceId": { + "FolderOperation": { + "description": "Metadata describing a long running folder operation", + "type": "object", "properties": { + "sourceParent": { + "description": "The resource name of the folder's parent.\nOnly applicable when the operation_type is MOVE.", + "type": "string" + }, + "displayName": { + "description": "The display name of the folder.", + "type": "string" + }, + "destinationParent": { + "description": "The resource name of the folder or organization we are either creating\nthe folder under or moving the folder to.", + "type": "string" + }, + "operationType": { + "enumDescriptions": [ + "Operation type not specified.", + "A create folder operation.", + "A move folder operation." + ], + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "CREATE", + "MOVE" + ], + "description": "The type of this operation.", + "type": "string" + } + }, + "id": "FolderOperation" + }, + "ResourceId": { + "description": "A container to reference an id for any resource type. A `resource` in Google\nCloud Platform is a generic term for something you (a developer) may want to\ninteract with through one of our API's. Some examples are an App Engine app,\na Compute Engine instance, a Cloud SQL database, and so on.", + "type": "object", + "properties": { + "type": { + "description": "Required field representing the resource type this id is for.\nAt present, the valid types are \"project\", \"folder\", and \"organization\".", + "type": "string" + }, "id": { "description": "Required field for the type-specific id. This should correspond to the id\nused in the type-specific API's.", "type": "string" - }, - "type": { - "type": "string", - "description": "Required field representing the resource type this id is for.\nAt present, the valid types are \"project\" and \"organization\"." } }, - "id": "ResourceId", - "description": "A container to reference an id for any resource type. A `resource` in Google\nCloud Platform is a generic term for something you (a developer) may want to\ninteract with through one of our API's. Some examples are an App Engine app,\na Compute Engine instance, a Cloud SQL database, and so on.", - "type": "object" + "id": "ResourceId" }, "AuditConfig": { + "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", + "type": "object", "properties": { + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.\nNext ID: 4", + "items": { + "$ref": "AuditLogConfig" + }, + "type": "array" + }, "service": { "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services.", "type": "string" - }, - "auditLogConfigs": { - "description": "The configuration for logging of each type of permission.\nNext ID: 4", - "type": "array", - "items": { - "$ref": "AuditLogConfig" - } } }, - "id": "AuditConfig", - "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", - "type": "object" + "id": "AuditConfig" + }, + "Ancestor": { + "description": "Identifying information for a single ancestor of a project.", + "type": "object", + "properties": { + "resourceId": { + "description": "Resource id of the ancestor.", + "$ref": "ResourceId" + } + }, + "id": "Ancestor" + }, + "ListOrganizationsResponse": { + "description": "The response returned from the `ListOrganizations` method.", + "type": "object", + "properties": { + "organizations": { + "description": "The list of Organizations that matched the list query, possibly paginated.", + "items": { + "$ref": "Organization" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A pagination token to be used to retrieve the next page of results. If the\nresult is too large to fit within the page size specified in the request,\nthis field will be set with a token that can be used to fetch the next page\nof results. If this field is empty, it indicates that this response\ncontains the last page of results.", + "type": "string" + } + }, + "id": "ListOrganizationsResponse" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them.", + "$ref": "Policy" + }, + "updateMask": { + "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", + "type": "string" + } + }, + "id": "SetIamPolicyRequest" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" } }, "protocol": "rest", @@ -440,8 +450,6 @@ "x32": "http://www.google.com/images/icons/product/search-32.gif", "x16": "http://www.google.com/images/icons/product/search-16.gif" }, - "version": "v1beta1", - "baseUrl": "https://cloudresourcemanager.googleapis.com/", "canonicalName": "Cloud Resource Manager", "auth": { "oauth2": { @@ -455,177 +463,21 @@ } } }, - "servicePath": "", - "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.", - "kind": "discovery#restDescription", "rootUrl": "https://cloudresourcemanager.googleapis.com/", - "basePath": "", "ownerDomain": "google.com", "name": "cloudresourcemanager", "batchPath": "batch", - "revision": "20170517", - "documentationLink": "https://cloud.google.com/resource-manager", - "id": "cloudresourcemanager:v1beta1", + "fullyEncodeReservedExpansion": true, "title": "Google Cloud Resource Manager API", - "discoveryVersion": "v1", "ownerName": "Google", "resources": { "organizations": { "methods": { - "list": { - "response": { - "$ref": "ListOrganizationsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "filter": { - "location": "query", - "description": "An optional query string used to filter the Organizations to return in\nthe response. Filter rules are case-insensitive.\n\n\nOrganizations may be filtered by `owner.directoryCustomerId` or by\n`domain`, where the domain is a Google for Work domain, for example:\n\n|Filter|Description|\n|------|-----------|\n|owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.|\n|domain:google.com|Organizations corresponding to the domain `google.com`.|\n\nThis field is optional.", - "type": "string" - }, - "pageToken": { - "description": "A pagination token returned from a previous call to `ListOrganizations`\nthat indicates from where listing should continue.\nThis field is optional.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The maximum number of Organizations to return in the response.\nThis field is optional.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v1beta1/organizations", - "path": "v1beta1/organizations", - "id": "cloudresourcemanager.organizations.list", - "description": "Lists Organization resources that are visible to the user and satisfy\nthe specified filter. This method returns Organizations in an unspecified\norder. New Organizations do not necessarily appear at the end of the list." - }, - "setIamPolicy": { - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/organizations/{organizationsId}:setIamPolicy", - "id": "cloudresourcemanager.organizations.setIamPolicy", - "path": "v1beta1/{+resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on an Organization resource. Replaces any\nexisting policy. The `resource` field should be the organization's resource\nname, e.g. \"organizations/123\".", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - } - }, - "getIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "flatPath": "v1beta1/organizations/{organizationsId}:getIamPolicy", - "id": "cloudresourcemanager.organizations.getIamPolicy", - "path": "v1beta1/{+resource}:getIamPolicy", - "request": { - "$ref": "GetIamPolicyRequest" - }, - "description": "Gets the access control policy for an Organization resource. May be empty\nif no such policy or resource exists. The `resource` field should be the\norganization's resource name, e.g. \"organizations/123\"." - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Organization" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "name": { - "pattern": "^organizations/[^/]+$", - "location": "path", - "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".", - "required": true, - "type": "string" - }, - "organizationId": { - "location": "query", - "description": "The id of the Organization resource to fetch.\nThis field is deprecated and will be removed in v1. Use name instead.", - "type": "string" - } - }, - "flatPath": "v1beta1/organizations/{organizationsId}", - "id": "cloudresourcemanager.organizations.get", - "path": "v1beta1/{+name}", - "description": "Fetches an Organization resource identified by the specified resource name." - }, - "update": { - "id": "cloudresourcemanager.organizations.update", - "path": "v1beta1/{+name}", - "request": { - "$ref": "Organization" - }, - "description": "Updates an Organization resource identified by the specified resource name.", - "httpMethod": "PUT", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Organization" - }, - "parameters": { - "name": { - "pattern": "^organizations/[^/]+$", - "location": "path", - "description": "Output Only. The resource name of the organization. This is the\norganization's relative path in the API. Its format is\n\"organizations/[organization_id]\". For example, \"organizations/1234\".", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/organizations/{organizationsId}" - }, "testIamPermissions": { - "description": "Returns permissions that a caller has on the specified Organization.\nThe `resource` field should be the organization's resource name,\ne.g. \"organizations/123\".", "request": { "$ref": "TestIamPermissionsRequest" }, + "description": "Returns permissions that a caller has on the specified Organization.\nThe `resource` field should be the organization's resource name,\ne.g. \"organizations/123\".", "httpMethod": "POST", "parameterOrder": [ "resource" @@ -639,110 +491,51 @@ ], "parameters": { "resource": { - "pattern": "^organizations/[^/]+$", "location": "path", "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", "required": true, - "type": "string" + "pattern": "^organizations/[^/]+$" } }, "flatPath": "v1beta1/organizations/{organizationsId}:testIamPermissions", - "id": "cloudresourcemanager.organizations.testIamPermissions", - "path": "v1beta1/{+resource}:testIamPermissions" - } - } - }, - "projects": { - "methods": { - "delete": { - "path": "v1beta1/projects/{projectId}", - "id": "cloudresourcemanager.projects.delete", - "description": "Marks the Project identified by the specified\n`project_id` (for example, `my-project-123`) for deletion.\nThis method will only affect the Project if the following criteria are met:\n\n+ The Project does not have a billing account associated with it.\n+ The Project has a lifecycle state of\nACTIVE.\n\nThis method changes the Project's lifecycle state from\nACTIVE\nto DELETE_REQUESTED.\nThe deletion starts at an unspecified time, at which point the project is\nno longer accessible.\n\nUntil the deletion completes, you can check the lifecycle state\nchecked by retrieving the Project with GetProject,\nand the Project remains visible to ListProjects.\nHowever, you cannot update the project.\n\nAfter the deletion completes, the Project is not retrievable by\nthe GetProject and\nListProjects methods.\n\nThe caller must have modify permissions for this Project.", - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "projectId" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The Project ID (for example, `foo-bar-123`).\n\nRequired.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectId}" + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "cloudresourcemanager.organizations.testIamPermissions" }, "list": { + "description": "Lists Organization resources that are visible to the user and satisfy\nthe specified filter. This method returns Organizations in an unspecified\norder. New Organizations do not necessarily appear at the end of the list.", "httpMethod": "GET", - "response": { - "$ref": "ListProjectsResponse" - }, "parameterOrder": [], - "parameters": { - "filter": { - "location": "query", - "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red labels.size:big|The project's label `color` has the\nvalue `red` and its label `size` has the value `big`.\n\nOptional.", - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "A pagination token returned from a previous call to ListProjects\nthat indicates from where listing should continue.\n\nOptional.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "The maximum number of Projects to return in the response.\nThe server can return fewer Projects than requested.\nIf unspecified, server picks an appropriate default.\n\nOptional.", - "format": "int32", - "type": "integer" - } + "response": { + "$ref": "ListOrganizationsResponse" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], - "flatPath": "v1beta1/projects", - "id": "cloudresourcemanager.projects.list", - "path": "v1beta1/projects", - "description": "Lists Projects that are visible to the user and satisfy the\nspecified filter. This method returns Projects in an unspecified order.\nNew Projects do not necessarily appear at the end of the list." - }, - "create": { - "path": "v1beta1/projects", - "id": "cloudresourcemanager.projects.create", - "request": { - "$ref": "Project" - }, - "description": "Creates a Project resource.\n\nInitially, the Project resource is owned by its creator exclusively.\nThe creator can later grant permission to others to read or update the\nProject.\n\nSeveral APIs are activated automatically for the Project, including\nGoogle Cloud Storage.", - "response": { - "$ref": "Project" - }, - "parameterOrder": [], - "httpMethod": "POST", "parameters": { - "useLegacyStack": { + "pageSize": { "location": "query", - "description": "A safety hatch to opt out of the new reliable project creation process.", - "type": "boolean" + "format": "int32", + "description": "The maximum number of Organizations to return in the response.\nThis field is optional.", + "type": "integer" + }, + "filter": { + "description": "An optional query string used to filter the Organizations to return in\nthe response. Filter rules are case-insensitive.\n\n\nOrganizations may be filtered by `owner.directoryCustomerId` or by\n`domain`, where the domain is a Google for Work domain, for example:\n\n|Filter|Description|\n|------|-----------|\n|owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.|\n|domain:google.com|Organizations corresponding to the domain `google.com`.|\n\nThis field is optional.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "A pagination token returned from a previous call to `ListOrganizations`\nthat indicates from where listing should continue.\nThis field is optional.", + "type": "string" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects" + "flatPath": "v1beta1/organizations", + "path": "v1beta1/organizations", + "id": "cloudresourcemanager.organizations.list" }, "setIamPolicy": { - "flatPath": "v1beta1/projects/{resource}:setIamPolicy", - "id": "cloudresourcemanager.projects.setIamPolicy", - "path": "v1beta1/projects/{resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the IAM access control policy for the specified Project. Replaces\nany existing policy.\n\nThe following constraints apply when using `setIamPolicy()`:\n\n+ Project does not support `allUsers` and `allAuthenticatedUsers` as\n`members` in a `Binding` of a `Policy`.\n\n+ The owner role can be granted only to `user` and `serviceAccount`.\n\n+ Service accounts can be made owners of a project directly\nwithout any restrictions. However, to be added as an owner, a user must be\ninvited via Cloud Platform console and must accept the invitation.\n\n+ A user cannot be granted the owner role using `setIamPolicy()`. The user\nmust be granted the owner role using the Cloud Platform Console and must\nexplicitly accept the invitation.\n\n+ Invitations to grant the owner role cannot be sent using\n`setIamPolicy()`; they must be sent only using the Cloud Platform Console.\n\n+ Membership changes that leave the project without any owners that have\naccepted the Terms of Service (ToS) will be rejected.\n\n+ There must be at least one owner who has accepted the Terms of\nService (ToS) agreement in the policy. Calling `setIamPolicy()` to\nremove the last ToS-accepted owner from the policy will fail. This\nrestriction also applies to legacy projects that no longer have owners\nwho have accepted the ToS. Edits to IAM policies will be rejected until\nthe lack of a ToS-accepting owner is rectified.\n\n+ Calling this method requires enabling the App Engine Admin API.\n\nNote: Removing service accounts from policies or changing their roles\ncan render services completely inoperable. It is important to understand\nhow the service account is being used before removing or updating its\nroles.", "httpMethod": "POST", "parameterOrder": [ "resource" @@ -750,18 +543,118 @@ "response": { "$ref": "Policy" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { "resource": { - "location": "path", "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/organizations/{organizationsId}:setIamPolicy", + "path": "v1beta1/{+resource}:setIamPolicy", + "id": "cloudresourcemanager.organizations.setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on an Organization resource. Replaces any\nexisting policy. The `resource` field should be the organization's resource\nname, e.g. \"organizations/123\"." + }, + "getIamPolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/organizations/{organizationsId}:getIamPolicy", + "path": "v1beta1/{+resource}:getIamPolicy", + "id": "cloudresourcemanager.organizations.getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for an Organization resource. May be empty\nif no such policy or resource exists. The `resource` field should be the\norganization's resource name, e.g. \"organizations/123\"." + }, + "get": { + "flatPath": "v1beta1/organizations/{organizationsId}", + "path": "v1beta1/{+name}", + "id": "cloudresourcemanager.organizations.get", + "description": "Fetches an Organization resource identified by the specified resource name.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Organization" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + }, + "organizationId": { + "location": "query", + "description": "The id of the Organization resource to fetch.\nThis field is deprecated and will be removed in v1. Use name instead.", "type": "string" } + } + }, + "update": { + "request": { + "$ref": "Organization" + }, + "description": "Updates an Organization resource identified by the specified resource name.", + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Organization" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] - }, + ], + "parameters": { + "name": { + "description": "Output Only. The resource name of the organization. This is the\norganization's relative path in the API. Its format is\n\"organizations/[organization_id]\". For example, \"organizations/1234\".", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/organizations/{organizationsId}", + "path": "v1beta1/{+name}", + "id": "cloudresourcemanager.organizations.update" + } + } + }, + "projects": { + "methods": { "getIamPolicy": { "description": "Returns the IAM access control policy for the specified Project.\nPermission is denied if the policy or the resource does not exist.", "request": { @@ -774,27 +667,30 @@ "response": { "$ref": "Policy" }, + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "location": "path" + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, "flatPath": "v1beta1/projects/{resource}:getIamPolicy", - "id": "cloudresourcemanager.projects.getIamPolicy", - "path": "v1beta1/projects/{resource}:getIamPolicy" + "path": "v1beta1/projects/{resource}:getIamPolicy", + "id": "cloudresourcemanager.projects.getIamPolicy" }, "undelete": { - "description": "Restores the Project identified by the specified\n`project_id` (for example, `my-project-123`).\nYou can only use this method for a Project that has a lifecycle state of\nDELETE_REQUESTED.\nAfter deletion starts, the Project cannot be restored.\n\nThe caller must have modify permissions for this Project.", + "flatPath": "v1beta1/projects/{projectId}:undelete", + "path": "v1beta1/projects/{projectId}:undelete", + "id": "cloudresourcemanager.projects.undelete", "request": { "$ref": "UndeleteProjectRequest" }, + "description": "Restores the Project identified by the specified\n`project_id` (for example, `my-project-123`).\nYou can only use this method for a Project that has a lifecycle state of\nDELETE_REQUESTED.\nAfter deletion starts, the Project cannot be restored.\n\nThe caller must have modify permissions for this Project.", "httpMethod": "POST", "parameterOrder": [ "projectId" @@ -807,18 +703,14 @@ ], "parameters": { "projectId": { - "location": "path", "description": "The project ID (for example, `foo-bar-123`).\n\nRequired.", + "type": "string", "required": true, - "type": "string" + "location": "path" } - }, - "flatPath": "v1beta1/projects/{projectId}:undelete", - "id": "cloudresourcemanager.projects.undelete", - "path": "v1beta1/projects/{projectId}:undelete" + } }, "get": { - "description": "Retrieves the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project.", "response": { "$ref": "Project" }, @@ -833,44 +725,52 @@ "parameters": { "projectId": { "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", - "required": true, "type": "string", + "required": true, "location": "path" } }, "flatPath": "v1beta1/projects/{projectId}", + "id": "cloudresourcemanager.projects.get", "path": "v1beta1/projects/{projectId}", - "id": "cloudresourcemanager.projects.get" + "description": "Retrieves the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project." }, "getAncestry": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta1/projects/{projectId}:getAncestry", - "id": "cloudresourcemanager.projects.getAncestry", - "path": "v1beta1/projects/{projectId}:getAncestry", "description": "Gets a list of ancestors in the resource hierarchy for the Project\nidentified by the specified `project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project.", "request": { "$ref": "GetAncestryRequest" }, - "httpMethod": "POST", + "response": { + "$ref": "GetAncestryResponse" + }, "parameterOrder": [ "projectId" ], - "response": { - "$ref": "GetAncestryResponse" - } + "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta1/projects/{projectId}:getAncestry", + "id": "cloudresourcemanager.projects.getAncestry", + "path": "v1beta1/projects/{projectId}:getAncestry" }, "update": { + "flatPath": "v1beta1/projects/{projectId}", + "id": "cloudresourcemanager.projects.update", + "path": "v1beta1/projects/{projectId}", + "description": "Updates the attributes of the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have modify permissions for this Project.", + "request": { + "$ref": "Project" + }, "response": { "$ref": "Project" }, @@ -882,54 +782,184 @@ "projectId": { "location": "path", "description": "The project ID (for example, `my-project-123`).\n\nRequired.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectId}", - "path": "v1beta1/projects/{projectId}", - "id": "cloudresourcemanager.projects.update", - "request": { - "$ref": "Project" - }, - "description": "Updates the attributes of the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have modify permissions for this Project." + ] }, "testIamPermissions": { - "id": "cloudresourcemanager.projects.testIamPermissions", - "path": "v1beta1/projects/{resource}:testIamPermissions", - "description": "Returns permissions that a caller has on the specified Project.", "request": { "$ref": "TestIamPermissionsRequest" }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], + "description": "Returns permissions that a caller has on the specified Project.", "response": { "$ref": "TestIamPermissionsResponse" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { "resource": { + "location": "path", "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{resource}:testIamPermissions", + "id": "cloudresourcemanager.projects.testIamPermissions", + "path": "v1beta1/projects/{resource}:testIamPermissions" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Project ID (for example, `foo-bar-123`).\n\nRequired.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectId}", + "id": "cloudresourcemanager.projects.delete", + "path": "v1beta1/projects/{projectId}", + "description": "Marks the Project identified by the specified\n`project_id` (for example, `my-project-123`) for deletion.\nThis method will only affect the Project if the following criteria are met:\n\n+ The Project does not have a billing account associated with it.\n+ The Project has a lifecycle state of\nACTIVE.\n\nThis method changes the Project's lifecycle state from\nACTIVE\nto DELETE_REQUESTED.\nThe deletion starts at an unspecified time, at which point the project is\nno longer accessible.\n\nUntil the deletion completes, you can check the lifecycle state\nchecked by retrieving the Project with GetProject,\nand the Project remains visible to ListProjects.\nHowever, you cannot update the project.\n\nAfter the deletion completes, the Project is not retrievable by\nthe GetProject and\nListProjects methods.\n\nThe caller must have modify permissions for this Project." + }, + "list": { + "description": "Lists Projects that are visible to the user and satisfy the\nspecified filter. This method returns Projects in an unspecified order.\nNew Projects do not necessarily appear at the end of the list.", + "response": { + "$ref": "ListProjectsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageSize": { + "format": "int32", + "description": "The maximum number of Projects to return in the response.\nThe server can return fewer Projects than requested.\nIf unspecified, server picks an appropriate default.\n\nOptional.", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`.\n\nIf you specify a filter that has both `parent.type` and `parent.id`, then\nthe `resourcemanager.projects.list` permission is checked on the parent.\nIf the user has this permission, all projects under the parent will be\nreturned after remaining filters have been applied. If the user lacks this\npermission, then all projects for which the user has the\n`resourcemanager.projects.get` permission will be returned after remaining\nfilters have been applied. If no filter is specified, the call will return\nprojects for which the user has `resourcemanager.projects.get` permissions.\n\nOptional.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "A pagination token returned from a previous call to ListProjects\nthat indicates from where listing should continue.\n\nOptional.", + "type": "string" + } + }, + "flatPath": "v1beta1/projects", + "id": "cloudresourcemanager.projects.list", + "path": "v1beta1/projects" + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the IAM access control policy for the specified Project. Replaces\nany existing policy.\n\nThe following constraints apply when using `setIamPolicy()`:\n\n+ Project does not support `allUsers` and `allAuthenticatedUsers` as\n`members` in a `Binding` of a `Policy`.\n\n+ The owner role can be granted only to `user` and `serviceAccount`.\n\n+ Service accounts can be made owners of a project directly\nwithout any restrictions. However, to be added as an owner, a user must be\ninvited via Cloud Platform console and must accept the invitation.\n\n+ A user cannot be granted the owner role using `setIamPolicy()`. The user\nmust be granted the owner role using the Cloud Platform Console and must\nexplicitly accept the invitation.\n\n+ Invitations to grant the owner role cannot be sent using\n`setIamPolicy()`; they must be sent only using the Cloud Platform Console.\n\n+ Membership changes that leave the project without any owners that have\naccepted the Terms of Service (ToS) will be rejected.\n\n+ If the project is not part of an organization, there must be at least\none owner who has accepted the Terms of Service (ToS) agreement in the\npolicy. Calling `setIamPolicy()` to remove the last ToS-accepted owner\nfrom the policy will fail. This restriction also applies to legacy\nprojects that no longer have owners who have accepted the ToS. Edits to\nIAM policies will be rejected until the lack of a ToS-accepting owner is\nrectified.\n\n+ Calling this method requires enabling the App Engine Admin API.\n\nNote: Removing service accounts from policies or changing their roles\ncan render services completely inoperable. It is important to understand\nhow the service account is being used before removing or updating its\nroles.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, "location": "path" } }, - "flatPath": "v1beta1/projects/{resource}:testIamPermissions" + "flatPath": "v1beta1/projects/{resource}:setIamPolicy", + "id": "cloudresourcemanager.projects.setIamPolicy", + "path": "v1beta1/projects/{resource}:setIamPolicy" + }, + "create": { + "flatPath": "v1beta1/projects", + "path": "v1beta1/projects", + "id": "cloudresourcemanager.projects.create", + "request": { + "$ref": "Project" + }, + "description": "Creates a Project resource.\n\nInitially, the Project resource is owned by its creator exclusively.\nThe creator can later grant permission to others to read or update the\nProject.\n\nSeveral APIs are activated automatically for the Project, including\nGoogle Cloud Storage.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "useLegacyStack": { + "description": "A safety hatch to opt out of the new reliable project creation process.", + "type": "boolean", + "location": "query" + } + } } } } }, "parameters": { + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, "alt": { + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -942,19 +972,18 @@ "json", "media", "proto" - ], - "type": "string" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" + ] }, "key": { "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.", "type": "string", "location": "query" }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, "quotaUser": { "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.", "type": "string", @@ -962,14 +991,14 @@ }, "pp": { "description": "Pretty-print response.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "bearer_token": { + "description": "OAuth bearer token.", "type": "string", - "location": "query", - "description": "OAuth bearer token." + "location": "query" }, "oauth_token": { "description": "OAuth 2.0 token for the current user.", @@ -977,43 +1006,15 @@ "location": "query" }, "upload_protocol": { - "type": "string", "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "type": "string", - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." - }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" } } } diff --git a/etc/api/cloudresourcemanager/v1beta1/crates/1.0.6-api+20170920 b/etc/api/cloudresourcemanager/v1beta1/crates/1.0.6-api+20170920 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudresourcemanager/v1beta1/crates/1.0.6-cli+20170920 b/etc/api/cloudresourcemanager/v1beta1/crates/1.0.6-cli+20170920 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json new file mode 100644 index 0000000000..d761846a83 --- /dev/null +++ b/etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json @@ -0,0 +1,848 @@ +{ + "schemas": { + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "FolderOperationError": { + "description": "A classification of the Folder Operation error.", + "type": "object", + "properties": { + "errorMessageId": { + "type": "string", + "enumDescriptions": [ + "The error type was unrecognized or unspecified.", + "The attempted action would violate the max folder depth constraint.", + "The attempted action would violate the max child folders constraint.", + "The attempted action would violate the locally-unique folder\ndisplay_name constraint.", + "The resource being moved has been deleted.", + "The resource a folder was being added to has been deleted.", + "The attempted action would introduce cycle in resource path.", + "The attempted action would move a folder that is already being moved.", + "The folder the caller is trying to delete contains active resources.", + "The attempted action would violate the max deleted folder depth\nconstraint." + ], + "enum": [ + "ERROR_TYPE_UNSPECIFIED", + "ACTIVE_FOLDER_HEIGHT_VIOLATION", + "MAX_CHILD_FOLDERS_VIOLATION", + "FOLDER_NAME_UNIQUENESS_VIOLATION", + "RESOURCE_DELETED_VIOLATION", + "PARENT_DELETED_VIOLATION", + "CYCLE_INTRODUCED_VIOLATION", + "FOLDER_BEING_MOVED_VIOLATION", + "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION", + "DELETED_FOLDER_HEIGHT_VIOLATION" + ], + "description": "The type of operation error experienced." + } + }, + "id": "FolderOperationError" + }, + "FolderOperation": { + "id": "FolderOperation", + "description": "Metadata describing a long running folder operation", + "type": "object", + "properties": { + "sourceParent": { + "description": "The resource name of the folder's parent.\nOnly applicable when the operation_type is MOVE.", + "type": "string" + }, + "displayName": { + "description": "The display name of the folder.", + "type": "string" + }, + "destinationParent": { + "type": "string", + "description": "The resource name of the folder or organization we are either creating\nthe folder under or moving the folder to." + }, + "operationType": { + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "CREATE", + "MOVE" + ], + "description": "The type of this operation.", + "type": "string", + "enumDescriptions": [ + "Operation type not specified.", + "A create folder operation.", + "A move folder operation." + ] + } + } + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + }, + "type": "array" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + } + }, + "id": "Policy" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "response": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`." + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" + } + }, + "id": "Operation" + }, + "AuditConfig": { + "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", + "type": "object", + "properties": { + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.\nNext ID: 4", + "items": { + "$ref": "AuditLogConfig" + }, + "type": "array" + }, + "service": { + "type": "string", + "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services." + } + }, + "id": "AuditConfig" + }, + "ListFoldersResponse": { + "properties": { + "nextPageToken": { + "description": "A pagination token returned from a previous call to `ListFolders`\nthat indicates from where listing should continue.\nThis field is optional.", + "type": "string" + }, + "folders": { + "items": { + "$ref": "Folder" + }, + "type": "array", + "description": "A possibly paginated list of Folders that are direct descendants of\nthe specified parent resource." + } + }, + "id": "ListFoldersResponse", + "description": "The ListFolders response message.", + "type": "object" + }, + "MoveFolderRequest": { + "type": "object", + "properties": { + "destinationParent": { + "type": "string", + "description": "The resource name of the Folder or Organization to reparent\nthe folder under.\nMust be of the form `folders/{folder_id}` or `organizations/{org_id}`." + } + }, + "id": "MoveFolderRequest", + "description": "The MoveFolder request message." + }, + "SearchFoldersResponse": { + "properties": { + "folders": { + "items": { + "$ref": "Folder" + }, + "type": "array", + "description": "A possibly paginated folder search results.\nthe specified parent resource." + }, + "nextPageToken": { + "description": "A pagination token returned from a previous call to `SearchFolders`\nthat indicates from where searching should continue.\nThis field is optional.", + "type": "string" + } + }, + "id": "SearchFoldersResponse", + "description": "The response message for searching folders.", + "type": "object" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." + }, + "updateMask": { + "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", + "type": "string" + } + }, + "id": "SetIamPolicyRequest" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "Status" + }, + "Binding": { + "id": "Binding", + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + } + }, + "SearchFoldersRequest": { + "type": "object", + "properties": { + "query": { + "description": "Search criteria used to select the Folders to return.\nIf no search criteria is specified then all accessible folders will be\nreturned.\n\nQuery expressions can be used to restrict results based upon displayName,\nlifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nSome example queries are:\n|Query|Description|\n|------|-----------|\n|displayName=Test*|Folders whose display name starts with \"Test\".|\n|lifecycleState=ACTIVE|Folders whose lifecycleState is ACTIVE.|\n|parent=folders/123|Folders whose parent is \"folders/123\".|\n|parent=folders/123 AND lifecycleState=ACTIVE|Active folders whose\nparent is \"folders/123\".|", + "type": "string" + }, + "pageToken": { + "description": "A pagination token returned from a previous call to `SearchFolders`\nthat indicates from where search should continue.\nThis field is optional.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of folders to return in the response.\nThis field is optional.", + "type": "integer" + } + }, + "id": "SearchFoldersRequest", + "description": "The request message for searching folders." + }, + "ProjectCreationStatus": { + "description": "A status object which is used as the `metadata` field for the Operation\nreturned by CreateProject. It provides insight for when significant phases of\nProject creation have completed.", + "type": "object", + "properties": { + "ready": { + "description": "True if the project creation process is complete.", + "type": "boolean" + }, + "gettable": { + "description": "True if the project can be retrieved using GetProject. No other operations\non the project are guaranteed to work until the project creation is\ncomplete.", + "type": "boolean" + }, + "createTime": { + "type": "string", + "format": "google-datetime", + "description": "Creation time of the project creation workflow." + } + }, + "id": "ProjectCreationStatus" + }, + "Folder": { + "id": "Folder", + "description": "A Folder in an Organization's resource hierarchy, used to\norganize that Organization's resources.", + "type": "object", + "properties": { + "displayName": { + "description": "The folder’s display name.\nA folder’s display name must be unique amongst its siblings, e.g.\nno two folders with the same parent can share the same display name.\nThe display name must start and end with a letter or digit, may contain\nletters, digits, spaces, hyphens and underscores and can be no longer\nthan 30 characters. This is captured by the regular expression:\n[\\p{L}\\p{N}]({\\p{L}\\p{N}_- ]{0,28}[\\p{L}\\p{N}])?.", + "type": "string" + }, + "parent": { + "description": "The Folder’s parent's resource name.\nUpdates to the folder's parent must be performed via [MoveFolders].", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "Output only. Timestamp when the Folder was created. Assigned by the server.", + "type": "string" + }, + "lifecycleState": { + "type": "string", + "enumDescriptions": [ + "Unspecified state.", + "The normal and active state.", + "The folder has been marked for deletion by the user." + ], + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED" + ], + "description": "Output only. The lifecycle state of the folder.\nUpdates to the lifecycle_state must be performed via\n[DeleteFolder] and [UndeleteFolder]." + }, + "name": { + "description": "Output only. The resource name of the Folder.\nIts format is `folders/{folder_id}`, for example: \"folders/1234\".", + "type": "string" + } + } + }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse" + }, + "UndeleteFolderRequest": { + "description": "The UndeleteFolder request message.", + "type": "object", + "properties": {}, + "id": "UndeleteFolderRequest" + }, + "AuditLogConfig": { + "properties": { + "exemptedMembers": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members." + }, + "logType": { + "description": "The log type that this config enables.", + "type": "string", + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ], + "enum": [ + "LOG_TYPE_UNSPECIFIED", + "ADMIN_READ", + "DATA_WRITE", + "DATA_READ" + ] + } + }, + "id": "AuditLogConfig", + "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", + "type": "object" + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "canonicalName": "Cloud Resource Manager", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudresourcemanager.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudresourcemanager", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Resource Manager API", + "ownerName": "Google", + "resources": { + "folders": { + "methods": { + "move": { + "description": "Moves a Folder under a new resource parent.\nReturns an Operation which can be used to track the progress of the\nfolder move workflow.\nUpon success the Operation.response field will be populated with the\nmoved Folder.\nUpon failure, a FolderOperationError categorizing the failure cause will\nbe returned - if the failure occurs synchronously then the\nFolderOperationError will be returned via the Status.details field\nand if it occurs asynchronously then the FolderOperation will be returned\nvia the the Operation.error field.\nIn addition, the Operation.metadata field will be populated with a\nFolderOperation message as an aid to stateless clients.\nFolder moves will be rejected if they violate either the naming, height\nor fanout constraints described in the [CreateFolder] documentation.\nThe caller must have `resourcemanager.folders.move` permission on the\nfolder's current and proposed new parent.", + "request": { + "$ref": "MoveFolderRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the Folder to move.\nMust be of the form folders/{folder_id}", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/folders/{foldersId}:move", + "id": "cloudresourcemanager.folders.move", + "path": "v2beta1/{+name}:move" + }, + "testIamPermissions": { + "flatPath": "v2beta1/folders/{foldersId}:testIamPermissions", + "id": "cloudresourcemanager.folders.testIamPermissions", + "path": "v2beta1/{+resource}:testIamPermissions", + "description": "Returns permissions that a caller has on the specified Folder.\nThe `resource` field should be the Folder's resource name,\ne.g. \"folders/1234\".\n\nThere are no permissions required for making this API call.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Folder" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "the resource name of the Folder to be deleted.\nMust be of the form `folders/{folder_id}`.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/folders/{foldersId}", + "path": "v2beta1/{+name}", + "id": "cloudresourcemanager.folders.delete", + "description": "Requests deletion of a Folder. The Folder is moved into the\n[DELETE_REQUESTED] state immediately, and is deleted approximately 30 days\nlater. This method may only be called on an empty Folder in the [ACTIVE]\nstate, where a Folder is empty if it doesn't contain any Folders or\nProjects in the [ACTIVE] state.\nThe caller must have `resourcemanager.folders.delete` permission on the\nidentified folder." + }, + "list": { + "response": { + "$ref": "ListFoldersResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "The maximum number of Folders to return in the response.\nThis field is optional.", + "type": "integer" + }, + "parent": { + "location": "query", + "description": "The resource name of the Organization or Folder whose Folders are\nbeing listed.\nMust be of the form `folders/{folder_id}` or `organizations/{org_id}`.\nAccess to this method is controlled by checking the\n`resourcemanager.folders.list` permission on the `parent`.", + "type": "string" + }, + "showDeleted": { + "description": "Controls whether Folders in the [DELETE_REQUESTED} state should\nbe returned.", + "type": "boolean", + "location": "query" + }, + "pageToken": { + "description": "A pagination token returned from a previous call to `ListFolders`\nthat indicates where this listing should continue from.\nThis field is optional.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2beta1/folders", + "id": "cloudresourcemanager.folders.list", + "path": "v2beta1/folders", + "description": "Lists the Folders that are direct descendants of supplied parent resource.\nList provides a strongly consistent view of the Folders underneath\nthe specified parent resource.\nList returns Folders sorted based upon the (ascending) lexical ordering\nof their display_name.\nThe caller must have `resourcemanager.folders.list` permission on the\nidentified parent." + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on a Folder, replacing any existing policy.\nThe `resource` field should be the Folder's resource name, e.g.\n\"folders/1234\".\nThe caller must have `resourcemanager.folders.setIamPolicy` permission\non the identified folder.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$" + } + }, + "flatPath": "v2beta1/folders/{foldersId}:setIamPolicy", + "id": "cloudresourcemanager.folders.setIamPolicy", + "path": "v2beta1/{+resource}:setIamPolicy" + }, + "create": { + "description": "Creates a Folder in the resource hierarchy.\nReturns an Operation which can be used to track the progress of the\nfolder creation workflow.\nUpon success the Operation.response field will be populated with the\ncreated Folder.\n\nIn order to succeed, the addition of this new Folder must not violate\nthe Folder naming, height or fanout constraints.\n+ The Folder's display_name must be distinct from all other Folder's that\nshare its parent.\n+ The addition of the Folder must not cause the active Folder hierarchy\nto exceed a height of 4. Note, the full active + deleted Folder hierarchy\nis allowed to reach a height of 8; this provides additional headroom when\nmoving folders that contain deleted folders.\n+ The addition of the Folder must not cause the total number of Folders\nunder its parent to exceed 100.\n\nIf the operation fails due to a folder constraint violation,\na PreconditionFailure explaining the violation will be returned.\nIf the failure occurs synchronously then the PreconditionFailure\nwill be returned via the Status.details field and if it occurs\nasynchronously then the PreconditionFailure will be returned\nvia the the Operation.error field.\n\nThe caller must have `resourcemanager.folders.create` permission on the\nidentified parent.", + "request": { + "$ref": "Folder" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Operation" + }, + "parameters": { + "parent": { + "location": "query", + "description": "The resource name of the new Folder's parent.\nMust be of the form `folders/{folder_id}` or `organizations/{org_id}`.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/folders", + "path": "v2beta1/folders", + "id": "cloudresourcemanager.folders.create" + }, + "getIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v2beta1/folders/{foldersId}:getIamPolicy", + "id": "cloudresourcemanager.folders.getIamPolicy", + "path": "v2beta1/{+resource}:getIamPolicy", + "description": "Gets the access control policy for a Folder. The returned policy may be\nempty if no such policy or resource exists. The `resource` field should\nbe the Folder's resource name, e.g. \"folders/1234\".\nThe caller must have `resourcemanager.folders.getIamPolicy` permission\non the identified folder.", + "request": { + "$ref": "GetIamPolicyRequest" + } + }, + "search": { + "response": { + "$ref": "SearchFoldersResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": {}, + "flatPath": "v2beta1/folders:search", + "id": "cloudresourcemanager.folders.search", + "path": "v2beta1/folders:search", + "request": { + "$ref": "SearchFoldersRequest" + }, + "description": "Search for folders that match specific filter criteria.\nSearch provides an eventually consistent view of the folders a user has\naccess to which meet the specified filter criteria.\n\nThis will only return folders on which the caller has the\npermission `resourcemanager.folders.get`." + }, + "undelete": { + "response": { + "$ref": "Folder" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "The resource name of the Folder to undelete.\nMust be of the form `folders/{folder_id}`." + } + }, + "flatPath": "v2beta1/folders/{foldersId}:undelete", + "id": "cloudresourcemanager.folders.undelete", + "path": "v2beta1/{+name}:undelete", + "request": { + "$ref": "UndeleteFolderRequest" + }, + "description": "Cancels the deletion request for a Folder. This method may only be\ncalled on a Folder in the [DELETE_REQUESTED] state.\nIn order to succeed, the Folder's parent must be in the [ACTIVE] state.\nIn addition, reintroducing the folder into the tree must not violate\nfolder naming, height and fanout constraints described in the\n[CreateFolder] documentation.\nThe caller must have `resourcemanager.folders.undelete` permission on the\nidentified folder." + }, + "get": { + "description": "Retrieves a Folder identified by the supplied resource name.\nValid Folder resource names have the format `folders/{folder_id}`\n(for example, `folders/1234`).\nThe caller must have `resourcemanager.folders.get` permission on the\nidentified folder.", + "response": { + "$ref": "Folder" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "The resource name of the Folder to retrieve.\nMust be of the form `folders/{folder_id}`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v2beta1/folders/{foldersId}", + "id": "cloudresourcemanager.folders.get", + "path": "v2beta1/{+name}" + }, + "patch": { + "request": { + "$ref": "Folder" + }, + "description": "Updates a Folder, changing its display_name.\nChanges to the folder display_name will be rejected if they violate either\nthe display_name formatting rules or naming constraints described in\nthe [CreateFolder] documentation.\n+ The Folder's display name must start and end with a letter or digit,\nmay contain letters, digits, spaces, hyphens and underscores and can be\nno longer than 30 characters. This is captured by the regular expression:\n[\\p{L}\\p{N}]({\\p{L}\\p{N}_- ]{0,28}[\\p{L}\\p{N}])?.\nThe caller must have `resourcemanager.folders.update` permission on the\nidentified folder.\n\nIf the update fails due to the unique name constraint then a\nPreconditionFailure explaining this violation will be returned\nin the Status.details field.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Output only. The resource name of the Folder.\nIts format is `folders/{folder_id}`, for example: \"folders/1234\".", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Fields to be updated.\nOnly the `display_name` can be updated.", + "type": "string" + } + }, + "flatPath": "v2beta1/folders/{foldersId}", + "path": "v2beta1/{+name}", + "id": "cloudresourcemanager.folders.patch" + } + } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "default": "true", + "type": "boolean", + "location": "query", + "description": "Returns response with indentations and line breaks." + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + } + }, + "version": "v2beta1", + "baseUrl": "https://cloudresourcemanager.googleapis.com/", + "servicePath": "", + "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "cloudresourcemanager:v2beta1", + "documentationLink": "https://cloud.google.com/resource-manager", + "revision": "20170920", + "discoveryVersion": "v1" +} diff --git a/etc/api/cloudtasks/v2beta2/cloudtasks-api.json b/etc/api/cloudtasks/v2beta2/cloudtasks-api.json new file mode 100644 index 0000000000..930fc82670 --- /dev/null +++ b/etc/api/cloudtasks/v2beta2/cloudtasks-api.json @@ -0,0 +1,1608 @@ +{ + "version": "v2beta2", + "baseUrl": "https://cloudtasks.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Manages the execution of large numbers of distributed requests. Cloud Tasks is in Alpha.", + "servicePath": "", + "basePath": "", + "id": "cloudtasks:v2beta2", + "revision": "20170926", + "documentationLink": "https://cloud.google.com/cloud-tasks/", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Queue": { + "description": "A queue is a container of related tasks. Queues are configured to manage\nhow those tasks are dispatched. Configurable properties include rate limits,\nretry options, target types, and others.", + "type": "object", + "properties": { + "purgeTime": { + "format": "google-datetime", + "description": "Output only.\n\nThe last time this queue was purged. All tasks that were\ncreated before this time were purged.\n\nA queue can be purged using CloudTasks.PurgeQueue, the\n[App Engine Task Queue SDK, or the Cloud Console](/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).\n\nPurge time will be truncated to the nearest microsecond. Purge\ntime will be zero if the queue has never been purged.", + "type": "string" + }, + "queueState": { + "description": "Output only.\n\nThe state of the queue.\n\n`queue_state` can only be changed by called\nCloudTasks.PauseQueue, CloudTasks.ResumeQueue, or uploading\n[queue.yaml](/appengine/docs/python/config/queueref).\nCloudTasks.UpdateQueue cannot be used to change `queue_state`.", + "type": "string", + "enumDescriptions": [ + "Unspecified state.", + "The queue is running. Tasks can be dispatched.", + "Tasks are paused by the user. If the queue is paused then Cloud\nTasks will stop delivering tasks from it, but more tasks can\nstill be added to it by the user. When a pull queue is paused,\nall CloudTasks.PullTasks calls will return a\n`FAILED_PRECONDITION` error.", + "The queue is disabled.\n\nA queue becomes `DISABLED` when\n[queue.yaml](/appengine/docs/python/config/queueref) or\n[queue.xml](appengine/docs/standard/java/config/queueref) is uploaded\nwhich does not contain the queue. You cannot directly disable a queue.\n\nWhen a queue is disabled, tasks can still be added to a queue\nbut the tasks are not dispatched and CloudTasks.PullTasks calls\nreturn a `FAILED_PRECONDITION` error.\n\nTo permanently delete this queue and all of its tasks, call\nCloudTasks.DeleteQueue." + ], + "enum": [ + "QUEUE_STATE_UNSPECIFIED", + "RUNNING", + "PAUSED", + "DISABLED" + ] + }, + "retryConfig": { + "$ref": "RetryConfig", + "description": "Settings that determine the retry behavior.\n\n* For tasks created using Cloud Tasks: the queue-level retry settings\n apply to all tasks in the queue that were created using Cloud Tasks.\n Retry settings cannot be set on individual tasks.\n* For tasks created using the App Engine SDK: the queue-level retry\n settings apply to all tasks in the queue which do not have retry settings\n explicitly set on the task and were created by the App Engine SDK. See\n [App Engine documentation](/appengine/docs/standard/python/taskqueue/push/retrying-tasks)." + }, + "name": { + "description": "The queue name.\n\nThe queue name must have the following format:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`\n\n* `PROJECT_ID` can contain uppercase and lowercase letters,\n numbers, hyphens, colons, and periods; that is, it must match\n the regular expression: `[a-zA-Z\\\\d-:\\\\.]+`.\n* `QUEUE_ID` can contain uppercase and lowercase letters,\n numbers, and hyphens; that is, it must match the regular\n expression: `[a-zA-Z\\\\d-]+`. The maximum length is 100\n characters.\n\nCaller-specified and required in CreateQueueRequest, after which\nit becomes output only.", + "type": "string" + }, + "throttleConfig": { + "$ref": "ThrottleConfig", + "description": "Config for throttling task dispatches." + }, + "appEngineQueueConfig": { + "$ref": "AppEngineQueueConfig", + "description": "Deprecated. Use Queue.app_engine_http_target." + }, + "pullTarget": { + "description": "Pull target.\n\nA pull queue is a queue that has a PullTarget.", + "$ref": "PullTarget" + }, + "pullQueueConfig": { + "description": "Deprecated. Use Queue.pull_target.", + "$ref": "PullQueueConfig" + }, + "appEngineHttpTarget": { + "$ref": "AppEngineHttpTarget", + "description": "App Engine HTTP target.\n\nAn App Engine queue is a queue that has an AppEngineHttpTarget." + } + }, + "id": "Queue" + }, + "PullQueueConfig": { + "description": "Deprecated. Use PullTarget.", + "type": "object", + "properties": {}, + "id": "PullQueueConfig" + }, + "PullTasksRequest": { + "description": "Request message for pulling tasks using CloudTasks.PullTasks.", + "type": "object", + "properties": { + "filter": { + "description": "`filter` can be used to specify a subset of tasks to lease.\n\nWhen `filter` is set to `tag=\u003cmy-tag\u003e` then the\nPullTasksResponse will contain only tasks whose\nPullMessage.tag is equal to `\u003cmy-tag\u003e`. `\u003cmy-tag\u003e` can be\na bytes encoded as a string and must be less than 500 bytes.\nIf `\u003cmy-tag\u003e` includes whitespace or special characters (characters which\naren't letters, numbers, or underscores), then it must be double-quoted.\nDouble quotes and backslashes in quoted strings must be escaped by\npreceding it with a backslash (`\\`).\n\nWhen `filter` is set to `tag=oldest_tag()`, only tasks which have the same\ntag as the task with the oldest schedule_time will be returned.\n\nGrammar Syntax:\n\n* `filter = \"tag=\" comparable`\n\n* `comparable = tag | function`\n\n* `tag = string | bytes`\n\n* `function = \"oldest_tag()\"`\n\n\n\nThe `oldest_tag()` function returns tasks which have the same tag as the\noldest task (ordered by schedule time).", + "type": "string" + }, + "leaseDuration": { + "format": "google-duration", + "description": "The duration of the lease.\n\nEach task returned in the PullTasksResponse will have its\nTask.schedule_time set to the current time plus the\n`lease_duration`. A task that has been returned in a\nPullTasksResponse is leased -- that task will not be\nreturned in a different PullTasksResponse before the\nTask.schedule_time.\n\nAfter the lease holder has successfully finished the work\nassociated with the task, the lease holder must call\nCloudTasks.AcknowledgeTask. If the task is not acknowledged\nvia CloudTasks.AcknowledgeTask before the\nTask.schedule_time then it will be returned in a later\nPullTasksResponse so that another lease holder can process\nit.\n\nThe maximum lease duration is 1 week.\n`lease_duration` will be truncated to the nearest second.", + "type": "string" + }, + "maxTasks": { + "format": "int32", + "description": "The maximum number of tasks to lease. The maximum that can be\nrequested is 1000.", + "type": "integer" + }, + "responseView": { + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string", + "enumDescriptions": [ + "Unspecified. Defaults to BASIC.", + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include the payload.", + "All information is returned.\n\nPayloads might be desirable to return only when needed, because\nthey can be large and because of the sensitivity of the data\nthat you choose to store in it.\n\nAuthorization for Task.View.FULL requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the Queue.name resource." + ], + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + } + }, + "id": "PullTasksRequest" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them.", + "$ref": "Policy" + } + }, + "id": "SetIamPolicyRequest" + }, + "AppEngineRouting": { + "description": "App Engine Routing.\n\nFor more information about services, versions, and instances see\n[An Overview of App Engine](/appengine/docs/python/an-overview-of-app-engine),\n[Microservices Architecture on Google App Engine](/appengine/docs/python/microservices-on-app-engine),\n[App Engine Standard request routing](/appengine/docs/standard/python/how-requests-are-routed),\nand [App Engine Flex request routing](/appengine/docs/flexible/python/how-requests-are-routed).", + "type": "object", + "properties": { + "host": { + "description": "Output only.\n\nThe host that the task is sent to. For more information, see\n[How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed).\n\nThe host is constructed as:\n\n\n* `host = [application_domain_name]`\u003c/br\u003e\n `| [service] + '.' + [application_domain_name]`\u003c/br\u003e\n `| [version] + '.' + [application_domain_name]`\u003c/br\u003e\n `| [version_dot_service]+ '.' + [application_domain_name]`\u003c/br\u003e\n `| [instance] + '.' + [application_domain_name]`\u003c/br\u003e\n `| [instance_dot_service] + '.' + [application_domain_name]`\u003c/br\u003e\n `| [instance_dot_version] + '.' + [application_domain_name]`\u003c/br\u003e\n `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`\n\n* `application_domain_name` = The domain name of the app, for\n example \u003capp-id\u003e.appspot.com, which is associated with the\n queue's project ID. Some tasks which were created using the App Engine\n SDK use a custom domain name.\n\n* `service =` AppEngineRouting.service\n\n* `version =` AppEngineRouting.version\n\n* `version_dot_service =`\n AppEngineRouting.version `+ '.' +` AppEngineRouting.service\n\n* `instance =` AppEngineRouting.instance\n\n* `instance_dot_service =`\n AppEngineRouting.instance `+ '.' +` AppEngineRouting.service\n\n* `instance_dot_version =`\n AppEngineRouting.instance `+ '.' +` AppEngineRouting.version\n\n* `instance_dot_version_dot_service =`\n AppEngineRouting.instance `+ '.' +`\n AppEngineRouting.version `+ '.' +` AppEngineRouting.service\n\nIf AppEngineRouting.service is empty, then the task will be sent\nto the service which is the default service when the task is attempted.\n\nIf AppEngineRouting.version is empty, then the task will be sent\nto the version which is the default version when the task is attempted.\n\nIf AppEngineRouting.instance is empty, then the task will be sent\nto an instance which is available when the task is attempted.\n\nWhen AppEngineRouting.service is \"default\",\nAppEngineRouting.version is \"default\", and\nAppEngineRouting.instance is empty, AppEngineRouting.host is\nshortened to just the `application_domain_name`.\n\nIf AppEngineRouting.service, AppEngineRouting.version, or\nAppEngineRouting.instance is invalid, then the task will be sent\nto the default version of the default service when the task is attempted.", + "type": "string" + }, + "service": { + "description": "App service.\n\nBy default, the task is sent to the service which is the default\nservice when the task is attempted (\"default\").\n\nFor some queues or tasks which were created using the App Engine Task Queue\nAPI, AppEngineRouting.host is not parsable into\nAppEngineRouting.service, AppEngineRouting.version, and\nAppEngineRouting.instance. For example, some tasks which were created\nusing the App Engine SDK use a custom domain name; custom domains are not\nparsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then\nAppEngineRouting.service, AppEngineRouting.version, and\nAppEngineRouting.instance are the empty string.", + "type": "string" + }, + "instance": { + "description": "App instance.\n\nBy default, the task is sent to an instance which is available when\nthe task is attempted.\n\nRequests can only be sent to a specific instance if\n[manual scaling is used in App Engine Standard](/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).\nApp Engine Flex does not support instances. For more information, see\n[App Engine Standard request routing](/appengine/docs/standard/python/how-requests-are-routed)\nand [App Engine Flex request routing](/appengine/docs/flexible/python/how-requests-are-routed).", + "type": "string" + }, + "version": { + "description": "App version.\n\nBy default, the task is sent to the version which is the default\nversion when the task is attempted (\"default\").\n\nFor some queues or tasks which were created using the App Engine Task Queue\nAPI, AppEngineRouting.host is not parsable into\nAppEngineRouting.service, AppEngineRouting.version, and\nAppEngineRouting.instance. For example, some tasks which were created\nusing the App Engine SDK use a custom domain name; custom domains are not\nparsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then\nAppEngineRouting.service, AppEngineRouting.version, and\nAppEngineRouting.instance are the empty string.", + "type": "string" + } + }, + "id": "AppEngineRouting" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "AppEngineHttpTarget": { + "description": "App Engine HTTP target.\n\nThe task will be delivered to the App Engine application hostname\nspecified by its AppEngineHttpTarget and AppEngineHttpRequest.\nThe documentation for AppEngineHttpRequest explains how the\ntask's host URL is constructed.\n\nUsing AppEngineHttpTarget requires\n[`appengine.applications.get`](/appengine/docs/admin-api/access-control)\nGoogle IAM permission for the project\nand the following scope:\n\n`https://www.googleapis.com/auth/cloud-platform`", + "type": "object", + "properties": { + "appEngineRoutingOverride": { + "description": "Overrides for the\ntask-level app_engine_routing.\n\nIf set, AppEngineHttpTarget.app_engine_routing_override is used for\nall tasks in the queue, no matter what the setting is for the\ntask-level app_engine_routing.", + "$ref": "AppEngineRouting" + } + }, + "id": "AppEngineHttpTarget" + }, + "Location": { + "description": "A resource that represents Google Cloud Platform location.", + "type": "object", + "properties": { + "labels": { + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", + "type": "string" + }, + "locationId": { + "description": "The canonical id for this location. For example: `\"us-east1\"`.", + "type": "string" + }, + "metadata": { + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, + "id": "Location" + }, + "AcknowledgeTaskRequest": { + "description": "Request message for acknowledging a task using\nCloudTasks.AcknowledgeTask.", + "type": "object", + "properties": { + "scheduleTime": { + "format": "google-datetime", + "description": "Required.\n\nThe task's current schedule time, available in the Task.schedule_time\nreturned in PullTasksResponse.tasks or\nCloudTasks.RenewLease. This restriction is to check that\nthe caller is acknowledging the correct task.", + "type": "string" + } + }, + "id": "AcknowledgeTaskRequest" + }, + "ListQueuesResponse": { + "description": "Response message for CloudTasks.ListQueues.", + "type": "object", + "properties": { + "queues": { + "description": "The list of queues.", + "items": { + "$ref": "Queue" + }, + "type": "array" + }, + "nextPageToken": { + "format": "byte", + "description": "A token to retrieve next page of results.\n\nTo return the next page of results, call\nCloudTasks.ListQueues with this value as the\nListQueuesRequest.page_token.\n\nIf the next_page_token is empty, there are no more results.\n\nThe page token is valid for only 2 hours.", + "type": "string" + } + }, + "id": "ListQueuesResponse" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "items": { + "$ref": "Location" + }, + "type": "array" + } + }, + "id": "ListLocationsResponse" + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + } + }, + "id": "Policy" + }, + "AppEngineTaskTarget": { + "description": "Deprecated. Use AppEngineHttpRequest.", + "type": "object", + "properties": { + "relativeUrl": { + "description": "Deprecated. Use AppEngineHttpRequest.relative_url.", + "type": "string" + }, + "headers": { + "description": "Deprecated. Use AppEngineHttpRequest.headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "appEngineRouting": { + "description": "Deprecated. Use AppEngineHttpRequest.app_engine_routing.", + "$ref": "AppEngineRouting" + }, + "httpMethod": { + "description": "Deprecated. Use AppEngineHttpRequest.http_method.", + "type": "string", + "enumDescriptions": [ + "HTTP method unspecified", + "HTTP Post", + "HTTP Get", + "HTTP Head", + "HTTP Put", + "HTTP Delete" + ], + "enum": [ + "HTTP_METHOD_UNSPECIFIED", + "POST", + "GET", + "HEAD", + "PUT", + "DELETE" + ] + }, + "payload": { + "format": "byte", + "description": "Deprecated. Use AppEngineHttpRequest.payload.", + "type": "string" + } + }, + "id": "AppEngineTaskTarget" + }, + "CancelLeaseRequest": { + "description": "Request message for canceling a lease using\nCloudTasks.CancelLease.", + "type": "object", + "properties": { + "scheduleTime": { + "format": "google-datetime", + "description": "Required.\n\nThe task's current schedule time, available in the Task.schedule_time\nreturned in PullTasksResponse.tasks or\nCloudTasks.RenewLease. This restriction is to check that\nthe caller is canceling the correct task.", + "type": "string" + }, + "responseView": { + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string", + "enumDescriptions": [ + "Unspecified. Defaults to BASIC.", + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include the payload.", + "All information is returned.\n\nPayloads might be desirable to return only when needed, because\nthey can be large and because of the sensitivity of the data\nthat you choose to store in it.\n\nAuthorization for Task.View.FULL requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the Queue.name resource." + ], + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + } + }, + "id": "CancelLeaseRequest" + }, + "AttemptStatus": { + "description": "The status of a task attempt.", + "type": "object", + "properties": { + "responseStatus": { + "description": "Output only.\n\nThe response from the target for this attempt.\n\nIf the task has not been attempted or the task is currently running\nthen the response status is google.rpc.Code.UNKNOWN.", + "$ref": "Status" + }, + "responseTime": { + "format": "google-datetime", + "description": "Output only.\n\nThe time that this attempt response was received.\n\n`response_time` will be truncated to the nearest microsecond.", + "type": "string" + }, + "scheduleTime": { + "format": "google-datetime", + "description": "Output only.\n\nThe time that this attempt was scheduled.\n\n`schedule_time` will be truncated to the nearest microsecond.", + "type": "string" + }, + "dispatchTime": { + "format": "google-datetime", + "description": "Output only.\n\nThe time that this attempt was dispatched.\n\n`dispatch_time` will be truncated to the nearest microsecond.", + "type": "string" + } + }, + "id": "AttemptStatus" + }, + "PurgeQueueRequest": { + "description": "Request message for CloudTasks.PurgeQueue.", + "type": "object", + "properties": {}, + "id": "PurgeQueueRequest" + }, + "PauseQueueRequest": { + "description": "Request message for CloudTasks.PauseQueue.", + "type": "object", + "properties": {}, + "id": "PauseQueueRequest" + }, + "RunTaskRequest": { + "description": "Request message for forcing a task to run now using\nCloudTasks.RunTask.", + "type": "object", + "properties": { + "responseView": { + "enumDescriptions": [ + "Unspecified. Defaults to BASIC.", + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include the payload.", + "All information is returned.\n\nPayloads might be desirable to return only when needed, because\nthey can be large and because of the sensitivity of the data\nthat you choose to store in it.\n\nAuthorization for Task.View.FULL requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the Queue.name resource." + ], + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string" + } + }, + "id": "RunTaskRequest" + }, + "PullTasksResponse": { + "description": "Response message for pulling tasks using CloudTasks.PullTasks.", + "type": "object", + "properties": { + "tasks": { + "description": "The leased tasks.", + "items": { + "$ref": "Task" + }, + "type": "array" + } + }, + "id": "PullTasksResponse" + }, + "Task": { + "description": "A unit of scheduled work.", + "type": "object", + "properties": { + "pullTaskTarget": { + "description": "Deprecated. Use Task.pull_message.", + "$ref": "PullTaskTarget" + }, + "appEngineHttpRequest": { + "$ref": "AppEngineHttpRequest", + "description": "App Engine HTTP request that is sent to the task's target. Can be set\nonly if Queue.app_engine_http_target is set.\n\nAn App Engine task is a task that has AppEngineHttpRequest set." + }, + "view": { + "enumDescriptions": [ + "Unspecified. Defaults to BASIC.", + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include the payload.", + "All information is returned.\n\nPayloads might be desirable to return only when needed, because\nthey can be large and because of the sensitivity of the data\nthat you choose to store in it.\n\nAuthorization for Task.View.FULL requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the Queue.name resource." + ], + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "description": "Output only.\n\nThe view specifies which subset of the Task has been\nreturned.", + "type": "string" + }, + "pullMessage": { + "$ref": "PullMessage", + "description": "Pull message contains data that should be used by the caller of\nCloudTasks.PullTasks to process the task. Can be set only if\nQueue.pull_target is set.\n\nA pull task is a task that has PullMessage set." + }, + "scheduleTime": { + "format": "google-datetime", + "description": "The time when the task is scheduled to be attempted.\n\nFor pull queues, this is the time when the task is available to\nbe leased; if a task is currently leased, this is the time when\nthe current lease expires, that is, the time that the task was\nleased plus the PullTasksRequest.lease_duration.\n\nFor App Engine queues, this is when the task will be attempted or retried.\n\n`schedule_time` will be truncated to the nearest microsecond.", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "Output only.\n\nThe time that the task was created.\n\n`create_time` will be truncated to the nearest second.", + "type": "string" + }, + "name": { + "description": "The task name.\n\nThe task name must have the following format:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`\n\n* `PROJECT_ID` can contain uppercase and lowercase letters,\n numbers, hyphens, colons, and periods; that is, it must match\n the regular expression: `[a-zA-Z\\\\d-:\\\\.]+`.\n* `QUEUE_ID` can contain uppercase and lowercase letters,\n numbers, and hyphens; that is, it must match the regular\n expression: `[a-zA-Z\\\\d-]+`. The maximum length is 100\n characters.\n* `TASK_ID` contain uppercase and lowercase letters, numbers,\n underscores, and hyphens; that is, it must match the regular\n expression: `[a-zA-Z\\\\d_-]+`. The maximum length is 500\n characters.\n\nOptionally caller-specified in CreateTaskRequest.", + "type": "string" + }, + "appEngineTaskTarget": { + "description": "Deprecated. Use Task.app_engine_http_request.", + "$ref": "AppEngineTaskTarget" + }, + "taskStatus": { + "description": "Output only.\n\nTask status.", + "$ref": "TaskStatus" + } + }, + "id": "Task" + }, + "PullMessage": { + "description": "The pull message contains data that can be used by the caller of\nCloudTasks.PullTasks to process the task.\n\nThis proto can only be used for tasks in a queue which has\nQueue.pull_target set.", + "type": "object", + "properties": { + "payload": { + "format": "byte", + "description": "A data payload consumed by the task worker to execute the task.", + "type": "string" + }, + "tag": { + "format": "byte", + "description": "A meta-data tag for this task.\n\nThis value is used by CloudTasks.PullTasks calls when\nPullTasksRequest.filter is `tag=\u003ctag\u003e`.\n\nThe tag must be less than 500 bytes.", + "type": "string" + } + }, + "id": "PullMessage" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" + }, + "RenewLeaseRequest": { + "description": "Request message for renewing a lease using CloudTasks.RenewLease.", + "type": "object", + "properties": { + "scheduleTime": { + "format": "google-datetime", + "description": "Required.\n\nThe task's current schedule time, available in the Task.schedule_time\nreturned in PullTasksResponse.tasks or\nCloudTasks.RenewLease. This restriction is to check that\nthe caller is renewing the correct task.", + "type": "string" + }, + "newLeaseDuration": { + "format": "google-duration", + "description": "Required.\n\nThe desired new lease duration, starting from now.\n\n\nThe maximum lease duration is 1 week.\n`new_lease_duration` will be truncated to the nearest second.", + "type": "string" + }, + "responseView": { + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string", + "enumDescriptions": [ + "Unspecified. Defaults to BASIC.", + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include the payload.", + "All information is returned.\n\nPayloads might be desirable to return only when needed, because\nthey can be large and because of the sensitivity of the data\nthat you choose to store in it.\n\nAuthorization for Task.View.FULL requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the Queue.name resource." + ], + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + } + }, + "id": "RenewLeaseRequest" + }, + "TaskStatus": { + "description": "Status of the task.", + "type": "object", + "properties": { + "firstAttemptStatus": { + "description": "Output only.\n\nThe status of the task's first attempt.\n\nOnly AttemptStatus.dispatch_time will be set.\nThe other AttemptStatus information is not retained by Cloud Tasks.\n\nThis field is not calculated for\n[pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget).", + "$ref": "AttemptStatus" + }, + "attemptResponseCount": { + "format": "int64", + "description": "Output only.\n\nThe number of attempts which have received a response.\n\nThis field is not calculated for\n[pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget).", + "type": "string" + }, + "lastAttemptStatus": { + "$ref": "AttemptStatus", + "description": "Output only.\n\nThe status of the task's last attempt.\n\nThis field is not calculated for\n[pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget)." + }, + "attemptDispatchCount": { + "format": "int64", + "description": "Output only.\n\nThe number of attempts dispatched. This count includes tasks which have\nbeen dispatched but haven't received a response.", + "type": "string" + } + }, + "id": "TaskStatus" + }, + "AppEngineHttpRequest": { + "description": "App Engine HTTP request.\n\nThe message defines the HTTP request that is sent to an App Engine app when\nthe task is dispatched.\n\nThis proto can only be used for tasks in a queue which has\nQueue.app_engine_http_target set.\n\nUsing AppEngineHttpRequest requires\n[`appengine.applications.get`](/appengine/docs/admin-api/access-control)\nGoogle IAM permission for the project\nand the following scope:\n\n`https://www.googleapis.com/auth/cloud-platform`\n\nThe task will be delivered to the App Engine app which belongs to the same\nproject as the queue. For more information, see\n[How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed)\nand how routing is affected by\n[dispatch files](/appengine/docs/python/config/dispatchref).\n\nThe AppEngineRouting used to construct the URL that the task is\ndelivered to can be set at the queue-level or task-level:\n\n* If set, AppEngineHttpTarget.app_engine_routing_override is used for\n all tasks in the queue, no matter what the setting is for the\n task-level app_engine_routing.\n\n\nThe `url` that the task will be sent to is:\n\n* `url =` AppEngineRouting.host `+` AppEngineHttpRequest.relative_url\n\nThe task will be sent to a task handler by an HTTP\nrequest using the specified AppEngineHttpRequest.http_method (for example\nPOST, HTTP GET, etc). The task attempt has succeeded if the task handler\nreturns an HTTP response code in the range [200 - 299]. Error 503 is\nconsidered an App Engine system error instead of an application error.\nRequests returning error 503 will be retried regardless of retry\nconfiguration and not counted against retry counts.\nAny other response code or a failure to receive a response before the\ndeadline is a failed attempt.", + "type": "object", + "properties": { + "relativeUrl": { + "description": "The relative URL.\n\nThe relative URL must begin with \"/\" and must be a valid HTTP relative URL.\nIt can contain a path, query string arguments, and `#` fragments.\nIf the relative URL is empty, then the root path \"/\" will be used.\nNo spaces are allowed, and the maximum length allowed is 2083 characters.", + "type": "string" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "description": "HTTP request headers.\n\nThis map contains the header field names and values.\nHeaders can be set when the\n[task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask).\nRepeated headers are not supported but a header value can contain commas.\n\nCloud Tasks sets some headers to default values:\n\n* `User-Agent`: By default, this header is\n `\"AppEngine-Google; (+http://code.google.com/appengine)\"`.\n This header can be modified, but Cloud Tasks will append\n `\"AppEngine-Google; (+http://code.google.com/appengine)\"` to the\n modified `User-Agent`.\n\nIf the task has an AppEngineHttpRequest.payload, Cloud Tasks sets the\nfollowing headers:\n\n* `Content-Type`: By default, the `Content-Type` header is set to\n `\"application/octet-stream\"`. The default can be overridden by explictly\n setting `Content-Type` to a particular media type when the\n [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask).\n For example, `Content-Type` can be set to `\"application/json\"`.\n* `Content-Length`: This is computed by Cloud Tasks. This value is\n output only. It cannot be changed.\n\nThe headers below cannot be set or overridden:\n\n* `Host`\n* `X-Google-*`\n* `X-AppEngine-*`\n\nIn addition, some App Engine headers, which contain\ntask-specific information, are also be sent to the task handler; see\n[request headers](/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).", + "type": "object" + }, + "appEngineRouting": { + "description": "Task-level setting for App Engine routing.\n\nIf set, AppEngineHttpTarget.app_engine_routing_override is used for\nall tasks in the queue, no matter what the setting is for the\ntask-level app_engine_routing.", + "$ref": "AppEngineRouting" + }, + "httpMethod": { + "description": "The HTTP method to use for the request. The default is POST.\n\nThe app's request handler for the task's target URL must be able to handle\nHTTP requests with this http_method, otherwise the task attempt will fail\nwith error code 405 \"Method Not Allowed\" because \"the method specified in\nthe Request-Line is not allowed for the resource identified by the\nRequest-URI\". See\n[Writing a push task request handler](/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)\nand the documentation for the request handlers in the language your app is\nwritten in e.g.\n[python RequestHandler](/appengine/docs/python/tools/webapp/requesthandlerclass).", + "type": "string", + "enumDescriptions": [ + "HTTP method unspecified", + "HTTP Post", + "HTTP Get", + "HTTP Head", + "HTTP Put", + "HTTP Delete" + ], + "enum": [ + "HTTP_METHOD_UNSPECIFIED", + "POST", + "GET", + "HEAD", + "PUT", + "DELETE" + ] + }, + "payload": { + "format": "byte", + "description": "Payload.\n\nThe payload will be sent as the HTTP message body. A message\nbody, and thus a payload, is allowed only if the HTTP method is\nPOST or PUT. It is an error to set a data payload on a task with\nan incompatible HttpMethod.", + "type": "string" + } + }, + "id": "AppEngineHttpRequest" + }, + "AppEngineQueueConfig": { + "description": "Deprecated. Use AppEngineTarget.", + "type": "object", + "properties": { + "appEngineRoutingOverride": { + "$ref": "AppEngineRouting", + "description": "Deprecated. Use AppEngineTarget.app_engine_routing_override." + } + }, + "id": "AppEngineQueueConfig" + }, + "PullTaskTarget": { + "description": "Deprecated. Use PullMessage.", + "type": "object", + "properties": { + "payload": { + "format": "byte", + "description": "Deprecated. Use PullMessage.payload.", + "type": "string" + }, + "tag": { + "format": "byte", + "description": "Deprecated. Use PullMessage.tag.", + "type": "string" + } + }, + "id": "PullTaskTarget" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse" + }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, + "RetryConfig": { + "description": "Retry config.\n\nThese settings determine retry behavior.\n\nIf a task does not complete successfully, meaning that an\nacknowledgement is not received from the handler before the\n[deadline](/appengine/docs/python/taskqueue/push/#the_task_deadline),\nthen it will be retried with exponential backoff according to the\nsettings in RetryConfig.", + "type": "object", + "properties": { + "maxDoublings": { + "format": "int32", + "description": "The maximum number of times that the interval between failed task\nretries will be doubled before the increase becomes constant. The\nconstant is: 2**(max_doublings - 1) *\nRetryConfig.min_backoff.\n\n* For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget),\n this field is 16 by default.\n* For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field\n is output only and always 0.", + "type": "integer" + }, + "maxAttempts": { + "format": "int32", + "description": "The maximum number of attempts for a task.\n\nCloud Tasks will attempt the task `max_attempts` times (that\nis, if the first attempt fails, then there will be\n`max_attempts - 1` retries). Must be \u003e 0.", + "type": "integer" + }, + "taskAgeLimit": { + "format": "google-duration", + "description": "If positive, task_age_limit specifies the time limit for retrying a failed\ntask, measured from when the task was first run. If specified with\nRetryConfig.max_attempts, the task will be retried until both\nlimits are reached.\n\nIf zero, then the task age is unlimited. This field is zero by default.\n\n`task_age_limit` will be truncated to the nearest second.", + "type": "string" + }, + "unlimitedAttempts": { + "description": "If true, then the number of attempts is unlimited.", + "type": "boolean" + }, + "minBackoff": { + "format": "google-duration", + "description": "The minimum amount of time to wait before retrying a task after\nit fails.\n\n* For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget),\n this field is 0.1 seconds by default.\n* For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this\n field is output only and always 0.\n\n`min_backoff` will be truncated to the nearest second.", + "type": "string" + }, + "maxBackoff": { + "format": "google-duration", + "description": "The maximum amount of time to wait before retrying a task after\nit fails. The default is 1 hour.\n\n* For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget),\n this field is 1 hour by default.\n* For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field\n is output only and always 0.\n\n`max_backoff` will be truncated to the nearest second.", + "type": "string" + } + }, + "id": "RetryConfig" + }, + "PullTarget": { + "description": "Pull target.", + "type": "object", + "properties": {}, + "id": "PullTarget" + }, + "ThrottleConfig": { + "description": "Throttle config.\n\nThese settings determine the throttling behavior.", + "type": "object", + "properties": { + "maxOutstandingTasks": { + "format": "int32", + "description": "The maximum number of outstanding tasks that Cloud Tasks allows\nto be dispatched for this queue. After this threshold has been\nreached, Cloud Tasks stops dispatching tasks until the number of\noutstanding requests decreases.\n\nThe maximum allowed value is 5,000.\n\n* For App Engine queues, this field is 10 by default.\n* For pull queues, this field is output only and always -1, which\n indicates no limit.\n\nThis field has the same meaning as\n[max_concurrent_requests in queue.yaml](/appengine/docs/standard/python/config/queueref#max_concurrent_requests).", + "type": "integer" + }, + "maxTasksDispatchedPerSecond": { + "format": "double", + "description": "The maximum rate at which tasks are dispatched from this\nqueue.\n\nThe maximum allowed value is 500.\n\n* For App Engine queues, this field is 1 by default.\n* For pull queues, this field is output only and always 10,000.\n\nThis field has the same meaning as\n[rate in queue.yaml](/appengine/docs/standard/python/config/queueref#rate).", + "type": "number" + }, + "maxBurstSize": { + "format": "int32", + "description": "Output only.\n\nThe max burst size limits how fast the queue is processed when\nmany tasks are in the queue and the rate is high. This field\nallows the queue to have a high rate so processing starts shortly\nafter a task is enqueued, but still limits resource usage when\nmany tasks are enqueued in a short period of time.\n\n* For App Engine queues, if\n ThrottleConfig.max_tasks_dispatched_per_second is 1, this\n field is 10; otherwise this field is\n ThrottleConfig.max_tasks_dispatched_per_second / 5.\n* For pull queues, this field is output only and always 10,000.\n\nNote: For App Engine queues that were created through\n`queue.yaml/xml`, `max_burst_size` might not have the same\nsettings as specified above; CloudTasks.UpdateQueue can be\nused to set `max_burst_size` only to the values specified above.\n\nThis field has the same meaning as\n[bucket_size in queue.yaml](/appengine/docs/standard/python/config/queueref#bucket_size).", + "type": "integer" + } + }, + "id": "ThrottleConfig" + }, + "ResumeQueueRequest": { + "description": "Request message for CloudTasks.ResumeQueue.", + "type": "object", + "properties": {}, + "id": "ResumeQueueRequest" + }, + "ListTasksResponse": { + "description": "Response message for listing tasks using CloudTasks.ListTasks.", + "type": "object", + "properties": { + "nextPageToken": { + "format": "byte", + "description": "A token to retrieve next page of results.\n\nTo return the next page of results, call\nCloudTasks.ListTasks with this value as the\nListTasksRequest.page_token.\n\nIf the next_page_token is empty, there are no more results.", + "type": "string" + }, + "tasks": { + "description": "The list of tasks.", + "items": { + "$ref": "Task" + }, + "type": "array" + } + }, + "id": "ListTasksResponse" + }, + "CreateTaskRequest": { + "description": "Request message for CloudTasks.CreateTask.", + "type": "object", + "properties": { + "task": { + "description": "Required.\n\nThe task to add.\n\nTask names have the following format:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.\nThe user can optionally specify a name for the task in\nTask.name. If a name is not specified then the system will\ngenerate a random unique task id, which will be returned in the\nresponse's Task.name.\n\nExplicitly specifying a Task.name enables task\nde-duplication. If a task's name is identical to the name of an\nexisting task or a task that was deleted or completed within the\nlast ~10 days then the call to CloudTasks.CreateTask will\nfail with google.rpc.Code.ALREADY_EXISTS. Because there is an\nextra lookup cost to identify duplicate task names, these\nCloudTasks.CreateTask calls have significantly increased\nlatency. Using hashed strings for the task id or for the prefix\nof the task id is recommended. Choosing task ids that are\nsequential or have sequential prefixes, for example using a\ntimestamp, causes an increase in latency and error rates in all\ntask commands. The infrastructure relies on an approximately\nuniform distribution of task ids to store and serve tasks\nefficiently.\n\nIf Task.schedule_time is not set or is in the past then Cloud\nTasks will set it to the current time.", + "$ref": "Task" + }, + "responseView": { + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string", + "enumDescriptions": [ + "Unspecified. Defaults to BASIC.", + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include the payload.", + "All information is returned.\n\nPayloads might be desirable to return only when needed, because\nthey can be large and because of the sensitivity of the data\nthat you choose to store in it.\n\nAuthorization for Task.View.FULL requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the Queue.name resource." + ], + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + } + }, + "id": "CreateTaskRequest" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "canonicalName": "Cloud Tasks", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudtasks.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudtasks", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Cloud Tasks API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "methods": { + "get": { + "description": "Get information about a location.", + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Resource name for the location.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}", + "id": "cloudtasks.projects.locations.get", + "path": "v2beta2/{+name}" + }, + "list": { + "flatPath": "v2beta2/projects/{projectsId}/locations", + "id": "cloudtasks.projects.locations.list", + "path": "v2beta2/{+name}/locations", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + }, + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "The resource that owns the locations collection, if applicable.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "queues": { + "methods": { + "get": { + "description": "Gets a queue.", + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe resource name of the queue. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", + "id": "cloudtasks.projects.locations.queues.get", + "path": "v2beta2/{+name}" + }, + "patch": { + "request": { + "$ref": "Queue" + }, + "description": "Updates a queue.\n\nThis method creates the queue if it does not exist and updates\nthe queue if it does exist.\n\nWARNING: This method is only available to whitelisted\nusers. Using this method carries some risk. Read\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully and then sign up for\n[whitelist access to this method](https://goo.gl/Fe5mUy).", + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "A mask used to specify which fields of the queue are being updated.\n\nIf empty, then all fields will be updated.", + "type": "string" + }, + "name": { + "location": "path", + "description": "The queue name.\n\nThe queue name must have the following format:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`\n\n* `PROJECT_ID` can contain uppercase and lowercase letters,\n numbers, hyphens, colons, and periods; that is, it must match\n the regular expression: `[a-zA-Z\\\\d-:\\\\.]+`.\n* `QUEUE_ID` can contain uppercase and lowercase letters,\n numbers, and hyphens; that is, it must match the regular\n expression: `[a-zA-Z\\\\d-]+`. The maximum length is 100\n characters.\n\nCaller-specified and required in CreateQueueRequest, after which\nit becomes output only.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", + "id": "cloudtasks.projects.locations.queues.patch", + "path": "v2beta2/{+name}" + }, + "purge": { + "request": { + "$ref": "PurgeQueueRequest" + }, + "description": "Purges a queue by deleting all of its tasks.\n\nAll tasks created before this method is called are permanently deleted.\n\nPurge operations can take up to one minute to take effect. Tasks\nmight be dispatched before the purge takes effect. A purge is irreversible.", + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:purge", + "id": "cloudtasks.projects.locations.queues.purge", + "path": "v2beta2/{+name}:purge" + }, + "testIamPermissions": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:testIamPermissions", + "id": "cloudtasks.projects.locations.queues.testIamPermissions", + "path": "v2beta2/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on a Queue.\nIf the resource does not exist, this will return an empty set of\npermissions, not a google.rpc.Code.NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.\n", + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + } + }, + "pause": { + "request": { + "$ref": "PauseQueueRequest" + }, + "description": "Pauses the queue.\n\nIf a queue is paused then the system will stop executing the\ntasks in the queue until it is resumed via\nCloudTasks.ResumeQueue. Tasks can still be added when the\nqueue is paused. The state of the queue is stored in\nQueue.queue_state; if paused it will be set to\nQueue.QueueState.PAUSED.\n\nWARNING: This method is only available to whitelisted\nusers. Using this method carries some risk. Read\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully and then sign up for\n[whitelist access to this method](https://goo.gl/Fe5mUy).", + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:pause", + "id": "cloudtasks.projects.locations.queues.pause", + "path": "v2beta2/{+name}:pause" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", + "path": "v2beta2/{+name}", + "id": "cloudtasks.projects.locations.queues.delete", + "description": "Deletes a queue.\n\nThis command will delete the queue even if it has tasks in it.\n\nNote: If you delete a queue, a queue with the same name can't be created\nfor 7 days.\n\nWARNING: This method is only available to whitelisted\nusers. Using this method carries some risk. Read\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully and then sign up for\n[whitelist access to this method](https://goo.gl/Fe5mUy)." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListQueuesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "description": "`filter` can be used to specify a subset of queues. Any Queue\nfield can be used as a filter and several operators as supported.\nFor example: `\u003c=, \u003c, \u003e=, \u003e, !=, =, :`. The filter syntax is the same as\ndescribed in\n[Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters).\n\nSample filter \"app_engine_http_target: *\".\n\nNote that using filters might cause fewer queues than the\nrequested_page size to be returned.", + "type": "string", + "location": "query" + }, + "pageToken": { + "format": "byte", + "description": "A token identifying the page of results to return.\n\nTo request the first page results, page_token must be empty. To\nrequest the next page of results, page_token must be the value of\nListQueuesResponse.next_page_token returned from the previous\ncall to CloudTasks.ListQueues method. It is an error to\nswitch the value of ListQueuesRequest.filter while iterating\nthrough pages.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size.\n\nThe maximum page size is 9800. If unspecified, the page size will\nbe the maximum. Fewer queues than requested might be returned,\neven if more queues exist; use\nListQueuesResponse.next_page_token to determine if more\nqueues exist.", + "type": "integer" + }, + "parent": { + "description": "Required.\n\nThe location name.\nFor example: `projects/PROJECT_ID/locations/LOCATION_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues", + "path": "v2beta2/{+parent}/queues", + "id": "cloudtasks.projects.locations.queues.list", + "description": "Lists queues.\n\nQueues are returned in lexicographical order." + }, + "setIamPolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:setIamPolicy", + "path": "v2beta2/{+resource}:setIamPolicy", + "id": "cloudtasks.projects.locations.queues.setIamPolicy", + "description": "Sets the access control policy for a Queue. Replaces any existing\npolicy.\n\nAuthorization requires the following [Google IAM](/iam) permission on the\nspecified resource parent:\n\n* `cloudtasks.queues.setIamPolicy`\n", + "request": { + "$ref": "SetIamPolicyRequest" + } + }, + "create": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues", + "id": "cloudtasks.projects.locations.queues.create", + "path": "v2beta2/{+parent}/queues", + "description": "Creates a queue.\n\nWARNING: This method is only available to whitelisted\nusers. Using this method carries some risk. Read\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully and then sign up for\n[whitelist access to this method](https://goo.gl/Fe5mUy).", + "request": { + "$ref": "Queue" + }, + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "Required.\n\nThe location name in which the queue will be created.\nFor example: `projects/PROJECT_ID/locations/LOCATION_ID`\n\nThe list of allowed locations can be obtained by calling Cloud\nTasks' implementation of\ngoogle.cloud.location.Locations.ListLocations.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "resume": { + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:resume", + "id": "cloudtasks.projects.locations.queues.resume", + "path": "v2beta2/{+name}:resume", + "request": { + "$ref": "ResumeQueueRequest" + }, + "description": "Resume a queue.\n\nThis method resumes a queue after it has been\nQueue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of\na queue is stored in Queue.queue_state; after calling this method it\nwill be set to Queue.QueueState.RUNNING.\n\nWARNING: This method is only available to whitelisted\nusers. Using this method carries some risk. Read\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully and then sign up for\n[whitelist access to this method](https://goo.gl/Fe5mUy).\n\nWARNING: Resuming many high-QPS queues at the same time can\nlead to target overloading. If you are resuming high-QPS\nqueues, follow the 500/50/5 pattern described in\n[Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf)." + }, + "getIamPolicy": { + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for a Queue.\nReturns an empty policy if the resource exists and does not have a policy\nset.\n\nAuthorization requires the following [Google IAM](/iam) permission on the\nspecified resource parent:\n\n* `cloudtasks.queues.getIamPolicy`\n", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:getIamPolicy", + "id": "cloudtasks.projects.locations.queues.getIamPolicy", + "path": "v2beta2/{+resource}:getIamPolicy" + } + }, + "resources": { + "tasks": { + "methods": { + "run": { + "response": { + "$ref": "Task" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:run", + "id": "cloudtasks.projects.locations.queues.tasks.run", + "path": "v2beta2/{+name}:run", + "description": "Forces a task to run now.\n\nThis command is meant to be used for manual debugging. For\nexample, CloudTasks.RunTask can be used to retry a failed\ntask after a fix has been made or to manually force a task to be\ndispatched now.\n\nWhen this method is called, Cloud Tasks will dispatch the task to its\ntarget, even if the queue is Queue.QueueState.PAUSED.\n\nThe dispatched task is returned. That is, the task that is returned\ncontains the Task.task_status after the task is dispatched but\nbefore the task is received by its target.\n\nIf Cloud Tasks receives a successful response from the task's\nhandler, then the task will be deleted; otherwise the task's\nTask.schedule_time will be reset to the time that\nCloudTasks.RunTask was called plus the retry delay specified\nin the queue and task's RetryConfig.\n\nCloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when\nit is called on a task that has already succeeded or permanently\nfailed. google.rpc.Code.FAILED_PRECONDITION is returned when\nCloudTasks.RunTask is called on task that is dispatched or\nalready running.", + "request": { + "$ref": "RunTaskRequest" + } + }, + "cancelLease": { + "description": "Cancel a pull task's lease.\n\nThe lease holder can use this method to cancel a task's lease\nby setting Task.schedule_time to now. This will make the task\navailable to be leased to the next caller of CloudTasks.PullTasks.", + "request": { + "$ref": "CancelLeaseRequest" + }, + "response": { + "$ref": "Task" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:cancelLease", + "id": "cloudtasks.projects.locations.queues.tasks.cancelLease", + "path": "v2beta2/{+name}:cancelLease" + }, + "acknowledge": { + "request": { + "$ref": "AcknowledgeTaskRequest" + }, + "description": "Acknowledges a pull task.\n\nThe lease holder, that is, the entity that received this task in\na PullTasksResponse, must call this method to indicate that\nthe work associated with the task has finished.\n\nThe lease holder must acknowledge a task within the\nPullTasksRequest.lease_duration or the lease will expire and\nthe task will become ready to be returned in a different\nPullTasksResponse. After the task is acknowledged, it will\nnot be returned by a later CloudTasks.PullTasks,\nCloudTasks.GetTask, or CloudTasks.ListTasks.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:acknowledge", + "id": "cloudtasks.projects.locations.queues.tasks.acknowledge", + "path": "v2beta2/{+name}:acknowledge" + }, + "renewLease": { + "response": { + "$ref": "Task" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:renewLease", + "id": "cloudtasks.projects.locations.queues.tasks.renewLease", + "path": "v2beta2/{+name}:renewLease", + "request": { + "$ref": "RenewLeaseRequest" + }, + "description": "Renew the current lease of a pull task.\n\nThe lease holder can use this method to extend the lease by a new\nduration, starting from now. The new task lease will be\nreturned in Task.schedule_time." + }, + "get": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}", + "id": "cloudtasks.projects.locations.queues.tasks.get", + "path": "v2beta2/{+name}", + "description": "Gets a task.", + "response": { + "$ref": "Task" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "responseView": { + "location": "query", + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string" + }, + "name": { + "location": "path", + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a task.\n\nA task can be deleted if it is scheduled or dispatched. A task\ncannot be deleted if it has completed successfully or permanently\nfailed.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}", + "id": "cloudtasks.projects.locations.queues.tasks.delete", + "path": "v2beta2/{+name}" + }, + "pull": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "PullTasksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks:pull", + "path": "v2beta2/{+name}/tasks:pull", + "id": "cloudtasks.projects.locations.queues.tasks.pull", + "request": { + "$ref": "PullTasksRequest" + }, + "description": "Pulls tasks from a pull queue and acquires a lease on them for a\nspecified PullTasksRequest.lease_duration.\n\nThis method is invoked by the lease holder to obtain the\nlease. The lease holder must acknowledge the task via\nCloudTasks.AcknowledgeTask after they have performed the work\nassociated with the task.\n\nThe payload is intended to store data that the lease holder needs\nto perform the work associated with the task. To return the\npayloads in the PullTasksResponse, set\nPullTasksRequest.response_view to Task.View.FULL." + }, + "list": { + "description": "Lists the tasks in a queue.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default due to performance\nconsiderations; ListTasksRequest.response_view controls the\nsubset of information which is returned.", + "response": { + "$ref": "ListTasksResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageSize": { + "format": "int32", + "description": "Requested page size. Fewer tasks than requested might be returned.\n\nThe maximum page size is 1000. If unspecified, the page size will\nbe the maximum. Fewer tasks than requested might be returned,\neven if more tasks exist; use\nListTasksResponse.next_page_token to determine if more tasks\nexist.", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "format": "byte", + "description": "A token identifying the page of results to return.\n\nTo request the first page results, page_token must be empty. To\nrequest the next page of results, page_token must be the value of\nListTasksResponse.next_page_token returned from the previous\ncall to CloudTasks.ListTasks method.\n\nThe page token is valid for only 2 hours.", + "type": "string" + }, + "orderBy": { + "location": "query", + "description": "\nSort order used for the query. The fields supported for sorting\nare Task.schedule_time and PullMessage.tag. All results will be\nreturned in ascending order. The default ordering is by\nTask.schedule_time.", + "type": "string" + }, + "responseView": { + "location": "query", + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "description": "The response_view specifies which subset of the Task will be\nreturned.\n\nBy default response_view is Task.View.BASIC; not all\ninformation is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\n\nAuthorization for Task.View.FULL requires `cloudtasks.tasks.fullView`\n[Google IAM](/iam/) permission on the\nTask.name resource.", + "type": "string" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks", + "id": "cloudtasks.projects.locations.queues.tasks.list", + "path": "v2beta2/{+parent}/tasks" + }, + "create": { + "description": "Creates a task and adds it to a queue.\n\nTo add multiple tasks at the same time, use\n[HTTP batching](/storage/docs/json_api/v1/how-tos/batch)\nor the batching documentation for your client library, for example\nhttps://developers.google.com/api-client-library/python/guide/batch.\n\nTasks cannot be updated after creation; there is no UpdateTask command.", + "request": { + "$ref": "CreateTaskRequest" + }, + "response": { + "$ref": "Task" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`\n\nThe queue must already exist.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks", + "id": "cloudtasks.projects.locations.queues.tasks.create", + "path": "v2beta2/{+parent}/tasks" + } + } + } + } + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + } +} diff --git a/etc/api/cloudtasks/v2beta2/crates/1.0.6-api+20170926 b/etc/api/cloudtasks/v2beta2/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudtasks/v2beta2/crates/1.0.6-cli+20170926 b/etc/api/cloudtasks/v2beta2/crates/1.0.6-cli+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/cloudtrace/v1/cloudtrace-api.json b/etc/api/cloudtrace/v1/cloudtrace-api.json index 4f835da3bf..b53ff049e5 100644 --- a/etc/api/cloudtrace/v1/cloudtrace-api.json +++ b/etc/api/cloudtrace/v1/cloudtrace-api.json @@ -1,156 +1,72 @@ { - "basePath": "", - "revision": "20170516", - "documentationLink": "https://cloud.google.com/trace", - "id": "cloudtrace:v1", - "discoveryVersion": "v1", - "version_module": "True", - "schemas": { - "Traces": { - "description": "List of new or updated traces.", - "type": "object", - "properties": { - "traces": { - "description": "List of traces.", - "type": "array", - "items": { - "$ref": "Trace" - } - } - }, - "id": "Traces" - }, - "TraceSpan": { - "description": "A span represents a single timed event within a trace. Spans can be nested\nand form a trace tree. Often, a trace contains a root span that describes the\nend-to-end latency of an operation and, optionally, one or more subspans for\nits suboperations. Spans do not need to be contiguous. There may be gaps\nbetween spans in a trace.", - "type": "object", - "properties": { - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Collection of labels associated with the span. Label keys must be less than\n128 bytes. Label values must be less than 16 kilobytes (10MB for\n`/stacktrace` values).\n\nSome predefined label keys exist, or you may create your own. When creating\nyour own, we recommend the following formats:\n\n* `/category/product/key` for agents of well-known products (e.g.\n `/db/mongodb/read_size`).\n* `short_host/path/key` for domain-specific keys (e.g.\n `foo.com/myproduct/bar`)\n\nPredefined labels include:\n\n* `/agent`\n* `/component`\n* `/error/message`\n* `/error/name`\n* `/http/client_city`\n* `/http/client_country`\n* `/http/client_protocol`\n* `/http/client_region`\n* `/http/host`\n* `/http/method`\n* `/http/redirected_url`\n* `/http/request/size`\n* `/http/response/size`\n* `/http/status_code`\n* `/http/url`\n* `/http/user_agent`\n* `/pid`\n* `/stacktrace`\n* `/tid`", - "type": "object" - }, - "name": { - "description": "Name of the span. Must be less than 128 bytes. The span name is sanitized\nand displayed in the Stackdriver Trace tool in the\n{% dynamic print site_values.console_name %}.\nThe name may be a method name or some other per-call site name.\nFor the same executable and the same call point, a best practice is\nto use a consistent name, which makes it easier to correlate\ncross-trace spans.", - "type": "string" - }, - "spanId": { - "description": "Identifier for the span. Must be a 64-bit integer other than 0 and\nunique within a trace.", - "format": "uint64", - "type": "string" - }, - "parentSpanId": { - "description": "ID of the parent span, if any. Optional.", - "format": "uint64", - "type": "string" - }, - "endTime": { - "description": "End time of the span in nanoseconds from the UNIX epoch.", - "format": "google-datetime", - "type": "string" - }, - "startTime": { - "description": "Start time of the span in nanoseconds from the UNIX epoch.", - "format": "google-datetime", - "type": "string" - }, - "kind": { - "description": "Distinguishes between spans generated in a particular context. For example,\ntwo spans with the same name may be distinguished using `RPC_CLIENT`\nand `RPC_SERVER` to identify queueing latency associated with the span.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "Indicates that the span covers server-side handling of an RPC or other\nremote network request.", - "Indicates that the span covers the client-side wrapper around an RPC or\nother remote request." - ], - "enum": [ - "SPAN_KIND_UNSPECIFIED", - "RPC_SERVER", - "RPC_CLIENT" - ] - } - }, - "id": "TraceSpan" - }, - "ListTracesResponse": { - "description": "The response message for the `ListTraces` method.", - "type": "object", - "properties": { - "traces": { - "description": "List of trace records returned.", - "type": "array", - "items": { - "$ref": "Trace" - } - }, - "nextPageToken": { - "description": "If defined, indicates that there are more traces that match the request\nand that this value should be passed to the next request to continue\nretrieving additional traces.", - "type": "string" - } - }, - "id": "ListTracesResponse" - }, - "Empty": { - "properties": {}, - "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object" - }, - "Trace": { - "id": "Trace", - "description": "A trace describes how long it takes for an application to perform an\noperation. It consists of a set of spans, each of which represent a single\ntimed event within the operation.", - "type": "object", - "properties": { - "projectId": { - "description": "Project ID of the Cloud project where the trace data is stored.", - "type": "string" - }, - "spans": { - "description": "Collection of spans in the trace.", - "type": "array", - "items": { - "$ref": "TraceSpan" - } - }, - "traceId": { - "description": "Globally unique identifier for the trace. This identifier is a 128-bit\nnumeric value formatted as a 32-byte hex string.", - "type": "string" - } - } - } - }, - "protocol": "rest", - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, - "canonicalName": "Cloud Trace", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/trace.append": { - "description": "Write Trace data for a project or application" - }, - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/trace.readonly": { - "description": "Read Trace data for a project or application" - } - } - } - }, - "rootUrl": "https://cloudtrace.googleapis.com/", - "ownerDomain": "google.com", - "name": "cloudtrace", - "batchPath": "batch", - "title": "Stackdriver Trace API", "ownerName": "Google", "resources": { "projects": { + "methods": { + "patchTraces": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "ID of the Cloud project where the trace data is stored.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/traces", + "id": "cloudtrace.projects.patchTraces", + "path": "v1/projects/{projectId}/traces", + "request": { + "$ref": "Traces" + }, + "description": "Sends new traces to Stackdriver Trace or updates existing traces. If the ID\nof a trace that you send matches that of an existing trace, any fields\nin the existing trace and its spans are overwritten by the provided values,\nand any new fields provided are merged with the existing trace data. If the\nID does not match, a new trace is created." + } + }, "resources": { "traces": { "methods": { + "get": { + "description": "Gets a single trace by its ID.", + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "traceId" + ], + "response": { + "$ref": "Trace" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "ID of the Cloud project where the trace data is stored.", + "type": "string", + "required": true + }, + "traceId": { + "description": "ID of the trace to return.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.readonly" + ], + "flatPath": "v1/projects/{projectId}/traces/{traceId}", + "path": "v1/projects/{projectId}/traces/{traceId}", + "id": "cloudtrace.projects.traces.get" + }, "list": { "description": "Returns of a list of traces that match the specified filter conditions.", "httpMethod": "GET", @@ -160,23 +76,44 @@ "response": { "$ref": "ListTracesResponse" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.readonly" + ], "parameters": { - "pageToken": { + "projectId": { + "location": "path", + "description": "ID of the Cloud project where the trace data is stored.", "type": "string", + "required": true + }, + "filter": { "location": "query", - "description": "Token identifying the page of results to return. If provided, use the\nvalue of the `next_page_token` field from a previous request. Optional." + "description": "An optional filter against labels for the request.\n\nBy default, searches use prefix matching. To specify exact match, prepend\na plus symbol (`+`) to the search term.\nMultiple terms are ANDed. Syntax:\n\n* `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root\n span starts with `NAME_PREFIX`.\n* `+root:NAME` or `+NAME`: Return traces where any root span's name is\n exactly `NAME`.\n* `span:NAME_PREFIX`: Return traces where any span starts with\n `NAME_PREFIX`.\n* `+span:NAME`: Return traces where any span's name is exactly\n `NAME`.\n* `latency:DURATION`: Return traces whose overall latency is\n greater or equal to than `DURATION`. Accepted units are nanoseconds\n (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For\n example, `latency:24ms` returns traces whose overall latency\n is greater than or equal to 24 milliseconds.\n* `label:LABEL_KEY`: Return all traces containing the specified\n label key (exact match, case-sensitive) regardless of the key:value\n pair's value (including empty values).\n* `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified\n label key (exact match, case-sensitive) whose value starts with\n `VALUE_PREFIX`. Both a key and a value must be specified.\n* `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair\n exactly matching the specified text. Both a key and a value must be\n specified.\n* `method:VALUE`: Equivalent to `/http/method:VALUE`.\n* `url:VALUE`: Equivalent to `/http/url:VALUE`.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "End of the time interval (inclusive) during which the trace data was\ncollected from the application.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "Token identifying the page of results to return. If provided, use the\nvalue of the `next_page_token` field from a previous request. Optional.", + "type": "string", + "location": "query" }, "startTime": { "location": "query", - "description": "Start of the time interval (inclusive) during which the trace data was\ncollected from the application.", "format": "google-datetime", + "description": "Start of the time interval (inclusive) during which the trace data was\ncollected from the application.", "type": "string" }, "pageSize": { - "type": "integer", - "location": "query", + "format": "int32", "description": "Maximum number of traces to return. If not specified or \u003c= 0, the\nimplementation selects a reasonable value. The implementation may\nreturn fewer traces than the requested page size. Optional.", - "format": "int32" + "type": "integer", + "location": "query" }, "view": { "location": "query", @@ -190,154 +127,34 @@ "type": "string" }, "orderBy": { - "description": "Field used to sort the returned traces. Optional.\nCan be one of the following:\n\n* `trace_id`\n* `name` (`name` field of root span in the trace)\n* `duration` (difference between `end_time` and `start_time` fields of\n the root span)\n* `start` (`start_time` field of the root span)\n\nDescending order can be specified by appending `desc` to the sort field\n(for example, `name desc`).\n\nOnly one sort field is permitted.", - "type": "string", - "location": "query" - }, - "projectId": { - "location": "path", - "description": "ID of the Cloud project where the trace data is stored.", - "required": true, - "type": "string" - }, - "filter": { - "description": "An optional filter against labels for the request.\n\nBy default, searches use prefix matching. To specify exact match, prepend\na plus symbol (`+`) to the search term.\nMultiple terms are ANDed. Syntax:\n\n* `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root\n span starts with `NAME_PREFIX`.\n* `+root:NAME` or `+NAME`: Return traces where any root span's name is\n exactly `NAME`.\n* `span:NAME_PREFIX`: Return traces where any span starts with\n `NAME_PREFIX`.\n* `+span:NAME`: Return traces where any span's name is exactly\n `NAME`.\n* `latency:DURATION`: Return traces whose overall latency is\n greater or equal to than `DURATION`. Accepted units are nanoseconds\n (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For\n example, `latency:24ms` returns traces whose overall latency\n is greater than or equal to 24 milliseconds.\n* `label:LABEL_KEY`: Return all traces containing the specified\n label key (exact match, case-sensitive) regardless of the key:value\n pair's value (including empty values).\n* `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified\n label key (exact match, case-sensitive) whose value starts with\n `VALUE_PREFIX`. Both a key and a value must be specified.\n* `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair\n exactly matching the specified text. Both a key and a value must be\n specified.\n* `method:VALUE`: Equivalent to `/http/method:VALUE`.\n* `url:VALUE`: Equivalent to `/http/url:VALUE`.", - "type": "string", - "location": "query" - }, - "endTime": { "location": "query", - "description": "End of the time interval (inclusive) during which the trace data was\ncollected from the application.", - "format": "google-datetime", + "description": "Field used to sort the returned traces. Optional.\nCan be one of the following:\n\n* `trace_id`\n* `name` (`name` field of root span in the trace)\n* `duration` (difference between `end_time` and `start_time` fields of\n the root span)\n* `start` (`start_time` field of the root span)\n\nDescending order can be specified by appending `desc` to the sort field\n(for example, `name desc`).\n\nOnly one sort field is permitted.", "type": "string" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.readonly" - ], "flatPath": "v1/projects/{projectId}/traces", - "id": "cloudtrace.projects.traces.list", - "path": "v1/projects/{projectId}/traces" - }, - "get": { - "description": "Gets a single trace by its ID.", - "httpMethod": "GET", - "parameterOrder": [ - "projectId", - "traceId" - ], - "response": { - "$ref": "Trace" - }, - "parameters": { - "projectId": { - "required": true, - "type": "string", - "location": "path", - "description": "ID of the Cloud project where the trace data is stored." - }, - "traceId": { - "location": "path", - "description": "ID of the trace to return.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.readonly" - ], - "flatPath": "v1/projects/{projectId}/traces/{traceId}", - "id": "cloudtrace.projects.traces.get", - "path": "v1/projects/{projectId}/traces/{traceId}" + "path": "v1/projects/{projectId}/traces", + "id": "cloudtrace.projects.traces.list" } } } - }, - "methods": { - "patchTraces": { - "description": "Sends new traces to Stackdriver Trace or updates existing traces. If the ID\nof a trace that you send matches that of an existing trace, any fields\nin the existing trace and its spans are overwritten by the provided values,\nand any new fields provided are merged with the existing trace data. If the\nID does not match, a new trace is created.", - "request": { - "$ref": "Traces" - }, - "httpMethod": "PATCH", - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append" - ], - "parameters": { - "projectId": { - "description": "ID of the Cloud project where the trace data is stored.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectId}/traces", - "id": "cloudtrace.projects.patchTraces", - "path": "v1/projects/{projectId}/traces" - } } } }, "parameters": { - "access_token": { - "description": "OAuth access token.", + "fields": { + "description": "Selector specifying which fields to include in a partial response.", "type": "string", "location": "query" }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", "location": "query" }, - "fields": { + "callback": { "location": "query", - "description": "Selector specifying which fields to include in a partial response.", + "description": "JSONP", "type": "string" }, "$.xgafv": { @@ -353,13 +170,7 @@ "description": "V1 error format.", "type": "string" }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, "alt": { - "location": "query", "description": "Data format for response.", "default": "json", "enum": [ @@ -372,12 +183,201 @@ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" - ] + ], + "location": "query" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" } }, "version": "v1", "baseUrl": "https://cloudtrace.googleapis.com/", - "description": "Send and retrieve trace data from Stackdriver Trace. Data is generated and available by default for all App Engine applications. Data from other applications can be written to Stackdriver Trace for display, reporting, and analysis.\n", "kind": "discovery#restDescription", - "servicePath": "" + "description": "Send and retrieve trace data from Stackdriver Trace. Data is generated and available by default for all App Engine applications. Data from other applications can be written to Stackdriver Trace for display, reporting, and analysis.\n", + "servicePath": "", + "basePath": "", + "revision": "20170919", + "documentationLink": "https://cloud.google.com/trace", + "id": "cloudtrace:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "ListTracesResponse": { + "description": "The response message for the `ListTraces` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If defined, indicates that there are more traces that match the request\nand that this value should be passed to the next request to continue\nretrieving additional traces.", + "type": "string" + }, + "traces": { + "description": "List of trace records returned.", + "items": { + "$ref": "Trace" + }, + "type": "array" + } + }, + "id": "ListTracesResponse" + }, + "Trace": { + "description": "A trace describes how long it takes for an application to perform an\noperation. It consists of a set of spans, each of which represent a single\ntimed event within the operation.", + "type": "object", + "properties": { + "spans": { + "description": "Collection of spans in the trace.", + "items": { + "$ref": "TraceSpan" + }, + "type": "array" + }, + "projectId": { + "description": "Project ID of the Cloud project where the trace data is stored.", + "type": "string" + }, + "traceId": { + "description": "Globally unique identifier for the trace. This identifier is a 128-bit\nnumeric value formatted as a 32-byte hex string.", + "type": "string" + } + }, + "id": "Trace" + }, + "Traces": { + "description": "List of new or updated traces.", + "type": "object", + "properties": { + "traces": { + "description": "List of traces.", + "items": { + "$ref": "Trace" + }, + "type": "array" + } + }, + "id": "Traces" + }, + "TraceSpan": { + "description": "A span represents a single timed event within a trace. Spans can be nested\nand form a trace tree. Often, a trace contains a root span that describes the\nend-to-end latency of an operation and, optionally, one or more subspans for\nits suboperations. Spans do not need to be contiguous. There may be gaps\nbetween spans in a trace.", + "type": "object", + "properties": { + "labels": { + "description": "Collection of labels associated with the span. Label keys must be less than\n128 bytes. Label values must be less than 16 kilobytes (10MB for\n`/stacktrace` values).\n\nSome predefined label keys exist, or you may create your own. When creating\nyour own, we recommend the following formats:\n\n* `/category/product/key` for agents of well-known products (e.g.\n `/db/mongodb/read_size`).\n* `short_host/path/key` for domain-specific keys (e.g.\n `foo.com/myproduct/bar`)\n\nPredefined labels include:\n\n* `/agent`\n* `/component`\n* `/error/message`\n* `/error/name`\n* `/http/client_city`\n* `/http/client_country`\n* `/http/client_protocol`\n* `/http/client_region`\n* `/http/host`\n* `/http/method`\n* `/http/redirected_url`\n* `/http/request/size`\n* `/http/response/size`\n* `/http/status_code`\n* `/http/url`\n* `/http/user_agent`\n* `/pid`\n* `/stacktrace`\n* `/tid`", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Name of the span. Must be less than 128 bytes. The span name is sanitized\nand displayed in the Stackdriver Trace tool in the\n{% dynamic print site_values.console_name %}.\nThe name may be a method name or some other per-call site name.\nFor the same executable and the same call point, a best practice is\nto use a consistent name, which makes it easier to correlate\ncross-trace spans.", + "type": "string" + }, + "spanId": { + "format": "uint64", + "description": "Identifier for the span. Must be a 64-bit integer other than 0 and\nunique within a trace.", + "type": "string" + }, + "parentSpanId": { + "format": "uint64", + "description": "ID of the parent span, if any. Optional.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "End time of the span in nanoseconds from the UNIX epoch.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Start time of the span in nanoseconds from the UNIX epoch.", + "type": "string" + }, + "kind": { + "enumDescriptions": [ + "Unspecified.", + "Indicates that the span covers server-side handling of an RPC or other\nremote network request.", + "Indicates that the span covers the client-side wrapper around an RPC or\nother remote request." + ], + "enum": [ + "SPAN_KIND_UNSPECIFIED", + "RPC_SERVER", + "RPC_CLIENT" + ], + "description": "Distinguishes between spans generated in a particular context. For example,\ntwo spans with the same name may be distinguished using `RPC_CLIENT`\nand `RPC_SERVER` to identify queueing latency associated with the span.", + "type": "string" + } + }, + "id": "TraceSpan" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Cloud Trace", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/trace.readonly": { + "description": "Read Trace data for a project or application" + }, + "https://www.googleapis.com/auth/trace.append": { + "description": "Write Trace data for a project or application" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudtrace.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudtrace", + "batchPath": "batch", + "title": "Stackdriver Trace API" } diff --git a/etc/api/cloudtrace/v2/cloudtrace-api.json b/etc/api/cloudtrace/v2/cloudtrace-api.json new file mode 100644 index 0000000000..4cbaf4dd3c --- /dev/null +++ b/etc/api/cloudtrace/v2/cloudtrace-api.json @@ -0,0 +1,604 @@ +{ + "basePath": "", + "id": "cloudtrace:v2", + "revision": "20170919", + "documentationLink": "https://cloud.google.com/trace", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "Span": { + "description": "A span represents a single operation within a trace. Spans can be\nnested to form a trace tree. Often, a trace contains a root span\nthat describes the end-to-end latency, and one or more subspans for\nits sub-operations. A trace can also contain multiple root spans,\nor none at all. Spans do not need to be contiguous—there may be\ngaps or overlaps between spans in a trace.", + "type": "object", + "properties": { + "childSpanCount": { + "format": "uint32", + "description": "An optional number of child spans that were generated while this span\nwas active. If set, allows implementation to detect missing child spans.", + "type": "integer" + }, + "sameProcessAsParentSpan": { + "description": "A highly recommended but not required flag that identifies when a trace\ncrosses a process boundary. True when the parent_span belongs to the\nsame process as the current span.", + "type": "boolean" + }, + "status": { + "$ref": "Status", + "description": "An optional final status for this span." + }, + "name": { + "description": "The resource name of the span in the following format:\n\n projects/[PROJECT_ID]traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project.\n[SPAN_ID] is a unique identifier for a span within a trace,\nassigned when the span is created.", + "type": "string" + }, + "stackTrace": { + "description": "Stack trace captured at the start of the span.", + "$ref": "StackTrace" + }, + "parentSpanId": { + "description": "The [SPAN_ID] of this span's parent span. If this is a root span,\nthen this field must be empty.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "The end time of the span. On the client side, this is the time kept by\nthe local machine where the span execution ends. On the server side, this\nis the time when the server application handler stops running.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "The start time of the span. On the client side, this is the time kept by\nthe local machine where the span execution starts. On the server side, this\nis the time when the server's application handler starts running.", + "type": "string" + }, + "displayName": { + "$ref": "TruncatableString", + "description": "A description of the span's operation (up to 128 bytes).\nStackdriver Trace displays the description in the\n{% dynamic print site_values.console_name %}.\nFor example, the display name can be a qualified method name or a file name\nand a line number where the operation is called. A best practice is to use\nthe same display name within an application and at the same call point.\nThis makes it easier to correlate spans in different traces." + }, + "timeEvents": { + "$ref": "TimeEvents", + "description": "The included time events. There can be up to 32 annotations and 128 network\nevents per span." + }, + "links": { + "description": "A maximum of 128 links are allowed per Span.", + "$ref": "Links" + }, + "attributes": { + "$ref": "Attributes", + "description": "A set of attributes on the span. There is a limit of 32 attributes per\nspan." + }, + "spanId": { + "description": "The [SPAN_ID] portion of the span's resource name.", + "type": "string" + } + }, + "id": "Span" + }, + "AttributeValue": { + "description": "The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.", + "type": "object", + "properties": { + "intValue": { + "format": "int64", + "description": "A 64-bit signed integer.", + "type": "string" + }, + "boolValue": { + "description": "A Boolean value represented by `true` or `false`.", + "type": "boolean" + }, + "stringValue": { + "description": "A string up to 256 bytes long.", + "$ref": "TruncatableString" + } + }, + "id": "AttributeValue" + }, + "Attributes": { + "description": "A set of attributes, each in the format `[KEY]:[VALUE]`.", + "type": "object", + "properties": { + "droppedAttributesCount": { + "format": "int32", + "description": "The number of attributes that were discarded. Attributes can be discarded\nbecause their keys are too long or because there are too many attributes.\nIf this value is 0 then all attributes are valid.", + "type": "integer" + }, + "attributeMap": { + "description": "The set of attributes. Each attribute's key can be up to 128 bytes\nlong. The value can be a string up to 256 bytes, an integer, or the\nBoolean values `true` and `false`. For example:\n\n \"/instance_id\": \"my-instance\"\n \"/http/user_agent\": \"\"\n \"/http/request_bytes\": 300\n \"abc.com/myattribute\": true", + "type": "object", + "additionalProperties": { + "$ref": "AttributeValue" + } + } + }, + "id": "Attributes" + }, + "Links": { + "description": "A collection of links, which are references from this span to a span\nin the same or different trace.", + "type": "object", + "properties": { + "link": { + "description": "A collection of links.", + "items": { + "$ref": "Link" + }, + "type": "array" + }, + "droppedLinksCount": { + "format": "int32", + "description": "The number of dropped links after the maximum size was enforced. If\nthis value is 0, then no links were dropped.", + "type": "integer" + } + }, + "id": "Links" + }, + "StackTrace": { + "description": "A call stack appearing in a trace.", + "type": "object", + "properties": { + "stackTraceHashId": { + "format": "uint64", + "description": "The hash ID is used to conserve network bandwidth for duplicate\nstack traces within a single trace.\n\nOften multiple spans will have identical stack traces.\nThe first occurrence of a stack trace should contain both the\n`stackFrame` content and a value in `stackTraceHashId`.\n\nSubsequent spans within the same request can refer\nto that stack trace by only setting `stackTraceHashId`.", + "type": "string" + }, + "stackFrames": { + "$ref": "StackFrames", + "description": "Stack frames in this stack trace. A maximum of 128 frames are allowed." + } + }, + "id": "StackTrace" + }, + "TruncatableString": { + "description": "Represents a string that might be shortened to a specified length.", + "type": "object", + "properties": { + "truncatedByteCount": { + "format": "int32", + "description": "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.", + "type": "integer" + }, + "value": { + "description": "The shortened string. For example, if the original string was 500\nbytes long and the limit of the string was 128 bytes, then this\nvalue contains the first 128 bytes of the 500-byte string. Note that\ntruncation always happens on the character boundary, to ensure that\ntruncated string is still valid UTF8. In case of multi-byte characters,\nsize of truncated string can be less than truncation limit.", + "type": "string" + } + }, + "id": "TruncatableString" + }, + "TimeEvent": { + "description": "A time-stamped annotation or network event in the Span.", + "type": "object", + "properties": { + "time": { + "format": "google-datetime", + "description": "The timestamp indicating the time the event occurred.", + "type": "string" + }, + "networkEvent": { + "description": "An event describing an RPC message sent/received on the network.", + "$ref": "NetworkEvent" + }, + "annotation": { + "$ref": "Annotation", + "description": "Text annotation with a set of attributes." + } + }, + "id": "TimeEvent" + }, + "NetworkEvent": { + "description": "An event describing an RPC message sent or received on the network.", + "type": "object", + "properties": { + "time": { + "format": "google-datetime", + "description": "For sent messages, this is the time at which the first bit was sent.\nFor received messages, this is the time at which the last bit was\nreceived.", + "type": "string" + }, + "uncompressedMessageSize": { + "format": "uint64", + "description": "The number of uncompressed bytes sent or received.", + "type": "string" + }, + "type": { + "description": "Type of NetworkEvent. Indicates whether the RPC message was sent or\nreceived.", + "type": "string", + "enumDescriptions": [ + "Unknown event type.", + "Indicates a sent RPC message.", + "Indicates a received RPC message." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "SENT", + "RECV" + ] + }, + "messageId": { + "format": "uint64", + "description": "An identifier for the message, which must be unique in this span.", + "type": "string" + }, + "compressedMessageSize": { + "format": "uint64", + "description": "The number of compressed bytes sent or received.", + "type": "string" + } + }, + "id": "NetworkEvent" + }, + "StackFrame": { + "description": "Represents a single stack frame in a stack trace.", + "type": "object", + "properties": { + "lineNumber": { + "format": "int64", + "description": "The line number in `file_name` where the function call appears.", + "type": "string" + }, + "loadModule": { + "description": "The binary module from where the code was loaded.", + "$ref": "Module" + }, + "columnNumber": { + "format": "int64", + "description": "The column number where the function call appears, if available.\nThis is important in JavaScript because of its anonymous functions.", + "type": "string" + }, + "fileName": { + "$ref": "TruncatableString", + "description": "The name of the source file where the function call appears (up to 256\nbytes)." + }, + "sourceVersion": { + "$ref": "TruncatableString", + "description": "The version of the deployed source code (up to 128 bytes)." + }, + "originalFunctionName": { + "$ref": "TruncatableString", + "description": "An un-mangled function name, if `function_name` is\n[mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can\nbe fully-qualified (up to 1024 bytes)." + }, + "functionName": { + "$ref": "TruncatableString", + "description": "The fully-qualified name that uniquely identifies the function or\nmethod that is active in this frame (up to 1024 bytes)." + } + }, + "id": "StackFrame" + }, + "Link": { + "description": "A pointer from the current span to another span in the same trace or in a\ndifferent trace. For example, this can be used in batching operations,\nwhere a single batch handler processes multiple requests from different\ntraces or when the handler receives a request from a different project.", + "type": "object", + "properties": { + "type": { + "description": "The relationship of the current span relative to the linked span.", + "type": "string", + "enumDescriptions": [ + "The relationship of the two spans is unknown.", + "The linked span is a child of the current span.", + "The linked span is a parent of the current span." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "CHILD_LINKED_SPAN", + "PARENT_LINKED_SPAN" + ] + }, + "attributes": { + "description": "A set of attributes on the link. There is a limit of 32 attributes per\nlink.", + "$ref": "Attributes" + }, + "traceId": { + "description": "`TRACE_ID` identifies a trace within a project.", + "type": "string" + }, + "spanId": { + "description": "`SPAN_ID` identifies a span within a trace.", + "type": "string" + } + }, + "id": "Link" + }, + "Annotation": { + "description": "Text annotation with a set of attributes.", + "type": "object", + "properties": { + "description": { + "$ref": "TruncatableString", + "description": "A user-supplied message describing the event. The maximum length for\nthe description is 256 bytes." + }, + "attributes": { + "description": "A set of attributes on the annotation. There is a limit of 4 attributes\nper Annotation.", + "$ref": "Attributes" + } + }, + "id": "Annotation" + }, + "StackFrames": { + "description": "A collection of stack frames, which can be truncated.", + "type": "object", + "properties": { + "droppedFramesCount": { + "format": "int32", + "description": "The number of stack frames that were dropped because there\nwere too many stack frames.\nIf this value is 0, then no stack frames were dropped.", + "type": "integer" + }, + "frame": { + "description": "Stack frames in this call stack.", + "items": { + "$ref": "StackFrame" + }, + "type": "array" + } + }, + "id": "StackFrames" + }, + "TimeEvents": { + "description": "A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation\non the span, consisting of either user-supplied key:value pairs, or\ndetails of an RPC message sent/received on the network.", + "type": "object", + "properties": { + "droppedAnnotationsCount": { + "format": "int32", + "description": "The number of dropped annotations in all the included time events.\nIf the value is 0, then no annotations were dropped.", + "type": "integer" + }, + "timeEvent": { + "description": "A collection of `TimeEvent`s.", + "items": { + "$ref": "TimeEvent" + }, + "type": "array" + }, + "droppedNetworkEventsCount": { + "format": "int32", + "description": "The number of dropped network events in all the included time events.\nIf the value is 0, then no network events were dropped.", + "type": "integer" + } + }, + "id": "TimeEvents" + }, + "Module": { + "description": "Binary module.", + "type": "object", + "properties": { + "module": { + "description": "For example: main binary, kernel modules, and dynamic libraries\nsuch as libc.so, sharedlib.so (up to 256 bytes).", + "$ref": "TruncatableString" + }, + "buildId": { + "$ref": "TruncatableString", + "description": "A unique identifier for the module, usually a hash of its\ncontents (up to 128 bytes)." + } + }, + "id": "Module" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "BatchWriteSpansRequest": { + "description": "The request message for the `BatchWriteSpans` method.", + "type": "object", + "properties": { + "spans": { + "description": "A collection of spans.", + "items": { + "$ref": "Span" + }, + "type": "array" + } + }, + "id": "BatchWriteSpansRequest" + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "canonicalName": "Cloud Trace", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/trace.append": { + "description": "Write Trace data for a project or application" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudtrace.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudtrace", + "batchPath": "batch", + "title": "Stackdriver Trace API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "traces": { + "methods": { + "batchWrite": { + "flatPath": "v2/projects/{projectsId}/traces:batchWrite", + "id": "cloudtrace.projects.traces.batchWrite", + "path": "v2/{+name}/traces:batchWrite", + "description": "Sends new spans to Stackdriver Trace or updates existing traces. If the\nname of a trace that you send matches that of an existing trace, new spans\nare added to the existing trace. Attempt to update existing spans results\nundefined behavior. If the name does not match, a new trace is created\nwith given set of spans.", + "request": { + "$ref": "BatchWriteSpansRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "Required. Name of the project where the spans belong. The format is\n`projects/PROJECT_ID`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append" + ] + } + }, + "resources": { + "spans": { + "methods": { + "create": { + "response": { + "$ref": "Span" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the span in the following format:\n\n projects/[PROJECT_ID]traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project.\n[SPAN_ID] is a unique identifier for a span within a trace,\nassigned when the span is created.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/traces/[^/]+/spans/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append" + ], + "flatPath": "v2/projects/{projectsId}/traces/{tracesId}/spans/{spansId}", + "id": "cloudtrace.projects.traces.spans.create", + "path": "v2/{+name}", + "description": "Creates a new Span.", + "request": { + "$ref": "Span" + } + } + } + } + } + } + } + } + }, + "parameters": { + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + } + }, + "version": "v2", + "baseUrl": "https://cloudtrace.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Send and retrieve trace data from Stackdriver Trace. Data is generated and available by default for all App Engine applications. Data from other applications can be written to Stackdriver Trace for display, reporting, and analysis.\n", + "servicePath": "" +} diff --git a/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json b/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json index 2ef43ad9a4..110083dccd 100644 --- a/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json +++ b/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json @@ -21,7 +21,7 @@ "basePath": "/clouduseraccounts/alpha/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "clouduseraccounts/alpha/projects/", - "batchPath": "batch", + "batchPath": "batch/clouduseraccounts/alpha", "parameters": { "alt": { "type": "string", diff --git a/etc/api/clouduseraccounts/beta/clouduseraccounts-api.json b/etc/api/clouduseraccounts/beta/clouduseraccounts-api.json index 97da319582..19293aca58 100644 --- a/etc/api/clouduseraccounts/beta/clouduseraccounts-api.json +++ b/etc/api/clouduseraccounts/beta/clouduseraccounts-api.json @@ -21,7 +21,7 @@ "basePath": "/clouduseraccounts/beta/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "clouduseraccounts/beta/projects/", - "batchPath": "batch", + "batchPath": "batch/clouduseraccounts/beta", "parameters": { "alt": { "type": "string", diff --git a/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json b/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json index 141978bbac..832a7fad89 100644 --- a/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json +++ b/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json @@ -21,7 +21,7 @@ "basePath": "/clouduseraccounts/vm_alpha/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "clouduseraccounts/vm_alpha/projects/", - "batchPath": "batch", + "batchPath": "batch/clouduseraccounts/vm_alpha", "parameters": { "alt": { "type": "string", diff --git a/etc/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json b/etc/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json index ce19b70270..2077e5a39a 100644 --- a/etc/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json +++ b/etc/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json @@ -21,7 +21,7 @@ "basePath": "/clouduseraccounts/vm_beta/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "clouduseraccounts/vm_beta/projects/", - "batchPath": "batch", + "batchPath": "batch/clouduseraccounts/vm_beta", "parameters": { "alt": { "type": "string", diff --git a/etc/api/compute/alpha/compute-api.json b/etc/api/compute/alpha/compute-api.json index db94a6199e..936a253085 100644 --- a/etc/api/compute/alpha/compute-api.json +++ b/etc/api/compute/alpha/compute-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/5iPMQ7gb_sNP9BqL2s00rhnUDOY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/3cMXWrWKedeDcxyJugoWfBBTcik\"", "discoveryVersion": "v1", "id": "compute:alpha", "name": "compute", "version": "alpha", - "revision": "20170426", + "revision": "20170908", "title": "Compute Engine API", "description": "Creates and runs virtual machines on Google Cloud Platform.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/compute/alpha/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "compute/alpha/projects/", - "batchPath": "batch", + "batchPath": "batch/compute/alpha", "parameters": { "alt": { "type": "string", @@ -160,11 +160,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped accelerator type lists.", + "description": "A list of AcceleratorTypesScopedList resources.", "additionalProperties": { "$ref": "AcceleratorTypesScopedList", "description": "[Output Only] Name of the scope containing this set of accelerator types." @@ -182,6 +182,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -208,11 +277,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -318,7 +456,7 @@ }, "networkTier": { "type": "string", - "description": "This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , SELECT. If this field is not specified, it is assumed to be PREMIUM.", + "description": "This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD.\n\nIf an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier.\n\nIf an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP.", "enum": [ "PREMIUM", "SELECT", @@ -366,17 +504,19 @@ "properties": { "address": { "type": "string", - "description": "The static external IP address represented by this resource." + "description": "The static IP address represented by this resource." }, "addressType": { "type": "string", "description": "The type of address to reserve. If unspecified, defaults to EXTERNAL.", "enum": [ + "DNS_FORWARDING", "EXTERNAL", "INTERNAL", "UNSPECIFIED_TYPE" ], "enumDescriptions": [ + "", "", "", "" @@ -438,7 +578,7 @@ }, "networkTier": { "type": "string", - "description": "This signifies the networking tier used for configuring this Address and can only take the following values: PREMIUM , SELECT. If this field is not specified, it is assumed to be PREMIUM.", + "description": "This signifies the networking tier used for configuring this Address and can only take the following values: PREMIUM , STANDARD.\n\nIf this field is not specified, it is assumed to be PREMIUM.", "enum": [ "PREMIUM", "SELECT", @@ -493,7 +633,7 @@ }, "items": { "type": "object", - "description": "[Output Only] A map of scoped address lists.", + "description": "A list of AddressesScopedList resources.", "additionalProperties": { "$ref": "AddressesScopedList", "description": "[Output Only] Name of the scope containing this set of addresses." @@ -511,6 +651,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -521,11 +730,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of addresses.", + "description": "A list of Address resources.", "items": { "$ref": "Address" } @@ -541,7 +750,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -670,7 +948,7 @@ }, "index": { "type": "integer", - "description": "Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.", + "description": "[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.", "format": "int32" }, "initializeParams": { @@ -826,6 +1104,31 @@ } } }, + "AuthorizationLoggingOptions": { + "id": "AuthorizationLoggingOptions", + "type": "object", + "description": "Authorization-related information used by Cloud Audit Logging.", + "properties": { + "permissionType": { + "type": "string", + "description": "The type of the permission that was checked.", + "enum": [ + "ADMIN_READ", + "ADMIN_WRITE", + "DATA_READ", + "DATA_WRITE", + "PERMISSION_TYPE_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, "Autoscaler": { "id": "Autoscaler", "type": "object", @@ -910,11 +1213,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped autoscaler lists.", + "description": "A list of AutoscalersScopedList resources.", "additionalProperties": { "$ref": "AutoscalersScopedList", "description": "[Output Only] Name of the scope containing this set of autoscalers." @@ -932,6 +1235,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -942,7 +1314,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -963,6 +1335,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -988,9 +1429,11 @@ "MISSING_LOAD_BALANCING_DATA_POINTS", "MORE_THAN_ONE_BACKEND_SERVICE", "NOT_ENOUGH_QUOTA_AVAILABLE", + "REGION_RESOURCE_STOCKOUT", "SCALING_TARGET_DOES_NOT_EXIST", "UNKNOWN", - "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION" + "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION", + "ZONE_RESOURCE_STOCKOUT" ], "enumDescriptions": [ "", @@ -1005,6 +1448,8 @@ "", "", "", + "", + "", "" ] } @@ -1127,6 +1572,22 @@ "description": "The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.", "format": "int32" }, + "mode": { + "type": "string", + "description": "Defines operating mode for this policy.", + "enum": [ + "OFF", + "ON", + "ONLY_DOWN", + "ONLY_UP" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, "queueBasedScaling": { "$ref": "AutoscalingPolicyQueueBasedScaling", "description": "Configuration parameters of autoscaling based on queuing system." @@ -1150,10 +1611,19 @@ "type": "object", "description": "Custom utilization metric policy.", "properties": { + "filter": { + "type": "string", + "description": "A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or global data.\n\nFor the filter to be valid for autoscaling purposes, the following rules apply: \n- You can only use the AND operator for joining selectors. \n- You can only use direct equality comparison operator (=) without any functions for each selector. \n- You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. \n- The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.\nIf the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is / called a global metric for the purpose of autoscaling.\n\nIf not specified, the type defaults to gce_instance. \n\nYou should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value." + }, "metric": { "type": "string", "description": "The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric.\n\nThe metric must have a value type of INT64 or DOUBLE." }, + "singleInstanceAssignment": { + "type": "number", + "description": "If scaling is based on a global metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.\n\nA good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.\n\nA bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.", + "format": "double" + }, "utilizationTarget": { "type": "number", "description": "The target value of the metric that autoscaler should maintain. This must be a positive value.\n\nFor example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.", @@ -1230,7 +1700,7 @@ "properties": { "balancingMode": { "type": "string", - "description": "Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).\n\nThis cannot be used for internal load balancing.", + "description": "Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).\n\nFor Internal Load Balancing, the default and only supported mode is CONNECTION.", "enum": [ "CONNECTION", "RATE", @@ -1257,13 +1727,18 @@ }, "group": { "type": "string", - "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL.\n\nWhen the BackendService has load balancing scheme INTERNAL, the instance group must be in a zone within the same region as the BackendService." + "description": "The fully-qualified URL of a Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL.\n\nWhen the BackendService has load balancing scheme INTERNAL, the instance group must be within the same region as the BackendService." }, "maxConnections": { "type": "integer", "description": "The max number of simultaneous connections for the group. Can be used with either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set.\n\nThis cannot be used for internal load balancing.", "format": "int32" }, + "maxConnectionsPerEndpoint": { + "type": "integer", + "description": "The max number of simultaneous connections that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must be set.\n\nThis cannot be used for internal load balancing.", + "format": "int32" + }, "maxConnectionsPerInstance": { "type": "integer", "description": "The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set.\n\nThis cannot be used for internal load balancing.", @@ -1274,6 +1749,11 @@ "description": "The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set.\n\nThis cannot be used for internal load balancing.", "format": "int32" }, + "maxRatePerEndpoint": { + "type": "number", + "description": "The max requests per second (RPS) that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerEndpoint must be set.\n\nThis cannot be used for internal load balancing.", + "format": "float" + }, "maxRatePerInstance": { "type": "number", "description": "The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.\n\nThis cannot be used for internal load balancing.", @@ -1374,11 +1854,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -1392,6 +1941,10 @@ "description": "Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value for TTL is one day.\n\nWhen the load balancing scheme is INTERNAL, this field is not used.", "format": "int32" }, + "appEngineBackend": { + "$ref": "BackendServiceAppEngineBackend", + "description": "Directs request to an App Engine app. cloudFunctionBackend and backends[] must be empty if this is set." + }, "backends": { "type": "array", "description": "The list of backends that serve this BackendService.", @@ -1403,6 +1956,10 @@ "$ref": "BackendServiceCdnPolicy", "description": "Cloud CDN configuration for this BackendService." }, + "cloudFunctionBackend": { + "$ref": "BackendServiceCloudFunctionBackend", + "description": "Directs request to a cloud function. appEngineBackend and backends[] must be empty if this is set." + }, "connectionDraining": { "$ref": "ConnectionDraining" }, @@ -1425,10 +1982,8 @@ "type": "boolean", "description": "If true, enable Cloud CDN for this BackendService.\n\nWhen the load balancing scheme is INTERNAL, this field is not used." }, - "failoverRatio": { - "type": "number", - "description": "The value of the field must be in [0, 1]. If set, 'backends[].failover' must be set. They together define the fallback behavior of the primary backend: if the ratio of the healthy VMs in the primary backend is at or below this number, traffic arriving at the load-balanced IP will be directed to the failover backend.\n\nIn case where 'failoverRatio' is not set or all the VMs in the backup backend are unhealthy, the traffic will be directed back to the primary backend in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy.\n\nThis field is only used with l4 load balancing.", - "format": "float" + "failoverPolicy": { + "$ref": "BackendServiceFailoverPolicy" }, "fingerprint": { "type": "string", @@ -1437,7 +1992,7 @@ }, "healthChecks": { "type": "array", - "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required.\n\nFor internal load balancing, a URL to a HealthCheck resource must be specified instead.", + "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required for Compute Engine backend services. A health check must not be specified for App Engine backend and Cloud Function backend.\n\nFor internal load balancing, a URL to a HealthCheck resource must be specified instead.", "items": { "type": "string" } @@ -1457,6 +2012,7 @@ }, "loadBalancingScheme": { "type": "string", + "description": "Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other. Possible values are INTERNAL and EXTERNAL.", "enum": [ "EXTERNAL", "INTERNAL", @@ -1550,7 +2106,7 @@ }, "items": { "type": "object", - "description": "A map of scoped BackendService lists.", + "description": "A list of BackendServicesScopedList resources.", "additionalProperties": { "$ref": "BackendServicesScopedList", "description": "Name of the scope containing this set of BackendServices." @@ -1563,11 +2119,99 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "BackendServiceAppEngineBackend": { + "id": "BackendServiceAppEngineBackend", + "type": "object", + "description": "Configuration of a App Engine backend.", + "properties": { + "appEngineService": { + "type": "string", + "description": "Optional. App Engine app service name." + }, + "targetProject": { + "type": "string", + "description": "Required. Project ID of the project hosting the app. This is the project ID of this project. Reference to another project is not allowed." + }, + "version": { + "type": "string", + "description": "Optional. Version of App Engine app service. When empty, App Engine will do its normal traffic split." } } }, @@ -1594,6 +2238,40 @@ } } }, + "BackendServiceCloudFunctionBackend": { + "id": "BackendServiceCloudFunctionBackend", + "type": "object", + "description": "Configuration of a Cloud Function backend.", + "properties": { + "functionName": { + "type": "string", + "description": "Required. A cloud function name. Special value ?*? represents all cloud functions in the project." + }, + "targetProject": { + "type": "string", + "description": "Required. Project ID of the project hosting the cloud function." + } + } + }, + "BackendServiceFailoverPolicy": { + "id": "BackendServiceFailoverPolicy", + "type": "object", + "properties": { + "disableConnectionDrainOnFailover": { + "type": "boolean", + "description": "On failover or failback, this field indicates whether connection drain will be honored. Setting this to true has the following effect: connections to the old active pool are not drained. Connections to the new active pool use the timeout of 10 min (currently fixed). Setting to false has the following effect: both old and new connections will have a drain timeout of 10 min.\n\nThis can be set to true only if the protocol is TCP.\n\nThe default is false." + }, + "dropTrafficIfUnhealthy": { + "type": "boolean", + "description": "This option is used only when no healthy VMs are detected in the primary and backup instance groups. When set to true, traffic is dropped. When set to false, new connections are sent across all VMs in the primary group.\n\nThe default is false." + }, + "failoverRatio": { + "type": "number", + "description": "The value of the field must be in [0, 1]. If the ratio of the healthy VMs in the primary backend is at or below this number, traffic arriving at the load-balanced IP will be directed to the failover backend.\n\nIn case where 'failoverRatio' is not set or all the VMs in the backup backend are unhealthy, the traffic will be directed back to the primary backend in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy.\n\nThis field is only used with l4 load balancing.", + "format": "float" + } + } + }, "BackendServiceGroupHealth": { "id": "BackendServiceGroupHealth", "type": "object", @@ -1659,6 +2337,84 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "BackendServiceReference": { + "id": "BackendServiceReference", + "type": "object", + "properties": { + "backendService": { + "type": "string" } } }, @@ -1749,9 +2505,13 @@ "type": "object", "description": "Associates `members` with a `role`.", "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. This field is GOOGLE_INTERNAL." + }, "members": { "type": "array", - "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", "items": { "type": "string" } @@ -1811,7 +2571,7 @@ "Commitment": { "id": "Commitment", "type": "object", - "description": "A usage-commitment with a start / end time. Users create commitments for particular resources (e.g. memory). Actual usage is first deducted from available commitments made prior, perhaps at a reduced price (as laid out in the commitment).", + "description": "Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts.\n\nCommitted use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts.", "properties": { "creationTimestamp": { "type": "string", @@ -1875,7 +2635,7 @@ }, "status": { "type": "string", - "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end-date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", + "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", "enum": [ "ACTIVE", "CREATING", @@ -1901,11 +2661,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "Commitments by scope.", + "description": "A list of CommitmentsScopedList resources.", "additionalProperties": { "$ref": "CommitmentsScopedList", "description": "[Output Only] Name of the scope containing this set of commitments." @@ -1923,6 +2683,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -1933,7 +2762,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -1954,6 +2783,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2252,6 +3150,14 @@ "type": "string", "description": "[Output Only] Last detach timestamp in RFC3339 text format." }, + "licenseCodes": { + "type": "array", + "description": "Integer license codes indicating which licenses are attached to this disk.", + "items": { + "type": "string", + "format": "int64" + } + }, "licenses": { "type": "array", "description": "Any applicable publicly visible licenses.", @@ -2273,6 +3179,11 @@ "type": "string", "description": "Internal use only." }, + "physicalBlockSizeBytes": { + "type": "string", + "description": "Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Initially only 4096 is supported, but other powers of two may be added. If an unsupported value is requested, the error message will list the supported values, but even a supported value may be allowed for only some projects.", + "format": "int64" + }, "region": { "type": "string", "description": "[Output Only] URL of the region where the disk resides. Only applicable for regional resources." @@ -2290,7 +3201,7 @@ }, "sizeGb": { "type": "string", - "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.", + "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.", "format": "int64" }, "sourceImage": { @@ -2368,11 +3279,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped disk lists.", + "description": "A list of DisksScopedList resources.", "additionalProperties": { "$ref": "DisksScopedList", "description": "[Output Only] Name of the scope containing this set of disks." @@ -2385,11 +3296,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. Acceptable values are 0 to 500, inclusive. (Default: 500)" + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2416,11 +3396,80 @@ }, "nextPageToken": { "type": "string", - "description": "This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2495,11 +3544,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped disk type lists.", + "description": "A list of DiskTypesScopedList resources.", "additionalProperties": { "$ref": "DiskTypesScopedList", "description": "[Output Only] Name of the scope containing this set of disk types." @@ -2517,6 +3566,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2527,11 +3645,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Disk Type resources.", + "description": "A list of DiskType resources.", "items": { "$ref": "DiskType" } @@ -2548,6 +3666,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2744,7 +3931,36 @@ "properties": { "zone": { "type": "string", - "description": "URL of the zone where managed instance group is spawning instances (for regional resources). Zone has to belong to the region where managed instance group is located." + "description": "URL of the zone where managed instance group is spawning instances (for regional resources). Zone has to belong to the region where managed instance group is located.", + "annotations": { + "required": [ + "compute.regionInstanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.update" + ] + } + } + } + }, + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example:\n\ntitle: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax.\n\nThe application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." } } }, @@ -2761,7 +3977,7 @@ "properties": { "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number." + "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number." }, "ports": { "type": "array", @@ -2785,7 +4001,7 @@ "properties": { "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number." + "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number." }, "ports": { "type": "array", @@ -2820,6 +4036,10 @@ "" ] }, + "enableLogging": { + "type": "boolean", + "description": "This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to the configured export destination for all firewall logs in the network. Logs may be exported to BigQuery or Pub/Sub." + }, "id": { "type": "string", "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", @@ -2870,7 +4090,7 @@ }, "sourceTags": { "type": "array", - "description": "If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.", + "description": "If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.", "items": { "type": "string" } @@ -2898,11 +4118,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Firewall resources.", + "description": "A list of Firewall resources.", "items": { "$ref": "Firewall" } @@ -2919,6 +4139,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2951,7 +4240,7 @@ "properties": { "IPAddress": { "type": "string", - "description": "The IP address that this forwarding rule is serving on behalf of.\n\nFor global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IP from the same scope (global or regional) will be assigned.\n\nWhen the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the subnetwork or network configured for this forwarding rule. Only IPv4 is supported." + "description": "The IP address that this forwarding rule is serving on behalf of.\n\nFor global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6.\n\nWhen the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the subnetwork or network configured for this forwarding rule." }, "IPProtocol": { "type": "string", @@ -2985,6 +4274,11 @@ "type": "string", "description": "An optional description of this resource. Provide this property when you create the resource." }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ForwardingRule. Include the fingerprint in patch request to ensure that you do not overwrite changes that were applied from another concurrent request.\n\nTo see the latest fingerprint, make a get() request to retrieve a ForwardingRule.", + "format": "byte" + }, "id": { "type": "string", "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", @@ -3046,7 +4340,7 @@ }, "networkTier": { "type": "string", - "description": "This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM , SELECT. If this field is not specified, it is assumed to be PREMIUM.", + "description": "This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM , STANDARD.\n\nFor regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.\n\nIf this field is not specified, it is assumed to be PREMIUM. If IPAddress is specified, this value must be equal to the networkTier of the Address.", "enum": [ "PREMIUM", "SELECT", @@ -3060,7 +4354,7 @@ }, "portRange": { "type": "string", - "description": "This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance.\n\nApplicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges.\n\nSome types of forwarding target have constraints on the acceptable ports: \n- TargetHttpProxy: 80, 8080 \n- TargetHttpsProxy: 443 \n- TargetSslProxy: 443 \n- TargetVpnGateway: 500, 4500\n-" + "description": "This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance.\n\nApplicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges.\n\nSome types of forwarding target have constraints on the acceptable ports: \n- TargetHttpProxy: 80, 8080 \n- TargetHttpsProxy: 443 \n- TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 \n- TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 \n- TargetVpnGateway: 500, 4500\n-" }, "ports": { "type": "array", @@ -3102,11 +4396,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped forwarding rule lists.", + "description": "A list of ForwardingRulesScopedList resources.", "additionalProperties": { "$ref": "ForwardingRulesScopedList", "description": "Name of the scope containing this set of addresses." @@ -3124,6 +4418,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3134,7 +4497,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Set by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3155,6 +4518,84 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "ForwardingRuleReference": { + "id": "ForwardingRuleReference", + "type": "object", + "properties": { + "forwardingRule": { + "type": "string" } } }, @@ -3258,6 +4699,30 @@ } } }, + "GuestAttributes": { + "id": "GuestAttributes", + "type": "object", + "description": "A guest attributes entry.", + "properties": { + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry.", + "default": "compute#guestAttributes" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "variableKey": { + "type": "string", + "description": "The key to search for." + }, + "variableValue": { + "type": "string", + "description": "[Output Only] The value found for the requested key." + } + } + }, "GuestOsFeature": { "id": "GuestOsFeature", "type": "object", @@ -3265,7 +4730,7 @@ "properties": { "type": { "type": "string", - "description": "The type of supported feature. Currenty only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image. This value is purely informational and does not enable or disable any features.", + "description": "The type of supported feature. Currently only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", "enum": [ "FEATURE_TYPE_UNSPECIFIED", "MULTI_IP_SUBNET", @@ -3298,6 +4763,20 @@ "type": "string", "description": "Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence." }, + "portSpecification": { + "type": "string", + "description": "Specifies how port is selected for health checking, can be one of following values:\nUSE_FIXED_PORT: The port number in\nport\nis used for health checking.\nUSE_NAMED_PORT: The\nportName\nis used for health checking.\nUSE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking.\n\n\nIf not specified, HTTP2 health check follows behavior specified in\nport\nand\nportName\nfields.", + "enum": [ + "USE_FIXED_PORT", + "USE_NAMED_PORT", + "USE_SERVING_PORT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "proxyHeader": { "type": "string", "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.", @@ -3337,6 +4816,20 @@ "type": "string", "description": "Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence." }, + "portSpecification": { + "type": "string", + "description": "Specifies how port is selected for health checking, can be one of following values:\nUSE_FIXED_PORT: The port number in\nport\nis used for health checking.\nUSE_NAMED_PORT: The\nportName\nis used for health checking.\nUSE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking.\n\n\nIf not specified, HTTP health check follows behavior specified in\nport\nand\nportName\nfields.", + "enum": [ + "USE_FIXED_PORT", + "USE_NAMED_PORT", + "USE_SERVING_PORT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "proxyHeader": { "type": "string", "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.", @@ -3376,6 +4869,20 @@ "type": "string", "description": "Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence." }, + "portSpecification": { + "type": "string", + "description": "Specifies how port is selected for health checking, can be one of following values:\nUSE_FIXED_PORT: The port number in\nport\nis used for health checking.\nUSE_NAMED_PORT: The\nportName\nis used for health checking.\nUSE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking.\n\n\nIf not specified, HTTPS health check follows behavior specified in\nport\nand\nportName\nfields.", + "enum": [ + "USE_FIXED_PORT", + "USE_NAMED_PORT", + "USE_SERVING_PORT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "proxyHeader": { "type": "string", "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.", @@ -3499,7 +5006,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3520,6 +5027,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3564,6 +5140,40 @@ } } }, + "HealthStatusForNetworkEndpoint": { + "id": "HealthStatusForNetworkEndpoint", + "type": "object", + "properties": { + "backendService": { + "$ref": "BackendServiceReference", + "description": "URL of the backend service associated with the health state of the network endpoint." + }, + "forwardingRule": { + "$ref": "ForwardingRuleReference", + "description": "URL of the forwarding rule associated with the health state of the network endpoint." + }, + "healthCheck": { + "$ref": "HealthCheckReference", + "description": "URL of the health check associated with the health state of the network endpoint." + }, + "healthState": { + "type": "string", + "description": "Health state of the network endpoint determined based on the health checks configured.", + "enum": [ + "DRAINING", + "HEALTHY", + "UNHEALTHY", + "UNKNOWN" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, "Host": { "id": "Host", "type": "object", @@ -3651,11 +5261,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped host lists.", + "description": "A list of HostsScopedList resources.", "additionalProperties": { "$ref": "HostsScopedList", "description": "[Output Only] Name of the scope containing this set of hosts." @@ -3672,7 +5282,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3683,11 +5362,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Host resources.", + "description": "A list of Host resources.", "items": { "$ref": "Host" } @@ -3703,7 +5382,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3796,11 +5544,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped host type lists.", + "description": "A list of HostTypesScopedList resources.", "additionalProperties": { "$ref": "HostTypesScopedList", "description": "[Output Only] Name of the scope containing this set of host types." @@ -3817,7 +5565,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3828,11 +5645,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Host Type resources.", + "description": "A list of HostType resources.", "items": { "$ref": "HostType" } @@ -3848,7 +5665,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4090,7 +5976,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -4111,6 +5997,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4209,6 +6164,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4245,7 +6269,7 @@ }, "guestOsFeatures": { "type": "array", - "description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor new Windows images, the server might also populate this field with the value WINDOWS, to indicate that this is a Windows image. This value is purely informational and does not enable or disable any features.", + "description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", "items": { "$ref": "GuestOsFeature" } @@ -4276,6 +6300,14 @@ "type": "string" } }, + "licenseCodes": { + "type": "array", + "description": "Integer license codes indicating which licenses are attached to this image.", + "items": { + "type": "string", + "format": "int64" + } + }, "licenses": { "type": "array", "description": "Any applicable license URI.", @@ -4385,11 +6417,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Image resources.", + "description": "A list of Image resources.", "items": { "$ref": "Image" } @@ -4406,6 +6438,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4426,6 +6527,10 @@ "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." }, + "deletionProtection": { + "type": "boolean", + "description": "Whether the resource should be protected against deletion." + }, "description": { "type": "string", "description": "An optional description of this resource. Provide this property when you create the resource." @@ -4446,7 +6551,7 @@ }, "host": { "type": "string", - "description": "Full or partial URL of the host resource that the instance should be placed on, in the format: zones/zone/hosts/host.\n\nOptional, Private Host (physical machine) that the instance will be placed on when it's created. The instance is guaranteed to be placed on the same machine as other instances with the same private host.\n\nThe request will be rejected if the private host has run out of resources." + "description": "Full or partial URL of the host resource that the instance should be placed on, in the format: zones/zone/hosts/host.\n\nOptional, sole-tenant Host (physical machine) that the instance will be placed on when it's created. The instance is guaranteed to be placed on the same machine as other instances with the same sole-tenant host.\n\nThe request will be rejected if the sole-tenant host has run out of resources." }, "id": { "type": "string", @@ -4489,7 +6594,7 @@ }, "minCpuPlatform": { "type": "string", - "description": "Minimum cpu/platform to be used by this instance. We may schedule on the specified or later cpu/platform." + "description": "Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: \"Intel Haswell\" or minCpuPlatform: \"Intel Sandy Bridge\"." }, "name": { "type": "string", @@ -4503,7 +6608,7 @@ }, "networkInterfaces": { "type": "array", - "description": "An 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. Only one interface is supported per instance.", + "description": "An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance.", "items": { "$ref": "NetworkInterface" } @@ -4529,7 +6634,7 @@ }, "status": { "type": "string", - "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.", + "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED.", "enum": [ "PROVISIONING", "RUNNING", @@ -4571,11 +6676,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped instance lists.", + "description": "A list of InstancesScopedList resources.", "additionalProperties": { "$ref": "InstancesScopedList", "description": "[Output Only] Name of the scope containing this set of instances." @@ -4593,6 +6698,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4673,11 +6847,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped instance group lists.", + "description": "A list of InstanceGroupsScopedList resources.", "additionalProperties": { "$ref": "InstanceGroupsScopedList", "description": "The name of the scope that contains this set of instance groups." @@ -4694,7 +6868,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4705,11 +6948,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of instance groups.", + "description": "A list of InstanceGroup resources.", "items": { "$ref": "InstanceGroup" } @@ -4725,7 +6968,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4734,6 +7046,9 @@ "type": "object", "description": "An Instance Group Manager resource.", "properties": { + "activities": { + "$ref": "InstanceGroupManagerActivities" + }, "autoHealingPolicies": { "type": "array", "description": "The autohealing policy for this managed instance group. You can specify only one value.", @@ -4808,7 +7123,8 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ - "compute.instanceGroupManagers.insert" + "compute.instanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.insert" ] } }, @@ -4833,7 +7149,7 @@ }, "serviceAccount": { "type": "string", - "description": "Service account will be used as credentials for all operations performed by managed instance group on instances. The service accounts needs all permissions required to create and delete instances. When not specified, the service account {projectNumber}@cloudservices.gserviceaccount.com will be used." + "description": "[Output Only] The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used." }, "statefulPolicy": { "$ref": "InstanceGroupManagerStatefulPolicy", @@ -4852,7 +7168,8 @@ "format": "int32", "annotations": { "required": [ - "compute.instanceGroupManagers.insert" + "compute.instanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.insert" ] } }, @@ -4924,17 +7241,100 @@ } } }, + "InstanceGroupManagerActivities": { + "id": "InstanceGroupManagerActivities", + "type": "object", + "properties": { + "autohealing": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "autohealingHealthCheckBased": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "autoscalingDown": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "autoscalingUp": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "creatingInstances": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "deletingInstances": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "recreatingInstances": { + "type": "string", + "enum": [ + "PERMITTED", + "PROHIBITED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, "InstanceGroupManagerAggregatedList": { "id": "InstanceGroupManagerAggregatedList", "type": "object", "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of filtered managed instance group lists.", + "description": "A list of InstanceGroupManagersScopedList resources.", "additionalProperties": { "$ref": "InstanceGroupManagersScopedList", "description": "[Output Only] The name of the scope that contains this set of managed instance groups." @@ -4951,7 +7351,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4981,11 +7450,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of managed instance groups.", + "description": "A list of InstanceGroupManager resources.", "items": { "$ref": "InstanceGroupManager" } @@ -5002,6 +7471,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5075,10 +7613,14 @@ "type": "string", "description": "Minimal action to be taken on an instance. The order of action types is: RESTART \u003c REPLACE.", "enum": [ + "NONE", + "REFRESH", "REPLACE", "RESTART" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -5130,6 +7672,52 @@ } } }, + "InstanceGroupManagersApplyUpdatesRequest": { + "id": "InstanceGroupManagersApplyUpdatesRequest", + "type": "object", + "description": "InstanceGroupManagers.applyUpdatesToInstances", + "properties": { + "instances": { + "type": "array", + "description": "The list of URLs of one or more instances for which we want to apply updates on this managed instance group. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + } + }, + "maximalAction": { + "type": "string", + "description": "The maximal action that should be perfomed on the instances. By default REPLACE.", + "enum": [ + "NONE", + "REFRESH", + "REPLACE", + "RESTART" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "minimalAction": { + "type": "string", + "description": "The minimal action that should be perfomed on the instances. By default NONE.", + "enum": [ + "NONE", + "REFRESH", + "REPLACE", + "RESTART" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, "InstanceGroupManagersDeleteInstancesRequest": { "id": "InstanceGroupManagersDeleteInstancesRequest", "type": "object", @@ -5143,6 +7731,20 @@ } } }, + "InstanceGroupManagersDeletePerInstanceConfigsReq": { + "id": "InstanceGroupManagersDeletePerInstanceConfigsReq", + "type": "object", + "description": "InstanceGroupManagers.deletePerInstanceConfigs", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances for which we want to delete per-instance configs on this managed instance group.", + "items": { + "type": "string" + } + } + } + }, "InstanceGroupManagersListManagedInstancesResponse": { "id": "InstanceGroupManagersListManagedInstancesResponse", "type": "object", @@ -5160,6 +7762,92 @@ } } }, + "InstanceGroupManagersListPerInstanceConfigsResp": { + "id": "InstanceGroupManagersListPerInstanceConfigsResp", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "[Output Only] The list of PerInstanceConfig.", + "items": { + "$ref": "PerInstanceConfig" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "InstanceGroupManagersRecreateInstancesRequest": { "id": "InstanceGroupManagersRecreateInstancesRequest", "type": "object", @@ -5310,6 +7998,20 @@ } } }, + "InstanceGroupManagersUpdatePerInstanceConfigsReq": { + "id": "InstanceGroupManagersUpdatePerInstanceConfigsReq", + "type": "object", + "description": "InstanceGroupManagers.updatePerInstanceConfigs", + "properties": { + "perInstanceConfigs": { + "type": "array", + "description": "The list of per-instance configs to insert or patch on this managed instance group.", + "items": { + "$ref": "PerInstanceConfig" + } + } + } + }, "InstanceGroupsAddInstancesRequest": { "id": "InstanceGroupsAddInstancesRequest", "type": "object", @@ -5329,11 +8031,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this list of instances in the specified instance group. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of instances and any named ports that are assigned to those instances.", + "description": "A list of InstanceWithNamedPorts resources.", "items": { "$ref": "InstanceWithNamedPorts" } @@ -5349,7 +8051,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this list of instances in the specified instance groups. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5491,11 +8262,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of instances.", + "description": "A list of Instance resources.", "items": { "$ref": "Instance" } @@ -5512,6 +8283,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5522,11 +8362,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of referrers.", + "description": "A list of Reference resources.", "items": { "$ref": "Reference" } @@ -5543,6 +8383,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5567,7 +8476,7 @@ "properties": { "canIpForward": { "type": "boolean", - "description": "Enables 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, specify true. If unsure, leave this set to false. See the Enable IP forwarding for instances documentation for more information." + "description": "Enables 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, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information." }, "description": { "type": "string", @@ -5609,7 +8518,7 @@ }, "minCpuPlatform": { "type": "string", - "description": "Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or later cpu/platform." + "description": "Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: \"Intel Haswell\" or minCpuPlatform: \"Intel Sandy Bridge\". For more information, read Specifying a Minimum CPU Platform." }, "networkInterfaces": { "type": "array", @@ -5699,11 +8608,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] list of InstanceTemplate resources.", + "description": "A list of InstanceTemplate resources.", "items": { "$ref": "InstanceTemplate" } @@ -5719,7 +8628,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this instance template list. The server defines this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5933,12 +8911,19 @@ "Interconnect": { "id": "Interconnect", "type": "object", - "description": "Protocol definitions for Mixer API to support Interconnect. Next available tag: 20", + "description": "Protocol definitions for Mixer API to support Interconnect. Next available tag: 23", "properties": { "adminEnabled": { "type": "boolean", "description": "Administrative status of the interconnect. When this is set to ?true?, the Interconnect is functional and may carry traffic (assuming there are functional InterconnectAttachments and other requirements are satisfied). When set to ?false?, no packets will be carried over this Interconnect and no BGP routes will be exchanged over it. By default, it is set to ?true?." }, + "circuitInfos": { + "type": "array", + "description": "[Output Only] List of CircuitInfo objects, that describe the individual circuits in this LAG.", + "items": { + "$ref": "InterconnectCircuitInfo" + } + }, "connectionAuthorization": { "type": "string", "description": "[Output Only] URL to retrieve the Letter Of Authority and Customer Facility Assignment (LOA-CFA) documentation relating to this Interconnect. This documentation authorizes the facility provider to connect to the specified crossconnect ports." @@ -5947,10 +8932,21 @@ "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." }, + "customerName": { + "type": "string", + "description": "Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect." + }, "description": { "type": "string", "description": "An optional description of this resource. Provide this property when you create the resource." }, + "expectedOutages": { + "type": "array", + "description": "[Output Only] List of outages expected for this Interconnect.", + "items": { + "$ref": "InterconnectOutageNotification" + } + }, "googleIpAddress": { "type": "string", "description": "[Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests." @@ -5974,9 +8970,11 @@ "interconnectType": { "type": "string", "enum": [ + "IT_PARTNER", "IT_PRIVATE" ], "enumDescriptions": [ + "", "" ] }, @@ -6017,11 +9015,9 @@ "description": "[Output Only] The current status of whether or not this Interconnect is functional.", "enum": [ "OS_ACTIVE", - "OS_UNPROVISIONED", - "OS_UNSPECIFIED" + "OS_UNPROVISIONED" ], "enumDescriptions": [ - "", "", "" ] @@ -6049,7 +9045,7 @@ "InterconnectAttachment": { "id": "InterconnectAttachment", "type": "object", - "description": "Protocol definitions for Mixer API to support InterconnectAttachment. Next available tag: 14", + "description": "Protocol definitions for Mixer API to support InterconnectAttachment. Next available tag: 18", "properties": { "cloudRouterIpAddress": { "type": "string", @@ -6126,11 +9122,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped InterconnectAttachment lists.", + "description": "A list of InterconnectAttachmentsScopedList resources.", "additionalProperties": { "$ref": "InterconnectAttachmentsScopedList", "description": "Name of the scope containing this set of interconnect attachments." @@ -6148,6 +9144,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6158,11 +9223,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of InterconnectAttachment resources.", + "description": "A list of InterconnectAttachment resources.", "items": { "$ref": "InterconnectAttachment" } @@ -6179,6 +9244,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6276,6 +9410,25 @@ } } }, + "InterconnectCircuitInfo": { + "id": "InterconnectCircuitInfo", + "type": "object", + "description": "Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only. Next id: 4", + "properties": { + "customerDemarcId": { + "type": "string", + "description": "Customer-side demarc ID for this circuit. This will only be set if it was provided by the Customer to Google during circuit turn-up." + }, + "googleCircuitId": { + "type": "string", + "description": "Google-assigned unique ID for this circuit. Assigned at circuit turn-up." + }, + "googleDemarcId": { + "type": "string", + "description": "Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA." + } + } + }, "InterconnectList": { "id": "InterconnectList", "type": "object", @@ -6283,11 +9436,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Interconnect resources.", + "description": "A list of Interconnect resources.", "items": { "$ref": "Interconnect" } @@ -6304,6 +9457,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6316,6 +9538,32 @@ "type": "string", "description": "[Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character." }, + "availabilityZone": { + "type": "string", + "description": "Availability zone for this location. Within a city, maintenance will not be simultaneously scheduled in more than one availability zone. Example: \"zone1\" or \"zone2\"." + }, + "city": { + "type": "string", + "description": "City designator used by the Interconnect UI to locate this InterconnectLocation within the Continent. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\"." + }, + "continent": { + "type": "string", + "description": "Continent for this location. Used by the location picker in the Interconnect UI.", + "enum": [ + "C_AFRICA", + "C_ASIA_PAC", + "C_EUROPE", + "C_NORTH_AMERICA", + "C_SOUTH_AMERICA" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, "creationTimestamp": { "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." @@ -6370,11 +9618,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of InterconnectLocation resources.", + "description": "A list of InterconnectLocation resources.", "items": { "$ref": "InterconnectLocation" } @@ -6391,6 +9639,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6416,12 +9733,199 @@ "" ] }, + "region": { + "type": "string", + "description": "URL for the region of this location." + }, "regionKey": { "type": "string", "description": "Scope key for the region of this location." } } }, + "InterconnectOutageNotification": { + "id": "InterconnectOutageNotification", + "type": "object", + "description": "Description of a planned outage on this Interconnect. Next id: 9", + "properties": { + "affectedCircuits": { + "type": "array", + "description": "Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected.", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "description": "Short user-visible description of the purpose of the outage." + }, + "endTime": { + "type": "string", + "format": "int64" + }, + "issueType": { + "type": "string", + "enum": [ + "IT_OUTAGE", + "IT_PARTIAL_OUTAGE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Unique identifier for this outage notification." + }, + "source": { + "type": "string", + "enum": [ + "NSRC_GOOGLE" + ], + "enumDescriptions": [ + "" + ] + }, + "startTime": { + "type": "string", + "description": "Scheduled start and end times for the outage (milliseconds since Unix epoch).", + "format": "int64" + }, + "state": { + "type": "string", + "enum": [ + "NS_ACTIVE", + "NS_CANCELED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "InternalIpOwner": { + "id": "InternalIpOwner", + "type": "object", + "properties": { + "ipCidrRange": { + "type": "string", + "description": "IP CIDR range being owned." + }, + "owners": { + "type": "array", + "description": "URLs of the IP owners of the IP CIDR range.", + "items": { + "type": "string" + } + }, + "systemOwned": { + "type": "boolean", + "description": "Whether this IP CIDR range is reserved for system use." + } + } + }, + "IpOwnerList": { + "id": "IpOwnerList", + "type": "object", + "description": "Contains a list of IP owners.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of InternalIpOwner resources.", + "items": { + "$ref": "InternalIpOwner" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#ipOwnerList for lists of IP owners.", + "default": "compute#ipOwnerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "License": { "id": "License", "type": "object", @@ -6429,7 +9933,7 @@ "properties": { "chargesUseFee": { "type": "boolean", - "description": "[Output Only] If true, the customer will be charged license fee for running software that contains this license on an instance." + "description": "[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee." }, "creationTimestamp": { "type": "string", @@ -6477,6 +9981,87 @@ } } }, + "LicenseCode": { + "id": "LicenseCode", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "[Output Only] Description of this License Code." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#licenseCode for licenses.", + "default": "compute#licenseCode" + }, + "licenseAlias": { + "type": "array", + "description": "[Output Only] URL and description aliases of Licenses with the same License Code.", + "items": { + "$ref": "LicenseCodeLicenseAlias" + } + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.", + "pattern": "[0-9]{0,20}?", + "annotations": { + "required": [ + "compute.licenses.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "state": { + "type": "string", + "description": "[Output Only] Current state of this License Code.", + "enum": [ + "DISABLED", + "ENABLED", + "RESTRICTED", + "STATE_UNSPECIFIED", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "transferable": { + "type": "boolean", + "description": "[Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred." + } + } + }, + "LicenseCodeLicenseAlias": { + "id": "LicenseCodeLicenseAlias", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "[Output Only] Description of this License Code." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] URL of license corresponding to this License Code." + } + } + }, "LicenseResourceRequirements": { "id": "LicenseResourceRequirements", "type": "object", @@ -6499,11 +10084,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of License resources.", + "description": "A list of License resources.", "items": { "$ref": "License" } @@ -6515,6 +10100,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6523,16 +10177,49 @@ "type": "object", "description": "Specifies what kind of log the caller must write", "properties": { + "cloudAudit": { + "$ref": "LogConfigCloudAuditOptions", + "description": "Cloud audit options." + }, "counter": { "$ref": "LogConfigCounterOptions", "description": "Counter options." + }, + "dataAccess": { + "$ref": "LogConfigDataAccessOptions", + "description": "Data access options." + } + } + }, + "LogConfigCloudAuditOptions": { + "id": "LogConfigCloudAuditOptions", + "type": "object", + "description": "Write a Cloud Audit log", + "properties": { + "authorizationLoggingOptions": { + "$ref": "AuthorizationLoggingOptions", + "description": "Information used by the Cloud Audit Logging pipeline." + }, + "logName": { + "type": "string", + "description": "The log_name to populate in the Cloud Audit Record.", + "enum": [ + "ADMIN_ACTIVITY", + "DATA_ACCESS", + "UNSPECIFIED_LOG_NAME" + ], + "enumDescriptions": [ + "", + "", + "" + ] } } }, "LogConfigCounterOptions": { "id": "LogConfigCounterOptions", "type": "object", - "description": "Options for counters", + "description": "Increment a streamz counter with the specified metric and field names.\n\nMetric 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.\n\nField names correspond to IAM request parameters and field values are their respective values.\n\nAt present the only supported field names are - \"iam_principal\", corresponding to IAMContext.principal; - \"\" (empty string), resulting in one aggretated counter with no field.\n\nExamples: counter { metric: \"/debug_access_count\" field: \"iam_principal\" } ==\u003e increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}\n\nAt 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": { "field": { "type": "string", @@ -6544,6 +10231,25 @@ } } }, + "LogConfigDataAccessOptions": { + "id": "LogConfigDataAccessOptions", + "type": "object", + "description": "Write a Data Access (Gin) log", + "properties": { + "logMode": { + "type": "string", + "description": "Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now.", + "enum": [ + "LOG_FAIL_CLOSED", + "LOG_MODE_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, "MachineType": { "id": "MachineType", "type": "object", @@ -6616,11 +10322,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped machine type lists.", + "description": "A list of MachineTypesScopedList resources.", "additionalProperties": { "$ref": "MachineTypesScopedList", "description": "[Output Only] Name of the scope containing this set of machine types." @@ -6638,6 +10344,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6648,11 +10423,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Machine Type resources.", + "description": "A list of MachineType resources.", "items": { "$ref": "MachineType" } @@ -6669,6 +10444,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6825,6 +10669,10 @@ "$ref": "ManagedInstanceLastAttempt", "description": "[Output Only] Information about the last attempt to create or delete the instance." }, + "override": { + "$ref": "ManagedInstanceOverride", + "description": "[Output Only] Override defined for this instance." + }, "standbyMode": { "type": "string", "description": "[Output Only] Standby mode of the instance. This field is non-empty iff the instance is a standby.", @@ -6878,6 +10726,58 @@ } } }, + "ManagedInstanceOverride": { + "id": "ManagedInstanceOverride", + "type": "object", + "description": "Overrides of stateful properties for a given instance", + "properties": { + "disks": { + "type": "array", + "description": "Disk overrides defined for this instance", + "items": { + "$ref": "ManagedInstanceOverrideDiskOverride" + } + }, + "origin": { + "type": "string", + "description": "[Output Only] Indicates where does the override come from.", + "enum": [ + "AUTO_GENERATED", + "USER_GENERATED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ManagedInstanceOverrideDiskOverride": { + "id": "ManagedInstanceOverrideDiskOverride", + "type": "object", + "properties": { + "deviceName": { + "type": "string", + "description": "The name of the device on the VM" + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.", + "enum": [ + "READ_ONLY", + "READ_WRITE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "source": { + "type": "string", + "description": "The disk that is/will be mounted" + } + } + }, "ManagedInstanceVersion": { "id": "ManagedInstanceVersion", "type": "object", @@ -6921,7 +10821,7 @@ }, "value": { "type": "string", - "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).", "annotations": { "required": [ "compute.instances.insert", @@ -7050,6 +10950,549 @@ } } }, + "NetworkEndpoint": { + "id": "NetworkEndpoint", + "type": "object", + "description": "The network endpoint.", + "properties": { + "instance": { + "type": "string", + "description": "The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group.\n\nThe name must be 1-63 characters long, and comply with RFC1035." + }, + "ipAddress": { + "type": "string", + "description": "Optional IPv4 address of network endpoint. The IP address must belong to a VM in GCE (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used." + }, + "port": { + "type": "integer", + "description": "Optional port number of network endpoint. If not specified and the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the defaultPort for the network endpoint group will be used.", + "format": "int32" + } + } + }, + "NetworkEndpointGroup": { + "id": "NetworkEndpointGroup", + "type": "object", + "description": "Represents a collection of network endpoints.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group.", + "default": "compute#networkEndpointGroup" + }, + "loadBalancer": { + "$ref": "NetworkEndpointGroupLbNetworkEndpointGroup", + "description": "This field is only valid when the network endpoint group type is LOAD_BALANCING." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "networkEndpointType": { + "type": "string", + "description": "Type of network endpoints in this network endpoint group. Only supported values for LOAD_BALANCING are GCE_VM_IP or GCE_VM_IP_PORT.", + "enum": [ + "GCE_VM_IP_PORT" + ], + "enumDescriptions": [ + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "size": { + "type": "integer", + "description": "[Output only] Number of network endpoints in the network endpoint group.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "Specify the type of this network endpoint group. Only LOAD_BALANCING is valid for now.", + "enum": [ + "LOAD_BALANCING" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "NetworkEndpointGroupAggregatedList": { + "id": "NetworkEndpointGroupAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A list of NetworkEndpointGroupsScopedList resources.", + "additionalProperties": { + "$ref": "NetworkEndpointGroupsScopedList", + "description": "The name of the scope that contains this set of network endpoint groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups.", + "default": "compute#networkEndpointGroupAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "NetworkEndpointGroupLbNetworkEndpointGroup": { + "id": "NetworkEndpointGroupLbNetworkEndpointGroup", + "type": "object", + "description": "Load balancing specific fields for network endpoint group of type LOAD_BALANCING.", + "properties": { + "defaultPort": { + "type": "integer", + "description": "The default port used if the port number is not specified in the network endpoint. If the network endpoint type is GCE_VM_IP, this field must not be specified.", + "format": "int32" + }, + "network": { + "type": "string", + "description": "The URL of the network to which all network endpoints in the NEG belong. Uses \"default\" project network if unspecified." + }, + "subnetwork": { + "type": "string", + "description": "Optional URL of the subnetwork to which all network endpoints in the NEG belong." + }, + "zone": { + "type": "string", + "description": "[Output Only] The URL of the zone where the network endpoint group is located." + } + } + }, + "NetworkEndpointGroupList": { + "id": "NetworkEndpointGroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of NetworkEndpointGroup resources.", + "items": { + "$ref": "NetworkEndpointGroup" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#networkEndpointGroupList for network endpoint group lists.", + "default": "compute#networkEndpointGroupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "NetworkEndpointGroupsAttachEndpointsRequest": { + "id": "NetworkEndpointGroupsAttachEndpointsRequest", + "type": "object", + "properties": { + "networkEndpoints": { + "type": "array", + "description": "The list of network endpoints to be attached.", + "items": { + "$ref": "NetworkEndpoint" + } + } + } + }, + "NetworkEndpointGroupsDetachEndpointsRequest": { + "id": "NetworkEndpointGroupsDetachEndpointsRequest", + "type": "object", + "properties": { + "networkEndpoints": { + "type": "array", + "description": "The list of network endpoints to be detached.", + "items": { + "$ref": "NetworkEndpoint" + } + } + } + }, + "NetworkEndpointGroupsListEndpointsRequest": { + "id": "NetworkEndpointGroupsListEndpointsRequest", + "type": "object", + "properties": { + "healthStatus": { + "type": "string", + "description": "Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specifiy this parameter, the health status of network endpoints will not be provided.", + "enum": [ + "SHOW", + "SKIP" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "NetworkEndpointGroupsListNetworkEndpoints": { + "id": "NetworkEndpointGroupsListNetworkEndpoints", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of NetworkEndpointWithHealthStatus resources.", + "items": { + "$ref": "NetworkEndpointWithHealthStatus" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group.", + "default": "compute#networkEndpointGroupsListNetworkEndpoints" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "NetworkEndpointGroupsScopedList": { + "id": "NetworkEndpointGroupsScopedList", + "type": "object", + "properties": { + "networkEndpointGroups": { + "type": "array", + "description": "[Output Only] The list of network endpoint groups that are contained in this scope.", + "items": { + "$ref": "NetworkEndpointGroup" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "NetworkEndpointWithHealthStatus": { + "id": "NetworkEndpointWithHealthStatus", + "type": "object", + "properties": { + "healths": { + "type": "array", + "description": "[Output only] The health status of network endpoint;", + "items": { + "$ref": "HealthStatusForNetworkEndpoint" + } + }, + "networkEndpoint": { + "$ref": "NetworkEndpoint", + "description": "[Output only] The network endpoint;" + } + } + }, "NetworkInterface": { "id": "NetworkInterface", "type": "object", @@ -7104,11 +11547,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Network resources.", + "description": "A list of Network resources.", "items": { "$ref": "Network" } @@ -7125,6 +11568,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7443,6 +11955,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7474,6 +12055,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7603,6 +12253,19 @@ } } }, + "PerInstanceConfig": { + "id": "PerInstanceConfig", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "The URL of the instance. Serves as a merge key during UpdatePerInstanceConfigs operation." + }, + "override": { + "$ref": "ManagedInstanceOverride" + } + } + }, "Policy": { "id": "Policy", "type": "object", @@ -7617,7 +12280,7 @@ }, "bindings": { "type": "array", - "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "description": "Associates a list of `members` to a `role`. `bindings` with no members will result in an error.", "items": { "$ref": "Binding" } @@ -7658,6 +12321,20 @@ "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." }, + "defaultNetworkTier": { + "type": "string", + "description": "This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM.", + "enum": [ + "PREMIUM", + "SELECT", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "defaultServiceAccount": { "type": "string", "description": "[Output Only] Default service account used by VMs running in this project." @@ -7704,7 +12381,7 @@ }, "xpnProjectStatus": { "type": "string", - "description": "[Output Only] The role this project has in a Cross Project Network (XPN) configuration. Currently only HOST projects are differentiated.", + "description": "[Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated.", "enum": [ "HOST", "UNSPECIFIED_XPN_PROJECT_STATUS" @@ -7722,7 +12399,7 @@ "properties": { "xpnResource": { "$ref": "XpnResourceId", - "description": "XPN resource ID." + "description": "Service resource (a.k.a service project) ID." } } }, @@ -7732,7 +12409,7 @@ "properties": { "xpnResource": { "$ref": "XpnResourceId", - "description": "XPN resource ID." + "description": "Service resource (a.k.a service project) ID." } } }, @@ -7742,7 +12419,7 @@ "properties": { "kind": { "type": "string", - "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of XPN resources.", + "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects)", "default": "compute#projectsGetXpnResources" }, "nextPageToken": { @@ -7751,7 +12428,7 @@ }, "resources": { "type": "array", - "description": "XPN resources attached to this project as their XPN host.", + "description": "Service resources (a.k.a service projects) attached to this project as their shared VPC host.", "items": { "$ref": "XpnResourceId" } @@ -7764,7 +12441,27 @@ "properties": { "organization": { "type": "string", - "description": "Optional organization ID managed by Cloud Resource Manager, for which to list XPN host projects. If not specified, the organization will be inferred from the project." + "description": "Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project." + } + } + }, + "ProjectsSetDefaultNetworkTierRequest": { + "id": "ProjectsSetDefaultNetworkTierRequest", + "type": "object", + "properties": { + "networkTier": { + "type": "string", + "description": "Default network tier to be set.", + "enum": [ + "PREMIUM", + "SELECT", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "" + ] } } }, @@ -7792,6 +12489,7 @@ "type": "string", "description": "[Output Only] Name of the quota metric.", "enum": [ + "AMD_S9300_GPUS", "AUTOSCALERS", "BACKEND_BUCKETS", "BACKEND_SERVICES", @@ -7807,15 +12505,20 @@ "INSTANCE_GROUPS", "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", + "INTERCONNECTS", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", "NETWORKS", "NVIDIA_K80_GPUS", + "NVIDIA_P100_GPUS", "PREEMPTIBLE_CPUS", + "PREEMPTIBLE_LOCAL_SSD_GB", "REGIONAL_AUTOSCALERS", "REGIONAL_INSTANCE_GROUP_MANAGERS", "ROUTERS", "ROUTES", + "SECURITY_POLICIES", + "SECURITY_POLICY_RULES", "SNAPSHOTS", "SSD_TOTAL_GB", "SSL_CERTIFICATES", @@ -7869,6 +12572,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7973,11 +12682,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of autoscalers.", + "description": "A list of Autoscaler resources.", "items": { "$ref": "Autoscaler" } @@ -7989,11 +12698,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8003,11 +12781,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Disk Type resources.", + "description": "A list of DiskType resources.", "items": { "$ref": "DiskType" } @@ -8024,6 +12802,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8045,7 +12892,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8065,7 +12912,90 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "RegionInstanceGroupManagerDeleteInstanceConfigReq": { + "id": "RegionInstanceGroupManagerDeleteInstanceConfigReq", + "type": "object", + "description": "RegionInstanceGroupManagers.deletePerInstanceConfigs", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances for which we want to delete per-instance configs on this managed instance group.", + "items": { + "type": "string" + } } } }, @@ -8076,11 +13006,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of managed instance groups.", + "description": "A list of InstanceGroupManager resources.", "items": { "$ref": "InstanceGroupManager" } @@ -8092,11 +13022,94 @@ }, "nextPageToken": { "type": "string", - "description": "[Output only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", - "description": "[Output only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "RegionInstanceGroupManagerUpdateInstanceConfigReq": { + "id": "RegionInstanceGroupManagerUpdateInstanceConfigReq", + "type": "object", + "description": "RegionInstanceGroupManagers.updatePerInstanceConfigs", + "properties": { + "perInstanceConfigs": { + "type": "array", + "description": "The list of per-instance configs to insert or patch on this managed instance group.", + "items": { + "$ref": "PerInstanceConfig" + } } } }, @@ -8113,6 +13126,52 @@ } } }, + "RegionInstanceGroupManagersApplyUpdatesRequest": { + "id": "RegionInstanceGroupManagersApplyUpdatesRequest", + "type": "object", + "description": "InstanceGroupManagers.applyUpdatesToInstances", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances for which we want to apply changes on this managed instance group.", + "items": { + "type": "string" + } + }, + "maximalAction": { + "type": "string", + "description": "The maximal action that should be perfomed on the instances. By default REPLACE.", + "enum": [ + "NONE", + "REFRESH", + "REPLACE", + "RESTART" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "minimalAction": { + "type": "string", + "description": "The minimal action that should be perfomed on the instances. By default NONE.", + "enum": [ + "NONE", + "REFRESH", + "REPLACE", + "RESTART" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, "RegionInstanceGroupManagersDeleteInstancesRequest": { "id": "RegionInstanceGroupManagersDeleteInstancesRequest", "type": "object", @@ -8126,6 +13185,92 @@ } } }, + "RegionInstanceGroupManagersListInstanceConfigsResp": { + "id": "RegionInstanceGroupManagersListInstanceConfigsResp", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "[Output Only] The list of PerInstanceConfig.", + "items": { + "$ref": "PerInstanceConfig" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "RegionInstanceGroupManagersListInstancesResponse": { "id": "RegionInstanceGroupManagersListInstancesResponse", "type": "object", @@ -8202,11 +13347,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of instances and any named ports that are assigned to those instances.", + "description": "A list of InstanceWithNamedPorts resources.", "items": { "$ref": "InstanceWithNamedPorts" } @@ -8222,7 +13367,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8274,11 +13488,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Region resources.", + "description": "A list of Region resources.", "items": { "$ref": "Region" } @@ -8295,6 +13509,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8323,12 +13606,12 @@ "properties": { "amount": { "type": "string", - "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes).", + "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.", "format": "int64" }, "type": { "type": "string", - "description": "Type of resource for which this commitment applies.", + "description": "Type of resource for which this commitment applies. Possible values are VCPU and MEMORY", "enum": [ "LOCAL_SSD", "MEMORY", @@ -8357,7 +13640,7 @@ "Route": { "id": "Route", "type": "object", - "description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.", + "description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.", "properties": { "creationTimestamp": { "type": "string", @@ -8536,11 +13819,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Route resources.", + "description": "A list of Route resources.", "items": { "$ref": "Route" } @@ -8557,6 +13840,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8611,6 +13963,13 @@ ] } }, + "nats": { + "type": "array", + "description": "List of Nat services created in this router. The maximum number of Nat services within a Router is 3 for Alpha.", + "items": { + "$ref": "RouterNat" + } + }, "network": { "type": "string", "description": "URI of the network to which this router belongs.", @@ -8652,11 +14011,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped router lists.", + "description": "A list of Router resources.", "additionalProperties": { "$ref": "RoutersScopedList", "description": "Name of the scope containing this set of routers." @@ -8674,6 +14033,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8815,7 +14243,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8836,6 +14264,169 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "RouterNat": { + "id": "RouterNat", + "type": "object", + "description": "Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided.", + "properties": { + "autoAllocatedNatIps": { + "type": "array", + "description": "[Output Only] List of IPs allocated automatically by GCP for this Nat service. They will be raw IP strings like \"179.12.26.133\". They are ephemeral IPs allocated from the IP blocks managed by the NAT manager. This list can grow and shrink based on the number of VMs configured to use NAT.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "natIpAllocateOption": { + "type": "string", + "description": "Specify the NatIpAllocateOption. If it is AUTO_ONLY, then nat_ip should be empty.", + "enum": [ + "AUTO_ONLY", + "MANUAL_ONLY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "natIps": { + "type": "array", + "description": "List of URLs of the IP resources used for this Nat service. These IPs must be valid static external IP addresses assigned to the project. max_length is subject to change post alpha.", + "items": { + "type": "string" + } + }, + "sourceSubnetworkIpRangesToNat": { + "type": "string", + "description": "Specify the Nat option. If this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region.", + "enum": [ + "ALL_SUBNETWORKS_ALL_IP_RANGES", + "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES", + "LIST_OF_SUBNETWORKS" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "subnetworks": { + "type": "array", + "description": "List of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.", + "items": { + "$ref": "RouterNatSubnetworkToNat" + } + } + } + }, + "RouterNatSubnetworkToNat": { + "id": "RouterNatSubnetworkToNat", + "type": "object", + "description": "Defines the IP ranges that want to use NAT for a subnetwork.", + "properties": { + "name": { + "type": "string", + "description": "URL for the subnetwork resource to use NAT." + }, + "secondaryIpRangeNames": { + "type": "array", + "description": "List of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if \"LIST_OF_SECONDARY_IP_RANGES\" is one of the values in source_ip_ranges_to_nat.", + "items": { + "type": "string" + } + }, + "sourceIpRangesToNats": { + "type": "array", + "description": "Specify the options for NAT ranges in the Subnetwork. All usages of single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: [\"PRIMARY_IP_RANGE\", \"LIST_OF_SECONDARY_IP_RANGES\"] Default: [ALL_IP_RANGES]", + "items": { + "type": "string", + "enum": [ + "ALL_IP_RANGES", + "LIST_OF_SECONDARY_IP_RANGES", + "PRIMARY_IP_RANGE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } } } }, @@ -8863,6 +14454,12 @@ "$ref": "RouterStatusBgpPeerStatus" } }, + "natStatus": { + "type": "array", + "items": { + "$ref": "RouterStatusNatStatus" + } + }, "network": { "type": "string", "description": "URI of the network to which this router belongs." @@ -8929,6 +14526,48 @@ } } }, + "RouterStatusNatStatus": { + "id": "RouterStatusNatStatus", + "type": "object", + "description": "Status of a NAT contained in this router.", + "properties": { + "autoAllocatedNatIps": { + "type": "array", + "description": "List of IPs auto-allocated for NAT. Example: [\"1.1.1.1\", \"129.2.16.89\"]", + "items": { + "type": "string" + } + }, + "minExtraNatIpsNeeded": { + "type": "integer", + "description": "The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Unique name of this NAT." + }, + "numVmEndpointsWithNatMappings": { + "type": "integer", + "description": "Number of VM endpoints (i.e., Nics) that can use NAT.", + "format": "int32" + }, + "userAllocatedNatIpResources": { + "type": "array", + "description": "List of fully qualified URLs of reserved IP address resources.", + "items": { + "type": "string" + } + }, + "userAllocatedNatIps": { + "type": "array", + "description": "List of IPs user-allocated for NAT. They will be raw IP strings like \"179.12.26.133\".", + "items": { + "type": "string" + } + } + } + }, "RouterStatusResponse": { "id": "RouterStatusResponse", "type": "object", @@ -9114,6 +14753,20 @@ "type": "string", "description": "Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence." }, + "portSpecification": { + "type": "string", + "description": "Specifies how port is selected for health checking, can be one of following values:\nUSE_FIXED_PORT: The port number in\nport\nis used for health checking.\nUSE_NAMED_PORT: The\nportName\nis used for health checking.\nUSE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking.\n\n\nIf not specified, SSL health check follows behavior specified in\nport\nand\nportName\nfields.", + "enum": [ + "USE_FIXED_PORT", + "USE_NAMED_PORT", + "USE_SERVING_PORT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "proxyHeader": { "type": "string", "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.", @@ -9163,32 +14816,6 @@ } } }, - "SecurityPoliciesList": { - "id": "SecurityPoliciesList", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." - }, - "items": { - "type": "array", - "description": "[Output Only] A list of SecurityPolicy resources.", - "items": { - "$ref": "SecurityPolicy" - } - }, - "kind": { - "type": "string", - "description": "[Output Only] Type of resource. Always compute#securityPoliciesList for listsof securityPolicies", - "default": "compute#securityPoliciesList" - }, - "nextPageToken": { - "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." - } - } - }, "SecurityPolicy": { "id": "SecurityPolicy", "type": "object", @@ -9235,6 +14862,101 @@ } } }, + "SecurityPolicyList": { + "id": "SecurityPolicyList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of SecurityPolicy resources.", + "items": { + "$ref": "SecurityPolicy" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies", + "default": "compute#securityPolicyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "SecurityPolicyReference": { "id": "SecurityPolicyReference", "type": "object", @@ -9247,7 +14969,7 @@ "SecurityPolicyRule": { "id": "SecurityPolicyRule", "type": "object", - "description": "Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny)", + "description": "Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).", "properties": { "action": { "type": "string", @@ -9259,7 +14981,7 @@ }, "kind": { "type": "string", - "description": "[Output only] Type of the resource. Always compute#rulefor security policies", + "description": "[Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules", "default": "compute#securityPolicyRule" }, "match": { @@ -9272,15 +14994,51 @@ }, "priority": { "type": "integer", - "description": "An integer indicating the priority of a rule in the list. Rules are evaluated in the increasing order of priority.", - "format": "uint32" + "description": "An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated in the increasing order of priority.", + "format": "int32" } } }, "SecurityPolicyRuleMatcher": { "id": "SecurityPolicyRuleMatcher", "type": "object", - "description": "Represents a match condition that incoming traffic is evaluated against. Exactly one of the fields must be set.", + "description": "Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.", + "properties": { + "config": { + "$ref": "SecurityPolicyRuleMatcherConfig", + "description": "The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified." + }, + "srcIpRanges": { + "type": "array", + "description": "CIDR IP address range. Only IPv4 is supported.", + "items": { + "type": "string" + } + }, + "srcRegionCodes": { + "type": "array", + "description": "Match by country or region code.", + "items": { + "type": "string" + } + }, + "versionedExpr": { + "type": "string", + "description": "Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config.", + "enum": [ + "SRC_IPS_V1", + "VERSIONED_EXPR_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "SecurityPolicyRuleMatcherConfig": { + "id": "SecurityPolicyRuleMatcherConfig", + "type": "object", "properties": { "srcIpRanges": { "type": "array", @@ -9395,6 +15153,14 @@ "type": "string" } }, + "licenseCodes": { + "type": "array", + "description": "Integer license codes indicating which licenses are attached to this snapshot.", + "items": { + "type": "string", + "format": "int64" + } + }, "licenses": { "type": "array", "description": "[Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image).", @@ -9447,7 +15213,7 @@ }, "storageBytes": { "type": "string", - "description": "[Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", + "description": "[Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", "format": "int64" }, "storageBytesStatus": { @@ -9471,11 +15237,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Snapshot resources.", + "description": "A list of Snapshot resources.", "items": { "$ref": "Snapshot" } @@ -9492,6 +15258,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9544,7 +15379,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -9565,6 +15400,353 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "SslPoliciesList": { + "id": "SslPoliciesList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of SslPolicy resources.", + "items": { + "$ref": "SslPolicy" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies.", + "default": "compute#sslPoliciesList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "SslPoliciesListAvailableFeaturesResponse": { + "id": "SslPoliciesListAvailableFeaturesResponse", + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SslPolicy": { + "id": "SslPolicy", + "type": "object", + "description": "A SSL policy specifies the server-side support for SSL features. This can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between clients and the HTTPS or SSL proxy load balancer. They do not affect the connection between the load balancers and the backends.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "customFeatures": { + "type": "array", + "description": "List of features enabled when the selected profile is CUSTOM. The\n- method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM.", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "enabledFeatures": { + "type": "array", + "description": "[Output Only] The list of features enabled in the SSL policy.", + "items": { + "type": "string" + } + }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output only] Type of the resource. Always compute#sslPolicyfor SSL policies.", + "default": "compute#sslPolicy" + }, + "minTlsVersion": { + "type": "string", + "description": "The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2, TLS_1_3.", + "enum": [ + "TLS_1_0", + "TLS_1_1", + "TLS_1_2", + "TLS_1_3" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "profile": { + "type": "string", + "description": "Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field.", + "enum": [ + "COMPATIBLE", + "CUSTOM", + "MODERN", + "RESTRICTED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + } + }, + "SslPolicyReference": { + "id": "SslPolicyReference", + "type": "object", + "properties": { + "sslPolicy": { + "type": "string", + "description": "URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource." } } }, @@ -9573,17 +15755,26 @@ "type": "object", "description": "A Subnetwork resource.", "properties": { + "allowSubnetCidrRoutesOverlap": { + "type": "boolean", + "description": "Whether this subnetwork can conflict with static routes. Setting this to true allows this subnetwork's primary and secondary ranges to conflict with routes that have already been configured on the corresponding network. Static routes will take precedence over the subnetwork route if the route prefix length is at least as large as the subnetwork prefix length.\n\nAlso, packets destined to IPs within subnetwork may contain private/sensitive data and are prevented from leaving the virtual network. Setting this field to true will disable this feature.\n\nThe default value is false and applies to all existing subnetworks and automatically created subnetworks.\n\nThis field cannot be set to true at resource creation time." + }, "creationTimestamp": { "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional description of this resource. Provide this property when you create the resource." + "description": "An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time." + }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork.", + "format": "byte" }, "gatewayAddress": { "type": "string", - "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork." + "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time." }, "id": { "type": "string", @@ -9592,7 +15783,7 @@ }, "ipCidrRange": { "type": "string", - "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported." + "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time." }, "kind": { "type": "string", @@ -9606,15 +15797,15 @@ }, "network": { "type": "string", - "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks." + "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time." }, "privateIpGoogleAccess": { "type": "boolean", - "description": "Whether the VMs in this subnet can access Google services without assigned external IP addresses." + "description": "Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess." }, "region": { "type": "string", - "description": "URL of the region where the Subnetwork resides." + "description": "URL of the region where the Subnetwork resides. This field can be set only at resource creation time." }, "secondaryIpRanges": { "type": "array", @@ -9635,11 +15826,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output] A map of scoped Subnetwork lists.", + "description": "A list of SubnetworksScopedList resources.", "additionalProperties": { "$ref": "SubnetworksScopedList", "description": "Name of the scope containing this set of Subnetworks." @@ -9657,6 +15848,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9667,11 +15927,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "The Subnetwork resources.", + "description": "A list of Subnetwork resources.", "items": { "$ref": "Subnetwork" } @@ -9688,6 +15948,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9820,6 +16149,20 @@ "type": "string", "description": "Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence." }, + "portSpecification": { + "type": "string", + "description": "Specifies how port is selected for health checking, can be one of following values:\nUSE_FIXED_PORT: The port number in\nport\nis used for health checking.\nUSE_NAMED_PORT: The\nportName\nis used for health checking.\nUSE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking.\n\n\nIf not specified, TCP health check follows behavior specified in\nport\nand\nportName\nfields.", + "enum": [ + "USE_FIXED_PORT", + "USE_NAMED_PORT", + "USE_SERVING_PORT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "proxyHeader": { "type": "string", "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.", @@ -9906,7 +16249,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -9927,6 +16270,95 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "TargetHttpsProxiesSetQuicOverrideRequest": { + "id": "TargetHttpsProxiesSetQuicOverrideRequest", + "type": "object", + "properties": { + "quicOverride": { + "type": "string", + "description": "QUIC policy for the TargetHttpsProxy resource.", + "enum": [ + "DISABLE", + "ENABLE", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] } } }, @@ -9975,6 +16407,20 @@ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, + "quicOverride": { + "type": "string", + "description": "Specifies the QUIC override policy for this TargetHttpsProxy resource. This determines whether the load balancer will attempt to negotiate QUIC with clients or not. Can specify one of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC, Enables QUIC when set to ENABLE, and disables QUIC when set to DISABLE. If NONE is specified, uses the QUIC policy with no user overrides, which is equivalent to DISABLE. Not specifying this field is equivalent to specifying NONE.", + "enum": [ + "DISABLE", + "ENABLE", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." @@ -9986,6 +16432,10 @@ "type": "string" } }, + "sslPolicy": { + "type": "string", + "description": "URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured." + }, "urlMap": { "type": "string", "description": "A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: \n- https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map \n- projects/project/global/urlMaps/url-map \n- global/urlMaps/url-map" @@ -9999,7 +16449,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -10020,6 +16470,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10085,7 +16604,7 @@ }, "items": { "type": "object", - "description": "A map of scoped target instance lists.", + "description": "A list of TargetInstance resources.", "additionalProperties": { "$ref": "TargetInstancesScopedList", "description": "Name of the scope containing this set of target instances." @@ -10103,6 +16622,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10113,7 +16701,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -10134,6 +16722,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10304,11 +16961,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped target pool lists.", + "description": "A list of TargetPool resources.", "additionalProperties": { "$ref": "TargetPoolsScopedList", "description": "Name of the scope containing this set of target pools." @@ -10326,6 +16983,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10353,7 +17079,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -10374,6 +17100,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10619,6 +17414,10 @@ "items": { "type": "string" } + }, + "sslPolicy": { + "type": "string", + "description": "URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured." } } }, @@ -10629,7 +17428,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -10650,6 +17449,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10738,7 +17606,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -10759,6 +17627,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10792,6 +17729,18 @@ "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", "default": "compute#targetVpnGateway" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this TargetVpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make a get() request to retrieve an TargetVpnGateway.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this TargetVpnGateway resource. These can be later modified by the setLabels method. Each label key/value must comply with RFC1035. Label values may be empty.", + "additionalProperties": { + "type": "string" + } + }, "name": { "type": "string", "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", @@ -10850,11 +17799,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped target vpn gateway lists.", + "description": "A list of TargetVpnGateway resources.", "additionalProperties": { "$ref": "TargetVpnGatewaysScopedList", "description": "[Output Only] Name of the scope containing this set of target VPN gateways." @@ -10872,6 +17821,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -10882,11 +17900,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of TargetVpnGateway resources.", + "description": "A list of TargetVpnGateway resources.", "items": { "$ref": "TargetVpnGateway" } @@ -10903,6 +17921,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -11126,7 +18213,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Set by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -11147,6 +18234,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -11228,6 +18384,116 @@ } } }, + "UsableSubnetwork": { + "id": "UsableSubnetwork", + "type": "object", + "description": "Subnetwork which the current user has compute.subnetworks.use permission on.", + "properties": { + "subnetwork": { + "type": "string", + "description": "Subnetwork URL." + } + } + }, + "UsableSubnetworksAggregatedList": { + "id": "UsableSubnetworksAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + }, + "items": { + "type": "array", + "description": "[Output] A list of usable subnetwork URLs.", + "items": { + "$ref": "UsableSubnetwork" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks.", + "default": "compute#usableSubnetworksAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "UsageExportLocation": { "id": "UsageExportLocation", "type": "object", @@ -11383,11 +18649,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped vpn tunnel lists.", + "description": "A list of VpnTunnelsScopedList resources.", "additionalProperties": { "$ref": "VpnTunnelsScopedList", "description": "Name of the scope containing this set of vpn tunnels." @@ -11405,6 +18671,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -11415,11 +18750,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of VpnTunnel resources.", + "description": "A list of VpnTunnel resources.", "items": { "$ref": "VpnTunnel" } @@ -11436,6 +18771,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -11527,18 +18931,18 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of XPN host project URLs.", + "description": "[Output Only] A list of shared VPC host project URLs.", "items": { "$ref": "Project" } }, "kind": { "type": "string", - "description": "[Output Only] Type of resource. Always compute#xpnHostList for lists of XPN hosts.", + "description": "[Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts.", "default": "compute#xpnHostList" }, "nextPageToken": { @@ -11548,21 +18952,90 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, "XpnResourceId": { "id": "XpnResourceId", "type": "object", - "description": "XpnResourceId", + "description": "Service resource (a.k.a service project) ID.", "properties": { "id": { "type": "string", - "description": "The ID of the XPN resource. In the case of projects, this field matches the project's name, not the canonical ID." + "description": "The ID of the service resource. In the case of projects, this field matches the project ID (e.g., my-project), not the project number (e.g., 12345678)." }, "type": { "type": "string", - "description": "The type of the XPN resource.", + "description": "The type of the service resource.", "enum": [ "PROJECT", "XPN_RESOURCE_TYPE_UNSPECIFIED" @@ -11645,7 +19118,7 @@ }, "items": { "type": "array", - "description": "[Output Only] A list of Zone resources.", + "description": "A list of Zone resources.", "items": { "$ref": "Zone" } @@ -11662,6 +19135,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -11695,7 +19237,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11786,7 +19328,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11847,7 +19389,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11917,7 +19459,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -11998,7 +19540,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -12025,7 +19567,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12078,7 +19620,7 @@ "id": "compute.addresses.setLabels", "path": "{project}/regions/{region}/addresses/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on an Address. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -12096,7 +19638,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "resource": { @@ -12180,7 +19722,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12243,7 +19785,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -12324,7 +19866,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -12358,7 +19900,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12411,7 +19953,7 @@ "id": "compute.autoscalers.patch", "path": "{project}/zones/{zone}/autoscalers", "httpMethod": "PATCH", - "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "autoscaler": { "type": "string", @@ -12428,7 +19970,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -12451,8 +19993,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -12521,7 +20062,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -12572,7 +20113,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -12613,7 +20154,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -12656,7 +20197,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -12724,7 +20265,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -12756,7 +20297,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -12782,7 +20323,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12827,7 +20368,7 @@ "id": "compute.backendBuckets.patch", "path": "{project}/global/backendBuckets/{backendBucket}", "httpMethod": "PATCH", - "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports patch semantics.", + "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendBucket": { "type": "string", @@ -12845,7 +20386,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -12861,8 +20402,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "setIamPolicy": { @@ -12882,7 +20422,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -12918,7 +20458,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -12960,7 +20500,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13004,7 +20544,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13031,7 +20571,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13094,7 +20634,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13137,7 +20677,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13239,7 +20779,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13265,7 +20805,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13310,7 +20850,7 @@ "id": "compute.backendServices.patch", "path": "{project}/global/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendService": { "type": "string", @@ -13328,7 +20868,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13344,8 +20884,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "setSecurityPolicy": { @@ -13369,7 +20908,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13405,7 +20944,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -13447,7 +20986,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -13487,7 +21026,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -13519,7 +21058,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13610,7 +21149,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13671,7 +21210,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13738,7 +21277,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -13786,7 +21325,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -13909,7 +21448,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "sourceImage": { @@ -13948,7 +21487,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14019,7 +21558,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -14094,7 +21633,7 @@ "id": "compute.disks.setLabels", "path": "{project}/zones/{zone}/disks/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -14105,7 +21644,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "resource": { @@ -14210,7 +21749,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14275,7 +21814,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14301,7 +21840,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14346,7 +21885,7 @@ "id": "compute.firewalls.patch", "path": "{project}/global/firewalls/{firewall}", "httpMethod": "PATCH", - "description": "Updates the specified firewall rule with the data included in the request. This method supports patch semantics.", + "description": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "firewall": { "type": "string", @@ -14364,7 +21903,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14380,8 +21919,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -14401,7 +21939,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -14443,7 +21981,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14474,7 +22012,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14544,7 +22082,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14625,7 +22163,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14652,7 +22190,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14705,7 +22243,7 @@ "id": "compute.forwardingRules.patch", "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}", "httpMethod": "PATCH", - "description": "Updates the specified forwarding rule with the data included in the request. This method supports patch semantics. Currently it only allow to patch network_tier field.", + "description": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.", "parameters": { "forwardingRule": { "type": "string", @@ -14730,7 +22268,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14747,15 +22285,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "setLabels": { "id": "compute.forwardingRules.setLabels", "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -14773,7 +22310,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "resource": { @@ -14829,7 +22366,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14920,7 +22457,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -14985,7 +22522,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15011,7 +22548,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15056,7 +22593,7 @@ "id": "compute.globalAddresses.setLabels", "path": "{project}/global/addresses/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -15105,7 +22642,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -15151,7 +22688,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15216,7 +22753,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15242,7 +22779,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15287,7 +22824,7 @@ "id": "compute.globalForwardingRules.patch", "path": "{project}/global/forwardingRules/{forwardingRule}", "httpMethod": "PATCH", - "description": "Updates the specified forwarding rule with the data included in the request. This method supports patch semantics. Currently it only allow to patch network_tier field.", + "description": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.", "parameters": { "forwardingRule": { "type": "string", @@ -15305,7 +22842,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15321,15 +22858,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "setLabels": { "id": "compute.globalForwardingRules.setLabels", "path": "{project}/global/forwardingRules/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -15383,7 +22919,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15419,7 +22955,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -15451,7 +22987,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15564,7 +23100,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15631,7 +23167,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15696,7 +23232,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15722,7 +23258,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15767,7 +23303,7 @@ "id": "compute.healthChecks.patch", "path": "{project}/global/healthChecks/{healthCheck}", "httpMethod": "PATCH", - "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "healthCheck": { "type": "string", @@ -15785,7 +23321,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15801,8 +23337,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -15822,7 +23357,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -15864,7 +23399,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -15895,7 +23430,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15986,7 +23521,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16047,7 +23582,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16110,7 +23645,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -16233,7 +23768,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -16267,7 +23802,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16431,7 +23966,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16496,7 +24031,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16522,7 +24057,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16567,7 +24102,7 @@ "id": "compute.httpHealthChecks.patch", "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", "httpMethod": "PATCH", - "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "httpHealthCheck": { "type": "string", @@ -16585,7 +24120,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16601,8 +24136,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -16622,7 +24156,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -16664,7 +24198,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16709,7 +24243,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16774,7 +24308,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16800,7 +24334,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16845,7 +24379,7 @@ "id": "compute.httpsHealthChecks.patch", "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", "httpMethod": "PATCH", - "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "httpsHealthCheck": { "type": "string", @@ -16863,7 +24397,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16879,8 +24413,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -16900,7 +24433,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -16942,7 +24475,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -16987,7 +24520,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -17025,7 +24558,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -17129,7 +24662,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -17166,7 +24699,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -17195,7 +24728,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17253,7 +24786,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -17276,7 +24809,7 @@ "id": "compute.images.setLabels", "path": "{project}/global/images/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on an image. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -17325,7 +24858,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -17353,7 +24886,7 @@ "id": "compute.instanceGroupManagers.abandonInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", "httpMethod": "POST", - "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -17370,7 +24903,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17404,7 +24937,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17445,6 +24978,48 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "applyUpdatesToInstances": { + "id": "compute.instanceGroupManagers.applyUpdatesToInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances", + "httpMethod": "POST", + "description": "Apply changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group, should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located. Should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersApplyUpdatesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "id": "compute.instanceGroupManagers.delete", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", @@ -17466,7 +25041,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17493,7 +25068,7 @@ "id": "compute.instanceGroupManagers.deleteInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", "httpMethod": "POST", - "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -17510,7 +25085,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17536,6 +25111,48 @@ "https://www.googleapis.com/auth/compute" ] }, + "deletePerInstanceConfigs": { + "id": "compute.instanceGroupManagers.deletePerInstanceConfigs", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs", + "httpMethod": "POST", + "description": "Delete selected per-instance configs for the managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group. It should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersDeletePerInstanceConfigsReq" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "get": { "id": "compute.instanceGroupManagers.get", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", @@ -17580,7 +25197,7 @@ "id": "compute.instanceGroupManagers.insert", "path": "{project}/zones/{zone}/instanceGroupManagers", "httpMethod": "POST", - "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group.", + "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.", "parameters": { "project": { "type": "string", @@ -17591,7 +25208,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17624,7 +25241,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17731,11 +25348,74 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "listPerInstanceConfigs": { + "id": "compute.instanceGroupManagers.listPerInstanceConfigs", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs", + "httpMethod": "POST", + "description": "Lists all of the per-instance configs defined for the managed instance group.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group. It should conform to RFC1035.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManagersListPerInstanceConfigsResp" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, "patch": { "id": "compute.instanceGroupManagers.patch", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", "httpMethod": "PATCH", - "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports patch semantics.", + "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "instanceGroupManager": { "type": "string", @@ -17752,7 +25432,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17775,15 +25455,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "recreateInstances": { "id": "compute.instanceGroupManagers.recreateInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", "httpMethod": "POST", - "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -17800,7 +25479,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17830,7 +25509,7 @@ "id": "compute.instanceGroupManagers.resize", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", "httpMethod": "POST", - "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -17847,7 +25526,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "size": { @@ -17882,7 +25561,7 @@ "id": "compute.instanceGroupManagers.resizeAdvanced", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced", "httpMethod": "POST", - "description": "Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.\n\nIf you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method.", + "description": "Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.\n\nIf you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -17899,7 +25578,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17946,7 +25625,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -17993,7 +25672,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18040,7 +25719,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18132,7 +25811,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18157,6 +25836,53 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "updatePerInstanceConfigs": { + "id": "compute.instanceGroupManagers.updatePerInstanceConfigs", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs", + "httpMethod": "POST", + "description": "Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group. It should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersUpdatePerInstanceConfigsReq" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -18183,7 +25909,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18217,7 +25943,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18279,7 +26005,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18357,7 +26083,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18390,7 +26116,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18446,7 +26172,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instanceGroup": { @@ -18508,7 +26234,7 @@ "id": "compute.instanceGroups.removeInstances", "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", "httpMethod": "POST", - "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.", "parameters": { "instanceGroup": { "type": "string", @@ -18525,7 +26251,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18572,7 +26298,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18669,7 +26395,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -18734,7 +26460,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -18760,7 +26486,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18818,7 +26544,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -18870,7 +26596,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -18906,7 +26632,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18974,7 +26700,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19023,7 +26749,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19081,7 +26807,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19135,7 +26861,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19202,6 +26928,53 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "getGuestAttributes": { + "id": "compute.instances.getGuestAttributes", + "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes", + "httpMethod": "GET", + "description": "Returns the specified guest attributes entry.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "variableKey": { + "type": "string", + "description": "Specifies the key for the guest attributes entry.", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The 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": "GuestAttributes" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, "getIamPolicy": { "id": "compute.instances.getIamPolicy", "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy", @@ -19316,7 +27089,12 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "sourceInstanceTemplate": { + "type": "string", + "description": "Specifies instance template to create the instance.\n\nThis field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: \n- https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate \n- projects/project/global/global/instanceTemplates/instanceTemplate \n- global/instancesTemplates/instanceTemplate", "location": "query" }, "zone": { @@ -19350,7 +27128,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19407,7 +27185,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instance": { @@ -19486,7 +27264,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19510,6 +27288,58 @@ "https://www.googleapis.com/auth/compute" ] }, + "setDeletionProtection": { + "id": "compute.instances.setDeletionProtection", + "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection", + "httpMethod": "POST", + "description": "Sets deletion protection on the instance.", + "parameters": { + "deletionProtection": { + "type": "boolean", + "description": "Whether the resource should be protected against deletion.", + "default": "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The 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", + "resource" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setDiskAutoDelete": { "id": "compute.instances.setDiskAutoDelete", "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete", @@ -19545,7 +27375,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19619,7 +27449,7 @@ "id": "compute.instances.setLabels", "path": "{project}/zones/{zone}/instances/{instance}/setLabels", "httpMethod": "POST", - "description": "Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "instance": { "type": "string", @@ -19637,7 +27467,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19686,7 +27516,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19735,7 +27565,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19784,7 +27614,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19815,7 +27645,7 @@ "id": "compute.instances.setMinCpuPlatform", "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform", "httpMethod": "POST", - "description": "Changes the minimum cpu/platform that this instance should be started as. This is called on a stopped instance.", + "description": "Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.", "parameters": { "instance": { "type": "string", @@ -19833,7 +27663,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19882,7 +27712,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19931,7 +27761,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -19980,7 +27810,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20070,7 +27900,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20116,7 +27946,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20170,7 +28000,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20221,7 +28051,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20294,7 +28124,7 @@ "id": "compute.instances.updateAccessConfig", "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig", "httpMethod": "POST", - "description": "Updates the specified access config from an instance's network interface with the data included in the request.", + "description": "Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "instance": { "type": "string", @@ -20318,7 +28148,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20374,7 +28204,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -20414,7 +28244,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20484,7 +28314,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -20607,7 +28437,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -20634,7 +28464,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20683,6 +28513,50 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setIamPolicy": { + "id": "compute.interconnectAttachments.setIamPolicy", + "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "testIamPermissions": { "id": "compute.interconnectAttachments.testIamPermissions", "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions", @@ -20774,7 +28648,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20832,7 +28706,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -20878,7 +28752,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -20928,6 +28802,40 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "getIamPolicy": { + "id": "compute.interconnects.getIamPolicy", + "path": "{project}/global/interconnects/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, "insert": { "id": "compute.interconnects.insert", "path": "{project}/global/interconnects", @@ -20943,7 +28851,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -20969,7 +28877,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21014,7 +28922,7 @@ "id": "compute.interconnects.patch", "path": "{project}/global/interconnects/{interconnect}", "httpMethod": "PATCH", - "description": "Updates the specified interconnect with the data included in the request using patch semantics.", + "description": "Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "interconnect": { "type": "string", @@ -21032,7 +28940,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21048,8 +28956,43 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" + ] + }, + "setIamPolicy": { + "id": "compute.interconnects.setIamPolicy", + "path": "{project}/global/interconnects/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -21069,7 +29012,152 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "licenseCodes": { + "methods": { + "get": { + "id": "compute.licenseCodes.get", + "path": "{project}/global/licenseCodes/{licenseCode}", + "httpMethod": "GET", + "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.", + "parameters": { + "licenseCode": { + "type": "string", + "description": "Number corresponding to the License code resource to return.", + "required": true, + "pattern": "[0-9]{0,61}?", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "licenseCode" + ], + "response": { + "$ref": "LicenseCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getIamPolicy": { + "id": "compute.licenseCodes.getIamPolicy", + "path": "{project}/global/licenseCodes/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setIamPolicy": { + "id": "compute.licenseCodes.setIamPolicy", + "path": "{project}/global/licenseCodes/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "testIamPermissions": { + "id": "compute.licenseCodes.testIamPermissions", + "path": "{project}/global/licenseCodes/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -21093,11 +29181,49 @@ }, "licenses": { "methods": { + "delete": { + "id": "compute.licenses.delete", + "path": "{project}/global/licenses/{license}", + "httpMethod": "DELETE", + "description": "Deletes the specified license.", + "parameters": { + "license": { + "type": "string", + "description": "Name of the license 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "license" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "get": { "id": "compute.licenses.get", "path": "{project}/global/licenses/{license}", "httpMethod": "GET", - "description": "Returns the specified License resource. Get a list of available licenses by making a list() request.", + "description": "Returns the specified License resource.", "parameters": { "license": { "type": "string", @@ -21127,6 +29253,40 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "getIamPolicy": { + "id": "compute.licenses.getIamPolicy", + "path": "{project}/global/licenses/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, "insert": { "id": "compute.licenses.insert", "path": "{project}/global/licenses", @@ -21142,7 +29302,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21171,7 +29331,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21211,6 +29371,79 @@ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute.readonly" ] + }, + "setIamPolicy": { + "id": "compute.licenses.setIamPolicy", + "path": "{project}/global/licenses/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "testIamPermissions": { + "id": "compute.licenses.testIamPermissions", + "path": "{project}/global/licenses/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] } } }, @@ -21224,7 +29457,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21315,7 +29548,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21366,6 +29599,444 @@ } } }, + "networkEndpointGroups": { + "methods": { + "aggregatedList": { + "id": "compute.networkEndpointGroups.aggregatedList", + "path": "{project}/aggregated/networkEndpointGroups", + "httpMethod": "GET", + "description": "Retrieves the list of network endpoint groups and sorts them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "NetworkEndpointGroupAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "attachNetworkEndpoints": { + "id": "compute.networkEndpointGroups.attachNetworkEndpoints", + "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints", + "httpMethod": "POST", + "description": "Attach a list of network endpoints to the specified network endpoint group.", + "parameters": { + "networkEndpointGroup": { + "type": "string", + "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "networkEndpointGroup" + ], + "request": { + "$ref": "NetworkEndpointGroupsAttachEndpointsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "compute.networkEndpointGroups.delete", + "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}", + "httpMethod": "DELETE", + "description": "Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it.", + "parameters": { + "networkEndpointGroup": { + "type": "string", + "description": "The name of the network endpoint group to delete. It should comply with RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "networkEndpointGroup" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "detachNetworkEndpoints": { + "id": "compute.networkEndpointGroups.detachNetworkEndpoints", + "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints", + "httpMethod": "POST", + "description": "Detach a list of network endpoints from the specified network endpoint group.", + "parameters": { + "networkEndpointGroup": { + "type": "string", + "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "networkEndpointGroup" + ], + "request": { + "$ref": "NetworkEndpointGroupsDetachEndpointsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.networkEndpointGroups.get", + "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}", + "httpMethod": "GET", + "description": "Returns the specified network endpoint group. Get a list of available network endpoint groups by making a list() request.", + "parameters": { + "networkEndpointGroup": { + "type": "string", + "description": "The name of the network endpoint group. It should comply with RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "networkEndpointGroup" + ], + "response": { + "$ref": "NetworkEndpointGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.networkEndpointGroups.insert", + "path": "{project}/zones/{zone}/networkEndpointGroups", + "httpMethod": "POST", + "description": "Creates a network endpoint group in the specified project using the parameters that are 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "NetworkEndpointGroup" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.networkEndpointGroups.list", + "path": "{project}/zones/{zone}/networkEndpointGroups", + "httpMethod": "GET", + "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "NetworkEndpointGroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listNetworkEndpoints": { + "id": "compute.networkEndpointGroups.listNetworkEndpoints", + "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints", + "httpMethod": "POST", + "description": "List the network endpoints in the specified network endpoint group.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "networkEndpointGroup": { + "type": "string", + "description": "The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.", + "required": true, + "location": "path" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "networkEndpointGroup" + ], + "request": { + "$ref": "NetworkEndpointGroupsListEndpointsRequest" + }, + "response": { + "$ref": "NetworkEndpointGroupsListNetworkEndpoints" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "testIamPermissions": { + "id": "compute.networkEndpointGroups.testIamPermissions", + "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The 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", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "networks": { "methods": { "addPeering": { @@ -21390,7 +30061,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21431,7 +30102,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21496,7 +30167,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21522,7 +30193,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21563,6 +30234,131 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "listIpOwners": { + "id": "compute.networks.listIpOwners", + "path": "{project}/global/networks/{network}/listIpOwners", + "httpMethod": "GET", + "description": "List the internal IP owners in the specified network.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "ipCidrRange": { + "type": "string", + "description": "(Optional) IP CIDR range filter, example: \"10.128.10.0/30\".", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "network": { + "type": "string", + "description": "Name of the network to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "ownerProjects": { + "type": "string", + "description": "(Optional) Project IDs filter, example: \"project-1,project-2\".", + "location": "query" + }, + "ownerTypes": { + "type": "string", + "description": "(Optional) Owner types filter, example: \"instance,forwardingRule\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "subnetName": { + "type": "string", + "description": "(Optional) Subnetwork name filter.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "query" + }, + "subnetRegion": { + "type": "string", + "description": "(Optional) Subnetwork region filter.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "network" + ], + "response": { + "$ref": "IpOwnerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.networks.patch", + "path": "{project}/global/networks/{network}", + "httpMethod": "PATCH", + "description": "Patches the specified network with the data included in the request.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network to update.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "network" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "removePeering": { "id": "compute.networks.removePeering", "path": "{project}/global/networks/{network}/removePeering", @@ -21585,7 +30381,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21626,7 +30422,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21659,7 +30455,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -21687,7 +30483,7 @@ "id": "compute.projects.disableXpnHost", "path": "{project}/disableXpnHost", "httpMethod": "POST", - "description": "Disable this project as an XPN host project.", + "description": "Disable this project as a shared VPC host project.", "parameters": { "project": { "type": "string", @@ -21698,7 +30494,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21717,7 +30513,7 @@ "id": "compute.projects.disableXpnResource", "path": "{project}/disableXpnResource", "httpMethod": "POST", - "description": "Disable an XPN resource associated with this host project.", + "description": "Disable a serivce resource (a.k.a service project) associated with this host project.", "parameters": { "project": { "type": "string", @@ -21728,7 +30524,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21750,7 +30546,7 @@ "id": "compute.projects.enableXpnHost", "path": "{project}/enableXpnHost", "httpMethod": "POST", - "description": "Enable this project as an XPN host project.", + "description": "Enable this project as a shared VPC host project.", "parameters": { "project": { "type": "string", @@ -21761,7 +30557,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21780,7 +30576,7 @@ "id": "compute.projects.enableXpnResource", "path": "{project}/enableXpnResource", "httpMethod": "POST", - "description": "Enable XPN resource (a.k.a service project or service folder in the future) for a host project, so that subnetworks in the host project can be used by instances in the service project or folder.", + "description": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.", "parameters": { "project": { "type": "string", @@ -21791,7 +30587,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -21839,7 +30635,7 @@ "id": "compute.projects.getXpnHost", "path": "{project}/getXpnHost", "httpMethod": "GET", - "description": "Get the XPN host project that this project links to. May be empty if no link exists.", + "description": "Get the shared VPC host project that this project links to. May be empty if no link exists.", "parameters": { "project": { "type": "string", @@ -21857,15 +30653,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "getXpnResources": { "id": "compute.projects.getXpnResources", "path": "{project}/getXpnResources", "httpMethod": "GET", - "description": "Get XPN resources associated with this host project.", + "description": "Get service resources (a.k.a service project) associated with this host project.", "parameters": { "filter": { "type": "string", @@ -21902,15 +30697,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "listXpnHosts": { "id": "compute.projects.listXpnHosts", "path": "{project}/listXpnHosts", "httpMethod": "POST", - "description": "List all XPN host projects visible to the user in an organization.", + "description": "List all shared VPC host projects visible to the user in an organization.", "parameters": { "filter": { "type": "string", @@ -21950,8 +30744,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "moveDisk": { @@ -21969,7 +30762,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22002,7 +30795,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22035,7 +30828,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22053,6 +30846,39 @@ "https://www.googleapis.com/auth/compute" ] }, + "setDefaultNetworkTier": { + "id": "compute.projects.setDefaultNetworkTier", + "path": "{project}/setDefaultNetworkTier", + "httpMethod": "POST", + "description": "Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ProjectsSetDefaultNetworkTierRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setDefaultServiceAccount": { "id": "compute.projects.setDefaultServiceAccount", "path": "{project}/setDefaultServiceAccount", @@ -22068,7 +30894,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22101,7 +30927,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22155,7 +30981,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22236,7 +31062,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22263,7 +31089,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22316,7 +31142,7 @@ "id": "compute.regionAutoscalers.patch", "path": "{project}/regions/{region}/autoscalers", "httpMethod": "PATCH", - "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "autoscaler": { "type": "string", @@ -22340,7 +31166,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22356,8 +31182,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -22433,7 +31258,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22485,7 +31310,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22610,7 +31435,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22637,7 +31462,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22690,7 +31515,7 @@ "id": "compute.regionBackendServices.patch", "path": "{project}/regions/{region}/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendService": { "type": "string", @@ -22715,7 +31540,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22732,8 +31557,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -22810,7 +31634,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22842,7 +31666,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22929,7 +31753,7 @@ "id": "compute.regionCommitments.insert", "path": "{project}/regions/{region}/commitments", "httpMethod": "POST", - "description": "Creates an commitment in the specified project using the data included in the request.", + "description": "Creates a commitment in the specified project using the data included in the request.", "parameters": { "project": { "type": "string", @@ -22947,7 +31771,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -22974,7 +31798,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23122,7 +31946,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23208,7 +32032,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23256,7 +32080,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23337,7 +32161,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "sourceImage": { @@ -23369,7 +32193,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23447,7 +32271,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23489,7 +32313,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "resource": { @@ -23569,7 +32393,7 @@ "id": "compute.regionInstanceGroupManagers.abandonInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", "httpMethod": "POST", - "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -23592,7 +32416,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23612,6 +32436,48 @@ "https://www.googleapis.com/auth/compute" ] }, + "applyUpdatesToInstances": { + "id": "compute.regionInstanceGroupManagers.applyUpdatesToInstances", + "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances", + "httpMethod": "POST", + "description": "Apply updates to selected instances the managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group, should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request, should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "request": { + "$ref": "RegionInstanceGroupManagersApplyUpdatesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "id": "compute.regionInstanceGroupManagers.delete", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}", @@ -23639,7 +32505,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23660,7 +32526,7 @@ "id": "compute.regionInstanceGroupManagers.deleteInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", "httpMethod": "POST", - "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -23683,7 +32549,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23703,6 +32569,48 @@ "https://www.googleapis.com/auth/compute" ] }, + "deletePerInstanceConfigs": { + "id": "compute.regionInstanceGroupManagers.deletePerInstanceConfigs", + "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs", + "httpMethod": "POST", + "description": "Delete selected per-instance configs for the managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group. It should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request, should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "request": { + "$ref": "RegionInstanceGroupManagerDeleteInstanceConfigReq" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "get": { "id": "compute.regionInstanceGroupManagers.get", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}", @@ -23764,7 +32672,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23791,7 +32699,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23898,11 +32806,74 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "listPerInstanceConfigs": { + "id": "compute.regionInstanceGroupManagers.listPerInstanceConfigs", + "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs", + "httpMethod": "POST", + "description": "Lists all of the per-instance configs defined for the managed instance group.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group. It should conform to RFC1035.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request, should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "response": { + "$ref": "RegionInstanceGroupManagersListInstanceConfigsResp" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, "patch": { "id": "compute.regionInstanceGroupManagers.patch", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}", "httpMethod": "PATCH", - "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports patch semantics.", + "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "instanceGroupManager": { "type": "string", @@ -23925,7 +32896,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23942,15 +32913,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "recreateInstances": { "id": "compute.regionInstanceGroupManagers.recreateInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", "httpMethod": "POST", - "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -23973,7 +32943,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -23997,7 +32967,7 @@ "id": "compute.regionInstanceGroupManagers.resize", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize", "httpMethod": "POST", - "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -24020,7 +32990,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "size": { @@ -24073,7 +33043,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -24120,7 +33090,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -24167,7 +33137,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -24259,7 +33229,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -24278,6 +33248,48 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "updatePerInstanceConfigs": { + "id": "compute.regionInstanceGroupManagers.updatePerInstanceConfigs", + "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs", + "httpMethod": "POST", + "description": "Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group. It should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request, should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "request": { + "$ref": "RegionInstanceGroupManagerUpdateInstanceConfigReq" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -24331,7 +33343,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -24387,7 +33399,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instanceGroup": { @@ -24472,7 +33484,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -24629,7 +33641,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -24724,7 +33736,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -24777,7 +33789,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -24840,7 +33852,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "router": { @@ -24970,7 +33982,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -24997,7 +34009,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -25050,7 +34062,7 @@ "id": "compute.routers.patch", "path": "{project}/regions/{region}/routers/{router}", "httpMethod": "PATCH", - "description": "Patches the specified Router resource with the data included in the request. This method supports patch semantics.", + "description": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.", "parameters": { "project": { "type": "string", @@ -25068,7 +34080,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "router": { @@ -25092,8 +34104,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "preview": { @@ -25208,7 +34219,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "router": { @@ -25254,7 +34265,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "route": { @@ -25326,7 +34337,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -25352,7 +34363,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -25410,7 +34421,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -25449,7 +34460,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "securityPolicy": { @@ -25487,7 +34498,7 @@ }, "securityPolicy": { "type": "string", - "description": "Name of the security policy to update.", + "description": "Name of the security policy to get.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -25521,7 +34532,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -25547,7 +34558,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -25580,7 +34591,7 @@ "project" ], "response": { - "$ref": "SecurityPoliciesList" + "$ref": "SecurityPolicyList" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", @@ -25603,7 +34614,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "securityPolicy": { @@ -25626,8 +34637,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -25647,7 +34657,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -25686,7 +34696,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "snapshot": { @@ -25760,7 +34770,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -25785,7 +34795,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -25843,7 +34853,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -25866,7 +34876,7 @@ "id": "compute.snapshots.setLabels", "path": "{project}/global/snapshots/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -25915,7 +34925,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -25954,7 +34964,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "sslCertificate": { @@ -26026,7 +35036,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -26052,7 +35062,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -26110,7 +35120,289 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "sslPolicies": { + "methods": { + "delete": { + "id": "compute.sslPolicies.delete", + "path": "{project}/global/sslPolicies/{sslPolicy}", + "httpMethod": "DELETE", + "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "sslPolicy": { + "type": "string", + "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslPolicy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.sslPolicies.get", + "path": "{project}/global/sslPolicies/{sslPolicy}", + "httpMethod": "GET", + "description": "List all of the ordered rules present in a single specified policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "sslPolicy": { + "type": "string", + "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslPolicy" + ], + "response": { + "$ref": "SslPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.sslPolicies.insert", + "path": "{project}/global/sslPolicies", + "httpMethod": "POST", + "description": "Returns the specified SSL policy resource. Get a list of available SSL policies by making a list() 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "SslPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.sslPolicies.list", + "path": "{project}/global/sslPolicies", + "httpMethod": "GET", + "description": "List all the SSL policies that have been configured for the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "SslPoliciesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listAvailableFeatures": { + "id": "compute.sslPolicies.listAvailableFeatures", + "path": "{project}/global/sslPolicies/listAvailableFeatures", + "httpMethod": "GET", + "description": "Lists all features that can be specified in the SSL policy when using custom profile.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "SslPoliciesListAvailableFeaturesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.sslPolicies.patch", + "path": "{project}/global/sslPolicies/{sslPolicy}", + "httpMethod": "PATCH", + "description": "Patches the specified SSL policy 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "sslPolicy": { + "type": "string", + "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslPolicy" + ], + "request": { + "$ref": "SslPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "testIamPermissions": { + "id": "compute.sslPolicies.testIamPermissions", + "path": "{project}/global/sslPolicies/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -26142,7 +35434,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -26205,7 +35497,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "subnetwork": { @@ -26251,7 +35543,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "subnetwork": { @@ -26384,7 +35676,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -26411,7 +35703,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -26460,6 +35752,104 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "listUsable": { + "id": "compute.subnetworks.listUsable", + "path": "{project}/aggregated/subnetworks/listUsable", + "httpMethod": "GET", + "description": "Retrieves an aggregated list of usable subnetworks.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "UsableSubnetworksAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.subnetworks.patch", + "path": "{project}/regions/{region}/subnetworks/{subnetwork}", + "httpMethod": "PATCH", + "description": "Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "subnetwork": { + "type": "string", + "description": "Name of the Subnetwork resource to patch.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "subnetwork" + ], + "request": { + "$ref": "Subnetwork" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setIamPolicy": { "id": "compute.subnetworks.setIamPolicy", "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", @@ -26526,7 +35916,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "subnetwork": { @@ -26617,7 +36007,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetHttpProxy": { @@ -26689,7 +36079,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -26715,7 +36105,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -26771,7 +36161,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetHttpProxy": { @@ -26814,7 +36204,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -26853,7 +36243,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetHttpsProxy": { @@ -26925,7 +36315,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -26951,7 +36341,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -26992,6 +36382,46 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setQuicOverride": { + "id": "compute.targetHttpsProxies.setQuicOverride", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride", + "httpMethod": "POST", + "description": "Sets the QUIC override policy for TargetHttpsProxy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "request": { + "$ref": "TargetHttpsProxiesSetQuicOverrideRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setSslCertificates": { "id": "compute.targetHttpsProxies.setSslCertificates", "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", @@ -27007,7 +36437,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetHttpsProxy": { @@ -27033,6 +36463,46 @@ "https://www.googleapis.com/auth/compute" ] }, + "setSslPolicy": { + "id": "compute.targetHttpsProxies.setSslPolicy", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy", + "httpMethod": "POST", + "description": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "request": { + "$ref": "SslPolicyReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setUrlMap": { "id": "compute.targetHttpsProxies.setUrlMap", "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", @@ -27048,7 +36518,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetHttpsProxy": { @@ -27091,7 +36561,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -27123,7 +36593,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -27179,7 +36649,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetInstance": { @@ -27267,7 +36737,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "zone": { @@ -27301,7 +36771,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -27421,7 +36891,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetPool": { @@ -27470,7 +36940,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetPool": { @@ -27505,7 +36975,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -27568,7 +37038,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetPool": { @@ -27701,7 +37171,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -27728,7 +37198,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -27799,7 +37269,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetPool": { @@ -27848,7 +37318,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetPool": { @@ -27903,7 +37373,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetPool": { @@ -27994,7 +37464,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetSslProxy": { @@ -28066,7 +37536,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -28092,7 +37562,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -28148,7 +37618,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetSslProxy": { @@ -28189,7 +37659,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetSslProxy": { @@ -28230,7 +37700,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetSslProxy": { @@ -28256,6 +37726,46 @@ "https://www.googleapis.com/auth/compute" ] }, + "setSslPolicy": { + "id": "compute.targetSslProxies.setSslPolicy", + "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy", + "httpMethod": "POST", + "description": "Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "targetSslProxy": { + "type": "string", + "description": "Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetSslProxy" + ], + "request": { + "$ref": "SslPolicyReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "testIamPermissions": { "id": "compute.targetSslProxies.testIamPermissions", "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions", @@ -28273,7 +37783,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -28312,7 +37822,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetTcpProxy": { @@ -28384,7 +37894,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -28410,7 +37920,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -28466,7 +37976,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetTcpProxy": { @@ -28507,7 +38017,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetTcpProxy": { @@ -28550,7 +38060,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -28582,7 +38092,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -28645,7 +38155,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "targetVpnGateway": { @@ -28733,7 +38243,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -28760,7 +38270,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -28873,7 +38383,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "urlMap": { @@ -28945,7 +38455,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -28978,7 +38488,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "urlMap": { @@ -29012,7 +38522,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -29057,7 +38567,7 @@ "id": "compute.urlMaps.patch", "path": "{project}/global/urlMaps/{urlMap}", "httpMethod": "PATCH", - "description": "Patches the specified UrlMap resource with the data included in the request. This method supports patch semantics.", + "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "project": { "type": "string", @@ -29068,7 +38578,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "urlMap": { @@ -29091,8 +38601,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -29112,7 +38621,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -29147,7 +38656,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "urlMap": { @@ -29221,7 +38730,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -29284,7 +38793,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "vpnTunnel": { @@ -29372,7 +38881,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" } }, @@ -29399,7 +38908,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -29452,7 +38961,7 @@ "id": "compute.vpnTunnels.setLabels", "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -29470,7 +38979,7 @@ }, "requestId": { "type": "string", - "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query" }, "resource": { @@ -29634,7 +39143,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -29729,7 +39238,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { diff --git a/etc/api/compute/beta/compute-api.json b/etc/api/compute/beta/compute-api.json index fd0fe034c1..10446d78f9 100644 --- a/etc/api/compute/beta/compute-api.json +++ b/etc/api/compute/beta/compute-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/HQXgZmEmQzzaH47rZdB_hEzs91Q\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/2Jt9iILNSBvotCe8YWfswUcsXKc\"", "discoveryVersion": "v1", "id": "compute:beta", "name": "compute", "version": "beta", - "revision": "20170426", + "revision": "20170908", "title": "Compute Engine API", "description": "Creates and runs virtual machines on Google Cloud Platform.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/compute/beta/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "compute/beta/projects/", - "batchPath": "batch", + "batchPath": "batch/compute/beta", "parameters": { "alt": { "type": "string", @@ -160,11 +160,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped accelerator type lists.", + "description": "A list of AcceleratorTypesScopedList resources.", "additionalProperties": { "$ref": "AcceleratorTypesScopedList", "description": "[Output Only] Name of the scope containing this set of accelerator types." @@ -182,6 +182,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -208,11 +277,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -316,6 +454,14 @@ "type": "string", "description": "An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance." }, + "publicPtrDomainName": { + "type": "string", + "description": "The DNS domain name for the public PTR record. This field can only be set when the set_public_ptr field is enabled." + }, + "setPublicPtr": { + "type": "boolean", + "description": "Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name." + }, "type": { "type": "string", "description": "The type of configuration. The default and only option is ONE_TO_ONE_NAT.", @@ -336,7 +482,21 @@ "properties": { "address": { "type": "string", - "description": "The static external IP address represented by this resource." + "description": "The static IP address represented by this resource." + }, + "addressType": { + "type": "string", + "description": "The type of address to reserve. If unspecified, defaults to EXTERNAL.", + "enum": [ + "EXTERNAL", + "INTERNAL", + "UNSPECIFIED_TYPE" + ], + "enumDescriptions": [ + "", + "", + "" + ] }, "creationTimestamp": { "type": "string", @@ -370,6 +530,18 @@ "description": "[Output Only] Type of the resource. Always compute#address for addresses.", "default": "compute#address" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this Address, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make a get() request to retrieve an Address.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this Address resource. These can be later modified by the setLabels method. Each label key/value must comply with RFC1035. Label values may be empty.", + "additionalProperties": { + "type": "string" + } + }, "name": { "type": "string", "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", @@ -400,6 +572,10 @@ "" ] }, + "subnetwork": { + "type": "string", + "description": "For external addresses, this field should not be used.\n\nThe URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range." + }, "users": { "type": "array", "description": "[Output Only] The URLs of the resources that are using this address.", @@ -419,7 +595,7 @@ }, "items": { "type": "object", - "description": "[Output Only] A map of scoped address lists.", + "description": "A list of AddressesScopedList resources.", "additionalProperties": { "$ref": "AddressesScopedList", "description": "[Output Only] Name of the scope containing this set of addresses." @@ -437,6 +613,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -447,11 +692,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of addresses.", + "description": "A list of Address resources.", "items": { "$ref": "Address" } @@ -467,7 +712,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -591,7 +905,7 @@ }, "index": { "type": "integer", - "description": "Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.", + "description": "[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.", "format": "int32" }, "initializeParams": { @@ -747,6 +1061,31 @@ } } }, + "AuthorizationLoggingOptions": { + "id": "AuthorizationLoggingOptions", + "type": "object", + "description": "Authorization-related information used by Cloud Audit Logging.", + "properties": { + "permissionType": { + "type": "string", + "description": "The type of the permission that was checked.", + "enum": [ + "ADMIN_READ", + "ADMIN_WRITE", + "DATA_READ", + "DATA_WRITE", + "PERMISSION_TYPE_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, "Autoscaler": { "id": "Autoscaler", "type": "object", @@ -831,11 +1170,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped autoscaler lists.", + "description": "A list of AutoscalersScopedList resources.", "additionalProperties": { "$ref": "AutoscalersScopedList", "description": "[Output Only] Name of the scope containing this set of autoscalers." @@ -853,6 +1192,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -863,7 +1271,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -884,6 +1292,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -909,9 +1386,11 @@ "MISSING_LOAD_BALANCING_DATA_POINTS", "MORE_THAN_ONE_BACKEND_SERVICE", "NOT_ENOUGH_QUOTA_AVAILABLE", + "REGION_RESOURCE_STOCKOUT", "SCALING_TARGET_DOES_NOT_EXIST", "UNKNOWN", - "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION" + "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION", + "ZONE_RESOURCE_STOCKOUT" ], "enumDescriptions": [ "", @@ -926,6 +1405,8 @@ "", "", "", + "", + "", "" ] } @@ -1067,10 +1548,19 @@ "type": "object", "description": "Custom utilization metric policy.", "properties": { + "filter": { + "type": "string", + "description": "A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or global data.\n\nFor the filter to be valid for autoscaling purposes, the following rules apply: \n- You can only use the AND operator for joining selectors. \n- You can only use direct equality comparison operator (=) without any functions for each selector. \n- You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. \n- The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.\nIf the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is / called a global metric for the purpose of autoscaling.\n\nIf not specified, the type defaults to gce_instance. \n\nYou should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value." + }, "metric": { "type": "string", "description": "The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric.\n\nThe metric must have a value type of INT64 or DOUBLE." }, + "singleInstanceAssignment": { + "type": "number", + "description": "If scaling is based on a global metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.\n\nA good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.\n\nA bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.", + "format": "double" + }, "utilizationTarget": { "type": "number", "description": "The target value of the metric that autoscaler should maintain. This must be a positive value.\n\nFor example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.", @@ -1111,7 +1601,7 @@ "properties": { "balancingMode": { "type": "string", - "description": "Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).\n\nThis cannot be used for internal load balancing.", + "description": "Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).\n\nFor Internal Load Balancing, the default and only supported mode is CONNECTION.", "enum": [ "CONNECTION", "RATE", @@ -1134,7 +1624,7 @@ }, "group": { "type": "string", - "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL.\n\nWhen the BackendService has load balancing scheme INTERNAL, the instance group must be in a zone within the same region as the BackendService." + "description": "The fully-qualified URL of a Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL.\n\nWhen the BackendService has load balancing scheme INTERNAL, the instance group must be within the same region as the BackendService." }, "maxConnections": { "type": "integer", @@ -1228,11 +1718,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -1279,7 +1838,7 @@ }, "healthChecks": { "type": "array", - "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required.\n\nFor internal load balancing, a URL to a HealthCheck resource must be specified instead.", + "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required for Compute Engine backend services. A health check must not be specified for App Engine backend and Cloud Function backend.\n\nFor internal load balancing, a URL to a HealthCheck resource must be specified instead.", "items": { "type": "string" } @@ -1299,6 +1858,7 @@ }, "loadBalancingScheme": { "type": "string", + "description": "Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other. Possible values are INTERNAL and EXTERNAL.", "enum": [ "EXTERNAL", "INTERNAL", @@ -1346,6 +1906,10 @@ "type": "string", "description": "[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services." }, + "securityPolicy": { + "type": "string", + "description": "[Output Only] The resource URL for the security policy associated with this backend service." + }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." @@ -1386,7 +1950,7 @@ }, "items": { "type": "object", - "description": "A map of scoped BackendService lists.", + "description": "A list of BackendServicesScopedList resources.", "additionalProperties": { "$ref": "BackendServicesScopedList", "description": "Name of the scope containing this set of BackendServices." @@ -1399,11 +1963,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -1483,6 +2116,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -1573,9 +2275,13 @@ "type": "object", "description": "Associates `members` with a `role`.", "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. This field is GOOGLE_INTERNAL." + }, "members": { "type": "array", - "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", "items": { "type": "string" } @@ -1635,7 +2341,7 @@ "Commitment": { "id": "Commitment", "type": "object", - "description": "A usage-commitment with a start / end time. Users create commitments for particular resources (e.g. memory). Actual usage is first deducted from available commitments made prior, perhaps at a reduced price (as laid out in the commitment).", + "description": "Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts.\n\nCommitted use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts.", "properties": { "creationTimestamp": { "type": "string", @@ -1699,7 +2405,7 @@ }, "status": { "type": "string", - "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end-date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", + "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", "enum": [ "ACTIVE", "CREATING", @@ -1725,11 +2431,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "Commitments by scope.", + "description": "A list of CommitmentsScopedList resources.", "additionalProperties": { "$ref": "CommitmentsScopedList", "description": "[Output Only] Name of the scope containing this set of commitments." @@ -1747,6 +2453,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -1757,7 +2532,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -1778,6 +2553,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2099,7 +2943,7 @@ }, "sizeGb": { "type": "string", - "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.", + "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.", "format": "int64" }, "sourceImage": { @@ -2177,11 +3021,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped disk lists.", + "description": "A list of DisksScopedList resources.", "additionalProperties": { "$ref": "DisksScopedList", "description": "[Output Only] Name of the scope containing this set of disks." @@ -2194,11 +3038,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. Acceptable values are 0 to 500, inclusive. (Default: 500)" + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2225,11 +3138,80 @@ }, "nextPageToken": { "type": "string", - "description": "This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2304,11 +3286,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped disk type lists.", + "description": "A list of DiskTypesScopedList resources.", "additionalProperties": { "$ref": "DiskTypesScopedList", "description": "[Output Only] Name of the scope containing this set of disk types." @@ -2326,6 +3308,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2336,11 +3387,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Disk Type resources.", + "description": "A list of DiskType resources.", "items": { "$ref": "DiskType" } @@ -2357,6 +3408,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2535,6 +3655,57 @@ } } }, + "DistributionPolicy": { + "id": "DistributionPolicy", + "type": "object", + "properties": { + "zones": { + "type": "array", + "items": { + "$ref": "DistributionPolicyZoneConfiguration" + } + } + } + }, + "DistributionPolicyZoneConfiguration": { + "id": "DistributionPolicyZoneConfiguration", + "type": "object", + "properties": { + "zone": { + "type": "string", + "description": "URL of the zone where managed instance group is spawning instances (for regional resources). Zone has to belong to the region where managed instance group is located.", + "annotations": { + "required": [ + "compute.regionInstanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.update" + ] + } + } + } + }, + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example:\n\ntitle: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax.\n\nThe application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." + } + } + }, "Firewall": { "id": "Firewall", "type": "object", @@ -2548,7 +3719,7 @@ "properties": { "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number." + "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number." }, "ports": { "type": "array", @@ -2572,7 +3743,7 @@ "properties": { "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number." + "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number." }, "ports": { "type": "array", @@ -2648,9 +3819,23 @@ "type": "string" } }, + "sourceServiceAccounts": { + "type": "array", + "description": "If source service accounts are specified, the firewall will apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both properties for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags.", + "items": { + "type": "string" + } + }, "sourceTags": { "type": "array", - "description": "If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.", + "description": "If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.", + "items": { + "type": "string" + } + }, + "targetServiceAccounts": { + "type": "array", + "description": "A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network.", "items": { "type": "string" } @@ -2671,11 +3856,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Firewall resources.", + "description": "A list of Firewall resources.", "items": { "$ref": "Firewall" } @@ -2692,6 +3877,97 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "FixedOrPercent": { + "id": "FixedOrPercent", + "type": "object", + "description": "Encapsulates numeric value that can be either absolute or relative.", + "properties": { + "calculated": { + "type": "integer", + "description": "[Output Only] Absolute value calculated based on mode: mode = fixed -\u003e calculated = fixed = percent -\u003e calculated = ceiling(percent/100 * base_value)", + "format": "int32" + }, + "fixed": { + "type": "integer", + "description": "fixed must be non-negative.", + "format": "int32" + }, + "percent": { + "type": "integer", + "description": "percent must belong to [0, 100].", + "format": "int32" } } }, @@ -2702,7 +3978,7 @@ "properties": { "IPAddress": { "type": "string", - "description": "The IP address that this forwarding rule is serving on behalf of.\n\nFor global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IP from the same scope (global or regional) will be assigned.\n\nWhen the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the subnetwork or network configured for this forwarding rule. Only IPv4 is supported." + "description": "The IP address that this forwarding rule is serving on behalf of.\n\nFor global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6.\n\nWhen the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the subnetwork or network configured for this forwarding rule." }, "IPProtocol": { "type": "string", @@ -2760,6 +4036,18 @@ "description": "[Output Only] Type of the resource. Always compute#forwardingRule for Forwarding Rule resources.", "default": "compute#forwardingRule" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this resource, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make a get() request to retrieve a ForwardingRule.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this resource. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.", + "additionalProperties": { + "type": "string" + } + }, "loadBalancingScheme": { "type": "string", "description": "This signifies what the ForwardingRule will be used for and can only take the following values: INTERNAL, EXTERNAL The value of INTERNAL means that this will be used for Internal Network Load Balancing (TCP, UDP). The value of EXTERNAL means that this will be used for External Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy)", @@ -2785,7 +4073,7 @@ }, "portRange": { "type": "string", - "description": "This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance.\n\nApplicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges.\n\nSome types of forwarding target have constraints on the acceptable ports: \n- TargetHttpProxy: 80, 8080 \n- TargetHttpsProxy: 443 \n- TargetSslProxy: 443 \n- TargetVpnGateway: 500, 4500\n-" + "description": "This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance.\n\nApplicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges.\n\nSome types of forwarding target have constraints on the acceptable ports: \n- TargetHttpProxy: 80, 8080 \n- TargetHttpsProxy: 443 \n- TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 \n- TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 \n- TargetVpnGateway: 500, 4500\n-" }, "ports": { "type": "array", @@ -2827,11 +4115,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped forwarding rule lists.", + "description": "A list of ForwardingRulesScopedList resources.", "additionalProperties": { "$ref": "ForwardingRulesScopedList", "description": "Name of the scope containing this set of addresses." @@ -2849,6 +4137,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2859,7 +4216,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Set by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -2880,6 +4237,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -2990,7 +4416,7 @@ "properties": { "type": { "type": "string", - "description": "The type of supported feature. Currenty only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image. This value is purely informational and does not enable or disable any features.", + "description": "The type of supported feature. Currently only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", "enum": [ "FEATURE_TYPE_UNSPECIFIED", "MULTI_IP_SUBNET", @@ -3172,7 +4598,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3193,6 +4619,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3333,7 +4828,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3354,6 +4849,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3452,6 +5016,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3488,7 +5121,7 @@ }, "guestOsFeatures": { "type": "array", - "description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor new Windows images, the server might also populate this field with the value WINDOWS, to indicate that this is a Windows image. This value is purely informational and does not enable or disable any features.", + "description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", "items": { "$ref": "GuestOsFeature" } @@ -3582,6 +5215,18 @@ "type": "string", "description": "The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name." }, + "sourceImage": { + "type": "string", + "description": "URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of: \n- this property, or \n- the rawDisk.source property, or \n- the sourceDisk property in order to create an image." + }, + "sourceImageEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key." + }, + "sourceImageId": { + "type": "string", + "description": "[Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name." + }, "sourceType": { "type": "string", "description": "The type of the image used to create this disk. The default and only value is RAW", @@ -3616,11 +5261,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Image resources.", + "description": "A list of Image resources.", "items": { "$ref": "Image" } @@ -3637,6 +5282,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3710,6 +5424,10 @@ "$ref": "Metadata", "description": "The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys." }, + "minCpuPlatform": { + "type": "string", + "description": "Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: \"Intel Haswell\" or minCpuPlatform: \"Intel Sandy Bridge\"." + }, "name": { "type": "string", "description": "The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", @@ -3722,7 +5440,7 @@ }, "networkInterfaces": { "type": "array", - "description": "An 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. Only one interface is supported per instance.", + "description": "An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance.", "items": { "$ref": "NetworkInterface" } @@ -3742,9 +5460,13 @@ "$ref": "ServiceAccount" } }, + "startRestricted": { + "type": "boolean", + "description": "[Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity." + }, "status": { "type": "string", - "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.", + "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED.", "enum": [ "PROVISIONING", "RUNNING", @@ -3786,11 +5508,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped instance lists.", + "description": "A list of InstancesScopedList resources.", "additionalProperties": { "$ref": "InstancesScopedList", "description": "[Output Only] Name of the scope containing this set of instances." @@ -3808,6 +5530,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3888,11 +5679,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped instance group lists.", + "description": "A list of InstanceGroupsScopedList resources.", "additionalProperties": { "$ref": "InstanceGroupsScopedList", "description": "The name of the scope that contains this set of instance groups." @@ -3909,7 +5700,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3920,11 +5780,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of instance groups.", + "description": "A list of InstanceGroup resources.", "items": { "$ref": "InstanceGroup" } @@ -3940,7 +5800,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -3978,6 +5907,10 @@ "type": "string", "description": "An optional description of this resource. Provide this property when you create the resource." }, + "distributionPolicy": { + "$ref": "DistributionPolicy", + "description": "Policy valid only for regional managed instance groups." + }, "failoverAction": { "type": "string", "description": "The action to perform in case of zone failure. Only one value is supported, NO_FAILOVER. The default is NO_FAILOVER.", @@ -4019,7 +5952,8 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ - "compute.instanceGroupManagers.insert" + "compute.instanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.insert" ] } }, @@ -4030,6 +5964,10 @@ "$ref": "NamedPort" } }, + "pendingActions": { + "$ref": "InstanceGroupManagerPendingActionsSummary", + "description": "[Output Only] The list of instance actions and the number of instances in this managed instance group that are pending for each of those actions." + }, "region": { "type": "string", "description": "[Output Only] The URL of the region where the managed instance group resides (for regional resources)." @@ -4040,7 +5978,7 @@ }, "serviceAccount": { "type": "string", - "description": "Service account will be used as credentials for all operations performed by managed instance group on instances. The service accounts needs all permissions required to create and delete instances. When not specified, the service account {projectNumber}@cloudservices.gserviceaccount.com will be used." + "description": "[Output Only] The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account {projectNumber}@cloudservices.gserviceaccount.com is used." }, "targetPools": { "type": "array", @@ -4055,10 +5993,22 @@ "format": "int32", "annotations": { "required": [ - "compute.instanceGroupManagers.insert" + "compute.instanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.insert" ] } }, + "updatePolicy": { + "$ref": "InstanceGroupManagerUpdatePolicy", + "description": "The update policy for this managed instance group." + }, + "versions": { + "type": "array", + "description": "Versions supported by this IGM. User should set this field if they need fine-grained control over how many instances in each version are run by this IGM. Versions are keyed by instanceTemplate. Every instanceTemplate can appear at most once. This field overrides instanceTemplate field. If both instanceTemplate and versions are set, the user receives a warning. \"instanceTemplate: X\" is semantically equivalent to \"versions [ { instanceTemplate: X } ]\". Exactly one version must have targetSize field left unset. Size of such a version will be calculated automatically.", + "items": { + "$ref": "InstanceGroupManagerVersion" + } + }, "zone": { "type": "string", "description": "[Output Only] The URL of the zone where the managed instance group is located (for zonal resources)." @@ -4108,6 +6058,11 @@ "type": "integer", "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.", "format": "int32" + }, + "verifying": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are being verified. More details regarding verification process are covered in the documentation of ManagedInstance.InstanceAction.VERIFYING enum field.", + "format": "int32" } } }, @@ -4117,11 +6072,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of filtered managed instance group lists.", + "description": "A list of InstanceGroupManagersScopedList resources.", "additionalProperties": { "$ref": "InstanceGroupManagersScopedList", "description": "[Output Only] The name of the scope that contains this set of managed instance groups." @@ -4138,7 +6093,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4164,11 +6188,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of managed instance groups.", + "description": "A list of InstanceGroupManager resources.", "items": { "$ref": "InstanceGroupManager" } @@ -4185,6 +6209,160 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "InstanceGroupManagerPendingActionsSummary": { + "id": "InstanceGroupManagerPendingActionsSummary", + "type": "object", + "properties": { + "creating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are pending to be created.", + "format": "int32" + }, + "deleting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are pending to be deleted.", + "format": "int32" + }, + "recreating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are pending to be recreated.", + "format": "int32" + }, + "restarting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are pending to be restarted.", + "format": "int32" + } + } + }, + "InstanceGroupManagerUpdatePolicy": { + "id": "InstanceGroupManagerUpdatePolicy", + "type": "object", + "properties": { + "maxSurge": { + "$ref": "FixedOrPercent", + "description": "Maximum number of instances that can be created above the InstanceGroupManager.targetSize during the update process. By default, a fixed value of 1 is used. Using maxSurge \u003e 0 will cause instance names to change during the update process. At least one of { maxSurge, maxUnavailable } must be greater than 0." + }, + "maxUnavailable": { + "$ref": "FixedOrPercent", + "description": "Maximum number of instances that can be unavailable during the update process. The instance is considered available if all of the following conditions are satisfied: 1. Instance's status is RUNNING. 2. Instance's liveness health check result was observed to be HEALTHY at least once. By default, a fixed value of 1 is used. At least one of { maxSurge, maxUnavailable } must be greater than 0." + }, + "minReadySec": { + "type": "integer", + "description": "Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].", + "format": "int32" + }, + "minimalAction": { + "type": "string", + "description": "Minimal action to be taken on an instance. The order of action types is: RESTART \u003c REPLACE.", + "enum": [ + "REPLACE", + "RESTART" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "type": { + "type": "string", + "enum": [ + "OPPORTUNISTIC", + "PROACTIVE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "InstanceGroupManagerVersion": { + "id": "InstanceGroupManagerVersion", + "type": "object", + "properties": { + "instanceTemplate": { + "type": "string" + }, + "name": { + "type": "string", + "description": "Name of the version. Unique among all versions in the scope of this managed instance group." + }, + "targetSize": { + "$ref": "FixedOrPercent", + "description": "Intended number of instances that are created from instanceTemplate. The final number of instances created from instanceTemplate will be equal to: * if expressed as fixed number: min(targetSize.fixed, instanceGroupManager.targetSize), * if expressed as percent: ceiling(targetSize.percent * InstanceGroupManager.targetSize). If unset, this version will handle all the remaining instances." } } }, @@ -4400,11 +6578,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this list of instances in the specified instance group. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of instances and any named ports that are assigned to those instances.", + "description": "A list of InstanceWithNamedPorts resources.", "items": { "$ref": "InstanceWithNamedPorts" } @@ -4420,7 +6598,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this list of instances in the specified instance groups. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4562,11 +6809,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of instances.", + "description": "A list of Instance resources.", "items": { "$ref": "Instance" } @@ -4583,6 +6830,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4593,11 +6909,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of referrers.", + "description": "A list of Reference resources.", "items": { "$ref": "Reference" } @@ -4614,6 +6930,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4638,7 +7023,7 @@ "properties": { "canIpForward": { "type": "boolean", - "description": "Enables 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, specify true. If unsure, leave this set to false. See the Enable IP forwarding for instances documentation for more information." + "description": "Enables 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, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information." }, "description": { "type": "string", @@ -4678,6 +7063,10 @@ "$ref": "Metadata", "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." }, + "minCpuPlatform": { + "type": "string", + "description": "Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: \"Intel Haswell\" or minCpuPlatform: \"Intel Sandy Bridge\". For more information, read Specifying a Minimum CPU Platform." + }, "networkInterfaces": { "type": "array", "description": "An array of network access configurations for this interface.", @@ -4762,11 +7151,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] list of InstanceTemplate resources.", + "description": "A list of InstanceTemplate resources.", "items": { "$ref": "InstanceTemplate" } @@ -4782,7 +7171,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this instance template list. The server defines this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -4949,6 +7407,16 @@ } } }, + "InstancesSetMinCpuPlatformRequest": { + "id": "InstancesSetMinCpuPlatformRequest", + "type": "object", + "properties": { + "minCpuPlatform": { + "type": "string", + "description": "Minimum cpu/platform this instance should be started at." + } + } + }, "InstancesSetServiceAccountRequest": { "id": "InstancesSetServiceAccountRequest", "type": "object", @@ -4979,6 +7447,901 @@ } } }, + "Interconnect": { + "id": "Interconnect", + "type": "object", + "description": "Protocol definitions for Mixer API to support Interconnect. Next available tag: 23", + "properties": { + "adminEnabled": { + "type": "boolean", + "description": "Administrative status of the interconnect. When this is set to ?true?, the Interconnect is functional and may carry traffic (assuming there are functional InterconnectAttachments and other requirements are satisfied). When set to ?false?, no packets will be carried over this Interconnect and no BGP routes will be exchanged over it. By default, it is set to ?true?." + }, + "circuitInfos": { + "type": "array", + "description": "[Output Only] List of CircuitInfo objects, that describe the individual circuits in this LAG.", + "items": { + "$ref": "InterconnectCircuitInfo" + } + }, + "connectionAuthorization": { + "type": "string", + "description": "[Output Only] URL to retrieve the Letter Of Authority and Customer Facility Assignment (LOA-CFA) documentation relating to this Interconnect. This documentation authorizes the facility provider to connect to the specified crossconnect ports." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "customerName": { + "type": "string", + "description": "Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "expectedOutages": { + "type": "array", + "description": "[Output Only] List of outages expected for this Interconnect.", + "items": { + "$ref": "InterconnectOutageNotification" + } + }, + "googleIpAddress": { + "type": "string", + "description": "[Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests." + }, + "googleReferenceId": { + "type": "string", + "description": "[Output Only] Google reference ID; to be used when raising support tickets with Google or otherwise to debug backend connectivity issues." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "interconnectAttachments": { + "type": "array", + "description": "[Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect.", + "items": { + "type": "string" + } + }, + "interconnectType": { + "type": "string", + "enum": [ + "IT_PRIVATE" + ], + "enumDescriptions": [ + "" + ] + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#interconnect for interconnects.", + "default": "compute#interconnect" + }, + "linkType": { + "type": "string", + "enum": [ + "LINK_TYPE_ETHERNET_10G_LR" + ], + "enumDescriptions": [ + "" + ] + }, + "location": { + "type": "string", + "description": "URL of the InterconnectLocation object that represents where this connection is to be provisioned." + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.interconnects.insert" + ] + } + }, + "nocContactEmail": { + "type": "string", + "description": "Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Stackdriver logs alerting and Cloud Notifications." + }, + "operationalStatus": { + "type": "string", + "description": "[Output Only] The current status of whether or not this Interconnect is functional.", + "enum": [ + "OS_ACTIVE", + "OS_UNPROVISIONED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "peerIpAddress": { + "type": "string", + "description": "[Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests." + }, + "provisionedLinkCount": { + "type": "integer", + "description": "[Output Only] Number of links actually provisioned in this interconnect.", + "format": "int32" + }, + "requestedLinkCount": { + "type": "integer", + "description": "Target number of physical links in the link bundle, as requested by the customer.", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "InterconnectAttachment": { + "id": "InterconnectAttachment", + "type": "object", + "description": "Protocol definitions for Mixer API to support InterconnectAttachment. Next available tag: 18", + "properties": { + "cloudRouterIpAddress": { + "type": "string", + "description": "[Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "customerRouterIpAddress": { + "type": "string", + "description": "[Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "googleReferenceId": { + "type": "string", + "description": "[Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "interconnect": { + "type": "string", + "description": "URL of the underlying Interconnect object that this attachment's traffic will traverse through." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments.", + "default": "compute#interconnectAttachment" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "operationalStatus": { + "type": "string", + "description": "[Output Only] The current status of whether or not this interconnect attachment is functional.", + "enum": [ + "OS_ACTIVE", + "OS_UNPROVISIONED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "privateInterconnectInfo": { + "$ref": "InterconnectAttachmentPrivateInfo", + "description": "[Output Only] Information specific to a Private InterconnectAttachment. Only populated if the interconnect that this is attached is of type IT_PRIVATE." + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the regional interconnect attachment resides." + }, + "router": { + "type": "string", + "description": "URL of the cloud router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network & region within which the Cloud Router is configured." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "InterconnectAttachmentAggregatedList": { + "id": "InterconnectAttachmentAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A list of InterconnectAttachmentsScopedList resources.", + "additionalProperties": { + "$ref": "InterconnectAttachmentsScopedList", + "description": "Name of the scope containing this set of interconnect attachments." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments.", + "default": "compute#interconnectAttachmentAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "InterconnectAttachmentList": { + "id": "InterconnectAttachmentList", + "type": "object", + "description": "Response to the list request, and contains a list of interconnect attachments.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of InterconnectAttachment resources.", + "items": { + "$ref": "InterconnectAttachment" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments.", + "default": "compute#interconnectAttachmentList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "InterconnectAttachmentPrivateInfo": { + "id": "InterconnectAttachmentPrivateInfo", + "type": "object", + "description": "Private information for an interconnect attachment when this belongs to an interconnect of type IT_PRIVATE.", + "properties": { + "tag8021q": { + "type": "integer", + "description": "[Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region.", + "format": "uint32" + } + } + }, + "InterconnectAttachmentsScopedList": { + "id": "InterconnectAttachmentsScopedList", + "type": "object", + "properties": { + "interconnectAttachments": { + "type": "array", + "description": "List of interconnect attachments contained in this scope.", + "items": { + "$ref": "InterconnectAttachment" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "InterconnectCircuitInfo": { + "id": "InterconnectCircuitInfo", + "type": "object", + "description": "Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only. Next id: 4", + "properties": { + "customerDemarcId": { + "type": "string", + "description": "Customer-side demarc ID for this circuit. This will only be set if it was provided by the Customer to Google during circuit turn-up." + }, + "googleCircuitId": { + "type": "string", + "description": "Google-assigned unique ID for this circuit. Assigned at circuit turn-up." + }, + "googleDemarcId": { + "type": "string", + "description": "Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA." + } + } + }, + "InterconnectList": { + "id": "InterconnectList", + "type": "object", + "description": "Response to the list request, and contains a list of interconnects.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Interconnect resources.", + "items": { + "$ref": "Interconnect" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#interconnectList for lists of interconnects.", + "default": "compute#interconnectList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "InterconnectLocation": { + "id": "InterconnectLocation", + "type": "object", + "description": "Protocol definitions for Mixer API to support InterconnectLocation.", + "properties": { + "address": { + "type": "string", + "description": "[Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character." + }, + "availabilityZone": { + "type": "string", + "description": "Availability zone for this location. Within a city, maintenance will not be simultaneously scheduled in more than one availability zone. Example: \"zone1\" or \"zone2\"." + }, + "city": { + "type": "string", + "description": "City designator used by the Interconnect UI to locate this InterconnectLocation within the Continent. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\"." + }, + "continent": { + "type": "string", + "description": "Continent for this location. Used by the location picker in the Interconnect UI.", + "enum": [ + "C_AFRICA", + "C_ASIA_PAC", + "C_EUROPE", + "C_NORTH_AMERICA", + "C_SOUTH_AMERICA" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "[Output Only] An optional description of the resource." + }, + "facilityProvider": { + "type": "string", + "description": "[Output Only] The name of the provider for this facility (e.g., EQUINIX)." + }, + "facilityProviderFacilityId": { + "type": "string", + "description": "[Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1)." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations.", + "default": "compute#interconnectLocation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "peeringdbFacilityId": { + "type": "string", + "description": "[Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb)." + }, + "regionInfos": { + "type": "array", + "description": "[Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions.", + "items": { + "$ref": "InterconnectLocationRegionInfo" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "InterconnectLocationList": { + "id": "InterconnectLocationList", + "type": "object", + "description": "Response to the list request, and contains a list of interconnect locations.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of InterconnectLocation resources.", + "items": { + "$ref": "InterconnectLocation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations.", + "default": "compute#interconnectLocationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "InterconnectLocationRegionInfo": { + "id": "InterconnectLocationRegionInfo", + "type": "object", + "description": "Information about any potential InterconnectAttachments between an Interconnect at a specific InterconnectLocation, and a specific Cloud Region.", + "properties": { + "expectedRttMs": { + "type": "string", + "description": "Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region.", + "format": "int64" + }, + "locationPresence": { + "type": "string", + "description": "Identifies the network presence of this location.", + "enum": [ + "LP_GLOBAL", + "LP_LOCAL_REGION" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "region": { + "type": "string", + "description": "URL for the region of this location." + }, + "regionKey": { + "type": "string", + "description": "Scope key for the region of this location." + } + } + }, + "InterconnectOutageNotification": { + "id": "InterconnectOutageNotification", + "type": "object", + "description": "Description of a planned outage on this Interconnect. Next id: 9", + "properties": { + "affectedCircuits": { + "type": "array", + "description": "Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected.", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "description": "Short user-visible description of the purpose of the outage." + }, + "endTime": { + "type": "string", + "format": "int64" + }, + "issueType": { + "type": "string", + "enum": [ + "IT_OUTAGE", + "IT_PARTIAL_OUTAGE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Unique identifier for this outage notification." + }, + "source": { + "type": "string", + "enum": [ + "NSRC_GOOGLE" + ], + "enumDescriptions": [ + "" + ] + }, + "startTime": { + "type": "string", + "description": "Scheduled start and end times for the outage (milliseconds since Unix epoch).", + "format": "int64" + }, + "state": { + "type": "string", + "enum": [ + "NS_ACTIVE", + "NS_CANCELED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, "License": { "id": "License", "type": "object", @@ -4986,7 +8349,7 @@ "properties": { "chargesUseFee": { "type": "boolean", - "description": "[Output Only] If true, the customer will be charged license fee for running software that contains this license on an instance." + "description": "[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee." }, "kind": { "type": "string", @@ -5014,16 +8377,49 @@ "type": "object", "description": "Specifies what kind of log the caller must write", "properties": { + "cloudAudit": { + "$ref": "LogConfigCloudAuditOptions", + "description": "Cloud audit options." + }, "counter": { "$ref": "LogConfigCounterOptions", "description": "Counter options." + }, + "dataAccess": { + "$ref": "LogConfigDataAccessOptions", + "description": "Data access options." + } + } + }, + "LogConfigCloudAuditOptions": { + "id": "LogConfigCloudAuditOptions", + "type": "object", + "description": "Write a Cloud Audit log", + "properties": { + "authorizationLoggingOptions": { + "$ref": "AuthorizationLoggingOptions", + "description": "Information used by the Cloud Audit Logging pipeline." + }, + "logName": { + "type": "string", + "description": "The log_name to populate in the Cloud Audit Record.", + "enum": [ + "ADMIN_ACTIVITY", + "DATA_ACCESS", + "UNSPECIFIED_LOG_NAME" + ], + "enumDescriptions": [ + "", + "", + "" + ] } } }, "LogConfigCounterOptions": { "id": "LogConfigCounterOptions", "type": "object", - "description": "Options for counters", + "description": "Increment a streamz counter with the specified metric and field names.\n\nMetric 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.\n\nField names correspond to IAM request parameters and field values are their respective values.\n\nAt present the only supported field names are - \"iam_principal\", corresponding to IAMContext.principal; - \"\" (empty string), resulting in one aggretated counter with no field.\n\nExamples: counter { metric: \"/debug_access_count\" field: \"iam_principal\" } ==\u003e increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}\n\nAt 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": { "field": { "type": "string", @@ -5035,6 +8431,25 @@ } } }, + "LogConfigDataAccessOptions": { + "id": "LogConfigDataAccessOptions", + "type": "object", + "description": "Write a Data Access (Gin) log", + "properties": { + "logMode": { + "type": "string", + "description": "Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now.", + "enum": [ + "LOG_FAIL_CLOSED", + "LOG_MODE_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, "MachineType": { "id": "MachineType", "type": "object", @@ -5107,11 +8522,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped machine type lists.", + "description": "A list of MachineTypesScopedList resources.", "additionalProperties": { "$ref": "MachineTypesScopedList", "description": "[Output Only] Name of the scope containing this set of machine types." @@ -5129,6 +8544,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5139,11 +8623,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Machine Type resources.", + "description": "A list of MachineType resources.", "items": { "$ref": "MachineType" } @@ -5160,6 +8644,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5260,7 +8813,8 @@ "NONE", "RECREATING", "REFRESHING", - "RESTARTING" + "RESTARTING", + "VERIFYING" ], "enumDescriptions": [ "", @@ -5270,6 +8824,7 @@ "", "", "", + "", "" ] }, @@ -5392,7 +8947,7 @@ }, "value": { "type": "string", - "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).", "annotations": { "required": [ "compute.instances.insert", @@ -5480,6 +9035,10 @@ "$ref": "NetworkPeering" } }, + "routingConfig": { + "$ref": "NetworkRoutingConfig", + "description": "The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce." + }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." @@ -5512,6 +9071,11 @@ "$ref": "AliasIpRange" } }, + "fingerprint": { + "type": "string", + "description": "Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface.", + "format": "byte" + }, "kind": { "type": "string", "description": "[Output Only] Type of the resource. Always compute#networkInterface for network interfaces.", @@ -5542,11 +9106,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Network resources.", + "description": "A list of Network resources.", "items": { "$ref": "Network" } @@ -5563,6 +9127,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5601,6 +9234,25 @@ } } }, + "NetworkRoutingConfig": { + "id": "NetworkRoutingConfig", + "type": "object", + "description": "A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide.", + "properties": { + "routingMode": { + "type": "string", + "description": "The network-wide routing mode to use. If set to REGIONAL, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set to GLOBAL, this network's cloud routers will advertise routes with all subnetworks of this network, across regions.", + "enum": [ + "GLOBAL", + "REGIONAL" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, "NetworksAddPeeringRequest": { "id": "NetworksAddPeeringRequest", "type": "object", @@ -5862,6 +9514,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -5893,6 +9614,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6036,7 +9826,7 @@ }, "bindings": { "type": "array", - "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "description": "Associates a list of `members` to a `role`. `bindings` with no members will result in an error.", "items": { "$ref": "Binding" } @@ -6123,7 +9913,7 @@ }, "xpnProjectStatus": { "type": "string", - "description": "[Output Only] The role this project has in a Cross Project Network (XPN) configuration. Currently only HOST projects are differentiated.", + "description": "[Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated.", "enum": [ "HOST", "UNSPECIFIED_XPN_PROJECT_STATUS" @@ -6141,7 +9931,7 @@ "properties": { "xpnResource": { "$ref": "XpnResourceId", - "description": "XPN resource ID." + "description": "Service resource (a.k.a service project) ID." } } }, @@ -6151,7 +9941,7 @@ "properties": { "xpnResource": { "$ref": "XpnResourceId", - "description": "XPN resource ID." + "description": "Service resource (a.k.a service project) ID." } } }, @@ -6161,7 +9951,7 @@ "properties": { "kind": { "type": "string", - "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of XPN resources.", + "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects)", "default": "compute#projectsGetXpnResources" }, "nextPageToken": { @@ -6170,7 +9960,7 @@ }, "resources": { "type": "array", - "description": "XPN resources attached to this project as their XPN host.", + "description": "Service resources (a.k.a service projects) attached to this project as their shared VPC host.", "items": { "$ref": "XpnResourceId" } @@ -6183,7 +9973,7 @@ "properties": { "organization": { "type": "string", - "description": "Optional organization ID managed by Cloud Resource Manager, for which to list XPN host projects. If not specified, the organization will be inferred from the project." + "description": "Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project." } } }, @@ -6216,15 +10006,20 @@ "INSTANCE_GROUPS", "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", + "INTERCONNECTS", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", "NETWORKS", "NVIDIA_K80_GPUS", + "NVIDIA_P100_GPUS", "PREEMPTIBLE_CPUS", + "PREEMPTIBLE_LOCAL_SSD_GB", "REGIONAL_AUTOSCALERS", "REGIONAL_INSTANCE_GROUP_MANAGERS", "ROUTERS", "ROUTES", + "SECURITY_POLICIES", + "SECURITY_POLICY_RULES", "SNAPSHOTS", "SSD_TOTAL_GB", "SSL_CERTIFICATES", @@ -6235,6 +10030,7 @@ "TARGET_INSTANCES", "TARGET_POOLS", "TARGET_SSL_PROXIES", + "TARGET_TCP_PROXIES", "TARGET_VPN_GATEWAYS", "URL_MAPS", "VPN_TUNNELS" @@ -6276,6 +10072,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6380,11 +10182,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of autoscalers.", + "description": "A list of Autoscaler resources.", "items": { "$ref": "Autoscaler" } @@ -6396,11 +10198,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6411,7 +10282,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -6431,7 +10302,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6442,11 +10382,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of managed instance groups.", + "description": "A list of InstanceGroupManager resources.", "items": { "$ref": "InstanceGroupManager" } @@ -6458,11 +10398,80 @@ }, "nextPageToken": { "type": "string", - "description": "[Output only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", - "description": "[Output only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6568,11 +10577,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of instances and any named ports that are assigned to those instances.", + "description": "A list of InstanceWithNamedPorts resources.", "items": { "$ref": "InstanceWithNamedPorts" } @@ -6588,7 +10597,76 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6640,11 +10718,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Region resources.", + "description": "A list of Region resources.", "items": { "$ref": "Region" } @@ -6661,6 +10739,93 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "RegionSetLabelsRequest": { + "id": "RegionSetLabelsRequest", + "type": "object", + "properties": { + "labelFingerprint": { + "type": "string", + "description": "The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "The labels to set for this resource.", + "additionalProperties": { + "type": "string" + } } } }, @@ -6671,12 +10836,12 @@ "properties": { "amount": { "type": "string", - "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes).", + "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.", "format": "int64" }, "type": { "type": "string", - "description": "Type of resource for which this commitment applies.", + "description": "Type of resource for which this commitment applies. Possible values are VCPU and MEMORY", "enum": [ "MEMORY", "UNSPECIFIED", @@ -6703,7 +10868,7 @@ "Route": { "id": "Route", "type": "object", - "description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.", + "description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.", "properties": { "creationTimestamp": { "type": "string", @@ -6882,11 +11047,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Route resources.", + "description": "A list of Route resources.", "items": { "$ref": "Route" } @@ -6903,6 +11068,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -6983,11 +11217,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped router lists.", + "description": "A list of Router resources.", "additionalProperties": { "$ref": "RoutersScopedList", "description": "Name of the scope containing this set of routers." @@ -7005,6 +11239,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7060,6 +11363,10 @@ "type": "string", "description": "IP address and range of the interface. The IP range must be in the RFC3927 link-local IP space. The value must be a CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents the IP address of the interface." }, + "linkedInterconnectAttachment": { + "type": "string", + "description": "URI of the linked interconnect attachment. It must be in the same region as the router. Each interface can have at most one linked resource and it could either be a VPN Tunnel or an interconnect attachment." + }, "linkedVpnTunnel": { "type": "string", "description": "URI of the linked VPN tunnel. It must be in the same region as the router. Each interface can have at most one linked resource and it could either be a VPN Tunnel or an interconnect attachment." @@ -7078,7 +11385,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -7099,6 +11406,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7426,6 +11802,203 @@ } } }, + "SecurityPolicy": { + "id": "SecurityPolicy", + "type": "object", + "description": "A security policy is comprised of one or more rules. It can also be associated with one or more 'targets'.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.\n\nTo see the latest fingerprint, make get() request to the security policy.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output only] Type of the resource. Always compute#securityPolicyfor security policies", + "default": "compute#securityPolicy" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "rules": { + "type": "array", + "description": "List of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match \"*\"). If no rules are provided when creating a security policy, a default rule with action \"allow\" will be added.", + "items": { + "$ref": "SecurityPolicyRule" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "SecurityPolicyList": { + "id": "SecurityPolicyList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of SecurityPolicy resources.", + "items": { + "$ref": "SecurityPolicy" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies", + "default": "compute#securityPolicyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, + "SecurityPolicyReference": { + "id": "SecurityPolicyReference", + "type": "object", + "properties": { + "securityPolicy": { + "type": "string" + } + } + }, + "SecurityPolicyRule": { + "id": "SecurityPolicyRule", + "type": "object", + "description": "Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).", + "properties": { + "action": { + "type": "string", + "description": "The Action to preform when the client connection triggers the rule. Can currently be either \"allow\" or \"deny()\" where valid values for status are 403, 404, and 502." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "kind": { + "type": "string", + "description": "[Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules", + "default": "compute#securityPolicyRule" + }, + "match": { + "$ref": "SecurityPolicyRuleMatcher", + "description": "A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding ?action? is enforced." + }, + "preview": { + "type": "boolean", + "description": "If set to true, the specified action is not enforced." + }, + "priority": { + "type": "integer", + "description": "An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated in the increasing order of priority.", + "format": "int32" + } + } + }, + "SecurityPolicyRuleMatcher": { + "id": "SecurityPolicyRuleMatcher", + "type": "object", + "description": "Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.", + "properties": { + "srcIpRanges": { + "type": "array", + "description": "CIDR IP address range. Only IPv4 is supported.", + "items": { + "type": "string" + } + } + } + }, "SerialPortOutput": { "id": "SerialPortOutput", "type": "object", @@ -7566,7 +12139,7 @@ }, "storageBytes": { "type": "string", - "description": "[Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", + "description": "[Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", "format": "int64" }, "storageBytesStatus": { @@ -7590,11 +12163,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Snapshot resources.", + "description": "A list of Snapshot resources.", "items": { "$ref": "Snapshot" } @@ -7611,6 +12184,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7663,7 +12305,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -7684,6 +12326,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7692,17 +12403,26 @@ "type": "object", "description": "A Subnetwork resource.", "properties": { + "allowSubnetCidrRoutesOverlap": { + "type": "boolean", + "description": "Whether this subnetwork can conflict with static routes. Setting this to true allows this subnetwork's primary and secondary ranges to conflict with routes that have already been configured on the corresponding network. Static routes will take precedence over the subnetwork route if the route prefix length is at least as large as the subnetwork prefix length.\n\nAlso, packets destined to IPs within subnetwork may contain private/sensitive data and are prevented from leaving the virtual network. Setting this field to true will disable this feature.\n\nThe default value is false and applies to all existing subnetworks and automatically created subnetworks.\n\nThis field cannot be set to true at resource creation time." + }, "creationTimestamp": { "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional description of this resource. Provide this property when you create the resource." + "description": "An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time." + }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork.", + "format": "byte" }, "gatewayAddress": { "type": "string", - "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork." + "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time." }, "id": { "type": "string", @@ -7711,7 +12431,7 @@ }, "ipCidrRange": { "type": "string", - "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported." + "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time." }, "kind": { "type": "string", @@ -7725,15 +12445,15 @@ }, "network": { "type": "string", - "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks." + "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time." }, "privateIpGoogleAccess": { "type": "boolean", - "description": "Whether the VMs in this subnet can access Google services without assigned external IP addresses." + "description": "Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess." }, "region": { "type": "string", - "description": "URL of the region where the Subnetwork resides." + "description": "URL of the region where the Subnetwork resides. This field can be set only at resource creation time." }, "secondaryIpRanges": { "type": "array", @@ -7754,11 +12474,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output] A map of scoped Subnetwork lists.", + "description": "A list of SubnetworksScopedList resources.", "additionalProperties": { "$ref": "SubnetworksScopedList", "description": "Name of the scope containing this set of Subnetworks." @@ -7776,6 +12496,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -7786,11 +12575,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "The Subnetwork resources.", + "description": "A list of Subnetwork resources.", "items": { "$ref": "Subnetwork" } @@ -7807,6 +12596,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8025,7 +12883,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8046,6 +12904,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8114,7 +13041,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8135,6 +13062,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8200,7 +13196,7 @@ }, "items": { "type": "object", - "description": "A map of scoped target instance lists.", + "description": "A list of TargetInstance resources.", "additionalProperties": { "$ref": "TargetInstancesScopedList", "description": "Name of the scope containing this set of target instances." @@ -8218,6 +13214,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8228,7 +13293,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8249,6 +13314,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8419,11 +13553,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped target pool lists.", + "description": "A list of TargetPool resources.", "additionalProperties": { "$ref": "TargetPoolsScopedList", "description": "Name of the scope containing this set of target pools." @@ -8441,6 +13575,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8468,7 +13671,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8489,6 +13692,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8740,7 +14012,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8761,6 +14033,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8849,7 +14190,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -8870,6 +14211,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8961,11 +14371,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped target vpn gateway lists.", + "description": "A list of TargetVpnGateway resources.", "additionalProperties": { "$ref": "TargetVpnGatewaysScopedList", "description": "[Output Only] Name of the scope containing this set of target VPN gateways." @@ -8983,6 +14393,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -8993,11 +14472,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of TargetVpnGateway resources.", + "description": "A list of TargetVpnGateway resources.", "items": { "$ref": "TargetVpnGateway" } @@ -9014,6 +14493,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9237,7 +14785,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Set by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -9258,6 +14806,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9482,11 +15099,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped vpn tunnel lists.", + "description": "A list of VpnTunnelsScopedList resources.", "additionalProperties": { "$ref": "VpnTunnelsScopedList", "description": "Name of the scope containing this set of vpn tunnels." @@ -9504,6 +15121,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9514,11 +15200,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of VpnTunnel resources.", + "description": "A list of VpnTunnel resources.", "items": { "$ref": "VpnTunnel" } @@ -9535,6 +15221,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9626,18 +15381,18 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of XPN host project URLs.", + "description": "[Output Only] A list of shared VPC host project URLs.", "items": { "$ref": "Project" } }, "kind": { "type": "string", - "description": "[Output Only] Type of resource. Always compute#xpnHostList for lists of XPN hosts.", + "description": "[Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts.", "default": "compute#xpnHostList" }, "nextPageToken": { @@ -9647,21 +15402,90 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, "XpnResourceId": { "id": "XpnResourceId", "type": "object", - "description": "XpnResourceId", + "description": "Service resource (a.k.a service project) ID.", "properties": { "id": { "type": "string", - "description": "The ID of the XPN resource. In the case of projects, this field matches the project's name, not the canonical ID." + "description": "The ID of the service resource. In the case of projects, this field matches the project ID (e.g., my-project), not the project number (e.g., 12345678)." }, "type": { "type": "string", - "description": "The type of the XPN resource.", + "description": "The type of the service resource.", "enum": [ "PROJECT", "XPN_RESOURCE_TYPE_UNSPECIFIED" @@ -9678,6 +15502,13 @@ "type": "object", "description": "A Zone resource.", "properties": { + "availableCpuPlatforms": { + "type": "array", + "description": "[Output Only] Available cpu/platform selections for the zone.", + "items": { + "type": "string" + } + }, "creationTimestamp": { "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." @@ -9737,7 +15568,7 @@ }, "items": { "type": "array", - "description": "[Output Only] A list of Zone resources.", + "description": "A list of Zone resources.", "items": { "$ref": "Zone" } @@ -9754,6 +15585,75 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for this resource." + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } } } }, @@ -9787,7 +15687,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9878,7 +15778,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9939,7 +15839,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10006,6 +15906,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10082,6 +15987,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10107,7 +16017,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10156,6 +16066,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "id": "compute.addresses.setLabels", + "path": "{project}/regions/{region}/addresses/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "The region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "resource" + ], + "request": { + "$ref": "RegionSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "testIamPermissions": { "id": "compute.addresses.testIamPermissions", "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions", @@ -10213,7 +16172,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10274,6 +16233,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -10350,6 +16314,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -10381,7 +16350,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10434,7 +16403,7 @@ "id": "compute.autoscalers.patch", "path": "{project}/zones/{zone}/autoscalers", "httpMethod": "PATCH", - "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "autoscaler": { "type": "string", @@ -10449,6 +16418,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -10469,8 +16443,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -10537,6 +16510,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -10583,6 +16561,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10643,6 +16626,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10667,7 +16655,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10712,7 +16700,7 @@ "id": "compute.backendBuckets.patch", "path": "{project}/global/backendBuckets/{backendBucket}", "httpMethod": "PATCH", - "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports patch semantics.", + "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendBucket": { "type": "string", @@ -10727,6 +16715,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10741,8 +16734,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -10764,6 +16756,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10793,7 +16790,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10853,6 +16850,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10949,6 +16951,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10973,7 +16980,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11018,7 +17025,7 @@ "id": "compute.backendServices.patch", "path": "{project}/global/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendService": { "type": "string", @@ -11033,6 +17040,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11047,8 +17059,47 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" + ] + }, + "setSecurityPolicy": { + "id": "compute.backendServices.setSecurityPolicy", + "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy", + "httpMethod": "POST", + "description": "Sets the security policy for the specified backend service.", + "parameters": { + "backendService": { + "type": "string", + "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.", + "required": true, + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "backendService" + ], + "request": { + "$ref": "SecurityPolicyReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -11068,7 +17119,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -11107,6 +17158,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11136,7 +17192,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11227,7 +17283,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11288,7 +17344,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11353,6 +17409,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -11396,6 +17457,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -11472,6 +17538,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "sourceImage": { "type": "string", "description": "Optional. Source image to restore onto a disk.", @@ -11508,7 +17579,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11577,6 +17648,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -11605,7 +17681,7 @@ "id": "compute.disks.setLabels", "path": "{project}/zones/{zone}/disks/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -11614,6 +17690,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "resource": { "type": "string", "description": "Name of the resource for this request.", @@ -11713,6 +17794,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11773,6 +17859,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11797,7 +17888,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11842,7 +17933,7 @@ "id": "compute.firewalls.patch", "path": "{project}/global/firewalls/{firewall}", "httpMethod": "PATCH", - "description": "Updates the specified firewall rule with the data included in the request. This method supports patch semantics.", + "description": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "firewall": { "type": "string", @@ -11857,6 +17948,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11871,8 +17967,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -11892,7 +17987,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -11931,6 +18026,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11960,7 +18060,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12027,6 +18127,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12103,6 +18208,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12128,7 +18238,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12177,6 +18287,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "id": "compute.forwardingRules.setLabels", + "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "The region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "resource" + ], + "request": { + "$ref": "RegionSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setTarget": { "id": "compute.forwardingRules.setTarget", "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", @@ -12203,6 +18362,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12289,6 +18453,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12349,6 +18518,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12373,7 +18547,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12414,6 +18588,42 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "id": "compute.globalAddresses.setLabels", + "path": "{project}/global/addresses/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "GlobalSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "testIamPermissions": { "id": "compute.globalAddresses.testIamPermissions", "path": "{project}/global/addresses/{resource}/testIamPermissions", @@ -12431,7 +18641,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -12474,6 +18684,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12534,6 +18749,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12558,7 +18778,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12599,6 +18819,42 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "id": "compute.globalForwardingRules.setLabels", + "path": "{project}/global/forwardingRules/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "GlobalSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setTarget": { "id": "compute.globalForwardingRules.setTarget", "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget", @@ -12618,6 +18874,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12652,7 +18913,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -12684,7 +18945,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12797,7 +19058,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12861,6 +19122,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12921,6 +19187,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12945,7 +19216,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12990,7 +19261,7 @@ "id": "compute.healthChecks.patch", "path": "{project}/global/healthChecks/{healthCheck}", "httpMethod": "PATCH", - "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "healthCheck": { "type": "string", @@ -13005,6 +19276,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13019,8 +19295,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -13040,7 +19315,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -13079,6 +19354,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13119,6 +19399,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13179,6 +19464,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13203,7 +19493,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13248,7 +19538,7 @@ "id": "compute.httpHealthChecks.patch", "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", "httpMethod": "PATCH", - "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "httpHealthCheck": { "type": "string", @@ -13263,6 +19553,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13277,8 +19572,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -13298,7 +19592,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -13337,6 +19631,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13377,6 +19676,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13437,6 +19741,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13461,7 +19770,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13506,7 +19815,7 @@ "id": "compute.httpsHealthChecks.patch", "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", "httpMethod": "PATCH", - "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "httpsHealthCheck": { "type": "string", @@ -13521,6 +19830,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13535,8 +19849,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -13556,7 +19869,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -13595,6 +19908,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13635,6 +19953,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13668,6 +19991,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13759,12 +20087,22 @@ "httpMethod": "POST", "description": "Creates an image in the specified project using the data included in the request.", "parameters": { + "forceCreate": { + "type": "boolean", + "description": "Force image creation if 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13792,7 +20130,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13837,7 +20175,7 @@ "id": "compute.images.setLabels", "path": "{project}/global/images/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on an image. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -13886,7 +20224,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -13914,7 +20252,7 @@ "id": "compute.instanceGroupManagers.abandonInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", "httpMethod": "POST", - "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -13929,6 +20267,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -13960,7 +20303,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14020,6 +20363,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14044,7 +20392,7 @@ "id": "compute.instanceGroupManagers.deleteInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", "httpMethod": "POST", - "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14059,6 +20407,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14126,7 +20479,7 @@ "id": "compute.instanceGroupManagers.insert", "path": "{project}/zones/{zone}/instanceGroupManagers", "httpMethod": "POST", - "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group.", + "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.", "parameters": { "project": { "type": "string", @@ -14135,6 +20488,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where you want to create the managed instance group.", @@ -14165,7 +20523,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14276,7 +20634,7 @@ "id": "compute.instanceGroupManagers.patch", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", "httpMethod": "PATCH", - "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports patch semantics.", + "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14291,6 +20649,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where you want to create the managed instance group.", @@ -14311,15 +20674,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "recreateInstances": { "id": "compute.instanceGroupManagers.recreateInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", "httpMethod": "POST", - "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14334,6 +20696,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14361,7 +20728,7 @@ "id": "compute.instanceGroupManagers.resize", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", "httpMethod": "POST", - "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14376,6 +20743,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "size": { "type": "integer", "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", @@ -14408,7 +20780,7 @@ "id": "compute.instanceGroupManagers.resizeAdvanced", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced", "httpMethod": "POST", - "description": "Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.\n\nIf you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method.", + "description": "Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.\n\nIf you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14423,6 +20795,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14465,6 +20842,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14507,6 +20889,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14549,6 +20936,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -14636,6 +21028,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where you want to create the managed instance group.", @@ -14682,6 +21079,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -14713,7 +21115,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14773,6 +21175,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -14846,6 +21253,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where you want to create the instance group.", @@ -14876,7 +21288,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14932,7 +21344,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instanceGroup": { @@ -14994,7 +21406,7 @@ "id": "compute.instanceGroups.removeInstances", "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", "httpMethod": "POST", - "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.", "parameters": { "instanceGroup": { "type": "string", @@ -15009,6 +21421,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -15051,6 +21468,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -15142,6 +21564,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15202,6 +21629,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15226,7 +21658,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15284,7 +21716,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -15334,6 +21766,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15367,7 +21804,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15428,6 +21865,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15472,6 +21914,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15525,6 +21972,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15574,6 +22026,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15708,6 +22165,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15739,7 +22201,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15796,7 +22258,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instance": { @@ -15873,6 +22335,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15927,6 +22394,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -15954,7 +22426,7 @@ "id": "compute.instances.setLabels", "path": "{project}/zones/{zone}/instances/{instance}/setLabels", "httpMethod": "POST", - "description": "Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "instance": { "type": "string", @@ -15970,6 +22442,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16014,6 +22491,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16058,6 +22540,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16102,6 +22589,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16126,6 +22618,55 @@ "https://www.googleapis.com/auth/compute" ] }, + "setMinCpuPlatform": { + "id": "compute.instances.setMinCpuPlatform", + "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform", + "httpMethod": "POST", + "description": "Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The 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" + ], + "request": { + "$ref": "InstancesSetMinCpuPlatformRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setScheduling": { "id": "compute.instances.setScheduling", "path": "{project}/zones/{zone}/instances/{instance}/setScheduling", @@ -16146,6 +22687,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16190,6 +22736,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16234,6 +22785,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16278,6 +22834,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16319,6 +22880,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16363,6 +22929,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -16428,6 +22999,725 @@ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute.readonly" ] + }, + "updateAccessConfig": { + "id": "compute.instances.updateAccessConfig", + "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig", + "httpMethod": "POST", + "description": "Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", + "parameters": { + "instance": { + "type": "string", + "description": "The instance name for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "The name of the network interface where the access config is attached.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The 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", + "networkInterface" + ], + "request": { + "$ref": "AccessConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "updateNetworkInterface": { + "id": "compute.instances.updateNetworkInterface", + "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface", + "httpMethod": "PATCH", + "description": "Updates an instance's network interface. This method follows PATCH semantics.", + "parameters": { + "instance": { + "type": "string", + "description": "The instance name for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "The name of the network interface to update.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The 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", + "networkInterface" + ], + "request": { + "$ref": "NetworkInterface" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "interconnectAttachments": { + "methods": { + "aggregatedList": { + "id": "compute.interconnectAttachments.aggregatedList", + "path": "{project}/aggregated/interconnectAttachments", + "httpMethod": "GET", + "description": "Retrieves an aggregated list of interconnect attachments.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InterconnectAttachmentAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.interconnectAttachments.delete", + "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}", + "httpMethod": "DELETE", + "description": "Deletes the specified interconnect attachment.", + "parameters": { + "interconnectAttachment": { + "type": "string", + "description": "Name of the interconnect attachment 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "region", + "interconnectAttachment" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.interconnectAttachments.get", + "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}", + "httpMethod": "GET", + "description": "Returns the specified interconnect attachment.", + "parameters": { + "interconnectAttachment": { + "type": "string", + "description": "Name of the interconnect attachment 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "interconnectAttachment" + ], + "response": { + "$ref": "InterconnectAttachment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.interconnectAttachments.insert", + "path": "{project}/regions/{region}/interconnectAttachments", + "httpMethod": "POST", + "description": "Creates an InterconnectAttachment 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "InterconnectAttachment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.interconnectAttachments.list", + "path": "{project}/regions/{region}/interconnectAttachments", + "httpMethod": "GET", + "description": "Retrieves the list of interconnect attachments contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "InterconnectAttachmentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "testIamPermissions": { + "id": "compute.interconnectAttachments.testIamPermissions", + "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "interconnectLocations": { + "methods": { + "get": { + "id": "compute.interconnectLocations.get", + "path": "{project}/global/interconnectLocations/{interconnectLocation}", + "httpMethod": "GET", + "description": "Returns the details for the specified interconnect location. Get a list of available interconnect locations by making a list() request.", + "parameters": { + "interconnectLocation": { + "type": "string", + "description": "Name of the interconnect location 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "interconnectLocation" + ], + "response": { + "$ref": "InterconnectLocation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.interconnectLocations.list", + "path": "{project}/global/interconnectLocations", + "httpMethod": "GET", + "description": "Retrieves the list of interconnect locations available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InterconnectLocationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "interconnects": { + "methods": { + "delete": { + "id": "compute.interconnects.delete", + "path": "{project}/global/interconnects/{interconnect}", + "httpMethod": "DELETE", + "description": "Deletes the specified interconnect.", + "parameters": { + "interconnect": { + "type": "string", + "description": "Name of the interconnect 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "interconnect" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.interconnects.get", + "path": "{project}/global/interconnects/{interconnect}", + "httpMethod": "GET", + "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.", + "parameters": { + "interconnect": { + "type": "string", + "description": "Name of the interconnect 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "interconnect" + ], + "response": { + "$ref": "Interconnect" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.interconnects.insert", + "path": "{project}/global/interconnects", + "httpMethod": "POST", + "description": "Creates a Interconnect 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "Interconnect" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.interconnects.list", + "path": "{project}/global/interconnects", + "httpMethod": "GET", + "description": "Retrieves the list of interconnect available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InterconnectList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.interconnects.patch", + "path": "{project}/global/interconnects/{interconnect}", + "httpMethod": "PATCH", + "description": "Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", + "parameters": { + "interconnect": { + "type": "string", + "description": "Name of the interconnect to update.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "interconnect" + ], + "request": { + "$ref": "Interconnect" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "testIamPermissions": { + "id": "compute.interconnects.testIamPermissions", + "path": "{project}/global/interconnects/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] } } }, @@ -16437,7 +23727,7 @@ "id": "compute.licenses.get", "path": "{project}/global/licenses/{license}", "httpMethod": "GET", - "description": "Returns the specified License resource. Get a list of available licenses by making a list() request.", + "description": "Returns the specified License resource.", "parameters": { "license": { "type": "string", @@ -16479,7 +23769,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16570,7 +23860,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16642,6 +23932,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16678,6 +23973,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16738,6 +24038,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16762,7 +24067,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16803,6 +24108,47 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "patch": { + "id": "compute.networks.patch", + "path": "{project}/global/networks/{network}", + "httpMethod": "PATCH", + "description": "Patches the specified network with the data included in the request.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network to update.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "network" + ], + "request": { + "$ref": "Network" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "removePeering": { "id": "compute.networks.removePeering", "path": "{project}/global/networks/{network}/removePeering", @@ -16822,6 +24168,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16858,6 +24209,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16889,7 +24245,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -16917,7 +24273,7 @@ "id": "compute.projects.disableXpnHost", "path": "{project}/disableXpnHost", "httpMethod": "POST", - "description": "Disable this project as an XPN host project.", + "description": "Disable this project as a shared VPC host project.", "parameters": { "project": { "type": "string", @@ -16925,6 +24281,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16942,7 +24303,7 @@ "id": "compute.projects.disableXpnResource", "path": "{project}/disableXpnResource", "httpMethod": "POST", - "description": "Disable an XPN resource associated with this host project.", + "description": "Disable a serivce resource (a.k.a service project) associated with this host project.", "parameters": { "project": { "type": "string", @@ -16950,6 +24311,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16970,7 +24336,7 @@ "id": "compute.projects.enableXpnHost", "path": "{project}/enableXpnHost", "httpMethod": "POST", - "description": "Enable this project as an XPN host project.", + "description": "Enable this project as a shared VPC host project.", "parameters": { "project": { "type": "string", @@ -16978,6 +24344,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16995,7 +24366,7 @@ "id": "compute.projects.enableXpnResource", "path": "{project}/enableXpnResource", "httpMethod": "POST", - "description": "Enable XPN resource (a.k.a service project or service folder in the future) for a host project, so that subnetworks in the host project can be used by instances in the service project or folder.", + "description": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.", "parameters": { "project": { "type": "string", @@ -17003,6 +24374,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17049,7 +24425,7 @@ "id": "compute.projects.getXpnHost", "path": "{project}/getXpnHost", "httpMethod": "GET", - "description": "Get the XPN host project that this project links to. May be empty if no link exists.", + "description": "Get the shared VPC host project that this project links to. May be empty if no link exists.", "parameters": { "project": { "type": "string", @@ -17067,15 +24443,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "getXpnResources": { "id": "compute.projects.getXpnResources", "path": "{project}/getXpnResources", "httpMethod": "GET", - "description": "Get XPN resources associated with this host project.", + "description": "Get service resources (a.k.a service project) associated with this host project.", "parameters": { "filter": { "type": "string", @@ -17112,15 +24487,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "listXpnHosts": { "id": "compute.projects.listXpnHosts", "path": "{project}/listXpnHosts", "httpMethod": "POST", - "description": "List all XPN host projects visible to the user in an organization.", + "description": "List all shared VPC host projects visible to the user in an organization.", "parameters": { "filter": { "type": "string", @@ -17160,8 +24534,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "moveDisk": { @@ -17176,6 +24549,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17204,6 +24582,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17232,6 +24615,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17260,6 +24648,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17309,6 +24702,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17385,6 +24783,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17410,7 +24813,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17463,7 +24866,7 @@ "id": "compute.regionAutoscalers.patch", "path": "{project}/regions/{region}/autoscalers", "httpMethod": "PATCH", - "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "autoscaler": { "type": "string", @@ -17484,6 +24887,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17498,8 +24906,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -17572,6 +24979,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17619,6 +25031,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17739,6 +25156,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17764,7 +25186,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17817,7 +25239,7 @@ "id": "compute.regionBackendServices.patch", "path": "{project}/regions/{region}/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendService": { "type": "string", @@ -17839,6 +25261,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17854,8 +25281,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -17929,6 +25355,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17959,7 +25390,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18046,7 +25477,7 @@ "id": "compute.regionCommitments.insert", "path": "{project}/regions/{region}/commitments", "httpMethod": "POST", - "description": "Creates an commitment in the specified project using the data included in the request.", + "description": "Creates a commitment in the specified project using the data included in the request.", "parameters": { "project": { "type": "string", @@ -18061,6 +25492,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18086,7 +25522,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18143,7 +25579,7 @@ "id": "compute.regionInstanceGroupManagers.abandonInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", "httpMethod": "POST", - "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -18163,6 +25599,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18205,6 +25646,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18224,7 +25670,7 @@ "id": "compute.regionInstanceGroupManagers.deleteInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", "httpMethod": "POST", - "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -18244,6 +25690,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18320,6 +25771,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18345,7 +25801,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18456,7 +25912,7 @@ "id": "compute.regionInstanceGroupManagers.patch", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}", "httpMethod": "PATCH", - "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports patch semantics.", + "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "instanceGroupManager": { "type": "string", @@ -18476,6 +25932,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18491,15 +25952,14 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "recreateInstances": { "id": "compute.regionInstanceGroupManagers.recreateInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", "httpMethod": "POST", - "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -18519,6 +25979,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18541,7 +26006,7 @@ "id": "compute.regionInstanceGroupManagers.resize", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize", "httpMethod": "POST", - "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -18562,6 +26027,11 @@ "required": true, "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "size": { "type": "integer", "description": "Number of instances that should exist in this instance group manager.", @@ -18609,6 +26079,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18651,6 +26126,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18693,6 +26173,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18780,6 +26265,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18850,7 +26340,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18906,7 +26396,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instanceGroup": { @@ -18988,6 +26478,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -19143,7 +26638,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19238,7 +26733,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19291,7 +26786,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19352,6 +26847,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "router": { "type": "string", "description": "Name of the Router resource to delete.", @@ -19476,6 +26976,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -19501,7 +27006,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19554,7 +27059,7 @@ "id": "compute.routers.patch", "path": "{project}/regions/{region}/routers/{router}", "httpMethod": "PATCH", - "description": "Patches the specified Router resource with the data included in the request. This method supports patch semantics.", + "description": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.", "parameters": { "project": { "type": "string", @@ -19570,6 +27075,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "router": { "type": "string", "description": "Name of the Router resource to patch.", @@ -19591,8 +27101,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "preview": { @@ -19705,6 +27214,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "router": { "type": "string", "description": "Name of the Router resource to update.", @@ -19746,6 +27260,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "route": { "type": "string", "description": "Name of the Route resource to delete.", @@ -19812,6 +27331,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -19836,7 +27360,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19894,7 +27418,243 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "securityPolicies": { + "methods": { + "delete": { + "id": "compute.securityPolicies.delete", + "path": "{project}/global/securityPolicies/{securityPolicy}", + "httpMethod": "DELETE", + "description": "Deletes the specified policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "securityPolicy": { + "type": "string", + "description": "Name of the security policy to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.securityPolicies.get", + "path": "{project}/global/securityPolicies/{securityPolicy}", + "httpMethod": "GET", + "description": "List all of the ordered rules present in a single specified policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "securityPolicy": { + "type": "string", + "description": "Name of the security policy to get.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "response": { + "$ref": "SecurityPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.securityPolicies.insert", + "path": "{project}/global/securityPolicies", + "httpMethod": "POST", + "description": "Creates a new policy 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "SecurityPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.securityPolicies.list", + "path": "{project}/global/securityPolicies", + "httpMethod": "GET", + "description": "List all the policies that have been configured for the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "SecurityPolicyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.securityPolicies.patch", + "path": "{project}/global/securityPolicies/{securityPolicy}", + "httpMethod": "PATCH", + "description": "Patches the specified policy 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "securityPolicy": { + "type": "string", + "description": "Name of the security policy to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "request": { + "$ref": "SecurityPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "testIamPermissions": { + "id": "compute.securityPolicies.testIamPermissions", + "path": "{project}/global/securityPolicies/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -19931,6 +27691,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "snapshot": { "type": "string", "description": "Name of the Snapshot resource to delete.", @@ -19993,7 +27758,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20038,7 +27803,7 @@ "id": "compute.snapshots.setLabels", "path": "{project}/global/snapshots/{resource}/setLabels", "httpMethod": "POST", - "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling or Tagging Resources documentation.", + "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.", "parameters": { "project": { "type": "string", @@ -20087,7 +27852,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -20124,6 +27889,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "sslCertificate": { "type": "string", "description": "Name of the SslCertificate resource to delete.", @@ -20190,6 +27960,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -20214,7 +27989,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20272,7 +28047,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -20304,7 +28079,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20365,6 +28140,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "subnetwork": { "type": "string", "description": "Name of the Subnetwork resource to delete.", @@ -20406,6 +28186,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "subnetwork": { "type": "string", "description": "Name of the Subnetwork resource to update.", @@ -20533,6 +28318,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -20558,7 +28348,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20607,6 +28397,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "patch": { + "id": "compute.subnetworks.patch", + "path": "{project}/regions/{region}/subnetworks/{subnetwork}", + "httpMethod": "PATCH", + "description": "Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range and allow_subnet_cidr_routes_overlap. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "subnetwork": { + "type": "string", + "description": "Name of the Subnetwork resource to patch.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "subnetwork" + ], + "request": { + "$ref": "Subnetwork" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setIamPolicy": { "id": "compute.subnetworks.setIamPolicy", "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", @@ -20671,6 +28510,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "subnetwork": { "type": "string", "description": "Name of the Subnetwork resource.", @@ -20757,6 +28601,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpProxy": { "type": "string", "description": "Name of the TargetHttpProxy resource to delete.", @@ -20823,6 +28672,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -20847,7 +28701,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -20901,6 +28755,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpProxy": { "type": "string", "description": "Name of the TargetHttpProxy to set a URL map for.", @@ -20941,7 +28800,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -20978,6 +28837,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpsProxy": { "type": "string", "description": "Name of the TargetHttpsProxy resource to delete.", @@ -21044,6 +28908,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -21068,7 +28937,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21122,6 +28991,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpsProxy": { "type": "string", "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.", @@ -21158,6 +29032,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpsProxy": { "type": "string", "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.", @@ -21198,7 +29077,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -21230,7 +29109,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21284,6 +29163,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetInstance": { "type": "string", "description": "Name of the TargetInstance resource to delete.", @@ -21367,6 +29251,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone scoping this request.", @@ -21398,7 +29287,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21516,6 +29405,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the target pool to add a health check to.", @@ -21560,6 +29454,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to add instances to.", @@ -21592,7 +29491,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21653,6 +29552,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to delete.", @@ -21780,6 +29684,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -21805,7 +29714,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -21874,6 +29783,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the target pool to remove health checks from.", @@ -21918,6 +29832,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to remove instances from.", @@ -21968,6 +29887,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to set a backup pool for.", @@ -22054,6 +29978,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource to delete.", @@ -22120,6 +30049,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -22144,7 +30078,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22198,6 +30132,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.", @@ -22234,6 +30173,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.", @@ -22270,6 +30214,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.", @@ -22310,7 +30259,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -22347,6 +30296,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetTcpProxy": { "type": "string", "description": "Name of the TargetTcpProxy resource to delete.", @@ -22413,6 +30367,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -22437,7 +30396,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22491,6 +30450,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetTcpProxy": { "type": "string", "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.", @@ -22527,6 +30491,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetTcpProxy": { "type": "string", "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.", @@ -22562,7 +30531,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22623,6 +30592,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetVpnGateway": { "type": "string", "description": "Name of the target VPN gateway to delete.", @@ -22705,6 +30679,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -22730,7 +30709,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -22841,6 +30820,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap resource to delete.", @@ -22907,6 +30891,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -22936,6 +30925,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap scoping this request.", @@ -22967,7 +30961,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23012,7 +31006,7 @@ "id": "compute.urlMaps.patch", "path": "{project}/global/urlMaps/{urlMap}", "httpMethod": "PATCH", - "description": "Patches the specified UrlMap resource with the data included in the request. This method supports patch semantics.", + "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "project": { "type": "string", @@ -23021,6 +31015,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap resource to patch.", @@ -23041,8 +31040,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "testIamPermissions": { @@ -23062,7 +31060,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -23095,6 +31093,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap resource to update.", @@ -23166,7 +31169,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23227,6 +31230,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "vpnTunnel": { "type": "string", "description": "Name of the VpnTunnel resource to delete.", @@ -23309,6 +31317,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -23334,7 +31347,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23520,7 +31533,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -23615,7 +31628,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { diff --git a/etc/api/compute/v1/compute-api.json b/etc/api/compute/v1/compute-api.json index 1821ae26d2..faef7b2f5d 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/0lLIb0a2O5fm-bLW1ABv4G_BX-0\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/cngOjaowRI92cKIanqfdVBHzE7E\"", "discoveryVersion": "v1", "id": "compute:v1", "name": "compute", "version": "v1", - "revision": "20170426", + "revision": "20170908", "title": "Compute Engine API", "description": "Creates and runs virtual machines on Google Cloud Platform.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/compute/v1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "compute/v1/projects/", - "batchPath": "batch", + "batchPath": "batch/compute/v1", "parameters": { "alt": { "type": "string", @@ -91,6 +91,213 @@ } }, "schemas": { + "AcceleratorConfig": { + "id": "AcceleratorConfig", + "type": "object", + "description": "A specification of the type and number of accelerator cards attached to the instance.", + "properties": { + "acceleratorCount": { + "type": "integer", + "description": "The number of the guest accelerator cards exposed to this instance.", + "format": "int32" + }, + "acceleratorType": { + "type": "string", + "description": "Full or partial URL of the accelerator type resource to expose to this instance." + } + } + }, + "AcceleratorType": { + "id": "AcceleratorType", + "type": "object", + "description": "An Accelerator Type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this accelerator type." + }, + "description": { + "type": "string", + "description": "[Output Only] An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The type of the resource. Always compute#acceleratorType for accelerator types.", + "default": "compute#acceleratorType" + }, + "maximumCardsPerInstance": { + "type": "integer", + "description": "[Output Only] Maximum accelerator cards allowed per instance.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "zone": { + "type": "string", + "description": "[Output Only] The name of the zone where the accelerator type resides, such as us-central1-a." + } + } + }, + "AcceleratorTypeAggregatedList": { + "id": "AcceleratorTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A list of AcceleratorTypesScopedList resources.", + "additionalProperties": { + "$ref": "AcceleratorTypesScopedList", + "description": "[Output Only] Name of the scope containing this set of accelerator types." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types.", + "default": "compute#acceleratorTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AcceleratorTypeList": { + "id": "AcceleratorTypeList", + "type": "object", + "description": "Contains a list of accelerator types.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of AcceleratorType resources.", + "items": { + "$ref": "AcceleratorType" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types.", + "default": "compute#acceleratorTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AcceleratorTypesScopedList": { + "id": "AcceleratorTypesScopedList", + "type": "object", + "properties": { + "acceleratorTypes": { + "type": "array", + "description": "[Output Only] List of accelerator types contained in this scope.", + "items": { + "$ref": "AcceleratorType" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that appears when the accelerator types list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "AccessConfig": { "id": "AccessConfig", "type": "object", @@ -129,7 +336,7 @@ "properties": { "address": { "type": "string", - "description": "The static external IP address represented by this resource." + "description": "The static IP address represented by this resource." }, "creationTimestamp": { "type": "string", @@ -144,6 +351,20 @@ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", "format": "uint64" }, + "ipVersion": { + "type": "string", + "description": "The IP Version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address.", + "enum": [ + "IPV4", + "IPV6", + "UNSPECIFIED_VERSION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "kind": { "type": "string", "description": "[Output Only] Type of the resource. Always compute#address for addresses.", @@ -198,7 +419,7 @@ }, "items": { "type": "object", - "description": "[Output Only] A map of scoped address lists.", + "description": "A list of AddressesScopedList resources.", "additionalProperties": { "$ref": "AddressesScopedList", "description": "[Output Only] Name of the scope containing this set of addresses." @@ -226,11 +447,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of addresses.", + "description": "A list of Address resources.", "items": { "$ref": "Address" } @@ -246,7 +467,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -332,6 +553,21 @@ } } }, + "AliasIpRange": { + "id": "AliasIpRange", + "type": "object", + "description": "An alias IP range attached to an instance's network interface.", + "properties": { + "ipCidrRange": { + "type": "string", + "description": "The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24)." + }, + "subnetworkRangeName": { + "type": "string", + "description": "Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used." + } + } + }, "AttachedDisk": { "id": "AttachedDisk", "type": "object", @@ -355,7 +591,7 @@ }, "index": { "type": "integer", - "description": "Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.", + "description": "[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.", "format": "int32" }, "initializeParams": { @@ -489,6 +725,29 @@ "type": "string", "description": "[Output Only] Server-defined URL for the resource." }, + "status": { + "type": "string", + "description": "[Output Only] The status of the autoscaler configuration.", + "enum": [ + "ACTIVE", + "DELETING", + "ERROR", + "PENDING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "statusDetails": { + "type": "array", + "description": "[Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter.", + "items": { + "$ref": "AutoscalerStatusDetails" + } + }, "target": { "type": "string", "description": "URL of the managed instance group that this autoscaler will scale." @@ -505,11 +764,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped autoscaler lists.", + "description": "A list of AutoscalersScopedList resources.", "additionalProperties": { "$ref": "AutoscalersScopedList", "description": "[Output Only] Name of the scope containing this set of autoscalers." @@ -537,7 +796,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -561,6 +820,54 @@ } } }, + "AutoscalerStatusDetails": { + "id": "AutoscalerStatusDetails", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The status message." + }, + "type": { + "type": "string", + "description": "The type of error returned.", + "enum": [ + "ALL_INSTANCES_UNHEALTHY", + "BACKEND_SERVICE_DOES_NOT_EXIST", + "CAPPED_AT_MAX_NUM_REPLICAS", + "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE", + "CUSTOM_METRIC_INVALID", + "MIN_EQUALS_MAX", + "MISSING_CUSTOM_METRIC_DATA_POINTS", + "MISSING_LOAD_BALANCING_DATA_POINTS", + "MORE_THAN_ONE_BACKEND_SERVICE", + "NOT_ENOUGH_QUOTA_AVAILABLE", + "REGION_RESOURCE_STOCKOUT", + "SCALING_TARGET_DOES_NOT_EXIST", + "UNKNOWN", + "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION", + "ZONE_RESOURCE_STOCKOUT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, "AutoscalersScopedList": { "id": "AutoscalersScopedList", "type": "object", @@ -741,7 +1048,7 @@ "properties": { "balancingMode": { "type": "string", - "description": "Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).\n\nThis cannot be used for internal load balancing.", + "description": "Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL).\n\nFor Internal Load Balancing, the default and only supported mode is CONNECTION.", "enum": [ "CONNECTION", "RATE", @@ -764,7 +1071,7 @@ }, "group": { "type": "string", - "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL.\n\nWhen the BackendService has load balancing scheme INTERNAL, the instance group must be in a zone within the same region as the BackendService." + "description": "The fully-qualified URL of a Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL.\n\nWhen the BackendService has load balancing scheme INTERNAL, the instance group must be within the same region as the BackendService." }, "maxConnections": { "type": "integer", @@ -858,7 +1165,7 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", @@ -909,7 +1216,7 @@ }, "healthChecks": { "type": "array", - "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required.\n\nFor internal load balancing, a URL to a HealthCheck resource must be specified instead.", + "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required for Compute Engine backend services. A health check must not be specified for App Engine backend and Cloud Function backend.\n\nFor internal load balancing, a URL to a HealthCheck resource must be specified instead.", "items": { "type": "string" } @@ -929,6 +1236,7 @@ }, "loadBalancingScheme": { "type": "string", + "description": "Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other. Possible values are INTERNAL and EXTERNAL.", "enum": [ "EXTERNAL", "INTERNAL", @@ -1016,7 +1324,7 @@ }, "items": { "type": "object", - "description": "A map of scoped BackendService lists.", + "description": "A list of BackendServicesScopedList resources.", "additionalProperties": { "$ref": "BackendServicesScopedList", "description": "Name of the scope containing this set of BackendServices." @@ -1029,7 +1337,7 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", @@ -1244,6 +1552,237 @@ } } }, + "Commitment": { + "id": "Commitment", + "type": "object", + "description": "Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts.\n\nCommitted use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "endTimestamp": { + "type": "string", + "description": "[Output Only] Commitment end time in RFC3339 text format." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#commitment for commitments.", + "default": "compute#commitment" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "plan": { + "type": "string", + "description": "The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).", + "enum": [ + "INVALID", + "THIRTY_SIX_MONTH", + "TWELVE_MONTH" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where this commitment may be used." + }, + "resources": { + "type": "array", + "description": "List of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.", + "items": { + "$ref": "ResourceCommitment" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTimestamp": { + "type": "string", + "description": "[Output Only] Commitment start time in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", + "enum": [ + "ACTIVE", + "CREATING", + "EXPIRED", + "NOT_YET_ACTIVE" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional, human-readable explanation of the status." + } + } + }, + "CommitmentAggregatedList": { + "id": "CommitmentAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A list of CommitmentsScopedList resources.", + "additionalProperties": { + "$ref": "CommitmentsScopedList", + "description": "[Output Only] Name of the scope containing this set of commitments." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments.", + "default": "compute#commitmentAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "CommitmentList": { + "id": "CommitmentList", + "type": "object", + "description": "Contains a list of Commitment resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Commitment resources.", + "items": { + "$ref": "Commitment" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#commitmentList for lists of commitments.", + "default": "compute#commitmentList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "CommitmentsScopedList": { + "id": "CommitmentsScopedList", + "type": "object", + "properties": { + "commitments": { + "type": "array", + "description": "[Output Only] List of commitments contained in this scope.", + "items": { + "$ref": "Commitment" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of commitments when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "FIELD_VALUE_OVERRIDEN", + "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_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + }, "ConnectionDraining": { "id": "ConnectionDraining", "type": "object", @@ -1349,6 +1888,18 @@ "description": "[Output Only] Type of the resource. Always compute#disk for disks.", "default": "compute#disk" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make a get() request to retrieve a disk.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this disk. These can be later modified by the setLabels method.", + "additionalProperties": { + "type": "string" + } + }, "lastAttachTimestamp": { "type": "string", "description": "[Output Only] Last attach timestamp in RFC3339 text format." @@ -1384,7 +1935,7 @@ }, "sizeGb": { "type": "string", - "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.", + "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.", "format": "int64" }, "sourceImage": { @@ -1450,11 +2001,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped disk lists.", + "description": "A list of DisksScopedList resources.", "additionalProperties": { "$ref": "DisksScopedList", "description": "[Output Only] Name of the scope containing this set of disks." @@ -1467,7 +2018,7 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. Acceptable values are 0 to 500, inclusive. (Default: 500)" + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", @@ -1498,7 +2049,7 @@ }, "nextPageToken": { "type": "string", - "description": "This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", @@ -1577,11 +2128,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped disk type lists.", + "description": "A list of DiskTypesScopedList resources.", "additionalProperties": { "$ref": "DiskTypesScopedList", "description": "[Output Only] Name of the scope containing this set of disk types." @@ -1609,11 +2160,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Disk Type resources.", + "description": "A list of DiskType resources.", "items": { "$ref": "DiskType" } @@ -1821,7 +2372,7 @@ "properties": { "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number." + "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number." }, "ports": { "type": "array", @@ -1837,10 +2388,49 @@ "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." }, + "denied": { + "type": "array", + "description": "The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.", + "items": { + "type": "object", + "properties": { + "IPProtocol": { + "type": "string", + "description": "The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number." + }, + "ports": { + "type": "array", + "description": "An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.\n\nExample inputs include: [\"22\"], [\"80\",\"443\"], and [\"12345-12349\"].", + "items": { + "type": "string" + } + } + } + } + }, "description": { "type": "string", "description": "An optional description of this resource. Provide this property when you create the resource." }, + "destinationRanges": { + "type": "array", + "description": "If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported.", + "items": { + "type": "string" + } + }, + "direction": { + "type": "string", + "description": "Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags.", + "enum": [ + "EGRESS", + "INGRESS" + ], + "enumDescriptions": [ + "", + "" + ] + }, "id": { "type": "string", "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", @@ -1866,6 +2456,11 @@ "type": "string", "description": "URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used:\nglobal/networks/default\nIf you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network \n- projects/myproject/global/networks/my-network \n- global/networks/default" }, + "priority": { + "type": "integer", + "description": "Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority.", + "format": "int32" + }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." @@ -1879,7 +2474,7 @@ }, "sourceTags": { "type": "array", - "description": "If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.", + "description": "If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply.", "items": { "type": "string" } @@ -1900,11 +2495,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Firewall resources.", + "description": "A list of Firewall resources.", "items": { "$ref": "Firewall" } @@ -1931,7 +2526,7 @@ "properties": { "IPAddress": { "type": "string", - "description": "The IP address that this forwarding rule is serving on behalf of.\n\nFor global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IP from the same scope (global or regional) will be assigned.\n\nWhen the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the subnetwork or network configured for this forwarding rule. Only IPv4 is supported." + "description": "The IP address that this forwarding rule is serving on behalf of.\n\nFor global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6.\n\nWhen the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the subnetwork or network configured for this forwarding rule." }, "IPProtocol": { "type": "string", @@ -1970,6 +2565,20 @@ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", "format": "uint64" }, + "ipVersion": { + "type": "string", + "description": "The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. This can only be specified for a global forwarding rule.", + "enum": [ + "IPV4", + "IPV6", + "UNSPECIFIED_VERSION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "kind": { "type": "string", "description": "[Output Only] Type of the resource. Always compute#forwardingRule for Forwarding Rule resources.", @@ -2000,7 +2609,7 @@ }, "portRange": { "type": "string", - "description": "This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance.\n\nApplicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges.\n\nSome types of forwarding target have constraints on the acceptable ports: \n- TargetHttpProxy: 80, 8080 \n- TargetHttpsProxy: 443 \n- TargetSslProxy: 443 \n- TargetVpnGateway: 500, 4500\n-" + "description": "This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance.\n\nApplicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges.\n\nSome types of forwarding target have constraints on the acceptable ports: \n- TargetHttpProxy: 80, 8080 \n- TargetHttpsProxy: 443 \n- TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 \n- TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 \n- TargetVpnGateway: 500, 4500\n-" }, "ports": { "type": "array", @@ -2033,11 +2642,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped forwarding rule lists.", + "description": "A list of ForwardingRulesScopedList resources.", "additionalProperties": { "$ref": "ForwardingRulesScopedList", "description": "Name of the scope containing this set of addresses." @@ -2065,7 +2674,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Set by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -2171,6 +2780,24 @@ } } }, + "GlobalSetLabelsRequest": { + "id": "GlobalSetLabelsRequest", + "type": "object", + "properties": { + "labelFingerprint": { + "type": "string", + "description": "The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make a get() request to the resource to get the latest fingerprint.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "A list of labels to apply for this resource. Each label key & value must comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, \"webserver-frontend\": \"images\". A label value can also be empty (e.g. \"my-label\": \"\").", + "additionalProperties": { + "type": "string" + } + } + } + }, "GuestOsFeature": { "id": "GuestOsFeature", "type": "object", @@ -2178,7 +2805,7 @@ "properties": { "type": { "type": "string", - "description": "The type of supported feature. Currenty only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image. This value is purely informational and does not enable or disable any features.", + "description": "The type of supported feature. Currently only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", "enum": [ "FEATURE_TYPE_UNSPECIFIED", "VIRTIO_SCSI_MULTIQUEUE", @@ -2353,7 +2980,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -2514,7 +3141,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -2669,7 +3296,7 @@ }, "guestOsFeatures": { "type": "array", - "description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor new Windows images, the server might also populate this field with the value WINDOWS, to indicate that this is a Windows image. This value is purely informational and does not enable or disable any features.", + "description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", "items": { "$ref": "GuestOsFeature" } @@ -2688,6 +3315,18 @@ "description": "[Output Only] Type of the resource. Always compute#image for images.", "default": "compute#image" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make a get() request to retrieve an image.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this image. These can be later modified by the setLabels method.", + "additionalProperties": { + "type": "string" + } + }, "licenses": { "type": "array", "description": "Any applicable license URI.", @@ -2751,6 +3390,18 @@ "type": "string", "description": "The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name." }, + "sourceImage": { + "type": "string", + "description": "URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of: \n- this property, or \n- the rawDisk.source property, or \n- the sourceDisk property in order to create an image." + }, + "sourceImageEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key." + }, + "sourceImageId": { + "type": "string", + "description": "[Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name." + }, "sourceType": { "type": "string", "description": "The type of the image used to create this disk. The default and only value is RAW", @@ -2785,11 +3436,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Image resources.", + "description": "A list of Image resources.", "items": { "$ref": "Image" } @@ -2837,6 +3488,13 @@ "$ref": "AttachedDisk" } }, + "guestAccelerators": { + "type": "array", + "description": "List of the type and count of accelerator cards attached to the instance.", + "items": { + "$ref": "AcceleratorConfig" + } + }, "id": { "type": "string", "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", @@ -2847,6 +3505,18 @@ "description": "[Output Only] Type of the resource. Always compute#instance for instances.", "default": "compute#instance" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.\n\nTo see the latest fingerprint, make get() request to the instance.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this instance. These can be later modified by the setLabels method.", + "additionalProperties": { + "type": "string" + } + }, "machineType": { "type": "string", "description": "Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:\n\nzones/us-central1-f/machineTypes/n1-standard-1 \n\nTo create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):\n\nzones/zone/machineTypes/custom-CPUS-MEMORY \n\nFor example: zones/us-central1-f/machineTypes/custom-4-5120 \n\nFor a full list of restrictions, read the Specifications for custom machine types.", @@ -2872,7 +3542,7 @@ }, "networkInterfaces": { "type": "array", - "description": "An 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. Only one interface is supported per instance.", + "description": "An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance.", "items": { "$ref": "NetworkInterface" } @@ -2892,9 +3562,13 @@ "$ref": "ServiceAccount" } }, + "startRestricted": { + "type": "boolean", + "description": "[Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity." + }, "status": { "type": "string", - "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.", + "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED.", "enum": [ "PROVISIONING", "RUNNING", @@ -2936,11 +3610,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped instance lists.", + "description": "A list of InstancesScopedList resources.", "additionalProperties": { "$ref": "InstancesScopedList", "description": "[Output Only] Name of the scope containing this set of instances." @@ -3038,11 +3712,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped instance group lists.", + "description": "A list of InstanceGroupsScopedList resources.", "additionalProperties": { "$ref": "InstanceGroupsScopedList", "description": "The name of the scope that contains this set of instance groups." @@ -3059,7 +3733,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3070,11 +3744,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of instance groups.", + "description": "A list of InstanceGroup resources.", "items": { "$ref": "InstanceGroup" } @@ -3090,7 +3764,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3150,7 +3824,8 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ - "compute.instanceGroupManagers.insert" + "compute.instanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.insert" ] } }, @@ -3182,7 +3857,8 @@ "format": "int32", "annotations": { "required": [ - "compute.instanceGroupManagers.insert" + "compute.instanceGroupManagers.insert", + "compute.regionInstanceGroupManagers.insert" ] } }, @@ -3244,11 +3920,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of filtered managed instance group lists.", + "description": "A list of InstanceGroupManagersScopedList resources.", "additionalProperties": { "$ref": "InstanceGroupManagersScopedList", "description": "[Output Only] The name of the scope that contains this set of managed instance groups." @@ -3265,7 +3941,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3276,11 +3952,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of managed instance groups.", + "description": "A list of InstanceGroupManager resources.", "items": { "$ref": "InstanceGroupManager" } @@ -3481,11 +4157,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this list of instances in the specified instance group. The server generates this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of instances and any named ports that are assigned to those instances.", + "description": "A list of InstanceWithNamedPorts resources.", "items": { "$ref": "InstanceWithNamedPorts" } @@ -3501,7 +4177,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this list of instances in the specified instance groups. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3643,11 +4319,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of instances.", + "description": "A list of Instance resources.", "items": { "$ref": "Instance" } @@ -3688,7 +4364,7 @@ "properties": { "canIpForward": { "type": "boolean", - "description": "Enables 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, specify true. If unsure, leave this set to false. See the Enable IP forwarding for instances documentation for more information." + "description": "Enables 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, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information." }, "description": { "type": "string", @@ -3701,6 +4377,20 @@ "$ref": "AttachedDisk" } }, + "guestAccelerators": { + "type": "array", + "description": "A list of guest accelerator cards' type and count to use for instances created from the instance template.", + "items": { + "$ref": "AcceleratorConfig" + } + }, + "labels": { + "type": "object", + "description": "Labels to apply to instances that are created from this template.", + "additionalProperties": { + "type": "string" + } + }, "machineType": { "type": "string", "description": "The machine type to use for instances that are created from this template.", @@ -3798,11 +4488,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] list of InstanceTemplate resources.", + "description": "A list of InstanceTemplate resources.", "items": { "$ref": "InstanceTemplate" } @@ -3818,7 +4508,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this instance template list. The server defines this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3945,6 +4635,36 @@ } } }, + "InstancesSetLabelsRequest": { + "id": "InstancesSetLabelsRequest", + "type": "object", + "properties": { + "labelFingerprint": { + "type": "string", + "description": "Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels.", + "format": "byte" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "InstancesSetMachineResourcesRequest": { + "id": "InstancesSetMachineResourcesRequest", + "type": "object", + "properties": { + "guestAccelerators": { + "type": "array", + "description": "List of the type and count of accelerator cards attached to the instance.", + "items": { + "$ref": "AcceleratorConfig" + } + } + } + }, "InstancesSetMachineTypeRequest": { "id": "InstancesSetMachineTypeRequest", "type": "object", @@ -3992,7 +4712,7 @@ "properties": { "chargesUseFee": { "type": "boolean", - "description": "[Output Only] If true, the customer will be charged license fee for running software that contains this license on an instance." + "description": "[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee." }, "kind": { "type": "string", @@ -4106,11 +4826,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped machine type lists.", + "description": "A list of MachineTypesScopedList resources.", "additionalProperties": { "$ref": "MachineTypesScopedList", "description": "[Output Only] Name of the scope containing this set of machine types." @@ -4138,11 +4858,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Machine Type resources.", + "description": "A list of MachineType resources.", "items": { "$ref": "MachineType" } @@ -4373,7 +5093,7 @@ }, "value": { "type": "string", - "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.", + "description": "Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).", "annotations": { "required": [ "compute.instances.insert", @@ -4454,6 +5174,13 @@ ] } }, + "peerings": { + "type": "array", + "description": "[Output Only] List of network peerings for the resource.", + "items": { + "$ref": "NetworkPeering" + } + }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." @@ -4479,6 +5206,13 @@ "$ref": "AccessConfig" } }, + "aliasIpRanges": { + "type": "array", + "description": "An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.", + "items": { + "$ref": "AliasIpRange" + } + }, "kind": { "type": "string", "description": "[Output Only] Type of the resource. Always compute#networkInterface for network interfaces.", @@ -4509,11 +5243,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Network resources.", + "description": "A list of Network resources.", "items": { "$ref": "Network" } @@ -4533,6 +5267,69 @@ } } }, + "NetworkPeering": { + "id": "NetworkPeering", + "type": "object", + "description": "A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering.", + "properties": { + "autoCreateRoutes": { + "type": "boolean", + "description": "Whether full mesh connectivity is created and managed automatically. When it is set to true, Google Compute Engine will automatically create and manage the routes between two networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer network." + }, + "name": { + "type": "string", + "description": "Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "network": { + "type": "string", + "description": "The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network." + }, + "state": { + "type": "string", + "description": "[Output Only] State for the peering.", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "stateDetails": { + "type": "string", + "description": "[Output Only] Details about the current state of the peering." + } + } + }, + "NetworksAddPeeringRequest": { + "id": "NetworksAddPeeringRequest", + "type": "object", + "properties": { + "autoCreateRoutes": { + "type": "boolean", + "description": "Whether Google Compute Engine manages the routes automatically." + }, + "name": { + "type": "string", + "description": "Name of the peering, which should conform to RFC1035." + }, + "peerNetwork": { + "type": "string", + "description": "URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network." + } + } + }, + "NetworksRemovePeeringRequest": { + "id": "NetworksRemovePeeringRequest", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the peering, which should conform to RFC1035." + } + } + }, "Operation": { "id": "Operation", "type": "object", @@ -4982,6 +5779,70 @@ "usageExportLocation": { "$ref": "UsageExportLocation", "description": "The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored." + }, + "xpnProjectStatus": { + "type": "string", + "description": "[Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated.", + "enum": [ + "HOST", + "UNSPECIFIED_XPN_PROJECT_STATUS" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ProjectsDisableXpnResourceRequest": { + "id": "ProjectsDisableXpnResourceRequest", + "type": "object", + "properties": { + "xpnResource": { + "$ref": "XpnResourceId", + "description": "Service resource (a.k.a service project) ID." + } + } + }, + "ProjectsEnableXpnResourceRequest": { + "id": "ProjectsEnableXpnResourceRequest", + "type": "object", + "properties": { + "xpnResource": { + "$ref": "XpnResourceId", + "description": "Service resource (a.k.a service project) ID." + } + } + }, + "ProjectsGetXpnResources": { + "id": "ProjectsGetXpnResources", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects)", + "default": "compute#projectsGetXpnResources" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "resources": { + "type": "array", + "description": "Service resources (a.k.a service projects) attached to this project as their shared VPC host.", + "items": { + "$ref": "XpnResourceId" + } + } + } + }, + "ProjectsListXpnHostsRequest": { + "id": "ProjectsListXpnHostsRequest", + "type": "object", + "properties": { + "organization": { + "type": "string", + "description": "Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project." } } }, @@ -5002,6 +5863,7 @@ "AUTOSCALERS", "BACKEND_BUCKETS", "BACKEND_SERVICES", + "COMMITMENTS", "CPUS", "CPUS_ALL_REGIONS", "DISKS_TOTAL_GB", @@ -5016,11 +5878,16 @@ "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", "NETWORKS", + "NVIDIA_K80_GPUS", + "NVIDIA_P100_GPUS", "PREEMPTIBLE_CPUS", + "PREEMPTIBLE_LOCAL_SSD_GB", "REGIONAL_AUTOSCALERS", "REGIONAL_INSTANCE_GROUP_MANAGERS", "ROUTERS", "ROUTES", + "SECURITY_POLICIES", + "SECURITY_POLICY_RULES", "SNAPSHOTS", "SSD_TOTAL_GB", "SSL_CERTIFICATES", @@ -5031,6 +5898,7 @@ "TARGET_INSTANCES", "TARGET_POOLS", "TARGET_SSL_PROXIES", + "TARGET_TCP_PROXIES", "TARGET_VPN_GATEWAYS", "URL_MAPS", "VPN_TUNNELS" @@ -5070,6 +5938,13 @@ "", "", "", + "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5150,11 +6025,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of autoscalers.", + "description": "A list of Autoscaler resources.", "items": { "$ref": "Autoscaler" } @@ -5166,7 +6041,7 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", @@ -5181,7 +6056,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -5201,7 +6076,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -5212,11 +6087,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of managed instance groups.", + "description": "A list of InstanceGroupManager resources.", "items": { "$ref": "InstanceGroupManager" } @@ -5228,11 +6103,11 @@ }, "nextPageToken": { "type": "string", - "description": "[Output only] A token used to continue a truncated list request." + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." }, "selfLink": { "type": "string", - "description": "[Output only] The URL for this resource type. The server generates this URL." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -5322,11 +6197,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of instances and any named ports that are assigned to those instances.", + "description": "A list of InstanceWithNamedPorts resources.", "items": { "$ref": "InstanceWithNamedPorts" } @@ -5342,7 +6217,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -5394,11 +6269,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Region resources.", + "description": "A list of Region resources.", "items": { "$ref": "Region" } @@ -5418,6 +6293,32 @@ } } }, + "ResourceCommitment": { + "id": "ResourceCommitment", + "type": "object", + "description": "Commitment for a particular resource (a Commitment is composed of one or more of these).", + "properties": { + "amount": { + "type": "string", + "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of resource for which this commitment applies. Possible values are VCPU and MEMORY", + "enum": [ + "MEMORY", + "UNSPECIFIED", + "VCPU" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, "ResourceGroupReference": { "id": "ResourceGroupReference", "type": "object", @@ -5431,7 +6332,7 @@ "Route": { "id": "Route", "type": "object", - "description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving a instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.", + "description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.", "properties": { "creationTimestamp": { "type": "string", @@ -5495,6 +6396,10 @@ "type": "string", "description": "The URL of the local network if it should handle matching packets." }, + "nextHopPeering": { + "type": "string", + "description": "[Output Only] The network peering name that should handle matching packets, which should conform to RFC1035." + }, "nextHopVpnTunnel": { "type": "string", "description": "The URL to a VpnTunnel that should handle matching packets." @@ -5606,11 +6511,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Route resources.", + "description": "A list of Route resources.", "items": { "$ref": "Route" } @@ -5707,11 +6612,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped router lists.", + "description": "A list of Router resources.", "additionalProperties": { "$ref": "RoutersScopedList", "description": "Name of the scope containing this set of routers." @@ -5802,7 +6707,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -6160,6 +7065,18 @@ "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.", "default": "compute#snapshot" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.\n\nTo see the latest fingerprint, make a get() request to retrieve a snapshot.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.", + "additionalProperties": { + "type": "string" + } + }, "licenses": { "type": "array", "description": "[Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image).", @@ -6212,7 +7129,7 @@ }, "storageBytes": { "type": "string", - "description": "[Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", + "description": "[Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", "format": "int64" }, "storageBytesStatus": { @@ -6236,11 +7153,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of Snapshot resources.", + "description": "A list of Snapshot resources.", "items": { "$ref": "Snapshot" } @@ -6309,7 +7226,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -6344,11 +7261,11 @@ }, "description": { "type": "string", - "description": "An optional description of this resource. Provide this property when you create the resource." + "description": "An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time." }, "gatewayAddress": { "type": "string", - "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork." + "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time." }, "id": { "type": "string", @@ -6357,7 +7274,7 @@ }, "ipCidrRange": { "type": "string", - "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported." + "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time." }, "kind": { "type": "string", @@ -6371,15 +7288,22 @@ }, "network": { "type": "string", - "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks." + "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time." }, "privateIpGoogleAccess": { "type": "boolean", - "description": "Whether the VMs in this subnet can access Google services without assigned external IP addresses." + "description": "Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess." }, "region": { "type": "string", - "description": "URL of the region where the Subnetwork resides." + "description": "URL of the region where the Subnetwork resides. This field can be set only at resource creation time." + }, + "secondaryIpRanges": { + "type": "array", + "description": "An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges.", + "items": { + "$ref": "SubnetworkSecondaryRange" + } }, "selfLink": { "type": "string", @@ -6393,11 +7317,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output] A map of scoped Subnetwork lists.", + "description": "A list of SubnetworksScopedList resources.", "additionalProperties": { "$ref": "SubnetworksScopedList", "description": "Name of the scope containing this set of Subnetworks." @@ -6425,11 +7349,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "The Subnetwork resources.", + "description": "A list of Subnetwork resources.", "items": { "$ref": "Subnetwork" } @@ -6449,6 +7373,21 @@ } } }, + "SubnetworkSecondaryRange": { + "id": "SubnetworkSecondaryRange", + "type": "object", + "description": "Represents a secondary IP range of a subnetwork.", + "properties": { + "ipCidrRange": { + "type": "string", + "description": "The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported." + }, + "rangeName": { + "type": "string", + "description": "The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork." + } + } + }, "SubnetworksExpandIpCidrRangeRequest": { "id": "SubnetworksExpandIpCidrRangeRequest", "type": "object", @@ -6649,7 +7588,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -6738,7 +7677,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -6824,7 +7763,7 @@ }, "items": { "type": "object", - "description": "A map of scoped target instance lists.", + "description": "A list of TargetInstance resources.", "additionalProperties": { "$ref": "TargetInstancesScopedList", "description": "Name of the scope containing this set of target instances." @@ -6852,7 +7791,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -7043,11 +7982,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped target pool lists.", + "description": "A list of TargetPool resources.", "additionalProperties": { "$ref": "TargetPoolsScopedList", "description": "Name of the scope containing this set of target pools." @@ -7092,7 +8031,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -7364,7 +8303,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -7388,6 +8327,115 @@ } } }, + "TargetTcpProxiesSetBackendServiceRequest": { + "id": "TargetTcpProxiesSetBackendServiceRequest", + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "The URL of the new BackendService resource for the targetTcpProxy." + } + } + }, + "TargetTcpProxiesSetProxyHeaderRequest": { + "id": "TargetTcpProxiesSetProxyHeaderRequest", + "type": "object", + "properties": { + "proxyHeader": { + "type": "string", + "description": "The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed.", + "enum": [ + "NONE", + "PROXY_V1" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "TargetTcpProxy": { + "id": "TargetTcpProxy", + "type": "object", + "description": "A TargetTcpProxy resource. This resource defines a TCP proxy.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional description of this resource. Provide this property when you create the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies.", + "default": "compute#targetTcpProxy" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "proxyHeader": { + "type": "string", + "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.", + "enum": [ + "NONE", + "PROXY_V1" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "service": { + "type": "string", + "description": "URL to the BackendService resource." + } + } + }, + "TargetTcpProxyList": { + "id": "TargetTcpProxyList", + "type": "object", + "description": "Contains a list of TargetTcpProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetTcpProxy resources.", + "items": { + "$ref": "TargetTcpProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetTcpProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, "TargetVpnGateway": { "id": "TargetVpnGateway", "type": "object", @@ -7476,11 +8524,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "A map of scoped target vpn gateway lists.", + "description": "A list of TargetVpnGateway resources.", "additionalProperties": { "$ref": "TargetVpnGatewaysScopedList", "description": "[Output Only] Name of the scope containing this set of target VPN gateways." @@ -7508,11 +8556,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of TargetVpnGateway resources.", + "description": "A list of TargetVpnGateway resources.", "items": { "$ref": "TargetVpnGateway" } @@ -7703,7 +8751,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource. Set by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -7948,11 +8996,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", - "description": "[Output Only] A map of scoped vpn tunnel lists.", + "description": "A list of VpnTunnelsScopedList resources.", "additionalProperties": { "$ref": "VpnTunnelsScopedList", "description": "Name of the scope containing this set of vpn tunnels." @@ -7980,11 +9028,11 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "[Output Only] A list of VpnTunnel resources.", + "description": "A list of VpnTunnel resources.", "items": { "$ref": "VpnTunnel" } @@ -8086,6 +9134,59 @@ } } }, + "XpnHostList": { + "id": "XpnHostList", + "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 shared VPC host project URLs.", + "items": { + "$ref": "Project" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts.", + "default": "compute#xpnHostList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "XpnResourceId": { + "id": "XpnResourceId", + "type": "object", + "description": "Service resource (a.k.a service project) ID.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the service resource. In the case of projects, this field matches the project ID (e.g., my-project), not the project number (e.g., 12345678)." + }, + "type": { + "type": "string", + "description": "The type of the service resource.", + "enum": [ + "PROJECT", + "XPN_RESOURCE_TYPE_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, "Zone": { "id": "Zone", "type": "object", @@ -8150,7 +9251,7 @@ }, "items": { "type": "array", - "description": "[Output Only] A list of Zone resources.", + "description": "A list of Zone resources.", "items": { "$ref": "Zone" } @@ -8169,9 +9270,179 @@ "description": "[Output Only] Server-defined URL for this resource." } } + }, + "ZoneSetLabelsRequest": { + "id": "ZoneSetLabelsRequest", + "type": "object", + "properties": { + "labelFingerprint": { + "type": "string", + "description": "The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "The labels to set for this resource.", + "additionalProperties": { + "type": "string" + } + } + } } }, "resources": { + "acceleratorTypes": { + "methods": { + "aggregatedList": { + "id": "compute.acceleratorTypes.aggregatedList", + "path": "{project}/aggregated/acceleratorTypes", + "httpMethod": "GET", + "description": "Retrieves an aggregated list of accelerator types.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "AcceleratorTypeAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "get": { + "id": "compute.acceleratorTypes.get", + "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}", + "httpMethod": "GET", + "description": "Returns the specified accelerator type. Get a list of available accelerator types by making a list() request.", + "parameters": { + "acceleratorType": { + "type": "string", + "description": "Name of the accelerator type 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The 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", + "acceleratorType" + ], + "response": { + "$ref": "AcceleratorType" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "compute.acceleratorTypes.list", + "path": "{project}/zones/{zone}/acceleratorTypes", + "httpMethod": "GET", + "description": "Retrieves a list of accelerator types available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The 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" + ], + "response": { + "$ref": "AcceleratorTypeList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "addresses": { "methods": { "aggregatedList": { @@ -8182,7 +9453,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -8249,6 +9520,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -8325,6 +9601,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -8350,7 +9631,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -8411,7 +9692,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -8472,6 +9753,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -8548,6 +9834,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -8579,7 +9870,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -8632,7 +9923,7 @@ "id": "compute.autoscalers.patch", "path": "{project}/zones/{zone}/autoscalers", "httpMethod": "PATCH", - "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "autoscaler": { "type": "string", @@ -8647,6 +9938,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -8667,8 +9963,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -8690,6 +9985,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -8736,6 +10036,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -8796,6 +10101,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -8820,7 +10130,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -8865,7 +10175,7 @@ "id": "compute.backendBuckets.patch", "path": "{project}/global/backendBuckets/{backendBucket}", "httpMethod": "PATCH", - "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports patch semantics.", + "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendBucket": { "type": "string", @@ -8880,6 +10190,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -8894,8 +10209,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -8917,6 +10231,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -8946,7 +10265,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9006,6 +10325,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9102,6 +10426,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9126,7 +10455,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9171,7 +10500,7 @@ "id": "compute.backendServices.patch", "path": "{project}/global/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendService": { "type": "string", @@ -9186,6 +10515,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9200,8 +10534,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -9223,6 +10556,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9252,7 +10590,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9343,7 +10681,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9404,7 +10742,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9469,6 +10807,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -9512,6 +10855,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -9588,6 +10936,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "sourceImage": { "type": "string", "description": "Optional. Source image to restore onto a disk.", @@ -9624,7 +10977,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9693,6 +11046,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -9716,6 +11074,55 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "setLabels": { + "id": "compute.disks.setLabels", + "path": "{project}/zones/{zone}/disks/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The 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", + "resource" + ], + "request": { + "$ref": "ZoneSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -9740,6 +11147,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9800,6 +11212,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9824,7 +11241,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -9869,11 +11286,11 @@ "id": "compute.firewalls.patch", "path": "{project}/global/firewalls/{firewall}", "httpMethod": "PATCH", - "description": "Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. This method supports patch semantics.", + "description": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "firewall": { "type": "string", - "description": "Name of the firewall rule to update.", + "description": "Name of the firewall rule to patch.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -9884,6 +11301,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9920,6 +11342,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -9949,7 +11376,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10016,6 +11443,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10092,6 +11524,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10117,7 +11554,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10192,6 +11629,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10233,6 +11675,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10293,6 +11740,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10317,7 +11769,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10381,6 +11833,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10441,6 +11898,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10465,7 +11927,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10525,6 +11987,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10554,7 +12021,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10667,7 +12134,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10731,6 +12198,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10791,6 +12263,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10815,7 +12292,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -10860,7 +12337,7 @@ "id": "compute.healthChecks.patch", "path": "{project}/global/healthChecks/{healthCheck}", "httpMethod": "PATCH", - "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "healthCheck": { "type": "string", @@ -10875,6 +12352,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10889,8 +12371,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -10912,6 +12393,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -10952,6 +12438,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11012,6 +12503,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11036,7 +12532,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11081,7 +12577,7 @@ "id": "compute.httpHealthChecks.patch", "path": "{project}/global/httpHealthChecks/{httpHealthCheck}", "httpMethod": "PATCH", - "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "httpHealthCheck": { "type": "string", @@ -11096,6 +12592,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11110,8 +12611,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -11133,6 +12633,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11173,6 +12678,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11233,6 +12743,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11257,7 +12772,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11302,7 +12817,7 @@ "id": "compute.httpsHealthChecks.patch", "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", "httpMethod": "PATCH", - "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "httpsHealthCheck": { "type": "string", @@ -11317,6 +12832,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11331,8 +12851,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -11354,6 +12873,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11394,6 +12918,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11427,6 +12956,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11518,12 +13052,22 @@ "httpMethod": "POST", "description": "Creates an image in the specified project using the data included in the request.", "parameters": { + "forceCreate": { + "type": "boolean", + "description": "Force image creation if 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -11551,7 +13095,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11591,6 +13135,42 @@ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute.readonly" ] + }, + "setLabels": { + "id": "compute.images.setLabels", + "path": "{project}/global/images/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "GlobalSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -11600,7 +13180,7 @@ "id": "compute.instanceGroupManagers.abandonInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", "httpMethod": "POST", - "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -11615,6 +13195,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -11646,7 +13231,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11706,6 +13291,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -11730,7 +13320,7 @@ "id": "compute.instanceGroupManagers.deleteInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", "httpMethod": "POST", - "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -11745,6 +13335,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -11812,7 +13407,7 @@ "id": "compute.instanceGroupManagers.insert", "path": "{project}/zones/{zone}/instanceGroupManagers", "httpMethod": "POST", - "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group.", + "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.", "parameters": { "project": { "type": "string", @@ -11821,6 +13416,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where you want to create the managed instance group.", @@ -11851,7 +13451,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -11962,7 +13562,7 @@ "id": "compute.instanceGroupManagers.recreateInstances", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", "httpMethod": "POST", - "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -11977,6 +13577,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -12004,7 +13609,7 @@ "id": "compute.instanceGroupManagers.resize", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", "httpMethod": "POST", - "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -12019,6 +13624,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "size": { "type": "integer", "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", @@ -12066,6 +13676,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -12108,6 +13723,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the managed instance group is located.", @@ -12154,6 +13774,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -12185,7 +13810,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12245,6 +13870,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -12318,6 +13948,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where you want to create the instance group.", @@ -12348,7 +13983,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12404,7 +14039,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instanceGroup": { @@ -12466,7 +14101,7 @@ "id": "compute.instanceGroups.removeInstances", "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", "httpMethod": "POST", - "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.", "parameters": { "instanceGroup": { "type": "string", @@ -12481,6 +14116,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -12523,6 +14163,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone where the instance group is located.", @@ -12569,6 +14214,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12629,6 +14279,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -12653,7 +14308,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12724,6 +14379,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -12757,7 +14417,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -12818,6 +14478,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -12862,6 +14527,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -12915,6 +14585,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -12964,6 +14639,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13098,6 +14778,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13129,7 +14814,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13198,6 +14883,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13252,6 +14942,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13275,6 +14970,104 @@ "https://www.googleapis.com/auth/compute" ] }, + "setLabels": { + "id": "compute.instances.setLabels", + "path": "{project}/zones/{zone}/instances/{instance}/setLabels", + "httpMethod": "POST", + "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The 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" + ], + "request": { + "$ref": "InstancesSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setMachineResources": { + "id": "compute.instances.setMachineResources", + "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources", + "httpMethod": "POST", + "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance scoping this request.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The 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" + ], + "request": { + "$ref": "InstancesSetMachineResourcesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setMachineType": { "id": "compute.instances.setMachineType", "path": "{project}/zones/{zone}/instances/{instance}/setMachineType", @@ -13295,6 +15088,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13339,6 +15137,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13383,6 +15186,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13427,6 +15235,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13471,6 +15284,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13515,6 +15333,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13556,6 +15379,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13600,6 +15428,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "The name of the zone for this request.", @@ -13629,7 +15462,7 @@ "id": "compute.licenses.get", "path": "{project}/global/licenses/{license}", "httpMethod": "GET", - "description": "Returns the specified License resource. Get a list of available licenses by making a list() request.", + "description": "Returns the specified License resource.", "parameters": { "license": { "type": "string", @@ -13671,7 +15504,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13762,7 +15595,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13815,6 +15648,47 @@ }, "networks": { "methods": { + "addPeering": { + "id": "compute.networks.addPeering", + "path": "{project}/global/networks/{network}/addPeering", + "httpMethod": "POST", + "description": "Adds a peering to the specified network.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to add peering to.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "network" + ], + "request": { + "$ref": "NetworksAddPeeringRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "id": "compute.networks.delete", "path": "{project}/global/networks/{network}", @@ -13834,6 +15708,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13894,6 +15773,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13918,7 +15802,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -13959,6 +15843,47 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "removePeering": { + "id": "compute.networks.removePeering", + "path": "{project}/global/networks/{network}/removePeering", + "httpMethod": "POST", + "description": "Removes a peering from the specified network.", + "parameters": { + "network": { + "type": "string", + "description": "Name of the network resource to remove peering from.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "network" + ], + "request": { + "$ref": "NetworksRemovePeeringRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "switchToCustomMode": { "id": "compute.networks.switchToCustomMode", "path": "{project}/global/networks/{network}/switchToCustomMode", @@ -13978,6 +15903,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -13996,6 +15926,132 @@ }, "projects": { "methods": { + "disableXpnHost": { + "id": "compute.projects.disableXpnHost", + "path": "{project}/disableXpnHost", + "httpMethod": "POST", + "description": "Disable this project as a shared VPC host project.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "disableXpnResource": { + "id": "compute.projects.disableXpnResource", + "path": "{project}/disableXpnResource", + "httpMethod": "POST", + "description": "Disable a serivce resource (a.k.a service project) associated with this host project.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ProjectsDisableXpnResourceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "enableXpnHost": { + "id": "compute.projects.enableXpnHost", + "path": "{project}/enableXpnHost", + "httpMethod": "POST", + "description": "Enable this project as a shared VPC host project.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "enableXpnResource": { + "id": "compute.projects.enableXpnResource", + "path": "{project}/enableXpnResource", + "httpMethod": "POST", + "description": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ProjectsEnableXpnResourceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "get": { "id": "compute.projects.get", "path": "{project}", @@ -14022,6 +16078,122 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "getXpnHost": { + "id": "compute.projects.getXpnHost", + "path": "{project}/getXpnHost", + "httpMethod": "GET", + "description": "Get the shared VPC host project that this project links to. May be empty if no link exists.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "getXpnResources": { + "id": "compute.projects.getXpnResources", + "path": "{project}/getXpnResources", + "httpMethod": "GET", + "description": "Get service resources (a.k.a service project) associated with this host project.", + "parameters": { + "filter": { + "type": "string", + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "order_by": { + "type": "string", + "location": "query" + }, + "pageToken": { + "type": "string", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ProjectsGetXpnResources" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "listXpnHosts": { + "id": "compute.projects.listXpnHosts", + "path": "{project}/listXpnHosts", + "httpMethod": "POST", + "description": "List all shared VPC host projects visible to the user in an organization.", + "parameters": { + "filter": { + "type": "string", + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "order_by": { + "type": "string", + "location": "query" + }, + "pageToken": { + "type": "string", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ProjectsListXpnHostsRequest" + }, + "response": { + "$ref": "XpnHostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "moveDisk": { "id": "compute.projects.moveDisk", "path": "{project}/moveDisk", @@ -14034,6 +16206,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14062,6 +16239,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14090,6 +16272,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14118,6 +16305,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14167,6 +16359,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14243,6 +16440,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14268,7 +16470,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14321,7 +16523,7 @@ "id": "compute.regionAutoscalers.patch", "path": "{project}/regions/{region}/autoscalers", "httpMethod": "PATCH", - "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.", + "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "autoscaler": { "type": "string", @@ -14342,6 +16544,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14356,8 +16563,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -14385,6 +16591,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14432,6 +16643,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14552,6 +16768,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14577,7 +16798,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -14630,7 +16851,7 @@ "id": "compute.regionBackendServices.patch", "path": "{project}/regions/{region}/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "backendService": { "type": "string", @@ -14652,6 +16873,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14667,8 +16893,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -14697,6 +16922,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14717,13 +16947,206 @@ } } }, + "regionCommitments": { + "methods": { + "aggregatedList": { + "id": "compute.regionCommitments.aggregatedList", + "path": "{project}/aggregated/commitments", + "httpMethod": "GET", + "description": "Retrieves an aggregated list of commitments.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "CommitmentAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "get": { + "id": "compute.regionCommitments.get", + "path": "{project}/regions/{region}/commitments/{commitment}", + "httpMethod": "GET", + "description": "Returns the specified commitment resource. Get a list of available commitments by making a list() request.", + "parameters": { + "commitment": { + "type": "string", + "description": "Name of the commitment 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "commitment" + ], + "response": { + "$ref": "Commitment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.regionCommitments.insert", + "path": "{project}/regions/{region}/commitments", + "httpMethod": "POST", + "description": "Creates a commitment 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "Commitment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.regionCommitments.list", + "path": "{project}/regions/{region}/commitments", + "httpMethod": "GET", + "description": "Retrieves a list of commitments contained within the specified region.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "region": { + "type": "string", + "description": "Name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "CommitmentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "regionInstanceGroupManagers": { "methods": { "abandonInstances": { "id": "compute.regionInstanceGroupManagers.abandonInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", "httpMethod": "POST", - "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14743,6 +17166,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14785,6 +17213,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14804,7 +17237,7 @@ "id": "compute.regionInstanceGroupManagers.deleteInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", "httpMethod": "POST", - "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -14824,6 +17257,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14900,6 +17338,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -14925,7 +17368,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15036,7 +17479,7 @@ "id": "compute.regionInstanceGroupManagers.recreateInstances", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", "httpMethod": "POST", - "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nYou can specify a maximum of 1000 instances with this method per request.", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.", "parameters": { "instanceGroupManager": { "type": "string", @@ -15056,6 +17499,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15078,7 +17526,7 @@ "id": "compute.regionInstanceGroupManagers.resize", "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize", "httpMethod": "POST", - "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.", "parameters": { "instanceGroupManager": { "type": "string", @@ -15099,6 +17547,11 @@ "required": true, "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "size": { "type": "integer", "description": "Number of instances that should exist in this instance group manager.", @@ -15146,6 +17599,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15188,6 +17646,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15258,7 +17721,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15314,7 +17777,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "instanceGroup": { @@ -15396,6 +17859,11 @@ "description": "Name of the region scoping this request.", "required": true, "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15506,7 +17974,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15601,7 +18069,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15654,7 +18122,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15715,6 +18183,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "router": { "type": "string", "description": "Name of the Router resource to delete.", @@ -15839,6 +18312,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -15864,7 +18342,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -15917,7 +18395,7 @@ "id": "compute.routers.patch", "path": "{project}/regions/{region}/routers/{router}", "httpMethod": "PATCH", - "description": "Patches the specified Router resource with the data included in the request. This method supports patch semantics.", + "description": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.", "parameters": { "project": { "type": "string", @@ -15933,6 +18411,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "router": { "type": "string", "description": "Name of the Router resource to patch.", @@ -15954,8 +18437,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "preview": { @@ -16023,6 +18505,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "router": { "type": "string", "description": "Name of the Router resource to update.", @@ -16064,6 +18551,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "route": { "type": "string", "description": "Name of the Route resource to delete.", @@ -16130,6 +18622,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16154,7 +18651,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16212,6 +18709,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "snapshot": { "type": "string", "description": "Name of the Snapshot resource to delete.", @@ -16274,7 +18776,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16314,6 +18816,42 @@ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute.readonly" ] + }, + "setLabels": { + "id": "compute.snapshots.setLabels", + "path": "{project}/global/snapshots/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "GlobalSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -16332,6 +18870,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "sslCertificate": { "type": "string", "description": "Name of the SslCertificate resource to delete.", @@ -16398,6 +18941,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16422,7 +18970,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16475,7 +19023,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16536,6 +19084,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "subnetwork": { "type": "string", "description": "Name of the Subnetwork resource to delete.", @@ -16577,6 +19130,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "subnetwork": { "type": "string", "description": "Name of the Subnetwork resource to update.", @@ -16662,6 +19220,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16687,7 +19250,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16756,6 +19319,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "subnetwork": { "type": "string", "description": "Name of the Subnetwork resource.", @@ -16797,6 +19365,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpProxy": { "type": "string", "description": "Name of the TargetHttpProxy resource to delete.", @@ -16863,6 +19436,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -16887,7 +19465,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -16941,6 +19519,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpProxy": { "type": "string", "description": "Name of the TargetHttpProxy to set a URL map for.", @@ -16981,6 +19564,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpsProxy": { "type": "string", "description": "Name of the TargetHttpsProxy resource to delete.", @@ -17047,6 +19635,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17071,7 +19664,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17125,6 +19718,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpsProxy": { "type": "string", "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.", @@ -17161,6 +19759,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetHttpsProxy": { "type": "string", "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.", @@ -17196,7 +19799,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17250,6 +19853,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetInstance": { "type": "string", "description": "Name of the TargetInstance resource to delete.", @@ -17333,6 +19941,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "zone": { "type": "string", "description": "Name of the zone scoping this request.", @@ -17364,7 +19977,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17437,6 +20050,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the target pool to add a health check to.", @@ -17481,6 +20099,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to add instances to.", @@ -17513,7 +20136,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17574,6 +20197,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to delete.", @@ -17701,6 +20329,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -17726,7 +20359,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -17795,6 +20428,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the target pool to remove health checks from.", @@ -17839,6 +20477,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to remove instances from.", @@ -17889,6 +20532,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetPool": { "type": "string", "description": "Name of the TargetPool resource to set a backup pool for.", @@ -17930,6 +20578,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource to delete.", @@ -17996,6 +20649,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18020,7 +20678,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18074,6 +20732,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.", @@ -18110,6 +20773,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.", @@ -18146,6 +20814,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetSslProxy": { "type": "string", "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.", @@ -18171,6 +20844,246 @@ } } }, + "targetTcpProxies": { + "methods": { + "delete": { + "id": "compute.targetTcpProxies.delete", + "path": "{project}/global/targetTcpProxies/{targetTcpProxy}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetTcpProxy 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "targetTcpProxy": { + "type": "string", + "description": "Name of the TargetTcpProxy resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetTcpProxy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetTcpProxies.get", + "path": "{project}/global/targetTcpProxies/{targetTcpProxy}", + "httpMethod": "GET", + "description": "Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "targetTcpProxy": { + "type": "string", + "description": "Name of the TargetTcpProxy resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetTcpProxy" + ], + "response": { + "$ref": "TargetTcpProxy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetTcpProxies.insert", + "path": "{project}/global/targetTcpProxies", + "httpMethod": "POST", + "description": "Creates a TargetTcpProxy 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "TargetTcpProxy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetTcpProxies.list", + "path": "{project}/global/targetTcpProxies", + "httpMethod": "GET", + "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "TargetTcpProxyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setBackendService": { + "id": "compute.targetTcpProxies.setBackendService", + "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService", + "httpMethod": "POST", + "description": "Changes the BackendService for TargetTcpProxy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "targetTcpProxy": { + "type": "string", + "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetTcpProxy" + ], + "request": { + "$ref": "TargetTcpProxiesSetBackendServiceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setProxyHeader": { + "id": "compute.targetTcpProxies.setProxyHeader", + "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader", + "httpMethod": "POST", + "description": "Changes the ProxyHeaderType for TargetTcpProxy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, + "targetTcpProxy": { + "type": "string", + "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetTcpProxy" + ], + "request": { + "$ref": "TargetTcpProxiesSetProxyHeaderRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, "targetVpnGateways": { "methods": { "aggregatedList": { @@ -18181,7 +21094,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18242,6 +21155,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "targetVpnGateway": { "type": "string", "description": "Name of the target VPN gateway to delete.", @@ -18324,6 +21242,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18349,7 +21272,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18415,6 +21338,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap resource to delete.", @@ -18481,6 +21409,11 @@ "required": true, "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18510,6 +21443,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap scoping this request.", @@ -18541,7 +21479,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18586,7 +21524,7 @@ "id": "compute.urlMaps.patch", "path": "{project}/global/urlMaps/{urlMap}", "httpMethod": "PATCH", - "description": "Patches the specified UrlMap resource with the data included in the request. This method supports patch semantics.", + "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", "parameters": { "project": { "type": "string", @@ -18595,6 +21533,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap resource to patch.", @@ -18615,8 +21558,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" + "https://www.googleapis.com/auth/compute" ] }, "update": { @@ -18632,6 +21574,11 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "urlMap": { "type": "string", "description": "Name of the UrlMap resource to update.", @@ -18703,7 +21650,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -18764,6 +21711,11 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" + }, "vpnTunnel": { "type": "string", "description": "Name of the VpnTunnel resource to delete.", @@ -18846,6 +21798,11 @@ "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" + }, + "requestId": { + "type": "string", + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "location": "query" } }, "parameterOrder": [ @@ -18871,7 +21828,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19012,7 +21969,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -19107,7 +22064,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { diff --git a/etc/api/consumersurveys/v2/consumersurveys-api.json b/etc/api/consumersurveys/v2/consumersurveys-api.json index 44d975c772..3577a2d690 100644 --- a/etc/api/consumersurveys/v2/consumersurveys-api.json +++ b/etc/api/consumersurveys/v2/consumersurveys-api.json @@ -20,7 +20,7 @@ "basePath": "/consumersurveys/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "consumersurveys/v2/", - "batchPath": "batch", + "batchPath": "batch/consumersurveys/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/container/v1/container-api.json b/etc/api/container/v1/container-api.json index ce3a3884ca..9aa4ae922b 100644 --- a/etc/api/container/v1/container-api.json +++ b/etc/api/container/v1/container-api.json @@ -1,7 +1,27 @@ { + "version": "v1", + "baseUrl": "https://container.googleapis.com/", + "canonicalName": "Container", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "servicePath": "", + "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", + "kind": "discovery#restDescription", + "rootUrl": "https://container.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "container", + "batchPath": "batch", "id": "container:v1", "documentationLink": "https://cloud.google.com/container-engine/", - "revision": "20170430", + "revision": "20170915", "title": "Google Container Engine API", "ownerName": "Google", "discoveryVersion": "v1", @@ -14,7 +34,6 @@ "id": "container.projects.zones.getServerconfig", "path": "v1/projects/{projectId}/zones/{zone}/serverconfig", "description": "Returns configuration info about the Container Engine service.", - "httpMethod": "GET", "response": { "$ref": "ServerConfig" }, @@ -22,21 +41,22 @@ "projectId", "zone" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for.", - "required": true, - "type": "string" - }, "projectId": { "location": "path", "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for.", + "type": "string", "required": true, - "type": "string" + "location": "path" } }, "flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig" @@ -44,450 +64,107 @@ }, "resources": { "clusters": { - "methods": { - "legacyAbac": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "projectId": { - "required": true, - "type": "string", - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840)." - }, - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" - }, - "clusterId": { - "description": "The name of the cluster to update.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac", - "id": "container.projects.zones.clusters.legacyAbac", - "description": "Enables or disables the ABAC authorization mechanism on a cluster.", - "request": { - "$ref": "SetLegacyAbacRequest" - } - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Cluster" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" - }, - "clusterId": { - "location": "path", - "description": "The name of the cluster to retrieve.", - "required": true, - "type": "string" - }, - "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", - "id": "container.projects.zones.clusters.get", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", - "description": "Gets the details of a specific cluster." - }, - "update": { - "request": { - "$ref": "UpdateClusterRequest" - }, - "description": "Updates the settings of a specific cluster.", - "httpMethod": "PUT", - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "clusterId": { - "location": "path", - "description": "The name of the cluster to upgrade.", - "required": true, - "type": "string" - }, - "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" - }, - "zone": { - "required": true, - "type": "string", - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", - "id": "container.projects.zones.clusters.update", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}" - }, - "startIpRotation": { - "description": "Start master IP rotation.", - "request": { - "$ref": "StartIPRotationRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "projectId": { - "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", - "required": true, - "type": "string", - "location": "path" - }, - "zone": { - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string", - "location": "path" - }, - "clusterId": { - "location": "path", - "description": "The name of the cluster.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", - "id": "container.projects.zones.clusters.startIpRotation", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation" - }, - "setMasterAuth": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string", - "location": "path" - }, - "zone": { - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string", - "location": "path" - }, - "clusterId": { - "location": "path", - "description": "The name of the cluster to upgrade.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", - "id": "container.projects.zones.clusters.setMasterAuth", - "request": { - "$ref": "SetMasterAuthRequest" - }, - "description": "Used to set master auth materials. Currently supports :-\nChanging the admin password of a specific cluster.\nThis can be either via password generation or explicitly set the password." - }, - "delete": { - "id": "container.projects.zones.clusters.delete", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", - "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.", - "httpMethod": "DELETE", - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" - }, - "clusterId": { - "description": "The name of the cluster to delete.", - "required": true, - "type": "string", - "location": "path" - }, - "projectId": { - "required": true, - "type": "string", - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840)." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}" - }, - "list": { - "response": { - "$ref": "ListClustersResponse" - }, - "parameterOrder": [ - "projectId", - "zone" - ], - "httpMethod": "GET", - "parameters": { - "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" - }, - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters", - "path": "v1/projects/{projectId}/zones/{zone}/clusters", - "id": "container.projects.zones.clusters.list", - "description": "Lists all clusters owned by a project in either the specified zone or all\nzones." - }, - "create": { - "request": { - "$ref": "CreateClusterRequest" - }, - "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "zone" - ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" - }, - "zone": { - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters", - "path": "v1/projects/{projectId}/zones/{zone}/clusters", - "id": "container.projects.zones.clusters.create" - }, - "resourceLabels": { - "parameters": { - "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", - "required": true, - "type": "string" - }, - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" - }, - "clusterId": { - "description": "The name of the cluster.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", - "id": "container.projects.zones.clusters.resourceLabels", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", - "request": { - "$ref": "SetLabelsRequest" - }, - "description": "Sets labels on a cluster.", - "httpMethod": "POST", - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "response": { - "$ref": "Operation" - } - }, - "completeIpRotation": { - "request": { - "$ref": "CompleteIPRotationRequest" - }, - "description": "Completes master IP rotation.", - "httpMethod": "POST", - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "zone": { - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string", - "location": "path" - }, - "clusterId": { - "location": "path", - "description": "The name of the cluster.", - "required": true, - "type": "string" - }, - "projectId": { - "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", - "id": "container.projects.zones.clusters.completeIpRotation", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation" - } - }, "resources": { "nodePools": { "methods": { - "delete": { - "description": "Deletes a node pool from a cluster.", - "httpMethod": "DELETE", - "parameterOrder": [ - "projectId", - "zone", - "clusterId", - "nodePoolId" - ], - "response": { - "$ref": "Operation" - }, + "get": { "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", + "type": "string", + "required": true + }, "zone": { "location": "path", "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" + "type": "string", + "required": true }, "clusterId": { "location": "path", "description": "The name of the cluster.", - "required": true, - "type": "string" + "type": "string", + "required": true }, "nodePoolId": { - "description": "The name of the node pool to delete.", - "required": true, - "type": "string", - "location": "path" - }, - "projectId": { "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", - "required": true, - "type": "string" + "description": "The name of the node pool.", + "type": "string", + "required": true } }, "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", - "id": "container.projects.zones.clusters.nodePools.delete", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}" - }, - "setManagement": { - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", - "id": "container.projects.zones.clusters.nodePools.setManagement", - "description": "Sets the NodeManagement options for a node pool.", - "request": { - "$ref": "SetNodePoolManagementRequest" + "id": "container.projects.zones.clusters.nodePools.get", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "description": "Retrieves the node pool requested.", + "response": { + "$ref": "NodePool" }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "GET" + }, + "update": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true, + "location": "path" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to upgrade.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update", + "id": "container.projects.zones.clusters.nodePools.update", + "request": { + "$ref": "UpdateNodePoolRequest" + }, + "description": "Updates the version and/or image type of a specific node pool." + }, + "delete": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "id": "container.projects.zones.clusters.nodePools.delete", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "description": "Deletes a node pool from a cluster.", "response": { "$ref": "Operation" }, @@ -497,65 +174,160 @@ "clusterId", "nodePoolId" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" - }, - "clusterId": { - "location": "path", - "description": "The name of the cluster to update.", - "required": true, - "type": "string" - }, - "nodePoolId": { - "location": "path", - "description": "The name of the node pool to update.", - "required": true, - "type": "string" - }, - "projectId": { - "required": true, - "type": "string", - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840)." - } - }, - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement" - }, - "list": { + "httpMethod": "DELETE", "parameters": { "projectId": { "location": "path", "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.", + "type": "string", + "required": true + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to delete.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setSize": { + "request": { + "$ref": "SetNodePoolSizeRequest" + }, + "description": "Sets the size of a specific node pool.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" }, "zone": { "location": "path", "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" + "type": "string", + "required": true }, "clusterId": { - "required": true, - "type": "string", "location": "path", - "description": "The name of the cluster." + "description": "The name of the cluster to update.", + "type": "string", + "required": true + }, + "nodePoolId": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the node pool to update." + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize", + "id": "container.projects.zones.clusters.nodePools.setSize" + }, + "setManagement": { + "description": "Sets the NodeManagement options for a node pool.", + "request": { + "$ref": "SetNodePoolManagementRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to update.", + "type": "string", + "required": true + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to update.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", + "id": "container.projects.zones.clusters.nodePools.setManagement" + }, + "list": { + "parameters": { + "clusterId": { + "location": "path", + "description": "The name of the cluster.", + "type": "string", + "required": true + }, + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber)." + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", "id": "container.projects.zones.clusters.nodePools.list", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", "description": "Lists the node pools for a cluster.", "response": { "$ref": "ListNodePoolsResponse" @@ -568,6 +340,13 @@ "httpMethod": "GET" }, "rollback": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", + "id": "container.projects.zones.clusters.nodePools.rollback", + "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.", + "request": { + "$ref": "RollbackNodePoolUpgradeRequest" + }, "httpMethod": "POST", "parameterOrder": [ "projectId", @@ -579,49 +358,42 @@ "$ref": "Operation" }, "parameters": { - "zone": { - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, + "clusterId": { + "description": "The name of the cluster to rollback.", "type": "string", + "required": true, "location": "path" }, - "clusterId": { - "required": true, - "type": "string", - "location": "path", - "description": "The name of the cluster to rollback." - }, "nodePoolId": { - "location": "path", "description": "The name of the node pool to rollback.", + "type": "string", "required": true, - "type": "string" + "location": "path" }, "projectId": { "location": "path", "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", - "id": "container.projects.zones.clusters.nodePools.rollback", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", - "request": { - "$ref": "RollbackNodePoolUpgradeRequest" - }, - "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed." + ] }, "create": { - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", "id": "container.projects.zones.clusters.nodePools.create", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", + "description": "Creates a node pool for a cluster.", "request": { "$ref": "CreateNodePoolRequest" }, - "description": "Creates a node pool for a cluster.", "response": { "$ref": "Operation" }, @@ -634,21 +406,21 @@ "parameters": { "projectId": { "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", - "required": true, "type": "string", + "required": true, "location": "path" }, "zone": { - "location": "path", - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", "required": true, - "type": "string" + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides." }, "clusterId": { - "required": true, - "type": "string", "location": "path", - "description": "The name of the cluster." + "description": "The name of the cluster.", + "type": "string", + "required": true } }, "scopes": [ @@ -656,58 +428,740 @@ ], "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools" }, - "get": { - "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", - "id": "container.projects.zones.clusters.nodePools.get", - "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", - "description": "Retrieves the node pool requested.", - "httpMethod": "GET", + "autoscaling": { + "response": { + "$ref": "Operation" + }, "parameterOrder": [ "projectId", "zone", "clusterId", "nodePoolId" ], - "response": { - "$ref": "NodePool" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "httpMethod": "POST", "parameters": { - "clusterId": { - "description": "The name of the cluster.", - "required": true, - "type": "string", - "location": "path" - }, - "nodePoolId": { - "required": true, - "type": "string", - "location": "path", - "description": "The name of the node pool." - }, "projectId": { - "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", - "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", "type": "string", - "location": "path" + "required": true }, "zone": { "location": "path", "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to upgrade.", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "nodePoolId": { + "description": "The name of the node pool to upgrade.", + "type": "string", + "required": true, + "location": "path" } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling", + "id": "container.projects.zones.clusters.nodePools.autoscaling", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling", + "description": "Sets the autoscaling settings of a specific node pool.", + "request": { + "$ref": "SetNodePoolAutoscalingRequest" } } } } + }, + "methods": { + "startIpRotation": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "id": "container.projects.zones.clusters.startIpRotation", + "description": "Start master IP rotation.", + "request": { + "$ref": "StartIPRotationRequest" + } + }, + "setMaintenancePolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster to update.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "id": "container.projects.zones.clusters.setMaintenancePolicy", + "description": "Sets the maintenance policy for a cluster.", + "request": { + "$ref": "SetMaintenancePolicyRequest" + } + }, + "addons": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons", + "id": "container.projects.zones.clusters.addons", + "request": { + "$ref": "SetAddonsConfigRequest" + }, + "description": "Sets the addons of a specific cluster." + }, + "delete": { + "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.", + "httpMethod": "DELETE", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to delete.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.delete" + }, + "locations": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations", + "id": "container.projects.zones.clusters.locations", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations", + "request": { + "$ref": "SetLocationsRequest" + }, + "description": "Sets the locations of a specific cluster." + }, + "update": { + "id": "container.projects.zones.clusters.update", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "request": { + "$ref": "UpdateClusterRequest" + }, + "description": "Updates the settings of a specific cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}" + }, + "monitoring": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the cluster to upgrade." + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring", + "id": "container.projects.zones.clusters.monitoring", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring", + "request": { + "$ref": "SetMonitoringServiceRequest" + }, + "description": "Sets the monitoring service of a specific cluster." + }, + "master": { + "description": "Updates the master of a specific cluster.", + "request": { + "$ref": "UpdateMasterRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master", + "id": "container.projects.zones.clusters.master", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master" + }, + "setMasterAuth": { + "id": "container.projects.zones.clusters.setMasterAuth", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", + "description": "Used to set master auth materials. Currently supports :-\nChanging the admin password of a specific cluster.\nThis can be either via password generation or explicitly set the password.", + "request": { + "$ref": "SetMasterAuthRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840)." + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth" + }, + "logging": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging", + "id": "container.projects.zones.clusters.logging", + "request": { + "$ref": "SetLoggingServiceRequest" + }, + "description": "Sets the logging service of a specific cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.", + "type": "string", + "required": true + } + } + }, + "list": { + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "GET", + "response": { + "$ref": "ListClustersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters", + "id": "container.projects.zones.clusters.list", + "path": "v1/projects/{projectId}/zones/{zone}/clusters", + "description": "Lists all clusters owned by a project in either the specified zone or all\nzones." + }, + "resourceLabels": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber)." + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", + "id": "container.projects.zones.clusters.resourceLabels", + "description": "Sets labels on a cluster.", + "request": { + "$ref": "SetLabelsRequest" + } + }, + "create": { + "id": "container.projects.zones.clusters.create", + "path": "v1/projects/{projectId}/zones/{zone}/clusters", + "request": { + "$ref": "CreateClusterRequest" + }, + "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters" + }, + "completeIpRotation": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", + "id": "container.projects.zones.clusters.completeIpRotation", + "description": "Completes master IP rotation.", + "request": { + "$ref": "CompleteIPRotationRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides." + }, + "clusterId": { + "description": "The name of the cluster.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "legacyAbac": { + "request": { + "$ref": "SetLegacyAbacRequest" + }, + "description": "Enables or disables the ABAC authorization mechanism on a cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to update.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac", + "id": "container.projects.zones.clusters.legacyAbac", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac" + }, + "setNetworkPolicy": { + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy", + "id": "container.projects.zones.clusters.setNetworkPolicy", + "description": "Enables/Disables Network Policy for a cluster.", + "request": { + "$ref": "SetNetworkPolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy" + }, + "get": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.get", + "description": "Gets the details of a specific cluster.", + "httpMethod": "GET", + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides." + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to retrieve.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } } }, "operations": { "methods": { "cancel": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel", + "id": "container.projects.zones.operations.cancel", + "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel", "request": { "$ref": "CancelOperationRequest" }, @@ -721,69 +1175,32 @@ "operationId" ], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.", + "type": "string", + "required": true + }, "operationId": { "description": "The server-assigned `name` of the operation.", - "required": true, "type": "string", + "required": true, "location": "path" }, "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" - }, - "zone": { - "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.", - "required": true, "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel", - "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel", - "id": "container.projects.zones.operations.cancel" - }, - "list": { - "description": "Lists all operations in a project in a specific zone or all zones.", - "httpMethod": "GET", - "response": { - "$ref": "ListOperationsResponse" - }, - "parameterOrder": [ - "projectId", - "zone" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", "required": true, - "type": "string" - }, - "zone": { "location": "path", - "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for, or `-` for all zones.", - "required": true, - "type": "string" + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840)." } - }, - "flatPath": "v1/projects/{projectId}/zones/{zone}/operations", - "id": "container.projects.zones.operations.list", - "path": "v1/projects/{projectId}/zones/{zone}/operations" + } }, "get": { - "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", - "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", - "id": "container.projects.zones.operations.get", - "description": "Gets the specified operation.", + "httpMethod": "GET", "response": { "$ref": "Operation" }, @@ -792,30 +1209,64 @@ "zone", "operationId" ], - "httpMethod": "GET", "parameters": { "operationId": { "description": "The server-assigned `name` of the operation.", - "required": true, "type": "string", + "required": true, "location": "path" }, "projectId": { "location": "path", "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", - "required": true, - "type": "string" + "type": "string", + "required": true }, "zone": { "location": "path", "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "id": "container.projects.zones.operations.get", + "description": "Gets the specified operation." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for, or `-` for all zones.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/operations", + "path": "v1/projects/{projectId}/zones/{zone}/operations", + "id": "container.projects.zones.operations.list", + "description": "Lists all operations in a project in a specific zone or all zones." } } } @@ -832,23 +1283,18 @@ }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, "fields": { "location": "query", "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, - "callback": { + "uploadType": { "location": "query", - "description": "JSONP", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string" }, "$.xgafv": { @@ -864,7 +1310,17 @@ ], "location": "query" }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -873,12 +1329,7 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] + "default": "json" }, "access_token": { "type": "string", @@ -891,33 +1342,46 @@ "type": "string" }, "quotaUser": { - "location": "query", "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.", - "type": "string" + "type": "string", + "location": "query" }, "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" }, "bearer_token": { + "location": "query", "description": "OAuth bearer token.", - "type": "string", - "location": "query" + "type": "string" }, "oauth_token": { + "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "type": "string" } }, "schemas": { + "KubernetesDashboard": { + "properties": { + "disabled": { + "description": "Whether the Kubernetes Dashboard is enabled for this cluster.", + "type": "boolean" + } + }, + "id": "KubernetesDashboard", + "description": "Configuration for the Kubernetes Dashboard.", + "type": "object" + }, "Operation": { "description": "This operation resource represents operations that may have happened or are\nhappening on the cluster. All fields are output only.", "type": "object", "properties": { "operationType": { + "description": "The operation type.", + "type": "string", "enumDescriptions": [ "Not set.", "Cluster create.", @@ -932,7 +1396,10 @@ "Automatic node pool repair.", "Automatic node upgrade.", "Set labels.", - "Set/generate master auth materials" + "Set/generate master auth materials", + "Set node pool size.", + "Updates network policy for a cluster.", + "Set the maintenance policy." ], "enum": [ "TYPE_UNSPECIFIED", @@ -948,9 +1415,14 @@ "AUTO_REPAIR_NODES", "AUTO_UPGRADE_NODES", "SET_LABELS", - "SET_MASTER_AUTH" - ], - "description": "The operation type.", + "SET_MASTER_AUTH", + "SET_NODE_POOL_SIZE", + "SET_NETWORK_POLICY", + "SET_MAINTENANCE_POLICY" + ] + }, + "startTime": { + "description": "[Output only] The time the operation started, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", "type": "string" }, "zone": { @@ -984,8 +1456,8 @@ "type": "string" }, "selfLink": { - "description": "Server-defined URL for the resource.", - "type": "string" + "type": "string", + "description": "Server-defined URL for the resource." }, "detail": { "description": "Detailed operation progress, if available.", @@ -994,276 +1466,199 @@ "targetLink": { "description": "Server-defined URL for the target of the operation.", "type": "string" + }, + "endTime": { + "description": "[Output only] The time the operation completed, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" } }, "id": "Operation" }, - "AddonsConfig": { + "MaintenanceWindow": { "type": "object", "properties": { - "horizontalPodAutoscaling": { - "$ref": "HorizontalPodAutoscaling", - "description": "Configuration for the horizontal pod autoscaling feature, which\nincreases or decreases the number of replica pods a replication controller\nhas based on the resource usage of the existing pods." - }, - "httpLoadBalancing": { - "$ref": "HttpLoadBalancing", - "description": "Configuration for the HTTP (L7) load balancing controller addon, which\nmakes it easy to set up HTTP load balancers for services in a cluster." + "dailyMaintenanceWindow": { + "$ref": "DailyMaintenanceWindow", + "description": "DailyMaintenanceWindow specifies a daily maintenance operation window." } }, - "id": "AddonsConfig", - "description": "Configuration for the addons that can be automatically spun up in the\ncluster, enabling additional functionality." + "id": "MaintenanceWindow", + "description": "MaintenanceWindow defines the maintenance window to be used for the cluster." }, "RollbackNodePoolUpgradeRequest": { - "type": "object", - "properties": {}, "id": "RollbackNodePoolUpgradeRequest", - "description": "RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed\nNodePool upgrade. This will be an no-op if the last upgrade successfully\ncompleted." + "description": "RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed\nNodePool upgrade. This will be an no-op if the last upgrade successfully\ncompleted.", + "type": "object", + "properties": {} }, - "UpdateClusterRequest": { - "description": "UpdateClusterRequest updates the settings of a cluster.", + "NetworkPolicy": { + "description": "Configuration options for the NetworkPolicy feature.\nhttps://kubernetes.io/docs/concepts/services-networking/networkpolicies/", "type": "object", "properties": { - "update": { - "description": "A description of the update.", - "$ref": "ClusterUpdate" - } - }, - "id": "UpdateClusterRequest" - }, - "Cluster": { - "type": "object", - "properties": { - "clusterIpv4Cidr": { - "description": "The IP address range of the container pods in this cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`). Leave blank to have\none automatically chosen or specify a `/14` block in `10.0.0.0/8`.", - "type": "string" + "enabled": { + "type": "boolean", + "description": "Whether network policy is enabled on the cluster." }, - "initialNodeCount": { - "description": "The number of nodes to create in this cluster. You must ensure that your\nCompute Engine \u003ca href=\"/compute/docs/resource-quotas\"\u003eresource quota\u003c/a\u003e\nis sufficient for this number of instances. You must also have available\nfirewall and routes quota.\nFor requests, this field should only be used in lieu of a\n\"node_pool\" object, since this configuration (along with the\n\"node_config\") will be used to create a \"NodePool\" object with an\nauto-generated name. Do not use this and a node_pool at the same time.", - "format": "int32", - "type": "integer" - }, - "selfLink": { - "description": "[Output only] Server-defined URL for the resource.", - "type": "string" - }, - "locations": { - "description": "The list of Google Compute Engine\n[locations](/compute/docs/zones#available) in which the cluster's nodes\nshould be located.", - "type": "array", - "items": { - "type": "string" - } - }, - "nodePools": { - "type": "array", - "items": { - "$ref": "NodePool" - }, - "description": "The node pools associated with this cluster.\nThis field should not be set if \"node_config\" or \"initial_node_count\" are\nspecified." - }, - "instanceGroupUrls": { - "type": "array", - "items": { - "type": "string" - }, - "description": "[Output only] The resource URLs of [instance\ngroups](/compute/docs/instance-groups/) associated with this\ncluster." - }, - "servicesIpv4Cidr": { - "description": "[Output only] The IP address range of the Kubernetes services in\nthis cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `1.2.3.4/29`). Service addresses are\ntypically put in the last `/16` from the container CIDR.", - "type": "string" - }, - "enableKubernetesAlpha": { - "description": "Kubernetes alpha features are enabled on this cluster. This includes alpha\nAPI groups (e.g. v1alpha1) and features that may not be production ready in\nthe kubernetes version of the master and nodes.\nThe cluster has no SLA for uptime and master/node upgrades are disabled.\nAlpha enabled clusters are automatically deleted thirty days after\ncreation.", - "type": "boolean" - }, - "description": { - "description": "An optional description of this cluster.", - "type": "string" - }, - "currentNodeCount": { - "description": "[Output only] The number of nodes currently in the cluster.", - "format": "int32", - "type": "integer" - }, - "monitoringService": { - "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* `monitoring.googleapis.com` - the Google Cloud Monitoring service.\n* `none` - no metrics will be exported from the cluster.\n* if left as an empty string, `monitoring.googleapis.com` will be used.", - "type": "string" - }, - "network": { - "description": "The name of the Google Compute Engine\n[network](/compute/docs/networks-and-firewalls#networks) to which the\ncluster is connected. If left unspecified, the `default` network\nwill be used.", - "type": "string" - }, - "labelFingerprint": { + "provider": { + "description": "The selected network policy provider.", "type": "string", - "description": "The fingerprint of the set of labels for this cluster." - }, - "zone": { - "description": "[Output only] The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", - "type": "string" - }, - "expireTime": { - "description": "[Output only] The time the cluster will be automatically\ndeleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", - "type": "string" - }, - "loggingService": { - "description": "The logging service the cluster should use to write logs.\nCurrently available options:\n\n* `logging.googleapis.com` - the Google Cloud Logging service.\n* `none` - no logs will be exported from the cluster.\n* if left as an empty string,`logging.googleapis.com` will be used.", - "type": "string" - }, - "nodeIpv4CidrSize": { - "description": "[Output only] The size of the address space on each node for hosting\ncontainers. This is provisioned from within the `container_ipv4_cidr`\nrange.", - "format": "int32", - "type": "integer" - }, - "statusMessage": { - "type": "string", - "description": "[Output only] Additional information about the current status of this\ncluster, if available." - }, - "masterAuth": { - "$ref": "MasterAuth", - "description": "The authentication information for accessing the master endpoint." - }, - "currentMasterVersion": { - "type": "string", - "description": "[Output only] The current software version of the master endpoint." - }, - "nodeConfig": { - "$ref": "NodeConfig", - "description": "Parameters used in creating the cluster's nodes.\nSee `nodeConfig` for the description of its properties.\nFor requests, this field should only be used in lieu of a\n\"node_pool\" object, since this configuration (along with the\n\"initial_node_count\") will be used to create a \"NodePool\" object with an\nauto-generated name. Do not use this and a node_pool at the same time.\nFor responses, this field will be populated with the node configuration of\nthe first node pool.\n\nIf unspecified, the defaults are used." - }, - "addonsConfig": { - "$ref": "AddonsConfig", - "description": "Configurations for the various addons available to run in the cluster." - }, - "status": { "enumDescriptions": [ - "Not set.", - "The PROVISIONING state indicates the cluster is being created.", - "The RUNNING state indicates the cluster has been created and is fully\nusable.", - "The RECONCILING state indicates that some work is actively being done on\nthe cluster, such as upgrading the master or node software. Details can\nbe found in the `statusMessage` field.", - "The STOPPING state indicates the cluster is being deleted.", - "The ERROR state indicates the cluster may be unusable. Details\ncan be found in the `statusMessage` field." + "Not set", + "Tigera (Calico Felix)." ], "enum": [ - "STATUS_UNSPECIFIED", - "PROVISIONING", - "RUNNING", - "RECONCILING", - "STOPPING", - "ERROR" - ], - "description": "[Output only] The current status of this cluster.", - "type": "string" - }, - "currentNodeVersion": { - "description": "[Output only] The current version of the node software components.\nIf they are currently at multiple versions because they're in the process\nof being upgraded, this reflects the minimum version of all nodes.", - "type": "string" - }, - "subnetwork": { - "description": "The name of the Google Compute Engine\n[subnetwork](/compute/docs/subnetworks) to which the\ncluster is connected.", - "type": "string" - }, - "name": { - "type": "string", - "description": "The name of this cluster. The name must be unique within this project\nand zone, and can be up to 40 characters with the following restrictions:\n\n* Lowercase letters, numbers, and hyphens only.\n* Must start with a letter.\n* Must end with a number or a letter." - }, - "resourceLabels": { - "additionalProperties": { - "type": "string" - }, - "description": "The resource labels for the cluster to use to annotate any related GCE\nresources.", - "type": "object" - }, - "initialClusterVersion": { - "description": "The initial Kubernetes version for this cluster. Valid versions are those\nfound in validMasterVersions returned by getServerConfig. The version can\nbe upgraded over time; such upgrades are reflected in\ncurrentMasterVersion and currentNodeVersion.", - "type": "string" - }, - "legacyAbac": { - "$ref": "LegacyAbac", - "description": "Configuration for the legacy ABAC authorization mode." - }, - "endpoint": { - "description": "[Output only] The IP address of this cluster's master endpoint.\nThe endpoint can be accessed from the internet at\n`https://username:password@endpoint/`.\n\nSee the `masterAuth` property of this resource for username and\npassword information.", - "type": "string" - }, - "createTime": { - "description": "[Output only] The time the cluster was created, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "PROVIDER_UNSPECIFIED", + "CALICO" + ] + } + }, + "id": "NetworkPolicy" + }, + "UpdateMasterRequest": { + "description": "UpdateMasterRequest updates the master of the cluster.", + "type": "object", + "properties": { + "masterVersion": { + "description": "The Kubernetes version to change the master to. The only valid value is the\nlatest supported version. Use \"-\" to have the server automatically select\nthe latest version.", "type": "string" } }, - "id": "Cluster", - "description": "A Google Container Engine cluster." - }, - "CreateNodePoolRequest": { - "id": "CreateNodePoolRequest", - "description": "CreateNodePoolRequest creates a node pool for a cluster.", - "type": "object", - "properties": { - "nodePool": { - "$ref": "NodePool", - "description": "The node pool to create." - } - } + "id": "UpdateMasterRequest" }, "ListOperationsResponse": { "description": "ListOperationsResponse is the result of ListOperationsRequest.", "type": "object", "properties": { "operations": { - "description": "A list of operations in the project in the specified zone.", - "type": "array", "items": { "$ref": "Operation" - } + }, + "type": "array", + "description": "A list of operations in the project in the specified zone." }, "missingZones": { "description": "If any zones are listed here, the list of operations returned\nmay be missing the operations from those zones.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "ListOperationsResponse" }, - "ServerConfig": { - "description": "Container Engine service configuration.", + "CidrBlock": { "type": "object", + "properties": { + "displayName": { + "description": "display_name is an optional field for users to identify CIDR blocks.", + "type": "string" + }, + "cidrBlock": { + "description": "cidr_block must be specified in CIDR notation.", + "type": "string" + } + }, + "id": "CidrBlock", + "description": "CidrBlock contains an optional name and one CIDR block." + }, + "SetMonitoringServiceRequest": { + "description": "SetMonitoringServiceRequest sets the monitoring service of a cluster.", + "type": "object", + "properties": { + "monitoringService": { + "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* \"monitoring.googleapis.com\" - the Google Cloud Monitoring service\n* \"none\" - no metrics will be exported from the cluster", + "type": "string" + } + }, + "id": "SetMonitoringServiceRequest" + }, + "ServerConfig": { "properties": { "validMasterVersions": { "description": "List of valid master versions.", - "type": "array", "items": { "type": "string" - } - }, - "defaultClusterVersion": { - "description": "Version of Kubernetes the service deploys by default.", - "type": "string" + }, + "type": "array" }, "defaultImageType": { "description": "Default image type.", "type": "string" }, - "validNodeVersions": { - "description": "List of valid node upgrade target versions.", - "type": "array", - "items": { - "type": "string" - } + "defaultClusterVersion": { + "description": "Version of Kubernetes the service deploys by default.", + "type": "string" }, "validImageTypes": { "description": "List of valid image types.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "validNodeVersions": { + "description": "List of valid node upgrade target versions.", + "items": { + "type": "string" + }, + "type": "array" } }, - "id": "ServerConfig" + "id": "ServerConfig", + "description": "Container Engine service configuration.", + "type": "object" }, "NodeConfig": { "description": "Parameters that describe the nodes in a cluster.", "type": "object", "properties": { + "imageType": { + "type": "string", + "description": "The image type to use for this node. Note that for a given image type,\nthe latest version of it will be used." + }, + "oauthScopes": { + "description": "The set of Google API scopes to be made available on all of the\nnode VMs under the \"default\" service account.\n\nThe following scopes are recommended, but not required, and by default are\nnot included:\n\n* `https://www.googleapis.com/auth/compute` is required for mounting\npersistent storage on your nodes.\n* `https://www.googleapis.com/auth/devstorage.read_only` is required for\ncommunicating with **gcr.io**\n(the [Google Container Registry](/container-registry/)).\n\nIf unspecified, no scopes are added, unless Cloud Logging or Cloud\nMonitoring are enabled, in which case their required scopes will be added.", + "items": { + "type": "string" + }, + "type": "array" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The map of Kubernetes labels (key/value pairs) to be applied to each node.\nThese will added in addition to any default label(s) that\nKubernetes may apply to the node.\nIn case of conflict in label keys, the applied set may differ depending on\nthe Kubernetes version -- it's best to assume the behavior is undefined\nand conflicts should be avoided.\nFor more information, including usage and the valid values, see:\nhttps://kubernetes.io/docs/concepts/overview/working-with-objects/labels/", + "type": "object" + }, + "diskSizeGb": { + "type": "integer", + "format": "int32", + "description": "Size of the disk attached to each node, specified in GB.\nThe smallest allowed disk size is 10GB.\n\nIf unspecified, the default disk size is 100GB." + }, + "accelerators": { + "description": "A list of hardware accelerators to be attached to each node.\nSee https://cloud.google.com/compute/docs/gpus for more information about\nsupport for GPUs.", + "items": { + "$ref": "AcceleratorConfig" + }, + "type": "array" + }, + "machineType": { + "description": "The name of a Google Compute Engine [machine\ntype](/compute/docs/machine-types) (e.g.\n`n1-standard-1`).\n\nIf unspecified, the default machine type is\n`n1-standard-1`.", + "type": "string" + }, + "minCpuPlatform": { + "description": "Minimum CPU platform to be used by this instance. The instance may be\nscheduled on the specified or newer CPU platform. Applicable values are the\nfriendly names of CPU platforms, such as\n\u003ccode\u003eminCpuPlatform: "Intel Haswell"\u003c/code\u003e or\n\u003ccode\u003eminCpuPlatform: "Intel Sandy Bridge"\u003c/code\u003e. For more\ninformation, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)", + "type": "string" + }, + "preemptible": { + "description": "Whether the nodes are created as preemptible VM instances. See:\nhttps://cloud.google.com/compute/docs/instances/preemptible for more\ninformation about preemptible VM instances.", + "type": "boolean" + }, + "localSsdCount": { + "format": "int32", + "description": "The number of local SSD disks to be attached to the node.\n\nThe limit for this value is dependant upon the maximum number of\ndisks available on a machine per zone. See:\nhttps://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits\nfor more information.", + "type": "integer" + }, "metadata": { "additionalProperties": { "type": "string" @@ -1271,83 +1666,20 @@ "description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the four reserved keys:\n\"instance-template\", \"kube-env\", \"startup-script\", and \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.", "type": "object" }, - "diskSizeGb": { - "description": "Size of the disk attached to each node, specified in GB.\nThe smallest allowed disk size is 10GB.\n\nIf unspecified, the default disk size is 100GB.", - "format": "int32", - "type": "integer" - }, "tags": { "description": "The list of instance tags applied to all nodes. Tags are used to identify\nvalid sources or targets for network firewalls and are specified by\nthe client during cluster or node pool creation. Each tag within the list\nmust comply with RFC1035.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "serviceAccount": { "description": "The Google Cloud Platform Service Account to be used by the node VMs. If\nno Service Account is specified, the \"default\" service account is used.", "type": "string" - }, - "machineType": { - "description": "The name of a Google Compute Engine [machine\ntype](/compute/docs/machine-types) (e.g.\n`n1-standard-1`).\n\nIf unspecified, the default machine type is\n`n1-standard-1`.", - "type": "string" - }, - "imageType": { - "type": "string", - "description": "The image type to use for this node. Note that for a given image type,\nthe latest version of it will be used." - }, - "oauthScopes": { - "description": "The set of Google API scopes to be made available on all of the\nnode VMs under the \"default\" service account.\n\nThe following scopes are recommended, but not required, and by default are\nnot included:\n\n* `https://www.googleapis.com/auth/compute` is required for mounting\npersistent storage on your nodes.\n* `https://www.googleapis.com/auth/devstorage.read_only` is required for\ncommunicating with **gcr.io**\n(the [Google Container Registry](/container-registry/)).\n\nIf unspecified, no scopes are added, unless Cloud Logging or Cloud\nMonitoring are enabled, in which case their required scopes will be added.", - "type": "array", - "items": { - "type": "string" - } - }, - "preemptible": { - "type": "boolean", - "description": "Whether the nodes are created as preemptible VM instances. See:\nhttps://cloud.google.com/compute/docs/instances/preemptible for more\ninforamtion about preemptible VM instances." - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "The map of Kubernetes labels (key/value pairs) to be applied to each node.\nThese will added in addition to any default label(s) that\nKubernetes may apply to the node.\nIn case of conflict in label keys, the applied set may differ depending on\nthe Kubernetes version -- it's best to assume the behavior is undefined\nand conflicts should be avoided.\nFor more information, including usage and the valid values, see:\nhttp://kubernetes.io/v1.1/docs/user-guide/labels.html" - }, - "localSsdCount": { - "description": "The number of local SSD disks to be attached to the node.\n\nThe limit for this value is dependant upon the maximum number of\ndisks available on a machine per zone. See:\nhttps://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits\nfor more information.", - "format": "int32", - "type": "integer" } }, "id": "NodeConfig" }, - "MasterAuth": { - "description": "The authentication information for accessing the master endpoint.\nAuthentication can be done using HTTP basic auth or using client\ncertificates.", - "type": "object", - "properties": { - "clusterCaCertificate": { - "description": "[Output only] Base64-encoded public certificate that is the root of\ntrust for the cluster.", - "type": "string" - }, - "password": { - "description": "The password to use for HTTP basic authentication to the master endpoint.\nBecause the master endpoint is open to the Internet, you should create a\nstrong password. If a password is provided for cluster creation, username\nmust be non-empty.", - "type": "string" - }, - "clientCertificate": { - "description": "[Output only] Base64-encoded public certificate used by clients to\nauthenticate to the cluster endpoint.", - "type": "string" - }, - "username": { - "description": "The username to use for HTTP basic authentication to the master endpoint.\nFor clusters v1.6.0 and later, you can disable basic authentication by\nproviding an empty username.", - "type": "string" - }, - "clientKey": { - "description": "[Output only] Base64-encoded private key used by clients to authenticate\nto the cluster endpoint.", - "type": "string" - } - }, - "id": "MasterAuth" - }, "AutoUpgradeOptions": { "description": "AutoUpgradeOptions defines the set of options for the user to control how\nthe Auto Upgrades will proceed.", "type": "object", @@ -1364,25 +1696,25 @@ "id": "AutoUpgradeOptions" }, "ListClustersResponse": { - "description": "ListClustersResponse is the result of ListClustersRequest.", - "type": "object", "properties": { "clusters": { "description": "A list of clusters in the project in the specified zone, or\nacross all ones.", - "type": "array", "items": { "$ref": "Cluster" - } + }, + "type": "array" }, "missingZones": { "description": "If any zones are listed here, the list of clusters returned\nmay be missing those zones.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "ListClustersResponse" + "id": "ListClustersResponse", + "description": "ListClustersResponse is the result of ListClustersRequest.", + "type": "object" }, "HttpLoadBalancing": { "description": "Configuration options for the HTTP (L7) load balancing controller addon,\nwhich makes it easy to set up HTTP load balancers for services in a cluster.", @@ -1395,28 +1727,8 @@ }, "id": "HttpLoadBalancing" }, - "NodePoolAutoscaling": { - "description": "NodePoolAutoscaling contains information required by cluster autoscaler to\nadjust the size of the node pool to the current cluster usage.", - "type": "object", - "properties": { - "maxNodeCount": { - "description": "Maximum number of nodes in the NodePool. Must be \u003e= min_node_count. There\nhas to enough quota to scale up the cluster.", - "format": "int32", - "type": "integer" - }, - "minNodeCount": { - "description": "Minimum number of nodes in the NodePool. Must be \u003e= 1 and \u003c=\nmax_node_count.", - "format": "int32", - "type": "integer" - }, - "enabled": { - "description": "Is autoscaling enabled for this node pool.", - "type": "boolean" - } - }, - "id": "NodePoolAutoscaling" - }, "SetMasterAuthRequest": { + "description": "SetMasterAuthRequest updates the admin password of a cluster.", "type": "object", "properties": { "update": { @@ -1424,6 +1736,7 @@ "$ref": "MasterAuth" }, "action": { + "type": "string", "enumDescriptions": [ "Operation is unknown and will error out", "Set the password to a user generated value.", @@ -1434,17 +1747,106 @@ "SET_PASSWORD", "GENERATE_PASSWORD" ], - "description": "The exact form of action to be taken on the master auth", + "description": "The exact form of action to be taken on the master auth" + } + }, + "id": "SetMasterAuthRequest" + }, + "SetNetworkPolicyRequest": { + "description": "SetNetworkPolicyRequest enables/disables network policy for a cluster.", + "type": "object", + "properties": { + "networkPolicy": { + "$ref": "NetworkPolicy", + "description": "Configuration options for the NetworkPolicy feature." + } + }, + "id": "SetNetworkPolicyRequest" + }, + "NodePoolAutoscaling": { + "description": "NodePoolAutoscaling contains information required by cluster autoscaler to\nadjust the size of the node pool to the current cluster usage.", + "type": "object", + "properties": { + "maxNodeCount": { + "format": "int32", + "description": "Maximum number of nodes in the NodePool. Must be \u003e= min_node_count. There\nhas to enough quota to scale up the cluster.", + "type": "integer" + }, + "minNodeCount": { + "format": "int32", + "description": "Minimum number of nodes in the NodePool. Must be \u003e= 1 and \u003c=\nmax_node_count.", + "type": "integer" + }, + "enabled": { + "description": "Is autoscaling enabled for this node pool.", + "type": "boolean" + } + }, + "id": "NodePoolAutoscaling" + }, + "IPAllocationPolicy": { + "description": "Configuration for controlling how IPs are allocated in the cluster.", + "type": "object", + "properties": { + "nodeIpv4Cidr": { + "type": "string", + "description": "This field is deprecated, use node_ipv4_cidr_block." + }, + "clusterIpv4CidrBlock": { + "description": "The IP address range for the cluster pod IPs. If this field is set, then\n`cluster.cluster_ipv4_cidr` must be left blank.\n\nThis field is only applicable when `use_ip_aliases` is true.\n\nSet to blank to have a range chosen with the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.", + "type": "string" + }, + "clusterSecondaryRangeName": { + "description": "The name of the secondary range to be used for the cluster CIDR\nblock. The secondary range will be used for pod IP\naddresses. This must be an existing secondary range associated\nwith the cluster subnetwork.\n\nThis field is only applicable with use_ip_aliases is true and\ncreate_subnetwork is false.", + "type": "string" + }, + "nodeIpv4CidrBlock": { + "description": "The IP address range of the instance IPs in this cluster.\n\nThis is applicable only if `create_subnetwork` is true.\n\nSet to blank to have a range chosen with the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.", + "type": "string" + }, + "servicesIpv4Cidr": { + "description": "This field is deprecated, use services_ipv4_cidr_block.", + "type": "string" + }, + "servicesSecondaryRangeName": { + "description": "The name of the secondary range to be used as for the services\nCIDR block. The secondary range will be used for service\nClusterIPs. This must be an existing secondary range associated\nwith the cluster subnetwork.\n\nThis field is only applicable with use_ip_aliases is true and\ncreate_subnetwork is false.", + "type": "string" + }, + "useIpAliases": { + "description": "Whether alias IPs will be used for pod IPs in the cluster.", + "type": "boolean" + }, + "createSubnetwork": { + "type": "boolean", + "description": "Whether a new subnetwork will be created automatically for the cluster.\n\nThis field is only applicable when `use_ip_aliases` is true." + }, + "servicesIpv4CidrBlock": { + "description": "The IP address range of the services IPs in this cluster. If blank, a range\nwill be automatically chosen with the default size.\n\nThis field is only applicable when `use_ip_aliases` is true.\n\nSet to blank to have a range chosen with the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.", + "type": "string" + }, + "subnetworkName": { + "description": "A custom subnetwork name to be used if `create_subnetwork` is true. If\nthis field is empty, then an automatic name will be chosen for the new\nsubnetwork.", + "type": "string" + }, + "clusterIpv4Cidr": { + "description": "This field is deprecated, use cluster_ipv4_cidr_block.", "type": "string" } }, - "id": "SetMasterAuthRequest", - "description": "SetMasterAuthRequest updates the admin password of a cluster." + "id": "IPAllocationPolicy" }, "ClusterUpdate": { "description": "ClusterUpdate describes an update to the cluster. Exactly one update can\nbe applied to a cluster with each request, so at most one field can be\nprovided.", "type": "object", "properties": { + "desiredAddonsConfig": { + "$ref": "AddonsConfig", + "description": "Configurations for the various addons available to run in the cluster." + }, + "desiredNodePoolId": { + "description": "The node pool to be upgraded. This field is mandatory if\n\"desired_node_version\", \"desired_image_family\" or\n\"desired_node_pool_autoscaling\" is specified and there is more than one\nnode pool on the cluster.", + "type": "string" + }, "desiredNodeVersion": { "description": "The Kubernetes version to change the nodes to (typically an\nupgrade). Use `-` to upgrade to the latest version supported by\nthe server.", "type": "string" @@ -1453,32 +1855,28 @@ "description": "The Kubernetes version to change the master to. The only valid value is the\nlatest supported version. Use \"-\" to have the server automatically select\nthe latest version.", "type": "string" }, + "desiredMasterAuthorizedNetworksConfig": { + "$ref": "MasterAuthorizedNetworksConfig", + "description": "Master authorized networks is a Beta feature.\nThe desired configuration options for master authorized networks feature." + }, "desiredLocations": { "description": "The desired list of Google Compute Engine\n[locations](/compute/docs/zones#available) in which the cluster's nodes\nshould be located. Changing the locations a cluster is in will result\nin nodes being either created or removed from the cluster, depending on\nwhether locations are being added or removed.\n\nThis list must always include the cluster's primary zone.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "desiredNodePoolAutoscaling": { - "$ref": "NodePoolAutoscaling", - "description": "Autoscaler configuration for the node pool specified in\ndesired_node_pool_id. If there is only one pool in the\ncluster and desired_node_pool_id is not provided then\nthe change applies to that single node pool." + "description": "Autoscaler configuration for the node pool specified in\ndesired_node_pool_id. If there is only one pool in the\ncluster and desired_node_pool_id is not provided then\nthe change applies to that single node pool.", + "$ref": "NodePoolAutoscaling" }, "desiredMonitoringService": { - "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* \"monitoring.googleapis.com\" - the Google Cloud Monitoring service\n* \"none\" - no metrics will be exported from the cluster", - "type": "string" + "type": "string", + "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* \"monitoring.googleapis.com\" - the Google Cloud Monitoring service\n* \"none\" - no metrics will be exported from the cluster" }, "desiredImageType": { "description": "The desired image type for the node pool.\nNOTE: Set the \"desired_node_pool\" field as well.", "type": "string" - }, - "desiredAddonsConfig": { - "description": "Configurations for the various addons available to run in the cluster.", - "$ref": "AddonsConfig" - }, - "desiredNodePoolId": { - "type": "string", - "description": "The node pool to be upgraded. This field is mandatory if\n\"desired_node_version\", \"desired_image_family\" or\n\"desired_node_pool_autoscaling\" is specified and there is more than one\nnode pool on the cluster." } }, "id": "ClusterUpdate" @@ -1494,6 +1892,24 @@ }, "id": "HorizontalPodAutoscaling" }, + "MasterAuthorizedNetworksConfig": { + "description": "Master authorized networks is a Beta feature.\nConfiguration options for the master authorized networks feature. Enabled\nmaster authorized networks will disallow all external traffic to access\nKubernetes master through HTTPS except traffic from the given CIDR blocks,\nGoogle Compute Engine Public IPs and Google Prod IPs.", + "type": "object", + "properties": { + "enabled": { + "description": "Whether or not master authorized networks is enabled.", + "type": "boolean" + }, + "cidrBlocks": { + "description": "cidr_blocks define up to 10 external networks that could access\nKubernetes master through HTTPS.", + "items": { + "$ref": "CidrBlock" + }, + "type": "array" + } + }, + "id": "MasterAuthorizedNetworksConfig" + }, "SetNodePoolManagementRequest": { "description": "SetNodePoolManagementRequest sets the node management properties of a node\npool.", "type": "object", @@ -1505,11 +1921,16 @@ }, "id": "SetNodePoolManagementRequest" }, - "Empty": { - "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "SetNodePoolAutoscalingRequest": { + "id": "SetNodePoolAutoscalingRequest", + "description": "SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool.", "type": "object", - "properties": {} + "properties": { + "autoscaling": { + "$ref": "NodePoolAutoscaling", + "description": "Autoscaling configuration for the node pool." + } + } }, "CreateClusterRequest": { "description": "CreateClusterRequest creates a cluster.", @@ -1522,31 +1943,36 @@ }, "id": "CreateClusterRequest" }, - "ListNodePoolsResponse": { + "UpdateNodePoolRequest": { + "description": "UpdateNodePoolRequests update a node pool's image and/or version.", + "type": "object", "properties": { - "nodePools": { - "description": "A list of node pools for a cluster.", - "type": "array", - "items": { - "$ref": "NodePool" - } + "imageType": { + "description": "The desired image type for the node pool.", + "type": "string" + }, + "nodeVersion": { + "description": "The Kubernetes version to change the nodes to (typically an\nupgrade). Use `-` to upgrade to the latest version supported by\nthe server.", + "type": "string" } }, - "id": "ListNodePoolsResponse", - "description": "ListNodePoolsResponse is the result of ListNodePoolsRequest.", - "type": "object" + "id": "UpdateNodePoolRequest" }, - "CompleteIPRotationRequest": { - "description": "CompleteIPRotationRequest moves the cluster master back into single-IP mode.", + "AcceleratorConfig": { + "description": "AcceleratorConfig represents a Hardware Accelerator request.", "type": "object", - "properties": {}, - "id": "CompleteIPRotationRequest" - }, - "StartIPRotationRequest": { - "type": "object", - "properties": {}, - "id": "StartIPRotationRequest", - "description": "StartIPRotationRequest creates a new IP for the cluster and then performs\na node upgrade on each node pool to point to the new IP." + "properties": { + "acceleratorType": { + "description": "The accelerator type resource name. List of supported accelerators\n[here](/compute/docs/gpus/#Introduction)", + "type": "string" + }, + "acceleratorCount": { + "format": "int64", + "description": "The number of the accelerator cards exposed to an instance.", + "type": "string" + } + }, + "id": "AcceleratorConfig" }, "LegacyAbac": { "description": "Configuration for the legacy Attribute Based Access Control authorization\nmode.", @@ -1559,16 +1985,420 @@ }, "id": "LegacyAbac" }, + "SetAddonsConfigRequest": { + "description": "SetAddonsConfigRequest sets the addons associated with the cluster.", + "type": "object", + "properties": { + "addonsConfig": { + "$ref": "AddonsConfig", + "description": "The desired configurations for the various addons available to run in the\ncluster." + } + }, + "id": "SetAddonsConfigRequest" + }, + "SetLegacyAbacRequest": { + "description": "SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for\na cluster.", + "type": "object", + "properties": { + "enabled": { + "description": "Whether ABAC authorization will be enabled in the cluster.", + "type": "boolean" + } + }, + "id": "SetLegacyAbacRequest" + }, + "AddonsConfig": { + "properties": { + "horizontalPodAutoscaling": { + "$ref": "HorizontalPodAutoscaling", + "description": "Configuration for the horizontal pod autoscaling feature, which\nincreases or decreases the number of replica pods a replication controller\nhas based on the resource usage of the existing pods." + }, + "httpLoadBalancing": { + "$ref": "HttpLoadBalancing", + "description": "Configuration for the HTTP (L7) load balancing controller addon, which\nmakes it easy to set up HTTP load balancers for services in a cluster." + }, + "kubernetesDashboard": { + "description": "Configuration for the Kubernetes Dashboard.", + "$ref": "KubernetesDashboard" + }, + "networkPolicyConfig": { + "$ref": "NetworkPolicyConfig", + "description": "Configuration for NetworkPolicy. This only tracks whether the addon\nis enabled or not on the Master, it does not track whether network policy\nis enabled for the nodes." + } + }, + "id": "AddonsConfig", + "description": "Configuration for the addons that can be automatically spun up in the\ncluster, enabling additional functionality.", + "type": "object" + }, + "SetLocationsRequest": { + "description": "SetLocationsRequest sets the locations of the cluster.", + "type": "object", + "properties": { + "locations": { + "description": "The desired list of Google Compute Engine\n[locations](/compute/docs/zones#available) in which the cluster's nodes\nshould be located. Changing the locations a cluster is in will result\nin nodes being either created or removed from the cluster, depending on\nwhether locations are being added or removed.\n\nThis list must always include the cluster's primary zone.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "SetLocationsRequest" + }, + "SetNodePoolSizeRequest": { + "description": "SetNodePoolSizeRequest sets the size a node\npool.", + "type": "object", + "properties": { + "nodeCount": { + "format": "int32", + "description": "The desired node count for the pool.", + "type": "integer" + } + }, + "id": "SetNodePoolSizeRequest" + }, + "UpdateClusterRequest": { + "properties": { + "update": { + "$ref": "ClusterUpdate", + "description": "A description of the update." + } + }, + "id": "UpdateClusterRequest", + "description": "UpdateClusterRequest updates the settings of a cluster.", + "type": "object" + }, + "NetworkPolicyConfig": { + "properties": { + "disabled": { + "description": "Whether NetworkPolicy is enabled for this cluster.", + "type": "boolean" + } + }, + "id": "NetworkPolicyConfig", + "description": "Configuration for NetworkPolicy. This only tracks whether the addon\nis enabled or not on the Master, it does not track whether network policy\nis enabled for the nodes.", + "type": "object" + }, + "Cluster": { + "description": "A Google Container Engine cluster.", + "type": "object", + "properties": { + "network": { + "description": "The name of the Google Compute Engine\n[network](/compute/docs/networks-and-firewalls#networks) to which the\ncluster is connected. If left unspecified, the `default` network\nwill be used.", + "type": "string" + }, + "labelFingerprint": { + "description": "The fingerprint of the set of labels for this cluster.", + "type": "string" + }, + "zone": { + "description": "[Output only] The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string" + }, + "loggingService": { + "description": "The logging service the cluster should use to write logs.\nCurrently available options:\n\n* `logging.googleapis.com` - the Google Cloud Logging service.\n* `none` - no logs will be exported from the cluster.\n* if left as an empty string,`logging.googleapis.com` will be used.", + "type": "string" + }, + "nodeIpv4CidrSize": { + "format": "int32", + "description": "[Output only] The size of the address space on each node for hosting\ncontainers. This is provisioned from within the `container_ipv4_cidr`\nrange.", + "type": "integer" + }, + "expireTime": { + "description": "[Output only] The time the cluster will be automatically\ndeleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "masterAuthorizedNetworksConfig": { + "$ref": "MasterAuthorizedNetworksConfig", + "description": "Master authorized networks is a Beta feature.\nThe configuration options for master authorized networks feature." + }, + "statusMessage": { + "description": "[Output only] Additional information about the current status of this\ncluster, if available.", + "type": "string" + }, + "masterAuth": { + "$ref": "MasterAuth", + "description": "The authentication information for accessing the master endpoint." + }, + "currentMasterVersion": { + "description": "[Output only] The current software version of the master endpoint.", + "type": "string" + }, + "nodeConfig": { + "$ref": "NodeConfig", + "description": "Parameters used in creating the cluster's nodes.\nSee `nodeConfig` for the description of its properties.\nFor requests, this field should only be used in lieu of a\n\"node_pool\" object, since this configuration (along with the\n\"initial_node_count\") will be used to create a \"NodePool\" object with an\nauto-generated name. Do not use this and a node_pool at the same time.\nFor responses, this field will be populated with the node configuration of\nthe first node pool.\n\nIf unspecified, the defaults are used." + }, + "addonsConfig": { + "$ref": "AddonsConfig", + "description": "Configurations for the various addons available to run in the cluster." + }, + "status": { + "description": "[Output only] The current status of this cluster.", + "type": "string", + "enumDescriptions": [ + "Not set.", + "The PROVISIONING state indicates the cluster is being created.", + "The RUNNING state indicates the cluster has been created and is fully\nusable.", + "The RECONCILING state indicates that some work is actively being done on\nthe cluster, such as upgrading the master or node software. Details can\nbe found in the `statusMessage` field.", + "The STOPPING state indicates the cluster is being deleted.", + "The ERROR state indicates the cluster may be unusable. Details\ncan be found in the `statusMessage` field." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "PROVISIONING", + "RUNNING", + "RECONCILING", + "STOPPING", + "ERROR" + ] + }, + "currentNodeVersion": { + "description": "[Output only] The current version of the node software components.\nIf they are currently at multiple versions because they're in the process\nof being upgraded, this reflects the minimum version of all nodes.", + "type": "string" + }, + "subnetwork": { + "description": "The name of the Google Compute Engine\n[subnetwork](/compute/docs/subnetworks) to which the\ncluster is connected.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of this cluster. The name must be unique within this project\nand zone, and can be up to 40 characters with the following restrictions:\n\n* Lowercase letters, numbers, and hyphens only.\n* Must start with a letter.\n* Must end with a number or a letter." + }, + "resourceLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The resource labels for the cluster to use to annotate any related\nGoogle Compute Engine resources.", + "type": "object" + }, + "maintenancePolicy": { + "description": "Configure the maintenance policy for this cluster.", + "$ref": "MaintenancePolicy" + }, + "initialClusterVersion": { + "description": "The initial Kubernetes version for this cluster. Valid versions are those\nfound in validMasterVersions returned by getServerConfig. The version can\nbe upgraded over time; such upgrades are reflected in\ncurrentMasterVersion and currentNodeVersion.", + "type": "string" + }, + "ipAllocationPolicy": { + "$ref": "IPAllocationPolicy", + "description": "Configuration for cluster IP allocation." + }, + "legacyAbac": { + "$ref": "LegacyAbac", + "description": "Configuration for the legacy ABAC authorization mode." + }, + "endpoint": { + "description": "[Output only] The IP address of this cluster's master endpoint.\nThe endpoint can be accessed from the internet at\n`https://username:password@endpoint/`.\n\nSee the `masterAuth` property of this resource for username and\npassword information.", + "type": "string" + }, + "createTime": { + "description": "[Output only] The time the cluster was created, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "clusterIpv4Cidr": { + "description": "The IP address range of the container pods in this cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`). Leave blank to have\none automatically chosen or specify a `/14` block in `10.0.0.0/8`.", + "type": "string" + }, + "initialNodeCount": { + "type": "integer", + "format": "int32", + "description": "The number of nodes to create in this cluster. You must ensure that your\nCompute Engine \u003ca href=\"/compute/docs/resource-quotas\"\u003eresource quota\u003c/a\u003e\nis sufficient for this number of instances. You must also have available\nfirewall and routes quota.\nFor requests, this field should only be used in lieu of a\n\"node_pool\" object, since this configuration (along with the\n\"node_config\") will be used to create a \"NodePool\" object with an\nauto-generated name. Do not use this and a node_pool at the same time." + }, + "selfLink": { + "description": "[Output only] Server-defined URL for the resource.", + "type": "string" + }, + "nodePools": { + "description": "The node pools associated with this cluster.\nThis field should not be set if \"node_config\" or \"initial_node_count\" are\nspecified.", + "items": { + "$ref": "NodePool" + }, + "type": "array" + }, + "locations": { + "description": "The list of Google Compute Engine\n[locations](/compute/docs/zones#available) in which the cluster's nodes\nshould be located.", + "items": { + "type": "string" + }, + "type": "array" + }, + "instanceGroupUrls": { + "description": "[Output only] The resource URLs of [instance\ngroups](/compute/docs/instance-groups/) associated with this\ncluster.", + "items": { + "type": "string" + }, + "type": "array" + }, + "servicesIpv4Cidr": { + "description": "[Output only] The IP address range of the Kubernetes services in\nthis cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `1.2.3.4/29`). Service addresses are\ntypically put in the last `/16` from the container CIDR.", + "type": "string" + }, + "networkPolicy": { + "$ref": "NetworkPolicy", + "description": "Configuration options for the NetworkPolicy feature." + }, + "enableKubernetesAlpha": { + "description": "Kubernetes alpha features are enabled on this cluster. This includes alpha\nAPI groups (e.g. v1alpha1) and features that may not be production ready in\nthe kubernetes version of the master and nodes.\nThe cluster has no SLA for uptime and master/node upgrades are disabled.\nAlpha enabled clusters are automatically deleted thirty days after\ncreation.", + "type": "boolean" + }, + "description": { + "description": "An optional description of this cluster.", + "type": "string" + }, + "currentNodeCount": { + "format": "int32", + "description": "[Output only] The number of nodes currently in the cluster.", + "type": "integer" + }, + "monitoringService": { + "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* `monitoring.googleapis.com` - the Google Cloud Monitoring service.\n* `none` - no metrics will be exported from the cluster.\n* if left as an empty string, `monitoring.googleapis.com` will be used.", + "type": "string" + } + }, + "id": "Cluster" + }, + "CreateNodePoolRequest": { + "description": "CreateNodePoolRequest creates a node pool for a cluster.", + "type": "object", + "properties": { + "nodePool": { + "$ref": "NodePool", + "description": "The node pool to create." + } + }, + "id": "CreateNodePoolRequest" + }, + "MasterAuth": { + "properties": { + "password": { + "description": "The password to use for HTTP basic authentication to the master endpoint.\nBecause the master endpoint is open to the Internet, you should create a\nstrong password. If a password is provided for cluster creation, username\nmust be non-empty.", + "type": "string" + }, + "clientCertificateConfig": { + "$ref": "ClientCertificateConfig", + "description": "Configuration for client certificate authentication on the cluster. If no\nconfiguration is specified, a client certificate is issued." + }, + "clientKey": { + "description": "[Output only] Base64-encoded private key used by clients to authenticate\nto the cluster endpoint.", + "type": "string" + }, + "clusterCaCertificate": { + "description": "[Output only] Base64-encoded public certificate that is the root of\ntrust for the cluster.", + "type": "string" + }, + "clientCertificate": { + "description": "[Output only] Base64-encoded public certificate used by clients to\nauthenticate to the cluster endpoint.", + "type": "string" + }, + "username": { + "description": "The username to use for HTTP basic authentication to the master endpoint.\nFor clusters v1.6.0 and later, you can disable basic authentication by\nproviding an empty username.", + "type": "string" + } + }, + "id": "MasterAuth", + "description": "The authentication information for accessing the master endpoint.\nAuthentication can be done using HTTP basic auth or using client\ncertificates.", + "type": "object" + }, + "DailyMaintenanceWindow": { + "description": "Time window specified for daily maintenance operations.", + "type": "object", + "properties": { + "duration": { + "description": "[Output only] Duration of the time window, automatically chosen to be\nsmallest possible in the given scenario.\nDuration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat \"PTnHnMnS\".", + "type": "string" + }, + "startTime": { + "description": "Time within the maintenance window to start the maintenance operations.\nTime format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat \"HH:MM”, where HH : [00-23] and MM : [00-59] GMT.", + "type": "string" + } + }, + "id": "DailyMaintenanceWindow" + }, + "MaintenancePolicy": { + "description": "MaintenancePolicy defines the maintenance policy to be used for the cluster.", + "type": "object", + "properties": { + "window": { + "description": "Specifies the maintenance window in which maintenance may be performed.", + "$ref": "MaintenanceWindow" + } + }, + "id": "MaintenancePolicy" + }, + "ClientCertificateConfig": { + "properties": { + "issueClientCertificate": { + "description": "Issue a client certificate.", + "type": "boolean" + } + }, + "id": "ClientCertificateConfig", + "description": "Configuration for client certificates on the cluster.", + "type": "object" + }, + "SetLoggingServiceRequest": { + "description": "SetLoggingServiceRequest sets the logging service of a cluster.", + "type": "object", + "properties": { + "loggingService": { + "description": "The logging service the cluster should use to write metrics.\nCurrently available options:\n\n* \"logging.googleapis.com\" - the Google Cloud Logging service\n* \"none\" - no metrics will be exported from the cluster", + "type": "string" + } + }, + "id": "SetLoggingServiceRequest" + }, + "SetMaintenancePolicyRequest": { + "description": "SetMaintenancePolicyRequest sets the maintenance policy for a cluster.", + "type": "object", + "properties": { + "maintenancePolicy": { + "description": "The maintenance policy to be set for the cluster. An empty field\nclears the existing maintenance policy.", + "$ref": "MaintenancePolicy" + } + }, + "id": "SetMaintenancePolicyRequest" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "ListNodePoolsResponse": { + "description": "ListNodePoolsResponse is the result of ListNodePoolsRequest.", + "type": "object", + "properties": { + "nodePools": { + "description": "A list of node pools for a cluster.", + "items": { + "$ref": "NodePool" + }, + "type": "array" + } + }, + "id": "ListNodePoolsResponse" + }, + "CompleteIPRotationRequest": { + "description": "CompleteIPRotationRequest moves the cluster master back into single-IP mode.", + "type": "object", + "properties": {}, + "id": "CompleteIPRotationRequest" + }, + "StartIPRotationRequest": { + "properties": {}, + "id": "StartIPRotationRequest", + "description": "StartIPRotationRequest creates a new IP for the cluster and then performs\na node upgrade on each node pool to point to the new IP.", + "type": "object" + }, "SetLabelsRequest": { "description": "SetLabelsRequest sets the Google Cloud Platform labels on a Google Container\nEngine cluster, which will in turn set them for Google Compute Engine\nresources used by that cluster", "type": "object", "properties": { "resourceLabels": { + "description": "The labels to set for that cluster.", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "The labels to set for that cluster.", - "type": "object" + } }, "labelFingerprint": { "description": "The fingerprint of the previous set of labels for this resource,\nused to detect conflicts. The fingerprint is initially generated by\nContainer Engine and changes after every request to modify or update\nlabels. You must always provide an up-to-date fingerprint hash when\nupdating or changing labels. Make a \u003ccode\u003eget()\u003c/code\u003e request to the\nresource to get the latest fingerprint.", @@ -1582,7 +2412,6 @@ "type": "object", "properties": { "status": { - "description": "[Output only] The status of the nodes in this pool instance.", "type": "string", "enumDescriptions": [ "Not set.", @@ -1601,7 +2430,8 @@ "RECONCILING", "STOPPING", "ERROR" - ] + ], + "description": "[Output only] The status of the nodes in this pool instance." }, "config": { "$ref": "NodeConfig", @@ -1619,25 +2449,25 @@ "$ref": "NodePoolAutoscaling", "description": "Autoscaler configuration for this NodePool. Autoscaler is enabled\nonly if a valid configuration is present." }, + "initialNodeCount": { + "type": "integer", + "format": "int32", + "description": "The initial node count for the pool. You must ensure that your\nCompute Engine \u003ca href=\"/compute/docs/resource-quotas\"\u003eresource quota\u003c/a\u003e\nis sufficient for this number of instances. You must also have available\nfirewall and routes quota." + }, "management": { "$ref": "NodeManagement", "description": "NodeManagement configuration for this NodePool." }, - "initialNodeCount": { - "description": "The initial node count for the pool. You must ensure that your\nCompute Engine \u003ca href=\"/compute/docs/resource-quotas\"\u003eresource quota\u003c/a\u003e\nis sufficient for this number of instances. You must also have available\nfirewall and routes quota.", - "format": "int32", - "type": "integer" - }, "selfLink": { "description": "[Output only] Server-defined URL for the resource.", "type": "string" }, "instanceGroupUrls": { "description": "[Output only] The resource URLs of [instance\ngroups](/compute/docs/instance-groups/) associated with this\nnode pool.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "version": { "description": "[Output only] The version of the Kubernetes of this node.", @@ -1650,17 +2480,17 @@ "description": "NodeManagement defines the set of node management services turned on for the\nnode pool.", "type": "object", "properties": { - "upgradeOptions": { - "$ref": "AutoUpgradeOptions", - "description": "Specifies the Auto Upgrade knobs for the node pool." - }, - "autoUpgrade": { - "description": "A flag that specifies whether node auto-upgrade is enabled for the node\npool. If enabled, node auto-upgrade helps keep the nodes in your node pool\nup to date with the latest release version of Kubernetes.", - "type": "boolean" - }, "autoRepair": { "description": "A flag that specifies whether the node auto-repair is enabled for the node\npool. If enabled, the nodes in this node pool will be monitored and, if\nthey fail health checks too many times, an automatic repair action will be\ntriggered.", "type": "boolean" + }, + "autoUpgrade": { + "type": "boolean", + "description": "A flag that specifies whether node auto-upgrade is enabled for the node\npool. If enabled, node auto-upgrade helps keep the nodes in your node pool\nup to date with the latest release version of Kubernetes." + }, + "upgradeOptions": { + "$ref": "AutoUpgradeOptions", + "description": "Specifies the Auto Upgrade knobs for the node pool." } }, "id": "NodeManagement" @@ -1670,41 +2500,11 @@ "type": "object", "properties": {}, "id": "CancelOperationRequest" - }, - "SetLegacyAbacRequest": { - "description": "SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for\na cluster.", - "type": "object", - "properties": { - "enabled": { - "description": "Whether ABAC authorization will be enabled in the cluster.", - "type": "boolean" - } - }, - "id": "SetLegacyAbacRequest" } }, + "protocol": "rest", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, - "protocol": "rest", - "version": "v1", - "baseUrl": "https://container.googleapis.com/", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - } - } - } - }, - "kind": "discovery#restDescription", - "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", - "servicePath": "", - "rootUrl": "https://container.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "container", - "batchPath": "batch" + } } diff --git a/etc/api/container/v1/crates/1.0.6-api+20170915 b/etc/api/container/v1/crates/1.0.6-api+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/container/v1beta1/container-api.json b/etc/api/container/v1beta1/container-api.json new file mode 100644 index 0000000000..94d21b7c54 --- /dev/null +++ b/etc/api/container/v1beta1/container-api.json @@ -0,0 +1,3084 @@ +{ + "documentationLink": "https://cloud.google.com/container-engine/", + "revision": "20170915", + "id": "container:v1beta1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "AcceleratorConfig": { + "description": "AcceleratorConfig represents a Hardware Accelerator request.", + "type": "object", + "properties": { + "acceleratorType": { + "description": "The accelerator type resource name. List of supported accelerators\n[here](/compute/docs/gpus/#Introduction)", + "type": "string" + }, + "acceleratorCount": { + "format": "int64", + "description": "The number of the accelerator cards exposed to an instance.", + "type": "string" + } + }, + "id": "AcceleratorConfig" + }, + "SetLabelsRequest": { + "description": "SetLabelsRequest sets the Google Cloud Platform labels on a Google Container\nEngine cluster, which will in turn set them for Google Compute Engine\nresources used by that cluster", + "type": "object", + "properties": { + "labelFingerprint": { + "description": "The fingerprint of the previous set of labels for this resource,\nused to detect conflicts. The fingerprint is initially generated by\nContainer Engine and changes after every request to modify or update\nlabels. You must always provide an up-to-date fingerprint hash when\nupdating or changing labels. Make a \u003ccode\u003eget()\u003c/code\u003e request to the\nresource to get the latest fingerprint.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "resourceLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The labels to set for that cluster.", + "type": "object" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "id": "SetLabelsRequest" + }, + "NodePool": { + "id": "NodePool", + "description": "NodePool contains the name and configuration for a cluster's node pool.\nNode pools are a set of nodes (i.e. VM's), with a common configuration and\nspecification, under the control of the cluster master. They may have a set\nof Kubernetes labels applied to them, which may be used to reference them\nduring pod scheduling. They may also be resized up or down, to accommodate\nthe workload.", + "type": "object", + "properties": { + "status": { + "enumDescriptions": [ + "Not set.", + "The PROVISIONING state indicates the node pool is being created.", + "The RUNNING state indicates the node pool has been created\nand is fully usable.", + "The RUNNING_WITH_ERROR state indicates the node pool has been created\nand is partially usable. Some error state has occurred and some\nfunctionality may be impaired. Customer may need to reissue a request\nor trigger a new update.", + "The RECONCILING state indicates that some work is actively being done on\nthe node pool, such as upgrading node software. Details can\nbe found in the `statusMessage` field.", + "The STOPPING state indicates the node pool is being deleted.", + "The ERROR state indicates the node pool may be unusable. Details\ncan be found in the `statusMessage` field." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "PROVISIONING", + "RUNNING", + "RUNNING_WITH_ERROR", + "RECONCILING", + "STOPPING", + "ERROR" + ], + "description": "[Output only] The status of the nodes in this pool instance.", + "type": "string" + }, + "config": { + "$ref": "NodeConfig", + "description": "The node configuration of the pool." + }, + "statusMessage": { + "description": "[Output only] Additional information about the current status of this\nnode pool instance, if available.", + "type": "string" + }, + "name": { + "description": "The name of the node pool.", + "type": "string" + }, + "autoscaling": { + "description": "Autoscaler configuration for this NodePool. Autoscaler is enabled\nonly if a valid configuration is present.", + "$ref": "NodePoolAutoscaling" + }, + "initialNodeCount": { + "format": "int32", + "description": "The initial node count for the pool. You must ensure that your\nCompute Engine \u003ca href=\"/compute/docs/resource-quotas\"\u003eresource quota\u003c/a\u003e\nis sufficient for this number of instances. You must also have available\nfirewall and routes quota.", + "type": "integer" + }, + "management": { + "$ref": "NodeManagement", + "description": "NodeManagement configuration for this NodePool." + }, + "selfLink": { + "description": "[Output only] Server-defined URL for the resource.", + "type": "string" + }, + "version": { + "description": "[Output only] The version of the Kubernetes of this node.", + "type": "string" + }, + "instanceGroupUrls": { + "description": "[Output only] The resource URLs of [instance\ngroups](/compute/docs/instance-groups/) associated with this\nnode pool.", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "NodeManagement": { + "description": "NodeManagement defines the set of node management services turned on for the\nnode pool.", + "type": "object", + "properties": { + "upgradeOptions": { + "description": "Specifies the Auto Upgrade knobs for the node pool.", + "$ref": "AutoUpgradeOptions" + }, + "autoRepair": { + "description": "Whether the nodes will be automatically repaired.", + "type": "boolean" + }, + "autoUpgrade": { + "description": "Whether the nodes will be automatically upgraded.", + "type": "boolean" + } + }, + "id": "NodeManagement" + }, + "NodeTaint": { + "properties": { + "key": { + "description": "Key for taint.", + "type": "string" + }, + "effect": { + "description": "Effect for taint.", + "type": "string", + "enumDescriptions": [ + "NoSchedule", + "PreferNoSchedule", + "NoExecute" + ], + "enum": [ + "NO_SCHEDULE", + "PREFER_NO_SCHEDULE", + "NO_EXECUTE" + ] + }, + "value": { + "description": "Value for taint.", + "type": "string" + } + }, + "id": "NodeTaint", + "description": "Kubernetes taint is comprised of three fields: key, value, and effect. Effect\ncan only be one of three types: NoSchedule, PreferNoSchedule or NoExecute.\n\nFor more information, including usage and the valid values, see:\nhttps://kubernetes.io/docs/concepts/configuration/taint-and-toleration/", + "type": "object" + }, + "CancelOperationRequest": { + "description": "CancelOperationRequest cancels a single operation.", + "type": "object", + "properties": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.", + "type": "string" + }, + "operationId": { + "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead." + } + }, + "id": "CancelOperationRequest" + }, + "KubernetesDashboard": { + "description": "Configuration for the Kubernetes Dashboard.", + "type": "object", + "properties": { + "disabled": { + "description": "Whether the Kubernetes Dashboard is enabled for this cluster.", + "type": "boolean" + } + }, + "id": "KubernetesDashboard" + }, + "SetLegacyAbacRequest": { + "properties": { + "name": { + "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "enabled": { + "description": "Whether ABAC authorization will be enabled in the cluster.", + "type": "boolean" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead." + }, + "clusterId": { + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "id": "SetLegacyAbacRequest", + "description": "SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for\na cluster.", + "type": "object" + }, + "Operation": { + "id": "Operation", + "description": "This operation resource represents operations that may have happened or are\nhappening on the cluster. All fields are output only.", + "type": "object", + "properties": { + "selfLink": { + "type": "string", + "description": "Server-defined URL for the resource." + }, + "detail": { + "description": "Detailed operation progress, if available.", + "type": "string" + }, + "targetLink": { + "description": "Server-defined URL for the target of the operation.", + "type": "string" + }, + "location": { + "description": "[Output only] The name of the Google Compute Engine\n[zone](/compute/docs/regions-zones/regions-zones#available) or\n[region](/compute/docs/regions-zones/regions-zones#available) in which\nthe cluster resides.", + "type": "string" + }, + "endTime": { + "description": "[Output only] The time the operation completed, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "operationType": { + "description": "The operation type.", + "type": "string", + "enumDescriptions": [ + "Not set.", + "Cluster create.", + "Cluster delete.", + "A master upgrade.", + "A node upgrade.", + "Cluster repair.", + "Cluster update.", + "Node pool create.", + "Node pool delete.", + "Set node pool management.", + "Automatic node pool repair.", + "Automatic node upgrade.", + "Set labels.", + "Set/generate master auth materials", + "Set node pool size.", + "Updates network policy for a cluster.", + "Set the maintenance policy." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "CREATE_CLUSTER", + "DELETE_CLUSTER", + "UPGRADE_MASTER", + "UPGRADE_NODES", + "REPAIR_CLUSTER", + "UPDATE_CLUSTER", + "CREATE_NODE_POOL", + "DELETE_NODE_POOL", + "SET_NODE_POOL_MANAGEMENT", + "AUTO_REPAIR_NODES", + "AUTO_UPGRADE_NODES", + "SET_LABELS", + "SET_MASTER_AUTH", + "SET_NODE_POOL_SIZE", + "SET_NETWORK_POLICY", + "SET_MAINTENANCE_POLICY" + ] + }, + "startTime": { + "description": "[Output only] The time the operation started, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation\nis taking place.\nThis field is deprecated, use location instead.", + "type": "string" + }, + "status": { + "enum": [ + "STATUS_UNSPECIFIED", + "PENDING", + "RUNNING", + "DONE", + "ABORTING" + ], + "description": "The current status of the operation.", + "type": "string", + "enumDescriptions": [ + "Not set.", + "The operation has been created.", + "The operation is currently running.", + "The operation is done, either cancelled or completed.", + "The operation is aborting." + ] + }, + "name": { + "description": "The server-assigned ID for the operation.", + "type": "string" + }, + "statusMessage": { + "description": "If an error has occurred, a textual description of the error.", + "type": "string" + } + } + }, + "AddonsConfig": { + "id": "AddonsConfig", + "description": "Configuration for the addons that can be automatically spun up in the\ncluster, enabling additional functionality.", + "type": "object", + "properties": { + "kubernetesDashboard": { + "description": "Configuration for the Kubernetes Dashboard.", + "$ref": "KubernetesDashboard" + }, + "networkPolicyConfig": { + "$ref": "NetworkPolicyConfig", + "description": "Configuration for NetworkPolicy. This only tracks whether the addon\nis enabled or not on the Master, it does not track whether network policy\nis enabled for the nodes." + }, + "horizontalPodAutoscaling": { + "$ref": "HorizontalPodAutoscaling", + "description": "Configuration for the horizontal pod autoscaling feature, which\nincreases or decreases the number of replica pods a replication controller\nhas based on the resource usage of the existing pods." + }, + "httpLoadBalancing": { + "$ref": "HttpLoadBalancing", + "description": "Configuration for the HTTP (L7) load balancing controller addon, which\nmakes it easy to set up HTTP load balancers for services in a cluster." + } + } + }, + "MaintenanceWindow": { + "description": "MaintenanceWindow defines the maintenance window to be used for the cluster.", + "type": "object", + "properties": { + "dailyMaintenanceWindow": { + "$ref": "DailyMaintenanceWindow", + "description": "DailyMaintenanceWindow specifies a daily maintenance operation window." + } + }, + "id": "MaintenanceWindow" + }, + "RollbackNodePoolUpgradeRequest": { + "description": "RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed\nNodePool upgrade. This will be an no-op if the last upgrade successfully\ncompleted.", + "type": "object", + "properties": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster to rollback.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "nodePoolId": { + "description": "The name of the node pool to rollback.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'." + } + }, + "id": "RollbackNodePoolUpgradeRequest" + }, + "NetworkPolicyConfig": { + "properties": { + "disabled": { + "description": "Whether NetworkPolicy is enabled for this cluster.", + "type": "boolean" + } + }, + "id": "NetworkPolicyConfig", + "description": "Configuration for NetworkPolicy. This only tracks whether the addon\nis enabled or not on the Master, it does not track whether network policy\nis enabled for the nodes.", + "type": "object" + }, + "UpdateClusterRequest": { + "properties": { + "update": { + "description": "A description of the update.", + "$ref": "ClusterUpdate" + }, + "name": { + "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "id": "UpdateClusterRequest", + "description": "UpdateClusterRequest updates the settings of a cluster.", + "type": "object" + }, + "NetworkPolicy": { + "description": "Configuration options for the NetworkPolicy feature.\nhttps://kubernetes.io/docs/concepts/services-networking/networkpolicies/", + "type": "object", + "properties": { + "enabled": { + "description": "Whether network policy is enabled on the cluster.", + "type": "boolean" + }, + "provider": { + "enumDescriptions": [ + "Not set", + "Tigera (Calico Felix)." + ], + "enum": [ + "PROVIDER_UNSPECIFIED", + "CALICO" + ], + "description": "The selected network policy provider.", + "type": "string" + } + }, + "id": "NetworkPolicy" + }, + "Cluster": { + "description": "A Google Container Engine cluster.", + "type": "object", + "properties": { + "createTime": { + "description": "[Output only] The time the cluster was created, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "clusterIpv4Cidr": { + "description": "The IP address range of the container pods in this cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`). Leave blank to have\none automatically chosen or specify a `/14` block in `10.0.0.0/8`.", + "type": "string" + }, + "initialNodeCount": { + "format": "int32", + "description": "The number of nodes to create in this cluster. You must ensure that your\nCompute Engine \u003ca href=\"/compute/docs/resource-quotas\"\u003eresource quota\u003c/a\u003e\nis sufficient for this number of instances. You must also have available\nfirewall and routes quota.\nFor requests, this field should only be used in lieu of a\n\"node_pool\" object, since this configuration (along with the\n\"node_config\") will be used to create a \"NodePool\" object with an\nauto-generated name. Do not use this and a node_pool at the same time.", + "type": "integer" + }, + "nodePools": { + "description": "The node pools associated with this cluster.\nThis field should not be set if \"node_config\" or \"initial_node_count\" are\nspecified.", + "items": { + "$ref": "NodePool" + }, + "type": "array" + }, + "locations": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The list of Google Compute Engine\n[locations](/compute/docs/zones#available) in which the cluster's nodes\nshould be located." + }, + "selfLink": { + "description": "[Output only] Server-defined URL for the resource.", + "type": "string" + }, + "instanceGroupUrls": { + "description": "[Output only] The resource URLs of [instance\ngroups](/compute/docs/instance-groups/) associated with this\ncluster.", + "items": { + "type": "string" + }, + "type": "array" + }, + "networkPolicy": { + "$ref": "NetworkPolicy", + "description": "Configuration options for the NetworkPolicy feature." + }, + "servicesIpv4Cidr": { + "description": "[Output only] The IP address range of the Kubernetes services in\nthis cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `1.2.3.4/29`). Service addresses are\ntypically put in the last `/16` from the container CIDR.", + "type": "string" + }, + "enableKubernetesAlpha": { + "description": "Kubernetes alpha features are enabled on this cluster. This includes alpha\nAPI groups (e.g. v1beta1) and features that may not be production ready in\nthe kubernetes version of the master and nodes.\nThe cluster has no SLA for uptime and master/node upgrades are disabled.\nAlpha enabled clusters are automatically deleted thirty days after\ncreation.", + "type": "boolean" + }, + "description": { + "description": "An optional description of this cluster.", + "type": "string" + }, + "currentNodeCount": { + "format": "int32", + "description": "[Output only] The number of nodes currently in the cluster.", + "type": "integer" + }, + "monitoringService": { + "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* `monitoring.googleapis.com` - the Google Cloud Monitoring service.\n* `none` - no metrics will be exported from the cluster.\n* if left as an empty string, `monitoring.googleapis.com` will be used.", + "type": "string" + }, + "network": { + "type": "string", + "description": "The name of the Google Compute Engine\n[network](/compute/docs/networks-and-firewalls#networks) to which the\ncluster is connected. If left unspecified, the `default` network\nwill be used." + }, + "zone": { + "description": "[Output only] The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use location instead.", + "type": "string" + }, + "loggingService": { + "type": "string", + "description": "The logging service the cluster should use to write logs.\nCurrently available options:\n\n* `logging.googleapis.com` - the Google Cloud Logging service.\n* `none` - no logs will be exported from the cluster.\n* if left as an empty string,`logging.googleapis.com` will be used." + }, + "nodeIpv4CidrSize": { + "format": "int32", + "description": "[Output only] The size of the address space on each node for hosting\ncontainers. This is provisioned from within the `container_ipv4_cidr`\nrange.", + "type": "integer" + }, + "expireTime": { + "description": "[Output only] The time the cluster will be automatically\ndeleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + }, + "masterAuthorizedNetworksConfig": { + "description": "The configuration options for master authorized networks feature.", + "$ref": "MasterAuthorizedNetworksConfig" + }, + "statusMessage": { + "description": "[Output only] Additional information about the current status of this\ncluster, if available.", + "type": "string" + }, + "masterAuth": { + "$ref": "MasterAuth", + "description": "The authentication information for accessing the master endpoint." + }, + "currentMasterVersion": { + "description": "[Output only] The current software version of the master endpoint.", + "type": "string" + }, + "nodeConfig": { + "$ref": "NodeConfig", + "description": "Parameters used in creating the cluster's nodes.\nSee `nodeConfig` for the description of its properties.\nFor requests, this field should only be used in lieu of a\n\"node_pool\" object, since this configuration (along with the\n\"initial_node_count\") will be used to create a \"NodePool\" object with an\nauto-generated name. Do not use this and a node_pool at the same time.\nFor responses, this field will be populated with the node configuration of\nthe first node pool.\n\nIf unspecified, the defaults are used." + }, + "addonsConfig": { + "description": "Configurations for the various addons available to run in the cluster.", + "$ref": "AddonsConfig" + }, + "status": { + "enumDescriptions": [ + "Not set.", + "The PROVISIONING state indicates the cluster is being created.", + "The RUNNING state indicates the cluster has been created and is fully\nusable.", + "The RECONCILING state indicates that some work is actively being done on\nthe cluster, such as upgrading the master or node software. Details can\nbe found in the `statusMessage` field.", + "The STOPPING state indicates the cluster is being deleted.", + "The ERROR state indicates the cluster may be unusable. Details\ncan be found in the `statusMessage` field." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "PROVISIONING", + "RUNNING", + "RECONCILING", + "STOPPING", + "ERROR" + ], + "description": "[Output only] The current status of this cluster.", + "type": "string" + }, + "currentNodeVersion": { + "description": "[Output only] The current version of the node software components.\nIf they are currently at multiple versions because they're in the process\nof being upgraded, this reflects the minimum version of all nodes.", + "type": "string" + }, + "subnetwork": { + "description": "The name of the Google Compute Engine\n[subnetwork](/compute/docs/subnetworks) to which the\ncluster is connected.", + "type": "string" + }, + "name": { + "description": "The name of this cluster. The name must be unique within this project\nand zone, and can be up to 40 characters with the following restrictions:\n\n* Lowercase letters, numbers, and hyphens only.\n* Must start with a letter.\n* Must end with a number or a letter.", + "type": "string" + }, + "maintenancePolicy": { + "$ref": "MaintenancePolicy", + "description": "Configure the maintenance policy for this cluster." + }, + "initialClusterVersion": { + "description": "The initial Kubernetes version for this cluster. Valid versions are those\nfound in validMasterVersions returned by getServerConfig. The version can\nbe upgraded over time; such upgrades are reflected in\ncurrentMasterVersion and currentNodeVersion.", + "type": "string" + }, + "ipAllocationPolicy": { + "description": "Configuration for cluster IP allocation.", + "$ref": "IPAllocationPolicy" + }, + "endpoint": { + "description": "[Output only] The IP address of this cluster's master endpoint.\nThe endpoint can be accessed from the internet at\n`https://username:password@endpoint/`.\n\nSee the `masterAuth` property of this resource for username and\npassword information.", + "type": "string" + }, + "location": { + "description": "[Output only] The name of the Google Compute Engine\n[zone](/compute/docs/regions-zones/regions-zones#available) or\n[region](/compute/docs/regions-zones/regions-zones#available) in which\nthe cluster resides.", + "type": "string" + } + }, + "id": "Cluster" + }, + "ListOperationsResponse": { + "description": "ListOperationsResponse is the result of ListOperationsRequest.", + "type": "object", + "properties": { + "operations": { + "description": "A list of operations in the project in the specified zone.", + "items": { + "$ref": "Operation" + }, + "type": "array" + }, + "missingZones": { + "description": "If any zones are listed here, the list of operations returned\nmay be missing the operations from those zones.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ListOperationsResponse" + }, + "CreateNodePoolRequest": { + "properties": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use parent instead.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use parent instead.", + "type": "string" + }, + "parent": { + "description": "The parent (project, location, cluster id) where the node pool will be created.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string" + }, + "nodePool": { + "description": "The node pool to create.", + "$ref": "NodePool" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "type": "string" + } + }, + "id": "CreateNodePoolRequest", + "description": "CreateNodePoolRequest creates a node pool for a cluster.", + "type": "object" + }, + "CidrBlock": { + "id": "CidrBlock", + "description": "CidrBlock contains an optional name and one CIDR block.", + "type": "object", + "properties": { + "displayName": { + "description": "display_name is an optional field for users to identify CIDR blocks.", + "type": "string" + }, + "cidrBlock": { + "description": "cidr_block must be specified in CIDR notation.", + "type": "string" + } + } + }, + "ServerConfig": { + "description": "Container Engine service configuration.", + "type": "object", + "properties": { + "validMasterVersions": { + "description": "List of valid master versions.", + "items": { + "type": "string" + }, + "type": "array" + }, + "defaultImageType": { + "description": "Default image type.", + "type": "string" + }, + "defaultClusterVersion": { + "type": "string", + "description": "Version of Kubernetes the service deploys by default." + }, + "validImageTypes": { + "description": "List of valid image types.", + "items": { + "type": "string" + }, + "type": "array" + }, + "validNodeVersions": { + "description": "List of valid node upgrade target versions.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ServerConfig" + }, + "NodeConfig": { + "description": "Parameters that describe the nodes in a cluster.", + "type": "object", + "properties": { + "tags": { + "description": "The list of instance tags applied to all nodes. Tags are used to identify\nvalid sources or targets for network firewalls and are specified by\nthe client during cluster or node pool creation. Each tag within the list\nmust comply with RFC1035.", + "items": { + "type": "string" + }, + "type": "array" + }, + "serviceAccount": { + "description": "The Google Cloud Platform Service Account to be used by the node VMs. If\nno Service Account is specified, the \"default\" service account is used.", + "type": "string" + }, + "imageType": { + "description": "The image type to use for this node. Note that for a given image type,\nthe latest version of it will be used.", + "type": "string" + }, + "oauthScopes": { + "description": "The set of Google API scopes to be made available on all of the\nnode VMs under the \"default\" service account.\n\nThe following scopes are recommended, but not required, and by default are\nnot included:\n\n* `https://www.googleapis.com/auth/compute` is required for mounting\npersistent storage on your nodes.\n* `https://www.googleapis.com/auth/devstorage.read_only` is required for\ncommunicating with **gcr.io**\n(the [Google Container Registry](/container-registry/)).\n\nIf unspecified, no scopes are added, unless Cloud Logging or Cloud\nMonitoring are enabled, in which case their required scopes will be added.", + "items": { + "type": "string" + }, + "type": "array" + }, + "taints": { + "description": "List of kubernetes taints to be applied to each node.\n\nFor more information, including usage and the valid values, see:\nhttps://kubernetes.io/docs/concepts/configuration/taint-and-toleration/", + "items": { + "$ref": "NodeTaint" + }, + "type": "array" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The map of Kubernetes labels (key/value pairs) to be applied to each node.\nThese will added in addition to any default label(s) that\nKubernetes may apply to the node.\nIn case of conflict in label keys, the applied set may differ depending on\nthe Kubernetes version -- it's best to assume the behavior is undefined\nand conflicts should be avoided.\nFor more information, including usage and the valid values, see:\nhttps://kubernetes.io/docs/concepts/overview/working-with-objects/labels/", + "type": "object" + }, + "diskSizeGb": { + "format": "int32", + "description": "Size of the disk attached to each node, specified in GB.\nThe smallest allowed disk size is 10GB.\n\nIf unspecified, the default disk size is 100GB.", + "type": "integer" + }, + "accelerators": { + "description": "A list of hardware accelerators to be attached to each node.\nSee https://cloud.google.com/compute/docs/gpus for more information about\nsupport for GPUs.", + "items": { + "$ref": "AcceleratorConfig" + }, + "type": "array" + }, + "machineType": { + "description": "The name of a Google Compute Engine [machine\ntype](/compute/docs/machine-types) (e.g.\n`n1-standard-1`).\n\nIf unspecified, the default machine type is\n`n1-standard-1`.", + "type": "string" + }, + "minCpuPlatform": { + "description": "Minimum CPU platform to be used by this instance. The instance may be\nscheduled on the specified or newer CPU platform. Applicable values are the\nfriendly names of CPU platforms, such as\n\u003ccode\u003eminCpuPlatform: "Intel Haswell"\u003c/code\u003e or\n\u003ccode\u003eminCpuPlatform: "Intel Sandy Bridge"\u003c/code\u003e. For more\ninformation, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)", + "type": "string" + }, + "preemptible": { + "description": "Whether the nodes are created as preemptible VM instances. See:\nhttps://cloud.google.com/compute/docs/instances/preemptible for more\ninforamtion about preemptible VM instances.", + "type": "boolean" + }, + "localSsdCount": { + "format": "int32", + "description": "The number of local SSD disks to be attached to the node.\n\nThe limit for this value is dependant upon the maximum number of\ndisks available on a machine per zone. See:\nhttps://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits\nfor more information.", + "type": "integer" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the four reserved keys:\n\"instance-template\", \"kube-env\", \"startup-script\", and \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.", + "type": "object" + } + }, + "id": "NodeConfig" + }, + "MasterAuth": { + "description": "The authentication information for accessing the master endpoint.\nAuthentication can be done using HTTP basic auth or using client\ncertificates.", + "type": "object", + "properties": { + "password": { + "description": "The password to use for HTTP basic authentication to the master endpoint.\nBecause the master endpoint is open to the Internet, you should create a\nstrong password. If a password is provided for cluster creation, username\nmust be non-empty.", + "type": "string" + }, + "clientCertificateConfig": { + "$ref": "ClientCertificateConfig", + "description": "Configuration for client certificate authentication on the cluster. If no\nconfiguration is specified, a client certificate is issued." + }, + "clientKey": { + "description": "[Output only] Base64-encoded private key used by clients to authenticate\nto the cluster endpoint.", + "type": "string" + }, + "clusterCaCertificate": { + "description": "[Output only] Base64-encoded public certificate that is the root of\ntrust for the cluster.", + "type": "string" + }, + "clientCertificate": { + "description": "[Output only] Base64-encoded public certificate used by clients to\nauthenticate to the cluster endpoint.", + "type": "string" + }, + "username": { + "description": "The username to use for HTTP basic authentication to the master endpoint.\nFor clusters v1.6.0 and later, you can disable basic authentication by\nproviding an empty username.", + "type": "string" + } + }, + "id": "MasterAuth" + }, + "DailyMaintenanceWindow": { + "description": "Time window specified for daily maintenance operations.", + "type": "object", + "properties": { + "duration": { + "type": "string", + "description": "[Output only] Duration of the time window, automatically chosen to be\nsmallest possible in the given scenario." + }, + "startTime": { + "description": "Time within the maintenance window to start the maintenance operations.\nIt must be in format \"HH:MM”, where HH : [00-23] and MM : [00-59] GMT.", + "type": "string" + } + }, + "id": "DailyMaintenanceWindow" + }, + "AutoUpgradeOptions": { + "type": "object", + "properties": { + "description": { + "description": "[Output only] This field is set when upgrades are about to commence\nwith the description of the upgrade.", + "type": "string" + }, + "autoUpgradeStartTime": { + "description": "[Output only] This field is set when upgrades are about to commence\nwith the approximate start time for the upgrades, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", + "type": "string" + } + }, + "id": "AutoUpgradeOptions", + "description": "AutoUpgradeOptions defines the set of options for the user to control how\nthe Auto Upgrades will proceed." + }, + "ListClustersResponse": { + "description": "ListClustersResponse is the result of ListClustersRequest.", + "type": "object", + "properties": { + "clusters": { + "description": "A list of clusters in the project in the specified zone, or\nacross all ones.", + "items": { + "$ref": "Cluster" + }, + "type": "array" + }, + "missingZones": { + "description": "If any zones are listed here, the list of clusters returned\nmay be missing those zones.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ListClustersResponse" + }, + "HttpLoadBalancing": { + "description": "Configuration options for the HTTP (L7) load balancing controller addon,\nwhich makes it easy to set up HTTP load balancers for services in a cluster.", + "type": "object", + "properties": { + "disabled": { + "description": "Whether the HTTP Load Balancing controller is enabled in the cluster.\nWhen enabled, it runs a small pod in the cluster that manages the load\nbalancers.", + "type": "boolean" + } + }, + "id": "HttpLoadBalancing" + }, + "SetNetworkPolicyRequest": { + "description": "SetNetworkPolicyRequest enables/disables network policy for a cluster.", + "type": "object", + "properties": { + "networkPolicy": { + "$ref": "NetworkPolicy", + "description": "Configuration options for the NetworkPolicy feature." + }, + "name": { + "type": "string", + "description": "The name (project, location, cluster id) of the cluster to set networking policy.\nSpecified in the format 'projects/*/locations/*/clusters/*'." + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "id": "SetNetworkPolicyRequest" + }, + "SetMasterAuthRequest": { + "properties": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "action": { + "enum": [ + "UNKNOWN", + "SET_PASSWORD", + "GENERATE_PASSWORD" + ], + "description": "The exact form of action to be taken on the master auth", + "type": "string", + "enumDescriptions": [ + "Operation is unknown and will error out", + "Set the password to a user generated value.", + "Generate a new password and set it to that." + ] + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "update": { + "description": "A description of the update.", + "$ref": "MasterAuth" + } + }, + "id": "SetMasterAuthRequest", + "description": "SetMasterAuthRequest updates the admin password of a cluster.", + "type": "object" + }, + "ClientCertificateConfig": { + "description": "Configuration for client certificates on the cluster.", + "type": "object", + "properties": { + "issueClientCertificate": { + "description": "Issue a client certificate.", + "type": "boolean" + } + }, + "id": "ClientCertificateConfig" + }, + "NodePoolAutoscaling": { + "id": "NodePoolAutoscaling", + "description": "NodePoolAutoscaling contains information required by cluster autoscaler to\nadjust the size of the node pool to the current cluster usage.", + "type": "object", + "properties": { + "maxNodeCount": { + "format": "int32", + "description": "Maximum number of nodes in the NodePool. Must be \u003e= min_node_count. There\nhas to enough quota to scale up the cluster.", + "type": "integer" + }, + "minNodeCount": { + "format": "int32", + "description": "Minimum number of nodes in the NodePool. Must be \u003e= 1 and \u003c=\nmax_node_count.", + "type": "integer" + }, + "enabled": { + "description": "Is autoscaling enabled for this node pool.", + "type": "boolean" + } + } + }, + "MaintenancePolicy": { + "description": "MaintenancePolicy defines the maintenance policy to be used for the cluster.", + "type": "object", + "properties": { + "window": { + "description": "Specifies the maintenance window in which maintenance may be performed.", + "$ref": "MaintenanceWindow" + } + }, + "id": "MaintenancePolicy" + }, + "IPAllocationPolicy": { + "properties": { + "servicesIpv4Cidr": { + "description": "This field is deprecated, use services_ipv4_cidr_block.", + "type": "string" + }, + "servicesSecondaryRangeName": { + "description": "The name of the secondary range to be used as for the services\nCIDR block. The secondary range will be used for service\nClusterIPs. This must be an existing secondary range associated\nwith the cluster subnetwork.\n\nThis field is only applicable with use_ip_aliases and\ncreate_subnetwork is false.", + "type": "string" + }, + "useIpAliases": { + "description": "Whether alias IPs will be used for pod IPs in the cluster.", + "type": "boolean" + }, + "createSubnetwork": { + "type": "boolean", + "description": "Whether a new subnetwork will be created automatically for the cluster.\n\nThis field is only applicable when `use_ip_aliases` is true." + }, + "servicesIpv4CidrBlock": { + "type": "string", + "description": "The IP address range of the services IPs in this cluster. If blank, a range\nwill be automatically chosen with the default size.\n\nThis field is only applicable when `use_ip_aliases` is true.\n\nSet to blank to have a range chosen with the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use." + }, + "subnetworkName": { + "description": "A custom subnetwork name to be used if `create_subnetwork` is true. If\nthis field is empty, then an automatic name will be chosen for the new\nsubnetwork.", + "type": "string" + }, + "clusterIpv4Cidr": { + "description": "This field is deprecated, use cluster_ipv4_cidr_block.", + "type": "string" + }, + "nodeIpv4Cidr": { + "description": "This field is deprecated, use node_ipv4_cidr_block.", + "type": "string" + }, + "clusterIpv4CidrBlock": { + "type": "string", + "description": "The IP address range for the cluster pod IPs. If this field is set, then\n`cluster.cluster_ipv4_cidr` must be left blank.\n\nThis field is only applicable when `use_ip_aliases` is true.\n\nSet to blank to have a range chosen with the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use." + }, + "clusterSecondaryRangeName": { + "description": "The name of the secondary range to be used for the cluster CIDR\nblock. The secondary range will be used for pod IP\naddresses. This must be an existing secondary range associated\nwith the cluster subnetwork.\n\nThis field is only applicable with use_ip_aliases and\ncreate_subnetwork is false.", + "type": "string" + }, + "nodeIpv4CidrBlock": { + "description": "The IP address range of the instance IPs in this cluster.\n\nThis is applicable only if `create_subnetwork` is true.\n\nSet to blank to have a range chosen with the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.", + "type": "string" + } + }, + "id": "IPAllocationPolicy", + "description": "Configuration for controlling how IPs are allocated in the cluster.", + "type": "object" + }, + "ClusterUpdate": { + "description": "ClusterUpdate describes an update to the cluster. Exactly one update can\nbe applied to a cluster with each request, so at most one field can be\nprovided.", + "type": "object", + "properties": { + "desiredMasterAuthorizedNetworksConfig": { + "description": "The desired configuration options for master authorized networks feature.", + "$ref": "MasterAuthorizedNetworksConfig" + }, + "desiredNodePoolAutoscaling": { + "$ref": "NodePoolAutoscaling", + "description": "Autoscaler configuration for the node pool specified in\ndesired_node_pool_id. If there is only one pool in the\ncluster and desired_node_pool_id is not provided then\nthe change applies to that single node pool." + }, + "desiredLocations": { + "description": "The desired list of Google Compute Engine\n[locations](/compute/docs/zones#available) in which the cluster's nodes\nshould be located. Changing the locations a cluster is in will result\nin nodes being either created or removed from the cluster, depending on\nwhether locations are being added or removed.\n\nThis list must always include the cluster's primary zone.", + "items": { + "type": "string" + }, + "type": "array" + }, + "desiredMonitoringService": { + "description": "The monitoring service the cluster should use to write metrics.\nCurrently available options:\n\n* \"monitoring.googleapis.com\" - the Google Cloud Monitoring service\n* \"none\" - no metrics will be exported from the cluster", + "type": "string" + }, + "desiredImageType": { + "type": "string", + "description": "The desired image type for the node pool.\nNOTE: Set the \"desired_node_pool\" field as well." + }, + "desiredAddonsConfig": { + "description": "Configurations for the various addons available to run in the cluster.", + "$ref": "AddonsConfig" + }, + "desiredNodePoolId": { + "description": "The node pool to be upgraded. This field is mandatory if\n\"desired_node_version\", \"desired_image_family\" or\n\"desired_node_pool_autoscaling\" is specified and there is more than one\nnode pool on the cluster.", + "type": "string" + }, + "desiredNodeVersion": { + "description": "The Kubernetes version to change the nodes to (typically an\nupgrade). Use `-` to upgrade to the latest version supported by\nthe server.", + "type": "string" + }, + "desiredMasterVersion": { + "description": "The Kubernetes version to change the master to. The only valid value is the\nlatest supported version. Use \"-\" to have the server automatically select\nthe latest version.", + "type": "string" + } + }, + "id": "ClusterUpdate" + }, + "HorizontalPodAutoscaling": { + "description": "Configuration options for the horizontal pod autoscaling feature, which\nincreases or decreases the number of replica pods a replication controller\nhas based on the resource usage of the existing pods.", + "type": "object", + "properties": { + "disabled": { + "description": "Whether the Horizontal Pod Autoscaling feature is enabled in the cluster.\nWhen enabled, it ensures that a Heapster pod is running in the cluster,\nwhich is also used by the Cloud Monitoring service.", + "type": "boolean" + } + }, + "id": "HorizontalPodAutoscaling" + }, + "SetMaintenancePolicyRequest": { + "description": "SetMaintenancePolicyRequest sets the maintenance policy for a cluster.", + "type": "object", + "properties": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster to update.", + "type": "string" + }, + "name": { + "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "maintenancePolicy": { + "$ref": "MaintenancePolicy", + "description": "The maintenance policy to be set for the cluster. An empty field\nclears the existing maintenance policy." + } + }, + "id": "SetMaintenancePolicyRequest" + }, + "SetNodePoolManagementRequest": { + "description": "SetNodePoolManagementRequest sets the node management properties of a node\npool.", + "type": "object", + "properties": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "description": "The name (project, location, cluster, node pool id) of the node pool to set\nmanagement properties. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "management": { + "description": "NodeManagement configuration for the node pool.", + "$ref": "NodeManagement" + }, + "clusterId": { + "type": "string", + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead." + }, + "nodePoolId": { + "description": "The name of the node pool to update.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "id": "SetNodePoolManagementRequest" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "MasterAuthorizedNetworksConfig": { + "properties": { + "enabled": { + "description": "Whether or not master authorized networks is enabled.", + "type": "boolean" + }, + "cidrBlocks": { + "description": "cidr_blocks define up to 10 external networks that could access\nKubernetes master through HTTPS.", + "items": { + "$ref": "CidrBlock" + }, + "type": "array" + } + }, + "id": "MasterAuthorizedNetworksConfig", + "description": "Configuration options for the master authorized networks feature. Enabled\nmaster authorized networks will disallow all external traffic to access\nKubernetes master through HTTPS except traffic from the given CIDR blocks,\nGoogle Compute Engine Public IPs and Google Prod IPs.", + "type": "object" + }, + "CreateClusterRequest": { + "description": "CreateClusterRequest creates a cluster.", + "type": "object", + "properties": { + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use parent instead." + }, + "parent": { + "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.", + "type": "string" + }, + "cluster": { + "$ref": "Cluster", + "description": "A [cluster\nresource](/container-engine/reference/rest/v1beta1/projects.zones.clusters)" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use parent instead.", + "type": "string" + } + }, + "id": "CreateClusterRequest" + }, + "ListNodePoolsResponse": { + "description": "ListNodePoolsResponse is the result of ListNodePoolsRequest.", + "type": "object", + "properties": { + "nodePools": { + "description": "A list of node pools for a cluster.", + "items": { + "$ref": "NodePool" + }, + "type": "array" + } + }, + "id": "ListNodePoolsResponse" + }, + "CompleteIPRotationRequest": { + "description": "CompleteIPRotationRequest moves the cluster master back into single-IP mode.", + "type": "object", + "properties": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "description": "The name (project, location, cluster id) of the cluster to complete IP rotation.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + } + }, + "id": "CompleteIPRotationRequest" + }, + "StartIPRotationRequest": { + "description": "StartIPRotationRequest creates a new IP for the cluster and then performs\na node upgrade on each node pool to point to the new IP.", + "type": "object", + "properties": { + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "name": { + "description": "The name (project, location, cluster id) of the cluster to start IP rotation.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead." + } + }, + "id": "StartIPRotationRequest" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Container", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://container.googleapis.com/", + "ownerDomain": "google.com", + "name": "container", + "batchPath": "batch", + "title": "Google Container Engine API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "zones": { + "methods": { + "getServerconfig": { + "description": "Returns configuration info about the Container Engine service.", + "httpMethod": "GET", + "response": { + "$ref": "ServerConfig" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead." + }, + "zone": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for.\nThis field is deprecated, use name instead." + }, + "name": { + "location": "query", + "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig", + "path": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig", + "id": "container.projects.zones.getServerconfig" + } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "id": "container.projects.zones.operations.cancel", + "path": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel", + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Cancels the specified operation.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId", + "zone", + "operationId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "operationId": { + "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.\nThis field is deprecated, use name instead." + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel" + }, + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "operationId" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "query", + "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.", + "type": "string" + }, + "operationId": { + "location": "path", + "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "id": "container.projects.zones.operations.get", + "path": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "description": "Gets the specified operation." + }, + "list": { + "description": "Lists all operations in a project in a specific zone or all zones.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "GET", + "parameters": { + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for, or `-` for all zones.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true + }, + "parent": { + "type": "string", + "location": "query", + "description": "The parent (project and location) where the operations will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions." + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations", + "id": "container.projects.zones.operations.list", + "path": "v1beta1/projects/{projectId}/zones/{zone}/operations" + } + } + }, + "clusters": { + "methods": { + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters", + "id": "container.projects.zones.clusters.create", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters", + "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.", + "request": { + "$ref": "CreateClusterRequest" + } + }, + "resourceLabels": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead." + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", + "id": "container.projects.zones.clusters.resourceLabels", + "request": { + "$ref": "SetLabelsRequest" + }, + "description": "Sets labels on a cluster." + }, + "completeIpRotation": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", + "id": "container.projects.zones.clusters.completeIpRotation", + "description": "Completes master IP rotation.", + "request": { + "$ref": "CompleteIPRotationRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setNetworkPolicy": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy", + "id": "container.projects.zones.clusters.setNetworkPolicy", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy", + "request": { + "$ref": "SetNetworkPolicyRequest" + }, + "description": "Enables/Disables Network Policy for a cluster." + }, + "get": { + "id": "container.projects.zones.clusters.get", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "description": "Gets the details of a specific cluster.", + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "location": "query" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster to retrieve.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}" + }, + "legacyAbac": { + "description": "Enables or disables the ABAC authorization mechanism on a cluster.", + "request": { + "$ref": "SetLegacyAbacRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac", + "id": "container.projects.zones.clusters.legacyAbac", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac" + }, + "startIpRotation": { + "request": { + "$ref": "StartIPRotationRequest" + }, + "description": "Start master IP rotation.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "id": "container.projects.zones.clusters.startIpRotation" + }, + "setMaintenancePolicy": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "id": "container.projects.zones.clusters.setMaintenancePolicy", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "description": "Sets the maintenance policy for a cluster.", + "request": { + "$ref": "SetMaintenancePolicyRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "parameters": { + "clusterId": { + "location": "path", + "description": "The name of the cluster to update.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "httpMethod": "DELETE", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "location": "query" + }, + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "zone": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead." + }, + "clusterId": { + "description": "The name of the cluster to delete.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.delete", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time." + }, + "update": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.update", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "request": { + "$ref": "UpdateClusterRequest" + }, + "description": "Updates the settings of a specific cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "PUT" + }, + "setMasterAuth": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", + "id": "container.projects.zones.clusters.setMasterAuth", + "description": "Used to set master auth materials. Currently supports :-\nChanging the admin password of a specific cluster.\nThis can be either via password generation or explicitly set.\nModify basic_auth.csv and reset the K8S API server.", + "request": { + "$ref": "SetMasterAuthRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.", + "response": { + "$ref": "ListClustersResponse" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use parent instead." + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + }, + "parent": { + "location": "query", + "description": "The parent (project and location) where the clusters will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.", + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters", + "id": "container.projects.zones.clusters.list", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters" + } + }, + "resources": { + "nodePools": { + "methods": { + "get": { + "description": "Retrieves the node pool requested.", + "response": { + "$ref": "NodePool" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster, node pool id) of the node pool to get.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string", + "location": "query" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "nodePoolId": { + "description": "The name of the node pool.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "id": "container.projects.zones.clusters.nodePools.get", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}" + }, + "setManagement": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to update.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", + "id": "container.projects.zones.clusters.nodePools.setManagement", + "request": { + "$ref": "SetNodePoolManagementRequest" + }, + "description": "Sets the NodeManagement options for a node pool." + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "nodePoolId": { + "description": "The name of the node pool to delete.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "name": { + "description": "The name (project, location, cluster, node pool id) of the node pool to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "id": "container.projects.zones.clusters.nodePools.delete", + "description": "Deletes a node pool from a cluster." + }, + "list": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", + "id": "container.projects.zones.clusters.nodePools.list", + "description": "Lists the node pools for a cluster.", + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "ListNodePoolsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + }, + "parent": { + "location": "query", + "description": "The parent (project, location, cluster id) where the node pools will be listed.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + } + } + }, + "rollback": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "zone": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true + }, + "clusterId": { + "description": "The name of the cluster to rollback.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "nodePoolId": { + "description": "The name of the node pool to rollback.\nThis field is deprecated, use name instead.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", + "id": "container.projects.zones.clusters.nodePools.rollback", + "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.", + "request": { + "$ref": "RollbackNodePoolUpgradeRequest" + } + }, + "create": { + "request": { + "$ref": "CreateNodePoolRequest" + }, + "description": "Creates a node pool for a cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use parent instead.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools", + "id": "container.projects.zones.clusters.nodePools.create" + } + } + } + } + } + } + }, + "locations": { + "methods": { + "getServerConfig": { + "path": "v1beta1/{+name}/serverConfig", + "id": "container.projects.locations.getServerConfig", + "description": "Returns configuration info about the Container Engine service.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ServerConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + }, + "projectId": { + "location": "query", + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string" + }, + "zone": { + "location": "query", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/serverConfig" + } + }, + "resources": { + "clusters": { + "methods": { + "update": { + "id": "container.projects.locations.clusters.update", + "path": "v1beta1/{+name}", + "description": "Updates the settings of a specific cluster.", + "request": { + "$ref": "UpdateClusterRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}" + }, + "setMasterAuth": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth", + "id": "container.projects.locations.clusters.setMasterAuth", + "path": "v1beta1/{+name}:setMasterAuth", + "description": "Used to set master auth materials. Currently supports :-\nChanging the admin password of a specific cluster.\nThis can be either via password generation or explicitly set.\nModify basic_auth.csv and reset the K8S API server.", + "request": { + "$ref": "SetMasterAuthRequest" + } + }, + "list": { + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters", + "path": "v1beta1/{+parent}/clusters", + "id": "container.projects.locations.clusters.list", + "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.", + "httpMethod": "GET", + "response": { + "$ref": "ListClustersResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use parent instead.", + "type": "string", + "location": "query" + }, + "zone": { + "type": "string", + "location": "query", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.\nThis field is deprecated, use parent instead." + }, + "parent": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The parent (project and location) where the clusters will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters", + "path": "v1beta1/{+parent}/clusters", + "id": "container.projects.locations.clusters.create", + "request": { + "$ref": "CreateClusterRequest" + }, + "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + } + }, + "completeIpRotation": { + "request": { + "$ref": "CompleteIPRotationRequest" + }, + "description": "Completes master IP rotation.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster id) of the cluster to complete IP rotation.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation", + "id": "container.projects.locations.clusters.completeIpRotation", + "path": "v1beta1/{+name}:completeIpRotation" + }, + "get": { + "id": "container.projects.locations.clusters.get", + "path": "v1beta1/{+name}", + "description": "Gets the details of a specific cluster.", + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "zone": { + "type": "string", + "location": "query", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead." + }, + "clusterId": { + "description": "The name of the cluster to retrieve.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}" + }, + "setNetworkPolicy": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster id) of the cluster to set networking policy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy", + "id": "container.projects.locations.clusters.setNetworkPolicy", + "path": "v1beta1/{+name}:setNetworkPolicy", + "request": { + "$ref": "SetNetworkPolicyRequest" + }, + "description": "Enables/Disables Network Policy for a cluster." + }, + "startIpRotation": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name (project, location, cluster id) of the cluster to start IP rotation.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation", + "id": "container.projects.locations.clusters.startIpRotation", + "path": "v1beta1/{+name}:startIpRotation", + "description": "Start master IP rotation.", + "request": { + "$ref": "StartIPRotationRequest" + } + }, + "setMaintenancePolicy": { + "path": "v1beta1/{+name}:setMaintenancePolicy", + "id": "container.projects.locations.clusters.setMaintenancePolicy", + "description": "Sets the maintenance policy for a cluster.", + "request": { + "$ref": "SetMaintenancePolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "location": "path", + "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy" + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "clusterId": { + "location": "query", + "description": "The name of the cluster to delete.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}", + "id": "container.projects.locations.clusters.delete", + "path": "v1beta1/{+name}", + "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time." + }, + "setLegacyAbac": { + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac", + "id": "container.projects.locations.clusters.setLegacyAbac", + "path": "v1beta1/{+name}:setLegacyAbac", + "request": { + "$ref": "SetLegacyAbacRequest" + }, + "description": "Enables or disables the ABAC authorization mechanism on a cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + } + } + }, + "setResourceLabels": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels", + "id": "container.projects.locations.clusters.setResourceLabels", + "path": "v1beta1/{+name}:setResourceLabels", + "request": { + "$ref": "SetLabelsRequest" + }, + "description": "Sets labels on a cluster." + } + }, + "resources": { + "nodePools": { + "methods": { + "list": { + "description": "Lists the node pools for a cluster.", + "response": { + "$ref": "ListNodePoolsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "zone": { + "location": "query", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use parent instead.", + "type": "string" + }, + "clusterId": { + "type": "string", + "location": "query", + "description": "The name of the cluster.\nThis field is deprecated, use parent instead." + }, + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The parent (project, location, cluster id) where the node pools will be listed.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string", + "required": true + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use parent instead.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools", + "id": "container.projects.locations.clusters.nodePools.list", + "path": "v1beta1/{+parent}/nodePools" + }, + "rollback": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback", + "path": "v1beta1/{+name}:rollback", + "id": "container.projects.locations.clusters.nodePools.rollback", + "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.", + "request": { + "$ref": "RollbackNodePoolUpgradeRequest" + } + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The parent (project, location, cluster id) where the node pool will be created.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools", + "path": "v1beta1/{+parent}/nodePools", + "id": "container.projects.locations.clusters.nodePools.create", + "request": { + "$ref": "CreateNodePoolRequest" + }, + "description": "Creates a node pool for a cluster." + }, + "get": { + "description": "Retrieves the node pool requested.", + "response": { + "$ref": "NodePool" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "nodePoolId": { + "type": "string", + "location": "query", + "description": "The name of the node pool.\nThis field is deprecated, use name instead." + }, + "name": { + "location": "path", + "description": "The name (project, location, cluster, node pool id) of the node pool to get.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$" + }, + "projectId": { + "type": "string", + "location": "query", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead." + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}", + "id": "container.projects.locations.clusters.nodePools.get", + "path": "v1beta1/{+name}" + }, + "setManagement": { + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement", + "id": "container.projects.locations.clusters.nodePools.setManagement", + "path": "v1beta1/{+name}:setManagement", + "description": "Sets the NodeManagement options for a node pool.", + "request": { + "$ref": "SetNodePoolManagementRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster, node pool id) of the node pool to set\nmanagement properties. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}", + "path": "v1beta1/{+name}", + "id": "container.projects.locations.clusters.nodePools.delete", + "description": "Deletes a node pool from a cluster.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "zone": { + "location": "query", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "clusterId": { + "location": "query", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "nodePoolId": { + "type": "string", + "location": "query", + "description": "The name of the node pool to delete.\nThis field is deprecated, use name instead." + }, + "name": { + "description": "The name (project, location, cluster, node pool id) of the node pool to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "location": "path" + } + } + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "location": "path" + }, + "operationId": { + "location": "query", + "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "zone": { + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + "id": "container.projects.locations.operations.get", + "path": "v1beta1/{+name}", + "description": "Gets the specified operation." + }, + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field is deprecated, use parent instead.", + "type": "string", + "location": "query" + }, + "zone": { + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for, or `-` for all zones.\nThis field is deprecated, use parent instead.", + "type": "string", + "location": "query" + }, + "parent": { + "description": "The parent (project and location) where the operations will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations", + "id": "container.projects.locations.operations.list", + "path": "v1beta1/{+parent}/operations", + "description": "Lists all operations in a project in a specific zone or all zones." + }, + "cancel": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", + "path": "v1beta1/{+name}:cancel", + "id": "container.projects.locations.operations.cancel", + "description": "Cancels the specified operation.", + "request": { + "$ref": "CancelOperationRequest" + } + } + } + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + }, + "version": "v1beta1", + "baseUrl": "https://container.googleapis.com/", + "servicePath": "", + "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", + "kind": "discovery#restDescription", + "basePath": "" +} diff --git a/etc/api/content/v2/content-api.json b/etc/api/content/v2/content-api.json index 43ca1e2b0b..9234d15b5d 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/BclkybusasZymwfyrM_IDMj_UwU\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/e0JuGPKREEjV0KDWNAvNTkBRhXc\"", "discoveryVersion": "v1", "id": "content:v2", "name": "content", "canonicalName": "Shopping Content", "version": "v2", - "revision": "20170519", + "revision": "20170926", "title": "Content API for Shopping", "description": "Manages product items, inventory, and Merchant Center accounts for Google Shopping.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/content/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "content/v2/", - "batchPath": "batch", + "batchPath": "batch/content/v2", "parameters": { "alt": { "type": "string", @@ -136,6 +136,13 @@ "websiteUrl": { "type": "string", "description": "The merchant's website." + }, + "youtubeChannelLinks": { + "type": "array", + "description": "List of linked YouTube channels that are active or pending approval. To create a new link request, add a new link with status active to the list. It will remain in a pending state until approved or rejected in the YT Creator Studio interface. To delete an active link, or to cancel a link request, remove it from the list.", + "items": { + "$ref": "AccountYouTubeChannelLink" + } } } }, @@ -179,6 +186,13 @@ "type": "string", "description": "The ID of the account for which the status is reported." }, + "accountLevelIssues": { + "type": "array", + "description": "A list of account level issues.", + "items": { + "$ref": "AccountStatusAccountLevelIssue" + } + }, "dataQualityIssues": { "type": "array", "description": "A list of data quality issues.", @@ -197,6 +211,32 @@ } } }, + "AccountStatusAccountLevelIssue": { + "id": "AccountStatusAccountLevelIssue", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "Country for which this issue is reported." + }, + "detail": { + "type": "string", + "description": "Additional details about the issue." + }, + "id": { + "type": "string", + "description": "Issue identifier." + }, + "severity": { + "type": "string", + "description": "Severity of the issue." + }, + "title": { + "type": "string", + "description": "Short description of the issue." + } + } + }, "AccountStatusDataQualityIssue": { "id": "AccountStatusDataQualityIssue", "type": "object", @@ -350,6 +390,32 @@ } } }, + "AccountYouTubeChannelLink": { + "id": "AccountYouTubeChannelLink", + "type": "object", + "properties": { + "channelId": { + "type": "string", + "description": "Channel ID.", + "annotations": { + "required": [ + "content.accounts.insert", + "content.accounts.update" + ] + } + }, + "status": { + "type": "string", + "description": "Status of the link between this Merchant Center account and the YouTube channel. Upon retrieval, it represents the actual status of the link and can be either active if it was approved in YT Creator Studio or pending if it's pending approval. Upon insertion, it represents the intended status of the link. Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status will remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if it was active or cancel the link request if it was pending.", + "annotations": { + "required": [ + "content.accounts.insert", + "content.accounts.update" + ] + } + } + } + }, "AccountsAuthInfoResponse": { "id": "AccountsAuthInfoResponse", "type": "object", @@ -411,6 +477,10 @@ "description": "An entry ID, unique within the batch request.", "format": "uint32" }, + "force": { + "type": "boolean", + "description": "Whether the account should be deleted if the account has offers. Only applicable if the method is delete." + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -747,7 +817,7 @@ "Datafeed": { "id": "Datafeed", "type": "object", - "description": "Datafeed data.", + "description": "Datafeed configuration data.", "properties": { "attributeLanguage": { "type": "string", @@ -755,12 +825,7 @@ }, "contentLanguage": { "type": "string", - "description": "The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targetCountry.", - "annotations": { - "required": [ - "content.datafeeds.insert" - ] - } + "description": "[DEPRECATED] Please use target.language instead. The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targetCountry." }, "contentType": { "type": "string", @@ -802,7 +867,7 @@ }, "intendedDestinations": { "type": "array", - "description": "The list of intended destinations (corresponds to checked check boxes in Merchant Center).", + "description": "[DEPRECATED] Please use target.includedDestination instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center).", "items": { "type": "string" } @@ -823,12 +888,13 @@ }, "targetCountry": { "type": "string", - "description": "The country where the items in the feed will be included in the search index, represented as a CLDR territory code.", - "annotations": { - "required": [ - "content.datafeeds.insert", - "content.datafeeds.update" - ] + "description": "[DEPRECATED] Please use target.country instead. The country where the items in the feed will be included in the search index, represented as a CLDR territory code." + }, + "targets": { + "type": "array", + "description": "The targets this feed should apply to (country, language, destinations).", + "items": { + "$ref": "DatafeedTarget" } } } @@ -861,6 +927,10 @@ "type": "string", "description": "An optional password for fetch_url." }, + "paused": { + "type": "boolean", + "description": "Whether the scheduled fetch is paused or not." + }, "timeZone": { "type": "string", "description": "Time zone used for schedule. UTC by default. E.g., \"America/Los_Angeles\"." @@ -898,6 +968,10 @@ "type": "object", "description": "The status of a datafeed, i.e., the result of the last retrieval of the datafeed computed asynchronously when the feed processing is finished.", "properties": { + "country": { + "type": "string", + "description": "The country for which the status is reported, represented as a CLDR territory code." + }, "datafeedId": { "type": "string", "description": "The ID of the feed for which the status is reported.", @@ -925,6 +999,10 @@ "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeedStatus\".", "default": "content#datafeedStatus" }, + "language": { + "type": "string", + "description": "The two-letter ISO 639-1 language for which the status is reported." + }, "lastUploadDate": { "type": "string", "description": "The last date at which the feed was uploaded." @@ -989,6 +1067,34 @@ } } }, + "DatafeedTarget": { + "id": "DatafeedTarget", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "The country where the items in the feed will be included in the search index, represented as a CLDR territory code." + }, + "excludedDestinations": { + "type": "array", + "description": "The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center).", + "items": { + "type": "string" + } + }, + "includedDestinations": { + "type": "array", + "description": "The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included unless provided in the excluded_destination field.", + "items": { + "type": "string" + } + }, + "language": { + "type": "string", + "description": "The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targets[].country." + } + } + }, "DatafeedsCustomBatchRequest": { "id": "DatafeedsCustomBatchRequest", "type": "object", @@ -1113,11 +1219,19 @@ "description": "An entry ID, unique within the batch request.", "format": "uint32" }, + "country": { + "type": "string", + "description": "The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that for multi-target datafeeds this parameter is required." + }, "datafeedId": { "type": "string", - "description": "The ID of the data feed to get or delete.", + "description": "The ID of the data feed to get.", "format": "uint64" }, + "language": { + "type": "string", + "description": "The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that for multi-target datafeeds this parameter is required." + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -1596,7 +1710,7 @@ }, "promotions": { "type": "array", - "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", + "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", "items": { "$ref": "OrderPromotion" } @@ -1966,7 +2080,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier for the shipping. Optional." + "description": "The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values." }, "maxDaysInTransit": { "type": "integer", @@ -2027,7 +2141,7 @@ }, "type": { "type": "string", - "description": "The type of instrument (VISA, Mastercard, etc)." + "description": "The type of instrument.\n\nAcceptable values are: \n- \"AMEX\" \n- \"DISCOVER\" \n- \"JCB\" \n- \"MASTERCARD\" \n- \"UNIONPAY\" \n- \"VISA\" \n- \"\"" } } }, @@ -2155,7 +2269,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment." + "description": "The carrier handling the shipment.\n\nAcceptable values are: \n- \"gsx\" \n- \"ups\" \n- \"united parcel service\" \n- \"usps\" \n- \"united states postal service\" \n- \"fedex\" \n- \"dhl\" \n- \"ecourier\" \n- \"cxt\" \n- \"google\" \n- \"on trac\" \n- \"ontrac\" \n- \"on-trac\" \n- \"on_trac\" \n- \"delvic\" \n- \"dynamex\" \n- \"lasership\" \n- \"smartpost\" \n- \"fedex smartpost\" \n- \"mpx\" \n- \"uds\" \n- \"united delivery service\"" }, "creationDate": { "type": "string", @@ -2502,7 +2616,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "lineItems": { "type": "array", @@ -2513,7 +2627,37 @@ }, "shipmentId": { "type": "string", - "description": "The ID of the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The ID of the shipment." + }, + "shipmentInfos": { + "type": "array", + "description": "Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs).", + "items": { + "$ref": "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo" + } + }, + "trackingId": { + "type": "string", + "description": "Deprecated. Please use shipmentInfo instead. The tracking id for the shipment." + } + } + }, + "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo": { + "id": "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment.", + "annotations": { + "required": [ + "content.orders.shiplineitems" + ] + } }, "trackingId": { "type": "string", @@ -2527,7 +2671,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment. Not updated if missing." + "description": "The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "shipmentId": { "type": "string", @@ -2725,7 +2869,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "lineItems": { "type": "array", @@ -2740,11 +2884,18 @@ }, "shipmentId": { "type": "string", - "description": "The ID of the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The ID of the shipment." + }, + "shipmentInfos": { + "type": "array", + "description": "Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs).", + "items": { + "$ref": "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo" + } }, "trackingId": { "type": "string", - "description": "The tracking id for the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The tracking id for the shipment." } } }, @@ -2798,7 +2949,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment. Not updated if missing." + "description": "The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "operationId": { "type": "string", @@ -3099,6 +3250,16 @@ "type": "string", "description": "The material of which the item is made." }, + "maxHandlingTime": { + "type": "string", + "description": "Maximal product handling time (in business days).", + "format": "int64" + }, + "minHandlingTime": { + "type": "string", + "description": "Minimal product handling time (in business days).", + "format": "int64" + }, "mobileLink": { "type": "string", "description": "Link to a mobile-optimized version of the landing page." @@ -3341,7 +3502,7 @@ }, "region": { "type": "string", - "description": "The geographic region to which a shipping rate applies (e.g. zip code)." + "description": "The geographic region to which a shipping rate applies." }, "service": { "type": "string", @@ -3419,6 +3580,10 @@ "type": "string", "description": "The link to the product." }, + "product": { + "$ref": "Product", + "description": "Product data after applying all the join inputs." + }, "productId": { "type": "string", "description": "The id of the product for which status is reported." @@ -3675,6 +3840,9 @@ "description": "An entry ID, unique within the batch request.", "format": "uint32" }, + "includeAttributes": { + "type": "boolean" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -3821,6 +3989,10 @@ "$ref": "DeliveryTime", "description": "Time spent in various aspects from order to the delivery of the product. Required." }, + "minimumOrderValue": { + "$ref": "Price", + "description": "Minimum order value for this service. If set, indicates that customers will have to spend at least this amount. All prices within a service must have the same currency." + }, "name": { "type": "string", "description": "Free-form name of the service. Must be unique within target account. Required." @@ -4054,7 +4226,7 @@ }, "promotions": { "type": "array", - "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", + "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", "items": { "$ref": "OrderPromotion" } @@ -4353,7 +4525,7 @@ "id": "content.accounts.claimwebsite", "path": "{merchantId}/accounts/{accountId}/claimwebsite", "httpMethod": "POST", - "description": "Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts.", + "description": "Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -4371,7 +4543,7 @@ }, "overwrite": { "type": "boolean", - "description": "Flag to remove any existing claim on the requested website by another account and replace it with a claim from this account.", + "description": "Only available to selected merchants. When set to True, this flag removes any existing claim on the requested website by another account and replaces it with a claim from this account.", "location": "query" } }, @@ -4426,6 +4598,12 @@ "description": "Flag to run the request in dry-run mode.", "location": "query" }, + "force": { + "type": "boolean", + "description": "Flag to delete sub-accounts with products. The default value of false will become active on September 28, 2017.", + "default": "true", + "location": "query" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -4446,7 +4624,7 @@ "id": "content.accounts.get", "path": "{merchantId}/accounts/{accountId}", "httpMethod": "GET", - "description": "Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -4545,7 +4723,7 @@ "id": "content.accounts.patch", "path": "{merchantId}/accounts/{accountId}", "httpMethod": "PATCH", - "description": "Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics.", + "description": "Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics.", "parameters": { "accountId": { "type": "string", @@ -4585,7 +4763,7 @@ "id": "content.accounts.update", "path": "{merchantId}/accounts/{accountId}", "httpMethod": "PUT", - "description": "Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -4643,7 +4821,7 @@ "id": "content.accountstatuses.get", "path": "{merchantId}/accountstatuses/{accountId}", "httpMethod": "GET", - "description": "Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -4736,7 +4914,7 @@ "id": "content.accounttax.get", "path": "{merchantId}/accounttax/{accountId}", "httpMethod": "GET", - "description": "Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -4803,7 +4981,7 @@ "id": "content.accounttax.patch", "path": "{merchantId}/accounttax/{accountId}", "httpMethod": "PATCH", - "description": "Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics.", + "description": "Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics.", "parameters": { "accountId": { "type": "string", @@ -4843,7 +5021,7 @@ "id": "content.accounttax.update", "path": "{merchantId}/accounttax/{accountId}", "httpMethod": "PUT", - "description": "Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -4908,7 +5086,7 @@ "id": "content.datafeeds.delete", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "DELETE", - "description": "Deletes a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts.", "parameters": { "datafeedId": { "type": "string", @@ -4940,7 +5118,7 @@ "id": "content.datafeeds.get", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "GET", - "description": "Retrieves a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts.", "parameters": { "datafeedId": { "type": "string", @@ -4970,7 +5148,7 @@ "id": "content.datafeeds.insert", "path": "{merchantId}/datafeeds", "httpMethod": "POST", - "description": "Registers a datafeed with your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts.", "parameters": { "dryRun": { "type": "boolean", @@ -5036,7 +5214,7 @@ "id": "content.datafeeds.patch", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "PATCH", - "description": "Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics.", + "description": "Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics.", "parameters": { "datafeedId": { "type": "string", @@ -5074,7 +5252,7 @@ "id": "content.datafeeds.update", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "PUT", - "description": "Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts.", "parameters": { "datafeedId": { "type": "string", @@ -5132,12 +5310,22 @@ "httpMethod": "GET", "description": "Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts.", "parameters": { + "country": { + "type": "string", + "description": "The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.", + "location": "query" + }, "datafeedId": { "type": "string", "required": true, "format": "uint64", "location": "path" }, + "language": { + "type": "string", + "description": "The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.", + "location": "query" + }, "merchantId": { "type": "string", "required": true, @@ -6111,7 +6299,7 @@ "id": "content.shippingsettings.get", "path": "{merchantId}/shippingsettings/{accountId}", "httpMethod": "GET", - "description": "Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", @@ -6202,7 +6390,7 @@ "id": "content.shippingsettings.patch", "path": "{merchantId}/shippingsettings/{accountId}", "httpMethod": "PATCH", - "description": "Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics.", + "description": "Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics.", "parameters": { "accountId": { "type": "string", @@ -6242,7 +6430,7 @@ "id": "content.shippingsettings.update", "path": "{merchantId}/shippingsettings/{accountId}", "httpMethod": "PUT", - "description": "Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account.", + "description": "Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", "parameters": { "accountId": { "type": "string", diff --git a/etc/api/content/v2/crates/1.0.6-api+20170926 b/etc/api/content/v2/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/content/v2sandbox/content-api.json b/etc/api/content/v2sandbox/content-api.json index bb5d14c077..f50e976fa1 100644 --- a/etc/api/content/v2sandbox/content-api.json +++ b/etc/api/content/v2sandbox/content-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/nn4zZjTupvVB_YDH6azVBTMwJuk\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/5vl5aa2CUylrEFA9Igu87wDe8Ug\"", "discoveryVersion": "v1", "id": "content:v2sandbox", "name": "content", "canonicalName": "Shopping Content", "version": "v2sandbox", - "revision": "20170519", + "revision": "20170926", "title": "Content API for Shopping", "description": "Manages product items, inventory, and Merchant Center accounts for Google Shopping.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/content/v2sandbox/", "rootUrl": "https://www.googleapis.com/", "servicePath": "content/v2sandbox/", - "batchPath": "batch", + "batchPath": "batch/content/v2sandbox", "parameters": { "alt": { "type": "string", @@ -181,7 +181,7 @@ }, "promotions": { "type": "array", - "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", + "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", "items": { "$ref": "OrderPromotion" } @@ -551,7 +551,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier for the shipping. Optional." + "description": "The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values." }, "maxDaysInTransit": { "type": "integer", @@ -612,7 +612,7 @@ }, "type": { "type": "string", - "description": "The type of instrument (VISA, Mastercard, etc)." + "description": "The type of instrument.\n\nAcceptable values are: \n- \"AMEX\" \n- \"DISCOVER\" \n- \"JCB\" \n- \"MASTERCARD\" \n- \"UNIONPAY\" \n- \"VISA\" \n- \"\"" } } }, @@ -740,7 +740,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment." + "description": "The carrier handling the shipment.\n\nAcceptable values are: \n- \"gsx\" \n- \"ups\" \n- \"united parcel service\" \n- \"usps\" \n- \"united states postal service\" \n- \"fedex\" \n- \"dhl\" \n- \"ecourier\" \n- \"cxt\" \n- \"google\" \n- \"on trac\" \n- \"ontrac\" \n- \"on-trac\" \n- \"on_trac\" \n- \"delvic\" \n- \"dynamex\" \n- \"lasership\" \n- \"smartpost\" \n- \"fedex smartpost\" \n- \"mpx\" \n- \"uds\" \n- \"united delivery service\"" }, "creationDate": { "type": "string", @@ -1087,7 +1087,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "lineItems": { "type": "array", @@ -1098,7 +1098,37 @@ }, "shipmentId": { "type": "string", - "description": "The ID of the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The ID of the shipment." + }, + "shipmentInfos": { + "type": "array", + "description": "Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs).", + "items": { + "$ref": "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo" + } + }, + "trackingId": { + "type": "string", + "description": "Deprecated. Please use shipmentInfo instead. The tracking id for the shipment." + } + } + }, + "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo": { + "id": "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment.", + "annotations": { + "required": [ + "content.orders.shiplineitems" + ] + } }, "trackingId": { "type": "string", @@ -1112,7 +1142,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment. Not updated if missing." + "description": "The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "shipmentId": { "type": "string", @@ -1310,7 +1340,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "lineItems": { "type": "array", @@ -1325,11 +1355,18 @@ }, "shipmentId": { "type": "string", - "description": "The ID of the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The ID of the shipment." + }, + "shipmentInfos": { + "type": "array", + "description": "Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs).", + "items": { + "$ref": "OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo" + } }, "trackingId": { "type": "string", - "description": "The tracking id for the shipment." + "description": "Deprecated. Please use shipmentInfo instead. The tracking id for the shipment." } } }, @@ -1383,7 +1420,7 @@ "properties": { "carrier": { "type": "string", - "description": "The carrier handling the shipment. Not updated if missing." + "description": "The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values." }, "operationId": { "type": "string", @@ -1477,7 +1514,7 @@ }, "promotions": { "type": "array", - "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", + "description": "The details of the merchant provided promotions applied to the order. More details about the program are here.", "items": { "$ref": "OrderPromotion" } diff --git a/etc/api/content/v2sandbox/crates/1.0.6-api+20170926 b/etc/api/content/v2sandbox/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/content/v2sandbox/crates/1.0.6-cli+20170926 b/etc/api/content/v2sandbox/crates/1.0.6-cli+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/customsearch/v1/crates/1.0.6-api+20170615 b/etc/api/customsearch/v1/crates/1.0.6-api+20170615 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/customsearch/v1/crates/1.0.6-cli+20170615 b/etc/api/customsearch/v1/crates/1.0.6-cli+20170615 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/customsearch/v1/customsearch-api.json b/etc/api/customsearch/v1/customsearch-api.json index a24c4351aa..ba2e94c0df 100644 --- a/etc/api/customsearch/v1/customsearch-api.json +++ b/etc/api/customsearch/v1/customsearch-api.json @@ -1,13 +1,13 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/2gL3A40IBu11GP9xmmdXxrLKXPg\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/vjsLOntBAplI6gHuETouIyrKBJI\"", "discoveryVersion": "v1", "id": "customsearch:v1", "name": "customsearch", "version": "v1", - "revision": "20160411", + "revision": "20170615", "title": "CustomSearch API", - "description": "Lets you search over a website or collection of websites", + "description": "Searches over a website or collection of websites", "ownerDomain": "google.com", "ownerName": "Google", "icons": { @@ -163,9 +163,6 @@ "cr": { "type": "string" }, - "cref": { - "type": "string" - }, "cx": { "type": "string" }, @@ -443,7 +440,7 @@ "properties": { "template": { "type": "string", - "default": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json" + "default": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json" }, "type": { "type": "string", @@ -473,11 +470,6 @@ "description": "Country restrict(s).", "location": "query" }, - "cref": { - "type": "string", - "description": "The URL of a linked custom search engine", - "location": "query" - }, "cx": { "type": "string", "description": "The custom search engine ID to scope this search query", diff --git a/etc/api/dataflow/v1b3/dataflow-api.json b/etc/api/dataflow/v1b3/dataflow-api.json index 3cc958e423..9cdc33400c 100644 --- a/etc/api/dataflow/v1b3/dataflow-api.json +++ b/etc/api/dataflow/v1b3/dataflow-api.json @@ -1,10 +1,15 @@ { + "kind": "discovery#restDescription", + "description": "Manages Google Cloud Dataflow projects on Google Cloud Platform.", + "servicePath": "", + "rootUrl": "https://dataflow.googleapis.com/", + "basePath": "", "ownerDomain": "google.com", "name": "dataflow", "batchPath": "batch", - "id": "dataflow:v1b3", "documentationLink": "https://cloud.google.com/dataflow", - "revision": "20170520", + "id": "dataflow:v1b3", + "revision": "20170918", "title": "Google Dataflow API", "ownerName": "Google", "discoveryVersion": "v1", @@ -12,6 +17,13 @@ "projects": { "methods": { "workerMessages": { + "flatPath": "v1b3/projects/{projectId}/WorkerMessages", + "path": "v1b3/projects/{projectId}/WorkerMessages", + "id": "dataflow.projects.workerMessages", + "description": "Send a worker_message to the service.", + "request": { + "$ref": "SendWorkerMessagesRequest" + }, "httpMethod": "POST", "parameterOrder": [ "projectId" @@ -19,182 +31,56 @@ "response": { "$ref": "SendWorkerMessagesResponse" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], "parameters": { "projectId": { "location": "path", "description": "The project to send the WorkerMessages to.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, - "flatPath": "v1b3/projects/{projectId}/WorkerMessages", - "id": "dataflow.projects.workerMessages", - "path": "v1b3/projects/{projectId}/WorkerMessages", - "description": "Send a worker_message to the service.", - "request": { - "$ref": "SendWorkerMessagesRequest" - } + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ] } }, "resources": { - "templates": { - "methods": { - "launch": { - "flatPath": "v1b3/projects/{projectId}/templates:launch", - "id": "dataflow.projects.templates.launch", - "path": "v1b3/projects/{projectId}/templates:launch", - "request": { - "$ref": "LaunchTemplateParameters" - }, - "description": "Launch a template.", - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "LaunchTemplateResponse" - }, - "parameters": { - "validateOnly": { - "description": "If true, the request is validated but not actually executed.\nDefaults to false.", - "type": "boolean", - "location": "query" - }, - "projectId": { - "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string", - "location": "path" - }, - "gcsPath": { - "description": "Required. A Cloud Storage path to the template from which to create\nthe job.\nMust be valid Cloud Storage URL, beginning with 'gs://'.", - "type": "string", - "location": "query" - }, - "location": { - "location": "query", - "description": "The location to which to direct the request.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ] - }, - "get": { - "response": { - "$ref": "GetTemplateResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "GET", - "parameters": { - "projectId": { - "location": "path", - "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, - "view": { - "location": "query", - "enum": [ - "METADATA_ONLY" - ], - "description": "The view to retrieve. Defaults to METADATA_ONLY.", - "type": "string" - }, - "gcsPath": { - "location": "query", - "description": "Required. A Cloud Storage path to the template from which to\ncreate the job.\nMust be a valid Cloud Storage URL, beginning with `gs://`.", - "type": "string" - }, - "location": { - "description": "The location to which to direct the request.", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "flatPath": "v1b3/projects/{projectId}/templates:get", - "path": "v1b3/projects/{projectId}/templates:get", - "id": "dataflow.projects.templates.get", - "description": "Get the template associated with a template." - }, - "create": { - "response": { - "$ref": "Job" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1b3/projects/{projectId}/templates", - "path": "v1b3/projects/{projectId}/templates", - "id": "dataflow.projects.templates.create", - "description": "Creates a Cloud Dataflow job from a template.", - "request": { - "$ref": "CreateJobFromTemplateRequest" - } - } - } - }, "locations": { "methods": { "workerMessages": { + "description": "Send a worker_message to the service.", "request": { "$ref": "SendWorkerMessagesRequest" }, - "description": "Send a worker_message to the service.", - "response": { - "$ref": "SendWorkerMessagesResponse" - }, + "httpMethod": "POST", "parameterOrder": [ "projectId", "location" ], - "httpMethod": "POST", + "response": { + "$ref": "SendWorkerMessagesResponse" + }, "parameters": { - "projectId": { - "location": "path", - "description": "The project to send the WorkerMessages to.", - "required": true, - "type": "string" - }, "location": { - "location": "path", "description": "The location which contains the job", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "projectId": { + "description": "The project to send the WorkerMessages to.", + "type": "string", + "required": true, + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], "flatPath": "v1b3/projects/{projectId}/locations/{location}/WorkerMessages", @@ -205,72 +91,22 @@ "resources": { "templates": { "methods": { - "launch": { - "response": { - "$ref": "LaunchTemplateResponse" - }, - "parameterOrder": [ - "projectId", - "location" - ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "location": "path", - "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, - "gcsPath": { - "location": "query", - "description": "Required. A Cloud Storage path to the template from which to create\nthe job.\nMust be valid Cloud Storage URL, beginning with 'gs://'.", - "type": "string" - }, - "location": { - "location": "path", - "description": "The location to which to direct the request.", - "required": true, - "type": "string" - }, - "validateOnly": { - "location": "query", - "description": "If true, the request is validated but not actually executed.\nDefaults to false.", - "type": "boolean" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "flatPath": "v1b3/projects/{projectId}/locations/{location}/templates:launch", - "path": "v1b3/projects/{projectId}/locations/{location}/templates:launch", - "id": "dataflow.projects.locations.templates.launch", - "request": { - "$ref": "LaunchTemplateParameters" - }, - "description": "Launch a template." - }, "get": { - "httpMethod": "GET", - "parameterOrder": [ - "projectId", - "location" - ], + "description": "Get the template associated with a template.", "response": { "$ref": "GetTemplateResponse" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" + "parameterOrder": [ + "projectId", + "location" ], + "httpMethod": "GET", "parameters": { - "projectId": { - "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "required": true, + "location": { + "location": "path", + "description": "The location to which to direct the request.", "type": "string", - "location": "path" + "required": true }, "view": { "location": "query", @@ -280,22 +116,27 @@ "description": "The view to retrieve. Defaults to METADATA_ONLY.", "type": "string" }, + "projectId": { + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + }, "gcsPath": { "location": "query", "description": "Required. A Cloud Storage path to the template from which to\ncreate the job.\nMust be a valid Cloud Storage URL, beginning with `gs://`.", "type": "string" - }, - "location": { - "location": "path", - "description": "The location to which to direct the request.", - "required": true, - "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], "flatPath": "v1b3/projects/{projectId}/locations/{location}/templates:get", "id": "dataflow.projects.locations.templates.get", - "path": "v1b3/projects/{projectId}/locations/{location}/templates:get", - "description": "Get the template associated with a template." + "path": "v1b3/projects/{projectId}/locations/{location}/templates:get" }, "create": { "description": "Creates a Cloud Dataflow job from a template.", @@ -310,73 +151,196 @@ "location" ], "httpMethod": "POST", + "parameters": { + "location": { + "description": "The location to which to direct the request.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "flatPath": "v1b3/projects/{projectId}/locations/{location}/templates", + "id": "dataflow.projects.locations.templates.create", + "path": "v1b3/projects/{projectId}/locations/{location}/templates" + }, + "launch": { + "request": { + "$ref": "LaunchTemplateParameters" + }, + "description": "Launch a template.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "location" + ], + "response": { + "$ref": "LaunchTemplateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], "parameters": { - "projectId": { - "location": "path", - "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, "location": { - "location": "path", "description": "The location to which to direct the request.", + "type": "string", "required": true, + "location": "path" + }, + "validateOnly": { + "location": "query", + "description": "If true, the request is validated but not actually executed.\nDefaults to false.", + "type": "boolean" + }, + "projectId": { + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + }, + "gcsPath": { + "location": "query", + "description": "Required. A Cloud Storage path to the template from which to create\nthe job.\nMust be valid Cloud Storage URL, beginning with 'gs://'.", "type": "string" } }, - "flatPath": "v1b3/projects/{projectId}/locations/{location}/templates", - "path": "v1b3/projects/{projectId}/locations/{location}/templates", - "id": "dataflow.projects.locations.templates.create" + "flatPath": "v1b3/projects/{projectId}/locations/{location}/templates:launch", + "path": "v1b3/projects/{projectId}/locations/{location}/templates:launch", + "id": "dataflow.projects.locations.templates.launch" } } }, "jobs": { "methods": { - "get": { + "getMetrics": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], + "response": { + "$ref": "JobMetrics" + }, "parameters": { "location": { - "description": "The location that contains this job.", - "required": true, + "location": "path", + "description": "The location which contains the job specified by job_id.", "type": "string", + "required": true + }, + "startTime": { + "format": "google-datetime", + "description": "Return only metric data that has changed since this time.\nDefault is to return all information about all metrics for the job.", + "type": "string", + "location": "query" + }, + "jobId": { + "description": "The job to get messages for.", + "type": "string", + "required": true, "location": "path" }, "projectId": { - "location": "path", - "description": "The ID of the Cloud Platform project that the job belongs to.", + "description": "A project id.", + "type": "string", "required": true, - "type": "string" - }, - "jobId": { - "location": "path", - "description": "The job ID.", - "required": true, - "type": "string" + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics", + "id": "dataflow.projects.locations.jobs.getMetrics", + "description": "Request the job status." + }, + "list": { + "description": "List the jobs of a project in a given region.", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [ + "projectId", + "location" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "If there are many jobs, limit response to at most this many.\nThe actual number of jobs returned will be the lesser of max_responses\nand an unspecified server-defined limit.", + "type": "integer" }, "view": { + "description": "Level of information requested in response. Default is `JOB_VIEW_SUMMARY`.", + "type": "string", "location": "query", "enum": [ "JOB_VIEW_UNKNOWN", "JOB_VIEW_SUMMARY", "JOB_VIEW_ALL", "JOB_VIEW_DESCRIPTION" - ], - "description": "The level of information requested in response.", - "type": "string" + ] + }, + "projectId": { + "location": "path", + "description": "The project which owns the jobs.", + "type": "string", + "required": true + }, + "filter": { + "description": "The kind of filter to use.", + "type": "string", + "location": "query", + "enum": [ + "UNKNOWN", + "ALL", + "TERMINATED", + "ACTIVE" + ] + }, + "location": { + "location": "path", + "description": "The location that contains this job.", + "type": "string", + "required": true + }, + "pageToken": { + "description": "Set this to the 'next_page_token' field of a previous response\nto request additional results in a long list.", + "type": "string", + "location": "query" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", - "id": "dataflow.projects.locations.jobs.get", + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs", + "id": "dataflow.projects.locations.jobs.list", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs" + }, + "get": { "description": "Gets the state of the specified Cloud Dataflow job.", "response": { "$ref": "Job" @@ -386,77 +350,52 @@ "location", "jobId" ], - "httpMethod": "GET" - }, - "list": { - "description": "List the jobs of a project.", "httpMethod": "GET", - "parameterOrder": [ - "projectId", - "location" - ], - "response": { - "$ref": "ListJobsResponse" - }, "parameters": { + "location": { + "description": "The location that contains this job.", + "type": "string", + "required": true, + "location": "path" + }, "view": { + "description": "The level of information requested in response.", + "type": "string", "location": "query", "enum": [ "JOB_VIEW_UNKNOWN", "JOB_VIEW_SUMMARY", "JOB_VIEW_ALL", "JOB_VIEW_DESCRIPTION" - ], - "description": "Level of information requested in response. Default is `JOB_VIEW_SUMMARY`.", - "type": "string" + ] + }, + "jobId": { + "location": "path", + "description": "The job ID.", + "type": "string", + "required": true }, "projectId": { - "description": "The project which owns the jobs.", - "required": true, - "type": "string", - "location": "path" - }, - "filter": { - "location": "query", - "enum": [ - "UNKNOWN", - "ALL", - "TERMINATED", - "ACTIVE" - ], - "description": "The kind of filter to use.", - "type": "string" - }, - "location": { "location": "path", - "description": "The location that contains this job.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Set this to the 'next_page_token' field of a previous response\nto request additional results in a long list.", - "type": "string" - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "If there are many jobs, limit response to at most this many.\nThe actual number of jobs returned will be the lesser of max_responses\nand an unspecified server-defined limit.", - "format": "int32" + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs", - "id": "dataflow.projects.locations.jobs.list", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs" + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", + "id": "dataflow.projects.locations.jobs.get", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}" }, "update": { - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", "id": "dataflow.projects.locations.jobs.update", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", "request": { "$ref": "Job" }, @@ -470,34 +409,38 @@ "jobId" ], "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], "parameters": { "location": { - "location": "path", "description": "The location that contains this job.", - "required": true, - "type": "string" - }, - "projectId": { - "description": "The ID of the Cloud Platform project that the job belongs to.", - "required": true, "type": "string", + "required": true, "location": "path" }, "jobId": { "location": "path", "description": "The job ID.", - "required": true, - "type": "string" + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}" + } }, "create": { + "request": { + "$ref": "Job" + }, + "description": "Creates a Cloud Dataflow job.", "httpMethod": "POST", "parameterOrder": [ "projectId", @@ -506,15 +449,14 @@ "response": { "$ref": "Job" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], "parameters": { - "projectId": { - "location": "path", - "description": "The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, "view": { - "type": "string", "location": "query", "enum": [ "JOB_VIEW_UNKNOWN", @@ -522,13 +464,20 @@ "JOB_VIEW_ALL", "JOB_VIEW_DESCRIPTION" ], - "description": "The level of information requested in response." + "description": "The level of information requested in response.", + "type": "string" + }, + "projectId": { + "location": "path", + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true }, "location": { + "location": "path", "description": "The location that contains this job.", - "required": true, "type": "string", - "location": "path" + "required": true }, "replaceJobId": { "location": "query", @@ -536,306 +485,260 @@ "type": "string" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs", - "id": "dataflow.projects.locations.jobs.create", "path": "v1b3/projects/{projectId}/locations/{location}/jobs", - "request": { - "$ref": "Job" - }, - "description": "Creates a Cloud Dataflow job." - }, - "getMetrics": { - "id": "dataflow.projects.locations.jobs.getMetrics", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics", - "description": "Request the job status.", - "httpMethod": "GET", - "response": { - "$ref": "JobMetrics" - }, - "parameterOrder": [ - "projectId", - "location", - "jobId" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "A project id.", - "required": true, - "type": "string" - }, - "jobId": { - "location": "path", - "description": "The job to get messages for.", - "required": true, - "type": "string" - }, - "location": { - "location": "path", - "description": "The location which contains the job specified by job_id.", - "required": true, - "type": "string" - }, - "startTime": { - "type": "string", - "location": "query", - "description": "Return only metric data that has changed since this time.\nDefault is to return all information about all metrics for the job.", - "format": "google-datetime" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics" + "id": "dataflow.projects.locations.jobs.create" } }, "resources": { - "debug": { - "methods": { - "getConfig": { - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig", - "id": "dataflow.projects.locations.jobs.debug.getConfig", - "description": "Get encoded debug configuration for component. Not cacheable.", - "request": { - "$ref": "GetDebugConfigRequest" - }, - "response": { - "$ref": "GetDebugConfigResponse" - }, - "parameterOrder": [ - "projectId", - "location", - "jobId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "parameters": { - "projectId": { - "description": "The project id.", - "required": true, - "type": "string", - "location": "path" - }, - "jobId": { - "location": "path", - "description": "The job id.", - "required": true, - "type": "string" - }, - "location": { - "description": "The location which contains the job specified by job_id.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig" - }, - "sendCapture": { - "httpMethod": "POST", - "parameterOrder": [ - "projectId", - "location", - "jobId" - ], - "response": { - "$ref": "SendDebugCaptureResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "parameters": { - "location": { - "location": "path", - "description": "The location which contains the job specified by job_id.", - "required": true, - "type": "string" - }, - "projectId": { - "location": "path", - "description": "The project id.", - "required": true, - "type": "string" - }, - "jobId": { - "location": "path", - "description": "The job id.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/sendCapture", - "id": "dataflow.projects.locations.jobs.debug.sendCapture", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/sendCapture", - "description": "Send encoded debug capture data for component.", - "request": { - "$ref": "SendDebugCaptureRequest" - } - } - } - }, "workItems": { "methods": { "lease": { + "request": { + "$ref": "LeaseWorkItemRequest" + }, + "description": "Leases a dataflow WorkItem to run.", + "response": { + "$ref": "LeaseWorkItemResponse" + }, + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], "parameters": { - "location": { - "description": "The location which contains the WorkItem's job.", - "required": true, + "jobId": { + "description": "Identifies the workflow job this worker belongs to.", "type": "string", + "required": true, "location": "path" }, "projectId": { "location": "path", "description": "Identifies the project this worker belongs to.", - "required": true, - "type": "string" - }, - "jobId": { - "description": "Identifies the workflow job this worker belongs to.", - "required": true, "type": "string", + "required": true + }, + "location": { + "description": "The location which contains the WorkItem's job.", + "type": "string", + "required": true, "location": "path" } }, "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:lease", "id": "dataflow.projects.locations.jobs.workItems.lease", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:lease", - "description": "Leases a dataflow WorkItem to run.", - "request": { - "$ref": "LeaseWorkItemRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "projectId", - "location", - "jobId" - ], - "response": { - "$ref": "LeaseWorkItemResponse" - } + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:lease" }, "reportStatus": { "request": { "$ref": "ReportWorkItemStatusRequest" }, "description": "Reports the status of dataflow WorkItems leased by a worker.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], "response": { "$ref": "ReportWorkItemStatusResponse" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "location": { + "location": "path", + "description": "The location which contains the WorkItem's job.", + "type": "string", + "required": true + }, + "jobId": { + "description": "The job which the WorkItem is part of.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "The project which owns the WorkItem's job.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus", + "id": "dataflow.projects.locations.jobs.workItems.reportStatus" + } + } + }, + "debug": { + "methods": { + "sendCapture": { + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/sendCapture", + "id": "dataflow.projects.locations.jobs.debug.sendCapture", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/sendCapture", + "request": { + "$ref": "SendDebugCaptureRequest" + }, + "description": "Send encoded debug capture data for component.", + "response": { + "$ref": "SendDebugCaptureResponse" + }, "parameterOrder": [ "projectId", "location", "jobId" ], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], "parameters": { - "projectId": { + "jobId": { "location": "path", - "description": "The project which owns the WorkItem's job.", + "description": "The job id.", + "type": "string", + "required": true + }, + "projectId": { + "description": "The project id.", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "location": { + "description": "The location which contains the job specified by job_id.", + "type": "string", + "required": true, + "location": "path" + } + } + }, + "getConfig": { + "description": "Get encoded debug configuration for component. Not cacheable.", + "request": { + "$ref": "GetDebugConfigRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], + "response": { + "$ref": "GetDebugConfigResponse" + }, + "parameters": { + "location": { + "location": "path", + "description": "The location which contains the job specified by job_id.", + "type": "string", + "required": true }, "jobId": { "location": "path", - "description": "The job which the WorkItem is part of.", - "required": true, - "type": "string" - }, - "location": { - "description": "The location which contains the WorkItem's job.", - "required": true, + "description": "The job id.", "type": "string", - "location": "path" + "required": true + }, + "projectId": { + "location": "path", + "description": "The project id.", + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus", - "id": "dataflow.projects.locations.jobs.workItems.reportStatus" + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig", + "id": "dataflow.projects.locations.jobs.debug.getConfig" } } }, "messages": { "methods": { "list": { - "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages", - "id": "dataflow.projects.locations.jobs.messages.list", "description": "Request the job status.", - "response": { - "$ref": "ListJobMessagesResponse" - }, + "httpMethod": "GET", "parameterOrder": [ "projectId", "location", "jobId" ], - "httpMethod": "GET", + "response": { + "$ref": "ListJobMessagesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], "parameters": { "jobId": { "description": "The job to get messages about.", - "required": true, "type": "string", + "required": true, "location": "path" }, "projectId": { "location": "path", "description": "A project id.", - "required": true, - "type": "string" + "type": "string", + "required": true + }, + "endTime": { + "format": "google-datetime", + "description": "Return only messages with timestamps \u003c end_time. The default is now\n(i.e. return up to the latest messages available).", + "type": "string", + "location": "query" }, "location": { "description": "The location which contains the job specified by job_id.", - "required": true, "type": "string", + "required": true, "location": "path" }, - "endTime": { - "description": "Return only messages with timestamps \u003c end_time. The default is now\n(i.e. return up to the latest messages available).", - "format": "google-datetime", + "pageToken": { + "description": "If supplied, this should be the value of next_page_token returned\nby an earlier call. This will cause the next page of results to\nbe returned.", "type": "string", "location": "query" }, "startTime": { - "type": "string", "location": "query", + "format": "google-datetime", "description": "If specified, return only messages with timestamps \u003e= start_time.\nThe default is the job creation time (i.e. beginning of messages).", - "format": "google-datetime" - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "If supplied, this should be the value of next_page_token returned\nby an earlier call. This will cause the next page of results to\nbe returned." + "type": "string" }, "pageSize": { - "location": "query", - "description": "If specified, determines the maximum number of messages to\nreturn. If unspecified, the service may choose an appropriate\ndefault, or may return an arbitrarily large number of results.", "format": "int32", - "type": "integer" + "description": "If specified, determines the maximum number of messages to\nreturn. If unspecified, the service may choose an appropriate\ndefault, or may return an arbitrarily large number of results.", + "type": "integer", + "location": "query" }, "minimumImportance": { + "description": "Filter to only get messages with importance \u003e= level", + "type": "string", "location": "query", "enum": [ "JOB_MESSAGE_IMPORTANCE_UNKNOWN", @@ -844,16 +747,12 @@ "JOB_MESSAGE_BASIC", "JOB_MESSAGE_WARNING", "JOB_MESSAGE_ERROR" - ], - "description": "Filter to only get messages with importance \u003e= level", - "type": "string" + ] } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ] + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages", + "id": "dataflow.projects.locations.jobs.messages.list" } } } @@ -861,56 +760,297 @@ } } }, - "jobs": { + "templates": { "methods": { - "getMetrics": { - "description": "Request the job status.", - "httpMethod": "GET", + "launch": { + "description": "Launch a template.", + "request": { + "$ref": "LaunchTemplateParameters" + }, + "httpMethod": "POST", "parameterOrder": [ - "projectId", - "jobId" + "projectId" ], "response": { - "$ref": "JobMetrics" + "$ref": "LaunchTemplateResponse" + }, + "parameters": { + "location": { + "location": "query", + "description": "The location to which to direct the request.", + "type": "string" + }, + "validateOnly": { + "description": "If true, the request is validated but not actually executed.\nDefaults to false.", + "type": "boolean", + "location": "query" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + }, + "gcsPath": { + "description": "Required. A Cloud Storage path to the template from which to create\nthe job.\nMust be valid Cloud Storage URL, beginning with 'gs://'.", + "type": "string", + "location": "query" + } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "flatPath": "v1b3/projects/{projectId}/templates:launch", + "path": "v1b3/projects/{projectId}/templates:launch", + "id": "dataflow.projects.templates.launch" + }, + "get": { + "response": { + "$ref": "GetTemplateResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "GET", + "parameters": { + "view": { + "location": "query", + "enum": [ + "METADATA_ONLY" + ], + "description": "The view to retrieve. Defaults to METADATA_ONLY.", + "type": "string" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + }, + "gcsPath": { + "location": "query", + "description": "Required. A Cloud Storage path to the template from which to\ncreate the job.\nMust be a valid Cloud Storage URL, beginning with `gs://`.", + "type": "string" + }, + "location": { + "location": "query", + "description": "The location to which to direct the request.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "flatPath": "v1b3/projects/{projectId}/templates:get", + "id": "dataflow.projects.templates.get", + "path": "v1b3/projects/{projectId}/templates:get", + "description": "Get the template associated with a template." + }, + "create": { + "description": "Creates a Cloud Dataflow job from a template.", + "request": { + "$ref": "CreateJobFromTemplateRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Job" + }, + "parameters": { + "projectId": { + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "flatPath": "v1b3/projects/{projectId}/templates", + "path": "v1b3/projects/{projectId}/templates", + "id": "dataflow.projects.templates.create" + } + } + }, + "jobs": { + "methods": { + "list": { + "description": "List the jobs of a project in a given region.", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], "parameters": { - "location": { + "pageSize": { + "format": "int32", + "description": "If there are many jobs, limit response to at most this many.\nThe actual number of jobs returned will be the lesser of max_responses\nand an unspecified server-defined limit.", + "type": "integer", + "location": "query" + }, + "view": { + "description": "Level of information requested in response. Default is `JOB_VIEW_SUMMARY`.", + "type": "string", "location": "query", - "description": "The location which contains the job specified by job_id.", + "enum": [ + "JOB_VIEW_UNKNOWN", + "JOB_VIEW_SUMMARY", + "JOB_VIEW_ALL", + "JOB_VIEW_DESCRIPTION" + ] + }, + "projectId": { + "location": "path", + "description": "The project which owns the jobs.", + "type": "string", + "required": true + }, + "filter": { + "location": "query", + "enum": [ + "UNKNOWN", + "ALL", + "TERMINATED", + "ACTIVE" + ], + "description": "The kind of filter to use.", "type": "string" }, - "startTime": { - "description": "Return only metric data that has changed since this time.\nDefault is to return all information about all metrics for the job.", - "format": "google-datetime", + "location": { + "description": "The location that contains this job.", "type": "string", "location": "query" }, - "projectId": { - "description": "A project id.", - "required": true, + "pageToken": { + "description": "Set this to the 'next_page_token' field of a previous response\nto request additional results in a long list.", "type": "string", - "location": "path" + "location": "query" + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs", + "id": "dataflow.projects.jobs.list", + "path": "v1b3/projects/{projectId}/jobs" + }, + "create": { + "description": "Creates a Cloud Dataflow job.", + "request": { + "$ref": "Job" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Job" + }, + "parameters": { + "location": { + "description": "The location that contains this job.", + "type": "string", + "location": "query" + }, + "replaceJobId": { + "location": "query", + "description": "Deprecated. This field is now in the Job message.", + "type": "string" + }, + "view": { + "description": "The level of information requested in response.", + "type": "string", + "location": "query", + "enum": [ + "JOB_VIEW_UNKNOWN", + "JOB_VIEW_SUMMARY", + "JOB_VIEW_ALL", + "JOB_VIEW_DESCRIPTION" + ] + }, + "projectId": { + "location": "path", + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "flatPath": "v1b3/projects/{projectId}/jobs", + "path": "v1b3/projects/{projectId}/jobs", + "id": "dataflow.projects.jobs.create" + }, + "getMetrics": { + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", + "id": "dataflow.projects.jobs.getMetrics", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", + "description": "Request the job status.", + "response": { + "$ref": "JobMetrics" + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "httpMethod": "GET", + "parameters": { + "location": { + "description": "The location which contains the job specified by job_id.", + "type": "string", + "location": "query" + }, + "startTime": { + "location": "query", + "format": "google-datetime", + "description": "Return only metric data that has changed since this time.\nDefault is to return all information about all metrics for the job.", + "type": "string" }, "jobId": { "location": "path", "description": "The job to get messages for.", + "type": "string", + "required": true + }, + "projectId": { + "description": "A project id.", + "type": "string", "required": true, - "type": "string" + "location": "path" } }, - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", - "id": "dataflow.projects.jobs.getMetrics", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/metrics" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ] }, "get": { "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}", - "path": "v1b3/projects/{projectId}/jobs/{jobId}", "id": "dataflow.projects.jobs.get", + "path": "v1b3/projects/{projectId}/jobs/{jobId}", "description": "Gets the state of the specified Cloud Dataflow job.", "response": { "$ref": "Job" @@ -921,176 +1061,6 @@ ], "httpMethod": "GET", "parameters": { - "location": { - "location": "query", - "description": "The location that contains this job.", - "type": "string" - }, - "projectId": { - "location": "path", - "description": "The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, - "jobId": { - "description": "The job ID.", - "required": true, - "type": "string", - "location": "path" - }, - "view": { - "type": "string", - "location": "query", - "enum": [ - "JOB_VIEW_UNKNOWN", - "JOB_VIEW_SUMMARY", - "JOB_VIEW_ALL", - "JOB_VIEW_DESCRIPTION" - ], - "description": "The level of information requested in response." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ] - }, - "list": { - "response": { - "$ref": "ListJobsResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "GET", - "parameters": { - "pageToken": { - "type": "string", - "location": "query", - "description": "Set this to the 'next_page_token' field of a previous response\nto request additional results in a long list." - }, - "pageSize": { - "description": "If there are many jobs, limit response to at most this many.\nThe actual number of jobs returned will be the lesser of max_responses\nand an unspecified server-defined limit.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "view": { - "location": "query", - "enum": [ - "JOB_VIEW_UNKNOWN", - "JOB_VIEW_SUMMARY", - "JOB_VIEW_ALL", - "JOB_VIEW_DESCRIPTION" - ], - "description": "Level of information requested in response. Default is `JOB_VIEW_SUMMARY`.", - "type": "string" - }, - "projectId": { - "location": "path", - "description": "The project which owns the jobs.", - "required": true, - "type": "string" - }, - "filter": { - "enum": [ - "UNKNOWN", - "ALL", - "TERMINATED", - "ACTIVE" - ], - "description": "The kind of filter to use.", - "type": "string", - "location": "query" - }, - "location": { - "description": "The location that contains this job.", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "flatPath": "v1b3/projects/{projectId}/jobs", - "path": "v1b3/projects/{projectId}/jobs", - "id": "dataflow.projects.jobs.list", - "description": "List the jobs of a project." - }, - "update": { - "httpMethod": "PUT", - "parameterOrder": [ - "projectId", - "jobId" - ], - "response": { - "$ref": "Job" - }, - "parameters": { - "location": { - "location": "query", - "description": "The location that contains this job.", - "type": "string" - }, - "projectId": { - "description": "The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string", - "location": "path" - }, - "jobId": { - "required": true, - "type": "string", - "location": "path", - "description": "The job ID." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}", - "id": "dataflow.projects.jobs.update", - "path": "v1b3/projects/{projectId}/jobs/{jobId}", - "request": { - "$ref": "Job" - }, - "description": "Updates the state of an existing Cloud Dataflow job." - }, - "create": { - "response": { - "$ref": "Job" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "parameters": { - "location": { - "type": "string", - "location": "query", - "description": "The location that contains this job." - }, - "replaceJobId": { - "description": "Deprecated. This field is now in the Job message.", - "type": "string", - "location": "query" - }, - "projectId": { - "location": "path", - "description": "The ID of the Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, "view": { "location": "query", "enum": [ @@ -1101,99 +1071,144 @@ ], "description": "The level of information requested in response.", "type": "string" + }, + "jobId": { + "location": "path", + "description": "The job ID.", + "type": "string", + "required": true + }, + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + }, + "location": { + "description": "The location that contains this job.", + "type": "string", + "location": "query" } }, - "flatPath": "v1b3/projects/{projectId}/jobs", - "path": "v1b3/projects/{projectId}/jobs", - "id": "dataflow.projects.jobs.create", - "description": "Creates a Cloud Dataflow job.", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "update": { + "httpMethod": "PUT", + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "location": { + "description": "The location that contains this job.", + "type": "string", + "location": "query" + }, + "jobId": { + "description": "The job ID.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}", + "path": "v1b3/projects/{projectId}/jobs/{jobId}", + "id": "dataflow.projects.jobs.update", "request": { "$ref": "Job" - } + }, + "description": "Updates the state of an existing Cloud Dataflow job." + }, + "aggregated": { + "description": "List the jobs of a project across all regions.", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListJobsResponse" + }, + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "projectId": { + "description": "The project which owns the jobs.", + "type": "string", + "required": true, + "location": "path" + }, + "filter": { + "location": "query", + "enum": [ + "UNKNOWN", + "ALL", + "TERMINATED", + "ACTIVE" + ], + "description": "The kind of filter to use.", + "type": "string" + }, + "location": { + "description": "The location that contains this job.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "Set this to the 'next_page_token' field of a previous response\nto request additional results in a long list.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "If there are many jobs, limit response to at most this many.\nThe actual number of jobs returned will be the lesser of max_responses\nand an unspecified server-defined limit.", + "type": "integer" + }, + "view": { + "description": "Level of information requested in response. Default is `JOB_VIEW_SUMMARY`.", + "type": "string", + "location": "query", + "enum": [ + "JOB_VIEW_UNKNOWN", + "JOB_VIEW_SUMMARY", + "JOB_VIEW_ALL", + "JOB_VIEW_DESCRIPTION" + ] + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs:aggregated", + "id": "dataflow.projects.jobs.aggregated", + "path": "v1b3/projects/{projectId}/jobs:aggregated" } }, "resources": { - "debug": { - "methods": { - "getConfig": { - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig", - "id": "dataflow.projects.jobs.debug.getConfig", - "request": { - "$ref": "GetDebugConfigRequest" - }, - "description": "Get encoded debug configuration for component. Not cacheable.", - "response": { - "$ref": "GetDebugConfigResponse" - }, - "parameterOrder": [ - "projectId", - "jobId" - ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "location": "path", - "description": "The project id.", - "required": true, - "type": "string" - }, - "jobId": { - "location": "path", - "description": "The job id.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ] - }, - "sendCapture": { - "response": { - "$ref": "SendDebugCaptureResponse" - }, - "parameterOrder": [ - "projectId", - "jobId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The project id.", - "required": true, - "type": "string" - }, - "jobId": { - "required": true, - "type": "string", - "location": "path", - "description": "The job id." - } - }, - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture", - "id": "dataflow.projects.jobs.debug.sendCapture", - "description": "Send encoded debug capture data for component.", - "request": { - "$ref": "SendDebugCaptureRequest" - } - } - } - }, "workItems": { "methods": { "lease": { - "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease", - "id": "dataflow.projects.jobs.workItems.lease", "request": { "$ref": "LeaseWorkItemRequest" }, @@ -1206,35 +1221,31 @@ "jobId" ], "httpMethod": "POST", - "parameters": { - "projectId": { - "location": "path", - "description": "Identifies the project this worker belongs to.", - "required": true, - "type": "string" - }, - "jobId": { - "description": "Identifies the workflow job this worker belongs to.", - "required": true, - "type": "string", - "location": "path" - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease" + "parameters": { + "jobId": { + "description": "Identifies the workflow job this worker belongs to.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "Identifies the project this worker belongs to.", + "type": "string", + "required": true + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease", + "id": "dataflow.projects.jobs.workItems.lease", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease" }, "reportStatus": { - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus", - "id": "dataflow.projects.jobs.workItems.reportStatus", - "description": "Reports the status of dataflow WorkItems leased by a worker.", - "request": { - "$ref": "ReportWorkItemStatusRequest" - }, "response": { "$ref": "ReportWorkItemStatusResponse" }, @@ -1246,22 +1257,108 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], "parameters": { + "jobId": { + "description": "The job which the WorkItem is part of.", + "type": "string", + "required": true, + "location": "path" + }, "projectId": { "location": "path", "description": "The project which owns the WorkItem's job.", - "required": true, - "type": "string" - }, - "jobId": { - "description": "The job which the WorkItem is part of.", - "required": true, "type": "string", + "required": true + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus", + "id": "dataflow.projects.jobs.workItems.reportStatus", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus", + "request": { + "$ref": "ReportWorkItemStatusRequest" + }, + "description": "Reports the status of dataflow WorkItems leased by a worker." + } + } + }, + "debug": { + "methods": { + "sendCapture": { + "request": { + "$ref": "SendDebugCaptureRequest" + }, + "description": "Send encoded debug capture data for component.", + "response": { + "$ref": "SendDebugCaptureResponse" + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "jobId": { + "description": "The job id.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "The project id.", + "type": "string", + "required": true, "location": "path" } - } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture", + "id": "dataflow.projects.jobs.debug.sendCapture", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture" + }, + "getConfig": { + "request": { + "$ref": "GetDebugConfigRequest" + }, + "description": "Get encoded debug configuration for component. Not cacheable.", + "response": { + "$ref": "GetDebugConfigResponse" + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "jobId": { + "description": "The job id.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "The project id.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig", + "id": "dataflow.projects.jobs.debug.getConfig", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig" } } }, @@ -1276,27 +1373,11 @@ "jobId" ], "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/userinfo.email" - ], "parameters": { - "startTime": { - "location": "query", - "description": "If specified, return only messages with timestamps \u003e= start_time.\nThe default is the job creation time (i.e. beginning of messages).", - "format": "google-datetime", - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "If supplied, this should be the value of next_page_token returned\nby an earlier call. This will cause the next page of results to\nbe returned.", - "type": "string" - }, "pageSize": { "location": "query", - "description": "If specified, determines the maximum number of messages to\nreturn. If unspecified, the service may choose an appropriate\ndefault, or may return an arbitrarily large number of results.", "format": "int32", + "description": "If specified, determines the maximum number of messages to\nreturn. If unspecified, the service may choose an appropriate\ndefault, or may return an arbitrarily large number of results.", "type": "integer" }, "minimumImportance": { @@ -1314,31 +1395,48 @@ }, "jobId": { "description": "The job to get messages about.", - "required": true, "type": "string", + "required": true, "location": "path" }, "projectId": { "location": "path", "description": "A project id.", - "required": true, - "type": "string" + "type": "string", + "required": true }, "location": { + "location": "query", "description": "The location which contains the job specified by job_id.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Return only messages with timestamps \u003c end_time. The default is now\n(i.e. return up to the latest messages available).", "type": "string", "location": "query" }, - "endTime": { - "description": "Return only messages with timestamps \u003c end_time. The default is now\n(i.e. return up to the latest messages available).", - "format": "google-datetime", + "pageToken": { + "description": "If supplied, this should be the value of next_page_token returned\nby an earlier call. This will cause the next page of results to\nbe returned.", "type": "string", "location": "query" + }, + "startTime": { + "location": "query", + "format": "google-datetime", + "description": "If specified, return only messages with timestamps \u003e= start_time.\nThe default is the job creation time (i.e. beginning of messages).", + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/messages", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/messages", "id": "dataflow.projects.jobs.messages.list", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/messages", "description": "Request the job status." } } @@ -1349,55 +1447,28 @@ } }, "parameters": { - "pp": { - "type": "boolean", - "default": "true", + "fields": { "location": "query", - "description": "Pretty-print response." - }, - "oauth_token": { - "type": "string", - "location": "query", - "description": "OAuth 2.0 token for the current user." - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", + "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." - }, - "fields": { - "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." + "location": "query" }, "$.xgafv": { - "enum": [ - "1", - "2" - ], "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" ], - "location": "query" + "location": "query", + "enum": [ + "1", + "2" + ] }, "callback": { "description": "JSONP", @@ -1405,6 +1476,11 @@ "location": "query" }, "alt": { + "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", "description": "Data format for response.", "default": "json", @@ -1413,17 +1489,12 @@ "media", "proto" ], - "type": "string", - "enumDescriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ] + "type": "string" }, "key": { - "location": "query", "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.", - "type": "string" + "type": "string", + "location": "query" }, "access_token": { "description": "OAuth access token.", @@ -1431,418 +1502,43 @@ "location": "query" }, "quotaUser": { - "location": "query", "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" } }, "schemas": { - "SourceOperationResponse": { - "description": "The result of a SourceOperationRequest, specified in\nReportWorkItemStatusRequest.source_operation when the work item\nis completed.", - "type": "object", - "properties": { - "getMetadata": { - "$ref": "SourceGetMetadataResponse", - "description": "A response to a request to get metadata about a source." - }, - "split": { - "$ref": "SourceSplitResponse", - "description": "A response to a request to split a source." - } - }, - "id": "SourceOperationResponse" - }, - "SendDebugCaptureResponse": { - "description": "Response to a send capture request.\nnothing", - "type": "object", - "properties": {}, - "id": "SendDebugCaptureResponse" - }, - "SideInputInfo": { - "description": "Information about a side input of a DoFn or an input of a SeqDoFn.", - "type": "object", - "properties": { - "sources": { - "description": "The source(s) to read element(s) from to get the value of this side input.\nIf more than one source, then the elements are taken from the\nsources, in the specified order if order matters.\nAt least one source is required.", - "type": "array", - "items": { - "$ref": "Source" - } - }, - "kind": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "How to interpret the source element(s) as a side input value.", - "type": "object" - }, - "tag": { - "description": "The id of the tag the user code will access this side input by;\nthis should correspond to the tag of some MultiOutputInfo.", - "type": "string" - } - }, - "id": "SideInputInfo" - }, - "CounterStructuredNameAndMetadata": { - "description": "A single message which encapsulates structured name and metadata for a given\ncounter.", - "type": "object", - "properties": { - "name": { - "description": "Structured name of the counter.", - "$ref": "CounterStructuredName" - }, - "metadata": { - "$ref": "CounterMetadata", - "description": "Metadata associated with a counter" - } - }, - "id": "CounterStructuredNameAndMetadata" - }, - "ConcatPosition": { - "description": "A position that encapsulates an inner position and an index for the inner\nposition. A ConcatPosition can be used by a reader of a source that\nencapsulates a set of other sources.", - "type": "object", - "properties": { - "position": { - "$ref": "Position", - "description": "Position within the inner source." - }, - "index": { - "description": "Index of the inner source.", - "format": "int32", - "type": "integer" - } - }, - "id": "ConcatPosition" - }, - "WriteInstruction": { - "description": "An instruction that writes records.\nTakes one input, produces no outputs.", - "type": "object", - "properties": { - "sink": { - "$ref": "Sink", - "description": "The sink to write to." - }, - "input": { - "description": "The input.", - "$ref": "InstructionInput" - } - }, - "id": "WriteInstruction" - }, - "StreamingComputationRanges": { - "description": "Describes full or partial data disk assignment information of the computation\nranges.", - "type": "object", - "properties": { - "computationId": { - "description": "The ID of the computation.", - "type": "string" - }, - "rangeAssignments": { - "description": "Data disk assignments for ranges from this computation.", - "type": "array", - "items": { - "$ref": "KeyRangeDataDiskAssignment" - } - } - }, - "id": "StreamingComputationRanges" - }, - "AutoscalingSettings": { - "description": "Settings for WorkerPool autoscaling.", - "type": "object", - "properties": { - "algorithm": { - "enumDescriptions": [ - "The algorithm is unknown, or unspecified.", - "Disable autoscaling.", - "Increase worker count over time to reduce job execution time." - ], - "enum": [ - "AUTOSCALING_ALGORITHM_UNKNOWN", - "AUTOSCALING_ALGORITHM_NONE", - "AUTOSCALING_ALGORITHM_BASIC" - ], - "description": "The algorithm to use for autoscaling.", - "type": "string" - }, - "maxNumWorkers": { - "description": "The maximum number of workers to cap scaling at.", - "format": "int32", - "type": "integer" - } - }, - "id": "AutoscalingSettings" - }, - "ExecutionStageSummary": { - "description": "Description of the composing transforms, names/ids, and input/outputs of a\nstage of execution. Some composing transforms and sources may have been\ngenerated by the Dataflow service during execution planning.", - "type": "object", - "properties": { - "componentTransform": { - "description": "Transforms that comprise this execution stage.", - "type": "array", - "items": { - "$ref": "ComponentTransform" - } - }, - "componentSource": { - "description": "Collections produced and consumed by component transforms of this stage.", - "type": "array", - "items": { - "$ref": "ComponentSource" - } - }, - "kind": { - "enum": [ - "UNKNOWN_KIND", - "PAR_DO_KIND", - "GROUP_BY_KEY_KIND", - "FLATTEN_KIND", - "READ_KIND", - "WRITE_KIND", - "CONSTANT_KIND", - "SINGLETON_KIND", - "SHUFFLE_KIND" - ], - "description": "Type of tranform this stage is executing.", - "type": "string", - "enumDescriptions": [ - "Unrecognized transform type.", - "ParDo transform.", - "Group By Key transform.", - "Flatten transform.", - "Read transform.", - "Write transform.", - "Constructs from a constant value, such as with Create.of.", - "Creates a Singleton view of a collection.", - "Opening or closing a shuffle session, often as part of a GroupByKey." - ] - }, - "outputSource": { - "description": "Output sources for this stage.", - "type": "array", - "items": { - "$ref": "StageSource" - } - }, - "name": { - "description": "Dataflow service generated name for this stage.", - "type": "string" - }, - "inputSource": { - "description": "Input sources for this stage.", - "type": "array", - "items": { - "$ref": "StageSource" - } - }, - "id": { - "description": "Dataflow service generated id for this stage.", - "type": "string" - } - }, - "id": "ExecutionStageSummary" - }, - "SendWorkerMessagesRequest": { - "description": "A request for sending worker messages to the service.", - "type": "object", - "properties": { - "workerMessages": { - "description": "The WorkerMessages to send.", - "type": "array", - "items": { - "$ref": "WorkerMessage" - } - }, - "location": { - "description": "The location which contains the job", - "type": "string" - } - }, - "id": "SendWorkerMessagesRequest" - }, - "LogBucket": { - "description": "Bucket of values for Distribution's logarithmic histogram.", - "type": "object", - "properties": { - "count": { - "description": "Number of values in this bucket.", - "format": "int64", - "type": "string" - }, - "log": { - "description": "floor(log2(value)); defined to be zero for nonpositive values.\n log(-1) = 0\n log(0) = 0\n log(1) = 0\n log(2) = 1\n log(3) = 1\n log(4) = 2\n log(5) = 2", - "format": "int32", - "type": "integer" - } - }, - "id": "LogBucket" - }, - "SourceSplitShard": { - "description": "DEPRECATED in favor of DerivedSource.", - "type": "object", - "properties": { - "derivationMode": { - "enumDescriptions": [ - "The source derivation is unknown, or unspecified.", - "Produce a completely independent Source with no base.", - "Produce a Source based on the Source being split.", - "Produce a Source based on the base of the Source being split." - ], - "enum": [ - "SOURCE_DERIVATION_MODE_UNKNOWN", - "SOURCE_DERIVATION_MODE_INDEPENDENT", - "SOURCE_DERIVATION_MODE_CHILD_OF_CURRENT", - "SOURCE_DERIVATION_MODE_SIBLING_OF_CURRENT" - ], - "description": "DEPRECATED", - "type": "string" - }, - "source": { - "description": "DEPRECATED", - "$ref": "Source" - } - }, - "id": "SourceSplitShard" - }, - "CPUTime": { - "properties": { - "rate": { - "type": "number", - "description": "Average CPU utilization rate (% non-idle cpu / second) since previous\nsample.", - "format": "double" - }, - "timestamp": { - "type": "string", - "description": "Timestamp of the measurement.", - "format": "google-datetime" - }, - "totalMs": { - "description": "Total active CPU time across all cores (ie., non-idle) in milliseconds\nsince start-up.", - "format": "uint64", - "type": "string" - } - }, - "id": "CPUTime", - "description": "Modeled after information exposed by /proc/stat.", - "type": "object" - }, - "Environment": { - "description": "Describes the environment in which a Dataflow Job runs.", - "type": "object", - "properties": { - "clusterManagerApiService": { - "description": "The type of cluster manager API to use. If unknown or\nunspecified, the service will attempt to choose a reasonable\ndefault. This should be in the form of the API service name,\ne.g. \"compute.googleapis.com\".", - "type": "string" - }, - "tempStoragePrefix": { - "description": "The prefix of the resources the system should use for temporary\nstorage. The system will append the suffix \"/temp-{JOBNAME} to\nthis resource prefix, where {JOBNAME} is the value of the\njob_name field. The resulting bucket and object prefix is used\nas the prefix of the resources used to store temporary data\nneeded during the job execution. NOTE: This will override the\nvalue in taskrunner_settings.\nThe supported resource type is:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", - "type": "string" - }, - "workerPools": { - "description": "The worker pools. At least one \"harness\" worker pool must be\nspecified in order for the job to have workers.", - "type": "array", - "items": { - "$ref": "WorkerPool" - } - }, - "dataset": { - "description": "The dataset for the current project where various workflow\nrelated tables are stored.\n\nThe supported resource type is:\n\nGoogle BigQuery:\n bigquery.googleapis.com/{dataset}", - "type": "string" - }, - "experiments": { - "description": "The list of experiments to enable.", - "type": "array", - "items": { - "type": "string" - } - }, - "version": { - "description": "A structure describing which components and their versions of the service\nare required in order to run the job.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } - }, - "internalExperiments": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "Experimental settings.", - "type": "object" - }, - "serviceAccountEmail": { - "type": "string", - "description": "Identity to run virtual machines as. Defaults to the default account." - }, - "sdkPipelineOptions": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The Cloud Dataflow SDK pipeline options specified by the user. These\noptions are passed through the service and are used to recreate the\nSDK pipeline options on the worker in a language agnostic and platform\nindependent way.", - "type": "object" - }, - "userAgent": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "A description of the process that generated the request.", - "type": "object" - } - }, - "id": "Environment" - }, - "StreamingComputationTask": { - "type": "object", - "properties": { - "dataDisks": { - "description": "Describes the set of data disks this task should apply to.", - "type": "array", - "items": { - "$ref": "MountedDataDisk" - } - }, - "taskType": { - "enum": [ - "STREAMING_COMPUTATION_TASK_UNKNOWN", - "STREAMING_COMPUTATION_TASK_STOP", - "STREAMING_COMPUTATION_TASK_START" - ], - "description": "A type of streaming computation task.", - "type": "string", - "enumDescriptions": [ - "The streaming computation task is unknown, or unspecified.", - "Stop processing specified streaming computation range(s).", - "Start processing specified streaming computation range(s)." - ] - }, - "computationRanges": { - "description": "Contains ranges of a streaming computation this task should apply to.", - "type": "array", - "items": { - "$ref": "StreamingComputationRanges" - } - } - }, - "id": "StreamingComputationTask", - "description": "A task which describes what action should be performed for the specified\nstreaming computation ranges." - }, "SendDebugCaptureRequest": { "description": "Request to send encoded debug information.", "type": "object", "properties": { - "location": { - "description": "The location which contains the job specified by job_id.", - "type": "string" - }, - "data": { - "description": "The encoded debug information.", - "type": "string" - }, "componentId": { "description": "The internal component id for which debug information is sent.", "type": "string" @@ -1850,6 +1546,14 @@ "workerId": { "description": "The worker id, i.e., VM hostname.", "type": "string" + }, + "location": { + "description": "The location which contains the job specified by job_id.", + "type": "string" + }, + "data": { + "description": "The encoded debug information.", + "type": "string" } }, "id": "SendDebugCaptureRequest" @@ -1869,6 +1573,10 @@ "description": "Description of a transform executed as part of an execution stage.", "type": "object", "properties": { + "userName": { + "description": "Human-readable name for this transform; may be user or system generated.", + "type": "string" + }, "originalTransform": { "description": "User name for the original user transform with which this transform is\nmost closely associated.", "type": "string" @@ -1876,10 +1584,6 @@ "name": { "description": "Dataflow service generated name for this source.", "type": "string" - }, - "userName": { - "description": "Human-readable name for this transform; may be user or system generated.", - "type": "string" } }, "id": "ComponentTransform" @@ -1888,23 +1592,23 @@ "description": "A task which initializes part of a streaming Dataflow job.", "type": "object", "properties": { - "receiveWorkPort": { - "description": "The TCP port on which the worker should listen for messages from\nother streaming computation workers.", - "format": "int32", - "type": "integer" - }, "streamingComputationTopology": { - "description": "The global topology of the streaming Dataflow job.", - "$ref": "TopologyConfig" - }, - "workerHarnessPort": { - "type": "integer", - "description": "The TCP port used by the worker to communicate with the Dataflow\nworker harness.", - "format": "int32" + "$ref": "TopologyConfig", + "description": "The global topology of the streaming Dataflow job." }, "drain": { "description": "The user has requested drain.", "type": "boolean" + }, + "workerHarnessPort": { + "format": "int32", + "description": "The TCP port used by the worker to communicate with the Dataflow\nworker harness.", + "type": "integer" + }, + "receiveWorkPort": { + "format": "int32", + "description": "The TCP port on which the worker should listen for messages from\nother streaming computation workers.", + "type": "integer" } }, "id": "StreamingSetupTask" @@ -1913,6 +1617,14 @@ "description": "Identifies a pubsub location to use for transferring data into or\nout of a streaming Dataflow job.", "type": "object", "properties": { + "topic": { + "description": "A pubsub topic, in the form of\n\"pubsub.googleapis.com/topics/\u003cproject-id\u003e/\u003ctopic-name\u003e\"", + "type": "string" + }, + "timestampLabel": { + "description": "If set, contains a pubsub label from which to extract record timestamps.\nIf left empty, record timestamps will be generated upon arrival.", + "type": "string" + }, "subscription": { "description": "A pubsub subscription, in the form of\n\"pubsub.googleapis.com/subscriptions/\u003cproject-id\u003e/\u003csubscription-name\u003e\"", "type": "string" @@ -1932,14 +1644,6 @@ "idLabel": { "description": "If set, contains a pubsub label from which to extract record ids.\nIf left empty, record deduplication will be strictly best effort.", "type": "string" - }, - "timestampLabel": { - "description": "If set, contains a pubsub label from which to extract record timestamps.\nIf left empty, record timestamps will be generated upon arrival.", - "type": "string" - }, - "topic": { - "description": "A pubsub topic, in the form of\n\"pubsub.googleapis.com/topics/\u003cproject-id\u003e/\u003ctopic-name\u003e\"", - "type": "string" } }, "id": "PubsubLocation" @@ -1948,22 +1652,17 @@ "description": "WorkerHealthReport contains information about the health of a worker.\n\nThe VM should be identified by the labels attached to the WorkerMessage that\nthis health ping belongs to.", "type": "object", "properties": { - "vmStartupTime": { - "description": "The time the VM was booted.", - "format": "google-datetime", + "reportInterval": { + "format": "google-duration", + "description": "The interval at which the worker is sending health reports.\nThe default value of 0 should be interpreted as the field is not being\nexplicitly set by the worker.", "type": "string" }, "vmIsHealthy": { "description": "Whether the VM is healthy.", "type": "boolean" }, - "reportInterval": { - "description": "The interval at which the worker is sending health reports.\nThe default value of 0 should be interpreted as the field is not being\nexplicitly set by the worker.", - "format": "google-duration", - "type": "string" - }, "pods": { - "type": "array", + "description": "The pods running on the worker. See:\nhttp://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod\n\nThis field is used by the worker to send the status of the indvidual\ncontainers running on each worker.", "items": { "additionalProperties": { "description": "Properties of the object.", @@ -1971,7 +1670,12 @@ }, "type": "object" }, - "description": "The pods running on the worker. See:\nhttp://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod\n\nThis field is used by the worker to send the status of the indvidual\ncontainers running on each worker." + "type": "array" + }, + "vmStartupTime": { + "format": "google-datetime", + "description": "The time the VM was booted.", + "type": "string" } }, "id": "WorkerHealthReport" @@ -1980,12 +1684,16 @@ "description": "A particular message pertaining to a Dataflow job.", "type": "object", "properties": { - "messageText": { - "description": "The text of the message.", + "time": { + "format": "google-datetime", + "description": "The timestamp of the message.", + "type": "string" + }, + "id": { + "description": "Deprecated.", "type": "string" }, "messageImportance": { - "type": "string", "enumDescriptions": [ "The message importance isn't specified, or is unknown.", "The message is at the 'debug' level: typically only useful for\nsoftware engineers working on the code the job is running.\nTypically, Dataflow pipeline runners do not display log messages\nat this level by default.", @@ -2002,38 +1710,20 @@ "JOB_MESSAGE_WARNING", "JOB_MESSAGE_ERROR" ], - "description": "Importance level of the message." + "description": "Importance level of the message.", + "type": "string" }, - "time": { - "type": "string", - "description": "The timestamp of the message.", - "format": "google-datetime" - }, - "id": { - "description": "Deprecated.", + "messageText": { + "description": "The text of the message.", "type": "string" } }, "id": "JobMessage" }, "ParameterMetadata": { + "description": "Metadata for a specific parameter.", "type": "object", "properties": { - "name": { - "description": "Required. The name of the parameter.", - "type": "string" - }, - "regexes": { - "description": "Optional. Regexes that the parameter must match.", - "type": "array", - "items": { - "type": "string" - } - }, - "label": { - "description": "Required. The label to display for the parameter.", - "type": "string" - }, "helpText": { "description": "Required. The help text to display for the parameter.", "type": "string" @@ -2041,10 +1731,24 @@ "isOptional": { "description": "Optional. Whether the parameter is optional. Defaults to false.", "type": "boolean" + }, + "name": { + "description": "Required. The name of the parameter.", + "type": "string" + }, + "regexes": { + "description": "Optional. Regexes that the parameter must match.", + "items": { + "type": "string" + }, + "type": "array" + }, + "label": { + "description": "Required. The label to display for the parameter.", + "type": "string" } }, - "id": "ParameterMetadata", - "description": "Metadata for a specific parameter." + "id": "ParameterMetadata" }, "MultiOutputInfo": { "description": "Information about an output of a multi-output DoFn.", @@ -2061,13 +1765,13 @@ "description": "Represents the operation to split a high-level Source specification\ninto bundles (parts for parallel processing).\n\nAt a high level, splitting of a source into bundles happens as follows:\nSourceSplitRequest is applied to the source. If it returns\nSOURCE_SPLIT_OUTCOME_USE_CURRENT, no further splitting happens and the source\nis used \"as is\". Otherwise, splitting is applied recursively to each\nproduced DerivedSource.\n\nAs an optimization, for any Source, if its does_not_need_splitting is\ntrue, the framework assumes that splitting this source would return\nSOURCE_SPLIT_OUTCOME_USE_CURRENT, and doesn't initiate a SourceSplitRequest.\nThis applies both to the initial source being split and to bundles\nproduced from it.", "type": "object", "properties": { + "options": { + "$ref": "SourceSplitOptions", + "description": "Hints for tuning the splitting process." + }, "source": { "description": "Specification of the source to be split.", "$ref": "Source" - }, - "options": { - "description": "Hints for tuning the splitting process.", - "$ref": "SourceSplitOptions" } }, "id": "SourceSplitRequest" @@ -2083,11 +1787,30 @@ }, "id": "SourceGetMetadataResponse" }, + "MetricShortId": { + "description": "The metric short id is returned to the user alongside an offset into\nReportWorkItemStatusRequest", + "type": "object", + "properties": { + "metricIndex": { + "format": "int32", + "description": "The index of the corresponding metric in\nthe ReportWorkItemStatusRequest. Required.", + "type": "integer" + }, + "shortId": { + "format": "int64", + "description": "The service-generated short identifier for the metric.", + "type": "string" + } + }, + "id": "MetricShortId" + }, "ShellTask": { + "description": "A task which consists of a shell command for the worker to execute.", + "type": "object", "properties": { "exitCode": { - "description": "Exit code for the task.", "format": "int32", + "description": "Exit code for the task.", "type": "integer" }, "command": { @@ -2095,36 +1818,21 @@ "type": "string" } }, - "id": "ShellTask", - "description": "A task which consists of a shell command for the worker to execute.", - "type": "object" - }, - "MetricShortId": { - "type": "object", - "properties": { - "metricIndex": { - "description": "The index of the corresponding metric in\nthe ReportWorkItemStatusRequest. Required.", - "format": "int32", - "type": "integer" - }, - "shortId": { - "description": "The service-generated short identifier for the metric.", - "format": "int64", - "type": "string" - } - }, - "id": "MetricShortId", - "description": "The metric short id is returned to the user alongside an offset into\nReportWorkItemStatusRequest" + "id": "ShellTask" }, "AutoscalingEvent": { "description": "A structured message reporting an autoscaling decision made by the Dataflow\nservice.", "type": "object", "properties": { - "targetNumWorkers": { - "description": "The target number of workers the worker pool wants to resize to use.", - "format": "int64", + "time": { + "format": "google-datetime", + "description": "The time this event was emitted to indicate a new target or current\nnum_workers value.", "type": "string" }, + "description": { + "$ref": "StructuredMessage", + "description": "A message describing why the system decided to adjust the current\nnumber of workers, why it failed, or why the system decided to\nnot make any changes to the number of workers." + }, "eventType": { "enumDescriptions": [ "Default type for the enum. Value should never be returned.", @@ -2143,24 +1851,22 @@ "description": "The type of autoscaling event to report.", "type": "string" }, - "currentNumWorkers": { - "description": "The current number of workers the job has.", + "targetNumWorkers": { "format": "int64", + "description": "The target number of workers the worker pool wants to resize to use.", "type": "string" }, - "description": { - "$ref": "StructuredMessage", - "description": "A message describing why the system decided to adjust the current\nnumber of workers, why it failed, or why the system decided to\nnot make any changes to the number of workers." - }, - "time": { - "description": "The time this event was emitted to indicate a new target or current\nnum_workers value.", - "format": "google-datetime", + "currentNumWorkers": { + "format": "int64", + "description": "The current number of workers the job has.", "type": "string" } }, "id": "AutoscalingEvent" }, "TaskRunnerSettings": { + "description": "Taskrunner configuration settings.", + "type": "object", "properties": { "baseUrl": { "description": "The base URL for the taskrunner to use when accessing Google Cloud APIs.\n\nWhen workers access Google Cloud APIs, they logically do so via\nrelative URLs. If this field is specified, it supplies the base\nURL to use for resolving these relative URLs. The normative\nalgorithm used is defined by RFC 1808, \"Relative Uniform Resource\nLocators\".\n\nIf not specified, the default value is \"http://www.googleapis.com/\"", @@ -2175,17 +1881,17 @@ "type": "boolean" }, "parallelWorkerSettings": { - "description": "The settings to pass to the parallel worker harness.", - "$ref": "WorkerSettings" - }, - "taskUser": { - "description": "The UNIX user ID on the worker VM to use for tasks launched by\ntaskrunner; e.g. \"root\".", - "type": "string" + "$ref": "WorkerSettings", + "description": "The settings to pass to the parallel worker harness." }, "vmId": { "description": "The ID string of the VM.", "type": "string" }, + "taskUser": { + "description": "The UNIX user ID on the worker VM to use for tasks launched by\ntaskrunner; e.g. \"root\".", + "type": "string" + }, "alsologtostderr": { "description": "Whether to also send taskrunner log info to stderr.", "type": "boolean" @@ -2203,57 +1909,62 @@ "type": "string" }, "dataflowApiVersion": { - "type": "string", - "description": "The API version of endpoint, e.g. \"v1b3\"" + "description": "The API version of endpoint, e.g. \"v1b3\"", + "type": "string" }, "oauthScopes": { "description": "The OAuth2 scopes to be requested by the taskrunner in order to\naccess the Cloud Dataflow API.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "streamingWorkerMainClass": { - "type": "string", - "description": "The streaming worker main class name." + "description": "The streaming worker main class name.", + "type": "string" }, "logUploadLocation": { "description": "Indicates where to put logs. If this is not specified, the logs\nwill not be uploaded.\n\nThe supported resource type is:\n\nGoogle Cloud Storage:\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", "type": "string" }, "workflowFileName": { - "type": "string", - "description": "The file to store the workflow in." + "description": "The file to store the workflow in.", + "type": "string" + }, + "languageHint": { + "description": "The suggested backend language.", + "type": "string" + }, + "commandlinesFileName": { + "description": "The file to store preprocessing commands in.", + "type": "string" }, "tempStoragePrefix": { "description": "The prefix of the resources the taskrunner should use for\ntemporary storage.\n\nThe supported resource type is:\n\nGoogle Cloud Storage:\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", "type": "string" }, "baseTaskDir": { - "type": "string", - "description": "The location on the worker for task-specific subdirectories." - }, - "commandlinesFileName": { - "type": "string", - "description": "The file to store preprocessing commands in." - }, - "languageHint": { - "description": "The suggested backend language.", + "description": "The location on the worker for task-specific subdirectories.", "type": "string" } }, - "id": "TaskRunnerSettings", - "description": "Taskrunner configuration settings.", - "type": "object" + "id": "TaskRunnerSettings" }, "Position": { - "id": "Position", "description": "Position defines a position within a collection of data. The value\ncan be either the end position, a key (used with ordered\ncollections), a byte offset, or a record index.", "type": "object", "properties": { + "end": { + "description": "Position is past all other positions. Also useful for the end\nposition of an unbounded range.", + "type": "boolean" + }, + "key": { + "description": "Position is a string key, ordered lexicographically.", + "type": "string" + }, "recordIndex": { - "description": "Position is a record index.", "format": "int64", + "description": "Position is a record index.", "type": "string" }, "shufflePosition": { @@ -2265,57 +1976,50 @@ "$ref": "ConcatPosition" }, "byteOffset": { - "description": "Position is a byte offset.", "format": "int64", - "type": "string" - }, - "end": { - "description": "Position is past all other positions. Also useful for the end\nposition of an unbounded range.", - "type": "boolean" - }, - "key": { - "description": "Position is a string key, ordered lexicographically.", + "description": "Position is a byte offset.", "type": "string" } - } + }, + "id": "Position" }, "Source": { "description": "A source that records can be read and decoded from.", "type": "object", "properties": { - "codec": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The codec to use to decode data read from the source." - }, - "doesNotNeedSplitting": { - "description": "Setting this value to true hints to the framework that the source\ndoesn't need splitting, and using SourceSplitRequest on it would\nyield SOURCE_SPLIT_OUTCOME_USE_CURRENT.\n\nE.g. a file splitter may set this to true when splitting a single file\ninto a set of byte ranges of appropriate size, and set this\nto false when splitting a filepattern into individual files.\nHowever, for efficiency, a file splitter may decide to produce\nfile subranges directly from the filepattern to avoid a splitting\nround-trip.\n\nSee SourceSplitRequest for an overview of the splitting process.\n\nThis field is meaningful only in the Source objects populated\nby the user (e.g. when filling in a DerivedSource).\nSource objects supplied by the framework to the user don't have\nthis field populated.", - "type": "boolean" - }, - "spec": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The source to read from, plus its parameters.", - "type": "object" - }, "metadata": { "$ref": "SourceMetadata", "description": "Optionally, metadata for this source can be supplied right away,\navoiding a SourceGetMetadataOperation roundtrip\n(see SourceOperationRequest).\n\nThis field is meaningful only in the Source objects populated\nby the user (e.g. when filling in a DerivedSource).\nSource objects supplied by the framework to the user don't have\nthis field populated." }, "baseSpecs": { "description": "While splitting, sources may specify the produced bundles\nas differences against another source, in order to save backend-side\nmemory and allow bigger jobs. For details, see SourceSplitRequest.\nTo support this use case, the full set of parameters of the source\nis logically obtained by taking the latest explicitly specified value\nof each parameter in the order:\nbase_specs (later items win), spec (overrides anything in base_specs).", - "type": "array", "items": { "additionalProperties": { "description": "Properties of the object.", "type": "any" }, "type": "object" + }, + "type": "array" + }, + "doesNotNeedSplitting": { + "description": "Setting this value to true hints to the framework that the source\ndoesn't need splitting, and using SourceSplitRequest on it would\nyield SOURCE_SPLIT_OUTCOME_USE_CURRENT.\n\nE.g. a file splitter may set this to true when splitting a single file\ninto a set of byte ranges of appropriate size, and set this\nto false when splitting a filepattern into individual files.\nHowever, for efficiency, a file splitter may decide to produce\nfile subranges directly from the filepattern to avoid a splitting\nround-trip.\n\nSee SourceSplitRequest for an overview of the splitting process.\n\nThis field is meaningful only in the Source objects populated\nby the user (e.g. when filling in a DerivedSource).\nSource objects supplied by the framework to the user don't have\nthis field populated.", + "type": "boolean" + }, + "codec": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The codec to use to decode data read from the source.", + "type": "object" + }, + "spec": { + "description": "The source to read from, plus its parameters.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" } } }, @@ -2326,45 +2030,122 @@ "type": "object", "properties": { "lowBits": { - "description": "The low order bits: n & 0xffffffff.", "format": "uint32", + "description": "The low order bits: n & 0xffffffff.", "type": "integer" }, "highBits": { - "description": "The high order bits, including the sign: n \u003e\u003e 32.", "format": "int32", + "description": "The high order bits, including the sign: n \u003e\u003e 32.", "type": "integer" } }, "id": "SplitInt64" }, "WorkerPool": { + "description": "Describes one particular pool of Cloud Dataflow workers to be\ninstantiated by the Cloud Dataflow service in order to perform the\ncomputations required by a job. Note that a workflow job may use\nmultiple pools, in order to match the various computational\nrequirements of the various stages of the job.", "type": "object", "properties": { + "workerHarnessContainerImage": { + "description": "Required. Docker container image that executes the Cloud Dataflow worker\nharness, residing in Google Container Registry.", + "type": "string" + }, + "machineType": { + "description": "Machine type (e.g. \"n1-standard-1\"). If empty or unspecified, the\nservice will attempt to choose a reasonable default.", + "type": "string" + }, + "diskType": { + "description": "Type of root disk for VMs. If empty or unspecified, the service will\nattempt to choose a reasonable default.", + "type": "string" + }, + "kind": { + "description": "The kind of the worker pool; currently only `harness` and `shuffle`\nare supported.", + "type": "string" + }, + "dataDisks": { + "description": "Data disks that are used by a VM in this workflow.", + "items": { + "$ref": "Disk" + }, + "type": "array" + }, + "subnetwork": { + "description": "Subnetwork to which VMs will be assigned, if desired. Expected to be of\nthe form \"regions/REGION/subnetworks/SUBNETWORK\".", + "type": "string" + }, + "ipConfiguration": { + "description": "Configuration for VM IPs.", + "type": "string", + "enumDescriptions": [ + "The configuration is unknown, or unspecified.", + "Workers should have public IP addresses.", + "Workers should have private IP addresses." + ], + "enum": [ + "WORKER_IP_UNSPECIFIED", + "WORKER_IP_PUBLIC", + "WORKER_IP_PRIVATE" + ] + }, + "autoscalingSettings": { + "$ref": "AutoscalingSettings", + "description": "Settings for autoscaling of this WorkerPool." + }, + "taskrunnerSettings": { + "$ref": "TaskRunnerSettings", + "description": "Settings passed through to Google Compute Engine workers when\nusing the standard Dataflow task runner. Users should ignore\nthis field." + }, + "metadata": { + "description": "Metadata to set on the Google Compute Engine VMs.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "network": { + "description": "Network to which VMs will be assigned. If empty or unspecified,\nthe service will use the network \"default\".", + "type": "string" + }, + "defaultPackageSet": { + "description": "The default package set to install. This allows the service to\nselect a default set of packages which are useful to worker\nharnesses written in a particular language.", + "type": "string", + "enumDescriptions": [ + "The default set of packages to stage is unknown, or unspecified.", + "Indicates that no packages should be staged at the worker unless\nexplicitly specified by the job.", + "Stage packages typically useful to workers written in Java.", + "Stage pacakges typically useful to workers written in Python." + ], + "enum": [ + "DEFAULT_PACKAGE_SET_UNKNOWN", + "DEFAULT_PACKAGE_SET_NONE", + "DEFAULT_PACKAGE_SET_JAVA", + "DEFAULT_PACKAGE_SET_PYTHON" + ] + }, + "numThreadsPerWorker": { + "format": "int32", + "description": "The number of threads per worker harness. If empty or unspecified, the\nservice will choose a number of threads (according to the number of cores\non the selected machine type for batch, or 1 by convention for streaming).", + "type": "integer" + }, + "numWorkers": { + "format": "int32", + "description": "Number of Google Compute Engine workers in this pool needed to\nexecute the job. If zero or unspecified, the service will\nattempt to choose a reasonable default.", + "type": "integer" + }, "zone": { "description": "Zone to run the worker pools in. If empty or unspecified, the service\nwill attempt to choose a reasonable default.", "type": "string" }, - "numWorkers": { - "type": "integer", - "description": "Number of Google Compute Engine workers in this pool needed to\nexecute the job. If zero or unspecified, the service will\nattempt to choose a reasonable default.", - "format": "int32" - }, - "numThreadsPerWorker": { - "description": "The number of threads per worker harness. If empty or unspecified, the\nservice will choose a number of threads (according to the number of cores\non the selected machine type for batch, or 1 by convention for streaming).", - "format": "int32", - "type": "integer" - }, "diskSourceImage": { - "type": "string", - "description": "Fully qualified source image for disks." + "description": "Fully qualified source image for disks.", + "type": "string" }, "packages": { "description": "Packages to be installed on workers.", - "type": "array", "items": { "$ref": "Package" - } + }, + "type": "array" }, "teardownPolicy": { "description": "Sets the policy for determining when to turndown worker pool.\nAllowed values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and\n`TEARDOWN_NEVER`.\n`TEARDOWN_ALWAYS` means workers are always torn down regardless of whether\nthe job succeeds. `TEARDOWN_ON_SUCCESS` means workers are torn down\nif the job succeeds. `TEARDOWN_NEVER` means the workers are never torn\ndown.\n\nIf the workers are not torn down by the service, they will\ncontinue to run and use Google Compute Engine VM resources in the\nuser's project until they are explicitly terminated by the user.\nBecause of this, Google recommends using the `TEARDOWN_ALWAYS`\npolicy except for small, manually supervised test jobs.\n\nIf unknown or unspecified, the service will attempt to choose a reasonable\ndefault.", @@ -2395,92 +2176,14 @@ } }, "diskSizeGb": { - "description": "Size of root disk for VMs, in GB. If zero or unspecified, the service will\nattempt to choose a reasonable default.", "format": "int32", + "description": "Size of root disk for VMs, in GB. If zero or unspecified, the service will\nattempt to choose a reasonable default.", "type": "integer" - }, - "workerHarnessContainerImage": { - "type": "string", - "description": "Required. Docker container image that executes the Cloud Dataflow worker\nharness, residing in Google Container Registry." - }, - "diskType": { - "description": "Type of root disk for VMs. If empty or unspecified, the service will\nattempt to choose a reasonable default.", - "type": "string" - }, - "machineType": { - "description": "Machine type (e.g. \"n1-standard-1\"). If empty or unspecified, the\nservice will attempt to choose a reasonable default.", - "type": "string" - }, - "kind": { - "type": "string", - "description": "The kind of the worker pool; currently only `harness` and `shuffle`\nare supported." - }, - "dataDisks": { - "description": "Data disks that are used by a VM in this workflow.", - "type": "array", - "items": { - "$ref": "Disk" - } - }, - "subnetwork": { - "description": "Subnetwork to which VMs will be assigned, if desired. Expected to be of\nthe form \"regions/REGION/subnetworks/SUBNETWORK\".", - "type": "string" - }, - "ipConfiguration": { - "type": "string", - "enumDescriptions": [ - "The configuration is unknown, or unspecified.", - "Workers should have public IP addresses.", - "Workers should have private IP addresses." - ], - "enum": [ - "WORKER_IP_UNSPECIFIED", - "WORKER_IP_PUBLIC", - "WORKER_IP_PRIVATE" - ], - "description": "Configuration for VM IPs." - }, - "taskrunnerSettings": { - "description": "Settings passed through to Google Compute Engine workers when\nusing the standard Dataflow task runner. Users should ignore\nthis field.", - "$ref": "TaskRunnerSettings" - }, - "autoscalingSettings": { - "$ref": "AutoscalingSettings", - "description": "Settings for autoscaling of this WorkerPool." - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Metadata to set on the Google Compute Engine VMs.", - "type": "object" - }, - "defaultPackageSet": { - "enumDescriptions": [ - "The default set of packages to stage is unknown, or unspecified.", - "Indicates that no packages should be staged at the worker unless\nexplicitly specified by the job.", - "Stage packages typically useful to workers written in Java.", - "Stage pacakges typically useful to workers written in Python." - ], - "enum": [ - "DEFAULT_PACKAGE_SET_UNKNOWN", - "DEFAULT_PACKAGE_SET_NONE", - "DEFAULT_PACKAGE_SET_JAVA", - "DEFAULT_PACKAGE_SET_PYTHON" - ], - "description": "The default package set to install. This allows the service to\nselect a default set of packages which are useful to worker\nharnesses written in a particular language.", - "type": "string" - }, - "network": { - "description": "Network to which VMs will be assigned. If empty or unspecified,\nthe service will use the network \"default\".", - "type": "string" } }, - "id": "WorkerPool", - "description": "Describes one particular pool of Cloud Dataflow workers to be\ninstantiated by the Cloud Dataflow service in order to perform the\ncomputations required by a job. Note that a workflow job may use\nmultiple pools, in order to match the various computational\nrequirements of the various stages of the job." + "id": "WorkerPool" }, "SourceOperationRequest": { - "id": "SourceOperationRequest", "description": "A work item that represents the different operations that can be\nperformed on a user-defined Source specification.", "type": "object", "properties": { @@ -2489,20 +2192,16 @@ "$ref": "SourceSplitRequest" }, "getMetadata": { - "description": "Information about a request to get metadata about a source.", - "$ref": "SourceGetMetadataRequest" + "$ref": "SourceGetMetadataRequest", + "description": "Information about a request to get metadata about a source." } - } + }, + "id": "SourceOperationRequest" }, "WorkItem": { "description": "WorkItem represents basic information about a WorkItem to be executed\nin the cloud.", "type": "object", "properties": { - "initialReportIndex": { - "description": "The initial index to use when reporting the status of the WorkItem.", - "format": "int64", - "type": "string" - }, "streamingComputationTask": { "description": "Additional information for StreamingComputationTask WorkItems.", "$ref": "StreamingComputationTask" @@ -2516,8 +2215,8 @@ "type": "string" }, "id": { - "description": "Identifies this WorkItem.", "format": "int64", + "description": "Identifies this WorkItem.", "type": "string" }, "configuration": { @@ -2525,27 +2224,27 @@ "type": "string" }, "mapTask": { - "$ref": "MapTask", - "description": "Additional information for MapTask WorkItems." + "description": "Additional information for MapTask WorkItems.", + "$ref": "MapTask" }, "seqMapTask": { - "$ref": "SeqMapTask", - "description": "Additional information for SeqMapTask WorkItems." + "description": "Additional information for SeqMapTask WorkItems.", + "$ref": "SeqMapTask" }, "packages": { "description": "Any required packages that need to be fetched in order to execute\nthis WorkItem.", - "type": "array", "items": { "$ref": "Package" - } + }, + "type": "array" }, "projectId": { "description": "Identifies the cloud project this WorkItem belongs to.", "type": "string" }, "reportStatusInterval": { - "description": "Recommended reporting interval.", "format": "google-duration", + "description": "Recommended reporting interval.", "type": "string" }, "streamingSetupTask": { @@ -2561,8 +2260,13 @@ "$ref": "StreamingConfigTask" }, "leaseExpireTime": { - "description": "Time when the lease on this Work will expire.", "format": "google-datetime", + "description": "Time when the lease on this Work will expire.", + "type": "string" + }, + "initialReportIndex": { + "format": "int64", + "description": "The initial index to use when reporting the status of the WorkItem.", "type": "string" } }, @@ -2572,13 +2276,6 @@ "description": "A rich message format, including a human readable string, a key for\nidentifying the message, and structured data associated with the message for\nprogrammatic consumption.", "type": "object", "properties": { - "parameters": { - "description": "The structured data associated with this message.", - "type": "array", - "items": { - "$ref": "Parameter" - } - }, "messageKey": { "description": "Idenfier for this message type. Used by external systems to\ninternationalize or personalize message.", "type": "string" @@ -2586,6 +2283,13 @@ "messageText": { "description": "Human-readable version of message.", "type": "string" + }, + "parameters": { + "description": "The structured data associated with this message.", + "items": { + "$ref": "Parameter" + }, + "type": "array" } }, "id": "StructuredMessage" @@ -2595,12 +2299,12 @@ "type": "object", "properties": { "isInfinite": { - "type": "boolean", - "description": "Specifies whether the parallelism is infinite. If true, \"value\" is\nignored.\nInfinite parallelism means the service will assume that the work item\ncan always be split into more non-empty work items by dynamic splitting.\nThis is a work-around for lack of support for infinity by the current\nJSON-based Java RPC stack." + "description": "Specifies whether the parallelism is infinite. If true, \"value\" is\nignored.\nInfinite parallelism means the service will assume that the work item\ncan always be split into more non-empty work items by dynamic splitting.\nThis is a work-around for lack of support for infinity by the current\nJSON-based Java RPC stack.", + "type": "boolean" }, "value": { - "description": "Specifies the level of parallelism in case it is finite.", "format": "double", + "description": "Specifies the level of parallelism in case it is finite.", "type": "number" } }, @@ -2612,10 +2316,10 @@ "properties": { "cpuTime": { "description": "CPU utilization samples.", - "type": "array", "items": { "$ref": "CPUTime" - } + }, + "type": "array" } }, "id": "ResourceUtilizationReport" @@ -2633,47 +2337,47 @@ }, "computations": { "description": "The computations associated with a streaming Dataflow job.", - "type": "array", "items": { "$ref": "ComputationTopology" - } + }, + "type": "array" + }, + "persistentStateVersion": { + "format": "int32", + "description": "Version number for persistent state.", + "type": "integer" }, "dataDiskAssignments": { "description": "The disks assigned to a streaming Dataflow job.", - "type": "array", "items": { "$ref": "DataDiskAssignment" - } - }, - "persistentStateVersion": { - "description": "Version number for persistent state.", - "format": "int32", - "type": "integer" + }, + "type": "array" }, "forwardingKeyBits": { - "type": "integer", + "format": "int32", "description": "The size (in bits) of keys that will be assigned to source messages.", - "format": "int32" + "type": "integer" } }, "id": "TopologyConfig" }, "SourceSplitOptions": { + "description": "Hints for splitting a Source into bundles (parts for parallel\nprocessing) using SourceSplitRequest.", "type": "object", "properties": { "desiredBundleSizeBytes": { - "type": "string", + "format": "int64", "description": "The source should be split into a set of bundles where the estimated size\nof each is approximately this many bytes.", - "format": "int64" + "type": "string" }, "desiredShardSizeBytes": { - "description": "DEPRECATED in favor of desired_bundle_size_bytes.", "format": "int64", + "description": "DEPRECATED in favor of desired_bundle_size_bytes.", "type": "string" } }, - "id": "SourceSplitOptions", - "description": "Hints for splitting a Source into bundles (parts for parallel\nprocessing) using SourceSplitRequest." + "id": "SourceSplitOptions" }, "ReadInstruction": { "description": "An instruction that reads records.\nTakes no inputs, produces one output.", @@ -2687,6 +2391,8 @@ "id": "ReadInstruction" }, "WorkerSettings": { + "description": "Provides data to pass through to the worker harness.", + "type": "object", "properties": { "baseUrl": { "description": "The base URL for accessing Google Cloud APIs.\n\nWhen workers access Google Cloud APIs, they logically do so via\nrelative URLs. If this field is specified, it supplies the base\nURL to use for resolving these relative URLs. The normative\nalgorithm used is defined by RFC 1808, \"Relative Uniform Resource\nLocators\".\n\nIf not specified, the default value is \"http://www.googleapis.com/\"", @@ -2713,9 +2419,7 @@ "type": "string" } }, - "id": "WorkerSettings", - "description": "Provides data to pass through to the worker harness.", - "type": "object" + "id": "WorkerSettings" }, "StreamingStageLocation": { "description": "Identifies the location of a streaming computation stage, for\nstage-to-stage communication.", @@ -2729,22 +2433,22 @@ "id": "StreamingStageLocation" }, "DataDiskAssignment": { + "description": "Data disk assignment for a given VM instance.", + "type": "object", "properties": { + "dataDisks": { + "description": "Mounted data disks. The order is important a data disk's 0-based index in\nthis list defines which persistent directory the disk is mounted to, for\nexample the list of { \"myproject-1014-104817-4c2-harness-0-disk-0\" },\n{ \"myproject-1014-104817-4c2-harness-0-disk-1\" }.", + "items": { + "type": "string" + }, + "type": "array" + }, "vmInstance": { "description": "VM instance name the data disks mounted to, for example\n\"myproject-1014-104817-4c2-harness-0\".", "type": "string" - }, - "dataDisks": { - "description": "Mounted data disks. The order is important a data disk's 0-based index in\nthis list defines which persistent directory the disk is mounted to, for\nexample the list of { \"myproject-1014-104817-4c2-harness-0-disk-0\" },\n{ \"myproject-1014-104817-4c2-harness-0-disk-1\" }.", - "type": "array", - "items": { - "type": "string" - } } }, - "id": "DataDiskAssignment", - "description": "Data disk assignment for a given VM instance.", - "type": "object" + "id": "DataDiskAssignment" }, "ApproximateSplitRequest": { "description": "A suggestion by the service to the worker to dynamically split the WorkItem.", @@ -2755,8 +2459,8 @@ "description": "A Position at which to split the work item." }, "fractionConsumed": { - "description": "A fraction at which to split the work item, from 0.0 (beginning of the\ninput) to 1.0 (end of the input).", "format": "double", + "description": "A fraction at which to split the work item, from 0.0 (beginning of the\ninput) to 1.0 (end of the input).", "type": "number" } }, @@ -2766,54 +2470,34 @@ "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - }, "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" } - } + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" } }, "id": "Status" }, "ExecutionStageState": { + "description": "A message describing the state of a particular execution stage.", + "type": "object", "properties": { - "executionStageName": { - "description": "The name of the execution stage.", - "type": "string" - }, - "currentStateTime": { - "description": "The time at which the stage transitioned to this state.", - "format": "google-datetime", - "type": "string" - }, "executionStageState": { - "enum": [ - "JOB_STATE_UNKNOWN", - "JOB_STATE_STOPPED", - "JOB_STATE_RUNNING", - "JOB_STATE_DONE", - "JOB_STATE_FAILED", - "JOB_STATE_CANCELLED", - "JOB_STATE_UPDATED", - "JOB_STATE_DRAINING", - "JOB_STATE_DRAINED", - "JOB_STATE_PENDING", - "JOB_STATE_CANCELLING" - ], "description": "Executions stage states allow the same set of values as JobState.", "type": "string", "enumDescriptions": [ @@ -2828,32 +2512,52 @@ "`JOB_STATE_DRAINED` indicates that the job has been drained.\nA drained job terminated by stopping pulling from its input sources and\nprocessing any data that remained in-flight when draining was requested.\nThis state is a terminal state, may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_DRAINING`.", "'JOB_STATE_PENDING' indicates that the job has been created but is not yet\nrunning. Jobs that are pending may only transition to `JOB_STATE_RUNNING`,\nor `JOB_STATE_FAILED`.", "'JOB_STATE_CANCELLING' indicates that the job has been explicitly cancelled\nand is in the process of stopping. Jobs that are cancelling may only\ntransition to 'JOB_STATE_CANCELLED' or 'JOB_STATE_FAILED'." + ], + "enum": [ + "JOB_STATE_UNKNOWN", + "JOB_STATE_STOPPED", + "JOB_STATE_RUNNING", + "JOB_STATE_DONE", + "JOB_STATE_FAILED", + "JOB_STATE_CANCELLED", + "JOB_STATE_UPDATED", + "JOB_STATE_DRAINING", + "JOB_STATE_DRAINED", + "JOB_STATE_PENDING", + "JOB_STATE_CANCELLING" ] + }, + "executionStageName": { + "description": "The name of the execution stage.", + "type": "string" + }, + "currentStateTime": { + "format": "google-datetime", + "description": "The time at which the stage transitioned to this state.", + "type": "string" } }, - "id": "ExecutionStageState", - "description": "A message describing the state of a particular execution stage.", - "type": "object" + "id": "ExecutionStageState" }, "StreamLocation": { "description": "Describes a stream of data, either as input to be processed or as\noutput of a streaming Dataflow job.", "type": "object", "properties": { "customSourceLocation": { - "description": "The stream is a custom source.", - "$ref": "CustomSourceLocation" - }, - "streamingStageLocation": { - "description": "The stream is part of another computation within the current\nstreaming Dataflow job.", - "$ref": "StreamingStageLocation" - }, - "pubsubLocation": { - "$ref": "PubsubLocation", - "description": "The stream is a pubsub stream." + "$ref": "CustomSourceLocation", + "description": "The stream is a custom source." }, "sideInputLocation": { "$ref": "StreamingSideInputLocation", "description": "The stream is a streaming side input." + }, + "pubsubLocation": { + "description": "The stream is a pubsub stream.", + "$ref": "PubsubLocation" + }, + "streamingStageLocation": { + "description": "The stream is part of another computation within the current\nstreaming Dataflow job.", + "$ref": "StreamingStageLocation" } }, "id": "StreamLocation" @@ -2864,45 +2568,56 @@ "properties": { "workerMessageResponses": { "description": "The servers response to the worker messages.", - "type": "array", "items": { "$ref": "WorkerMessageResponse" - } + }, + "type": "array" } }, "id": "SendWorkerMessagesResponse" }, "StreamingComputationConfig": { + "description": "Configuration information for a single streaming computation.", "type": "object", "properties": { "computationId": { "description": "Unique identifier for this computation.", "type": "string" }, - "systemName": { - "description": "System defined name for this computation.", - "type": "string" - }, "stageName": { "description": "Stage name of this computation.", "type": "string" }, + "systemName": { + "description": "System defined name for this computation.", + "type": "string" + }, "instructions": { "description": "Instructions that comprise the computation.", - "type": "array", "items": { "$ref": "ParallelInstruction" - } + }, + "type": "array" } }, - "id": "StreamingComputationConfig", - "description": "Configuration information for a single streaming computation." + "id": "StreamingComputationConfig" }, "TransformSummary": { "description": "Description of the type, names/ids, and input/outputs for a transform.", "type": "object", "properties": { "kind": { + "enumDescriptions": [ + "Unrecognized transform type.", + "ParDo transform.", + "Group By Key transform.", + "Flatten transform.", + "Read transform.", + "Write transform.", + "Constructs from a constant value, such as with Create.of.", + "Creates a Singleton view of a collection.", + "Opening or closing a shuffle session, often as part of a GroupByKey." + ], "enum": [ "UNKNOWN_KIND", "PAR_DO_KIND", @@ -2915,25 +2630,14 @@ "SHUFFLE_KIND" ], "description": "Type of transform.", - "type": "string", - "enumDescriptions": [ - "Unrecognized transform type.", - "ParDo transform.", - "Group By Key transform.", - "Flatten transform.", - "Read transform.", - "Write transform.", - "Constructs from a constant value, such as with Create.of.", - "Creates a Singleton view of a collection.", - "Opening or closing a shuffle session, often as part of a GroupByKey." - ] + "type": "string" }, "inputCollectionName": { "description": "User names for all collection inputs to this transform.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "name": { "description": "User provided name for this transform instance.", @@ -2945,47 +2649,61 @@ }, "displayData": { "description": "Transform-specific display data.", - "type": "array", "items": { "$ref": "DisplayData" - } + }, + "type": "array" }, "outputCollectionName": { "description": "User names for all collection outputs to this transform.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "TransformSummary" }, "LeaseWorkItemResponse": { + "description": "Response to a request to lease WorkItems.", + "type": "object", "properties": { "workItems": { "description": "A list of the leased WorkItems.", - "type": "array", "items": { "$ref": "WorkItem" + }, + "type": "array" + } + }, + "id": "LeaseWorkItemResponse" + }, + "LaunchTemplateParameters": { + "description": "Parameters to provide to the template being launched.", + "type": "object", + "properties": { + "jobName": { + "description": "Required. The job name to use for the created job.", + "type": "string" + }, + "environment": { + "description": "The runtime environment for the job.", + "$ref": "RuntimeEnvironment" + }, + "parameters": { + "description": "The runtime parameters to pass to the job.", + "type": "object", + "additionalProperties": { + "type": "string" } } }, - "id": "LeaseWorkItemResponse", - "description": "Response to a request to lease WorkItems.", - "type": "object" + "id": "LaunchTemplateParameters" }, "Sink": { "description": "A sink that records can be encoded and written to.", "type": "object", "properties": { - "spec": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The sink to write to, plus its parameters.", - "type": "object" - }, "codec": { "additionalProperties": { "description": "Properties of the object.", @@ -2993,31 +2711,17 @@ }, "description": "The codec to use to encode data written to the sink.", "type": "object" - } - }, - "id": "Sink" - }, - "LaunchTemplateParameters": { - "description": "Parameters to provide to the template being launched.", - "type": "object", - "properties": { - "jobName": { - "type": "string", - "description": "Required. The job name to use for the created job." }, - "environment": { - "$ref": "RuntimeEnvironment", - "description": "The runtime environment for the job." - }, - "parameters": { + "spec": { "additionalProperties": { - "type": "string" + "description": "Properties of the object.", + "type": "any" }, - "description": "The runtime parameters to pass to the job.", + "description": "The sink to write to, plus its parameters.", "type": "object" } }, - "id": "LaunchTemplateParameters" + "id": "Sink" }, "FlattenInstruction": { "description": "An instruction that copies its inputs (zero or more) to its (single) output.", @@ -3025,38 +2729,29 @@ "properties": { "inputs": { "description": "Describes the inputs to the flatten instruction.", - "type": "array", "items": { "$ref": "InstructionInput" - } + }, + "type": "array" } }, "id": "FlattenInstruction" }, "PartialGroupByKeyInstruction": { + "description": "An instruction that does a partial group-by-key.\nOne input and one output.", + "type": "object", "properties": { - "sideInputs": { - "description": "Zero or more side inputs.", - "type": "array", - "items": { - "$ref": "SideInputInfo" - } - }, - "originalCombineValuesStepName": { - "description": "If this instruction includes a combining function, this is the name of the\nCombineValues instruction lifted into this instruction.", - "type": "string" - }, "input": { - "description": "Describes the input to the partial group-by-key instruction.", - "$ref": "InstructionInput" + "$ref": "InstructionInput", + "description": "Describes the input to the partial group-by-key instruction." }, "inputElementCodec": { + "description": "The codec to use for interpreting an element in the input PTable.", + "type": "object", "additionalProperties": { "description": "Properties of the object.", "type": "any" - }, - "description": "The codec to use for interpreting an element in the input PTable.", - "type": "object" + } }, "valueCombiningFn": { "additionalProperties": { @@ -3069,40 +2764,32 @@ "originalCombineValuesInputStoreName": { "description": "If this instruction includes a combining function this is the name of the\nintermediate store between the GBK and the CombineValues.", "type": "string" - } - }, - "id": "PartialGroupByKeyInstruction", - "description": "An instruction that does a partial group-by-key.\nOne input and one output.", - "type": "object" - }, - "InstructionInput": { - "properties": { - "producerInstructionIndex": { - "description": "The index (origin zero) of the parallel instruction that produces\nthe output to be consumed by this input. This index is relative\nto the list of instructions in this input's instruction's\ncontaining MapTask.", - "format": "int32", - "type": "integer" }, - "outputNum": { - "description": "The output index (origin zero) within the producer.", - "format": "int32", - "type": "integer" + "originalCombineValuesStepName": { + "description": "If this instruction includes a combining function, this is the name of the\nCombineValues instruction lifted into this instruction.", + "type": "string" + }, + "sideInputs": { + "description": "Zero or more side inputs.", + "items": { + "$ref": "SideInputInfo" + }, + "type": "array" } }, - "id": "InstructionInput", - "description": "An input of an instruction, as a reference to an output of a\nproducer instruction.", - "type": "object" + "id": "PartialGroupByKeyInstruction" }, "StageSource": { "description": "Description of an input or output of an execution stage.", "type": "object", "properties": { - "name": { - "description": "Dataflow service generated name for this source.", + "sizeBytes": { + "format": "int64", + "description": "Size of the source, if measurable.", "type": "string" }, - "sizeBytes": { - "description": "Size of the source, if measurable.", - "format": "int64", + "name": { + "description": "Dataflow service generated name for this source.", "type": "string" }, "userName": { @@ -3116,16 +2803,33 @@ }, "id": "StageSource" }, + "InstructionInput": { + "description": "An input of an instruction, as a reference to an output of a\nproducer instruction.", + "type": "object", + "properties": { + "outputNum": { + "format": "int32", + "description": "The output index (origin zero) within the producer.", + "type": "integer" + }, + "producerInstructionIndex": { + "format": "int32", + "description": "The index (origin zero) of the parallel instruction that produces\nthe output to be consumed by this input. This index is relative\nto the list of instructions in this input's instruction's\ncontaining MapTask.", + "type": "integer" + } + }, + "id": "InstructionInput" + }, "StringList": { "description": "A metric value representing a list of strings.", "type": "object", "properties": { "elements": { "description": "Elements of the list.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "StringList" @@ -3134,18 +2838,31 @@ "description": "Data provided with a pipeline or transform to provide descriptive info.", "type": "object", "properties": { + "timestampValue": { + "format": "google-datetime", + "description": "Contains value if the data is of timestamp type.", + "type": "string" + }, + "javaClassValue": { + "description": "Contains value if the data is of java class type.", + "type": "string" + }, + "boolValue": { + "description": "Contains value if the data is of a boolean type.", + "type": "boolean" + }, "strValue": { "description": "Contains value if the data is of string type.", "type": "string" }, - "durationValue": { - "description": "Contains value if the data is of duration type.", - "format": "google-duration", + "int64Value": { + "format": "int64", + "description": "Contains value if the data is of int64 type.", "type": "string" }, - "int64Value": { - "description": "Contains value if the data is of int64 type.", - "format": "int64", + "durationValue": { + "format": "google-duration", + "description": "Contains value if the data is of duration type.", "type": "string" }, "namespace": { @@ -3153,8 +2870,8 @@ "type": "string" }, "floatValue": { - "description": "Contains value if the data is of float type.", "format": "float", + "description": "Contains value if the data is of float type.", "type": "number" }, "key": { @@ -3172,19 +2889,6 @@ "url": { "description": "An optional full URL.", "type": "string" - }, - "timestampValue": { - "description": "Contains value if the data is of timestamp type.", - "format": "google-datetime", - "type": "string" - }, - "boolValue": { - "description": "Contains value if the data is of a boolean type.", - "type": "boolean" - }, - "javaClassValue": { - "description": "Contains value if the data is of java class type.", - "type": "string" } }, "id": "DisplayData" @@ -3193,10 +2897,6 @@ "description": "Request to get updated debug configuration for component.", "type": "object", "properties": { - "location": { - "description": "The location which contains the job specified by job_id.", - "type": "string" - }, "componentId": { "description": "The internal component id for which debug configuration is\nrequested.", "type": "string" @@ -3204,65 +2904,70 @@ "workerId": { "description": "The worker id, i.e., VM hostname.", "type": "string" + }, + "location": { + "description": "The location which contains the job specified by job_id.", + "type": "string" } }, "id": "GetDebugConfigRequest" }, "LeaseWorkItemRequest": { + "description": "Request to lease WorkItems.", "type": "object", "properties": { - "workerCapabilities": { - "description": "Worker capabilities. WorkItems might be limited to workers with specific\ncapabilities.", - "type": "array", - "items": { - "type": "string" - } - }, - "workerId": { - "type": "string", - "description": "Identifies the worker leasing work -- typically the ID of the\nvirtual machine running the worker." - }, - "requestedLeaseDuration": { - "description": "The initial lease period.", - "format": "google-duration", - "type": "string" - }, "currentWorkerTime": { - "description": "The current timestamp at the worker.", "format": "google-datetime", + "description": "The current timestamp at the worker.", "type": "string" }, - "workItemTypes": { - "description": "Filter for WorkItem type.", - "type": "array", - "items": { - "type": "string" - } - }, "location": { "description": "The location which contains the WorkItem's job.", "type": "string" + }, + "workItemTypes": { + "description": "Filter for WorkItem type.", + "items": { + "type": "string" + }, + "type": "array" + }, + "workerCapabilities": { + "description": "Worker capabilities. WorkItems might be limited to workers with specific\ncapabilities.", + "items": { + "type": "string" + }, + "type": "array" + }, + "workerId": { + "description": "Identifies the worker leasing work -- typically the ID of the\nvirtual machine running the worker.", + "type": "string" + }, + "requestedLeaseDuration": { + "format": "google-duration", + "description": "The initial lease period.", + "type": "string" } }, - "id": "LeaseWorkItemRequest", - "description": "Request to lease WorkItems." + "id": "LeaseWorkItemRequest" }, "GetTemplateResponse": { "description": "The response to a GetTemplate request.", "type": "object", "properties": { - "status": { - "$ref": "Status", - "description": "The status of the get template request. Any problems with the\nrequest will be indicated in the error_details." - }, "metadata": { - "description": "The template metadata describing the template name, available\nparameters, etc.", - "$ref": "TemplateMetadata" + "$ref": "TemplateMetadata", + "description": "The template metadata describing the template name, available\nparameters, etc." + }, + "status": { + "description": "The status of the get template request. Any problems with the\nrequest will be indicated in the error_details.", + "$ref": "Status" } }, "id": "GetTemplateResponse" }, "Parameter": { + "description": "Structured data associated with this message.", "type": "object", "properties": { "value": { @@ -3274,86 +2979,57 @@ "type": "string" } }, - "id": "Parameter", - "description": "Structured data associated with this message." + "id": "Parameter" }, "ReportWorkItemStatusRequest": { "description": "Request to report the status of WorkItems.", "type": "object", "properties": { + "currentWorkerTime": { + "format": "google-datetime", + "description": "The current timestamp at the worker.", + "type": "string" + }, "workerId": { "description": "The ID of the worker reporting the WorkItem status. If this\ndoes not match the ID of the worker which the Dataflow service\nbelieves currently has the lease on the WorkItem, the report\nwill be dropped (with an error response).", "type": "string" }, - "currentWorkerTime": { - "type": "string", - "description": "The current timestamp at the worker.", - "format": "google-datetime" - }, "location": { "description": "The location which contains the WorkItem's job.", "type": "string" }, "workItemStatuses": { "description": "The order is unimportant, except that the order of the\nWorkItemServiceState messages in the ReportWorkItemStatusResponse\ncorresponds to the order of WorkItemStatus messages here.", - "type": "array", "items": { "$ref": "WorkItemStatus" - } + }, + "type": "array" } }, "id": "ReportWorkItemStatusRequest" }, - "PipelineDescription": { - "properties": { - "displayData": { - "description": "Pipeline level display data.", - "type": "array", - "items": { - "$ref": "DisplayData" - } - }, - "executionPipelineStage": { - "description": "Description of each stage of execution of the pipeline.", - "type": "array", - "items": { - "$ref": "ExecutionStageSummary" - } - }, - "originalPipelineTransform": { - "description": "Description of each transform in the pipeline and collections between them.", - "type": "array", - "items": { - "$ref": "TransformSummary" - } - } - }, - "id": "PipelineDescription", - "description": "A descriptive representation of submitted pipeline as well as the executed\nform. This data is provided by the Dataflow service for ease of visualizing\nthe pipeline and interpretting Dataflow provided metrics.", - "type": "object" - }, "StreamingConfigTask": { "description": "A task that carries configuration information for streaming computations.", "type": "object", "properties": { "userStepToStateFamilyNameMap": { - "description": "Map from user step names to state families.", - "type": "object", "additionalProperties": { "type": "string" - } + }, + "description": "Map from user step names to state families.", + "type": "object" }, "windmillServicePort": { - "description": "If present, the worker must use this port to communicate with Windmill\nService dispatchers. Only applicable when windmill_service_endpoint is\nspecified.", "format": "int64", + "description": "If present, the worker must use this port to communicate with Windmill\nService dispatchers. Only applicable when windmill_service_endpoint is\nspecified.", "type": "string" }, "streamingComputationConfigs": { "description": "Set of computation configuration information.", - "type": "array", "items": { "$ref": "StreamingComputationConfig" - } + }, + "type": "array" }, "windmillServiceEndpoint": { "description": "If present, the worker must use this endpoint to communicate with Windmill\nService dispatchers, otherwise the worker must continue to use whatever\nendpoint it had been using.", @@ -3362,27 +3038,41 @@ }, "id": "StreamingConfigTask" }, - "JobExecutionInfo": { - "description": "Additional information about how a Cloud Dataflow job will be executed that\nisn't contained in the submitted job.", + "PipelineDescription": { + "description": "A descriptive representation of submitted pipeline as well as the executed\nform. This data is provided by the Dataflow service for ease of visualizing\nthe pipeline and interpretting Dataflow provided metrics.", "type": "object", "properties": { - "stages": { - "additionalProperties": { - "$ref": "JobExecutionStageInfo" + "originalPipelineTransform": { + "description": "Description of each transform in the pipeline and collections between them.", + "items": { + "$ref": "TransformSummary" }, - "description": "A mapping from each stage to the information about that stage.", - "type": "object" + "type": "array" + }, + "displayData": { + "description": "Pipeline level display data.", + "items": { + "$ref": "DisplayData" + }, + "type": "array" + }, + "executionPipelineStage": { + "description": "Description of each stage of execution of the pipeline.", + "items": { + "$ref": "ExecutionStageSummary" + }, + "type": "array" } }, - "id": "JobExecutionInfo" + "id": "PipelineDescription" }, "Step": { "description": "Defines a particular step within a Cloud Dataflow job.\n\nA job consists of multiple steps, each of which performs some\nspecific operation as part of the overall job. Data is typically\npassed from one step to another as part of the job.\n\nHere's an example of a sequence of steps which together implement a\nMap-Reduce job:\n\n * Read a collection of data from some source, parsing the\n collection's elements.\n\n * Validate the elements.\n\n * Apply a user-defined function to map each element to some value\n and extract an element-specific key value.\n\n * Group elements with the same key into a single element with\n that key, transforming a multiply-keyed collection into a\n uniquely-keyed collection.\n\n * Write the elements out to some data sink.\n\nNote that the Cloud Dataflow service may be used to run many different\ntypes of jobs, not just Map-Reduce.", "type": "object", "properties": { "kind": { - "type": "string", - "description": "The kind of step in the Cloud Dataflow job." + "description": "The kind of step in the Cloud Dataflow job.", + "type": "string" }, "properties": { "additionalProperties": { @@ -3399,8 +3089,21 @@ }, "id": "Step" }, + "JobExecutionInfo": { + "description": "Additional information about how a Cloud Dataflow job will be executed that\nisn't contained in the submitted job.", + "type": "object", + "properties": { + "stages": { + "additionalProperties": { + "$ref": "JobExecutionStageInfo" + }, + "description": "A mapping from each stage to the information about that stage.", + "type": "object" + } + }, + "id": "JobExecutionInfo" + }, "FailedLocation": { - "id": "FailedLocation", "description": "Indicates which location failed to respond to a request for data.", "type": "object", "properties": { @@ -3408,20 +3111,21 @@ "description": "The name of the failed location.", "type": "string" } - } + }, + "id": "FailedLocation" }, "Disk": { "description": "Describes the data disk used by a workflow job.", "type": "object", "properties": { - "sizeGb": { - "type": "integer", - "description": "Size of disk in GB. If zero or unspecified, the service will\nattempt to choose a reasonable default.", - "format": "int32" - }, "diskType": { - "type": "string", - "description": "Disk storage type, as defined by Google Compute Engine. This\nmust be a disk type appropriate to the project and zone in which\nthe workers will run. If unknown or unspecified, the service\nwill attempt to choose a reasonable default.\n\nFor example, the standard persistent disk type is a resource name\ntypically ending in \"pd-standard\". If SSD persistent disks are\navailable, the resource name typically ends with \"pd-ssd\". The\nactual valid values are defined the Google Compute Engine API,\nnot by the Cloud Dataflow API; consult the Google Compute Engine\ndocumentation for more information about determining the set of\navailable disk types for a particular project and zone.\n\nGoogle Compute Engine Disk types are local to a particular\nproject in a particular zone, and so the resource name will\ntypically look something like this:\n\ncompute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard" + "description": "Disk storage type, as defined by Google Compute Engine. This\nmust be a disk type appropriate to the project and zone in which\nthe workers will run. If unknown or unspecified, the service\nwill attempt to choose a reasonable default.\n\nFor example, the standard persistent disk type is a resource name\ntypically ending in \"pd-standard\". If SSD persistent disks are\navailable, the resource name typically ends with \"pd-ssd\". The\nactual valid values are defined the Google Compute Engine API,\nnot by the Cloud Dataflow API; consult the Google Compute Engine\ndocumentation for more information about determining the set of\navailable disk types for a particular project and zone.\n\nGoogle Compute Engine Disk types are local to a particular\nproject in a particular zone, and so the resource name will\ntypically look something like this:\n\ncompute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard", + "type": "string" + }, + "sizeGb": { + "format": "int32", + "description": "Size of disk in GB. If zero or unspecified, the service will\nattempt to choose a reasonable default.", + "type": "integer" }, "mountPoint": { "description": "Directory in a VM where disk is mounted.", @@ -3430,13 +3134,38 @@ }, "id": "Disk" }, + "ListJobMessagesResponse": { + "description": "Response to a request to list job messages.", + "type": "object", + "properties": { + "autoscalingEvents": { + "description": "Autoscaling events in ascending timestamp order.", + "items": { + "$ref": "AutoscalingEvent" + }, + "type": "array" + }, + "jobMessages": { + "description": "Messages in ascending timestamp order.", + "items": { + "$ref": "JobMessage" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The token to obtain the next page of results if there are more.", + "type": "string" + } + }, + "id": "ListJobMessagesResponse" + }, "CounterMetadata": { "description": "CounterMetadata includes all static non-name non-value counter attributes.", "type": "object", "properties": { - "otherUnits": { - "type": "string", - "description": "A string referring to the unit type." + "description": { + "description": "Human-readable description of the counter semantics.", + "type": "string" }, "kind": { "description": "Counter aggregation kind.", @@ -3464,21 +3193,7 @@ "DISTRIBUTION" ] }, - "description": { - "description": "Human-readable description of the counter semantics.", - "type": "string" - }, "standardUnits": { - "enum": [ - "BYTES", - "BYTES_PER_SEC", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS", - "TIMESTAMP_MSEC", - "TIMESTAMP_USEC", - "TIMESTAMP_NSEC" - ], "description": "System defined Units, see above enum.", "type": "string", "enumDescriptions": [ @@ -3490,56 +3205,45 @@ "Counter returns a timestamp in milliseconds.", "Counter returns a timestamp in microseconds.", "Counter returns a timestamp in nanoseconds." + ], + "enum": [ + "BYTES", + "BYTES_PER_SEC", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS", + "TIMESTAMP_MSEC", + "TIMESTAMP_USEC", + "TIMESTAMP_NSEC" ] - } - }, - "id": "CounterMetadata" - }, - "ListJobMessagesResponse": { - "type": "object", - "properties": { - "autoscalingEvents": { - "description": "Autoscaling events in ascending timestamp order.", - "type": "array", - "items": { - "$ref": "AutoscalingEvent" - } }, - "jobMessages": { - "type": "array", - "items": { - "$ref": "JobMessage" - }, - "description": "Messages in ascending timestamp order." - }, - "nextPageToken": { - "description": "The token to obtain the next page of results if there are more.", + "otherUnits": { + "description": "A string referring to the unit type.", "type": "string" } }, - "id": "ListJobMessagesResponse", - "description": "Response to a request to list job messages." + "id": "CounterMetadata" }, "ApproximateReportedProgress": { "description": "A progress measurement of a WorkItem by a worker.", "type": "object", "properties": { + "consumedParallelism": { + "$ref": "ReportedParallelism", + "description": "Total amount of parallelism in the portion of input of this task that has\nalready been consumed and is no longer active. In the first two examples\nabove (see remaining_parallelism), the value should be 29 or 2\nrespectively. The sum of remaining_parallelism and consumed_parallelism\nshould equal the total amount of parallelism in this work item. If\nspecified, must be finite." + }, "remainingParallelism": { "description": "Total amount of parallelism in the input of this task that remains,\n(i.e. can be delegated to this task and any new tasks via dynamic\nsplitting). Always at least 1 for non-finished work items and 0 for\nfinished.\n\n\"Amount of parallelism\" refers to how many non-empty parts of the input\ncan be read in parallel. This does not necessarily equal number\nof records. An input that can be read in parallel down to the\nindividual records is called \"perfectly splittable\".\nAn example of non-perfectly parallelizable input is a block-compressed\nfile format where a block of records has to be read as a whole,\nbut different blocks can be read in parallel.\n\nExamples:\n* If we are processing record #30 (starting at 1) out of 50 in a perfectly\n splittable 50-record input, this value should be 21 (20 remaining + 1\n current).\n* If we are reading through block 3 in a block-compressed file consisting\n of 5 blocks, this value should be 3 (since blocks 4 and 5 can be\n processed in parallel by new tasks via dynamic splitting and the current\n task remains processing block 3).\n* If we are reading through the last block in a block-compressed file,\n or reading or processing the last record in a perfectly splittable\n input, this value should be 1, because apart from the current task, no\n additional remainder can be split off.", "$ref": "ReportedParallelism" }, "position": { - "$ref": "Position", - "description": "A Position within the work to represent a progress." + "description": "A Position within the work to represent a progress.", + "$ref": "Position" }, "fractionConsumed": { - "type": "number", + "format": "double", "description": "Completion as fraction of the input consumed, from 0.0 (beginning, nothing\nconsumed), to 1.0 (end of the input, entire input consumed).", - "format": "double" - }, - "consumedParallelism": { - "description": "Total amount of parallelism in the portion of input of this task that has\nalready been consumed and is no longer active. In the first two examples\nabove (see remaining_parallelism), the value should be 29 or 2\nrespectively. The sum of remaining_parallelism and consumed_parallelism\nshould equal the total amount of parallelism in this work item. If\nspecified, must be finite.", - "$ref": "ReportedParallelism" + "type": "number" } }, "id": "ApproximateReportedProgress" @@ -3550,10 +3254,10 @@ "properties": { "elements": { "description": "Elements of the list.", - "type": "array", "items": { "$ref": "SplitInt64" - } + }, + "type": "array" } }, "id": "IntegerList" @@ -3574,59 +3278,50 @@ "id": "StateFamilyConfig" }, "ResourceUtilizationReportResponse": { - "properties": {}, - "id": "ResourceUtilizationReportResponse", "description": "Service-side response to WorkerMessage reporting resource utilization.", - "type": "object" + "type": "object", + "properties": {}, + "id": "ResourceUtilizationReportResponse" }, "SourceSplitResponse": { "description": "The response to a SourceSplitRequest.", "type": "object", "properties": { "shards": { - "type": "array", + "description": "DEPRECATED in favor of bundles.", "items": { "$ref": "SourceSplitShard" }, - "description": "DEPRECATED in favor of bundles." + "type": "array" }, "outcome": { + "enumDescriptions": [ + "The source split outcome is unknown, or unspecified.", + "The current source should be processed \"as is\" without splitting.", + "Splitting produced a list of bundles." + ], "enum": [ "SOURCE_SPLIT_OUTCOME_UNKNOWN", "SOURCE_SPLIT_OUTCOME_USE_CURRENT", "SOURCE_SPLIT_OUTCOME_SPLITTING_HAPPENED" ], "description": "Indicates whether splitting happened and produced a list of bundles.\nIf this is USE_CURRENT_SOURCE_AS_IS, the current source should\nbe processed \"as is\" without splitting. \"bundles\" is ignored in this case.\nIf this is SPLITTING_HAPPENED, then \"bundles\" contains a list of\nbundles into which the source was split.", - "type": "string", - "enumDescriptions": [ - "The source split outcome is unknown, or unspecified.", - "The current source should be processed \"as is\" without splitting.", - "Splitting produced a list of bundles." - ] + "type": "string" }, "bundles": { "description": "If outcome is SPLITTING_HAPPENED, then this is a list of bundles\ninto which the source was split. Otherwise this field is ignored.\nThis list can be empty, which means the source represents an empty input.", - "type": "array", "items": { "$ref": "DerivedSource" - } + }, + "type": "array" } }, "id": "SourceSplitResponse" }, "ParallelInstruction": { - "id": "ParallelInstruction", "description": "Describes a particular operation comprising a MapTask.", "type": "object", "properties": { - "parDo": { - "description": "Additional information for ParDo instructions.", - "$ref": "ParDoInstruction" - }, - "read": { - "$ref": "ReadInstruction", - "description": "Additional information for Read instructions." - }, "originalName": { "description": "System-defined name for the operation in the original workflow graph.", "type": "string" @@ -3635,32 +3330,43 @@ "description": "Additional information for Flatten instructions.", "$ref": "FlattenInstruction" }, - "write": { - "description": "Additional information for Write instructions.", - "$ref": "WriteInstruction" - }, "systemName": { "description": "System-defined name of this operation.\nUnique across the workflow.", "type": "string" }, + "write": { + "$ref": "WriteInstruction", + "description": "Additional information for Write instructions." + }, "partialGroupByKey": { "$ref": "PartialGroupByKeyInstruction", "description": "Additional information for PartialGroupByKey instructions." }, "outputs": { "description": "Describes the outputs of the instruction.", - "type": "array", "items": { "$ref": "InstructionOutput" - } + }, + "type": "array" }, "name": { "description": "User-provided name of this operation.", "type": "string" + }, + "parDo": { + "description": "Additional information for ParDo instructions.", + "$ref": "ParDoInstruction" + }, + "read": { + "description": "Additional information for Read instructions.", + "$ref": "ReadInstruction" } - } + }, + "id": "ParallelInstruction" }, "Package": { + "description": "The packages that must be installed in order for a worker to run the\nsteps of the Cloud Dataflow job that will be assigned to its worker\npool.\n\nThis is the mechanism by which the Cloud Dataflow SDK causes code to\nbe loaded onto the workers. For example, the Cloud Dataflow Java SDK\nmight use this to install jars containing the user's code and all of the\nvarious dependencies (libraries, data files, etc.) required in order\nfor that code to run.", + "type": "object", "properties": { "location": { "description": "The resource to read the package from. The supported resource type is:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}\n bucket.storage.googleapis.com/", @@ -3671,9 +3377,7 @@ "type": "string" } }, - "id": "Package", - "description": "The packages that must be installed in order for a worker to run the\nsteps of the Cloud Dataflow job that will be assigned to its worker\npool.\n\nThis is the mechanism by which the Cloud Dataflow SDK causes code to\nbe loaded onto the workers. For example, the Cloud Dataflow Java SDK\nmight use this to install jars containing the user's code and all of the\nvarious dependencies (libraries, data files, etc.) required in order\nfor that code to run.", - "type": "object" + "id": "Package" }, "KeyRangeDataDiskAssignment": { "description": "Data disk assignment information for a specific key-range of a sharded\ncomputation.\nCurrently we only support UTF-8 character splits to simplify encoding into\nJSON.", @@ -3683,60 +3387,67 @@ "description": "The end (exclusive) of the key range.", "type": "string" }, - "start": { - "description": "The start (inclusive) of the key range.", - "type": "string" - }, "dataDisk": { "description": "The name of the data disk where data for this range is stored.\nThis name is local to the Google Cloud Platform project and uniquely\nidentifies the disk within that project, for example\n\"myproject-1014-104817-4c2-harness-0-disk-1\".", "type": "string" + }, + "start": { + "description": "The start (inclusive) of the key range.", + "type": "string" } }, "id": "KeyRangeDataDiskAssignment" }, "ParDoInstruction": { + "description": "An instruction that does a ParDo operation.\nTakes one main input and zero or more side inputs, and produces\nzero or more outputs.\nRuns user code.", + "type": "object", "properties": { "numOutputs": { - "description": "The number of outputs.", "format": "int32", + "description": "The number of outputs.", "type": "integer" }, "sideInputs": { "description": "Zero or more side inputs.", - "type": "array", "items": { "$ref": "SideInputInfo" - } + }, + "type": "array" }, "multiOutputInfos": { "description": "Information about each of the outputs, if user_fn is a MultiDoFn.", - "type": "array", "items": { "$ref": "MultiOutputInfo" - } + }, + "type": "array" }, "userFn": { + "description": "The user function to invoke.", + "type": "object", "additionalProperties": { "description": "Properties of the object.", "type": "any" - }, - "description": "The user function to invoke.", - "type": "object" + } }, "input": { "$ref": "InstructionInput", "description": "The input." } }, - "id": "ParDoInstruction", - "description": "An instruction that does a ParDo operation.\nTakes one main input and zero or more side inputs, and produces\nzero or more outputs.\nRuns user code.", - "type": "object" + "id": "ParDoInstruction" }, "MetricUpdate": { - "id": "MetricUpdate", "description": "Describes the state of a metric.", "type": "object", "properties": { + "cumulative": { + "description": "True if this metric is reported as the total cumulative aggregate\nvalue accumulated since the worker started working on this WorkItem.\nBy default this is false, indicating that this metric is reported\nas a delta that is not associated with any WorkItem.", + "type": "boolean" + }, + "internal": { + "description": "Worker-computed aggregate value for internal use by the Dataflow\nservice.", + "type": "any" + }, "kind": { "description": "Metric aggregation kind. The possible metric aggregation kinds are\n\"Sum\", \"Max\", \"Min\", \"Mean\", \"Set\", \"And\", \"Or\", and \"Distribution\".\nThe specified aggregation kind is case-insensitive.\n\nIf omitted, this is not an aggregated value but instead\na single metric sample value.", "type": "string" @@ -3754,13 +3465,13 @@ "type": "any" }, "updateTime": { - "description": "Timestamp associated with the metric value. Optional when workers are\nreporting work progress; it will be filled in responses from the\nmetrics API.", "format": "google-datetime", + "description": "Timestamp associated with the metric value. Optional when workers are\nreporting work progress; it will be filled in responses from the\nmetrics API.", "type": "string" }, "name": { - "$ref": "MetricStructuredName", - "description": "Name of the metric." + "description": "Name of the metric.", + "$ref": "MetricStructuredName" }, "distribution": { "description": "A struct value describing properties of a distribution of numeric values.", @@ -3769,21 +3480,36 @@ "set": { "description": "Worker-computed aggregate value for the \"Set\" aggregation kind. The only\npossible value type is a list of Values whose type can be Long, Double,\nor String, according to the metric's type. All Values in the list must\nbe of the same type.", "type": "any" - }, - "cumulative": { - "description": "True if this metric is reported as the total cumulative aggregate\nvalue accumulated since the worker started working on this WorkItem.\nBy default this is false, indicating that this metric is reported\nas a delta that is not associated with any WorkItem.", - "type": "boolean" - }, - "internal": { - "type": "any", - "description": "Worker-computed aggregate value for internal use by the Dataflow\nservice." } - } + }, + "id": "MetricUpdate" }, "CounterStructuredName": { "description": "Identifies a counter within a per-job namespace. Counters whose structured\nnames are the same get merged into a single value for the job.", "type": "object", "properties": { + "portion": { + "description": "Portion of this counter, either key or value.", + "type": "string", + "enumDescriptions": [ + "Counter portion has not been set.", + "Counter reports a key.", + "Counter reports a value." + ], + "enum": [ + "ALL", + "KEY", + "VALUE" + ] + }, + "originalStepName": { + "description": "System generated name of the original step in the user's graph, before\noptimization.", + "type": "string" + }, + "originalShuffleStepName": { + "description": "The GroupByKey step name from the original graph.", + "type": "string" + }, "workerId": { "description": "ID of a particular worker.", "type": "string" @@ -3792,6 +3518,10 @@ "description": "A string containing a more specific namespace of the counter's origin.", "type": "string" }, + "sideInput": { + "$ref": "SideInputId", + "description": "ID of a side input being read from/written to. Side inputs are identified\nby a pair of (reader, input_index). The reader is usually equal to the\noriginal name, but it may be different, if a ParDo emits it's Iterator /\nMap side input object." + }, "origin": { "enumDescriptions": [ "Counter was created by the Dataflow system.", @@ -3815,86 +3545,79 @@ "componentStepName": { "description": "Name of the optimized step being executed by the workers.", "type": "string" - }, - "portion": { - "description": "Portion of this counter, either key or value.", - "type": "string", - "enumDescriptions": [ - "Counter portion has not been set.", - "Counter reports a key.", - "Counter reports a value." - ], - "enum": [ - "ALL", - "KEY", - "VALUE" - ] - }, - "originalStepName": { - "description": "System generated name of the original step in the user's graph, before\noptimization.", - "type": "string" } }, "id": "CounterStructuredName" }, + "WorkerShutdownNotice": { + "description": "Shutdown notification from workers. This is to be sent by the shutdown\nscript of the worker VM so that the backend knows that the VM is being\nshut down.", + "type": "object", + "properties": { + "reason": { + "description": "The reason for the worker shutdown.\nCurrent possible values are:\n \"UNKNOWN\": shutdown reason is unknown.\n \"PREEMPTION\": shutdown reason is preemption.\nOther possible reasons may be added in the future.\nNote that this must match the names of the enum specified in\ngoogle3/cloud/dataflow/router/protos/cloud_worker_messages_service.proto.", + "type": "string" + } + }, + "id": "WorkerShutdownNotice" + }, "ApproximateProgress": { "description": "Obsolete in favor of ApproximateReportedProgress and ApproximateSplitRequest.", "type": "object", "properties": { + "position": { + "$ref": "Position", + "description": "Obsolete." + }, "percentComplete": { - "description": "Obsolete.", "format": "float", + "description": "Obsolete.", "type": "number" }, "remainingTime": { - "description": "Obsolete.", "format": "google-duration", - "type": "string" - }, - "position": { "description": "Obsolete.", - "$ref": "Position" + "type": "string" } }, "id": "ApproximateProgress" }, "WorkerMessageResponse": { + "description": "A worker_message response allows the server to pass information to the\nsender.", + "type": "object", "properties": { + "workerShutdownNoticeResponse": { + "$ref": "WorkerShutdownNoticeResponse", + "description": "Service's response to shutdown notice (currently empty)." + }, "workerMetricsResponse": { - "$ref": "ResourceUtilizationReportResponse", - "description": "Service's response to reporting worker metrics (currently empty)." + "description": "Service's response to reporting worker metrics (currently empty).", + "$ref": "ResourceUtilizationReportResponse" }, "workerHealthReportResponse": { "$ref": "WorkerHealthReportResponse", "description": "The service's response to a worker's health report." } }, - "id": "WorkerMessageResponse", - "description": "A worker_message response allows the server to pass information to the\nsender.", - "type": "object" + "id": "WorkerMessageResponse" }, "TemplateMetadata": { "description": "Metadata describing a template.", "type": "object", "properties": { - "name": { - "description": "Required. The name of the template.", - "type": "string" - }, - "parameters": { - "description": "The parameters for the template.", - "type": "array", - "items": { - "$ref": "ParameterMetadata" - } - }, "description": { "description": "Optional. A description of the template.", "type": "string" }, - "bypassTempDirValidation": { - "description": "If true, will bypass the validation that the temp directory is\nwritable. This should only be used with templates for pipelines\nthat are guaranteed not to need to write to the temp directory,\nwhich is subject to change based on the optimizer.", - "type": "boolean" + "parameters": { + "description": "The parameters for the template.", + "items": { + "$ref": "ParameterMetadata" + }, + "type": "array" + }, + "name": { + "description": "Required. The name of the template.", + "type": "string" } }, "id": "TemplateMetadata" @@ -3904,28 +3627,32 @@ "type": "object", "properties": { "time": { - "type": "string", + "format": "google-datetime", "description": "The timestamp of the worker_message.", - "format": "google-datetime" + "type": "string" + }, + "workerShutdownNotice": { + "$ref": "WorkerShutdownNotice", + "description": "Shutdown notice by workers." }, "workerHealthReport": { - "$ref": "WorkerHealthReport", - "description": "The health of a worker." + "description": "The health of a worker.", + "$ref": "WorkerHealthReport" }, "workerMessageCode": { - "description": "A worker message code.", - "$ref": "WorkerMessageCode" + "$ref": "WorkerMessageCode", + "description": "A worker message code." }, "workerMetrics": { - "description": "Resource metrics reported by workers.", - "$ref": "ResourceUtilizationReport" + "$ref": "ResourceUtilizationReport", + "description": "Resource metrics reported by workers." }, "labels": { - "description": "Labels are used to group WorkerMessages.\nFor example, a worker_message about a particular container\nmight have the labels:\n{ \"JOB_ID\": \"2015-04-22\",\n \"WORKER_ID\": \"wordcount-vm-2015…\"\n \"CONTAINER_TYPE\": \"worker\",\n \"CONTAINER_ID\": \"ac1234def\"}\nLabel tags typically correspond to Label enum values. However, for ease\nof development other strings can be used as tags. LABEL_UNSPECIFIED should\nnot be used here.", - "type": "object", "additionalProperties": { "type": "string" - } + }, + "description": "Labels are used to group WorkerMessages.\nFor example, a worker_message about a particular container\nmight have the labels:\n{ \"JOB_ID\": \"2015-04-22\",\n \"WORKER_ID\": \"wordcount-vm-2015…\"\n \"CONTAINER_TYPE\": \"worker\",\n \"CONTAINER_ID\": \"ac1234def\"}\nLabel tags typically correspond to Label enum values. However, for ease\nof development other strings can be used as tags. LABEL_UNSPECIFIED should\nnot be used here.", + "type": "object" } }, "id": "WorkerMessage" @@ -3934,55 +3661,57 @@ "description": "JobMetrics contains a collection of metrics descibing the detailed progress\nof a Dataflow job. Metrics correspond to user-defined and system-defined\nmetrics in the job.\n\nThis resource captures only the most recent values of each metric;\ntime-series data can be queried for them (under the same metric names)\nfrom Cloud Monitoring.", "type": "object", "properties": { - "metricTime": { - "description": "Timestamp as of which metric values are current.", - "format": "google-datetime", - "type": "string" - }, "metrics": { "description": "All metrics for this job.", - "type": "array", "items": { "$ref": "MetricUpdate" - } + }, + "type": "array" + }, + "metricTime": { + "format": "google-datetime", + "description": "Timestamp as of which metric values are current.", + "type": "string" } }, "id": "JobMetrics" }, + "WorkerShutdownNoticeResponse": { + "description": "Service-side response to WorkerMessage issuing shutdown notice.", + "type": "object", + "properties": {}, + "id": "WorkerShutdownNoticeResponse" + }, "FloatingPointList": { - "id": "FloatingPointList", "description": "A metric value representing a list of floating point numbers.", "type": "object", "properties": { "elements": { "description": "Elements of the list.", - "type": "array", "items": { "format": "double", "type": "number" - } + }, + "type": "array" } - } + }, + "id": "FloatingPointList" }, "CounterUpdate": { "description": "An update to a Counter sent from a worker.", "type": "object", "properties": { - "integer": { - "$ref": "SplitInt64", - "description": "Integer value for Sum, Max, Min." - }, - "structuredNameAndMetadata": { - "$ref": "CounterStructuredNameAndMetadata", - "description": "Counter structured name and metadata." - }, "integerList": { "description": "List of integers, for Set.", "$ref": "IntegerList" }, + "structuredNameAndMetadata": { + "description": "Counter structured name and metadata.", + "$ref": "CounterStructuredNameAndMetadata" + }, "floatingPoint": { - "description": "Floating point value for Sum, Max, Min.", "format": "double", + "description": "Floating point value for Sum, Max, Min.", "type": "number" }, "integerMean": { @@ -4006,25 +3735,29 @@ "type": "boolean" }, "nameAndKind": { - "description": "Counter name and aggregation type.", - "$ref": "NameAndKind" - }, - "stringList": { - "description": "List of strings, for Set.", - "$ref": "StringList" + "$ref": "NameAndKind", + "description": "Counter name and aggregation type." }, "distribution": { "$ref": "DistributionUpdate", "description": "Distribution data" }, + "stringList": { + "description": "List of strings, for Set.", + "$ref": "StringList" + }, "shortId": { - "description": "The service-generated short identifier for this counter.\nThe short_id -\u003e (name, metadata) mapping is constant for the lifetime of\na job.", "format": "int64", + "description": "The service-generated short identifier for this counter.\nThe short_id -\u003e (name, metadata) mapping is constant for the lifetime of\na job.", "type": "string" }, "floatingPointList": { "description": "List of floating point numbers, for Set.", "$ref": "FloatingPointList" + }, + "integer": { + "$ref": "SplitInt64", + "description": "Integer value for Sum, Max, Min." } }, "id": "CounterUpdate" @@ -4033,80 +3766,70 @@ "description": "Metadata about a Source useful for automatically optimizing\nand tuning the pipeline, etc.", "type": "object", "properties": { - "producesSortedKeys": { - "description": "Whether this source is known to produce key/value pairs with\nthe (encoded) keys in lexicographically sorted order.", - "type": "boolean" + "estimatedSizeBytes": { + "format": "int64", + "description": "An estimate of the total size (in bytes) of the data that would be\nread from this source. This estimate is in terms of external storage\nsize, before any decompression or other processing done by the reader.", + "type": "string" }, "infinite": { "description": "Specifies that the size of this source is known to be infinite\n(this is a streaming source).", "type": "boolean" }, - "estimatedSizeBytes": { - "description": "An estimate of the total size (in bytes) of the data that would be\nread from this source. This estimate is in terms of external storage\nsize, before any decompression or other processing done by the reader.", - "format": "int64", - "type": "string" + "producesSortedKeys": { + "description": "Whether this source is known to produce key/value pairs with\nthe (encoded) keys in lexicographically sorted order.", + "type": "boolean" } }, "id": "SourceMetadata" }, "DistributionUpdate": { - "id": "DistributionUpdate", "description": "A metric value representing a distribution.", "type": "object", "properties": { + "count": { + "$ref": "SplitInt64", + "description": "The count of the number of elements present in the distribution." + }, + "sumOfSquares": { + "format": "double", + "description": "Use a double since the sum of squares is likely to overflow int64.", + "type": "number" + }, "min": { "description": "The minimum value present in the distribution.", "$ref": "SplitInt64" }, - "sumOfSquares": { - "description": "Use a double since the sum of squares is likely to overflow int64.", - "format": "double", - "type": "number" - }, "sum": { "$ref": "SplitInt64", "description": "Use an int64 since we'd prefer the added precision. If overflow is a common\nproblem we can detect it and use an additional int64 or a double." }, + "histogram": { + "$ref": "Histogram", + "description": "(Optional) Histogram of value counts for the distribution." + }, "max": { "description": "The maximum value present in the distribution.", "$ref": "SplitInt64" - }, - "logBuckets": { - "description": "(Optional) Logarithmic histogram of values.\nEach log may be in no more than one bucket. Order does not matter.", - "type": "array", - "items": { - "$ref": "LogBucket" - } - }, - "count": { - "$ref": "SplitInt64", - "description": "The count of the number of elements present in the distribution." } - } + }, + "id": "DistributionUpdate" }, "WorkerHealthReportResponse": { + "description": "WorkerHealthReportResponse contains information returned to the worker\nin response to a health ping.", "type": "object", "properties": { "reportInterval": { - "description": "A positive value indicates the worker should change its reporting interval\nto the specified value.\n\nThe default value of zero means no change in report rate is requested by\nthe server.", "format": "google-duration", + "description": "A positive value indicates the worker should change its reporting interval\nto the specified value.\n\nThe default value of zero means no change in report rate is requested by\nthe server.", "type": "string" } }, - "id": "WorkerHealthReportResponse", - "description": "WorkerHealthReportResponse contains information returned to the worker\nin response to a health ping." + "id": "WorkerHealthReportResponse" }, "SourceFork": { + "description": "DEPRECATED in favor of DynamicSourceSplit.", "type": "object", "properties": { - "primary": { - "$ref": "SourceSplitShard", - "description": "DEPRECATED" - }, - "primarySource": { - "description": "DEPRECATED", - "$ref": "DerivedSource" - }, "residual": { "$ref": "SourceSplitShard", "description": "DEPRECATED" @@ -4114,62 +3837,22 @@ "residualSource": { "description": "DEPRECATED", "$ref": "DerivedSource" + }, + "primary": { + "$ref": "SourceSplitShard", + "description": "DEPRECATED" + }, + "primarySource": { + "description": "DEPRECATED", + "$ref": "DerivedSource" } }, - "id": "SourceFork", - "description": "DEPRECATED in favor of DynamicSourceSplit." + "id": "SourceFork" }, "WorkItemStatus": { "description": "Conveys a worker's progress through the work described by a WorkItem.", "type": "object", "properties": { - "counterUpdates": { - "description": "Worker output counters for this WorkItem.", - "type": "array", - "items": { - "$ref": "CounterUpdate" - } - }, - "workItemId": { - "description": "Identifies the WorkItem.", - "type": "string" - }, - "errors": { - "description": "Specifies errors which occurred during processing. If errors are\nprovided, and completed = true, then the WorkItem is considered\nto have failed.", - "type": "array", - "items": { - "$ref": "Status" - } - }, - "metricUpdates": { - "description": "DEPRECATED in favor of counter_updates.", - "type": "array", - "items": { - "$ref": "MetricUpdate" - } - }, - "dynamicSourceSplit": { - "$ref": "DynamicSourceSplit", - "description": "See documentation of stop_position." - }, - "sourceOperationResponse": { - "$ref": "SourceOperationResponse", - "description": "If the work item represented a SourceOperationRequest, and the work\nis completed, contains the result of the operation." - }, - "progress": { - "$ref": "ApproximateProgress", - "description": "DEPRECATED in favor of reported_progress." - }, - "requestedLeaseDuration": { - "description": "Amount of time the worker requests for its lease.", - "format": "google-duration", - "type": "string" - }, - "reportIndex": { - "description": "The report index. When a WorkItem is leased, the lease will\ncontain an initial report index. When a WorkItem's status is\nreported to the system, the report should be sent with\nthat report index, and the response will contain the index the\nworker should use for the next report. Reports received with\nunexpected index values will be rejected by the service.\n\nIn order to preserve idempotency, the worker should not alter the\ncontents of a report, even if the worker must submit the same\nreport multiple times before getting back a response. The worker\nshould not submit a subsequent report until the response for the\nprevious report had been received from the service.", - "format": "int64", - "type": "string" - }, "stopPosition": { "description": "A worker may split an active map task in two parts, \"primary\" and\n\"residual\", continuing to process the primary part and returning the\nresidual part into the pool of available work.\nThis event is called a \"dynamic split\" and is critical to the dynamic\nwork rebalancing feature. The two obtained sub-tasks are called\n\"parts\" of the split.\nThe parts, if concatenated, must represent the same input as would\nbe read by the current task if the split did not happen.\nThe exact way in which the original task is decomposed into the two\nparts is specified either as a position demarcating them\n(stop_position), or explicitly as two DerivedSources, if this\ntask consumes a user-defined source type (dynamic_source_split).\n\nThe \"current\" task is adjusted as a result of the split: after a task\nwith range [A, B) sends a stop_position update at C, its range is\nconsidered to be [A, C), e.g.:\n* Progress should be interpreted relative to the new range, e.g.\n \"75% completed\" means \"75% of [A, C) completed\"\n* The worker should interpret proposed_stop_position relative to the\n new range, e.g. \"split at 68%\" should be interpreted as\n \"split at 68% of [A, C)\".\n* If the worker chooses to split again using stop_position, only\n stop_positions in [A, C) will be accepted.\n* Etc.\ndynamic_source_split has similar semantics: e.g., if a task with\nsource S splits using dynamic_source_split into {P, R}\n(where P and R must be together equivalent to S), then subsequent\nprogress and proposed_stop_position should be interpreted relative\nto P, and in a potential subsequent dynamic_source_split into {P', R'},\nP' and R' must be together equivalent to P, etc.", "$ref": "Position" @@ -4183,18 +3866,68 @@ "description": "The worker's progress through this WorkItem." }, "sourceFork": { - "description": "DEPRECATED in favor of dynamic_source_split.", - "$ref": "SourceFork" + "$ref": "SourceFork", + "description": "DEPRECATED in favor of dynamic_source_split." + }, + "totalThrottlerWaitTimeSeconds": { + "format": "double", + "description": "Total time the worker spent being throttled by external systems.", + "type": "number" + }, + "counterUpdates": { + "description": "Worker output counters for this WorkItem.", + "items": { + "$ref": "CounterUpdate" + }, + "type": "array" + }, + "workItemId": { + "description": "Identifies the WorkItem.", + "type": "string" + }, + "errors": { + "description": "Specifies errors which occurred during processing. If errors are\nprovided, and completed = true, then the WorkItem is considered\nto have failed.", + "items": { + "$ref": "Status" + }, + "type": "array" + }, + "metricUpdates": { + "description": "DEPRECATED in favor of counter_updates.", + "items": { + "$ref": "MetricUpdate" + }, + "type": "array" + }, + "dynamicSourceSplit": { + "$ref": "DynamicSourceSplit", + "description": "See documentation of stop_position." + }, + "sourceOperationResponse": { + "description": "If the work item represented a SourceOperationRequest, and the work\nis completed, contains the result of the operation.", + "$ref": "SourceOperationResponse" + }, + "progress": { + "description": "DEPRECATED in favor of reported_progress.", + "$ref": "ApproximateProgress" + }, + "requestedLeaseDuration": { + "format": "google-duration", + "description": "Amount of time the worker requests for its lease.", + "type": "string" + }, + "reportIndex": { + "format": "int64", + "description": "The report index. When a WorkItem is leased, the lease will\ncontain an initial report index. When a WorkItem's status is\nreported to the system, the report should be sent with\nthat report index, and the response will contain the index the\nworker should use for the next report. Reports received with\nunexpected index values will be rejected by the service.\n\nIn order to preserve idempotency, the worker should not alter the\ncontents of a report, even if the worker must submit the same\nreport multiple times before getting back a response. The worker\nshould not submit a subsequent report until the response for the\nprevious report had been received from the service.", + "type": "string" } }, "id": "WorkItemStatus" }, "ComponentSource": { + "description": "Description of an interstitial value between transforms in an execution\nstage.", + "type": "object", "properties": { - "name": { - "description": "Dataflow service generated name for this source.", - "type": "string" - }, "userName": { "description": "Human-readable name for this transform; may be user or system generated.", "type": "string" @@ -4202,39 +3935,70 @@ "originalTransformOrCollection": { "description": "User name for the original user transform or collection with which this\nsource is most closely associated.", "type": "string" + }, + "name": { + "description": "Dataflow service generated name for this source.", + "type": "string" } }, - "id": "ComponentSource", - "description": "Description of an interstitial value between transforms in an execution\nstage.", - "type": "object" + "id": "ComponentSource" + }, + "Histogram": { + "description": "Histogram of value counts for a distribution.\n\nBuckets have an inclusive lower bound and exclusive upper bound and use\n\"1,2,5 bucketing\": The first bucket range is from [0,1) and all subsequent\nbucket boundaries are powers of ten multiplied by 1, 2, or 5. Thus, bucket\nboundaries are 0, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, ...\nNegative values are not supported.", + "type": "object", + "properties": { + "firstBucketOffset": { + "format": "int32", + "description": "Starting index of first stored bucket. The non-inclusive upper-bound of\nthe ith bucket is given by:\n pow(10,(i-first_bucket_offset)/3) * (1,2,5)[(i-first_bucket_offset)%3]", + "type": "integer" + }, + "bucketCounts": { + "description": "Counts of values in each bucket. For efficiency, prefix and trailing\nbuckets with count = 0 are elided. Buckets can store the full range of\nvalues of an unsigned long, with ULLONG_MAX falling into the 59th bucket\nwith range [1e19, 2e19).", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + } + }, + "id": "Histogram" }, "WorkItemServiceState": { "description": "The Dataflow service's idea of the current state of a WorkItem\nbeing processed by a worker.", "type": "object", "properties": { + "reportStatusInterval": { + "format": "google-duration", + "description": "New recommended reporting interval.", + "type": "string" + }, + "suggestedStopPosition": { + "$ref": "Position", + "description": "Obsolete, always empty." + }, "harnessData": { + "description": "Other data returned by the service, specific to the particular\nworker harness.", "type": "object", "additionalProperties": { - "type": "any", - "description": "Properties of the object." - }, - "description": "Other data returned by the service, specific to the particular\nworker harness." + "description": "Properties of the object.", + "type": "any" + } }, "leaseExpireTime": { - "description": "Time at which the current lease will expire.", "format": "google-datetime", + "description": "Time at which the current lease will expire.", "type": "string" }, "metricShortId": { "description": "The short ids that workers should use in subsequent metric updates.\nWorkers should strive to use short ids whenever possible, but it is ok\nto request the short_id again if a worker lost track of it\n(e.g. if the worker is recovering from a crash).\nNOTE: it is possible that the response may have short ids for a subset\nof the metrics.", - "type": "array", "items": { "$ref": "MetricShortId" - } + }, + "type": "array" }, "nextReportIndex": { - "description": "The index value to use for the next report sent by the worker.\nNote: If the report call fails for whatever reason, the worker should\nreuse this index for subsequent report attempts.", "format": "int64", + "description": "The index value to use for the next report sent by the worker.\nNote: If the report call fails for whatever reason, the worker should\nreuse this index for subsequent report attempts.", "type": "string" }, "suggestedStopPoint": { @@ -4244,15 +4008,6 @@ "splitRequest": { "$ref": "ApproximateSplitRequest", "description": "The progress point in the WorkItem where the Dataflow service\nsuggests that the worker truncate the task." - }, - "reportStatusInterval": { - "description": "New recommended reporting interval.", - "format": "google-duration", - "type": "string" - }, - "suggestedStopPosition": { - "description": "Obsolete, always empty.", - "$ref": "Position" } }, "id": "WorkItemServiceState" @@ -4261,57 +4016,61 @@ "description": "Identifies a metric, by describing the source which generated the\nmetric.", "type": "object", "properties": { - "origin": { - "description": "Origin (namespace) of metric name. May be blank for user-define metrics;\nwill be \"dataflow\" for metrics defined by the Dataflow service or SDK.", - "type": "string" - }, "name": { "description": "Worker-defined metric name.", "type": "string" }, + "origin": { + "description": "Origin (namespace) of metric name. May be blank for user-define metrics;\nwill be \"dataflow\" for metrics defined by the Dataflow service or SDK.", + "type": "string" + }, "context": { - "description": "Zero or more labeled fields which identify the part of the job this\nmetric is associated with, such as the name of a step or collection.\n\nFor example, built-in counters associated with steps will have\ncontext['step'] = \u003cstep-name\u003e. Counters associated with PCollections\nin the SDK will have context['pcollection'] = \u003cpcollection-name\u003e.", - "type": "object", "additionalProperties": { "type": "string" - } + }, + "description": "Zero or more labeled fields which identify the part of the job this\nmetric is associated with, such as the name of a step or collection.\n\nFor example, built-in counters associated with steps will have\ncontext['step'] = \u003cstep-name\u003e. Counters associated with PCollections\nin the SDK will have context['pcollection'] = \u003cpcollection-name\u003e.", + "type": "object" } }, "id": "MetricStructuredName" }, "SeqMapTaskOutputInfo": { + "description": "Information about an output of a SeqMapTask.", "type": "object", "properties": { - "tag": { - "description": "The id of the TupleTag the user code will tag the output value by.", - "type": "string" - }, "sink": { "$ref": "Sink", "description": "The sink to write the output value to." + }, + "tag": { + "description": "The id of the TupleTag the user code will tag the output value by.", + "type": "string" } }, - "id": "SeqMapTaskOutputInfo", - "description": "Information about an output of a SeqMapTask." + "id": "SeqMapTaskOutputInfo" }, "JobExecutionStageInfo": { + "description": "Contains information about how a particular\ngoogle.dataflow.v1beta3.Step will be executed.", "type": "object", "properties": { "stepName": { "description": "The steps associated with the execution stage.\nNote that stages may have several steps, and that a given step\nmight be run by more than one stage.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "JobExecutionStageInfo", - "description": "Contains information about how a particular\ngoogle.dataflow.v1beta3.Step will be executed." + "id": "JobExecutionStageInfo" }, "KeyRangeLocation": { "description": "Location information for a specific key-range of a sharded computation.\nCurrently we only support UTF-8 character splits to simplify encoding into\nJSON.", "type": "object", "properties": { + "end": { + "description": "The end (exclusive) of the key range.", + "type": "string" + }, "deprecatedPersistentDirectory": { "description": "DEPRECATED. The location of the persistent state for this range, as a\npersistent directory in the worker local filesystem.", "type": "string" @@ -4320,16 +4079,12 @@ "description": "The physical location of this range assignment to be used for\nstreaming computation cross-worker message delivery.", "type": "string" }, - "start": { - "description": "The start (inclusive) of the key range.", - "type": "string" - }, "dataDisk": { "description": "The name of the data disk where data for this range is stored.\nThis name is local to the Google Cloud Platform project and uniquely\nidentifies the disk within that project, for example\n\"myproject-1014-104817-4c2-harness-0-disk-1\".", "type": "string" }, - "end": { - "description": "The end (exclusive) of the key range.", + "start": { + "description": "The start (inclusive) of the key range.", "type": "string" } }, @@ -4340,8 +4095,8 @@ "type": "object", "properties": { "source": { - "$ref": "Source", - "description": "Specification of the source whose metadata should be computed." + "description": "Specification of the source whose metadata should be computed.", + "$ref": "Source" } }, "id": "SourceGetMetadataRequest" @@ -4350,32 +4105,28 @@ "description": "Describes a particular function to invoke.", "type": "object", "properties": { - "name": { - "type": "string", - "description": "The user-provided name of the SeqDo operation." - }, "outputInfos": { "description": "Information about each of the outputs.", - "type": "array", "items": { "$ref": "SeqMapTaskOutputInfo" - } + }, + "type": "array" }, "inputs": { "description": "Information about each of the inputs.", - "type": "array", "items": { "$ref": "SideInputInfo" - } - }, - "systemName": { - "description": "System-defined name of the SeqDo operation.\nUnique across the workflow.", - "type": "string" + }, + "type": "array" }, "stageName": { "description": "System-defined name of the stage containing the SeqDo operation.\nUnique across the workflow.", "type": "string" }, + "systemName": { + "description": "System-defined name of the SeqDo operation.\nUnique across the workflow.", + "type": "string" + }, "userFn": { "additionalProperties": { "description": "Properties of the object.", @@ -4383,6 +4134,10 @@ }, "description": "The user function to invoke.", "type": "object" + }, + "name": { + "description": "The user-provided name of the SeqDo operation.", + "type": "string" } }, "id": "SeqMapTask" @@ -4391,10 +4146,6 @@ "description": "Basic metadata about a counter.", "type": "object", "properties": { - "name": { - "description": "Name of the counter.", - "type": "string" - }, "kind": { "description": "Counter aggregation kind.", "type": "string", @@ -4420,6 +4171,10 @@ "SET", "DISTRIBUTION" ] + }, + "name": { + "description": "Name of the counter.", + "type": "string" } }, "id": "NameAndKind" @@ -4428,10 +4183,6 @@ "description": "A message code is used to report status and error messages to the service.\nThe message codes are intended to be machine readable. The service will\ntake care of translating these into user understandable messages if\nnecessary.\n\nExample use cases:\n 1. Worker processes reporting successful startup.\n 2. Worker processes reporting specific errors (e.g. package staging\n failure).", "type": "object", "properties": { - "code": { - "description": "The code is a string intended for consumption by a machine that identifies\nthe type of message being sent.\nExamples:\n 1. \"HARNESS_STARTED\" might be used to indicate the worker harness has\n started.\n 2. \"GCS_DOWNLOAD_ERROR\" might be used to indicate an error downloading\n a GCS file as part of the boot process of one of the worker containers.\n\nThis is a string and not an enum to make it easy to add new codes without\nwaiting for an API change.", - "type": "string" - }, "parameters": { "description": "Parameters contains specific information about the code.\n\nThis is a struct to allow parameters of different types.\n\nExamples:\n 1. For a \"HARNESS_STARTED\" message parameters might provide the name\n of the worker and additional data like timing information.\n 2. For a \"GCS_DOWNLOAD_ERROR\" parameters might contain fields listing\n the GCS objects being downloaded and fields containing errors.\n\nIn general complex data structures should be avoided. If a worker\nneeds to send a specific and complicated data structure then please\nconsider defining a new proto and adding it to the data oneof in\nWorkerMessageResponse.\n\nConventions:\n Parameters should only be used for information that isn't typically passed\n as a label.\n hostname and other worker identifiers should almost always be passed\n as labels since they will be included on most messages.", "type": "object", @@ -4439,11 +4190,16 @@ "description": "Properties of the object.", "type": "any" } + }, + "code": { + "description": "The code is a string intended for consumption by a machine that identifies\nthe type of message being sent.\nExamples:\n 1. \"HARNESS_STARTED\" might be used to indicate the worker harness has\n started.\n 2. \"GCS_DOWNLOAD_ERROR\" might be used to indicate an error downloading\n a GCS file as part of the boot process of one of the worker containers.\n\nThis is a string and not an enum to make it easy to add new codes without\nwaiting for an API change.", + "type": "string" } }, "id": "WorkerMessageCode" }, "CustomSourceLocation": { + "description": "Identifies the location of a custom souce.", "type": "object", "properties": { "stateful": { @@ -4451,46 +4207,45 @@ "type": "boolean" } }, - "id": "CustomSourceLocation", - "description": "Identifies the location of a custom souce." + "id": "CustomSourceLocation" }, "MapTask": { "description": "MapTask consists of an ordered set of instructions, each of which\ndescribes one particular low-level operation for the worker to\nperform in order to accomplish the MapTask's WorkItem.\n\nEach instruction must appear in the list before any instructions which\ndepends on its output.", "type": "object", "properties": { + "stageName": { + "description": "System-defined name of the stage containing this MapTask.\nUnique across the workflow.", + "type": "string" + }, "systemName": { "description": "System-defined name of this MapTask.\nUnique across the workflow.", "type": "string" }, - "stageName": { - "type": "string", - "description": "System-defined name of the stage containing this MapTask.\nUnique across the workflow." - }, "instructions": { - "type": "array", + "description": "The instructions in the MapTask.", "items": { "$ref": "ParallelInstruction" }, - "description": "The instructions in the MapTask." + "type": "array" } }, "id": "MapTask" }, "FloatingPointMean": { + "description": "A representation of a floating point mean metric contribution.", + "type": "object", "properties": { "count": { "$ref": "SplitInt64", "description": "The number of values being aggregated." }, "sum": { - "description": "The sum of all values being aggregated.", "format": "double", + "description": "The sum of all values being aggregated.", "type": "number" } }, - "id": "FloatingPointMean", - "description": "A representation of a floating point mean metric contribution.", - "type": "object" + "id": "FloatingPointMean" }, "ReportWorkItemStatusResponse": { "description": "Response from a request to report the status of WorkItems.", @@ -4498,10 +4253,10 @@ "properties": { "workItemServiceStates": { "description": "A set of messages indicating the service-side state for each\nWorkItem whose status was reported, in the same order as the\nWorkItemStatus messages in the ReportWorkItemStatusRequest which\nresulting in this response.", - "type": "array", "items": { "$ref": "WorkItemServiceState" - } + }, + "type": "array" } }, "id": "ReportWorkItemStatusResponse" @@ -4514,29 +4269,29 @@ "description": "System-defined name for this output in the original workflow graph.\nOutputs that do not contribute to an original instruction do not set this.", "type": "string" }, - "systemName": { - "description": "System-defined name of this output.\nUnique across the workflow.", - "type": "string" - }, "onlyCountKeyBytes": { "description": "For system-generated byte and mean byte metrics, certain instructions\nshould only report the key size.", "type": "boolean" }, + "systemName": { + "description": "System-defined name of this output.\nUnique across the workflow.", + "type": "string" + }, "onlyCountValueBytes": { "description": "For system-generated byte and mean byte metrics, certain instructions\nshould only report the value size.", "type": "boolean" }, "codec": { + "description": "The codec to use to encode data being written via this output.", + "type": "object", "additionalProperties": { "description": "Properties of the object.", "type": "any" - }, - "description": "The codec to use to encode data being written via this output.", - "type": "object" + } }, "name": { - "type": "string", - "description": "The user-provided name of this output." + "description": "The user-provided name of this output.", + "type": "string" } }, "id": "InstructionOutput" @@ -4545,12 +4300,20 @@ "description": "A request to create a Cloud Dataflow job from a template.", "type": "object", "properties": { + "environment": { + "description": "The runtime environment for the job.", + "$ref": "RuntimeEnvironment" + }, + "location": { + "description": "The location to which to direct the request.", + "type": "string" + }, "parameters": { - "type": "object", "additionalProperties": { "type": "string" }, - "description": "The runtime parameters to pass to the job." + "description": "The runtime parameters to pass to the job.", + "type": "object" }, "jobName": { "description": "Required. The job name to use for the created job.", @@ -4559,14 +4322,6 @@ "gcsPath": { "description": "Required. A Cloud Storage path to the template from which to\ncreate the job.\nMust be a valid Cloud Storage URL, beginning with `gs://`.", "type": "string" - }, - "environment": { - "$ref": "RuntimeEnvironment", - "description": "The runtime environment for the job." - }, - "location": { - "description": "The location to which to direct the request.", - "type": "string" } }, "id": "CreateJobFromTemplateRequest" @@ -4575,58 +4330,59 @@ "description": "A representation of an integer mean metric contribution.", "type": "object", "properties": { - "count": { - "$ref": "SplitInt64", - "description": "The number of values being aggregated." - }, "sum": { "description": "The sum of all values being aggregated.", "$ref": "SplitInt64" + }, + "count": { + "$ref": "SplitInt64", + "description": "The number of values being aggregated." } }, "id": "IntegerMean" }, "ListJobsResponse": { - "id": "ListJobsResponse", "description": "Response to a request to list Cloud Dataflow jobs. This may be a partial\nresponse, depending on the page size in the ListJobsRequest.", "type": "object", "properties": { - "jobs": { - "description": "A subset of the requested job information.", - "type": "array", + "failedLocation": { + "description": "Zero or more messages describing locations that failed to respond.", "items": { - "$ref": "Job" - } + "$ref": "FailedLocation" + }, + "type": "array" }, "nextPageToken": { "description": "Set if there may be more results than fit in this response.", "type": "string" }, - "failedLocation": { - "description": "Zero or more messages describing locations that failed to respond.", - "type": "array", + "jobs": { + "description": "A subset of the requested job information.", "items": { - "$ref": "FailedLocation" - } + "$ref": "Job" + }, + "type": "array" } - } + }, + "id": "ListJobsResponse" }, "ComputationTopology": { + "description": "All configuration data for a particular Computation.", "type": "object", "properties": { - "stateFamilies": { - "description": "The state family values.", - "type": "array", - "items": { - "$ref": "StateFamilyConfig" - } - }, "outputs": { "description": "The outputs from the computation.", - "type": "array", "items": { "$ref": "StreamLocation" - } + }, + "type": "array" + }, + "stateFamilies": { + "description": "The state family values.", + "items": { + "$ref": "StateFamilyConfig" + }, + "type": "array" }, "systemStageName": { "description": "The system stage name.", @@ -4638,29 +4394,29 @@ }, "inputs": { "description": "The inputs to the computation.", - "type": "array", "items": { "$ref": "StreamLocation" - } + }, + "type": "array" }, "keyRanges": { "description": "The key ranges processed by the computation.", - "type": "array", "items": { "$ref": "KeyRangeLocation" - } + }, + "type": "array" } }, - "id": "ComputationTopology", - "description": "All configuration data for a particular Computation." + "id": "ComputationTopology" }, "RuntimeEnvironment": { "description": "The environment values to set at runtime.", "type": "object", "properties": { - "bypassTempDirValidation": { - "description": "Whether to bypass the safety checks for the job's temporary directory.\nUse with caution.", - "type": "boolean" + "maxWorkers": { + "format": "int32", + "description": "The maximum number of Google Compute Engine instances to be made\navailable to your pipeline during execution, from 1 to 1000.", + "type": "integer" }, "serviceAccountEmail": { "description": "The email address of the service account to run the job as.", @@ -4670,18 +4426,17 @@ "description": "The Cloud Storage path to use for temporary files.\nMust be a valid Cloud Storage URL, beginning with `gs://`.", "type": "string" }, + "bypassTempDirValidation": { + "description": "Whether to bypass the safety checks for the job's temporary directory.\nUse with caution.", + "type": "boolean" + }, "machineType": { - "type": "string", - "description": "The machine type to use for the job. Defaults to the value from the\ntemplate if not specified." + "description": "The machine type to use for the job. Defaults to the value from the\ntemplate if not specified.", + "type": "string" }, "zone": { "description": "The Compute Engine [availability\nzone](https://cloud.google.com/compute/docs/regions-zones/regions-zones)\nfor launching worker instances to run your pipeline.", "type": "string" - }, - "maxWorkers": { - "type": "integer", - "description": "The maximum number of Google Compute Engine instances to be made\navailable to your pipeline during execution, from 1 to 1000.", - "format": "int32" } }, "id": "RuntimeEnvironment" @@ -4691,8 +4446,8 @@ "type": "object", "properties": { "stateFamily": { - "type": "string", - "description": "Identifies the state family where this side input is stored." + "description": "Identifies the state family where this side input is stored.", + "type": "string" }, "tag": { "description": "Identifies the particular side input within the streaming Dataflow job.", @@ -4702,207 +4457,26 @@ "id": "StreamingSideInputLocation" }, "MountedDataDisk": { + "description": "Describes mounted data disk.", + "type": "object", "properties": { "dataDisk": { - "type": "string", - "description": "The name of the data disk.\nThis name is local to the Google Cloud Platform project and uniquely\nidentifies the disk within that project, for example\n\"myproject-1014-104817-4c2-harness-0-disk-1\"." + "description": "The name of the data disk.\nThis name is local to the Google Cloud Platform project and uniquely\nidentifies the disk within that project, for example\n\"myproject-1014-104817-4c2-harness-0-disk-1\".", + "type": "string" } }, - "id": "MountedDataDisk", - "description": "Describes mounted data disk.", - "type": "object" + "id": "MountedDataDisk" }, "LaunchTemplateResponse": { + "description": "Response to the request to launch a template.", + "type": "object", "properties": { "job": { - "description": "The job that was launched, if the request was not a dry run and\nthe job was successfully launched.", - "$ref": "Job" + "$ref": "Job", + "description": "The job that was launched, if the request was not a dry run and\nthe job was successfully launched." } }, - "id": "LaunchTemplateResponse", - "description": "Response to the request to launch a template.", - "type": "object" - }, - "Job": { - "description": "Defines a job to be run by the Cloud Dataflow service.", - "type": "object", - "properties": { - "environment": { - "description": "The environment for the job.", - "$ref": "Environment" - }, - "labels": { - "description": "User-defined labels for this job.\n\nThe labels map can contain no more than 64 entries. Entries of the labels\nmap are UTF8 strings that comply with the following restrictions:\n\n* Keys must conform to regexp: \\p{Ll}\\p{Lo}{0,62}\n* Values must conform to regexp: [\\p{Ll}\\p{Lo}\\p{N}_-]{0,63}\n* Both keys and values are additionally constrained to be \u003c= 128 bytes in\nsize.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "createTime": { - "description": "The timestamp when the job was initially created. Immutable and set by the\nCloud Dataflow service.", - "format": "google-datetime", - "type": "string" - }, - "stageStates": { - "description": "This field may be mutated by the Cloud Dataflow service;\ncallers cannot mutate it.", - "type": "array", - "items": { - "$ref": "ExecutionStageState" - } - }, - "projectId": { - "description": "The ID of the Cloud Platform project that the job belongs to.", - "type": "string" - }, - "type": { - "enum": [ - "JOB_TYPE_UNKNOWN", - "JOB_TYPE_BATCH", - "JOB_TYPE_STREAMING" - ], - "description": "The type of Cloud Dataflow job.", - "type": "string", - "enumDescriptions": [ - "The type of the job is unspecified, or unknown.", - "A batch job with a well-defined end point: data is read, data is\nprocessed, data is written, and the job is done.", - "A continuously streaming job with no end: data is read,\nprocessed, and written continuously." - ] - }, - "pipelineDescription": { - "$ref": "PipelineDescription", - "description": "Preliminary field: The format of this data may change at any time.\nA description of the user pipeline and stages through which it is executed.\nCreated by Cloud Dataflow service. Only retrieved with\nJOB_VIEW_DESCRIPTION or JOB_VIEW_ALL." - }, - "replaceJobId": { - "description": "If this job is an update of an existing job, this field is the job ID\nof the job it replaced.\n\nWhen sending a `CreateJobRequest`, you can update a job by specifying it\nhere. The job named here is stopped, and its intermediate state is\ntransferred to this job.", - "type": "string" - }, - "requestedState": { - "type": "string", - "enumDescriptions": [ - "The job's run state isn't specified.", - "`JOB_STATE_STOPPED` indicates that the job has not\nyet started to run.", - "`JOB_STATE_RUNNING` indicates that the job is currently running.", - "`JOB_STATE_DONE` indicates that the job has successfully completed.\nThis is a terminal job state. This state may be set by the Cloud Dataflow\nservice, as a transition from `JOB_STATE_RUNNING`. It may also be set via a\nCloud Dataflow `UpdateJob` call, if the job has not yet reached a terminal\nstate.", - "`JOB_STATE_FAILED` indicates that the job has failed. This is a\nterminal job state. This state may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_RUNNING`.", - "`JOB_STATE_CANCELLED` indicates that the job has been explicitly\ncancelled. This is a terminal job state. This state may only be\nset via a Cloud Dataflow `UpdateJob` call, and only if the job has not\nyet reached another terminal state.", - "`JOB_STATE_UPDATED` indicates that the job was successfully updated,\nmeaning that this job was stopped and another job was started, inheriting\nstate from this one. This is a terminal job state. This state may only be\nset by the Cloud Dataflow service, and only as a transition from\n`JOB_STATE_RUNNING`.", - "`JOB_STATE_DRAINING` indicates that the job is in the process of draining.\nA draining job has stopped pulling from its input sources and is processing\nany data that remains in-flight. This state may be set via a Cloud Dataflow\n`UpdateJob` call, but only as a transition from `JOB_STATE_RUNNING`. Jobs\nthat are draining may only transition to `JOB_STATE_DRAINED`,\n`JOB_STATE_CANCELLED`, or `JOB_STATE_FAILED`.", - "`JOB_STATE_DRAINED` indicates that the job has been drained.\nA drained job terminated by stopping pulling from its input sources and\nprocessing any data that remained in-flight when draining was requested.\nThis state is a terminal state, may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_DRAINING`.", - "'JOB_STATE_PENDING' indicates that the job has been created but is not yet\nrunning. Jobs that are pending may only transition to `JOB_STATE_RUNNING`,\nor `JOB_STATE_FAILED`.", - "'JOB_STATE_CANCELLING' indicates that the job has been explicitly cancelled\nand is in the process of stopping. Jobs that are cancelling may only\ntransition to 'JOB_STATE_CANCELLED' or 'JOB_STATE_FAILED'." - ], - "enum": [ - "JOB_STATE_UNKNOWN", - "JOB_STATE_STOPPED", - "JOB_STATE_RUNNING", - "JOB_STATE_DONE", - "JOB_STATE_FAILED", - "JOB_STATE_CANCELLED", - "JOB_STATE_UPDATED", - "JOB_STATE_DRAINING", - "JOB_STATE_DRAINED", - "JOB_STATE_PENDING", - "JOB_STATE_CANCELLING" - ], - "description": "The job's requested state.\n\n`UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and\n`JOB_STATE_RUNNING` states, by setting requested_state. `UpdateJob` may\nalso be used to directly set a job's requested state to\n`JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably terminating the\njob if it has not already reached a terminal state." - }, - "tempFiles": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A set of files the system should be aware of that are used\nfor temporary storage. These temporary files will be\nremoved on job completion.\nNo duplicates are allowed.\nNo file patterns are supported.\n\nThe supported files are:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}" - }, - "clientRequestId": { - "description": "The client's unique identifier of the job, re-used across retried attempts.\nIf this field is set, the service will ensure its uniqueness.\nThe request to create a job will fail if the service has knowledge of a\npreviously submitted job with the same client's ID and job name.\nThe caller may use this field to ensure idempotence of job\ncreation across retried attempts to create a job.\nBy default, the field is empty and, in that case, the service ignores it.", - "type": "string" - }, - "name": { - "description": "The user-specified Cloud Dataflow job name.\n\nOnly one Job with a given name may exist in a project at any\ngiven time. If a caller attempts to create a Job with the same\nname as an already-existing Job, the attempt returns the\nexisting Job.\n\nThe name must match the regular expression\n`[a-z]([-a-z0-9]{0,38}[a-z0-9])?`", - "type": "string" - }, - "steps": { - "description": "The top-level steps that constitute the entire job.", - "type": "array", - "items": { - "$ref": "Step" - } - }, - "replacedByJobId": { - "description": "If another job is an update of this job (and thus, this job is in\n`JOB_STATE_UPDATED`), this field contains the ID of that job.", - "type": "string" - }, - "executionInfo": { - "description": "Deprecated.", - "$ref": "JobExecutionInfo" - }, - "id": { - "description": "The unique ID of this job.\n\nThis field is set by the Cloud Dataflow service when the Job is\ncreated, and is immutable for the life of the job.", - "type": "string" - }, - "currentState": { - "type": "string", - "enumDescriptions": [ - "The job's run state isn't specified.", - "`JOB_STATE_STOPPED` indicates that the job has not\nyet started to run.", - "`JOB_STATE_RUNNING` indicates that the job is currently running.", - "`JOB_STATE_DONE` indicates that the job has successfully completed.\nThis is a terminal job state. This state may be set by the Cloud Dataflow\nservice, as a transition from `JOB_STATE_RUNNING`. It may also be set via a\nCloud Dataflow `UpdateJob` call, if the job has not yet reached a terminal\nstate.", - "`JOB_STATE_FAILED` indicates that the job has failed. This is a\nterminal job state. This state may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_RUNNING`.", - "`JOB_STATE_CANCELLED` indicates that the job has been explicitly\ncancelled. This is a terminal job state. This state may only be\nset via a Cloud Dataflow `UpdateJob` call, and only if the job has not\nyet reached another terminal state.", - "`JOB_STATE_UPDATED` indicates that the job was successfully updated,\nmeaning that this job was stopped and another job was started, inheriting\nstate from this one. This is a terminal job state. This state may only be\nset by the Cloud Dataflow service, and only as a transition from\n`JOB_STATE_RUNNING`.", - "`JOB_STATE_DRAINING` indicates that the job is in the process of draining.\nA draining job has stopped pulling from its input sources and is processing\nany data that remains in-flight. This state may be set via a Cloud Dataflow\n`UpdateJob` call, but only as a transition from `JOB_STATE_RUNNING`. Jobs\nthat are draining may only transition to `JOB_STATE_DRAINED`,\n`JOB_STATE_CANCELLED`, or `JOB_STATE_FAILED`.", - "`JOB_STATE_DRAINED` indicates that the job has been drained.\nA drained job terminated by stopping pulling from its input sources and\nprocessing any data that remained in-flight when draining was requested.\nThis state is a terminal state, may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_DRAINING`.", - "'JOB_STATE_PENDING' indicates that the job has been created but is not yet\nrunning. Jobs that are pending may only transition to `JOB_STATE_RUNNING`,\nor `JOB_STATE_FAILED`.", - "'JOB_STATE_CANCELLING' indicates that the job has been explicitly cancelled\nand is in the process of stopping. Jobs that are cancelling may only\ntransition to 'JOB_STATE_CANCELLED' or 'JOB_STATE_FAILED'." - ], - "enum": [ - "JOB_STATE_UNKNOWN", - "JOB_STATE_STOPPED", - "JOB_STATE_RUNNING", - "JOB_STATE_DONE", - "JOB_STATE_FAILED", - "JOB_STATE_CANCELLED", - "JOB_STATE_UPDATED", - "JOB_STATE_DRAINING", - "JOB_STATE_DRAINED", - "JOB_STATE_PENDING", - "JOB_STATE_CANCELLING" - ], - "description": "The current state of the job.\n\nJobs are created in the `JOB_STATE_STOPPED` state unless otherwise\nspecified.\n\nA job in the `JOB_STATE_RUNNING` state may asynchronously enter a\nterminal state. After a job has reached a terminal state, no\nfurther state updates may be made.\n\nThis field may be mutated by the Cloud Dataflow service;\ncallers cannot mutate it." - }, - "location": { - "description": "The location that contains this job.", - "type": "string" - }, - "currentStateTime": { - "description": "The timestamp associated with the current state.", - "format": "google-datetime", - "type": "string" - }, - "transformNameMapping": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "The map of transform name prefixes of the job to be replaced to the\ncorresponding name prefixes of the new job." - } - }, - "id": "Job" - }, - "DynamicSourceSplit": { - "description": "When a task splits using WorkItemStatus.dynamic_source_split, this\nmessage describes the two parts of the split relative to the\ndescription of the current task's input.", - "type": "object", - "properties": { - "residual": { - "$ref": "DerivedSource", - "description": "Residual part (returned to the pool of work).\nSpecified relative to the previously-current source." - }, - "primary": { - "$ref": "DerivedSource", - "description": "Primary part (continued to be processed by worker).\nSpecified relative to the previously-current source.\nBecomes current." - } - }, - "id": "DynamicSourceSplit" + "id": "LaunchTemplateResponse" }, "DerivedSource": { "description": "Specification of one of the bundles produced as a result of splitting\na Source (e.g. when executing a SourceSplitRequest, or when\nsplitting an active task using WorkItemStatus.dynamic_source_split),\nrelative to the source being split.", @@ -4925,11 +4499,585 @@ "type": "string" }, "source": { - "$ref": "Source", - "description": "Specification of the source." + "description": "Specification of the source.", + "$ref": "Source" } }, "id": "DerivedSource" + }, + "DynamicSourceSplit": { + "description": "When a task splits using WorkItemStatus.dynamic_source_split, this\nmessage describes the two parts of the split relative to the\ndescription of the current task's input.", + "type": "object", + "properties": { + "primary": { + "$ref": "DerivedSource", + "description": "Primary part (continued to be processed by worker).\nSpecified relative to the previously-current source.\nBecomes current." + }, + "residual": { + "description": "Residual part (returned to the pool of work).\nSpecified relative to the previously-current source.", + "$ref": "DerivedSource" + } + }, + "id": "DynamicSourceSplit" + }, + "Job": { + "description": "Defines a job to be run by the Cloud Dataflow service.", + "type": "object", + "properties": { + "currentState": { + "enumDescriptions": [ + "The job's run state isn't specified.", + "`JOB_STATE_STOPPED` indicates that the job has not\nyet started to run.", + "`JOB_STATE_RUNNING` indicates that the job is currently running.", + "`JOB_STATE_DONE` indicates that the job has successfully completed.\nThis is a terminal job state. This state may be set by the Cloud Dataflow\nservice, as a transition from `JOB_STATE_RUNNING`. It may also be set via a\nCloud Dataflow `UpdateJob` call, if the job has not yet reached a terminal\nstate.", + "`JOB_STATE_FAILED` indicates that the job has failed. This is a\nterminal job state. This state may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_RUNNING`.", + "`JOB_STATE_CANCELLED` indicates that the job has been explicitly\ncancelled. This is a terminal job state. This state may only be\nset via a Cloud Dataflow `UpdateJob` call, and only if the job has not\nyet reached another terminal state.", + "`JOB_STATE_UPDATED` indicates that the job was successfully updated,\nmeaning that this job was stopped and another job was started, inheriting\nstate from this one. This is a terminal job state. This state may only be\nset by the Cloud Dataflow service, and only as a transition from\n`JOB_STATE_RUNNING`.", + "`JOB_STATE_DRAINING` indicates that the job is in the process of draining.\nA draining job has stopped pulling from its input sources and is processing\nany data that remains in-flight. This state may be set via a Cloud Dataflow\n`UpdateJob` call, but only as a transition from `JOB_STATE_RUNNING`. Jobs\nthat are draining may only transition to `JOB_STATE_DRAINED`,\n`JOB_STATE_CANCELLED`, or `JOB_STATE_FAILED`.", + "`JOB_STATE_DRAINED` indicates that the job has been drained.\nA drained job terminated by stopping pulling from its input sources and\nprocessing any data that remained in-flight when draining was requested.\nThis state is a terminal state, may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_DRAINING`.", + "'JOB_STATE_PENDING' indicates that the job has been created but is not yet\nrunning. Jobs that are pending may only transition to `JOB_STATE_RUNNING`,\nor `JOB_STATE_FAILED`.", + "'JOB_STATE_CANCELLING' indicates that the job has been explicitly cancelled\nand is in the process of stopping. Jobs that are cancelling may only\ntransition to 'JOB_STATE_CANCELLED' or 'JOB_STATE_FAILED'." + ], + "enum": [ + "JOB_STATE_UNKNOWN", + "JOB_STATE_STOPPED", + "JOB_STATE_RUNNING", + "JOB_STATE_DONE", + "JOB_STATE_FAILED", + "JOB_STATE_CANCELLED", + "JOB_STATE_UPDATED", + "JOB_STATE_DRAINING", + "JOB_STATE_DRAINED", + "JOB_STATE_PENDING", + "JOB_STATE_CANCELLING" + ], + "description": "The current state of the job.\n\nJobs are created in the `JOB_STATE_STOPPED` state unless otherwise\nspecified.\n\nA job in the `JOB_STATE_RUNNING` state may asynchronously enter a\nterminal state. After a job has reached a terminal state, no\nfurther state updates may be made.\n\nThis field may be mutated by the Cloud Dataflow service;\ncallers cannot mutate it.", + "type": "string" + }, + "location": { + "description": "The location that contains this job.", + "type": "string" + }, + "currentStateTime": { + "format": "google-datetime", + "description": "The timestamp associated with the current state.", + "type": "string" + }, + "transformNameMapping": { + "additionalProperties": { + "type": "string" + }, + "description": "The map of transform name prefixes of the job to be replaced to the\ncorresponding name prefixes of the new job.", + "type": "object" + }, + "createTime": { + "format": "google-datetime", + "description": "The timestamp when the job was initially created. Immutable and set by the\nCloud Dataflow service.", + "type": "string" + }, + "environment": { + "$ref": "Environment", + "description": "The environment for the job." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "User-defined labels for this job.\n\nThe labels map can contain no more than 64 entries. Entries of the labels\nmap are UTF8 strings that comply with the following restrictions:\n\n* Keys must conform to regexp: \\p{Ll}\\p{Lo}{0,62}\n* Values must conform to regexp: [\\p{Ll}\\p{Lo}\\p{N}_-]{0,63}\n* Both keys and values are additionally constrained to be \u003c= 128 bytes in\nsize.", + "type": "object" + }, + "stageStates": { + "description": "This field may be mutated by the Cloud Dataflow service;\ncallers cannot mutate it.", + "items": { + "$ref": "ExecutionStageState" + }, + "type": "array" + }, + "type": { + "description": "The type of Cloud Dataflow job.", + "type": "string", + "enumDescriptions": [ + "The type of the job is unspecified, or unknown.", + "A batch job with a well-defined end point: data is read, data is\nprocessed, data is written, and the job is done.", + "A continuously streaming job with no end: data is read,\nprocessed, and written continuously." + ], + "enum": [ + "JOB_TYPE_UNKNOWN", + "JOB_TYPE_BATCH", + "JOB_TYPE_STREAMING" + ] + }, + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string" + }, + "pipelineDescription": { + "description": "Preliminary field: The format of this data may change at any time.\nA description of the user pipeline and stages through which it is executed.\nCreated by Cloud Dataflow service. Only retrieved with\nJOB_VIEW_DESCRIPTION or JOB_VIEW_ALL.", + "$ref": "PipelineDescription" + }, + "replaceJobId": { + "description": "If this job is an update of an existing job, this field is the job ID\nof the job it replaced.\n\nWhen sending a `CreateJobRequest`, you can update a job by specifying it\nhere. The job named here is stopped, and its intermediate state is\ntransferred to this job.", + "type": "string" + }, + "requestedState": { + "enumDescriptions": [ + "The job's run state isn't specified.", + "`JOB_STATE_STOPPED` indicates that the job has not\nyet started to run.", + "`JOB_STATE_RUNNING` indicates that the job is currently running.", + "`JOB_STATE_DONE` indicates that the job has successfully completed.\nThis is a terminal job state. This state may be set by the Cloud Dataflow\nservice, as a transition from `JOB_STATE_RUNNING`. It may also be set via a\nCloud Dataflow `UpdateJob` call, if the job has not yet reached a terminal\nstate.", + "`JOB_STATE_FAILED` indicates that the job has failed. This is a\nterminal job state. This state may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_RUNNING`.", + "`JOB_STATE_CANCELLED` indicates that the job has been explicitly\ncancelled. This is a terminal job state. This state may only be\nset via a Cloud Dataflow `UpdateJob` call, and only if the job has not\nyet reached another terminal state.", + "`JOB_STATE_UPDATED` indicates that the job was successfully updated,\nmeaning that this job was stopped and another job was started, inheriting\nstate from this one. This is a terminal job state. This state may only be\nset by the Cloud Dataflow service, and only as a transition from\n`JOB_STATE_RUNNING`.", + "`JOB_STATE_DRAINING` indicates that the job is in the process of draining.\nA draining job has stopped pulling from its input sources and is processing\nany data that remains in-flight. This state may be set via a Cloud Dataflow\n`UpdateJob` call, but only as a transition from `JOB_STATE_RUNNING`. Jobs\nthat are draining may only transition to `JOB_STATE_DRAINED`,\n`JOB_STATE_CANCELLED`, or `JOB_STATE_FAILED`.", + "`JOB_STATE_DRAINED` indicates that the job has been drained.\nA drained job terminated by stopping pulling from its input sources and\nprocessing any data that remained in-flight when draining was requested.\nThis state is a terminal state, may only be set by the Cloud Dataflow\nservice, and only as a transition from `JOB_STATE_DRAINING`.", + "'JOB_STATE_PENDING' indicates that the job has been created but is not yet\nrunning. Jobs that are pending may only transition to `JOB_STATE_RUNNING`,\nor `JOB_STATE_FAILED`.", + "'JOB_STATE_CANCELLING' indicates that the job has been explicitly cancelled\nand is in the process of stopping. Jobs that are cancelling may only\ntransition to 'JOB_STATE_CANCELLED' or 'JOB_STATE_FAILED'." + ], + "enum": [ + "JOB_STATE_UNKNOWN", + "JOB_STATE_STOPPED", + "JOB_STATE_RUNNING", + "JOB_STATE_DONE", + "JOB_STATE_FAILED", + "JOB_STATE_CANCELLED", + "JOB_STATE_UPDATED", + "JOB_STATE_DRAINING", + "JOB_STATE_DRAINED", + "JOB_STATE_PENDING", + "JOB_STATE_CANCELLING" + ], + "description": "The job's requested state.\n\n`UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and\n`JOB_STATE_RUNNING` states, by setting requested_state. `UpdateJob` may\nalso be used to directly set a job's requested state to\n`JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably terminating the\njob if it has not already reached a terminal state.", + "type": "string" + }, + "tempFiles": { + "description": "A set of files the system should be aware of that are used\nfor temporary storage. These temporary files will be\nremoved on job completion.\nNo duplicates are allowed.\nNo file patterns are supported.\n\nThe supported files are:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", + "items": { + "type": "string" + }, + "type": "array" + }, + "clientRequestId": { + "description": "The client's unique identifier of the job, re-used across retried attempts.\nIf this field is set, the service will ensure its uniqueness.\nThe request to create a job will fail if the service has knowledge of a\npreviously submitted job with the same client's ID and job name.\nThe caller may use this field to ensure idempotence of job\ncreation across retried attempts to create a job.\nBy default, the field is empty and, in that case, the service ignores it.", + "type": "string" + }, + "name": { + "description": "The user-specified Cloud Dataflow job name.\n\nOnly one Job with a given name may exist in a project at any\ngiven time. If a caller attempts to create a Job with the same\nname as an already-existing Job, the attempt returns the\nexisting Job.\n\nThe name must match the regular expression\n`[a-z]([-a-z0-9]{0,38}[a-z0-9])?`", + "type": "string" + }, + "steps": { + "description": "The top-level steps that constitute the entire job.", + "items": { + "$ref": "Step" + }, + "type": "array" + }, + "replacedByJobId": { + "description": "If another job is an update of this job (and thus, this job is in\n`JOB_STATE_UPDATED`), this field contains the ID of that job.", + "type": "string" + }, + "id": { + "description": "The unique ID of this job.\n\nThis field is set by the Cloud Dataflow service when the Job is\ncreated, and is immutable for the life of the job.", + "type": "string" + }, + "executionInfo": { + "$ref": "JobExecutionInfo", + "description": "Deprecated." + } + }, + "id": "Job" + }, + "SideInputId": { + "description": "Uniquely identifies a side input.", + "type": "object", + "properties": { + "inputIndex": { + "format": "int32", + "description": "The index of the side input, from the list of non_parallel_inputs.", + "type": "integer" + }, + "declaringStepName": { + "description": "The step that receives and usually consumes this side input.", + "type": "string" + } + }, + "id": "SideInputId" + }, + "SourceOperationResponse": { + "description": "The result of a SourceOperationRequest, specified in\nReportWorkItemStatusRequest.source_operation when the work item\nis completed.", + "type": "object", + "properties": { + "getMetadata": { + "$ref": "SourceGetMetadataResponse", + "description": "A response to a request to get metadata about a source." + }, + "split": { + "$ref": "SourceSplitResponse", + "description": "A response to a request to split a source." + } + }, + "id": "SourceOperationResponse" + }, + "SendDebugCaptureResponse": { + "description": "Response to a send capture request.\nnothing", + "type": "object", + "properties": {}, + "id": "SendDebugCaptureResponse" + }, + "SideInputInfo": { + "description": "Information about a side input of a DoFn or an input of a SeqDoFn.", + "type": "object", + "properties": { + "tag": { + "description": "The id of the tag the user code will access this side input by;\nthis should correspond to the tag of some MultiOutputInfo.", + "type": "string" + }, + "kind": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "How to interpret the source element(s) as a side input value.", + "type": "object" + }, + "sources": { + "description": "The source(s) to read element(s) from to get the value of this side input.\nIf more than one source, then the elements are taken from the\nsources, in the specified order if order matters.\nAt least one source is required.", + "items": { + "$ref": "Source" + }, + "type": "array" + } + }, + "id": "SideInputInfo" + }, + "CounterStructuredNameAndMetadata": { + "description": "A single message which encapsulates structured name and metadata for a given\ncounter.", + "type": "object", + "properties": { + "name": { + "$ref": "CounterStructuredName", + "description": "Structured name of the counter." + }, + "metadata": { + "$ref": "CounterMetadata", + "description": "Metadata associated with a counter" + } + }, + "id": "CounterStructuredNameAndMetadata" + }, + "ConcatPosition": { + "description": "A position that encapsulates an inner position and an index for the inner\nposition. A ConcatPosition can be used by a reader of a source that\nencapsulates a set of other sources.", + "type": "object", + "properties": { + "position": { + "description": "Position within the inner source.", + "$ref": "Position" + }, + "index": { + "format": "int32", + "description": "Index of the inner source.", + "type": "integer" + } + }, + "id": "ConcatPosition" + }, + "WriteInstruction": { + "description": "An instruction that writes records.\nTakes one input, produces no outputs.", + "type": "object", + "properties": { + "input": { + "$ref": "InstructionInput", + "description": "The input." + }, + "sink": { + "description": "The sink to write to.", + "$ref": "Sink" + } + }, + "id": "WriteInstruction" + }, + "StreamingComputationRanges": { + "description": "Describes full or partial data disk assignment information of the computation\nranges.", + "type": "object", + "properties": { + "rangeAssignments": { + "description": "Data disk assignments for ranges from this computation.", + "items": { + "$ref": "KeyRangeDataDiskAssignment" + }, + "type": "array" + }, + "computationId": { + "description": "The ID of the computation.", + "type": "string" + } + }, + "id": "StreamingComputationRanges" + }, + "AutoscalingSettings": { + "description": "Settings for WorkerPool autoscaling.", + "type": "object", + "properties": { + "algorithm": { + "description": "The algorithm to use for autoscaling.", + "type": "string", + "enumDescriptions": [ + "The algorithm is unknown, or unspecified.", + "Disable autoscaling.", + "Increase worker count over time to reduce job execution time." + ], + "enum": [ + "AUTOSCALING_ALGORITHM_UNKNOWN", + "AUTOSCALING_ALGORITHM_NONE", + "AUTOSCALING_ALGORITHM_BASIC" + ] + }, + "maxNumWorkers": { + "format": "int32", + "description": "The maximum number of workers to cap scaling at.", + "type": "integer" + } + }, + "id": "AutoscalingSettings" + }, + "ExecutionStageSummary": { + "description": "Description of the composing transforms, names/ids, and input/outputs of a\nstage of execution. Some composing transforms and sources may have been\ngenerated by the Dataflow service during execution planning.", + "type": "object", + "properties": { + "inputSource": { + "description": "Input sources for this stage.", + "items": { + "$ref": "StageSource" + }, + "type": "array" + }, + "id": { + "description": "Dataflow service generated id for this stage.", + "type": "string" + }, + "componentTransform": { + "description": "Transforms that comprise this execution stage.", + "items": { + "$ref": "ComponentTransform" + }, + "type": "array" + }, + "componentSource": { + "description": "Collections produced and consumed by component transforms of this stage.", + "items": { + "$ref": "ComponentSource" + }, + "type": "array" + }, + "kind": { + "description": "Type of tranform this stage is executing.", + "type": "string", + "enumDescriptions": [ + "Unrecognized transform type.", + "ParDo transform.", + "Group By Key transform.", + "Flatten transform.", + "Read transform.", + "Write transform.", + "Constructs from a constant value, such as with Create.of.", + "Creates a Singleton view of a collection.", + "Opening or closing a shuffle session, often as part of a GroupByKey." + ], + "enum": [ + "UNKNOWN_KIND", + "PAR_DO_KIND", + "GROUP_BY_KEY_KIND", + "FLATTEN_KIND", + "READ_KIND", + "WRITE_KIND", + "CONSTANT_KIND", + "SINGLETON_KIND", + "SHUFFLE_KIND" + ] + }, + "outputSource": { + "description": "Output sources for this stage.", + "items": { + "$ref": "StageSource" + }, + "type": "array" + }, + "name": { + "description": "Dataflow service generated name for this stage.", + "type": "string" + } + }, + "id": "ExecutionStageSummary" + }, + "SendWorkerMessagesRequest": { + "description": "A request for sending worker messages to the service.", + "type": "object", + "properties": { + "location": { + "description": "The location which contains the job", + "type": "string" + }, + "workerMessages": { + "description": "The WorkerMessages to send.", + "items": { + "$ref": "WorkerMessage" + }, + "type": "array" + } + }, + "id": "SendWorkerMessagesRequest" + }, + "SourceSplitShard": { + "description": "DEPRECATED in favor of DerivedSource.", + "type": "object", + "properties": { + "derivationMode": { + "description": "DEPRECATED", + "type": "string", + "enumDescriptions": [ + "The source derivation is unknown, or unspecified.", + "Produce a completely independent Source with no base.", + "Produce a Source based on the Source being split.", + "Produce a Source based on the base of the Source being split." + ], + "enum": [ + "SOURCE_DERIVATION_MODE_UNKNOWN", + "SOURCE_DERIVATION_MODE_INDEPENDENT", + "SOURCE_DERIVATION_MODE_CHILD_OF_CURRENT", + "SOURCE_DERIVATION_MODE_SIBLING_OF_CURRENT" + ] + }, + "source": { + "$ref": "Source", + "description": "DEPRECATED" + } + }, + "id": "SourceSplitShard" + }, + "CPUTime": { + "description": "Modeled after information exposed by /proc/stat.", + "type": "object", + "properties": { + "timestamp": { + "format": "google-datetime", + "description": "Timestamp of the measurement.", + "type": "string" + }, + "totalMs": { + "format": "uint64", + "description": "Total active CPU time across all cores (ie., non-idle) in milliseconds\nsince start-up.", + "type": "string" + }, + "rate": { + "format": "double", + "description": "Average CPU utilization rate (% non-idle cpu / second) since previous\nsample.", + "type": "number" + } + }, + "id": "CPUTime" + }, + "Environment": { + "description": "Describes the environment in which a Dataflow Job runs.", + "type": "object", + "properties": { + "serviceAccountEmail": { + "description": "Identity to run virtual machines as. Defaults to the default account.", + "type": "string" + }, + "userAgent": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "A description of the process that generated the request.", + "type": "object" + }, + "sdkPipelineOptions": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The Cloud Dataflow SDK pipeline options specified by the user. These\noptions are passed through the service and are used to recreate the\nSDK pipeline options on the worker in a language agnostic and platform\nindependent way.", + "type": "object" + }, + "clusterManagerApiService": { + "description": "The type of cluster manager API to use. If unknown or\nunspecified, the service will attempt to choose a reasonable\ndefault. This should be in the form of the API service name,\ne.g. \"compute.googleapis.com\".", + "type": "string" + }, + "tempStoragePrefix": { + "description": "The prefix of the resources the system should use for temporary\nstorage. The system will append the suffix \"/temp-{JOBNAME} to\nthis resource prefix, where {JOBNAME} is the value of the\njob_name field. The resulting bucket and object prefix is used\nas the prefix of the resources used to store temporary data\nneeded during the job execution. NOTE: This will override the\nvalue in taskrunner_settings.\nThe supported resource type is:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", + "type": "string" + }, + "workerPools": { + "description": "The worker pools. At least one \"harness\" worker pool must be\nspecified in order for the job to have workers.", + "items": { + "$ref": "WorkerPool" + }, + "type": "array" + }, + "dataset": { + "description": "The dataset for the current project where various workflow\nrelated tables are stored.\n\nThe supported resource type is:\n\nGoogle BigQuery:\n bigquery.googleapis.com/{dataset}", + "type": "string" + }, + "experiments": { + "description": "The list of experiments to enable.", + "items": { + "type": "string" + }, + "type": "array" + }, + "internalExperiments": { + "description": "Experimental settings.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "version": { + "description": "A structure describing which components and their versions of the service\nare required in order to run the job.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + } + }, + "id": "Environment" + }, + "StreamingComputationTask": { + "description": "A task which describes what action should be performed for the specified\nstreaming computation ranges.", + "type": "object", + "properties": { + "taskType": { + "description": "A type of streaming computation task.", + "type": "string", + "enumDescriptions": [ + "The streaming computation task is unknown, or unspecified.", + "Stop processing specified streaming computation range(s).", + "Start processing specified streaming computation range(s)." + ], + "enum": [ + "STREAMING_COMPUTATION_TASK_UNKNOWN", + "STREAMING_COMPUTATION_TASK_STOP", + "STREAMING_COMPUTATION_TASK_START" + ] + }, + "computationRanges": { + "description": "Contains ranges of a streaming computation this task should apply to.", + "items": { + "$ref": "StreamingComputationRanges" + }, + "type": "array" + }, + "dataDisks": { + "description": "Describes the set of data disks this task should apply to.", + "items": { + "$ref": "MountedDataDisk" + }, + "type": "array" + } + }, + "id": "StreamingComputationTask" } }, "protocol": "rest", @@ -4942,6 +5090,9 @@ "auth": { "oauth2": { "scopes": { + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, "https://www.googleapis.com/auth/compute": { "description": "View and manage your Google Compute Engine resources" }, @@ -4953,10 +5104,5 @@ } } } - }, - "servicePath": "", - "description": "Manages Google Cloud Dataflow projects on Google Cloud Platform.", - "kind": "discovery#restDescription", - "rootUrl": "https://dataflow.googleapis.com/", - "basePath": "" + } } diff --git a/etc/api/dataproc/v1/crates/1.0.6-api+20170919 b/etc/api/dataproc/v1/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dataproc/v1/crates/1.0.6-cli+20170919 b/etc/api/dataproc/v1/crates/1.0.6-cli+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dataproc/v1/dataproc-api.json b/etc/api/dataproc/v1/dataproc-api.json index 91b577920b..f75e6e7251 100644 --- a/etc/api/dataproc/v1/dataproc-api.json +++ b/etc/api/dataproc/v1/dataproc-api.json @@ -1,140 +1,480 @@ { - "ownerName": "Google", + "batchPath": "batch", + "documentationLink": "https://cloud.google.com/dataproc/", + "id": "dataproc:v1", + "revision": "20170919", + "title": "Google Cloud Dataproc API", "discoveryVersion": "v1", + "ownerName": "Google", "resources": { "projects": { "resources": { "regions": { "resources": { - "jobs": { + "clusters": { "methods": { - "cancel": { + "diagnose": { + "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", + "id": "dataproc.projects.regions.clusters.diagnose", + "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.", "request": { - "$ref": "CancelJobRequest" - }, - "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.", - "response": { - "$ref": "Job" + "$ref": "DiagnoseClusterRequest" }, + "httpMethod": "POST", "parameterOrder": [ "projectId", "region", - "jobId" + "clusterName" ], - "httpMethod": "POST", + "response": { + "$ref": "Operation" + }, "parameters": { - "projectId": { - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, - "jobId": { - "location": "path", - "description": "Required. The job ID.", - "required": true, - "type": "string" - }, "region": { - "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "clusterName": { + "description": "Required. The cluster name.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true, + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", - "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", - "id": "dataproc.projects.regions.jobs.cancel" + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose" + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "httpMethod": "DELETE", + "parameters": { + "clusterName": { + "description": "Required. The cluster name.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true, + "location": "path" + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.delete", + "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "description": "Deletes a cluster in a project." + }, + "list": { + "response": { + "$ref": "ListClustersResponse" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. The standard List page token.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The standard List page size.", + "type": "integer", + "location": "query" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true + }, + "filter": { + "type": "string", + "location": "query", + "description": "Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *" + }, + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters", + "id": "dataproc.projects.regions.clusters.list", + "path": "v1/projects/{projectId}/regions/{region}/clusters", + "description": "Lists all regions/{region}/clusters in a project." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "region" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters", + "path": "v1/projects/{projectId}/regions/{region}/clusters", + "id": "dataproc.projects.regions.clusters.create", + "description": "Creates a cluster in a project.", + "request": { + "$ref": "Cluster" + } + }, + "get": { + "description": "Gets the resource representation for a cluster in a project.", + "httpMethod": "GET", + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + }, + "clusterName": { + "description": "Required. The cluster name.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.get" }, "patch": { - "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", - "id": "dataproc.projects.regions.jobs.patch", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:\n{\n \"config\":{\n \"workerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\nSimilarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:\n{\n \"config\":{\n \"secondaryWorkerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\n\u003cstrong\u003eNote:\u003c/strong\u003e Currently, only the following fields can be updated:\u003ctable\u003e \u003ctbody\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003elabels\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eUpdate labels\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003econfig.worker_config.num_instances\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eResize primary worker group\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003econfig.secondary_worker_config.num_instances\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eResize secondary worker group\u003c/td\u003e \u003c/tr\u003e \u003c/tbody\u003e \u003c/table\u003e", + "type": "string", + "location": "query" + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + }, + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.patch", + "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "description": "Updates a cluster in a project.", + "request": { + "$ref": "Cluster" + } + } + } + }, + "operations": { + "methods": { + "get": { + "parameters": { + "name": { + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", + "id": "dataproc.projects.regions.operations.get", + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET" + }, + "list": { + "id": "dataproc.projects.regions.operations.list", + "path": "v1/{+name}", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + }, + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/regions/[^/]+/operations$", + "location": "path", + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations" + }, + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be cancelled." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", + "id": "dataproc.projects.regions.operations.cancel", + "path": "v1/{+name}:cancel" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be deleted.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", + "id": "dataproc.projects.regions.operations.delete", + "path": "v1/{+name}", + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED." + } + } + }, + "jobs": { + "methods": { + "patch": { "request": { "$ref": "Job" }, "description": "Updates a job in a project.", - "response": { - "$ref": "Job" - }, + "httpMethod": "PATCH", "parameterOrder": [ "projectId", "region", "jobId" ], - "httpMethod": "PATCH", - "parameters": { - "region": { - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string", - "location": "path" - }, - "updateMask": { - "type": "string", - "location": "query", - "description": "Required. Specifies the path, relative to \u003ccode\u003eJob\u003c/code\u003e, of the field to update. For example, to update the labels of a Job the \u003ccode\u003eupdate_mask\u003c/code\u003e parameter would be specified as \u003ccode\u003elabels\u003c/code\u003e, and the PATCH request body would specify the new value. \u003cstrong\u003eNote:\u003c/strong\u003e Currently, \u003ccode\u003elabels\u003c/code\u003e is the only field that can be updated.", - "format": "google-fieldmask" - }, - "projectId": { - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" - }, - "jobId": { - "location": "path", - "description": "Required. The job ID.", - "required": true, - "type": "string" - } + "response": { + "$ref": "Job" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}" + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Required. Specifies the path, relative to \u003ccode\u003eJob\u003c/code\u003e, of the field to update. For example, to update the labels of a Job the \u003ccode\u003eupdate_mask\u003c/code\u003e parameter would be specified as \u003ccode\u003elabels\u003c/code\u003e, and the PATCH request body would specify the new value. \u003cstrong\u003eNote:\u003c/strong\u003e Currently, \u003ccode\u003elabels\u003c/code\u003e is the only field that can be updated.", + "type": "string", + "location": "query" + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + }, + "jobId": { + "location": "path", + "description": "Required. The job ID.", + "type": "string", + "required": true + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.patch" }, "get": { + "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.get", + "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", "description": "Gets the resource representation for a job in a project.", - "httpMethod": "GET", + "response": { + "$ref": "Job" + }, "parameterOrder": [ "projectId", "region", "jobId" ], - "response": { - "$ref": "Job" - }, - "parameters": { - "region": { - "location": "path", - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string" - }, - "projectId": { - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "required": true, - "type": "string", - "location": "path" - }, - "jobId": { - "description": "Required. The job ID.", - "required": true, - "type": "string", - "location": "path" - } - }, + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", - "id": "dataproc.projects.regions.jobs.get", - "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}" + "parameters": { + "region": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request." + }, + "jobId": { + "location": "path", + "description": "Required. The job ID.", + "type": "string", + "required": true + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + } + } }, "submit": { + "flatPath": "v1/projects/{projectId}/regions/{region}/jobs:submit", + "path": "v1/projects/{projectId}/regions/{region}/jobs:submit", + "id": "dataproc.projects.regions.jobs.submit", + "request": { + "$ref": "SubmitJobRequest" + }, + "description": "Submits a job to a cluster.", "httpMethod": "POST", "parameterOrder": [ "projectId", @@ -148,27 +488,24 @@ ], "parameters": { "region": { - "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", "required": true, - "type": "string" + "location": "path" }, "projectId": { - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "required": true, "type": "string", - "location": "path" + "required": true, + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to." } - }, - "flatPath": "v1/projects/{projectId}/regions/{region}/jobs:submit", - "id": "dataproc.projects.regions.jobs.submit", - "path": "v1/projects/{projectId}/regions/{region}/jobs:submit", - "description": "Submits a job to a cluster.", - "request": { - "$ref": "SubmitJobRequest" } }, "delete": { + "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.delete", + "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.", "response": { "$ref": "Empty" }, @@ -179,50 +516,43 @@ ], "httpMethod": "DELETE", "parameters": { + "jobId": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. The job ID." + }, "projectId": { "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "required": true, "type": "string", + "required": true, "location": "path" }, - "jobId": { - "location": "path", - "description": "Required. The job ID.", - "required": true, - "type": "string" - }, "region": { - "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", "required": true, - "type": "string" + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", - "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", - "id": "dataproc.projects.regions.jobs.delete", - "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION." + ] }, "list": { - "httpMethod": "GET", + "response": { + "$ref": "ListJobsResponse" + }, "parameterOrder": [ "projectId", "region" ], - "response": { - "$ref": "ListJobsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "httpMethod": "GET", "parameters": { "filter": { - "location": "query", "description": "Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or INACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = *", - "type": "string" + "type": "string", + "location": "query" }, "jobStateMatcher": { "description": "Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs).", @@ -241,401 +571,76 @@ }, "pageSize": { "location": "query", - "description": "Optional. The number of results to return in each response.", "format": "int32", + "description": "Optional. The number of results to return in each response.", "type": "integer" }, "region": { + "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, "type": "string", - "location": "path" + "required": true }, "clusterName": { - "location": "query", "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", - "type": "string" + "type": "string", + "location": "query" }, "projectId": { "location": "path", "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "flatPath": "v1/projects/{projectId}/regions/{region}/jobs", "id": "dataproc.projects.regions.jobs.list", "path": "v1/projects/{projectId}/regions/{region}/jobs", "description": "Lists regions/{region}/jobs in a project." - } - } - }, - "clusters": { - "methods": { - "create": { - "path": "v1/projects/{projectId}/regions/{region}/clusters", - "id": "dataproc.projects.regions.clusters.create", - "description": "Creates a cluster in a project.", - "request": { - "$ref": "Cluster" - }, - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "region" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "region": { - "location": "path", - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string" - }, - "projectId": { - "required": true, - "type": "string", - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to." - } - }, - "flatPath": "v1/projects/{projectId}/regions/{region}/clusters" - }, - "patch": { - "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", - "id": "dataproc.projects.regions.clusters.patch", - "description": "Updates a cluster in a project.", - "request": { - "$ref": "Cluster" - }, - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "region", - "clusterName" - ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "clusterName": { - "description": "Required. The cluster name.", - "required": true, - "type": "string", - "location": "path" - }, - "projectId": { - "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", - "required": true, - "type": "string", - "location": "path" - }, - "region": { - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string", - "location": "path" - }, - "updateMask": { - "description": "Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:\n{\n \"config\":{\n \"workerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\nSimilarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:\n{\n \"config\":{\n \"secondaryWorkerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\n\u003cstrong\u003eNote:\u003c/strong\u003e Currently, only the following fields can be updated:\u003ctable\u003e \u003ctbody\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003elabels\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eUpdate labels\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003econfig.worker_config.num_instances\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eResize primary worker group\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003econfig.secondary_worker_config.num_instances\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eResize secondary worker group\u003c/td\u003e \u003c/tr\u003e \u003c/tbody\u003e \u003c/table\u003e", - "format": "google-fieldmask", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}" - }, - "get": { - "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", - "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", - "id": "dataproc.projects.regions.clusters.get", - "description": "Gets the resource representation for a cluster in a project.", - "response": { - "$ref": "Cluster" - }, - "parameterOrder": [ - "projectId", - "region", - "clusterName" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "clusterName": { - "description": "Required. The cluster name.", - "required": true, - "type": "string", - "location": "path" - }, - "projectId": { - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", - "required": true, - "type": "string" - }, - "region": { - "location": "path", - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string" - } - } - }, - "delete": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "clusterName": { - "description": "Required. The cluster name.", - "required": true, - "type": "string", - "location": "path" - }, - "projectId": { - "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", - "required": true, - "type": "string", - "location": "path" - }, - "region": { - "location": "path", - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", - "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", - "id": "dataproc.projects.regions.clusters.delete", - "description": "Deletes a cluster in a project.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "region", - "clusterName" - ], - "httpMethod": "DELETE" - }, - "diagnose": { - "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", - "id": "dataproc.projects.regions.clusters.diagnose", - "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.", - "request": { - "$ref": "DiagnoseClusterRequest" - }, - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "region", - "clusterName" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "clusterName": { - "location": "path", - "description": "Required. The cluster name.", - "required": true, - "type": "string" - }, - "projectId": { - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", - "required": true, - "type": "string" - }, - "region": { - "location": "path", - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose" - }, - "list": { - "id": "dataproc.projects.regions.clusters.list", - "path": "v1/projects/{projectId}/regions/{region}/clusters", - "description": "Lists all regions/{region}/clusters in a project.", - "httpMethod": "GET", - "parameterOrder": [ - "projectId", - "region" - ], - "response": { - "$ref": "ListClustersResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "region": { - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "required": true, - "type": "string", - "location": "path" - }, - "filter": { - "description": "Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *", - "type": "string", - "location": "query" - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "Optional. The standard List page token." - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "Optional. The standard List page size.", - "format": "int32" - }, - "projectId": { - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectId}/regions/{region}/clusters" - } - } - }, - "operations": { - "methods": { - "list": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ListOperationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation collection.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/regions/[^/]+/operations$" - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The standard list page size.", - "format": "int32", - "type": "integer" - }, - "filter": { - "type": "string", - "location": "query", - "description": "The standard list filter." - } - }, - "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations", - "id": "dataproc.projects.regions.operations.list", - "path": "v1/{+name}" - }, - "get": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "parameters": { - "name": { - "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", - "location": "path", - "description": "The name of the operation resource.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", - "path": "v1/{+name}", - "id": "dataproc.projects.regions.operations.get", - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." }, "cancel": { - "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [ + "projectId", + "region", + "jobId" + ], "httpMethod": "POST", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation resource to be cancelled.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", - "id": "dataproc.projects.regions.operations.cancel", - "path": "v1/{+name}:cancel" - }, - "delete": { - "path": "v1/{+name}", - "id": "dataproc.projects.regions.operations.delete", - "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "name": { + "region": { "location": "path", - "description": "The name of the operation resource to be deleted.", - "required": true, + "description": "Required. The Cloud Dataproc region in which to handle the request.", "type": "string", - "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$" + "required": true + }, + "jobId": { + "location": "path", + "description": "Required. The job ID.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true } }, - "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}" + "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", + "id": "dataproc.projects.regions.jobs.cancel", + "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", + "request": { + "$ref": "CancelJobRequest" + }, + "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get." } } } @@ -645,67 +650,9 @@ } }, "parameters": { - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, "alt": { + "description": "Data format for response.", + "default": "json", "enum": [ "json", "media", @@ -717,34 +664,334 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query", - "description": "Data format for response.", - "default": "json" + "location": "query" }, "access_token": { - "location": "query", "description": "OAuth access token.", - "type": "string" + "type": "string", + "location": "query" }, "key": { "location": "query", "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.", "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "type": "string", + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" } }, "schemas": { + "AcceleratorConfig": { + "description": "Specifies the type and number of accelerator cards attached to the instances of an instance group (see GPUs on Compute Engine).", + "type": "object", + "properties": { + "acceleratorTypeUri": { + "description": "Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( /compute/docs/reference/beta/acceleratorTypes)Examples * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80", + "type": "string" + }, + "acceleratorCount": { + "format": "int32", + "description": "The number of the accelerator cards of this type exposed to this instance.", + "type": "integer" + } + }, + "id": "AcceleratorConfig" + }, + "ClusterMetrics": { + "description": "Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", + "type": "object", + "properties": { + "hdfsMetrics": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "The HDFS metrics.", + "type": "object" + }, + "yarnMetrics": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "The YARN metrics.", + "type": "object" + } + }, + "id": "ClusterMetrics" + }, + "LoggingConfig": { + "description": "The runtime logging config of the job.", + "type": "object", + "properties": { + "driverLogLevels": { + "additionalProperties": { + "type": "string", + "enum": [ + "LEVEL_UNSPECIFIED", + "ALL", + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + }, + "description": "The per-package log levels for the driver. This may include \"root\" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'", + "type": "object" + } + }, + "id": "LoggingConfig" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object", + "properties": { + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, + "response": { + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" + } + }, + "id": "Operation" + }, + "JobReference": { + "description": "Encapsulates the full scoping used to reference a job.", + "type": "object", + "properties": { + "jobId": { + "description": "Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters.", + "type": "string" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string" + } + }, + "id": "JobReference" + }, + "SubmitJobRequest": { + "type": "object", + "properties": { + "job": { + "$ref": "Job", + "description": "Required. The job resource." + } + }, + "id": "SubmitJobRequest", + "description": "A request to submit a job." + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + } + }, + "id": "Status" + }, + "InstanceGroupConfig": { + "id": "InstanceGroupConfig", + "description": "Optional. The config settings for Google Compute Engine resources in an instance group, such as a master or worker group.", + "type": "object", + "properties": { + "diskConfig": { + "description": "Optional. Disk option config settings.", + "$ref": "DiskConfig" + }, + "machineTypeUri": { + "description": "Optional. The Google Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2\nprojects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2\nn1-standard-2", + "type": "string" + }, + "imageUri": { + "type": "string", + "description": "Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version." + }, + "managedGroupConfig": { + "description": "Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups.", + "$ref": "ManagedGroupConfig" + }, + "isPreemptible": { + "type": "boolean", + "description": "Optional. Specifies that this instance group contains preemptible instances." + }, + "instanceNames": { + "description": "Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user (recommended practice is to let Cloud Dataproc derive the name).", + "items": { + "type": "string" + }, + "type": "array" + }, + "accelerators": { + "items": { + "$ref": "AcceleratorConfig" + }, + "type": "array", + "description": "Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release." + }, + "numInstances": { + "format": "int32", + "description": "Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1.", + "type": "integer" + } + } + }, + "JobScheduling": { + "type": "object", + "properties": { + "maxFailuresPerHour": { + "format": "int32", + "description": "Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10.", + "type": "integer" + } + }, + "id": "JobScheduling", + "description": "Job scheduling options.Beta Feature: These options are available for testing purposes only. They may be changed before final release." + }, + "ListJobsResponse": { + "description": "A list of jobs in a project.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent \u003ccode\u003eListJobsRequest\u003c/code\u003e.", + "type": "string" + }, + "jobs": { + "description": "Output-only. Jobs list.", + "items": { + "$ref": "Job" + }, + "type": "array" + } + }, + "id": "ListJobsResponse" + }, + "NodeInitializationAction": { + "description": "Specifies an executable to run on a fully configured node and a timeout period for executable completion.", + "type": "object", + "properties": { + "executionTimeout": { + "format": "google-duration", + "description": "Optional. Amount of time executable has to complete. Default is 10 minutes. Cluster creation fails with an explanatory error message (the name of the executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period.", + "type": "string" + }, + "executableFile": { + "description": "Required. Google Cloud Storage URI of executable file.", + "type": "string" + } + }, + "id": "NodeInitializationAction" + }, + "CancelJobRequest": { + "properties": {}, + "id": "CancelJobRequest", + "description": "A request to cancel a job.", + "type": "object" + }, "SparkSqlJob": { "description": "A Cloud Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries.", "type": "object", "properties": { - "queryFileUri": { - "description": "The HCFS URI of the script that contains SQL queries.", - "type": "string" - }, - "queryList": { - "description": "A list of queries.", - "$ref": "QueryList" - }, "scriptVariables": { "additionalProperties": { "type": "string" @@ -753,15 +1000,15 @@ "type": "object" }, "jarFileUris": { - "type": "array", + "description": "Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.", "items": { "type": "string" }, - "description": "Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH." + "type": "array" }, "loggingConfig": { - "description": "Optional. The runtime log config for job execution.", - "$ref": "LoggingConfig" + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." }, "properties": { "additionalProperties": { @@ -769,14 +1016,19 @@ }, "description": "Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Cloud Dataproc API may be overwritten.", "type": "object" + }, + "queryFileUri": { + "description": "The HCFS URI of the script that contains SQL queries.", + "type": "string" + }, + "queryList": { + "description": "A list of queries.", + "$ref": "QueryList" } }, "id": "SparkSqlJob" }, "Cluster": { - "id": "Cluster", - "description": "Describes the identifying information, config, and status of a cluster of Google Compute Engine instances.", - "type": "object", "properties": { "labels": { "additionalProperties": { @@ -786,135 +1038,73 @@ "type": "object" }, "metrics": { - "description": "Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", - "$ref": "ClusterMetrics" + "$ref": "ClusterMetrics", + "description": "Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release." }, "status": { "description": "Output-only. Cluster status.", "$ref": "ClusterStatus" }, + "config": { + "description": "Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated.", + "$ref": "ClusterConfig" + }, "statusHistory": { "description": "Output-only. The previous cluster status.", - "type": "array", "items": { "$ref": "ClusterStatus" - } - }, - "config": { - "$ref": "ClusterConfig", - "description": "Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated." - }, - "clusterName": { - "description": "Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused.", - "type": "string" + }, + "type": "array" }, "clusterUuid": { "description": "Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster.", "type": "string" }, + "clusterName": { + "description": "Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused.", + "type": "string" + }, "projectId": { "description": "Required. The Google Cloud Platform project ID that the cluster belongs to.", "type": "string" } - } + }, + "id": "Cluster", + "description": "Describes the identifying information, config, and status of a cluster of Google Compute Engine instances.", + "type": "object" }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "type": "object", "properties": { - "operations": { - "type": "array", - "items": { - "$ref": "Operation" - }, - "description": "A list of operations that matches the specified filter in the request." - }, "nextPageToken": { "description": "The standard List next-page token.", "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" } }, "id": "ListOperationsResponse" }, - "OperationMetadata": { - "id": "OperationMetadata", - "description": "Metadata describing the operation.", + "JobPlacement": { + "description": "Cloud Dataproc job config.", "type": "object", "properties": { - "endTime": { - "description": "The time that the operation completed.", - "format": "google-datetime", + "clusterUuid": { + "description": "Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted.", "type": "string" }, - "startTime": { - "description": "The time that the operation was started by the server.", - "format": "google-datetime", - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Output-only Errors encountered during operation execution." - }, - "insertTime": { - "description": "The time that the operation was requested.", - "format": "google-datetime", - "type": "string" - }, - "statusHistory": { - "description": "Output-only Previous operation status.", - "type": "array", - "items": { - "$ref": "OperationStatus" - } - }, - "operationType": { - "description": "Output-only The operation type.", - "type": "string" - }, - "description": { - "description": "Output-only Short description of operation.", - "type": "string" - }, - "status": { - "description": "Output-only Current operation status.", - "$ref": "OperationStatus" - }, - "details": { - "type": "string", - "description": "A message containing any operation metadata details." - }, - "state": { - "description": "A message containing the operation state.", - "type": "string", - "enumDescriptions": [ - "Unused.", - "The operation has been created.", - "The operation is currently running.", - "The operation is done, either cancelled or completed." - ], - "enum": [ - "UNKNOWN", - "PENDING", - "RUNNING", - "DONE" - ] - }, "clusterName": { - "description": "Name of the cluster for the operation.", - "type": "string" - }, - "clusterUuid": { - "description": "Cluster UUId for the operation.", - "type": "string" - }, - "innerState": { - "description": "A message containing the detailed operation state.", + "description": "Required. The name of the cluster where the job will be submitted.", "type": "string" } - } + }, + "id": "JobPlacement" }, "SoftwareConfig": { "description": "Specifies the selection and config of software inside the cluster.", @@ -925,31 +1115,18 @@ "type": "string" }, "properties": { + "description": "Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, such as core:fs.defaultFS. The following are supported prefixes and their mappings:\ncapacity-scheduler: capacity-scheduler.xml\ncore: core-site.xml\ndistcp: distcp-default.xml\nhdfs: hdfs-site.xml\nhive: hive-site.xml\nmapred: mapred-site.xml\npig: pig.properties\nspark: spark-defaults.conf\nyarn: yarn-site.xmlFor more information, see Cluster properties.", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, such as core:fs.defaultFS. The following are supported prefixes and their mappings:\ncapacity-scheduler: capacity-scheduler.xml\ncore: core-site.xml\ndistcp: distcp-default.xml\nhdfs: hdfs-site.xml\nhive: hive-site.xml\nmapred: mapred-site.xml\npig: pig.properties\nspark: spark-defaults.conf\nyarn: yarn-site.xml", - "type": "object" + } } }, "id": "SoftwareConfig" }, - "JobPlacement": { - "properties": { - "clusterName": { - "description": "Required. The name of the cluster where the job will be submitted.", - "type": "string" - }, - "clusterUuid": { - "description": "Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted.", - "type": "string" - } - }, - "id": "JobPlacement", - "description": "Cloud Dataproc job config.", - "type": "object" - }, "ClusterStatus": { + "description": "The status of a cluster and its instances.", + "type": "object", "properties": { "detail": { "description": "Output-only. Optional details of cluster's state.", @@ -975,46 +1152,32 @@ "description": "Output-only. The cluster's state.", "type": "string" }, - "stateStartTime": { - "type": "string", - "description": "Output-only. Time when this state was entered.", - "format": "google-datetime" - }, "substate": { - "enumDescriptions": [ - "", - "The cluster is known to be in an unhealthy state (for example, critical daemons are not running or HDFS capacity is exhausted).Applies to RUNNING state.", - "The agent-reported status is out of date (may occur if Cloud Dataproc loses communication with Agent).Applies to RUNNING state." - ], "enum": [ "UNSPECIFIED", "UNHEALTHY", "STALE_STATUS" ], "description": "Output-only. Additional state information that includes status reported by the agent.", + "type": "string", + "enumDescriptions": [ + "", + "The cluster is known to be in an unhealthy state (for example, critical daemons are not running or HDFS capacity is exhausted).Applies to RUNNING state.", + "The agent-reported status is out of date (may occur if Cloud Dataproc loses communication with Agent).Applies to RUNNING state." + ] + }, + "stateStartTime": { + "format": "google-datetime", + "description": "Output-only. Time when this state was entered.", "type": "string" } }, - "id": "ClusterStatus", - "description": "The status of a cluster and its instances.", - "type": "object" + "id": "ClusterStatus" }, "PigJob": { - "id": "PigJob", "description": "A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN.", "type": "object", "properties": { - "loggingConfig": { - "description": "Optional. The runtime log config for job execution.", - "$ref": "LoggingConfig" - }, - "properties": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code.", - "type": "object" - }, "continueOnFailure": { "description": "Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.", "type": "boolean" @@ -1028,11 +1191,11 @@ "type": "string" }, "jarFileUris": { - "type": "array", + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.", "items": { "type": "string" }, - "description": "Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs." + "type": "array" }, "scriptVariables": { "additionalProperties": { @@ -1040,91 +1203,136 @@ }, "description": "Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]).", "type": "object" + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "description": "Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code.", + "type": "object", + "additionalProperties": { + "type": "string" + } } - } + }, + "id": "PigJob" }, "ListClustersResponse": { "properties": { - "clusters": { - "description": "Output-only. The clusters in the project.", - "type": "array", - "items": { - "$ref": "Cluster" - } - }, "nextPageToken": { "description": "Output-only. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent ListClustersRequest.", "type": "string" + }, + "clusters": { + "description": "Output-only. The clusters in the project.", + "items": { + "$ref": "Cluster" + }, + "type": "array" } }, "id": "ListClustersResponse", "description": "The list of all clusters in a project.", "type": "object" }, - "Job": { - "description": "A Cloud Dataproc job resource.", + "SparkJob": { + "description": "A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN.", "type": "object", "properties": { - "scheduling": { - "$ref": "JobScheduling", - "description": "Optional. Job scheduling configuration." + "mainJarFileUri": { + "description": "The HCFS URI of the jar file that contains the main class.", + "type": "string" }, - "pigJob": { - "$ref": "PigJob", - "description": "Job is a Pig job." - }, - "hiveJob": { - "$ref": "HiveJob", - "description": "Job is a Hive job." - }, - "labels": { - "additionalProperties": { + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks.", + "items": { "type": "string" }, - "description": "Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job.", - "type": "object" + "type": "array" }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "description": "Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "args": { + "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", + "items": { + "type": "string" + }, + "type": "array" + }, + "fileUris": { + "description": "Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainClass": { + "type": "string", + "description": "The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris." + }, + "archiveUris": { + "description": "Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "SparkJob" + }, + "Job": { + "properties": { "driverOutputResourceUri": { "type": "string", "description": "Output-only. A URI pointing to the location of the stdout of the job's driver program." }, "statusHistory": { "description": "Output-only. The previous job status.", - "type": "array", "items": { "$ref": "JobStatus" - } - }, - "sparkJob": { - "$ref": "SparkJob", - "description": "Job is a Spark job." + }, + "type": "array" }, "sparkSqlJob": { - "$ref": "SparkSqlJob", - "description": "Job is a SparkSql job." + "description": "Job is a SparkSql job.", + "$ref": "SparkSqlJob" + }, + "sparkJob": { + "description": "Job is a Spark job.", + "$ref": "SparkJob" }, "yarnApplications": { "description": "Output-only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", - "type": "array", "items": { "$ref": "YarnApplication" - } + }, + "type": "array" }, "pysparkJob": { - "$ref": "PySparkJob", - "description": "Job is a Pyspark job." + "description": "Job is a Pyspark job.", + "$ref": "PySparkJob" }, "reference": { - "$ref": "JobReference", - "description": "Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not specified when a job is created, the server generates a \u003ccode\u003ejob_id\u003c/code\u003e." + "description": "Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not specified when a job is created, the server generates a \u003ccode\u003ejob_id\u003c/code\u003e.", + "$ref": "JobReference" }, "hadoopJob": { "description": "Job is a Hadoop job.", "$ref": "HadoopJob" }, "status": { - "$ref": "JobStatus", - "description": "Output-only. The job status. Additional application-specific status information may be contained in the \u003ccode\u003etype_job\u003c/code\u003e and \u003ccode\u003eyarn_applications\u003c/code\u003e fields." + "description": "Output-only. The job status. Additional application-specific status information may be contained in the \u003ccode\u003etype_job\u003c/code\u003e and \u003ccode\u003eyarn_applications\u003c/code\u003e fields.", + "$ref": "JobStatus" }, "placement": { "$ref": "JobPlacement", @@ -1133,67 +1341,60 @@ "driverControlFilesUri": { "description": "Output-only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files may be placed in the same location as driver_output_uri.", "type": "string" - } - }, - "id": "Job" - }, - "SparkJob": { - "description": "A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN.", - "type": "object", - "properties": { - "fileUris": { - "description": "Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks.", - "type": "array", - "items": { - "type": "string" - } }, - "mainClass": { - "description": "The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris.", - "type": "string" + "scheduling": { + "$ref": "JobScheduling", + "description": "Optional. Job scheduling configuration." }, - "archiveUris": { - "description": "Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.", - "type": "array", - "items": { - "type": "string" - } + "pigJob": { + "description": "Job is a Pig job.", + "$ref": "PigJob" }, - "mainJarFileUri": { - "type": "string", - "description": "The HCFS URI of the jar file that contains the main class." + "hiveJob": { + "description": "Job is a Hive job.", + "$ref": "HiveJob" }, - "jarFileUris": { - "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks.", - "type": "array", - "items": { - "type": "string" - } - }, - "loggingConfig": { - "$ref": "LoggingConfig", - "description": "Optional. The runtime log config for job execution." - }, - "properties": { + "labels": { "additionalProperties": { "type": "string" }, - "description": "Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.", + "description": "Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job.", "type": "object" - }, - "args": { - "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", - "type": "array", - "items": { - "type": "string" - } } }, - "id": "SparkJob" + "id": "Job", + "description": "A Cloud Dataproc job resource.", + "type": "object" }, "JobStatus": { + "description": "Cloud Dataproc job status.", "type": "object", "properties": { + "substate": { + "description": "Output-only. Additional state information, which includes status reported by the agent.", + "type": "string", + "enumDescriptions": [ + "", + "The Job is submitted to the agent.Applies to RUNNING state.", + "The Job has been received and is awaiting execution (it may be waiting for a condition to be met). See the \"details\" field for the reason for the delay.Applies to RUNNING state.", + "The agent-reported status is out of date, which may be caused by a loss of communication between the agent and Cloud Dataproc. If the agent does not send a timely update, the job will fail.Applies to RUNNING state." + ], + "enum": [ + "UNSPECIFIED", + "SUBMITTED", + "QUEUED", + "STALE_STATUS" + ] + }, + "stateStartTime": { + "format": "google-datetime", + "description": "Output-only. The time when this state was entered.", + "type": "string" + }, + "details": { + "type": "string", + "description": "Output-only. Optional job state details, such as an error description if the state is \u003ccode\u003eERROR\u003c/code\u003e." + }, "state": { "enum": [ "STATE_UNSPECIFIED", @@ -1221,35 +1422,9 @@ "The job has completed, but encountered an error.", "Job attempt has failed. The detail field contains failure details for this attempt.Applies to restartable jobs only." ] - }, - "details": { - "description": "Output-only. Optional job state details, such as an error description if the state is \u003ccode\u003eERROR\u003c/code\u003e.", - "type": "string" - }, - "stateStartTime": { - "description": "Output-only. The time when this state was entered.", - "format": "google-datetime", - "type": "string" - }, - "substate": { - "description": "Output-only. Additional state information, which includes status reported by the agent.", - "type": "string", - "enumDescriptions": [ - "", - "The Job is submitted to the agent.Applies to RUNNING state.", - "The Job has been received and is awaiting execution (it may be waiting for a condition to be met). See the \"details\" field for the reason for the delay.Applies to RUNNING state.", - "The agent-reported status is out of date, which may be caused by a loss of communication between the agent and Cloud Dataproc. If the agent does not send a timely update, the job will fail.Applies to RUNNING state." - ], - "enum": [ - "UNSPECIFIED", - "SUBMITTED", - "QUEUED", - "STALE_STATUS" - ] } }, - "id": "JobStatus", - "description": "Cloud Dataproc job status." + "id": "JobStatus" }, "ManagedGroupConfig": { "description": "Specifies the resources used to actively manage an instance group.", @@ -1267,20 +1442,20 @@ "id": "ManagedGroupConfig" }, "ClusterOperationStatus": { - "id": "ClusterOperationStatus", "description": "The status of the operation.", "type": "object", "properties": { - "innerState": { - "description": "Output-only. A message containing the detailed operation state.", + "stateStartTime": { + "format": "google-datetime", + "description": "Output-only. The time this state was entered.", "type": "string" }, - "stateStartTime": { - "description": "Output-only. The time this state was entered.", - "format": "google-datetime", + "details": { + "description": "Output-only.A message containing any operation metadata details.", "type": "string" }, "state": { + "description": "Output-only. A message containing the operation state.", "type": "string", "enumDescriptions": [ "Unused.", @@ -1293,19 +1468,100 @@ "PENDING", "RUNNING", "DONE" - ], - "description": "Output-only. A message containing the operation state." + ] }, - "details": { - "description": "Output-only.A message containing any operation metadata details.", + "innerState": { + "description": "Output-only. A message containing the detailed operation state.", "type": "string" } - } + }, + "id": "ClusterOperationStatus" + }, + "HadoopJob": { + "description": "A Cloud Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).", + "type": "object", + "properties": { + "fileUris": { + "description": "Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainClass": { + "description": "The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris.", + "type": "string" + }, + "archiveUris": { + "description": "Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainJarFileUri": { + "description": "The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'", + "type": "string" + }, + "jarFileUris": { + "description": "Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "loggingConfig": { + "description": "Optional. The runtime log config for job execution.", + "$ref": "LoggingConfig" + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code.", + "type": "object" + }, + "args": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a collision may occur that causes an incorrect job submission." + } + }, + "id": "HadoopJob" + }, + "QueryList": { + "description": "A list of queries to run on a cluster.", + "type": "object", + "properties": { + "queries": { + "description": "Required. The queries to execute. You do not need to terminate a query with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of an Cloud Dataproc API snippet that uses a QueryList to specify a HiveJob:\n\"hiveJob\": {\n \"queryList\": {\n \"queries\": [\n \"query1\",\n \"query2\",\n \"query3;query4\",\n ]\n }\n}\n", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "QueryList" }, "YarnApplication": { "description": "A YARN application created by a job. Application information is a subset of \u003ccode\u003eorg.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto\u003c/code\u003e.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", "type": "object", "properties": { + "name": { + "description": "Required. The application name.", + "type": "string" + }, + "trackingUrl": { + "description": "Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access.", + "type": "string" + }, + "progress": { + "format": "float", + "description": "Required. The numerical progress of the application, from 1 to 100.", + "type": "number" + }, "state": { "enum": [ "STATE_UNSPECIFIED", @@ -1331,91 +1587,10 @@ "Status is FAILED.", "Status is KILLED." ] - }, - "name": { - "description": "Required. The application name.", - "type": "string" - }, - "trackingUrl": { - "description": "Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access.", - "type": "string" - }, - "progress": { - "description": "Required. The numerical progress of the application, from 1 to 100.", - "format": "float", - "type": "number" } }, "id": "YarnApplication" }, - "QueryList": { - "description": "A list of queries to run on a cluster.", - "type": "object", - "properties": { - "queries": { - "description": "Required. The queries to execute. You do not need to terminate a query with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of an Cloud Dataproc API snippet that uses a QueryList to specify a HiveJob:\n\"hiveJob\": {\n \"queryList\": {\n \"queries\": [\n \"query1\",\n \"query2\",\n \"query3;query4\",\n ]\n }\n}\n", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "QueryList" - }, - "HadoopJob": { - "properties": { - "jarFileUris": { - "description": "Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks.", - "type": "array", - "items": { - "type": "string" - } - }, - "loggingConfig": { - "$ref": "LoggingConfig", - "description": "Optional. The runtime log config for job execution." - }, - "properties": { - "description": "Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "args": { - "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", - "type": "array", - "items": { - "type": "string" - } - }, - "fileUris": { - "description": "Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks.", - "type": "array", - "items": { - "type": "string" - } - }, - "mainClass": { - "description": "The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris.", - "type": "string" - }, - "archiveUris": { - "description": "Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip.", - "type": "array", - "items": { - "type": "string" - } - }, - "mainJarFileUri": { - "description": "The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'", - "type": "string" - } - }, - "id": "HadoopJob", - "description": "A Cloud Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).", - "type": "object" - }, "DiagnoseClusterRequest": { "description": "A request to collect cluster diagnostic information.", "type": "object", @@ -1423,50 +1598,43 @@ "id": "DiagnoseClusterRequest" }, "DiskConfig": { + "description": "Specifies the config of disk options for a group of VM instances.", + "type": "object", "properties": { "numLocalSsds": { - "description": "Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and the boot disk contains only basic config and installed binaries.", "format": "int32", + "description": "Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and the boot disk contains only basic config and installed binaries.", "type": "integer" }, "bootDiskSizeGb": { - "description": "Optional. Size in GB of the boot disk (default is 500GB).", "format": "int32", + "description": "Optional. Size in GB of the boot disk (default is 500GB).", "type": "integer" } }, - "id": "DiskConfig", - "description": "Specifies the config of disk options for a group of VM instances.", - "type": "object" + "id": "DiskConfig" }, "ClusterOperationMetadata": { "description": "Metadata describing the operation.", "type": "object", "properties": { - "warnings": { - "description": "Output-only. Errors encountered during operation execution.", - "type": "array", - "items": { - "type": "string" - } - }, "labels": { - "type": "object", "additionalProperties": { "type": "string" }, - "description": "Output-only. Labels associated with the operation" + "description": "Output-only. Labels associated with the operation", + "type": "object" }, "status": { - "$ref": "ClusterOperationStatus", - "description": "Output-only. Current operation status." + "description": "Output-only. Current operation status.", + "$ref": "ClusterOperationStatus" }, "statusHistory": { - "description": "Output-only. The previous operation status.", - "type": "array", "items": { "$ref": "ClusterOperationStatus" - } + }, + "type": "array", + "description": "Output-only. The previous operation status." }, "clusterUuid": { "description": "Output-only. Cluster UUID for the operation.", @@ -1483,6 +1651,13 @@ "description": { "description": "Output-only. Short description of operation.", "type": "string" + }, + "warnings": { + "description": "Output-only. Errors encountered during operation execution.", + "items": { + "type": "string" + }, + "type": "array" } }, "id": "ClusterOperationMetadata" @@ -1495,26 +1670,26 @@ "description": "Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.", "type": "boolean" }, - "queryList": { - "description": "A list of queries.", - "$ref": "QueryList" - }, "queryFileUri": { "description": "The HCFS URI of the script that contains Hive queries.", "type": "string" }, - "scriptVariables": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name=\"value\";).", - "type": "object" + "queryList": { + "description": "A list of queries.", + "$ref": "QueryList" }, "jarFileUris": { "description": "Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs.", - "type": "array", "items": { "type": "string" + }, + "type": "array" + }, + "scriptVariables": { + "description": "Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name=\"value\";).", + "type": "object", + "additionalProperties": { + "type": "string" } }, "properties": { @@ -1528,21 +1703,21 @@ "id": "HiveJob" }, "Empty": { - "type": "object", - "properties": {}, "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON 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:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object", + "properties": {} }, "DiagnoseClusterResults": { - "description": "The location of diagnostic output.", - "type": "object", "properties": { "outputUri": { "description": "Output-only. The Google Cloud Storage URI of the diagnostic output. The output report is a plain text file with a summary of collected diagnostics.", "type": "string" } }, - "id": "DiagnoseClusterResults" + "id": "DiagnoseClusterResults", + "description": "The location of diagnostic output.", + "type": "object" }, "ClusterConfig": { "description": "The cluster config.", @@ -1550,10 +1725,10 @@ "properties": { "initializationActions": { "description": "Optional. Commands to execute on each node after config is completed. By default, executables are run on master and all worker nodes. You can test a node's role metadata to run an executable on a master or worker node, as shown below using curl (you can also use wget):\nROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)\nif [[ \"${ROLE}\" == 'Master' ]]; then\n ... master specific actions ...\nelse\n ... worker specific actions ...\nfi\n", - "type": "array", "items": { "$ref": "NodeInitializationAction" - } + }, + "type": "array" }, "configBucket": { "description": "Optional. A Google Cloud Storage staging bucket used for sharing generated SSH keys and config. If you do not specify a staging bucket, Cloud Dataproc will determine an appropriate Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone where your cluster is deployed, and then it will create and manage this project-level, per-location bucket for you.", @@ -1564,8 +1739,8 @@ "description": "Optional. The Google Compute Engine config settings for worker instances in a cluster." }, "gceClusterConfig": { - "$ref": "GceClusterConfig", - "description": "Required. The shared Google Compute Engine config settings for all instances in a cluster." + "description": "Required. The shared Google Compute Engine config settings for all instances in a cluster.", + "$ref": "GceClusterConfig" }, "softwareConfig": { "$ref": "SoftwareConfig", @@ -1583,47 +1758,37 @@ "id": "ClusterConfig" }, "PySparkJob": { + "id": "PySparkJob", "description": "A Cloud Dataproc job for running Apache PySpark (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN.", "type": "object", "properties": { - "jarFileUris": { - "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks.", - "type": "array", - "items": { - "type": "string" - } - }, - "loggingConfig": { - "$ref": "LoggingConfig", - "description": "Optional. The runtime log config for job execution." - }, "properties": { + "description": "Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.", - "type": "object" + } }, "args": { - "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array", + "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission." }, "fileUris": { "description": "Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "pythonFileUris": { "description": "Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "mainPythonFileUri": { "description": "Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file.", @@ -1631,24 +1796,42 @@ }, "archiveUris": { "description": "Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." } - }, - "id": "PySparkJob" + } }, "GceClusterConfig": { "description": "Common config settings for resources of Google Compute Engine cluster instances, applicable to all instances in the cluster.", "type": "object", "properties": { + "networkUri": { + "description": "Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the \"default\" network of the project is used, if it exists. Cannot be a \"Custom Subnet Network\" (see Using Subnetworks for more information).A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default\nprojects/[project_id]/regions/global/default\ndefault", + "type": "string" + }, + "zoneUri": { + "description": "Optional. The zone where the Google Compute Engine cluster will be located. On a create request, it is required in the \"global\" region. If omitted in a non-global Cloud Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be present.A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]\nprojects/[project_id]/zones/[zone]\nus-central1-f", + "type": "string" + }, "metadata": { + "description": "The Google Compute Engine metadata entries to add to all instances (see Project and instance metadata (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "The Google Compute Engine metadata entries to add to all instances (see Project and instance metadata (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).", - "type": "object" + } }, "internalIpOnly": { "description": "Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses.", @@ -1656,333 +1839,28 @@ }, "serviceAccountScopes": { "description": "Optional. The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included:\nhttps://www.googleapis.com/auth/cloud.useraccounts.readonly\nhttps://www.googleapis.com/auth/devstorage.read_write\nhttps://www.googleapis.com/auth/logging.writeIf no scopes are specified, the following defaults are also provided:\nhttps://www.googleapis.com/auth/bigquery\nhttps://www.googleapis.com/auth/bigtable.admin.table\nhttps://www.googleapis.com/auth/bigtable.data\nhttps://www.googleapis.com/auth/devstorage.full_control", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "tags": { "description": "The Google Compute Engine tags to add to all instances (see Tagging instances).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "serviceAccount": { - "description": "Optional. The service account of the instances. Defaults to the default Google Compute Engine service account. Custom service accounts need permissions equivalent to the folloing IAM roles:\nroles/logging.logWriter\nroles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: [account_id]@[project_id].iam.gserviceaccount.com", - "type": "string" + "type": "string", + "description": "Optional. The service account of the instances. Defaults to the default Google Compute Engine service account. Custom service accounts need permissions equivalent to the folloing IAM roles:\nroles/logging.logWriter\nroles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: [account_id]@[project_id].iam.gserviceaccount.com" }, "subnetworkUri": { - "description": "Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0.", - "type": "string" - }, - "networkUri": { - "description": "Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the \"default\" network of the project is used, if it exists. Cannot be a \"Custom Subnet Network\" (see Using Subnetworks for more information). Example: https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default.", - "type": "string" - }, - "zoneUri": { - "description": "Required. The zone where the Google Compute Engine cluster will be located. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone].", + "description": "Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri.A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0\nprojects/[project_id]/regions/us-east1/sub0\nsub0", "type": "string" } }, "id": "GceClusterConfig" - }, - "ClusterMetrics": { - "description": "Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", - "type": "object", - "properties": { - "yarnMetrics": { - "additionalProperties": { - "format": "int64", - "type": "string" - }, - "description": "The YARN metrics.", - "type": "object" - }, - "hdfsMetrics": { - "additionalProperties": { - "format": "int64", - "type": "string" - }, - "description": "The HDFS metrics.", - "type": "object" - } - }, - "id": "ClusterMetrics" - }, - "AcceleratorConfig": { - "description": "Specifies the type and number of accelerator cards attached to the instances of an instance group (see GPUs on Compute Engine).", - "type": "object", - "properties": { - "acceleratorTypeUri": { - "description": "Full or partial URI of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( /compute/docs/reference/beta/acceleratorTypes)", - "type": "string" - }, - "acceleratorCount": { - "description": "The number of the accelerator cards of this type exposed to this instance.", - "format": "int32", - "type": "integer" - } - }, - "id": "AcceleratorConfig" - }, - "LoggingConfig": { - "description": "The runtime logging config of the job.", - "type": "object", - "properties": { - "driverLogLevels": { - "additionalProperties": { - "enum": [ - "LEVEL_UNSPECIFIED", - "ALL", - "TRACE", - "DEBUG", - "INFO", - "WARN", - "ERROR", - "FATAL", - "OFF" - ], - "type": "string" - }, - "description": "The per-package log levels for the driver. This may include \"root\" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'", - "type": "object" - } - }, - "id": "LoggingConfig" - }, - "DiagnoseClusterOutputLocation": { - "type": "object", - "properties": { - "outputUri": { - "description": "Output-only The Google Cloud Storage URI of the diagnostic output. This will be a plain text file with summary of collected diagnostics.", - "type": "string" - } - }, - "id": "DiagnoseClusterOutputLocation", - "description": "The location where output from diagnostic command can be found." - }, - "Operation": { - "properties": { - "done": { - "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", - "type": "boolean" - }, - "response": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", - "type": "object" - }, - "name": { - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name.", - "type": "string" - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." - }, - "metadata": { - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - }, - "id": "Operation", - "description": "This resource represents a long-running operation that is the result of a network API call.", - "type": "object" - }, - "OperationStatus": { - "description": "The status of the operation.", - "type": "object", - "properties": { - "state": { - "enumDescriptions": [ - "Unused.", - "The operation has been created.", - "The operation is running.", - "The operation is done; either cancelled or completed." - ], - "enum": [ - "UNKNOWN", - "PENDING", - "RUNNING", - "DONE" - ], - "description": "A message containing the operation state.", - "type": "string" - }, - "details": { - "description": "A message containing any operation metadata details.", - "type": "string" - }, - "innerState": { - "description": "A message containing the detailed operation state.", - "type": "string" - }, - "stateStartTime": { - "description": "The time this state was entered.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "OperationStatus" - }, - "JobReference": { - "description": "Encapsulates the full scoping used to reference a job.", - "type": "object", - "properties": { - "projectId": { - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "type": "string" - }, - "jobId": { - "description": "Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters.", - "type": "string" - } - }, - "id": "JobReference" - }, - "SubmitJobRequest": { - "id": "SubmitJobRequest", - "description": "A request to submit a job.", - "type": "object", - "properties": { - "job": { - "$ref": "Job", - "description": "Required. The job resource." - } - } - }, - "Status": { - "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" - }, - "details": { - "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - } - }, - "id": "Status" - }, - "JobScheduling": { - "description": "Job scheduling options.Beta Feature: These options are available for testing purposes only. They may be changed before final release.", - "type": "object", - "properties": { - "maxFailuresPerHour": { - "type": "integer", - "description": "Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10.", - "format": "int32" - } - }, - "id": "JobScheduling" - }, - "InstanceGroupConfig": { - "id": "InstanceGroupConfig", - "description": "Optional. The config settings for Google Compute Engine resources in an instance group, such as a master or worker group.", - "type": "object", - "properties": { - "instanceNames": { - "description": "Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user (recommended practice is to let Cloud Dataproc derive the name).", - "type": "array", - "items": { - "type": "string" - } - }, - "accelerators": { - "description": "Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release.", - "type": "array", - "items": { - "$ref": "AcceleratorConfig" - } - }, - "numInstances": { - "type": "integer", - "description": "Required. The number of VM instances in the instance group. For master instance groups, must be set to 1.", - "format": "int32" - }, - "diskConfig": { - "description": "Optional. Disk option config settings.", - "$ref": "DiskConfig" - }, - "isPreemptible": { - "description": "Optional. Specifies that this instance group contains preemptible instances.", - "type": "boolean" - }, - "managedGroupConfig": { - "description": "Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups.", - "$ref": "ManagedGroupConfig" - }, - "imageUri": { - "description": "Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version.", - "type": "string" - }, - "machineTypeUri": { - "type": "string", - "description": "Required. The Google Compute Engine machine type used for cluster instances. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2." - } - } - }, - "NodeInitializationAction": { - "description": "Specifies an executable to run on a fully configured node and a timeout period for executable completion.", - "type": "object", - "properties": { - "executionTimeout": { - "description": "Optional. Amount of time executable has to complete. Default is 10 minutes. Cluster creation fails with an explanatory error message (the name of the executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period.", - "format": "google-duration", - "type": "string" - }, - "executableFile": { - "description": "Required. Google Cloud Storage URI of executable file.", - "type": "string" - } - }, - "id": "NodeInitializationAction" - }, - "ListJobsResponse": { - "id": "ListJobsResponse", - "description": "A list of jobs in a project.", - "type": "object", - "properties": { - "jobs": { - "description": "Output-only. Jobs list.", - "type": "array", - "items": { - "$ref": "Job" - } - }, - "nextPageToken": { - "description": "Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent \u003ccode\u003eListJobsRequest\u003c/code\u003e.", - "type": "string" - } - } - }, - "CancelJobRequest": { - "description": "A request to cancel a job.", - "type": "object", - "properties": {}, - "id": "CancelJobRequest" } }, "icons": { @@ -2007,10 +1885,5 @@ "rootUrl": "https://dataproc.googleapis.com/", "basePath": "", "ownerDomain": "google.com", - "name": "dataproc", - "batchPath": "batch", - "revision": "20170515", - "documentationLink": "https://cloud.google.com/dataproc/", - "id": "dataproc:v1", - "title": "Google Cloud Dataproc API" + "name": "dataproc" } diff --git a/etc/api/dataproc/v1beta2/dataproc-api.json b/etc/api/dataproc/v1beta2/dataproc-api.json new file mode 100644 index 0000000000..c97418c4b2 --- /dev/null +++ b/etc/api/dataproc/v1beta2/dataproc-api.json @@ -0,0 +1,2084 @@ +{ + "ownerName": "Google", + "discoveryVersion": "v1", + "version_module": true, + "resources": { + "projects": { + "resources": { + "regions": { + "resources": { + "operations": { + "methods": { + "cancel": { + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", + "id": "dataproc.projects.regions.operations.cancel", + "path": "v1beta2/{+name}:cancel", + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST" + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be deleted.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", + "id": "dataproc.projects.regions.operations.delete", + "path": "v1beta2/{+name}" + }, + "get": { + "path": "v1beta2/{+name}", + "id": "dataproc.projects.regions.operations.get", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "httpMethod": "GET", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}" + }, + "list": { + "id": "dataproc.projects.regions.operations.list", + "path": "v1beta2/{+name}", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/operations$" + }, + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + }, + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations" + } + } + }, + "jobs": { + "methods": { + "cancel": { + "request": { + "$ref": "CancelJobRequest" + }, + "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [ + "projectId", + "region", + "jobId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "jobId": { + "description": "Required. The job ID.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", + "id": "dataproc.projects.regions.jobs.cancel", + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel" + }, + "get": { + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.get", + "description": "Gets the resource representation for a job in a project.", + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "region", + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "jobId": { + "description": "Required. The job ID.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}" + }, + "patch": { + "request": { + "$ref": "Job" + }, + "description": "Updates a job in a project.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [ + "projectId", + "region", + "jobId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "jobId": { + "location": "path", + "description": "Required. The job ID.", + "type": "string", + "required": true + }, + "projectId": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to." + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Required. Specifies the path, relative to \u003ccode\u003eJob\u003c/code\u003e, of the field to update. For example, to update the labels of a Job the \u003ccode\u003eupdate_mask\u003c/code\u003e parameter would be specified as \u003ccode\u003elabels\u003c/code\u003e, and the PATCH request body would specify the new value. \u003cstrong\u003eNote:\u003c/strong\u003e Currently, \u003ccode\u003elabels\u003c/code\u003e is the only field that can be updated.", + "type": "string" + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.patch", + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}" + }, + "submit": { + "description": "Submits a job to a cluster.", + "request": { + "$ref": "SubmitJobRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "region" + ], + "response": { + "$ref": "Job" + }, + "parameters": { + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit", + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit", + "id": "dataproc.projects.regions.jobs.submit" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "projectId", + "region", + "jobId" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + }, + "jobId": { + "location": "path", + "description": "Required. The job ID.", + "type": "string", + "required": true + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.delete", + "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION." + }, + "list": { + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "location": "query", + "description": "Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or INACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = *", + "type": "string" + }, + "jobStateMatcher": { + "description": "Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs).", + "type": "string", + "location": "query", + "enum": [ + "ALL", + "ACTIVE", + "NON_ACTIVE" + ] + }, + "pageToken": { + "location": "query", + "description": "Optional. The page token, returned by a previous call, to request the next page of results.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The number of results to return in each response.", + "type": "integer", + "location": "query" + }, + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + }, + "clusterName": { + "location": "query", + "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", + "type": "string" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs", + "id": "dataproc.projects.regions.jobs.list", + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs", + "description": "Lists regions/{region}/jobs in a project." + } + } + }, + "clusters": { + "methods": { + "getIamPolicy": { + "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy", + "id": "dataproc.projects.regions.clusters.getIamPolicy", + "path": "v1beta2/{+resource}:getIamPolicy" + }, + "get": { + "description": "Gets the resource representation for a cluster in a project.", + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "type": "string", + "required": true + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.get", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Required. Specifies the path, relative to \u003ccode\u003eCluster\u003c/code\u003e, of the field to update. For example, to change the number of workers in a cluster to 5, the \u003ccode\u003eupdate_mask\u003c/code\u003e parameter would be specified as \u003ccode\u003econfig.worker_config.num_instances\u003c/code\u003e, and the PATCH request body would specify the new value, as follows:\n{\n \"config\":{\n \"workerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\nSimilarly, to change the number of preemptible workers in a cluster to 5, the \u003ccode\u003eupdate_mask\u003c/code\u003e parameter would be \u003ccode\u003econfig.secondary_worker_config.num_instances\u003c/code\u003e, and the PATCH request body would be set as follows:\n{\n \"config\":{\n \"secondaryWorkerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\n\u003cstrong\u003eNote:\u003c/strong\u003e currently only some fields can be updated: |Mask|Purpose| |labels|Updates labels| |config.worker_config.num_instances|Resize primary worker group| |config.secondary_worker_config.num_instances|Resize secondary worker group|", + "type": "string" + }, + "region": { + "type": "string", + "required": true, + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request." + }, + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "type": "string", + "required": true + }, + "gracefulDecommissionTimeout": { + "location": "query", + "format": "google-duration", + "description": "Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day.Only supported on Dataproc image versions 1.2 and higher.", + "type": "string" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.patch", + "request": { + "$ref": "Cluster" + }, + "description": "Updates a cluster in a project." + }, + "testIamPermissions": { + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "id": "dataproc.projects.regions.clusters.testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a cluster in a project.", + "response": { + "$ref": "Operation" + }, + "httpMethod": "DELETE", + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "parameters": { + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true, + "location": "path" + }, + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.delete", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}" + }, + "diagnose": { + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", + "id": "dataproc.projects.regions.clusters.diagnose", + "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.", + "request": { + "$ref": "DiagnoseClusterRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "region": { + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true + }, + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "type": "string", + "required": true + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters", + "id": "dataproc.projects.regions.clusters.list", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", + "description": "Lists all regions/{region}/clusters in a project.", + "response": { + "$ref": "ListClustersResponse" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "location": "query", + "description": "Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *", + "type": "string" + }, + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "description": "Optional. The standard List page token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The standard List page size.", + "type": "integer" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "id": "dataproc.projects.regions.clusters.setIamPolicy", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", + "id": "dataproc.projects.regions.clusters.create", + "description": "Creates a cluster in a project.", + "request": { + "$ref": "Cluster" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "region" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters" + } + } + } + } + } + } + } + }, + "parameters": { + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + } + }, + "schemas": { + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object" + }, + "HiveJob": { + "description": "A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN.", + "type": "object", + "properties": { + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "scriptVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name=\"value\";).", + "type": "object" + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code.", + "type": "object" + }, + "continueOnFailure": { + "description": "Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.", + "type": "boolean" + }, + "queryList": { + "$ref": "QueryList", + "description": "A list of queries." + }, + "queryFileUri": { + "description": "The HCFS URI of the script that contains Hive queries.", + "type": "string" + } + }, + "id": "HiveJob" + }, + "DiagnoseClusterResults": { + "type": "object", + "properties": { + "outputUri": { + "description": "Output-only. The Google Cloud Storage URI of the diagnostic output. The output report is a plain text file with a summary of collected diagnostics.", + "type": "string" + } + }, + "id": "DiagnoseClusterResults", + "description": "The location of diagnostic output." + }, + "ClusterConfig": { + "description": "The cluster config.", + "type": "object", + "properties": { + "workerConfig": { + "$ref": "InstanceGroupConfig", + "description": "Optional. The Google Compute Engine config settings for worker instances in a cluster." + }, + "gceClusterConfig": { + "description": "Required. The shared Google Compute Engine config settings for all instances in a cluster.", + "$ref": "GceClusterConfig" + }, + "softwareConfig": { + "$ref": "SoftwareConfig", + "description": "Optional. The config settings for software inside the cluster." + }, + "masterConfig": { + "$ref": "InstanceGroupConfig", + "description": "Optional. The Google Compute Engine config settings for the master instance in a cluster." + }, + "secondaryWorkerConfig": { + "$ref": "InstanceGroupConfig", + "description": "Optional. The Google Compute Engine config settings for additional worker instances in a cluster." + }, + "initializationActions": { + "description": "Optional. Commands to execute on each node after config is completed. By default, executables are run on master and all worker nodes. You can test a node's \u003ccode\u003erole\u003c/code\u003e metadata to run an executable on a master or worker node, as shown below using curl (you can also use wget):\nROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role)\nif [[ \"${ROLE}\" == 'Master' ]]; then\n ... master specific actions ...\nelse\n ... worker specific actions ...\nfi\n", + "items": { + "$ref": "NodeInitializationAction" + }, + "type": "array" + }, + "lifecycleConfig": { + "$ref": "LifecycleConfig", + "description": "Optional. The config setting for auto delete cluster schedule." + }, + "configBucket": { + "description": "Optional. A Google Cloud Storage staging bucket used for sharing generated SSH keys and config. If you do not specify a staging bucket, Cloud Dataproc will determine an appropriate Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone where your cluster is deployed, and then it will create and manage this project-level, per-location bucket for you.", + "type": "string" + } + }, + "id": "ClusterConfig" + }, + "PySparkJob": { + "id": "PySparkJob", + "description": "A Cloud Dataproc job for running Apache PySpark (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN.", + "type": "object", + "properties": { + "mainPythonFileUri": { + "description": "Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file.", + "type": "string" + }, + "archiveUris": { + "description": "Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip.", + "items": { + "type": "string" + }, + "type": "array" + }, + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.", + "type": "object" + }, + "args": { + "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", + "items": { + "type": "string" + }, + "type": "array" + }, + "fileUris": { + "description": "Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pythonFileUris": { + "description": "Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip.", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "GceClusterConfig": { + "description": "Common config settings for resources of Google Compute Engine cluster instances, applicable to all instances in the cluster.", + "type": "object", + "properties": { + "networkUri": { + "description": "Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the \"default\" network of the project is used, if it exists. Cannot be a \"Custom Subnet Network\" (see Using Subnetworks for more information).A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default\nprojects/[project_id]/regions/global/default\ndefault", + "type": "string" + }, + "zoneUri": { + "description": "Optional. The zone where the Google Compute Engine cluster will be located. On a create request, it is required in the \"global\" region. If omitted in a non-global Cloud Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be present.A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]\nprojects/[project_id]/zones/[zone]\nus-central1-f", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "The Google Compute Engine metadata entries to add to all instances (see Project and instance metadata (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).", + "type": "object" + }, + "internalIpOnly": { + "description": "Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses.", + "type": "boolean" + }, + "serviceAccountScopes": { + "description": "Optional. The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included:\nhttps://www.googleapis.com/auth/cloud.useraccounts.readonly\nhttps://www.googleapis.com/auth/devstorage.read_write\nhttps://www.googleapis.com/auth/logging.writeIf no scopes are specified, the following defaults are also provided:\nhttps://www.googleapis.com/auth/bigquery\nhttps://www.googleapis.com/auth/bigtable.admin.table\nhttps://www.googleapis.com/auth/bigtable.data\nhttps://www.googleapis.com/auth/devstorage.full_control", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "description": "The Google Compute Engine tags to add to all instances (see Tagging instances).", + "items": { + "type": "string" + }, + "type": "array" + }, + "serviceAccount": { + "description": "Optional. The service account of the instances. Defaults to the default Google Compute Engine service account. Custom service accounts need permissions equivalent to the folloing IAM roles:\nroles/logging.logWriter\nroles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: [account_id]@[project_id].iam.gserviceaccount.com", + "type": "string" + }, + "subnetworkUri": { + "description": "Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri.A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0\nprojects/[project_id]/regions/us-east1/sub0\nsub0", + "type": "string" + } + }, + "id": "GceClusterConfig" + }, + "ClusterMetrics": { + "description": "Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", + "type": "object", + "properties": { + "yarnMetrics": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "The YARN metrics.", + "type": "object" + }, + "hdfsMetrics": { + "description": "The HDFS metrics.", + "type": "object", + "additionalProperties": { + "format": "int64", + "type": "string" + } + } + }, + "id": "ClusterMetrics" + }, + "AcceleratorConfig": { + "description": "Specifies the type and number of accelerator cards attached to the instances of an instance group (see GPUs on Compute Engine).", + "type": "object", + "properties": { + "acceleratorCount": { + "format": "int32", + "description": "The number of the accelerator cards of this type exposed to this instance.", + "type": "integer" + }, + "acceleratorTypeUri": { + "description": "Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( /compute/docs/reference/beta/acceleratorTypes)Examples * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80", + "type": "string" + } + }, + "id": "AcceleratorConfig" + }, + "TestIamPermissionsRequest": { + "description": "Request message for TestIamPermissions method.", + "type": "object", + "properties": { + "permissions": { + "description": "The set of permissions to check for the resource. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.A Policy consists of a list of bindings. A Binding binds a list of members to a role, where the members can be user accounts, Google groups, Google domains, and service accounts. A role is a named list of permissions defined by IAM.Example\n{\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n}\nFor a description of IAM and its features, see the IAM developer's guide (https://cloud.google.com/iam).", + "type": "object", + "properties": { + "bindings": { + "description": "Associates a list of members to a role. bindings with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, + "etag": { + "format": "byte", + "description": "etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy.If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten blindly.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the Policy. The default version is 0.", + "type": "integer" + } + }, + "id": "Policy" + }, + "LoggingConfig": { + "id": "LoggingConfig", + "description": "The runtime logging config of the job.", + "type": "object", + "properties": { + "driverLogLevels": { + "additionalProperties": { + "enum": [ + "LEVEL_UNSPECIFIED", + "ALL", + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ], + "type": "string" + }, + "description": "The per-package log levels for the driver. This may include \"root\" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'", + "type": "object" + } + } + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object", + "properties": { + "done": { + "description": "If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.", + "type": "boolean" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.", + "type": "object" + }, + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name." + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, + "id": "Operation" + }, + "JobReference": { + "description": "Encapsulates the full scoping used to reference a job.", + "type": "object", + "properties": { + "jobId": { + "description": "Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters.", + "type": "string" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "type": "string" + } + }, + "id": "JobReference" + }, + "SubmitJobRequest": { + "properties": { + "job": { + "$ref": "Job", + "description": "Required. The job resource." + } + }, + "id": "SubmitJobRequest", + "description": "A request to submit a job.", + "type": "object" + }, + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code." + } + }, + "id": "Status" + }, + "Binding": { + "description": "Associates members with a role.", + "type": "object", + "properties": { + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource. members can have the following values:\nallUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.\nallAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.\nuser:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.com.\nserviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.\ngroup:{emailid}: An email address that represents a Google group. For example, admins@example.com.\ndomain:{domain}: A Google Apps domain name that represents all the users of that domain. For example, google.com or example.com.", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner. Required", + "type": "string" + } + }, + "id": "Binding" + }, + "JobScheduling": { + "properties": { + "maxFailuresPerHour": { + "format": "int32", + "description": "Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10.", + "type": "integer" + } + }, + "id": "JobScheduling", + "description": "Job scheduling options.Beta Feature: These options are available for testing purposes only. They may be changed before final release.", + "type": "object" + }, + "InstanceGroupConfig": { + "description": "Optional. The config settings for Google Compute Engine resources in an instance group, such as a master or worker group.", + "type": "object", + "properties": { + "machineTypeUri": { + "description": "Optional. The Google Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples:\nhttps://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2\nprojects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2\nn1-standard-2", + "type": "string" + }, + "imageUri": { + "description": "Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version.", + "type": "string" + }, + "managedGroupConfig": { + "$ref": "ManagedGroupConfig", + "description": "Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups." + }, + "isPreemptible": { + "description": "Optional. Specifies that this instance group contains preemptible instances.", + "type": "boolean" + }, + "instanceNames": { + "description": "Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user (recommended practice is to let Cloud Dataproc derive the name).", + "items": { + "type": "string" + }, + "type": "array" + }, + "accelerators": { + "description": "Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release.", + "items": { + "$ref": "AcceleratorConfig" + }, + "type": "array" + }, + "numInstances": { + "format": "int32", + "description": "Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1.", + "type": "integer" + }, + "diskConfig": { + "$ref": "DiskConfig", + "description": "Optional. Disk option config settings." + } + }, + "id": "InstanceGroupConfig" + }, + "ListJobsResponse": { + "id": "ListJobsResponse", + "description": "A list of jobs in a project.", + "type": "object", + "properties": { + "jobs": { + "description": "Output-only. Jobs list.", + "items": { + "$ref": "Job" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent \u003ccode\u003eListJobsRequest\u003c/code\u003e.", + "type": "string" + } + } + }, + "NodeInitializationAction": { + "properties": { + "executableFile": { + "description": "Required. Google Cloud Storage URI of executable file.", + "type": "string" + }, + "executionTimeout": { + "format": "google-duration", + "description": "Optional. Amount of time executable has to complete. Default is 10 minutes. Cluster creation fails with an explanatory error message (the name of the executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period.", + "type": "string" + } + }, + "id": "NodeInitializationAction", + "description": "Specifies an executable to run on a fully configured node and a timeout period for executable completion.", + "type": "object" + }, + "CancelJobRequest": { + "properties": {}, + "id": "CancelJobRequest", + "description": "A request to cancel a job.", + "type": "object" + }, + "SparkSqlJob": { + "description": "A Cloud Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries.", + "type": "object", + "properties": { + "queryFileUri": { + "description": "The HCFS URI of the script that contains SQL queries.", + "type": "string" + }, + "queryList": { + "$ref": "QueryList", + "description": "A list of queries." + }, + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "scriptVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name=\"value\";).", + "type": "object" + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Cloud Dataproc API may be overwritten.", + "type": "object" + } + }, + "id": "SparkSqlJob" + }, + "Cluster": { + "description": "Describes the identifying information, config, and status of a cluster of Google Compute Engine instances.", + "type": "object", + "properties": { + "metrics": { + "$ref": "ClusterMetrics", + "description": "Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release." + }, + "status": { + "$ref": "ClusterStatus", + "description": "Output-only. Cluster status." + }, + "config": { + "$ref": "ClusterConfig", + "description": "Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated." + }, + "statusHistory": { + "description": "Output-only. The previous cluster status.", + "items": { + "$ref": "ClusterStatus" + }, + "type": "array" + }, + "clusterUuid": { + "description": "Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster.", + "type": "string" + }, + "clusterName": { + "description": "Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused.", + "type": "string" + }, + "projectId": { + "type": "string", + "description": "Required. The Google Cloud Platform project ID that the cluster belongs to." + }, + "labels": { + "description": "Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster.", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "id": "Cluster" + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListOperationsResponse" + }, + "TestIamPermissionsResponse": { + "description": "Response message for TestIamPermissions method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of TestPermissionsRequest.permissions that the caller is allowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse" + }, + "JobPlacement": { + "description": "Cloud Dataproc job config.", + "type": "object", + "properties": { + "clusterUuid": { + "description": "Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted.", + "type": "string" + }, + "clusterName": { + "description": "Required. The name of the cluster where the job will be submitted.", + "type": "string" + } + }, + "id": "JobPlacement" + }, + "SoftwareConfig": { + "description": "Specifies the selection and config of software inside the cluster.", + "type": "object", + "properties": { + "imageVersion": { + "description": "Optional. The version of software inside the cluster. It must match the regular expression [0-9]+\\.[0-9]+. If unspecified, it defaults to the latest version (see Cloud Dataproc Versioning).", + "type": "string" + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, such as core:fs.defaultFS. The following are supported prefixes and their mappings:\ncapacity-scheduler: capacity-scheduler.xml\ncore: core-site.xml\ndistcp: distcp-default.xml\nhdfs: hdfs-site.xml\nhive: hive-site.xml\nmapred: mapred-site.xml\npig: pig.properties\nspark: spark-defaults.conf\nyarn: yarn-site.xmlFor more information, see Cluster properties.", + "type": "object" + } + }, + "id": "SoftwareConfig" + }, + "ClusterStatus": { + "description": "The status of a cluster and its instances.", + "type": "object", + "properties": { + "substate": { + "type": "string", + "enumDescriptions": [ + "", + "The cluster is known to be in an unhealthy state (for example, critical daemons are not running or HDFS capacity is exhausted).Applies to RUNNING state.", + "The agent-reported status is out of date (may occur if Cloud Dataproc loses communication with Agent).Applies to RUNNING state." + ], + "enum": [ + "UNSPECIFIED", + "UNHEALTHY", + "STALE_STATUS" + ], + "description": "Output-only. Additional state information that includes status reported by the agent." + }, + "stateStartTime": { + "format": "google-datetime", + "description": "Output-only. Time when this state was entered.", + "type": "string" + }, + "detail": { + "description": "Output-only. Optional details of cluster's state.", + "type": "string" + }, + "state": { + "enumDescriptions": [ + "The cluster state is unknown.", + "The cluster is being created and set up. It is not ready for use.", + "The cluster is currently running and healthy. It is ready for use.", + "The cluster encountered an error. It is not ready for use.", + "The cluster is being deleted. It cannot be used.", + "The cluster is being updated. It continues to accept and process jobs." + ], + "enum": [ + "UNKNOWN", + "CREATING", + "RUNNING", + "ERROR", + "DELETING", + "UPDATING" + ], + "description": "Output-only. The cluster's state.", + "type": "string" + } + }, + "id": "ClusterStatus" + }, + "PigJob": { + "description": "A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN.", + "type": "object", + "properties": { + "continueOnFailure": { + "description": "Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.", + "type": "boolean" + }, + "queryFileUri": { + "description": "The HCFS URI of the script that contains the Pig queries.", + "type": "string" + }, + "queryList": { + "$ref": "QueryList", + "description": "A list of queries." + }, + "scriptVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]).", + "type": "object" + }, + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code.", + "type": "object" + } + }, + "id": "PigJob" + }, + "ListClustersResponse": { + "description": "The list of all clusters in a project.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Output-only. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent \u003ccode\u003eListClustersRequest\u003c/code\u003e.", + "type": "string" + }, + "clusters": { + "description": "Output-only. The clusters in the project.", + "items": { + "$ref": "Cluster" + }, + "type": "array" + } + }, + "id": "ListClustersResponse" + }, + "SparkJob": { + "description": "A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN.", + "type": "object", + "properties": { + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.", + "type": "object" + }, + "args": { + "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", + "items": { + "type": "string" + }, + "type": "array" + }, + "fileUris": { + "description": "Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainClass": { + "description": "The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris.", + "type": "string" + }, + "archiveUris": { + "description": "Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainJarFileUri": { + "description": "The HCFS URI of the jar file that contains the main class.", + "type": "string" + } + }, + "id": "SparkJob" + }, + "Job": { + "description": "A Cloud Dataproc job resource.", + "type": "object", + "properties": { + "hadoopJob": { + "$ref": "HadoopJob", + "description": "Job is a Hadoop job." + }, + "placement": { + "$ref": "JobPlacement", + "description": "Required. Job information, including how, when, and where to run the job." + }, + "status": { + "$ref": "JobStatus", + "description": "Output-only. The job status. Additional application-specific status information may be contained in the \u003ccode\u003etype_job\u003c/code\u003e and \u003ccode\u003eyarn_applications\u003c/code\u003e fields." + }, + "driverControlFilesUri": { + "description": "Output-only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files may be placed in the same location as driver_output_uri.", + "type": "string" + }, + "scheduling": { + "description": "Optional. Job scheduling configuration.", + "$ref": "JobScheduling" + }, + "pigJob": { + "description": "Job is a Pig job.", + "$ref": "PigJob" + }, + "hiveJob": { + "$ref": "HiveJob", + "description": "Job is a Hive job." + }, + "labels": { + "description": "Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "driverOutputResourceUri": { + "description": "Output-only. A URI pointing to the location of the stdout of the job's driver program.", + "type": "string" + }, + "sparkSqlJob": { + "description": "Job is a SparkSql job.", + "$ref": "SparkSqlJob" + }, + "sparkJob": { + "$ref": "SparkJob", + "description": "Job is a Spark job." + }, + "statusHistory": { + "description": "Output-only. The previous job status.", + "items": { + "$ref": "JobStatus" + }, + "type": "array" + }, + "yarnApplications": { + "items": { + "$ref": "YarnApplication" + }, + "type": "array", + "description": "Output-only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It may be changed before final release." + }, + "pysparkJob": { + "description": "Job is a Pyspark job.", + "$ref": "PySparkJob" + }, + "reference": { + "$ref": "JobReference", + "description": "Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not specified when a job is created, the server generates a \u003ccode\u003ejob_id\u003c/code\u003e." + } + }, + "id": "Job" + }, + "JobStatus": { + "description": "Cloud Dataproc job status.", + "type": "object", + "properties": { + "details": { + "description": "Output-only. Optional job state details, such as an error description if the state is \u003ccode\u003eERROR\u003c/code\u003e.", + "type": "string" + }, + "state": { + "type": "string", + "enumDescriptions": [ + "The job state is unknown.", + "The job is pending; it has been submitted, but is not yet running.", + "Job has been received by the service and completed initial setup; it will soon be submitted to the cluster.", + "The job is running on the cluster.", + "A CancelJob request has been received, but is pending.", + "Transient in-flight resources have been canceled, and the request to cancel the running job has been issued to the cluster.", + "The job cancellation was successful.", + "The job has completed successfully.", + "The job has completed, but encountered an error.", + "Job attempt has failed. The detail field contains failure details for this attempt.Applies to restartable jobs only." + ], + "enum": [ + "STATE_UNSPECIFIED", + "PENDING", + "SETUP_DONE", + "RUNNING", + "CANCEL_PENDING", + "CANCEL_STARTED", + "CANCELLED", + "DONE", + "ERROR", + "ATTEMPT_FAILURE" + ], + "description": "Output-only. A state message specifying the overall job state." + }, + "substate": { + "description": "Output-only. Additional state information, which includes status reported by the agent.", + "type": "string", + "enumDescriptions": [ + "", + "The Job is submitted to the agent.Applies to RUNNING state.", + "The Job has been received and is awaiting execution (it may be waiting for a condition to be met). See the \"details\" field for the reason for the delay.Applies to RUNNING state.", + "The agent-reported status is out of date, which may be caused by a loss of communication between the agent and Cloud Dataproc. If the agent does not send a timely update, the job will fail.Applies to RUNNING state." + ], + "enum": [ + "UNSPECIFIED", + "SUBMITTED", + "QUEUED", + "STALE_STATUS" + ] + }, + "stateStartTime": { + "format": "google-datetime", + "description": "Output-only. The time when this state was entered.", + "type": "string" + } + }, + "id": "JobStatus" + }, + "LifecycleConfig": { + "description": "Specifies the cluster auto delete related schedule configuration.", + "type": "object", + "properties": { + "autoDeleteTtl": { + "format": "google-duration", + "description": "Optional. The life duration of cluster, the cluster will be auto-deleted at the end of this duration.", + "type": "string" + }, + "autoDeleteTime": { + "format": "google-datetime", + "description": "Optional. The time when cluster will be auto-deleted.", + "type": "string" + }, + "idleDeleteTtl": { + "format": "google-duration", + "description": "Optional. The longest duration that cluster would keep alive while staying idle; passing this threshold will cause cluster to be auto-deleted.", + "type": "string" + } + }, + "id": "LifecycleConfig" + }, + "ManagedGroupConfig": { + "properties": { + "instanceGroupManagerName": { + "description": "Output-only. The name of the Instance Group Manager for this group.", + "type": "string" + }, + "instanceTemplateName": { + "description": "Output-only. The name of the Instance Template used for the Managed Instance Group.", + "type": "string" + } + }, + "id": "ManagedGroupConfig", + "description": "Specifies the resources used to actively manage an instance group.", + "type": "object" + }, + "ClusterOperationStatus": { + "properties": { + "details": { + "description": "Output-only.A message containing any operation metadata details.", + "type": "string" + }, + "state": { + "description": "Output-only. A message containing the operation state.", + "type": "string", + "enumDescriptions": [ + "Unused.", + "The operation has been created.", + "The operation is running.", + "The operation is done; either cancelled or completed." + ], + "enum": [ + "UNKNOWN", + "PENDING", + "RUNNING", + "DONE" + ] + }, + "innerState": { + "type": "string", + "description": "Output-only. A message containing the detailed operation state." + }, + "stateStartTime": { + "type": "string", + "format": "google-datetime", + "description": "Output-only. The time this state was entered." + } + }, + "id": "ClusterOperationStatus", + "description": "The status of the operation.", + "type": "object" + }, + "YarnApplication": { + "description": "A YARN application created by a job. Application information is a subset of \u003ccode\u003eorg.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto\u003c/code\u003e.Beta Feature: This report is available for testing purposes only. It may be changed before final release.", + "type": "object", + "properties": { + "state": { + "type": "string", + "enumDescriptions": [ + "Status is unspecified.", + "Status is NEW.", + "Status is NEW_SAVING.", + "Status is SUBMITTED.", + "Status is ACCEPTED.", + "Status is RUNNING.", + "Status is FINISHED.", + "Status is FAILED.", + "Status is KILLED." + ], + "enum": [ + "STATE_UNSPECIFIED", + "NEW", + "NEW_SAVING", + "SUBMITTED", + "ACCEPTED", + "RUNNING", + "FINISHED", + "FAILED", + "KILLED" + ], + "description": "Required. The application state." + }, + "name": { + "description": "Required. The application name.", + "type": "string" + }, + "trackingUrl": { + "description": "Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access.", + "type": "string" + }, + "progress": { + "format": "float", + "description": "Required. The numerical progress of the application, from 1 to 100.", + "type": "number" + } + }, + "id": "YarnApplication" + }, + "QueryList": { + "description": "A list of queries to run on a cluster.", + "type": "object", + "properties": { + "queries": { + "description": "Required. The queries to execute. You do not need to terminate a query with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of an Cloud Dataproc API snippet that uses a QueryList to specify a HiveJob:\n\"hiveJob\": {\n \"queryList\": {\n \"queries\": [\n \"query1\",\n \"query2\",\n \"query3;query4\",\n ]\n }\n}\n", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "QueryList" + }, + "HadoopJob": { + "description": "A Cloud Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).", + "type": "object", + "properties": { + "jarFileUris": { + "description": "Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "loggingConfig": { + "description": "Optional. The runtime log config for job execution.", + "$ref": "LoggingConfig" + }, + "properties": { + "description": "Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "args": { + "description": "Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a collision may occur that causes an incorrect job submission.", + "items": { + "type": "string" + }, + "type": "array" + }, + "fileUris": { + "description": "Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainClass": { + "description": "The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris.", + "type": "string" + }, + "archiveUris": { + "description": "Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip.", + "items": { + "type": "string" + }, + "type": "array" + }, + "mainJarFileUri": { + "description": "The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'", + "type": "string" + } + }, + "id": "HadoopJob" + }, + "DiagnoseClusterRequest": { + "description": "A request to collect cluster diagnostic information.", + "type": "object", + "properties": {}, + "id": "DiagnoseClusterRequest" + }, + "SetIamPolicyRequest": { + "description": "Request message for SetIamPolicy method.", + "type": "object", + "properties": { + "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 a valid policy but certain Cloud Platform services (such as Projects) might reject them.", + "$ref": "Policy" + } + }, + "id": "SetIamPolicyRequest" + }, + "DiskConfig": { + "description": "Specifies the config of disk options for a group of VM instances.", + "type": "object", + "properties": { + "bootDiskSizeGb": { + "format": "int32", + "description": "Optional. Size in GB of the boot disk (default is 500GB).", + "type": "integer" + }, + "numLocalSsds": { + "format": "int32", + "description": "Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and the boot disk contains only basic config and installed binaries.", + "type": "integer" + } + }, + "id": "DiskConfig" + }, + "ClusterOperationMetadata": { + "description": "Metadata describing the operation.", + "type": "object", + "properties": { + "warnings": { + "description": "Output-only. Errors encountered during operation execution.", + "items": { + "type": "string" + }, + "type": "array" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Output-only. Labels associated with the operation", + "type": "object" + }, + "status": { + "$ref": "ClusterOperationStatus", + "description": "Output-only. Current operation status." + }, + "statusHistory": { + "description": "Output-only. The previous operation status.", + "items": { + "$ref": "ClusterOperationStatus" + }, + "type": "array" + }, + "clusterName": { + "type": "string", + "description": "Output-only. Name of the cluster for the operation." + }, + "clusterUuid": { + "description": "Output-only. Cluster UUID for the operation.", + "type": "string" + }, + "operationType": { + "description": "Output-only. The operation type.", + "type": "string" + }, + "description": { + "description": "Output-only. Short description of operation.", + "type": "string" + } + }, + "id": "ClusterOperationMetadata" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "version": "v1beta2", + "baseUrl": "https://dataproc.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "kind": "discovery#restDescription", + "servicePath": "", + "description": "Manages Hadoop-based clusters and jobs on Google Cloud Platform.", + "rootUrl": "https://dataproc.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "dataproc", + "batchPath": "batch", + "id": "dataproc:v1beta2", + "documentationLink": "https://cloud.google.com/dataproc/", + "revision": "20170919", + "title": "Google Cloud Dataproc API" +} diff --git a/etc/api/datastore/v1/datastore-api.json b/etc/api/datastore/v1/datastore-api.json index 911c93f6bb..349a19e7ca 100644 --- a/etc/api/datastore/v1/datastore-api.json +++ b/etc/api/datastore/v1/datastore-api.json @@ -1,35 +1,46 @@ { - "version_module": "True", + "rootUrl": "https://datastore.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "datastore", + "batchPath": "batch", + "revision": "20170918", + "documentationLink": "https://cloud.google.com/datastore/", + "id": "datastore:v1", + "title": "Google Cloud Datastore API", + "discoveryVersion": "v1", + "ownerName": "Google", + "version_module": true, "resources": { "projects": { "methods": { - "allocateIds": { - "response": { - "$ref": "AllocateIdsResponse" + "commit": { + "request": { + "$ref": "CommitRequest" }, + "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.", + "httpMethod": "POST", "parameterOrder": [ "projectId" ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "location": "path", - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string" - } + "response": { + "$ref": "CommitResponse" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/datastore" ], - "flatPath": "v1/projects/{projectId}:allocateIds", - "path": "v1/projects/{projectId}:allocateIds", - "id": "datastore.projects.allocateIds", - "request": { - "$ref": "AllocateIdsRequest" + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true + } }, - "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted." + "flatPath": "v1/projects/{projectId}:commit", + "path": "v1/projects/{projectId}:commit", + "id": "datastore.projects.commit" }, "beginTransaction": { "response": { @@ -41,10 +52,10 @@ "httpMethod": "POST", "parameters": { "projectId": { - "location": "path", - "description": "The ID of the project against which to make the request.", + "type": "string", "required": true, - "type": "string" + "location": "path", + "description": "The ID of the project against which to make the request." } }, "scopes": [ @@ -52,46 +63,14 @@ "https://www.googleapis.com/auth/datastore" ], "flatPath": "v1/projects/{projectId}:beginTransaction", - "path": "v1/projects/{projectId}:beginTransaction", "id": "datastore.projects.beginTransaction", + "path": "v1/projects/{projectId}:beginTransaction", + "description": "Begins a new transaction.", "request": { "$ref": "BeginTransactionRequest" - }, - "description": "Begins a new transaction." - }, - "commit": { - "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.", - "request": { - "$ref": "CommitRequest" - }, - "response": { - "$ref": "CommitResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "parameters": { - "projectId": { - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectId}:commit", - "path": "v1/projects/{projectId}:commit", - "id": "datastore.projects.commit" + } }, "runQuery": { - "description": "Queries for entities.", - "request": { - "$ref": "RunQueryRequest" - }, "response": { "$ref": "RunQueryResponse" }, @@ -99,57 +78,55 @@ "projectId" ], "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true, + "location": "path" + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/datastore" ], - "parameters": { - "projectId": { - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string", - "location": "path" - } - }, "flatPath": "v1/projects/{projectId}:runQuery", + "id": "datastore.projects.runQuery", "path": "v1/projects/{projectId}:runQuery", - "id": "datastore.projects.runQuery" + "description": "Queries for entities.", + "request": { + "$ref": "RunQueryRequest" + } }, "rollback": { - "description": "Rolls back a transaction.", - "request": { - "$ref": "RollbackRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], "response": { "$ref": "RollbackResponse" }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true, + "location": "path" + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/datastore" ], - "parameters": { - "projectId": { - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string", - "location": "path" - } - }, "flatPath": "v1/projects/{projectId}:rollback", "id": "datastore.projects.rollback", - "path": "v1/projects/{projectId}:rollback" + "path": "v1/projects/{projectId}:rollback", + "description": "Rolls back a transaction.", + "request": { + "$ref": "RollbackRequest" + } }, "lookup": { - "id": "datastore.projects.lookup", - "path": "v1/projects/{projectId}:lookup", - "description": "Looks up entities by key.", - "request": { - "$ref": "LookupRequest" - }, "httpMethod": "POST", "parameterOrder": [ "projectId" @@ -163,28 +140,209 @@ ], "parameters": { "projectId": { + "location": "path", "description": "The ID of the project against which to make the request.", - "required": true, "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}:lookup", + "path": "v1/projects/{projectId}:lookup", + "id": "datastore.projects.lookup", + "request": { + "$ref": "LookupRequest" + }, + "description": "Looks up entities by key." + }, + "allocateIds": { + "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted.", + "request": { + "$ref": "AllocateIdsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "AllocateIdsResponse" + }, + "parameters": { + "projectId": { + "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true, "location": "path" } }, - "flatPath": "v1/projects/{projectId}:lookup" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1/projects/{projectId}:allocateIds", + "path": "v1/projects/{projectId}:allocateIds", + "id": "datastore.projects.allocateIds" + } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/operations/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel", + "id": "datastore.projects.operations.cancel", + "path": "v1/{+name}:cancel", + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`." + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}", + "id": "datastore.projects.operations.delete", + "path": "v1/{+name}", + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`." + }, + "get": { + "id": "datastore.projects.operations.get", + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}" + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "httpMethod": "GET", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1/projects/{projectsId}/operations", + "path": "v1/{+name}/operations", + "id": "datastore.projects.operations.list" + } + } } } } }, "parameters": { + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", "location": "query" }, "prettyPrint": { + "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", - "location": "query" + "type": "boolean" }, "fields": { "description": "Selector specifying which fields to include in a partial response.", @@ -197,6 +355,7 @@ "location": "query" }, "$.xgafv": { + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -206,8 +365,7 @@ "1", "2" ], - "description": "V1 error format.", - "type": "string" + "description": "V1 error format." }, "callback": { "location": "query", @@ -230,573 +388,29 @@ "description": "Data format for response.", "default": "json" }, + "key": { + "type": "string", + "location": "query", + "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." + }, "access_token": { "description": "OAuth access token.", "type": "string", "location": "query" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" } }, "schemas": { - "EntityResult": { - "description": "The result of fetching an entity from Datastore.", - "type": "object", + "GoogleDatastoreAdminV1beta1ExportEntitiesResponse": { "properties": { - "cursor": { - "description": "A cursor that points to the position after the result entity.\nSet only when the `EntityResult` is part of a `QueryResultBatch` message.", - "format": "byte", - "type": "string" - }, - "version": { - "description": "The version of the entity, a strictly positive number that monotonically\nincreases with changes to the entity.\n\nThis field is set for `FULL` entity\nresults.\n\nFor missing entities in `LookupResponse`, this\nis the version of the snapshot that was used to look up the entity, and it\nis always set except for eventually consistent reads.", - "format": "int64", - "type": "string" - }, - "entity": { - "description": "The resulting entity.", - "$ref": "Entity" - } - }, - "id": "EntityResult" - }, - "Value": { - "description": "A message that can hold any of the supported value types and associated\nmetadata.", - "type": "object", - "properties": { - "geoPointValue": { - "$ref": "LatLng", - "description": "A geo point value representing a point on the surface of Earth." - }, - "keyValue": { - "description": "A key value.", - "$ref": "Key" - }, - "integerValue": { - "description": "An integer value.", - "format": "int64", - "type": "string" - }, - "stringValue": { - "description": "A UTF-8 encoded string value.\nWhen `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.\nOtherwise, may be set to at least 1,000,000 bytes.", - "type": "string" - }, - "excludeFromIndexes": { - "description": "If the value should be excluded from all indexes including those defined\nexplicitly.", - "type": "boolean" - }, - "doubleValue": { - "description": "A double value.", - "format": "double", - "type": "number" - }, - "timestampValue": { - "description": "A timestamp value.\nWhen stored in the Datastore, precise only to microseconds;\nany additional precision is rounded down.", - "format": "google-datetime", - "type": "string" - }, - "nullValue": { - "enumDescriptions": [ - "Null value." - ], - "enum": [ - "NULL_VALUE" - ], - "description": "A null value.", - "type": "string" - }, - "booleanValue": { - "description": "A boolean value.", - "type": "boolean" - }, - "blobValue": { - "description": "A blob value.\nMay have at most 1,000,000 bytes.\nWhen `exclude_from_indexes` is false, may have at most 1500 bytes.\nIn JSON requests, must be base64-encoded.", - "format": "byte", - "type": "string" - }, - "meaning": { - "description": "The `meaning` field should only be populated for backwards compatibility.", - "format": "int32", - "type": "integer" - }, - "arrayValue": { - "description": "An array value.\nCannot contain another array value.\nA `Value` instance that sets field `array_value` must not set fields\n`meaning` or `exclude_from_indexes`.", - "$ref": "ArrayValue" - }, - "entityValue": { - "$ref": "Entity", - "description": "An entity value.\n\n- May have no key.\n- May have a key with an incomplete key path.\n- May have a reserved/read-only key." - } - }, - "id": "Value" - }, - "CommitResponse": { - "description": "The response for Datastore.Commit.", - "type": "object", - "properties": { - "mutationResults": { - "description": "The result of performing the mutations.\nThe i-th mutation result corresponds to the i-th mutation in the request.", - "type": "array", - "items": { - "$ref": "MutationResult" - } - }, - "indexUpdates": { - "description": "The number of index entries updated during the commit, or zero if none were\nupdated.", - "format": "int32", - "type": "integer" - } - }, - "id": "CommitResponse" - }, - "PartitionId": { - "description": "A partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.\n\nA partition ID contains several dimensions:\nproject ID and namespace ID.\n\nPartition dimensions:\n\n- May be `\"\"`.\n- Must be valid UTF-8 bytes.\n- Must have values that match regex `[A-Za-z\\d\\.\\-_]{1,100}`\nIf the value of any dimension matches regex `__.*__`, the partition is\nreserved/read-only.\nA reserved/read-only partition ID is forbidden in certain documented\ncontexts.\n\nForeign partition IDs (in which the project ID does\nnot match the context project ID ) are discouraged.\nReads and writes of foreign partition IDs may fail if the project is not in an active state.", - "type": "object", - "properties": { - "namespaceId": { - "description": "If not empty, the ID of the namespace to which the entities belong.", - "type": "string" - }, - "projectId": { - "description": "The ID of the project to which the entities belong.", + "outputUrl": { + "description": "Location of the output metadata file. This can be used to begin an import\ninto Cloud Datastore (this project or another project). See\ngoogle.datastore.admin.v1beta1.ImportEntitiesRequest.input_url.\nOnly present if the operation completed successfully.", "type": "string" } }, - "id": "PartitionId" - }, - "Entity": { - "description": "A Datastore data object.\n\nAn entity is limited to 1 megabyte when stored. That _roughly_\ncorresponds to a limit of 1 megabyte for the serialized form of this\nmessage.", - "type": "object", - "properties": { - "key": { - "$ref": "Key", - "description": "The entity's key.\n\nAn entity must have a key, unless otherwise documented (for example,\nan entity in `Value.entity_value` may have no key).\nAn entity's kind is its key path's last element's kind,\nor null if it has no key." - }, - "properties": { - "description": "The entity's properties.\nThe map's keys are property names.\nA property name matching regex `__.*__` is reserved.\nA reserved property name is forbidden in certain documented contexts.\nThe name must not contain more than 500 characters.\nThe name cannot be `\"\"`.", - "type": "object", - "additionalProperties": { - "$ref": "Value" - } - } - }, - "id": "Entity" - }, - "LookupRequest": { - "description": "The request for Datastore.Lookup.", - "type": "object", - "properties": { - "readOptions": { - "$ref": "ReadOptions", - "description": "The options for this lookup request." - }, - "keys": { - "description": "Keys of entities to look up.", - "type": "array", - "items": { - "$ref": "Key" - } - } - }, - "id": "LookupRequest" - }, - "QueryResultBatch": { - "description": "A batch of results produced by a query.", - "type": "object", - "properties": { - "moreResults": { - "description": "The state of the query after the current batch.", - "type": "string", - "enumDescriptions": [ - "Unspecified. This value is never used.", - "There may be additional batches to fetch from this query.", - "The query is finished, but there may be more results after the limit.", - "The query is finished, but there may be more results after the end\ncursor.", - "The query has been exhausted." - ], - "enum": [ - "MORE_RESULTS_TYPE_UNSPECIFIED", - "NOT_FINISHED", - "MORE_RESULTS_AFTER_LIMIT", - "MORE_RESULTS_AFTER_CURSOR", - "NO_MORE_RESULTS" - ] - }, - "endCursor": { - "description": "A cursor that points to the position after the last result in the batch.", - "format": "byte", - "type": "string" - }, - "snapshotVersion": { - "description": "The version number of the snapshot this batch was returned from.\nThis applies to the range of results from the query's `start_cursor` (or\nthe beginning of the query if no cursor was given) to this batch's\n`end_cursor` (not the query's `end_cursor`).\n\nIn a single transaction, subsequent query result batches for the same query\ncan have a greater snapshot version number. Each batch's snapshot version\nis valid for all preceding batches.\nThe value will be zero for eventually consistent queries.", - "format": "int64", - "type": "string" - }, - "skippedCursor": { - "description": "A cursor that points to the position after the last skipped result.\nWill be set when `skipped_results` != 0.", - "format": "byte", - "type": "string" - }, - "skippedResults": { - "description": "The number of results skipped, typically because of an offset.", - "format": "int32", - "type": "integer" - }, - "entityResultType": { - "description": "The result type for every entity in `entity_results`.", - "type": "string", - "enumDescriptions": [ - "Unspecified. This value is never used.", - "The key and properties.", - "A projected subset of properties. The entity may have no key.", - "Only the key." - ], - "enum": [ - "RESULT_TYPE_UNSPECIFIED", - "FULL", - "PROJECTION", - "KEY_ONLY" - ] - }, - "entityResults": { - "description": "The results for this batch.", - "type": "array", - "items": { - "$ref": "EntityResult" - } - } - }, - "id": "QueryResultBatch" - }, - "PathElement": { - "description": "A (kind, ID/name) pair used to construct a key path.\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete.", - "type": "object", - "properties": { - "name": { - "description": "The name of the entity.\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", - "type": "string" - }, - "kind": { - "description": "The kind of the entity.\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", - "type": "string" - }, - "id": { - "description": "The auto-allocated ID of the entity.\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.", - "format": "int64", - "type": "string" - } - }, - "id": "PathElement" - }, - "GqlQueryParameter": { - "description": "A binding parameter for a GQL query.", - "type": "object", - "properties": { - "cursor": { - "description": "A query cursor. Query cursors are returned in query\nresult batches.", - "format": "byte", - "type": "string" - }, - "value": { - "description": "A value parameter.", - "$ref": "Value" - } - }, - "id": "GqlQueryParameter" - }, - "BeginTransactionResponse": { - "description": "The response for Datastore.BeginTransaction.", - "type": "object", - "properties": { - "transaction": { - "description": "The transaction identifier (always present).", - "format": "byte", - "type": "string" - } - }, - "id": "BeginTransactionResponse" - }, - "AllocateIdsRequest": { - "description": "The request for Datastore.AllocateIds.", - "type": "object", - "properties": { - "keys": { - "description": "A list of keys with incomplete key paths for which to allocate IDs.\nNo key may be reserved/read-only.", - "type": "array", - "items": { - "$ref": "Key" - } - } - }, - "id": "AllocateIdsRequest" - }, - "LookupResponse": { - "description": "The response for Datastore.Lookup.", - "type": "object", - "properties": { - "deferred": { - "description": "A list of keys that were not looked up due to resource constraints. The\norder of results in this field is undefined and has no relation to the\norder of the keys in the input.", - "type": "array", - "items": { - "$ref": "Key" - } - }, - "found": { - "description": "Entities found as `ResultType.FULL` entities. The order of results in this\nfield is undefined and has no relation to the order of the keys in the\ninput.", - "type": "array", - "items": { - "$ref": "EntityResult" - } - }, - "missing": { - "description": "Entities not found as `ResultType.KEY_ONLY` entities. The order of results\nin this field is undefined and has no relation to the order of the keys\nin the input.", - "type": "array", - "items": { - "$ref": "EntityResult" - } - } - }, - "id": "LookupResponse" - }, - "RunQueryResponse": { - "description": "The response for Datastore.RunQuery.", - "type": "object", - "properties": { - "query": { - "$ref": "Query", - "description": "The parsed form of the `GqlQuery` from the request, if it was set." - }, - "batch": { - "description": "A batch of query results (always present).", - "$ref": "QueryResultBatch" - } - }, - "id": "RunQueryResponse" - }, - "PropertyOrder": { - "description": "The desired order for a specific property.", - "type": "object", - "properties": { - "property": { - "$ref": "PropertyReference", - "description": "The property to order by." - }, - "direction": { - "description": "The direction to order by. Defaults to `ASCENDING`.", - "type": "string", - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Ascending.", - "Descending." - ], - "enum": [ - "DIRECTION_UNSPECIFIED", - "ASCENDING", - "DESCENDING" - ] - } - }, - "id": "PropertyOrder" - }, - "BeginTransactionRequest": { - "description": "The request for Datastore.BeginTransaction.", - "type": "object", - "properties": {}, - "id": "BeginTransactionRequest" - }, - "CommitRequest": { - "description": "The request for Datastore.Commit.", - "type": "object", - "properties": { - "mode": { - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Transactional: The mutations are either all applied, or none are applied.\nLearn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions).", - "Non-transactional: The mutations may not apply as all or none." - ], - "enum": [ - "MODE_UNSPECIFIED", - "TRANSACTIONAL", - "NON_TRANSACTIONAL" - ], - "description": "The type of commit to perform. Defaults to `TRANSACTIONAL`.", - "type": "string" - }, - "mutations": { - "description": "The mutations to perform.\n\nWhen mode is `TRANSACTIONAL`, mutations affecting a single entity are\napplied in order. The following sequences of mutations affecting a single\nentity are not permitted in a single `Commit` request:\n\n- `insert` followed by `insert`\n- `update` followed by `insert`\n- `upsert` followed by `insert`\n- `delete` followed by `update`\n\nWhen mode is `NON_TRANSACTIONAL`, no two mutations may affect a single\nentity.", - "type": "array", - "items": { - "$ref": "Mutation" - } - }, - "transaction": { - "description": "The identifier of the transaction associated with the commit. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", - "format": "byte", - "type": "string" - } - }, - "id": "CommitRequest" - }, - "KindExpression": { - "description": "A representation of a kind.", - "type": "object", - "properties": { - "name": { - "description": "The name of the kind.", - "type": "string" - } - }, - "id": "KindExpression" - }, - "LatLng": { - "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)\n\nThe code in logs/storage/validator/logs_validator_traits.cc treats this type\nas if it were annotated as ST_LOCATION.", - "type": "object", - "properties": { - "latitude": { - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "format": "double", - "type": "number" - }, - "longitude": { - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "format": "double", - "type": "number" - } - }, - "id": "LatLng" - }, - "Key": { - "description": "A unique identifier for an entity.\nIf a key's partition ID or any of its path kinds or names are\nreserved/read-only, the key is reserved/read-only.\nA reserved/read-only key is forbidden in certain documented contexts.", - "type": "object", - "properties": { - "path": { - "description": "The entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a _root entity_, the second element identifies\na _child_ of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's _ancestors_.\n\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\n\nA path can never be empty, and a path can have at most 100 elements.", - "type": "array", - "items": { - "$ref": "PathElement" - } - }, - "partitionId": { - "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.", - "$ref": "PartitionId" - } - }, - "id": "Key" - }, - "PropertyReference": { - "properties": { - "name": { - "description": "The name of the property.\nIf name includes \".\"s, it may be interpreted as a property name path.", - "type": "string" - } - }, - "id": "PropertyReference", - "description": "A reference to a property relative to the kind expressions.", + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesResponse", + "description": "The response for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.", "type": "object" }, - "ArrayValue": { - "properties": { - "values": { - "description": "Values in the array.\nThe order of this array may not be preserved if it contains a mix of\nindexed and unindexed values.", - "type": "array", - "items": { - "$ref": "Value" - } - } - }, - "id": "ArrayValue", - "description": "An array value.", - "type": "object" - }, - "Projection": { - "description": "A representation of a property in a projection.", - "type": "object", - "properties": { - "property": { - "$ref": "PropertyReference", - "description": "The property to project." - } - }, - "id": "Projection" - }, - "Mutation": { - "properties": { - "insert": { - "description": "The entity to insert. The entity must not already exist.\nThe entity key's final path element may be incomplete.", - "$ref": "Entity" - }, - "baseVersion": { - "description": "The version of the entity that this mutation is being applied to. If this\ndoes not match the current version on the server, the mutation conflicts.", - "format": "int64", - "type": "string" - }, - "update": { - "$ref": "Entity", - "description": "The entity to update. The entity must already exist.\nMust have a complete key path." - }, - "upsert": { - "description": "The entity to upsert. The entity may or may not already exist.\nThe entity key's final path element may be incomplete.", - "$ref": "Entity" - }, - "delete": { - "$ref": "Key", - "description": "The key of the entity to delete. The entity may or may not already exist.\nMust have a complete key path and must not be reserved/read-only." - } - }, - "id": "Mutation", - "description": "A mutation to apply to an entity.", - "type": "object" - }, - "ReadOptions": { - "description": "The options shared by read requests.", - "type": "object", - "properties": { - "readConsistency": { - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Strong consistency.", - "Eventual consistency." - ], - "enum": [ - "READ_CONSISTENCY_UNSPECIFIED", - "STRONG", - "EVENTUAL" - ], - "description": "The non-transactional read consistency to use.\nCannot be set to `STRONG` for global queries.", - "type": "string" - }, - "transaction": { - "description": "The identifier of the transaction in which to read. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", - "format": "byte", - "type": "string" - } - }, - "id": "ReadOptions" - }, "RollbackResponse": { "description": "The response for Datastore.Rollback.\n(an empty message).", "type": "object", @@ -808,16 +422,16 @@ "type": "object", "properties": { "conflictDetected": { - "description": "Whether a conflict was detected for this mutation. Always false when a\nconflict detection strategy field is not set in the mutation.", - "type": "boolean" + "type": "boolean", + "description": "Whether a conflict was detected for this mutation. Always false when a\nconflict detection strategy field is not set in the mutation." }, "key": { - "description": "The automatically allocated key.\nSet only when the mutation allocated a key.", - "$ref": "Key" + "$ref": "Key", + "description": "The automatically allocated key.\nSet only when the mutation allocated a key." }, "version": { - "description": "The version of the entity on the server after processing the mutation. If\nthe mutation doesn't change anything on the server, then the version will\nbe the version of the current entity or, if no entity is present, a version\nthat is strictly greater than the version of any previous entity and less\nthan the version of any possible future entity.", "format": "int64", + "description": "The version of the entity on the server after processing the mutation. If\nthe mutation doesn't change anything on the server, then the version will\nbe the version of the current entity or, if no entity is present, a version\nthat is strictly greater than the version of any previous entity and less\nthan the version of any possible future entity.", "type": "string" } }, @@ -831,23 +445,23 @@ "description": "A string of the format described\n[here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).", "type": "string" }, + "positionalBindings": { + "description": "Numbered binding site @1 references the first numbered parameter,\neffectively using 1-based indexing, rather than the usual 0.\n\nFor each binding site numbered i in `query_string`, there must be an i-th\nnumbered parameter. The inverse must also be true.", + "items": { + "$ref": "GqlQueryParameter" + }, + "type": "array" + }, + "namedBindings": { + "description": "For each non-reserved named binding site in the query string, there must be\na named parameter with that name, but not necessarily the inverse.\n\nKey must match regex `A-Za-z_$*`, must not match regex\n`__.*__`, and must not be `\"\"`.", + "type": "object", + "additionalProperties": { + "$ref": "GqlQueryParameter" + } + }, "allowLiterals": { "description": "When false, the query string must not contain any literals and instead must\nbind all values. For example,\n`SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while\n`SELECT * FROM Kind WHERE a = @value` is.", "type": "boolean" - }, - "namedBindings": { - "additionalProperties": { - "$ref": "GqlQueryParameter" - }, - "description": "For each non-reserved named binding site in the query string, there must be\na named parameter with that name, but not necessarily the inverse.\n\nKey must match regex `A-Za-z_$*`, must not match regex\n`__.*__`, and must not be `\"\"`.", - "type": "object" - }, - "positionalBindings": { - "description": "Numbered binding site @1 references the first numbered parameter,\neffectively using 1-based indexing, rather than the usual 0.\n\nFor each binding site numbered i in `query_string`, there must be an i-th\nnumbered parameter. The inverse must also be true.", - "type": "array", - "items": { - "$ref": "GqlQueryParameter" - } } }, "id": "GqlQuery" @@ -855,12 +469,12 @@ "Filter": { "properties": { "compositeFilter": { - "description": "A composite filter.", - "$ref": "CompositeFilter" + "$ref": "CompositeFilter", + "description": "A composite filter." }, "propertyFilter": { - "description": "A filter on a property.", - "$ref": "PropertyFilter" + "$ref": "PropertyFilter", + "description": "A filter on a property." } }, "id": "Filter", @@ -868,42 +482,89 @@ "type": "object" }, "RollbackRequest": { + "description": "The request for Datastore.Rollback.", + "type": "object", "properties": { "transaction": { - "description": "The transaction identifier, returned by a call to\nDatastore.BeginTransaction.", "format": "byte", + "description": "The transaction identifier, returned by a call to\nDatastore.BeginTransaction.", "type": "string" } }, - "id": "RollbackRequest", - "description": "The request for Datastore.Rollback.", - "type": "object" + "id": "RollbackRequest" }, "RunQueryRequest": { "description": "The request for Datastore.RunQuery.", "type": "object", "properties": { - "partitionId": { - "$ref": "PartitionId", - "description": "Entities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID." - }, "gqlQuery": { "$ref": "GqlQuery", "description": "The GQL query to run." }, + "partitionId": { + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID." + }, "readOptions": { "description": "The options for this query.", "$ref": "ReadOptions" }, "query": { - "$ref": "Query", - "description": "The query to run." + "description": "The query to run.", + "$ref": "Query" } }, "id": "RunQueryRequest" }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata": { + "description": "Metadata for ExportEntities operations.", + "type": "object", + "properties": { + "progressEntities": { + "description": "An estimate of the number of entities processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + }, + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "progressBytes": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of bytes processed." + }, + "outputUrlPrefix": { + "description": "Location for the export metadata and data files. This will be the same\nvalue as the\ngoogle.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix\nfield. The final output location is provided in\ngoogle.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.", + "type": "string" + }, + "entityFilter": { + "description": "Description of which entities are being exported.", + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter" + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata" + }, + "TransactionOptions": { + "properties": { + "readOnly": { + "$ref": "ReadOnly", + "description": "The transaction should only allow reads." + }, + "readWrite": { + "$ref": "ReadWrite", + "description": "The transaction should allow both reads and writes." + } + }, + "id": "TransactionOptions", + "description": "Options for beginning a new transaction.\n\nTransactions can be created explicitly with calls to\nDatastore.BeginTransaction or implicitly by setting\nReadOptions.new_transaction in read requests.", + "type": "object" + }, "CompositeFilter": { - "description": "A filter that merges multiple other filters using the given operator.", "type": "object", "properties": { "op": { @@ -920,13 +581,41 @@ }, "filters": { "description": "The list of filters to combine.\nMust contain at least one filter.", - "type": "array", "items": { "$ref": "Filter" - } + }, + "type": "array" } }, - "id": "CompositeFilter" + "id": "CompositeFilter", + "description": "A filter that merges multiple other filters using the given operator." + }, + "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata": { + "description": "Metadata for ImportEntities operations.", + "type": "object", + "properties": { + "inputUrl": { + "description": "The location of the import metadata file. This will be the same value as\nthe google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url\nfield.", + "type": "string" + }, + "progressBytes": { + "description": "An estimate of the number of bytes processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + }, + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Description of which entities are being imported." + }, + "progressEntities": { + "description": "An estimate of the number of entities processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + }, + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + } + }, + "id": "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata" }, "AllocateIdsResponse": { "description": "The response for Datastore.AllocateIds.", @@ -934,10 +623,10 @@ "properties": { "keys": { "description": "The keys specified in the request (in the same order), each with\nits key path completed with a newly allocated ID.", - "type": "array", "items": { "$ref": "Key" - } + }, + "type": "array" } }, "id": "AllocateIdsResponse" @@ -948,77 +637,112 @@ "properties": { "projection": { "description": "The projection to return. Defaults to returning all properties.", - "type": "array", "items": { "$ref": "Projection" - } + }, + "type": "array" }, "endCursor": { - "description": "An ending point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).", "format": "byte", + "description": "An ending point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).", "type": "string" }, - "limit": { - "description": "The maximum number of results to return. Applies after all other\nconstraints. Optional.\nUnspecified is interpreted as no limit.\nMust be \u003e= 0 if specified.", - "format": "int32", - "type": "integer" - }, "filter": { "description": "The filter to apply.", "$ref": "Filter" }, - "offset": { - "description": "The number of results to skip. Applies before limit, but after all other\nconstraints. Optional. Must be \u003e= 0 if specified.", + "limit": { "format": "int32", + "description": "The maximum number of results to return. Applies after all other\nconstraints. Optional.\nUnspecified is interpreted as no limit.\nMust be \u003e= 0 if specified.", "type": "integer" }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The number of results to skip. Applies before limit, but after all other\nconstraints. Optional. Must be \u003e= 0 if specified." + }, "startCursor": { - "description": "A starting point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).", "format": "byte", + "description": "A starting point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).", "type": "string" }, "kind": { "description": "The kinds to query (if empty, returns entities of all kinds).\nCurrently at most 1 kind may be specified.", - "type": "array", "items": { "$ref": "KindExpression" - } + }, + "type": "array" }, "distinctOn": { "description": "The properties to make distinct. The query results will contain the first\nresult for each distinct combination of values for the given properties\n(if empty, all results are returned).", - "type": "array", "items": { "$ref": "PropertyReference" - } + }, + "type": "array" }, "order": { "description": "The order to apply to the query results (if empty, order is unspecified).", - "type": "array", "items": { "$ref": "PropertyOrder" - } + }, + "type": "array" } }, "id": "Query" }, - "PropertyFilter": { - "description": "A filter on a specific property.", + "GoogleLongrunningOperation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + } + }, + "id": "GoogleLongrunningOperation" + }, + "ReadOnly": { + "description": "Options specific to read-only transactions.", + "type": "object", + "properties": {}, + "id": "ReadOnly" + }, + "PropertyFilter": { + "type": "object", + "properties": { + "value": { + "$ref": "Value", + "description": "The value to compare the property to." + }, "property": { - "description": "The property to filter by.", - "$ref": "PropertyReference" + "$ref": "PropertyReference", + "description": "The property to filter by." }, "op": { - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Less than.", - "Less than or equal.", - "Greater than.", - "Greater than or equal.", - "Equal.", - "Has ancestor." - ], "enum": [ "OPERATOR_UNSPECIFIED", "LESS_THAN", @@ -1029,14 +753,716 @@ "HAS_ANCESTOR" ], "description": "The operator to filter by.", - "type": "string" - }, - "value": { - "description": "The value to compare the property to.", - "$ref": "Value" + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Less than.", + "Less than or equal.", + "Greater than.", + "Greater than or equal.", + "Equal.", + "Has ancestor." + ] } }, - "id": "PropertyFilter" + "id": "PropertyFilter", + "description": "A filter on a specific property." + }, + "EntityResult": { + "type": "object", + "properties": { + "entity": { + "description": "The resulting entity.", + "$ref": "Entity" + }, + "cursor": { + "type": "string", + "format": "byte", + "description": "A cursor that points to the position after the result entity.\nSet only when the `EntityResult` is part of a `QueryResultBatch` message." + }, + "version": { + "format": "int64", + "description": "The version of the entity, a strictly positive number that monotonically\nincreases with changes to the entity.\n\nThis field is set for `FULL` entity\nresults.\n\nFor missing entities in `LookupResponse`, this\nis the version of the snapshot that was used to look up the entity, and it\nis always set except for eventually consistent reads.", + "type": "string" + } + }, + "id": "EntityResult", + "description": "The result of fetching an entity from Datastore." + }, + "CommitResponse": { + "description": "The response for Datastore.Commit.", + "type": "object", + "properties": { + "indexUpdates": { + "format": "int32", + "description": "The number of index entries updated during the commit, or zero if none were\nupdated.", + "type": "integer" + }, + "mutationResults": { + "description": "The result of performing the mutations.\nThe i-th mutation result corresponds to the i-th mutation in the request.", + "items": { + "$ref": "MutationResult" + }, + "type": "array" + } + }, + "id": "CommitResponse" + }, + "Value": { + "type": "object", + "properties": { + "entityValue": { + "$ref": "Entity", + "description": "An entity value.\n\n- May have no key.\n- May have a key with an incomplete key path.\n- May have a reserved/read-only key." + }, + "geoPointValue": { + "$ref": "LatLng", + "description": "A geo point value representing a point on the surface of Earth." + }, + "integerValue": { + "format": "int64", + "description": "An integer value.", + "type": "string" + }, + "keyValue": { + "description": "A key value.", + "$ref": "Key" + }, + "stringValue": { + "type": "string", + "description": "A UTF-8 encoded string value.\nWhen `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.\nOtherwise, may be set to at least 1,000,000 bytes." + }, + "excludeFromIndexes": { + "description": "If the value should be excluded from all indexes including those defined\nexplicitly.", + "type": "boolean" + }, + "doubleValue": { + "format": "double", + "description": "A double value.", + "type": "number" + }, + "timestampValue": { + "format": "google-datetime", + "description": "A timestamp value.\nWhen stored in the Datastore, precise only to microseconds;\nany additional precision is rounded down.", + "type": "string" + }, + "nullValue": { + "enum": [ + "NULL_VALUE" + ], + "description": "A null value.", + "type": "string", + "enumDescriptions": [ + "Null value." + ] + }, + "booleanValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "blobValue": { + "format": "byte", + "description": "A blob value.\nMay have at most 1,000,000 bytes.\nWhen `exclude_from_indexes` is false, may have at most 1500 bytes.\nIn JSON requests, must be base64-encoded.", + "type": "string" + }, + "meaning": { + "format": "int32", + "description": "The `meaning` field should only be populated for backwards compatibility.", + "type": "integer" + }, + "arrayValue": { + "$ref": "ArrayValue", + "description": "An array value.\nCannot contain another array value.\nA `Value` instance that sets field `array_value` must not set fields\n`meaning` or `exclude_from_indexes`." + } + }, + "id": "Value", + "description": "A message that can hold any of the supported value types and associated\nmetadata." + }, + "PartitionId": { + "type": "object", + "properties": { + "projectId": { + "description": "The ID of the project to which the entities belong.", + "type": "string" + }, + "namespaceId": { + "description": "If not empty, the ID of the namespace to which the entities belong.", + "type": "string" + } + }, + "id": "PartitionId", + "description": "A partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.\n\nA partition ID contains several dimensions:\nproject ID and namespace ID.\n\nPartition dimensions:\n\n- May be `\"\"`.\n- Must be valid UTF-8 bytes.\n- Must have values that match regex `[A-Za-z\\d\\.\\-_]{1,100}`\nIf the value of any dimension matches regex `__.*__`, the partition is\nreserved/read-only.\nA reserved/read-only partition ID is forbidden in certain documented\ncontexts.\n\nForeign partition IDs (in which the project ID does\nnot match the context project ID ) are discouraged.\nReads and writes of foreign partition IDs may fail if the project is not in an active state." + }, + "ReadWrite": { + "description": "Options specific to read / write transactions.", + "type": "object", + "properties": { + "previousTransaction": { + "type": "string", + "format": "byte", + "description": "The transaction identifier of the transaction being retried." + } + }, + "id": "ReadWrite" + }, + "Entity": { + "description": "A Datastore data object.\n\nAn entity is limited to 1 megabyte when stored. That _roughly_\ncorresponds to a limit of 1 megabyte for the serialized form of this\nmessage.", + "type": "object", + "properties": { + "key": { + "$ref": "Key", + "description": "The entity's key.\n\nAn entity must have a key, unless otherwise documented (for example,\nan entity in `Value.entity_value` may have no key).\nAn entity's kind is its key path's last element's kind,\nor null if it has no key." + }, + "properties": { + "additionalProperties": { + "$ref": "Value" + }, + "description": "The entity's properties.\nThe map's keys are property names.\nA property name matching regex `__.*__` is reserved.\nA reserved property name is forbidden in certain documented contexts.\nThe name must not contain more than 500 characters.\nThe name cannot be `\"\"`.", + "type": "object" + } + }, + "id": "Entity" + }, + "LookupRequest": { + "description": "The request for Datastore.Lookup.", + "type": "object", + "properties": { + "readOptions": { + "description": "The options for this lookup request.", + "$ref": "ReadOptions" + }, + "keys": { + "description": "Keys of entities to look up.", + "items": { + "$ref": "Key" + }, + "type": "array" + } + }, + "id": "LookupRequest" + }, + "GoogleDatastoreAdminV1beta1Progress": { + "description": "Measures the progress of a particular metric.", + "type": "object", + "properties": { + "workEstimated": { + "format": "int64", + "description": "An estimate of how much work needs to be performed. May be zero if the\nwork estimate is unavailable.", + "type": "string" + }, + "workCompleted": { + "format": "int64", + "description": "The amount of work that has been completed. Note that this may be greater\nthan work_estimated.", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1Progress" + }, + "QueryResultBatch": { + "properties": { + "skippedCursor": { + "format": "byte", + "description": "A cursor that points to the position after the last skipped result.\nWill be set when `skipped_results` != 0.", + "type": "string" + }, + "skippedResults": { + "format": "int32", + "description": "The number of results skipped, typically because of an offset.", + "type": "integer" + }, + "entityResultType": { + "enumDescriptions": [ + "Unspecified. This value is never used.", + "The key and properties.", + "A projected subset of properties. The entity may have no key.", + "Only the key." + ], + "enum": [ + "RESULT_TYPE_UNSPECIFIED", + "FULL", + "PROJECTION", + "KEY_ONLY" + ], + "description": "The result type for every entity in `entity_results`.", + "type": "string" + }, + "entityResults": { + "description": "The results for this batch.", + "items": { + "$ref": "EntityResult" + }, + "type": "array" + }, + "endCursor": { + "format": "byte", + "description": "A cursor that points to the position after the last result in the batch.", + "type": "string" + }, + "moreResults": { + "description": "The state of the query after the current batch.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value is never used.", + "There may be additional batches to fetch from this query.", + "The query is finished, but there may be more results after the limit.", + "The query is finished, but there may be more results after the end\ncursor.", + "The query is finished, and there are no more results." + ], + "enum": [ + "MORE_RESULTS_TYPE_UNSPECIFIED", + "NOT_FINISHED", + "MORE_RESULTS_AFTER_LIMIT", + "MORE_RESULTS_AFTER_CURSOR", + "NO_MORE_RESULTS" + ] + }, + "snapshotVersion": { + "format": "int64", + "description": "The version number of the snapshot this batch was returned from.\nThis applies to the range of results from the query's `start_cursor` (or\nthe beginning of the query if no cursor was given) to this batch's\n`end_cursor` (not the query's `end_cursor`).\n\nIn a single transaction, subsequent query result batches for the same query\ncan have a greater snapshot version number. Each batch's snapshot version\nis valid for all preceding batches.\nThe value will be zero for eventually consistent queries.", + "type": "string" + } + }, + "id": "QueryResultBatch", + "description": "A batch of results produced by a query.", + "type": "object" + }, + "PathElement": { + "description": "A (kind, ID/name) pair used to construct a key path.\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete.", + "type": "object", + "properties": { + "name": { + "description": "The name of the entity.\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", + "type": "string" + }, + "kind": { + "description": "The kind of the entity.\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", + "type": "string" + }, + "id": { + "format": "int64", + "description": "The auto-allocated ID of the entity.\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.", + "type": "string" + } + }, + "id": "PathElement" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "Status" + }, + "GqlQueryParameter": { + "description": "A binding parameter for a GQL query.", + "type": "object", + "properties": { + "cursor": { + "type": "string", + "format": "byte", + "description": "A query cursor. Query cursors are returned in query\nresult batches." + }, + "value": { + "$ref": "Value", + "description": "A value parameter." + } + }, + "id": "GqlQueryParameter" + }, + "GoogleLongrunningListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "GoogleLongrunningOperation" + }, + "type": "array" + } + }, + "id": "GoogleLongrunningListOperationsResponse" + }, + "BeginTransactionResponse": { + "description": "The response for Datastore.BeginTransaction.", + "type": "object", + "properties": { + "transaction": { + "format": "byte", + "description": "The transaction identifier (always present).", + "type": "string" + } + }, + "id": "BeginTransactionResponse" + }, + "AllocateIdsRequest": { + "properties": { + "keys": { + "description": "A list of keys with incomplete key paths for which to allocate IDs.\nNo key may be reserved/read-only.", + "items": { + "$ref": "Key" + }, + "type": "array" + } + }, + "id": "AllocateIdsRequest", + "description": "The request for Datastore.AllocateIds.", + "type": "object" + }, + "RunQueryResponse": { + "description": "The response for Datastore.RunQuery.", + "type": "object", + "properties": { + "query": { + "$ref": "Query", + "description": "The parsed form of the `GqlQuery` from the request, if it was set." + }, + "batch": { + "description": "A batch of query results (always present).", + "$ref": "QueryResultBatch" + } + }, + "id": "RunQueryResponse" + }, + "LookupResponse": { + "type": "object", + "properties": { + "missing": { + "description": "Entities not found as `ResultType.KEY_ONLY` entities. The order of results\nin this field is undefined and has no relation to the order of the keys\nin the input.", + "items": { + "$ref": "EntityResult" + }, + "type": "array" + }, + "found": { + "description": "Entities found as `ResultType.FULL` entities. The order of results in this\nfield is undefined and has no relation to the order of the keys in the\ninput.", + "items": { + "$ref": "EntityResult" + }, + "type": "array" + }, + "deferred": { + "description": "A list of keys that were not looked up due to resource constraints. The\norder of results in this field is undefined and has no relation to the\norder of the keys in the input.", + "items": { + "$ref": "Key" + }, + "type": "array" + } + }, + "id": "LookupResponse", + "description": "The response for Datastore.Lookup." + }, + "CommitRequest": { + "properties": { + "transaction": { + "format": "byte", + "description": "The identifier of the transaction associated with the commit. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", + "type": "string" + }, + "mode": { + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Transactional: The mutations are either all applied, or none are applied.\nLearn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions).", + "Non-transactional: The mutations may not apply as all or none." + ], + "enum": [ + "MODE_UNSPECIFIED", + "TRANSACTIONAL", + "NON_TRANSACTIONAL" + ], + "description": "The type of commit to perform. Defaults to `TRANSACTIONAL`.", + "type": "string" + }, + "mutations": { + "description": "The mutations to perform.\n\nWhen mode is `TRANSACTIONAL`, mutations affecting a single entity are\napplied in order. The following sequences of mutations affecting a single\nentity are not permitted in a single `Commit` request:\n\n- `insert` followed by `insert`\n- `update` followed by `insert`\n- `upsert` followed by `insert`\n- `delete` followed by `update`\n\nWhen mode is `NON_TRANSACTIONAL`, no two mutations may affect a single\nentity.", + "items": { + "$ref": "Mutation" + }, + "type": "array" + } + }, + "id": "CommitRequest", + "description": "The request for Datastore.Commit.", + "type": "object" + }, + "BeginTransactionRequest": { + "description": "The request for Datastore.BeginTransaction.", + "type": "object", + "properties": { + "transactionOptions": { + "description": "Options for a new transaction.", + "$ref": "TransactionOptions" + } + }, + "id": "BeginTransactionRequest" + }, + "PropertyOrder": { + "description": "The desired order for a specific property.", + "type": "object", + "properties": { + "direction": { + "description": "The direction to order by. Defaults to `ASCENDING`.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Ascending.", + "Descending." + ], + "enum": [ + "DIRECTION_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ] + }, + "property": { + "$ref": "PropertyReference", + "description": "The property to order by." + } + }, + "id": "PropertyOrder" + }, + "KindExpression": { + "id": "KindExpression", + "description": "A representation of a kind.", + "type": "object", + "properties": { + "name": { + "description": "The name of the kind.", + "type": "string" + } + } + }, + "Key": { + "id": "Key", + "description": "A unique identifier for an entity.\nIf a key's partition ID or any of its path kinds or names are\nreserved/read-only, the key is reserved/read-only.\nA reserved/read-only key is forbidden in certain documented contexts.", + "type": "object", + "properties": { + "path": { + "description": "The entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a _root entity_, the second element identifies\na _child_ of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's _ancestors_.\n\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\n\nA path can never be empty, and a path can have at most 100 elements.", + "items": { + "$ref": "PathElement" + }, + "type": "array" + }, + "partitionId": { + "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.", + "$ref": "PartitionId" + } + } + }, + "LatLng": { + "id": "LatLng", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "type": "object", + "properties": { + "latitude": { + "format": "double", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "type": "number" + }, + "longitude": { + "format": "double", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "type": "number" + } + } + }, + "GoogleDatastoreAdminV1beta1EntityFilter": { + "type": "object", + "properties": { + "kinds": { + "description": "If empty, then this represents all kinds.", + "items": { + "type": "string" + }, + "type": "array" + }, + "namespaceIds": { + "description": "An empty list represents all namespaces. This is the preferred\nusage for projects that don't use namespaces.\n\nAn empty string element represents the default namespace. This should be\nused if the project has data in non-default namespaces, but doesn't want to\ninclude them.\nEach namespace in this list must be unique.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Identifies a subset of entities in a project. This is specified as\ncombinations of kinds and namespaces (either or both of which may be all, as\ndescribed in the following examples).\nExample usage:\n\nEntire project:\n kinds=[], namespace_ids=[]\n\nKinds Foo and Bar in all namespaces:\n kinds=['Foo', 'Bar'], namespace_ids=[]\n\nKinds Foo and Bar only in the default namespace:\n kinds=['Foo', 'Bar'], namespace_ids=['']\n\nKinds Foo and Bar in both the default and Baz namespaces:\n kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']\n\nThe entire Baz namespace:\n kinds=[], namespace_ids=['Baz']" + }, + "PropertyReference": { + "description": "A reference to a property relative to the kind expressions.", + "type": "object", + "properties": { + "name": { + "description": "The name of the property.\nIf name includes \".\"s, it may be interpreted as a property name path.", + "type": "string" + } + }, + "id": "PropertyReference" + }, + "GoogleDatastoreAdminV1beta1CommonMetadata": { + "description": "Metadata common to all Datastore Admin operations.", + "type": "object", + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The client-assigned labels which were provided when the operation was\ncreated. May also include additional labels.", + "type": "object" + }, + "endTime": { + "format": "google-datetime", + "description": "The time the operation ended, either successfully or otherwise.", + "type": "string" + }, + "state": { + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Request is being prepared for processing.", + "Request is actively being processed.", + "Request is in the process of being cancelled after user called\ngoogle.longrunning.Operations.CancelOperation on the operation.", + "Request has been processed and is in its finalization stage.", + "Request has completed successfully.", + "Request has finished being processed, but encountered an error.", + "Request has finished being cancelled after user called\ngoogle.longrunning.Operations.CancelOperation." + ], + "enum": [ + "STATE_UNSPECIFIED", + "INITIALIZING", + "PROCESSING", + "CANCELLING", + "FINALIZING", + "SUCCESSFUL", + "FAILED", + "CANCELLED" + ], + "description": "The current state of the Operation." + }, + "operationType": { + "enumDescriptions": [ + "Unspecified.", + "ExportEntities.", + "ImportEntities." + ], + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "EXPORT_ENTITIES", + "IMPORT_ENTITIES" + ], + "description": "The type of the operation. Can be used as a filter in\nListOperationsRequest.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "The time that work began on the operation.", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1CommonMetadata" + }, + "ArrayValue": { + "properties": { + "values": { + "description": "Values in the array.\nThe order of this array may not be preserved if it contains a mix of\nindexed and unindexed values.", + "items": { + "$ref": "Value" + }, + "type": "array" + } + }, + "id": "ArrayValue", + "description": "An array value.", + "type": "object" + }, + "Projection": { + "description": "A representation of a property in a projection.", + "type": "object", + "properties": { + "property": { + "description": "The property to project.", + "$ref": "PropertyReference" + } + }, + "id": "Projection" + }, + "Mutation": { + "description": "A mutation to apply to an entity.", + "type": "object", + "properties": { + "delete": { + "$ref": "Key", + "description": "The key of the entity to delete. The entity may or may not already exist.\nMust have a complete key path and must not be reserved/read-only." + }, + "baseVersion": { + "format": "int64", + "description": "The version of the entity that this mutation is being applied to. If this\ndoes not match the current version on the server, the mutation conflicts.", + "type": "string" + }, + "insert": { + "$ref": "Entity", + "description": "The entity to insert. The entity must not already exist.\nThe entity key's final path element may be incomplete." + }, + "update": { + "$ref": "Entity", + "description": "The entity to update. The entity must already exist.\nMust have a complete key path." + }, + "upsert": { + "$ref": "Entity", + "description": "The entity to upsert. The entity may or may not already exist.\nThe entity key's final path element may be incomplete." + } + }, + "id": "Mutation" + }, + "ReadOptions": { + "properties": { + "transaction": { + "type": "string", + "format": "byte", + "description": "The identifier of the transaction in which to read. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction." + }, + "readConsistency": { + "description": "The non-transactional read consistency to use.\nCannot be set to `STRONG` for global queries.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Strong consistency.", + "Eventual consistency." + ], + "enum": [ + "READ_CONSISTENCY_UNSPECIFIED", + "STRONG", + "EVENTUAL" + ] + } + }, + "id": "ReadOptions", + "description": "The options shared by read requests.", + "type": "object" } }, "icons": { @@ -1049,27 +1475,16 @@ "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/datastore": { "description": "View and manage your Google Cloud Datastore data" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" } } } }, - "kind": "discovery#restDescription", - "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", "servicePath": "", - "rootUrl": "https://datastore.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "datastore", - "batchPath": "batch", - "revision": "20170509", - "documentationLink": "https://cloud.google.com/datastore/", - "id": "datastore:v1", - "title": "Google Cloud Datastore API", - "discoveryVersion": "v1", - "ownerName": "Google" + "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", + "kind": "discovery#restDescription" } diff --git a/etc/api/datastore/v1beta1/datastore-api.json b/etc/api/datastore/v1beta1/datastore-api.json index e69de29bb2..3b00222088 100644 --- a/etc/api/datastore/v1beta1/datastore-api.json +++ b/etc/api/datastore/v1beta1/datastore-api.json @@ -0,0 +1,459 @@ +{ + "batchPath": "batch", + "revision": "20170918", + "documentationLink": "https://cloud.google.com/datastore/", + "id": "datastore:v1beta1", + "title": "Google Cloud Datastore API", + "discoveryVersion": "v1", + "ownerName": "Google", + "version_module": true, + "resources": { + "projects": { + "methods": { + "export": { + "id": "datastore.projects.export", + "path": "v1beta1/projects/{projectId}:export", + "request": { + "$ref": "GoogleDatastoreAdminV1beta1ExportEntitiesRequest" + }, + "description": "Exports a copy of all or a subset of entities from Google Cloud Datastore\nto another storage system, such as Google Cloud Storage. Recent updates to\nentities may not be reflected in the export. The export occurs in the\nbackground and its progress can be monitored and managed via the\nOperation resource that is created. The output of an export may only be\nused once the associated operation is done. If an export operation is\ncancelled before completion it may leave partial data behind in Google\nCloud Storage.", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "Project ID against which to make the request.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectId}:export" + }, + "import": { + "id": "datastore.projects.import", + "path": "v1beta1/projects/{projectId}:import", + "request": { + "$ref": "GoogleDatastoreAdminV1beta1ImportEntitiesRequest" + }, + "description": "Imports entities into Google Cloud Datastore. Existing entities with the\nsame key are overwritten. The import occurs in the background and its\nprogress can be monitored and managed via the Operation resource that is\ncreated. If an ImportEntities operation is cancelled, it is possible\nthat a subset of the data has already been imported to Cloud Datastore.", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "description": "Project ID against which to make the request.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}:import" + } + } + } + }, + "parameters": { + "key": { + "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.", + "type": "string", + "location": "query" + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, + "alt": { + "location": "query", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ] + } + }, + "schemas": { + "GoogleDatastoreAdminV1beta1ImportEntitiesRequest": { + "description": "The request for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities.", + "type": "object", + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Client-assigned labels.", + "type": "object" + }, + "inputUrl": { + "description": "The full resource URL of the external storage location. Currently, only\nGoogle Cloud Storage is supported. So input_url should be of the form:\n`gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where\n`BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is\nan optional Cloud Storage namespace path (this is not a Cloud Datastore\nnamespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written\nby the ExportEntities operation. For more information about Cloud Storage\nnamespace paths, see\n[Object name\nconsiderations](https://cloud.google.com/storage/docs/naming#object-considerations).\n\nFor more information, see\ngoogle.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.", + "type": "string" + }, + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Optionally specify which kinds/namespaces are to be imported. If provided,\nthe list must be a subset of the EntityFilter used in creating the export,\notherwise a FAILED_PRECONDITION error will be returned. If no filter is\nspecified then all entities from the export are imported." + } + }, + "id": "GoogleDatastoreAdminV1beta1ImportEntitiesRequest" + }, + "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata": { + "id": "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata", + "description": "Metadata for ImportEntities operations.", + "type": "object", + "properties": { + "entityFilter": { + "description": "Description of which entities are being imported.", + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter" + }, + "progressEntities": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of entities processed." + }, + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "inputUrl": { + "description": "The location of the import metadata file. This will be the same value as\nthe google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url\nfield.", + "type": "string" + }, + "progressBytes": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of bytes processed." + } + } + }, + "GoogleDatastoreAdminV1beta1Progress": { + "description": "Measures the progress of a particular metric.", + "type": "object", + "properties": { + "workEstimated": { + "format": "int64", + "description": "An estimate of how much work needs to be performed. May be zero if the\nwork estimate is unavailable.", + "type": "string" + }, + "workCompleted": { + "format": "int64", + "description": "The amount of work that has been completed. Note that this may be greater\nthan work_estimated.", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1Progress" + }, + "GoogleLongrunningOperation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any." + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + } + }, + "id": "GoogleLongrunningOperation" + }, + "GoogleDatastoreAdminV1beta1EntityFilter": { + "description": "Identifies a subset of entities in a project. This is specified as\ncombinations of kinds and namespaces (either or both of which may be all, as\ndescribed in the following examples).\nExample usage:\n\nEntire project:\n kinds=[], namespace_ids=[]\n\nKinds Foo and Bar in all namespaces:\n kinds=['Foo', 'Bar'], namespace_ids=[]\n\nKinds Foo and Bar only in the default namespace:\n kinds=['Foo', 'Bar'], namespace_ids=['']\n\nKinds Foo and Bar in both the default and Baz namespaces:\n kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']\n\nThe entire Baz namespace:\n kinds=[], namespace_ids=['Baz']", + "type": "object", + "properties": { + "kinds": { + "description": "If empty, then this represents all kinds.", + "items": { + "type": "string" + }, + "type": "array" + }, + "namespaceIds": { + "description": "An empty list represents all namespaces. This is the preferred\nusage for projects that don't use namespaces.\n\nAn empty string element represents the default namespace. This should be\nused if the project has data in non-default namespaces, but doesn't want to\ninclude them.\nEach namespace in this list must be unique.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "GoogleDatastoreAdminV1beta1EntityFilter" + }, + "GoogleDatastoreAdminV1beta1CommonMetadata": { + "description": "Metadata common to all Datastore Admin operations.", + "type": "object", + "properties": { + "endTime": { + "format": "google-datetime", + "description": "The time the operation ended, either successfully or otherwise.", + "type": "string" + }, + "state": { + "description": "The current state of the Operation.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Request is being prepared for processing.", + "Request is actively being processed.", + "Request is in the process of being cancelled after user called\ngoogle.longrunning.Operations.CancelOperation on the operation.", + "Request has been processed and is in its finalization stage.", + "Request has completed successfully.", + "Request has finished being processed, but encountered an error.", + "Request has finished being cancelled after user called\ngoogle.longrunning.Operations.CancelOperation." + ], + "enum": [ + "STATE_UNSPECIFIED", + "INITIALIZING", + "PROCESSING", + "CANCELLING", + "FINALIZING", + "SUCCESSFUL", + "FAILED", + "CANCELLED" + ] + }, + "operationType": { + "enumDescriptions": [ + "Unspecified.", + "ExportEntities.", + "ImportEntities." + ], + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "EXPORT_ENTITIES", + "IMPORT_ENTITIES" + ], + "description": "The type of the operation. Can be used as a filter in\nListOperationsRequest.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "The time that work began on the operation.", + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The client-assigned labels which were provided when the operation was\ncreated. May also include additional labels." + } + }, + "id": "GoogleDatastoreAdminV1beta1CommonMetadata" + }, + "Status": { + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code." + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesRequest": { + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesRequest", + "description": "The request for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.", + "type": "object", + "properties": { + "labels": { + "description": "Client-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "outputUrlPrefix": { + "description": "Location for the export metadata and data files.\n\nThe full resource URL of the external storage location. Currently, only\nGoogle Cloud Storage is supported. So output_url_prefix should be of the\nform: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the\nname of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud\nStorage namespace path (this is not a Cloud Datastore namespace). For more\ninformation about Cloud Storage namespace paths, see\n[Object name\nconsiderations](https://cloud.google.com/storage/docs/naming#object-considerations).\n\nThe resulting files will be nested deeper than the specified URL prefix.\nThe final output URL will be provided in the\ngoogle.datastore.admin.v1beta1.ExportEntitiesResponse.output_url\nfield. That value should be used for subsequent ImportEntities operations.\n\nBy nesting the data files deeper, the same Cloud Storage bucket can be used\nin multiple ExportEntities operations without conflict.", + "type": "string" + }, + "entityFilter": { + "description": "Description of what data from the project is included in the export.", + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter" + } + } + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata": { + "description": "Metadata for ExportEntities operations.", + "type": "object", + "properties": { + "outputUrlPrefix": { + "description": "Location for the export metadata and data files. This will be the same\nvalue as the\ngoogle.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix\nfield. The final output location is provided in\ngoogle.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.", + "type": "string" + }, + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Description of which entities are being exported." + }, + "progressEntities": { + "description": "An estimate of the number of entities processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + }, + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "progressBytes": { + "description": "An estimate of the number of bytes processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesResponse": { + "type": "object", + "properties": { + "outputUrl": { + "description": "Location of the output metadata file. This can be used to begin an import\ninto Cloud Datastore (this project or another project). See\ngoogle.datastore.admin.v1beta1.ImportEntitiesRequest.input_url.\nOnly present if the operation completed successfully.", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesResponse", + "description": "The response for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities." + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "version": "v1beta1", + "baseUrl": "https://datastore.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/datastore": { + "description": "View and manage your Google Cloud Datastore data" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "servicePath": "", + "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", + "kind": "discovery#restDescription", + "rootUrl": "https://datastore.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "datastore" +} diff --git a/etc/api/datastore/v1beta3/datastore-api.json b/etc/api/datastore/v1beta3/datastore-api.json index aace709465..e4b6329b53 100644 --- a/etc/api/datastore/v1beta3/datastore-api.json +++ b/etc/api/datastore/v1beta3/datastore-api.json @@ -1,78 +1,26 @@ { - "version": "v1beta3", - "baseUrl": "https://datastore.googleapis.com/", - "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/datastore": { - "description": "View and manage your Google Cloud Datastore data" - } - } - } - }, - "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", - "servicePath": "", - "kind": "discovery#restDescription", - "rootUrl": "https://datastore.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "datastore", - "batchPath": "batch", - "id": "datastore:v1beta3", - "documentationLink": "https://cloud.google.com/datastore/", - "revision": "20170509", - "title": "Google Cloud Datastore API", - "ownerName": "Google", - "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "resources": { "projects": { "methods": { - "runQuery": { - "response": { - "$ref": "RunQueryResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "parameters": { - "projectId": { - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1beta3/projects/{projectId}:runQuery", - "path": "v1beta3/projects/{projectId}:runQuery", - "id": "datastore.projects.runQuery", - "description": "Queries for entities.", - "request": { - "$ref": "RunQueryRequest" - } - }, "rollback": { - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], + "description": "Rolls back a transaction.", + "request": { + "$ref": "RollbackRequest" + }, "response": { "$ref": "RollbackResponse" }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", "parameters": { "projectId": { + "location": "path", "description": "The ID of the project against which to make the request.", - "required": true, "type": "string", - "location": "path" + "required": true } }, "scopes": [ @@ -81,19 +29,37 @@ ], "flatPath": "v1beta3/projects/{projectId}:rollback", "id": "datastore.projects.rollback", - "path": "v1beta3/projects/{projectId}:rollback", - "request": { - "$ref": "RollbackRequest" + "path": "v1beta3/projects/{projectId}:rollback" + }, + "runQuery": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "RunQueryResponse" }, - "description": "Rolls back a transaction." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1beta3/projects/{projectId}:runQuery", + "path": "v1beta3/projects/{projectId}:runQuery", + "id": "datastore.projects.runQuery", + "request": { + "$ref": "RunQueryRequest" + }, + "description": "Queries for entities." }, "lookup": { - "path": "v1beta3/projects/{projectId}:lookup", - "id": "datastore.projects.lookup", - "description": "Looks up entities by key.", - "request": { - "$ref": "LookupRequest" - }, "response": { "$ref": "LookupResponse" }, @@ -107,15 +73,25 @@ ], "parameters": { "projectId": { + "location": "path", "description": "The ID of the project against which to make the request.", - "required": true, "type": "string", - "location": "path" + "required": true } }, - "flatPath": "v1beta3/projects/{projectId}:lookup" + "flatPath": "v1beta3/projects/{projectId}:lookup", + "id": "datastore.projects.lookup", + "path": "v1beta3/projects/{projectId}:lookup", + "request": { + "$ref": "LookupRequest" + }, + "description": "Looks up entities by key." }, "allocateIds": { + "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted.", + "request": { + "$ref": "AllocateIdsRequest" + }, "response": { "$ref": "AllocateIdsResponse" }, @@ -123,31 +99,23 @@ "projectId" ], "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/datastore" ], - "parameters": { - "projectId": { - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string", - "location": "path" - } - }, "flatPath": "v1beta3/projects/{projectId}:allocateIds", - "path": "v1beta3/projects/{projectId}:allocateIds", "id": "datastore.projects.allocateIds", - "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted.", - "request": { - "$ref": "AllocateIdsRequest" - } + "path": "v1beta3/projects/{projectId}:allocateIds" }, "commit": { - "request": { - "$ref": "CommitRequest" - }, - "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.", "httpMethod": "POST", "parameterOrder": [ "projectId" @@ -155,30 +123,6 @@ "response": { "$ref": "CommitResponse" }, - "parameters": { - "projectId": { - "description": "The ID of the project against which to make the request.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "flatPath": "v1beta3/projects/{projectId}:commit", - "id": "datastore.projects.commit", - "path": "v1beta3/projects/{projectId}:commit" - }, - "beginTransaction": { - "response": { - "$ref": "BeginTransactionResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/datastore" @@ -187,70 +131,52 @@ "projectId": { "location": "path", "description": "The ID of the project against which to make the request.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta3/projects/{projectId}:commit", + "path": "v1beta3/projects/{projectId}:commit", + "id": "datastore.projects.commit", + "request": { + "$ref": "CommitRequest" + }, + "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities." + }, + "beginTransaction": { + "request": { + "$ref": "BeginTransactionRequest" + }, + "description": "Begins a new transaction.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "BeginTransactionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "type": "string", "required": true, - "type": "string" + "location": "path", + "description": "The ID of the project against which to make the request." } }, "flatPath": "v1beta3/projects/{projectId}:beginTransaction", "path": "v1beta3/projects/{projectId}:beginTransaction", - "id": "datastore.projects.beginTransaction", - "description": "Begins a new transaction.", - "request": { - "$ref": "BeginTransactionRequest" - } + "id": "datastore.projects.beginTransaction" } } } }, "parameters": { - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, "$.xgafv": { + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -260,12 +186,14 @@ "1", "2" ], - "description": "V1 error format.", + "description": "V1 error format." + }, + "callback": { + "location": "query", + "description": "JSONP", "type": "string" }, "alt": { - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -277,362 +205,96 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query" - }, - "key": { "location": "query", - "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.", - "type": "string" + "description": "Data format for response.", + "default": "json" }, "access_token": { + "location": "query", "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", "type": "string", "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "type": "string", + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" } }, "schemas": { - "PathElement": { - "properties": { - "name": { - "description": "The name of the entity.\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", - "type": "string" - }, - "kind": { - "description": "The kind of the entity.\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", - "type": "string" - }, - "id": { - "description": "The auto-allocated ID of the entity.\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.", - "format": "int64", - "type": "string" - } - }, - "id": "PathElement", - "description": "A (kind, ID/name) pair used to construct a key path.\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete.", - "type": "object" - }, - "GqlQueryParameter": { - "description": "A binding parameter for a GQL query.", - "type": "object", - "properties": { - "cursor": { - "description": "A query cursor. Query cursors are returned in query\nresult batches.", - "format": "byte", - "type": "string" - }, - "value": { - "$ref": "Value", - "description": "A value parameter." - } - }, - "id": "GqlQueryParameter" - }, - "BeginTransactionResponse": { - "properties": { - "transaction": { - "description": "The transaction identifier (always present).", - "format": "byte", - "type": "string" - } - }, - "id": "BeginTransactionResponse", - "description": "The response for Datastore.BeginTransaction.", - "type": "object" - }, - "RunQueryResponse": { - "properties": { - "query": { - "$ref": "Query", - "description": "The parsed form of the `GqlQuery` from the request, if it was set." - }, - "batch": { - "$ref": "QueryResultBatch", - "description": "A batch of query results (always present)." - } - }, - "id": "RunQueryResponse", - "description": "The response for Datastore.RunQuery.", - "type": "object" - }, - "LookupResponse": { - "description": "The response for Datastore.Lookup.", - "type": "object", - "properties": { - "found": { - "description": "Entities found as `ResultType.FULL` entities. The order of results in this\nfield is undefined and has no relation to the order of the keys in the\ninput.", - "type": "array", - "items": { - "$ref": "EntityResult" - } - }, - "missing": { - "description": "Entities not found as `ResultType.KEY_ONLY` entities. The order of results\nin this field is undefined and has no relation to the order of the keys\nin the input.", - "type": "array", - "items": { - "$ref": "EntityResult" - } - }, - "deferred": { - "description": "A list of keys that were not looked up due to resource constraints. The\norder of results in this field is undefined and has no relation to the\norder of the keys in the input.", - "type": "array", - "items": { - "$ref": "Key" - } - } - }, - "id": "LookupResponse" - }, - "AllocateIdsRequest": { - "properties": { - "keys": { - "description": "A list of keys with incomplete key paths for which to allocate IDs.\nNo key may be reserved/read-only.", - "type": "array", - "items": { - "$ref": "Key" - } - } - }, - "id": "AllocateIdsRequest", - "description": "The request for Datastore.AllocateIds.", - "type": "object" - }, - "PropertyOrder": { - "properties": { - "property": { - "description": "The property to order by.", - "$ref": "PropertyReference" - }, - "direction": { - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Ascending.", - "Descending." - ], - "enum": [ - "DIRECTION_UNSPECIFIED", - "ASCENDING", - "DESCENDING" - ], - "description": "The direction to order by. Defaults to `ASCENDING`.", - "type": "string" - } - }, - "id": "PropertyOrder", - "description": "The desired order for a specific property.", - "type": "object" - }, - "BeginTransactionRequest": { - "properties": {}, - "id": "BeginTransactionRequest", - "description": "The request for Datastore.BeginTransaction.", - "type": "object" - }, - "CommitRequest": { - "properties": { - "mutations": { - "description": "The mutations to perform.\n\nWhen mode is `TRANSACTIONAL`, mutations affecting a single entity are\napplied in order. The following sequences of mutations affecting a single\nentity are not permitted in a single `Commit` request:\n\n- `insert` followed by `insert`\n- `update` followed by `insert`\n- `upsert` followed by `insert`\n- `delete` followed by `update`\n\nWhen mode is `NON_TRANSACTIONAL`, no two mutations may affect a single\nentity.", - "type": "array", - "items": { - "$ref": "Mutation" - } - }, - "transaction": { - "description": "The identifier of the transaction associated with the commit. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", - "format": "byte", - "type": "string" - }, - "mode": { - "enum": [ - "MODE_UNSPECIFIED", - "TRANSACTIONAL", - "NON_TRANSACTIONAL" - ], - "description": "The type of commit to perform. Defaults to `TRANSACTIONAL`.", - "type": "string", - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Transactional: The mutations are either all applied, or none are applied.\nLearn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions).", - "Non-transactional: The mutations may not apply as all or none." - ] - } - }, - "id": "CommitRequest", - "description": "The request for Datastore.Commit.", - "type": "object" - }, - "KindExpression": { - "properties": { - "name": { - "description": "The name of the kind.", - "type": "string" - } - }, - "id": "KindExpression", - "description": "A representation of a kind.", - "type": "object" - }, - "LatLng": { - "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)\n\nThe code in logs/storage/validator/logs_validator_traits.cc treats this type\nas if it were annotated as ST_LOCATION.", - "type": "object", - "properties": { - "latitude": { - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "format": "double", - "type": "number" - }, - "longitude": { - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "format": "double", - "type": "number" - } - }, - "id": "LatLng" - }, - "Key": { - "properties": { - "path": { - "description": "The entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a _root entity_, the second element identifies\na _child_ of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's _ancestors_.\n\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\n\nA path can never be empty, and a path can have at most 100 elements.", - "type": "array", - "items": { - "$ref": "PathElement" - } - }, - "partitionId": { - "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.", - "$ref": "PartitionId" - } - }, - "id": "Key", - "description": "A unique identifier for an entity.\nIf a key's partition ID or any of its path kinds or names are\nreserved/read-only, the key is reserved/read-only.\nA reserved/read-only key is forbidden in certain documented contexts.", - "type": "object" - }, - "PropertyReference": { - "properties": { - "name": { - "description": "The name of the property.\nIf name includes \".\"s, it may be interpreted as a property name path.", - "type": "string" - } - }, - "id": "PropertyReference", - "description": "A reference to a property relative to the kind expressions.", - "type": "object" - }, - "Projection": { - "properties": { - "property": { - "description": "The property to project.", - "$ref": "PropertyReference" - } - }, - "id": "Projection", - "description": "A representation of a property in a projection.", - "type": "object" - }, - "ArrayValue": { - "properties": { - "values": { - "description": "Values in the array.\nThe order of this array may not be preserved if it contains a mix of\nindexed and unindexed values.", - "type": "array", - "items": { - "$ref": "Value" - } - } - }, - "id": "ArrayValue", - "description": "An array value.", - "type": "object" - }, - "Mutation": { - "description": "A mutation to apply to an entity.", - "type": "object", - "properties": { - "delete": { - "$ref": "Key", - "description": "The key of the entity to delete. The entity may or may not already exist.\nMust have a complete key path and must not be reserved/read-only." - }, - "insert": { - "description": "The entity to insert. The entity must not already exist.\nThe entity key's final path element may be incomplete.", - "$ref": "Entity" - }, - "baseVersion": { - "description": "The version of the entity that this mutation is being applied to. If this\ndoes not match the current version on the server, the mutation conflicts.", - "format": "int64", - "type": "string" - }, - "update": { - "description": "The entity to update. The entity must already exist.\nMust have a complete key path.", - "$ref": "Entity" - }, - "upsert": { - "description": "The entity to upsert. The entity may or may not already exist.\nThe entity key's final path element may be incomplete.", - "$ref": "Entity" - } - }, - "id": "Mutation" - }, - "ReadOptions": { - "properties": { - "readConsistency": { - "enum": [ - "READ_CONSISTENCY_UNSPECIFIED", - "STRONG", - "EVENTUAL" - ], - "description": "The non-transactional read consistency to use.\nCannot be set to `STRONG` for global queries.", - "type": "string", - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "Strong consistency.", - "Eventual consistency." - ] - }, - "transaction": { - "description": "The identifier of the transaction in which to read. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", - "format": "byte", - "type": "string" - } - }, - "id": "ReadOptions", - "description": "The options shared by read requests.", - "type": "object" - }, - "RollbackResponse": { - "properties": {}, - "id": "RollbackResponse", - "description": "The response for Datastore.Rollback.\n(an empty message).", - "type": "object" - }, "MutationResult": { "description": "The result of applying a mutation.", "type": "object", "properties": { - "version": { - "description": "The version of the entity on the server after processing the mutation. If\nthe mutation doesn't change anything on the server, then the version will\nbe the version of the current entity or, if no entity is present, a version\nthat is strictly greater than the version of any previous entity and less\nthan the version of any possible future entity.", - "format": "int64", - "type": "string" - }, "conflictDetected": { "description": "Whether a conflict was detected for this mutation. Always false when a\nconflict detection strategy field is not set in the mutation.", "type": "boolean" }, "key": { - "$ref": "Key", - "description": "The automatically allocated key.\nSet only when the mutation allocated a key." + "description": "The automatically allocated key.\nSet only when the mutation allocated a key.", + "$ref": "Key" + }, + "version": { + "format": "int64", + "description": "The version of the entity on the server after processing the mutation. If\nthe mutation doesn't change anything on the server, then the version will\nbe the version of the current entity or, if no entity is present, a version\nthat is strictly greater than the version of any previous entity and less\nthan the version of any possible future entity.", + "type": "string" } }, "id": "MutationResult" }, "GqlQuery": { - "description": "A [GQL query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).", - "type": "object", "properties": { "queryString": { "description": "A string of the format described\n[here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).", "type": "string" }, - "allowLiterals": { - "description": "When false, the query string must not contain any literals and instead must\nbind all values. For example,\n`SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while\n`SELECT * FROM Kind WHERE a = @value` is.", - "type": "boolean" + "positionalBindings": { + "description": "Numbered binding site @1 references the first numbered parameter,\neffectively using 1-based indexing, rather than the usual 0.\n\nFor each binding site numbered i in `query_string`, there must be an i-th\nnumbered parameter. The inverse must also be true.", + "items": { + "$ref": "GqlQueryParameter" + }, + "type": "array" }, "namedBindings": { "additionalProperties": { @@ -641,76 +303,115 @@ "description": "For each non-reserved named binding site in the query string, there must be\na named parameter with that name, but not necessarily the inverse.\n\nKey must match regex `A-Za-z_$*`, must not match regex\n`__.*__`, and must not be `\"\"`.", "type": "object" }, - "positionalBindings": { - "description": "Numbered binding site @1 references the first numbered parameter,\neffectively using 1-based indexing, rather than the usual 0.\n\nFor each binding site numbered i in `query_string`, there must be an i-th\nnumbered parameter. The inverse must also be true.", - "type": "array", - "items": { - "$ref": "GqlQueryParameter" - } + "allowLiterals": { + "description": "When false, the query string must not contain any literals and instead must\nbind all values. For example,\n`SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while\n`SELECT * FROM Kind WHERE a = @value` is.", + "type": "boolean" } }, - "id": "GqlQuery" + "id": "GqlQuery", + "description": "A [GQL query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).", + "type": "object" }, "Filter": { + "description": "A holder for any type of filter.", + "type": "object", "properties": { "compositeFilter": { - "description": "A composite filter.", - "$ref": "CompositeFilter" + "$ref": "CompositeFilter", + "description": "A composite filter." }, "propertyFilter": { - "$ref": "PropertyFilter", - "description": "A filter on a property." + "description": "A filter on a property.", + "$ref": "PropertyFilter" } }, - "id": "Filter", - "description": "A holder for any type of filter.", - "type": "object" + "id": "Filter" }, "RollbackRequest": { "description": "The request for Datastore.Rollback.", "type": "object", "properties": { "transaction": { - "description": "The transaction identifier, returned by a call to\nDatastore.BeginTransaction.", + "type": "string", "format": "byte", - "type": "string" + "description": "The transaction identifier, returned by a call to\nDatastore.BeginTransaction." } }, "id": "RollbackRequest" }, "RunQueryRequest": { + "description": "The request for Datastore.RunQuery.", + "type": "object", "properties": { - "partitionId": { - "description": "Entities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID.", - "$ref": "PartitionId" - }, "gqlQuery": { - "description": "The GQL query to run.", - "$ref": "GqlQuery" + "$ref": "GqlQuery", + "description": "The GQL query to run." + }, + "partitionId": { + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID." }, "readOptions": { - "description": "The options for this query.", - "$ref": "ReadOptions" + "$ref": "ReadOptions", + "description": "The options for this query." }, "query": { "$ref": "Query", "description": "The query to run." } }, - "id": "RunQueryRequest", - "description": "The request for Datastore.RunQuery.", - "type": "object" + "id": "RunQueryRequest" }, - "CompositeFilter": { - "description": "A filter that merges multiple other filters using the given operator.", + "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata": { + "description": "Metadata for ExportEntities operations.", "type": "object", + "properties": { + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "progressBytes": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of bytes processed." + }, + "outputUrlPrefix": { + "description": "Location for the export metadata and data files. This will be the same\nvalue as the\ngoogle.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix\nfield. The final output location is provided in\ngoogle.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.", + "type": "string" + }, + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Description of which entities are being exported." + }, + "progressEntities": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of entities processed." + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata" + }, + "TransactionOptions": { + "id": "TransactionOptions", + "description": "Options for beginning a new transaction.\n\nTransactions can be created explicitly with calls to\nDatastore.BeginTransaction or implicitly by setting\nReadOptions.new_transaction in read requests.", + "type": "object", + "properties": { + "readOnly": { + "$ref": "ReadOnly", + "description": "The transaction should only allow reads." + }, + "readWrite": { + "$ref": "ReadWrite", + "description": "The transaction should allow both reads and writes." + } + } + }, + "CompositeFilter": { "properties": { "filters": { - "description": "The list of filters to combine.\nMust contain at least one filter.", - "type": "array", "items": { "$ref": "Filter" - } + }, + "type": "array", + "description": "The list of filters to combine.\nMust contain at least one filter." }, "op": { "enum": [ @@ -725,82 +426,120 @@ ] } }, - "id": "CompositeFilter" + "id": "CompositeFilter", + "description": "A filter that merges multiple other filters using the given operator.", + "type": "object" + }, + "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata": { + "description": "Metadata for ImportEntities operations.", + "type": "object", + "properties": { + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "inputUrl": { + "description": "The location of the import metadata file. This will be the same value as\nthe google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url\nfield.", + "type": "string" + }, + "progressBytes": { + "description": "An estimate of the number of bytes processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + }, + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Description of which entities are being imported." + }, + "progressEntities": { + "description": "An estimate of the number of entities processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + } + }, + "id": "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata" }, "AllocateIdsResponse": { - "description": "The response for Datastore.AllocateIds.", "type": "object", "properties": { "keys": { "description": "The keys specified in the request (in the same order), each with\nits key path completed with a newly allocated ID.", - "type": "array", "items": { "$ref": "Key" - } + }, + "type": "array" } }, - "id": "AllocateIdsResponse" + "id": "AllocateIdsResponse", + "description": "The response for Datastore.AllocateIds." }, "Query": { + "description": "A query for entities.", + "type": "object", "properties": { - "endCursor": { - "description": "An ending point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).", - "format": "byte", - "type": "string" + "kind": { + "description": "The kinds to query (if empty, returns entities of all kinds).\nCurrently at most 1 kind may be specified.", + "items": { + "$ref": "KindExpression" + }, + "type": "array" }, - "limit": { - "description": "The maximum number of results to return. Applies after all other\nconstraints. Optional.\nUnspecified is interpreted as no limit.\nMust be \u003e= 0 if specified.", - "format": "int32", - "type": "integer" + "distinctOn": { + "items": { + "$ref": "PropertyReference" + }, + "type": "array", + "description": "The properties to make distinct. The query results will contain the first\nresult for each distinct combination of values for the given properties\n(if empty, all results are returned)." + }, + "order": { + "description": "The order to apply to the query results (if empty, order is unspecified).", + "items": { + "$ref": "PropertyOrder" + }, + "type": "array" + }, + "projection": { + "description": "The projection to return. Defaults to returning all properties.", + "items": { + "$ref": "Projection" + }, + "type": "array" + }, + "endCursor": { + "type": "string", + "format": "byte", + "description": "An ending point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets)." }, "filter": { "$ref": "Filter", "description": "The filter to apply." }, - "offset": { - "description": "The number of results to skip. Applies before limit, but after all other\nconstraints. Optional. Must be \u003e= 0 if specified.", + "limit": { "format": "int32", + "description": "The maximum number of results to return. Applies after all other\nconstraints. Optional.\nUnspecified is interpreted as no limit.\nMust be \u003e= 0 if specified.", "type": "integer" }, "startCursor": { - "description": "A starting point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).", + "type": "string", "format": "byte", - "type": "string" + "description": "A starting point for the query results. Query cursors are\nreturned in query result batches and\n[can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets)." }, - "kind": { - "description": "The kinds to query (if empty, returns entities of all kinds).\nCurrently at most 1 kind may be specified.", - "type": "array", - "items": { - "$ref": "KindExpression" - } - }, - "distinctOn": { - "description": "The properties to make distinct. The query results will contain the first\nresult for each distinct combination of values for the given properties\n(if empty, all results are returned).", - "type": "array", - "items": { - "$ref": "PropertyReference" - } - }, - "order": { - "description": "The order to apply to the query results (if empty, order is unspecified).", - "type": "array", - "items": { - "$ref": "PropertyOrder" - } - }, - "projection": { - "description": "The projection to return. Defaults to returning all properties.", - "type": "array", - "items": { - "$ref": "Projection" - } + "offset": { + "format": "int32", + "description": "The number of results to skip. Applies before limit, but after all other\nconstraints. Optional. Must be \u003e= 0 if specified.", + "type": "integer" } }, - "id": "Query", - "description": "A query for entities.", + "id": "Query" + }, + "ReadOnly": { + "properties": {}, + "id": "ReadOnly", + "description": "Options specific to read-only transactions.", "type": "object" }, "PropertyFilter": { + "id": "PropertyFilter", + "description": "A filter on a specific property.", + "type": "object", "properties": { "value": { "$ref": "Value", @@ -811,6 +550,8 @@ "description": "The property to filter by." }, "op": { + "description": "The operator to filter by.", + "type": "string", "enumDescriptions": [ "Unspecified. This value must not be used.", "Less than.", @@ -828,49 +569,44 @@ "GREATER_THAN_OR_EQUAL", "EQUAL", "HAS_ANCESTOR" - ], - "description": "The operator to filter by.", - "type": "string" + ] } - }, - "id": "PropertyFilter", - "description": "A filter on a specific property.", - "type": "object" + } }, "EntityResult": { + "description": "The result of fetching an entity from Datastore.", + "type": "object", "properties": { - "cursor": { - "description": "A cursor that points to the position after the result entity.\nSet only when the `EntityResult` is part of a `QueryResultBatch` message.", - "format": "byte", - "type": "string" - }, - "version": { - "description": "The version of the entity, a strictly positive number that monotonically\nincreases with changes to the entity.\n\nThis field is set for `FULL` entity\nresults.\n\nFor missing entities in `LookupResponse`, this\nis the version of the snapshot that was used to look up the entity, and it\nis always set except for eventually consistent reads.", - "format": "int64", - "type": "string" - }, "entity": { "description": "The resulting entity.", "$ref": "Entity" + }, + "cursor": { + "format": "byte", + "description": "A cursor that points to the position after the result entity.\nSet only when the `EntityResult` is part of a `QueryResultBatch` message.", + "type": "string" + }, + "version": { + "format": "int64", + "description": "The version of the entity, a strictly positive number that monotonically\nincreases with changes to the entity.\n\nThis field is set for `FULL` entity\nresults.\n\nFor missing entities in `LookupResponse`, this\nis the version of the snapshot that was used to look up the entity, and it\nis always set except for eventually consistent reads.", + "type": "string" } }, - "id": "EntityResult", - "description": "The result of fetching an entity from Datastore.", - "type": "object" + "id": "EntityResult" }, "CommitResponse": { "properties": { + "indexUpdates": { + "format": "int32", + "description": "The number of index entries updated during the commit, or zero if none were\nupdated.", + "type": "integer" + }, "mutationResults": { "description": "The result of performing the mutations.\nThe i-th mutation result corresponds to the i-th mutation in the request.", - "type": "array", "items": { "$ref": "MutationResult" - } - }, - "indexUpdates": { - "description": "The number of index entries updated during the commit, or zero if none were\nupdated.", - "format": "int32", - "type": "integer" + }, + "type": "array" } }, "id": "CommitResponse", @@ -878,7 +614,50 @@ "type": "object" }, "Value": { + "type": "object", "properties": { + "excludeFromIndexes": { + "description": "If the value should be excluded from all indexes including those defined\nexplicitly.", + "type": "boolean" + }, + "doubleValue": { + "format": "double", + "description": "A double value.", + "type": "number" + }, + "timestampValue": { + "format": "google-datetime", + "description": "A timestamp value.\nWhen stored in the Datastore, precise only to microseconds;\nany additional precision is rounded down.", + "type": "string" + }, + "nullValue": { + "type": "string", + "enumDescriptions": [ + "Null value." + ], + "enum": [ + "NULL_VALUE" + ], + "description": "A null value." + }, + "booleanValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "blobValue": { + "format": "byte", + "description": "A blob value.\nMay have at most 1,000,000 bytes.\nWhen `exclude_from_indexes` is false, may have at most 1500 bytes.\nIn JSON requests, must be base64-encoded.", + "type": "string" + }, + "meaning": { + "format": "int32", + "description": "The `meaning` field should only be populated for backwards compatibility.", + "type": "integer" + }, + "arrayValue": { + "description": "An array value.\nCannot contain another array value.\nA `Value` instance that sets field `array_value` must not set fields\n`meaning` or `exclude_from_indexes`.", + "$ref": "ArrayValue" + }, "entityValue": { "$ref": "Entity", "description": "An entity value.\n\n- May have no key.\n- May have a key with an incomplete key path.\n- May have a reserved/read-only key." @@ -888,8 +667,8 @@ "description": "A geo point value representing a point on the surface of Earth." }, "integerValue": { - "description": "An integer value.", "format": "int64", + "description": "An integer value.", "type": "string" }, "keyValue": { @@ -899,120 +678,83 @@ "stringValue": { "description": "A UTF-8 encoded string value.\nWhen `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.\nOtherwise, may be set to at least 1,000,000 bytes.", "type": "string" - }, - "excludeFromIndexes": { - "description": "If the value should be excluded from all indexes including those defined\nexplicitly.", - "type": "boolean" - }, - "doubleValue": { - "description": "A double value.", - "format": "double", - "type": "number" - }, - "timestampValue": { - "description": "A timestamp value.\nWhen stored in the Datastore, precise only to microseconds;\nany additional precision is rounded down.", - "format": "google-datetime", - "type": "string" - }, - "nullValue": { - "enumDescriptions": [ - "Null value." - ], - "enum": [ - "NULL_VALUE" - ], - "description": "A null value.", - "type": "string" - }, - "booleanValue": { - "description": "A boolean value.", - "type": "boolean" - }, - "blobValue": { - "description": "A blob value.\nMay have at most 1,000,000 bytes.\nWhen `exclude_from_indexes` is false, may have at most 1500 bytes.\nIn JSON requests, must be base64-encoded.", - "format": "byte", - "type": "string" - }, - "meaning": { - "description": "The `meaning` field should only be populated for backwards compatibility.", - "format": "int32", - "type": "integer" - }, - "arrayValue": { - "$ref": "ArrayValue", - "description": "An array value.\nCannot contain another array value.\nA `Value` instance that sets field `array_value` must not set fields\n`meaning` or `exclude_from_indexes`." } }, "id": "Value", - "description": "A message that can hold any of the supported value types and associated\nmetadata.", - "type": "object" + "description": "A message that can hold any of the supported value types and associated\nmetadata." }, "PartitionId": { + "description": "A partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.\n\nA partition ID contains several dimensions:\nproject ID and namespace ID.\n\nPartition dimensions:\n\n- May be `\"\"`.\n- Must be valid UTF-8 bytes.\n- Must have values that match regex `[A-Za-z\\d\\.\\-_]{1,100}`\nIf the value of any dimension matches regex `__.*__`, the partition is\nreserved/read-only.\nA reserved/read-only partition ID is forbidden in certain documented\ncontexts.\n\nForeign partition IDs (in which the project ID does\nnot match the context project ID ) are discouraged.\nReads and writes of foreign partition IDs may fail if the project is not in an active state.", + "type": "object", "properties": { + "projectId": { + "type": "string", + "description": "The ID of the project to which the entities belong." + }, "namespaceId": { "description": "If not empty, the ID of the namespace to which the entities belong.", "type": "string" - }, - "projectId": { - "description": "The ID of the project to which the entities belong.", + } + }, + "id": "PartitionId" + }, + "ReadWrite": { + "description": "Options specific to read / write transactions.", + "type": "object", + "properties": { + "previousTransaction": { + "format": "byte", + "description": "The transaction identifier of the transaction being retried.", "type": "string" } }, - "id": "PartitionId", - "description": "A partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.\n\nA partition ID contains several dimensions:\nproject ID and namespace ID.\n\nPartition dimensions:\n\n- May be `\"\"`.\n- Must be valid UTF-8 bytes.\n- Must have values that match regex `[A-Za-z\\d\\.\\-_]{1,100}`\nIf the value of any dimension matches regex `__.*__`, the partition is\nreserved/read-only.\nA reserved/read-only partition ID is forbidden in certain documented\ncontexts.\n\nForeign partition IDs (in which the project ID does\nnot match the context project ID ) are discouraged.\nReads and writes of foreign partition IDs may fail if the project is not in an active state.", - "type": "object" + "id": "ReadWrite" }, "Entity": { "properties": { + "key": { + "description": "The entity's key.\n\nAn entity must have a key, unless otherwise documented (for example,\nan entity in `Value.entity_value` may have no key).\nAn entity's kind is its key path's last element's kind,\nor null if it has no key.", + "$ref": "Key" + }, "properties": { + "type": "object", "additionalProperties": { "$ref": "Value" }, - "description": "The entity's properties.\nThe map's keys are property names.\nA property name matching regex `__.*__` is reserved.\nA reserved property name is forbidden in certain documented contexts.\nThe name must not contain more than 500 characters.\nThe name cannot be `\"\"`.", - "type": "object" - }, - "key": { - "$ref": "Key", - "description": "The entity's key.\n\nAn entity must have a key, unless otherwise documented (for example,\nan entity in `Value.entity_value` may have no key).\nAn entity's kind is its key path's last element's kind,\nor null if it has no key." + "description": "The entity's properties.\nThe map's keys are property names.\nA property name matching regex `__.*__` is reserved.\nA reserved property name is forbidden in certain documented contexts.\nThe name must not contain more than 500 characters.\nThe name cannot be `\"\"`." } }, "id": "Entity", "description": "A Datastore data object.\n\nAn entity is limited to 1 megabyte when stored. That _roughly_\ncorresponds to a limit of 1 megabyte for the serialized form of this\nmessage.", "type": "object" }, - "LookupRequest": { - "description": "The request for Datastore.Lookup.", - "type": "object", + "GoogleDatastoreAdminV1beta1Progress": { "properties": { - "keys": { - "description": "Keys of entities to look up.", - "type": "array", - "items": { - "$ref": "Key" - } + "workEstimated": { + "format": "int64", + "description": "An estimate of how much work needs to be performed. May be zero if the\nwork estimate is unavailable.", + "type": "string" }, - "readOptions": { - "$ref": "ReadOptions", - "description": "The options for this lookup request." + "workCompleted": { + "format": "int64", + "description": "The amount of work that has been completed. Note that this may be greater\nthan work_estimated.", + "type": "string" } }, - "id": "LookupRequest" + "id": "GoogleDatastoreAdminV1beta1Progress", + "description": "Measures the progress of a particular metric.", + "type": "object" }, "QueryResultBatch": { + "description": "A batch of results produced by a query.", + "type": "object", "properties": { "endCursor": { - "description": "A cursor that points to the position after the last result in the batch.", "format": "byte", + "description": "A cursor that points to the position after the last result in the batch.", "type": "string" }, "moreResults": { - "enumDescriptions": [ - "Unspecified. This value is never used.", - "There may be additional batches to fetch from this query.", - "The query is finished, but there may be more results after the limit.", - "The query is finished, but there may be more results after the end\ncursor.", - "The query has been exhausted." - ], "enum": [ "MORE_RESULTS_TYPE_UNSPECIFIED", "NOT_FINISHED", @@ -1021,24 +763,33 @@ "NO_MORE_RESULTS" ], "description": "The state of the query after the current batch.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Unspecified. This value is never used.", + "There may be additional batches to fetch from this query.", + "The query is finished, but there may be more results after the limit.", + "The query is finished, but there may be more results after the end\ncursor.", + "The query is finished, and there are no more results." + ] }, "snapshotVersion": { - "description": "The version number of the snapshot this batch was returned from.\nThis applies to the range of results from the query's `start_cursor` (or\nthe beginning of the query if no cursor was given) to this batch's\n`end_cursor` (not the query's `end_cursor`).\n\nIn a single transaction, subsequent query result batches for the same query\ncan have a greater snapshot version number. Each batch's snapshot version\nis valid for all preceding batches.\nThe value will be zero for eventually consistent queries.", + "type": "string", "format": "int64", - "type": "string" + "description": "The version number of the snapshot this batch was returned from.\nThis applies to the range of results from the query's `start_cursor` (or\nthe beginning of the query if no cursor was given) to this batch's\n`end_cursor` (not the query's `end_cursor`).\n\nIn a single transaction, subsequent query result batches for the same query\ncan have a greater snapshot version number. Each batch's snapshot version\nis valid for all preceding batches.\nThe value will be zero for eventually consistent queries." }, "skippedCursor": { - "description": "A cursor that points to the position after the last skipped result.\nWill be set when `skipped_results` != 0.", "format": "byte", + "description": "A cursor that points to the position after the last skipped result.\nWill be set when `skipped_results` != 0.", "type": "string" }, "skippedResults": { - "description": "The number of results skipped, typically because of an offset.", "format": "int32", + "description": "The number of results skipped, typically because of an offset.", "type": "integer" }, "entityResultType": { + "description": "The result type for every entity in `entity_results`.", + "type": "string", "enumDescriptions": [ "Unspecified. This value is never used.", "The key and properties.", @@ -1050,26 +801,478 @@ "FULL", "PROJECTION", "KEY_ONLY" - ], - "description": "The result type for every entity in `entity_results`.", - "type": "string" + ] }, "entityResults": { - "description": "The results for this batch.", - "type": "array", "items": { "$ref": "EntityResult" - } + }, + "type": "array", + "description": "The results for this batch." } }, - "id": "QueryResultBatch", - "description": "A batch of results produced by a query.", + "id": "QueryResultBatch" + }, + "LookupRequest": { + "description": "The request for Datastore.Lookup.", + "type": "object", + "properties": { + "keys": { + "description": "Keys of entities to look up.", + "items": { + "$ref": "Key" + }, + "type": "array" + }, + "readOptions": { + "description": "The options for this lookup request.", + "$ref": "ReadOptions" + } + }, + "id": "LookupRequest" + }, + "PathElement": { + "description": "A (kind, ID/name) pair used to construct a key path.\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the entity.\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`." + }, + "kind": { + "description": "The kind of the entity.\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", + "type": "string" + }, + "id": { + "format": "int64", + "description": "The auto-allocated ID of the entity.\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.", + "type": "string" + } + }, + "id": "PathElement" + }, + "GqlQueryParameter": { + "description": "A binding parameter for a GQL query.", + "type": "object", + "properties": { + "cursor": { + "type": "string", + "format": "byte", + "description": "A query cursor. Query cursors are returned in query\nresult batches." + }, + "value": { + "description": "A value parameter.", + "$ref": "Value" + } + }, + "id": "GqlQueryParameter" + }, + "BeginTransactionResponse": { + "description": "The response for Datastore.BeginTransaction.", + "type": "object", + "properties": { + "transaction": { + "format": "byte", + "description": "The transaction identifier (always present).", + "type": "string" + } + }, + "id": "BeginTransactionResponse" + }, + "AllocateIdsRequest": { + "properties": { + "keys": { + "description": "A list of keys with incomplete key paths for which to allocate IDs.\nNo key may be reserved/read-only.", + "items": { + "$ref": "Key" + }, + "type": "array" + } + }, + "id": "AllocateIdsRequest", + "description": "The request for Datastore.AllocateIds.", "type": "object" + }, + "LookupResponse": { + "description": "The response for Datastore.Lookup.", + "type": "object", + "properties": { + "deferred": { + "description": "A list of keys that were not looked up due to resource constraints. The\norder of results in this field is undefined and has no relation to the\norder of the keys in the input.", + "items": { + "$ref": "Key" + }, + "type": "array" + }, + "missing": { + "description": "Entities not found as `ResultType.KEY_ONLY` entities. The order of results\nin this field is undefined and has no relation to the order of the keys\nin the input.", + "items": { + "$ref": "EntityResult" + }, + "type": "array" + }, + "found": { + "items": { + "$ref": "EntityResult" + }, + "type": "array", + "description": "Entities found as `ResultType.FULL` entities. The order of results in this\nfield is undefined and has no relation to the order of the keys in the\ninput." + } + }, + "id": "LookupResponse" + }, + "RunQueryResponse": { + "description": "The response for Datastore.RunQuery.", + "type": "object", + "properties": { + "batch": { + "$ref": "QueryResultBatch", + "description": "A batch of query results (always present)." + }, + "query": { + "description": "The parsed form of the `GqlQuery` from the request, if it was set.", + "$ref": "Query" + } + }, + "id": "RunQueryResponse" + }, + "BeginTransactionRequest": { + "description": "The request for Datastore.BeginTransaction.", + "type": "object", + "properties": { + "transactionOptions": { + "$ref": "TransactionOptions", + "description": "Options for a new transaction." + } + }, + "id": "BeginTransactionRequest" + }, + "PropertyOrder": { + "type": "object", + "properties": { + "direction": { + "description": "The direction to order by. Defaults to `ASCENDING`.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Ascending.", + "Descending." + ], + "enum": [ + "DIRECTION_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ] + }, + "property": { + "description": "The property to order by.", + "$ref": "PropertyReference" + } + }, + "id": "PropertyOrder", + "description": "The desired order for a specific property." + }, + "CommitRequest": { + "description": "The request for Datastore.Commit.", + "type": "object", + "properties": { + "transaction": { + "format": "byte", + "description": "The identifier of the transaction associated with the commit. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", + "type": "string" + }, + "mode": { + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Transactional: The mutations are either all applied, or none are applied.\nLearn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions).", + "Non-transactional: The mutations may not apply as all or none." + ], + "enum": [ + "MODE_UNSPECIFIED", + "TRANSACTIONAL", + "NON_TRANSACTIONAL" + ], + "description": "The type of commit to perform. Defaults to `TRANSACTIONAL`.", + "type": "string" + }, + "mutations": { + "description": "The mutations to perform.\n\nWhen mode is `TRANSACTIONAL`, mutations affecting a single entity are\napplied in order. The following sequences of mutations affecting a single\nentity are not permitted in a single `Commit` request:\n\n- `insert` followed by `insert`\n- `update` followed by `insert`\n- `upsert` followed by `insert`\n- `delete` followed by `update`\n\nWhen mode is `NON_TRANSACTIONAL`, no two mutations may affect a single\nentity.", + "items": { + "$ref": "Mutation" + }, + "type": "array" + } + }, + "id": "CommitRequest" + }, + "KindExpression": { + "type": "object", + "properties": { + "name": { + "description": "The name of the kind.", + "type": "string" + } + }, + "id": "KindExpression", + "description": "A representation of a kind." + }, + "LatLng": { + "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "type": "object", + "properties": { + "latitude": { + "format": "double", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "type": "number" + }, + "longitude": { + "format": "double", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "type": "number" + } + }, + "id": "LatLng" + }, + "Key": { + "description": "A unique identifier for an entity.\nIf a key's partition ID or any of its path kinds or names are\nreserved/read-only, the key is reserved/read-only.\nA reserved/read-only key is forbidden in certain documented contexts.", + "type": "object", + "properties": { + "path": { + "description": "The entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a _root entity_, the second element identifies\na _child_ of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's _ancestors_.\n\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\n\nA path can never be empty, and a path can have at most 100 elements.", + "items": { + "$ref": "PathElement" + }, + "type": "array" + }, + "partitionId": { + "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.", + "$ref": "PartitionId" + } + }, + "id": "Key" + }, + "GoogleDatastoreAdminV1beta1EntityFilter": { + "description": "Identifies a subset of entities in a project. This is specified as\ncombinations of kinds and namespaces (either or both of which may be all, as\ndescribed in the following examples).\nExample usage:\n\nEntire project:\n kinds=[], namespace_ids=[]\n\nKinds Foo and Bar in all namespaces:\n kinds=['Foo', 'Bar'], namespace_ids=[]\n\nKinds Foo and Bar only in the default namespace:\n kinds=['Foo', 'Bar'], namespace_ids=['']\n\nKinds Foo and Bar in both the default and Baz namespaces:\n kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']\n\nThe entire Baz namespace:\n kinds=[], namespace_ids=['Baz']", + "type": "object", + "properties": { + "kinds": { + "description": "If empty, then this represents all kinds.", + "items": { + "type": "string" + }, + "type": "array" + }, + "namespaceIds": { + "items": { + "type": "string" + }, + "type": "array", + "description": "An empty list represents all namespaces. This is the preferred\nusage for projects that don't use namespaces.\n\nAn empty string element represents the default namespace. This should be\nused if the project has data in non-default namespaces, but doesn't want to\ninclude them.\nEach namespace in this list must be unique." + } + }, + "id": "GoogleDatastoreAdminV1beta1EntityFilter" + }, + "PropertyReference": { + "description": "A reference to a property relative to the kind expressions.", + "type": "object", + "properties": { + "name": { + "description": "The name of the property.\nIf name includes \".\"s, it may be interpreted as a property name path.", + "type": "string" + } + }, + "id": "PropertyReference" + }, + "GoogleDatastoreAdminV1beta1CommonMetadata": { + "type": "object", + "properties": { + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The client-assigned labels which were provided when the operation was\ncreated. May also include additional labels." + }, + "endTime": { + "format": "google-datetime", + "description": "The time the operation ended, either successfully or otherwise.", + "type": "string" + }, + "state": { + "enumDescriptions": [ + "Unspecified.", + "Request is being prepared for processing.", + "Request is actively being processed.", + "Request is in the process of being cancelled after user called\ngoogle.longrunning.Operations.CancelOperation on the operation.", + "Request has been processed and is in its finalization stage.", + "Request has completed successfully.", + "Request has finished being processed, but encountered an error.", + "Request has finished being cancelled after user called\ngoogle.longrunning.Operations.CancelOperation." + ], + "enum": [ + "STATE_UNSPECIFIED", + "INITIALIZING", + "PROCESSING", + "CANCELLING", + "FINALIZING", + "SUCCESSFUL", + "FAILED", + "CANCELLED" + ], + "description": "The current state of the Operation.", + "type": "string" + }, + "operationType": { + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "EXPORT_ENTITIES", + "IMPORT_ENTITIES" + ], + "description": "The type of the operation. Can be used as a filter in\nListOperationsRequest.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "ExportEntities.", + "ImportEntities." + ] + }, + "startTime": { + "format": "google-datetime", + "description": "The time that work began on the operation.", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "ArrayValue": { + "type": "object", + "properties": { + "values": { + "description": "Values in the array.\nThe order of this array may not be preserved if it contains a mix of\nindexed and unindexed values.", + "items": { + "$ref": "Value" + }, + "type": "array" + } + }, + "id": "ArrayValue", + "description": "An array value." + }, + "Projection": { + "description": "A representation of a property in a projection.", + "type": "object", + "properties": { + "property": { + "description": "The property to project.", + "$ref": "PropertyReference" + } + }, + "id": "Projection" + }, + "Mutation": { + "description": "A mutation to apply to an entity.", + "type": "object", + "properties": { + "update": { + "$ref": "Entity", + "description": "The entity to update. The entity must already exist.\nMust have a complete key path." + }, + "upsert": { + "$ref": "Entity", + "description": "The entity to upsert. The entity may or may not already exist.\nThe entity key's final path element may be incomplete." + }, + "delete": { + "description": "The key of the entity to delete. The entity may or may not already exist.\nMust have a complete key path and must not be reserved/read-only.", + "$ref": "Key" + }, + "baseVersion": { + "format": "int64", + "description": "The version of the entity that this mutation is being applied to. If this\ndoes not match the current version on the server, the mutation conflicts.", + "type": "string" + }, + "insert": { + "description": "The entity to insert. The entity must not already exist.\nThe entity key's final path element may be incomplete.", + "$ref": "Entity" + } + }, + "id": "Mutation" + }, + "ReadOptions": { + "description": "The options shared by read requests.", + "type": "object", + "properties": { + "transaction": { + "format": "byte", + "description": "The identifier of the transaction in which to read. A\ntransaction identifier is returned by a call to\nDatastore.BeginTransaction.", + "type": "string" + }, + "readConsistency": { + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Strong consistency.", + "Eventual consistency." + ], + "enum": [ + "READ_CONSISTENCY_UNSPECIFIED", + "STRONG", + "EVENTUAL" + ], + "description": "The non-transactional read consistency to use.\nCannot be set to `STRONG` for global queries.", + "type": "string" + } + }, + "id": "ReadOptions" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesResponse": { + "description": "The response for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.", + "type": "object", + "properties": { + "outputUrl": { + "description": "Location of the output metadata file. This can be used to begin an import\ninto Cloud Datastore (this project or another project). See\ngoogle.datastore.admin.v1beta1.ImportEntitiesRequest.input_url.\nOnly present if the operation completed successfully.", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesResponse" + }, + "RollbackResponse": { + "description": "The response for Datastore.Rollback.\n(an empty message).", + "type": "object", + "properties": {}, + "id": "RollbackResponse" } }, "protocol": "rest", "icons": { "x32": "http://www.google.com/images/icons/product/search-32.gif", "x16": "http://www.google.com/images/icons/product/search-16.gif" - } + }, + "version": "v1beta3", + "baseUrl": "https://datastore.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/datastore": { + "description": "View and manage your Google Cloud Datastore data" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "servicePath": "", + "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", + "kind": "discovery#restDescription", + "rootUrl": "https://datastore.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "datastore", + "batchPath": "batch", + "id": "datastore:v1beta3", + "documentationLink": "https://cloud.google.com/datastore/", + "revision": "20170918", + "title": "Google Cloud Datastore API", + "ownerName": "Google", + "discoveryVersion": "v1" } diff --git a/etc/api/deploymentmanager/alpha/deploymentmanager-api.json b/etc/api/deploymentmanager/alpha/deploymentmanager-api.json new file mode 100644 index 0000000000..ce7c0fd5c6 --- /dev/null +++ b/etc/api/deploymentmanager/alpha/deploymentmanager-api.json @@ -0,0 +1,3094 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/_YIg1ZU-z6xEn8qUWJtIDhiIaWM\"", + "discoveryVersion": "v1", + "id": "deploymentmanager:alpha", + "name": "deploymentmanager", + "canonicalName": "Deployment Manager Alpha", + "version": "alpha", + "revision": "20170925", + "title": "Google Cloud Deployment Manager Alpha API", + "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": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://cloud.google.com/deployment-manager/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/deploymentmanager/alpha/projects/", + "basePath": "/deploymentmanager/alpha/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "deploymentmanager/alpha/projects/", + "batchPath": "batch/deploymentmanager/alpha", + "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-platform.read-only": { + "description": "View 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": { + "AuditConfig": { + "id": "AuditConfig", + "type": "object", + "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n{ \"audit_configs\": [ { \"service\": \"allServices\" \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:foo@gmail.com\" ] }, { \"log_type\": \"DATA_WRITE\", }, { \"log_type\": \"ADMIN_READ\", } ] }, { \"service\": \"fooservice.googleapis.com\" \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:bar@gmail.com\" ] } ] } ] }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging.", + "properties": { + "auditLogConfigs": { + "type": "array", + "description": "The configuration for logging of each type of permission.", + "items": { + "$ref": "AuditLogConfig" + } + }, + "exemptedMembers": { + "type": "array", + "description": "", + "items": { + "type": "string" + } + }, + "service": { + "type": "string", + "description": "Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services." + } + } + }, + "AuditLogConfig": { + "id": "AuditLogConfig", + "type": "object", + "description": "Provides the configuration for logging a type of permissions. Example:\n\n{ \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:foo@gmail.com\" ] }, { \"log_type\": \"DATA_WRITE\", } ] }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging.", + "properties": { + "exemptedMembers": { + "type": "array", + "description": "Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].", + "items": { + "type": "string" + } + }, + "logType": { + "type": "string", + "description": "The log type that this config enables." + } + } + }, + "AuthorizationLoggingOptions": { + "id": "AuthorizationLoggingOptions", + "type": "object", + "description": "Authorization-related information used by Cloud Audit Logging.", + "properties": { + "permissionType": { + "type": "string", + "description": "The type of the permission that was checked." + } + } + }, + "BasicAuth": { + "id": "BasicAuth", + "type": "object", + "description": "Basic Auth used as a credential.", + "properties": { + "password": { + "type": "string" + }, + "user": { + "type": "string" + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. This field is GOOGLE_INTERNAL." + }, + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + }, + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`." + } + } + }, + "CollectionOverride": { + "id": "CollectionOverride", + "type": "object", + "description": "CollectionOverride allows resource handling overrides for specific resources within a BaseType", + "properties": { + "collection": { + "type": "string", + "description": "The collection that identifies this resource within its service." + }, + "options": { + "$ref": "Options", + "description": "The options to apply to this resource-level override" + } + } + }, + "CompositeType": { + "id": "CompositeType", + "type": "object", + "description": "Holds the composite type.", + "properties": { + "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" + }, + "insertTime": { + "type": "string", + "description": "Output only. Timestamp when the composite type was created, in RFC3339 text format." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "CompositeTypeLabelEntry" + } + }, + "name": { + "type": "string", + "description": "Name of the composite type." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this composite type." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the type provider." + }, + "status": { + "type": "string" + }, + "templateContents": { + "$ref": "TemplateContents", + "description": "Files for the template type." + } + } + }, + "CompositeTypeLabelEntry": { + "id": "CompositeTypeLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "CompositeTypesListResponse": { + "id": "CompositeTypesListResponse", + "type": "object", + "description": "A response that returns all Composite Types supported by Deployment Manager", + "properties": { + "compositeTypes": { + "type": "array", + "description": "Output only. A list of resource composite types supported by Deployment Manager.", + "items": { + "$ref": "CompositeType" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + } + } + }, + "Condition": { + "id": "Condition", + "type": "object", + "description": "A condition to be met.", + "properties": { + "iam": { + "type": "string", + "description": "Trusted attributes supplied by the IAM system." + }, + "op": { + "type": "string", + "description": "An operator to apply the subject with." + }, + "svc": { + "type": "string", + "description": "Trusted attributes discharged by the service." + }, + "sys": { + "type": "string", + "description": "Trusted attributes supplied by any service that owns resources and uses the IAM system for access control." + }, + "value": { + "type": "string", + "description": "DEPRECATED. Use 'values' instead." + }, + "values": { + "type": "array", + "description": "The objects of the condition. This is mutually exclusive with 'value'.", + "items": { + "type": "string" + } + } + } + }, + "ConfigFile": { + "id": "ConfigFile", + "type": "object", + "description": "", + "properties": { + "content": { + "type": "string", + "description": "The contents of the file." + } + } + }, + "ConfigurableService": { + "id": "ConfigurableService", + "type": "object", + "description": "BaseType that describes a service-backed Type.", + "properties": { + "collectionOverrides": { + "type": "array", + "description": "Allows resource handling overrides for specific collections", + "items": { + "$ref": "CollectionOverride" + } + }, + "credential": { + "$ref": "Credential", + "description": "Credential used when interacting with this type." + }, + "descriptorUrl": { + "type": "string", + "description": "Descriptor Url for the this type." + }, + "options": { + "$ref": "Options", + "description": "Options to apply when handling any resources in this service." + } + } + }, + "Credential": { + "id": "Credential", + "type": "object", + "description": "The credential used by Deployment Manager and TypeProvider. Only one of the options is permitted.", + "properties": { + "basicAuth": { + "$ref": "BasicAuth", + "description": "Basic Auth Credential, only used by TypeProvider." + }, + "serviceAccount": { + "$ref": "ServiceAccount", + "description": "Service Account Credential, only used by Deployment." + }, + "useProjectDefault": { + "type": "boolean", + "description": "Specify to use the project default credential, only supported by Deployment." + } + } + }, + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "", + "properties": { + "credential": { + "$ref": "Credential", + "description": "User provided default credential for the deployment." + }, + "description": { + "type": "string", + "description": "An optional user-provided description of the deployment." + }, + "fingerprint": { + "type": "string", + "description": "Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens 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 ." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "DeploymentLabelEntry" + } + }, + "manifest": { + "type": "string", + "description": "Output only. URL of the manifest representing the last manifest that was successfully deployed." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this deployment." + }, + "outputs": { + "type": "array", + "description": "Output only. Map of outputs from the last manifest that deployed successfully.", + "items": { + "$ref": "DeploymentOutputsEntry" + } + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the deployment." + }, + "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." + } + } + }, + "DeploymentLabelEntry": { + "id": "DeploymentLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "DeploymentOutputsEntry": { + "id": "DeploymentOutputsEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "DeploymentUpdate": { + "id": "DeploymentUpdate", + "type": "object", + "description": "", + "properties": { + "credential": { + "$ref": "Credential", + "description": "Output only. The user-provided default credential to use when deploying this preview." + }, + "description": { + "type": "string", + "description": "Output only. An optional user-provided description of the deployment after the current update has been applied." + }, + "labels": { + "type": "array", + "description": "Output only. Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "DeploymentUpdateLabelEntry" + } + }, + "manifest": { + "type": "string", + "description": "Output only. URL of the manifest representing the update configuration of this deployment." + } + } + }, + "DeploymentUpdateLabelEntry": { + "id": "DeploymentUpdateLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "DeploymentsCancelPreviewRequest": { + "id": "DeploymentsCancelPreviewRequest", + "type": "object", + "description": "", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to cancel a preview, this would prevent one of the requests).\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment.", + "format": "byte" + } + } + }, + "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." + } + } + }, + "DeploymentsStopRequest": { + "id": "DeploymentsStopRequest", + "type": "object", + "description": "", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to stop an ongoing update request, this would prevent a collision).\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment.", + "format": "byte" + } + } + }, + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example:\n\ntitle: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax.\n\nThe application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." + } + } + }, + "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." + } + } + }, + "InputMapping": { + "id": "InputMapping", + "type": "object", + "description": "InputMapping creates a 'virtual' property that will be injected into the properties before sending the request to the underlying API.", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the field that is going to be injected." + }, + "location": { + "type": "string", + "description": "The location where this mapping applies." + }, + "methodMatch": { + "type": "string", + "description": "Regex to evaluate on method to decide if input applies." + }, + "value": { + "type": "string", + "description": "A jsonPath expression to select an element." + } + } + }, + "LogConfig": { + "id": "LogConfig", + "type": "object", + "description": "Specifies what kind of log the caller must write", + "properties": { + "cloudAudit": { + "$ref": "LogConfigCloudAuditOptions", + "description": "Cloud audit options." + }, + "counter": { + "$ref": "LogConfigCounterOptions", + "description": "Counter options." + }, + "dataAccess": { + "$ref": "LogConfigDataAccessOptions", + "description": "Data access options." + } + } + }, + "LogConfigCloudAuditOptions": { + "id": "LogConfigCloudAuditOptions", + "type": "object", + "description": "Write a Cloud Audit log", + "properties": { + "authorizationLoggingOptions": { + "$ref": "AuthorizationLoggingOptions", + "description": "Information used by the Cloud Audit Logging pipeline." + }, + "logName": { + "type": "string", + "description": "The log_name to populate in the Cloud Audit Record." + } + } + }, + "LogConfigCounterOptions": { + "id": "LogConfigCounterOptions", + "type": "object", + "description": "Increment a streamz counter with the specified metric and field names.\n\nMetric 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.\n\nField names correspond to IAM request parameters and field values are their respective values.\n\nAt present the only supported field names are - \"iam_principal\", corresponding to IAMContext.principal; - \"\" (empty string), resulting in one aggretated counter with no field.\n\nExamples: counter { metric: \"/debug_access_count\" field: \"iam_principal\" } ==\u003e increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}\n\nAt 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": { + "field": { + "type": "string", + "description": "The field value to attribute." + }, + "metric": { + "type": "string", + "description": "The metric to update." + } + } + }, + "LogConfigDataAccessOptions": { + "id": "LogConfigDataAccessOptions", + "type": "object", + "description": "Write a Data Access (Gin) log", + "properties": { + "logMode": { + "type": "string", + "description": "Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now." + } + } + }, + "Manifest": { + "id": "Manifest", + "type": "object", + "description": "", + "properties": { + "config": { + "$ref": "ConfigFile", + "description": "Output only. The YAML configuration for this manifest." + }, + "expandedConfig": { + "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.\n\nThe 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] Reserved for future use." + }, + "creationTimestamp": { + "type": "string", + "description": "[Deprecated] This field is deprecated." + }, + "description": { + "type": "string", + "description": "[Output Only] A textual description of the operation, which is set when the operation is created." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This value 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 that 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 status code that was returned. For example, a 404 means the resource was not found.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This value 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] The type of operation, such as insert, update, or delete, and so on." + }, + "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 when the operation will be complete. This number should monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] The URL of the region where the operation resides. Only available when performing regional operations." + }, + "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 value is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the operation, which 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] The unique target ID, which identifies a specific incarnation of the target resource.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from." + }, + "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] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations." + } + } + }, + "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" + } + } + } + }, + "Options": { + "id": "Options", + "type": "object", + "description": "Options allows customized resource handling by Deployment Manager.", + "properties": { + "inputMappings": { + "type": "array", + "description": "The mappings that apply for requests.", + "items": { + "$ref": "InputMapping" + } + }, + "nameProperty": { + "type": "string", + "description": "The json path to the field in the resource JSON body into which the resource name should be mapped. Leaving this empty indicates that there should be no mapping performed." + }, + "validationOptions": { + "$ref": "ValidationOptions", + "description": "Options for how to validate and process properties on a resource." + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.\n\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.\n\n**Example**\n\n{ \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\", ] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] }\n\nFor a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "auditConfigs": { + "type": "array", + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + } + }, + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.", + "format": "byte" + }, + "iamOwned": { + "type": "boolean", + "description": "" + }, + "rules": { + "type": "array", + "description": "If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.", + "items": { + "$ref": "Rule" + } + }, + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "", + "properties": { + "accessControl": { + "$ref": "ResourceAccessControl", + "description": "The Access Control Policy set on this resource." + }, + "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 ." + }, + "lastUsedCredential": { + "$ref": "Credential", + "description": "Output only. The last used credential that successfully created/updated the resource." + }, + "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 cloudfunctions.v1beta1.function." + }, + "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." + }, + "warnings": { + "type": "array", + "description": "Output only. If warning messages are generated during processing of this resource, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + } + }, + "ResourceAccessControl": { + "id": "ResourceAccessControl", + "type": "object", + "description": "The access controls set on the resource.", + "properties": { + "gcpIamPolicy": { + "type": "string", + "description": "The GCP IAM Policy to set on the resource." + } + } + }, + "ResourceUpdate": { + "id": "ResourceUpdate", + "type": "object", + "description": "", + "properties": { + "accessControl": { + "$ref": "ResourceAccessControl", + "description": "The Access Control Policy to set on this resource after updating the resource itself." + }, + "credential": { + "$ref": "Credential", + "description": "Output only. The credential that will be used creating/updating this resource." + }, + "error": { + "type": "object", + "description": "Output only. If errors are generated during update of the resource, 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 that caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "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." + }, + "warnings": { + "type": "array", + "description": "Output only. If warning messages are generated during processing of this resource, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + } + }, + "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" + } + } + } + }, + "Rule": { + "id": "Rule", + "type": "object", + "description": "A rule to be applied in a Policy.", + "properties": { + "action": { + "type": "string", + "description": "Required" + }, + "conditions": { + "type": "array", + "description": "Additional restrictions that must be met. All conditions must pass for the rule to match.", + "items": { + "$ref": "Condition" + } + }, + "description": { + "type": "string", + "description": "Human-readable description of the rule." + }, + "ins": { + "type": "array", + "description": "If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.", + "items": { + "type": "string" + } + }, + "logConfigs": { + "type": "array", + "description": "The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.", + "items": { + "$ref": "LogConfig" + } + }, + "notIns": { + "type": "array", + "description": "If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.", + "items": { + "type": "string" + } + }, + "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": { + "type": "string" + } + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "Service Account used as a credential.", + "properties": { + "email": { + "type": "string", + "description": "The IAM service account email address like test@myproject.iam.gserviceaccount.com" + } + } + }, + "TargetConfiguration": { + "id": "TargetConfiguration", + "type": "object", + "description": "", + "properties": { + "config": { + "$ref": "ConfigFile", + "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" + } + } + } + }, + "TemplateContents": { + "id": "TemplateContents", + "type": "object", + "description": "Files that make up the template contents of a template type.", + "properties": { + "imports": { + "type": "array", + "description": "Import files referenced by the main template.", + "items": { + "$ref": "ImportFile" + } + }, + "interpreter": { + "type": "string", + "description": "Which interpreter (python or jinja) should be used during expansion." + }, + "schema": { + "type": "string", + "description": "The contents of the template schema." + }, + "template": { + "type": "string", + "description": "The contents of the main template file." + } + } + }, + "TestPermissionsRequest": { + "id": "TestPermissionsRequest", + "type": "object", + "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" + } + } + } + }, + "TestPermissionsResponse": { + "id": "TestPermissionsResponse", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "Type": { + "id": "Type", + "type": "object", + "description": "A resource type supported by Deployment Manager.", + "properties": { + "configurableService": { + "$ref": "ConfigurableService", + "description": "Base Type (configurable service) that backs this Type." + }, + "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" + }, + "insertTime": { + "type": "string", + "description": "Output only. Timestamp when the type was created, in RFC3339 text format." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "TypeLabelEntry" + } + }, + "name": { + "type": "string", + "description": "Name of the type." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this type." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the type." + } + } + }, + "TypeInfo": { + "id": "TypeInfo", + "type": "object", + "description": "Contains detailed information about a composite type, base type, or base type with specific collection.", + "properties": { + "description": { + "type": "string", + "description": "The description of the type." + }, + "documentationLink": { + "type": "string", + "description": "For swagger 2.0 externalDocs field will be used. For swagger 1.2 this field will be empty." + }, + "kind": { + "type": "string", + "description": "Output only. Type of the output. Always deploymentManager#TypeInfo for TypeInfo.", + "default": "deploymentmanager#typeInfo" + }, + "name": { + "type": "string", + "description": "The base type or composite type name." + }, + "schema": { + "$ref": "TypeInfoSchemaInfo", + "description": "For base types with a collection, we return a schema and documentation link For template types, we return only a schema" + }, + "selfLink": { + "type": "string", + "description": "Output only. Server-defined URL for the resource." + }, + "title": { + "type": "string", + "description": "The title on the API descriptor URL provided." + } + } + }, + "TypeInfoSchemaInfo": { + "id": "TypeInfoSchemaInfo", + "type": "object", + "description": "", + "properties": { + "input": { + "type": "string", + "description": "The properties that this composite type or base type collection accept as input, represented as a json blob, format is: JSON Schema Draft V4" + }, + "output": { + "type": "string", + "description": "The properties that this composite type or base type collection exposes as output, these properties can be used for references, represented as json blob, format is: JSON Schema Draft V4" + } + } + }, + "TypeLabelEntry": { + "id": "TypeLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "TypeProvider": { + "id": "TypeProvider", + "type": "object", + "description": "A type provider that describes a service-backed Type.", + "properties": { + "collectionOverrides": { + "type": "array", + "description": "Allows resource handling overrides for specific collections", + "items": { + "$ref": "CollectionOverride" + } + }, + "credential": { + "$ref": "Credential", + "description": "Credential used when interacting with this type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "descriptorUrl": { + "type": "string", + "description": "Descriptor Url for the this type provider." + }, + "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 type provider was created, in RFC3339 text format." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "TypeProviderLabelEntry" + } + }, + "name": { + "type": "string", + "description": "Name of the type provider." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this type provider." + }, + "options": { + "$ref": "Options", + "description": "Options to apply when handling any resources in this service." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the type provider." + } + } + }, + "TypeProviderLabelEntry": { + "id": "TypeProviderLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "TypeProvidersListResponse": { + "id": "TypeProvidersListResponse", + "type": "object", + "description": "A response that returns all Type Providers supported by Deployment Manager", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "typeProviders": { + "type": "array", + "description": "Output only. A list of resource type providers supported by Deployment Manager.", + "items": { + "$ref": "TypeProvider" + } + } + } + }, + "TypeProvidersListTypesResponse": { + "id": "TypeProvidersListTypesResponse", + "type": "object", + "description": "", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "types": { + "type": "array", + "description": "Output only. A list of resource type info.", + "items": { + "$ref": "TypeInfo" + } + } + } + }, + "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" + } + } + } + }, + "ValidationOptions": { + "id": "ValidationOptions", + "type": "object", + "description": "Options for how to validate and process properties on a resource.", + "properties": { + "schemaValidation": { + "type": "string", + "description": "Customize how deployment manager will validate the resource against schema errors." + }, + "undeclaredProperties": { + "type": "string", + "description": "Specify what to do with extra properties when executing a request." + } + } + } + }, + "resources": { + "compositeTypes": { + "methods": { + "delete": { + "id": "deploymentmanager.compositeTypes.delete", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "DELETE", + "description": "Deletes a composite type.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the type 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", + "compositeType" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.compositeTypes.get", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "GET", + "description": "Gets information about a specific composite type.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the composite type 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", + "compositeType" + ], + "response": { + "$ref": "CompositeType" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.compositeTypes.insert", + "path": "{project}/global/compositeTypes", + "httpMethod": "POST", + "description": "Creates a composite type.", + "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": "CompositeType" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.compositeTypes.list", + "path": "{project}/global/compositeTypes", + "httpMethod": "GET", + "description": "Lists all composite types for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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": "CompositeTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.compositeTypes.patch", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "PATCH", + "description": "Updates a composite type. This method supports patch semantics.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the composite type 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", + "compositeType" + ], + "request": { + "$ref": "CompositeType" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.compositeTypes.update", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "PUT", + "description": "Updates a composite type.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the composite type 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", + "compositeType" + ], + "request": { + "$ref": "CompositeType" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "deployments": { + "methods": { + "cancelPreview": { + "id": "deploymentmanager.deployments.cancelPreview", + "path": "{project}/global/deployments/{deployment}/cancelPreview", + "httpMethod": "POST", + "description": "Cancels and removes the preview currently associated with 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" + ], + "request": { + "$ref": "DeploymentsCancelPreviewRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "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": { + "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" + } + }, + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "getIamPolicy": { + "id": "deploymentmanager.deployments.getIamPolicy", + "path": "{project}/global/deployments/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "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": { + "preview": { + "type": "boolean", + "description": "If set to true, creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to 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.", + "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" + ], + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "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" + }, + "preview": { + "type": "boolean", + "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove 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.", + "default": "false", + "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" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "setIamPolicy": { + "id": "deploymentmanager.deployments.setIamPolicy", + "path": "{project}/global/deployments/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "stop": { + "id": "deploymentmanager.deployments.stop", + "path": "{project}/global/deployments/{deployment}/stop", + "httpMethod": "POST", + "description": "Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.", + "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" + ], + "request": { + "$ref": "DeploymentsStopRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "testIamPermissions": { + "id": "deploymentmanager.deployments.testIamPermissions", + "path": "{project}/global/deployments/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "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" + }, + "preview": { + "type": "boolean", + "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove 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.", + "default": "false", + "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" + ], + "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/cloud-platform.read-only", + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "typeProviders": { + "methods": { + "delete": { + "id": "deploymentmanager.typeProviders.delete", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "DELETE", + "description": "Deletes a type provider.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.typeProviders.get", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "GET", + "description": "Gets information about a specific type provider.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "response": { + "$ref": "TypeProvider" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "getType": { + "id": "deploymentmanager.typeProviders.getType", + "path": "{project}/global/typeProviders/{typeProvider}/types/{type}", + "httpMethod": "GET", + "description": "Gets a type info for a type provided by a TypeProvider.", + "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" + }, + "type": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "location": "path" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider", + "type" + ], + "response": { + "$ref": "TypeInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.typeProviders.insert", + "path": "{project}/global/typeProviders", + "httpMethod": "POST", + "description": "Creates a type provider.", + "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": "TypeProvider" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.typeProviders.list", + "path": "{project}/global/typeProviders", + "httpMethod": "GET", + "description": "Lists all resource type providers for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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": "TypeProvidersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "listTypes": { + "id": "deploymentmanager.typeProviders.listTypes", + "path": "{project}/global/typeProviders/{typeProvider}/types", + "httpMethod": "GET", + "description": "Lists all the type info for a TypeProvider.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "response": { + "$ref": "TypeProvidersListTypesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.typeProviders.patch", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "PATCH", + "description": "Updates a type provider. This method supports patch semantics.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "request": { + "$ref": "TypeProvider" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.typeProviders.update", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "PUT", + "description": "Updates a type provider.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "request": { + "$ref": "TypeProvider" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "types": { + "methods": { + "delete": { + "id": "deploymentmanager.types.delete", + "path": "{project}/global/types/{type}", + "httpMethod": "DELETE", + "description": "Deletes a type and all of the resources in the type.", + "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" + }, + "type": { + "type": "string", + "description": "The name of the type for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "type" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.types.get", + "path": "{project}/global/types/{type}", + "httpMethod": "GET", + "description": "Gets information about a specific type.", + "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" + }, + "type": { + "type": "string", + "description": "The name of the type for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "type" + ], + "response": { + "$ref": "Type" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.types.insert", + "path": "{project}/global/types", + "httpMethod": "POST", + "description": "Creates a type.", + "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": "Type" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.types.list", + "path": "{project}/global/types", + "httpMethod": "GET", + "description": "Lists all resource types for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.types.patch", + "path": "{project}/global/types/{type}", + "httpMethod": "PATCH", + "description": "Updates a type. This method supports patch semantics.", + "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" + }, + "type": { + "type": "string", + "description": "The name of the type for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "type" + ], + "request": { + "$ref": "Type" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.types.update", + "path": "{project}/global/types/{type}", + "httpMethod": "PUT", + "description": "Updates a type.", + "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" + }, + "type": { + "type": "string", + "description": "The name of the type for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "type" + ], + "request": { + "$ref": "Type" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + } + } +} diff --git a/etc/api/deploymentmanager/v2/crates/1.0.6-api+20170925 b/etc/api/deploymentmanager/v2/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/deploymentmanager/v2/crates/1.0.6-cli+20170925 b/etc/api/deploymentmanager/v2/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/deploymentmanager/v2/deploymentmanager-api.json b/etc/api/deploymentmanager/v2/deploymentmanager-api.json index afd01a7680..33589e2174 100644 --- a/etc/api/deploymentmanager/v2/deploymentmanager-api.json +++ b/etc/api/deploymentmanager/v2/deploymentmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/llynIIguUtQGZnafw0-LKyjVFvE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/4coXG-kLdOLe0xqn_lc-mbxcObg\"", "discoveryVersion": "v1", "id": "deploymentmanager:v2", "name": "deploymentmanager", "canonicalName": "Deployment Manager", "version": "v2", - "revision": "20170501", + "revision": "20170925", "title": "Google Cloud Deployment Manager API", "description": "Declares, configures, and deploys complex solutions on Google Cloud Platform.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/deploymentmanager/v2/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "deploymentmanager/v2/projects/", - "batchPath": "batch", + "batchPath": "batch/deploymentmanager/v2", "parameters": { "alt": { "type": "string", @@ -129,14 +129,29 @@ } } }, + "AuthorizationLoggingOptions": { + "id": "AuthorizationLoggingOptions", + "type": "object", + "description": "Authorization-related information used by Cloud Audit Logging.", + "properties": { + "permissionType": { + "type": "string", + "description": "The type of the permission that was checked." + } + } + }, "Binding": { "id": "Binding", "type": "object", "description": "Associates `members` with a `role`.", "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. This field is GOOGLE_INTERNAL." + }, "members": { "type": "array", - "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", "items": { "type": "string" } @@ -208,12 +223,12 @@ }, "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "description": "Output only. Unique identifier for the resource; defined by the server.", "format": "uint64" }, "insertTime": { "type": "string", - "description": "[Output Only] Timestamp when the deployment was created, in RFC3339 text format ." + "description": "Output only. Timestamp when the deployment was created, in RFC3339 text format ." }, "labels": { "type": "array", @@ -224,7 +239,7 @@ }, "manifest": { "type": "string", - "description": "[Output Only] URL of the manifest representing the last manifest that was successfully deployed." + "description": "Output only. URL of the manifest representing the last manifest that was successfully deployed." }, "name": { "type": "string", @@ -232,11 +247,11 @@ }, "operation": { "$ref": "Operation", - "description": "[Output Only] The Operation that most recently ran, or is currently running, on this deployment." + "description": "Output only. The Operation that most recently ran, or is currently running, on this deployment." }, "selfLink": { "type": "string", - "description": "[Output Only] Self link for the deployment." + "description": "Output only. Self link for the deployment." }, "target": { "$ref": "TargetConfiguration", @@ -244,7 +259,7 @@ }, "update": { "$ref": "DeploymentUpdate", - "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here." + "description": "Output only. If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here." } } }, @@ -267,18 +282,18 @@ "properties": { "description": { "type": "string", - "description": "[Output Only] An optional user-provided description of the deployment after the current update has been applied." + "description": "Output only. An optional user-provided description of the deployment after the current update has been applied." }, "labels": { "type": "array", - "description": "[Output Only] Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "description": "Output only. Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", "items": { "$ref": "DeploymentUpdateLabelEntry" } }, "manifest": { "type": "string", - "description": "[Output Only] URL of the manifest representing the update configuration of this deployment." + "description": "Output only. URL of the manifest representing the update configuration of this deployment." } } }, @@ -313,14 +328,14 @@ "properties": { "deployments": { "type": "array", - "description": "[Output Only] The deployments contained in this response.", + "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." + "description": "Output only. A token used to continue a truncated list request." } } }, @@ -336,6 +351,29 @@ } } }, + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example:\n\ntitle: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax.\n\nThe application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." + } + } + }, "ImportFile": { "id": "ImportFile", "type": "object", @@ -356,16 +394,39 @@ "type": "object", "description": "Specifies what kind of log the caller must write", "properties": { + "cloudAudit": { + "$ref": "LogConfigCloudAuditOptions", + "description": "Cloud audit options." + }, "counter": { "$ref": "LogConfigCounterOptions", "description": "Counter options." + }, + "dataAccess": { + "$ref": "LogConfigDataAccessOptions", + "description": "Data access options." + } + } + }, + "LogConfigCloudAuditOptions": { + "id": "LogConfigCloudAuditOptions", + "type": "object", + "description": "Write a Cloud Audit log", + "properties": { + "authorizationLoggingOptions": { + "$ref": "AuthorizationLoggingOptions", + "description": "Information used by the Cloud Audit Logging pipeline." + }, + "logName": { + "type": "string", + "description": "The log_name to populate in the Cloud Audit Record." } } }, "LogConfigCounterOptions": { "id": "LogConfigCounterOptions", "type": "object", - "description": "Options for counters", + "description": "Increment a streamz counter with the specified metric and field names.\n\nMetric 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.\n\nField names correspond to IAM request parameters and field values are their respective values.\n\nAt present the only supported field names are - \"iam_principal\", corresponding to IAMContext.principal; - \"\" (empty string), resulting in one aggretated counter with no field.\n\nExamples: counter { metric: \"/debug_access_count\" field: \"iam_principal\" } ==\u003e increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}\n\nAt 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": { "field": { "type": "string", @@ -377,6 +438,17 @@ } } }, + "LogConfigDataAccessOptions": { + "id": "LogConfigDataAccessOptions", + "type": "object", + "description": "Write a Data Access (Gin) log", + "properties": { + "logMode": { + "type": "string", + "description": "Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now." + } + } + }, "Manifest": { "id": "Manifest", "type": "object", @@ -384,39 +456,39 @@ "properties": { "config": { "$ref": "ConfigFile", - "description": "[Output Only] The YAML configuration for this manifest." + "description": "Output only. The YAML configuration for this manifest." }, "expandedConfig": { "type": "string", - "description": "[Output Only] The fully-expanded configuration file, including any templates and references." + "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.", + "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.", + "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." + "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." + "description": "Output only. The YAML layout for this manifest." }, "name": { "type": "string", - "description": "[Output Only] The name of the manifest." + "description": "Output only.\n\nThe name of the manifest." }, "selfLink": { "type": "string", - "description": "[Output Only] Self link for the manifest." + "description": "Output only. Self link for the manifest." } } }, @@ -427,14 +499,14 @@ "properties": { "manifests": { "type": "array", - "description": "[Output Only] Manifests contained in this list response.", + "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." + "description": "Output only. A token used to continue a truncated list request." } } }, @@ -602,11 +674,11 @@ "properties": { "nextPageToken": { "type": "string", - "description": "[Output Only] A token used to continue a truncated list request." + "description": "Output only. A token used to continue a truncated list request." }, "operations": { "type": "array", - "description": "[Output Only] Operations contained in this list response.", + "description": "Output only. Operations contained in this list response.", "items": { "$ref": "Operation" } @@ -627,7 +699,7 @@ }, "bindings": { "type": "array", - "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "description": "Associates a list of `members` to a `role`. `bindings` with no members will result in an error.", "items": { "$ref": "Binding" } @@ -666,48 +738,48 @@ }, "finalProperties": { "type": "string", - "description": "[Output Only] The evaluated properties of the resource with references expanded. Returned as serialized YAML." + "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.", + "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 ." + "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." + "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." + "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." + "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 cloudfunctions.v1beta1.function." + "description": "Output only. The type of the resource, for example compute.v1.instance, or cloudfunctions.v1beta1.function." }, "update": { "$ref": "ResourceUpdate", - "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here." + "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 ." + "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." + "description": "Output only. The URL of the actual resource." }, "warnings": { "type": "array", - "description": "[Output Only] If warning messages are generated during processing of this resource, this field will be populated.", + "description": "Output only. If warning messages are generated during processing of this resource, this field will be populated.", "items": { "type": "object", "properties": { @@ -763,7 +835,7 @@ }, "error": { "type": "object", - "description": "[Output Only] If errors are generated during update of the resource, this field will be populated.", + "description": "Output only. If errors are generated during update of the resource, this field will be populated.", "properties": { "errors": { "type": "array", @@ -790,27 +862,27 @@ }, "finalProperties": { "type": "string", - "description": "[Output Only] The expanded properties of the resource with reference values expanded. Returned as serialized YAML." + "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." + "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." + "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." + "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." + "description": "Output only. The state of the resource." }, "warnings": { "type": "array", - "description": "[Output Only] If warning messages are generated during processing of this resource, this field will be populated.", + "description": "Output only. If warning messages are generated during processing of this resource, this field will be populated.", "items": { "type": "object", "properties": { @@ -873,7 +945,7 @@ }, "conditions": { "type": "array", - "description": "Additional restrictions that must be met", + "description": "Additional restrictions that must be met. All conditions must pass for the rule to match.", "items": { "$ref": "Condition" } @@ -963,12 +1035,12 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "description": "Output only. Unique identifier for the resource; defined by the server.", "format": "uint64" }, "insertTime": { "type": "string", - "description": "[Output Only] Timestamp when the type was created, in RFC3339 text format." + "description": "Output only. Timestamp when the type was created, in RFC3339 text format." }, "name": { "type": "string", @@ -976,11 +1048,11 @@ }, "operation": { "$ref": "Operation", - "description": "[Output Only] The Operation that most recently ran, or is currently running, on this type." + "description": "Output only. The Operation that most recently ran, or is currently running, on this type." }, "selfLink": { "type": "string", - "description": "[Output Only] Self link for the type." + "description": "Output only. Self link for the type." } } }, @@ -995,7 +1067,7 @@ }, "types": { "type": "array", - "description": "[Output Only] A list of resource types supported by Deployment Manager.", + "description": "Output only. A list of resource types supported by Deployment Manager.", "items": { "$ref": "Type" } @@ -1141,7 +1213,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -1198,7 +1270,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -1327,7 +1399,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", "location": "path" } }, @@ -1399,7 +1471,7 @@ "type": "string", "description": "Name of the resource for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", "location": "path" } }, @@ -1550,7 +1622,7 @@ }, "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -1639,7 +1711,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -1742,7 +1814,7 @@ }, "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { @@ -1797,7 +1869,7 @@ "parameters": { "filter": { "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", "location": "query" }, "maxResults": { diff --git a/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json b/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json new file mode 100644 index 0000000000..c19a5a38c6 --- /dev/null +++ b/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json @@ -0,0 +1,2891 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/fjbnlFC4GTEIX5zCJ4_9R1qQWCw\"", + "discoveryVersion": "v1", + "id": "deploymentmanager:v2beta", + "name": "deploymentmanager", + "canonicalName": "Deployment Manager V2Beta", + "version": "v2beta", + "revision": "20170925", + "title": "Google Cloud Deployment Manager API V2Beta Methods", + "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": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://developers.google.com/deployment-manager/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/deploymentmanager/v2beta/projects/", + "basePath": "/deploymentmanager/v2beta/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "deploymentmanager/v2beta/projects/", + "batchPath": "batch/deploymentmanager/v2beta", + "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-platform.read-only": { + "description": "View 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": { + "AuditConfig": { + "id": "AuditConfig", + "type": "object", + "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n{ \"audit_configs\": [ { \"service\": \"allServices\" \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:foo@gmail.com\" ] }, { \"log_type\": \"DATA_WRITE\", }, { \"log_type\": \"ADMIN_READ\", } ] }, { \"service\": \"fooservice.googleapis.com\" \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:bar@gmail.com\" ] } ] } ] }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging.", + "properties": { + "auditLogConfigs": { + "type": "array", + "description": "The configuration for logging of each type of permission.", + "items": { + "$ref": "AuditLogConfig" + } + }, + "exemptedMembers": { + "type": "array", + "description": "", + "items": { + "type": "string" + } + }, + "service": { + "type": "string", + "description": "Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services." + } + } + }, + "AuditLogConfig": { + "id": "AuditLogConfig", + "type": "object", + "description": "Provides the configuration for logging a type of permissions. Example:\n\n{ \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:foo@gmail.com\" ] }, { \"log_type\": \"DATA_WRITE\", } ] }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging.", + "properties": { + "exemptedMembers": { + "type": "array", + "description": "Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].", + "items": { + "type": "string" + } + }, + "logType": { + "type": "string", + "description": "The log type that this config enables." + } + } + }, + "AuthorizationLoggingOptions": { + "id": "AuthorizationLoggingOptions", + "type": "object", + "description": "Authorization-related information used by Cloud Audit Logging.", + "properties": { + "permissionType": { + "type": "string", + "description": "The type of the permission that was checked." + } + } + }, + "BaseType": { + "id": "BaseType", + "type": "object", + "description": "BaseType that describes a service-backed Type.", + "properties": { + "collectionOverrides": { + "type": "array", + "description": "Allows resource handling overrides for specific collections", + "items": { + "$ref": "CollectionOverride" + } + }, + "credential": { + "$ref": "Credential", + "description": "Credential used when interacting with this type." + }, + "descriptorUrl": { + "type": "string", + "description": "Descriptor Url for the this type." + }, + "options": { + "$ref": "Options", + "description": "Options to apply when handling any resources in this service." + } + } + }, + "BasicAuth": { + "id": "BasicAuth", + "type": "object", + "description": "Basic Auth used as a credential.", + "properties": { + "password": { + "type": "string" + }, + "user": { + "type": "string" + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. This field is GOOGLE_INTERNAL." + }, + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + }, + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`." + } + } + }, + "CollectionOverride": { + "id": "CollectionOverride", + "type": "object", + "description": "CollectionOverride allows resource handling overrides for specific resources within a BaseType", + "properties": { + "collection": { + "type": "string", + "description": "The collection that identifies this resource within its service." + }, + "options": { + "$ref": "Options", + "description": "The options to apply to this resource-level override" + } + } + }, + "CompositeType": { + "id": "CompositeType", + "type": "object", + "description": "Holds the composite type.", + "properties": { + "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" + }, + "insertTime": { + "type": "string", + "description": "Output only. Timestamp when the composite type was created, in RFC3339 text format." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "CompositeTypeLabelEntry" + } + }, + "name": { + "type": "string", + "description": "Name of the composite type." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this composite type." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the type provider." + }, + "status": { + "type": "string" + }, + "templateContents": { + "$ref": "TemplateContents", + "description": "Files for the template type." + } + } + }, + "CompositeTypeLabelEntry": { + "id": "CompositeTypeLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "CompositeTypesListResponse": { + "id": "CompositeTypesListResponse", + "type": "object", + "description": "A response that returns all Composite Types supported by Deployment Manager", + "properties": { + "compositeTypes": { + "type": "array", + "description": "Output only. A list of resource composite types supported by Deployment Manager.", + "items": { + "$ref": "CompositeType" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + } + } + }, + "Condition": { + "id": "Condition", + "type": "object", + "description": "A condition to be met.", + "properties": { + "iam": { + "type": "string", + "description": "Trusted attributes supplied by the IAM system." + }, + "op": { + "type": "string", + "description": "An operator to apply the subject with." + }, + "svc": { + "type": "string", + "description": "Trusted attributes discharged by the service." + }, + "sys": { + "type": "string", + "description": "Trusted attributes supplied by any service that owns resources and uses the IAM system for access control." + }, + "value": { + "type": "string", + "description": "DEPRECATED. Use 'values' instead." + }, + "values": { + "type": "array", + "description": "The objects of the condition. This is mutually exclusive with 'value'.", + "items": { + "type": "string" + } + } + } + }, + "ConfigFile": { + "id": "ConfigFile", + "type": "object", + "description": "", + "properties": { + "content": { + "type": "string", + "description": "The contents of the file." + } + } + }, + "Credential": { + "id": "Credential", + "type": "object", + "description": "The credential used by Deployment Manager and TypeProvider. Only one of the options is permitted.", + "properties": { + "basicAuth": { + "$ref": "BasicAuth", + "description": "Basic Auth Credential, only used by TypeProvider." + }, + "serviceAccount": { + "$ref": "ServiceAccount", + "description": "Service Account Credential, only used by Deployment." + }, + "useProjectDefault": { + "type": "boolean", + "description": "Specify to use the project default credential, only supported by Deployment." + } + } + }, + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "", + "properties": { + "description": { + "type": "string", + "description": "An optional user-provided description of the deployment." + }, + "fingerprint": { + "type": "string", + "description": "Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens 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 ." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "DeploymentLabelEntry" + } + }, + "manifest": { + "type": "string", + "description": "Output only. URL of the manifest representing the last manifest that was successfully deployed." + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this deployment." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the deployment." + }, + "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." + } + } + }, + "DeploymentLabelEntry": { + "id": "DeploymentLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "DeploymentUpdate": { + "id": "DeploymentUpdate", + "type": "object", + "description": "", + "properties": { + "description": { + "type": "string", + "description": "Output only. An optional user-provided description of the deployment after the current update has been applied." + }, + "labels": { + "type": "array", + "description": "Output only. Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "DeploymentUpdateLabelEntry" + } + }, + "manifest": { + "type": "string", + "description": "Output only. URL of the manifest representing the update configuration of this deployment." + } + } + }, + "DeploymentUpdateLabelEntry": { + "id": "DeploymentUpdateLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "DeploymentsCancelPreviewRequest": { + "id": "DeploymentsCancelPreviewRequest", + "type": "object", + "description": "", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to cancel a preview, this would prevent one of the requests).\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment.", + "format": "byte" + } + } + }, + "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." + } + } + }, + "DeploymentsStopRequest": { + "id": "DeploymentsStopRequest", + "type": "object", + "description": "", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to stop an ongoing update request, this would prevent a collision).\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment.", + "format": "byte" + } + } + }, + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example:\n\ntitle: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax.\n\nThe application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." + } + } + }, + "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." + } + } + }, + "InputMapping": { + "id": "InputMapping", + "type": "object", + "description": "InputMapping creates a 'virtual' property that will be injected into the properties before sending the request to the underlying API.", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the field that is going to be injected." + }, + "location": { + "type": "string", + "description": "The location where this mapping applies." + }, + "methodMatch": { + "type": "string", + "description": "Regex to evaluate on method to decide if input applies." + }, + "value": { + "type": "string", + "description": "A jsonPath expression to select an element." + } + } + }, + "LogConfig": { + "id": "LogConfig", + "type": "object", + "description": "Specifies what kind of log the caller must write", + "properties": { + "cloudAudit": { + "$ref": "LogConfigCloudAuditOptions", + "description": "Cloud audit options." + }, + "counter": { + "$ref": "LogConfigCounterOptions", + "description": "Counter options." + }, + "dataAccess": { + "$ref": "LogConfigDataAccessOptions", + "description": "Data access options." + } + } + }, + "LogConfigCloudAuditOptions": { + "id": "LogConfigCloudAuditOptions", + "type": "object", + "description": "Write a Cloud Audit log", + "properties": { + "authorizationLoggingOptions": { + "$ref": "AuthorizationLoggingOptions", + "description": "Information used by the Cloud Audit Logging pipeline." + }, + "logName": { + "type": "string", + "description": "The log_name to populate in the Cloud Audit Record." + } + } + }, + "LogConfigCounterOptions": { + "id": "LogConfigCounterOptions", + "type": "object", + "description": "Increment a streamz counter with the specified metric and field names.\n\nMetric 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.\n\nField names correspond to IAM request parameters and field values are their respective values.\n\nAt present the only supported field names are - \"iam_principal\", corresponding to IAMContext.principal; - \"\" (empty string), resulting in one aggretated counter with no field.\n\nExamples: counter { metric: \"/debug_access_count\" field: \"iam_principal\" } ==\u003e increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}\n\nAt 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": { + "field": { + "type": "string", + "description": "The field value to attribute." + }, + "metric": { + "type": "string", + "description": "The metric to update." + } + } + }, + "LogConfigDataAccessOptions": { + "id": "LogConfigDataAccessOptions", + "type": "object", + "description": "Write a Data Access (Gin) log", + "properties": { + "logMode": { + "type": "string", + "description": "Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now." + } + } + }, + "Manifest": { + "id": "Manifest", + "type": "object", + "description": "", + "properties": { + "config": { + "$ref": "ConfigFile", + "description": "Output only. The YAML configuration for this manifest." + }, + "expandedConfig": { + "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.\n\nThe 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] Reserved for future use." + }, + "creationTimestamp": { + "type": "string", + "description": "[Deprecated] This field is deprecated." + }, + "description": { + "type": "string", + "description": "[Output Only] A textual description of the operation, which is set when the operation is created." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This value 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 that 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 status code that was returned. For example, a 404 means the resource was not found.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This value 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] The type of operation, such as insert, update, or delete, and so on." + }, + "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 when the operation will be complete. This number should monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] The URL of the region where the operation resides. Only available when performing regional operations." + }, + "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 value is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the operation, which 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] The unique target ID, which identifies a specific incarnation of the target resource.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from." + }, + "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] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations." + } + } + }, + "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" + } + } + } + }, + "Options": { + "id": "Options", + "type": "object", + "description": "Options allows customized resource handling by Deployment Manager.", + "properties": { + "inputMappings": { + "type": "array", + "description": "The mappings that apply for requests.", + "items": { + "$ref": "InputMapping" + } + }, + "validationOptions": { + "$ref": "ValidationOptions", + "description": "Options for how to validate and process properties on a resource." + }, + "virtualProperties": { + "type": "string", + "description": "Additional properties block described as a jsonSchema, these properties will never be part of the json payload, but they can be consumed by InputMappings, this must be a valid json schema draft-04. The properties specified here will be decouple in a different section. This schema will be merged to the schema validation, and properties here will be extracted From the payload and consumed explicitly by InputMappings. ex: field1: type: string field2: type: number" + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.\n\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.\n\n**Example**\n\n{ \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\", ] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] }\n\nFor a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "auditConfigs": { + "type": "array", + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + } + }, + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.", + "format": "byte" + }, + "iamOwned": { + "type": "boolean", + "description": "" + }, + "rules": { + "type": "array", + "description": "If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.", + "items": { + "$ref": "Rule" + } + }, + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "", + "properties": { + "accessControl": { + "$ref": "ResourceAccessControl", + "description": "The Access Control Policy set on this resource." + }, + "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 cloudfunctions.v1beta1.function." + }, + "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." + }, + "warnings": { + "type": "array", + "description": "Output only. If warning messages are generated during processing of this resource, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + } + }, + "ResourceAccessControl": { + "id": "ResourceAccessControl", + "type": "object", + "description": "The access controls set on the resource.", + "properties": { + "gcpIamPolicy": { + "type": "string", + "description": "The GCP IAM Policy to set on the resource." + } + } + }, + "ResourceUpdate": { + "id": "ResourceUpdate", + "type": "object", + "description": "", + "properties": { + "accessControl": { + "$ref": "ResourceAccessControl", + "description": "The Access Control Policy to set on this resource after updating the resource itself." + }, + "error": { + "type": "object", + "description": "Output only. If errors are generated during update of the resource, 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 that caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "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." + }, + "warnings": { + "type": "array", + "description": "Output only. If warning messages are generated during processing of this resource, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] A human-readable description of the warning code." + } + } + } + } + } + }, + "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" + } + } + } + }, + "Rule": { + "id": "Rule", + "type": "object", + "description": "A rule to be applied in a Policy.", + "properties": { + "action": { + "type": "string", + "description": "Required" + }, + "conditions": { + "type": "array", + "description": "Additional restrictions that must be met. All conditions must pass for the rule to match.", + "items": { + "$ref": "Condition" + } + }, + "description": { + "type": "string", + "description": "Human-readable description of the rule." + }, + "ins": { + "type": "array", + "description": "If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.", + "items": { + "type": "string" + } + }, + "logConfigs": { + "type": "array", + "description": "The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.", + "items": { + "$ref": "LogConfig" + } + }, + "notIns": { + "type": "array", + "description": "If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.", + "items": { + "type": "string" + } + }, + "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": { + "type": "string" + } + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "Service Account used as a credential.", + "properties": { + "email": { + "type": "string", + "description": "The IAM service account email address like test@myproject.iam.gserviceaccount.com" + } + } + }, + "TargetConfiguration": { + "id": "TargetConfiguration", + "type": "object", + "description": "", + "properties": { + "config": { + "$ref": "ConfigFile", + "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" + } + } + } + }, + "TemplateContents": { + "id": "TemplateContents", + "type": "object", + "description": "Files that make up the template contents of a template type.", + "properties": { + "imports": { + "type": "array", + "description": "Import files referenced by the main template.", + "items": { + "$ref": "ImportFile" + } + }, + "interpreter": { + "type": "string", + "description": "Which interpreter (python or jinja) should be used during expansion." + }, + "schema": { + "type": "string", + "description": "The contents of the template schema." + }, + "template": { + "type": "string", + "description": "The contents of the main template file." + } + } + }, + "TestPermissionsRequest": { + "id": "TestPermissionsRequest", + "type": "object", + "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" + } + } + } + }, + "TestPermissionsResponse": { + "id": "TestPermissionsResponse", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "Type": { + "id": "Type", + "type": "object", + "description": "A resource type supported by Deployment Manager.", + "properties": { + "base": { + "$ref": "BaseType", + "description": "Base Type (configurable service) that backs this Type." + }, + "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" + }, + "insertTime": { + "type": "string", + "description": "Output only. Timestamp when the type was created, in RFC3339 text format." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "TypeLabelEntry" + } + }, + "name": { + "type": "string", + "description": "Name of the type." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this type." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the type." + } + } + }, + "TypeInfo": { + "id": "TypeInfo", + "type": "object", + "description": "Contains detailed information about a composite type, base type, or base type with specific collection.", + "properties": { + "description": { + "type": "string", + "description": "The description of the type." + }, + "documentationLink": { + "type": "string", + "description": "For swagger 2.0 externalDocs field will be used. For swagger 1.2 this field will be empty." + }, + "kind": { + "type": "string", + "description": "Output only. Type of the output. Always deploymentManager#TypeInfo for TypeInfo.", + "default": "deploymentmanager#typeInfo" + }, + "name": { + "type": "string", + "description": "The base type or composite type name." + }, + "schema": { + "$ref": "TypeInfoSchemaInfo", + "description": "For base types with a collection, we return a schema and documentation link For template types, we return only a schema" + }, + "selfLink": { + "type": "string", + "description": "Output only. Server-defined URL for the resource." + }, + "title": { + "type": "string", + "description": "The title on the API descriptor URL provided." + } + } + }, + "TypeInfoSchemaInfo": { + "id": "TypeInfoSchemaInfo", + "type": "object", + "description": "", + "properties": { + "input": { + "type": "string", + "description": "The properties that this composite type or base type collection accept as input, represented as a json blob, format is: JSON Schema Draft V4" + }, + "output": { + "type": "string", + "description": "The properties that this composite type or base type collection exposes as output, these properties can be used for references, represented as json blob, format is: JSON Schema Draft V4" + } + } + }, + "TypeLabelEntry": { + "id": "TypeLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "TypeProvider": { + "id": "TypeProvider", + "type": "object", + "description": "A type provider that describes a service-backed Type.", + "properties": { + "collectionOverrides": { + "type": "array", + "description": "Allows resource handling overrides for specific collections", + "items": { + "$ref": "CollectionOverride" + } + }, + "credential": { + "$ref": "Credential", + "description": "Credential used when interacting with this type." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "descriptorUrl": { + "type": "string", + "description": "Descriptor Url for the this type provider." + }, + "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 type provider was created, in RFC3339 text format." + }, + "labels": { + "type": "array", + "description": "Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)?", + "items": { + "$ref": "TypeProviderLabelEntry" + } + }, + "name": { + "type": "string", + "description": "Name of the type provider." + }, + "operation": { + "$ref": "Operation", + "description": "Output only. The Operation that most recently ran, or is currently running, on this type provider." + }, + "options": { + "$ref": "Options", + "description": "Options to apply when handling any resources in this service." + }, + "selfLink": { + "type": "string", + "description": "Output only. Self link for the type provider." + } + } + }, + "TypeProviderLabelEntry": { + "id": "TypeProviderLabelEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "TypeProvidersListResponse": { + "id": "TypeProvidersListResponse", + "type": "object", + "description": "A response that returns all Type Providers supported by Deployment Manager", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "typeProviders": { + "type": "array", + "description": "Output only. A list of resource type providers supported by Deployment Manager.", + "items": { + "$ref": "TypeProvider" + } + } + } + }, + "TypeProvidersListTypesResponse": { + "id": "TypeProvidersListTypesResponse", + "type": "object", + "description": "", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "types": { + "type": "array", + "description": "Output only. A list of resource type info.", + "items": { + "$ref": "TypeInfo" + } + } + } + }, + "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" + } + } + } + }, + "ValidationOptions": { + "id": "ValidationOptions", + "type": "object", + "description": "Options for how to validate and process properties on a resource.", + "properties": { + "schemaValidation": { + "type": "string", + "description": "Customize how deployment manager will validate the resource against schema errors." + }, + "undeclaredProperties": { + "type": "string", + "description": "Specify what to do with extra properties when executing a request." + } + } + } + }, + "resources": { + "compositeTypes": { + "methods": { + "delete": { + "id": "deploymentmanager.compositeTypes.delete", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "DELETE", + "description": "Deletes a composite type.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the type 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", + "compositeType" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.compositeTypes.get", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "GET", + "description": "Gets information about a specific composite type.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the composite type 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", + "compositeType" + ], + "response": { + "$ref": "CompositeType" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.compositeTypes.insert", + "path": "{project}/global/compositeTypes", + "httpMethod": "POST", + "description": "Creates a composite type.", + "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": "CompositeType" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.compositeTypes.list", + "path": "{project}/global/compositeTypes", + "httpMethod": "GET", + "description": "Lists all composite types for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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": "CompositeTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.compositeTypes.patch", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "PATCH", + "description": "Updates a composite type. This method supports patch semantics.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the composite type 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", + "compositeType" + ], + "request": { + "$ref": "CompositeType" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.compositeTypes.update", + "path": "{project}/global/compositeTypes/{compositeType}", + "httpMethod": "PUT", + "description": "Updates a composite type.", + "parameters": { + "compositeType": { + "type": "string", + "description": "The name of the composite type 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", + "compositeType" + ], + "request": { + "$ref": "CompositeType" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "deployments": { + "methods": { + "cancelPreview": { + "id": "deploymentmanager.deployments.cancelPreview", + "path": "{project}/global/deployments/{deployment}/cancelPreview", + "httpMethod": "POST", + "description": "Cancels and removes the preview currently associated with 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" + ], + "request": { + "$ref": "DeploymentsCancelPreviewRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "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": { + "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" + } + }, + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "getIamPolicy": { + "id": "deploymentmanager.deployments.getIamPolicy", + "path": "{project}/global/deployments/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "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": { + "preview": { + "type": "boolean", + "description": "If set to true, creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to 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.", + "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" + ], + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "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" + }, + "preview": { + "type": "boolean", + "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove 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.", + "default": "false", + "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" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "setIamPolicy": { + "id": "deploymentmanager.deployments.setIamPolicy", + "path": "{project}/global/deployments/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "stop": { + "id": "deploymentmanager.deployments.stop", + "path": "{project}/global/deployments/{deployment}/stop", + "httpMethod": "POST", + "description": "Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.", + "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" + ], + "request": { + "$ref": "DeploymentsStopRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "testIamPermissions": { + "id": "deploymentmanager.deployments.testIamPermissions", + "path": "{project}/global/deployments/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified 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-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "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" + }, + "preview": { + "type": "boolean", + "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove 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.", + "default": "false", + "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" + ], + "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/cloud-platform.read-only", + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "typeProviders": { + "methods": { + "delete": { + "id": "deploymentmanager.typeProviders.delete", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "DELETE", + "description": "Deletes a type provider.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.typeProviders.get", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "GET", + "description": "Gets information about a specific type provider.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "response": { + "$ref": "TypeProvider" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "getType": { + "id": "deploymentmanager.typeProviders.getType", + "path": "{project}/global/typeProviders/{typeProvider}/types/{type}", + "httpMethod": "GET", + "description": "Gets a type info for a type provided by a TypeProvider.", + "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" + }, + "type": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "location": "path" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider", + "type" + ], + "response": { + "$ref": "TypeInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.typeProviders.insert", + "path": "{project}/global/typeProviders", + "httpMethod": "POST", + "description": "Creates a type provider.", + "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": "TypeProvider" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.typeProviders.list", + "path": "{project}/global/typeProviders", + "httpMethod": "GET", + "description": "Lists all resource type providers for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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": "TypeProvidersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "listTypes": { + "id": "deploymentmanager.typeProviders.listTypes", + "path": "{project}/global/typeProviders/{typeProvider}/types", + "httpMethod": "GET", + "description": "Lists all the type info for a TypeProvider.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "response": { + "$ref": "TypeProvidersListTypesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.typeProviders.patch", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "PATCH", + "description": "Updates a type provider. This method supports patch semantics.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "request": { + "$ref": "TypeProvider" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.typeProviders.update", + "path": "{project}/global/typeProviders/{typeProvider}", + "httpMethod": "PUT", + "description": "Updates a type provider.", + "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" + }, + "typeProvider": { + "type": "string", + "description": "The name of the type provider for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "typeProvider" + ], + "request": { + "$ref": "TypeProvider" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "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": "Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance.\n\nYou can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)", + "default": "500", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + } + } +} diff --git a/etc/api/dfareporting/v2.7/crates/1.0.6-api+20170818 b/etc/api/dfareporting/v2.7/crates/1.0.6-api+20170818 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dfareporting/v2.7/crates/1.0.6-cli+20170818 b/etc/api/dfareporting/v2.7/crates/1.0.6-cli+20170818 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dfareporting/v2.7/dfareporting-api.json b/etc/api/dfareporting/v2.7/dfareporting-api.json index 84887ca43f..0cbf504e97 100644 --- a/etc/api/dfareporting/v2.7/dfareporting-api.json +++ b/etc/api/dfareporting/v2.7/dfareporting-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/p-RysYnjE2Jp5kxjC09O1FcghzI\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/3Wqk_k4XWB3JARQsnkZ477HngjY\"", "discoveryVersion": "v1", "id": "dfareporting:v2.7", "name": "dfareporting", "version": "v2.7", - "revision": "20170428", + "revision": "20170818", "title": "DCM/DFA Reporting And Trafficking API", "description": "Manages your DoubleClick Campaign Manager ad campaigns and reports.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/dfareporting/v2.7/", "rootUrl": "https://www.googleapis.com/", "servicePath": "dfareporting/v2.7/", - "batchPath": "batch", + "batchPath": "batch/dfareporting/v2.7", "parameters": { "alt": { "type": "string", @@ -2229,7 +2229,7 @@ }, "htmlCode": { "type": "string", - "description": "HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is false. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA." + "description": "HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is true. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA." }, "htmlCodeLocked": { "type": "boolean", @@ -4569,7 +4569,7 @@ }, "videoActiveViewOptOut": { "type": "boolean", - "description": "Whether this directory site has disabled active view for in-stream video creatives." + "description": "Whether this directory site has disabled active view for in-stream video creatives. This is a read-only field." } } }, @@ -5200,7 +5200,7 @@ }, "userDefinedVariableTypes": { "type": "array", - "description": "List of the user-defined variables used by this conversion tag. These map to the \"u[1-20]=\" in the tags. Each of these can have a user defined type.\nAcceptable values are:\n- \"U1\"\n- \"U2\"\n- \"U3\"\n- \"U4\"\n- \"U5\"\n- \"U6\"\n- \"U7\"\n- \"U8\"\n- \"U9\"\n- \"U10\"\n- \"U11\"\n- \"U12\"\n- \"U13\"\n- \"U14\"\n- \"U15\"\n- \"U16\"\n- \"U17\"\n- \"U18\"\n- \"U19\"\n- \"U20\"", + "description": "List of the user-defined variables used by this conversion tag. These map to the \"u[1-100]=\" in the tags. Each of these can have a user defined type.\nAcceptable values are U1 to U100, inclusive.", "items": { "type": "string", "enum": [ @@ -7125,7 +7125,7 @@ }, "vpaidAdapterChoice": { "type": "string", - "description": "VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this placement.", + "description": "VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this placement.\n\nNote: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH.", "enum": [ "BOTH", "DEFAULT", @@ -9017,7 +9017,7 @@ }, "vpaidAdapterChoiceTemplate": { "type": "string", - "description": "Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter, and Flash VPAID creatives use the Flash adapter).", + "description": "Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter).\n\nNote: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH.", "enum": [ "BOTH", "DEFAULT", @@ -16824,7 +16824,7 @@ }, "tagFormats": { "type": "string", - "description": "Tag formats to generate for these placements.", + "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.", "enum": [ "PLACEMENT_TAG_CLICK_COMMANDS", "PLACEMENT_TAG_IFRAME_ILAYER", diff --git a/etc/api/dfareporting/v2.8/crates/1.0.6-api+20170818 b/etc/api/dfareporting/v2.8/crates/1.0.6-api+20170818 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dfareporting/v2.8/crates/1.0.6-cli+20170818 b/etc/api/dfareporting/v2.8/crates/1.0.6-cli+20170818 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dfareporting/v2.8/dfareporting-api.json b/etc/api/dfareporting/v2.8/dfareporting-api.json new file mode 100644 index 0000000000..e52586cf07 --- /dev/null +++ b/etc/api/dfareporting/v2.8/dfareporting-api.json @@ -0,0 +1,19730 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/emGV_y_FRSYhyMgSPP7gVElVBpw\"", + "discoveryVersion": "v1", + "id": "dfareporting:v2.8", + "name": "dfareporting", + "version": "v2.8", + "revision": "20170818", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manages your DoubleClick Campaign Manager ad campaigns and reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v2.8/", + "basePath": "/dfareporting/v2.8/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v2.8/", + "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/ddmconversions": { + "description": "Manage DoubleClick Digital Marketing conversions" + }, + "https://www.googleapis.com/auth/dfareporting": { + "description": "View and manage DoubleClick for Advertisers reports" + }, + "https://www.googleapis.com/auth/dfatrafficking": { + "description": "View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Contains properties of a DCM account.", + "properties": { + "accountPermissionIds": { + "type": "array", + "description": "Account permissions assigned to this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "accountProfile": { + "type": "string", + "description": "Profile for this account. This is a read-only field that can be left blank.", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "active": { + "type": "boolean", + "description": "Whether this account is active." + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for this account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_1M", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_500K", + "ACTIVE_ADS_TIER_750K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "activeViewOptOut": { + "type": "boolean", + "description": "Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions." + }, + "availablePermissionIds": { + "type": "array", + "description": "User role permissions available to the user roles of this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "countryId": { + "type": "string", + "description": "ID of the country associated with this account.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "ID of currency associated with this account. This is a required field.\nAcceptable values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ \n- \"37\" for PLN \n- \"39\" for INR \n- \"40\" for THB \n- \"41\" for IDR \n- \"42\" for CZK \n- \"43\" for RON \n- \"44\" for HUF \n- \"45\" for RUB \n- \"46\" for AED \n- \"47\" for BGN \n- \"48\" for HRK \n- \"49\" for MXN", + "format": "int64" + }, + "defaultCreativeSizeId": { + "type": "string", + "description": "Default placement dimensions for this account.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this account." + }, + "id": { + "type": "string", + "description": "ID of this account. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#account\".", + "default": "dfareporting#account" + }, + "locale": { + "type": "string", + "description": "Locale of this account.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil) \n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "maximumImageSize": { + "type": "string", + "description": "Maximum image size allowed for this account, in kilobytes. Value must be greater than or equal to 1.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this account. This is a required field, and must be less than 128 characters long and be globally unique." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default." + }, + "reportsConfiguration": { + "$ref": "ReportsConfiguration", + "description": "Reporting configuration of this account." + }, + "shareReportsWithTwitter": { + "type": "boolean", + "description": "Share Path to Conversion reports with Twitter." + }, + "teaserSizeLimit": { + "type": "string", + "description": "File size limit in kilobytes of Rich Media teaser creatives. Acceptable values are 1 to 10240, inclusive.", + "format": "int64" + } + } + }, + "AccountActiveAdSummary": { + "id": "AccountActiveAdSummary", + "type": "object", + "description": "Gets a summary of active ads in an account.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account.", + "format": "int64" + }, + "activeAds": { + "type": "string", + "description": "Ads that have been activated for the account", + "format": "int64" + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for the account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_1M", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_500K", + "ACTIVE_ADS_TIER_750K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "availableAds": { + "type": "string", + "description": "Ads that can be activated for the account.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountActiveAdSummary\".", + "default": "dfareporting#accountActiveAdSummary" + } + } + }, + "AccountPermission": { + "id": "AccountPermission", + "type": "object", + "description": "AccountPermissions contains information about a particular account permission. Some features of DCM require an account permission to be present in the account.", + "properties": { + "accountProfiles": { + "type": "array", + "description": "Account profiles associated with this account permission.\n\nPossible values are:\n- \"ACCOUNT_PROFILE_BASIC\"\n- \"ACCOUNT_PROFILE_STANDARD\"", + "items": { + "type": "string", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + } + }, + "id": { + "type": "string", + "description": "ID of this account permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermission\".", + "default": "dfareporting#accountPermission" + }, + "level": { + "type": "string", + "description": "Administrative level required to enable this account permission.", + "enum": [ + "ADMINISTRATOR", + "USER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of this account permission." + }, + "permissionGroupId": { + "type": "string", + "description": "Permission group of this account permission.", + "format": "int64" + } + } + }, + "AccountPermissionGroup": { + "id": "AccountPermissionGroup", + "type": "object", + "description": "AccountPermissionGroups contains a mapping of permission group IDs to names. A permission group is a grouping of account permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this account permission group.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroup\".", + "default": "dfareporting#accountPermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this account permission group." + } + } + }, + "AccountPermissionGroupsListResponse": { + "id": "AccountPermissionGroupsListResponse", + "type": "object", + "description": "Account Permission Group List Response", + "properties": { + "accountPermissionGroups": { + "type": "array", + "description": "Account permission group collection.", + "items": { + "$ref": "AccountPermissionGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroupsListResponse\".", + "default": "dfareporting#accountPermissionGroupsListResponse" + } + } + }, + "AccountPermissionsListResponse": { + "id": "AccountPermissionsListResponse", + "type": "object", + "description": "Account Permission List Response", + "properties": { + "accountPermissions": { + "type": "array", + "description": "Account permission collection.", + "items": { + "$ref": "AccountPermission" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionsListResponse\".", + "default": "dfareporting#accountPermissionsListResponse" + } + } + }, + "AccountUserProfile": { + "id": "AccountUserProfile", + "type": "object", + "description": "AccountUserProfiles contains properties of a DCM user profile. This resource is specifically for managing user profiles, whereas UserProfiles is for accessing the API.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable." + }, + "advertiserFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which advertisers are visible to the user profile." + }, + "campaignFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which campaigns are visible to the user profile." + }, + "comments": { + "type": "string", + "description": "Comments for this user profile." + }, + "email": { + "type": "string", + "description": "Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion." + }, + "id": { + "type": "string", + "description": "ID of the user profile. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfile\".", + "default": "dfareporting#accountUserProfile" + }, + "locale": { + "type": "string", + "description": "Locale of the user profile. This is a required field.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil)\n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "name": { + "type": "string", + "description": "Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any of the following characters: \"&;\"#%,\"." + }, + "siteFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which sites are visible to the user profile." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerType": { + "type": "string", + "description": "Trafficker type of this user profile.", + "enum": [ + "EXTERNAL_TRAFFICKER", + "INTERNAL_NON_TRAFFICKER", + "INTERNAL_TRAFFICKER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userAccessType": { + "type": "string", + "description": "User type of the user profile. This is a read-only field that can be left blank.", + "enum": [ + "INTERNAL_ADMINISTRATOR", + "NORMAL_USER", + "READ_ONLY_SUPER_USER", + "SUPER_USER" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "userRoleFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which user roles are visible to the user profile." + }, + "userRoleId": { + "type": "string", + "description": "User role ID of the user profile. This is a required field.", + "format": "int64" + } + } + }, + "AccountUserProfilesListResponse": { + "id": "AccountUserProfilesListResponse", + "type": "object", + "description": "Account User Profile List Response", + "properties": { + "accountUserProfiles": { + "type": "array", + "description": "Account user profile collection.", + "items": { + "$ref": "AccountUserProfile" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfilesListResponse\".", + "default": "dfareporting#accountUserProfilesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AccountsListResponse": { + "id": "AccountsListResponse", + "type": "object", + "description": "Account List Response", + "properties": { + "accounts": { + "type": "array", + "description": "Account collection.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountsListResponse\".", + "default": "dfareporting#accountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "Activities": { + "id": "Activities", + "type": "object", + "description": "Represents an activity group.", + "properties": { + "filters": { + "type": "array", + "description": "List of activity filters. The dimension values need to be all either of type \"dfa:activity\" or \"dfa:activityGroup\".", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#activities.", + "default": "dfareporting#activities" + }, + "metricNames": { + "type": "array", + "description": "List of names of floodlight activity metrics.", + "items": { + "type": "string" + } + } + } + }, + "Ad": { + "id": "Ad", + "type": "object", + "description": "Contains properties of a DCM ad.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this ad is active. When true, archived must be false." + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this ad is archived. When true, active must be false." + }, + "audienceSegmentId": { + "type": "string", + "description": "Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD.", + "format": "int64" + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative." + }, + "comments": { + "type": "string", + "description": "Comments for this ad." + }, + "compatibility": { + "type": "string", + "description": "Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are only used for existing default ads. New mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and default ads created for those placements will be limited to those compatibility types. IN_STREAM_VIDEO refers to rendering in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "DISPLAY", + "DISPLAY_INTERSTITIAL", + "IN_STREAM_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this ad. This is a read-only field." + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeRotation": { + "$ref": "CreativeRotation", + "description": "Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment." + }, + "dayPartTargeting": { + "$ref": "DayPartTargeting", + "description": "Time and day targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Default click-through event tag properties for this ad." + }, + "deliverySchedule": { + "$ref": "DeliverySchedule", + "description": "Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD." + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only after insert." + }, + "endTime": { + "type": "string", + "description": "Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion.", + "format": "date-time" + }, + "eventTagOverrides": { + "type": "array", + "description": "Event tag overrides for this ad.", + "items": { + "$ref": "EventTagOverride" + } + }, + "geoTargeting": { + "$ref": "GeoTargeting", + "description": "Geographical targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "id": { + "type": "string", + "description": "ID of this ad. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this ad. This is a read-only, auto-generated field." + }, + "keyValueTargetingExpression": { + "$ref": "KeyValueTargetingExpression", + "description": "Key-value targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ad\".", + "default": "dfareporting#ad" + }, + "languageTargeting": { + "$ref": "LanguageTargeting", + "description": "Language targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this ad. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this ad. This is a required field and must be less than 256 characters long." + }, + "placementAssignments": { + "type": "array", + "description": "Placement assignments for this ad.", + "items": { + "$ref": "PlacementAssignment" + } + }, + "remarketingListExpression": { + "$ref": "ListTargetingExpression", + "description": "Remarketing list targeting expression for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "size": { + "$ref": "Size", + "description": "Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion.", + "format": "date-time" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "targetingTemplateId": { + "type": "string", + "description": "Targeting template ID, used to apply preconfigured targeting information to this ad. This cannot be set while any of dayPartTargeting, geoTargeting, keyValueTargetingExpression, languageTargeting, remarketingListExpression, or technologyTargeting are set. Applicable when type is AD_SERVING_STANDARD_AD.", + "format": "int64" + }, + "technologyTargeting": { + "$ref": "TechnologyTargeting", + "description": "Technology platform targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "type": { + "type": "string", + "description": "Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource).", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "AdBlockingConfiguration": { + "id": "AdBlockingConfiguration", + "type": "object", + "description": "Campaign ad blocking settings.", + "properties": { + "clickThroughUrl": { + "type": "string", + "description": "Click-through URL used by brand-neutral ads. This is a required field when overrideClickThroughUrl is set to true." + }, + "creativeBundleId": { + "type": "string", + "description": "ID of a creative bundle to use for this campaign. If set, brand-neutral ads will select creatives from this bundle. Otherwise, a default transparent pixel will be used.", + "format": "int64" + }, + "enabled": { + "type": "boolean", + "description": "Whether this campaign has enabled ad blocking. When true, ad blocking is enabled for placements in the campaign, but this may be overridden by site and placement settings. When false, ad blocking is disabled for all placements under the campaign, regardless of site and placement settings." + }, + "overrideClickThroughUrl": { + "type": "boolean", + "description": "Whether the brand-neutral ad's click-through URL comes from the campaign's creative bundle or the override URL. Must be set to true if ad blocking is enabled and no creative bundle is configured." + } + } + }, + "AdSlot": { + "id": "AdSlot", + "type": "object", + "description": "Ad Slot", + "properties": { + "comment": { + "type": "string", + "description": "Comment for this ad slot." + }, + "compatibility": { + "type": "string", + "description": "Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile devices or in mobile apps for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "DISPLAY", + "DISPLAY_INTERSTITIAL", + "IN_STREAM_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "height": { + "type": "string", + "description": "Height of this ad slot.", + "format": "int64" + }, + "linkedPlacementId": { + "type": "string", + "description": "ID of the placement from an external platform that is linked to this ad slot.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this ad slot." + }, + "paymentSourceType": { + "type": "string", + "description": "Payment source type of this ad slot.", + "enum": [ + "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID", + "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "primary": { + "type": "boolean", + "description": "Primary ad slot of a roadblock inventory item." + }, + "width": { + "type": "string", + "description": "Width of this ad slot.", + "format": "int64" + } + } + }, + "AdsListResponse": { + "id": "AdsListResponse", + "type": "object", + "description": "Ad List Response", + "properties": { + "ads": { + "type": "array", + "description": "Ad collection.", + "items": { + "$ref": "Ad" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#adsListResponse\".", + "default": "dfareporting#adsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "Advertiser": { + "id": "Advertiser", + "type": "object", + "description": "Contains properties of a DCM advertiser.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserGroupId": { + "type": "string", + "description": "ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for all advertisers in each group.", + "format": "int64" + }, + "clickThroughUrlSuffix": { + "type": "string", + "description": "Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long." + }, + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns.", + "format": "int64" + }, + "defaultEmail": { + "type": "string", + "description": "Default email address used in sender field for tag emails." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this advertiser, so long as: \n- This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. \n- This advertiser's original floodlight configuration is not already shared with another advertiser.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this advertiser. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this advertiser. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiser\".", + "default": "dfareporting#advertiser" + }, + "name": { + "type": "string", + "description": "Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account." + }, + "originalFloodlightConfigurationId": { + "type": "string", + "description": "Original floodlight configuration before any sharing occurred. Set the floodlightConfigurationId of this advertiser to originalFloodlightConfigurationId to unshare the advertiser's current floodlight configuration. You cannot unshare an advertiser's floodlight configuration if the shared configuration has activities associated with any campaign or placement.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Status of this advertiser.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + }, + "suspended": { + "type": "boolean", + "description": "Suspension status of this advertiser." + } + } + }, + "AdvertiserGroup": { + "id": "AdvertiserGroup", + "type": "object", + "description": "Groups advertisers together so that reports can be generated for the entire group at once.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this advertiser group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroup\".", + "default": "dfareporting#advertiserGroup" + }, + "name": { + "type": "string", + "description": "Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same account." + } + } + }, + "AdvertiserGroupsListResponse": { + "id": "AdvertiserGroupsListResponse", + "type": "object", + "description": "Advertiser Group List Response", + "properties": { + "advertiserGroups": { + "type": "array", + "description": "Advertiser group collection.", + "items": { + "$ref": "AdvertiserGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroupsListResponse\".", + "default": "dfareporting#advertiserGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AdvertisersListResponse": { + "id": "AdvertisersListResponse", + "type": "object", + "description": "Advertiser List Response", + "properties": { + "advertisers": { + "type": "array", + "description": "Advertiser collection.", + "items": { + "$ref": "Advertiser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertisersListResponse\".", + "default": "dfareporting#advertisersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AudienceSegment": { + "id": "AudienceSegment", + "type": "object", + "description": "Audience Segment.", + "properties": { + "allocation": { + "type": "integer", + "description": "Weight allocated to this segment. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group. Acceptable values are 1 to 1000, inclusive.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this audience segment. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment. This is a required field and must be less than 65 characters long." + } + } + }, + "AudienceSegmentGroup": { + "id": "AudienceSegmentGroup", + "type": "object", + "description": "Audience Segment Group.", + "properties": { + "audienceSegments": { + "type": "array", + "description": "Audience segments assigned to this group. The number of segments must be between 2 and 100.", + "items": { + "$ref": "AudienceSegment" + } + }, + "id": { + "type": "string", + "description": "ID of this audience segment group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment group. This is a required field and must be less than 65 characters long." + } + } + }, + "Browser": { + "id": "Browser", + "type": "object", + "description": "Contains information about a browser that can be targeted by ads.", + "properties": { + "browserVersionId": { + "type": "string", + "description": "ID referring to this grouping of browser and version numbers. This is the ID used for targeting.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this browser. This is the ID used when generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browser\".", + "default": "dfareporting#browser" + }, + "majorVersion": { + "type": "string", + "description": "Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "minorVersion": { + "type": "string", + "description": "Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "name": { + "type": "string", + "description": "Name of this browser." + } + } + }, + "BrowsersListResponse": { + "id": "BrowsersListResponse", + "type": "object", + "description": "Browser List Response", + "properties": { + "browsers": { + "type": "array", + "description": "Browser collection.", + "items": { + "$ref": "Browser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browsersListResponse\".", + "default": "dfareporting#browsersListResponse" + } + } + }, + "Campaign": { + "id": "Campaign", + "type": "object", + "description": "Contains properties of a DCM campaign.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "adBlockingConfiguration": { + "$ref": "AdBlockingConfiguration", + "description": "Ad blocking settings for this campaign." + }, + "additionalCreativeOptimizationConfigurations": { + "type": "array", + "description": "Additional creative optimization configurations for the campaign.", + "items": { + "$ref": "CreativeOptimizationConfiguration" + } + }, + "advertiserGroupId": { + "type": "string", + "description": "Advertiser group ID of the associated advertiser.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this campaign. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this campaign has been archived." + }, + "audienceSegmentGroups": { + "type": "array", + "description": "Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups.", + "items": { + "$ref": "AudienceSegmentGroup" + } + }, + "billingInvoiceCode": { + "type": "string", + "description": "Billing invoice code included in the DCM client billing invoices associated with the campaign." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix override properties for this campaign." + }, + "comment": { + "type": "string", + "description": "Arbitrary comments about this campaign. Must be less than 256 characters long." + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this campaign. This is a read-only field." + }, + "creativeGroupIds": { + "type": "array", + "description": "List of creative group IDs that are assigned to the campaign.", + "items": { + "type": "string", + "format": "int64" + } + }, + "creativeOptimizationConfiguration": { + "$ref": "CreativeOptimizationConfiguration", + "description": "Creative optimization configuration for the campaign." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Click-through event tag ID override properties for this campaign." + }, + "endDate": { + "type": "string", + "description": "Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "eventTagOverrides": { + "type": "array", + "description": "Overrides that can be used to activate or deactivate advertiser event tags.", + "items": { + "$ref": "EventTagOverride" + } + }, + "externalId": { + "type": "string", + "description": "External ID for this campaign." + }, + "id": { + "type": "string", + "description": "ID of this campaign. This is a read-only auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this campaign. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaign\".", + "default": "dfareporting#campaign" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this campaign. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for the campaign." + }, + "name": { + "type": "string", + "description": "Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether Nielsen reports are enabled for this campaign." + }, + "startDate": { + "type": "string", + "description": "Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerEmails": { + "type": "array", + "description": "Campaign trafficker contact emails.", + "items": { + "type": "string" + } + } + } + }, + "CampaignCreativeAssociation": { + "id": "CampaignCreativeAssociation", + "type": "object", + "description": "Identifies a creative which has been associated with a given campaign.", + "properties": { + "creativeId": { + "type": "string", + "description": "ID of the creative associated with the campaign. This is a required field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociation\".", + "default": "dfareporting#campaignCreativeAssociation" + } + } + }, + "CampaignCreativeAssociationsListResponse": { + "id": "CampaignCreativeAssociationsListResponse", + "type": "object", + "description": "Campaign Creative Association List Response", + "properties": { + "campaignCreativeAssociations": { + "type": "array", + "description": "Campaign creative association collection", + "items": { + "$ref": "CampaignCreativeAssociation" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociationsListResponse\".", + "default": "dfareporting#campaignCreativeAssociationsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CampaignsListResponse": { + "id": "CampaignsListResponse", + "type": "object", + "description": "Campaign List Response", + "properties": { + "campaigns": { + "type": "array", + "description": "Campaign collection.", + "items": { + "$ref": "Campaign" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignsListResponse\".", + "default": "dfareporting#campaignsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ChangeLog": { + "id": "ChangeLog", + "type": "object", + "description": "Describes a change that a user has made to a resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the modified object.", + "format": "int64" + }, + "action": { + "type": "string", + "description": "Action which caused the change." + }, + "changeTime": { + "type": "string", + "description": "Time when the object was modified.", + "format": "date-time" + }, + "fieldName": { + "type": "string", + "description": "Field name of the object which changed." + }, + "id": { + "type": "string", + "description": "ID of this change log.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLog\".", + "default": "dfareporting#changeLog" + }, + "newValue": { + "type": "string", + "description": "New value of the object field." + }, + "objectId": { + "type": "string", + "description": "ID of the object of this change log. The object could be a campaign, placement, ad, or other type.", + "format": "int64" + }, + "objectType": { + "type": "string", + "description": "Object type of the change log." + }, + "oldValue": { + "type": "string", + "description": "Old value of the object field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the modified object.", + "format": "int64" + }, + "transactionId": { + "type": "string", + "description": "Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share the same transactionId.", + "format": "int64" + }, + "userProfileId": { + "type": "string", + "description": "ID of the user who modified the object.", + "format": "int64" + }, + "userProfileName": { + "type": "string", + "description": "User profile name of the user who modified the object." + } + } + }, + "ChangeLogsListResponse": { + "id": "ChangeLogsListResponse", + "type": "object", + "description": "Change Log List Response", + "properties": { + "changeLogs": { + "type": "array", + "description": "Change log collection.", + "items": { + "$ref": "ChangeLog" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLogsListResponse\".", + "default": "dfareporting#changeLogsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CitiesListResponse": { + "id": "CitiesListResponse", + "type": "object", + "description": "City List Response", + "properties": { + "cities": { + "type": "array", + "description": "City collection.", + "items": { + "$ref": "City" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#citiesListResponse\".", + "default": "dfareporting#citiesListResponse" + } + } + }, + "City": { + "id": "City", + "type": "object", + "description": "Contains information about a city that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this city belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this city belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this city. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#city\".", + "default": "dfareporting#city" + }, + "metroCode": { + "type": "string", + "description": "Metro region code of the metro region (DMA) to which this city belongs." + }, + "metroDmaId": { + "type": "string", + "description": "ID of the metro region (DMA) to which this city belongs.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this city." + }, + "regionCode": { + "type": "string", + "description": "Region code of the region to which this city belongs." + }, + "regionDartId": { + "type": "string", + "description": "DART ID of the region to which this city belongs.", + "format": "int64" + } + } + }, + "ClickTag": { + "id": "ClickTag", + "type": "object", + "description": "Creative Click Tag.", + "properties": { + "eventName": { + "type": "string", + "description": "Advertiser event name associated with the click tag. This field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "name": { + "type": "string", + "description": "Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY creative assets, this field must match the value of the creative asset's creativeAssetId.name field." + }, + "value": { + "type": "string", + "description": "Parameter value for the specified click tag. This field contains a click-through url." + } + } + }, + "ClickThroughUrl": { + "id": "ClickThroughUrl", + "type": "object", + "description": "Click-through URL", + "properties": { + "computedClickThroughUrl": { + "type": "string", + "description": "Read-only convenience field representing the actual URL that will be used for this click-through. The URL is computed as follows: \n- If defaultLandingPage is enabled then the campaign's default landing page URL is assigned to this field.\n- If defaultLandingPage is not enabled and a landingPageId is specified then that landing page's URL is assigned to this field.\n- If neither of the above cases apply, then the customClickThroughUrl is assigned to this field." + }, + "customClickThroughUrl": { + "type": "string", + "description": "Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset." + }, + "defaultLandingPage": { + "type": "boolean", + "description": "Whether the campaign default landing page is used." + }, + "landingPageId": { + "type": "string", + "description": "ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false.", + "format": "int64" + } + } + }, + "ClickThroughUrlSuffixProperties": { + "id": "ClickThroughUrlSuffixProperties", + "type": "object", + "description": "Click Through URL Suffix settings.", + "properties": { + "clickThroughUrlSuffix": { + "type": "string", + "description": "Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long." + }, + "overrideInheritedSuffix": { + "type": "boolean", + "description": "Whether this entity should override the inherited click-through URL suffix with its own defined value." + } + } + }, + "CompanionClickThroughOverride": { + "id": "CompanionClickThroughOverride", + "type": "object", + "description": "Companion Click-through override.", + "properties": { + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of this companion click-through override." + }, + "creativeId": { + "type": "string", + "description": "ID of the creative for this companion click-through override.", + "format": "int64" + } + } + }, + "CompanionSetting": { + "id": "CompanionSetting", + "type": "object", + "description": "Companion Settings", + "properties": { + "companionsDisabled": { + "type": "boolean", + "description": "Whether companions are disabled for this placement." + }, + "enabledSizes": { + "type": "array", + "description": "Whitelist of companion sizes to be served to this placement. Set this list to null or empty to serve all companion sizes.", + "items": { + "$ref": "Size" + } + }, + "imageOnly": { + "type": "boolean", + "description": "Whether to serve only static images as companions." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#companionSetting\".", + "default": "dfareporting#companionSetting" + } + } + }, + "CompatibleFields": { + "id": "CompatibleFields", + "type": "object", + "description": "Represents a response to the queryCompatibleFields method.", + "properties": { + "crossDimensionReachReportCompatibleFields": { + "$ref": "CrossDimensionReachReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"CROSS_DIMENSION_REACH\"." + }, + "floodlightReportCompatibleFields": { + "$ref": "FloodlightReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"FLOODLIGHT\"." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#compatibleFields.", + "default": "dfareporting#compatibleFields" + }, + "pathToConversionReportCompatibleFields": { + "$ref": "PathToConversionReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"PATH_TO_CONVERSION\"." + }, + "reachReportCompatibleFields": { + "$ref": "ReachReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"REACH\"." + }, + "reportCompatibleFields": { + "$ref": "ReportCompatibleFields", + "description": "Contains items that are compatible to be selected for a report of type \"STANDARD\"." + } + } + }, + "ConnectionType": { + "id": "ConnectionType", + "type": "object", + "description": "Contains information about an internet connection type that can be targeted by ads. Clients can use the connection type to target mobile vs. broadband users.", + "properties": { + "id": { + "type": "string", + "description": "ID of this connection type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionType\".", + "default": "dfareporting#connectionType" + }, + "name": { + "type": "string", + "description": "Name of this connection type." + } + } + }, + "ConnectionTypesListResponse": { + "id": "ConnectionTypesListResponse", + "type": "object", + "description": "Connection Type List Response", + "properties": { + "connectionTypes": { + "type": "array", + "description": "Collection of connection types such as broadband and mobile.", + "items": { + "$ref": "ConnectionType" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionTypesListResponse\".", + "default": "dfareporting#connectionTypesListResponse" + } + } + }, + "ContentCategoriesListResponse": { + "id": "ContentCategoriesListResponse", + "type": "object", + "description": "Content Category List Response", + "properties": { + "contentCategories": { + "type": "array", + "description": "Content category collection.", + "items": { + "$ref": "ContentCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategoriesListResponse\".", + "default": "dfareporting#contentCategoriesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ContentCategory": { + "id": "ContentCategory", + "type": "object", + "description": "Organizes placements according to the contents of their associated webpages.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this content category. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this content category. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategory\".", + "default": "dfareporting#contentCategory" + }, + "name": { + "type": "string", + "description": "Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same account." + } + } + }, + "Conversion": { + "id": "Conversion", + "type": "object", + "description": "A Conversion represents when a user successfully performs a desired action after seeing an ad.", + "properties": { + "childDirectedTreatment": { + "type": "boolean", + "description": "Whether the conversion was directed toward children." + }, + "customVariables": { + "type": "array", + "description": "Custom floodlight variables.", + "items": { + "$ref": "CustomFloodlightVariable" + } + }, + "encryptedUserId": { + "type": "string", + "description": "The alphanumeric encrypted user ID. When set, encryptionInfo should also be specified. This field is mutually exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid. This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required field." + }, + "encryptedUserIdCandidates": { + "type": "array", + "description": "A list of the alphanumeric encrypted user IDs. Any user ID with exposure prior to the conversion timestamp will be used in the inserted conversion. If no such user ID is found then the conversion will be rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be specified. This field may only be used when calling batchinsert; it is not supported by batchupdate. This field is mutually exclusive with encryptedUserId, mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId or gclid is a required field.", + "items": { + "type": "string" + } + }, + "floodlightActivityId": { + "type": "string", + "description": "Floodlight Activity ID of this conversion. This is a required field.", + "format": "int64" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight Configuration ID of this conversion. This is a required field.", + "format": "int64" + }, + "gclid": { + "type": "string", + "description": "The Google click ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId is a required field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversion\".", + "default": "dfareporting#conversion" + }, + "limitAdTracking": { + "type": "boolean", + "description": "Whether Limit Ad Tracking is enabled. When set to true, the conversion will be used for reporting but not targeting. This will prevent remarketing." + }, + "mobileDeviceId": { + "type": "string", + "description": "The mobile device ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and gclid. This or encryptedUserId or encryptedUserIdCandidates[] or gclid is a required field." + }, + "ordinal": { + "type": "string", + "description": "The ordinal of the conversion. Use this field to control how conversions of the same user and day are de-duplicated. This is a required field." + }, + "quantity": { + "type": "string", + "description": "The quantity of the conversion.", + "format": "int64" + }, + "timestampMicros": { + "type": "string", + "description": "The timestamp of conversion, in Unix epoch micros. This is a required field.", + "format": "int64" + }, + "value": { + "type": "number", + "description": "The value of the conversion.", + "format": "double" + } + } + }, + "ConversionError": { + "id": "ConversionError", + "type": "object", + "description": "The error code and description for a conversion that failed to insert or update.", + "properties": { + "code": { + "type": "string", + "description": "The error code.", + "enum": [ + "INTERNAL", + "INVALID_ARGUMENT", + "NOT_FOUND", + "PERMISSION_DENIED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversionError\".", + "default": "dfareporting#conversionError" + }, + "message": { + "type": "string", + "description": "A description of the error." + } + } + }, + "ConversionStatus": { + "id": "ConversionStatus", + "type": "object", + "description": "The original conversion that was inserted or updated and whether there were any errors.", + "properties": { + "conversion": { + "$ref": "Conversion", + "description": "The original conversion that was inserted or updated." + }, + "errors": { + "type": "array", + "description": "A list of errors related to this conversion.", + "items": { + "$ref": "ConversionError" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversionStatus\".", + "default": "dfareporting#conversionStatus" + } + } + }, + "ConversionsBatchInsertRequest": { + "id": "ConversionsBatchInsertRequest", + "type": "object", + "description": "Insert Conversions Request.", + "properties": { + "conversions": { + "type": "array", + "description": "The set of conversions to insert.", + "items": { + "$ref": "Conversion" + } + }, + "encryptionInfo": { + "$ref": "EncryptionInfo", + "description": "Describes how encryptedUserId or encryptedUserIdCandidates[] is encrypted. This is a required field if encryptedUserId or encryptedUserIdCandidates[] is used." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversionsBatchInsertRequest\".", + "default": "dfareporting#conversionsBatchInsertRequest" + } + } + }, + "ConversionsBatchInsertResponse": { + "id": "ConversionsBatchInsertResponse", + "type": "object", + "description": "Insert Conversions Response.", + "properties": { + "hasFailures": { + "type": "boolean", + "description": "Indicates that some or all conversions failed to insert." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversionsBatchInsertResponse\".", + "default": "dfareporting#conversionsBatchInsertResponse" + }, + "status": { + "type": "array", + "description": "The insert status of each conversion. Statuses are returned in the same order that conversions are inserted.", + "items": { + "$ref": "ConversionStatus" + } + } + } + }, + "ConversionsBatchUpdateRequest": { + "id": "ConversionsBatchUpdateRequest", + "type": "object", + "description": "Update Conversions Request.", + "properties": { + "conversions": { + "type": "array", + "description": "The set of conversions to update.", + "items": { + "$ref": "Conversion" + } + }, + "encryptionInfo": { + "$ref": "EncryptionInfo", + "description": "Describes how encryptedUserId is encrypted. This is a required field if encryptedUserId is used." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversionsBatchUpdateRequest\".", + "default": "dfareporting#conversionsBatchUpdateRequest" + } + } + }, + "ConversionsBatchUpdateResponse": { + "id": "ConversionsBatchUpdateResponse", + "type": "object", + "description": "Update Conversions Response.", + "properties": { + "hasFailures": { + "type": "boolean", + "description": "Indicates that some or all conversions failed to update." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#conversionsBatchUpdateResponse\".", + "default": "dfareporting#conversionsBatchUpdateResponse" + }, + "status": { + "type": "array", + "description": "The update status of each conversion. Statuses are returned in the same order that conversions are updated.", + "items": { + "$ref": "ConversionStatus" + } + } + } + }, + "CountriesListResponse": { + "id": "CountriesListResponse", + "type": "object", + "description": "Country List Response", + "properties": { + "countries": { + "type": "array", + "description": "Country collection.", + "items": { + "$ref": "Country" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#countriesListResponse\".", + "default": "dfareporting#countriesListResponse" + } + } + }, + "Country": { + "id": "Country", + "type": "object", + "description": "Contains information about a country that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code." + }, + "dartId": { + "type": "string", + "description": "DART ID of this country. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#country\".", + "default": "dfareporting#country" + }, + "name": { + "type": "string", + "description": "Name of this country." + }, + "sslEnabled": { + "type": "boolean", + "description": "Whether ad serving supports secure servers in this country." + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "Contains properties of a Creative.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether the creative is active. Applicable to all creative types." + }, + "adParameters": { + "type": "string", + "description": "Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID." + }, + "adTagKeys": { + "type": "array", + "description": "Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field. Applicable to all creative types.", + "format": "int64" + }, + "allowScriptAccess": { + "type": "boolean", + "description": "Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. Applicable to the following creative types: FLASH_INPAGE." + }, + "archived": { + "type": "boolean", + "description": "Whether the creative is archived. Applicable to all creative types." + }, + "artworkType": { + "type": "string", + "description": "Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_IMAGE", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "authoringSource": { + "type": "string", + "description": "Source application where creative was authored. Presently, only DBM authored creatives will have this field set. Applicable to all creative types.", + "enum": [ + "CREATIVE_AUTHORING_SOURCE_DBM", + "CREATIVE_AUTHORING_SOURCE_DCM", + "CREATIVE_AUTHORING_SOURCE_STUDIO" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "authoringTool": { + "type": "string", + "description": "Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER.", + "enum": [ + "NINJA", + "SWIFFY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "autoAdvanceImages": { + "type": "boolean", + "description": "Whether images are automatically advanced for image gallery creatives. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY." + }, + "backgroundColor": { + "type": "string", + "description": "The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. Applicable to the following creative types: FLASH_INPAGE." + }, + "backupImageClickThroughUrl": { + "type": "string", + "description": "Click-through URL for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "backupImageFeatures": { + "type": "array", + "description": "List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the creativeAssets' detected features. Applicable to the following creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "backupImageReportingLabel": { + "type": "string", + "description": "Reporting label used for HTML5 banner backup image. Applicable to the following creative types: DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "backupImageTargetWindow": { + "$ref": "TargetWindow", + "description": "Target window for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "clickTags": { + "type": "array", + "description": "Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly one entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.", + "items": { + "$ref": "ClickTag" + } + }, + "commercialId": { + "type": "string", + "description": "Industry standard ID assigned to creative for reach and frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives." + }, + "companionCreatives": { + "type": "array", + "description": "List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to the following creative types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection set to false.", + "items": { + "type": "string", + "format": "int64" + } + }, + "compatibility": { + "type": "array", + "description": "Compatibilities associated with this creative. This is a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing creatives may have these compatibilities since new creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types.\n\nAcceptable values are:\n- \"APP\"\n- \"APP_INTERSTITIAL\"\n- \"IN_STREAM_VIDEO\"\n- \"DISPLAY\"\n- \"DISPLAY_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "DISPLAY", + "DISPLAY_INTERSTITIAL", + "IN_STREAM_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + }, + "convertFlashToHtml5": { + "type": "boolean", + "description": "Whether Flash assets associated with the creative need to be automatically converted to HTML5. This flag is enabled by default and users can choose to disable it if they don't want the system to generate and use HTML5 asset for this creative. Applicable to the following creative type: FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "counterCustomEvents": { + "type": "array", + "description": "List of counter events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "creativeAssetSelection": { + "$ref": "CreativeAssetSelection", + "description": "Required if dynamicAssetSelection is true." + }, + "creativeAssets": { + "type": "array", + "description": "Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT", + "items": { + "$ref": "CreativeAsset" + } + }, + "creativeFieldAssignments": { + "type": "array", + "description": "Creative field assignments for this creative. Applicable to all creative types.", + "items": { + "$ref": "CreativeFieldAssignment" + } + }, + "customKeyValues": { + "type": "array", + "description": "Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "dynamicAssetSelection": { + "type": "boolean", + "description": "Set this to true to enable the use of rules to target individual assets in this creative. When set to true creativeAssetSelection must be set. This also controls asset-level companions. When this is true, companion creatives should be assigned to creative assets. Learn more. Applicable to INSTREAM_VIDEO creatives." + }, + "exitCustomEvents": { + "type": "array", + "description": "List of exit events configured for the creative. For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags, For DISPLAY, an event is also created from the backupImageReportingLabel. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "fsCommand": { + "$ref": "FsCommand", + "description": "OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE." + }, + "htmlCode": { + "type": "string", + "description": "HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is true. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA." + }, + "htmlCodeLocked": { + "type": "boolean", + "description": "Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER." + }, + "id": { + "type": "string", + "description": "ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creative\".", + "default": "dfareporting#creative" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Creative last modification information. This is a read-only field. Applicable to all creative types." + }, + "latestTraffickedCreativeId": { + "type": "string", + "description": "Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types." + }, + "overrideCss": { + "type": "string", + "description": "Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA." + }, + "progressOffset": { + "$ref": "VideoOffset", + "description": "Amount of time to play the video before counting a view. Applicable to the following creative types: all INSTREAM_VIDEO." + }, + "redirectUrl": { + "type": "string", + "description": "URL of hosted image or hosted video or another ad tag. For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect URL. The standard for a VAST (Video Ad Serving Template) ad response allows for a redirect link to another VAST 2.0 or 3.0 call. This is a required field when applicable. Applicable to the following creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT" + }, + "renderingId": { + "type": "string", + "description": "ID of current rendering version. This is a read-only field. Applicable to all creative types.", + "format": "int64" + }, + "renderingIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "requiredFlashPluginVersion": { + "type": "string", + "description": "The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID." + }, + "requiredFlashVersion": { + "type": "integer", + "description": "The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.", + "format": "int32" + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is a required field when applicable; however for IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a primary asset of type HTML_IMAGE, if left blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: DISPLAY, DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "skipOffset": { + "$ref": "VideoOffset", + "description": "Amount of time to play the video before the skip button appears. Applicable to the following creative types: all INSTREAM_VIDEO." + }, + "skippable": { + "type": "boolean", + "description": "Whether the user can choose to skip the creative. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types." + }, + "sslOverride": { + "type": "boolean", + "description": "Whether creative should be treated as SSL compliant even if the system scan shows it's not. Applicable to all creative types." + }, + "studioAdvertiserId": { + "type": "string", + "description": "Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioCreativeId": { + "type": "string", + "description": "Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioTraffickedCreativeId": { + "type": "string", + "description": "Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "thirdPartyBackupImageImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA." + }, + "thirdPartyRichMediaImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA." + }, + "thirdPartyUrls": { + "type": "array", + "description": "Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID.", + "items": { + "$ref": "ThirdPartyTrackingUrl" + } + }, + "timerCustomEvents": { + "type": "array", + "description": "List of timer events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset is not HTML_IMAGE.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "totalFileSize": { + "type": "string", + "description": "Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of this creative. This is a required field. Applicable to all creative types.\n\nNote: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for existing creatives. New creatives should use DISPLAY as a replacement for these types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_DISPLAY", + "CUSTOM_DISPLAY_INTERSTITIAL", + "DISPLAY", + "DISPLAY_IMAGE_GALLERY", + "DISPLAY_REDIRECT", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INSTREAM_VIDEO_REDIRECT", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "RICH_MEDIA_DISPLAY_BANNER", + "RICH_MEDIA_DISPLAY_EXPANDING", + "RICH_MEDIA_DISPLAY_INTERSTITIAL", + "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VPAID_LINEAR_VIDEO", + "VPAID_NON_LINEAR_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "universalAdId": { + "$ref": "UniversalAdId", + "description": "A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following creative types: INSTREAM_VIDEO and VPAID." + }, + "version": { + "type": "integer", + "description": "The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich Media creative merging. Applicable to all creative types.", + "format": "int32" + }, + "videoDescription": { + "type": "string", + "description": "Description of the video ad. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID." + }, + "videoDuration": { + "type": "number", + "description": "Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.", + "format": "float" + } + } + }, + "CreativeAsset": { + "id": "CreativeAsset", + "type": "object", + "description": "Creative Asset.", + "properties": { + "actionScript3": { + "type": "boolean", + "description": "Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative type: FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "active": { + "type": "boolean", + "description": "Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "alignment": { + "type": "string", + "description": "Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.", + "enum": [ + "ALIGNMENT_BOTTOM", + "ALIGNMENT_LEFT", + "ALIGNMENT_RIGHT", + "ALIGNMENT_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "artworkType": { + "type": "string", + "description": "Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_IMAGE", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "backupImageExit": { + "$ref": "CreativeCustomEvent", + "description": "Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA." + }, + "bitRate": { + "type": "integer", + "description": "Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "int32" + }, + "childAssetType": { + "type": "string", + "description": "Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID.", + "enum": [ + "CHILD_ASSET_TYPE_DATA", + "CHILD_ASSET_TYPE_FLASH", + "CHILD_ASSET_TYPE_IMAGE", + "CHILD_ASSET_TYPE_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "collapsedSize": { + "$ref": "Size", + "description": "Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "companionCreativeIds": { + "type": "array", + "description": "List of companion creatives assigned to an in-stream video creative asset. Acceptable values include IDs of existing flash and image creatives. Applicable to INSTREAM_VIDEO creative type with dynamicAssetSelection set to true.", + "items": { + "type": "string", + "format": "int64" + } + }, + "customStartTimeValue": { + "type": "integer", + "description": "Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA. Value must be greater than or equal to 0.", + "format": "int32" + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "displayType": { + "type": "string", + "description": "Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DISPLAY_TYPE_BACKDROP", + "ASSET_DISPLAY_TYPE_EXPANDING", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING", + "ASSET_DISPLAY_TYPE_FLOATING", + "ASSET_DISPLAY_TYPE_INPAGE", + "ASSET_DISPLAY_TYPE_OVERLAY", + "ASSET_DISPLAY_TYPE_PEEL_DOWN", + "ASSET_DISPLAY_TYPE_VPAID_LINEAR", + "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "duration": { + "type": "integer", + "description": "Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must be greater than or equal to 1.", + "format": "int32" + }, + "durationType": { + "type": "string", + "description": "Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DURATION_TYPE_AUTO", + "ASSET_DURATION_TYPE_CUSTOM", + "ASSET_DURATION_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "expandedDimension": { + "$ref": "Size", + "description": "Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "fileSize": { + "type": "string", + "description": "File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "flashVersion": { + "type": "integer", + "description": "Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.", + "format": "int32" + }, + "hideFlashObjects": { + "type": "boolean", + "description": "Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "hideSelectionBoxes": { + "type": "boolean", + "description": "Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "horizontallyLocked": { + "type": "boolean", + "description": "Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "id": { + "type": "string", + "description": "Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the asset. This is a read-only, auto-generated field." + }, + "mimeType": { + "type": "string", + "description": "Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "originalBackup": { + "type": "boolean", + "description": "Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA." + }, + "position": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "positionLeftUnit": { + "type": "string", + "description": "Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "positionTopUnit": { + "type": "string", + "description": "Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "progressiveServingUrl": { + "type": "string", + "description": "Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "pushdown": { + "type": "boolean", + "description": "Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height." + }, + "pushdownDuration": { + "type": "number", + "description": "Pushdown duration in seconds for an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. Acceptable values are 0 to 9.99, inclusive.", + "format": "float" + }, + "role": { + "type": "string", + "description": "Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required field.\nPRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and all VPAID creatives.\nBACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.\nADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives.\nOTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives.\nPARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives.\nTRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives.\nALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within DCM.\nFor VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative.", + "enum": [ + "ADDITIONAL_FLASH", + "ADDITIONAL_IMAGE", + "ALTERNATE_VIDEO", + "BACKUP_IMAGE", + "OTHER", + "PARENT_VIDEO", + "PRIMARY", + "TRANSCODED_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, this field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "startTimeType": { + "type": "string", + "description": "Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_START_TIME_TYPE_CUSTOM", + "ASSET_START_TIME_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "streamingServingUrl": { + "type": "string", + "description": "Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "transparency": { + "type": "boolean", + "description": "Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets." + }, + "verticallyLocked": { + "type": "boolean", + "description": "Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "videoDuration": { + "type": "number", + "description": "Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "float" + }, + "windowMode": { + "type": "string", + "description": "Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and RICH_MEDIA_INPAGE_FLOATING.", + "enum": [ + "OPAQUE", + "TRANSPARENT", + "WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "zIndex": { + "type": "integer", + "description": "zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive.", + "format": "int32" + }, + "zipFilename": { + "type": "string", + "description": "File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + }, + "zipFilesize": { + "type": "string", + "description": "Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + } + } + }, + "CreativeAssetId": { + "id": "CreativeAssetId", + "type": "object", + "description": "Creative Asset ID.", + "properties": { + "name": { + "type": "string", + "description": "Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded asset. Characters in the name must be alphanumeric or one of the following: \".-_ \". Spaces are allowed." + }, + "type": { + "type": "string", + "description": "Type of asset to upload. This is a required field. FLASH and IMAGE are no longer supported for new uploads. All image assets should use HTML_IMAGE.", + "enum": [ + "FLASH", + "HTML", + "HTML_IMAGE", + "IMAGE", + "VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "CreativeAssetMetadata": { + "id": "CreativeAssetMetadata", + "type": "object", + "description": "CreativeAssets contains properties of a creative asset file which will be uploaded or has already been uploaded. Refer to the creative sample code for how to upload assets and insert a creative.", + "properties": { + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "ID of the creative asset. This is a required field." + }, + "clickTags": { + "type": "array", + "description": "List of detected click tags for assets. This is a read-only auto-generated field.", + "items": { + "$ref": "ClickTag" + } + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "id": { + "type": "string", + "description": "Numeric ID of the asset. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the numeric ID of the asset. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeAssetMetadata\".", + "default": "dfareporting#creativeAssetMetadata" + }, + "warnedValidationRules": { + "type": "array", + "description": "Rules validated during code generation that generated a warning. This is a read-only, auto-generated field.\n\nPossible values are:\n- \"ADMOB_REFERENCED\"\n- \"ASSET_FORMAT_UNSUPPORTED_DCM\"\n- \"ASSET_INVALID\"\n- \"CLICK_TAG_HARD_CODED\"\n- \"CLICK_TAG_INVALID\"\n- \"CLICK_TAG_IN_GWD\"\n- \"CLICK_TAG_MISSING\"\n- \"CLICK_TAG_MORE_THAN_ONE\"\n- \"CLICK_TAG_NON_TOP_LEVEL\"\n- \"COMPONENT_UNSUPPORTED_DCM\"\n- \"ENABLER_UNSUPPORTED_METHOD_DCM\"\n- \"EXTERNAL_FILE_REFERENCED\"\n- \"FILE_DETAIL_EMPTY\"\n- \"FILE_TYPE_INVALID\"\n- \"GWD_PROPERTIES_INVALID\"\n- \"HTML5_FEATURE_UNSUPPORTED\"\n- \"LINKED_FILE_NOT_FOUND\"\n- \"MAX_FLASH_VERSION_11\"\n- \"MRAID_REFERENCED\"\n- \"NOT_SSL_COMPLIANT\"\n- \"ORPHANED_ASSET\"\n- \"PRIMARY_HTML_MISSING\"\n- \"SVG_INVALID\"\n- \"ZIP_INVALID\"", + "items": { + "type": "string", + "enum": [ + "ADMOB_REFERENCED", + "ASSET_FORMAT_UNSUPPORTED_DCM", + "ASSET_INVALID", + "CLICK_TAG_HARD_CODED", + "CLICK_TAG_INVALID", + "CLICK_TAG_IN_GWD", + "CLICK_TAG_MISSING", + "CLICK_TAG_MORE_THAN_ONE", + "CLICK_TAG_NON_TOP_LEVEL", + "COMPONENT_UNSUPPORTED_DCM", + "ENABLER_UNSUPPORTED_METHOD_DCM", + "EXTERNAL_FILE_REFERENCED", + "FILE_DETAIL_EMPTY", + "FILE_TYPE_INVALID", + "GWD_PROPERTIES_INVALID", + "HTML5_FEATURE_UNSUPPORTED", + "LINKED_FILE_NOT_FOUND", + "MAX_FLASH_VERSION_11", + "MRAID_REFERENCED", + "NOT_SSL_COMPLIANT", + "ORPHANED_ASSET", + "PRIMARY_HTML_MISSING", + "SVG_INVALID", + "ZIP_INVALID" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "CreativeAssetSelection": { + "id": "CreativeAssetSelection", + "type": "object", + "description": "Encapsulates the list of rules for asset selection and a default asset in case none of the rules match. Applicable to INSTREAM_VIDEO creatives.", + "properties": { + "defaultAssetId": { + "type": "string", + "description": "A creativeAssets[].id. This should refer to one of the parent assets in this creative, and will be served if none of the rules match. This is a required field.", + "format": "int64" + }, + "rules": { + "type": "array", + "description": "Rules determine which asset will be served to a viewer. Rules will be evaluated in the order in which they are stored in this list. This list must contain at least one rule. Applicable to INSTREAM_VIDEO creatives.", + "items": { + "$ref": "Rule" + } + } + } + }, + "CreativeAssignment": { + "id": "CreativeAssignment", + "type": "object", + "description": "Creative Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this creative assignment is active. When true, the creative will be included in the ad's rotation." + }, + "applyEventTags": { + "type": "boolean", + "description": "Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of the creative assignment." + }, + "companionCreativeOverrides": { + "type": "array", + "description": "Companion creative overrides for this creative assignment. Applicable to video ads.", + "items": { + "$ref": "CompanionClickThroughOverride" + } + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeId": { + "type": "string", + "description": "ID of the creative to be assigned. This is a required field.", + "format": "int64" + }, + "creativeIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the creative. This is a read-only, auto-generated field." + }, + "endTime": { + "type": "string", + "description": "Date and time that the assigned creative should stop serving. Must be later than the start time.", + "format": "date-time" + }, + "richMediaExitOverrides": { + "type": "array", + "description": "Rich media exit overrides for this creative assignment.\nApplicable when the creative type is any of the following: \n- DISPLAY\n- RICH_MEDIA_INPAGE\n- RICH_MEDIA_INPAGE_FLOATING\n- RICH_MEDIA_IM_EXPAND\n- RICH_MEDIA_EXPANDING\n- RICH_MEDIA_INTERSTITIAL_FLOAT\n- RICH_MEDIA_MOBILE_IN_APP\n- RICH_MEDIA_MULTI_FLOATING\n- RICH_MEDIA_PEEL_DOWN\n- VPAID_LINEAR\n- VPAID_NON_LINEAR", + "items": { + "$ref": "RichMediaExitOverride" + } + }, + "sequence": { + "type": "integer", + "description": "Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to 65535, inclusive.", + "format": "int32" + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that the assigned creative should start serving.", + "format": "date-time" + }, + "weight": { + "type": "integer", + "description": "Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1.", + "format": "int32" + } + } + }, + "CreativeCustomEvent": { + "id": "CreativeCustomEvent", + "type": "object", + "description": "Creative Custom Event.", + "properties": { + "advertiserCustomEventId": { + "type": "string", + "description": "Unique ID of this event used by DDM Reporting and Data Transfer. This is a read-only field.", + "format": "int64" + }, + "advertiserCustomEventName": { + "type": "string", + "description": "User-entered name for the event." + }, + "advertiserCustomEventType": { + "type": "string", + "description": "Type of the event. This is a read-only field.", + "enum": [ + "ADVERTISER_EVENT_COUNTER", + "ADVERTISER_EVENT_EXIT", + "ADVERTISER_EVENT_TIMER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "artworkLabel": { + "type": "string", + "description": "Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion." + }, + "artworkType": { + "type": "string", + "description": "Artwork type used by the creative.This is a read-only field.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_IMAGE", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "exitUrl": { + "type": "string", + "description": "Exit URL of the event. This field is used only for exit events." + }, + "id": { + "type": "string", + "description": "ID of this event. This is a required field and should not be modified after insertion.", + "format": "int64" + }, + "popupWindowProperties": { + "$ref": "PopupWindowProperties", + "description": "Properties for rich media popup windows. This field is used only for exit events." + }, + "targetType": { + "type": "string", + "description": "Target type used by the event.", + "enum": [ + "TARGET_BLANK", + "TARGET_PARENT", + "TARGET_POPUP", + "TARGET_SELF", + "TARGET_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "videoReportingId": { + "type": "string", + "description": "Video reporting ID, used to differentiate multiple videos in a single creative. This is a read-only field." + } + } + }, + "CreativeField": { + "id": "CreativeField", + "type": "object", + "description": "Contains properties of a creative field.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative field. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this creative field. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeField\".", + "default": "dfareporting#creativeField" + }, + "name": { + "type": "string", + "description": "Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeFieldAssignment": { + "id": "CreativeFieldAssignment", + "type": "object", + "description": "Creative Field Assignment.", + "properties": { + "creativeFieldId": { + "type": "string", + "description": "ID of the creative field.", + "format": "int64" + }, + "creativeFieldValueId": { + "type": "string", + "description": "ID of the creative field value.", + "format": "int64" + } + } + }, + "CreativeFieldValue": { + "id": "CreativeFieldValue", + "type": "object", + "description": "Contains properties of a creative field value.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative field value. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValue\".", + "default": "dfareporting#creativeFieldValue" + }, + "value": { + "type": "string", + "description": "Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field." + } + } + }, + "CreativeFieldValuesListResponse": { + "id": "CreativeFieldValuesListResponse", + "type": "object", + "description": "Creative Field Value List Response", + "properties": { + "creativeFieldValues": { + "type": "array", + "description": "Creative field value collection.", + "items": { + "$ref": "CreativeFieldValue" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValuesListResponse\".", + "default": "dfareporting#creativeFieldValuesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeFieldsListResponse": { + "id": "CreativeFieldsListResponse", + "type": "object", + "description": "Creative Field List Response", + "properties": { + "creativeFields": { + "type": "array", + "description": "Creative field collection.", + "items": { + "$ref": "CreativeField" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldsListResponse\".", + "default": "dfareporting#creativeFieldsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeGroup": { + "id": "CreativeGroup", + "type": "object", + "description": "Contains properties of a creative group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "groupNumber": { + "type": "integer", + "description": "Subgroup of the creative group. Assign your creative groups to a subgroup in order to filter or manage them more easily. This field is required on insertion and is read-only after insertion. Acceptable values are 1 to 2, inclusive.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this creative group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroup\".", + "default": "dfareporting#creativeGroup" + }, + "name": { + "type": "string", + "description": "Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeGroupAssignment": { + "id": "CreativeGroupAssignment", + "type": "object", + "description": "Creative Group Assignment.", + "properties": { + "creativeGroupId": { + "type": "string", + "description": "ID of the creative group to be assigned.", + "format": "int64" + }, + "creativeGroupNumber": { + "type": "string", + "description": "Creative group number of the creative group assignment.", + "enum": [ + "CREATIVE_GROUP_ONE", + "CREATIVE_GROUP_TWO" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "CreativeGroupsListResponse": { + "id": "CreativeGroupsListResponse", + "type": "object", + "description": "Creative Group List Response", + "properties": { + "creativeGroups": { + "type": "array", + "description": "Creative group collection.", + "items": { + "$ref": "CreativeGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroupsListResponse\".", + "default": "dfareporting#creativeGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeOptimizationConfiguration": { + "id": "CreativeOptimizationConfiguration", + "type": "object", + "description": "Creative optimization settings.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this creative optimization config. This is a required field and must be less than 129 characters long." + }, + "optimizationActivitys": { + "type": "array", + "description": "List of optimization activities associated with this configuration.", + "items": { + "$ref": "OptimizationActivity" + } + }, + "optimizationModel": { + "type": "string", + "description": "Optimization model for this configuration.", + "enum": [ + "CLICK", + "POST_CLICK", + "POST_CLICK_AND_IMPRESSION", + "POST_IMPRESSION", + "VIDEO_COMPLETION" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "CreativeRotation": { + "id": "CreativeRotation", + "type": "object", + "description": "Creative Rotation.", + "properties": { + "creativeAssignments": { + "type": "array", + "description": "Creative assignments in this creative rotation.", + "items": { + "$ref": "CreativeAssignment" + } + }, + "creativeOptimizationConfigurationId": { + "type": "string", + "description": "Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of creative rotation. Can be used to specify whether to use sequential or random rotation.", + "enum": [ + "CREATIVE_ROTATION_TYPE_RANDOM", + "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "weightCalculationStrategy": { + "type": "string", + "description": "Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM.", + "enum": [ + "WEIGHT_STRATEGY_CUSTOM", + "WEIGHT_STRATEGY_EQUAL", + "WEIGHT_STRATEGY_HIGHEST_CTR", + "WEIGHT_STRATEGY_OPTIMIZED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeSettings": { + "id": "CreativeSettings", + "type": "object", + "description": "Creative Settings", + "properties": { + "iFrameFooter": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + }, + "iFrameHeader": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + } + } + }, + "CreativesListResponse": { + "id": "CreativesListResponse", + "type": "object", + "description": "Creative List Response", + "properties": { + "creatives": { + "type": "array", + "description": "Creative collection.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativesListResponse\".", + "default": "dfareporting#creativesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CrossDimensionReachReportCompatibleFields": { + "id": "CrossDimensionReachReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"CROSS_DIMENSION_REACH\".", + "properties": { + "breakdown": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"breakdown\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#crossDimensionReachReportCompatibleFields.", + "default": "dfareporting#crossDimensionReachReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "overlapMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"overlapMetricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "CustomFloodlightVariable": { + "id": "CustomFloodlightVariable", + "type": "object", + "description": "A custom floodlight variable.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#customFloodlightVariable\".", + "default": "dfareporting#customFloodlightVariable" + }, + "type": { + "type": "string", + "description": "The type of custom floodlight variable to supply a value for. These map to the \"u[1-20]=\" in the tags.", + "enum": [ + "U1", + "U10", + "U100", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U21", + "U22", + "U23", + "U24", + "U25", + "U26", + "U27", + "U28", + "U29", + "U3", + "U30", + "U31", + "U32", + "U33", + "U34", + "U35", + "U36", + "U37", + "U38", + "U39", + "U4", + "U40", + "U41", + "U42", + "U43", + "U44", + "U45", + "U46", + "U47", + "U48", + "U49", + "U5", + "U50", + "U51", + "U52", + "U53", + "U54", + "U55", + "U56", + "U57", + "U58", + "U59", + "U6", + "U60", + "U61", + "U62", + "U63", + "U64", + "U65", + "U66", + "U67", + "U68", + "U69", + "U7", + "U70", + "U71", + "U72", + "U73", + "U74", + "U75", + "U76", + "U77", + "U78", + "U79", + "U8", + "U80", + "U81", + "U82", + "U83", + "U84", + "U85", + "U86", + "U87", + "U88", + "U89", + "U9", + "U90", + "U91", + "U92", + "U93", + "U94", + "U95", + "U96", + "U97", + "U98", + "U99" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "The value of the custom floodlight variable. The length of string must not exceed 50 characters." + } + } + }, + "CustomRichMediaEvents": { + "id": "CustomRichMediaEvents", + "type": "object", + "description": "Represents a Custom Rich Media Events group.", + "properties": { + "filteredEventIds": { + "type": "array", + "description": "List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#customRichMediaEvents.", + "default": "dfareporting#customRichMediaEvents" + } + } + }, + "DateRange": { + "id": "DateRange", + "type": "object", + "description": "Represents a date range.", + "properties": { + "endDate": { + "type": "string", + "description": "The end date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dateRange.", + "default": "dfareporting#dateRange" + }, + "relativeDateRange": { + "type": "string", + "description": "The date range relative to the date of when the report is run.", + "enum": [ + "LAST_24_MONTHS", + "LAST_30_DAYS", + "LAST_365_DAYS", + "LAST_7_DAYS", + "LAST_90_DAYS", + "MONTH_TO_DATE", + "PREVIOUS_MONTH", + "PREVIOUS_QUARTER", + "PREVIOUS_WEEK", + "PREVIOUS_YEAR", + "QUARTER_TO_DATE", + "TODAY", + "WEEK_TO_DATE", + "YEAR_TO_DATE", + "YESTERDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "DayPartTargeting": { + "id": "DayPartTargeting", + "type": "object", + "description": "Day Part Targeting.", + "properties": { + "daysOfWeek": { + "type": "array", + "description": "Days of the week when the ad will serve.\n\nAcceptable values are:\n- \"SUNDAY\"\n- \"MONDAY\"\n- \"TUESDAY\"\n- \"WEDNESDAY\"\n- \"THURSDAY\"\n- \"FRIDAY\"\n- \"SATURDAY\"", + "items": { + "type": "string", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "hoursOfDay": { + "type": "array", + "description": "Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with days of week, in which case the ad would serve during these hours on the specified days. For example if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "userLocalTime": { + "type": "boolean", + "description": "Whether or not to use the user's local time. If false, the America/New York time zone applies." + } + } + }, + "DefaultClickThroughEventTagProperties": { + "id": "DefaultClickThroughEventTagProperties", + "type": "object", + "description": "Properties of inheriting and overriding the default click-through event tag. A campaign may override the event tag defined at the advertiser level, and an ad may also override the campaign's setting further.", + "properties": { + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply to all ads in this entity's scope.", + "format": "int64" + }, + "overrideInheritedEventTag": { + "type": "boolean", + "description": "Whether this entity should override the inherited default click-through event tag with its own defined value." + } + } + }, + "DeliverySchedule": { + "id": "DeliverySchedule", + "type": "object", + "description": "Delivery Schedule.", + "properties": { + "frequencyCap": { + "$ref": "FrequencyCap", + "description": "Limit on the number of times an individual user can be served the ad within a specified period of time." + }, + "hardCutoff": { + "type": "boolean", + "description": "Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it has reached its delivery goals." + }, + "impressionRatio": { + "type": "string", + "description": "Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Acceptable values are 1 to 10, inclusive.", + "format": "int64" + }, + "priority": { + "type": "string", + "description": "Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served.", + "enum": [ + "AD_PRIORITY_01", + "AD_PRIORITY_02", + "AD_PRIORITY_03", + "AD_PRIORITY_04", + "AD_PRIORITY_05", + "AD_PRIORITY_06", + "AD_PRIORITY_07", + "AD_PRIORITY_08", + "AD_PRIORITY_09", + "AD_PRIORITY_10", + "AD_PRIORITY_11", + "AD_PRIORITY_12", + "AD_PRIORITY_13", + "AD_PRIORITY_14", + "AD_PRIORITY_15", + "AD_PRIORITY_16" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "DfpSettings": { + "id": "DfpSettings", + "type": "object", + "description": "DFP Settings", + "properties": { + "dfpNetworkCode": { + "type": "string", + "description": "DFP network code for this directory site." + }, + "dfpNetworkName": { + "type": "string", + "description": "DFP network name for this directory site." + }, + "programmaticPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts programmatic placements." + }, + "pubPaidPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts publisher-paid tags." + }, + "publisherPortalOnly": { + "type": "boolean", + "description": "Whether this directory site is available only via DoubleClick Publisher Portal." + } + } + }, + "Dimension": { + "id": "Dimension", + "type": "object", + "description": "Represents a dimension.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimension.", + "default": "dfareporting#dimension" + }, + "name": { + "type": "string", + "description": "The dimension name, e.g. dfa:advertiser" + } + } + }, + "DimensionFilter": { + "id": "DimensionFilter", + "type": "object", + "description": "Represents a dimension filter.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension to filter." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionFilter.", + "default": "dfareporting#dimensionFilter" + }, + "value": { + "type": "string", + "description": "The value of the dimension to filter." + } + } + }, + "DimensionValue": { + "id": "DimensionValue", + "type": "object", + "description": "Represents a DimensionValue resource.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID associated with the value if available." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#dimensionValue.", + "default": "dfareporting#dimensionValue" + }, + "matchType": { + "type": "string", + "description": "Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.", + "enum": [ + "BEGINS_WITH", + "CONTAINS", + "EXACT", + "WILDCARD_EXPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "The value of the dimension." + } + } + }, + "DimensionValueList": { + "id": "DimensionValueList", + "type": "object", + "description": "Represents the list of DimensionValue resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The dimension values returned in this response.", + "items": { + "$ref": "DimensionValue" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#dimensionValueList.", + "default": "dfareporting#dimensionValueList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "DimensionValueRequest": { + "id": "DimensionValueRequest", + "type": "object", + "description": "Represents a DimensionValuesRequest.", + "properties": { + "dimensionName": { + "type": "string", + "description": "The name of the dimension for which values should be requested.", + "annotations": { + "required": [ + "dfareporting.dimensionValues.query" + ] + } + }, + "endDate": { + "type": "string", + "description": "The end date of the date range for which to retrieve dimension values. A string of the format \"yyyy-MM-dd\".", + "format": "date", + "annotations": { + "required": [ + "dfareporting.dimensionValues.query" + ] + } + }, + "filters": { + "type": "array", + "description": "The list of filters by which to filter values. The filters are ANDed.", + "items": { + "$ref": "DimensionFilter" + } + }, + "kind": { + "type": "string", + "description": "The kind of request this is, in this case dfareporting#dimensionValueRequest.", + "default": "dfareporting#dimensionValueRequest" + }, + "startDate": { + "type": "string", + "description": "The start date of the date range for which to retrieve dimension values. A string of the format \"yyyy-MM-dd\".", + "format": "date", + "annotations": { + "required": [ + "dfareporting.dimensionValues.query" + ] + } + } + } + }, + "DirectorySite": { + "id": "DirectorySite", + "type": "object", + "description": "DirectorySites contains properties of a website from the Site Directory. Sites need to be added to an account via the Sites resource before they can be assigned to a placement.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this directory site is active." + }, + "contactAssignments": { + "type": "array", + "description": "Directory site contacts.", + "items": { + "$ref": "DirectorySiteContactAssignment" + } + }, + "countryId": { + "type": "string", + "description": "Country ID of this directory site. This is a read-only field.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "Currency ID of this directory site. This is a read-only field.\nPossible values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ \n- \"37\" for PLN \n- \"39\" for INR \n- \"40\" for THB \n- \"41\" for IDR \n- \"42\" for CZK \n- \"43\" for RON \n- \"44\" for HUF \n- \"45\" for RUB \n- \"46\" for AED \n- \"47\" for BGN \n- \"48\" for HRK \n- \"49\" for MXN", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this directory site. This is a read-only field." + }, + "id": { + "type": "string", + "description": "ID of this directory site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this directory site. This is a read-only, auto-generated field." + }, + "inpageTagFormats": { + "type": "array", + "description": "Tag types for regular placements.\n\nAcceptable values are:\n- \"STANDARD\"\n- \"IFRAME_JAVASCRIPT_INPAGE\"\n- \"INTERNAL_REDIRECT_INPAGE\"\n- \"JAVASCRIPT_INPAGE\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INPAGE", + "INTERNAL_REDIRECT_INPAGE", + "JAVASCRIPT_INPAGE", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "interstitialTagFormats": { + "type": "array", + "description": "Tag types for interstitial placements.\n\nAcceptable values are:\n- \"IFRAME_JAVASCRIPT_INTERSTITIAL\"\n- \"INTERNAL_REDIRECT_INTERSTITIAL\"\n- \"JAVASCRIPT_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INTERSTITIAL", + "INTERNAL_REDIRECT_INTERSTITIAL", + "JAVASCRIPT_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySite\".", + "default": "dfareporting#directorySite" + }, + "name": { + "type": "string", + "description": "Name of this directory site." + }, + "parentId": { + "type": "string", + "description": "Parent directory site ID.", + "format": "int64" + }, + "settings": { + "$ref": "DirectorySiteSettings", + "description": "Directory site settings." + }, + "url": { + "type": "string", + "description": "URL of this directory site." + } + } + }, + "DirectorySiteContact": { + "id": "DirectorySiteContact", + "type": "object", + "description": "Contains properties of a Site Directory contact.", + "properties": { + "address": { + "type": "string", + "description": "Address of this directory site contact." + }, + "email": { + "type": "string", + "description": "Email address of this directory site contact." + }, + "firstName": { + "type": "string", + "description": "First name of this directory site contact." + }, + "id": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContact\".", + "default": "dfareporting#directorySiteContact" + }, + "lastName": { + "type": "string", + "description": "Last name of this directory site contact." + }, + "phone": { + "type": "string", + "description": "Phone number of this directory site contact." + }, + "role": { + "type": "string", + "description": "Directory site contact role.", + "enum": [ + "ADMIN", + "EDIT", + "VIEW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "title": { + "type": "string", + "description": "Title or designation of this directory site contact." + }, + "type": { + "type": "string", + "description": "Directory site contact type.", + "enum": [ + "BILLING", + "OTHER", + "SALES", + "TECHNICAL" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "DirectorySiteContactAssignment": { + "id": "DirectorySiteContactAssignment", + "type": "object", + "description": "Directory Site Contact Assignment", + "properties": { + "contactId": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "visibility": { + "type": "string", + "description": "Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set to PRIVATE it is visible only to the site.", + "enum": [ + "PRIVATE", + "PUBLIC" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "DirectorySiteContactsListResponse": { + "id": "DirectorySiteContactsListResponse", + "type": "object", + "description": "Directory Site Contact List Response", + "properties": { + "directorySiteContacts": { + "type": "array", + "description": "Directory site contact collection", + "items": { + "$ref": "DirectorySiteContact" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContactsListResponse\".", + "default": "dfareporting#directorySiteContactsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "DirectorySiteSettings": { + "id": "DirectorySiteSettings", + "type": "object", + "description": "Directory Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view creatives." + }, + "dfpSettings": { + "$ref": "DfpSettings", + "description": "Directory site DFP settings." + }, + "instreamVideoPlacementAccepted": { + "type": "boolean", + "description": "Whether this site accepts in-stream video ads." + }, + "interstitialPlacementAccepted": { + "type": "boolean", + "description": "Whether this site accepts interstitial ads." + }, + "nielsenOcrOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled Nielsen OCR reach ratings." + }, + "verificationTagOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled generation of Verification ins tags." + }, + "videoActiveViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view for in-stream video creatives. This is a read-only field." + } + } + }, + "DirectorySitesListResponse": { + "id": "DirectorySitesListResponse", + "type": "object", + "description": "Directory Site List Response", + "properties": { + "directorySites": { + "type": "array", + "description": "Directory site collection.", + "items": { + "$ref": "DirectorySite" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySitesListResponse\".", + "default": "dfareporting#directorySitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "DynamicTargetingKey": { + "id": "DynamicTargetingKey", + "type": "object", + "description": "Contains properties of a dynamic targeting key. Dynamic targeting keys are unique, user-friendly labels, created at the advertiser level in DCM, that can be assigned to ads, creatives, and placements and used for targeting with DoubleClick Studio dynamic creatives. Use these labels instead of numeric DCM IDs (such as placement IDs) to save time and avoid errors in your dynamic feeds.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#dynamicTargetingKey\".", + "default": "dfareporting#dynamicTargetingKey" + }, + "name": { + "type": "string", + "description": "Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase." + }, + "objectId": { + "type": "string", + "description": "ID of the object of this dynamic targeting key. This is a required field.", + "format": "int64" + }, + "objectType": { + "type": "string", + "description": "Type of the object of this dynamic targeting key. This is a required field.", + "enum": [ + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_CREATIVE", + "OBJECT_PLACEMENT" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "DynamicTargetingKeysListResponse": { + "id": "DynamicTargetingKeysListResponse", + "type": "object", + "description": "Dynamic Targeting Key List Response", + "properties": { + "dynamicTargetingKeys": { + "type": "array", + "description": "Dynamic targeting key collection.", + "items": { + "$ref": "DynamicTargetingKey" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#dynamicTargetingKeysListResponse\".", + "default": "dfareporting#dynamicTargetingKeysListResponse" + } + } + }, + "EncryptionInfo": { + "id": "EncryptionInfo", + "type": "object", + "description": "A description of how user IDs are encrypted.", + "properties": { + "encryptionEntityId": { + "type": "string", + "description": "The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer.", + "format": "int64" + }, + "encryptionEntityType": { + "type": "string", + "description": "The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer.", + "enum": [ + "ADWORDS_CUSTOMER", + "DBM_ADVERTISER", + "DBM_PARTNER", + "DCM_ACCOUNT", + "DCM_ADVERTISER", + "ENCRYPTION_ENTITY_TYPE_UNKNOWN" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "encryptionSource": { + "type": "string", + "description": "Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer.", + "enum": [ + "AD_SERVING", + "DATA_TRANSFER", + "ENCRYPTION_SCOPE_UNKNOWN" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#encryptionInfo\".", + "default": "dfareporting#encryptionInfo" + } + } + }, + "EventTag": { + "id": "EventTag", + "type": "object", + "description": "Contains properties of an event tag.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this event tag. This field or the campaignId field is required on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this event tag. This field or the advertiserId field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "enabledByDefault": { + "type": "boolean", + "description": "Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads." + }, + "excludeFromAdxRequests": { + "type": "boolean", + "description": "Whether to remove this event tag from ads that are trafficked through DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag uses a pixel that is unapproved for Ad Exchange bids on one or more networks, such as the Google Display Network." + }, + "id": { + "type": "string", + "description": "ID of this event tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTag\".", + "default": "dfareporting#eventTag" + }, + "name": { + "type": "string", + "description": "Name of this event tag. This is a required field and must be less than 256 characters long." + }, + "siteFilterType": { + "type": "string", + "description": "Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites.", + "enum": [ + "BLACKLIST", + "WHITELIST" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "siteIds": { + "type": "array", + "description": "Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this tag is SSL-compliant or not. This is a read-only field." + }, + "status": { + "type": "string", + "description": "Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field.", + "enum": [ + "DISABLED", + "ENABLED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. This is a required field.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required on insertion." + }, + "urlEscapeLevels": { + "type": "integer", + "description": "Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through event tags as specified by the event tag type.", + "format": "int32" + } + } + }, + "EventTagOverride": { + "id": "EventTagOverride", + "type": "object", + "description": "Event tag override information.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether this override is enabled." + }, + "id": { + "type": "string", + "description": "ID of this event tag override. This is a read-only, auto-generated field.", + "format": "int64" + } + } + }, + "EventTagsListResponse": { + "id": "EventTagsListResponse", + "type": "object", + "description": "Event Tag List Response", + "properties": { + "eventTags": { + "type": "array", + "description": "Event tag collection.", + "items": { + "$ref": "EventTag" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTagsListResponse\".", + "default": "dfareporting#eventTagsListResponse" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A file contains the metadata for a report run. It shows the status of the run and holds the URLs to the generated report data if the run is finished and the status is \"REPORT_AVAILABLE\".", + "properties": { + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which the file has report data. The date range will always be the absolute date range for which the report is run." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The filename of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "id": { + "type": "string", + "description": "The unique ID of this report file.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#file.", + "default": "dfareporting#file" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp in milliseconds since epoch when this file was last modified.", + "format": "int64" + }, + "reportId": { + "type": "string", + "description": "The ID of the report this file was generated from.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "The status of the report file.", + "enum": [ + "CANCELLED", + "FAILED", + "PROCESSING", + "REPORT_AVAILABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "urls": { + "type": "object", + "description": "The URLs where the completed report file can be downloaded.", + "properties": { + "apiUrl": { + "type": "string", + "description": "The URL for downloading the report data through the API." + }, + "browserUrl": { + "type": "string", + "description": "The URL for downloading the report data through a browser." + } + } + } + } + }, + "FileList": { + "id": "FileList", + "type": "object", + "description": "Represents the list of File resources.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The files returned in this response.", + "items": { + "$ref": "File" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#fileList.", + "default": "dfareporting#fileList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through files. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "Flight": { + "id": "Flight", + "type": "object", + "description": "Flight", + "properties": { + "endDate": { + "type": "string", + "description": "Inventory item flight end date.", + "format": "date" + }, + "rateOrCost": { + "type": "string", + "description": "Rate or cost of this flight.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Inventory item flight start date.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this flight.", + "format": "int64" + } + } + }, + "FloodlightActivitiesGenerateTagResponse": { + "id": "FloodlightActivitiesGenerateTagResponse", + "type": "object", + "description": "Floodlight Activity GenerateTag Response", + "properties": { + "floodlightActivityTag": { + "type": "string", + "description": "Generated tag for this floodlight activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesGenerateTagResponse\".", + "default": "dfareporting#floodlightActivitiesGenerateTagResponse" + } + } + }, + "FloodlightActivitiesListResponse": { + "id": "FloodlightActivitiesListResponse", + "type": "object", + "description": "Floodlight Activity List Response", + "properties": { + "floodlightActivities": { + "type": "array", + "description": "Floodlight activity collection.", + "items": { + "$ref": "FloodlightActivity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesListResponse\".", + "default": "dfareporting#floodlightActivitiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivity": { + "id": "FloodlightActivity", + "type": "object", + "description": "Contains properties of a Floodlight activity.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "cacheBustingType": { + "type": "string", + "description": "Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.", + "enum": [ + "ACTIVE_SERVER_PAGE", + "COLD_FUSION", + "JAVASCRIPT", + "JSP", + "PHP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "countingMethod": { + "type": "string", + "description": "Counting method for conversions for this floodlight activity. This is a required field.", + "enum": [ + "ITEMS_SOLD_COUNTING", + "SESSION_COUNTING", + "STANDARD_COUNTING", + "TRANSACTIONS_COUNTING", + "UNIQUE_COUNTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "defaultTags": { + "type": "array", + "description": "Dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityDynamicTag" + } + }, + "expectedUrl": { + "type": "string", + "description": "URL where this tag will be deployed. If specified, must be less than 256 characters long." + }, + "floodlightActivityGroupId": { + "type": "string", + "description": "Floodlight activity group ID of this floodlight activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Name of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Tag string of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Type of the associated floodlight activity group. This is a read-only field.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's floodlight configuration or from the existing activity's floodlight configuration.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "hidden": { + "type": "boolean", + "description": "Whether this activity is archived." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether the image tag is enabled for this activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivity\".", + "default": "dfareporting#floodlightActivity" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes." + }, + "notes": { + "type": "string", + "description": "General notes or implementation instructions for the tag." + }, + "publisherTags": { + "type": "array", + "description": "Publisher dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityPublisherDynamicTag" + } + }, + "secure": { + "type": "boolean", + "description": "Whether this tag should use SSL." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this floodlight activity must be SSL-compliant." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagFormat": { + "type": "string", + "description": "Tag format type for the floodlight activity. If left blank, the tag format will default to HTML.", + "enum": [ + "HTML", + "XHTML" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "tagString": { + "type": "string", + "description": "Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activities of the same activity group. This field is read-only after insertion." + }, + "userDefinedVariableTypes": { + "type": "array", + "description": "List of the user-defined variables used by this conversion tag. These map to the \"u[1-100]=\" in the tags. Each of these can have a user defined type.\nAcceptable values are U1 to U100, inclusive.", + "items": { + "type": "string", + "enum": [ + "U1", + "U10", + "U100", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U21", + "U22", + "U23", + "U24", + "U25", + "U26", + "U27", + "U28", + "U29", + "U3", + "U30", + "U31", + "U32", + "U33", + "U34", + "U35", + "U36", + "U37", + "U38", + "U39", + "U4", + "U40", + "U41", + "U42", + "U43", + "U44", + "U45", + "U46", + "U47", + "U48", + "U49", + "U5", + "U50", + "U51", + "U52", + "U53", + "U54", + "U55", + "U56", + "U57", + "U58", + "U59", + "U6", + "U60", + "U61", + "U62", + "U63", + "U64", + "U65", + "U66", + "U67", + "U68", + "U69", + "U7", + "U70", + "U71", + "U72", + "U73", + "U74", + "U75", + "U76", + "U77", + "U78", + "U79", + "U8", + "U80", + "U81", + "U82", + "U83", + "U84", + "U85", + "U86", + "U87", + "U88", + "U89", + "U9", + "U90", + "U91", + "U92", + "U93", + "U94", + "U95", + "U96", + "U97", + "U98", + "U99" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "FloodlightActivityDynamicTag": { + "id": "FloodlightActivityDynamicTag", + "type": "object", + "description": "Dynamic Tag", + "properties": { + "id": { + "type": "string", + "description": "ID of this dynamic tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this tag." + }, + "tag": { + "type": "string", + "description": "Tag code." + } + } + }, + "FloodlightActivityGroup": { + "id": "FloodlightActivityGroup", + "type": "object", + "description": "Contains properties of a Floodlight activity group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's advertiser or from the existing activity group's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity group. This is a required field.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroup\".", + "default": "dfareporting#floodlightActivityGroup" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagString": { + "type": "string", + "description": "Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after insertion." + }, + "type": { + "type": "string", + "description": "Type of the floodlight activity group. This is a required field that is read-only after insertion.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "FloodlightActivityGroupsListResponse": { + "id": "FloodlightActivityGroupsListResponse", + "type": "object", + "description": "Floodlight Activity Group List Response", + "properties": { + "floodlightActivityGroups": { + "type": "array", + "description": "Floodlight activity group collection.", + "items": { + "$ref": "FloodlightActivityGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroupsListResponse\".", + "default": "dfareporting#floodlightActivityGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivityPublisherDynamicTag": { + "id": "FloodlightActivityPublisherDynamicTag", + "type": "object", + "description": "Publisher Dynamic Tag", + "properties": { + "clickThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for click-throughs." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is retrieved, only the siteId field will be populated.", + "format": "int64" + }, + "dynamicTag": { + "$ref": "FloodlightActivityDynamicTag", + "description": "Dynamic floodlight tag." + }, + "siteId": { + "type": "string", + "description": "Site ID of this dynamic tag.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "viewThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for view-throughs." + } + } + }, + "FloodlightConfiguration": { + "id": "FloodlightConfiguration", + "type": "object", + "description": "Contains properties of a Floodlight configuration.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of the parent advertiser of this floodlight configuration.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "analyticsDataSharingEnabled": { + "type": "boolean", + "description": "Whether advertiser data is shared with Google Analytics." + }, + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "firstDayOfWeek": { + "type": "string", + "description": "Day that will be counted as the first day of the week in reports. This is a required field.", + "enum": [ + "MONDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this floodlight configuration. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field." + }, + "inAppAttributionTrackingEnabled": { + "type": "boolean", + "description": "Whether in-app attribution tracking is enabled." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfiguration\".", + "default": "dfareporting#floodlightConfiguration" + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this floodlight configuration." + }, + "naturalSearchConversionAttributionOption": { + "type": "string", + "description": "Types of attribution options for natural search conversions.", + "enum": [ + "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "omnitureSettings": { + "$ref": "OmnitureSettings", + "description": "Settings for DCM Omniture integration." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagSettings": { + "$ref": "TagSettings", + "description": "Configuration settings for dynamic and image floodlight tags." + }, + "thirdPartyAuthenticationTokens": { + "type": "array", + "description": "List of third-party authentication tokens enabled for this configuration.", + "items": { + "$ref": "ThirdPartyAuthenticationToken" + } + }, + "userDefinedVariableConfigurations": { + "type": "array", + "description": "List of user defined variables enabled for this configuration.", + "items": { + "$ref": "UserDefinedVariableConfiguration" + } + } + } + }, + "FloodlightConfigurationsListResponse": { + "id": "FloodlightConfigurationsListResponse", + "type": "object", + "description": "Floodlight Configuration List Response", + "properties": { + "floodlightConfigurations": { + "type": "array", + "description": "Floodlight configuration collection.", + "items": { + "$ref": "FloodlightConfiguration" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfigurationsListResponse\".", + "default": "dfareporting#floodlightConfigurationsListResponse" + } + } + }, + "FloodlightReportCompatibleFields": { + "id": "FloodlightReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"FlOODLIGHT\".", + "properties": { + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensions": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#floodlightReportCompatibleFields.", + "default": "dfareporting#floodlightReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "FrequencyCap": { + "id": "FrequencyCap", + "type": "object", + "description": "Frequency Cap.", + "properties": { + "duration": { + "type": "string", + "description": "Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days. Acceptable values are 1 to 7776000, inclusive.", + "format": "int64" + }, + "impressions": { + "type": "string", + "description": "Number of times an individual user can be served the ad within the specified duration. Acceptable values are 1 to 15, inclusive.", + "format": "int64" + } + } + }, + "FsCommand": { + "id": "FsCommand", + "type": "object", + "description": "FsCommand.", + "properties": { + "left": { + "type": "integer", + "description": "Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "positionOption": { + "type": "string", + "description": "Position in the browser where the window will open.", + "enum": [ + "CENTERED", + "DISTANCE_FROM_TOP_LEFT_CORNER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "top": { + "type": "integer", + "description": "Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "windowHeight": { + "type": "integer", + "description": "Height of the window.", + "format": "int32" + }, + "windowWidth": { + "type": "integer", + "description": "Width of the window.", + "format": "int32" + } + } + }, + "GeoTargeting": { + "id": "GeoTargeting", + "type": "object", + "description": "Geographical Targeting.", + "properties": { + "cities": { + "type": "array", + "description": "Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city.", + "items": { + "$ref": "City" + } + }, + "countries": { + "type": "array", + "description": "Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, metros, or postal codes in the same country.", + "items": { + "$ref": "Country" + } + }, + "excludeCountries": { + "type": "boolean", + "description": "Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted by the ad." + }, + "metros": { + "type": "array", + "description": "Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a metro, do not target or exclude the country of the metro.", + "items": { + "$ref": "Metro" + } + }, + "postalCodes": { + "type": "array", + "description": "Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a postal code, do not target or exclude the country of the postal code.", + "items": { + "$ref": "PostalCode" + } + }, + "regions": { + "type": "array", + "description": "Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a region, do not target or exclude the country of the region.", + "items": { + "$ref": "Region" + } + } + } + }, + "InventoryItem": { + "id": "InventoryItem", + "type": "object", + "description": "Represents a buy from the DoubleClick Planning inventory store.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this inventory item.", + "format": "int64" + }, + "adSlots": { + "type": "array", + "description": "Ad slots of this inventory item. If this inventory item represents a standalone placement, there will be exactly one ad slot. If this inventory item represents a placement group, there will be more than one ad slot, each representing one child placement in that placement group.", + "items": { + "$ref": "AdSlot" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this inventory item.", + "format": "int64" + }, + "contentCategoryId": { + "type": "string", + "description": "Content category ID of this inventory item.", + "format": "int64" + }, + "estimatedClickThroughRate": { + "type": "string", + "description": "Estimated click-through rate of this inventory item.", + "format": "int64" + }, + "estimatedConversionRate": { + "type": "string", + "description": "Estimated conversion rate of this inventory item.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this inventory item.", + "format": "int64" + }, + "inPlan": { + "type": "boolean", + "description": "Whether this inventory item is in plan." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#inventoryItem\".", + "default": "dfareporting#inventoryItem" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this inventory item." + }, + "name": { + "type": "string", + "description": "Name of this inventory item. For standalone inventory items, this is the same name as that of its only ad slot. For group inventory items, this can differ from the name of any of its ad slots." + }, + "negotiationChannelId": { + "type": "string", + "description": "Negotiation channel ID of this inventory item.", + "format": "int64" + }, + "orderId": { + "type": "string", + "description": "Order ID of this inventory item.", + "format": "int64" + }, + "placementStrategyId": { + "type": "string", + "description": "Placement strategy ID of this inventory item.", + "format": "int64" + }, + "pricing": { + "$ref": "Pricing", + "description": "Pricing of this inventory item." + }, + "projectId": { + "type": "string", + "description": "Project ID of this inventory item.", + "format": "int64" + }, + "rfpId": { + "type": "string", + "description": "RFP ID of this inventory item.", + "format": "int64" + }, + "siteId": { + "type": "string", + "description": "ID of the site this inventory item is associated with.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this inventory item.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of inventory item.", + "enum": [ + "PLANNING_PLACEMENT_TYPE_CREDIT", + "PLANNING_PLACEMENT_TYPE_REGULAR" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "InventoryItemsListResponse": { + "id": "InventoryItemsListResponse", + "type": "object", + "description": "Inventory item List Response", + "properties": { + "inventoryItems": { + "type": "array", + "description": "Inventory item collection", + "items": { + "$ref": "InventoryItem" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#inventoryItemsListResponse\".", + "default": "dfareporting#inventoryItemsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "KeyValueTargetingExpression": { + "id": "KeyValueTargetingExpression", + "type": "object", + "description": "Key Value Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Keyword expression being targeted by the ad." + } + } + }, + "LandingPage": { + "id": "LandingPage", + "type": "object", + "description": "Contains information about where a user's browser is taken after the user clicks an ad.", + "properties": { + "default": { + "type": "boolean", + "description": "Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing page is allowed per campaign." + }, + "id": { + "type": "string", + "description": "ID of this landing page. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPage\".", + "default": "dfareporting#landingPage" + }, + "name": { + "type": "string", + "description": "Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same campaign." + }, + "url": { + "type": "string", + "description": "URL of this landing page. This is a required field." + } + } + }, + "LandingPagesListResponse": { + "id": "LandingPagesListResponse", + "type": "object", + "description": "Landing Page List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPagesListResponse\".", + "default": "dfareporting#landingPagesListResponse" + }, + "landingPages": { + "type": "array", + "description": "Landing page collection", + "items": { + "$ref": "LandingPage" + } + } + } + }, + "Language": { + "id": "Language", + "type": "object", + "description": "Contains information about a language that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "Language ID of this language. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#language\".", + "default": "dfareporting#language" + }, + "languageCode": { + "type": "string", + "description": "Format of language code is an ISO 639 two-letter language code optionally followed by an underscore followed by an ISO 3166 code. Examples are \"en\" for English or \"zh_CN\" for Simplified Chinese." + }, + "name": { + "type": "string", + "description": "Name of this language." + } + } + }, + "LanguageTargeting": { + "id": "LanguageTargeting", + "type": "object", + "description": "Language Targeting.", + "properties": { + "languages": { + "type": "array", + "description": "Languages that this ad targets. For each language only languageId is required. The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "Language" + } + } + } + }, + "LanguagesListResponse": { + "id": "LanguagesListResponse", + "type": "object", + "description": "Language List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#languagesListResponse\".", + "default": "dfareporting#languagesListResponse" + }, + "languages": { + "type": "array", + "description": "Language collection.", + "items": { + "$ref": "Language" + } + } + } + }, + "LastModifiedInfo": { + "id": "LastModifiedInfo", + "type": "object", + "description": "Modification timestamp.", + "properties": { + "time": { + "type": "string", + "description": "Timestamp of the last change in milliseconds since epoch.", + "format": "int64" + } + } + }, + "ListPopulationClause": { + "id": "ListPopulationClause", + "type": "object", + "description": "A group clause made up of list population terms representing constraints joined by ORs.", + "properties": { + "terms": { + "type": "array", + "description": "Terms of this list population clause. Each clause is made up of list population terms representing constraints and are joined by ORs.", + "items": { + "$ref": "ListPopulationTerm" + } + } + } + }, + "ListPopulationRule": { + "id": "ListPopulationRule", + "type": "object", + "description": "Remarketing List Population Rule.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this rule. This field can be left blank.", + "format": "int64" + }, + "floodlightActivityName": { + "type": "string", + "description": "Name of floodlight activity associated with this rule. This is a read-only, auto-generated field." + }, + "listPopulationClauses": { + "type": "array", + "description": "Clauses that make up this list population rule. Clauses are joined by ANDs, and the clauses themselves are made up of list population terms which are joined by ORs.", + "items": { + "$ref": "ListPopulationClause" + } + } + } + }, + "ListPopulationTerm": { + "id": "ListPopulationTerm", + "type": "object", + "description": "Remarketing List Population Rule Term.", + "properties": { + "contains": { + "type": "boolean", + "description": "Will be true if the term should check if the user is in the list and false if the term should check if the user is not in the list. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. False by default." + }, + "negation": { + "type": "boolean", + "description": "Whether to negate the comparison result of this term during rule evaluation. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM." + }, + "operator": { + "type": "string", + "description": "Comparison operator of this term. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.", + "enum": [ + "NUM_EQUALS", + "NUM_GREATER_THAN", + "NUM_GREATER_THAN_EQUAL", + "NUM_LESS_THAN", + "NUM_LESS_THAN_EQUAL", + "STRING_CONTAINS", + "STRING_EQUALS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "remarketingListId": { + "type": "string", + "description": "ID of the list in question. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "List population term type determines the applicable fields in this object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, variableFriendlyName, operator, value, and negation are applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. If set to REFERRER_TERM then operator, value, and negation are applicable.", + "enum": [ + "CUSTOM_VARIABLE_TERM", + "LIST_MEMBERSHIP_TERM", + "REFERRER_TERM" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "Literal to compare the variable to. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM." + }, + "variableFriendlyName": { + "type": "string", + "description": "Friendly name of this term's variable. This is a read-only, auto-generated field. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM." + }, + "variableName": { + "type": "string", + "description": "Name of the variable (U1, U2, etc.) being compared in this term. This field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or REFERRER_TERM." + } + } + }, + "ListTargetingExpression": { + "id": "ListTargetingExpression", + "type": "object", + "description": "Remarketing List Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Expression describing which lists are being targeted by the ad." + } + } + }, + "LookbackConfiguration": { + "id": "LookbackConfiguration", + "type": "object", + "description": "Lookback configuration settings.", + "properties": { + "clickDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, inclusive.", + "format": "int32" + }, + "postImpressionActivitiesDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, inclusive.", + "format": "int32" + } + } + }, + "Metric": { + "id": "Metric", + "type": "object", + "description": "Represents a metric.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#metric.", + "default": "dfareporting#metric" + }, + "name": { + "type": "string", + "description": "The metric name, e.g. dfa:impressions" + } + } + }, + "Metro": { + "id": "Metro", + "type": "object", + "description": "Contains information about a metro region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this metro region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this metro region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this metro region.", + "format": "int64" + }, + "dmaId": { + "type": "string", + "description": "DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metro\".", + "default": "dfareporting#metro" + }, + "metroCode": { + "type": "string", + "description": "Metro code of this metro region. This is equivalent to dma_id." + }, + "name": { + "type": "string", + "description": "Name of this metro region." + } + } + }, + "MetrosListResponse": { + "id": "MetrosListResponse", + "type": "object", + "description": "Metro List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metrosListResponse\".", + "default": "dfareporting#metrosListResponse" + }, + "metros": { + "type": "array", + "description": "Metro collection.", + "items": { + "$ref": "Metro" + } + } + } + }, + "MobileCarrier": { + "id": "MobileCarrier", + "type": "object", + "description": "Contains information about a mobile carrier that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this mobile carrier belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this mobile carrier belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this mobile carrier.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarrier\".", + "default": "dfareporting#mobileCarrier" + }, + "name": { + "type": "string", + "description": "Name of this mobile carrier." + } + } + }, + "MobileCarriersListResponse": { + "id": "MobileCarriersListResponse", + "type": "object", + "description": "Mobile Carrier List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarriersListResponse\".", + "default": "dfareporting#mobileCarriersListResponse" + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carrier collection.", + "items": { + "$ref": "MobileCarrier" + } + } + } + }, + "ObjectFilter": { + "id": "ObjectFilter", + "type": "object", + "description": "Object Filter.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#objectFilter\".", + "default": "dfareporting#objectFilter" + }, + "objectIds": { + "type": "array", + "description": "Applicable when status is ASSIGNED. The user has access to objects with these object IDs.", + "items": { + "type": "string", + "format": "int64" + } + }, + "status": { + "type": "string", + "description": "Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has access to the objects with IDs in the objectIds list.", + "enum": [ + "ALL", + "ASSIGNED", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "OffsetPosition": { + "id": "OffsetPosition", + "type": "object", + "description": "Offset Position.", + "properties": { + "left": { + "type": "integer", + "description": "Offset distance from left side of an asset or a window.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "Offset distance from top side of an asset or a window.", + "format": "int32" + } + } + }, + "OmnitureSettings": { + "id": "OmnitureSettings", + "type": "object", + "description": "Omniture Integration Settings.", + "properties": { + "omnitureCostDataEnabled": { + "type": "boolean", + "description": "Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true." + }, + "omnitureIntegrationEnabled": { + "type": "boolean", + "description": "Whether Omniture integration is enabled. This property can be enabled only when the \"Advanced Ad Serving\" account setting is enabled." + } + } + }, + "OperatingSystem": { + "id": "OperatingSystem", + "type": "object", + "description": "Contains information about an operating system that can be targeted by ads.", + "properties": { + "dartId": { + "type": "string", + "description": "DART ID of this operating system. This is the ID used for targeting.", + "format": "int64" + }, + "desktop": { + "type": "boolean", + "description": "Whether this operating system is for desktop." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystem\".", + "default": "dfareporting#operatingSystem" + }, + "mobile": { + "type": "boolean", + "description": "Whether this operating system is for mobile." + }, + "name": { + "type": "string", + "description": "Name of this operating system." + } + } + }, + "OperatingSystemVersion": { + "id": "OperatingSystemVersion", + "type": "object", + "description": "Contains information about a particular version of an operating system that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this operating system version.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersion\".", + "default": "dfareporting#operatingSystemVersion" + }, + "majorVersion": { + "type": "string", + "description": "Major version (leftmost number) of this operating system version." + }, + "minorVersion": { + "type": "string", + "description": "Minor version (number after the first dot) of this operating system version." + }, + "name": { + "type": "string", + "description": "Name of this operating system version." + }, + "operatingSystem": { + "$ref": "OperatingSystem", + "description": "Operating system of this operating system version." + } + } + }, + "OperatingSystemVersionsListResponse": { + "id": "OperatingSystemVersionsListResponse", + "type": "object", + "description": "Operating System Version List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersionsListResponse\".", + "default": "dfareporting#operatingSystemVersionsListResponse" + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system version collection.", + "items": { + "$ref": "OperatingSystemVersion" + } + } + } + }, + "OperatingSystemsListResponse": { + "id": "OperatingSystemsListResponse", + "type": "object", + "description": "Operating System List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemsListResponse\".", + "default": "dfareporting#operatingSystemsListResponse" + }, + "operatingSystems": { + "type": "array", + "description": "Operating system collection.", + "items": { + "$ref": "OperatingSystem" + } + } + } + }, + "OptimizationActivity": { + "id": "OptimizationActivity", + "type": "object", + "description": "Creative optimization activity.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID of this optimization activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field." + }, + "weight": { + "type": "integer", + "description": "Weight associated with this optimization. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities. Value must be greater than or equal to 1.", + "format": "int32" + } + } + }, + "Order": { + "id": "Order", + "type": "object", + "description": "Describes properties of a DoubleClick Planning order.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this order.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this order.", + "format": "int64" + }, + "approverUserProfileIds": { + "type": "array", + "description": "IDs for users that have to approve documents created for this order.", + "items": { + "type": "string", + "format": "int64" + } + }, + "buyerInvoiceId": { + "type": "string", + "description": "Buyer invoice ID associated with this order." + }, + "buyerOrganizationName": { + "type": "string", + "description": "Name of the buyer organization." + }, + "comments": { + "type": "string", + "description": "Comments in this order." + }, + "contacts": { + "type": "array", + "description": "Contacts for this order.", + "items": { + "$ref": "OrderContact" + } + }, + "id": { + "type": "string", + "description": "ID of this order. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#order\".", + "default": "dfareporting#order" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this order." + }, + "name": { + "type": "string", + "description": "Name of this order." + }, + "notes": { + "type": "string", + "description": "Notes of this order." + }, + "planningTermId": { + "type": "string", + "description": "ID of the terms and conditions template used in this order.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Project ID of this order.", + "format": "int64" + }, + "sellerOrderId": { + "type": "string", + "description": "Seller order ID associated with this order." + }, + "sellerOrganizationName": { + "type": "string", + "description": "Name of the seller organization." + }, + "siteId": { + "type": "array", + "description": "Site IDs this order is associated with.", + "items": { + "type": "string", + "format": "int64" + } + }, + "siteNames": { + "type": "array", + "description": "Free-form site names this order is associated with.", + "items": { + "type": "string" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this order.", + "format": "int64" + }, + "termsAndConditions": { + "type": "string", + "description": "Terms and conditions of this order." + } + } + }, + "OrderContact": { + "id": "OrderContact", + "type": "object", + "description": "Contact of an order.", + "properties": { + "contactInfo": { + "type": "string", + "description": "Free-form information about this contact. It could be any information related to this contact in addition to type, title, name, and signature user profile ID." + }, + "contactName": { + "type": "string", + "description": "Name of this contact." + }, + "contactTitle": { + "type": "string", + "description": "Title of this contact." + }, + "contactType": { + "type": "string", + "description": "Type of this contact.", + "enum": [ + "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT", + "PLANNING_ORDER_CONTACT_BUYER_CONTACT", + "PLANNING_ORDER_CONTACT_SELLER_CONTACT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "signatureUserProfileId": { + "type": "string", + "description": "ID of the user profile containing the signature that will be embedded into order documents.", + "format": "int64" + } + } + }, + "OrderDocument": { + "id": "OrderDocument", + "type": "object", + "description": "Contains properties of a DoubleClick Planning order document.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this order document.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this order document.", + "format": "int64" + }, + "amendedOrderDocumentId": { + "type": "string", + "description": "The amended order document ID of this order document. An order document can be created by optionally amending another order document so that the change history can be preserved.", + "format": "int64" + }, + "approvedByUserProfileIds": { + "type": "array", + "description": "IDs of users who have approved this order document.", + "items": { + "type": "string", + "format": "int64" + } + }, + "cancelled": { + "type": "boolean", + "description": "Whether this order document is cancelled." + }, + "createdInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this order document." + }, + "effectiveDate": { + "type": "string", + "description": "Effective date of this order document.", + "format": "date" + }, + "id": { + "type": "string", + "description": "ID of this order document.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#orderDocument\".", + "default": "dfareporting#orderDocument" + }, + "lastSentRecipients": { + "type": "array", + "description": "List of email addresses that received the last sent document.", + "items": { + "type": "string" + } + }, + "lastSentTime": { + "type": "string", + "description": "Timestamp of the last email sent with this order document.", + "format": "date-time" + }, + "orderId": { + "type": "string", + "description": "ID of the order from which this order document is created.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Project ID of this order document.", + "format": "int64" + }, + "signed": { + "type": "boolean", + "description": "Whether this order document has been signed." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this order document.", + "format": "int64" + }, + "title": { + "type": "string", + "description": "Title of this order document." + }, + "type": { + "type": "string", + "description": "Type of this order document", + "enum": [ + "PLANNING_ORDER_TYPE_CHANGE_ORDER", + "PLANNING_ORDER_TYPE_INSERTION_ORDER" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "OrderDocumentsListResponse": { + "id": "OrderDocumentsListResponse", + "type": "object", + "description": "Order document List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#orderDocumentsListResponse\".", + "default": "dfareporting#orderDocumentsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "orderDocuments": { + "type": "array", + "description": "Order document collection", + "items": { + "$ref": "OrderDocument" + } + } + } + }, + "OrdersListResponse": { + "id": "OrdersListResponse", + "type": "object", + "description": "Order List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ordersListResponse\".", + "default": "dfareporting#ordersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "orders": { + "type": "array", + "description": "Order collection.", + "items": { + "$ref": "Order" + } + } + } + }, + "PathToConversionReportCompatibleFields": { + "id": "PathToConversionReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"PATH_TO_CONVERSION\".", + "properties": { + "conversionDimensions": { + "type": "array", + "description": "Conversion dimensions which are compatible to be selected in the \"conversionDimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "customFloodlightVariables": { + "type": "array", + "description": "Custom floodlight variables which are compatible to be selected in the \"customFloodlightVariables\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#pathToConversionReportCompatibleFields.", + "default": "dfareporting#pathToConversionReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "perInteractionDimensions": { + "type": "array", + "description": "Per-interaction dimensions which are compatible to be selected in the \"perInteractionDimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + } + } + }, + "Placement": { + "id": "Placement", + "type": "object", + "description": "Contains properties of a placement.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement. This field can be left blank.", + "format": "int64" + }, + "adBlockingOptOut": { + "type": "boolean", + "description": "Whether this placement opts out of ad blocking. When true, ad blocking is disabled for this placement. When false, the campaign and site settings take effect." + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement. This field is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "comment": { + "type": "string", + "description": "Comments for this placement." + }, + "compatibility": { + "type": "string", + "description": "Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices or in mobile apps for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are no longer allowed for new placement insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "DISPLAY", + "DISPLAY_INTERSTITIAL", + "IN_STREAM_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this placement. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placement\".", + "default": "dfareporting#placement" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this placement." + }, + "name": { + "type": "string", + "description": "Name of this placement.This is a required field and must be less than 256 characters long." + }, + "paymentApproved": { + "type": "boolean", + "description": "Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements." + }, + "paymentSource": { + "type": "string", + "description": "Payment source for this placement. This is a required field that is read-only after insertion.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementGroupId": { + "type": "string", + "description": "ID of this placement's group, if applicable.", + "format": "int64" + }, + "placementGroupIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement group. This is a read-only, auto-generated field." + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType." + }, + "primary": { + "type": "boolean", + "description": "Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the roadblock's primaryPlacementId field to the ID of this placement." + }, + "publisherUpdateInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the last publisher update. This is a read-only field." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "size": { + "$ref": "Size", + "description": "Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether creatives assigned to this placement must be SSL-compliant." + }, + "status": { + "type": "string", + "description": "Third-party placement status.", + "enum": [ + "ACKNOWLEDGE_ACCEPTANCE", + "ACKNOWLEDGE_REJECTION", + "DRAFT", + "PAYMENT_ACCEPTED", + "PAYMENT_REJECTED", + "PENDING_REVIEW" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement. This field can be left blank.", + "format": "int64" + }, + "tagFormats": { + "type": "array", + "description": "Tag formats to generate for this placement. This field is required on insertion.\nAcceptable values are:\n- \"PLACEMENT_TAG_STANDARD\"\n- \"PLACEMENT_TAG_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_IFRAME_ILAYER\"\n- \"PLACEMENT_TAG_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT\"\n- \"PLACEMENT_TAG_CLICK_COMMANDS\"\n- \"PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH\"\n- \"PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3\"\n- \"PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4\"\n- \"PLACEMENT_TAG_TRACKING\"\n- \"PLACEMENT_TAG_TRACKING_IFRAME\"\n- \"PLACEMENT_TAG_TRACKING_JAVASCRIPT\"", + "items": { + "type": "string", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Tag settings for this placement." + }, + "videoActiveViewOptOut": { + "type": "boolean", + "description": "Whether Verification and ActiveView are disabled for in-stream video creatives for this placement. The same setting videoActiveViewOptOut exists on the site level -- the opt out occurs if either of these settings are true. These settings are distinct from DirectorySites.settings.activeViewOptOut or Sites.siteSettings.activeViewOptOut which only apply to display ads. However, Accounts.activeViewOptOut opts out both video traffic, as well as display ads, from Verification and ActiveView." + }, + "videoSettings": { + "$ref": "VideoSettings", + "description": "A collection of settings which affect video creatives served through this placement. Applicable to placements with IN_STREAM_VIDEO compatibility." + }, + "vpaidAdapterChoice": { + "type": "string", + "description": "VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this placement.\n\nNote: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH.", + "enum": [ + "BOTH", + "DEFAULT", + "FLASH", + "HTML5" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "PlacementAssignment": { + "id": "PlacementAssignment", + "type": "object", + "description": "Placement Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this placement assignment is active. When true, the placement will be included in the ad's rotation." + }, + "placementId": { + "type": "string", + "description": "ID of the placement to be assigned. This is a required field.", + "format": "int64" + }, + "placementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement. This is a read-only, auto-generated field." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated." + } + } + }, + "PlacementGroup": { + "id": "PlacementGroup", + "type": "object", + "description": "Contains properties of a package or roadblock.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement group is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement group. This field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "childPlacementIds": { + "type": "array", + "description": "IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comment": { + "type": "string", + "description": "Comments for this placement group." + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement group.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement group. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroup\".", + "default": "dfareporting#placementGroup" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement group. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this placement group. This is a required field and must be less than 256 characters long." + }, + "placementGroupType": { + "type": "string", + "description": "Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement group.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement group. This field is required on insertion." + }, + "primaryPlacementId": { + "type": "string", + "description": "ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the primary field on all affected roadblock child placements.", + "format": "int64" + }, + "primaryPlacementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the primary placement. This is a read-only, auto-generated field." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "PlacementGroupsListResponse": { + "id": "PlacementGroupsListResponse", + "type": "object", + "description": "Placement Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroupsListResponse\".", + "default": "dfareporting#placementGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementGroups": { + "type": "array", + "description": "Placement group collection.", + "items": { + "$ref": "PlacementGroup" + } + } + } + }, + "PlacementStrategiesListResponse": { + "id": "PlacementStrategiesListResponse", + "type": "object", + "description": "Placement Strategy List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategiesListResponse\".", + "default": "dfareporting#placementStrategiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementStrategies": { + "type": "array", + "description": "Placement strategy collection.", + "items": { + "$ref": "PlacementStrategy" + } + } + } + }, + "PlacementStrategy": { + "id": "PlacementStrategy", + "type": "object", + "description": "Contains properties of a placement strategy.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement strategy.This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this placement strategy. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategy\".", + "default": "dfareporting#placementStrategy" + }, + "name": { + "type": "string", + "description": "Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same account." + } + } + }, + "PlacementTag": { + "id": "PlacementTag", + "type": "object", + "description": "Placement Tag", + "properties": { + "placementId": { + "type": "string", + "description": "Placement ID", + "format": "int64" + }, + "tagDatas": { + "type": "array", + "description": "Tags generated for this placement.", + "items": { + "$ref": "TagData" + } + } + } + }, + "PlacementsGenerateTagsResponse": { + "id": "PlacementsGenerateTagsResponse", + "type": "object", + "description": "Placement GenerateTags Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsGenerateTagsResponse\".", + "default": "dfareporting#placementsGenerateTagsResponse" + }, + "placementTags": { + "type": "array", + "description": "Set of generated tags for the specified placements.", + "items": { + "$ref": "PlacementTag" + } + } + } + }, + "PlacementsListResponse": { + "id": "PlacementsListResponse", + "type": "object", + "description": "Placement List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsListResponse\".", + "default": "dfareporting#placementsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placements": { + "type": "array", + "description": "Placement collection.", + "items": { + "$ref": "Placement" + } + } + } + }, + "PlatformType": { + "id": "PlatformType", + "type": "object", + "description": "Contains information about a platform type that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this platform type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformType\".", + "default": "dfareporting#platformType" + }, + "name": { + "type": "string", + "description": "Name of this platform type." + } + } + }, + "PlatformTypesListResponse": { + "id": "PlatformTypesListResponse", + "type": "object", + "description": "Platform Type List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformTypesListResponse\".", + "default": "dfareporting#platformTypesListResponse" + }, + "platformTypes": { + "type": "array", + "description": "Platform type collection.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "PopupWindowProperties": { + "id": "PopupWindowProperties", + "type": "object", + "description": "Popup Window Properties.", + "properties": { + "dimension": { + "$ref": "Size", + "description": "Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID" + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES." + }, + "positionType": { + "type": "string", + "description": "Popup window position either centered or at specific coordinate.", + "enum": [ + "CENTER", + "COORDINATES" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "showAddressBar": { + "type": "boolean", + "description": "Whether to display the browser address bar." + }, + "showMenuBar": { + "type": "boolean", + "description": "Whether to display the browser menu bar." + }, + "showScrollBar": { + "type": "boolean", + "description": "Whether to display the browser scroll bar." + }, + "showStatusBar": { + "type": "boolean", + "description": "Whether to display the browser status bar." + }, + "showToolBar": { + "type": "boolean", + "description": "Whether to display the browser tool bar." + }, + "title": { + "type": "string", + "description": "Title of popup window." + } + } + }, + "PostalCode": { + "id": "PostalCode", + "type": "object", + "description": "Contains information about a postal code that can be targeted by ads.", + "properties": { + "code": { + "type": "string", + "description": "Postal code. This is equivalent to the id field." + }, + "countryCode": { + "type": "string", + "description": "Country code of the country to which this postal code belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this postal code belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this postal code." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCode\".", + "default": "dfareporting#postalCode" + } + } + }, + "PostalCodesListResponse": { + "id": "PostalCodesListResponse", + "type": "object", + "description": "Postal Code List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCodesListResponse\".", + "default": "dfareporting#postalCodesListResponse" + }, + "postalCodes": { + "type": "array", + "description": "Postal code collection.", + "items": { + "$ref": "PostalCode" + } + } + } + }, + "Pricing": { + "id": "Pricing", + "type": "object", + "description": "Pricing Information", + "properties": { + "capCostType": { + "type": "string", + "description": "Cap cost type of this inventory item.", + "enum": [ + "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE", + "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY", + "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "endDate": { + "type": "string", + "description": "End date of this inventory item.", + "format": "date" + }, + "flights": { + "type": "array", + "description": "Flights of this inventory item. A flight (a.k.a. pricing period) represents the inventory item pricing information for a specific period of time.", + "items": { + "$ref": "Flight" + } + }, + "groupType": { + "type": "string", + "description": "Group type of this inventory item if it represents a placement group. Is null otherwise. There are two type of placement groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items that acts as a single pricing point for a group of tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned inventory items to be marked as primary.", + "enum": [ + "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE", + "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "pricingType": { + "type": "string", + "description": "Pricing type of this inventory item.", + "enum": [ + "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS", + "PLANNING_PLACEMENT_PRICING_TYPE_CPA", + "PLANNING_PLACEMENT_PRICING_TYPE_CPC", + "PLANNING_PLACEMENT_PRICING_TYPE_CPM", + "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW", + "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS", + "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS", + "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Start date of this inventory item.", + "format": "date" + } + } + }, + "PricingSchedule": { + "id": "PricingSchedule", + "type": "object", + "description": "Pricing Schedule", + "properties": { + "capCostOption": { + "type": "string", + "description": "Placement cap cost option.", + "enum": [ + "CAP_COST_CUMULATIVE", + "CAP_COST_MONTHLY", + "CAP_COST_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "disregardOverdelivery": { + "type": "boolean", + "description": "Whether cap costs are ignored by ad serving." + }, + "endDate": { + "type": "string", + "description": "Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "flighted": { + "type": "boolean", + "description": "Whether this placement is flighted. If true, pricing periods will be computed automatically." + }, + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA.", + "format": "int64" + }, + "pricingPeriods": { + "type": "array", + "description": "Pricing periods for this placement.", + "items": { + "$ref": "PricingSchedulePricingPeriod" + } + }, + "pricingType": { + "type": "string", + "description": "Placement pricing type. This field is required on insertion.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_CPM_ACTIVEVIEW", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "testingStartDate": { + "type": "string", + "description": "Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + } + } + }, + "PricingSchedulePricingPeriod": { + "id": "PricingSchedulePricingPeriod", + "type": "object", + "description": "Pricing Period", + "properties": { + "endDate": { + "type": "string", + "description": "Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error.", + "format": "date" + }, + "pricingComment": { + "type": "string", + "description": "Comments for this pricing period." + }, + "rateOrCostNanos": { + "type": "string", + "description": "Rate or cost of this pricing period in nanos (i.e., multipled by 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this pricing period. Acceptable values are 0 to 10000000000, inclusive.", + "format": "int64" + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "Contains properties of a DoubleClick Planning project.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this project.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this project.", + "format": "int64" + }, + "audienceAgeGroup": { + "type": "string", + "description": "Audience age group of this project.", + "enum": [ + "PLANNING_AUDIENCE_AGE_18_24", + "PLANNING_AUDIENCE_AGE_25_34", + "PLANNING_AUDIENCE_AGE_35_44", + "PLANNING_AUDIENCE_AGE_45_54", + "PLANNING_AUDIENCE_AGE_55_64", + "PLANNING_AUDIENCE_AGE_65_OR_MORE", + "PLANNING_AUDIENCE_AGE_UNKNOWN" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "audienceGender": { + "type": "string", + "description": "Audience gender of this project.", + "enum": [ + "PLANNING_AUDIENCE_GENDER_FEMALE", + "PLANNING_AUDIENCE_GENDER_MALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "budget": { + "type": "string", + "description": "Budget of this project in the currency specified by the current account. The value stored in this field represents only the non-fractional amount. For example, for USD, the smallest value that can be represented by this field is 1 US dollar.", + "format": "int64" + }, + "clientBillingCode": { + "type": "string", + "description": "Client billing code of this project." + }, + "clientName": { + "type": "string", + "description": "Name of the project client." + }, + "endDate": { + "type": "string", + "description": "End date of the project.", + "format": "date" + }, + "id": { + "type": "string", + "description": "ID of this project. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#project\".", + "default": "dfareporting#project" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this project." + }, + "name": { + "type": "string", + "description": "Name of this project." + }, + "overview": { + "type": "string", + "description": "Overview of this project." + }, + "startDate": { + "type": "string", + "description": "Start date of the project.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this project.", + "format": "int64" + }, + "targetClicks": { + "type": "string", + "description": "Number of clicks that the advertiser is targeting.", + "format": "int64" + }, + "targetConversions": { + "type": "string", + "description": "Number of conversions that the advertiser is targeting.", + "format": "int64" + }, + "targetCpaNanos": { + "type": "string", + "description": "CPA that the advertiser is targeting.", + "format": "int64" + }, + "targetCpcNanos": { + "type": "string", + "description": "CPC that the advertiser is targeting.", + "format": "int64" + }, + "targetCpmActiveViewNanos": { + "type": "string", + "description": "vCPM from Active View that the advertiser is targeting.", + "format": "int64" + }, + "targetCpmNanos": { + "type": "string", + "description": "CPM that the advertiser is targeting.", + "format": "int64" + }, + "targetImpressions": { + "type": "string", + "description": "Number of impressions that the advertiser is targeting.", + "format": "int64" + } + } + }, + "ProjectsListResponse": { + "id": "ProjectsListResponse", + "type": "object", + "description": "Project List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#projectsListResponse\".", + "default": "dfareporting#projectsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "projects": { + "type": "array", + "description": "Project collection.", + "items": { + "$ref": "Project" + } + } + } + }, + "ReachReportCompatibleFields": { + "id": "ReachReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"REACH\".", + "properties": { + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensions": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#reachReportCompatibleFields.", + "default": "dfareporting#reachReportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "pivotedActivityMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected as activity metrics to pivot on in the \"activities\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "reachByFrequencyMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"reachByFrequencyMetricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "Recipient": { + "id": "Recipient", + "type": "object", + "description": "Represents a recipient.", + "properties": { + "deliveryType": { + "type": "string", + "description": "The delivery type for the recipient.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "email": { + "type": "string", + "description": "The email address of the recipient.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#recipient.", + "default": "dfareporting#recipient" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Contains information about a region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this region.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#region\".", + "default": "dfareporting#region" + }, + "name": { + "type": "string", + "description": "Name of this region." + }, + "regionCode": { + "type": "string", + "description": "Region code." + } + } + }, + "RegionsListResponse": { + "id": "RegionsListResponse", + "type": "object", + "description": "Region List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#regionsListResponse\".", + "default": "dfareporting#regionsListResponse" + }, + "regions": { + "type": "array", + "description": "Region collection.", + "items": { + "$ref": "Region" + } + } + } + }, + "RemarketingList": { + "id": "RemarketingList", + "type": "object", + "description": "Contains properties of a remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource can be used to manage remarketing lists that are owned by your advertisers. To see all remarketing lists that are visible to your advertisers, including those that are shared to your advertiser or account, use the TargetableRemarketingLists resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this remarketing list is active." + }, + "advertiserId": { + "type": "string", + "description": "Dimension value for the advertiser ID that owns this remarketing list. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "description": { + "type": "string", + "description": "Remarketing list description." + }, + "id": { + "type": "string", + "description": "Remarketing list ID. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingList\".", + "default": "dfareporting#remarketingList" + }, + "lifeSpan": { + "type": "string", + "description": "Number of days that a user should remain in the remarketing list without an impression. Acceptable values are 1 to 540, inclusive.", + "format": "int64" + }, + "listPopulationRule": { + "$ref": "ListPopulationRule", + "description": "Rule used to populate the remarketing list with users." + }, + "listSize": { + "type": "string", + "description": "Number of users currently in the list. This is a read-only field.", + "format": "int64" + }, + "listSource": { + "type": "string", + "description": "Product from which this remarketing list was originated.", + "enum": [ + "REMARKETING_LIST_SOURCE_ADX", + "REMARKETING_LIST_SOURCE_DBM", + "REMARKETING_LIST_SOURCE_DFA", + "REMARKETING_LIST_SOURCE_DFP", + "REMARKETING_LIST_SOURCE_DMP", + "REMARKETING_LIST_SOURCE_GA", + "REMARKETING_LIST_SOURCE_GPLUS", + "REMARKETING_LIST_SOURCE_OTHER", + "REMARKETING_LIST_SOURCE_PLAY_STORE", + "REMARKETING_LIST_SOURCE_XFP", + "REMARKETING_LIST_SOURCE_YOUTUBE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the remarketing list. This is a required field. Must be no greater than 128 characters long." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + } + } + }, + "RemarketingListShare": { + "id": "RemarketingListShare", + "type": "object", + "description": "Contains properties of a remarketing list's sharing information. Sharing allows other accounts or advertisers to target to your remarketing lists. This resource can be used to manage remarketing list sharing to other accounts and advertisers.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingListShare\".", + "default": "dfareporting#remarketingListShare" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID. This is a read-only, auto-generated field.", + "format": "int64" + }, + "sharedAccountIds": { + "type": "array", + "description": "Accounts that the remarketing list is shared with.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sharedAdvertiserIds": { + "type": "array", + "description": "Advertisers that the remarketing list is shared with.", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "RemarketingListsListResponse": { + "id": "RemarketingListsListResponse", + "type": "object", + "description": "Remarketing list response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingListsListResponse\".", + "default": "dfareporting#remarketingListsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "remarketingLists": { + "type": "array", + "description": "Remarketing list collection.", + "items": { + "$ref": "RemarketingList" + } + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "description": "Represents a Report resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this report belongs.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "criteria": { + "type": "object", + "description": "The report criteria for a report of type \"STANDARD\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range for which this report should be run." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of standard dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "crossDimensionReachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"CROSS_DIMENSION_REACH\".", + "properties": { + "breakdown": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimension": { + "type": "string", + "description": "The dimension option.", + "enum": [ + "ADVERTISER", + "CAMPAIGN", + "SITE_BY_ADVERTISER", + "SITE_BY_CAMPAIGN" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.", + "items": { + "$ref": "DimensionValue" + } + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "overlapMetricNames": { + "type": "array", + "description": "The list of names of overlap metrics the report should include.", + "items": { + "type": "string" + } + }, + "pivoted": { + "type": "boolean", + "description": "Whether the report is pivoted or not. Defaults to true." + } + } + }, + "delivery": { + "type": "object", + "description": "The report's email delivery settings.", + "properties": { + "emailOwner": { + "type": "boolean", + "description": "Whether the report should be emailed to the report owner." + }, + "emailOwnerDeliveryType": { + "type": "string", + "description": "The type of delivery for the owner to receive, if enabled.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "message": { + "type": "string", + "description": "The message to be sent with each email." + }, + "recipients": { + "type": "array", + "description": "The list of recipients to which to email the report.", + "items": { + "$ref": "Recipient" + } + } + } + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "fileName": { + "type": "string", + "description": "The filename used when generating report files for this report." + }, + "floodlightCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"FLOODLIGHT\".", + "properties": { + "customRichMediaEvents": { + "type": "array", + "description": "The list of custom rich media events to include.", + "items": { + "$ref": "DimensionValue" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no cookie, but do have an exposure path." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + } + } + } + } + }, + "format": { + "type": "string", + "description": "The output format of the report. If not specified, default format is \"CSV\". Note that the actual format in the completed report file might differ if for instance the report's size exceeds the format's capabilities. \"CSV\" will then be the fallback format.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "id": { + "type": "string", + "description": "The unique ID identifying this report resource.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#report.", + "default": "dfareporting#report" + }, + "lastModifiedTime": { + "type": "string", + "description": "The timestamp (in milliseconds since epoch) of when this report was last modified.", + "format": "uint64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "name": { + "type": "string", + "description": "The name of the report.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "ownerProfileId": { + "type": "string", + "description": "The user profile id of the owner of this report.", + "format": "int64", + "annotations": { + "required": [ + "dfareporting.reports.update" + ] + } + }, + "pathToConversionCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"PATH_TO_CONVERSION\".", + "properties": { + "activityFilters": { + "type": "array", + "description": "The list of 'dfa:activity' values to filter on.", + "items": { + "$ref": "DimensionValue" + } + }, + "conversionDimensions": { + "type": "array", + "description": "The list of conversion dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "customFloodlightVariables": { + "type": "array", + "description": "The list of custom floodlight variables the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "customRichMediaEvents": { + "type": "array", + "description": "The list of custom rich media events to include.", + "items": { + "$ref": "DimensionValue" + } + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "floodlightConfigId": { + "$ref": "DimensionValue", + "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "perInteractionDimensions": { + "type": "array", + "description": "The list of per interaction dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "reportProperties": { + "type": "object", + "description": "The properties of the report.", + "properties": { + "clicksLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "impressionsLookbackWindow": { + "type": "integer", + "description": "DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90.", + "format": "int32" + }, + "includeAttributedIPConversions": { + "type": "boolean", + "description": "Deprecated: has no effect." + }, + "includeUnattributedCookieConversions": { + "type": "boolean", + "description": "Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window." + }, + "includeUnattributedIPConversions": { + "type": "boolean", + "description": "Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion." + }, + "maximumClickInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumImpressionInteractions": { + "type": "integer", + "description": "The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report.", + "format": "int32" + }, + "maximumInteractionGap": { + "type": "integer", + "description": "The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90.", + "format": "int32" + }, + "pivotOnInteractionPath": { + "type": "boolean", + "description": "Enable pivoting on interaction path." + } + } + } + } + }, + "reachCriteria": { + "type": "object", + "description": "The report criteria for a report of type \"REACH\".", + "properties": { + "activities": { + "$ref": "Activities", + "description": "Activity group." + }, + "customRichMediaEvents": { + "$ref": "CustomRichMediaEvents", + "description": "Custom Rich Media Events group." + }, + "dateRange": { + "$ref": "DateRange", + "description": "The date range this report should be run for." + }, + "dimensionFilters": { + "type": "array", + "description": "The list of filters on which dimensions are filtered.\nFilters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed.", + "items": { + "$ref": "DimensionValue" + } + }, + "dimensions": { + "type": "array", + "description": "The list of dimensions the report should include.", + "items": { + "$ref": "SortedDimension" + } + }, + "enableAllDimensionCombinations": { + "type": "boolean", + "description": "Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last three months." + }, + "metricNames": { + "type": "array", + "description": "The list of names of metrics the report should include.", + "items": { + "type": "string" + } + }, + "reachByFrequencyMetricNames": { + "type": "array", + "description": "The list of names of Reach By Frequency metrics the report should include.", + "items": { + "type": "string" + } + } + } + }, + "schedule": { + "type": "object", + "description": "The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not \"TODAY\".", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the schedule is active or not. Must be set to either true or false.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "every": { + "type": "integer", + "description": "Defines every how many days, weeks or months the report should be run. Needs to be set when \"repeats\" is either \"DAILY\", \"WEEKLY\" or \"MONTHLY\".", + "format": "int32" + }, + "expirationDate": { + "type": "string", + "description": "The expiration date when the scheduled report stops running.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeats": { + "type": "string", + "description": "The interval for which the report is repeated. Note: \n- \"DAILY\" also requires field \"every\" to be set. \n- \"WEEKLY\" also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"MONTHLY\" also requires fields \"every\" and \"runsOnDayOfMonth\" to be set.", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + }, + "repeatsOnWeekDays": { + "type": "array", + "description": "List of week days \"WEEKLY\" on which scheduled reports should run.", + "items": { + "type": "string", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "runsOnDayOfMonth": { + "type": "string", + "description": "Enum to define for \"MONTHLY\" scheduled reports whether reports should be repeated on the same day of the month as \"startDate\" or the same day of the week of the month.\nExample: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), \"DAY_OF_MONTH\" would run subsequent reports on the 2nd of every Month, and \"WEEK_OF_MONTH\" would run subsequent reports on the first Monday of the month.", + "enum": [ + "DAY_OF_MONTH", + "WEEK_OF_MONTH" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Start date of date range for which scheduled reports should be run.", + "format": "date", + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "subAccountId": { + "type": "string", + "description": "The subaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report.", + "enum": [ + "CROSS_DIMENSION_REACH", + "FLOODLIGHT", + "PATH_TO_CONVERSION", + "REACH", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "dfareporting.reports.insert", + "dfareporting.reports.update" + ] + } + } + } + }, + "ReportCompatibleFields": { + "id": "ReportCompatibleFields", + "type": "object", + "description": "Represents fields that are compatible to be selected for a report of type \"STANDARD\".", + "properties": { + "dimensionFilters": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensionFilters\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "dimensions": { + "type": "array", + "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", + "items": { + "$ref": "Dimension" + } + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#reportCompatibleFields.", + "default": "dfareporting#reportCompatibleFields" + }, + "metrics": { + "type": "array", + "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", + "items": { + "$ref": "Metric" + } + }, + "pivotedActivityMetrics": { + "type": "array", + "description": "Metrics which are compatible to be selected as activity metrics to pivot on in the \"activities\" section of the report.", + "items": { + "$ref": "Metric" + } + } + } + }, + "ReportList": { + "id": "ReportList", + "type": "object", + "description": "Represents the list of reports.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The reports returned in this response.", + "items": { + "$ref": "Report" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#reportList.", + "default": "dfareporting#reportList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through reports. To retrieve the next page of results, set the next request's \"pageToken\" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted." + } + } + }, + "ReportsConfiguration": { + "id": "ReportsConfiguration", + "type": "object", + "description": "Reporting Configuration", + "properties": { + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Default lookback windows for new advertisers in this account." + }, + "reportGenerationTimeZoneId": { + "type": "string", + "description": "Report generation time zone ID of this account. This is a required field that can only be changed by a superuser.\nAcceptable values are:\n\n- \"1\" for \"America/New_York\" \n- \"2\" for \"Europe/London\" \n- \"3\" for \"Europe/Paris\" \n- \"4\" for \"Africa/Johannesburg\" \n- \"5\" for \"Asia/Jerusalem\" \n- \"6\" for \"Asia/Shanghai\" \n- \"7\" for \"Asia/Hong_Kong\" \n- \"8\" for \"Asia/Tokyo\" \n- \"9\" for \"Australia/Sydney\" \n- \"10\" for \"Asia/Dubai\" \n- \"11\" for \"America/Los_Angeles\" \n- \"12\" for \"Pacific/Auckland\" \n- \"13\" for \"America/Sao_Paulo\"", + "format": "int64" + } + } + }, + "RichMediaExitOverride": { + "id": "RichMediaExitOverride", + "type": "object", + "description": "Rich Media Exit Override.", + "properties": { + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of this rich media exit override. Applicable if the enabled field is set to true." + }, + "enabled": { + "type": "boolean", + "description": "Whether to use the clickThroughUrl. If false, the creative-level exit will be used." + }, + "exitId": { + "type": "string", + "description": "ID for the override to refer to a specific exit in the creative.", + "format": "int64" + } + } + }, + "Rule": { + "id": "Rule", + "type": "object", + "description": "A rule associates an asset with a targeting template for asset-level targeting. Applicable to INSTREAM_VIDEO creatives.", + "properties": { + "assetId": { + "type": "string", + "description": "A creativeAssets[].id. This should refer to one of the parent assets in this creative. This is a required field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "A user-friendly name for this rule. This is a required field." + }, + "targetingTemplateId": { + "type": "string", + "description": "A targeting template ID. The targeting from the targeting template will be used to determine whether this asset should be served. This is a required field.", + "format": "int64" + } + } + }, + "Site": { + "id": "Site", + "type": "object", + "description": "Contains properties of a site.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + }, + "approved": { + "type": "boolean", + "description": "Whether this site is approved." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site associated with this site. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this site. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this site. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#site\".", + "default": "dfareporting#site" + }, + "name": { + "type": "string", + "description": "Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account." + }, + "siteContacts": { + "type": "array", + "description": "Site contacts.", + "items": { + "$ref": "SiteContact" + } + }, + "siteSettings": { + "$ref": "SiteSettings", + "description": "Site-wide settings." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "SiteContact": { + "id": "SiteContact", + "type": "object", + "description": "Site Contact", + "properties": { + "address": { + "type": "string", + "description": "Address of this site contact." + }, + "contactType": { + "type": "string", + "description": "Site contact type.", + "enum": [ + "SALES_PERSON", + "TRAFFICKER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "email": { + "type": "string", + "description": "Email address of this site contact. This is a required field." + }, + "firstName": { + "type": "string", + "description": "First name of this site contact." + }, + "id": { + "type": "string", + "description": "ID of this site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "lastName": { + "type": "string", + "description": "Last name of this site contact." + }, + "phone": { + "type": "string", + "description": "Primary phone number of this site contact." + }, + "title": { + "type": "string", + "description": "Title or designation of this site contact." + } + } + }, + "SiteSettings": { + "id": "SiteSettings", + "type": "object", + "description": "Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether active view creatives are disabled for this site." + }, + "adBlockingOptOut": { + "type": "boolean", + "description": "Whether this site opts out of ad blocking. When true, ad blocking is disabled for all placements under the site, regardless of the individual placement settings. When false, the campaign and placement settings take effect." + }, + "creativeSettings": { + "$ref": "CreativeSettings", + "description": "Site-wide creative settings." + }, + "disableNewCookie": { + "type": "boolean", + "description": "Whether new cookies are disabled for this site." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this site." + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Configuration settings for dynamic and image floodlight tags." + }, + "videoActiveViewOptOutTemplate": { + "type": "boolean", + "description": "Whether Verification and ActiveView for in-stream video creatives are disabled by default for new placements created under this site. This value will be used to populate the placement.videoActiveViewOptOut field, when no value is specified for the new placement." + }, + "vpaidAdapterChoiceTemplate": { + "type": "string", + "description": "Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter).\n\nNote: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH.", + "enum": [ + "BOTH", + "DEFAULT", + "FLASH", + "HTML5" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "SitesListResponse": { + "id": "SitesListResponse", + "type": "object", + "description": "Site List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sitesListResponse\".", + "default": "dfareporting#sitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "sites": { + "type": "array", + "description": "Site collection.", + "items": { + "$ref": "Site" + } + } + } + }, + "Size": { + "id": "Size", + "type": "object", + "description": "Represents the dimensions of ads, placements, creatives, or creative assets.", + "properties": { + "height": { + "type": "integer", + "description": "Height of this size. Acceptable values are 0 to 32767, inclusive.", + "format": "int32" + }, + "iab": { + "type": "boolean", + "description": "IAB standard size. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this size. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#size\".", + "default": "dfareporting#size" + }, + "width": { + "type": "integer", + "description": "Width of this size. Acceptable values are 0 to 32767, inclusive.", + "format": "int32" + } + } + }, + "SizesListResponse": { + "id": "SizesListResponse", + "type": "object", + "description": "Size List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sizesListResponse\".", + "default": "dfareporting#sizesListResponse" + }, + "sizes": { + "type": "array", + "description": "Size collection.", + "items": { + "$ref": "Size" + } + } + } + }, + "SkippableSetting": { + "id": "SkippableSetting", + "type": "object", + "description": "Skippable Settings", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#skippableSetting\".", + "default": "dfareporting#skippableSetting" + }, + "progressOffset": { + "$ref": "VideoOffset", + "description": "Amount of time to play videos served to this placement before counting a view. Applicable when skippable is true." + }, + "skipOffset": { + "$ref": "VideoOffset", + "description": "Amount of time to play videos served to this placement before the skip button should appear. Applicable when skippable is true." + }, + "skippable": { + "type": "boolean", + "description": "Whether the user can skip creatives served to this placement." + } + } + }, + "SortedDimension": { + "id": "SortedDimension", + "type": "object", + "description": "Represents a sorted dimension.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#sortedDimension.", + "default": "dfareporting#sortedDimension" + }, + "name": { + "type": "string", + "description": "The name of the dimension." + }, + "sortOrder": { + "type": "string", + "description": "An optional sort order for the dimension column.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "Subaccount": { + "id": "Subaccount", + "type": "object", + "description": "Contains properties of a DCM subaccount.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account that contains this subaccount. This is a read-only field that can be left blank.", + "format": "int64" + }, + "availablePermissionIds": { + "type": "array", + "description": "IDs of the available user role permissions for this subaccount.", + "items": { + "type": "string", + "format": "int64" + } + }, + "id": { + "type": "string", + "description": "ID of this subaccount. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccount\".", + "default": "dfareporting#subaccount" + }, + "name": { + "type": "string", + "description": "Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account." + } + } + }, + "SubaccountsListResponse": { + "id": "SubaccountsListResponse", + "type": "object", + "description": "Subaccount List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccountsListResponse\".", + "default": "dfareporting#subaccountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "subaccounts": { + "type": "array", + "description": "Subaccount collection.", + "items": { + "$ref": "Subaccount" + } + } + } + }, + "TagData": { + "id": "TagData", + "type": "object", + "description": "Placement Tag Data", + "properties": { + "adId": { + "type": "string", + "description": "Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING.", + "format": "int64" + }, + "clickTag": { + "type": "string", + "description": "Tag string to record a click." + }, + "creativeId": { + "type": "string", + "description": "Creative associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING.", + "format": "int64" + }, + "format": { + "type": "string", + "description": "TagData tag format of this tag.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "impressionTag": { + "type": "string", + "description": "Tag string for serving an ad." + } + } + }, + "TagSetting": { + "id": "TagSetting", + "type": "object", + "description": "Tag Settings", + "properties": { + "additionalKeyValues": { + "type": "string", + "description": "Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys and values must not contain commas. For example, id=2;color=red is a valid value for this field." + }, + "includeClickThroughUrls": { + "type": "boolean", + "description": "Whether static landing page URLs should be included in the tags. This setting applies only to placements." + }, + "includeClickTracking": { + "type": "boolean", + "description": "Whether click-tracking string should be included in the tags." + }, + "keywordOption": { + "type": "string", + "description": "Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags for this site. Publishers can then add keywords to those placeholders.", + "enum": [ + "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD", + "IGNORE", + "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TagSettings": { + "id": "TagSettings", + "type": "object", + "description": "Dynamic and Image Tag Settings.", + "properties": { + "dynamicTagEnabled": { + "type": "boolean", + "description": "Whether dynamic floodlight tags are enabled." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether image tags are enabled." + } + } + }, + "TargetWindow": { + "id": "TargetWindow", + "type": "object", + "description": "Target Window.", + "properties": { + "customHtml": { + "type": "string", + "description": "User-entered value." + }, + "targetWindowOption": { + "type": "string", + "description": "Type of browser window for which the backup image of the flash creative can be displayed.", + "enum": [ + "CURRENT_WINDOW", + "CUSTOM", + "NEW_WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetableRemarketingList": { + "id": "TargetableRemarketingList", + "type": "object", + "description": "Contains properties of a targetable remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource is a read-only view of a remarketing list to be used to faciliate targeting ads to specific lists. Remarketing lists that are owned by your advertisers and those that are shared to your advertisers or account are accessible via this resource. To manage remarketing lists that are owned by your advertisers, use the RemarketingLists resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this targetable remarketing list is active." + }, + "advertiserId": { + "type": "string", + "description": "Dimension value for the advertiser ID that owns this targetable remarketing list.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser." + }, + "description": { + "type": "string", + "description": "Targetable remarketing list description." + }, + "id": { + "type": "string", + "description": "Targetable remarketing list ID.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetableRemarketingList\".", + "default": "dfareporting#targetableRemarketingList" + }, + "lifeSpan": { + "type": "string", + "description": "Number of days that a user should remain in the targetable remarketing list without an impression.", + "format": "int64" + }, + "listSize": { + "type": "string", + "description": "Number of users currently in the list. This is a read-only field.", + "format": "int64" + }, + "listSource": { + "type": "string", + "description": "Product from which this targetable remarketing list was originated.", + "enum": [ + "REMARKETING_LIST_SOURCE_ADX", + "REMARKETING_LIST_SOURCE_DBM", + "REMARKETING_LIST_SOURCE_DFA", + "REMARKETING_LIST_SOURCE_DFP", + "REMARKETING_LIST_SOURCE_DMP", + "REMARKETING_LIST_SOURCE_GA", + "REMARKETING_LIST_SOURCE_GPLUS", + "REMARKETING_LIST_SOURCE_OTHER", + "REMARKETING_LIST_SOURCE_PLAY_STORE", + "REMARKETING_LIST_SOURCE_XFP", + "REMARKETING_LIST_SOURCE_YOUTUBE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the targetable remarketing list. Is no greater than 128 characters long." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + } + } + }, + "TargetableRemarketingListsListResponse": { + "id": "TargetableRemarketingListsListResponse", + "type": "object", + "description": "Targetable remarketing list response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetableRemarketingListsListResponse\".", + "default": "dfareporting#targetableRemarketingListsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "targetableRemarketingLists": { + "type": "array", + "description": "Targetable remarketing list collection.", + "items": { + "$ref": "TargetableRemarketingList" + } + } + } + }, + "TargetingTemplate": { + "id": "TargetingTemplate", + "type": "object", + "description": "Contains properties of a targeting template. A targeting template encapsulates targeting information which can be reused across multiple ads.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "dayPartTargeting": { + "$ref": "DayPartTargeting", + "description": "Time and day targeting criteria." + }, + "geoTargeting": { + "$ref": "GeoTargeting", + "description": "Geographical targeting criteria." + }, + "id": { + "type": "string", + "description": "ID of this targeting template. This is a read-only, auto-generated field.", + "format": "int64" + }, + "keyValueTargetingExpression": { + "$ref": "KeyValueTargetingExpression", + "description": "Key-value targeting criteria." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetingTemplate\".", + "default": "dfareporting#targetingTemplate" + }, + "languageTargeting": { + "$ref": "LanguageTargeting", + "description": "Language targeting criteria." + }, + "listTargetingExpression": { + "$ref": "ListTargetingExpression", + "description": "Remarketing list targeting criteria." + }, + "name": { + "type": "string", + "description": "Name of this targeting template. This field is required. It must be less than 256 characters long and unique within an advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert.", + "format": "int64" + }, + "technologyTargeting": { + "$ref": "TechnologyTargeting", + "description": "Technology platform targeting criteria." + } + } + }, + "TargetingTemplatesListResponse": { + "id": "TargetingTemplatesListResponse", + "type": "object", + "description": "Targeting Template List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetingTemplatesListResponse\".", + "default": "dfareporting#targetingTemplatesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "targetingTemplates": { + "type": "array", + "description": "Targeting template collection.", + "items": { + "$ref": "TargetingTemplate" + } + } + } + }, + "TechnologyTargeting": { + "id": "TechnologyTargeting", + "type": "object", + "description": "Technology Targeting.", + "properties": { + "browsers": { + "type": "array", + "description": "Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only browserVersionId will be used. The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "Browser" + } + }, + "connectionTypes": { + "type": "array", + "description": "Connection types that this ad targets. For each connection type only id is required. The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "ConnectionType" + } + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes.", + "items": { + "$ref": "MobileCarrier" + } + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the corresponding operating system in operatingSystems.", + "items": { + "$ref": "OperatingSystemVersion" + } + }, + "operatingSystems": { + "type": "array", + "description": "Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating system versions for the same operating system.", + "items": { + "$ref": "OperatingSystem" + } + }, + "platformTypes": { + "type": "array", + "description": "Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "ThirdPartyAuthenticationToken": { + "id": "ThirdPartyAuthenticationToken", + "type": "object", + "description": "Third Party Authentication Token", + "properties": { + "name": { + "type": "string", + "description": "Name of the third-party authentication token." + }, + "value": { + "type": "string", + "description": "Value of the third-party authentication token. This is a read-only, auto-generated field." + } + } + }, + "ThirdPartyTrackingUrl": { + "id": "ThirdPartyTrackingUrl", + "type": "object", + "description": "Third-party Tracking URL.", + "properties": { + "thirdPartyUrlType": { + "type": "string", + "description": "Third-party URL type for in-stream video creatives.", + "enum": [ + "CLICK_TRACKING", + "IMPRESSION", + "RICH_MEDIA_BACKUP_IMPRESSION", + "RICH_MEDIA_IMPRESSION", + "RICH_MEDIA_RM_IMPRESSION", + "SURVEY", + "VIDEO_COMPLETE", + "VIDEO_CUSTOM", + "VIDEO_FIRST_QUARTILE", + "VIDEO_FULLSCREEN", + "VIDEO_MIDPOINT", + "VIDEO_MUTE", + "VIDEO_PAUSE", + "VIDEO_PROGRESS", + "VIDEO_REWIND", + "VIDEO_SKIP", + "VIDEO_START", + "VIDEO_STOP", + "VIDEO_THIRD_QUARTILE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "URL for the specified third-party URL type." + } + } + }, + "TranscodeSetting": { + "id": "TranscodeSetting", + "type": "object", + "description": "Transcode Settings", + "properties": { + "enabledVideoFormats": { + "type": "array", + "description": "Whitelist of video formats to be served to this placement. Set this list to null or empty to serve all video formats.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#transcodeSetting\".", + "default": "dfareporting#transcodeSetting" + } + } + }, + "UniversalAdId": { + "id": "UniversalAdId", + "type": "object", + "description": "A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following creative types: INSTREAM_VIDEO and VPAID.", + "properties": { + "registry": { + "type": "string", + "description": "Registry used for the Ad ID value.", + "enum": [ + "AD_ID.ORG", + "CLEARCAST", + "DCM", + "OTHER" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "ID value for this creative. Only alphanumeric characters and the following symbols are valid: \"_/\\-\". Maximum length is 64 characters. Read only when registry is DCM." + } + } + }, + "UserDefinedVariableConfiguration": { + "id": "UserDefinedVariableConfiguration", + "type": "object", + "description": "User Defined Variable configuration.", + "properties": { + "dataType": { + "type": "string", + "description": "Data type for the variable. This is a required field.", + "enum": [ + "NUMBER", + "STRING" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "reportName": { + "type": "string", + "description": "User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain the following characters: \"\"\u003c\u003e\"." + }, + "variableType": { + "type": "string", + "description": "Variable name in the tag. This is a required field.", + "enum": [ + "U1", + "U10", + "U100", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U21", + "U22", + "U23", + "U24", + "U25", + "U26", + "U27", + "U28", + "U29", + "U3", + "U30", + "U31", + "U32", + "U33", + "U34", + "U35", + "U36", + "U37", + "U38", + "U39", + "U4", + "U40", + "U41", + "U42", + "U43", + "U44", + "U45", + "U46", + "U47", + "U48", + "U49", + "U5", + "U50", + "U51", + "U52", + "U53", + "U54", + "U55", + "U56", + "U57", + "U58", + "U59", + "U6", + "U60", + "U61", + "U62", + "U63", + "U64", + "U65", + "U66", + "U67", + "U68", + "U69", + "U7", + "U70", + "U71", + "U72", + "U73", + "U74", + "U75", + "U76", + "U77", + "U78", + "U79", + "U8", + "U80", + "U81", + "U82", + "U83", + "U84", + "U85", + "U86", + "U87", + "U88", + "U89", + "U9", + "U90", + "U91", + "U92", + "U93", + "U94", + "U95", + "U96", + "U97", + "U98", + "U99" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "UserProfile": { + "id": "UserProfile", + "type": "object", + "description": "Represents a UserProfile resource.", + "properties": { + "accountId": { + "type": "string", + "description": "The account ID to which this profile belongs.", + "format": "int64" + }, + "accountName": { + "type": "string", + "description": "The account name this profile belongs to." + }, + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "kind": { + "type": "string", + "description": "The kind of resource this is, in this case dfareporting#userProfile.", + "default": "dfareporting#userProfile" + }, + "profileId": { + "type": "string", + "description": "The unique ID of the user profile.", + "format": "int64" + }, + "subAccountId": { + "type": "string", + "description": "The sub account ID this profile belongs to if applicable.", + "format": "int64" + }, + "subAccountName": { + "type": "string", + "description": "The sub account name this profile belongs to if applicable." + }, + "userName": { + "type": "string", + "description": "The user name." + } + } + }, + "UserProfileList": { + "id": "UserProfileList", + "type": "object", + "description": "Represents the list of user profiles.", + "properties": { + "etag": { + "type": "string", + "description": "The eTag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The user profiles returned in this response.", + "items": { + "$ref": "UserProfile" + } + }, + "kind": { + "type": "string", + "description": "The kind of list this is, in this case dfareporting#userProfileList.", + "default": "dfareporting#userProfileList" + } + } + }, + "UserRole": { + "id": "UserRole", + "type": "object", + "description": "Contains properties of auser role, which is used to manage user access.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + }, + "defaultUserRole": { + "type": "boolean", + "description": "Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each default user role comes with a basic set of preassigned permissions." + }, + "id": { + "type": "string", + "description": "ID of this user role. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRole\".", + "default": "dfareporting#userRole" + }, + "name": { + "type": "string", + "description": "Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles of the same account." + }, + "parentUserRoleId": { + "type": "string", + "description": "ID of the user role that this user role is based on or copied from. This is a required field.", + "format": "int64" + }, + "permissions": { + "type": "array", + "description": "List of permissions associated with this user role.", + "items": { + "$ref": "UserRolePermission" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "UserRolePermission": { + "id": "UserRolePermission", + "type": "object", + "description": "Contains properties of a user role permission.", + "properties": { + "availability": { + "type": "string", + "description": "Levels of availability for a user role permission.", + "enum": [ + "ACCOUNT_ALWAYS", + "ACCOUNT_BY_DEFAULT", + "NOT_AVAILABLE_BY_DEFAULT", + "SUBACCOUNT_AND_ACCOUNT_ALWAYS", + "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermission\".", + "default": "dfareporting#userRolePermission" + }, + "name": { + "type": "string", + "description": "Name of this user role permission." + }, + "permissionGroupId": { + "type": "string", + "description": "ID of the permission group that this user role permission belongs to.", + "format": "int64" + } + } + }, + "UserRolePermissionGroup": { + "id": "UserRolePermissionGroup", + "type": "object", + "description": "Represents a grouping of related user role permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroup\".", + "default": "dfareporting#userRolePermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this user role permission group." + } + } + }, + "UserRolePermissionGroupsListResponse": { + "id": "UserRolePermissionGroupsListResponse", + "type": "object", + "description": "User Role Permission Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroupsListResponse\".", + "default": "dfareporting#userRolePermissionGroupsListResponse" + }, + "userRolePermissionGroups": { + "type": "array", + "description": "User role permission group collection.", + "items": { + "$ref": "UserRolePermissionGroup" + } + } + } + }, + "UserRolePermissionsListResponse": { + "id": "UserRolePermissionsListResponse", + "type": "object", + "description": "User Role Permission List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionsListResponse\".", + "default": "dfareporting#userRolePermissionsListResponse" + }, + "userRolePermissions": { + "type": "array", + "description": "User role permission collection.", + "items": { + "$ref": "UserRolePermission" + } + } + } + }, + "UserRolesListResponse": { + "id": "UserRolesListResponse", + "type": "object", + "description": "User Role List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolesListResponse\".", + "default": "dfareporting#userRolesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "userRoles": { + "type": "array", + "description": "User role collection.", + "items": { + "$ref": "UserRole" + } + } + } + }, + "VideoFormat": { + "id": "VideoFormat", + "type": "object", + "description": "Contains information about supported video formats.", + "properties": { + "fileType": { + "type": "string", + "description": "File type of the video format.", + "enum": [ + "FLV", + "M3U8", + "MP4", + "THREEGPP", + "WEBM" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "integer", + "description": "ID of the video format.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#videoFormat\".", + "default": "dfareporting#videoFormat" + }, + "resolution": { + "$ref": "Size", + "description": "The resolution of this video format." + }, + "targetBitRate": { + "type": "integer", + "description": "The target bit rate of this video format.", + "format": "int32" + } + } + }, + "VideoFormatsListResponse": { + "id": "VideoFormatsListResponse", + "type": "object", + "description": "Video Format List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#videoFormatsListResponse\".", + "default": "dfareporting#videoFormatsListResponse" + }, + "videoFormats": { + "type": "array", + "description": "Video format collection.", + "items": { + "$ref": "VideoFormat" + } + } + } + }, + "VideoOffset": { + "id": "VideoOffset", + "type": "object", + "description": "Video Offset", + "properties": { + "offsetPercentage": { + "type": "integer", + "description": "Duration, as a percentage of video duration. Do not set when offsetSeconds is set. Acceptable values are 0 to 100, inclusive.", + "format": "int32" + }, + "offsetSeconds": { + "type": "integer", + "description": "Duration, in seconds. Do not set when offsetPercentage is set. Acceptable values are 0 to 86399, inclusive.", + "format": "int32" + } + } + }, + "VideoSettings": { + "id": "VideoSettings", + "type": "object", + "description": "Video Settings", + "properties": { + "companionSettings": { + "$ref": "CompanionSetting", + "description": "Settings for the companion creatives of video creatives served to this placement." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#videoSettings\".", + "default": "dfareporting#videoSettings" + }, + "skippableSettings": { + "$ref": "SkippableSetting", + "description": "Settings for the skippability of video creatives served to this placement. If this object is provided, the creative-level skippable settings will be overridden." + }, + "transcodeSettings": { + "$ref": "TranscodeSetting", + "description": "Settings for the transcodes of video creatives served to this placement. If this object is provided, the creative-level transcode settings will be overridden." + } + } + } + }, + "resources": { + "accountActiveAdSummaries": { + "methods": { + "get": { + "id": "dfareporting.accountActiveAdSummaries.get", + "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + "httpMethod": "GET", + "description": "Gets the account's active ad summary by account ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "summaryAccountId": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "summaryAccountId" + ], + "response": { + "$ref": "AccountActiveAdSummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.accountPermissionGroups.get", + "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one account permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissionGroups.list", + "path": "userprofiles/{profileId}/accountPermissionGroups", + "httpMethod": "GET", + "description": "Retrieves the list of account permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissions": { + "methods": { + "get": { + "id": "dfareporting.accountPermissions.get", + "path": "userprofiles/{profileId}/accountPermissions/{id}", + "httpMethod": "GET", + "description": "Gets one account permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissions.list", + "path": "userprofiles/{profileId}/accountPermissions", + "httpMethod": "GET", + "description": "Retrieves the list of account permissions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountUserProfiles": { + "methods": { + "get": { + "id": "dfareporting.accountUserProfiles.get", + "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + "httpMethod": "GET", + "description": "Gets one account user profile by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.accountUserProfiles.insert", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "POST", + "description": "Inserts a new account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountUserProfiles.list", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "GET", + "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active user profiles.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user profiles with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user profiles with the specified subaccount ID.", + "format": "int64", + "location": "query" + }, + "userRoleId": { + "type": "string", + "description": "Select only user profiles with the specified user role ID.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountUserProfilesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accountUserProfiles.patch", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PATCH", + "description": "Updates an existing account user profile. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accountUserProfiles.update", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PUT", + "description": "Updates an existing account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accounts": { + "methods": { + "get": { + "id": "dfareporting.accounts.get", + "path": "userprofiles/{profileId}/accounts/{id}", + "httpMethod": "GET", + "description": "Gets one account by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accounts.list", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "GET", + "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only accounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accounts.patch", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PATCH", + "description": "Updates an existing account. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accounts.update", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PUT", + "description": "Updates an existing account.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "ads": { + "methods": { + "get": { + "id": "dfareporting.ads.get", + "path": "userprofiles/{profileId}/ads/{id}", + "httpMethod": "GET", + "description": "Gets one ad by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.ads.insert", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "POST", + "description": "Inserts a new ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.ads.list", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "GET", + "description": "Retrieves a list of ads, possibly filtered. This method supports paging.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active ads.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only ads with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived ads.", + "location": "query" + }, + "audienceSegmentIds": { + "type": "string", + "description": "Select only ads with these audience segment IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only ads with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibility": { + "type": "string", + "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "DISPLAY", + "DISPLAY_INTERSTITIAL", + "IN_STREAM_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "creativeIds": { + "type": "string", + "description": "Select only ads with these creative IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeOptimizationConfigurationIds": { + "type": "string", + "description": "Select only ads with these creative optimization configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only ads with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "landingPageIds": { + "type": "string", + "description": "Select only ads with these landing page IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only ads with this event tag override ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Select only ads with these placement IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListIds": { + "type": "string", + "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only ads with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sslCompliant": { + "type": "boolean", + "description": "Select only ads that are SSL-compliant.", + "location": "query" + }, + "sslRequired": { + "type": "boolean", + "description": "Select only ads that require SSL.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only ads with these types.", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.ads.patch", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PATCH", + "description": "Updates an existing ad. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.ads.update", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PUT", + "description": "Updates an existing ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertiserGroups": { + "methods": { + "delete": { + "id": "dfareporting.advertiserGroups.delete", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing advertiser group.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.advertiserGroups.get", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertiserGroups.insert", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "POST", + "description": "Inserts a new advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertiserGroups.list", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "GET", + "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only advertiser groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertiserGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertiserGroups.patch", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertiserGroups.update", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PUT", + "description": "Updates an existing advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertisers": { + "methods": { + "get": { + "id": "dfareporting.advertisers.get", + "path": "userprofiles/{profileId}/advertisers/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertisers.insert", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "POST", + "description": "Inserts a new advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertisers.list", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "GET", + "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only advertisers with these advertiser group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightConfigurationIds": { + "type": "string", + "description": "Select only advertisers with these floodlight configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only advertisers with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "includeAdvertisersWithoutGroupsOnly": { + "type": "boolean", + "description": "Select only advertisers which do not belong to any advertiser group.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "onlyParent": { + "type": "boolean", + "description": "Select only advertisers which use another advertiser's floodlight configuration.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "status": { + "type": "string", + "description": "Select only advertisers with the specified status.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only advertisers with these subaccount IDs.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertisersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertisers.patch", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertisers.update", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PUT", + "description": "Updates an existing advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "browsers": { + "methods": { + "list": { + "id": "dfareporting.browsers.list", + "path": "userprofiles/{profileId}/browsers", + "httpMethod": "GET", + "description": "Retrieves a list of browsers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "BrowsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaignCreativeAssociations": { + "methods": { + "insert": { + "id": "dfareporting.campaignCreativeAssociations.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "POST", + "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "CampaignCreativeAssociation" + }, + "response": { + "$ref": "CampaignCreativeAssociation" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaignCreativeAssociations.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "GET", + "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "CampaignCreativeAssociationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaigns": { + "methods": { + "get": { + "id": "dfareporting.campaigns.get", + "path": "userprofiles/{profileId}/campaigns/{id}", + "httpMethod": "GET", + "description": "Gets one campaign by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.campaigns.insert", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "POST", + "description": "Inserts a new campaign.", + "parameters": { + "defaultLandingPageName": { + "type": "string", + "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + "required": true, + "location": "query" + }, + "defaultLandingPageUrl": { + "type": "string", + "description": "Default landing page URL for this new campaign.", + "required": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "defaultLandingPageName", + "defaultLandingPageUrl" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaigns.list", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "GET", + "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "advertiserIds": { + "type": "string", + "description": "Select only campaigns that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + "location": "query" + }, + "atLeastOneOptimizationActivity": { + "type": "boolean", + "description": "Select only campaigns that have at least one optimization activity.", + "location": "query" + }, + "excludedIds": { + "type": "string", + "description": "Exclude campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only campaigns that have overridden this event tag ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only campaigns that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CampaignsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.campaigns.patch", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PATCH", + "description": "Updates an existing campaign. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.campaigns.update", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PUT", + "description": "Updates an existing campaign.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "changeLogs": { + "methods": { + "get": { + "id": "dfareporting.changeLogs.get", + "path": "userprofiles/{profileId}/changeLogs/{id}", + "httpMethod": "GET", + "description": "Gets one change log by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Change log ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ChangeLog" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.changeLogs.list", + "path": "userprofiles/{profileId}/changeLogs", + "httpMethod": "GET", + "description": "Retrieves a list of change logs. This method supports paging.", + "parameters": { + "action": { + "type": "string", + "description": "Select only change logs with the specified action.", + "enum": [ + "ACTION_ADD", + "ACTION_ASSIGN", + "ACTION_ASSOCIATE", + "ACTION_CREATE", + "ACTION_DELETE", + "ACTION_DISABLE", + "ACTION_EMAIL_TAGS", + "ACTION_ENABLE", + "ACTION_LINK", + "ACTION_MARK_AS_DEFAULT", + "ACTION_PUSH", + "ACTION_REMOVE", + "ACTION_SEND", + "ACTION_SHARE", + "ACTION_UNASSIGN", + "ACTION_UNLINK", + "ACTION_UPDATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only change logs with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "minChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "objectIds": { + "type": "string", + "description": "Select only change logs with these object IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "objectType": { + "type": "string", + "description": "Select only change logs with the specified object type.", + "enum": [ + "OBJECT_ACCOUNT", + "OBJECT_ACCOUNT_BILLING_FEATURE", + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_ADVERTISER_GROUP", + "OBJECT_BILLING_ACCOUNT_GROUP", + "OBJECT_BILLING_FEATURE", + "OBJECT_BILLING_MINIMUM_FEE", + "OBJECT_BILLING_PROFILE", + "OBJECT_CAMPAIGN", + "OBJECT_CONTENT_CATEGORY", + "OBJECT_CREATIVE", + "OBJECT_CREATIVE_ASSET", + "OBJECT_CREATIVE_BUNDLE", + "OBJECT_CREATIVE_FIELD", + "OBJECT_CREATIVE_GROUP", + "OBJECT_DFA_SITE", + "OBJECT_EVENT_TAG", + "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + "OBJECT_FLOODLIGHT_ACTVITY", + "OBJECT_FLOODLIGHT_CONFIGURATION", + "OBJECT_INSTREAM_CREATIVE", + "OBJECT_LANDING_PAGE", + "OBJECT_MEDIA_ORDER", + "OBJECT_PLACEMENT", + "OBJECT_PLACEMENT_STRATEGY", + "OBJECT_PLAYSTORE_LINK", + "OBJECT_PROVIDED_LIST_CLIENT", + "OBJECT_RATE_CARD", + "OBJECT_REMARKETING_LIST", + "OBJECT_RICHMEDIA_CREATIVE", + "OBJECT_SD_SITE", + "OBJECT_SEARCH_LIFT_STUDY", + "OBJECT_SIZE", + "OBJECT_SUBACCOUNT", + "OBJECT_TARGETING_TEMPLATE", + "OBJECT_USER_PROFILE", + "OBJECT_USER_PROFILE_FILTER", + "OBJECT_USER_ROLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + "location": "query" + }, + "userProfileIds": { + "type": "string", + "description": "Select only change logs with these user profile IDs.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ChangeLogsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "cities": { + "methods": { + "list": { + "id": "dfareporting.cities.list", + "path": "userprofiles/{profileId}/cities", + "httpMethod": "GET", + "description": "Retrieves a list of cities, possibly filtered.", + "parameters": { + "countryDartIds": { + "type": "string", + "description": "Select only cities from these countries.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "dartIds": { + "type": "string", + "description": "Select only cities with these DART IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "namePrefix": { + "type": "string", + "description": "Select only cities with names starting with this prefix.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "regionDartIds": { + "type": "string", + "description": "Select only cities from these regions.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "connectionTypes": { + "methods": { + "get": { + "id": "dfareporting.connectionTypes.get", + "path": "userprofiles/{profileId}/connectionTypes/{id}", + "httpMethod": "GET", + "description": "Gets one connection type by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Connection type ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ConnectionType" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.connectionTypes.list", + "path": "userprofiles/{profileId}/connectionTypes", + "httpMethod": "GET", + "description": "Retrieves a list of connection types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ConnectionTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "contentCategories": { + "methods": { + "delete": { + "id": "dfareporting.contentCategories.delete", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing content category.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.contentCategories.get", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "GET", + "description": "Gets one content category by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.contentCategories.insert", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "POST", + "description": "Inserts a new content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.contentCategories.list", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "GET", + "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only content categories with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ContentCategoriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.contentCategories.patch", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PATCH", + "description": "Updates an existing content category. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.contentCategories.update", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PUT", + "description": "Updates an existing content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "conversions": { + "methods": { + "batchinsert": { + "id": "dfareporting.conversions.batchinsert", + "path": "userprofiles/{profileId}/conversions/batchinsert", + "httpMethod": "POST", + "description": "Inserts conversions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ConversionsBatchInsertRequest" + }, + "response": { + "$ref": "ConversionsBatchInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/ddmconversions" + ] + }, + "batchupdate": { + "id": "dfareporting.conversions.batchupdate", + "path": "userprofiles/{profileId}/conversions/batchupdate", + "httpMethod": "POST", + "description": "Updates existing conversions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ConversionsBatchUpdateRequest" + }, + "response": { + "$ref": "ConversionsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/ddmconversions" + ] + } + } + }, + "countries": { + "methods": { + "get": { + "id": "dfareporting.countries.get", + "path": "userprofiles/{profileId}/countries/{dartId}", + "httpMethod": "GET", + "description": "Gets one country by ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Country DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "Country" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.countries.list", + "path": "userprofiles/{profileId}/countries", + "httpMethod": "GET", + "description": "Retrieves a list of countries.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CountriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeAssets": { + "methods": { + "insert": { + "id": "dfareporting.creativeAssets.insert", + "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + "httpMethod": "POST", + "description": "Inserts a new creative asset.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "request": { + "$ref": "CreativeAssetMetadata" + }, + "response": { + "$ref": "CreativeAssetMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "1024MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + } + } + } + } + } + }, + "creativeFieldValues": { + "methods": { + "delete": { + "id": "dfareporting.creativeFieldValues.delete", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFieldValues.get", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "GET", + "description": "Gets one creative field value by ID.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFieldValues.insert", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "POST", + "description": "Inserts a new creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFieldValues.list", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "GET", + "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "ids": { + "type": "string", + "description": "Select only creative field values with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "VALUE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "response": { + "$ref": "CreativeFieldValuesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFieldValues.patch", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PATCH", + "description": "Updates an existing creative field value. This method supports patch semantics.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFieldValues.update", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PUT", + "description": "Updates an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeFields": { + "methods": { + "delete": { + "id": "dfareporting.creativeFields.delete", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFields.get", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "GET", + "description": "Gets one creative field by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFields.insert", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "POST", + "description": "Inserts a new creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFields.list", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "GET", + "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative fields that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative fields with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeFieldsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFields.patch", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PATCH", + "description": "Updates an existing creative field. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFields.update", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PUT", + "description": "Updates an existing creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeGroups": { + "methods": { + "get": { + "id": "dfareporting.creativeGroups.get", + "path": "userprofiles/{profileId}/creativeGroups/{id}", + "httpMethod": "GET", + "description": "Gets one creative group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeGroups.insert", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "POST", + "description": "Inserts a new creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeGroups.list", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "GET", + "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupNumber": { + "type": "integer", + "description": "Select only creative groups that belong to this subgroup.", + "format": "int32", + "minimum": "1", + "maximum": "2", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeGroups.patch", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PATCH", + "description": "Updates an existing creative group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeGroups.update", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PUT", + "description": "Updates an existing creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creatives": { + "methods": { + "get": { + "id": "dfareporting.creatives.get", + "path": "userprofiles/{profileId}/creatives/{id}", + "httpMethod": "GET", + "description": "Gets one creative by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creatives.insert", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "POST", + "description": "Inserts a new creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creatives.list", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "GET", + "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only creatives with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only creatives with this campaign ID.", + "format": "int64", + "location": "query" + }, + "companionCreativeIds": { + "type": "string", + "description": "Select only in-stream video creatives with these companion IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeFieldIds": { + "type": "string", + "description": "Select only creatives with these creative field IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creatives with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "renderingIds": { + "type": "string", + "description": "Select only creatives with these rendering IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only creatives with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "studioCreativeId": { + "type": "string", + "description": "Select only creatives corresponding to this Studio creative ID.", + "format": "int64", + "location": "query" + }, + "types": { + "type": "string", + "description": "Select only creatives with these creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_DISPLAY", + "CUSTOM_DISPLAY_INTERSTITIAL", + "DISPLAY", + "DISPLAY_IMAGE_GALLERY", + "DISPLAY_REDIRECT", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INSTREAM_VIDEO_REDIRECT", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "RICH_MEDIA_DISPLAY_BANNER", + "RICH_MEDIA_DISPLAY_EXPANDING", + "RICH_MEDIA_DISPLAY_INTERSTITIAL", + "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VPAID_LINEAR_VIDEO", + "VPAID_NON_LINEAR_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creatives.patch", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PATCH", + "description": "Updates an existing creative. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creatives.update", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PUT", + "description": "Updates an existing creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "dimensionValues": { + "methods": { + "query": { + "id": "dfareporting.dimensionValues.query", + "path": "userprofiles/{profileId}/dimensionvalues/query", + "httpMethod": "POST", + "description": "Retrieves list of report dimension values for a list of filters.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "100", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DimensionValueRequest" + }, + "response": { + "$ref": "DimensionValueList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "directorySiteContacts": { + "methods": { + "get": { + "id": "dfareporting.directorySiteContacts.get", + "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + "httpMethod": "GET", + "description": "Gets one directory site contact by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site contact ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySiteContact" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySiteContacts.list", + "path": "userprofiles/{profileId}/directorySiteContacts", + "httpMethod": "GET", + "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.", + "parameters": { + "directorySiteIds": { + "type": "string", + "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory site contacts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySiteContactsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "directorySites": { + "methods": { + "get": { + "id": "dfareporting.directorySites.get", + "path": "userprofiles/{profileId}/directorySites/{id}", + "httpMethod": "GET", + "description": "Gets one directory site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.directorySites.insert", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "POST", + "description": "Inserts a new directory site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DirectorySite" + }, + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySites.list", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "GET", + "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + "location": "query" + }, + "active": { + "type": "boolean", + "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + "location": "query" + }, + "countryId": { + "type": "string", + "description": "Select only directory sites with this country ID.", + "format": "int64", + "location": "query" + }, + "dfpNetworkCode": { + "type": "string", + "description": "Select only directory sites with this DFP network code.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "parentId": { + "type": "string", + "description": "Select only directory sites with this parent ID.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "dynamicTargetingKeys": { + "methods": { + "delete": { + "id": "dfareporting.dynamicTargetingKeys.delete", + "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}", + "httpMethod": "DELETE", + "description": "Deletes an existing dynamic targeting key.", + "parameters": { + "name": { + "type": "string", + "description": "Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase.", + "required": true, + "location": "query" + }, + "objectId": { + "type": "string", + "description": "ID of the object of this dynamic targeting key. This is a required field.", + "required": true, + "format": "int64", + "location": "path" + }, + "objectType": { + "type": "string", + "description": "Type of the object of this dynamic targeting key. This is a required field.", + "required": true, + "enum": [ + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_CREATIVE", + "OBJECT_PLACEMENT" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "objectId", + "name", + "objectType" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.dynamicTargetingKeys.insert", + "path": "userprofiles/{profileId}/dynamicTargetingKeys", + "httpMethod": "POST", + "description": "Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DynamicTargetingKey" + }, + "response": { + "$ref": "DynamicTargetingKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.dynamicTargetingKeys.list", + "path": "userprofiles/{profileId}/dynamicTargetingKeys", + "httpMethod": "GET", + "description": "Retrieves a list of dynamic targeting keys.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only dynamic targeting keys whose object has this advertiser ID.", + "format": "int64", + "location": "query" + }, + "names": { + "type": "string", + "description": "Select only dynamic targeting keys exactly matching these names.", + "repeated": true, + "location": "query" + }, + "objectId": { + "type": "string", + "description": "Select only dynamic targeting keys with this object ID.", + "format": "int64", + "location": "query" + }, + "objectType": { + "type": "string", + "description": "Select only dynamic targeting keys with this object type.", + "enum": [ + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_CREATIVE", + "OBJECT_PLACEMENT" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DynamicTargetingKeysListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "eventTags": { + "methods": { + "delete": { + "id": "dfareporting.eventTags.delete", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing event tag.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.eventTags.get", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "GET", + "description": "Gets one event tag by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.eventTags.insert", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "POST", + "description": "Inserts a new event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.eventTags.list", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "GET", + "description": "Retrieves a list of event tags, possibly filtered.", + "parameters": { + "adId": { + "type": "string", + "description": "Select only event tags that belong to this ad.", + "format": "int64", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only event tags that belong to this advertiser.", + "format": "int64", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only event tags that belong to this campaign.", + "format": "int64", + "location": "query" + }, + "definitionsOnly": { + "type": "boolean", + "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + "location": "query" + }, + "enabled": { + "type": "boolean", + "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + "location": "query" + }, + "eventTagTypes": { + "type": "string", + "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only event tags with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "EventTagsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.eventTags.patch", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PATCH", + "description": "Updates an existing event tag. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.eventTags.update", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PUT", + "description": "Updates an existing event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "files": { + "methods": { + "get": { + "id": "dfareporting.files.get", + "path": "reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file by its report ID and file ID. This method supports media download.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "dfareporting.files.list", + "path": "userprofiles/{profileId}/files", + "httpMethod": "GET", + "description": "Lists files for a user profile.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "10", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "scope": { + "type": "string", + "description": "The scope that defines which results are returned.", + "default": "MINE", + "enum": [ + "ALL", + "MINE", + "SHARED_WITH_ME" + ], + "enumDescriptions": [ + "All files in account.", + "My files.", + "Files shared with me." + ], + "location": "query" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "floodlightActivities": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivities.delete", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "generatetag": { + "id": "dfareporting.floodlightActivities.generatetag", + "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + "httpMethod": "POST", + "description": "Generates a tag for a floodlight activity.", + "parameters": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID for which we want to generate a tag.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesGenerateTagResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivities.get", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivities.insert", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivities.list", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightActivityGroupIds": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group name.", + "location": "query" + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + "location": "query" + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "tagString": { + "type": "string", + "description": "Select only floodlight activities with the specified tag string.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivities.patch", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivities.update", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightActivityGroups": { + "methods": { + "get": { + "id": "dfareporting.floodlightActivityGroups.get", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivityGroups.insert", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivityGroups.list", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivityGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivityGroups.patch", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivityGroups.update", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightConfigurations": { + "methods": { + "get": { + "id": "dfareporting.floodlightConfigurations.get", + "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight configuration by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightConfigurations.list", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight configurations, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightConfigurationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightConfigurations.patch", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightConfigurations.update", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PUT", + "description": "Updates an existing floodlight configuration.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "inventoryItems": { + "methods": { + "get": { + "id": "dfareporting.inventoryItems.get", + "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}", + "httpMethod": "GET", + "description": "Gets one inventory item by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Inventory item ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "InventoryItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.inventoryItems.list", + "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems", + "httpMethod": "GET", + "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only inventory items with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "inPlan": { + "type": "boolean", + "description": "Select only inventory items that are in plan.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Select only inventory items that belong to specified orders.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + }, + "siteId": { + "type": "string", + "description": "Select only inventory items that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only inventory items with this type.", + "enum": [ + "PLANNING_PLACEMENT_TYPE_CREDIT", + "PLANNING_PLACEMENT_TYPE_REGULAR" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "InventoryItemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "landingPages": { + "methods": { + "delete": { + "id": "dfareporting.landingPages.delete", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.landingPages.get", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "GET", + "description": "Gets one campaign landing page by ID.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.landingPages.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "POST", + "description": "Inserts a new landing page for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.landingPages.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "GET", + "description": "Retrieves the list of landing pages for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "LandingPagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.landingPages.patch", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PATCH", + "description": "Updates an existing campaign landing page. This method supports patch semantics.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.landingPages.update", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PUT", + "description": "Updates an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "languages": { + "methods": { + "list": { + "id": "dfareporting.languages.list", + "path": "userprofiles/{profileId}/languages", + "httpMethod": "GET", + "description": "Retrieves a list of languages.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "LanguagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "metros": { + "methods": { + "list": { + "id": "dfareporting.metros.list", + "path": "userprofiles/{profileId}/metros", + "httpMethod": "GET", + "description": "Retrieves a list of metros.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MetrosListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "mobileCarriers": { + "methods": { + "get": { + "id": "dfareporting.mobileCarriers.get", + "path": "userprofiles/{profileId}/mobileCarriers/{id}", + "httpMethod": "GET", + "description": "Gets one mobile carrier by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Mobile carrier ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "MobileCarrier" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.mobileCarriers.list", + "path": "userprofiles/{profileId}/mobileCarriers", + "httpMethod": "GET", + "description": "Retrieves a list of mobile carriers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MobileCarriersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystemVersions": { + "methods": { + "get": { + "id": "dfareporting.operatingSystemVersions.get", + "path": "userprofiles/{profileId}/operatingSystemVersions/{id}", + "httpMethod": "GET", + "description": "Gets one operating system version by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Operating system version ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "OperatingSystemVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.operatingSystemVersions.list", + "path": "userprofiles/{profileId}/operatingSystemVersions", + "httpMethod": "GET", + "description": "Retrieves a list of operating system versions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemVersionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystems": { + "methods": { + "get": { + "id": "dfareporting.operatingSystems.get", + "path": "userprofiles/{profileId}/operatingSystems/{dartId}", + "httpMethod": "GET", + "description": "Gets one operating system by DART ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Operating system DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "OperatingSystem" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.operatingSystems.list", + "path": "userprofiles/{profileId}/operatingSystems", + "httpMethod": "GET", + "description": "Retrieves a list of operating systems.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "orderDocuments": { + "methods": { + "get": { + "id": "dfareporting.orderDocuments.get", + "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}", + "httpMethod": "GET", + "description": "Gets one order document by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Order document ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "OrderDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.orderDocuments.list", + "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments", + "httpMethod": "GET", + "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.", + "parameters": { + "approved": { + "type": "boolean", + "description": "Select only order documents that have been approved by at least one user.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only order documents with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Select only order documents for specified orders.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, \"orderdocument*2015\" will return order documents with names like \"orderdocument June 2015\", \"orderdocument April 2015\", or simply \"orderdocument 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"orderdocument\" will match order documents with name \"my orderdocument\", \"orderdocument 2015\", or simply \"orderdocument\".", + "location": "query" + }, + "siteId": { + "type": "string", + "description": "Select only order documents that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "OrderDocumentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "orders": { + "methods": { + "get": { + "id": "dfareporting.orders.get", + "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}", + "httpMethod": "GET", + "description": "Gets one order by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Order ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for orders.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.orders.list", + "path": "userprofiles/{profileId}/projects/{projectId}/orders", + "httpMethod": "GET", + "description": "Retrieves a list of orders, possibly filtered. This method supports paging.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only orders with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for orders.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, \"order*2015\" will return orders with names like \"order June 2015\", \"order April 2015\", or simply \"order 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"order\" will match orders with name \"my order\", \"order 2015\", or simply \"order\".", + "location": "query" + }, + "siteId": { + "type": "string", + "description": "Select only orders that are associated with these site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "OrdersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementGroups": { + "methods": { + "get": { + "id": "dfareporting.placementGroups.get", + "path": "userprofiles/{profileId}/placementGroups/{id}", + "httpMethod": "GET", + "description": "Gets one placement group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementGroups.insert", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "POST", + "description": "Inserts a new placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementGroups.list", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "GET", + "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placement groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placement groups that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placement groups that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placement groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "800", + "format": "int32", + "minimum": "0", + "maximum": "800", + "location": "query" + }, + "maxStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementGroupType": { + "type": "string", + "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placement groups that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placement groups with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_CPM_ACTIVEVIEW", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementGroups.patch", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PATCH", + "description": "Updates an existing placement group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementGroups.update", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PUT", + "description": "Updates an existing placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementStrategies": { + "methods": { + "delete": { + "id": "dfareporting.placementStrategies.delete", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing placement strategy.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placementStrategies.get", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "GET", + "description": "Gets one placement strategy by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementStrategies.insert", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "POST", + "description": "Inserts a new placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementStrategies.list", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "GET", + "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only placement strategies with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementStrategiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementStrategies.patch", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PATCH", + "description": "Updates an existing placement strategy. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementStrategies.update", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PUT", + "description": "Updates an existing placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placements": { + "methods": { + "generatetags": { + "id": "dfareporting.placements.generatetags", + "path": "userprofiles/{profileId}/placements/generatetags", + "httpMethod": "POST", + "description": "Generates tags for a placement.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Generate placements belonging to this campaign. This is a required field.", + "format": "int64", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Generate tags for these placements.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "tagFormats": { + "type": "string", + "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsGenerateTagsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placements.get", + "path": "userprofiles/{profileId}/placements/{id}", + "httpMethod": "GET", + "description": "Gets one placement by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placements.insert", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "POST", + "description": "Inserts a new placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placements.list", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "GET", + "description": "Retrieves a list of placements, possibly filtered. This method supports paging.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placements that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placements that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibilities": { + "type": "string", + "description": "Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "DISPLAY", + "DISPLAY_INTERSTITIAL", + "IN_STREAM_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placements that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placements that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupIds": { + "type": "string", + "description": "Select only placements that belong to these placement groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placements with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "maxStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "paymentSource": { + "type": "string", + "description": "Select only placements with this payment source.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placements that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placements with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_CPM_ACTIVEVIEW", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placements that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only placements that are associated with these sizes.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placements.patch", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PATCH", + "description": "Updates an existing placement. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placements.update", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PUT", + "description": "Updates an existing placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "platformTypes": { + "methods": { + "get": { + "id": "dfareporting.platformTypes.get", + "path": "userprofiles/{profileId}/platformTypes/{id}", + "httpMethod": "GET", + "description": "Gets one platform type by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Platform type ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlatformType" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.platformTypes.list", + "path": "userprofiles/{profileId}/platformTypes", + "httpMethod": "GET", + "description": "Retrieves a list of platform types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlatformTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "postalCodes": { + "methods": { + "get": { + "id": "dfareporting.postalCodes.get", + "path": "userprofiles/{profileId}/postalCodes/{code}", + "httpMethod": "GET", + "description": "Gets one postal code by ID.", + "parameters": { + "code": { + "type": "string", + "description": "Postal code ID.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "code" + ], + "response": { + "$ref": "PostalCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.postalCodes.list", + "path": "userprofiles/{profileId}/postalCodes", + "httpMethod": "GET", + "description": "Retrieves a list of postal codes.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PostalCodesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "dfareporting.projects.get", + "path": "userprofiles/{profileId}/projects/{id}", + "httpMethod": "GET", + "description": "Gets one project by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Project ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.projects.list", + "path": "userprofiles/{profileId}/projects", + "httpMethod": "GET", + "description": "Retrieves a list of projects, possibly filtered. This method supports paging.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only projects with these advertiser IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only projects with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, \"project*2015\" will return projects with names like \"project June 2015\", \"project April 2015\", or simply \"project 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"project\" will match projects with name \"my project\", \"project 2015\", or simply \"project\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ProjectsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "regions": { + "methods": { + "list": { + "id": "dfareporting.regions.list", + "path": "userprofiles/{profileId}/regions", + "httpMethod": "GET", + "description": "Retrieves a list of regions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "RegionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "remarketingListShares": { + "methods": { + "get": { + "id": "dfareporting.remarketingListShares.get", + "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}", + "httpMethod": "GET", + "description": "Gets one remarketing list share by remarketing list ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "remarketingListId" + ], + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.remarketingListShares.patch", + "path": "userprofiles/{profileId}/remarketingListShares", + "httpMethod": "PATCH", + "description": "Updates an existing remarketing list share. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "remarketingListId" + ], + "request": { + "$ref": "RemarketingListShare" + }, + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.remarketingListShares.update", + "path": "userprofiles/{profileId}/remarketingListShares", + "httpMethod": "PUT", + "description": "Updates an existing remarketing list share.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingListShare" + }, + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "remarketingLists": { + "methods": { + "get": { + "id": "dfareporting.remarketingLists.get", + "path": "userprofiles/{profileId}/remarketingLists/{id}", + "httpMethod": "GET", + "description": "Gets one remarketing list by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.remarketingLists.insert", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "POST", + "description": "Inserts a new remarketing list.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.remarketingLists.list", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "GET", + "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active or only inactive remarketing lists.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only remarketing lists owned by this advertiser.", + "required": true, + "format": "int64", + "location": "query" + }, + "floodlightActivityId": { + "type": "string", + "description": "Select only remarketing lists that have this floodlight activity ID.", + "format": "int64", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "name": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "response": { + "$ref": "RemarketingListsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.remarketingLists.patch", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "PATCH", + "description": "Updates an existing remarketing list. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.remarketingLists.update", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "PUT", + "description": "Updates an existing remarketing list.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "reports": { + "methods": { + "delete": { + "id": "dfareporting.reports.delete", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "DELETE", + "description": "Deletes a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "get": { + "id": "dfareporting.reports.get", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "GET", + "description": "Retrieves a report by its ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "insert": { + "id": "dfareporting.reports.insert", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "POST", + "description": "Creates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "list": { + "id": "dfareporting.reports.list", + "path": "userprofiles/{profileId}/reports", + "httpMethod": "GET", + "description": "Retrieves list of reports.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "10", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "scope": { + "type": "string", + "description": "The scope that defines which results are returned.", + "default": "MINE", + "enum": [ + "ALL", + "MINE" + ], + "enumDescriptions": [ + "All reports in account.", + "My reports." + ], + "location": "query" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME", + "NAME" + ], + "enumDescriptions": [ + "Sort by report ID.", + "Sort by 'lastModifiedTime' field.", + "Sort by name of reports." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ReportList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "patch": { + "id": "dfareporting.reports.patch", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PATCH", + "description": "Updates a report. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "run": { + "id": "dfareporting.reports.run", + "path": "userprofiles/{profileId}/reports/{reportId}/run", + "httpMethod": "POST", + "description": "Runs a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + }, + "synchronous": { + "type": "boolean", + "description": "If set and true, tries to run the report synchronously.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + }, + "update": { + "id": "dfareporting.reports.update", + "path": "userprofiles/{profileId}/reports/{reportId}", + "httpMethod": "PUT", + "description": "Updates a report.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + }, + "resources": { + "compatibleFields": { + "methods": { + "query": { + "id": "dfareporting.reports.compatibleFields.query", + "path": "userprofiles/{profileId}/reports/compatiblefields/query", + "httpMethod": "POST", + "description": "Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions.", + "parameters": { + "profileId": { + "type": "string", + "description": "The DFA user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Report" + }, + "response": { + "$ref": "CompatibleFields" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + }, + "files": { + "methods": { + "get": { + "id": "dfareporting.reports.files.get", + "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}", + "httpMethod": "GET", + "description": "Retrieves a report file. This method supports media download.", + "parameters": { + "fileId": { + "type": "string", + "description": "The ID of the report file.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the report.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "reportId", + "fileId" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "dfareporting.reports.files.list", + "path": "userprofiles/{profileId}/reports/{reportId}/files", + "httpMethod": "GET", + "description": "Lists files for a report.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "10", + "format": "int32", + "minimum": "0", + "maximum": "10", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "The DFA profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "reportId": { + "type": "string", + "description": "The ID of the parent report.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "The field by which to sort the list.", + "default": "LAST_MODIFIED_TIME", + "enum": [ + "ID", + "LAST_MODIFIED_TIME" + ], + "enumDescriptions": [ + "Sort by file ID.", + "Sort by 'lastmodifiedAt' field." + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "DESCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "Ascending order.", + "Descending order." + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "reportId" + ], + "response": { + "$ref": "FileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting" + ] + } + } + } + } + }, + "sites": { + "methods": { + "get": { + "id": "dfareporting.sites.get", + "path": "userprofiles/{profileId}/sites/{id}", + "httpMethod": "GET", + "description": "Gets one site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sites.insert", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "POST", + "description": "Inserts a new site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sites.list", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "GET", + "description": "Retrieves a list of sites, possibly filtered. This method supports paging.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only sites that accept publisher paid placements.", + "location": "query" + }, + "adWordsSite": { + "type": "boolean", + "description": "Select only AdWords sites.", + "location": "query" + }, + "approved": { + "type": "boolean", + "description": "Select only approved sites.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only sites with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only sites with these directory site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only sites with this subaccount ID.", + "format": "int64", + "location": "query" + }, + "unmappedSite": { + "type": "boolean", + "description": "Select only sites that have not been mapped to a directory site.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.sites.patch", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PATCH", + "description": "Updates an existing site. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.sites.update", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PUT", + "description": "Updates an existing site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "sizes": { + "methods": { + "get": { + "id": "dfareporting.sizes.get", + "path": "userprofiles/{profileId}/sizes/{id}", + "httpMethod": "GET", + "description": "Gets one size by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Size ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sizes.insert", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "POST", + "description": "Inserts a new size.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Size" + }, + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sizes.list", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "GET", + "description": "Retrieves a list of sizes, possibly filtered.", + "parameters": { + "height": { + "type": "integer", + "description": "Select only sizes with this height.", + "format": "int32", + "minimum": "0", + "maximum": "32767", + "location": "query" + }, + "iabStandard": { + "type": "boolean", + "description": "Select only IAB standard sizes.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sizes with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "width": { + "type": "integer", + "description": "Select only sizes with this width.", + "format": "int32", + "minimum": "0", + "maximum": "32767", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SizesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "subaccounts": { + "methods": { + "get": { + "id": "dfareporting.subaccounts.get", + "path": "userprofiles/{profileId}/subaccounts/{id}", + "httpMethod": "GET", + "description": "Gets one subaccount by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.subaccounts.insert", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "POST", + "description": "Inserts a new subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.subaccounts.list", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "GET", + "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only subaccounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SubaccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.subaccounts.patch", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PATCH", + "description": "Updates an existing subaccount. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.subaccounts.update", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PUT", + "description": "Updates an existing subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "targetableRemarketingLists": { + "methods": { + "get": { + "id": "dfareporting.targetableRemarketingLists.get", + "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}", + "httpMethod": "GET", + "description": "Gets one remarketing list by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "TargetableRemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.targetableRemarketingLists.list", + "path": "userprofiles/{profileId}/targetableRemarketingLists", + "httpMethod": "GET", + "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active or only inactive targetable remarketing lists.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only targetable remarketing lists targetable by these advertisers.", + "required": true, + "format": "int64", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "name": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "response": { + "$ref": "TargetableRemarketingListsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "targetingTemplates": { + "methods": { + "get": { + "id": "dfareporting.targetingTemplates.get", + "path": "userprofiles/{profileId}/targetingTemplates/{id}", + "httpMethod": "GET", + "description": "Gets one targeting template by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Targeting template ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "TargetingTemplate" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.targetingTemplates.insert", + "path": "userprofiles/{profileId}/targetingTemplates", + "httpMethod": "POST", + "description": "Inserts a new targeting template.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "TargetingTemplate" + }, + "response": { + "$ref": "TargetingTemplate" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.targetingTemplates.list", + "path": "userprofiles/{profileId}/targetingTemplates", + "httpMethod": "GET", + "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only targeting templates with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only targeting templates with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"template*2015\" will return objects with names like \"template June 2015\", \"template April 2015\", or simply \"template 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"template\" will match objects with name \"my template\", \"template 2015\", or simply \"template\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "TargetingTemplatesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.targetingTemplates.patch", + "path": "userprofiles/{profileId}/targetingTemplates", + "httpMethod": "PATCH", + "description": "Updates an existing targeting template. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Targeting template ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "TargetingTemplate" + }, + "response": { + "$ref": "TargetingTemplate" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.targetingTemplates.update", + "path": "userprofiles/{profileId}/targetingTemplates", + "httpMethod": "PUT", + "description": "Updates an existing targeting template.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "TargetingTemplate" + }, + "response": { + "$ref": "TargetingTemplate" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userProfiles": { + "methods": { + "get": { + "id": "dfareporting.userProfiles.get", + "path": "userprofiles/{profileId}", + "httpMethod": "GET", + "description": "Gets one user profile by ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "The user profile ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting", + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userProfiles.list", + "path": "userprofiles", + "httpMethod": "GET", + "description": "Retrieves list of user profiles for a user.", + "response": { + "$ref": "UserProfileList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfareporting", + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissionGroups.get", + "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissionGroups.list", + "path": "userprofiles/{profileId}/userRolePermissionGroups", + "httpMethod": "GET", + "description": "Gets a list of all supported user role permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissions": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissions.get", + "path": "userprofiles/{profileId}/userRolePermissions/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissions.list", + "path": "userprofiles/{profileId}/userRolePermissions", + "httpMethod": "GET", + "description": "Gets a list of user role permissions, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only user role permissions with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRoles": { + "methods": { + "delete": { + "id": "dfareporting.userRoles.delete", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing user role.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.userRoles.get", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "GET", + "description": "Gets one user role by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.userRoles.insert", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "POST", + "description": "Inserts a new user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRoles.list", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "GET", + "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.", + "parameters": { + "accountUserRoleOnly": { + "type": "boolean", + "description": "Select only account level user roles not associated with any specific subaccount.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user roles with the specified IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "default": "1000", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "default": "ID", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results.", + "default": "ASCENDING", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user roles that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.userRoles.patch", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PATCH", + "description": "Updates an existing user role. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.userRoles.update", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PUT", + "description": "Updates an existing user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "videoFormats": { + "methods": { + "get": { + "id": "dfareporting.videoFormats.get", + "path": "userprofiles/{profileId}/videoFormats/{id}", + "httpMethod": "GET", + "description": "Gets one video format by ID.", + "parameters": { + "id": { + "type": "integer", + "description": "Video format ID.", + "required": true, + "format": "int32", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "VideoFormat" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.videoFormats.list", + "path": "userprofiles/{profileId}/videoFormats", + "httpMethod": "GET", + "description": "Lists available video formats.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "VideoFormatsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + } + } +} diff --git a/etc/api/discovery/v1/discovery-api.json b/etc/api/discovery/v1/discovery-api.json index b240e12e08..bc7d62f26e 100644 --- a/etc/api/discovery/v1/discovery-api.json +++ b/etc/api/discovery/v1/discovery-api.json @@ -1,6 +1,6 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Pyg0A4J33Dq212hoe9BYpSm0dl4\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/K3nEDF6hixE8Pks2-9Ysn9j9prQ\"", "discoveryVersion": "v1", "id": "discovery:v1", "name": "discovery", @@ -19,7 +19,7 @@ "basePath": "/discovery/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "discovery/v1/", - "batchPath": "batch", + "batchPath": "batch/discovery/v1", "parameters": { "alt": { "type": "string", @@ -319,8 +319,7 @@ }, "batchPath": { "type": "string", - "description": "The path for REST batch requests.", - "default": "batch" + "description": "The path for REST batch requests." }, "canonicalName": { "type": "string", diff --git a/etc/api/dlp/v2beta1/crates/1.0.6-api+20170918 b/etc/api/dlp/v2beta1/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dlp/v2beta1/crates/1.0.6-cli+20170918 b/etc/api/dlp/v2beta1/crates/1.0.6-cli+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dlp/v2beta1/dlp-api.json b/etc/api/dlp/v2beta1/dlp-api.json new file mode 100644 index 0000000000..5b3b7fcca8 --- /dev/null +++ b/etc/api/dlp/v2beta1/dlp-api.json @@ -0,0 +1,2596 @@ +{ + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "GoogleTypeDate": { + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "year": { + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "format": "int32", + "type": "integer" + }, + "day": { + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", + "format": "int32", + "type": "integer" + }, + "month": { + "description": "Month of year. Must be from 1 to 12.", + "format": "int32", + "type": "integer" + } + }, + "id": "GoogleTypeDate" + }, + "GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig": { + "description": "Replace each matching finding with the name of the info_type.", + "type": "object", + "properties": {}, + "id": "GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig" + }, + "GooglePrivacyDlpV2beta1ImageRedactionConfig": { + "properties": { + "redactionColor": { + "$ref": "GooglePrivacyDlpV2beta1Color", + "description": "The color to use when redacting content from an image. If not specified,\nthe default is black." + }, + "redactAllText": { + "description": "If true, all text found in the image, regardless whether it matches an\ninfo_type, is redacted.", + "type": "boolean" + }, + "infoType": { + "$ref": "GooglePrivacyDlpV2beta1InfoType", + "description": "Only one per info_type should be provided per request. If not\nspecified, and redact_all_text is false, the DLP API will redact all\ntext that it matches against all info_types that are found, but not\nspecified in another ImageRedactionConfig." + } + }, + "id": "GooglePrivacyDlpV2beta1ImageRedactionConfig", + "description": "Configuration for determing how redaction of images should occur.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Location": { + "description": "Specifies the location of a finding within its source item.", + "type": "object", + "properties": { + "recordKey": { + "$ref": "GooglePrivacyDlpV2beta1RecordKey", + "description": "Key of the finding." + }, + "tableLocation": { + "description": "Location within a `ContentItem.Table`.", + "$ref": "GooglePrivacyDlpV2beta1TableLocation" + }, + "codepointRange": { + "$ref": "GooglePrivacyDlpV2beta1Range", + "description": "Character offsets within a content item, included when content type\nis a text. Default charset assumed to be UTF-8." + }, + "fieldId": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "Field id of the field containing the finding." + }, + "imageBoxes": { + "description": "Location within an image's pixels.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ImageLocation" + } + }, + "byteRange": { + "description": "Zero-based byte offsets within a content item.", + "$ref": "GooglePrivacyDlpV2beta1Range" + } + }, + "id": "GooglePrivacyDlpV2beta1Location" + }, + "GooglePrivacyDlpV2beta1RecordSuppression": { + "description": "Configuration to suppress records whose suppression conditions evaluate to\ntrue.", + "type": "object", + "properties": { + "condition": { + "$ref": "GooglePrivacyDlpV2beta1RecordCondition" + } + }, + "id": "GooglePrivacyDlpV2beta1RecordSuppression" + }, + "GooglePrivacyDlpV2beta1InfoTypeDescription": { + "description": "Description of the information type (infoType).", + "type": "object", + "properties": { + "name": { + "description": "Internal name of the infoType.", + "type": "string" + }, + "displayName": { + "description": "Human readable form of the infoType name.", + "type": "string" + }, + "categories": { + "description": "List of categories this infoType belongs to.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1CategoryDescription" + } + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeDescription" + }, + "GooglePrivacyDlpV2beta1EntityId": { + "description": "An entity in a dataset is a field or set of fields that correspond to a\nsingle person. For example, in medical records the `EntityId` might be\na patient identifier, or for financial records it might be an account\nidentifier. This message is used when generalizations or analysis must be\nconsistent across multiple rows pertaining to the same entity.", + "type": "object", + "properties": { + "field": { + "description": "Composite key indicating which field contains the entity identifier.", + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + }, + "id": "GooglePrivacyDlpV2beta1EntityId" + }, + "GooglePrivacyDlpV2beta1UnwrappedCryptoKey": { + "description": "Using raw keys is prone to security risks due to accidentally\nleaking the key. Choose another type of key if possible.", + "type": "object", + "properties": { + "key": { + "description": "The AES 128/192/256 bit key. [required]", + "format": "byte", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1UnwrappedCryptoKey" + }, + "GoogleRpcStatus": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "type": "array", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + } + }, + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + } + }, + "id": "GoogleRpcStatus" + }, + "GooglePrivacyDlpV2beta1PathElement": { + "description": "A (kind, ID/name) pair used to construct a key path.\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete.", + "type": "object", + "properties": { + "kind": { + "description": "The kind of the entity.\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", + "type": "string" + }, + "id": { + "description": "The auto-allocated ID of the entity.\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.", + "format": "int64", + "type": "string" + }, + "name": { + "description": "The name of the entity.\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1PathElement" + }, + "GooglePrivacyDlpV2beta1SummaryResult": { + "description": "A collection that informs the user the number of times a particular\n`TransformationResultCode` and error details occurred.", + "type": "object", + "properties": { + "details": { + "description": "A place for warnings or errors to show up if a transformation didn't\nwork as expected.", + "type": "string" + }, + "count": { + "format": "int64", + "type": "string" + }, + "code": { + "type": "string", + "enumDescriptions": [ + "", + "", + "" + ], + "enum": [ + "TRANSFORMATION_RESULT_CODE_UNSPECIFIED", + "SUCCESS", + "ERROR" + ] + } + }, + "id": "GooglePrivacyDlpV2beta1SummaryResult" + }, + "GooglePrivacyDlpV2beta1BigQueryTable": { + "description": "Message defining the location of a BigQuery table. A table is uniquely\nidentified by its project_id, dataset_id, and table_name. Within a query\na table is often referenced with a string in the format of:\n`\u003cproject_id\u003e:\u003cdataset_id\u003e.\u003ctable_id\u003e` or\n`\u003cproject_id\u003e.\u003cdataset_id\u003e.\u003ctable_id\u003e`.", + "type": "object", + "properties": { + "datasetId": { + "description": "Dataset ID of the table.", + "type": "string" + }, + "tableId": { + "description": "Name of the table.", + "type": "string" + }, + "projectId": { + "description": "The Google Cloud Platform project ID of the project containing the table.\nIf omitted, project ID is inferred from the API call.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1BigQueryTable" + }, + "GooglePrivacyDlpV2beta1InfoTypeTransformations": { + "description": "A type of transformation that will scan unstructured text and\napply various `PrimitiveTransformation`s to each finding, where the\ntransformation is applied to only values that were identified as a specific\ninfo_type.", + "type": "object", + "properties": { + "transformations": { + "description": "Transformation for each info type. Cannot specify more than one\nfor a given info type. [required]", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeTransformation" + } + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeTransformations" + }, + "GooglePrivacyDlpV2beta1ListRootCategoriesResponse": { + "properties": { + "categories": { + "description": "List of all into type categories supported by the API.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1CategoryDescription" + } + } + }, + "id": "GooglePrivacyDlpV2beta1ListRootCategoriesResponse", + "description": "Response for ListRootCategories request.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1KindExpression": { + "description": "A representation of a Datastore kind.", + "type": "object", + "properties": { + "name": { + "description": "The name of the kind.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1KindExpression" + }, + "GooglePrivacyDlpV2beta1FileSet": { + "description": "Set of files to scan.", + "type": "object", + "properties": { + "url": { + "description": "The url, in the format `gs://\u003cbucket\u003e/\u003cpath\u003e`. Trailing wildcard in the\npath is allowed.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1FileSet" + }, + "GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest": { + "properties": { + "sourceTable": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Input dataset to compute metrics over." + }, + "privacyMetric": { + "description": "Privacy metric to compute.", + "$ref": "GooglePrivacyDlpV2beta1PrivacyMetric" + } + }, + "id": "GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest", + "description": "Request for creating a risk analysis operation.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1InfoTypeTransformation": { + "properties": { + "infoTypes": { + "description": "Info types to apply the transformation to. Empty list will match all\navailable info types for this transformation.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoType" + } + }, + "primitiveTransformation": { + "description": "Primitive transformation to apply to the info type. [required]", + "$ref": "GooglePrivacyDlpV2beta1PrimitiveTransformation" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeTransformation", + "description": "A transformation to apply to text that is identified as a specific\ninfo_type.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Bucket": { + "description": "Buckets represented as ranges, along with replacement values. Ranges must\nbe non-overlapping.", + "type": "object", + "properties": { + "max": { + "description": "Upper bound of the range, exclusive; type must match min.", + "$ref": "GooglePrivacyDlpV2beta1Value" + }, + "replacementValue": { + "description": "Replacement value for this bucket. If not provided\nthe default behavior will be to hyphenate the min-max range.", + "$ref": "GooglePrivacyDlpV2beta1Value" + }, + "min": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Lower bound of the range, inclusive. Type should be the same as max if\nused." + } + }, + "id": "GooglePrivacyDlpV2beta1Bucket" + }, + "GooglePrivacyDlpV2beta1KAnonymityResult": { + "description": "Result of the k-anonymity computation.", + "type": "object", + "properties": { + "equivalenceClassHistogramBuckets": { + "description": "Histogram of k-anonymity equivalence classes.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1KAnonymityHistogramBucket" + } + } + }, + "id": "GooglePrivacyDlpV2beta1KAnonymityResult" + }, + "GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket": { + "description": "Histogram bucket of value frequencies in the column.", + "type": "object", + "properties": { + "bucketSize": { + "description": "Total number of records in this bucket.", + "format": "int64", + "type": "string" + }, + "valueFrequencyUpperBound": { + "description": "Upper bound on the value frequency of the values in this bucket.", + "format": "int64", + "type": "string" + }, + "valueFrequencyLowerBound": { + "description": "Lower bound on the value frequency of the values in this bucket.", + "format": "int64", + "type": "string" + }, + "bucketValues": { + "description": "Sample of value frequencies in this bucket. The total number of\nvalues returned per bucket is capped at 20.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ValueFrequency" + } + } + }, + "id": "GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket" + }, + "GooglePrivacyDlpV2beta1TableLocation": { + "properties": { + "rowIndex": { + "description": "The zero-based index of the row where the finding is located.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1TableLocation", + "description": "Location of a finding within a `ContentItem.Table`.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1DatastoreKey": { + "description": "Record key for a finding in Cloud Datastore.", + "type": "object", + "properties": { + "entityKey": { + "$ref": "GooglePrivacyDlpV2beta1Key", + "description": "Datastore entity key." + } + }, + "id": "GooglePrivacyDlpV2beta1DatastoreKey" + }, + "GooglePrivacyDlpV2beta1KAnonymityConfig": { + "description": "k-anonymity metric, used for analysis of reidentification risk.", + "type": "object", + "properties": { + "entityId": { + "$ref": "GooglePrivacyDlpV2beta1EntityId", + "description": "Optional message indicating that each distinct `EntityId` should not\ncontribute to the k-anonymity count more than once per equivalence class." + }, + "quasiIds": { + "description": "Set of fields to compute k-anonymity over. When multiple fields are\nspecified, they are considered a single composite key. Structs and\nrepeated data types are not supported; however, nested fields are\nsupported so long as they are not structs themselves or nested within\na repeated field.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + } + }, + "id": "GooglePrivacyDlpV2beta1KAnonymityConfig" + }, + "GooglePrivacyDlpV2beta1RecordKey": { + "description": "Message for a unique key indicating a record that contains a finding.", + "type": "object", + "properties": { + "cloudStorageKey": { + "$ref": "GooglePrivacyDlpV2beta1CloudStorageKey" + }, + "datastoreKey": { + "$ref": "GooglePrivacyDlpV2beta1DatastoreKey" + } + }, + "id": "GooglePrivacyDlpV2beta1RecordKey" + }, + "GooglePrivacyDlpV2beta1DeidentifyContentRequest": { + "properties": { + "items": { + "description": "The list of items to inspect. Up to 100 are allowed per request.\nAll items will be treated as text/*.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + } + }, + "deidentifyConfig": { + "$ref": "GooglePrivacyDlpV2beta1DeidentifyConfig", + "description": "Configuration for the de-identification of the list of content items." + }, + "inspectConfig": { + "$ref": "GooglePrivacyDlpV2beta1InspectConfig", + "description": "Configuration for the inspector." + } + }, + "id": "GooglePrivacyDlpV2beta1DeidentifyContentRequest", + "description": "Request to de-identify a list of items.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1InspectResult": { + "description": "All the findings for a single scanned item.", + "type": "object", + "properties": { + "findingsTruncated": { + "description": "If true, then this item might have more findings than were returned,\nand the findings returned are an arbitrary subset of all findings.\nThe findings list might be truncated because the input items were too\nlarge, or because the server reached the maximum amount of resources\nallowed for a single API call. For best results, divide the input into\nsmaller batches.", + "type": "boolean" + }, + "findings": { + "description": "List of findings for an item.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Finding" + } + } + }, + "id": "GooglePrivacyDlpV2beta1InspectResult" + }, + "GooglePrivacyDlpV2beta1ImageLocation": { + "description": "Bounding box encompassing detected text within an image.", + "type": "object", + "properties": { + "height": { + "description": "Height of the bounding box in pixels.", + "format": "int32", + "type": "integer" + }, + "top": { + "description": "Top coordinate of the bounding box. (0,0) is upper left.", + "format": "int32", + "type": "integer" + }, + "left": { + "description": "Left coordinate of the bounding box. (0,0) is upper left.", + "format": "int32", + "type": "integer" + }, + "width": { + "description": "Width of the bounding box in pixels.", + "format": "int32", + "type": "integer" + } + }, + "id": "GooglePrivacyDlpV2beta1ImageLocation" + }, + "GooglePrivacyDlpV2beta1ReplaceValueConfig": { + "description": "Replace each input value with a given `Value`.", + "type": "object", + "properties": { + "newValue": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Value to replace it with." + } + }, + "id": "GooglePrivacyDlpV2beta1ReplaceValueConfig" + }, + "GooglePrivacyDlpV2beta1ContentItem": { + "description": "Container structure for the content to inspect.", + "type": "object", + "properties": { + "data": { + "description": "Content data to inspect or redact.", + "format": "byte", + "type": "string" + }, + "type": { + "description": "Type of the content, as defined in Content-Type HTTP header.\nSupported types are: all \"text\" types, octet streams, PNG images,\nJPEG images.", + "type": "string" + }, + "value": { + "description": "String data to inspect or redact.", + "type": "string" + }, + "table": { + "$ref": "GooglePrivacyDlpV2beta1Table", + "description": "Structured content for inspection." + } + }, + "id": "GooglePrivacyDlpV2beta1ContentItem" + }, + "GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig": { + "properties": { + "context": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "A context may be used for higher security since the same\nidentifier in two different contexts likely will be given a distinct\nsurrogate. The principle is that the likeliness is inversely related\nto the ratio of the number of distinct identifiers per context over the\nnumber of possible surrogates: As long as this ratio is small, the\nlikehood is large.\n\nIf the context is not set, a default tweak will be used.\nIf the context is set but:\n\n1. there is no record present when transforming a given value or\n1. the field is not present when transforming a given value,\n\na default tweak will be used.\n\nNote that case (1) is expected when an `InfoTypeTransformation` is\napplied to both structured and non-structured `ContentItem`s.\nCurrently, the referenced field may be of value type integer or string.\n\nThe tweak is constructed as a sequence of bytes in big endian byte order\nsuch that:\n\n- a 64 bit integer is encoded followed by a single byte of value 1\n- a string is encoded in UTF-8 format followed by a single byte of value 2\n\nThis is also known as the 'tweak', as in tweakable encryption." + }, + "customAlphabet": { + "description": "This is supported by mapping these to the alphanumeric characters\nthat the FFX mode natively supports. This happens before/after\nencryption/decryption.\nEach character listed must appear only once.\nNumber of characters must be in the range [2, 62].\nThis must be encoded as ASCII.\nThe order of characters does not matter.", + "type": "string" + }, + "cryptoKey": { + "$ref": "GooglePrivacyDlpV2beta1CryptoKey", + "description": "The key used by the encryption algorithm. [required]" + }, + "commonAlphabet": { + "enumDescriptions": [ + "", + "[0-9] (radix of 10)", + "[0-9A-F] (radix of 16)", + "[0-9A-Z] (radix of 36)", + "[0-9A-Za-z] (radix of 62)" + ], + "enum": [ + "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED", + "NUMERIC", + "HEXADECIMAL", + "UPPER_CASE_ALPHA_NUMERIC", + "ALPHA_NUMERIC" + ], + "type": "string" + }, + "radix": { + "description": "The native way to select the alphabet. Must be in the range [2, 62].", + "format": "int32", + "type": "integer" + } + }, + "id": "GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig", + "description": "Replaces an identifier with an surrogate using FPE with the FFX\nmode of operation.\nThe identifier must be encoded as ASCII.\nFor a given crypto key and context, the same identifier will be\nreplaced with the same surrogate.\nNote that a given identifier must be either the empty string or be at\nleast two characters long.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Color": { + "properties": { + "red": { + "description": "The amount of red in the color as a value in the interval [0, 1].", + "format": "float", + "type": "number" + }, + "green": { + "description": "The amount of green in the color as a value in the interval [0, 1].", + "format": "float", + "type": "number" + }, + "blue": { + "description": "The amount of blue in the color as a value in the interval [0, 1].", + "format": "float", + "type": "number" + } + }, + "id": "GooglePrivacyDlpV2beta1Color", + "description": "Represents a color in the RGB color space.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Table": { + "properties": { + "rows": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Row" + } + }, + "headers": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + } + }, + "id": "GooglePrivacyDlpV2beta1Table", + "description": "Structured content to inspect. Up to 50,000 `Value`s per request allowed.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1ValueFrequency": { + "description": "A value of a field, including its frequency.", + "type": "object", + "properties": { + "value": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "A value contained in the field in question." + }, + "count": { + "description": "How many times the value is contained in the field.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1ValueFrequency" + }, + "GooglePrivacyDlpV2beta1InfoTypeLimit": { + "description": "Max findings configuration per info type, per content item or long running\noperation.", + "type": "object", + "properties": { + "infoType": { + "description": "Type of information the findings limit applies to. Only one limit per\ninfo_type should be provided. If InfoTypeLimit does not have an\ninfo_type, the DLP API applies the limit against all info_types that are\nfound but not specified in another InfoTypeLimit.", + "$ref": "GooglePrivacyDlpV2beta1InfoType" + }, + "maxFindings": { + "description": "Max findings limit for the given infoType.", + "format": "int32", + "type": "integer" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeLimit" + }, + "GooglePrivacyDlpV2beta1CryptoKey": { + "properties": { + "kmsWrapped": { + "$ref": "GooglePrivacyDlpV2beta1KmsWrappedCryptoKey" + }, + "unwrapped": { + "$ref": "GooglePrivacyDlpV2beta1UnwrappedCryptoKey" + }, + "transient": { + "$ref": "GooglePrivacyDlpV2beta1TransientCryptoKey" + } + }, + "id": "GooglePrivacyDlpV2beta1CryptoKey", + "description": "This is a data encryption key (DEK) (as opposed to\na key encryption key (KEK) stored by KMS).\nWhen using KMS to wrap/unwrap DEKs, be sure to set an appropriate\nIAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot\nunwrap the data crypto key.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1LDiversityHistogramBucket": { + "properties": { + "sensitiveValueFrequencyUpperBound": { + "description": "Upper bound on the sensitive value frequencies of the equivalence\nclasses in this bucket.", + "format": "int64", + "type": "string" + }, + "sensitiveValueFrequencyLowerBound": { + "description": "Lower bound on the sensitive value frequencies of the equivalence\nclasses in this bucket.", + "format": "int64", + "type": "string" + }, + "bucketValues": { + "description": "Sample of equivalence classes in this bucket. The total number of\nclasses returned per bucket is capped at 20.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityEquivalenceClass" + } + }, + "bucketSize": { + "description": "Total number of records in this bucket.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1LDiversityHistogramBucket", + "description": "Histogram bucket of sensitive value frequencies in the table.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Value": { + "properties": { + "timestampValue": { + "format": "google-datetime", + "type": "string" + }, + "booleanValue": { + "type": "boolean" + }, + "floatValue": { + "format": "double", + "type": "number" + }, + "timeValue": { + "$ref": "GoogleTypeTimeOfDay" + }, + "integerValue": { + "format": "int64", + "type": "string" + }, + "stringValue": { + "type": "string" + }, + "dateValue": { + "$ref": "GoogleTypeDate" + } + }, + "id": "GooglePrivacyDlpV2beta1Value", + "description": "Set of primitive values supported by the system.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Condition": { + "description": "The field type of `value` and `field` do not need to match to be\nconsidered equal, but not all comparisons are possible.\n\nA `value` of type:\n\n- `string` can be compared against all other types\n- `boolean` can only be compared against other booleans\n- `integer` can be compared against doubles or a string if the string value\ncan be parsed as an integer.\n- `double` can be compared against integers or a string if the string can\nbe parsed as a double.\n- `Timestamp` can be compared against strings in RFC 3339 date string\nformat.\n- `TimeOfDay` can be compared against timestamps and strings in the format\nof 'HH:mm:ss'.\n\nIf we fail to compare do to type mismatch, a warning will be given and\nthe condition will evaluate to false.", + "type": "object", + "properties": { + "field": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "Field within the record this condition is evaluated against. [required]" + }, + "operator": { + "enumDescriptions": [ + "", + "Equal.", + "Not equal to.", + "Greater than.", + "Less than.", + "Greater than or equals.", + "Less than or equals.", + "Exists" + ], + "enum": [ + "RELATIONAL_OPERATOR_UNSPECIFIED", + "EQUAL_TO", + "NOT_EQUAL_TO", + "GREATER_THAN", + "LESS_THAN", + "GREATER_THAN_OR_EQUALS", + "LESS_THAN_OR_EQUALS", + "EXISTS" + ], + "description": "Operator used to compare the field or info type to the value. [required]", + "type": "string" + }, + "value": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Value to compare against. [Required, except for `EXISTS` tests.]" + } + }, + "id": "GooglePrivacyDlpV2beta1Condition" + }, + "GooglePrivacyDlpV2beta1PartitionId": { + "description": "Datastore partition ID.\nA partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.\n\nA partition ID contains several dimensions:\nproject ID and namespace ID.", + "type": "object", + "properties": { + "projectId": { + "description": "The ID of the project to which the entities belong.", + "type": "string" + }, + "namespaceId": { + "description": "If not empty, the ID of the namespace to which the entities belong.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1PartitionId" + }, + "GooglePrivacyDlpV2beta1InspectContentResponse": { + "description": "Results of inspecting a list of items.", + "type": "object", + "properties": { + "results": { + "description": "Each content_item from the request has a result in this list, in the\nsame order as the request.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InspectResult" + } + } + }, + "id": "GooglePrivacyDlpV2beta1InspectContentResponse" + }, + "GooglePrivacyDlpV2beta1RedactContentRequest": { + "description": "Request to search for potentially sensitive info in a list of items\nand replace it with a default or provided content.", + "type": "object", + "properties": { + "items": { + "description": "The list of items to inspect. Up to 100 are allowed per request.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + } + }, + "replaceConfigs": { + "description": "The strings to replace findings text findings with. Must specify at least\none of these or one ImageRedactionConfig if redacting images.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ReplaceConfig" + } + }, + "imageRedactionConfigs": { + "description": "The configuration for specifying what content to redact from images.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ImageRedactionConfig" + } + }, + "inspectConfig": { + "$ref": "GooglePrivacyDlpV2beta1InspectConfig", + "description": "Configuration for the inspector." + } + }, + "id": "GooglePrivacyDlpV2beta1RedactContentRequest" + }, + "GooglePrivacyDlpV2beta1FieldId": { + "description": "General identifier of a data field in a storage service.", + "type": "object", + "properties": { + "columnName": { + "description": "Name describing the field.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1FieldId" + }, + "GooglePrivacyDlpV2beta1TransformationSummary": { + "properties": { + "recordSuppress": { + "$ref": "GooglePrivacyDlpV2beta1RecordSuppression", + "description": "The specific suppression option these stats apply to." + }, + "infoType": { + "description": "Set if the transformation was limited to a specific info_type.", + "$ref": "GooglePrivacyDlpV2beta1InfoType" + }, + "transformation": { + "description": "The specific transformation these stats apply to.", + "$ref": "GooglePrivacyDlpV2beta1PrimitiveTransformation" + }, + "results": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1SummaryResult" + } + }, + "field": { + "description": "Set if the transformation was limited to a specific FieldId.", + "$ref": "GooglePrivacyDlpV2beta1FieldId" + }, + "fieldTransformations": { + "description": "The field transformation that was applied. This list will contain\nmultiple only in the case of errors.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldTransformation" + } + } + }, + "id": "GooglePrivacyDlpV2beta1TransformationSummary", + "description": "Summary of a single tranformation.", + "type": "object" + }, + "GoogleLongrunningCancelOperationRequest": { + "properties": {}, + "id": "GoogleLongrunningCancelOperationRequest", + "description": "The request message for Operations.CancelOperation.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1CharacterMaskConfig": { + "properties": { + "maskingCharacter": { + "description": "Character to mask the sensitive values—for example, \"*\" for an\nalphabetic string such as name, or \"0\" for a numeric string such as ZIP\ncode or credit card number. String must have length 1. If not supplied, we\nwill default to \"*\" for strings, 0 for digits.", + "type": "string" + }, + "reverseOrder": { + "description": "Mask characters in reverse order. For example, if `masking_character` is\n'0', number_to_mask is 14, and `reverse_order` is false, then\n1234-5678-9012-3456 -\u003e 00000000000000-3456\nIf `masking_character` is '*', `number_to_mask` is 3, and `reverse_order`\nis true, then 12345 -\u003e 12***", + "type": "boolean" + }, + "numberToMask": { + "description": "Number of characters to mask. If not set, all matching chars will be\nmasked. Skipped characters do not count towards this tally.", + "format": "int32", + "type": "integer" + }, + "charactersToIgnore": { + "description": "When masking a string, items in this list will be skipped when replacing.\nFor example, if your string is 555-555-5555 and you ask us to skip `-` and\nmask 5 chars with * we would produce ***-*55-5555.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1CharsToIgnore" + } + } + }, + "id": "GooglePrivacyDlpV2beta1CharacterMaskConfig", + "description": "Partially mask a string by replacing a given number of characters with a\nfixed character. Masking can start from the beginning or end of the string.\nThis can be used on data of any type (numbers, longs, and so on) and when\nde-identifying structured data we'll attempt to preserve the original data's\ntype. (This allows you to take a long like 123 and modify it to a string like\n**3.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1TransientCryptoKey": { + "description": "Use this to have a random data crypto key generated.\nIt will be discarded after the operation/request finishes.", + "type": "object", + "properties": { + "name": { + "description": "Name of the key. [required]\nThis is an arbitrary string used to differentiate different keys.\nA unique key is generated per name: two separate `TransientCryptoKey`\nprotos share the same generated key if their names are the same.\nWhen the data crypto key is generated, this name is not used in any way\n(repeating the api call will result in a different key being generated).", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1TransientCryptoKey" + }, + "GooglePrivacyDlpV2beta1CreateInspectOperationRequest": { + "description": "Request for scheduling a scan of a data subset from a Google Platform data\nrepository.", + "type": "object", + "properties": { + "inspectConfig": { + "$ref": "GooglePrivacyDlpV2beta1InspectConfig", + "description": "Configuration for the inspector." + }, + "storageConfig": { + "description": "Specification of the data set to process.", + "$ref": "GooglePrivacyDlpV2beta1StorageConfig" + }, + "outputConfig": { + "description": "Optional location to store findings. The bucket must already exist and\nthe Google APIs service account for DLP must have write permission to\nwrite to the given bucket.\nResults are split over multiple csv files with each file name matching\nthe pattern \"[operation_id]_[count].csv\", for example\n`3094877188788974909_1.csv`. The `operation_id` matches the\nidentifier for the Operation, and the `count` is a counter used for\ntracking the number of files written.\n\nThe CSV file(s) contain the following columns regardless of storage type\nscanned:\n- id\n- info_type\n- likelihood\n- byte size of finding\n- quote\n- timestamp\n\nFor Cloud Storage the next columns are:\n\n- file_path\n- start_offset\n\nFor Cloud Datastore the next columns are:\n\n- project_id\n- namespace_id\n- path\n- column_name\n- offset\n\nFor BigQuery the next columns are:\n\n- row_number\n- project_id\n- dataset_id\n- table_id", + "$ref": "GooglePrivacyDlpV2beta1OutputStorageConfig" + }, + "operationConfig": { + "$ref": "GooglePrivacyDlpV2beta1OperationConfig", + "description": "Additional configuration settings for long running operations." + } + }, + "id": "GooglePrivacyDlpV2beta1CreateInspectOperationRequest" + }, + "GooglePrivacyDlpV2beta1InfoTypeStatistics": { + "description": "Statistics regarding a specific InfoType.", + "type": "object", + "properties": { + "infoType": { + "description": "The type of finding this stat is for.", + "$ref": "GooglePrivacyDlpV2beta1InfoType" + }, + "count": { + "description": "Number of findings for this info type.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeStatistics" + }, + "GooglePrivacyDlpV2beta1RedactContentResponse": { + "description": "Results of redacting a list of items.", + "type": "object", + "properties": { + "items": { + "description": "The redacted content.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + } + } + }, + "id": "GooglePrivacyDlpV2beta1RedactContentResponse" + }, + "GooglePrivacyDlpV2beta1PropertyReference": { + "description": "A reference to a property relative to the Datastore kind expressions.", + "type": "object", + "properties": { + "name": { + "description": "The name of the property.\nIf name includes \".\"s, it may be interpreted as a property name path.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1PropertyReference" + }, + "GooglePrivacyDlpV2beta1OutputStorageConfig": { + "description": "Cloud repository for storing output.", + "type": "object", + "properties": { + "table": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Store findings in a new table in the dataset." + }, + "storagePath": { + "description": "The path to a Google Cloud Storage location to store output.", + "$ref": "GooglePrivacyDlpV2beta1CloudStoragePath" + } + }, + "id": "GooglePrivacyDlpV2beta1OutputStorageConfig" + }, + "GooglePrivacyDlpV2beta1FieldTransformation": { + "description": "The transformation to apply to the field.", + "type": "object", + "properties": { + "fields": { + "description": "Input field(s) to apply the transformation to. [required]", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + }, + "primitiveTransformation": { + "$ref": "GooglePrivacyDlpV2beta1PrimitiveTransformation", + "description": "Apply the transformation to the entire field." + }, + "condition": { + "$ref": "GooglePrivacyDlpV2beta1RecordCondition", + "description": "Only apply the transformation if the condition evaluates to true for the\ngiven `RecordCondition`. The conditions are allowed to reference fields\nthat are not used in the actual transformation. [optional]\n\nExample Use Cases:\n\n- Apply a different bucket transformation to an age column if the zip code\ncolumn for the same record is within a specific range.\n- Redact a field if the date of birth field is greater than 85." + }, + "infoTypeTransformations": { + "description": "Treat the contents of the field as free text, and selectively\ntransform content that matches an `InfoType`.", + "$ref": "GooglePrivacyDlpV2beta1InfoTypeTransformations" + } + }, + "id": "GooglePrivacyDlpV2beta1FieldTransformation" + }, + "GooglePrivacyDlpV2beta1BucketingConfig": { + "description": "Generalization function that buckets values based on ranges. The ranges and\nreplacement values are dynamically provided by the user for custom behavior,\nsuch as 1-30 -\u003e LOW 31-65 -\u003e MEDIUM 66-100 -\u003e HIGH\nThis can be used on\ndata of type: number, long, string, timestamp.\nIf the bound `Value` type differs from the type of data being transformed, we\nwill first attempt converting the type of the data to be transformed to match\nthe type of the bound before comparing.", + "type": "object", + "properties": { + "buckets": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Bucket" + } + } + }, + "id": "GooglePrivacyDlpV2beta1BucketingConfig" + }, + "GooglePrivacyDlpV2beta1DeidentifyContentResponse": { + "description": "Results of de-identifying a list of items.", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + } + }, + "summaries": { + "description": "A review of the transformations that took place for each item.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1DeidentificationSummary" + } + } + }, + "id": "GooglePrivacyDlpV2beta1DeidentifyContentResponse" + }, + "GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass": { + "properties": { + "equivalenceClassSize": { + "description": "Size of the equivalence class, for example number of rows with the\nabove set of values.", + "format": "int64", + "type": "string" + }, + "quasiIdsValues": { + "description": "Set of values defining the equivalence class. One value per\nquasi-identifier column in the original KAnonymity metric message.\nThe order is always the same as the original request.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Value" + } + } + }, + "id": "GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass", + "description": "The set of columns' values that share the same k-anonymity value.", + "type": "object" + }, + "GoogleLongrunningOperation": { + "properties": { + "response": { + "description": "This field will contain an InspectOperationResult object for `inspect.operations.create` or a RiskAnalysisOperationResult object for `dataSource.analyze`.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "name": { + "description": "The server-assigned name. The `name` should have the format of `inspect/operations/\u003cidentifier\u003e`.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "GoogleRpcStatus" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "This field will contain an InspectOperationMetadata object for `inspect.operations.create` or a RiskAnalysisOperationMetadata object for `dataSource.analyze`. This will always be returned with the Operation.", + "type": "object" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + } + }, + "id": "GoogleLongrunningOperation", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1KmsWrappedCryptoKey": { + "description": "Include to use an existing data crypto key wrapped by KMS.\nAuthorization requires the following IAM permissions when sending a request\nto perform a crypto transformation using a kms-wrapped crypto key:\ndlp.kms.encrypt", + "type": "object", + "properties": { + "wrappedKey": { + "description": "The wrapped data crypto key. [required]", + "format": "byte", + "type": "string" + }, + "cryptoKeyName": { + "description": "The resource name of the KMS CryptoKey to use for unwrapping. [required]", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1KmsWrappedCryptoKey" + }, + "GooglePrivacyDlpV2beta1InspectOperationMetadata": { + "description": "Metadata returned within GetOperation for an inspect request.", + "type": "object", + "properties": { + "totalEstimatedBytes": { + "description": "Estimate of the number of bytes to process.", + "format": "int64", + "type": "string" + }, + "infoTypeStats": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeStatistics" + } + }, + "requestInspectConfig": { + "$ref": "GooglePrivacyDlpV2beta1InspectConfig", + "description": "The inspect config used to create the Operation." + }, + "requestOutputConfig": { + "$ref": "GooglePrivacyDlpV2beta1OutputStorageConfig", + "description": "Optional location to store findings." + }, + "createTime": { + "description": "The time which this request was started.", + "format": "google-datetime", + "type": "string" + }, + "requestStorageConfig": { + "description": "The storage config used to create the Operation.", + "$ref": "GooglePrivacyDlpV2beta1StorageConfig" + }, + "processedBytes": { + "description": "Total size in bytes that were processed.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1InspectOperationMetadata" + }, + "GooglePrivacyDlpV2beta1InfoType": { + "description": "Type of information detected by the API.", + "type": "object", + "properties": { + "name": { + "description": "Name of the information type.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoType" + }, + "GooglePrivacyDlpV2beta1CharsToIgnore": { + "description": "Characters to skip when doing deidentification of a value. These will be left\nalone and skipped.", + "type": "object", + "properties": { + "commonCharactersToIgnore": { + "enum": [ + "CHARACTER_GROUP_UNSPECIFIED", + "NUMERIC", + "ALPHA_UPPER_CASE", + "ALPHA_LOWER_CASE", + "PUNCTUATION", + "WHITESPACE" + ], + "type": "string", + "enumDescriptions": [ + "", + "0-9", + "A-Z", + "a-z", + "US Punctuation, one of !\"#$%&'()*+,-./:;\u003c=\u003e?@[\\]^_`{|}~", + "Whitespace character, one of [ \\t\\n\\x0B\\f\\r]" + ] + }, + "charactersToSkip": { + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1CharsToIgnore" + }, + "GooglePrivacyDlpV2beta1FixedSizeBucketingConfig": { + "description": "Buckets values based on fixed size ranges. The\nBucketing transformation can provide all of this functionality,\nbut requires more configuration. This message is provided as a convenience to\nthe user for simple bucketing strategies.\nThe resulting value will be a hyphenated string of\nlower_bound-upper_bound.\nThis can be used on data of type: double, long.\nIf the bound Value type differs from the type of data\nbeing transformed, we will first attempt converting the type of the data to\nbe transformed to match the type of the bound before comparing.", + "type": "object", + "properties": { + "lowerBound": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Lower bound value of buckets. All values less than `lower_bound` are\ngrouped together into a single bucket; for example if `lower_bound` = 10,\nthen all values less than 10 are replaced with the value “-10”. [Required]." + }, + "bucketSize": { + "description": "Size of each bucket (except for minimum and maximum buckets). So if\n`lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the\nfollowing buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60,\n60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required].", + "format": "double", + "type": "number" + }, + "upperBound": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Upper bound value of buckets. All values greater than upper_bound are\ngrouped together into a single bucket; for example if `upper_bound` = 89,\nthen all values greater than 89 are replaced with the value “89+”.\n[Required]." + } + }, + "id": "GooglePrivacyDlpV2beta1FixedSizeBucketingConfig" + }, + "GooglePrivacyDlpV2beta1RiskAnalysisOperationResult": { + "description": "Result of a risk analysis\n[`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations)\nrequest.", + "type": "object", + "properties": { + "numericalStatsResult": { + "$ref": "GooglePrivacyDlpV2beta1NumericalStatsResult" + }, + "kAnonymityResult": { + "$ref": "GooglePrivacyDlpV2beta1KAnonymityResult" + }, + "lDiversityResult": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityResult" + }, + "categoricalStatsResult": { + "$ref": "GooglePrivacyDlpV2beta1CategoricalStatsResult" + } + }, + "id": "GooglePrivacyDlpV2beta1RiskAnalysisOperationResult" + }, + "GooglePrivacyDlpV2beta1Conditions": { + "type": "object", + "properties": { + "conditions": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Condition" + } + } + }, + "id": "GooglePrivacyDlpV2beta1Conditions" + }, + "GooglePrivacyDlpV2beta1CategoryDescription": { + "description": "Info Type Category description.", + "type": "object", + "properties": { + "displayName": { + "description": "Human readable form of the category name.", + "type": "string" + }, + "name": { + "description": "Internal name of the category.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1CategoryDescription" + }, + "GooglePrivacyDlpV2beta1PrimitiveTransformation": { + "properties": { + "fixedSizeBucketingConfig": { + "$ref": "GooglePrivacyDlpV2beta1FixedSizeBucketingConfig" + }, + "timePartConfig": { + "$ref": "GooglePrivacyDlpV2beta1TimePartConfig" + }, + "characterMaskConfig": { + "$ref": "GooglePrivacyDlpV2beta1CharacterMaskConfig" + }, + "redactConfig": { + "$ref": "GooglePrivacyDlpV2beta1RedactConfig" + }, + "bucketingConfig": { + "$ref": "GooglePrivacyDlpV2beta1BucketingConfig" + }, + "replaceWithInfoTypeConfig": { + "$ref": "GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig" + }, + "cryptoHashConfig": { + "$ref": "GooglePrivacyDlpV2beta1CryptoHashConfig" + }, + "cryptoReplaceFfxFpeConfig": { + "$ref": "GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig" + }, + "replaceConfig": { + "$ref": "GooglePrivacyDlpV2beta1ReplaceValueConfig" + } + }, + "id": "GooglePrivacyDlpV2beta1PrimitiveTransformation", + "description": "A rule for transforming a value.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1CategoricalStatsConfig": { + "description": "Compute numerical stats over an individual column, including\nnumber of distinct values and value count distribution.", + "type": "object", + "properties": { + "field": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "Field to compute categorical stats on. All column types are\nsupported except for arrays and structs. However, it may be more\ninformative to use NumericalStats when the field type is supported,\ndepending on the data." + } + }, + "id": "GooglePrivacyDlpV2beta1CategoricalStatsConfig" + }, + "GooglePrivacyDlpV2beta1Finding": { + "description": "Container structure describing a single finding within a string or image.", + "type": "object", + "properties": { + "infoType": { + "$ref": "GooglePrivacyDlpV2beta1InfoType", + "description": "The specific type of info the string might be." + }, + "createTime": { + "description": "Timestamp when finding was detected.", + "format": "google-datetime", + "type": "string" + }, + "quote": { + "description": "The specific string that may be potentially sensitive info.", + "type": "string" + }, + "location": { + "$ref": "GooglePrivacyDlpV2beta1Location", + "description": "Location of the info found." + }, + "likelihood": { + "enumDescriptions": [ + "Default value; information with all likelihoods is included.", + "Few matching elements.", + "", + "Some matching elements.", + "", + "Many matching elements." + ], + "enum": [ + "LIKELIHOOD_UNSPECIFIED", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Estimate of how likely it is that the info_type is correct.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1Finding" + }, + "GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata": { + "properties": { + "requestedPrivacyMetric": { + "description": "Privacy metric to compute.", + "$ref": "GooglePrivacyDlpV2beta1PrivacyMetric" + }, + "createTime": { + "description": "The time which this request was started.", + "format": "google-datetime", + "type": "string" + }, + "requestedSourceTable": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Input dataset to compute metrics over." + } + }, + "id": "GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata", + "description": "Metadata returned within the\n[`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get)\nfor risk analysis.", + "type": "object" + }, + "GoogleLongrunningListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "GoogleLongrunningOperation" + } + } + }, + "id": "GoogleLongrunningListOperationsResponse" + }, + "GooglePrivacyDlpV2beta1Row": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Value" + } + } + }, + "id": "GooglePrivacyDlpV2beta1Row" + }, + "GoogleProtobufEmpty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "GoogleProtobufEmpty" + }, + "GooglePrivacyDlpV2beta1ListInspectFindingsResponse": { + "description": "Response to the ListInspectFindings request.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If not empty, indicates that there may be more results that match the\nrequest; this value should be passed in a new `ListInspectFindingsRequest`.", + "type": "string" + }, + "result": { + "$ref": "GooglePrivacyDlpV2beta1InspectResult", + "description": "The results." + } + }, + "id": "GooglePrivacyDlpV2beta1ListInspectFindingsResponse" + }, + "GooglePrivacyDlpV2beta1Expressions": { + "description": "A collection of expressions", + "type": "object", + "properties": { + "logicalOperator": { + "enumDescriptions": [ + "", + "" + ], + "enum": [ + "LOGICAL_OPERATOR_UNSPECIFIED", + "AND" + ], + "description": "The operator to apply to the result of conditions. Default and currently\nonly supported value is `AND`.", + "type": "string" + }, + "conditions": { + "$ref": "GooglePrivacyDlpV2beta1Conditions" + } + }, + "id": "GooglePrivacyDlpV2beta1Expressions" + }, + "GooglePrivacyDlpV2beta1CloudStorageOptions": { + "description": "Options defining a file or a set of files (path ending with *) within\na Google Cloud Storage bucket.", + "type": "object", + "properties": { + "fileSet": { + "$ref": "GooglePrivacyDlpV2beta1FileSet" + } + }, + "id": "GooglePrivacyDlpV2beta1CloudStorageOptions" + }, + "GooglePrivacyDlpV2beta1CloudStoragePath": { + "description": "A location in Cloud Storage.", + "type": "object", + "properties": { + "path": { + "description": "The url, in the format of `gs://bucket/\u003cpath\u003e`.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1CloudStoragePath" + }, + "GooglePrivacyDlpV2beta1KAnonymityHistogramBucket": { + "description": "Histogram bucket of equivalence class sizes in the table.", + "type": "object", + "properties": { + "bucketValues": { + "description": "Sample of equivalence classes in this bucket. The total number of\nclasses returned per bucket is capped at 20.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass" + } + }, + "equivalenceClassSizeLowerBound": { + "description": "Lower bound on the size of the equivalence classes in this bucket.", + "format": "int64", + "type": "string" + }, + "equivalenceClassSizeUpperBound": { + "description": "Upper bound on the size of the equivalence classes in this bucket.", + "format": "int64", + "type": "string" + }, + "bucketSize": { + "description": "Total number of records in this bucket.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1KAnonymityHistogramBucket" + }, + "GooglePrivacyDlpV2beta1InspectOperationResult": { + "description": "The operational data.", + "type": "object", + "properties": { + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `inspect/results/{id}`.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1InspectOperationResult" + }, + "GooglePrivacyDlpV2beta1LDiversityResult": { + "properties": { + "sensitiveValueFrequencyHistogramBuckets": { + "description": "Histogram of l-diversity equivalence class sensitive value frequencies.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityHistogramBucket" + } + } + }, + "id": "GooglePrivacyDlpV2beta1LDiversityResult", + "description": "Result of the l-diversity computation.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1CategoricalStatsResult": { + "description": "Result of the categorical stats computation.", + "type": "object", + "properties": { + "valueFrequencyHistogramBuckets": { + "description": "Histogram of value frequencies in the column.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket" + } + } + }, + "id": "GooglePrivacyDlpV2beta1CategoricalStatsResult" + }, + "GooglePrivacyDlpV2beta1Range": { + "description": "Generic half-open interval [start, end)", + "type": "object", + "properties": { + "start": { + "description": "Index of the first character of the range (inclusive).", + "format": "int64", + "type": "string" + }, + "end": { + "description": "Index of the last character of the range (exclusive).", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1Range" + }, + "GoogleTypeTimeOfDay": { + "description": "Represents a time of day. The date and time zone are either not significant\nor are specified elsewhere. An API may choose to allow leap seconds. Related\ntypes are google.type.Date and `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "nanos": { + "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", + "format": "int32", + "type": "integer" + }, + "seconds": { + "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may\nallow the value 60 if it allows leap-seconds.", + "format": "int32", + "type": "integer" + }, + "minutes": { + "description": "Minutes of hour of day. Must be from 0 to 59.", + "format": "int32", + "type": "integer" + }, + "hours": { + "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose\nto allow the value \"24:00:00\" for scenarios like business closing time.", + "format": "int32", + "type": "integer" + } + }, + "id": "GoogleTypeTimeOfDay" + }, + "GooglePrivacyDlpV2beta1DeidentifyConfig": { + "properties": { + "recordTransformations": { + "$ref": "GooglePrivacyDlpV2beta1RecordTransformations", + "description": "Treat the dataset as structured. Transformations can be applied to\nspecific locations within structured datasets, such as transforming\na column within a table." + }, + "infoTypeTransformations": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeTransformations", + "description": "Treat the dataset as free-form text and apply the same free text\ntransformation everywhere." + } + }, + "id": "GooglePrivacyDlpV2beta1DeidentifyConfig", + "description": "The configuration that controls how the data will change.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1LDiversityConfig": { + "description": "l-diversity metric, used for analysis of reidentification risk.", + "type": "object", + "properties": { + "sensitiveAttribute": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "Sensitive field for computing the l-value." + }, + "quasiIds": { + "description": "Set of quasi-identifiers indicating how equivalence classes are\ndefined for the l-diversity computation. When multiple fields are\nspecified, they are considered a single composite key.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + } + }, + "id": "GooglePrivacyDlpV2beta1LDiversityConfig" + }, + "GooglePrivacyDlpV2beta1StorageConfig": { + "properties": { + "cloudStorageOptions": { + "description": "Google Cloud Storage options specification.", + "$ref": "GooglePrivacyDlpV2beta1CloudStorageOptions" + }, + "datastoreOptions": { + "description": "Google Cloud Datastore options specification.", + "$ref": "GooglePrivacyDlpV2beta1DatastoreOptions" + }, + "bigQueryOptions": { + "description": "BigQuery options specification.", + "$ref": "GooglePrivacyDlpV2beta1BigQueryOptions" + } + }, + "id": "GooglePrivacyDlpV2beta1StorageConfig", + "description": "Shared message indicating Cloud storage type.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1BigQueryOptions": { + "description": "Options defining BigQuery table and row identifiers.", + "type": "object", + "properties": { + "tableReference": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Complete BigQuery table reference." + }, + "identifyingFields": { + "description": "References to fields uniquely identifying rows within the table.\nNested fields in the format, like `person.birthdate.year`, are allowed.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + } + }, + "id": "GooglePrivacyDlpV2beta1BigQueryOptions" + }, + "GooglePrivacyDlpV2beta1OperationConfig": { + "description": "Additional configuration for inspect long running operations.", + "type": "object", + "properties": { + "maxItemFindings": { + "description": "Max number of findings per file, Datastore entity, or database row.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1OperationConfig" + }, + "GooglePrivacyDlpV2beta1PrivacyMetric": { + "description": "Privacy metric to compute for reidentification risk analysis.", + "type": "object", + "properties": { + "lDiversityConfig": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityConfig" + }, + "numericalStatsConfig": { + "$ref": "GooglePrivacyDlpV2beta1NumericalStatsConfig" + }, + "kAnonymityConfig": { + "$ref": "GooglePrivacyDlpV2beta1KAnonymityConfig" + }, + "categoricalStatsConfig": { + "$ref": "GooglePrivacyDlpV2beta1CategoricalStatsConfig" + } + }, + "id": "GooglePrivacyDlpV2beta1PrivacyMetric" + }, + "GooglePrivacyDlpV2beta1ReplaceConfig": { + "type": "object", + "properties": { + "infoType": { + "description": "Type of information to replace. Only one ReplaceConfig per info_type\nshould be provided. If ReplaceConfig does not have an info_type, the DLP\nAPI matches it against all info_types that are found but not specified in\nanother ReplaceConfig.", + "$ref": "GooglePrivacyDlpV2beta1InfoType" + }, + "replaceWith": { + "description": "Content replacing sensitive information of given type. Max 256 chars.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1ReplaceConfig" + }, + "GooglePrivacyDlpV2beta1LDiversityEquivalenceClass": { + "description": "The set of columns' values that share the same l-diversity value.", + "type": "object", + "properties": { + "quasiIdsValues": { + "description": "Quasi-identifier values defining the k-anonymity equivalence\nclass. The order is always the same as the original request.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Value" + } + }, + "numDistinctSensitiveValues": { + "description": "Number of distinct sensitive values in this equivalence class.", + "format": "int64", + "type": "string" + }, + "topSensitiveValues": { + "description": "Estimated frequencies of top sensitive values.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ValueFrequency" + } + }, + "equivalenceClassSize": { + "description": "Size of the k-anonymity equivalence class.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1LDiversityEquivalenceClass" + }, + "GooglePrivacyDlpV2beta1NumericalStatsConfig": { + "description": "Compute numerical stats over an individual column, including\nmin, max, and quantiles.", + "type": "object", + "properties": { + "field": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "Field to compute numerical stats on. Supported types are\ninteger, float, date, datetime, timestamp, time." + } + }, + "id": "GooglePrivacyDlpV2beta1NumericalStatsConfig" + }, + "GooglePrivacyDlpV2beta1TimePartConfig": { + "description": "For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a\nportion of the value.", + "type": "object", + "properties": { + "partToExtract": { + "enumDescriptions": [ + "", + "[000-9999]", + "[1-12]", + "[1-31]", + "[1-7]", + "[1-52]", + "[0-24]" + ], + "enum": [ + "TIME_PART_UNSPECIFIED", + "YEAR", + "MONTH", + "DAY_OF_MONTH", + "DAY_OF_WEEK", + "WEEK_OF_YEAR", + "HOUR_OF_DAY" + ], + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1TimePartConfig" + }, + "GooglePrivacyDlpV2beta1RecordCondition": { + "description": "A condition for determing whether a transformation should be applied to\na field.", + "type": "object", + "properties": { + "expressions": { + "$ref": "GooglePrivacyDlpV2beta1Expressions" + } + }, + "id": "GooglePrivacyDlpV2beta1RecordCondition" + }, + "GooglePrivacyDlpV2beta1DeidentificationSummary": { + "description": "High level summary of deidentification.", + "type": "object", + "properties": { + "transformedBytes": { + "description": "Total size in bytes that were transformed in some way.", + "format": "int64", + "type": "string" + }, + "transformationSummaries": { + "description": "Transformations applied to the dataset.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1TransformationSummary" + } + } + }, + "id": "GooglePrivacyDlpV2beta1DeidentificationSummary" + }, + "GooglePrivacyDlpV2beta1ListInfoTypesResponse": { + "description": "Response to the ListInfoTypes request.", + "type": "object", + "properties": { + "infoTypes": { + "description": "Set of sensitive info types belonging to a category.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeDescription" + } + } + }, + "id": "GooglePrivacyDlpV2beta1ListInfoTypesResponse" + }, + "GooglePrivacyDlpV2beta1CloudStorageKey": { + "description": "Record key for a finding in a Cloud Storage file.", + "type": "object", + "properties": { + "filePath": { + "description": "Path to the file.", + "type": "string" + }, + "startOffset": { + "description": "Byte offset of the referenced data in the file.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1CloudStorageKey" + }, + "GooglePrivacyDlpV2beta1NumericalStatsResult": { + "properties": { + "minValue": { + "description": "Minimum value appearing in the column.", + "$ref": "GooglePrivacyDlpV2beta1Value" + }, + "maxValue": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Maximum value appearing in the column." + }, + "quantileValues": { + "description": "List of 99 values that partition the set of field values into 100 equal\nsized buckets.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Value" + } + } + }, + "id": "GooglePrivacyDlpV2beta1NumericalStatsResult", + "description": "Result of the numerical stats computation.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1DatastoreOptions": { + "description": "Options defining a data set within Google Cloud Datastore.", + "type": "object", + "properties": { + "partitionId": { + "description": "A partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.", + "$ref": "GooglePrivacyDlpV2beta1PartitionId" + }, + "kind": { + "description": "The kind to process.", + "$ref": "GooglePrivacyDlpV2beta1KindExpression" + }, + "projection": { + "description": "Properties to scan. If none are specified, all properties will be scanned\nby default.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Projection" + } + } + }, + "id": "GooglePrivacyDlpV2beta1DatastoreOptions" + }, + "GooglePrivacyDlpV2beta1RecordTransformations": { + "description": "A type of transformation that is applied over structured data such as a\ntable.", + "type": "object", + "properties": { + "recordSuppressions": { + "description": "Configuration defining which records get suppressed entirely. Records that\nmatch any suppression rule are omitted from the output [optional].", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1RecordSuppression" + } + }, + "fieldTransformations": { + "description": "Transform the record by applying various field transformations.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldTransformation" + } + } + }, + "id": "GooglePrivacyDlpV2beta1RecordTransformations" + }, + "GooglePrivacyDlpV2beta1InspectConfig": { + "description": "Configuration description of the scanning process.\nWhen used with redactContent only info_types and min_likelihood are currently\nused.", + "type": "object", + "properties": { + "excludeTypes": { + "description": "When true, excludes type information of the findings.", + "type": "boolean" + }, + "minLikelihood": { + "enumDescriptions": [ + "Default value; information with all likelihoods is included.", + "Few matching elements.", + "", + "Some matching elements.", + "", + "Many matching elements." + ], + "enum": [ + "LIKELIHOOD_UNSPECIFIED", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Only returns findings equal or above this threshold.", + "type": "string" + }, + "infoTypeLimits": { + "description": "Configuration of findings limit given for specified info types.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeLimit" + } + }, + "maxFindings": { + "description": "Limits the number of findings per content item or long running operation.", + "format": "int32", + "type": "integer" + }, + "infoTypes": { + "description": "Restricts what info_types to look for. The values must correspond to\nInfoType values returned by ListInfoTypes or found in documentation.\nEmpty info_types runs all enabled detectors.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoType" + } + }, + "includeQuote": { + "description": "When true, a contextual quote from the data that triggered a finding is\nincluded in the response; see Finding.quote.", + "type": "boolean" + } + }, + "id": "GooglePrivacyDlpV2beta1InspectConfig" + }, + "GooglePrivacyDlpV2beta1Projection": { + "description": "A representation of a Datastore property in a projection.", + "type": "object", + "properties": { + "property": { + "$ref": "GooglePrivacyDlpV2beta1PropertyReference", + "description": "The property to project." + } + }, + "id": "GooglePrivacyDlpV2beta1Projection" + }, + "GooglePrivacyDlpV2beta1RedactConfig": { + "properties": {}, + "id": "GooglePrivacyDlpV2beta1RedactConfig", + "description": "Redact a given value. For example, if used with an `InfoTypeTransformation`\ntransforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the\noutput would be 'My phone number is '.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Key": { + "description": "A unique identifier for a Datastore entity.\nIf a key's partition ID or any of its path kinds or names are\nreserved/read-only, the key is reserved/read-only.\nA reserved/read-only key is forbidden in certain documented contexts.", + "type": "object", + "properties": { + "partitionId": { + "$ref": "GooglePrivacyDlpV2beta1PartitionId", + "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition." + }, + "path": { + "description": "The entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a _root entity_, the second element identifies\na _child_ of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's _ancestors_.\n\nA path can never be empty, and a path can have at most 100 elements.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1PathElement" + } + } + }, + "id": "GooglePrivacyDlpV2beta1Key" + }, + "GooglePrivacyDlpV2beta1CryptoHashConfig": { + "description": "Pseudonymization method that generates surrogates via cryptographic hashing.\nUses SHA-256.\nOutputs a 32 byte digest as an uppercase hex string\n(for example, 41D1567F7F99F1DC2A5FAB886DEE5BEE).\nCurrently, only string and integer values can be hashed.", + "type": "object", + "properties": { + "cryptoKey": { + "description": "The key used by the hash function.", + "$ref": "GooglePrivacyDlpV2beta1CryptoKey" + } + }, + "id": "GooglePrivacyDlpV2beta1CryptoHashConfig" + }, + "GooglePrivacyDlpV2beta1InspectContentRequest": { + "description": "Request to search for potentially sensitive info in a list of items.", + "type": "object", + "properties": { + "inspectConfig": { + "description": "Configuration for the inspector.", + "$ref": "GooglePrivacyDlpV2beta1InspectConfig" + }, + "items": { + "description": "The list of items to inspect. Items in a single request are\nconsidered \"related\" unless inspect_config.independent_inputs is true.\nUp to 100 are allowed per request.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + } + } + }, + "id": "GooglePrivacyDlpV2beta1InspectContentRequest" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "DLP", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://dlp.googleapis.com/", + "ownerDomain": "google.com", + "name": "dlp", + "batchPath": "batch", + "title": "DLP API", + "ownerName": "Google", + "resources": { + "riskAnalysis": { + "resources": { + "operations": { + "methods": { + "list": { + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^riskAnalysis/operations$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "pageSize": { + "description": "The list page size. The maximum allowed value is 256 and the default is 100.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "Filters by `done`. That is, `done=true` or `done=false`.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/riskAnalysis/operations", + "path": "v2beta1/{+name}", + "id": "dlp.riskAnalysis.operations.list", + "description": "Fetches the list of long running operations." + }, + "get": { + "flatPath": "v2beta1/riskAnalysis/operations/{operationsId}", + "id": "dlp.riskAnalysis.operations.get", + "path": "v2beta1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "httpMethod": "GET", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^riskAnalysis/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "cancel": { + "description": "Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation.", + "request": { + "$ref": "GoogleLongrunningCancelOperationRequest" + }, + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string", + "pattern": "^riskAnalysis/operations/[^/]+$" + } + }, + "flatPath": "v2beta1/riskAnalysis/operations/{operationsId}:cancel", + "path": "v2beta1/{+name}:cancel", + "id": "dlp.riskAnalysis.operations.cancel" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^riskAnalysis/operations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/riskAnalysis/operations/{operationsId}", + "id": "dlp.riskAnalysis.operations.delete", + "path": "v2beta1/{+name}", + "description": "This method is not supported and the server returns `UNIMPLEMENTED`." + } + } + } + } + }, + "dataSource": { + "methods": { + "analyze": { + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v2beta1/dataSource:analyze", + "path": "v2beta1/dataSource:analyze", + "id": "dlp.dataSource.analyze", + "description": "Schedules a job to compute risk analysis metrics over content in a Google\nCloud Platform repository.", + "request": { + "$ref": "GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest" + } + } + } + }, + "inspect": { + "resources": { + "results": { + "resources": { + "findings": { + "methods": { + "list": { + "response": { + "$ref": "GooglePrivacyDlpV2beta1ListInspectFindingsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "Maximum number of results to return.\nIf 0, the implementation selects a reasonable value.", + "format": "int32", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "Restricts findings to items that match. Supports info_type and likelihood.\n\nExamples:\n\n- info_type=EMAIL_ADDRESS\n- info_type=PHONE_NUMBER,EMAIL_ADDRESS\n- likelihood=VERY_LIKELY\n- likelihood=VERY_LIKELY,LIKELY\n- info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY", + "type": "string" + }, + "name": { + "location": "path", + "description": "Identifier of the results set returned as metadata of\nthe longrunning operation created by a call to InspectDataSource.\nShould be in the format of `inspect/results/{id}`.", + "required": true, + "type": "string", + "pattern": "^inspect/results/[^/]+$" + }, + "pageToken": { + "description": "The value returned by the last `ListInspectFindingsResponse`; indicates\nthat this is a continuation of a prior `ListInspectFindings` call, and that\nthe system should return the next page of data.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/inspect/results/{resultsId}/findings", + "path": "v2beta1/{+name}/findings", + "id": "dlp.inspect.results.findings.list", + "description": "Returns list of results for given inspect operation result set id." + } + } + } + } + }, + "operations": { + "methods": { + "list": { + "description": "Fetches the list of long running operations.", + "httpMethod": "GET", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "location": "query", + "description": "Filters by `done`. That is, `done=true` or `done=false`.", + "type": "string" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^inspect/operations$" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "pageSize": { + "description": "The list page size. The maximum allowed value is 256 and the default is 100.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/inspect/operations", + "id": "dlp.inspect.operations.list", + "path": "v2beta1/{+name}" + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^inspect/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/inspect/operations/{operationsId}", + "path": "v2beta1/{+name}", + "id": "dlp.inspect.operations.get" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/inspect/operations", + "id": "dlp.inspect.operations.create", + "path": "v2beta1/inspect/operations", + "request": { + "$ref": "GooglePrivacyDlpV2beta1CreateInspectOperationRequest" + }, + "description": "Schedules a job scanning content in a Google Cloud Platform data\nrepository." + }, + "cancel": { + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string", + "pattern": "^inspect/operations/[^/]+$" + } + }, + "flatPath": "v2beta1/inspect/operations/{operationsId}:cancel", + "path": "v2beta1/{+name}:cancel", + "id": "dlp.inspect.operations.cancel", + "description": "Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation.", + "request": { + "$ref": "GoogleLongrunningCancelOperationRequest" + } + }, + "delete": { + "flatPath": "v2beta1/inspect/operations/{operationsId}", + "path": "v2beta1/{+name}", + "id": "dlp.inspect.operations.delete", + "description": "This method is not supported and the server returns `UNIMPLEMENTED`.", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^inspect/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string" + } + } + } + } + } + } + }, + "content": { + "methods": { + "deidentify": { + "request": { + "$ref": "GooglePrivacyDlpV2beta1DeidentifyContentRequest" + }, + "description": "De-identifies potentially sensitive info from a list of strings.\nThis method has limits on input size and output size.", + "response": { + "$ref": "GooglePrivacyDlpV2beta1DeidentifyContentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/content:deidentify", + "path": "v2beta1/content:deidentify", + "id": "dlp.content.deidentify" + }, + "inspect": { + "request": { + "$ref": "GooglePrivacyDlpV2beta1InspectContentRequest" + }, + "description": "Finds potentially sensitive info in a list of strings.\nThis method has limits on input size, processing time, and output size.", + "response": { + "$ref": "GooglePrivacyDlpV2beta1InspectContentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/content:inspect", + "path": "v2beta1/content:inspect", + "id": "dlp.content.inspect" + }, + "redact": { + "flatPath": "v2beta1/content:redact", + "id": "dlp.content.redact", + "path": "v2beta1/content:redact", + "request": { + "$ref": "GooglePrivacyDlpV2beta1RedactContentRequest" + }, + "description": "Redacts potentially sensitive info from a list of strings.\nThis method has limits on input size, processing time, and output size.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GooglePrivacyDlpV2beta1RedactContentResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "rootCategories": { + "methods": { + "list": { + "description": "Returns the list of root categories of sensitive information.", + "response": { + "$ref": "GooglePrivacyDlpV2beta1ListRootCategoriesResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "languageCode": { + "description": "Optional language code for localized friendly category names.\nIf omitted or if localized strings are not available,\nen-US strings will be returned.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2beta1/rootCategories", + "path": "v2beta1/rootCategories", + "id": "dlp.rootCategories.list" + } + }, + "resources": { + "infoTypes": { + "methods": { + "list": { + "description": "Returns sensitive information types for given category.", + "response": { + "$ref": "GooglePrivacyDlpV2beta1ListInfoTypesResponse" + }, + "parameterOrder": [ + "category" + ], + "httpMethod": "GET", + "parameters": { + "category": { + "description": "Category name as returned by ListRootCategories.", + "required": true, + "type": "string", + "pattern": "^[^/]+$", + "location": "path" + }, + "languageCode": { + "description": "Optional BCP-47 language code for localized info type friendly\nnames. If omitted, or if localized strings are not available,\nen-US strings will be returned.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/rootCategories/{rootCategoriesId}/infoTypes", + "path": "v2beta1/rootCategories/{+category}/infoTypes", + "id": "dlp.rootCategories.infoTypes.list" + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "type": "boolean", + "default": "true", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + } + }, + "version": "v2beta1", + "baseUrl": "https://dlp.googleapis.com/", + "kind": "discovery#restDescription", + "description": "The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.", + "servicePath": "", + "basePath": "", + "revision": "20170918", + "documentationLink": "https://cloud.google.com/dlp/docs/", + "id": "dlp:v2beta1" +} diff --git a/etc/api/dns/v1/crates/1.0.6-api+20170921 b/etc/api/dns/v1/crates/1.0.6-api+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dns/v1/crates/1.0.6-cli+20170921 b/etc/api/dns/v1/crates/1.0.6-cli+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/dns/v1/dns-api.json b/etc/api/dns/v1/dns-api.json index 73980a5009..597a87cf71 100644 --- a/etc/api/dns/v1/dns-api.json +++ b/etc/api/dns/v1/dns-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/nI5hxBcCe0tNnzyChFSdnIGBMt0\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Qqhck8TylpPy6aQ1JM2ZkAgjJKg\"", "discoveryVersion": "v1", "id": "dns:v1", "name": "dns", "version": "v1", - "revision": "20170512", + "revision": "20170921", "title": "Google Cloud DNS API", "description": "Configures and serves authoritative DNS records.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/dns/v1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "dns/v1/projects/", - "batchPath": "batch", + "batchPath": "batch/dns/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/dns/v2beta1/dns-api.json b/etc/api/dns/v2beta1/dns-api.json index d7911b7297..152661aea2 100644 --- a/etc/api/dns/v2beta1/dns-api.json +++ b/etc/api/dns/v2beta1/dns-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/TFtoAUbJqSv6jKBRWRbK7yQFFhw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/hpi36R8_AoZ-cwi75LboIgnLTZI\"", "discoveryVersion": "v1", "id": "dns:v2beta1", "name": "dns", "version": "v2beta1", - "revision": "20170512", + "revision": "20170921", "title": "Google Cloud DNS API", "description": "Configures and serves authoritative DNS records.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/dns/v2beta1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "dns/v2beta1/projects/", - "batchPath": "batch", + "batchPath": "batch/dns/v2beta1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/doubleclickbidmanager/v1/crates/1.0.6-api+20170705 b/etc/api/doubleclickbidmanager/v1/crates/1.0.6-api+20170705 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/doubleclickbidmanager/v1/crates/1.0.6-cli+20170705 b/etc/api/doubleclickbidmanager/v1/crates/1.0.6-cli+20170705 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json b/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json index 13b078ad14..53611dd396 100644 --- a/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json +++ b/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/TpAruLLB982pPy6sW_n60NUC_v0\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/fiMIPCbr-8OYnnFx-elRq37f8OU\"", "discoveryVersion": "v1", "id": "doubleclickbidmanager:v1", "name": "doubleclickbidmanager", "canonicalName": "DoubleClick Bid Manager", "version": "v1", - "revision": "20170224", + "revision": "20170705", "title": "DoubleClick Bid Manager API", "description": "API for viewing and managing your reports in DoubleClick Bid Manager.", "ownerDomain": "google.com", @@ -89,11 +89,9 @@ "type": "string", "description": "File specification (column names, types, order) in which the line items will be returned. Default to EWF.", "enum": [ - "EWF", - "SDF" + "EWF" ], "enumDescriptions": [ - "", "" ] }, @@ -138,7 +136,7 @@ "properties": { "lineItems": { "type": "string", - "description": "Retrieved line items in CSV format. Refer to Entity Write File Format or Structured Data File Format for more information on file formats." + "description": "Retrieved line items in CSV format. For more information about file formats, see Entity Write File Format." } } }, @@ -235,6 +233,7 @@ "FILTER_AGE", "FILTER_BRANDSAFE_CHANNEL_ID", "FILTER_BROWSER", + "FILTER_BUDGET_SEGMENT_DESCRIPTION", "FILTER_CAMPAIGN_DAILY_FREQUENCY", "FILTER_CARRIER", "FILTER_CHANNEL_ID", @@ -461,6 +460,7 @@ "", "", "", + "", "" ] }, @@ -535,6 +535,7 @@ "FILTER_AGE", "FILTER_BRANDSAFE_CHANNEL_ID", "FILTER_BROWSER", + "FILTER_BUDGET_SEGMENT_DESCRIPTION", "FILTER_CAMPAIGN_DAILY_FREQUENCY", "FILTER_CARRIER", "FILTER_CHANNEL_ID", @@ -761,6 +762,7 @@ "", "", "", + "", "" ] } @@ -967,6 +969,7 @@ "METRIC_PROFIT_VIEWABLE_ECPM_ADVERTISER", "METRIC_PROFIT_VIEWABLE_ECPM_PARTNER", "METRIC_PROFIT_VIEWABLE_ECPM_USD", + "METRIC_REACH_COOKIE_FREQUENCY", "METRIC_REACH_COOKIE_REACH", "METRIC_REVENUE_ADVERTISER", "METRIC_REVENUE_ECPAPC_ADVERTISER", @@ -1382,6 +1385,7 @@ "", "", "", + "", "" ] } diff --git a/etc/api/doubleclicksearch/v2/crates/1.0.6-api+20170919 b/etc/api/doubleclicksearch/v2/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/doubleclicksearch/v2/crates/1.0.6-cli+20170919 b/etc/api/doubleclicksearch/v2/crates/1.0.6-cli+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json b/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json index 42e39fe9e4..2ed4998f37 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/CNwW5zhdZOVYCBH02fYR4CSgom8\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/hR70UblNHyBCC4lBQCtqgaZ_GJ8\"", "discoveryVersion": "v1", "id": "doubleclicksearch:v2", "name": "doubleclicksearch", "version": "v2", - "revision": "20170509", + "revision": "20170919", "title": "DoubleClick Search API", "description": "Reports and modifies your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/doubleclicksearch/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "doubleclicksearch/v2/", - "batchPath": "batch", + "batchPath": "batch/doubleclicksearch/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/drive/v2/crates/1.0.6-api+20170915 b/etc/api/drive/v2/crates/1.0.6-api+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/drive/v2/crates/1.0.6-cli+20170915 b/etc/api/drive/v2/crates/1.0.6-cli+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/drive/v2/drive-api.json b/etc/api/drive/v2/drive-api.json index 839462f601..b8e6716d5c 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/HjapmkPPa8mIdGN85nrk4HlNMhc\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/iFxqLENsSLiJs1Br4TNBOHg98fQ\"", "discoveryVersion": "v1", "id": "drive:v2", "name": "drive", "version": "v2", - "revision": "20170512", + "revision": "20170915", "title": "Drive API", "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/drive/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "drive/v2/", - "batchPath": "batch", + "batchPath": "batch/drive/v2", "parameters": { "alt": { "type": "string", @@ -1332,6 +1332,13 @@ "$ref": "ParentReference" } }, + "permissionIds": { + "type": "array", + "description": "List of permission IDs for users with access to this file.", + "items": { + "type": "string" + } + }, "permissions": { "type": "array", "description": "The list of permissions for users with access to this file. Not populated for Team Drive files.", @@ -1600,7 +1607,7 @@ }, "authKey": { "type": "string", - "description": "The authkey parameter required for this permission." + "description": "Deprecated." }, "deleted": { "type": "boolean", @@ -2993,7 +3000,7 @@ "id": "drive.files.export", "path": "files/{fileId}/export", "httpMethod": "GET", - "description": "Exports a Google Doc to the requested MIME type and returns the exported content.", + "description": "Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.", "parameters": { "fileId": { "type": "string", @@ -3255,7 +3262,7 @@ }, "orderBy": { "type": "string", - "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", + "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", "location": "query" }, "pageToken": { diff --git a/etc/api/drive/v3/crates/1.0.6-api+20170915 b/etc/api/drive/v3/crates/1.0.6-api+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/drive/v3/crates/1.0.6-cli+20170915 b/etc/api/drive/v3/crates/1.0.6-cli+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/drive/v3/drive-api.json b/etc/api/drive/v3/drive-api.json index 97675625ed..e49520e13a 100644 --- a/etc/api/drive/v3/drive-api.json +++ b/etc/api/drive/v3/drive-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/1elIKE9OJ8UNewNj9RsDGTkU5MM\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/IQ6IlDF_Rs6vMZyFSA6V8uvh46Q\"", "discoveryVersion": "v1", "id": "drive:v3", "name": "drive", "version": "v3", - "revision": "20170512", + "revision": "20170915", "title": "Drive API", "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/drive/v3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "drive/v3/", - "batchPath": "batch", + "batchPath": "batch/drive/v3", "parameters": { "alt": { "type": "string", @@ -759,6 +759,13 @@ "type": "string" } }, + "permissionIds": { + "type": "array", + "description": "List of permission IDs for users with access to this file.", + "items": { + "type": "string" + } + }, "permissions": { "type": "array", "description": "The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.", @@ -1979,7 +1986,7 @@ "id": "drive.files.export", "path": "files/{fileId}/export", "httpMethod": "GET", - "description": "Exports a Google Doc to the requested MIME type and returns the exported content.", + "description": "Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.", "parameters": { "fileId": { "type": "string", @@ -2112,7 +2119,7 @@ }, "orderBy": { "type": "string", - "description": "A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", + "description": "A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", "location": "query" }, "pageSize": { diff --git a/etc/api/firebasedynamiclinks/v1/crates/1.0.6-api+20170926 b/etc/api/firebasedynamiclinks/v1/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json b/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json index 12dd48646b..c872bb289c 100644 --- a/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json +++ b/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json @@ -1,135 +1,13 @@ { - "rootUrl": "https://firebasedynamiclinks.googleapis.com/", - "ownerDomain": "google.com", - "name": "firebasedynamiclinks", - "batchPath": "batch", - "title": "Firebase Dynamic Links API", - "ownerName": "Google", - "resources": { - "shortLinks": { - "methods": { - "create": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "CreateShortDynamicLinkResponse" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/firebase" - ], - "flatPath": "v1/shortLinks", - "id": "firebasedynamiclinks.shortLinks.create", - "path": "v1/shortLinks", - "request": { - "$ref": "CreateShortDynamicLinkRequest" - }, - "description": "Creates a short Dynamic Link given either a valid long Dynamic Link or\ndetails such as Dynamic Link domain, Android and iOS app information.\nThe created short Dynamic Link will not expire.\n\nRepeated calls with the same long Dynamic Link or Dynamic Link information\nwill produce the same short Dynamic Link.\n\nThe Dynamic Link domain in the request must be owned by requester's\nFirebase project." - } - } - } - }, - "parameters": { - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "key": { - "location": "query", - "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.", - "type": "string" - } - }, - "version": "v1", - "baseUrl": "https://firebasedynamiclinks.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Programmatically creates and manages Firebase Dynamic Links.", - "servicePath": "", - "basePath": "", - "id": "firebasedynamiclinks:v1", + "revision": "20170926", "documentationLink": "https://firebase.google.com/docs/dynamic-links/", - "revision": "20170517", + "id": "firebasedynamiclinks:v1", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { "CreateShortDynamicLinkResponse": { + "description": "Response to create a short Dynamic Link.", + "type": "object", "properties": { "shortLink": { "description": "Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz", @@ -147,13 +25,9 @@ } } }, - "id": "CreateShortDynamicLinkResponse", - "description": "Response to create a short Dynamic Link.", - "type": "object" + "id": "CreateShortDynamicLinkResponse" }, "Suffix": { - "description": "Short Dynamic Link suffix.", - "type": "object", "properties": { "option": { "enumDescriptions": [ @@ -170,10 +44,22 @@ "type": "string" } }, - "id": "Suffix" + "id": "Suffix", + "description": "Short Dynamic Link suffix.", + "type": "object" }, "GooglePlayAnalytics": { + "description": "Parameters for Google Play Campaign Measurements.\n[Learn more](https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#campaign-params)", + "type": "object", "properties": { + "utmTerm": { + "description": "Campaign term; used with paid search to supply the keywords for ads.", + "type": "string" + }, + "utmSource": { + "description": "Campaign source; used to identify a search engine, newsletter, or other\nsource.", + "type": "string" + }, "gclid": { "description": "[AdWords autotagging parameter](https://support.google.com/analytics/answer/1033981?hl=en);\nused to measure Google AdWords ads. This value is generated dynamically\nand should never be modified.", "type": "string" @@ -189,26 +75,12 @@ "utmMedium": { "description": "Campaign medium; used to identify a medium such as email or cost-per-click.", "type": "string" - }, - "utmTerm": { - "description": "Campaign term; used with paid search to supply the keywords for ads.", - "type": "string" - }, - "utmSource": { - "description": "Campaign source; used to identify a search engine, newsletter, or other\nsource.", - "type": "string" } }, - "id": "GooglePlayAnalytics", - "description": "Parameters for Google Play Campaign Measurements.\n[Learn more](https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#campaign-params)", - "type": "object" + "id": "GooglePlayAnalytics" }, "DynamicLinkInfo": { "properties": { - "dynamicLinkDomain": { - "description": "Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl\n[Learn more](https://firebase.google.com/docs/dynamic-links/android/receive)\non how to set up Dynamic Link domain associated with your Firebase project.\n\nRequired.", - "type": "string" - }, "link": { "description": "The link your app will open, You can specify any URL your app can handle.\nThis link must be a well-formatted URL, be properly URL-encoded, and use\nthe HTTP or HTTPS scheme. See 'link' parameters in the\n[documentation](https://firebase.google.com/docs/dynamic-links/create-manually).\n\nRequired.", "type": "string" @@ -226,12 +98,16 @@ "$ref": "AndroidInfo" }, "navigationInfo": { - "$ref": "NavigationInfo", - "description": "Information of navigation behavior of a Firebase Dynamic Links." + "description": "Information of navigation behavior of a Firebase Dynamic Links.", + "$ref": "NavigationInfo" }, "analyticsInfo": { "$ref": "AnalyticsInfo", "description": "Parameters used for tracking. See all tracking parameters in the\n[documentation](https://firebase.google.com/docs/dynamic-links/create-manually)." + }, + "dynamicLinkDomain": { + "description": "Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl\n[Learn more](https://firebase.google.com/docs/dynamic-links/android/receive)\non how to set up Dynamic Link domain associated with your Firebase project.\n\nRequired.", + "type": "string" } }, "id": "DynamicLinkInfo", @@ -239,8 +115,6 @@ "type": "object" }, "ITunesConnectAnalytics": { - "description": "Parameters for iTunes Connect App Analytics.", - "type": "object", "properties": { "at": { "description": "Affiliate token used to create affiliate-coded links.", @@ -259,7 +133,109 @@ "type": "string" } }, - "id": "ITunesConnectAnalytics" + "id": "ITunesConnectAnalytics", + "description": "Parameters for iTunes Connect App Analytics.", + "type": "object" + }, + "DeviceInfo": { + "description": "Signals associated with the device making the request.", + "type": "object", + "properties": { + "screenResolutionHeight": { + "description": "Device display resolution height.", + "format": "int64", + "type": "string" + }, + "languageCode": { + "description": "Device language code setting.", + "type": "string" + }, + "timezone": { + "description": "Device timezone setting.", + "type": "string" + }, + "screenResolutionWidth": { + "description": "Device display resolution width.", + "format": "int64", + "type": "string" + }, + "deviceModelName": { + "description": "Device model name.", + "type": "string" + } + }, + "id": "DeviceInfo" + }, + "GetIosPostInstallAttributionResponse": { + "description": "Response for iSDK to execute strong match flow for post-install attribution.", + "type": "object", + "properties": { + "utmSource": { + "description": "Scion source value to be propagated by iSDK to Scion at post-install.", + "type": "string" + }, + "isStrongMatchExecutable": { + "description": "Instruction for iSDK to attemmpt to perform strong match. For instance,\nif browser does not support/allow cookie or outside of support browsers,\nthis will be false.", + "type": "boolean" + }, + "appMinimumVersion": { + "description": "The minimum version for app, specified by dev through ?imv= parameter.\nReturn to iSDK to allow app to evaluate if current version meets this.", + "type": "string" + }, + "deepLink": { + "description": "The deep-link attributed post-install via one of several techniques\n(fingerprint, copy unique).", + "type": "string" + }, + "invitationId": { + "description": "Invitation ID attributed post-install via one of several techniques\n(fingerprint, copy unique).", + "type": "string" + }, + "attributionConfidence": { + "enumDescriptions": [ + "Unset.", + "Weak confidence, more than one matching link found or link suspected to\nbe false positive", + "Default confidence, match based on fingerprint", + "Unique confidence, match based on \"unique match link to check\" or other\nmeans" + ], + "enum": [ + "UNKNOWN_ATTRIBUTION_CONFIDENCE", + "WEAK", + "DEFAULT", + "UNIQUE" + ], + "description": "The confidence of the returned attribution.", + "type": "string" + }, + "externalBrowserDestinationLink": { + "description": "User-agent specific custom-scheme URIs for iSDK to open. This will be set\naccording to the user-agent tha the click was originally made in. There is\nno Safari-equivalent custom-scheme open URLs.\nie: googlechrome://www.example.com\nie: firefox://open-url?url=http://www.example.com\nie: opera-http://example.com", + "type": "string" + }, + "matchMessage": { + "description": "Describes why match failed, ie: \"discarded due to low confidence\".\nThis message will be publicly visible.", + "type": "string" + }, + "resolvedLink": { + "description": "The entire FDL, expanded from a short link. It is the same as the\nrequested_link, if it is long. Parameters from this should not be\nused directly (ie: server can default utm_[campaign|medium|source]\nto a value when requested_link lack them, server determine the best\nfallback_link when requested_link specifies \u003e1 fallback links).", + "type": "string" + }, + "utmCampaign": { + "description": "Scion campaign value to be propagated by iSDK to Scion at post-install.", + "type": "string" + }, + "fallbackLink": { + "description": "The link to navigate to update the app if min version is not met.\nThis is either (in order): 1) fallback link (from ?ifl= parameter, if\nspecified by developer) or 2) AppStore URL (from ?isi= parameter, if\nspecified), or 3) the payload link (from required link= parameter).", + "type": "string" + }, + "requestedLink": { + "description": "Entire FDL (short or long) attributed post-install via one of several\ntechniques (fingerprint, copy unique).", + "type": "string" + }, + "utmMedium": { + "description": "Scion medium value to be propagated by iSDK to Scion at post-install.", + "type": "string" + } + }, + "id": "GetIosPostInstallAttributionResponse" }, "SocialMetaTagInfo": { "description": "Parameters for social meta tag params.\nUsed to set meta tag data for link previews on social sites.", @@ -280,10 +256,37 @@ }, "id": "SocialMetaTagInfo" }, + "AndroidInfo": { + "description": "Android related attributes to the Dynamic Link.", + "type": "object", + "properties": { + "androidPackageName": { + "description": "Android package name of the app.", + "type": "string" + }, + "androidMinPackageVersionCode": { + "description": "Minimum version code for the Android app. If the installed app’s version\ncode is lower, then the user is taken to the Play Store.", + "type": "string" + }, + "androidLink": { + "description": "If specified, this overrides the ‘link’ parameter on Android.", + "type": "string" + }, + "androidFallbackLink": { + "description": "Link to open on Android if the app is not installed.", + "type": "string" + } + }, + "id": "AndroidInfo" + }, "DynamicLinkWarning": { "description": "Dynamic Links warning messages.", "type": "object", "properties": { + "warningDocumentLink": { + "description": "The document describing the warning, and helps resolve.", + "type": "string" + }, "warningCode": { "enumDescriptions": [ "Unknown code.", @@ -357,28 +360,19 @@ }, "id": "DynamicLinkWarning" }, - "AndroidInfo": { + "DynamicLinkStats": { + "description": "Analytics stats of a Dynamic Link for a given timeframe.", + "type": "object", "properties": { - "androidLink": { - "description": "If specified, this overrides the ‘link’ parameter on Android.", - "type": "string" - }, - "androidFallbackLink": { - "description": "Link to open on Android if the app is not installed.", - "type": "string" - }, - "androidPackageName": { - "description": "Android package name of the app.", - "type": "string" - }, - "androidMinPackageVersionCode": { - "description": "Minimum version code for the Android app. If the installed app’s version\ncode is lower, then the user is taken to the Play Store.", - "type": "string" + "linkEventStats": { + "description": "Dynamic Link event stats.", + "type": "array", + "items": { + "$ref": "DynamicLinkEventStat" + } } }, - "id": "AndroidInfo", - "description": "Android related attributes to the Dynamic Link.", - "type": "object" + "id": "DynamicLinkStats" }, "NavigationInfo": { "description": "Information of navigation behavior.", @@ -392,9 +386,15 @@ "id": "NavigationInfo" }, "IosInfo": { - "description": "iOS related attributes to the Dynamic Link..", - "type": "object", "properties": { + "iosFallbackLink": { + "description": "Link to open on iOS if the app is not installed.", + "type": "string" + }, + "iosAppStoreId": { + "description": "iOS App Store ID.", + "type": "string" + }, "iosIpadFallbackLink": { "description": "If specified, this overrides the ios_fallback_link value on iPads.", "type": "string" @@ -410,36 +410,28 @@ "iosBundleId": { "description": "iOS bundle ID of the app.", "type": "string" - }, - "iosFallbackLink": { - "description": "Link to open on iOS if the app is not installed.", - "type": "string" - }, - "iosAppStoreId": { - "description": "iOS App Store ID.", - "type": "string" } }, - "id": "IosInfo" - }, - "AnalyticsInfo": { - "properties": { - "itunesConnectAnalytics": { - "description": "iTunes Connect App Analytics.", - "$ref": "ITunesConnectAnalytics" - }, - "googlePlayAnalytics": { - "$ref": "GooglePlayAnalytics", - "description": "Google Play Campaign Measurements." - } - }, - "id": "AnalyticsInfo", - "description": "Tracking parameters supported by Dynamic Link.", + "id": "IosInfo", + "description": "iOS related attributes to the Dynamic Link..", "type": "object" }, - "CreateShortDynamicLinkRequest": { - "description": "Request to create a short Dynamic Link.", + "AnalyticsInfo": { + "description": "Tracking parameters supported by Dynamic Link.", "type": "object", + "properties": { + "itunesConnectAnalytics": { + "$ref": "ITunesConnectAnalytics", + "description": "iTunes Connect App Analytics." + }, + "googlePlayAnalytics": { + "description": "Google Play Campaign Measurements.", + "$ref": "GooglePlayAnalytics" + } + }, + "id": "AnalyticsInfo" + }, + "CreateShortDynamicLinkRequest": { "properties": { "dynamicLinkInfo": { "description": "Information about the Dynamic Link to be shortened.\n[Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically).", @@ -450,16 +442,128 @@ "type": "string" }, "suffix": { - "$ref": "Suffix", - "description": "Short Dynamic Link suffix. Optional." + "description": "Short Dynamic Link suffix. Optional.", + "$ref": "Suffix" } }, - "id": "CreateShortDynamicLinkRequest" + "id": "CreateShortDynamicLinkRequest", + "description": "Request to create a short Dynamic Link.", + "type": "object" + }, + "DynamicLinkEventStat": { + "properties": { + "event": { + "enumDescriptions": [ + "Unspecified type.", + "Indicates that an FDL is clicked by users.", + "Indicates that an FDL redirects users to fallback link.", + "Indicates that an FDL triggers an app install from Play store, currently\nit's impossible to get stats from App store.", + "Indicates that the app is opened for the first time after an install\ntriggered by FDLs", + "Indicates that the app is opened via an FDL for non-first time." + ], + "enum": [ + "DYNAMIC_LINK_EVENT_UNSPECIFIED", + "CLICK", + "REDIRECT", + "APP_INSTALL", + "APP_FIRST_OPEN", + "APP_RE_OPEN" + ], + "description": "Link event.", + "type": "string" + }, + "platform": { + "enumDescriptions": [ + "Unspecified platform.", + "Represents Android platform.\nAll apps and browsers on Android are classfied in this category.", + "Represents iOS platform.\nAll apps and browsers on iOS are classfied in this category.", + "Represents desktop.\nNote: other platforms like Windows, Blackberry, Amazon fall into this\ncategory." + ], + "enum": [ + "DYNAMIC_LINK_PLATFORM_UNSPECIFIED", + "ANDROID", + "IOS", + "DESKTOP" + ], + "description": "Requested platform.", + "type": "string" + }, + "count": { + "description": "The number of times this event occurred.", + "format": "int64", + "type": "string" + } + }, + "id": "DynamicLinkEventStat", + "description": "Dynamic Link event stat.", + "type": "object" + }, + "GetIosPostInstallAttributionRequest": { + "description": "Request for iSDK to execute strong match flow for post-install attribution.\nThis is meant for iOS requests only. Requests from other platforms will\nnot be honored.", + "type": "object", + "properties": { + "bundleId": { + "description": "APP bundle ID.", + "type": "string" + }, + "device": { + "description": "Device information.", + "$ref": "DeviceInfo" + }, + "uniqueMatchLinkToCheck": { + "description": "Possible unique matched link that server need to check before performing\nfingerprint match. If passed link is short server need to expand the link.\nIf link is long server need to vslidate the link.", + "type": "string" + }, + "appInstallationTime": { + "description": "App installation epoch time (https://en.wikipedia.org/wiki/Unix_time).\nThis is a client signal for a more accurate weak match.", + "format": "int64", + "type": "string" + }, + "iosVersion": { + "description": "iOS version, ie: 9.3.5.\nConsider adding \"build\".", + "type": "string" + }, + "retrievalMethod": { + "description": "App post install attribution retrieval information. Disambiguates\nmechanism (iSDK or developer invoked) to retrieve payload from\nclicked link.", + "type": "string", + "enumDescriptions": [ + "Unknown method.", + "iSDK performs a server lookup by device fingerprint in the background\nwhen app is first-opened; no API called by developer.", + "iSDK performs a server lookup by device fingerprint upon a dev API call.", + "iSDK performs a strong match only if weak match is found upon a dev\nAPI call." + ], + "enum": [ + "UNKNOWN_PAYLOAD_RETRIEVAL_METHOD", + "IMPLICIT_WEAK_MATCH", + "EXPLICIT_WEAK_MATCH", + "EXPLICIT_STRONG_AFTER_WEAK_MATCH" + ] + }, + "visualStyle": { + "enumDescriptions": [ + "Unknown style.", + "Default style.", + "Custom style." + ], + "enum": [ + "UNKNOWN_VISUAL_STYLE", + "DEFAULT_STYLE", + "CUSTOM_STYLE" + ], + "description": "Strong match page information. Disambiguates between default UI and\ncustom page to present when strong match succeeds/fails to find cookie.", + "type": "string" + }, + "sdkVersion": { + "description": "Google SDK version.", + "type": "string" + } + }, + "id": "GetIosPostInstallAttributionRequest" } }, "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "protocol": "rest", "canonicalName": "Firebase Dynamic Links", @@ -471,5 +575,181 @@ } } } - } + }, + "rootUrl": "https://firebasedynamiclinks-ipv6.googleapis.com/", + "ownerDomain": "google.com", + "name": "firebasedynamiclinks", + "batchPath": "batch", + "title": "Firebase Dynamic Links API", + "ownerName": "Google", + "resources": { + "shortLinks": { + "methods": { + "create": { + "flatPath": "v1/shortLinks", + "path": "v1/shortLinks", + "id": "firebasedynamiclinks.shortLinks.create", + "description": "Creates a short Dynamic Link given either a valid long Dynamic Link or\ndetails such as Dynamic Link domain, Android and iOS app information.\nThe created short Dynamic Link will not expire.\n\nRepeated calls with the same long Dynamic Link or Dynamic Link information\nwill produce the same short Dynamic Link.\n\nThe Dynamic Link domain in the request must be owned by requester's\nFirebase project.", + "request": { + "$ref": "CreateShortDynamicLinkRequest" + }, + "response": { + "$ref": "CreateShortDynamicLinkResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/firebase" + ], + "parameters": {} + } + } + }, + "v1": { + "methods": { + "getLinkStats": { + "flatPath": "v1/{dynamicLink}/linkStats", + "path": "v1/{dynamicLink}/linkStats", + "id": "firebasedynamiclinks.getLinkStats", + "description": "Fetches analytics stats of a short Dynamic Link for a given\nduration. Metrics include number of clicks, redirects, installs,\napp first opens, and app reopens.", + "response": { + "$ref": "DynamicLinkStats" + }, + "parameterOrder": [ + "dynamicLink" + ], + "httpMethod": "GET", + "parameters": { + "durationDays": { + "description": "The span of time requested in days.", + "format": "int64", + "type": "string", + "location": "query" + }, + "dynamicLink": { + "location": "path", + "description": "Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/firebase" + ] + }, + "installAttribution": { + "flatPath": "v1/installAttribution", + "path": "v1/installAttribution", + "id": "firebasedynamiclinks.installAttribution", + "description": "Get iOS strong/weak-match info for post-install attribution.", + "request": { + "$ref": "GetIosPostInstallAttributionRequest" + }, + "response": { + "$ref": "GetIosPostInstallAttributionResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/firebase" + ], + "parameters": {} + } + } + } + }, + "parameters": { + "pp": { + "description": "Pretty-print response.", + "type": "boolean", + "default": "true", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + } + }, + "version": "v1", + "baseUrl": "https://firebasedynamiclinks-ipv6.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Programmatically creates and manages Firebase Dynamic Links.", + "servicePath": "", + "basePath": "" } diff --git a/etc/api/firebaseremoteconfig/v1/crates/1.0.6-api+20170912 b/etc/api/firebaseremoteconfig/v1/crates/1.0.6-api+20170912 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/firebaseremoteconfig/v1/crates/1.0.6-cli+20170912 b/etc/api/firebaseremoteconfig/v1/crates/1.0.6-cli+20170912 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json b/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json new file mode 100644 index 0000000000..d0706998d7 --- /dev/null +++ b/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json @@ -0,0 +1,275 @@ +{ + "documentationLink": "https://firebase.google.com/docs/remote-config/", + "revision": "20170912", + "id": "firebaseremoteconfig:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "RemoteConfigCondition": { + "description": "A single RemoteConfig Condition. A list of these (because order matters) are\npart of a single RemoteConfig template.", + "type": "object", + "properties": { + "expression": { + "description": "Required.", + "type": "string" + }, + "tagColor": { + "description": "Optional.\nThe display (tag) color of this condition. This serves as part of a tag\n(in the future, we may add tag text as well as tag color, but that is not\nyet implemented in the UI).\nThis value has no affect on the semantics of the delivered config and it\nis ignored by the backend, except for passing it through write/read\nrequests.\nNot having this value or having the \"CONDITION_DISPLAY_COLOR_UNSPECIFIED\"\nvalue (0) have the same meaning: Let the UI choose any valid color when\ndisplaying the condition.", + "type": "string", + "enumDescriptions": [ + "", + "Blue", + "Brown", + "Cyan", + "aka \"Red Orange\"", + "Green", + "Indigo\n*", + "Lime - Approved deviation from Material color palette", + "Orange", + "Pink", + "Purple", + "Teal" + ], + "enum": [ + "CONDITION_DISPLAY_COLOR_UNSPECIFIED", + "BLUE", + "BROWN", + "CYAN", + "DEEP_ORANGE", + "GREEN", + "INDIGO", + "LIME", + "ORANGE", + "PINK", + "PURPLE", + "TEAL" + ] + }, + "name": { + "description": "Required.\nA non empty and unique name of this condition.", + "type": "string" + } + }, + "id": "RemoteConfigCondition" + }, + "RemoteConfigParameterValue": { + "description": "A RemoteConfigParameter's \"value\" (either the default value, or the value\nassociated with a condition name) is either a string, or the\n\"use_in_app_default\" indicator (which means to leave out the parameter from\nthe returned \u003ckey, value\u003e map that is the output of the parameter fetch).\nWe represent the \"use_in_app_default\" as a bool, but (when using the boolean\ninstead of the string) it should always be \u003ccode\u003etrue\u003c/code\u003e.", + "type": "object", + "properties": { + "useInAppDefault": { + "description": "if true, omit the parameter from the map of fetched parameter values", + "type": "boolean" + }, + "value": { + "description": "the string to set the parameter to", + "type": "string" + } + }, + "id": "RemoteConfigParameterValue" + }, + "RemoteConfig": { + "description": "*\nThe RemoteConfig consists of a list of conditions (which can be\nthought of as named \"if\" statements) and a map of parameters (parameter key\nto a stucture containing an optional default value, as well as a optional\nsubmap of (condition name to value when that condition is true).", + "type": "object", + "properties": { + "conditions": { + "description": "The list of named conditions. The order *does* affect the semantics.\nThe condition_name values of these entries must be unique.\n\nThe resolved value of a config parameter P is determined as follow:\n* Let Y be the set of values from the submap of P that refer to conditions\n that evaluate to \u003ccode\u003etrue\u003c/code\u003e.\n* If Y is non empty, the value is taken from the specific submap in Y whose\n condition_name is the earliest in this condition list.\n* Else, if P has a default value option (condition_name is empty) then\n the value is taken from that option.\n* Else, parameter P has no value and is omitted from the config result.\n\nExample: parameter key \"p1\", default value \"v1\", submap specified as\n{\"c1\": v2, \"c2\": v3} where \"c1\" and \"c2\" are names of conditions in the\ncondition list (where \"c1\" in this example appears before \"c2\"). The\nvalue of p1 would be v2 as long as c1 is true. Otherwise, if c2 is true,\np1 would evaluate to v3, and if c1 and c2 are both false, p1 would evaluate\nto v1. If no default value was specified, and c1 and c2 were both false,\nno value for p1 would be generated.", + "items": { + "$ref": "RemoteConfigCondition" + }, + "type": "array" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "$ref": "RemoteConfigParameter" + }, + "description": "Map of parameter keys to their optional default values and optional submap\nof (condition name : value). Order doesn't affect semantics, and so is\nsorted by the server. The 'key' values of the params must be unique." + } + }, + "id": "RemoteConfig" + }, + "RemoteConfigParameter": { + "properties": { + "defaultValue": { + "description": "Optional - value to set the parameter to, when none of the named conditions\nevaluate to \u003ccode\u003etrue\u003c/code\u003e.", + "$ref": "RemoteConfigParameterValue" + }, + "conditionalValues": { + "type": "object", + "additionalProperties": { + "$ref": "RemoteConfigParameterValue" + }, + "description": "Optional - a map of (condition_name, value). The condition_name of the\nhighest priority (the one listed first in the conditions array) determines\nthe value of this parameter." + } + }, + "id": "RemoteConfigParameter", + "description": "While default_value and conditional_values are each optional, at least one of\nthe two is required - otherwise, the parameter is meaningless (and an\nexception will be thrown by the validation logic).", + "type": "object" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Firebase Remote Config", + "rootUrl": "https://firebaseremoteconfig.googleapis.com/", + "ownerDomain": "google.com", + "name": "firebaseremoteconfig", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Firebase Remote Config API", + "ownerName": "Google", + "resources": { + "projects": { + "methods": { + "updateRemoteConfig": { + "httpMethod": "PUT", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "RemoteConfig" + }, + "parameters": { + "project": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The GMP project identifier. Required.\nSee note at the beginning of this file regarding project ids.", + "type": "string", + "required": true + }, + "validateOnly": { + "description": "Optional. Defaults to \u003ccode\u003efalse\u003c/code\u003e (UpdateRemoteConfig call should\nupdate the backend if there are no validation/interal errors). May be set\nto \u003ccode\u003etrue\u003c/code\u003e to indicate that, should no validation errors occur,\nthe call should return a \"200 OK\" instead of performing the update. Note\nthat other error messages (500 Internal Error, 412 Version Mismatch, etc)\nmay still result after flipping to \u003ccode\u003efalse\u003c/code\u003e, even if getting a\n\"200 OK\" when calling with \u003ccode\u003etrue\u003c/code\u003e.", + "type": "boolean", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/remoteConfig", + "path": "v1/{+project}/remoteConfig", + "id": "firebaseremoteconfig.projects.updateRemoteConfig", + "request": { + "$ref": "RemoteConfig" + }, + "description": "Update a RemoteConfig. We treat this as an always-existing\nresource (when it is not found in our data store, we treat it as version\n0, a template with zero conditions and zero parameters). Hence there are\nno Create or Delete operations. Returns the updated template when\nsuccessful (and the updated eTag as a response header), or an error if\nthings go wrong.\nPossible error messages:\n* VALIDATION_ERROR (HTTP status 400) with additional details if the\ntemplate being passed in can not be validated.\n* AUTHENTICATION_ERROR (HTTP status 401) if the request can not be\nauthenticate (e.g. no access token, or invalid access token).\n* AUTHORIZATION_ERROR (HTTP status 403) if the request can not be\nauthorized (e.g. the user has no access to the specified project id).\n* VERSION_MISMATCH (HTTP status 412) when trying to update when the\nexpected eTag (passed in via the \"If-match\" header) is not specified, or\nis specified but does does not match the current eTag.\n* Internal error (HTTP status 500) for Database problems or other internal\nerrors." + }, + "getRemoteConfig": { + "httpMethod": "GET", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "RemoteConfig" + }, + "parameters": { + "project": { + "description": "The GMP project identifier. Required.\nSee note at the beginning of this file regarding project ids.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/remoteConfig", + "path": "v1/{+project}/remoteConfig", + "id": "firebaseremoteconfig.projects.getRemoteConfig", + "description": "Get the latest version Remote Configuration for a project.\nReturns the RemoteConfig as the payload, and also the eTag as a\nresponse header." + } + } + } + }, + "parameters": { + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "type": "string", + "location": "query", + "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." + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + }, + "version": "v1", + "baseUrl": "https://firebaseremoteconfig.googleapis.com/", + "servicePath": "", + "description": "Firebase Remote Config API allows the 3P clients to manage Remote Config conditions and parameters for Firebase applications.", + "kind": "discovery#restDescription", + "basePath": "" +} diff --git a/etc/api/firebaserules/v1/firebaserules-api.json b/etc/api/firebaserules/v1/firebaserules-api.json index 1faa0ca74d..402166f4a7 100644 --- a/etc/api/firebaserules/v1/firebaserules-api.json +++ b/etc/api/firebaserules/v1/firebaserules-api.json @@ -1,9 +1,4 @@ { - "ownerDomain": "google.com", - "name": "firebaserules", - "batchPath": "batch", - "title": "Firebase Rules API", - "ownerName": "Google", "resources": { "projects": { "methods": { @@ -15,23 +10,23 @@ "response": { "$ref": "TestRulesetResponse" }, - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^projects/.+$", - "location": "path", - "description": "Tests may either provide `source` or a `Ruleset` resource name.\n\nFor tests against `source`, the resource name must refer to the project:\nFormat: `projects/{project_id}`\n\nFor tests against a `Ruleset`, this must be the `Ruleset` resource name:\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`" - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/firebase", "https://www.googleapis.com/auth/firebase.readonly" ], + "parameters": { + "name": { + "location": "path", + "description": "Tests may either provide `source` or a `Ruleset` resource name.\n\nFor tests against `source`, the resource name must refer to the project:\nFormat: `projects/{project_id}`\n\nFor tests against a `Ruleset`, this must be the `Ruleset` resource name:\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", + "type": "string", + "required": true, + "pattern": "^projects/.+$" + } + }, "flatPath": "v1/projects/{projectsId}:test", - "id": "firebaserules.projects.test", "path": "v1/{+name}:test", + "id": "firebaserules.projects.test", "request": { "$ref": "TestRulesetRequest" }, @@ -41,36 +36,7 @@ "resources": { "rulesets": { "methods": { - "get": { - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/rulesets/[^/]+$", - "location": "path", - "description": "Resource name for the ruleset to get.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase", - "https://www.googleapis.com/auth/firebase.readonly" - ], - "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}", - "id": "firebaserules.projects.rulesets.get", - "path": "v1/{+name}", - "description": "Get a `Ruleset` by name including the full `Source` contents.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Ruleset" - } - }, "list": { - "id": "firebaserules.projects.rulesets.list", - "path": "v1/{+name}/rulesets", "description": "List `Ruleset` metadata only and optionally filter the results by `Ruleset`\nname.\n\nThe full `Source` contents of a `Ruleset` may be retrieved with\nGetRuleset.", "httpMethod": "GET", "parameterOrder": [ @@ -79,6 +45,48 @@ "response": { "$ref": "ListRulesetsResponse" }, + "parameters": { + "filter": { + "location": "query", + "description": "`Ruleset` filter. The list method supports filters with restrictions on\n`Ruleset.name`.\n\nFilters on `Ruleset.create_time` should use the `date` function which\nparses strings that conform to the RFC 3339 date/time specifications.\n\nExample: `create_time \u003e date(\"2017-01-01\") AND name=UUID-*`", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Next page token for loading the next batch of `Ruleset` instances.", + "type": "string" + }, + "name": { + "location": "path", + "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Page size to load. Maximum of 100. Defaults to 10.\nNote: `page_size` is just a hint and the service may choose to load less\nthan `page_size` due to the size of the output. To traverse all of the\nreleases, caller should iterate until the `page_token` is empty.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase", + "https://www.googleapis.com/auth/firebase.readonly" + ], + "flatPath": "v1/projects/{projectsId}/rulesets", + "path": "v1/{+name}/rulesets", + "id": "firebaserules.projects.rulesets.list" + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Ruleset" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/firebase", @@ -86,34 +94,22 @@ ], "parameters": { "name": { - "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", + "location": "path", + "description": "Resource name for the ruleset to get.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", + "type": "string", "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - }, - "pageToken": { - "description": "Next page token for loading the next batch of `Ruleset` instances.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "Page size to load. Maximum of 100. Defaults to 10.\nNote: `page_size` is just a hint and the service may choose to load less\nthan `page_size` due to the size of the output. To traverse all of the\nreleases, caller should iterate until the `page_token` is empty.", - "format": "int32", - "type": "integer" - }, - "filter": { - "location": "query", - "description": "`Ruleset` filter. The list method supports filters with restrictions on\n`Ruleset.name`.\n\nFilters on `Ruleset.create_time` should use the `date` function which\nparses strings that conform to the RFC 3339 date/time specifications.\n\nExample: `create_time \u003e date(\"2017-01-01\") AND name=UUID-*`", - "type": "string" + "pattern": "^projects/[^/]+/rulesets/[^/]+$" } }, - "flatPath": "v1/projects/{projectsId}/rulesets" + "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}", + "path": "v1/{+name}", + "id": "firebaserules.projects.rulesets.get", + "description": "Get a `Ruleset` by name including the full `Source` contents." }, "create": { - "id": "firebaserules.projects.rulesets.create", + "flatPath": "v1/projects/{projectsId}/rulesets", "path": "v1/{+name}/rulesets", + "id": "firebaserules.projects.rulesets.create", "description": "Create a `Ruleset` from `Source`.\n\nThe `Ruleset` is given a unique generated name which is returned to the\ncaller. `Source` containing syntactic or semantics errors will result in an\nerror response indicating the first error encountered. For a detailed view\nof `Source` issues, use TestRuleset.", "request": { "$ref": "Ruleset" @@ -125,22 +121,25 @@ "response": { "$ref": "Ruleset" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase" - ], "parameters": { "name": { "location": "path", "description": "Resource name for Project which owns this `Ruleset`.\n\nFormat: `projects/{project_id}`", - "required": true, "type": "string", + "required": true, "pattern": "^projects/[^/]+$" } }, - "flatPath": "v1/projects/{projectsId}/rulesets" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ] }, "delete": { + "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}", + "id": "firebaserules.projects.rulesets.delete", + "path": "v1/{+name}", + "description": "Delete a `Ruleset` by resource name.\n\nIf the `Ruleset` is referenced by a `Release` the operation will fail.", "response": { "$ref": "Empty" }, @@ -148,55 +147,98 @@ "name" ], "httpMethod": "DELETE", - "parameters": { - "name": { - "pattern": "^projects/[^/]+/rulesets/[^/]+$", - "location": "path", - "description": "Resource name for the ruleset to delete.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", - "required": true, - "type": "string" - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/firebase" ], - "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}", - "path": "v1/{+name}", - "id": "firebaserules.projects.rulesets.delete", - "description": "Delete a `Ruleset` by resource name.\n\nIf the `Ruleset` is referenced by a `Release` the operation will fail." + "parameters": { + "name": { + "location": "path", + "description": "Resource name for the ruleset to delete.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/rulesets/[^/]+$" + } + } } } }, "releases": { "methods": { - "delete": { - "id": "firebaserules.projects.releases.delete", - "path": "v1/{+name}", - "description": "Delete a `Release` by resource name.", - "httpMethod": "DELETE", + "list": { + "httpMethod": "GET", "parameterOrder": [ "name" ], "response": { - "$ref": "Empty" + "$ref": "ListReleasesResponse" + }, + "parameters": { + "pageToken": { + "location": "query", + "description": "Next page token for the next batch of `Release` instances.", + "type": "string" + }, + "name": { + "location": "path", + "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Page size to load. Maximum of 100. Defaults to 10.\nNote: `page_size` is just a hint and the service may choose to load fewer\nthan `page_size` results due to the size of the output. To traverse all of\nthe releases, the caller should iterate until the `page_token` on the\nresponse is empty.", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "`Release` filter. The list method supports filters with restrictions on the\n`Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`.\n\nExample 1: A filter of 'name=prod*' might return `Release`s with names\nwithin 'projects/foo' prefixed with 'prod':\n\nName | Ruleset Name\n------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/uuid1234\nprojects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234\nprojects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888\n\nExample 2: A filter of `name=prod* ruleset_name=uuid1234` would return only\n`Release` instances for 'projects/foo' with names prefixed with 'prod'\nreferring to the same `Ruleset` name of 'uuid1234':\n\nName | Ruleset Name\n------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/1234\nprojects/foo/releases/prod/v1 | projects/foo/rulesets/1234\n\nIn the examples, the filter parameters refer to the search filters are\nrelative to the project. Fully qualified prefixed may also be used. e.g.\n`test_suite_name=projects/foo/testsuites/uuid1`", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase", + "https://www.googleapis.com/auth/firebase.readonly" + ], + "flatPath": "v1/projects/{projectsId}/releases", + "path": "v1/{+name}/releases", + "id": "firebaserules.projects.releases.list", + "description": "List the `Release` values for a project. This list may optionally be\nfiltered by `Release` name, `Ruleset` name, `TestSuite` name, or any\ncombination thereof." + }, + "create": { + "response": { + "$ref": "Release" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "Resource name for the project which owns this `Release`.\n\nFormat: `projects/{project_id}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/firebase" ], - "parameters": { - "name": { - "description": "Resource name for the `Release` to delete.\n\nFormat: `projects/{project_id}/releases/{release_id}`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/releases/.+$", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectsId}/releases/{releasesId}" + "flatPath": "v1/projects/{projectsId}/releases", + "id": "firebaserules.projects.releases.create", + "path": "v1/{+name}/releases", + "description": "Create a `Release`.\n\nRelease names should reflect the developer's deployment practices. For\nexample, the release name may include the environment name, application\nname, application version, or any other name meaningful to the developer.\nOnce a `Release` refers to a `Ruleset`, the rules can be enforced by\nFirebase Rules-enabled services.\n\nMore than one `Release` may be 'live' concurrently. Consider the following\nthree `Release` names for `projects/foo` and the `Ruleset` to which they\nrefer.\n\nRelease Name | Ruleset Name\n--------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/uuid123\nprojects/foo/releases/prod/beta | projects/foo/rulesets/uuid123\nprojects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456\n\nThe table reflects the `Ruleset` rollout in progress. The `prod` and\n`prod/beta` releases refer to the same `Ruleset`. However, `prod/v23`\nrefers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be\nupdated using the UpdateRelease method.", + "request": { + "$ref": "Release" + } }, "get": { + "description": "Get a `Release` by name.", "response": { "$ref": "Release" }, @@ -211,60 +253,16 @@ ], "parameters": { "name": { - "location": "path", - "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`", - "required": true, "type": "string", - "pattern": "^projects/[^/]+/releases/.+$" + "required": true, + "pattern": "^projects/[^/]+/releases/.+$", + "location": "path", + "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`" } }, "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", - "path": "v1/{+name}", "id": "firebaserules.projects.releases.get", - "description": "Get a `Release` by name." - }, - "list": { - "description": "List the `Release` values for a project. This list may optionally be\nfiltered by `Release` name, `Ruleset` name, `TestSuite` name, or any\ncombination thereof.", - "response": { - "$ref": "ListReleasesResponse" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase", - "https://www.googleapis.com/auth/firebase.readonly" - ], - "parameters": { - "filter": { - "description": "`Release` filter. The list method supports filters with restrictions on the\n`Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`.\n\nExample 1: A filter of 'name=prod*' might return `Release`s with names\nwithin 'projects/foo' prefixed with 'prod':\n\nName | Ruleset Name\n------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/uuid1234\nprojects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234\nprojects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888\n\nExample 2: A filter of `name=prod* ruleset_name=uuid1234` would return only\n`Release` instances for 'projects/foo' with names prefixed with 'prod'\nreferring to the same `Ruleset` name of 'uuid1234':\n\nName | Ruleset Name\n------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/1234\nprojects/foo/releases/prod/v1 | projects/foo/rulesets/1234\n\nIn the examples, the filter parameters refer to the search filters are\nrelative to the project. Fully qualified prefixed may also be used. e.g.\n`test_suite_name=projects/foo/testsuites/uuid1`", - "type": "string", - "location": "query" - }, - "name": { - "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "Next page token for the next batch of `Release` instances." - }, - "pageSize": { - "description": "Page size to load. Maximum of 100. Defaults to 10.\nNote: `page_size` is just a hint and the service may choose to load fewer\nthan `page_size` results due to the size of the output. To traverse all of\nthe releases, the caller should iterate until the `page_token` on the\nresponse is empty.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "flatPath": "v1/projects/{projectsId}/releases", - "path": "v1/{+name}/releases", - "id": "firebaserules.projects.releases.list" + "path": "v1/{+name}" }, "update": { "response": { @@ -274,13 +272,79 @@ "name" ], "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ], "parameters": { "name": { - "pattern": "^projects/[^/]+/releases/.+$", "location": "path", "description": "Resource name for the `Release`.\n\n`Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2`\nwhich affords developers a great deal of flexibility in mapping the name\nto the style that best fits their existing development practices. For\nexample, a name could refer to an environment, an app, a version, or some\ncombination of three.\n\nIn the table below, for the project name `projects/foo`, the following\nrelative release paths show how flat and structured names might be chosen\nto match a desired development / deployment strategy.\n\nUse Case | Flat Name | Structured Name\n-------------|---------------------|----------------\nEnvironments | releases/qa | releases/qa\nApps | releases/app1_qa | releases/app1/qa\nVersions | releases/app1_v2_qa | releases/app1/v2/qa\n\nThe delimiter between the release name path elements can be almost anything\nand it should work equally well with the release name list filter, but in\nmany ways the structured paths provide a clearer picture of the\nrelationship between `Release` instances.\n\nFormat: `projects/{project_id}/releases/{release_id}`", + "type": "string", "required": true, + "pattern": "^projects/[^/]+/releases/.+$" + } + }, + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", + "id": "firebaserules.projects.releases.update", + "path": "v1/{+name}", + "request": { + "$ref": "Release" + }, + "description": "Update a `Release`.\n\nOnly updates to the `ruleset_name` and `test_suite_name` fields will be\nhonored. `Release` rename is not supported. To create a `Release` use the\nCreateRelease method." + }, + "getExecutable": { + "response": { + "$ref": "GetReleaseExecutableResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "executableVersion": { + "location": "query", + "enum": [ + "RELEASE_EXECUTABLE_VERSION_UNSPECIFIED", + "FIREBASE_RULES_EXECUTABLE_V1", + "FIREBASE_RULES_EXECUTABLE_V2" + ], + "description": "The requested runtime executable version.\nDefaults to FIREBASE_RULES_EXECUTABLE_V1", "type": "string" + }, + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/releases/.+$", + "location": "path", + "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase", + "https://www.googleapis.com/auth/firebase.readonly" + ], + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}:getExecutable", + "id": "firebaserules.projects.releases.getExecutable", + "path": "v1/{+name}:getExecutable", + "description": "Get the `Release` executable to use when enforcing rules." + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/releases/.+$", + "location": "path", + "description": "Resource name for the `Release` to delete.\n\nFormat: `projects/{project_id}/releases/{release_id}`" } }, "scopes": [ @@ -289,40 +353,8 @@ ], "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", "path": "v1/{+name}", - "id": "firebaserules.projects.releases.update", - "request": { - "$ref": "Release" - }, - "description": "Update a `Release`.\n\nOnly updates to the `ruleset_name` and `test_suite_name` fields will be\nhonored. `Release` rename is not supported. To create a `Release` use the\nCreateRelease method." - }, - "create": { - "description": "Create a `Release`.\n\nRelease names should reflect the developer's deployment practices. For\nexample, the release name may include the environment name, application\nname, application version, or any other name meaningful to the developer.\nOnce a `Release` refers to a `Ruleset`, the rules can be enforced by\nFirebase Rules-enabled services.\n\nMore than one `Release` may be 'live' concurrently. Consider the following\nthree `Release` names for `projects/foo` and the `Ruleset` to which they\nrefer.\n\nRelease Name | Ruleset Name\n--------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/uuid123\nprojects/foo/releases/prod/beta | projects/foo/rulesets/uuid123\nprojects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456\n\nThe table reflects the `Ruleset` rollout in progress. The `prod` and\n`prod/beta` releases refer to the same `Ruleset`. However, `prod/v23`\nrefers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be\nupdated using the UpdateRelease method.", - "request": { - "$ref": "Release" - }, - "response": { - "$ref": "Release" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase" - ], - "parameters": { - "name": { - "location": "path", - "description": "Resource name for the project which owns this `Release`.\n\nFormat: `projects/{project_id}`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - } - }, - "flatPath": "v1/projects/{projectsId}/releases", - "path": "v1/{+name}/releases", - "id": "firebaserules.projects.releases.create" + "id": "firebaserules.projects.releases.delete", + "description": "Delete a `Release` by resource name." } } } @@ -330,70 +362,26 @@ } }, "parameters": { - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, "quotaUser": { "location": "query", "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.", "type": "string" }, "pp": { - "description": "Pretty-print response.", - "type": "boolean", "default": "true", - "location": "query" + "type": "boolean", + "location": "query", + "description": "Pretty-print response." }, "oauth_token": { + "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "type": "string" }, "bearer_token": { - "type": "string", "location": "query", - "description": "OAuth bearer token." + "description": "OAuth bearer token.", + "type": "string" }, "upload_protocol": { "location": "query", @@ -401,10 +389,10 @@ "type": "string" }, "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", - "location": "query" + "type": "boolean", + "location": "query", + "description": "Returns response with indentations and line breaks." }, "fields": { "location": "query", @@ -415,85 +403,240 @@ "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." + }, + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "key": { + "location": "query", + "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.", + "type": "string" } }, "version": "v1", "baseUrl": "https://firebaserules.googleapis.com/", - "servicePath": "", "description": "Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request.\n", "kind": "discovery#restDescription", + "servicePath": "", "basePath": "", "documentationLink": "https://firebase.google.com/docs/storage/security", - "revision": "20170418", "id": "firebaserules:v1", + "revision": "20170925", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "Source": { + "FunctionMock": { + "type": "object", "properties": { - "files": { - "description": "`File` set constituting the `Source` bundle.", - "type": "array", + "function": { + "description": "The name of the function.\n\nThe function name must match one provided by a service declaration.", + "type": "string" + }, + "result": { + "$ref": "Result", + "description": "The mock result of the function call." + }, + "args": { "items": { - "$ref": "File" - } + "$ref": "Arg" + }, + "type": "array", + "description": "The list of `Arg` values to match. The order in which the arguments are\nprovided is the order in which they must appear in the function\ninvocation." } }, - "id": "Source", + "id": "FunctionMock", + "description": "Mock function definition.\n\nMocks must refer to a function declared by the target service. The type of\nthe function args and result will be inferred at test time. If either the\narg or result values are not compatible with function type declaration, the\nrequest will be considered invalid.\n\nMore than one `FunctionMock` may be provided for a given function name so\nlong as the `Arg` matchers are distinct. There may be only one function\nfor a given overload where all `Arg` values are `Arg.any_value`." + }, + "GetReleaseExecutableResponse": { + "type": "object", + "properties": { + "executableVersion": { + "type": "string", + "enumDescriptions": [ + "Executable format unspecified.\nDefaults to FIREBASE_RULES_EXECUTABLE_V1", + "Firebase Rules syntax 'rules2' executable versions:\nCustom AST for use with Java clients.", + "CEL-based executable for use with C++ clients." + ], + "enum": [ + "RELEASE_EXECUTABLE_VERSION_UNSPECIFIED", + "FIREBASE_RULES_EXECUTABLE_V1", + "FIREBASE_RULES_EXECUTABLE_V2" + ], + "description": "The Rules runtime version of the executable." + }, + "executable": { + "type": "string", + "format": "byte", + "description": "Executable view of the `Ruleset` referenced by the `Release`." + }, + "updateTime": { + "type": "string", + "format": "google-datetime", + "description": "Timestamp for the most recent `Release.update_time`." + }, + "rulesetName": { + "description": "`Ruleset` name associated with the `Release` executable.", + "type": "string" + }, + "language": { + "type": "string", + "enumDescriptions": [ + "Language unspecified. Defaults to FIREBASE_RULES.", + "Firebase Rules language.", + "Event Flow triggers." + ], + "enum": [ + "LANGUAGE_UNSPECIFIED", + "FIREBASE_RULES", + "EVENT_FLOW_TRIGGERS" + ], + "description": "`Language` used to generate the executable bytes." + } + }, + "id": "GetReleaseExecutableResponse", + "description": "The response for FirebaseRulesService.GetReleaseExecutable" + }, + "Source": { "description": "`Source` is one or more `File` messages comprising a logical set of rules.", - "type": "object" + "type": "object", + "properties": { + "files": { + "items": { + "$ref": "File" + }, + "type": "array", + "description": "`File` set constituting the `Source` bundle." + } + }, + "id": "Source" + }, + "Result": { + "type": "object", + "properties": { + "undefined": { + "$ref": "Empty", + "description": "The result is undefined, meaning the result could not be computed." + }, + "value": { + "type": "any", + "description": "The result is an actual value. The type of the value must match that\nof the type declared by the service." + } + }, + "id": "Result", + "description": "Possible result values from the function mock invocation." }, "SourcePosition": { "description": "Position in the `Source` content including its line, column number, and an\nindex of the `File` in the `Source` message. Used for debug purposes.", "type": "object", "properties": { "line": { - "description": "Line number of the source fragment. 1-based.", + "type": "integer", "format": "int32", - "type": "integer" + "description": "Line number of the source fragment. 1-based." }, "column": { - "description": "First column on the source line associated with the source fragment.", "format": "int32", + "description": "First column on the source line associated with the source fragment.", "type": "integer" }, "fileName": { - "description": "Name of the `File`.", - "type": "string" + "type": "string", + "description": "Name of the `File`." } }, "id": "SourcePosition" }, + "TestCase": { + "description": "`TestCase` messages provide the request context and an expectation as to\nwhether the given context will be allowed or denied. Test cases may specify\nthe `request`, `resource`, and `function_mocks` to mock a function call to\na service-provided function.\n\nThe `request` object represents context present at request-time.\n\nThe `resource` is the value of the target resource as it appears in\npersistent storage before the request is executed.", + "type": "object", + "properties": { + "functionMocks": { + "items": { + "$ref": "FunctionMock" + }, + "type": "array", + "description": "Optional function mocks for service-defined functions. If not set, any\nservice defined function is expected to return an error, which may or may\nnot influence the test outcome." + }, + "resource": { + "description": "Optional resource value as it appears in persistent storage before the\nrequest is fulfilled.\n\nThe resource type depends on the `request.path` value.", + "type": "any" + }, + "expectation": { + "enum": [ + "EXPECTATION_UNSPECIFIED", + "ALLOW", + "DENY" + ], + "description": "Test expectation.", + "type": "string", + "enumDescriptions": [ + "Unspecified expectation.", + "Expect an allowed result.", + "Expect a denied result." + ] + }, + "request": { + "type": "any", + "description": "Request context.\n\nThe exact format of the request context is service-dependent. See the\nappropriate service documentation for information about the supported\nfields and types on the request. Minimally, all services support the\nfollowing fields and types:\n\nRequest field | Type\n---------------|-----------------\nauth.uid | `string`\nauth.token | `map\u003cstring, string\u003e`\nheaders | `map\u003cstring, string\u003e`\nmethod | `string`\nparams | `map\u003cstring, string\u003e`\npath | `string`\ntime | `google.protobuf.Timestamp`\n\nIf the request value is not well-formed for the service, the request will\nbe rejected as an invalid argument." + } + }, + "id": "TestCase" + }, "Ruleset": { - "description": "`Ruleset` is an immutable copy of `Source` with a globally unique identifier\nand a creation time.", "type": "object", "properties": { "name": { - "description": "Name of the `Ruleset`. The ruleset_id is auto generated by the service.\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`\nOutput only.", - "type": "string" + "type": "string", + "description": "Name of the `Ruleset`. The ruleset_id is auto generated by the service.\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`\nOutput only." }, "source": { "$ref": "Source", "description": "`Source` for the `Ruleset`." }, "createTime": { - "description": "Time the `Ruleset` was created.\nOutput only.", + "type": "string", "format": "google-datetime", - "type": "string" + "description": "Time the `Ruleset` was created.\nOutput only." } }, - "id": "Ruleset" - }, - "TestRulesetRequest": { - "description": "The request for FirebaseRulesService.TestRuleset.", - "type": "object", - "properties": { - "source": { - "$ref": "Source", - "description": "Optional `Source` to be checked for correctness.\n\nThis field must not be set when the resource name refers to a `Ruleset`." - } - }, - "id": "TestRulesetRequest" + "id": "Ruleset", + "description": "`Ruleset` is an immutable copy of `Source` with a globally unique identifier\nand a creation time." }, "Issue": { "description": "Issues include warnings, errors, and deprecation notices.", @@ -526,107 +669,122 @@ }, "id": "Issue" }, - "FunctionCall": { - "description": "Represents a service-defined function call that was invoked during test\nexecution.", + "TestRulesetRequest": { "type": "object", "properties": { - "args": { - "description": "The arguments that were provided to the function.", - "type": "array", - "items": { - "type": "any" - } + "testSuite": { + "$ref": "TestSuite", + "description": "Inline `TestSuite` to run." }, - "function": { - "description": "Name of the function invoked.", - "type": "string" + "source": { + "$ref": "Source", + "description": "Optional `Source` to be checked for correctness.\n\nThis field must not be set when the resource name refers to a `Ruleset`." } }, - "id": "FunctionCall" - }, - "File": { - "id": "File", - "description": "`File` containing source content.", - "type": "object", - "properties": { - "content": { - "description": "Textual Content.", - "type": "string" - }, - "fingerprint": { - "description": "Fingerprint (e.g. github sha) associated with the `File`.", - "format": "byte", - "type": "string" - }, - "name": { - "description": "File name.", - "type": "string" - } - } + "id": "TestRulesetRequest", + "description": "The request for FirebaseRulesService.TestRuleset." }, "ListReleasesResponse": { - "description": "The response for FirebaseRulesService.ListReleases.", "type": "object", "properties": { + "releases": { + "items": { + "$ref": "Release" + }, + "type": "array", + "description": "List of `Release` instances." + }, "nextPageToken": { "type": "string", "description": "The pagination token to retrieve the next page of results. If the value is\nempty, no further results remain." - }, - "releases": { - "description": "List of `Release` instances.", - "type": "array", - "items": { - "$ref": "Release" - } } }, - "id": "ListReleasesResponse" + "id": "ListReleasesResponse", + "description": "The response for FirebaseRulesService.ListReleases." }, - "Release": { + "FunctionCall": { + "type": "object", "properties": { - "createTime": { + "function": { "type": "string", - "description": "Time the release was created.\nOutput only.", - "format": "google-datetime" + "description": "Name of the function invoked." }, - "updateTime": { - "description": "Time the release was updated.\nOutput only.", - "format": "google-datetime", + "args": { + "items": { + "type": "any" + }, + "type": "array", + "description": "The arguments that were provided to the function." + } + }, + "id": "FunctionCall", + "description": "Represents a service-defined function call that was invoked during test\nexecution." + }, + "File": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "Textual Content." + }, + "fingerprint": { + "format": "byte", + "description": "Fingerprint (e.g. github sha) associated with the `File`.", "type": "string" }, "name": { - "description": "Resource name for the `Release`.\n\n`Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2`\nwhich affords developers a great deal of flexibility in mapping the name\nto the style that best fits their existing development practices. For\nexample, a name could refer to an environment, an app, a version, or some\ncombination of three.\n\nIn the table below, for the project name `projects/foo`, the following\nrelative release paths show how flat and structured names might be chosen\nto match a desired development / deployment strategy.\n\nUse Case | Flat Name | Structured Name\n-------------|---------------------|----------------\nEnvironments | releases/qa | releases/qa\nApps | releases/app1_qa | releases/app1/qa\nVersions | releases/app1_v2_qa | releases/app1/v2/qa\n\nThe delimiter between the release name path elements can be almost anything\nand it should work equally well with the release name list filter, but in\nmany ways the structured paths provide a clearer picture of the\nrelationship between `Release` instances.\n\nFormat: `projects/{project_id}/releases/{release_id}`", - "type": "string" + "type": "string", + "description": "File name." + } + }, + "id": "File", + "description": "`File` containing source content." + }, + "Release": { + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "google-datetime", + "description": "Time the release was updated.\nOutput only." }, "rulesetName": { - "description": "Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must\nexist the `Release` to be created.", + "type": "string", + "description": "Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must\nexist the `Release` to be created." + }, + "name": { + "type": "string", + "description": "Resource name for the `Release`.\n\n`Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2`\nwhich affords developers a great deal of flexibility in mapping the name\nto the style that best fits their existing development practices. For\nexample, a name could refer to an environment, an app, a version, or some\ncombination of three.\n\nIn the table below, for the project name `projects/foo`, the following\nrelative release paths show how flat and structured names might be chosen\nto match a desired development / deployment strategy.\n\nUse Case | Flat Name | Structured Name\n-------------|---------------------|----------------\nEnvironments | releases/qa | releases/qa\nApps | releases/app1_qa | releases/app1/qa\nVersions | releases/app1_v2_qa | releases/app1/v2/qa\n\nThe delimiter between the release name path elements can be almost anything\nand it should work equally well with the release name list filter, but in\nmany ways the structured paths provide a clearer picture of the\nrelationship between `Release` instances.\n\nFormat: `projects/{project_id}/releases/{release_id}`" + }, + "createTime": { + "format": "google-datetime", + "description": "Time the release was created.\nOutput only.", "type": "string" } }, "id": "Release", - "description": "`Release` is a named reference to a `Ruleset`. Once a `Release` refers to a\n`Ruleset`, rules-enabled services will be able to enforce the `Ruleset`.", - "type": "object" + "description": "`Release` is a named reference to a `Ruleset`. Once a `Release` refers to a\n`Ruleset`, rules-enabled services will be able to enforce the `Ruleset`." }, "TestRulesetResponse": { + "type": "object", "properties": { "testResults": { "description": "The set of test results given the test cases in the `TestSuite`.\nThe results will appear in the same order as the test cases appear in the\n`TestSuite`.", - "type": "array", "items": { "$ref": "TestResult" - } + }, + "type": "array" }, "issues": { - "type": "array", + "description": "Syntactic and semantic `Source` issues of varying severity. Issues of\n`ERROR` severity will prevent tests from executing.", "items": { "$ref": "Issue" }, - "description": "Syntactic and semantic `Source` issues of varying severity. Issues of\n`ERROR` severity will prevent tests from executing." + "type": "array" } }, "id": "TestRulesetResponse", - "description": "The response for FirebaseRulesService.TestRuleset.", - "type": "object" + "description": "The response for FirebaseRulesService.TestRuleset." }, "TestResult": { "description": "Test result message containing the state of the test as well as a\ndescription and source position for test failures.", @@ -634,10 +792,17 @@ "properties": { "functionCalls": { "description": "The set of function calls made to service-defined methods.\n\nFunction calls are included in the order in which they are encountered\nduring evaluation, are provided for both mocked and unmocked functions,\nand included on the response regardless of the test `state`.", - "type": "array", "items": { "$ref": "FunctionCall" - } + }, + "type": "array" + }, + "debugMessages": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Debug messages related to test execution issues encountered during\nevaluation.\n\nDebug messages may be related to too many or too few invocations of\nfunction mocks or to runtime errors that occur during evaluation.\n\nFor example: ```Unable to read variable [name: \"resource\"]```" }, "state": { "enum": [ @@ -653,13 +818,6 @@ "Test is a failure." ] }, - "debugMessages": { - "description": "Debug messages related to test execution issues encountered during\nevaluation.\n\nDebug messages may be related to too many or too few invocations of\nfunction mocks or to runtime errors that occur during evaluation.\n\nFor example: ```Unable to read variable [name: \"resource\"]```", - "type": "array", - "items": { - "type": "string" - } - }, "errorPosition": { "$ref": "SourcePosition", "description": "Position in the `Source` or `Ruleset` where the principle runtime error\noccurs.\n\nEvaluation of an expression may result in an error. Rules are deny by\ndefault, so a `DENY` expectation when an error is generated is valid.\nWhen there is a `DENY` with an error, the `SourcePosition` is returned.\n\nE.g. `error_position { line: 19 column: 37 }`" @@ -668,13 +826,14 @@ "id": "TestResult" }, "ListRulesetsResponse": { + "type": "object", "properties": { "rulesets": { - "description": "List of `Ruleset` instances.", - "type": "array", "items": { "$ref": "Ruleset" - } + }, + "type": "array", + "description": "List of `Ruleset` instances." }, "nextPageToken": { "description": "The pagination token to retrieve the next page of results. If the value is\nempty, no further results remain.", @@ -682,14 +841,42 @@ } }, "id": "ListRulesetsResponse", - "description": "The response for FirebaseRulesService.ListRulesets.", - "type": "object" + "description": "The response for FirebaseRulesService.ListRulesets." + }, + "Arg": { + "type": "object", + "properties": { + "anyValue": { + "$ref": "Empty", + "description": "Argument matches any value provided." + }, + "exactValue": { + "type": "any", + "description": "Argument exactly matches value provided." + } + }, + "id": "Arg", + "description": "Arg matchers for the mock function." + }, + "TestSuite": { + "description": "`TestSuite` is a collection of `TestCase` instances that validate the logical\ncorrectness of a `Ruleset`. The `TestSuite` may be referenced in-line within\na `TestRuleset` invocation or as part of a `Release` object as a pre-release\ncheck.", + "type": "object", + "properties": { + "testCases": { + "items": { + "$ref": "TestCase" + }, + "type": "array", + "description": "Collection of test cases associated with the `TestSuite`." + } + }, + "id": "TestSuite" }, "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object", "properties": {}, - "id": "Empty" + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`." } }, "icons": { @@ -704,14 +891,19 @@ "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" }, - "https://www.googleapis.com/auth/firebase": { - "description": "View and administer all your Firebase data and settings" - }, "https://www.googleapis.com/auth/firebase.readonly": { "description": "View all your Firebase data and settings" + }, + "https://www.googleapis.com/auth/firebase": { + "description": "View and administer all your Firebase data and settings" } } } }, - "rootUrl": "https://firebaserules.googleapis.com/" + "rootUrl": "https://firebaserules.googleapis.com/", + "ownerDomain": "google.com", + "name": "firebaserules", + "batchPath": "batch", + "title": "Firebase Rules API", + "ownerName": "Google" } diff --git a/etc/api/fitness/v1/crates/1.0.6-api+20170830 b/etc/api/fitness/v1/crates/1.0.6-api+20170830 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/fitness/v1/fitness-api.json b/etc/api/fitness/v1/fitness-api.json index 4dc972a633..abafde0461 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/ijeguRXyVpN9uEUSOI4kjLGOD9E\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Iezg2N-GRRgP6nxERqABDosZ2Tk\"", "discoveryVersion": "v1", "id": "fitness:v1", "name": "fitness", "version": "v1", - "revision": "20161128", + "revision": "20170830", "title": "Fitness", "description": "Stores and accesses user data in the fitness store from apps on any platform.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/fitness/v1/users/", "rootUrl": "https://www.googleapis.com/", "servicePath": "fitness/v1/users/", - "batchPath": "batch", + "batchPath": "batch/fitness/v1", "parameters": { "alt": { "type": "string", @@ -503,7 +503,7 @@ }, "dataStreamId": { "type": "string", - "description": "A unique identifier for the data stream produced by this data source. The identifier includes:\n\n \n- The physical device's manufacturer, model, and serial number (UID). \n- The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number is used when the data source was created by a REST client. \n- The data source's type. \n- The data source's stream name. Note that not all attributes of the data source are used as part of the stream identifier. In particular, the version of the hardware/the application isn't used. This allows us to preserve the same stream through version updates. This also means that two DataSource objects may represent the same data stream even if they're not equal.\n\nThe exact format of the data stream ID created by an Android application is: type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName \n\nThe exact format of the data stream ID created by a REST client is: type:dataType.name:developer project number:device.manufacturer:device.model:device.uid:dataStreamName \n\nWhen any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minnimum viable data stream ID would be: type:dataType.name:developer project number\n\nFinally, the developer project number 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 developer project number in clear and normal form.", + "description": "A unique identifier for the data stream produced by this data source. The identifier includes:\n\n \n- The physical device's manufacturer, model, and serial number (UID). \n- The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number is used when the data source was created by a REST client. \n- The data source's type. \n- The data source's stream name. Note that not all attributes of the data source are used as part of the stream identifier. In particular, the version of the hardware/the application isn't used. This allows us to preserve the same stream through version updates. This also means that two DataSource objects may represent the same data stream even if they're not equal.\n\nThe exact format of the data stream ID created by an Android application is: type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName \n\nThe exact format of the data stream ID created by a REST client is: type:dataType.name:developer project number:device.manufacturer:device.model:device.uid:dataStreamName \n\nWhen any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minimum viable data stream ID would be: type:dataType.name:developer project number\n\nFinally, the developer project number 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 developer project number in clear and normal form.", "annotations": { "required": [ "fitness.users.dataSources.update" @@ -763,6 +763,34 @@ } } }, + "ListDataPointChangesResponse": { + "id": "ListDataPointChangesResponse", + "type": "object", + "properties": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source with data point changes." + }, + "deletedDataPoint": { + "type": "array", + "description": "Data points that have been removed and will not be included in any other request for dataset contents.", + "items": { + "$ref": "DataPoint" + } + }, + "insertedDataPoint": { + "type": "array", + "description": "Data points listed.", + "items": { + "$ref": "DataPoint" + } + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, "ListDataSourcesResponse": { "id": "ListDataSourcesResponse", "type": "object", @@ -1189,6 +1217,68 @@ } }, "resources": { + "dataPointChanges": { + "methods": { + "list": { + "id": "fitness.users.dataSources.dataPointChanges.list", + "path": "{userId}/dataSources/{dataSourceId}/dataPointChanges", + "httpMethod": "GET", + "description": "results ordered by descending end_time", + "parameters": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source that created the dataset.", + "required": true, + "location": "path" + }, + "limit": { + "type": "integer", + "description": "If specified, no more than this many data point changes will be included in the response. The default is 500 data point changes.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "List data points for the person identified. Use \"me\" to indicate the authenticated user. Only \"me\" is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId" + ], + "response": { + "$ref": "ListDataPointChangesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.read", + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.blood_glucose.read", + "https://www.googleapis.com/auth/fitness.blood_glucose.write", + "https://www.googleapis.com/auth/fitness.blood_pressure.read", + "https://www.googleapis.com/auth/fitness.blood_pressure.write", + "https://www.googleapis.com/auth/fitness.body.read", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.body_temperature.read", + "https://www.googleapis.com/auth/fitness.body_temperature.write", + "https://www.googleapis.com/auth/fitness.location.read", + "https://www.googleapis.com/auth/fitness.location.write", + "https://www.googleapis.com/auth/fitness.nutrition.read", + "https://www.googleapis.com/auth/fitness.nutrition.write", + "https://www.googleapis.com/auth/fitness.oxygen_saturation.read", + "https://www.googleapis.com/auth/fitness.oxygen_saturation.write", + "https://www.googleapis.com/auth/fitness.reproductive_health.read", + "https://www.googleapis.com/auth/fitness.reproductive_health.write" + ] + } + } + }, "datasets": { "methods": { "delete": { diff --git a/etc/api/fusiontables/v1/fusiontables-api.json b/etc/api/fusiontables/v1/fusiontables-api.json index beeb66a183..51fc523e20 100644 --- a/etc/api/fusiontables/v1/fusiontables-api.json +++ b/etc/api/fusiontables/v1/fusiontables-api.json @@ -20,7 +20,7 @@ "basePath": "/fusiontables/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "fusiontables/v1/", - "batchPath": "batch", + "batchPath": "batch/fusiontables/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/fusiontables/v2/fusiontables-api.json b/etc/api/fusiontables/v2/fusiontables-api.json index a0ca84f170..5af149f15b 100644 --- a/etc/api/fusiontables/v2/fusiontables-api.json +++ b/etc/api/fusiontables/v2/fusiontables-api.json @@ -20,7 +20,7 @@ "basePath": "/fusiontables/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "fusiontables/v2/", - "batchPath": "batch", + "batchPath": "batch/fusiontables/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/games/v1/crates/1.0.6-api+20170925 b/etc/api/games/v1/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/games/v1/crates/1.0.6-cli+20170925 b/etc/api/games/v1/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/games/v1/games-api.json b/etc/api/games/v1/games-api.json index 01d5394784..1f08d5d01f 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/xRU0iq97BVwEymZdT-IMpyJ394E\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/sGiRc3q5mYn-fpaf2dI4we-YLzY\"", "discoveryVersion": "v1", "id": "games:v1", "name": "games", "canonicalName": "Games", "version": "v1", - "revision": "20170511", + "revision": "20170925", "title": "Google Play Game Services API", "description": "The API for Google Play Game Services.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/games/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "games/v1/", - "batchPath": "batch", + "batchPath": "batch/games/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/gamesconfiguration/v1configuration/crates/1.0.6-api+20170925 b/etc/api/gamesconfiguration/v1configuration/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/gamesconfiguration/v1configuration/crates/1.0.6-cli+20170925 b/etc/api/gamesconfiguration/v1configuration/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json b/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json index 771a9e90dd..0ac3b0faf1 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/xoUDLrOefVzVgtqG3x8wJuxbC_M\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/XlOtxoGRhUhIN8Wi-yr0KBHSEJA\"", "discoveryVersion": "v1", "id": "gamesConfiguration:v1configuration", "name": "gamesConfiguration", "canonicalName": "Games Configuration", "version": "v1configuration", - "revision": "20170511", + "revision": "20170925", "title": "Google Play Game Services Publishing API", "description": "The Publishing API for Google Play Game Services.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/games/v1configuration/", "rootUrl": "https://www.googleapis.com/", "servicePath": "games/v1configuration/", - "batchPath": "batch", + "batchPath": "batch/gamesConfiguration/v1configuration", "parameters": { "alt": { "type": "string", diff --git a/etc/api/gamesmanagement/v1management/crates/1.0.6-api+20170925 b/etc/api/gamesmanagement/v1management/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/gamesmanagement/v1management/crates/1.0.6-cli+20170925 b/etc/api/gamesmanagement/v1management/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/gamesmanagement/v1management/gamesmanagement-api.json b/etc/api/gamesmanagement/v1management/gamesmanagement-api.json index 387d36639d..1aa0322caf 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/t5ojdIyqE9cj_9KmuahxNl9Z7R8\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/x6d9KrKEkZj5LYDdLx1wDF-XPvE\"", "discoveryVersion": "v1", "id": "gamesManagement:v1management", "name": "gamesManagement", "canonicalName": "Games Management", "version": "v1management", - "revision": "20170511", + "revision": "20170925", "title": "Google Play Game Services Management API", "description": "The Management API for Google Play Game Services.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/games/v1management/", "rootUrl": "https://www.googleapis.com/", "servicePath": "games/v1management/", - "batchPath": "batch", + "batchPath": "batch/gamesManagement/v1management", "parameters": { "alt": { "type": "string", diff --git a/etc/api/genomics/v1/crates/1.0.6-api+20170925 b/etc/api/genomics/v1/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/genomics/v1/crates/1.0.6-cli+20170925 b/etc/api/genomics/v1/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/genomics/v1/genomics-api.json b/etc/api/genomics/v1/genomics-api.json index 54e582577b..370061b329 100644 --- a/etc/api/genomics/v1/genomics-api.json +++ b/etc/api/genomics/v1/genomics-api.json @@ -1,671 +1,287 @@ { + "discoveryVersion": "v1", + "ownerName": "Google", "resources": { - "annotationsets": { + "annotations": { "methods": { + "create": { + "description": "Creates a new annotation. Caller must have WRITE permission\nfor the associated annotation set.\n\nThe following fields are required:\n\n* annotationSetId\n* referenceName or\n referenceId\n\n### Transcripts\n\nFor annotations of type TRANSCRIPT, the following fields of\ntranscript must be provided:\n\n* exons.start\n* exons.end\n\nAll other fields may be optionally specified, unless documented as being\nserver-generated (for example, the `id` field). The annotated\nrange must be no longer than 100Mbp (mega base pairs). See the\nAnnotation resource\nfor additional restrictions on each field.", + "request": { + "$ref": "Annotation" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Annotation" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/annotations", + "path": "v1/annotations", + "id": "genomics.annotations.create" + }, + "batchCreate": { + "request": { + "$ref": "BatchCreateAnnotationsRequest" + }, + "description": "Creates one or more new annotations atomically. All annotations must\nbelong to the same annotation set. Caller must have WRITE\npermission for this annotation set. For optimal performance, batch\npositionally adjacent annotations together.\n\nIf the request has a systemic issue, such as an attempt to write to\nan inaccessible annotation set, the entire RPC will fail accordingly. For\nlesser data issues, when possible an error will be isolated to the\ncorresponding batch entry in the response; the remaining well formed\nannotations will be created normally.\n\nFor details on the requirements for each individual annotation resource,\nsee\nCreateAnnotation.", + "response": { + "$ref": "BatchCreateAnnotationsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/annotations:batchCreate", + "id": "genomics.annotations.batchCreate", + "path": "v1/annotations:batchCreate" + }, + "search": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": {}, + "flatPath": "v1/annotations/search", + "path": "v1/annotations/search", + "id": "genomics.annotations.search", + "request": { + "$ref": "SearchAnnotationsRequest" + }, + "description": "Searches for annotations that match the given criteria. Results are\nordered by genomic coordinate (by reference sequence, then position).\nAnnotations with equivalent genomic coordinates are returned in an\nunspecified order. This order is consistent, such that two queries for the\nsame content (regardless of page size) yield annotations in the same order\nacross their respective streams of paginated responses. Caller must have\nREAD permission for the queried annotation sets.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "SearchAnnotationsResponse" + } + }, + "get": { + "description": "Gets an annotation. Caller must have READ permission\nfor the associated annotation set.", + "response": { + "$ref": "Annotation" + }, + "parameterOrder": [ + "annotationId" + ], + "httpMethod": "GET", + "parameters": { + "annotationId": { + "location": "path", + "description": "The ID of the annotation to be retrieved.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/annotations/{annotationId}", + "id": "genomics.annotations.get", + "path": "v1/annotations/{annotationId}" + }, "update": { - "path": "v1/annotationsets/{annotationSetId}", - "id": "genomics.annotationsets.update", - "description": "Updates an annotation set. The update must respect all mutability\nrestrictions and other invariants described on the annotation set resource.\nCaller must have WRITE permission for the associated dataset.", - "request": { - "$ref": "AnnotationSet" + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. Mutable fields are\nname,\nvariant,\ntranscript, and\ninfo. If unspecified, all mutable\nfields will be updated.", + "type": "string", + "location": "query" + }, + "annotationId": { + "description": "The ID of the annotation to be updated.", + "type": "string", + "required": true, + "location": "path" + } }, - "response": { - "$ref": "AnnotationSet" - }, - "parameterOrder": [ - "annotationSetId" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" ], + "flatPath": "v1/annotations/{annotationId}", + "path": "v1/annotations/{annotationId}", + "id": "genomics.annotations.update", + "description": "Updates an annotation. Caller must have\nWRITE permission for the associated dataset.", + "request": { + "$ref": "Annotation" + }, "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" + "parameterOrder": [ + "annotationId" ], - "parameters": { - "updateMask": { - "description": "An optional mask specifying which fields to update. Mutable fields are\nname,\nsource_uri, and\ninfo. If unspecified, all\nmutable fields will be updated.", - "format": "google-fieldmask", - "type": "string", - "location": "query" - }, - "annotationSetId": { - "description": "The ID of the annotation set to be updated.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/annotationsets/{annotationSetId}" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [], "response": { - "$ref": "AnnotationSet" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/annotationsets", - "id": "genomics.annotationsets.create", - "path": "v1/annotationsets", - "request": { - "$ref": "AnnotationSet" - }, - "description": "Creates a new annotation set. Caller must have WRITE permission for the\nassociated dataset.\n\nThe following fields are required:\n\n * datasetId\n * referenceSetId\n\nAll other fields may be optionally specified, unless documented as being\nserver-generated (for example, the `id` field)." + "$ref": "Annotation" + } }, "delete": { - "parameters": { - "annotationSetId": { - "location": "path", - "description": "The ID of the annotation set to be deleted.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/annotationsets/{annotationSetId}", - "id": "genomics.annotationsets.delete", - "path": "v1/annotationsets/{annotationSetId}", - "description": "Deletes an annotation set. Caller must have WRITE permission\nfor the associated annotation set.", "httpMethod": "DELETE", "parameterOrder": [ - "annotationSetId" - ], - "response": { - "$ref": "Empty" - } - }, - "search": { - "response": { - "$ref": "SearchAnnotationSetsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": {}, - "flatPath": "v1/annotationsets/search", - "path": "v1/annotationsets/search", - "id": "genomics.annotationsets.search", - "description": "Searches for annotation sets that match the given criteria. Annotation sets\nare returned in an unspecified order. This order is consistent, such that\ntwo queries for the same content (regardless of page size) yield annotation\nsets in the same order across their respective streams of paginated\nresponses. Caller must have READ permission for the queried datasets.", - "request": { - "$ref": "SearchAnnotationSetsRequest" - } - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "annotationSetId" - ], - "response": { - "$ref": "AnnotationSet" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "annotationSetId": { - "location": "path", - "description": "The ID of the annotation set to be retrieved.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/annotationsets/{annotationSetId}", - "id": "genomics.annotationsets.get", - "path": "v1/annotationsets/{annotationSetId}", - "description": "Gets an annotation set. Caller must have READ permission for\nthe associated dataset." - } - } - }, - "variants": { - "methods": { - "create": { - "path": "v1/variants", - "id": "genomics.variants.create", - "request": { - "$ref": "Variant" - }, - "description": "Creates a new variant.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "response": { - "$ref": "Variant" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/variants" - }, - "search": { - "id": "genomics.variants.search", - "path": "v1/variants/search", - "request": { - "$ref": "SearchVariantsRequest" - }, - "description": "Gets a list of variants matching the criteria.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "SearchVariantsResponse" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "flatPath": "v1/variants/search" - }, - "get": { - "id": "genomics.variants.get", - "path": "v1/variants/{variantId}", - "description": "Gets a variant by ID.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "httpMethod": "GET", - "parameterOrder": [ - "variantId" - ], - "response": { - "$ref": "Variant" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "variantId": { - "location": "path", - "description": "The ID of the variant.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/variants/{variantId}" - }, - "patch": { - "id": "genomics.variants.patch", - "path": "v1/variants/{variantId}", - "description": "Updates a variant.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics. Returns the modified variant without\nits calls.", - "request": { - "$ref": "Variant" - }, - "httpMethod": "PATCH", - "parameterOrder": [ - "variantId" - ], - "response": { - "$ref": "Variant" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "variantId": { - "required": true, - "type": "string", - "location": "path", - "description": "The ID of the variant to be updated." - }, - "updateMask": { - "location": "query", - "description": "An optional mask specifying which fields to update. At this time, mutable\nfields are names and\ninfo. Acceptable values are \"names\" and\n\"info\". If unspecified, all mutable fields will be updated.", - "format": "google-fieldmask", - "type": "string" - } - }, - "flatPath": "v1/variants/{variantId}" - }, - "import": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.read_write", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/variants:import", - "path": "v1/variants:import", - "id": "genomics.variants.import", - "request": { - "$ref": "ImportVariantsRequest" - }, - "description": "Creates variant data by asynchronously importing the provided information.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThe variants for import will be merged with any existing variant that\nmatches its reference sequence, start, end, reference bases, and\nalternative bases. If no such variant exists, a new one will be created.\n\nWhen variants are merged, the call information from the new variant\nis added to the existing variant, and Variant info fields are merged\nas specified in\ninfoMergeConfig.\nAs a special case, for single-sample VCF files, QUAL and FILTER fields will\nbe moved to the call level; these are sometimes interpreted in a\ncall-specific context.\nImported VCF headers are appended to the metadata already in a variant set." - }, - "merge": { - "description": "Merges the given variants with existing variants.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nEach variant will be\nmerged with an existing variant that matches its reference sequence,\nstart, end, reference bases, and alternative bases. If no such variant\nexists, a new one will be created.\n\nWhen variants are merged, the call information from the new variant\nis added to the existing variant. Variant info fields are merged as\nspecified in the\ninfoMergeConfig\nfield of the MergeVariantsRequest.\n\nPlease exercise caution when using this method! It is easy to introduce\nmistakes in existing variants and difficult to back out of them. For\nexample,\nsuppose you were trying to merge a new variant with an existing one and\nboth\nvariants contain calls that belong to callsets with the same callset ID.\n\n // Existing variant - irrelevant fields trimmed for clarity\n {\n \"variantSetId\": \"10473108253681171589\",\n \"referenceName\": \"1\",\n \"start\": \"10582\",\n \"referenceBases\": \"G\",\n \"alternateBases\": [\n \"A\"\n ],\n \"calls\": [\n {\n \"callSetId\": \"10473108253681171589-0\",\n \"callSetName\": \"CALLSET0\",\n \"genotype\": [\n 0,\n 1\n ],\n }\n ]\n }\n\n // New variant with conflicting call information\n {\n \"variantSetId\": \"10473108253681171589\",\n \"referenceName\": \"1\",\n \"start\": \"10582\",\n \"referenceBases\": \"G\",\n \"alternateBases\": [\n \"A\"\n ],\n \"calls\": [\n {\n \"callSetId\": \"10473108253681171589-0\",\n \"callSetName\": \"CALLSET0\",\n \"genotype\": [\n 1,\n 1\n ],\n }\n ]\n }\n\nThe resulting merged variant would overwrite the existing calls with those\nfrom the new variant:\n\n {\n \"variantSetId\": \"10473108253681171589\",\n \"referenceName\": \"1\",\n \"start\": \"10582\",\n \"referenceBases\": \"G\",\n \"alternateBases\": [\n \"A\"\n ],\n \"calls\": [\n {\n \"callSetId\": \"10473108253681171589-0\",\n \"callSetName\": \"CALLSET0\",\n \"genotype\": [\n 1,\n 1\n ],\n }\n ]\n }\n\nThis may be the desired outcome, but it is up to the user to determine if\nif that is indeed the case.", - "request": { - "$ref": "MergeVariantsRequest" - }, - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": {}, - "flatPath": "v1/variants:merge", - "id": "genomics.variants.merge", - "path": "v1/variants:merge" - }, - "delete": { - "description": "Deletes a variant.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "httpMethod": "DELETE", - "parameterOrder": [ - "variantId" + "annotationId" ], "response": { "$ref": "Empty" }, - "parameters": { - "variantId": { - "location": "path", - "description": "The ID of the variant to be deleted.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/variants/{variantId}", - "id": "genomics.variants.delete", - "path": "v1/variants/{variantId}" - } - } - }, - "references": { - "methods": { - "search": { - "response": { - "$ref": "SearchReferencesResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": {}, - "flatPath": "v1/references/search", - "path": "v1/references/search", - "id": "genomics.references.search", - "description": "Searches for references which match the given criteria.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146).", - "request": { - "$ref": "SearchReferencesRequest" - } - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "referenceId" - ], - "response": { - "$ref": "Reference" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "referenceId": { - "location": "path", - "description": "The ID of the reference.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/references/{referenceId}", - "id": "genomics.references.get", - "path": "v1/references/{referenceId}", - "description": "Gets a reference.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158)." - } - }, - "resources": { - "bases": { - "methods": { - "list": { - "id": "genomics.references.bases.list", - "path": "v1/references/{referenceId}/bases", - "description": "Lists the bases in a reference, optionally restricted to a range.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221).", - "httpMethod": "GET", - "parameterOrder": [ - "referenceId" - ], - "response": { - "$ref": "ListBasesResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "end": { - "location": "query", - "description": "The end position (0-based, exclusive) of this query. Defaults to the length\nof this reference.", - "format": "int64", - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "The maximum number of bases to return in a single page. If unspecified,\ndefaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base\npairs).", - "format": "int32", - "type": "integer" - }, - "start": { - "location": "query", - "description": "The start position (0-based) of this query. Defaults to 0.", - "format": "int64", - "type": "string" - }, - "referenceId": { - "location": "path", - "description": "The ID of the reference.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/references/{referenceId}/bases" - } - } - } - } - }, - "datasets": { - "methods": { - "create": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Dataset" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": {}, - "flatPath": "v1/datasets", - "id": "genomics.datasets.create", - "path": "v1/datasets", - "description": "Creates a new dataset.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "request": { - "$ref": "Dataset" - } - }, - "setIamPolicy": { - "flatPath": "v1/datasets/{datasetsId}:setIamPolicy", - "path": "v1/{+resource}:setIamPolicy", - "id": "genomics.datasets.setIamPolicy", - "description": "Sets the access control policy on the specified dataset. Replaces any\nexisting policy.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nSee \u003ca href=\"/iam/docs/managing-policies#setting_a_policy\"\u003eSetting a\nPolicy\u003c/a\u003e for more information.", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], "parameters": { - "resource": { + "annotationId": { "location": "path", - "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", - "required": true, + "description": "The ID of the annotation to be deleted.", "type": "string", - "pattern": "^datasets/[^/]+$" - } - } - }, - "getIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", - "required": true, - "type": "string", - "pattern": "^datasets/[^/]+$", - "location": "path" + "required": true } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/datasets/{datasetsId}:getIamPolicy", - "id": "genomics.datasets.getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "request": { - "$ref": "GetIamPolicyRequest" - }, - "description": "Gets the access control policy for the dataset. This is empty if the\npolicy or resource does not exist.\n\nSee \u003ca href=\"/iam/docs/managing-policies#getting_a_policy\"\u003eGetting a\nPolicy\u003c/a\u003e for more information.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" - }, - "undelete": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "datasetId": { - "description": "The ID of the dataset to be undeleted.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/datasets/{datasetId}:undelete", - "path": "v1/datasets/{datasetId}:undelete", - "id": "genomics.datasets.undelete", - "description": "Undeletes a dataset by restoring a dataset which was deleted via this API.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis operation is only possible for a week after the deletion occurred.", - "request": { - "$ref": "UndeleteDatasetRequest" - }, - "response": { - "$ref": "Dataset" - }, - "parameterOrder": [ - "datasetId" - ], - "httpMethod": "POST" - }, - "get": { - "flatPath": "v1/datasets/{datasetId}", - "path": "v1/datasets/{datasetId}", - "id": "genomics.datasets.get", - "description": "Gets a dataset by ID.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "parameterOrder": [ - "datasetId" - ], - "response": { - "$ref": "Dataset" - }, - "httpMethod": "GET", - "parameters": { - "datasetId": { - "location": "path", - "description": "The ID of the dataset.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ] - }, - "patch": { - "httpMethod": "PATCH", - "parameterOrder": [ - "datasetId" - ], - "response": { - "$ref": "Dataset" - }, - "parameters": { - "datasetId": { - "location": "path", - "description": "The ID of the dataset to be updated.", - "required": true, - "type": "string" - }, - "updateMask": { - "location": "query", - "description": "An optional mask specifying which fields to update. At this time, the only\nmutable field is name. The only\nacceptable value is \"name\". If unspecified, all mutable fields will be\nupdated.", - "format": "google-fieldmask", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/datasets/{datasetId}", - "id": "genomics.datasets.patch", - "path": "v1/datasets/{datasetId}", - "request": { - "$ref": "Dataset" - }, - "description": "Updates a dataset.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics." - }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", - "required": true, - "type": "string", - "pattern": "^datasets/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/datasets/{datasetsId}:testIamPermissions", - "id": "genomics.datasets.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "description": "Returns permissions that a caller has on the specified resource.\nSee \u003ca href=\"/iam/docs/managing-policies#testing_permissions\"\u003eTesting\nPermissions\u003c/a\u003e for more information.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" - }, - "delete": { - "id": "genomics.datasets.delete", - "path": "v1/datasets/{datasetId}", - "description": "Deletes a dataset and all of its contents (all read group sets,\nreference sets, variant sets, call sets, annotation sets, etc.)\nThis is reversible (up to one week after the deletion) via\nthe\ndatasets.undelete\noperation.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "httpMethod": "DELETE", - "parameterOrder": [ - "datasetId" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "datasetId": { - "location": "path", - "description": "The ID of the dataset to be deleted.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/datasets/{datasetId}" - }, - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListDatasetsResponse" - }, - "parameterOrder": [], - "parameters": { - "pageToken": { - "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 50. The maximum value is 1024.", - "format": "int32", - "type": "integer" - }, - "projectId": { - "location": "query", - "description": "Required. The Google Cloud project ID to list datasets for.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "flatPath": "v1/datasets", - "id": "genomics.datasets.list", - "path": "v1/datasets", - "description": "Lists datasets within a project.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + "flatPath": "v1/annotations/{annotationId}", + "path": "v1/annotations/{annotationId}", + "id": "genomics.annotations.delete", + "description": "Deletes an annotation. Caller must have WRITE permission for\nthe associated annotation set." } } }, "variantsets": { "methods": { + "search": { + "response": { + "$ref": "SearchVariantSetsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": {}, + "flatPath": "v1/variantsets/search", + "id": "genomics.variantsets.search", + "path": "v1/variantsets/search", + "request": { + "$ref": "SearchVariantSetsRequest" + }, + "description": "Returns a list of all variant sets matching search criteria.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49)." + }, + "patch": { + "request": { + "$ref": "VariantSet" + }, + "description": "Updates a variant set using patch semantics.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "httpMethod": "PATCH", + "parameterOrder": [ + "variantSetId" + ], + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. Supported fields:\n\n* metadata.\n* name.\n* description.\n\nLeaving `updateMask` unset is equivalent to specifying all mutable\nfields.", + "type": "string" + }, + "variantSetId": { + "location": "path", + "description": "The ID of the variant to be updated (must already exist).", + "type": "string", + "required": true + } + }, + "flatPath": "v1/variantsets/{variantSetId}", + "path": "v1/variantsets/{variantSetId}", + "id": "genomics.variantsets.patch" + }, + "get": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": { + "variantSetId": { + "description": "Required. The ID of the variant set.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/variantsets/{variantSetId}", + "path": "v1/variantsets/{variantSetId}", + "id": "genomics.variantsets.get", + "description": "Gets a variant set by ID.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "httpMethod": "GET", + "response": { + "$ref": "VariantSet" + }, + "parameterOrder": [ + "variantSetId" + ] + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "variantSetId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "variantSetId": { + "location": "path", + "description": "The ID of the variant set to be deleted.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/variantsets/{variantSetId}", + "id": "genomics.variantsets.delete", + "path": "v1/variantsets/{variantSetId}", + "description": "Deletes a variant set including all variants, call sets, and calls within.\nThis is not reversible.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + }, + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/variantsets", + "path": "v1/variantsets", + "id": "genomics.variantsets.create", + "request": { + "$ref": "VariantSet" + }, + "description": "Creates a new variant set.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThe provided variant set must have a valid `datasetId` set - all other\nfields are optional. Note that the `id` field will be ignored, as this is\nassigned by the server.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "VariantSet" + } + }, "export": { - "id": "genomics.variantsets.export", "path": "v1/variantsets/{variantSetId}:export", - "description": "Exports variant set data to an external destination.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "id": "genomics.variantsets.export", "request": { "$ref": "ExportVariantSetRequest" }, + "description": "Exports variant set data to an external destination.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", "httpMethod": "POST", "parameterOrder": [ "variantSetId" @@ -680,369 +296,26 @@ ], "parameters": { "variantSetId": { - "required": true, + "description": "Required. The ID of the variant set that contains variant data which\nshould be exported. The caller must have READ access to this variant set.", "type": "string", - "location": "path", - "description": "Required. The ID of the variant set that contains variant data which\nshould be exported. The caller must have READ access to this variant set." + "required": true, + "location": "path" } }, "flatPath": "v1/variantsets/{variantSetId}:export" - }, - "search": { - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "flatPath": "v1/variantsets/search", - "path": "v1/variantsets/search", - "id": "genomics.variantsets.search", - "request": { - "$ref": "SearchVariantSetsRequest" - }, - "description": "Returns a list of all variant sets matching search criteria.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49).", - "response": { - "$ref": "SearchVariantSetsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST" - }, - "get": { - "response": { - "$ref": "VariantSet" - }, - "parameterOrder": [ - "variantSetId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "variantSetId": { - "location": "path", - "description": "Required. The ID of the variant set.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/variantsets/{variantSetId}", - "path": "v1/variantsets/{variantSetId}", - "id": "genomics.variantsets.get", - "description": "Gets a variant set by ID.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" - }, - "patch": { - "request": { - "$ref": "VariantSet" - }, - "description": "Updates a variant set using patch semantics.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "response": { - "$ref": "VariantSet" - }, - "parameterOrder": [ - "variantSetId" - ], - "httpMethod": "PATCH", - "parameters": { - "updateMask": { - "location": "query", - "description": "An optional mask specifying which fields to update. Supported fields:\n\n* metadata.\n* name.\n* description.\n\nLeaving `updateMask` unset is equivalent to specifying all mutable\nfields.", - "format": "google-fieldmask", - "type": "string" - }, - "variantSetId": { - "location": "path", - "description": "The ID of the variant to be updated (must already exist).", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/variantsets/{variantSetId}", - "path": "v1/variantsets/{variantSetId}", - "id": "genomics.variantsets.patch" - }, - "delete": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "variantSetId": { - "location": "path", - "description": "The ID of the variant set to be deleted.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/variantsets/{variantSetId}", - "id": "genomics.variantsets.delete", - "path": "v1/variantsets/{variantSetId}", - "description": "Deletes a variant set including all variants, call sets, and calls within.\nThis is not reversible.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "httpMethod": "DELETE", - "parameterOrder": [ - "variantSetId" - ], - "response": { - "$ref": "Empty" - } - }, - "create": { - "request": { - "$ref": "VariantSet" - }, - "description": "Creates a new variant set.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThe provided variant set must have a valid `datasetId` set - all other\nfields are optional. Note that the `id` field will be ignored, as this is\nassigned by the server.", - "response": { - "$ref": "VariantSet" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/variantsets", - "path": "v1/variantsets", - "id": "genomics.variantsets.create" - } - } - }, - "annotations": { - "methods": { - "search": { - "description": "Searches for annotations that match the given criteria. Results are\nordered by genomic coordinate (by reference sequence, then position).\nAnnotations with equivalent genomic coordinates are returned in an\nunspecified order. This order is consistent, such that two queries for the\nsame content (regardless of page size) yield annotations in the same order\nacross their respective streams of paginated responses. Caller must have\nREAD permission for the queried annotation sets.", - "request": { - "$ref": "SearchAnnotationsRequest" - }, - "response": { - "$ref": "SearchAnnotationsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": {}, - "flatPath": "v1/annotations/search", - "path": "v1/annotations/search", - "id": "genomics.annotations.search" - }, - "get": { - "flatPath": "v1/annotations/{annotationId}", - "id": "genomics.annotations.get", - "path": "v1/annotations/{annotationId}", - "description": "Gets an annotation. Caller must have READ permission\nfor the associated annotation set.", - "httpMethod": "GET", - "response": { - "$ref": "Annotation" - }, - "parameterOrder": [ - "annotationId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "annotationId": { - "description": "The ID of the annotation to be retrieved.", - "required": true, - "type": "string", - "location": "path" - } - } - }, - "update": { - "description": "Updates an annotation. Caller must have\nWRITE permission for the associated dataset.", - "request": { - "$ref": "Annotation" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "annotationId" - ], - "response": { - "$ref": "Annotation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "updateMask": { - "description": "An optional mask specifying which fields to update. Mutable fields are\nname,\nvariant,\ntranscript, and\ninfo. If unspecified, all mutable\nfields will be updated.", - "format": "google-fieldmask", - "type": "string", - "location": "query" - }, - "annotationId": { - "location": "path", - "description": "The ID of the annotation to be updated.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/annotations/{annotationId}", - "id": "genomics.annotations.update", - "path": "v1/annotations/{annotationId}" - }, - "delete": { - "path": "v1/annotations/{annotationId}", - "id": "genomics.annotations.delete", - "description": "Deletes an annotation. Caller must have WRITE permission for\nthe associated annotation set.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "annotationId" - ], - "httpMethod": "DELETE", - "parameters": { - "annotationId": { - "description": "The ID of the annotation to be deleted.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/annotations/{annotationId}" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Annotation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": {}, - "flatPath": "v1/annotations", - "id": "genomics.annotations.create", - "path": "v1/annotations", - "description": "Creates a new annotation. Caller must have WRITE permission\nfor the associated annotation set.\n\nThe following fields are required:\n\n* annotationSetId\n* referenceName or\n referenceId\n\n### Transcripts\n\nFor annotations of type TRANSCRIPT, the following fields of\ntranscript must be provided:\n\n* exons.start\n* exons.end\n\nAll other fields may be optionally specified, unless documented as being\nserver-generated (for example, the `id` field). The annotated\nrange must be no longer than 100Mbp (mega base pairs). See the\nAnnotation resource\nfor additional restrictions on each field.", - "request": { - "$ref": "Annotation" - } - }, - "batchCreate": { - "flatPath": "v1/annotations:batchCreate", - "path": "v1/annotations:batchCreate", - "id": "genomics.annotations.batchCreate", - "request": { - "$ref": "BatchCreateAnnotationsRequest" - }, - "description": "Creates one or more new annotations atomically. All annotations must\nbelong to the same annotation set. Caller must have WRITE\npermission for this annotation set. For optimal performance, batch\npositionally adjacent annotations together.\n\nIf the request has a systemic issue, such as an attempt to write to\nan inaccessible annotation set, the entire RPC will fail accordingly. For\nlesser data issues, when possible an error will be isolated to the\ncorresponding batch entry in the response; the remaining well formed\nannotations will be created normally.\n\nFor details on the requirements for each individual annotation resource,\nsee\nCreateAnnotation.", - "response": { - "$ref": "BatchCreateAnnotationsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ] } } }, "operations": { "methods": { - "cancel": { - "flatPath": "v1/operations/{operationsId}:cancel", - "path": "v1/{+name}:cancel", - "id": "genomics.operations.cancel", - "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation.", - "request": { - "$ref": "CancelOperationRequest" - }, - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^operations/.+$", - "location": "path", - "description": "The name of the operation resource to be cancelled." - } - } - }, - "list": { - "description": "Lists operations that match the specified filter in the request.", - "httpMethod": "GET", - "response": { - "$ref": "ListOperationsResponse" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "The name of the operation collection.", - "required": true, - "type": "string", - "pattern": "^operations$", - "location": "path" - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "The standard list page token." - }, - "pageSize": { - "location": "query", - "description": "The maximum number of results to return. If unspecified, defaults to\n256. The maximum value is 2048.", - "format": "int32", - "type": "integer" - }, - "filter": { - "description": "A string for filtering Operations.\nThe following filter fields are supported:\n\n* projectId: Required. Corresponds to\n OperationMetadata.projectId.\n* createTime: The time this job was created, in seconds from the\n [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `\u003c=`\n operators.\n* status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only\n one status may be specified.\n* labels.key where key is a label key.\n\nExamples:\n\n* `projectId = my-project AND createTime \u003e= 1432140000`\n* `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`\n* `projectId = my-project AND labels.color = *`\n* `projectId = my-project AND labels.color = red`", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/operations", - "id": "genomics.operations.list", - "path": "v1/{+name}" - }, "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "httpMethod": "GET", "response": { "$ref": "Operation" }, "parameterOrder": [ "name" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" @@ -1052,26 +325,91 @@ "pattern": "^operations/.+$", "location": "path", "description": "The name of the operation resource.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, "flatPath": "v1/operations/{operationsId}", "id": "genomics.operations.get", - "path": "v1/{+name}" + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "filter": { + "description": "A string for filtering Operations.\nThe following filter fields are supported:\n\n* projectId: Required. Corresponds to\n OperationMetadata.projectId.\n* createTime: The time this job was created, in seconds from the\n [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `\u003c=`\n operators.\n* status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only\n one status may be specified.\n* labels.key where key is a label key.\n\nExamples:\n\n* `projectId = my-project AND createTime \u003e= 1432140000`\n* `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`\n* `projectId = my-project AND labels.color = *`\n* `projectId = my-project AND labels.color = red`", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true, + "pattern": "^operations$", + "location": "path" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The maximum number of results to return. If unspecified, defaults to\n256. The maximum value is 2048.", + "type": "integer" + } + }, + "flatPath": "v1/operations", + "path": "v1/{+name}", + "id": "genomics.operations.list", + "description": "Lists operations that match the specified filter in the request." + }, + "cancel": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "name": { + "pattern": "^operations/.+$", + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/operations/{operationsId}:cancel", + "id": "genomics.operations.cancel", + "path": "v1/{+name}:cancel", + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST" } } }, "referencesets": { "methods": { "search": { - "flatPath": "v1/referencesets/search", - "id": "genomics.referencesets.search", - "path": "v1/referencesets/search", - "description": "Searches for reference sets which match the given criteria.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71)", - "request": { - "$ref": "SearchReferenceSetsRequest" - }, "httpMethod": "POST", "parameterOrder": [], "response": { @@ -1082,21 +420,31 @@ "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], - "parameters": {} + "parameters": {}, + "flatPath": "v1/referencesets/search", + "path": "v1/referencesets/search", + "id": "genomics.referencesets.search", + "request": { + "$ref": "SearchReferenceSetsRequest" + }, + "description": "Searches for reference sets which match the given criteria.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71)" }, "get": { + "path": "v1/referencesets/{referenceSetId}", + "id": "genomics.referencesets.get", + "description": "Gets a reference set.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83).", + "httpMethod": "GET", "response": { "$ref": "ReferenceSet" }, "parameterOrder": [ "referenceSetId" ], - "httpMethod": "GET", "parameters": { "referenceSetId": { "description": "The ID of the reference set.", - "required": true, "type": "string", + "required": true, "location": "path" } }, @@ -1105,24 +453,290 @@ "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], - "flatPath": "v1/referencesets/{referenceSetId}", - "path": "v1/referencesets/{referenceSetId}", - "id": "genomics.referencesets.get", - "description": "Gets a reference set.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83)." + "flatPath": "v1/referencesets/{referenceSetId}" + } + } + }, + "readgroupsets": { + "methods": { + "export": { + "path": "v1/readgroupsets/{readGroupSetId}:export", + "id": "genomics.readgroupsets.export", + "description": "Exports a read group set to a BAM file in Google Cloud Storage.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nNote that currently there may be some differences between exported BAM\nfiles and the original BAM file at the time of import. See\nImportReadGroupSets\nfor caveats.", + "request": { + "$ref": "ExportReadGroupSetRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "readGroupSetId": { + "location": "path", + "description": "Required. The ID of the read group set to export. The caller must have\nREAD access to this read group set.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/readgroupsets/{readGroupSetId}:export" + }, + "search": { + "response": { + "$ref": "SearchReadGroupSetsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": {}, + "flatPath": "v1/readgroupsets/search", + "id": "genomics.readgroupsets.search", + "path": "v1/readgroupsets/search", + "request": { + "$ref": "SearchReadGroupSetsRequest" + }, + "description": "Searches for read group sets matching the criteria.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135)." + }, + "get": { + "path": "v1/readgroupsets/{readGroupSetId}", + "id": "genomics.readgroupsets.get", + "description": "Gets a read group set by ID.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "httpMethod": "GET", + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ReadGroupSet" + }, + "parameters": { + "readGroupSetId": { + "location": "path", + "description": "The ID of the read group set.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/readgroupsets/{readGroupSetId}" + }, + "patch": { + "description": "Updates a read group set.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics.", + "request": { + "$ref": "ReadGroupSet" + }, + "response": { + "$ref": "ReadGroupSet" + }, + "parameterOrder": [ + "readGroupSetId" + ], + "httpMethod": "PATCH", + "parameters": { + "readGroupSetId": { + "location": "path", + "description": "The ID of the read group set to be updated. The caller must have WRITE\npermissions to the dataset associated with this read group set.", + "type": "string", + "required": true + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. Supported fields:\n\n* name.\n* referenceSetId.\n\nLeaving `updateMask` unset is equivalent to specifying all mutable\nfields.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/readgroupsets/{readGroupSetId}", + "id": "genomics.readgroupsets.patch", + "path": "v1/readgroupsets/{readGroupSetId}" + }, + "import": { + "id": "genomics.readgroupsets.import", + "path": "v1/readgroupsets:import", + "request": { + "$ref": "ImportReadGroupSetsRequest" + }, + "description": "Creates read group sets by asynchronously importing the provided\ninformation.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThe caller must have WRITE permissions to the dataset.\n\n## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import\n\n- Tags will be converted to strings - tag types are not preserved\n- Comments (`@CO`) in the input file header will not be preserved\n- Original header order of references (`@SQ`) will not be preserved\n- Any reverse stranded unmapped reads will be reverse complemented, and\ntheir qualities (also the \"BQ\" and \"OQ\" tags, if any) will be reversed\n- Unmapped reads will be stripped of positional information (reference name\nand position)", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/readgroupsets:import" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "parameterOrder": [ + "readGroupSetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "readGroupSetId": { + "description": "The ID of the read group set to be deleted. The caller must have WRITE\npermissions to the dataset associated with this read group set.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/readgroupsets/{readGroupSetId}", + "id": "genomics.readgroupsets.delete", + "path": "v1/readgroupsets/{readGroupSetId}", + "description": "Deletes a read group set.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + } + }, + "resources": { + "coveragebuckets": { + "methods": { + "list": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 2048.", + "type": "integer", + "location": "query" + }, + "start": { + "format": "int64", + "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified, `referenceName` must also be specified. Defaults to 0.", + "type": "string", + "location": "query" + }, + "targetBucketWidth": { + "format": "int64", + "description": "The desired width of each reported coverage bucket in base pairs. This\nwill be rounded down to the nearest precomputed bucket width; the value\nof which is returned as `bucketWidth` in the response. Defaults\nto infinity (each bucket spans an entire reference sequence) or the length\nof the target range, if specified. The smallest precomputed\n`bucketWidth` is currently 2048 base pairs; this is subject to\nchange.", + "type": "string", + "location": "query" + }, + "readGroupSetId": { + "description": "Required. The ID of the read group set over which coverage is requested.", + "type": "string", + "required": true, + "location": "path" + }, + "referenceName": { + "location": "query", + "description": "The name of the reference to query, within the reference set associated\nwith this query. Optional.", + "type": "string" + }, + "end": { + "location": "query", + "format": "int64", + "description": "The end position of the range on the reference, 0-based exclusive. If\nspecified, `referenceName` must also be specified. If unset or 0, defaults\nto the length of the reference.", + "type": "string" + } + }, + "flatPath": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", + "id": "genomics.readgroupsets.coveragebuckets.list", + "path": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", + "description": "Lists fixed width coverage buckets for a read group set, each of which\ncorrespond to a range of a reference sequence. Each bucket summarizes\ncoverage information across its corresponding genomic range.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nCoverage is defined as the number of reads which are aligned to a given\nbase in the reference sequence. Coverage buckets are available at several\nprecomputed bucket widths, enabling retrieval of various coverage 'zoom\nlevels'. The caller must have READ permissions for the target read group\nset.", + "response": { + "$ref": "ListCoverageBucketsResponse" + }, + "httpMethod": "GET", + "parameterOrder": [ + "readGroupSetId" + ] + } + } + } + } + }, + "reads": { + "methods": { + "search": { + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/reads/search", + "path": "v1/reads/search", + "id": "genomics.reads.search", + "description": "Gets a list of reads for one or more read group sets.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nReads search operates over a genomic coordinate space of reference sequence\n& position defined over the reference sequences to which the requested\nread group sets are aligned.\n\nIf a target positional range is specified, search returns all reads whose\nalignment to the reference genome overlap the range. A query which\nspecifies only read group set IDs yields all reads in those read group\nsets, including unmapped reads.\n\nAll reads returned (including reads on subsequent pages) are ordered by\ngenomic coordinate (by reference sequence, then position). Reads with\nequivalent genomic coordinates are returned in an unspecified order. This\norder is consistent, such that two queries for the same content (regardless\nof page size) yield reads in the same order across their respective streams\nof paginated responses.\n\nImplements\n[GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).", + "request": { + "$ref": "SearchReadsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "SearchReadsResponse" + } } } }, "callsets": { "methods": { - "delete": { - "description": "Deletes a call set.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "response": { - "$ref": "Empty" + "create": { + "description": "Creates a new call set.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "request": { + "$ref": "CallSet" }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "CallSet" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/callsets", + "path": "v1/callsets", + "id": "genomics.callsets.create" + }, + "delete": { + "path": "v1/callsets/{callSetId}", + "id": "genomics.callsets.delete", + "description": "Deletes a call set.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "httpMethod": "DELETE", "parameterOrder": [ "callSetId" ], - "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" @@ -1131,13 +745,11 @@ "callSetId": { "location": "path", "description": "The ID of the call set to be deleted.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, - "flatPath": "v1/callsets/{callSetId}", - "path": "v1/callsets/{callSetId}", - "id": "genomics.callsets.delete" + "flatPath": "v1/callsets/{callSetId}" }, "search": { "request": { @@ -1149,42 +761,68 @@ }, "parameterOrder": [], "httpMethod": "POST", - "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], + "parameters": {}, "flatPath": "v1/callsets/search", - "path": "v1/callsets/search", - "id": "genomics.callsets.search" + "id": "genomics.callsets.search", + "path": "v1/callsets/search" }, - "patch": { - "response": { - "$ref": "CallSet" - }, + "get": { + "httpMethod": "GET", "parameterOrder": [ "callSetId" ], - "httpMethod": "PATCH", + "response": { + "$ref": "CallSet" + }, "parameters": { "callSetId": { "location": "path", - "description": "The ID of the call set to be updated.", - "required": true, - "type": "string" - }, - "updateMask": { - "description": "An optional mask specifying which fields to update. At this time, the only\nmutable field is name. The only\nacceptable value is \"name\". If unspecified, all mutable fields will be\nupdated.", - "format": "google-fieldmask", + "description": "The ID of the call set.", "type": "string", - "location": "query" + "required": true } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/callsets/{callSetId}", + "path": "v1/callsets/{callSetId}", + "id": "genomics.callsets.get", + "description": "Gets a call set by ID.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "callSetId" + ], + "response": { + "$ref": "CallSet" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. At this time, the only\nmutable field is name. The only\nacceptable value is \"name\". If unspecified, all mutable fields will be\nupdated.", + "type": "string", + "location": "query" + }, + "callSetId": { + "description": "The ID of the call set to be updated.", + "type": "string", + "required": true, + "location": "path" + } + }, "flatPath": "v1/callsets/{callSetId}", "path": "v1/callsets/{callSetId}", "id": "genomics.callsets.patch", @@ -1192,13 +830,84 @@ "$ref": "CallSet" }, "description": "Updates a call set.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics." + } + } + }, + "annotationsets": { + "methods": { + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/annotationsets", + "path": "v1/annotationsets", + "id": "genomics.annotationsets.create", + "request": { + "$ref": "AnnotationSet" + }, + "description": "Creates a new annotation set. Caller must have WRITE permission for the\nassociated dataset.\n\nThe following fields are required:\n\n * datasetId\n * referenceSetId\n\nAll other fields may be optionally specified, unless documented as being\nserver-generated (for example, the `id` field).", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnnotationSet" + } + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "annotationSetId" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "annotationSetId": { + "description": "The ID of the annotation set to be deleted.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/annotationsets/{annotationSetId}", + "path": "v1/annotationsets/{annotationSetId}", + "id": "genomics.annotationsets.delete", + "description": "Deletes an annotation set. Caller must have WRITE permission\nfor the associated annotation set." + }, + "search": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": {}, + "flatPath": "v1/annotationsets/search", + "path": "v1/annotationsets/search", + "id": "genomics.annotationsets.search", + "request": { + "$ref": "SearchAnnotationSetsRequest" + }, + "description": "Searches for annotation sets that match the given criteria. Annotation sets\nare returned in an unspecified order. This order is consistent, such that\ntwo queries for the same content (regardless of page size) yield annotation\nsets in the same order across their respective streams of paginated\nresponses. Caller must have READ permission for the queried datasets.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "SearchAnnotationSetsResponse" + } }, "get": { + "id": "genomics.annotationsets.get", + "path": "v1/annotationsets/{annotationSetId}", + "description": "Gets an annotation set. Caller must have READ permission for\nthe associated dataset.", "response": { - "$ref": "CallSet" + "$ref": "AnnotationSet" }, "parameterOrder": [ - "callSetId" + "annotationSetId" ], "httpMethod": "GET", "scopes": [ @@ -1207,309 +916,633 @@ "https://www.googleapis.com/auth/genomics.readonly" ], "parameters": { - "callSetId": { - "description": "The ID of the call set.", - "required": true, + "annotationSetId": { + "description": "The ID of the annotation set to be retrieved.", "type": "string", + "required": true, "location": "path" } }, - "flatPath": "v1/callsets/{callSetId}", - "path": "v1/callsets/{callSetId}", - "id": "genomics.callsets.get", - "description": "Gets a call set by ID.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + "flatPath": "v1/annotationsets/{annotationSetId}" }, - "create": { - "httpMethod": "POST", - "parameterOrder": [], + "update": { "response": { - "$ref": "CallSet" + "$ref": "AnnotationSet" + }, + "parameterOrder": [ + "annotationSetId" + ], + "httpMethod": "PUT", + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. Mutable fields are\nname,\nsource_uri, and\ninfo. If unspecified, all\nmutable fields will be updated.", + "type": "string", + "location": "query" + }, + "annotationSetId": { + "description": "The ID of the annotation set to be updated.", + "type": "string", + "required": true, + "location": "path" + } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], - "parameters": {}, - "flatPath": "v1/callsets", - "id": "genomics.callsets.create", - "path": "v1/callsets", - "description": "Creates a new call set.\n\nFor the definitions of call sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "flatPath": "v1/annotationsets/{annotationSetId}", + "id": "genomics.annotationsets.update", + "path": "v1/annotationsets/{annotationSetId}", + "description": "Updates an annotation set. The update must respect all mutability\nrestrictions and other invariants described on the annotation set resource.\nCaller must have WRITE permission for the associated dataset.", "request": { - "$ref": "CallSet" + "$ref": "AnnotationSet" } } } }, - "reads": { + "variants": { "methods": { - "search": { - "description": "Gets a list of reads for one or more read group sets.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nReads search operates over a genomic coordinate space of reference sequence\n& position defined over the reference sequences to which the requested\nread group sets are aligned.\n\nIf a target positional range is specified, search returns all reads whose\nalignment to the reference genome overlap the range. A query which\nspecifies only read group set IDs yields all reads in those read group\nsets, including unmapped reads.\n\nAll reads returned (including reads on subsequent pages) are ordered by\ngenomic coordinate (by reference sequence, then position). Reads with\nequivalent genomic coordinates are returned in an unspecified order. This\norder is consistent, such that two queries for the same content (regardless\nof page size) yield reads in the same order across their respective streams\nof paginated responses.\n\nImplements\n[GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).", - "request": { - "$ref": "SearchReadsRequest" - }, - "response": { - "$ref": "SearchReadsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", + "create": { "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" + "https://www.googleapis.com/auth/genomics" ], "parameters": {}, - "flatPath": "v1/reads/search", - "path": "v1/reads/search", - "id": "genomics.reads.search" - } - } - }, - "readgroupsets": { - "methods": { - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "readGroupSetId" - ], - "httpMethod": "DELETE", - "parameters": { - "readGroupSetId": { - "location": "path", - "description": "The ID of the read group set to be deleted. The caller must have WRITE\npermissions to the dataset associated with this read group set.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/readgroupsets/{readGroupSetId}", - "path": "v1/readgroupsets/{readGroupSetId}", - "id": "genomics.readgroupsets.delete", - "description": "Deletes a read group set.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" - }, - "import": { - "flatPath": "v1/readgroupsets:import", - "id": "genomics.readgroupsets.import", - "path": "v1/readgroupsets:import", + "flatPath": "v1/variants", + "id": "genomics.variants.create", + "path": "v1/variants", "request": { - "$ref": "ImportReadGroupSetsRequest" + "$ref": "Variant" + }, + "description": "Creates a new variant.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "response": { + "$ref": "Variant" }, - "description": "Creates read group sets by asynchronously importing the provided\ninformation.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThe caller must have WRITE permissions to the dataset.\n\n## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import\n\n- Tags will be converted to strings - tag types are not preserved\n- Comments (`@CO`) in the input file header will not be preserved\n- Original header order of references (`@SQ`) will not be preserved\n- Any reverse stranded unmapped reads will be reverse complemented, and\ntheir qualities (also the \"BQ\" and \"OQ\" tags, if any) will be reversed\n- Unmapped reads will be stripped of positional information (reference name\nand position)", - "httpMethod": "POST", "parameterOrder": [], - "response": { - "$ref": "Operation" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.read_write", - "https://www.googleapis.com/auth/genomics" - ] - }, - "export": { - "parameters": { - "readGroupSetId": { - "description": "Required. The ID of the read group set to export. The caller must have\nREAD access to this read group set.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.read_write", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1/readgroupsets/{readGroupSetId}:export", - "path": "v1/readgroupsets/{readGroupSetId}:export", - "id": "genomics.readgroupsets.export", - "request": { - "$ref": "ExportReadGroupSetRequest" - }, - "description": "Exports a read group set to a BAM file in Google Cloud Storage.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nNote that currently there may be some differences between exported BAM\nfiles and the original BAM file at the time of import. See\nImportReadGroupSets\nfor caveats.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "readGroupSetId" - ], "httpMethod": "POST" }, "search": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "SearchReadGroupSetsResponse" + "description": "Gets a list of variants matching the criteria.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).", + "request": { + "$ref": "SearchVariantsRequest" }, + "response": { + "$ref": "SearchVariantsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], - "flatPath": "v1/readgroupsets/search", - "id": "genomics.readgroupsets.search", - "path": "v1/readgroupsets/search", - "request": { - "$ref": "SearchReadGroupSetsRequest" - }, - "description": "Searches for read group sets matching the criteria.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135)." + "flatPath": "v1/variants/search", + "id": "genomics.variants.search", + "path": "v1/variants/search" }, - "get": { - "httpMethod": "GET", + "patch": { + "request": { + "$ref": "Variant" + }, + "description": "Updates a variant.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics. Returns the modified variant without\nits calls.", + "httpMethod": "PATCH", "parameterOrder": [ - "readGroupSetId" + "variantId" ], "response": { - "$ref": "ReadGroupSet" + "$ref": "Variant" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. At this time, mutable\nfields are names and\ninfo. Acceptable values are \"names\" and\n\"info\". If unspecified, all mutable fields will be updated.", + "type": "string", + "location": "query" + }, + "variantId": { + "location": "path", + "description": "The ID of the variant to be updated.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/variants/{variantId}", + "path": "v1/variants/{variantId}", + "id": "genomics.variants.patch" + }, + "get": { + "description": "Gets a variant by ID.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "response": { + "$ref": "Variant" + }, + "httpMethod": "GET", + "parameterOrder": [ + "variantId" + ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], "parameters": { - "readGroupSetId": { - "required": true, + "variantId": { + "description": "The ID of the variant.", "type": "string", - "location": "path", - "description": "The ID of the read group set." - } - }, - "flatPath": "v1/readgroupsets/{readGroupSetId}", - "id": "genomics.readgroupsets.get", - "path": "v1/readgroupsets/{readGroupSetId}", - "description": "Gets a read group set by ID.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" - }, - "patch": { - "path": "v1/readgroupsets/{readGroupSetId}", - "id": "genomics.readgroupsets.patch", - "request": { - "$ref": "ReadGroupSet" - }, - "description": "Updates a read group set.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics.", - "response": { - "$ref": "ReadGroupSet" - }, - "parameterOrder": [ - "readGroupSetId" - ], - "httpMethod": "PATCH", - "parameters": { - "readGroupSetId": { - "description": "The ID of the read group set to be updated. The caller must have WRITE\npermissions to the dataset associated with this read group set.", "required": true, - "type": "string", "location": "path" - }, - "updateMask": { - "location": "query", - "description": "An optional mask specifying which fields to update. Supported fields:\n\n* name.\n* referenceSetId.\n\nLeaving `updateMask` unset is equivalent to specifying all mutable\nfields.", - "format": "google-fieldmask", - "type": "string" } }, + "flatPath": "v1/variants/{variantId}", + "id": "genomics.variants.get", + "path": "v1/variants/{variantId}" + }, + "delete": { "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], - "flatPath": "v1/readgroupsets/{readGroupSetId}" + "parameters": { + "variantId": { + "location": "path", + "description": "The ID of the variant to be deleted.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/variants/{variantId}", + "path": "v1/variants/{variantId}", + "id": "genomics.variants.delete", + "description": "Deletes a variant.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "httpMethod": "DELETE", + "parameterOrder": [ + "variantId" + ], + "response": { + "$ref": "Empty" + } + }, + "import": { + "request": { + "$ref": "ImportVariantsRequest" + }, + "description": "Creates variant data by asynchronously importing the provided information.\n\nFor the definitions of variant sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThe variants for import will be merged with any existing variant that\nmatches its reference sequence, start, end, reference bases, and\nalternative bases. If no such variant exists, a new one will be created.\n\nWhen variants are merged, the call information from the new variant\nis added to the existing variant, and Variant info fields are merged\nas specified in\ninfoMergeConfig.\nAs a special case, for single-sample VCF files, QUAL and FILTER fields will\nbe moved to the call level; these are sometimes interpreted in a\ncall-specific context.\nImported VCF headers are appended to the metadata already in a variant set.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/variants:import", + "id": "genomics.variants.import", + "path": "v1/variants:import" + }, + "merge": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/variants:merge", + "id": "genomics.variants.merge", + "path": "v1/variants:merge", + "request": { + "$ref": "MergeVariantsRequest" + }, + "description": "Merges the given variants with existing variants.\n\nFor the definitions of variants and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nEach variant will be\nmerged with an existing variant that matches its reference sequence,\nstart, end, reference bases, and alternative bases. If no such variant\nexists, a new one will be created.\n\nWhen variants are merged, the call information from the new variant\nis added to the existing variant. Variant info fields are merged as\nspecified in the\ninfoMergeConfig\nfield of the MergeVariantsRequest.\n\nPlease exercise caution when using this method! It is easy to introduce\nmistakes in existing variants and difficult to back out of them. For\nexample,\nsuppose you were trying to merge a new variant with an existing one and\nboth\nvariants contain calls that belong to callsets with the same callset ID.\n\n // Existing variant - irrelevant fields trimmed for clarity\n {\n \"variantSetId\": \"10473108253681171589\",\n \"referenceName\": \"1\",\n \"start\": \"10582\",\n \"referenceBases\": \"G\",\n \"alternateBases\": [\n \"A\"\n ],\n \"calls\": [\n {\n \"callSetId\": \"10473108253681171589-0\",\n \"callSetName\": \"CALLSET0\",\n \"genotype\": [\n 0,\n 1\n ],\n }\n ]\n }\n\n // New variant with conflicting call information\n {\n \"variantSetId\": \"10473108253681171589\",\n \"referenceName\": \"1\",\n \"start\": \"10582\",\n \"referenceBases\": \"G\",\n \"alternateBases\": [\n \"A\"\n ],\n \"calls\": [\n {\n \"callSetId\": \"10473108253681171589-0\",\n \"callSetName\": \"CALLSET0\",\n \"genotype\": [\n 1,\n 1\n ],\n }\n ]\n }\n\nThe resulting merged variant would overwrite the existing calls with those\nfrom the new variant:\n\n {\n \"variantSetId\": \"10473108253681171589\",\n \"referenceName\": \"1\",\n \"start\": \"10582\",\n \"referenceBases\": \"G\",\n \"alternateBases\": [\n \"A\"\n ],\n \"calls\": [\n {\n \"callSetId\": \"10473108253681171589-0\",\n \"callSetName\": \"CALLSET0\",\n \"genotype\": [\n 1,\n 1\n ],\n }\n ]\n }\n\nThis may be the desired outcome, but it is up to the user to determine if\nif that is indeed the case.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [], + "httpMethod": "POST" + } + } + }, + "references": { + "methods": { + "search": { + "id": "genomics.references.search", + "path": "v1/references/search", + "request": { + "$ref": "SearchReferencesRequest" + }, + "description": "Searches for references which match the given criteria.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146).", + "response": { + "$ref": "SearchReferencesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": {}, + "flatPath": "v1/references/search" + }, + "get": { + "parameters": { + "referenceId": { + "description": "The ID of the reference.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/references/{referenceId}", + "id": "genomics.references.get", + "path": "v1/references/{referenceId}", + "description": "Gets a reference.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158).", + "response": { + "$ref": "Reference" + }, + "parameterOrder": [ + "referenceId" + ], + "httpMethod": "GET" } }, "resources": { - "coveragebuckets": { + "bases": { "methods": { "list": { "response": { - "$ref": "ListCoverageBucketsResponse" + "$ref": "ListBasesResponse" }, - "parameterOrder": [ - "readGroupSetId" - ], "httpMethod": "GET", + "parameterOrder": [ + "referenceId" + ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], "parameters": { - "referenceName": { - "description": "The name of the reference to query, within the reference set associated\nwith this query. Optional.", - "type": "string", - "location": "query" - }, - "end": { - "location": "query", - "description": "The end position of the range on the reference, 0-based exclusive. If\nspecified, `referenceName` must also be specified. If unset or 0, defaults\nto the length of the reference.", - "format": "int64", - "type": "string" - }, "pageToken": { "location": "query", "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", "type": "string" }, "pageSize": { + "format": "int32", + "description": "The maximum number of bases to return in a single page. If unspecified,\ndefaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base\npairs).", "type": "integer", - "location": "query", - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 2048.", - "format": "int32" + "location": "query" }, "start": { "location": "query", - "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified, `referenceName` must also be specified. Defaults to 0.", "format": "int64", + "description": "The start position (0-based) of this query. Defaults to 0.", "type": "string" }, - "readGroupSetId": { - "description": "Required. The ID of the read group set over which coverage is requested.", - "required": true, + "referenceId": { + "description": "The ID of the reference.", "type": "string", + "required": true, "location": "path" }, - "targetBucketWidth": { + "end": { "location": "query", - "description": "The desired width of each reported coverage bucket in base pairs. This\nwill be rounded down to the nearest precomputed bucket width; the value\nof which is returned as `bucketWidth` in the response. Defaults\nto infinity (each bucket spans an entire reference sequence) or the length\nof the target range, if specified. The smallest precomputed\n`bucketWidth` is currently 2048 base pairs; this is subject to\nchange.", "format": "int64", + "description": "The end position (0-based, exclusive) of this query. Defaults to the length\nof this reference.", "type": "string" } }, - "flatPath": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", - "path": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", - "id": "genomics.readgroupsets.coveragebuckets.list", - "description": "Lists fixed width coverage buckets for a read group set, each of which\ncorrespond to a range of a reference sequence. Each bucket summarizes\ncoverage information across its corresponding genomic range.\n\nFor the definitions of read group sets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nCoverage is defined as the number of reads which are aligned to a given\nbase in the reference sequence. Coverage buckets are available at several\nprecomputed bucket widths, enabling retrieval of various coverage 'zoom\nlevels'. The caller must have READ permissions for the target read group\nset." + "flatPath": "v1/references/{referenceId}/bases", + "id": "genomics.references.bases.list", + "path": "v1/references/{referenceId}/bases", + "description": "Lists the bases in a reference, optionally restricted to a range.\n\nFor the definitions of references and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nImplements\n[GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221)." } } } } + }, + "datasets": { + "methods": { + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource.\nSee \u003ca href=\"/iam/docs/managing-policies#testing_permissions\"\u003eTesting\nPermissions\u003c/a\u003e for more information.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "pattern": "^datasets/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/datasets/{datasetsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "genomics.datasets.testIamPermissions" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "datasetId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "datasetId": { + "description": "The ID of the dataset to be deleted.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/datasets/{datasetId}", + "id": "genomics.datasets.delete", + "path": "v1/datasets/{datasetId}", + "description": "Deletes a dataset and all of its contents (all read group sets,\nreference sets, variant sets, call sets, annotation sets, etc.)\nThis is reversible (up to one week after the deletion) via\nthe\ndatasets.undelete\noperation.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListDatasetsResponse" + }, + "parameters": { + "pageToken": { + "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 50. The maximum value is 1024.", + "type": "integer", + "location": "query" + }, + "projectId": { + "description": "Required. The Google Cloud project ID to list datasets for.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/datasets", + "path": "v1/datasets", + "id": "genomics.datasets.list", + "description": "Lists datasets within a project.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + }, + "create": { + "id": "genomics.datasets.create", + "path": "v1/datasets", + "request": { + "$ref": "Dataset" + }, + "description": "Creates a new dataset.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "response": { + "$ref": "Dataset" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/datasets" + }, + "setIamPolicy": { + "description": "Sets the access control policy on the specified dataset. Replaces any\nexisting policy.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nSee \u003ca href=\"/iam/docs/managing-policies#setting_a_policy\"\u003eSetting a\nPolicy\u003c/a\u003e for more information.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", + "type": "string", + "required": true, + "pattern": "^datasets/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/datasets/{datasetsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "genomics.datasets.setIamPolicy" + }, + "getIamPolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "resource": { + "pattern": "^datasets/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/datasets/{datasetsId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "genomics.datasets.getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for the dataset. This is empty if the\npolicy or resource does not exist.\n\nSee \u003ca href=\"/iam/docs/managing-policies#getting_a_policy\"\u003eGetting a\nPolicy\u003c/a\u003e for more information.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "datasetId": { + "description": "The ID of the dataset to be updated.", + "type": "string", + "required": true, + "location": "path" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "An optional mask specifying which fields to update. At this time, the only\nmutable field is name. The only\nacceptable value is \"name\". If unspecified, all mutable fields will be\nupdated.", + "type": "string" + } + }, + "flatPath": "v1/datasets/{datasetId}", + "path": "v1/datasets/{datasetId}", + "id": "genomics.datasets.patch", + "request": { + "$ref": "Dataset" + }, + "description": "Updates a dataset.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis method supports patch semantics." + }, + "get": { + "id": "genomics.datasets.get", + "path": "v1/datasets/{datasetId}", + "description": "Gets a dataset by ID.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "response": { + "$ref": "Dataset" + }, + "parameterOrder": [ + "datasetId" + ], + "httpMethod": "GET", + "parameters": { + "datasetId": { + "location": "path", + "description": "The ID of the dataset.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "flatPath": "v1/datasets/{datasetId}" + }, + "undelete": { + "httpMethod": "POST", + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "parameters": { + "datasetId": { + "description": "The ID of the dataset to be undeleted.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/datasets/{datasetId}:undelete", + "path": "v1/datasets/{datasetId}:undelete", + "id": "genomics.datasets.undelete", + "description": "Undeletes a dataset by restoring a dataset which was deleted via this API.\n\nFor the definitions of datasets and other genomics resources, see\n[Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nThis operation is only possible for a week after the deletion occurred.", + "request": { + "$ref": "UndeleteDatasetRequest" + } + } + } } }, "parameters": { + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, "upload_protocol": { "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string" }, "prettyPrint": { + "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", - "location": "query" + "type": "boolean" }, "fields": { + "description": "Selector specifying which fields to include in a partial response.", "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." + "location": "query" }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "callback": { "location": "query", @@ -1517,6 +1550,7 @@ "type": "string" }, "$.xgafv": { + "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", @@ -1526,10 +1560,11 @@ "enum": [ "1", "2" - ], - "description": "V1 error format." + ] }, "alt": { + "description": "Data format for response.", + "default": "json", "enum": [ "json", "media", @@ -1541,149 +1576,269 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", "location": "query" } }, "schemas": { - "Exon": { + "Program": { "type": "object", "properties": { - "start": { - "description": "The start position of the exon on this annotation's reference sequence,\n0-based inclusive. Note that this is relative to the reference start, and\n**not** the containing annotation start.", - "format": "int64", + "version": { + "description": "The version of the program run.", "type": "string" }, - "end": { - "description": "The end position of the exon on this annotation's reference sequence,\n0-based exclusive. Note that this is relative to the reference start, and\n*not* the containing annotation start.", - "format": "int64", + "id": { + "description": "The user specified locally unique ID of the program. Used along with\n`prevProgramId` to define an ordering between programs.", "type": "string" }, - "frame": { - "type": "integer", - "description": "The frame of this exon. Contains a value of 0, 1, or 2, which indicates\nthe offset of the first coding base of the exon within the reading frame\nof the coding DNA sequence, if any. This field is dependent on the\nstrandedness of this annotation (see\nAnnotation.reverse_strand).\nFor forward stranded annotations, this offset is relative to the\nexon.start. For reverse\nstrand annotations, this offset is relative to the\nexon.end `- 1`.\n\nUnset if this exon does not intersect the coding sequence. Upon creation\nof a transcript, the frame must be populated for all or none of the\ncoding exons.", - "format": "int32" + "name": { + "description": "The display name of the program. This is typically the colloquial name of\nthe tool used, for example 'bwa' or 'picard'.", + "type": "string" + }, + "prevProgramId": { + "description": "The ID of the program run before this one.", + "type": "string" + }, + "commandLine": { + "description": "The command line used to run this program.", + "type": "string" } }, - "id": "Exon" + "id": "Program" }, - "ExportReadGroupSetRequest": { - "id": "ExportReadGroupSetRequest", - "description": "The read group set export request.", + "ComputeEngine": { + "id": "ComputeEngine", + "description": "Describes a Compute Engine resource that is being managed by a running\npipeline.", "type": "object", "properties": { - "exportUri": { - "description": "Required. A Google Cloud Storage URI for the exported BAM file.\nThe currently authenticated user must have write access to the new file.\nAn error will be returned if the URI already contains data.", - "type": "string" - }, - "referenceNames": { - "description": "The reference names to export. If this is not specified, all reference\nsequences, including unmapped reads, are exported.\nUse `*` to export only unmapped reads.", - "type": "array", + "diskNames": { + "description": "The names of the disks that were created for this pipeline.", "items": { "type": "string" - } + }, + "type": "array" }, - "projectId": { - "description": "Required. The Google Cloud project ID that owns this\nexport. The caller must have WRITE access to this project.", + "machineType": { + "description": "The machine type of the instance.", + "type": "string" + }, + "instanceName": { + "description": "The instance on which the operation is running.", + "type": "string" + }, + "zone": { + "description": "The availability zone in which the instance resides.", "type": "string" } } }, - "CallSet": { - "description": "A call set is a collection of variant calls, typically for one sample. It\nbelongs to a variant set.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "CoverageBucket": { + "id": "CoverageBucket", + "description": "A bucket over which read coverage has been precomputed. A bucket corresponds\nto a specific range of the reference sequence.", "type": "object", "properties": { - "info": { - "description": "A map of additional call set information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - } + "meanCoverage": { + "format": "float", + "description": "The average number of reads which are aligned to each individual\nreference base in this bucket.", + "type": "number" }, - "variantSetIds": { - "description": "The IDs of the variant sets this call set belongs to. This field must\nhave exactly length one, as a call set belongs to a single variant set.\nThis field is repeated for compatibility with the\n[GA4GH 0.5.1\nAPI](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76).", - "type": "array", - "items": { - "type": "string" - } + "range": { + "description": "The genomic coordinate range spanned by this bucket.", + "$ref": "Range" + } + } + }, + "ExternalId": { + "id": "ExternalId", + "type": "object", + "properties": { + "sourceName": { + "description": "The name of the source of this data.", + "type": "string" }, "id": { - "description": "The server-generated call set ID, unique across all call sets.", + "description": "The id used by the source of this data.", + "type": "string" + } + } + }, + "VariantSetMetadata": { + "id": "VariantSetMetadata", + "description": "Metadata describes a single piece of variant call metadata.\nThese data include a top level key and either a single value string (value)\nor a list of key-value pairs (info.)\nValue and info are mutually exclusive.", + "type": "object", + "properties": { + "value": { + "description": "The value field for simple metadata", "type": "string" }, - "created": { - "description": "The date this call set was created in milliseconds from the epoch.", + "id": { + "description": "User-provided ID field, not enforced by this API.\nTwo or more pieces of structured metadata with identical\nid and key fields are considered equivalent.", + "type": "string" + }, + "number": { + "description": "The number of values that can be included in a field described by this\nmetadata.", + "type": "string" + }, + "key": { + "description": "The top-level key.", + "type": "string" + }, + "description": { + "description": "A textual description of this metadata.", + "type": "string" + }, + "type": { + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ], + "enum": [ + "TYPE_UNSPECIFIED", + "INTEGER", + "FLOAT", + "FLAG", + "CHARACTER", + "STRING" + ], + "description": "The type of data. Possible types include: Integer, Float,\nFlag, Character, and String.", + "type": "string" + }, + "info": { + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + }, + "description": "Remaining structured metadata key-value pairs. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object" + } + } + }, + "Reference": { + "id": "Reference", + "description": "A reference is a canonical assembled DNA sequence, intended to act as a\nreference coordinate space for other genomic annotations. A single reference\nmight represent the human chromosome 1 or mitochandrial DNA, for instance. A\nreference belongs to one or more reference sets.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "type": "object", + "properties": { + "id": { + "description": "The server-generated reference ID, unique across all references.", + "type": "string" + }, + "length": { "format": "int64", + "description": "The length of this reference's sequence.", "type": "string" }, - "sampleId": { - "description": "The sample ID this call set corresponds to.", + "sourceAccessions": { + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally\nwith a version number, for example `GCF_000001405.26`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ncbiTaxonId": { + "format": "int32", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human.", + "type": "integer" + }, + "sourceUri": { + "description": "The URI from which the sequence was obtained. Typically specifies a FASTA\nformat file.", "type": "string" }, "name": { - "description": "The call set name.", + "description": "The name of this reference, for example `22`.", + "type": "string" + }, + "md5checksum": { + "description": "MD5 of the upper-case sequence excluding all whitespace characters (this\nis equivalent to SQ:M5 in SAM). This value is represented in lower case\nhexadecimal format.", + "type": "string" + } + } + }, + "SearchVariantSetsRequest": { + "description": "The search variant sets request.", + "type": "object", + "properties": { + "datasetIds": { + "description": "Exactly one dataset ID must be provided here. Only variant sets which\nbelong to this dataset will be returned.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pageToken": { + "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", + "type": "integer" + } + }, + "id": "SearchVariantSetsRequest" + }, + "SearchReferenceSetsRequest": { + "type": "object", + "properties": { + "md5checksums": { + "description": "If present, return reference sets for which the\nmd5checksum matches exactly.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pageToken": { + "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", + "type": "string" + }, + "accessions": { + "description": "If present, return reference sets for which a prefix of any of\nsourceAccessions\nmatch any of these strings. Accession numbers typically have a main number\nand a version, for example `NC_000001.11`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 4096.", + "type": "integer" + }, + "assemblyId": { + "description": "If present, return reference sets for which a substring of their\n`assemblyId` matches this string (case insensitive).", "type": "string" } }, - "id": "CallSet" + "id": "SearchReferenceSetsRequest" }, - "SearchAnnotationSetsResponse": { + "SetIamPolicyRequest": { + "id": "SetIamPolicyRequest", + "description": "Request message for `SetIamPolicy` method.", "type": "object", "properties": { - "nextPageToken": { - "type": "string", - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results." - }, - "annotationSets": { - "description": "The matching annotation sets.", - "type": "array", - "items": { - "$ref": "AnnotationSet" - } + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." } - }, - "id": "SearchAnnotationSetsResponse" + } }, - "ImportVariantsRequest": { - "description": "The variant data import request.", + "MergeVariantsRequest": { "type": "object", "properties": { + "variants": { + "description": "The variants to be merged with existing variants.", + "items": { + "$ref": "Variant" + }, + "type": "array" + }, "infoMergeConfig": { + "description": "A mapping between info field keys and the InfoMergeOperations to\nbe performed on them.", + "type": "object", "additionalProperties": { "enum": [ "INFO_MERGE_OPERATION_UNSPECIFIED", @@ -1691,26 +1846,447 @@ "MOVE_TO_CALLS" ], "type": "string" - }, - "description": "A mapping between info field keys and the InfoMergeOperations to\nbe performed on them. This is plumbed down to the MergeVariantRequests\ngenerated by the resulting import job.", - "type": "object" - }, - "variantSetId": { - "description": "Required. The variant set to which variant data should be imported.", - "type": "string" - }, - "sourceUris": { - "description": "A list of URIs referencing variant files in Google Cloud Storage. URIs can\ninclude wildcards [as described\nhere](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames).\nNote that recursive wildcards ('**') are not supported.", - "type": "array", - "items": { - "type": "string" } }, - "normalizeReferenceNames": { - "description": "Convert reference names to the canonical representation.\nhg19 haploytypes (those reference names containing \"_hap\")\nare not modified in any way.\nAll other reference names are modified according to the following rules:\nThe reference name is capitalized.\nThe \"chr\" prefix is dropped for all autosomes and sex chromsomes.\nFor example \"chr17\" becomes \"17\" and \"chrX\" becomes \"X\".\nAll mitochondrial chromosomes (\"chrM\", \"chrMT\", etc) become \"MT\".", + "variantSetId": { + "description": "The destination variant set.", + "type": "string" + } + }, + "id": "MergeVariantsRequest" + }, + "Read": { + "description": "A read alignment describes a linear alignment of a string of DNA to a\nreference sequence, in addition to metadata\nabout the fragment (the molecule of DNA sequenced) and the read (the bases\nwhich were read by the sequencer). A read is equivalent to a line in a SAM\nfile. A read belongs to exactly one read group and exactly one\nread group set.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\n### Reverse-stranded reads\n\nMapped reads (reads having a non-null `alignment`) can be aligned to either\nthe forward or the reverse strand of their associated reference. Strandedness\nof a mapped read is encoded by `alignment.position.reverseStrand`.\n\nIf we consider the reference to be a forward-stranded coordinate space of\n`[0, reference.length)` with `0` as the left-most position and\n`reference.length` as the right-most position, reads are always aligned left\nto right. That is, `alignment.position.position` always refers to the\nleft-most reference coordinate and `alignment.cigar` describes the alignment\nof this read to the reference from left to right. All per-base fields such as\n`alignedSequence` and `alignedQuality` share this same left-to-right\norientation; this is true of reads which are aligned to either strand. For\nreverse-stranded reads, this means that `alignedSequence` is the reverse\ncomplement of the bases that were originally reported by the sequencing\nmachine.\n\n### Generating a reference-aligned sequence string\n\nWhen interacting with mapped reads, it's often useful to produce a string\nrepresenting the local alignment of the read to reference. The following\npseudocode demonstrates one way of doing this:\n\n out = \"\"\n offset = 0\n for c in read.alignment.cigar {\n switch c.operation {\n case \"ALIGNMENT_MATCH\", \"SEQUENCE_MATCH\", \"SEQUENCE_MISMATCH\":\n out += read.alignedSequence[offset:offset+c.operationLength]\n offset += c.operationLength\n break\n case \"CLIP_SOFT\", \"INSERT\":\n offset += c.operationLength\n break\n case \"PAD\":\n out += repeat(\"*\", c.operationLength)\n break\n case \"DELETE\":\n out += repeat(\"-\", c.operationLength)\n break\n case \"SKIP\":\n out += repeat(\" \", c.operationLength)\n break\n case \"CLIP_HARD\":\n break\n }\n }\n return out\n\n### Converting to SAM's CIGAR string\n\nThe following pseudocode generates a SAM CIGAR string from the\n`cigar` field. Note that this is a lossy conversion\n(`cigar.referenceSequence` is lost).\n\n cigarMap = {\n \"ALIGNMENT_MATCH\": \"M\",\n \"INSERT\": \"I\",\n \"DELETE\": \"D\",\n \"SKIP\": \"N\",\n \"CLIP_SOFT\": \"S\",\n \"CLIP_HARD\": \"H\",\n \"PAD\": \"P\",\n \"SEQUENCE_MATCH\": \"=\",\n \"SEQUENCE_MISMATCH\": \"X\",\n }\n cigarStr = \"\"\n for c in read.alignment.cigar {\n cigarStr += c.operationLength + cigarMap[c.operation]\n }\n return cigarStr", + "type": "object", + "properties": { + "readGroupSetId": { + "description": "The ID of the read group set this read belongs to. A read belongs to\nexactly one read group set.", + "type": "string" + }, + "duplicateFragment": { + "description": "The fragment is a PCR or optical duplicate (SAM flag 0x400).", "type": "boolean" }, + "readNumber": { + "format": "int32", + "description": "The read number in sequencing. 0-based and less than numberReads. This\nfield replaces SAM flag 0x40 and 0x80.", + "type": "integer" + }, + "alignedSequence": { + "description": "The bases of the read sequence contained in this alignment record,\n**without CIGAR operations applied** (equivalent to SEQ in SAM).\n`alignedSequence` and `alignedQuality` may be\nshorter than the full read sequence and quality. This will occur if the\nalignment is part of a chimeric alignment, or if the read was trimmed. When\nthis occurs, the CIGAR for this read will begin/end with a hard clip\noperator that will indicate the length of the excised sequence.", + "type": "string" + }, + "readGroupId": { + "description": "The ID of the read group this read belongs to. A read belongs to exactly\none read group. This is a server-generated ID which is distinct from SAM's\nRG tag (for that value, see\nReadGroup.name).", + "type": "string" + }, + "nextMatePosition": { + "$ref": "Position", + "description": "The mapping of the primary alignment of the\n`(readNumber+1)%numberReads` read in the fragment. It replaces\nmate position and mate strand in SAM." + }, + "info": { + "description": "A map of additional read alignment information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object", + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + } + }, + "properPlacement": { + "description": "The orientation and the distance between reads from the fragment are\nconsistent with the sequencing protocol (SAM flag 0x2).", + "type": "boolean" + }, + "supplementaryAlignment": { + "description": "Whether this alignment is supplementary. Equivalent to SAM flag 0x800.\nSupplementary alignments are used in the representation of a chimeric\nalignment. In a chimeric alignment, a read is split into multiple\nlinear alignments that map to different reference contigs. The first\nlinear alignment in the read will be designated as the representative\nalignment; the remaining linear alignments will be designated as\nsupplementary alignments. These alignments may have different mapping\nquality scores. In each linear alignment in a chimeric alignment, the read\nwill be hard clipped. The `alignedSequence` and\n`alignedQuality` fields in the alignment record will only\nrepresent the bases for its respective linear alignment.", + "type": "boolean" + }, + "fragmentLength": { + "format": "int32", + "description": "The observed length of the fragment, equivalent to TLEN in SAM.", + "type": "integer" + }, + "failedVendorQualityChecks": { + "description": "Whether this read did not pass filters, such as platform or vendor quality\ncontrols (SAM flag 0x200).", + "type": "boolean" + }, + "alignedQuality": { + "description": "The quality of the read sequence contained in this alignment record\n(equivalent to QUAL in SAM).\n`alignedSequence` and `alignedQuality` may be shorter than the full read\nsequence and quality. This will occur if the alignment is part of a\nchimeric alignment, or if the read was trimmed. When this occurs, the CIGAR\nfor this read will begin/end with a hard clip operator that will indicate\nthe length of the excised sequence.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + }, + "alignment": { + "$ref": "LinearAlignment", + "description": "The linear alignment for this alignment record. This field is null for\nunmapped reads." + }, + "numberReads": { + "format": "int32", + "description": "The number of reads in the fragment (extension to SAM flag 0x1).", + "type": "integer" + }, + "id": { + "description": "The server-generated read ID, unique across all reads. This is different\nfrom the `fragmentName`.", + "type": "string" + }, + "secondaryAlignment": { + "description": "Whether this alignment is secondary. Equivalent to SAM flag 0x100.\nA secondary alignment represents an alternative to the primary alignment\nfor this read. Aligners may return secondary alignments if a read can map\nambiguously to multiple coordinates in the genome. By convention, each read\nhas one and only one alignment where both `secondaryAlignment`\nand `supplementaryAlignment` are false.", + "type": "boolean" + }, + "fragmentName": { + "description": "The fragment name. Equivalent to QNAME (query template name) in SAM.", + "type": "string" + } + }, + "id": "Read" + }, + "BatchCreateAnnotationsRequest": { + "id": "BatchCreateAnnotationsRequest", + "type": "object", + "properties": { + "annotations": { + "description": "The annotations to be created. At most 4096 can be specified in a single\nrequest.", + "items": { + "$ref": "Annotation" + }, + "type": "array" + }, + "requestId": { + "description": "A unique request ID which enables the server to detect duplicated requests.\nIf provided, duplicated requests will result in the same response; if not\nprovided, duplicated requests may result in duplicated data. For a given\nannotation set, callers should not reuse `request_id`s when writing\ndifferent batches of annotations - behavior in this case is undefined.\nA common approach is to use a UUID. For batch jobs where worker crashes are\na possibility, consider using some unique variant of a worker or run ID.", + "type": "string" + } + } + }, + "CigarUnit": { + "id": "CigarUnit", + "description": "A single CIGAR operation.", + "type": "object", + "properties": { + "operation": { + "type": "string", + "enumDescriptions": [ + "", + "An alignment match indicates that a sequence can be aligned to the\nreference without evidence of an INDEL. Unlike the\n`SEQUENCE_MATCH` and `SEQUENCE_MISMATCH` operators,\nthe `ALIGNMENT_MATCH` operator does not indicate whether the\nreference and read sequences are an exact match. This operator is\nequivalent to SAM's `M`.", + "The insert operator indicates that the read contains evidence of bases\nbeing inserted into the reference. This operator is equivalent to SAM's\n`I`.", + "The delete operator indicates that the read contains evidence of bases\nbeing deleted from the reference. This operator is equivalent to SAM's\n`D`.", + "The skip operator indicates that this read skips a long segment of the\nreference, but the bases have not been deleted. This operator is commonly\nused when working with RNA-seq data, where reads may skip long segments\nof the reference between exons. This operator is equivalent to SAM's\n`N`.", + "The soft clip operator indicates that bases at the start/end of a read\nhave not been considered during alignment. This may occur if the majority\nof a read maps, except for low quality bases at the start/end of a read.\nThis operator is equivalent to SAM's `S`. Bases that are soft\nclipped will still be stored in the read.", + "The hard clip operator indicates that bases at the start/end of a read\nhave been omitted from this alignment. This may occur if this linear\nalignment is part of a chimeric alignment, or if the read has been\ntrimmed (for example, during error correction or to trim poly-A tails for\nRNA-seq). This operator is equivalent to SAM's `H`.", + "The pad operator indicates that there is padding in an alignment. This\noperator is equivalent to SAM's `P`.", + "This operator indicates that this portion of the aligned sequence exactly\nmatches the reference. This operator is equivalent to SAM's `=`.", + "This operator indicates that this portion of the aligned sequence is an\nalignment match to the reference, but a sequence mismatch. This can\nindicate a SNP or a read error. This operator is equivalent to SAM's\n`X`." + ], + "enum": [ + "OPERATION_UNSPECIFIED", + "ALIGNMENT_MATCH", + "INSERT", + "DELETE", + "SKIP", + "CLIP_SOFT", + "CLIP_HARD", + "PAD", + "SEQUENCE_MATCH", + "SEQUENCE_MISMATCH" + ] + }, + "referenceSequence": { + "description": "`referenceSequence` is only used at mismatches\n(`SEQUENCE_MISMATCH`) and deletions (`DELETE`).\nFilling this field replaces SAM's MD tag. If the relevant information is\nnot available, this field is unset.", + "type": "string" + }, + "operationLength": { + "format": "int64", + "description": "The number of genomic bases that the operation runs for. Required.", + "type": "string" + } + } + }, + "ReferenceSet": { + "description": "A reference set is a set of references which typically comprise a reference\nassembly for a species, such as `GRCh38` which is representative\nof the human genome. A reference set defines a common coordinate space for\ncomparing reference-aligned experimental data. A reference set contains 1 or\nmore references.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "type": "object", + "properties": { + "sourceUri": { + "description": "The URI from which the references were obtained.", + "type": "string" + }, + "ncbiTaxonId": { + "format": "int32", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human)\nindicating the species which this reference set is intended to model. Note\nthat contained references may specify a different `ncbiTaxonId`, as\nassemblies may contain reference sequences which do not belong to the\nmodeled species, for example EBV in a human reference genome.", + "type": "integer" + }, + "referenceIds": { + "description": "The IDs of the reference objects that are part of this set.\n`Reference.md5checksum` must be unique within this set.", + "items": { + "type": "string" + }, + "type": "array" + }, + "assemblyId": { + "description": "Public id of this reference set, such as `GRCh37`.", + "type": "string" + }, + "md5checksum": { + "description": "Order-independent MD5 checksum which identifies this reference set. The\nchecksum is computed by sorting all lower case hexidecimal string\n`reference.md5checksum` (for all reference in this set) in\nascending lexicographic order, concatenating, and taking the MD5 of that\nvalue. The resulting value is represented in lower case hexadecimal format.", + "type": "string" + }, + "id": { + "description": "The server-generated reference set ID, unique across all reference sets.", + "type": "string" + }, + "sourceAccessions": { + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally\nwith a version number, for example `NC_000001.11`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "Free text description of this reference set.", + "type": "string" + } + }, + "id": "ReferenceSet" + }, + "Transcript": { + "description": "A transcript represents the assertion that a particular region of the\nreference genome may be transcribed as RNA.", + "type": "object", + "properties": { + "geneId": { + "description": "The annotation ID of the gene from which this transcript is transcribed.", + "type": "string" + }, + "exons": { + "description": "The \u003ca href=\"http://en.wikipedia.org/wiki/Exon\"\u003eexons\u003c/a\u003e that compose\nthis transcript. This field should be unset for genomes where transcript\nsplicing does not occur, for example prokaryotes.\n\nIntrons are regions of the transcript that are not included in the\nspliced RNA product. Though not explicitly modeled here, intron ranges can\nbe deduced; all regions of this transcript that are not exons are introns.\n\nExonic sequences do not necessarily code for a translational product\n(amino acids). Only the regions of exons bounded by the\ncodingSequence correspond\nto coding DNA sequence.\n\nExons are ordered by start position and may not overlap.", + "items": { + "$ref": "Exon" + }, + "type": "array" + }, + "codingSequence": { + "$ref": "CodingSequence", + "description": "The range of the coding sequence for this transcript, if any. To determine\nthe exact ranges of coding sequence, intersect this range with those of the\nexons, if any. If there are any\nexons, the\ncodingSequence must start\nand end within them.\n\nNote that in some cases, the reference genome will not exactly match the\nobserved mRNA transcript e.g. due to variance in the source genome from\nreference. In these cases,\nexon.frame will not necessarily\nmatch the expected reference reading frame and coding exon reference bases\ncannot necessarily be concatenated to produce the original transcript mRNA." + } + }, + "id": "Transcript" + }, + "AnnotationSet": { + "description": "An annotation set is a logical grouping of annotations that share consistent\ntype information and provenance. Examples of annotation sets include 'all\ngenes from refseq', and 'all variant annotations from ClinVar'.", + "type": "object", + "properties": { + "name": { + "description": "The display name for this annotation set.", + "type": "string" + }, + "referenceSetId": { + "description": "The ID of the reference set that defines the coordinate space for this\nset's annotations.", + "type": "string" + }, + "info": { + "description": "A map of additional read alignment information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object", + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + } + }, + "type": { + "description": "The type of annotations contained within this set.", + "type": "string", + "enumDescriptions": [ + "", + "A `GENERIC` annotation type should be used when no other annotation\ntype will suffice. This represents an untyped annotation of the reference\ngenome.", + "A `VARIANT` annotation type.", + "A `GENE` annotation type represents the existence of a gene at the\nassociated reference coordinates. The start coordinate is typically the\ngene's transcription start site and the end is typically the end of the\ngene's last exon.", + "A `TRANSCRIPT` annotation type represents the assertion that a\nparticular region of the reference genome may be transcribed as RNA." + ], + "enum": [ + "ANNOTATION_TYPE_UNSPECIFIED", + "GENERIC", + "VARIANT", + "GENE", + "TRANSCRIPT" + ] + }, + "id": { + "description": "The server-generated annotation set ID, unique across all annotation sets.", + "type": "string" + }, + "datasetId": { + "description": "The dataset to which this annotation set belongs.", + "type": "string" + }, + "sourceUri": { + "description": "The source URI describing the file from which this annotation set was\ngenerated, if any.", + "type": "string" + } + }, + "id": "AnnotationSet" + }, + "Experiment": { + "type": "object", + "properties": { + "sequencingCenter": { + "description": "The sequencing center used as part of this experiment.", + "type": "string" + }, + "platformUnit": { + "description": "The platform unit used as part of this experiment, for example\nflowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the\n@RG PU field in the SAM spec.", + "type": "string" + }, + "instrumentModel": { + "description": "The instrument model used as part of this experiment. This maps to\nsequencing technology in the SAM spec.", + "type": "string" + }, + "libraryId": { + "description": "A client-supplied library identifier; a library is a collection of DNA\nfragments which have been prepared for sequencing from a sample. This\nfield is important for quality control as error or bias can be introduced\nduring sample preparation.", + "type": "string" + } + }, + "id": "Experiment" + }, + "ListDatasetsResponse": { + "id": "ListDatasetsResponse", + "description": "The dataset list response.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" + }, + "datasets": { + "description": "The list of matching Datasets.", + "items": { + "$ref": "Dataset" + }, + "type": "array" + } + } + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "REQUIRED: The set of permissions to check for the 'resource'.\nPermissions with wildcards (such as '*' or 'storage.*') are not allowed.\nAllowed permissions are:\n\n* `genomics.datasets.create`\n* `genomics.datasets.delete`\n* `genomics.datasets.get`\n* `genomics.datasets.list`\n* `genomics.datasets.update`\n* `genomics.datasets.getIamPolicy`\n* `genomics.datasets.setIamPolicy`", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "ExportReadGroupSetRequest": { + "description": "The read group set export request.", + "type": "object", + "properties": { + "referenceNames": { + "description": "The reference names to export. If this is not specified, all reference\nsequences, including unmapped reads, are exported.\nUse `*` to export only unmapped reads.", + "items": { + "type": "string" + }, + "type": "array" + }, + "exportUri": { + "description": "Required. A Google Cloud Storage URI for the exported BAM file.\nThe currently authenticated user must have write access to the new file.\nAn error will be returned if the URI already contains data.", + "type": "string" + }, + "projectId": { + "description": "Required. The Google Cloud project ID that owns this\nexport. The caller must have WRITE access to this project.", + "type": "string" + } + }, + "id": "ExportReadGroupSetRequest" + }, + "Exon": { + "type": "object", + "properties": { + "start": { + "format": "int64", + "description": "The start position of the exon on this annotation's reference sequence,\n0-based inclusive. Note that this is relative to the reference start, and\n**not** the containing annotation start.", + "type": "string" + }, + "frame": { + "format": "int32", + "description": "The frame of this exon. Contains a value of 0, 1, or 2, which indicates\nthe offset of the first coding base of the exon within the reading frame\nof the coding DNA sequence, if any. This field is dependent on the\nstrandedness of this annotation (see\nAnnotation.reverse_strand).\nFor forward stranded annotations, this offset is relative to the\nexon.start. For reverse\nstrand annotations, this offset is relative to the\nexon.end `- 1`.\n\nUnset if this exon does not intersect the coding sequence. Upon creation\nof a transcript, the frame must be populated for all or none of the\ncoding exons.", + "type": "integer" + }, + "end": { + "format": "int64", + "description": "The end position of the exon on this annotation's reference sequence,\n0-based exclusive. Note that this is relative to the reference start, and\n*not* the containing annotation start.", + "type": "string" + } + }, + "id": "Exon" + }, + "CallSet": { + "description": "A call set is a collection of variant calls, typically for one sample. It\nbelongs to a variant set.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "type": "object", + "properties": { + "name": { + "description": "The call set name.", + "type": "string" + }, + "info": { + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + }, + "description": "A map of additional call set information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object" + }, + "variantSetIds": { + "description": "The IDs of the variant sets this call set belongs to. This field must\nhave exactly length one, as a call set belongs to a single variant set.\nThis field is repeated for compatibility with the\n[GA4GH 0.5.1\nAPI](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76).", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "The server-generated call set ID, unique across all call sets.", + "type": "string" + }, + "created": { + "format": "int64", + "description": "The date this call set was created in milliseconds from the epoch.", + "type": "string" + }, + "sampleId": { + "description": "The sample ID this call set corresponds to.", + "type": "string" + } + }, + "id": "CallSet" + }, + "SearchAnnotationSetsResponse": { + "id": "SearchAnnotationSetsResponse", + "type": "object", + "properties": { + "annotationSets": { + "description": "The matching annotation sets.", + "items": { + "$ref": "AnnotationSet" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" + } + } + }, + "ImportVariantsRequest": { + "description": "The variant data import request.", + "type": "object", + "properties": { "format": { + "description": "The format of the variant data being imported. If unspecified, defaults to\nto `VCF`.", "type": "string", "enumDescriptions": [ "", @@ -1721,15 +2297,66 @@ "FORMAT_UNSPECIFIED", "FORMAT_VCF", "FORMAT_COMPLETE_GENOMICS" - ], - "description": "The format of the variant data being imported. If unspecified, defaults to\nto `VCF`." + ] + }, + "infoMergeConfig": { + "additionalProperties": { + "type": "string", + "enum": [ + "INFO_MERGE_OPERATION_UNSPECIFIED", + "IGNORE_NEW", + "MOVE_TO_CALLS" + ] + }, + "description": "A mapping between info field keys and the InfoMergeOperations to\nbe performed on them. This is plumbed down to the MergeVariantRequests\ngenerated by the resulting import job.", + "type": "object" + }, + "sourceUris": { + "description": "A list of URIs referencing variant files in Google Cloud Storage. URIs can\ninclude wildcards [as described\nhere](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames).\nNote that recursive wildcards ('**') are not supported.", + "items": { + "type": "string" + }, + "type": "array" + }, + "variantSetId": { + "description": "Required. The variant set to which variant data should be imported.", + "type": "string" + }, + "normalizeReferenceNames": { + "description": "Convert reference names to the canonical representation.\nhg19 haploytypes (those reference names containing \"_hap\")\nare not modified in any way.\nAll other reference names are modified according to the following rules:\nThe reference name is capitalized.\nThe \"chr\" prefix is dropped for all autosomes and sex chromsomes.\nFor example \"chr17\" becomes \"17\" and \"chrX\" becomes \"X\".\nAll mitochondrial chromosomes (\"chrM\", \"chrMT\", etc) become \"MT\".", + "type": "boolean" } }, "id": "ImportVariantsRequest" }, "VariantAnnotation": { + "id": "VariantAnnotation", "type": "object", "properties": { + "type": { + "description": "Type has been adapted from ClinVar's list of variant types.", + "type": "string", + "enumDescriptions": [ + "", + "`TYPE_OTHER` should be used when no other Type will suffice.\nFurther explanation of the variant type may be included in the\ninfo field.", + "`INSERTION` indicates an insertion.", + "`DELETION` indicates a deletion.", + "`SUBSTITUTION` indicates a block substitution of\ntwo or more nucleotides.", + "`SNP` indicates a single nucleotide polymorphism.", + "`STRUCTURAL` indicates a large structural variant,\nincluding chromosomal fusions, inversions, etc.", + "`CNV` indicates a variation in copy number." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "TYPE_OTHER", + "INSERTION", + "DELETION", + "SUBSTITUTION", + "SNP", + "STRUCTURAL", + "CNV" + ] + }, "alternateBases": { "description": "The alternate allele for this variant. If multiple alternate alleles\nexist at this location, create a separate variant for each one, as they\nmay represent distinct conditions.", "type": "string" @@ -1739,22 +2366,6 @@ "type": "string" }, "clinicalSignificance": { - "enum": [ - "CLINICAL_SIGNIFICANCE_UNSPECIFIED", - "CLINICAL_SIGNIFICANCE_OTHER", - "UNCERTAIN", - "BENIGN", - "LIKELY_BENIGN", - "LIKELY_PATHOGENIC", - "PATHOGENIC", - "DRUG_RESPONSE", - "HISTOCOMPATIBILITY", - "CONFERS_SENSITIVITY", - "RISK_FACTOR", - "ASSOCIATION", - "PROTECTIVE", - "MULTIPLE_REPORTED" - ], "description": "Describes the clinical significance of a variant.\nIt is adapted from the ClinVar controlled vocabulary for clinical\nsignificance described at:\nhttp://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/", "type": "string", "enumDescriptions": [ @@ -1772,14 +2383,30 @@ "", "", "`MULTIPLE_REPORTED` should be used when multiple clinical\nsignficances are reported for a variant. The original clinical\nsignificance values may be provided in the `info` field." + ], + "enum": [ + "CLINICAL_SIGNIFICANCE_UNSPECIFIED", + "CLINICAL_SIGNIFICANCE_OTHER", + "UNCERTAIN", + "BENIGN", + "LIKELY_BENIGN", + "LIKELY_PATHOGENIC", + "PATHOGENIC", + "DRUG_RESPONSE", + "HISTOCOMPATIBILITY", + "CONFERS_SENSITIVITY", + "RISK_FACTOR", + "ASSOCIATION", + "PROTECTIVE", + "MULTIPLE_REPORTED" ] }, "conditions": { - "type": "array", + "description": "The set of conditions associated with this variant.\nA condition describes the way a variant influences human health.", "items": { "$ref": "ClinicalCondition" }, - "description": "The set of conditions associated with this variant.\nA condition describes the way a variant influences human health." + "type": "array" }, "effect": { "description": "Effect of the variant on the coding sequence.", @@ -1809,56 +2436,31 @@ }, "transcriptIds": { "description": "Google annotation IDs of the transcripts affected by this variant. These\nshould be provided when the variant is created.", - "type": "array", "items": { "type": "string" - } - }, - "type": { - "enum": [ - "TYPE_UNSPECIFIED", - "TYPE_OTHER", - "INSERTION", - "DELETION", - "SUBSTITUTION", - "SNP", - "STRUCTURAL", - "CNV" - ], - "description": "Type has been adapted from ClinVar's list of variant types.", - "type": "string", - "enumDescriptions": [ - "", - "`TYPE_OTHER` should be used when no other Type will suffice.\nFurther explanation of the variant type may be included in the\ninfo field.", - "`INSERTION` indicates an insertion.", - "`DELETION` indicates a deletion.", - "`SUBSTITUTION` indicates a block substitution of\ntwo or more nucleotides.", - "`SNP` indicates a single nucleotide polymorphism.", - "`STRUCTURAL` indicates a large structural variant,\nincluding chromosomal fusions, inversions, etc.", - "`CNV` indicates a variation in copy number." - ] + }, + "type": "array" } - }, - "id": "VariantAnnotation" + } }, "ListCoverageBucketsResponse": { "type": "object", "properties": { - "nextPageToken": { - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", - "type": "string" - }, "bucketWidth": { - "type": "string", + "format": "int64", "description": "The length of each coverage bucket in base pairs. Note that buckets at the\nend of a reference sequence may be shorter. This value is omitted if the\nbucket width is infinity (the default behaviour, with no range or\n`targetBucketWidth`).", - "format": "int64" + "type": "string" }, "coverageBuckets": { "description": "The coverage buckets. The list of buckets is sparse; a bucket with 0\noverlapping reads is not returned. A bucket never crosses more than one\nreference sequence. Each bucket has width `bucketWidth`, unless\nits end is the end of the reference sequence.", - "type": "array", "items": { "$ref": "CoverageBucket" - } + }, + "type": "array" + }, + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" } }, "id": "ListCoverageBucketsResponse" @@ -1867,66 +2469,51 @@ "description": "The variant data export request.", "type": "object", "properties": { - "format": { - "enum": [ - "FORMAT_UNSPECIFIED", - "FORMAT_BIGQUERY" - ], - "description": "The format for the exported data.", - "type": "string", - "enumDescriptions": [ - "", - "Export the data to Google BigQuery." - ] + "bigqueryTable": { + "description": "Required. The BigQuery table to export data to.\nIf the table doesn't exist, it will be created. If it already exists, it\nwill be overwritten.", + "type": "string" }, "bigqueryDataset": { "description": "Required. The BigQuery dataset to export data to. This dataset must already\nexist. Note that this is distinct from the Genomics concept of \"dataset\".", "type": "string" }, - "bigqueryTable": { - "description": "Required. The BigQuery table to export data to.\nIf the table doesn't exist, it will be created. If it already exists, it\nwill be overwritten.", - "type": "string" - }, - "callSetIds": { - "description": "If provided, only variant call information from the specified call sets\nwill be exported. By default all variant calls are exported.", - "type": "array", - "items": { - "type": "string" - } + "format": { + "description": "The format for the exported data.", + "type": "string", + "enumDescriptions": [ + "", + "Export the data to Google BigQuery." + ], + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_BIGQUERY" + ] }, "projectId": { "description": "Required. The Google Cloud project ID that owns the destination\nBigQuery dataset. The caller must have WRITE access to this project. This\nproject will also own the resulting export job.", "type": "string" + }, + "callSetIds": { + "description": "If provided, only variant call information from the specified call sets\nwill be exported. By default all variant calls are exported.", + "items": { + "type": "string" + }, + "type": "array" } }, "id": "ExportVariantSetRequest" }, "SearchAnnotationsRequest": { + "id": "SearchAnnotationsRequest", "type": "object", "properties": { - "start": { - "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified,\nreferenceId or\nreferenceName\nmust be specified. Defaults to 0.", - "format": "int64", - "type": "string" - }, - "annotationSetIds": { - "description": "Required. The annotation sets to search within. The caller must have\n`READ` access to these annotation sets.\nAll queried annotation sets must have the same type.", - "type": "array", - "items": { - "type": "string" - } - }, - "referenceName": { - "description": "The name of the reference to query, within the reference set associated\nwith this query.", - "type": "string" - }, "referenceId": { "description": "The ID of the reference to query.", "type": "string" }, "end": { - "description": "The end position of the range on the reference, 0-based exclusive. If\nreferenceId or\nreferenceName\nmust be specified, Defaults to the length of the reference.", "format": "int64", + "description": "The end position of the range on the reference, 0-based exclusive. If\nreferenceId or\nreferenceName\nmust be specified, Defaults to the length of the reference.", "type": "string" }, "pageToken": { @@ -1934,128 +2521,134 @@ "type": "string" }, "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 2048.", "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 2048.", "type": "integer" + }, + "start": { + "format": "int64", + "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified,\nreferenceId or\nreferenceName\nmust be specified. Defaults to 0.", + "type": "string" + }, + "annotationSetIds": { + "description": "Required. The annotation sets to search within. The caller must have\n`READ` access to these annotation sets.\nAll queried annotation sets must have the same type.", + "items": { + "type": "string" + }, + "type": "array" + }, + "referenceName": { + "description": "The name of the reference to query, within the reference set associated\nwith this query.", + "type": "string" } - }, - "id": "SearchAnnotationsRequest" + } }, "OperationEvent": { "description": "An event that occurred during an Operation.", "type": "object", "properties": { - "endTime": { - "description": "Optional time of when event finished. An event can have a start time and no\nfinish time. If an event has a finish time, there must be a start time.", + "startTime": { "format": "google-datetime", + "description": "Optional time of when event started.", "type": "string" }, - "startTime": { - "type": "string", - "description": "Optional time of when event started.", - "format": "google-datetime" - }, "description": { - "type": "string", - "description": "Required description of event." + "description": "Required description of event.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Optional time of when event finished. An event can have a start time and no\nfinish time. If an event has a finish time, there must be a start time.", + "type": "string" } }, "id": "OperationEvent" }, "CodingSequence": { + "id": "CodingSequence", "type": "object", "properties": { - "start": { - "description": "The start of the coding sequence on this annotation's reference sequence,\n0-based inclusive. Note that this position is relative to the reference\nstart, and *not* the containing annotation start.", + "end": { "format": "int64", + "description": "The end of the coding sequence on this annotation's reference sequence,\n0-based exclusive. Note that this position is relative to the reference\nstart, and *not* the containing annotation start.", "type": "string" }, - "end": { - "description": "The end of the coding sequence on this annotation's reference sequence,\n0-based exclusive. Note that this position is relative to the reference\nstart, and *not* the containing annotation start.", + "start": { "format": "int64", + "description": "The start of the coding sequence on this annotation's reference sequence,\n0-based inclusive. Note that this position is relative to the reference\nstart, and *not* the containing annotation start.", "type": "string" } - }, - "id": "CodingSequence" + } }, "SearchReferencesResponse": { + "id": "SearchReferencesResponse", "type": "object", "properties": { - "nextPageToken": { - "type": "string", - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results." - }, "references": { "description": "The matching references.", - "type": "array", "items": { "$ref": "Reference" - } + }, + "type": "array" + }, + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" } - }, - "id": "SearchReferencesResponse" + } }, "GetIamPolicyRequest": { - "type": "object", - "properties": {}, "id": "GetIamPolicyRequest", - "description": "Request message for `GetIamPolicy` method." + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {} }, "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", "type": "object", "properties": { "permissions": { "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "TestIamPermissionsResponse", - "description": "Response message for `TestIamPermissions` method." + "id": "TestIamPermissionsResponse" }, "SearchAnnotationSetsRequest": { - "id": "SearchAnnotationSetsRequest", "type": "object", "properties": { - "name": { - "description": "Only return annotations sets for which a substring of the name matches this\nstring (case insensitive).", - "type": "string" - }, - "referenceSetId": { - "type": "string", - "description": "If specified, only annotation sets associated with the given reference set\nare returned." - }, "pageToken": { "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", "type": "string" }, "pageSize": { - "type": "integer", + "format": "int32", "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 128. The maximum value is 1024.", - "format": "int32" + "type": "integer" }, "datasetIds": { "description": "Required. The dataset IDs to search within. Caller must have `READ` access\nto these datasets.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "types": { "description": "If specified, only annotation sets that have any of these types are\nreturned.", - "type": "array", "items": { + "type": "string", "enum": [ "ANNOTATION_TYPE_UNSPECIFIED", "GENERIC", "VARIANT", "GENE", "TRANSCRIPT" - ], - "type": "string" + ] }, + "type": "array", "enumDescriptions": [ "", "A `GENERIC` annotation type should be used when no other annotation\ntype will suffice. This represents an untyped annotation of the reference\ngenome.", @@ -2063,8 +2656,17 @@ "A `GENE` annotation type represents the existence of a gene at the\nassociated reference coordinates. The start coordinate is typically the\ngene's transcription start site and the end is typically the end of the\ngene's last exon.", "A `TRANSCRIPT` annotation type represents the assertion that a\nparticular region of the reference genome may be transcribed as RNA." ] + }, + "name": { + "description": "Only return annotations sets for which a substring of the name matches this\nstring (case insensitive).", + "type": "string" + }, + "referenceSetId": { + "description": "If specified, only annotation sets associated with the given reference set\nare returned.", + "type": "string" } - } + }, + "id": "SearchAnnotationSetsRequest" }, "SearchReadGroupSetsResponse": { "description": "The read group set search response.", @@ -2072,10 +2674,10 @@ "properties": { "readGroupSets": { "description": "The list of matching read group sets.", - "type": "array", "items": { "$ref": "ReadGroupSet" - } + }, + "type": "array" }, "nextPageToken": { "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", @@ -2084,63 +2686,65 @@ }, "id": "SearchReadGroupSetsResponse" }, - "LinearAlignment": { - "properties": { - "position": { - "description": "The position of this alignment.", - "$ref": "Position" - }, - "cigar": { - "description": "Represents the local alignment of this sequence (alignment matches, indels,\netc) against the reference.", - "type": "array", - "items": { - "$ref": "CigarUnit" - } - }, - "mappingQuality": { - "description": "The mapping quality of this alignment. Represents how likely\nthe read maps to this position as opposed to other locations.\n\nSpecifically, this is -10 log10 Pr(mapping position is wrong), rounded to\nthe nearest integer.", - "format": "int32", - "type": "integer" - } - }, - "id": "LinearAlignment", - "description": "A linear alignment can be represented by one CIGAR string. Describes the\nmapped position and local alignment of the read to the reference.", - "type": "object" - }, "SearchReferencesRequest": { + "id": "SearchReferencesRequest", + "type": "object", "properties": { - "accessions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "If present, return references for which a prefix of any of\nsourceAccessions match\nany of these strings. Accession numbers typically have a main number and a\nversion, for example `GCF_000001405.26`." - }, "pageToken": { "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", "type": "string" }, + "accessions": { + "description": "If present, return references for which a prefix of any of\nsourceAccessions match\nany of these strings. Accession numbers typically have a main number and a\nversion, for example `GCF_000001405.26`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pageSize": { + "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 4096.", + "type": "integer" + }, "referenceSetId": { "description": "If present, return only references which belong to this reference set.", "type": "string" }, - "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 4096.", - "format": "int32", - "type": "integer" - }, "md5checksums": { - "type": "array", + "description": "If present, return references for which the\nmd5checksum matches exactly.", "items": { "type": "string" }, - "description": "If present, return references for which the\nmd5checksum matches exactly." + "type": "array" } - }, - "id": "SearchReferencesRequest", - "type": "object" + } + }, + "LinearAlignment": { + "id": "LinearAlignment", + "description": "A linear alignment can be represented by one CIGAR string. Describes the\nmapped position and local alignment of the read to the reference.", + "type": "object", + "properties": { + "cigar": { + "description": "Represents the local alignment of this sequence (alignment matches, indels,\netc) against the reference.", + "items": { + "$ref": "CigarUnit" + }, + "type": "array" + }, + "position": { + "description": "The position of this alignment.", + "$ref": "Position" + }, + "mappingQuality": { + "format": "int32", + "description": "The mapping quality of this alignment. Represents how likely\nthe read maps to this position as opposed to other locations.\n\nSpecifically, this is -10 log10 Pr(mapping position is wrong), rounded to\nthe nearest integer.", + "type": "integer" + } + } }, "Dataset": { + "description": "A Dataset is a collection of genomic data.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", + "type": "object", "properties": { "name": { "description": "The dataset name.", @@ -2151,32 +2755,30 @@ "type": "string" }, "id": { - "type": "string", - "description": "The server-generated dataset ID, unique across all datasets." + "description": "The server-generated dataset ID, unique across all datasets.", + "type": "string" }, "createTime": { - "description": "The time this dataset was created, in seconds from the epoch.", "format": "google-datetime", + "description": "The time this dataset was created, in seconds from the epoch.", "type": "string" } }, - "id": "Dataset", - "description": "A Dataset is a collection of genomic data.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "type": "object" + "id": "Dataset" }, "ImportVariantsResponse": { + "id": "ImportVariantsResponse", "description": "The variant data import response.", "type": "object", "properties": { "callSetIds": { "description": "IDs of the call sets created during the import.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } - }, - "id": "ImportVariantsResponse" + } }, "ReadGroup": { "description": "A read group is all the data that's processed the same way by the sequencer.", @@ -2187,8 +2789,8 @@ "type": "string" }, "experiment": { - "$ref": "Experiment", - "description": "The experiment used to generate this read group." + "description": "The experiment used to generate this read group.", + "$ref": "Experiment" }, "name": { "description": "The read group name. This corresponds to the @RG ID field in the SAM spec.", @@ -2199,30 +2801,30 @@ "type": "string" }, "info": { + "description": "A map of additional read group information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object", "additionalProperties": { - "type": "array", "items": { "type": "any" - } - }, - "description": "A map of additional read group information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", - "type": "object" + }, + "type": "array" + } }, "id": { "description": "The server-generated read group ID, unique for all read groups.\nNote: This is different than the @RG ID field in the SAM spec. For that\nvalue, see name.", "type": "string" }, - "predictedInsertSize": { - "description": "The predicted insert size of this read group. The insert size is the length\nthe sequenced DNA fragment from end-to-end, not including the adapters.", - "format": "int32", - "type": "integer" - }, "programs": { "description": "The programs used to generate this read group. Programs are always\nidentical for all read groups within a read group set. For this reason,\nonly the first read group in a returned set will have this field\npopulated.", - "type": "array", "items": { "$ref": "Program" - } + }, + "type": "array" + }, + "predictedInsertSize": { + "format": "int32", + "description": "The predicted insert size of this read group. The insert size is the length\nthe sequenced DNA fragment from end-to-end, not including the adapters.", + "type": "integer" }, "description": { "description": "A free-form text description of this read group.", @@ -2236,37 +2838,24 @@ "id": "ReadGroup" }, "ReadGroupSet": { + "id": "ReadGroupSet", "description": "A read group set is a logical collection of read groups, which are\ncollections of reads produced by a sequencer. A read group set typically\nmodels reads corresponding to one sample, sequenced one way, and aligned one\nway.\n\n* A read group set belongs to one dataset.\n* A read group belongs to one read group set.\n* A read belongs to one read group.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", "type": "object", "properties": { - "referenceSetId": { - "description": "The reference set to which the reads in this read group set are aligned.", - "type": "string" - }, - "info": { - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - }, - "description": "A map of additional read group set information.", - "type": "object" - }, "id": { - "type": "string", - "description": "The server-generated read group set ID, unique for all read group sets." + "description": "The server-generated read group set ID, unique for all read group sets.", + "type": "string" }, "datasetId": { "description": "The dataset to which this read group set belongs.", "type": "string" }, "readGroups": { - "type": "array", + "description": "The read groups in this set. There are typically 1-10 read groups in a read\ngroup set.", "items": { "$ref": "ReadGroup" }, - "description": "The read groups in this set. There are typically 1-10 read groups in a read\ngroup set." + "type": "array" }, "filename": { "description": "The filename of the original source file for this read group set, if any.", @@ -2275,77 +2864,90 @@ "name": { "description": "The read group set name. By default this will be initialized to the sample\nname of the sequenced data contained in this set.", "type": "string" + }, + "referenceSetId": { + "description": "The reference set to which the reads in this read group set are aligned.", + "type": "string" + }, + "info": { + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + }, + "description": "A map of additional read group set information.", + "type": "object" } - }, - "id": "ReadGroupSet" + } }, "SearchVariantSetsResponse": { + "description": "The search variant sets response.", "type": "object", "properties": { - "nextPageToken": { - "type": "string", - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results." - }, "variantSets": { "description": "The variant sets belonging to the requested dataset.", - "type": "array", "items": { "$ref": "VariantSet" - } + }, + "type": "array" + }, + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" } }, - "id": "SearchVariantSetsResponse", - "description": "The search variant sets response." + "id": "SearchVariantSetsResponse" }, "Empty": { + "id": "Empty", "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object", - "properties": {}, - "id": "Empty" + "properties": {} }, "Entry": { "type": "object", "properties": { - "status": { - "$ref": "Status", - "description": "The creation status." - }, "annotation": { "$ref": "Annotation", "description": "The created annotation, if creation was successful." + }, + "status": { + "description": "The creation status.", + "$ref": "Status" } }, "id": "Entry" }, "Position": { + "id": "Position", "description": "An abstraction for referring to a genomic position, in relation to some\nalready known reference. For now, represents a genomic position as a\nreference name, a base number on that reference (0-based), and a\ndetermination of forward or reverse strand.", "type": "object", "properties": { - "reverseStrand": { - "description": "Whether this position is on the reverse strand, as opposed to the forward\nstrand.", - "type": "boolean" - }, "position": { - "description": "The 0-based offset from the start of the forward strand for that reference.", "format": "int64", + "description": "The 0-based offset from the start of the forward strand for that reference.", "type": "string" }, "referenceName": { "description": "The name of the reference in whatever reference set is being used.", "type": "string" + }, + "reverseStrand": { + "description": "Whether this position is on the reverse strand, as opposed to the forward\nstrand.", + "type": "boolean" } - }, - "id": "Position" + } }, "SearchReferenceSetsResponse": { "type": "object", "properties": { "referenceSets": { "description": "The matching references sets.", - "type": "array", "items": { "$ref": "ReferenceSet" - } + }, + "type": "array" }, "nextPageToken": { "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", @@ -2359,25 +2961,25 @@ "description": "The call set search request.", "type": "object", "properties": { - "variantSetIds": { - "description": "Restrict the query to call sets within the given variant sets. At least one\nID must be provided.", - "type": "array", - "items": { - "type": "string" - } + "pageToken": { + "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", + "type": "string" }, "name": { "description": "Only return call sets for which a substring of the name matches this\nstring.", "type": "string" }, - "pageToken": { - "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", - "type": "string" - }, "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", "type": "integer" + }, + "variantSetIds": { + "description": "Restrict the query to call sets within the given variant sets. At least one\nID must be provided.", + "items": { + "type": "string" + }, + "type": "array" } } }, @@ -2386,7 +2988,12 @@ "description": "The read group set import request.", "type": "object", "properties": { + "referenceSetId": { + "description": "The reference set to which the imported read group sets are aligned to, if\nany. The reference names of this reference set must be a superset of those\nfound in the imported file headers. If no reference set id is provided, a\nbest effort is made to associate with a matching reference set.", + "type": "string" + }, "partitionStrategy": { + "description": "The partition strategy describes how read groups are partitioned into read\ngroup sets.", "type": "string", "enumDescriptions": [ "", @@ -2397,8 +3004,7 @@ "PARTITION_STRATEGY_UNSPECIFIED", "PER_FILE_PER_SAMPLE", "MERGE_ALL" - ], - "description": "The partition strategy describes how read groups are partitioned into read\ngroup sets." + ] }, "datasetId": { "description": "Required. The ID of the dataset these read group sets will belong to. The\ncaller must have WRITE permissions to this dataset.", @@ -2406,40 +3012,36 @@ }, "sourceUris": { "description": "A list of URIs pointing at [BAM\nfiles](https://samtools.github.io/hts-specs/SAMv1.pdf)\nin Google Cloud Storage.\nThose URIs can include wildcards (*), but do not add or remove\nmatching files before import has completed.\n\nNote that Google Cloud Storage object listing is only eventually\nconsistent: files added may be not be immediately visible to\neveryone. Thus, if using a wildcard it is preferable not to start\nthe import immediately after the files are created.", - "type": "array", "items": { "type": "string" - } - }, - "referenceSetId": { - "description": "The reference set to which the imported read group sets are aligned to, if\nany. The reference names of this reference set must be a superset of those\nfound in the imported file headers. If no reference set id is provided, a\nbest effort is made to associate with a matching reference set.", - "type": "string" + }, + "type": "array" } } }, "Policy": { + "id": "Policy", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", "properties": { "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "type": "string" }, "version": { - "type": "integer", + "format": "int32", "description": "Version of the `Policy`. The default version is 0.", - "format": "int32" + "type": "integer" }, "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", "items": { "$ref": "Binding" - } + }, + "type": "array" } - }, - "id": "Policy", - "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", - "type": "object" + } }, "SearchReadsRequest": { "description": "The read search request.", @@ -2451,21 +3053,21 @@ }, "readGroupSetIds": { "description": "The IDs of the read groups sets within which to search for reads. All\nspecified read group sets must be aligned against a common set of reference\nsequences; this defines the genomic coordinates for the query. Must specify\none of `readGroupSetIds` or `readGroupIds`.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "readGroupIds": { "description": "The IDs of the read groups within which to search for reads. All specified\nread groups must belong to the same read group sets. Must specify one of\n`readGroupSetIds` or `readGroupIds`.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "end": { - "description": "The end position of the range on the reference, 0-based exclusive. If\nspecified, `referenceName` must also be specified.", "format": "int64", + "description": "The end position of the range on the reference, 0-based exclusive. If\nspecified, `referenceName` must also be specified.", "type": "string" }, "pageToken": { @@ -2473,32 +3075,80 @@ "type": "string" }, "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 2048.", "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 2048.", "type": "integer" }, "start": { - "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified, `referenceName` must also be specified.", "format": "int64", + "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified, `referenceName` must also be specified.", "type": "string" } }, "id": "SearchReadsRequest" }, "CancelOperationRequest": { + "id": "CancelOperationRequest", "description": "The request message for Operations.CancelOperation.", "type": "object", - "properties": {}, - "id": "CancelOperationRequest" + "properties": {} }, "Annotation": { "description": "An annotation describes a region of reference genome. The value of an\nannotation may be one of several canonical types, supplemented by arbitrary\ninfo tags. An annotation is not inherently associated with a specific\nsample or individual (though a client could choose to use annotations in\nthis way). Example canonical annotation types are `GENE` and\n`VARIANT`.", "type": "object", "properties": { + "end": { + "format": "int64", + "description": "The end position of the range on the reference, 0-based exclusive.", + "type": "string" + }, + "transcript": { + "$ref": "Transcript", + "description": "A transcript value represents the assertion that a particular region of\nthe reference genome may be transcribed as RNA. An alternative splicing\npattern would be represented as a separate transcript object. This field\nis only set for annotations of type `TRANSCRIPT`." + }, + "start": { + "format": "int64", + "description": "The start position of the range on the reference, 0-based inclusive.", + "type": "string" + }, + "annotationSetId": { + "description": "The annotation set to which this annotation belongs.", + "type": "string" + }, + "name": { + "description": "The display name of this annotation.", + "type": "string" + }, + "variant": { + "description": "A variant annotation, which describes the effect of a variant on the\ngenome, the coding sequence, and/or higher level consequences at the\norganism level e.g. pathogenicity. This field is only set for annotations\nof type `VARIANT`.", + "$ref": "VariantAnnotation" + }, + "referenceId": { + "description": "The ID of the Google Genomics reference associated with this range.", + "type": "string" + }, + "id": { + "description": "The server-generated annotation ID, unique across all annotations.", + "type": "string" + }, + "reverseStrand": { + "description": "Whether this range refers to the reverse strand, as opposed to the forward\nstrand. Note that regardless of this field, the start/end position of the\nrange always refer to the forward strand.", + "type": "boolean" + }, "referenceName": { "description": "The display name corresponding to the reference specified by\n`referenceId`, for example `chr1`, `1`, or `chrX`.", "type": "string" }, + "info": { + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + }, + "description": "A map of additional read alignment information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object" + }, "type": { "enumDescriptions": [ "", @@ -2516,83 +3166,32 @@ ], "description": "The data type for this annotation. Must match the containing annotation\nset's type.", "type": "string" - }, - "info": { - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - }, - "description": "A map of additional read alignment information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", - "type": "object" - }, - "end": { - "type": "string", - "description": "The end position of the range on the reference, 0-based exclusive.", - "format": "int64" - }, - "transcript": { - "$ref": "Transcript", - "description": "A transcript value represents the assertion that a particular region of\nthe reference genome may be transcribed as RNA. An alternative splicing\npattern would be represented as a separate transcript object. This field\nis only set for annotations of type `TRANSCRIPT`." - }, - "start": { - "description": "The start position of the range on the reference, 0-based inclusive.", - "format": "int64", - "type": "string" - }, - "annotationSetId": { - "description": "The annotation set to which this annotation belongs.", - "type": "string" - }, - "name": { - "description": "The display name of this annotation.", - "type": "string" - }, - "variant": { - "$ref": "VariantAnnotation", - "description": "A variant annotation, which describes the effect of a variant on the\ngenome, the coding sequence, and/or higher level consequences at the\norganism level e.g. pathogenicity. This field is only set for annotations\nof type `VARIANT`." - }, - "id": { - "description": "The server-generated annotation ID, unique across all annotations.", - "type": "string" - }, - "referenceId": { - "description": "The ID of the Google Genomics reference associated with this range.", - "type": "string" - }, - "reverseStrand": { - "description": "Whether this range refers to the reverse strand, as opposed to the forward\nstrand. Note that regardless of this field, the start/end position of the\nrange always refer to the forward strand.", - "type": "boolean" } }, "id": "Annotation" }, - "RuntimeMetadata": { - "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution.", - "type": "object", - "properties": { - "computeEngine": { - "description": "Execution information specific to Google Compute Engine.", - "$ref": "ComputeEngine" - } - }, - "id": "RuntimeMetadata" - }, "Operation": { "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw`", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, "metadata": { - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, "description": "An OperationMetadata object. This will always be returned with the Operation.", - "type": "object" + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } }, "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" }, "response": { @@ -2600,51 +3199,63 @@ "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an empty response is returned.", + "description": "If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an Empty response is returned.", "type": "object" - }, - "name": { - "description": "The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw`", - "type": "string" - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." } }, "id": "Operation" }, + "RuntimeMetadata": { + "id": "RuntimeMetadata", + "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution.", + "type": "object", + "properties": { + "computeEngine": { + "description": "Execution information specific to Google Compute Engine.", + "$ref": "ComputeEngine" + } + } + }, "ImportReadGroupSetsResponse": { "description": "The read group set import response.", "type": "object", "properties": { "readGroupSetIds": { "description": "IDs of the read group sets that were created.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "ImportReadGroupSetsResponse" }, "VariantCall": { + "id": "VariantCall", "description": "A call represents the determination of genotype with respect to a particular\nvariant. It may include associated information such as quality and phasing.\nFor example, a call might assign a probability of 0.32 to the occurrence of\na SNP named rs1234 in a call set with the name NA12345.", "type": "object", "properties": { + "genotype": { + "description": "The genotype of this variant call. Each value represents either the value\nof the `referenceBases` field or a 1-based index into\n`alternateBases`. If a variant had a `referenceBases`\nvalue of `T` and an `alternateBases`\nvalue of `[\"A\", \"C\"]`, and the `genotype` was\n`[2, 1]`, that would mean the call\nrepresented the heterozygous value `CA` for this variant.\nIf the `genotype` was instead `[0, 1]`, the\nrepresented value would be `TA`. Ordering of the\ngenotype values is important if the `phaseset` is present.\nIf a genotype is not called (that is, a `.` is present in the\nGT string) -1 is returned.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + }, "phaseset": { "description": "If this field is present, this variant call's genotype ordering implies\nthe phase of the bases and is consistent with any other variant calls in\nthe same reference sequence which have the same phaseset value.\nWhen importing data from VCF, if the genotype data was phased but no\nphase set was specified this field will be set to `*`.", "type": "string" }, "info": { + "description": "A map of additional variant call information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", "type": "object", "additionalProperties": { - "type": "array", "items": { "type": "any" - } - }, - "description": "A map of additional variant call information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values)." + }, + "type": "array" + } }, "callSetName": { "description": "The name of the call set this variant call belongs to.", @@ -2652,156 +3263,152 @@ }, "genotypeLikelihood": { "description": "The genotype likelihoods for this variant call. Each array entry\nrepresents how likely a specific genotype is for this call. The value\nordering is defined by the GL tag in the VCF spec.\nIf Phred-scaled genotype likelihood scores (PL) are available and\nlog10(P) genotype likelihood scores (GL) are not, PL scores are converted\nto GL scores. If both are available, PL scores are stored in `info`.", - "type": "array", "items": { "format": "double", "type": "number" - } + }, + "type": "array" }, "callSetId": { "description": "The ID of the call set this variant call belongs to.", "type": "string" - }, - "genotype": { - "description": "The genotype of this variant call. Each value represents either the value\nof the `referenceBases` field or a 1-based index into\n`alternateBases`. If a variant had a `referenceBases`\nvalue of `T` and an `alternateBases`\nvalue of `[\"A\", \"C\"]`, and the `genotype` was\n`[2, 1]`, that would mean the call\nrepresented the heterozygous value `CA` for this variant.\nIf the `genotype` was instead `[0, 1]`, the\nrepresented value would be `TA`. Ordering of the\ngenotype values is important if the `phaseset` is present.\nIf a genotype is not called (that is, a `.` is present in the\nGT string) -1 is returned.", - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } } - }, - "id": "VariantCall" + } }, "SearchVariantsResponse": { - "properties": { - "nextPageToken": { - "type": "string", - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results." - }, - "variants": { - "description": "The list of matching Variants.", - "type": "array", - "items": { - "$ref": "Variant" - } - } - }, "id": "SearchVariantsResponse", "description": "The variant search response.", - "type": "object" + "type": "object", + "properties": { + "variants": { + "description": "The list of matching Variants.", + "items": { + "$ref": "Variant" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" + } + } }, "ListBasesResponse": { + "id": "ListBasesResponse", "type": "object", "properties": { "sequence": { - "type": "string", - "description": "A substring of the bases that make up this reference." + "description": "A substring of the bases that make up this reference.", + "type": "string" }, "offset": { - "description": "The offset position (0-based) of the given `sequence` from the\nstart of this `Reference`. This value will differ for each page\nin a paginated request.", "format": "int64", + "description": "The offset position (0-based) of the given `sequence` from the\nstart of this `Reference`. This value will differ for each page\nin a paginated request.", "type": "string" }, "nextPageToken": { "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", "type": "string" } - }, - "id": "ListBasesResponse" + } }, "Status": { "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - } - }, "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client." + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": "array" } }, "id": "Status" }, "UndeleteDatasetRequest": { + "id": "UndeleteDatasetRequest", "type": "object", - "properties": {}, - "id": "UndeleteDatasetRequest" + "properties": {} }, "Binding": { + "id": "Binding", "description": "Associates `members` with a `role`.", "type": "object", "properties": { "members": { "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "role": { - "type": "string", - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired" + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" } - }, - "id": "Binding" + } }, "Range": { + "description": "A 0-based half-open genomic coordinate range for search requests.", + "type": "object", "properties": { - "start": { - "description": "The start position of the range on the reference, 0-based inclusive.", - "format": "int64", - "type": "string" - }, "end": { - "description": "The end position of the range on the reference, 0-based exclusive.", "format": "int64", + "description": "The end position of the range on the reference, 0-based exclusive.", "type": "string" }, "referenceName": { "description": "The reference sequence name, for example `chr1`,\n`1`, or `chrX`.", "type": "string" + }, + "start": { + "format": "int64", + "description": "The start position of the range on the reference, 0-based inclusive.", + "type": "string" } }, - "id": "Range", - "description": "A 0-based half-open genomic coordinate range for search requests.", - "type": "object" + "id": "Range" }, "VariantSet": { + "id": "VariantSet", "description": "A variant set is a collection of call sets and variants. It contains summary\nstatistics of those contents. A variant set belongs to a dataset.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", "type": "object", "properties": { + "name": { + "description": "User-specified, mutable name.", + "type": "string" + }, "referenceSetId": { "description": "The reference set to which the variant set is mapped. The reference set\ndescribes the alignment provenance of the variant set, while the\n`referenceBounds` describe the shape of the actual variant data. The\nreference set's reference names are a superset of those found in the\n`referenceBounds`.\n\nFor example, given a variant set that is mapped to the GRCh38 reference set\nand contains a single variant on reference 'X', `referenceBounds` would\ncontain only an entry for 'X', while the associated reference set\nenumerates all possible references: '1', '2', 'X', 'Y', 'MT', etc.", "type": "string" }, "metadata": { "description": "The metadata associated with this variant set.", - "type": "array", "items": { "$ref": "VariantSetMetadata" - } + }, + "type": "array" }, "referenceBounds": { "description": "A list of all references used by the variants in a variant set\nwith associated coordinate upper bounds for each one.", - "type": "array", "items": { "$ref": "ReferenceBound" - } + }, + "type": "array" }, "id": { "description": "The server-generated variant set ID, unique across all variant sets.", @@ -2812,28 +3419,23 @@ "type": "string" }, "datasetId": { - "type": "string", - "description": "The dataset to which this variant set belongs." - }, - "name": { - "type": "string", - "description": "User-specified, mutable name." + "description": "The dataset to which this variant set belongs.", + "type": "string" } - }, - "id": "VariantSet" + } }, "BatchCreateAnnotationsResponse": { + "id": "BatchCreateAnnotationsResponse", "type": "object", "properties": { "entries": { "description": "The resulting per-annotation entries, ordered consistently with the\noriginal request.", - "type": "array", "items": { "$ref": "Entry" - } + }, + "type": "array" } - }, - "id": "BatchCreateAnnotationsResponse" + } }, "ReferenceBound": { "id": "ReferenceBound", @@ -2841,8 +3443,8 @@ "type": "object", "properties": { "upperBound": { - "description": "An upper bound (inclusive) on the starting coordinate of any\nvariant in the reference sequence.", "format": "int64", + "description": "An upper bound (inclusive) on the starting coordinate of any\nvariant in the reference sequence.", "type": "string" }, "referenceName": { @@ -2851,151 +3453,130 @@ } } }, - "Variant": { - "description": "A variant represents a change in DNA sequence relative to a reference\nsequence. For example, a variant could represent a SNP or an insertion.\nVariants belong to a variant set.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nEach of the calls on a variant represent a determination of genotype with\nrespect to that variant. For example, a call might assign probability of 0.32\nto the occurrence of a SNP named rs1234 in a sample named NA12345. A call\nbelongs to a call set, which contains related calls typically from one\nsample.", - "type": "object", - "properties": { - "info": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - }, - "description": "A map of additional variant information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values)." - }, - "referenceBases": { - "description": "The reference bases for this variant. They start at the given\nposition.", - "type": "string" - }, - "alternateBases": { - "description": "The bases that appear instead of the reference bases.", - "type": "array", - "items": { - "type": "string" - } - }, - "names": { - "description": "Names for the variant, for example a RefSNP ID.", - "type": "array", - "items": { - "type": "string" - } - }, - "end": { - "description": "The end position (0-based) of this variant. This corresponds to the first\nbase after the last base in the reference allele. So, the length of\nthe reference allele is (end - start). This is useful for variants\nthat don't explicitly give alternate bases, for example large deletions.", - "format": "int64", - "type": "string" - }, - "filter": { - "description": "A list of filters (normally quality filters) this variant has failed.\n`PASS` indicates this variant has passed all filters.", - "type": "array", - "items": { - "type": "string" - } - }, - "calls": { - "description": "The variant calls for this particular variant. Each one represents the\ndetermination of genotype with respect to this variant.", - "type": "array", - "items": { - "$ref": "VariantCall" - } - }, - "created": { - "description": "The date this variant was created, in milliseconds from the epoch.", - "format": "int64", - "type": "string" - }, - "start": { - "description": "The position at which this variant occurs (0-based).\nThis corresponds to the first base of the string of reference bases.", - "format": "int64", - "type": "string" - }, - "quality": { - "description": "A measure of how likely this variant is to be real.\nA higher value is better.", - "format": "double", - "type": "number" - }, - "id": { - "description": "The server-generated variant ID, unique across all variants.", - "type": "string" - }, - "variantSetId": { - "description": "The ID of the variant set this variant belongs to.", - "type": "string" - }, - "referenceName": { - "type": "string", - "description": "The reference on which this variant occurs.\n(such as `chr20` or `X`)" - } - }, - "id": "Variant" - }, - "SearchCallSetsResponse": { - "id": "SearchCallSetsResponse", - "description": "The call set search response.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", - "type": "string" - }, - "callSets": { - "description": "The list of matching call sets.", - "type": "array", - "items": { - "$ref": "CallSet" - } - } - } - }, "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", "type": "object", "properties": { "operations": { "description": "A list of operations that matches the specified filter in the request.", - "type": "array", "items": { "$ref": "Operation" - } + }, + "type": "array" }, "nextPageToken": { "description": "The standard List next-page token.", "type": "string" } }, - "id": "ListOperationsResponse", - "description": "The response message for Operations.ListOperations." + "id": "ListOperationsResponse" + }, + "Variant": { + "id": "Variant", + "description": "A variant represents a change in DNA sequence relative to a reference\nsequence. For example, a variant could represent a SNP or an insertion.\nVariants belong to a variant set.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\nEach of the calls on a variant represent a determination of genotype with\nrespect to that variant. For example, a call might assign probability of 0.32\nto the occurrence of a SNP named rs1234 in a sample named NA12345. A call\nbelongs to a call set, which contains related calls typically from one\nsample.", + "type": "object", + "properties": { + "variantSetId": { + "description": "The ID of the variant set this variant belongs to.", + "type": "string" + }, + "referenceName": { + "description": "The reference on which this variant occurs.\n(such as `chr20` or `X`)", + "type": "string" + }, + "info": { + "additionalProperties": { + "items": { + "type": "any" + }, + "type": "array" + }, + "description": "A map of additional variant information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", + "type": "object" + }, + "referenceBases": { + "description": "The reference bases for this variant. They start at the given\nposition.", + "type": "string" + }, + "names": { + "description": "Names for the variant, for example a RefSNP ID.", + "items": { + "type": "string" + }, + "type": "array" + }, + "alternateBases": { + "description": "The bases that appear instead of the reference bases.", + "items": { + "type": "string" + }, + "type": "array" + }, + "end": { + "format": "int64", + "description": "The end position (0-based) of this variant. This corresponds to the first\nbase after the last base in the reference allele. So, the length of\nthe reference allele is (end - start). This is useful for variants\nthat don't explicitly give alternate bases, for example large deletions.", + "type": "string" + }, + "filter": { + "description": "A list of filters (normally quality filters) this variant has failed.\n`PASS` indicates this variant has passed all filters.", + "items": { + "type": "string" + }, + "type": "array" + }, + "calls": { + "description": "The variant calls for this particular variant. Each one represents the\ndetermination of genotype with respect to this variant.", + "items": { + "$ref": "VariantCall" + }, + "type": "array" + }, + "created": { + "format": "int64", + "description": "The date this variant was created, in milliseconds from the epoch.", + "type": "string" + }, + "start": { + "format": "int64", + "description": "The position at which this variant occurs (0-based).\nThis corresponds to the first base of the string of reference bases.", + "type": "string" + }, + "quality": { + "format": "double", + "description": "A measure of how likely this variant is to be real.\nA higher value is better.", + "type": "number" + }, + "id": { + "description": "The server-generated variant ID, unique across all variants.", + "type": "string" + } + } + }, + "SearchCallSetsResponse": { + "description": "The call set search response.", + "type": "object", + "properties": { + "callSets": { + "description": "The list of matching call sets.", + "items": { + "$ref": "CallSet" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", + "type": "string" + } + }, + "id": "SearchCallSetsResponse" }, "OperationMetadata": { "description": "Metadata describing an Operation.", "type": "object", "properties": { - "startTime": { - "description": "The time at which the job began to run.", - "format": "google-datetime", - "type": "string" - }, - "request": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "The original request that started the operation. Note that this will be in\ncurrent version of the API. If the operation was started with v1beta2 API\nand a GetOperation is performed on v1 API, a v1 request will be returned.", - "type": "object" - }, - "runtimeMetadata": { - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "description": "Runtime metadata on this Operation.", - "type": "object" - }, "createTime": { - "description": "The time at which the job was submitted to the Genomics service.", "format": "google-datetime", + "description": "The time at which the job was submitted to the Genomics service.", "type": "string" }, "labels": { @@ -3013,17 +3594,38 @@ "description": "This field is deprecated. Use `labels` instead. Optionally provided by the\ncaller when submitting the request that creates the operation.", "type": "string" }, + "endTime": { + "format": "google-datetime", + "description": "The time at which the job stopped running.", + "type": "string" + }, "events": { "description": "Optional event messages that were generated during the job's execution.\nThis also contains any warnings that were generated during import\nor export.", - "type": "array", "items": { "$ref": "OperationEvent" - } + }, + "type": "array" }, - "endTime": { - "type": "string", - "description": "The time at which the job stopped running.", - "format": "google-datetime" + "startTime": { + "format": "google-datetime", + "description": "The time at which the job began to run.", + "type": "string" + }, + "request": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The original request that started the operation. Note that this will be in\ncurrent version of the API. If the operation was started with v1beta2 API\nand a GetOperation is performed on v1 API, a v1 request will be returned.", + "type": "object" + }, + "runtimeMetadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Runtime metadata on this Operation.", + "type": "object" } }, "id": "OperationMetadata" @@ -3032,50 +3634,50 @@ "description": "The variant search request.", "type": "object", "properties": { - "referenceName": { - "description": "Required. Only return variants in this reference sequence.", - "type": "string" - }, - "variantSetIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "At most one variant set ID must be provided. Only variants from this\nvariant set will be returned. If omitted, a call set id must be included in\nthe request." - }, - "end": { - "description": "The end of the window, 0-based exclusive. If unspecified or 0, defaults to\nthe length of the reference.", - "format": "int64", - "type": "string" + "maxCalls": { + "format": "int32", + "description": "The maximum number of calls to return in a single page. Note that this\nlimit may be exceeded in the event that a matching variant contains more\ncalls than the requested maximum. If unspecified, defaults to 5000. The\nmaximum value is 10000.", + "type": "integer" }, "pageToken": { "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", "type": "string" }, - "maxCalls": { - "description": "The maximum number of calls to return in a single page. Note that this\nlimit may be exceeded in the event that a matching variant contains more\ncalls than the requested maximum. If unspecified, defaults to 5000. The\nmaximum value is 10000.", - "format": "int32", - "type": "integer" - }, "pageSize": { - "description": "The maximum number of variants to return in a single page. If unspecified,\ndefaults to 5000. The maximum value is 10000.", "format": "int32", + "description": "The maximum number of variants to return in a single page. If unspecified,\ndefaults to 5000. The maximum value is 10000.", "type": "integer" }, "callSetIds": { "description": "Only return variant calls which belong to call sets with these ids.\nLeaving this blank returns all variant calls. If a variant has no\ncalls belonging to any of these call sets, it won't be returned at all.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "variantName": { "description": "Only return variants which have exactly this name.", "type": "string" }, "start": { - "description": "The beginning of the window (0-based, inclusive) for which\noverlapping variants should be returned. If unspecified, defaults to 0.", "format": "int64", + "description": "The beginning of the window (0-based, inclusive) for which\noverlapping variants should be returned. If unspecified, defaults to 0.", + "type": "string" + }, + "referenceName": { + "description": "Required. Only return variants in this reference sequence.", + "type": "string" + }, + "variantSetIds": { + "description": "At most one variant set ID must be provided. Only variants from this\nvariant set will be returned. If omitted, a call set id must be included in\nthe request.", + "items": { + "type": "string" + }, + "type": "array" + }, + "end": { + "format": "int64", + "description": "The end of the window, 0-based exclusive. If unspecified or 0, defaults to\nthe length of the reference.", "type": "string" } }, @@ -3086,732 +3688,130 @@ "description": "The read group set search request.", "type": "object", "properties": { - "name": { - "description": "Only return read group sets for which a substring of the name matches this\nstring.", - "type": "string" - }, "pageToken": { "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", "type": "string" }, + "name": { + "description": "Only return read group sets for which a substring of the name matches this\nstring.", + "type": "string" + }, "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 1024.", "format": "int32", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 1024.", "type": "integer" }, "datasetIds": { "description": "Restricts this query to read group sets within the given datasets. At least\none ID must be provided.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } } }, "SearchAnnotationsResponse": { + "id": "SearchAnnotationsResponse", "type": "object", "properties": { - "nextPageToken": { - "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", - "type": "string" - }, "annotations": { - "type": "array", + "description": "The matching annotations.", "items": { "$ref": "Annotation" }, - "description": "The matching annotations." - } - }, - "id": "SearchAnnotationsResponse" - }, - "SearchReadsResponse": { - "description": "The read search response.", - "type": "object", - "properties": { - "alignments": { - "description": "The list of matching alignments sorted by mapped genomic coordinate,\nif any, ascending in position within the same reference. Unmapped reads,\nwhich have no position, are returned contiguously and are sorted in\nascending lexicographic order by fragment name.", - "type": "array", - "items": { - "$ref": "Read" - } + "type": "array" }, "nextPageToken": { "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", "type": "string" } - }, - "id": "SearchReadsResponse" + } }, "ClinicalCondition": { "type": "object", "properties": { + "names": { + "description": "A set of names for the condition.", + "items": { + "type": "string" + }, + "type": "array" + }, "omimId": { "description": "The OMIM id for this condition.\nSearch for these IDs at http://omim.org/", "type": "string" }, "externalIds": { "description": "The set of external IDs for this condition.", - "type": "array", "items": { "$ref": "ExternalId" - } + }, + "type": "array" }, "conceptId": { "description": "The MedGen concept id associated with this gene.\nSearch for these IDs at http://www.ncbi.nlm.nih.gov/medgen/", "type": "string" - }, - "names": { - "description": "A set of names for the condition.", - "type": "array", - "items": { - "type": "string" - } } }, "id": "ClinicalCondition" }, - "Program": { + "SearchReadsResponse": { + "description": "The read search response.", "type": "object", "properties": { - "name": { - "description": "The display name of the program. This is typically the colloquial name of\nthe tool used, for example 'bwa' or 'picard'.", - "type": "string" - }, - "commandLine": { - "type": "string", - "description": "The command line used to run this program." - }, - "prevProgramId": { - "description": "The ID of the program run before this one.", - "type": "string" - }, - "id": { - "description": "The user specified locally unique ID of the program. Used along with\n`prevProgramId` to define an ordering between programs.", - "type": "string" - }, - "version": { - "description": "The version of the program run.", - "type": "string" - } - }, - "id": "Program" - }, - "CoverageBucket": { - "description": "A bucket over which read coverage has been precomputed. A bucket corresponds\nto a specific range of the reference sequence.", - "type": "object", - "properties": { - "meanCoverage": { - "description": "The average number of reads which are aligned to each individual\nreference base in this bucket.", - "format": "float", - "type": "number" - }, - "range": { - "description": "The genomic coordinate range spanned by this bucket.", - "$ref": "Range" - } - }, - "id": "CoverageBucket" - }, - "ComputeEngine": { - "description": "Describes a Compute Engine resource that is being managed by a running\npipeline.", - "type": "object", - "properties": { - "machineType": { - "description": "The machine type of the instance.", - "type": "string" - }, - "diskNames": { - "description": "The names of the disks that were created for this pipeline.", - "type": "array", - "items": { - "type": "string" - } - }, - "instanceName": { - "description": "The instance on which the operation is running.", - "type": "string" - }, - "zone": { - "description": "The availability zone in which the instance resides.", - "type": "string" - } - }, - "id": "ComputeEngine" - }, - "ExternalId": { - "properties": { - "id": { - "type": "string", - "description": "The id used by the source of this data." - }, - "sourceName": { - "description": "The name of the source of this data.", - "type": "string" - } - }, - "id": "ExternalId", - "type": "object" - }, - "Reference": { - "description": "A reference is a canonical assembled DNA sequence, intended to act as a\nreference coordinate space for other genomic annotations. A single reference\nmight represent the human chromosome 1 or mitochandrial DNA, for instance. A\nreference belongs to one or more reference sets.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)", - "type": "object", - "properties": { - "ncbiTaxonId": { - "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human.", - "format": "int32", - "type": "integer" - }, - "sourceUri": { - "description": "The URI from which the sequence was obtained. Typically specifies a FASTA\nformat file.", - "type": "string" - }, - "name": { - "description": "The name of this reference, for example `22`.", - "type": "string" - }, - "md5checksum": { - "description": "MD5 of the upper-case sequence excluding all whitespace characters (this\nis equivalent to SQ:M5 in SAM). This value is represented in lower case\nhexadecimal format.", - "type": "string" - }, - "id": { - "description": "The server-generated reference ID, unique across all references.", - "type": "string" - }, - "length": { - "description": "The length of this reference's sequence.", - "format": "int64", - "type": "string" - }, - "sourceAccessions": { - "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally\nwith a version number, for example `GCF_000001405.26`.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "Reference" - }, - "VariantSetMetadata": { - "description": "Metadata describes a single piece of variant call metadata.\nThese data include a top level key and either a single value string (value)\nor a list of key-value pairs (info.)\nValue and info are mutually exclusive.", - "type": "object", - "properties": { - "description": { - "description": "A textual description of this metadata.", - "type": "string" - }, - "info": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - }, - "description": "Remaining structured metadata key-value pairs. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values)." - }, - "type": { - "description": "The type of data. Possible types include: Integer, Float,\nFlag, Character, and String.", - "type": "string", - "enumDescriptions": [ - "", - "", - "", - "", - "", - "" - ], - "enum": [ - "TYPE_UNSPECIFIED", - "INTEGER", - "FLOAT", - "FLAG", - "CHARACTER", - "STRING" - ] - }, - "number": { - "description": "The number of values that can be included in a field described by this\nmetadata.", - "type": "string" - }, - "id": { - "description": "User-provided ID field, not enforced by this API.\nTwo or more pieces of structured metadata with identical\nid and key fields are considered equivalent.", - "type": "string" - }, - "value": { - "description": "The value field for simple metadata", - "type": "string" - }, - "key": { - "type": "string", - "description": "The top-level key." - } - }, - "id": "VariantSetMetadata" - }, - "SearchVariantSetsRequest": { - "description": "The search variant sets request.", - "type": "object", - "properties": { - "datasetIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Exactly one dataset ID must be provided here. Only variant sets which\nbelong to this dataset will be returned." - }, - "pageToken": { - "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", - "type": "string" - }, - "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", - "format": "int32", - "type": "integer" - } - }, - "id": "SearchVariantSetsRequest" - }, - "SearchReferenceSetsRequest": { - "id": "SearchReferenceSetsRequest", - "type": "object", - "properties": { - "accessions": { - "description": "If present, return reference sets for which a prefix of any of\nsourceAccessions\nmatch any of these strings. Accession numbers typically have a main number\nand a version, for example `NC_000001.11`.", - "type": "array", - "items": { - "type": "string" - } - }, - "pageToken": { - "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.", - "type": "string" - }, - "pageSize": { - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 4096.", - "format": "int32", - "type": "integer" - }, - "assemblyId": { - "description": "If present, return reference sets for which a substring of their\n`assemblyId` matches this string (case insensitive).", - "type": "string" - }, - "md5checksums": { - "description": "If present, return reference sets for which the\nmd5checksum matches exactly.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "SetIamPolicyRequest": { - "description": "Request message for `SetIamPolicy` method.", - "type": "object", - "properties": { - "policy": { - "$ref": "Policy", - "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." - } - }, - "id": "SetIamPolicyRequest" - }, - "MergeVariantsRequest": { - "type": "object", - "properties": { - "variants": { - "description": "The variants to be merged with existing variants.", - "type": "array", - "items": { - "$ref": "Variant" - } - }, - "infoMergeConfig": { - "description": "A mapping between info field keys and the InfoMergeOperations to\nbe performed on them.", - "type": "object", - "additionalProperties": { - "enum": [ - "INFO_MERGE_OPERATION_UNSPECIFIED", - "IGNORE_NEW", - "MOVE_TO_CALLS" - ], - "type": "string" - } - }, - "variantSetId": { - "description": "The destination variant set.", - "type": "string" - } - }, - "id": "MergeVariantsRequest" - }, - "BatchCreateAnnotationsRequest": { - "type": "object", - "properties": { - "requestId": { - "description": "A unique request ID which enables the server to detect duplicated requests.\nIf provided, duplicated requests will result in the same response; if not\nprovided, duplicated requests may result in duplicated data. For a given\nannotation set, callers should not reuse `request_id`s when writing\ndifferent batches of annotations - behavior in this case is undefined.\nA common approach is to use a UUID. For batch jobs where worker crashes are\na possibility, consider using some unique variant of a worker or run ID.", - "type": "string" - }, - "annotations": { - "description": "The annotations to be created. At most 4096 can be specified in a single\nrequest.", - "type": "array", - "items": { - "$ref": "Annotation" - } - } - }, - "id": "BatchCreateAnnotationsRequest" - }, - "Read": { - "description": "A read alignment describes a linear alignment of a string of DNA to a\nreference sequence, in addition to metadata\nabout the fragment (the molecule of DNA sequenced) and the read (the bases\nwhich were read by the sequencer). A read is equivalent to a line in a SAM\nfile. A read belongs to exactly one read group and exactly one\nread group set.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)\n\n### Reverse-stranded reads\n\nMapped reads (reads having a non-null `alignment`) can be aligned to either\nthe forward or the reverse strand of their associated reference. Strandedness\nof a mapped read is encoded by `alignment.position.reverseStrand`.\n\nIf we consider the reference to be a forward-stranded coordinate space of\n`[0, reference.length)` with `0` as the left-most position and\n`reference.length` as the right-most position, reads are always aligned left\nto right. That is, `alignment.position.position` always refers to the\nleft-most reference coordinate and `alignment.cigar` describes the alignment\nof this read to the reference from left to right. All per-base fields such as\n`alignedSequence` and `alignedQuality` share this same left-to-right\norientation; this is true of reads which are aligned to either strand. For\nreverse-stranded reads, this means that `alignedSequence` is the reverse\ncomplement of the bases that were originally reported by the sequencing\nmachine.\n\n### Generating a reference-aligned sequence string\n\nWhen interacting with mapped reads, it's often useful to produce a string\nrepresenting the local alignment of the read to reference. The following\npseudocode demonstrates one way of doing this:\n\n out = \"\"\n offset = 0\n for c in read.alignment.cigar {\n switch c.operation {\n case \"ALIGNMENT_MATCH\", \"SEQUENCE_MATCH\", \"SEQUENCE_MISMATCH\":\n out += read.alignedSequence[offset:offset+c.operationLength]\n offset += c.operationLength\n break\n case \"CLIP_SOFT\", \"INSERT\":\n offset += c.operationLength\n break\n case \"PAD\":\n out += repeat(\"*\", c.operationLength)\n break\n case \"DELETE\":\n out += repeat(\"-\", c.operationLength)\n break\n case \"SKIP\":\n out += repeat(\" \", c.operationLength)\n break\n case \"CLIP_HARD\":\n break\n }\n }\n return out\n\n### Converting to SAM's CIGAR string\n\nThe following pseudocode generates a SAM CIGAR string from the\n`cigar` field. Note that this is a lossy conversion\n(`cigar.referenceSequence` is lost).\n\n cigarMap = {\n \"ALIGNMENT_MATCH\": \"M\",\n \"INSERT\": \"I\",\n \"DELETE\": \"D\",\n \"SKIP\": \"N\",\n \"CLIP_SOFT\": \"S\",\n \"CLIP_HARD\": \"H\",\n \"PAD\": \"P\",\n \"SEQUENCE_MATCH\": \"=\",\n \"SEQUENCE_MISMATCH\": \"X\",\n }\n cigarStr = \"\"\n for c in read.alignment.cigar {\n cigarStr += c.operationLength + cigarMap[c.operation]\n }\n return cigarStr", - "type": "object", - "properties": { - "readGroupSetId": { - "description": "The ID of the read group set this read belongs to. A read belongs to\nexactly one read group set.", - "type": "string" - }, - "duplicateFragment": { - "description": "The fragment is a PCR or optical duplicate (SAM flag 0x400).", - "type": "boolean" - }, - "readNumber": { - "description": "The read number in sequencing. 0-based and less than numberReads. This\nfield replaces SAM flag 0x40 and 0x80.", - "format": "int32", - "type": "integer" - }, - "readGroupId": { - "description": "The ID of the read group this read belongs to. A read belongs to exactly\none read group. This is a server-generated ID which is distinct from SAM's\nRG tag (for that value, see\nReadGroup.name).", - "type": "string" - }, - "alignedSequence": { - "description": "The bases of the read sequence contained in this alignment record,\n**without CIGAR operations applied** (equivalent to SEQ in SAM).\n`alignedSequence` and `alignedQuality` may be\nshorter than the full read sequence and quality. This will occur if the\nalignment is part of a chimeric alignment, or if the read was trimmed. When\nthis occurs, the CIGAR for this read will begin/end with a hard clip\noperator that will indicate the length of the excised sequence.", - "type": "string" - }, - "info": { - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - }, - "description": "A map of additional read alignment information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", - "type": "object" - }, - "nextMatePosition": { - "$ref": "Position", - "description": "The mapping of the primary alignment of the\n`(readNumber+1)%numberReads` read in the fragment. It replaces\nmate position and mate strand in SAM." - }, - "supplementaryAlignment": { - "type": "boolean", - "description": "Whether this alignment is supplementary. Equivalent to SAM flag 0x800.\nSupplementary alignments are used in the representation of a chimeric\nalignment. In a chimeric alignment, a read is split into multiple\nlinear alignments that map to different reference contigs. The first\nlinear alignment in the read will be designated as the representative\nalignment; the remaining linear alignments will be designated as\nsupplementary alignments. These alignments may have different mapping\nquality scores. In each linear alignment in a chimeric alignment, the read\nwill be hard clipped. The `alignedSequence` and\n`alignedQuality` fields in the alignment record will only\nrepresent the bases for its respective linear alignment." - }, - "properPlacement": { - "description": "The orientation and the distance between reads from the fragment are\nconsistent with the sequencing protocol (SAM flag 0x2).", - "type": "boolean" - }, - "fragmentLength": { - "description": "The observed length of the fragment, equivalent to TLEN in SAM.", - "format": "int32", - "type": "integer" - }, - "failedVendorQualityChecks": { - "description": "Whether this read did not pass filters, such as platform or vendor quality\ncontrols (SAM flag 0x200).", - "type": "boolean" - }, - "alignedQuality": { - "description": "The quality of the read sequence contained in this alignment record\n(equivalent to QUAL in SAM).\n`alignedSequence` and `alignedQuality` may be shorter than the full read\nsequence and quality. This will occur if the alignment is part of a\nchimeric alignment, or if the read was trimmed. When this occurs, the CIGAR\nfor this read will begin/end with a hard clip operator that will indicate\nthe length of the excised sequence.", - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "alignment": { - "description": "The linear alignment for this alignment record. This field is null for\nunmapped reads.", - "$ref": "LinearAlignment" - }, - "numberReads": { - "type": "integer", - "description": "The number of reads in the fragment (extension to SAM flag 0x1).", - "format": "int32" - }, - "id": { - "description": "The server-generated read ID, unique across all reads. This is different\nfrom the `fragmentName`.", - "type": "string" - }, - "secondaryAlignment": { - "type": "boolean", - "description": "Whether this alignment is secondary. Equivalent to SAM flag 0x100.\nA secondary alignment represents an alternative to the primary alignment\nfor this read. Aligners may return secondary alignments if a read can map\nambiguously to multiple coordinates in the genome. By convention, each read\nhas one and only one alignment where both `secondaryAlignment`\nand `supplementaryAlignment` are false." - }, - "fragmentName": { - "description": "The fragment name. Equivalent to QNAME (query template name) in SAM.", - "type": "string" - } - }, - "id": "Read" - }, - "ReferenceSet": { - "type": "object", - "properties": { - "assemblyId": { - "description": "Public id of this reference set, such as `GRCh37`.", - "type": "string" - }, - "md5checksum": { - "description": "Order-independent MD5 checksum which identifies this reference set. The\nchecksum is computed by sorting all lower case hexidecimal string\n`reference.md5checksum` (for all reference in this set) in\nascending lexicographic order, concatenating, and taking the MD5 of that\nvalue. The resulting value is represented in lower case hexadecimal format.", - "type": "string" - }, - "id": { - "description": "The server-generated reference set ID, unique across all reference sets.", - "type": "string" - }, - "sourceAccessions": { - "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally\nwith a version number, for example `NC_000001.11`.", - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "description": "Free text description of this reference set.", - "type": "string" - }, - "ncbiTaxonId": { - "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human)\nindicating the species which this reference set is intended to model. Note\nthat contained references may specify a different `ncbiTaxonId`, as\nassemblies may contain reference sequences which do not belong to the\nmodeled species, for example EBV in a human reference genome.", - "format": "int32", - "type": "integer" - }, - "sourceUri": { - "description": "The URI from which the references were obtained.", - "type": "string" - }, - "referenceIds": { - "description": "The IDs of the reference objects that are part of this set.\n`Reference.md5checksum` must be unique within this set.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "ReferenceSet", - "description": "A reference set is a set of references which typically comprise a reference\nassembly for a species, such as `GRCh38` which is representative\nof the human genome. A reference set defines a common coordinate space for\ncomparing reference-aligned experimental data. A reference set contains 1 or\nmore references.\n\nFor more genomics resource definitions, see [Fundamentals of Google\nGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)" - }, - "CigarUnit": { - "description": "A single CIGAR operation.", - "type": "object", - "properties": { - "operation": { - "enumDescriptions": [ - "", - "An alignment match indicates that a sequence can be aligned to the\nreference without evidence of an INDEL. Unlike the\n`SEQUENCE_MATCH` and `SEQUENCE_MISMATCH` operators,\nthe `ALIGNMENT_MATCH` operator does not indicate whether the\nreference and read sequences are an exact match. This operator is\nequivalent to SAM's `M`.", - "The insert operator indicates that the read contains evidence of bases\nbeing inserted into the reference. This operator is equivalent to SAM's\n`I`.", - "The delete operator indicates that the read contains evidence of bases\nbeing deleted from the reference. This operator is equivalent to SAM's\n`D`.", - "The skip operator indicates that this read skips a long segment of the\nreference, but the bases have not been deleted. This operator is commonly\nused when working with RNA-seq data, where reads may skip long segments\nof the reference between exons. This operator is equivalent to SAM's\n`N`.", - "The soft clip operator indicates that bases at the start/end of a read\nhave not been considered during alignment. This may occur if the majority\nof a read maps, except for low quality bases at the start/end of a read.\nThis operator is equivalent to SAM's `S`. Bases that are soft\nclipped will still be stored in the read.", - "The hard clip operator indicates that bases at the start/end of a read\nhave been omitted from this alignment. This may occur if this linear\nalignment is part of a chimeric alignment, or if the read has been\ntrimmed (for example, during error correction or to trim poly-A tails for\nRNA-seq). This operator is equivalent to SAM's `H`.", - "The pad operator indicates that there is padding in an alignment. This\noperator is equivalent to SAM's `P`.", - "This operator indicates that this portion of the aligned sequence exactly\nmatches the reference. This operator is equivalent to SAM's `=`.", - "This operator indicates that this portion of the aligned sequence is an\nalignment match to the reference, but a sequence mismatch. This can\nindicate a SNP or a read error. This operator is equivalent to SAM's\n`X`." - ], - "enum": [ - "OPERATION_UNSPECIFIED", - "ALIGNMENT_MATCH", - "INSERT", - "DELETE", - "SKIP", - "CLIP_SOFT", - "CLIP_HARD", - "PAD", - "SEQUENCE_MATCH", - "SEQUENCE_MISMATCH" - ], - "type": "string" - }, - "referenceSequence": { - "description": "`referenceSequence` is only used at mismatches\n(`SEQUENCE_MISMATCH`) and deletions (`DELETE`).\nFilling this field replaces SAM's MD tag. If the relevant information is\nnot available, this field is unset.", - "type": "string" - }, - "operationLength": { - "description": "The number of genomic bases that the operation runs for. Required.", - "format": "int64", - "type": "string" - } - }, - "id": "CigarUnit" - }, - "AnnotationSet": { - "id": "AnnotationSet", - "description": "An annotation set is a logical grouping of annotations that share consistent\ntype information and provenance. Examples of annotation sets include 'all\ngenes from refseq', and 'all variant annotations from ClinVar'.", - "type": "object", - "properties": { - "id": { - "description": "The server-generated annotation set ID, unique across all annotation sets.", - "type": "string" - }, - "datasetId": { - "description": "The dataset to which this annotation set belongs.", - "type": "string" - }, - "sourceUri": { - "description": "The source URI describing the file from which this annotation set was\ngenerated, if any.", - "type": "string" - }, - "name": { - "description": "The display name for this annotation set.", - "type": "string" - }, - "referenceSetId": { - "description": "The ID of the reference set that defines the coordinate space for this\nset's annotations.", - "type": "string" - }, - "type": { - "enumDescriptions": [ - "", - "A `GENERIC` annotation type should be used when no other annotation\ntype will suffice. This represents an untyped annotation of the reference\ngenome.", - "A `VARIANT` annotation type.", - "A `GENE` annotation type represents the existence of a gene at the\nassociated reference coordinates. The start coordinate is typically the\ngene's transcription start site and the end is typically the end of the\ngene's last exon.", - "A `TRANSCRIPT` annotation type represents the assertion that a\nparticular region of the reference genome may be transcribed as RNA." - ], - "enum": [ - "ANNOTATION_TYPE_UNSPECIFIED", - "GENERIC", - "VARIANT", - "GENE", - "TRANSCRIPT" - ], - "description": "The type of annotations contained within this set.", - "type": "string" - }, - "info": { - "additionalProperties": { - "type": "array", - "items": { - "type": "any" - } - }, - "description": "A map of additional read alignment information. This must be of the form\nmap\u003cstring, string[]\u003e (string key mapping to a list of string values).", - "type": "object" - } - } - }, - "Transcript": { - "properties": { - "exons": { - "description": "The \u003ca href=\"http://en.wikipedia.org/wiki/Exon\"\u003eexons\u003c/a\u003e that compose\nthis transcript. This field should be unset for genomes where transcript\nsplicing does not occur, for example prokaryotes.\n\nIntrons are regions of the transcript that are not included in the\nspliced RNA product. Though not explicitly modeled here, intron ranges can\nbe deduced; all regions of this transcript that are not exons are introns.\n\nExonic sequences do not necessarily code for a translational product\n(amino acids). Only the regions of exons bounded by the\ncodingSequence correspond\nto coding DNA sequence.\n\nExons are ordered by start position and may not overlap.", - "type": "array", - "items": { - "$ref": "Exon" - } - }, - "codingSequence": { - "$ref": "CodingSequence", - "description": "The range of the coding sequence for this transcript, if any. To determine\nthe exact ranges of coding sequence, intersect this range with those of the\nexons, if any. If there are any\nexons, the\ncodingSequence must start\nand end within them.\n\nNote that in some cases, the reference genome will not exactly match the\nobserved mRNA transcript e.g. due to variance in the source genome from\nreference. In these cases,\nexon.frame will not necessarily\nmatch the expected reference reading frame and coding exon reference bases\ncannot necessarily be concatenated to produce the original transcript mRNA." - }, - "geneId": { - "description": "The annotation ID of the gene from which this transcript is transcribed.", - "type": "string" - } - }, - "id": "Transcript", - "description": "A transcript represents the assertion that a particular region of the\nreference genome may be transcribed as RNA.", - "type": "object" - }, - "Experiment": { - "properties": { - "sequencingCenter": { - "description": "The sequencing center used as part of this experiment.", - "type": "string" - }, - "platformUnit": { - "description": "The platform unit used as part of this experiment, for example\nflowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the\n@RG PU field in the SAM spec.", - "type": "string" - }, - "libraryId": { - "description": "A client-supplied library identifier; a library is a collection of DNA\nfragments which have been prepared for sequencing from a sample. This\nfield is important for quality control as error or bias can be introduced\nduring sample preparation.", - "type": "string" - }, - "instrumentModel": { - "description": "The instrument model used as part of this experiment. This maps to\nsequencing technology in the SAM spec.", - "type": "string" - } - }, - "id": "Experiment", - "type": "object" - }, - "ListDatasetsResponse": { - "description": "The dataset list response.", - "type": "object", - "properties": { - "datasets": { - "description": "The list of matching Datasets.", - "type": "array", - "items": { - "$ref": "Dataset" - } - }, "nextPageToken": { "description": "The continuation token, which is used to page through large result sets.\nProvide this value in a subsequent request to return the next page of\nresults. This field will be empty if there aren't any additional results.", "type": "string" - } - }, - "id": "ListDatasetsResponse" - }, - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "type": "array", + }, + "alignments": { + "description": "The list of matching alignments sorted by mapped genomic coordinate,\nif any, ascending in position within the same reference. Unmapped reads,\nwhich have no position, are returned contiguously and are sorted in\nascending lexicographic order by fragment name.", "items": { - "type": "string" + "$ref": "Read" }, - "description": "REQUIRED: The set of permissions to check for the 'resource'.\nPermissions with wildcards (such as '*' or 'storage.*') are not allowed.\nAllowed permissions are:\n\n* `genomics.datasets.create`\n* `genomics.datasets.delete`\n* `genomics.datasets.get`\n* `genomics.datasets.list`\n* `genomics.datasets.update`\n* `genomics.datasets.getIamPolicy`\n* `genomics.datasets.setIamPolicy`" + "type": "array" } }, - "id": "TestIamPermissionsRequest" + "id": "SearchReadsResponse" } }, - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, "version": "v1", "baseUrl": "https://genomics.googleapis.com/", "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/genomics": { - "description": "View and manage Genomics data" + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" }, "https://www.googleapis.com/auth/bigquery": { "description": "View and manage your data in Google BigQuery" }, - "https://www.googleapis.com/auth/devstorage.read_write": { - "description": "Manage your data in Google Cloud Storage" + "https://www.googleapis.com/auth/genomics.readonly": { + "description": "View Genomics data" }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" }, - "https://www.googleapis.com/auth/genomics.readonly": { - "description": "View Genomics data" + "https://www.googleapis.com/auth/genomics": { + "description": "View and manage Genomics data" } } } }, - "kind": "discovery#restDescription", "description": "Upload, process, query, and search Genomics data in the cloud.", + "kind": "discovery#restDescription", "servicePath": "", "rootUrl": "https://genomics.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "genomics", "batchPath": "batch", + "revision": "20170925", "documentationLink": "https://cloud.google.com/genomics", "id": "genomics:v1", - "revision": "20170520", - "title": "Genomics API", - "ownerName": "Google", - "discoveryVersion": "v1" + "title": "Genomics API" } diff --git a/etc/api/genomics/v1alpha2/genomics-api.json b/etc/api/genomics/v1alpha2/genomics-api.json index cc107e1351..55d6926d98 100644 --- a/etc/api/genomics/v1alpha2/genomics-api.json +++ b/etc/api/genomics/v1alpha2/genomics-api.json @@ -1,61 +1,168 @@ { + "rootUrl": "https://genomics.googleapis.com/", + "basePath": "", "ownerDomain": "google.com", "name": "genomics", "batchPath": "batch", - "id": "genomics:v1alpha2", + "revision": "20170925", "documentationLink": "https://cloud.google.com/genomics", - "revision": "20170520", + "id": "genomics:v1alpha2", "title": "Genomics API", "ownerName": "Google", "discoveryVersion": "v1", "resources": { - "pipelines": { + "operations": { "methods": { - "setOperationStatus": { - "request": { - "$ref": "SetOperationStatusRequest" - }, - "description": "Sets status of a given operation. Any new timestamps (as determined by\ndescription) are appended to TimestampEvents. Should only be called by VMs\ncreated by the Pipelines Service and not by end users.", - "httpMethod": "PUT", - "parameterOrder": [], + "cancel": { "response": { "$ref": "Empty" }, - "parameters": {}, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], - "flatPath": "v1alpha2/pipelines:setOperationStatus", - "id": "genomics.pipelines.setOperationStatus", - "path": "v1alpha2/pipelines:setOperationStatus" + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "type": "string", + "required": true, + "pattern": "^operations/.+$" + } + }, + "flatPath": "v1alpha2/operations/{operationsId}:cancel", + "id": "genomics.operations.cancel", + "path": "v1alpha2/{+name}:cancel", + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation." }, - "delete": { - "flatPath": "v1alpha2/pipelines/{pipelineId}", - "id": "genomics.pipelines.delete", - "path": "v1alpha2/pipelines/{pipelineId}", - "description": "Deletes a pipeline based on ID.\n\nCaller must have WRITE permission to the project.", - "httpMethod": "DELETE", + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "httpMethod": "GET", "parameterOrder": [ - "pipelineId" + "name" ], "response": { - "$ref": "Empty" + "$ref": "Operation" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], "parameters": { - "pipelineId": { - "required": true, + "name": { "type": "string", + "required": true, + "pattern": "^operations/.+$", "location": "path", - "description": "Caller must have WRITE access to the project in which this pipeline\nis defined." + "description": "The name of the operation resource." + } + }, + "flatPath": "v1alpha2/operations/{operationsId}", + "path": "v1alpha2/{+name}", + "id": "genomics.operations.get" + }, + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "location": "query", + "description": "A string for filtering Operations.\nThe following filter fields are supported:\n\n* projectId: Required. Corresponds to\n OperationMetadata.projectId.\n* createTime: The time this job was created, in seconds from the\n [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `\u003c=`\n operators.\n* status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only\n one status may be specified.\n* labels.key where key is a label key.\n\nExamples:\n\n* `projectId = my-project AND createTime \u003e= 1432140000`\n* `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`\n* `projectId = my-project AND labels.color = *`\n* `projectId = my-project AND labels.color = red`", + "type": "string" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "The standard list page token." + }, + "name": { + "type": "string", + "required": true, + "pattern": "^operations$", + "location": "path", + "description": "The name of the operation's parent resource." + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "The maximum number of results to return. If unspecified, defaults to\n256. The maximum value is 2048." } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" - ] + ], + "flatPath": "v1alpha2/operations", + "id": "genomics.operations.list", + "path": "v1alpha2/{+name}", + "description": "Lists operations that match the specified filter in the request." + } + } + }, + "pipelines": { + "methods": { + "setOperationStatus": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1alpha2/pipelines:setOperationStatus", + "id": "genomics.pipelines.setOperationStatus", + "path": "v1alpha2/pipelines:setOperationStatus", + "request": { + "$ref": "SetOperationStatusRequest" + }, + "description": "Sets status of a given operation. Any new timestamps (as determined by\ndescription) are appended to TimestampEvents. Should only be called by VMs\ncreated by the Pipelines Service and not by end users." + }, + "delete": { + "description": "Deletes a pipeline based on ID.\n\nCaller must have WRITE permission to the project.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "pipelineId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "pipelineId": { + "type": "string", + "required": true, + "location": "path", + "description": "Caller must have WRITE access to the project in which this pipeline\nis defined." + } + }, + "flatPath": "v1alpha2/pipelines/{pipelineId}", + "id": "genomics.pipelines.delete", + "path": "v1alpha2/pipelines/{pipelineId}" }, "getControllerConfig": { + "flatPath": "v1alpha2/pipelines:getControllerConfig", + "id": "genomics.pipelines.getControllerConfig", + "path": "v1alpha2/pipelines:getControllerConfig", + "description": "Gets controller configuration information. Should only be called\nby VMs created by the Pipelines Service and not by end users.", "response": { "$ref": "ControllerConfig" }, @@ -63,9 +170,9 @@ "httpMethod": "GET", "parameters": { "operationId": { + "type": "string", "location": "query", - "description": "The operation to retrieve controller configuration for.", - "type": "string" + "description": "The operation to retrieve controller configuration for." }, "validationToken": { "location": "query", @@ -76,45 +183,41 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1alpha2/pipelines:getControllerConfig", - "path": "v1alpha2/pipelines:getControllerConfig", - "id": "genomics.pipelines.getControllerConfig", - "description": "Gets controller configuration information. Should only be called\nby VMs created by the Pipelines Service and not by end users." + ] }, "list": { - "httpMethod": "GET", "response": { "$ref": "ListPipelinesResponse" }, "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "projectId": { + "type": "string", + "location": "query", + "description": "Required. The name of the project to search for pipelines. Caller\nmust have READ access to this project." + }, + "namePrefix": { + "type": "string", + "location": "query", + "description": "Pipelines with names that match this prefix should be\nreturned. If unspecified, all pipelines in the project, up to\n`pageSize`, will be returned." + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Token to use to indicate where to start getting results.\nIf unspecified, returns the first page of results." + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Number of pipelines to return at once. Defaults to 256, and max\nis 2048.", + "type": "integer" + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], - "parameters": { - "namePrefix": { - "location": "query", - "description": "Pipelines with names that match this prefix should be\nreturned. If unspecified, all pipelines in the project, up to\n`pageSize`, will be returned.", - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Token to use to indicate where to start getting results.\nIf unspecified, returns the first page of results.", - "type": "string" - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "Number of pipelines to return at once. Defaults to 256, and max\nis 2048.", - "format": "int32" - }, - "projectId": { - "location": "query", - "description": "Required. The name of the project to search for pipelines. Caller\nmust have READ access to this project.", - "type": "string" - } - }, "flatPath": "v1alpha2/pipelines", "id": "genomics.pipelines.list", "path": "v1alpha2/pipelines", @@ -130,236 +233,94 @@ }, "parameterOrder": [], "httpMethod": "POST", + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], - "parameters": {}, "flatPath": "v1alpha2/pipelines", - "path": "v1alpha2/pipelines", - "id": "genomics.pipelines.create" + "id": "genomics.pipelines.create", + "path": "v1alpha2/pipelines" }, "run": { "description": "Runs a pipeline. If `pipelineId` is specified in the request, then\nrun a saved pipeline. If `ephemeralPipeline` is specified, then run\nthat pipeline once without saving a copy.\n\nThe caller must have READ permission to the project where the pipeline\nis stored and WRITE permission to the project where the pipeline will be\nrun, as VMs will be created and storage will be used.\n\nIf a pipeline operation is still running after 6 days, it will be canceled.", "request": { "$ref": "RunPipelineRequest" }, - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "Operation" }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/genomics" ], - "parameters": {}, "flatPath": "v1alpha2/pipelines:run", "id": "genomics.pipelines.run", "path": "v1alpha2/pipelines:run" }, "get": { - "description": "Retrieves a pipeline based on ID.\n\nCaller must have READ permission to the project.", - "httpMethod": "GET", "response": { "$ref": "Pipeline" }, "parameterOrder": [ "pipelineId" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], "parameters": { "pipelineId": { - "location": "path", - "description": "Caller must have READ access to the project in which this pipeline\nis defined.", + "type": "string", "required": true, - "type": "string" + "location": "path", + "description": "Caller must have READ access to the project in which this pipeline\nis defined." } }, "flatPath": "v1alpha2/pipelines/{pipelineId}", "id": "genomics.pipelines.get", - "path": "v1alpha2/pipelines/{pipelineId}" - } - } - }, - "operations": { - "methods": { - "cancel": { - "parameters": { - "name": { - "description": "The name of the operation resource to be cancelled.", - "required": true, - "type": "string", - "pattern": "^operations/.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1alpha2/operations/{operationsId}:cancel", - "path": "v1alpha2/{+name}:cancel", - "id": "genomics.operations.cancel", - "request": { - "$ref": "CancelOperationRequest" - }, - "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST" - }, - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ListOperationsResponse" - }, - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation collection.", - "required": true, - "type": "string", - "pattern": "^operations$" - }, - "pageToken": { - "location": "query", - "description": "The standard list page token.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "The maximum number of results to return. If unspecified, defaults to\n256. The maximum value is 2048.", - "format": "int32", - "type": "integer" - }, - "filter": { - "location": "query", - "description": "A string for filtering Operations.\nThe following filter fields are supported:\n\n* projectId: Required. Corresponds to\n OperationMetadata.projectId.\n* createTime: The time this job was created, in seconds from the\n [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `\u003c=`\n operators.\n* status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only\n one status may be specified.\n* labels.key where key is a label key.\n\nExamples:\n\n* `projectId = my-project AND createTime \u003e= 1432140000`\n* `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`\n* `projectId = my-project AND labels.color = *`\n* `projectId = my-project AND labels.color = red`", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1alpha2/operations", - "id": "genomics.operations.list", - "path": "v1alpha2/{+name}", - "description": "Lists operations that match the specified filter in the request." - }, - "get": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "parameters": { - "name": { - "description": "The name of the operation resource.", - "required": true, - "type": "string", - "pattern": "^operations/.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "flatPath": "v1alpha2/operations/{operationsId}", - "id": "genomics.operations.get", - "path": "v1alpha2/{+name}", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + "path": "v1alpha2/pipelines/{pipelineId}", + "description": "Retrieves a pipeline based on ID.\n\nCaller must have READ permission to the project." } } } }, "parameters": { - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" - }, - "prettyPrint": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." - }, "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", - "location": "query" + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." }, "fields": { + "type": "string", "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" }, "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" ] }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, "alt": { + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -372,71 +333,177 @@ "json", "media", "proto" - ], + ] + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", "type": "string" + }, + "key": { + "type": "string", + "location": "query", + "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." + }, + "quotaUser": { + "type": "string", + "location": "query", + "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." + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "upload_protocol": { + "type": "string", + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + }, + "prettyPrint": { + "default": "true", + "type": "boolean", + "location": "query", + "description": "Returns response with indentations and line breaks." } }, "schemas": { + "CancelOperationRequest": { + "description": "The request message for Operations.CancelOperation.", + "type": "object", + "properties": {}, + "id": "CancelOperationRequest" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "response": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an Empty response is returned." + }, + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw`" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "An OperationMetadata object. This will always be returned with the Operation." + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable." + } + }, + "id": "Operation" + }, + "RuntimeMetadata": { + "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution.", + "type": "object", + "properties": { + "computeEngine": { + "$ref": "ComputeEngine", + "description": "Execution information specific to Google Compute Engine." + } + }, + "id": "RuntimeMetadata" + }, + "ImportReadGroupSetsResponse": { + "description": "The read group set import response.", + "type": "object", + "properties": { + "readGroupSetIds": { + "items": { + "type": "string" + }, + "type": "array", + "description": "IDs of the read group sets that were created." + } + }, + "id": "ImportReadGroupSetsResponse" + }, "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" } - } + }, + "type": "array" }, "code": { "type": "integer", - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32" + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code." }, "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" + "type": "string", + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client." } }, - "id": "Status" + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons." }, "ServiceAccount": { "description": "A Google Cloud Service Account.", "type": "object", "properties": { + "scopes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "List of scopes to be enabled for this service account on the VM.\nThe following scopes are automatically included:\n\n* https://www.googleapis.com/auth/compute\n* https://www.googleapis.com/auth/devstorage.full_control\n* https://www.googleapis.com/auth/genomics\n* https://www.googleapis.com/auth/logging.write\n* https://www.googleapis.com/auth/monitoring.write" + }, "email": { "description": "Email address of the service account. Defaults to `default`,\nwhich uses the compute service account associated with the project.", "type": "string" - }, - "scopes": { - "description": "List of scopes to be enabled for this service account on the VM.\nThe following scopes are automatically included:\n\n* https://www.googleapis.com/auth/compute\n* https://www.googleapis.com/auth/devstorage.full_control\n* https://www.googleapis.com/auth/genomics\n* https://www.googleapis.com/auth/logging.write\n* https://www.googleapis.com/auth/monitoring.write", - "type": "array", - "items": { - "type": "string" - } } }, "id": "ServiceAccount" }, "PipelineResources": { - "id": "PipelineResources", "description": "The system resources for the pipeline run.", "type": "object", "properties": { "zones": { - "description": "List of Google Compute Engine availability zones to which resource\ncreation will restricted. If empty, any zone may be chosen.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array", + "description": "List of Google Compute Engine availability zones to which resource\ncreation will restricted. If empty, any zone may be chosen." }, "minimumCpuCores": { - "description": "The minimum number of cores to use. Defaults to 1.", "format": "int32", + "description": "The minimum number of cores to use. Defaults to 1.", "type": "integer" }, "noAddress": { @@ -444,52 +511,55 @@ "type": "boolean" }, "disks": { - "type": "array", + "description": "Disks to attach.", "items": { "$ref": "Disk" }, - "description": "Disks to attach." + "type": "array" }, "bootDiskSizeGb": { - "description": "The size of the boot disk. Defaults to 10 (GB).", + "type": "integer", "format": "int32", - "type": "integer" + "description": "The size of the boot disk. Defaults to 10 (GB)." }, "preemptible": { "description": "Whether to use preemptible VMs. Defaults to `false`. In order to use this,\nmust be true for both create time and run time. Cannot be true at run time\nif false at create time.", "type": "boolean" }, "minimumRamGb": { - "description": "The minimum amount of RAM to use. Defaults to 3.75 (GB)", + "type": "number", "format": "double", - "type": "number" + "description": "The minimum amount of RAM to use. Defaults to 3.75 (GB)" } - } + }, + "id": "PipelineResources" }, "Pipeline": { + "description": "The pipeline object. Represents a transformation from a set of input\nparameters to a set of output parameters. The transformation is defined\nas a docker image and command to run within that image. Each pipeline\nis run on a Google Compute Engine VM. A pipeline can be created with the\n`create` method and then later run with the `run` method, or a pipeline can\nbe defined and run all at once with the `run` method.", + "type": "object", "properties": { "resources": { - "description": "Required. Specifies resource requirements for the pipeline run.\nRequired fields:\n\n*\nminimumCpuCores\n\n*\nminimumRamGb", - "$ref": "PipelineResources" + "$ref": "PipelineResources", + "description": "Required. Specifies resource requirements for the pipeline run.\nRequired fields:\n\n*\nminimumCpuCores\n\n*\nminimumRamGb" }, "name": { "description": "Required. A user specified pipeline name that does not have to be unique.\nThis name can be used for filtering Pipelines in ListPipelines.", "type": "string" }, - "projectId": { - "type": "string", - "description": "Required. The project in which to create the pipeline. The caller must have\nWRITE access." - }, "pipelineId": { - "description": "Unique pipeline id that is generated by the service when CreatePipeline\nis called. Cannot be specified in the Pipeline used in the\nCreatePipelineRequest, and will be populated in the response to\nCreatePipeline and all subsequent Get and List calls. Indicates that the\nservice has registered this pipeline.", + "type": "string", + "description": "Unique pipeline id that is generated by the service when CreatePipeline\nis called. Cannot be specified in the Pipeline used in the\nCreatePipelineRequest, and will be populated in the response to\nCreatePipeline and all subsequent Get and List calls. Indicates that the\nservice has registered this pipeline." + }, + "projectId": { + "description": "Required. The project in which to create the pipeline. The caller must have\nWRITE access.", "type": "string" }, "outputParameters": { - "description": "Output parameters of the pipeline.", - "type": "array", "items": { "$ref": "PipelineParameter" - } + }, + "type": "array", + "description": "Output parameters of the pipeline." }, "description": { "description": "User-specified description.", @@ -501,25 +571,43 @@ }, "inputParameters": { "description": "Input parameters of the pipeline.", - "type": "array", "items": { "$ref": "PipelineParameter" - } + }, + "type": "array" } }, - "id": "Pipeline", - "description": "The pipeline object. Represents a transformation from a set of input\nparameters to a set of output parameters. The transformation is defined\nas a docker image and command to run within that image. Each pipeline\nis run on a Google Compute Engine VM. A pipeline can be created with the\n`create` method and then later run with the `run` method, or a pipeline can\nbe defined and run all at once with the `run` method.", - "type": "object" + "id": "Pipeline" + }, + "OperationEvent": { + "description": "An event that occurred during an Operation.", + "type": "object", + "properties": { + "endTime": { + "type": "string", + "format": "google-datetime", + "description": "Optional time of when event finished. An event can have a start time and no\nfinish time. If an event has a finish time, there must be a start time." + }, + "startTime": { + "type": "string", + "format": "google-datetime", + "description": "Optional time of when event started." + }, + "description": { + "type": "string", + "description": "Required description of event." + } + }, + "id": "OperationEvent" }, "ControllerConfig": { - "description": "Stores the information that the controller will fetch from the\nserver in order to run. Should only be used by VMs created by the\nPipelines Service and not by end users.", "type": "object", "properties": { "vars": { - "type": "object", "additionalProperties": { "type": "string" - } + }, + "type": "object" }, "image": { "type": "string" @@ -552,96 +640,55 @@ "type": "string" } }, - "id": "ControllerConfig" - }, - "OperationEvent": { - "type": "object", - "properties": { - "endTime": { - "description": "Optional time of when event finished. An event can have a start time and no\nfinish time. If an event has a finish time, there must be a start time.", - "format": "google-datetime", - "type": "string" - }, - "startTime": { - "description": "Optional time of when event started.", - "format": "google-datetime", - "type": "string" - }, - "description": { - "description": "Required description of event.", - "type": "string" - } - }, - "id": "OperationEvent", - "description": "An event that occurred during an Operation." - }, - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Operation" - } - } - }, - "id": "ListOperationsResponse" + "id": "ControllerConfig", + "description": "Stores the information that the controller will fetch from the\nserver in order to run. Should only be used by VMs created by the\nPipelines Service and not by end users." }, "RepeatedString": { "type": "object", "properties": { "values": { - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "RepeatedString" }, - "OperationMetadata": { - "description": "Metadata describing an Operation.", + "ListOperationsResponse": { "type": "object", "properties": { - "endTime": { - "description": "The time at which the job stopped running.", - "format": "google-datetime", - "type": "string" - }, - "events": { - "type": "array", + "operations": { + "description": "A list of operations that matches the specified filter in the request.", "items": { - "$ref": "OperationEvent" + "$ref": "Operation" }, - "description": "Optional event messages that were generated during the job's execution.\nThis also contains any warnings that were generated during import\nor export." + "type": "array" }, - "startTime": { - "description": "The time at which the job began to run.", - "format": "google-datetime", + "nextPageToken": { + "description": "The standard List next-page token.", "type": "string" - }, - "request": { - "description": "The original request that started the operation. Note that this will be in\ncurrent version of the API. If the operation was started with v1beta2 API\nand a GetOperation is performed on v1 API, a v1 request will be returned.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, + } + }, + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations." + }, + "OperationMetadata": { + "type": "object", + "properties": { "runtimeMetadata": { "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." }, "description": "Runtime metadata on this Operation.", "type": "object" }, + "createTime": { + "format": "google-datetime", + "description": "The time at which the job was submitted to the Genomics service.", + "type": "string" + }, "labels": { "additionalProperties": { "type": "string" @@ -649,33 +696,81 @@ "description": "Optionally provided by the caller when submitting the request that creates\nthe operation.", "type": "object" }, - "createTime": { - "description": "The time at which the job was submitted to the Genomics service.", - "format": "google-datetime", - "type": "string" - }, "projectId": { - "type": "string", - "description": "The Google Cloud Project in which the job is scoped." + "description": "The Google Cloud Project in which the job is scoped.", + "type": "string" }, "clientId": { "description": "This field is deprecated. Use `labels` instead. Optionally provided by the\ncaller when submitting the request that creates the operation.", "type": "string" + }, + "endTime": { + "type": "string", + "format": "google-datetime", + "description": "The time at which the job stopped running." + }, + "events": { + "description": "Optional event messages that were generated during the job's execution.\nThis also contains any warnings that were generated during import\nor export.", + "items": { + "$ref": "OperationEvent" + }, + "type": "array" + }, + "startTime": { + "type": "string", + "format": "google-datetime", + "description": "The time at which the job began to run." + }, + "request": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "The original request that started the operation. Note that this will be in\ncurrent version of the API. If the operation was started with v1beta2 API\nand a GetOperation is performed on v1 API, a v1 request will be returned.", + "type": "object" } }, - "id": "OperationMetadata" + "id": "OperationMetadata", + "description": "Metadata describing an Operation." }, "RunPipelineArgs": { "description": "The pipeline run arguments.", "type": "object", "properties": { - "clientId": { - "type": "string", - "description": "This field is deprecated. Use `labels` instead. Client-specified pipeline\noperation identifier." + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Labels to apply to this pipeline run. Labels will also be applied to\ncompute resources (VM, disks) created by this pipeline run. When listing\noperations, operations can filtered by labels.\nLabel keys may not be empty; label values may be empty. Non-empty labels\nmust be 1-63 characters long, and comply with [RFC1035]\n(https://www.ietf.org/rfc/rfc1035.txt).\nSpecifically, the name must be 1-63 characters long and match the regular\nexpression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first\ncharacter must be a lowercase letter, and all following characters must be\na dash, lowercase letter, or digit, except the last character, which cannot\nbe a dash." }, - "serviceAccount": { - "description": "The Google Cloud Service Account that will be used to access data and\nservices. By default, the compute service account associated with\n`projectId` is used.", - "$ref": "ServiceAccount" + "logging": { + "$ref": "LoggingOptions", + "description": "Required. Logging options. Used by the service to communicate results\nto the user." + }, + "keepVmAliveOnFailureDuration": { + "format": "google-duration", + "description": "How long to keep the VM up after a failure (for example docker command\nfailed, copying input or output files failed, etc). While the VM is up, one\ncan ssh into the VM to debug. Default is 0; maximum allowed value is 1 day.", + "type": "string" + }, + "resources": { + "$ref": "PipelineResources", + "description": "Specifies resource requirements/overrides for the pipeline run." + }, + "outputs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Pipeline output arguments; keys are defined in the pipeline\ndocumentation. All output parameters of without default values\nmust be specified. If parameters with defaults are specified\nhere, the defaults will be overridden." + }, + "projectId": { + "type": "string", + "description": "Required. The project in which to run the pipeline. The caller must have\nWRITER access to all Google Cloud services and resources (e.g. Google\nCompute Engine) will be used." + }, + "clientId": { + "description": "This field is deprecated. Use `labels` instead. Client-specified pipeline\noperation identifier.", + "type": "string" }, "inputs": { "additionalProperties": { @@ -684,74 +779,62 @@ "description": "Pipeline input arguments; keys are defined in the pipeline documentation.\nAll input parameters that do not have default values must be specified.\nIf parameters with defaults are specified here, the defaults will be\noverridden.", "type": "object" }, - "logging": { - "description": "Required. Logging options. Used by the service to communicate results\nto the user.", - "$ref": "LoggingOptions" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Labels to apply to this pipeline run. Labels will also be applied to\ncompute resources (VM, disks) created by this pipeline run. When listing\noperations, operations can filtered by labels.\nLabel keys may not be empty; label values may be empty. Non-empty labels\nmust be 1-63 characters long, and comply with [RFC1035]\n(https://www.ietf.org/rfc/rfc1035.txt).\nSpecifically, the name must be 1-63 characters long and match the regular\nexpression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first\ncharacter must be a lowercase letter, and all following characters must be\na dash, lowercase letter, or digit, except the last character, which cannot\nbe a dash." - }, - "keepVmAliveOnFailureDuration": { - "description": "How long to keep the VM up after a failure (for example docker command\nfailed, copying input or output files failed, etc). While the VM is up, one\ncan ssh into the VM to debug. Default is 0; maximum allowed value is 1 day.", - "format": "google-duration", - "type": "string" - }, - "resources": { - "description": "Specifies resource requirements/overrides for the pipeline run.", - "$ref": "PipelineResources" - }, - "outputs": { - "additionalProperties": { - "type": "string" - }, - "description": "Pipeline output arguments; keys are defined in the pipeline\ndocumentation. All output parameters of without default values\nmust be specified. If parameters with defaults are specified\nhere, the defaults will be overridden.", - "type": "object" - }, - "projectId": { - "description": "Required. The project in which to run the pipeline. The caller must have\nWRITER access to all Google Cloud services and resources (e.g. Google\nCompute Engine) will be used.", - "type": "string" + "serviceAccount": { + "$ref": "ServiceAccount", + "description": "The Google Cloud Service Account that will be used to access data and\nservices. By default, the compute service account associated with\n`projectId` is used." } }, "id": "RunPipelineArgs" }, "ListPipelinesResponse": { + "description": "The response of ListPipelines. Contains at most `pageSize`\npipelines. If it contains `pageSize` pipelines, and more pipelines\nexist, then `nextPageToken` will be populated and should be\nused as the `pageToken` argument to a subsequent ListPipelines\nrequest.", "type": "object", "properties": { "nextPageToken": { - "type": "string", - "description": "The token to use to get the next page of results." + "description": "The token to use to get the next page of results.", + "type": "string" }, "pipelines": { - "description": "The matched pipelines.", - "type": "array", "items": { "$ref": "Pipeline" - } + }, + "type": "array", + "description": "The matched pipelines." } }, - "id": "ListPipelinesResponse", - "description": "The response of ListPipelines. Contains at most `pageSize`\npipelines. If it contains `pageSize` pipelines, and more pipelines\nexist, then `nextPageToken` will be populated and should be\nused as the `pageToken` argument to a subsequent ListPipelines\nrequest." + "id": "ListPipelinesResponse" }, "SetOperationStatusRequest": { - "id": "SetOperationStatusRequest", "description": "Request to set operation status. Should only be used by VMs\ncreated by the Pipelines Service and not by end users.", "type": "object", "properties": { - "operationId": { - "type": "string" + "validationToken": { + "type": "string", + "format": "uint64" }, "errorMessage": { "type": "string" }, - "validationToken": { - "format": "uint64", - "type": "string" - }, "errorCode": { + "enum": [ + "OK", + "CANCELLED", + "UNKNOWN", + "INVALID_ARGUMENT", + "DEADLINE_EXCEEDED", + "NOT_FOUND", + "ALREADY_EXISTS", + "PERMISSION_DENIED", + "UNAUTHENTICATED", + "RESOURCE_EXHAUSTED", + "FAILED_PRECONDITION", + "ABORTED", + "OUT_OF_RANGE", + "UNIMPLEMENTED", + "INTERNAL", + "UNAVAILABLE", + "DATA_LOSS" + ], "type": "string", "enumDescriptions": [ "Not an error; returned on success\n\nHTTP Mapping: 200 OK", @@ -771,62 +854,35 @@ "Internal errors. This means that some invariants expected by the\nunderlying system have been broken. This error code is reserved\nfor serious errors.\n\nHTTP Mapping: 500 Internal Server Error", "The service is currently unavailable. This is most likely a\ntransient condition, which can be corrected by retrying with\na backoff.\n\nSee the guidelines above for deciding between `FAILED_PRECONDITION`,\n`ABORTED`, and `UNAVAILABLE`.\n\nHTTP Mapping: 503 Service Unavailable", "Unrecoverable data loss or corruption.\n\nHTTP Mapping: 500 Internal Server Error" - ], - "enum": [ - "OK", - "CANCELLED", - "UNKNOWN", - "INVALID_ARGUMENT", - "DEADLINE_EXCEEDED", - "NOT_FOUND", - "ALREADY_EXISTS", - "PERMISSION_DENIED", - "UNAUTHENTICATED", - "RESOURCE_EXHAUSTED", - "FAILED_PRECONDITION", - "ABORTED", - "OUT_OF_RANGE", - "UNIMPLEMENTED", - "INTERNAL", - "UNAVAILABLE", - "DATA_LOSS" ] }, "timestampEvents": { - "type": "array", "items": { "$ref": "TimestampEvent" - } - } - } - }, - "ImportVariantsResponse": { - "description": "The variant data import response.", - "type": "object", - "properties": { - "callSetIds": { - "description": "IDs of the call sets created during the import.", - "type": "array", - "items": { - "type": "string" - } + }, + "type": "array" + }, + "operationId": { + "type": "string" } }, - "id": "ImportVariantsResponse" + "id": "SetOperationStatusRequest" }, "ComputeEngine": { + "description": "Describes a Compute Engine resource that is being managed by a running\npipeline.", + "type": "object", "properties": { + "diskNames": { + "description": "The names of the disks that were created for this pipeline.", + "items": { + "type": "string" + }, + "type": "array" + }, "machineType": { "description": "The machine type of the instance.", "type": "string" }, - "diskNames": { - "description": "The names of the disks that were created for this pipeline.", - "type": "array", - "items": { - "type": "string" - } - }, "instanceName": { "description": "The instance on which the operation is running.", "type": "string" @@ -836,20 +892,32 @@ "type": "string" } }, - "id": "ComputeEngine", - "description": "Describes a Compute Engine resource that is being managed by a running\npipeline.", - "type": "object" + "id": "ComputeEngine" + }, + "ImportVariantsResponse": { + "type": "object", + "properties": { + "callSetIds": { + "description": "IDs of the call sets created during the import.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ImportVariantsResponse", + "description": "The variant data import response." }, "TimestampEvent": { "type": "object", "properties": { - "description": { - "type": "string", - "description": "String indicating the type of event" - }, "timestamp": { - "description": "The time this event occured.", "format": "google-datetime", + "description": "The time this event occured.", + "type": "string" + }, + "description": { + "description": "String indicating the type of event", "type": "string" } }, @@ -857,37 +925,42 @@ "description": "Stores the list of events and times they occured for major events in job\nexecution." }, "LocalCopy": { - "description": "LocalCopy defines how a remote file should be copied to and from the VM.", "type": "object", "properties": { + "path": { + "type": "string", + "description": "Required. The path within the user's docker container where\nthis input should be localized to and from, relative to the specified\ndisk's mount point. For example: file.txt," + }, "disk": { "description": "Required. The name of the disk where this parameter is\nlocated. Can be the name of one of the disks specified in the\nResources field, or \"boot\", which represents the Docker\ninstance's boot disk and has a mount point of `/`.", "type": "string" - }, - "path": { - "description": "Required. The path within the user's docker container where\nthis input should be localized to and from, relative to the specified\ndisk's mount point. For example: file.txt,", - "type": "string" } }, - "id": "LocalCopy" + "id": "LocalCopy", + "description": "LocalCopy defines how a remote file should be copied to and from the VM." }, "DockerExecutor": { - "id": "DockerExecutor", "description": "The Docker execuctor specification.", "type": "object", "properties": { "cmd": { - "description": "Required. The command or newline delimited script to run. The command\nstring will be executed within a bash shell.\n\nIf the command exits with a non-zero exit code, output parameter\nde-localization will be skipped and the pipeline operation's\n`error` field will be populated.\n\nMaximum command string length is 16384.", - "type": "string" + "type": "string", + "description": "Required. The command or newline delimited script to run. The command\nstring will be executed within a bash shell.\n\nIf the command exits with a non-zero exit code, output parameter\nde-localization will be skipped and the pipeline operation's\n`error` field will be populated.\n\nMaximum command string length is 16384." }, "imageName": { - "description": "Required. Image name from either Docker Hub or Google Container Registry.\nUsers that run pipelines must have READ access to the image.", - "type": "string" + "type": "string", + "description": "Required. Image name from either Docker Hub or Google Container Registry.\nUsers that run pipelines must have READ access to the image." } - } + }, + "id": "DockerExecutor" + }, + "Empty": { + "type": "object", + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`." }, "Disk": { - "description": "A Google Compute Engine disk resource specification.", "type": "object", "properties": { "autoDelete": { @@ -895,33 +968,27 @@ "type": "boolean" }, "sizeGb": { - "description": "The size of the disk. Defaults to 500 (GB).\nThis field is not applicable for local SSD.", + "type": "integer", "format": "int32", - "type": "integer" + "description": "The size of the disk. Defaults to 500 (GB).\nThis field is not applicable for local SSD." }, "mountPoint": { "description": "Required at create time and cannot be overridden at run time.\nSpecifies the path in the docker container where files on\nthis disk should be located. For example, if `mountPoint`\nis `/mnt/disk`, and the parameter has `localPath`\n`inputs/file.txt`, the docker container can access the data at\n`/mnt/disk/inputs/file.txt`.", "type": "string" }, "readOnly": { - "description": "Specifies how a sourced-base persistent disk will be mounted. See\nhttps://cloud.google.com/compute/docs/disks/persistent-disks#use_multi_instances\nfor more details.\nCan only be set at create time.", - "type": "boolean" + "type": "boolean", + "description": "Specifies how a sourced-base persistent disk will be mounted. See\nhttps://cloud.google.com/compute/docs/disks/persistent-disks#use_multi_instances\nfor more details.\nCan only be set at create time." }, "source": { "description": "The full or partial URL of the persistent disk to attach. See\nhttps://cloud.google.com/compute/docs/reference/latest/instances#resource\nand\nhttps://cloud.google.com/compute/docs/disks/persistent-disks#snapshots\nfor more details.", "type": "string" }, "name": { - "description": "Required. The name of the disk that can be used in the pipeline\nparameters. Must be 1 - 63 characters.\nThe name \"boot\" is reserved for system use.", - "type": "string" + "type": "string", + "description": "Required. The name of the disk that can be used in the pipeline\nparameters. Must be 1 - 63 characters.\nThe name \"boot\" is reserved for system use." }, "type": { - "enumDescriptions": [ - "Default disk type. Use one of the other options below.", - "Specifies a Google Compute Engine persistent hard disk. See\nhttps://cloud.google.com/compute/docs/disks/#pdspecs for details.", - "Specifies a Google Compute Engine persistent solid-state disk. See\nhttps://cloud.google.com/compute/docs/disks/#pdspecs for details.", - "Specifies a Google Compute Engine local SSD.\nSee https://cloud.google.com/compute/docs/disks/local-ssd for details." - ], "enum": [ "TYPE_UNSPECIFIED", "PERSISTENT_HDD", @@ -929,22 +996,25 @@ "LOCAL_SSD" ], "description": "Required. The type of the disk to create.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Default disk type. Use one of the other options below.", + "Specifies a Google Compute Engine persistent hard disk. See\nhttps://cloud.google.com/compute/docs/disks/#pdspecs for details.", + "Specifies a Google Compute Engine persistent solid-state disk. See\nhttps://cloud.google.com/compute/docs/disks/#pdspecs for details.", + "Specifies a Google Compute Engine local SSD.\nSee https://cloud.google.com/compute/docs/disks/local-ssd for details." + ] } }, - "id": "Disk" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" + "id": "Disk", + "description": "A Google Compute Engine disk resource specification." }, "PipelineParameter": { - "id": "PipelineParameter", - "description": "Parameters facilitate setting and delivering data into the\npipeline's execution environment. They are defined at create time,\nwith optional defaults, and can be overridden at run time.\n\nIf `localCopy` is unset, then the parameter specifies a string that\nis passed as-is into the pipeline, as the value of the environment\nvariable with the given name. A default value can be optionally\nspecified at create time. The default can be overridden at run time\nusing the inputs map. If no default is given, a value must be\nsupplied at runtime.\n\nIf `localCopy` is defined, then the parameter specifies a data\nsource or sink, both in Google Cloud Storage and on the Docker container\nwhere the pipeline computation is run. The service account associated with\nthe Pipeline (by\ndefault the project's Compute Engine service account) must have access to the\nGoogle Cloud Storage paths.\n\nAt run time, the Google Cloud Storage paths can be overridden if a default\nwas provided at create time, or must be set otherwise. The pipeline runner\nshould add a key/value pair to either the inputs or outputs map. The\nindicated data copies will be carried out before/after pipeline execution,\njust as if the corresponding arguments were provided to `gsutil cp`.\n\nFor example: Given the following `PipelineParameter`, specified\nin the `inputParameters` list:\n\n```\n{name: \"input_file\", localCopy: {path: \"file.txt\", disk: \"pd1\"}}\n```\n\nwhere `disk` is defined in the `PipelineResources` object as:\n\n```\n{name: \"pd1\", mountPoint: \"/mnt/disk/\"}\n```\n\nWe create a disk named `pd1`, mount it on the host VM, and map\n`/mnt/pd1` to `/mnt/disk` in the docker container. At\nruntime, an entry for `input_file` would be required in the inputs\nmap, such as:\n\n```\n inputs[\"input_file\"] = \"gs://my-bucket/bar.txt\"\n```\n\nThis would generate the following gsutil call:\n\n```\n gsutil cp gs://my-bucket/bar.txt /mnt/pd1/file.txt\n```\n\nThe file `/mnt/pd1/file.txt` maps to `/mnt/disk/file.txt` in the\nDocker container. Acceptable paths are:\n\n\u003ctable\u003e\n \u003cthead\u003e\n \u003ctr\u003e\u003cth\u003eGoogle Cloud storage path\u003c/th\u003e\u003cth\u003eLocal path\u003c/th\u003e\u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\u003ctd\u003efile\u003c/td\u003e\u003ctd\u003efile\u003c/td\u003e\u003c/tr\u003e\n \u003ctr\u003e\u003ctd\u003eglob\u003c/td\u003e\u003ctd\u003edirectory\u003c/td\u003e\u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\nFor outputs, the direction of the copy is reversed:\n\n```\n gsutil cp /mnt/disk/file.txt gs://my-bucket/bar.txt\n```\n\nAcceptable paths are:\n\n\u003ctable\u003e\n \u003cthead\u003e\n \u003ctr\u003e\u003cth\u003eLocal path\u003c/th\u003e\u003cth\u003eGoogle Cloud Storage path\u003c/th\u003e\u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\u003ctd\u003efile\u003c/td\u003e\u003ctd\u003efile\u003c/td\u003e\u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003efile\u003c/td\u003e\n \u003ctd\u003edirectory - directory must already exist\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003eglob\u003c/td\u003e\n \u003ctd\u003edirectory - directory will be created if it doesn't exist\u003c/td\u003e\u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\nOne restriction due to docker limitations, is that for outputs that are found\non the boot disk, the local path cannot be a glob and must be a file.", "type": "object", "properties": { + "localCopy": { + "$ref": "LocalCopy", + "description": "If present, this parameter is marked for copying to and from the VM.\n`LocalCopy` indicates where on the VM the file should be. The value\ngiven to this parameter (either at runtime or using `defaultValue`)\nmust be the remote path where the file should be." + }, "defaultValue": { "description": "The default value for this parameter. Can be overridden at runtime.\nIf `localCopy` is present, then this must be a Google Cloud Storage path\nbeginning with `gs://`.", "type": "string" @@ -954,14 +1024,12 @@ "type": "string" }, "description": { - "description": "Human-readable description.", - "type": "string" - }, - "localCopy": { - "$ref": "LocalCopy", - "description": "If present, this parameter is marked for copying to and from the VM.\n`LocalCopy` indicates where on the VM the file should be. The value\ngiven to this parameter (either at runtime or using `defaultValue`)\nmust be the remote path where the file should be." + "type": "string", + "description": "Human-readable description." } - } + }, + "id": "PipelineParameter", + "description": "Parameters facilitate setting and delivering data into the\npipeline's execution environment. They are defined at create time,\nwith optional defaults, and can be overridden at run time.\n\nIf `localCopy` is unset, then the parameter specifies a string that\nis passed as-is into the pipeline, as the value of the environment\nvariable with the given name. A default value can be optionally\nspecified at create time. The default can be overridden at run time\nusing the inputs map. If no default is given, a value must be\nsupplied at runtime.\n\nIf `localCopy` is defined, then the parameter specifies a data\nsource or sink, both in Google Cloud Storage and on the Docker container\nwhere the pipeline computation is run. The service account associated with\nthe Pipeline (by\ndefault the project's Compute Engine service account) must have access to the\nGoogle Cloud Storage paths.\n\nAt run time, the Google Cloud Storage paths can be overridden if a default\nwas provided at create time, or must be set otherwise. The pipeline runner\nshould add a key/value pair to either the inputs or outputs map. The\nindicated data copies will be carried out before/after pipeline execution,\njust as if the corresponding arguments were provided to `gsutil cp`.\n\nFor example: Given the following `PipelineParameter`, specified\nin the `inputParameters` list:\n\n```\n{name: \"input_file\", localCopy: {path: \"file.txt\", disk: \"pd1\"}}\n```\n\nwhere `disk` is defined in the `PipelineResources` object as:\n\n```\n{name: \"pd1\", mountPoint: \"/mnt/disk/\"}\n```\n\nWe create a disk named `pd1`, mount it on the host VM, and map\n`/mnt/pd1` to `/mnt/disk` in the docker container. At\nruntime, an entry for `input_file` would be required in the inputs\nmap, such as:\n\n```\n inputs[\"input_file\"] = \"gs://my-bucket/bar.txt\"\n```\n\nThis would generate the following gsutil call:\n\n```\n gsutil cp gs://my-bucket/bar.txt /mnt/pd1/file.txt\n```\n\nThe file `/mnt/pd1/file.txt` maps to `/mnt/disk/file.txt` in the\nDocker container. Acceptable paths are:\n\n\u003ctable\u003e\n \u003cthead\u003e\n \u003ctr\u003e\u003cth\u003eGoogle Cloud storage path\u003c/th\u003e\u003cth\u003eLocal path\u003c/th\u003e\u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\u003ctd\u003efile\u003c/td\u003e\u003ctd\u003efile\u003c/td\u003e\u003c/tr\u003e\n \u003ctr\u003e\u003ctd\u003eglob\u003c/td\u003e\u003ctd\u003edirectory\u003c/td\u003e\u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\nFor outputs, the direction of the copy is reversed:\n\n```\n gsutil cp /mnt/disk/file.txt gs://my-bucket/bar.txt\n```\n\nAcceptable paths are:\n\n\u003ctable\u003e\n \u003cthead\u003e\n \u003ctr\u003e\u003cth\u003eLocal path\u003c/th\u003e\u003cth\u003eGoogle Cloud Storage path\u003c/th\u003e\u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\u003ctd\u003efile\u003c/td\u003e\u003ctd\u003efile\u003c/td\u003e\u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003efile\u003c/td\u003e\n \u003ctd\u003edirectory - directory must already exist\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003eglob\u003c/td\u003e\n \u003ctd\u003edirectory - directory will be created if it doesn't exist\u003c/td\u003e\u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\nOne restriction due to docker limitations, is that for outputs that are found\non the boot disk, the local path cannot be a glob and must be a file." }, "LoggingOptions": { "description": "The logging options for the pipeline run.", @@ -975,7 +1043,6 @@ "id": "LoggingOptions" }, "RunPipelineRequest": { - "description": "The request to run a pipeline. If `pipelineId` is specified, it\nrefers to a saved pipeline created with CreatePipeline and set as\nthe `pipelineId` of the returned Pipeline object. If\n`ephemeralPipeline` is specified, that pipeline is run once\nwith the given args and not saved. It is an error to specify both\n`pipelineId` and `ephemeralPipeline`. `pipelineArgs`\nmust be specified.", "type": "object", "properties": { "pipelineArgs": { @@ -983,108 +1050,41 @@ "description": "The arguments to use when running this pipeline." }, "pipelineId": { - "description": "The already created pipeline to run.", - "type": "string" + "type": "string", + "description": "The already created pipeline to run." }, "ephemeralPipeline": { "$ref": "Pipeline", "description": "A new pipeline object to run once and then delete." } }, - "id": "RunPipelineRequest" - }, - "CancelOperationRequest": { - "description": "The request message for Operations.CancelOperation.", - "type": "object", - "properties": {}, - "id": "CancelOperationRequest" - }, - "Operation": { - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw`" - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "description": "An OperationMetadata object. This will always be returned with the Operation." - }, - "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", - "type": "boolean" - }, - "response": { - "description": "If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an empty response is returned.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - }, - "id": "Operation" - }, - "RuntimeMetadata": { - "id": "RuntimeMetadata", - "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution.", - "type": "object", - "properties": { - "computeEngine": { - "description": "Execution information specific to Google Compute Engine.", - "$ref": "ComputeEngine" - } - } - }, - "ImportReadGroupSetsResponse": { - "description": "The read group set import response.", - "type": "object", - "properties": { - "readGroupSetIds": { - "description": "IDs of the read group sets that were created.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "ImportReadGroupSetsResponse" + "id": "RunPipelineRequest", + "description": "The request to run a pipeline. If `pipelineId` is specified, it\nrefers to a saved pipeline created with CreatePipeline and set as\nthe `pipelineId` of the returned Pipeline object. If\n`ephemeralPipeline` is specified, that pipeline is run once\nwith the given args and not saved. It is an error to specify both\n`pipelineId` and `ephemeralPipeline`. `pipelineArgs`\nmust be specified." } }, "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "version": "v1alpha2", "baseUrl": "https://genomics.googleapis.com/", "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/genomics": { - "description": "View and manage Genomics data" - }, "https://www.googleapis.com/auth/compute": { "description": "View and manage your Google Compute Engine resources" }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/genomics": { + "description": "View and manage Genomics data" } } } }, "servicePath": "", "description": "Upload, process, query, and search Genomics data in the cloud.", - "kind": "discovery#restDescription", - "rootUrl": "https://genomics.googleapis.com/", - "basePath": "" + "kind": "discovery#restDescription" } diff --git a/etc/api/gmail/v1/crates/1.0.6-api+20170913 b/etc/api/gmail/v1/crates/1.0.6-api+20170913 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/gmail/v1/crates/1.0.6-cli+20170913 b/etc/api/gmail/v1/crates/1.0.6-cli+20170913 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/gmail/v1/gmail-api.json b/etc/api/gmail/v1/gmail-api.json index 1e140380a7..d6bafaf71f 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/sp6jQ8V0i8GKNN9WuCJbaCVJmmQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/yLmXjwrCZrd7tYs9N17TGZKIRRE\"", "discoveryVersion": "v1", "id": "gmail:v1", "name": "gmail", "version": "v1", - "revision": "20170510", + "revision": "20170913", "title": "Gmail API", "description": "Access Gmail mailboxes including sending user email.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/gmail/v1/users/", "rootUrl": "https://www.googleapis.com/", "servicePath": "gmail/v1/users/", - "batchPath": "batch", + "batchPath": "batch/gmail/v1", "parameters": { "alt": { "type": "string", @@ -88,7 +88,7 @@ "description": "View and modify but not delete your email" }, "https://www.googleapis.com/auth/gmail.readonly": { - "description": "View your emails messages and settings" + "description": "View your email messages and settings" }, "https://www.googleapis.com/auth/gmail.send": { "description": "Send email on your behalf" diff --git a/etc/api/groupsmigration/v1/crates/1.0.6-api+20170607 b/etc/api/groupsmigration/v1/crates/1.0.6-api+20170607 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/groupsmigration/v1/crates/1.0.6-cli+20170607 b/etc/api/groupsmigration/v1/crates/1.0.6-cli+20170607 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/groupsmigration/v1/groupsmigration-api.json b/etc/api/groupsmigration/v1/groupsmigration-api.json index a67806924e..9f4df0064a 100644 --- a/etc/api/groupsmigration/v1/groupsmigration-api.json +++ b/etc/api/groupsmigration/v1/groupsmigration-api.json @@ -1,19 +1,19 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/HWdr3QolTxcnkwueTlDTCxOXBdE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/VuTEwIALyLFp_kdXuKsAPvednIM\"", "discoveryVersion": "v1", "id": "groupsmigration:v1", "name": "groupsmigration", "canonicalName": "Groups Migration", "version": "v1", - "revision": "20140416", + "revision": "20170607", "title": "Groups Migration API", "description": "Groups Migration Api.", "ownerDomain": "google.com", "ownerName": "Google", "icons": { - "x16": "http://www.google.com/images/icons/product/discussions-16.gif", - "x32": "http://www.google.com/images/icons/product/discussions-32.gif" + "x16": "https://www.google.com/images/icons/product/discussions-16.gif", + "x32": "https://www.google.com/images/icons/product/discussions-32.gif" }, "documentationLink": "https://developers.google.com/google-apps/groups-migration/", "protocol": "rest", @@ -21,7 +21,7 @@ "basePath": "/groups/v1/groups/", "rootUrl": "https://www.googleapis.com/", "servicePath": "groups/v1/groups/", - "batchPath": "batch", + "batchPath": "batch/groupsmigration/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/groupssettings/v1/crates/1.0.6-api+20170607 b/etc/api/groupssettings/v1/crates/1.0.6-api+20170607 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/groupssettings/v1/crates/1.0.6-cli+20170607 b/etc/api/groupssettings/v1/crates/1.0.6-cli+20170607 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/groupssettings/v1/groupssettings-api.json b/etc/api/groupssettings/v1/groupssettings-api.json index c4ba1e3369..2afb79fb50 100644 --- a/etc/api/groupssettings/v1/groupssettings-api.json +++ b/etc/api/groupssettings/v1/groupssettings-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/8JFCy9G09DiKop8V7jh2RwsOYyI\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/OtGmapWnnxLrnB8PsHnXNA0QJ0I\"", "discoveryVersion": "v1", "id": "groupssettings:v1", "name": "groupssettings", "version": "v1", - "revision": "20160525", + "revision": "20170607", "title": "Groups Settings API", "description": "Lets you manage permission levels and related settings of a group.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/groups/v1/groups/", "rootUrl": "https://www.googleapis.com/", "servicePath": "groups/v1/groups/", - "batchPath": "batch", + "batchPath": "batch/groupssettings/v1", "parameters": { "alt": { "type": "string", @@ -199,7 +199,7 @@ }, "whoCanPostMessage": { "type": "string", - "description": "Permissions to post messages to the group. Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST" + "description": "Permissions to post messages to the group. Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST ALL_OWNERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST" }, "whoCanViewGroup": { "type": "string", diff --git a/etc/api/iam/v1/crates/1.0.6-api+20170919 b/etc/api/iam/v1/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/iam/v1/iam-api.json b/etc/api/iam/v1/iam-api.json index fc4d82fc6b..16877035f7 100644 --- a/etc/api/iam/v1/iam-api.json +++ b/etc/api/iam/v1/iam-api.json @@ -1,226 +1,16 @@ { - "revision": "20170515", + "version": "v1", + "baseUrl": "https://iam.googleapis.com/", + "servicePath": "", + "description": "Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170919", "documentationLink": "https://cloud.google.com/iam/", "id": "iam:v1", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "SignJwtResponse": { - "id": "SignJwtResponse", - "description": "The service account sign JWT response.", - "type": "object", - "properties": { - "keyId": { - "description": "The id of the key used to sign the JWT.", - "type": "string" - }, - "signedJwt": { - "type": "string", - "description": "The signed JWT." - } - } - }, - "SignBlobResponse": { - "description": "The service account sign blob response.", - "type": "object", - "properties": { - "signature": { - "description": "The signed blob.", - "format": "byte", - "type": "string" - }, - "keyId": { - "description": "The id of the key used to sign the blob.", - "type": "string" - } - }, - "id": "SignBlobResponse" - }, - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "TestIamPermissionsRequest" - }, - "Policy": { - "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", - "type": "object", - "properties": { - "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", - "format": "byte", - "type": "string" - }, - "version": { - "description": "Version of the `Policy`. The default version is 0.", - "format": "int32", - "type": "integer" - }, - "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", - "items": { - "$ref": "Binding" - } - } - }, - "id": "Policy" - }, - "SignJwtRequest": { - "type": "object", - "properties": { - "payload": { - "description": "The JWT payload to sign, a JSON JWT Claim set.", - "type": "string" - } - }, - "id": "SignJwtRequest", - "description": "The service account sign JWT request." - }, - "AuditData": { - "description": "Audit log information specific to Cloud IAM. This message is serialized\nas an `Any` type in the `ServiceData` message of an\n`AuditLog` message.", - "type": "object", - "properties": { - "policyDelta": { - "description": "Policy delta between the original policy and the newly set policy.", - "$ref": "PolicyDelta" - } - }, - "id": "AuditData" - }, - "BindingDelta": { - "description": "One delta entry for Binding. Each individual change (only one member in each\nentry) to a binding will be a separate entry.", - "type": "object", - "properties": { - "member": { - "description": "A single identity requesting access for a Cloud Platform resource.\nFollows the same format of Binding.members.\nRequired", - "type": "string" - }, - "role": { - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", - "type": "string" - }, - "action": { - "enumDescriptions": [ - "Unspecified.", - "Addition of a Binding.", - "Removal of a Binding." - ], - "enum": [ - "ACTION_UNSPECIFIED", - "ADD", - "REMOVE" - ], - "description": "The action that was performed on a Binding.\nRequired", - "type": "string" - } - }, - "id": "BindingDelta" - }, - "PolicyDelta": { - "id": "PolicyDelta", - "description": "The difference delta between two policies.", - "type": "object", - "properties": { - "bindingDeltas": { - "description": "The delta for Bindings between two policies.", - "type": "array", - "items": { - "$ref": "BindingDelta" - } - } - } - }, - "CreateServiceAccountRequest": { - "description": "The service account create request.", - "type": "object", - "properties": { - "serviceAccount": { - "description": "The ServiceAccount resource to create.\nCurrently, only the following values are user assignable:\n`display_name` .", - "$ref": "ServiceAccount" - }, - "accountId": { - "description": "Required. The account id that is used to generate the service account\nemail address and a stable unique id. It is unique within a project,\nmust be 6-30 characters long, and match the regular expression\n`[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035.", - "type": "string" - } - }, - "id": "CreateServiceAccountRequest" - }, - "ListServiceAccountsResponse": { - "properties": { - "nextPageToken": { - "type": "string", - "description": "To retrieve the next page of results, set\nListServiceAccountsRequest.page_token\nto this value." - }, - "accounts": { - "type": "array", - "items": { - "$ref": "ServiceAccount" - }, - "description": "The list of matching service accounts." - } - }, - "id": "ListServiceAccountsResponse", - "description": "The service account list response.", - "type": "object" - }, - "QueryGrantableRolesResponse": { - "description": "The grantable role query response.", - "type": "object", - "properties": { - "roles": { - "type": "array", - "items": { - "$ref": "Role" - }, - "description": "The list of matching roles." - }, - "nextPageToken": { - "description": "To retrieve the next page of results, set\n`QueryGrantableRolesRequest.page_token` to this value.", - "type": "string" - } - }, - "id": "QueryGrantableRolesResponse" - }, - "Role": { - "description": "A role in the Identity and Access Management API.", - "type": "object", - "properties": { - "name": { - "description": "The name of the role.\n\nWhen Role is used in CreateRole, the role name must not be set.\n\nWhen Role is used in output and other input such as UpdateRole, the role\nname is the complete path, e.g., roles/logging.viewer for curated roles\nand organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles.", - "type": "string" - }, - "description": { - "description": "Optional. A human-readable description for the role.", - "type": "string" - }, - "title": { - "description": "Optional. A human-readable title for the role. Typically this\nis limited to 100 UTF-8 bytes.", - "type": "string" - } - }, - "id": "Role" - }, - "SignBlobRequest": { - "description": "The service account sign blob request.", - "type": "object", - "properties": { - "bytesToSign": { - "description": "The bytes to sign.", - "format": "byte", - "type": "string" - } - }, - "id": "SignBlobRequest" - }, "SetIamPolicyRequest": { "description": "Request message for `SetIamPolicy` method.", "type": "object", @@ -232,138 +22,36 @@ }, "id": "SetIamPolicyRequest" }, - "Binding": { - "description": "Associates `members` with a `role`.", + "QueryTestablePermissionsResponse": { + "description": "The response containing permissions which can be tested on a resource.", "type": "object", "properties": { - "members": { - "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", + "nextPageToken": { + "description": "To retrieve the next page of results, set\n`QueryTestableRolesRequest.page_token` to this value.", + "type": "string" + }, + "permissions": { + "description": "The Permissions testable on the requested resource.", "items": { - "type": "string" - } - }, - "role": { - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", - "type": "string" + "$ref": "Permission" + }, + "type": "array" } }, - "id": "Binding" - }, - "ServiceAccount": { - "description": "A service account in the Identity and Access Management API.\n\nTo create a service account, specify the `project_id` and the `account_id`\nfor the account. The `account_id` is unique within the project, and is used\nto generate the service account email address and a stable\n`unique_id`.\n\nIf the account already exists, the account's resource name is returned\nin util::Status's ResourceInfo.resource_name in the format of\nprojects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}. The caller can\nuse the name in other methods to access the account.\n\nAll other methods can identify the service account using the format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "type": "object", - "properties": { - "oauth2ClientId": { - "description": "@OutputOnly. The OAuth2 client id for the service account.\nThis is used in conjunction with the OAuth2 clientconfig API to make\nthree legged OAuth2 (3LO) flows to access the data of Google users.", - "type": "string" - }, - "uniqueId": { - "description": "@OutputOnly The unique and stable id of the service account.", - "type": "string" - }, - "displayName": { - "description": "Optional. A user-specified description of the service account. Must be\nfewer than 100 UTF-8 bytes.", - "type": "string" - }, - "etag": { - "description": "Used to perform a consistent read-modify-write.", - "format": "byte", - "type": "string" - }, - "name": { - "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\n\nRequests using `-` as a wildcard for the project will infer the project\nfrom the `account` and the `account` value can be the `email` address or\nthe `unique_id` of the service account.\n\nIn responses the resource name will always be in the format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.", - "type": "string" - }, - "email": { - "type": "string", - "description": "@OutputOnly The email address of the service account." - }, - "projectId": { - "description": "@OutputOnly The id of the project that owns the service account.", - "type": "string" - } - }, - "id": "ServiceAccount" + "id": "QueryTestablePermissionsResponse" }, "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object", "properties": {}, - "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`." + "id": "Empty" }, - "QueryGrantableRolesRequest": { - "description": "The grantable role query request.", + "CreateServiceAccountKeyRequest": { + "description": "The service account key create request.", "type": "object", "properties": { - "fullResourceName": { - "description": "Required. The full resource name to query from the list of grantable roles.\n\nThe name follows the Google Cloud Platform resource format.\nFor example, a Cloud Platform project with id `my-project` will be named\n`//cloudresourcemanager.googleapis.com/projects/my-project`.", - "type": "string" - }, - "pageToken": { - "type": "string", - "description": "Optional pagination token returned in an earlier\nQueryGrantableRolesResponse." - }, - "pageSize": { - "description": "Optional limit on the number of roles to include in the response.", - "format": "int32", - "type": "integer" - } - }, - "id": "QueryGrantableRolesRequest" - }, - "TestIamPermissionsResponse": { - "properties": { - "permissions": { - "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "TestIamPermissionsResponse", - "description": "Response message for `TestIamPermissions` method.", - "type": "object" - }, - "ListServiceAccountKeysResponse": { - "id": "ListServiceAccountKeysResponse", - "description": "The service account keys list response.", - "type": "object", - "properties": { - "keys": { - "description": "The public keys for the service account.", - "type": "array", - "items": { - "$ref": "ServiceAccountKey" - } - } - } - }, - "ServiceAccountKey": { - "description": "Represents a service account key.\n\nA service account has two sets of key-pairs: user-managed, and\nsystem-managed.\n\nUser-managed key-pairs can be created and deleted by users. Users are\nresponsible for rotating these keys periodically to ensure security of\ntheir service accounts. Users retain the private key of these key-pairs,\nand Google retains ONLY the public key.\n\nSystem-managed key-pairs are managed automatically by Google, and rotated\ndaily without user intervention. The private key never leaves Google's\nservers to maximize security.\n\nPublic keys for all service accounts are also published at the OAuth2\nService Account API.", - "type": "object", - "properties": { - "privateKeyData": { - "description": "The private key data. Only provided in `CreateServiceAccountKey`\nresponses.", - "format": "byte", - "type": "string" - }, - "publicKeyData": { - "description": "The public key data. Only provided in `GetServiceAccountKey` responses.", - "format": "byte", - "type": "string" - }, - "name": { - "description": "The resource name of the service account key in the following format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.", - "type": "string" - }, - "validBeforeTime": { - "description": "The key can be used before this timestamp.", - "format": "google-datetime", - "type": "string" - }, "keyAlgorithm": { + "description": "Which type of key and algorithm to use for the key.\nThe default is currently a 2K RSA key. However this may change in the\nfuture.", "type": "string", "enumDescriptions": [ "An unspecified key algorithm.", @@ -374,8 +62,424 @@ "KEY_ALG_UNSPECIFIED", "KEY_ALG_RSA_1024", "KEY_ALG_RSA_2048" + ] + }, + "privateKeyType": { + "description": "The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the\ndefault output format.", + "type": "string", + "enumDescriptions": [ + "Unspecified. Equivalent to `TYPE_GOOGLE_CREDENTIALS_FILE`.", + "PKCS12 format.\nThe password for the PKCS12 file is `notasecret`.\nFor more information, see https://tools.ietf.org/html/rfc7292.", + "Google Credentials File format." ], - "description": "Specifies the algorithm (and possibly key size) for the key." + "enum": [ + "TYPE_UNSPECIFIED", + "TYPE_PKCS12_FILE", + "TYPE_GOOGLE_CREDENTIALS_FILE" + ] + } + }, + "id": "CreateServiceAccountKeyRequest" + }, + "SignJwtResponse": { + "description": "The service account sign JWT response.", + "type": "object", + "properties": { + "signedJwt": { + "description": "The signed JWT.", + "type": "string" + }, + "keyId": { + "description": "The id of the key used to sign the JWT.", + "type": "string" + } + }, + "id": "SignJwtResponse" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + } + }, + "id": "Policy" + }, + "ListRolesResponse": { + "description": "The response containing the roles defined under a resource.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "To retrieve the next page of results, set\n`ListRolesRequest.page_token` to this value.", + "type": "string" + }, + "roles": { + "description": "The Roles defined on this resource.", + "items": { + "$ref": "Role" + }, + "type": "array" + } + }, + "id": "ListRolesResponse" + }, + "AuditData": { + "description": "Audit log information specific to Cloud IAM. This message is serialized\nas an `Any` type in the `ServiceData` message of an\n`AuditLog` message.", + "type": "object", + "properties": { + "policyDelta": { + "$ref": "PolicyDelta", + "description": "Policy delta between the original policy and the newly set policy." + } + }, + "id": "AuditData" + }, + "BindingDelta": { + "description": "One delta entry for Binding. Each individual change (only one member in each\nentry) to a binding will be a separate entry.", + "type": "object", + "properties": { + "condition": { + "description": "The condition that is associated with this binding.\nThis field is GOOGLE_INTERNAL.\nThis field is not logged in IAM side because it's only for audit logging.\nOptional", + "$ref": "Expr" + }, + "member": { + "description": "A single identity requesting access for a Cloud Platform resource.\nFollows the same format of Binding.members.\nRequired", + "type": "string" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + }, + "action": { + "description": "The action that was performed on a Binding.\nRequired", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Addition of a Binding.", + "Removal of a Binding." + ], + "enum": [ + "ACTION_UNSPECIFIED", + "ADD", + "REMOVE" + ] + } + }, + "id": "BindingDelta" + }, + "UndeleteRoleRequest": { + "description": "The request to undelete an existing role.", + "type": "object", + "properties": { + "etag": { + "format": "byte", + "description": "Used to perform a consistent read-modify-write.", + "type": "string" + } + }, + "id": "UndeleteRoleRequest" + }, + "CreateServiceAccountRequest": { + "description": "The service account create request.", + "type": "object", + "properties": { + "serviceAccount": { + "$ref": "ServiceAccount", + "description": "The ServiceAccount resource to create.\nCurrently, only the following values are user assignable:\n`display_name` ." + }, + "accountId": { + "description": "Required. The account id that is used to generate the service account\nemail address and a stable unique id. It is unique within a project,\nmust be 6-30 characters long, and match the regular expression\n`[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035.", + "type": "string" + } + }, + "id": "CreateServiceAccountRequest" + }, + "Role": { + "description": "A role in the Identity and Access Management API.", + "type": "object", + "properties": { + "description": { + "description": "Optional. A human-readable description for the role.", + "type": "string" + }, + "etag": { + "format": "byte", + "description": "Used to perform a consistent read-modify-write.", + "type": "string" + }, + "stage": { + "enumDescriptions": [ + "The user has indicated this role is currently in an alpha phase.", + "The user has indicated this role is currently in a beta phase.", + "The user has indicated this role is generally available.", + "The user has indicated this role is being deprecated.", + "This role is disabled and will not contribute permissions to any members\nit is granted to in policies.", + "The user has indicated this role is currently in an eap phase." + ], + "enum": [ + "ALPHA", + "BETA", + "GA", + "DEPRECATED", + "DISABLED", + "EAP" + ], + "description": "The current launch stage of the role.", + "type": "string" + }, + "name": { + "description": "The name of the role.\n\nWhen Role is used in CreateRole, the role name must not be set.\n\nWhen Role is used in output and other input such as UpdateRole, the role\nname is the complete path, e.g., roles/logging.viewer for curated roles\nand organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles.", + "type": "string" + }, + "deleted": { + "description": "The current deleted state of the role. This field is read only.\nIt will be ignored in calls to CreateRole and UpdateRole.", + "type": "boolean" + }, + "title": { + "description": "Optional. A human-readable title for the role. Typically this\nis limited to 100 UTF-8 bytes.", + "type": "string" + }, + "includedPermissions": { + "description": "The names of the permissions this role grants when bound in an IAM policy.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "Role" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" + }, + "Expr": { + "description": "Represents an expression text. Example:\n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\"", + "type": "object", + "properties": { + "description": { + "description": "An optional description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI.", + "type": "string" + }, + "expression": { + "description": "Textual representation of an expression in\nCommon Expression Language syntax.\n\nThe application context of the containing message determines which\nwell-known feature set of CEL is supported.", + "type": "string" + }, + "location": { + "description": "An optional string indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file.", + "type": "string" + }, + "title": { + "description": "An optional title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.", + "type": "string" + } + }, + "id": "Expr" + }, + "ServiceAccount": { + "description": "A service account in the Identity and Access Management API.\n\nTo create a service account, specify the `project_id` and the `account_id`\nfor the account. The `account_id` is unique within the project, and is used\nto generate the service account email address and a stable\n`unique_id`.\n\nIf the account already exists, the account's resource name is returned\nin util::Status's ResourceInfo.resource_name in the format of\nprojects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}. The caller can\nuse the name in other methods to access the account.\n\nAll other methods can identify the service account using the format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", + "type": "object", + "properties": { + "displayName": { + "description": "Optional. A user-specified description of the service account. Must be\nfewer than 100 UTF-8 bytes.", + "type": "string" + }, + "etag": { + "format": "byte", + "description": "Used to perform a consistent read-modify-write.", + "type": "string" + }, + "email": { + "description": "@OutputOnly The email address of the service account.", + "type": "string" + }, + "name": { + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\n\nRequests using `-` as a wildcard for the project will infer the project\nfrom the `account` and the `account` value can be the `email` address or\nthe `unique_id` of the service account.\n\nIn responses the resource name will always be in the format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.", + "type": "string" + }, + "projectId": { + "description": "@OutputOnly The id of the project that owns the service account.", + "type": "string" + }, + "oauth2ClientId": { + "description": "@OutputOnly. The OAuth2 client id for the service account.\nThis is used in conjunction with the OAuth2 clientconfig API to make\nthree legged OAuth2 (3LO) flows to access the data of Google users.", + "type": "string" + }, + "uniqueId": { + "description": "@OutputOnly The unique and stable id of the service account.", + "type": "string" + } + }, + "id": "ServiceAccount" + }, + "QueryGrantableRolesRequest": { + "description": "The grantable role query request.", + "type": "object", + "properties": { + "pageSize": { + "format": "int32", + "description": "Optional limit on the number of roles to include in the response.", + "type": "integer" + }, + "view": { + "type": "string", + "enumDescriptions": [ + "Omits the `included_permissions` field.\nThis is the default value.", + "Returns all fields." + ], + "enum": [ + "BASIC", + "FULL" + ] + }, + "fullResourceName": { + "description": "Required. The full resource name to query from the list of grantable roles.\n\nThe name follows the Google Cloud Platform resource format.\nFor example, a Cloud Platform project with id `my-project` will be named\n`//cloudresourcemanager.googleapis.com/projects/my-project`.", + "type": "string" + }, + "pageToken": { + "description": "Optional pagination token returned in an earlier\nQueryGrantableRolesResponse.", + "type": "string" + } + }, + "id": "QueryGrantableRolesRequest" + }, + "CreateRoleRequest": { + "description": "The request to create a new role.", + "type": "object", + "properties": { + "roleId": { + "description": "The role id to use for this role.", + "type": "string" + }, + "role": { + "description": "The Role resource to create.", + "$ref": "Role" + } + }, + "id": "CreateRoleRequest" + }, + "ListServiceAccountKeysResponse": { + "description": "The service account keys list response.", + "type": "object", + "properties": { + "keys": { + "description": "The public keys for the service account.", + "items": { + "$ref": "ServiceAccountKey" + }, + "type": "array" + } + }, + "id": "ListServiceAccountKeysResponse" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse" + }, + "QueryTestablePermissionsRequest": { + "description": "A request to get permissions which can be tested on a resource.", + "type": "object", + "properties": { + "fullResourceName": { + "description": "Required. The full resource name to query from the list of testable\npermissions.\n\nThe name follows the Google Cloud Platform resource format.\nFor example, a Cloud Platform project with id `my-project` will be named\n`//cloudresourcemanager.googleapis.com/projects/my-project`.", + "type": "string" + }, + "pageToken": { + "description": "Optional pagination token returned in an earlier\nQueryTestablePermissionsRequest.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional limit on the number of permissions to include in the response.", + "type": "integer" + } + }, + "id": "QueryTestablePermissionsRequest" + }, + "ServiceAccountKey": { + "description": "Represents a service account key.\n\nA service account has two sets of key-pairs: user-managed, and\nsystem-managed.\n\nUser-managed key-pairs can be created and deleted by users. Users are\nresponsible for rotating these keys periodically to ensure security of\ntheir service accounts. Users retain the private key of these key-pairs,\nand Google retains ONLY the public key.\n\nSystem-managed key-pairs are managed automatically by Google, and rotated\ndaily without user intervention. The private key never leaves Google's\nservers to maximize security.\n\nPublic keys for all service accounts are also published at the OAuth2\nService Account API.", + "type": "object", + "properties": { + "name": { + "description": "The resource name of the service account key in the following format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.", + "type": "string" + }, + "validBeforeTime": { + "format": "google-datetime", + "description": "The key can be used before this timestamp.", + "type": "string" + }, + "keyAlgorithm": { + "description": "Specifies the algorithm (and possibly key size) for the key.", + "type": "string", + "enumDescriptions": [ + "An unspecified key algorithm.", + "1k RSA Key.", + "2k RSA Key." + ], + "enum": [ + "KEY_ALG_UNSPECIFIED", + "KEY_ALG_RSA_1024", + "KEY_ALG_RSA_2048" + ] + }, + "validAfterTime": { + "format": "google-datetime", + "description": "The key can be used after this timestamp.", + "type": "string" }, "privateKeyType": { "enumDescriptions": [ @@ -391,58 +495,167 @@ "description": "The output format for the private key.\nOnly provided in `CreateServiceAccountKey` responses, not\nin `GetServiceAccountKey` or `ListServiceAccountKey` responses.\n\nGoogle never exposes system-managed private keys, and never retains\nuser-managed private keys.", "type": "string" }, - "validAfterTime": { - "description": "The key can be used after this timestamp.", - "format": "google-datetime", + "privateKeyData": { + "format": "byte", + "description": "The private key data. Only provided in `CreateServiceAccountKey`\nresponses. Make sure to keep the private key data secure because it\nallows for the assertion of the service account identity.\nWhen decoded, the private key data can be used to authenticate with\nGoogle API client libraries and with\n\u003ca href=\"/sdk/gcloud/reference/auth/activate-service-account\"\u003egcloud\nauth activate-service-account\u003c/a\u003e.", + "type": "string" + }, + "publicKeyData": { + "format": "byte", + "description": "The public key data. Only provided in `GetServiceAccountKey` responses.", "type": "string" } }, "id": "ServiceAccountKey" }, - "CreateServiceAccountKeyRequest": { - "description": "The service account key create request.", + "SignBlobResponse": { + "description": "The service account sign blob response.", "type": "object", "properties": { - "privateKeyType": { - "description": "The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the\ndefault output format.", - "type": "string", - "enumDescriptions": [ - "Unspecified. Equivalent to `TYPE_GOOGLE_CREDENTIALS_FILE`.", - "PKCS12 format.\nThe password for the PKCS12 file is `notasecret`.\nFor more information, see https://tools.ietf.org/html/rfc7292.", - "Google Credentials File format." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "TYPE_PKCS12_FILE", - "TYPE_GOOGLE_CREDENTIALS_FILE" - ] + "signature": { + "format": "byte", + "description": "The signed blob.", + "type": "string" }, - "includePublicKeyData": { - "type": "boolean" - }, - "keyAlgorithm": { - "description": "Which type of key and algorithm to use for the key.\nThe default is currently a 2K RSA key. However this may change in the\nfuture.", - "type": "string", - "enumDescriptions": [ - "An unspecified key algorithm.", - "1k RSA Key.", - "2k RSA Key." - ], - "enum": [ - "KEY_ALG_UNSPECIFIED", - "KEY_ALG_RSA_1024", - "KEY_ALG_RSA_2048" - ] + "keyId": { + "description": "The id of the key used to sign the blob.", + "type": "string" } }, - "id": "CreateServiceAccountKeyRequest" + "id": "SignBlobResponse" + }, + "Permission": { + "description": "A permission which can be included by a role.", + "type": "object", + "properties": { + "onlyInPredefinedRoles": { + "description": "This permission can ONLY be used in predefined roles.", + "type": "boolean" + }, + "title": { + "description": "The title of this Permission.", + "type": "string" + }, + "description": { + "description": "A brief description of what this Permission is used for.", + "type": "string" + }, + "customRolesSupportLevel": { + "description": "The current custom role support level.", + "type": "string", + "enumDescriptions": [ + "Permission is fully supported for custom role use.", + "Permission is being tested to check custom role compatibility.", + "Permission is not supported for custom role use." + ], + "enum": [ + "SUPPORTED", + "TESTING", + "NOT_SUPPORTED" + ] + }, + "stage": { + "description": "The current launch stage of the permission.", + "type": "string", + "enumDescriptions": [ + "The permission is currently in an alpha phase.", + "The permission is currently in a beta phase.", + "The permission is generally available.", + "The permission is being deprecated." + ], + "enum": [ + "ALPHA", + "BETA", + "GA", + "DEPRECATED" + ] + }, + "name": { + "description": "The name of this Permission.", + "type": "string" + } + }, + "id": "Permission" + }, + "SignJwtRequest": { + "description": "The service account sign JWT request.", + "type": "object", + "properties": { + "payload": { + "description": "The JWT payload to sign, a JSON JWT Claim set.", + "type": "string" + } + }, + "id": "SignJwtRequest" + }, + "PolicyDelta": { + "description": "The difference delta between two policies.", + "type": "object", + "properties": { + "bindingDeltas": { + "description": "The delta for Bindings between two policies.", + "items": { + "$ref": "BindingDelta" + }, + "type": "array" + } + }, + "id": "PolicyDelta" + }, + "ListServiceAccountsResponse": { + "description": "The service account list response.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "To retrieve the next page of results, set\nListServiceAccountsRequest.page_token\nto this value.", + "type": "string" + }, + "accounts": { + "description": "The list of matching service accounts.", + "items": { + "$ref": "ServiceAccount" + }, + "type": "array" + } + }, + "id": "ListServiceAccountsResponse" + }, + "QueryGrantableRolesResponse": { + "description": "The grantable role query response.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "To retrieve the next page of results, set\n`QueryGrantableRolesRequest.page_token` to this value.", + "type": "string" + }, + "roles": { + "description": "The list of matching roles.", + "items": { + "$ref": "Role" + }, + "type": "array" + } + }, + "id": "QueryGrantableRolesResponse" + }, + "SignBlobRequest": { + "description": "The service account sign blob request.", + "type": "object", + "properties": { + "bytesToSign": { + "format": "byte", + "description": "The bytes to sign.", + "type": "string" + } + }, + "id": "SignBlobRequest" } }, - "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, + "protocol": "rest", "canonicalName": "iam", "auth": { "oauth2": { @@ -457,187 +670,216 @@ "ownerDomain": "google.com", "name": "iam", "batchPath": "batch", + "fullyEncodeReservedExpansion": true, "title": "Google Identity and Access Management (IAM) API", "ownerName": "Google", "resources": { "projects": { "resources": { - "serviceAccounts": { + "roles": { "methods": { - "signBlob": { + "get": { + "description": "Gets a Role definition.", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the role in one of the following formats:\n`roles/{ROLE_NAME}`\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/roles/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}", + "id": "iam.projects.roles.get", + "path": "v1/{+name}" + }, + "patch": { + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.projects.roles.patch", + "description": "Updates a Role definition.", + "request": { + "$ref": "Role" + }, + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Role" + }, + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "A mask describing which fields in the Role have changed.", + "type": "string" + }, + "name": { + "location": "path", + "description": "The resource name of the role in one of the following formats:\n`roles/{ROLE_NAME}`\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/roles/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "undelete": { + "description": "Undelete a Role, bringing it back in its previous state.", + "request": { + "$ref": "UndeleteRoleRequest" + }, "httpMethod": "POST", "parameterOrder": [ "name" ], "response": { - "$ref": "SignBlobResponse" + "$ref": "Role" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { "name": { "location": "path", - "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, + "description": "The resource name of the role in one of the following formats:\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", "type": "string", - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" + "required": true, + "pattern": "^projects/[^/]+/roles/[^/]+$" } }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob", - "id": "iam.projects.serviceAccounts.signBlob", - "path": "v1/{+name}:signBlob", - "description": "Signs a blob using a service account's system-managed private key.", - "request": { - "$ref": "SignBlobRequest" - } + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}:undelete", + "path": "v1/{+name}:undelete", + "id": "iam.projects.roles.undelete" }, - "list": { + "delete": { + "description": "Soft deletes a role. The role is suspended and cannot be used to create new\nIAM Policy Bindings.\nThe Role will not be included in `ListRoles()` unless `show_deleted` is set\nin the `ListRolesRequest`. The Role contains the deleted boolean set.\nExisting Bindings remains, but are inactive. The Role can be undeleted\nwithin 7 days. After 7 days the Role is deleted and all Bindings associated\nwith the role are removed.", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "name": { "location": "path", - "description": "Required. The resource name of the project associated with the service\naccounts, such as `projects/my-project-123`.", - "required": true, + "description": "The resource name of the role in one of the following formats:\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", "type": "string", - "pattern": "^projects/[^/]+$" + "required": true, + "pattern": "^projects/[^/]+/roles/[^/]+$" }, - "pageToken": { - "description": "Optional pagination token returned in an earlier\nListServiceAccountsResponse.next_page_token.", + "etag": { + "format": "byte", + "description": "Used to perform a consistent read-modify-write.", "type": "string", "location": "query" - }, + } + }, + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}", + "id": "iam.projects.roles.delete", + "path": "v1/{+name}" + }, + "list": { + "description": "Lists the Roles defined on a resource.", + "httpMethod": "GET", + "response": { + "$ref": "ListRolesResponse" + }, + "parameterOrder": [ + "parent" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { "pageSize": { "location": "query", - "description": "Optional limit on the number of service accounts to include in the\nresponse. Further accounts can subsequently be obtained by including the\nListServiceAccountsResponse.next_page_token\nin a subsequent request.", "format": "int32", + "description": "Optional limit on the number of roles to include in the response.", "type": "integer" - } - }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts", - "id": "iam.projects.serviceAccounts.list", - "path": "v1/{+name}/serviceAccounts", - "description": "Lists ServiceAccounts for a project.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ListServiceAccountsResponse" - } - }, - "signJwt": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "SignJwtResponse" - }, - "parameters": { - "name": { - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", - "location": "path", - "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt", - "id": "iam.projects.serviceAccounts.signJwt", - "path": "v1/{+name}:signJwt", - "request": { - "$ref": "SignJwtRequest" - }, - "description": "Signs a JWT using a service account's system-managed private key.\n\nIf no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an\nan expiry time of one hour by default. If you request an expiry time of\nmore than one hour, the request will fail." - }, - "setIamPolicy": { - "description": "Sets the IAM access control policy for a\nServiceAccount.", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "resource": { - "required": true, + }, + "view": { + "description": "Optional view for the returned Role objects.", "type": "string", - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "query", + "enum": [ + "BASIC", + "FULL" + ] + }, + "parent": { "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field." + "description": "The resource name of the parent resource in one of the following formats:\n`` (empty string) -- this refers to curated roles.\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "showDeleted": { + "location": "query", + "description": "Include Roles that have been deleted.", + "type": "boolean" + }, + "pageToken": { + "description": "Optional pagination token returned in an earlier ListRolesResponse.", + "type": "string", + "location": "query" } }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:setIamPolicy", - "id": "iam.projects.serviceAccounts.setIamPolicy", - "path": "v1/{+resource}:setIamPolicy" + "flatPath": "v1/projects/{projectsId}/roles", + "path": "v1/{+parent}/roles", + "id": "iam.projects.roles.list" }, "create": { - "flatPath": "v1/projects/{projectsId}/serviceAccounts", - "path": "v1/{+name}/serviceAccounts", - "id": "iam.projects.serviceAccounts.create", - "description": "Creates a ServiceAccount\nand returns it.", + "description": "Creates a new Role.", "request": { - "$ref": "CreateServiceAccountRequest" + "$ref": "CreateRoleRequest" }, - "response": { - "$ref": "ServiceAccount" - }, - "parameterOrder": [ - "name" - ], "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Required. The resource name of the project associated with the service\naccounts, such as `projects/my-project-123`.", - "required": true, - "type": "string" - } - } - }, - "getIamPolicy": { - "httpMethod": "POST", - "response": { - "$ref": "Policy" - }, "parameterOrder": [ - "resource" + "parent" ], + "response": { + "$ref": "Role" + }, "parameters": { - "resource": { + "parent": { "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, + "description": "The resource name of the parent resource in one of the following formats:\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", "type": "string", - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" + "required": true, + "pattern": "^projects/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:getIamPolicy", - "id": "iam.projects.serviceAccounts.getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "description": "Returns the IAM access control policy for a\nServiceAccount." - }, + "flatPath": "v1/projects/{projectsId}/roles", + "path": "v1/{+parent}/roles", + "id": "iam.projects.roles.create" + } + } + }, + "serviceAccounts": { + "methods": { "get": { + "description": "Gets a ServiceAccount.", "httpMethod": "GET", "response": { "$ref": "ServiceAccount" @@ -645,78 +887,77 @@ "parameterOrder": [ "name" ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { "name": { "location": "path", "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, "type": "string", + "required": true, "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", - "id": "iam.projects.serviceAccounts.get", "path": "v1/{+name}", - "description": "Gets a ServiceAccount." + "id": "iam.projects.serviceAccounts.get" }, "update": { + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", + "path": "v1/{+name}", + "id": "iam.projects.serviceAccounts.update", "description": "Updates a ServiceAccount.\n\nCurrently, only the following fields are updatable:\n`display_name` .\nThe `etag` is mandatory.", "request": { "$ref": "ServiceAccount" }, - "response": { - "$ref": "ServiceAccount" - }, + "httpMethod": "PUT", "parameterOrder": [ "name" ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "response": { + "$ref": "ServiceAccount" + }, "parameters": { "name": { - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", "location": "path", "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\n\nRequests using `-` as a wildcard for the project will infer the project\nfrom the `account` and the `account` value can be the `email` address or\nthe `unique_id` of the service account.\n\nIn responses the resource name will always be in the format\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.", + "type": "string", "required": true, - "type": "string" + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" } }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", - "path": "v1/{+name}", - "id": "iam.projects.serviceAccounts.update" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, "testIamPermissions": { - "id": "iam.projects.serviceAccounts.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", "request": { "$ref": "TestIamPermissionsRequest" }, "description": "Tests the specified permissions against the IAM access control policy\nfor a ServiceAccount.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], "response": { "$ref": "TestIamPermissionsResponse" }, - "parameters": { - "resource": { - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:testIamPermissions" + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:testIamPermissions", + "id": "iam.projects.serviceAccounts.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions" }, "delete": { "httpMethod": "DELETE", @@ -731,52 +972,196 @@ ], "parameters": { "name": { + "location": "path", "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", + "path": "v1/{+name}", + "id": "iam.projects.serviceAccounts.delete", + "description": "Deletes a ServiceAccount." + }, + "signBlob": { + "request": { + "$ref": "SignBlobRequest" + }, + "description": "Signs a blob using a service account's system-managed private key.", + "response": { + "$ref": "SignBlobResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", + "type": "string", + "required": true, "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", "location": "path" } }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", - "id": "iam.projects.serviceAccounts.delete", - "path": "v1/{+name}", - "description": "Deletes a ServiceAccount." + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob", + "id": "iam.projects.serviceAccounts.signBlob", + "path": "v1/{+name}:signBlob" + }, + "list": { + "description": "Lists ServiceAccounts for a project.", + "httpMethod": "GET", + "response": { + "$ref": "ListServiceAccountsResponse" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional pagination token returned in an earlier\nListServiceAccountsResponse.next_page_token.", + "type": "string" + }, + "name": { + "location": "path", + "description": "Required. The resource name of the project associated with the service\naccounts, such as `projects/my-project-123`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional limit on the number of service accounts to include in the\nresponse. Further accounts can subsequently be obtained by including the\nListServiceAccountsResponse.next_page_token\nin a subsequent request.", + "type": "integer" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts", + "path": "v1/{+name}/serviceAccounts", + "id": "iam.projects.serviceAccounts.list" + }, + "setIamPolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "iam.projects.serviceAccounts.setIamPolicy", + "description": "Sets the IAM access control policy for a\nServiceAccount.", + "request": { + "$ref": "SetIamPolicyRequest" + } + }, + "signJwt": { + "description": "Signs a JWT using a service account's system-managed private key.\n\nIf no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an\nan expiry time of one hour by default. If you request an expiry time of\nmore than one hour, the request will fail.", + "request": { + "$ref": "SignJwtRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "SignJwtResponse" + }, + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt", + "path": "v1/{+name}:signJwt", + "id": "iam.projects.serviceAccounts.signJwt" + }, + "create": { + "request": { + "$ref": "CreateServiceAccountRequest" + }, + "description": "Creates a ServiceAccount\nand returns it.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ServiceAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the project associated with the service\naccounts, such as `projects/my-project-123`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts", + "path": "v1/{+name}/serviceAccounts", + "id": "iam.projects.serviceAccounts.create" + }, + "getIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:getIamPolicy", + "id": "iam.projects.serviceAccounts.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "description": "Returns the IAM access control policy for a\nServiceAccount." } }, "resources": { "keys": { "methods": { - "create": { - "path": "v1/{+name}/keys", - "id": "iam.projects.serviceAccounts.keys.create", - "request": { - "$ref": "CreateServiceAccountKeyRequest" - }, - "description": "Creates a ServiceAccountKey\nand returns it.", - "response": { - "$ref": "ServiceAccountKey" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "parameters": { - "name": { - "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys" - }, "delete": { - "description": "Deletes a ServiceAccountKey.", "response": { "$ref": "Empty" }, @@ -784,67 +1169,28 @@ "name" ], "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { "name": { "location": "path", "description": "The resource name of the service account key in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, "type": "string", + "required": true, "pattern": "^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}", + "id": "iam.projects.serviceAccounts.keys.delete", "path": "v1/{+name}", - "id": "iam.projects.serviceAccounts.keys.delete" - }, - "list": { - "description": "Lists ServiceAccountKeys.", - "response": { - "$ref": "ListServiceAccountKeysResponse" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "location": "path", - "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\n\nUsing `-` as a wildcard for the project, will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" - }, - "keyTypes": { - "description": "Filters the types of keys the user wants to include in the list\nresponse. Duplicate key types are not allowed. If no key type\nis provided, all keys are returned.", - "type": "string", - "repeated": true, - "location": "query", - "enum": [ - "KEY_TYPE_UNSPECIFIED", - "USER_MANAGED", - "SYSTEM_MANAGED" - ] - } - }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys", - "path": "v1/{+name}/keys", - "id": "iam.projects.serviceAccounts.keys.list" + "description": "Deletes a ServiceAccountKey." }, "get": { - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}", - "path": "v1/{+name}", - "id": "iam.projects.serviceAccounts.keys.get", - "description": "Gets the ServiceAccountKey\nby key id.", + "httpMethod": "GET", "response": { "$ref": "ServiceAccountKey" }, - "httpMethod": "GET", "parameterOrder": [ "name" ], @@ -860,16 +1206,84 @@ ] }, "name": { - "location": "path", "description": "The resource name of the service account key in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.\n\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", - "required": true, "type": "string", - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$" + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$", + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] + ], + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}", + "path": "v1/{+name}", + "id": "iam.projects.serviceAccounts.keys.get", + "description": "Gets the ServiceAccountKey\nby key id." + }, + "list": { + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys", + "path": "v1/{+name}/keys", + "id": "iam.projects.serviceAccounts.keys.list", + "description": "Lists ServiceAccountKeys.", + "httpMethod": "GET", + "response": { + "$ref": "ListServiceAccountKeysResponse" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\n\nUsing `-` as a wildcard for the project, will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path" + }, + "keyTypes": { + "location": "query", + "enum": [ + "KEY_TYPE_UNSPECIFIED", + "USER_MANAGED", + "SYSTEM_MANAGED" + ], + "description": "Filters the types of keys the user wants to include in the list\nresponse. Duplicate key types are not allowed. If no key type\nis provided, all keys are returned.", + "type": "string", + "repeated": true + } + } + }, + "create": { + "response": { + "$ref": "ServiceAccountKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.\nUsing `-` as a wildcard for the project will infer the project from\nthe account. The `account` value can be the `email` address or the\n`unique_id` of the service account.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys", + "id": "iam.projects.serviceAccounts.keys.create", + "path": "v1/{+name}/keys", + "request": { + "$ref": "CreateServiceAccountKeyRequest" + }, + "description": "Creates a ServiceAccountKey\nand returns it." } } } @@ -877,76 +1291,363 @@ } } }, + "permissions": { + "methods": { + "queryTestablePermissions": { + "flatPath": "v1/permissions:queryTestablePermissions", + "path": "v1/permissions:queryTestablePermissions", + "id": "iam.permissions.queryTestablePermissions", + "description": "Lists the permissions testable on a resource.\nA permission is testable if it can be tested for an identity on a resource.", + "request": { + "$ref": "QueryTestablePermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "QueryTestablePermissionsResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "roles": { "methods": { + "get": { + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Role" + }, + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the role in one of the following formats:\n`roles/{ROLE_NAME}`\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^roles/[^/]+$" + } + }, + "flatPath": "v1/roles/{rolesId}", + "id": "iam.roles.get", + "path": "v1/{+name}", + "description": "Gets a Role definition." + }, + "list": { + "description": "Lists the Roles defined on a resource.", + "response": { + "$ref": "ListRolesResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "format": "int32", + "description": "Optional limit on the number of roles to include in the response.", + "type": "integer", + "location": "query" + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Optional view for the returned Role objects.", + "type": "string" + }, + "parent": { + "description": "The resource name of the parent resource in one of the following formats:\n`` (empty string) -- this refers to curated roles.\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", + "type": "string", + "location": "query" + }, + "showDeleted": { + "description": "Include Roles that have been deleted.", + "type": "boolean", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "Optional pagination token returned in an earlier ListRolesResponse.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/roles", + "id": "iam.roles.list", + "path": "v1/roles" + }, "queryGrantableRoles": { + "request": { + "$ref": "QueryGrantableRolesRequest" + }, + "description": "Queries roles that can be granted on a particular resource.\nA role is grantable if it can be used as the role in a binding for a policy\nfor that resource.", + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "QueryGrantableRolesResponse" }, - "parameterOrder": [], - "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": {}, "flatPath": "v1/roles:queryGrantableRoles", "path": "v1/roles:queryGrantableRoles", - "id": "iam.roles.queryGrantableRoles", - "description": "Queries roles that can be granted on a particular resource.\nA role is grantable if it can be used as the role in a binding for a policy\nfor that resource.", - "request": { - "$ref": "QueryGrantableRolesRequest" + "id": "iam.roles.queryGrantableRoles" + } + } + }, + "organizations": { + "resources": { + "roles": { + "methods": { + "patch": { + "request": { + "$ref": "Role" + }, + "description": "Updates a Role definition.", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "A mask describing which fields in the Role have changed.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The resource name of the role in one of the following formats:\n`roles/{ROLE_NAME}`\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}", + "id": "iam.organizations.roles.patch", + "path": "v1/{+name}" + }, + "undelete": { + "description": "Undelete a Role, bringing it back in its previous state.", + "request": { + "$ref": "UndeleteRoleRequest" + }, + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the role in one of the following formats:\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/roles/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}:undelete", + "id": "iam.organizations.roles.undelete", + "path": "v1/{+name}:undelete" + }, + "get": { + "description": "Gets a Role definition.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Role" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name of the role in one of the following formats:\n`roles/{ROLE_NAME}`\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.organizations.roles.get" + }, + "delete": { + "description": "Soft deletes a role. The role is suspended and cannot be used to create new\nIAM Policy Bindings.\nThe Role will not be included in `ListRoles()` unless `show_deleted` is set\nin the `ListRolesRequest`. The Role contains the deleted boolean set.\nExisting Bindings remains, but are inactive. The Role can be undeleted\nwithin 7 days. After 7 days the Role is deleted and all Bindings associated\nwith the role are removed.", + "httpMethod": "DELETE", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "etag": { + "format": "byte", + "description": "Used to perform a consistent read-modify-write.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The resource name of the role in one of the following formats:\n`organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}`\n`projects/{PROJECT_ID}/roles/{ROLE_NAME}`", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.organizations.roles.delete" + }, + "list": { + "description": "Lists the Roles defined on a resource.", + "response": { + "$ref": "ListRolesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "showDeleted": { + "location": "query", + "description": "Include Roles that have been deleted.", + "type": "boolean" + }, + "pageToken": { + "description": "Optional pagination token returned in an earlier ListRolesResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Optional limit on the number of roles to include in the response.", + "type": "integer", + "location": "query" + }, + "view": { + "description": "Optional view for the returned Role objects.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "FULL" + ] + }, + "parent": { + "description": "The resource name of the parent resource in one of the following formats:\n`` (empty string) -- this refers to curated roles.\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}/roles", + "id": "iam.organizations.roles.list", + "path": "v1/{+parent}/roles" + }, + "create": { + "request": { + "$ref": "CreateRoleRequest" + }, + "description": "Creates a new Role.", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "The resource name of the parent resource in one of the following formats:\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles", + "id": "iam.organizations.roles.create", + "path": "v1/{+parent}/roles" + } } } } } }, "parameters": { - "key": { - "type": "string", - "location": "query", - "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." - }, - "access_token": { - "type": "string", - "location": "query", - "description": "OAuth access token." - }, "quotaUser": { - "type": "string", "location": "query", - "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." - }, - "pp": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Pretty-print response." - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", + "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.", "type": "string" }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, "oauth_token": { + "location": "query", "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", "type": "string", "location": "query" }, "upload_protocol": { + "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" + "type": "string" }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "fields": { "description": "Selector specifying which fields to include in a partial response.", @@ -954,9 +1655,9 @@ "location": "query" }, "callback": { - "location": "query", "description": "JSONP", - "type": "string" + "type": "string", + "location": "query" }, "$.xgafv": { "enumDescriptions": [ @@ -972,26 +1673,30 @@ "type": "string" }, "alt": { - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", "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", - "description": "Data format for response." + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" } - }, - "version": "v1", - "baseUrl": "https://iam.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.", - "servicePath": "", - "basePath": "" + } } diff --git a/etc/api/identitytoolkit/v3/crates/1.0.6-api+20170828 b/etc/api/identitytoolkit/v3/crates/1.0.6-api+20170828 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/identitytoolkit/v3/identitytoolkit-api.json b/etc/api/identitytoolkit/v3/identitytoolkit-api.json index cc45b3b351..92f660ec78 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/mRP2pwjx8HZNSfXtE0G7azflT_U\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/YDuUtEWk-s4RoFmU1uyfiL_piZ0\"", "discoveryVersion": "v1", "id": "identitytoolkit:v3", "name": "identitytoolkit", "canonicalName": "Identity Toolkit", "version": "v3", - "revision": "20170425", + "revision": "20170828", "title": "Google Identity Toolkit API", "description": "Help the third party sites to implement federated login.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/identitytoolkit/v3/relyingparty/", "rootUrl": "https://www.googleapis.com/", "servicePath": "identitytoolkit/v3/relyingparty/", - "batchPath": "batch", + "batchPath": "batch/identitytoolkit/v3", "parameters": { "alt": { "type": "string", @@ -387,6 +387,13 @@ "items": { "type": "string" } + }, + "phoneNumber": { + "type": "array", + "description": "Privileged caller can query users by specified phone number.", + "items": { + "type": "string" + } } } }, @@ -481,6 +488,40 @@ } } }, + "IdentitytoolkitRelyingpartySendVerificationCodeRequest": { + "id": "IdentitytoolkitRelyingpartySendVerificationCodeRequest", + "type": "object", + "description": "Request for Identitytoolkit-SendVerificationCode", + "properties": { + "iosReceipt": { + "type": "string", + "description": "Receipt of successful app token validation with APNS." + }, + "iosSecret": { + "type": "string", + "description": "Secret delivered to iOS app via APNS." + }, + "phoneNumber": { + "type": "string", + "description": "The phone number to send the verification code to in E.164 format." + }, + "recaptchaToken": { + "type": "string", + "description": "Recaptcha solution." + } + } + }, + "IdentitytoolkitRelyingpartySendVerificationCodeResponse": { + "id": "IdentitytoolkitRelyingpartySendVerificationCodeResponse", + "type": "object", + "description": "Response for Identitytoolkit-SendVerificationCode", + "properties": { + "sessionInfo": { + "type": "string", + "description": "Encrypted session information" + } + } + }, "IdentitytoolkitRelyingpartySetAccountInfoRequest": { "id": "IdentitytoolkitRelyingpartySetAccountInfoRequest", "type": "object", @@ -499,6 +540,10 @@ "description": "The timestamp when the account is created.", "format": "int64" }, + "customAttributes": { + "type": "string", + "description": "The custom attributes to be set in the user's id token." + }, "delegatedProjectNumber": { "type": "string", "description": "GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration.", @@ -559,6 +604,10 @@ "type": "string", "description": "The new password of the user." }, + "phoneNumber": { + "type": "string", + "description": "Privileged caller can update user with specified phone number." + }, "photoUrl": { "type": "string", "description": "The photo url of the user." @@ -725,6 +774,10 @@ "type": "string", "description": "The new password of the user." }, + "phoneNumber": { + "type": "string", + "description": "Privileged caller can create user with specified phone number." + }, "photoUrl": { "type": "string", "description": "The photo url of the user." @@ -740,11 +793,24 @@ "type": "boolean", "description": "Whether allow overwrite existing account when user local_id exists." }, + "blockSize": { + "type": "integer", + "format": "int32" + }, + "cpuMemCost": { + "type": "integer", + "description": "The following 4 fields are for standard scrypt algorithm.", + "format": "int32" + }, "delegatedProjectNumber": { "type": "string", "description": "GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration.", "format": "int64" }, + "dkLen": { + "type": "integer", + "format": "int32" + }, "hashAlgorithm": { "type": "string", "description": "The password hash algorithm." @@ -754,6 +820,10 @@ "description": "Memory cost for hash calculation. Used by scrypt similar algorithms.", "format": "int32" }, + "parallelization": { + "type": "integer", + "format": "int32" + }, "rounds": { "type": "integer", "description": "Rounds for hash calculation. Used by scrypt and similar algorithms.", @@ -906,6 +976,75 @@ } } }, + "IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest": { + "id": "IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest", + "type": "object", + "description": "Request for Identitytoolkit-VerifyPhoneNumber", + "properties": { + "code": { + "type": "string" + }, + "idToken": { + "type": "string" + }, + "operation": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "sessionInfo": { + "type": "string", + "description": "The session info previously returned by IdentityToolkit-SendVerificationCode." + }, + "temporaryProof": { + "type": "string" + }, + "verificationProof": { + "type": "string" + } + } + }, + "IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse": { + "id": "IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse", + "type": "object", + "description": "Response for Identitytoolkit-VerifyPhoneNumber", + "properties": { + "expiresIn": { + "type": "string", + "format": "int64" + }, + "idToken": { + "type": "string" + }, + "isNewUser": { + "type": "boolean" + }, + "localId": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "refreshToken": { + "type": "string" + }, + "temporaryProof": { + "type": "string" + }, + "temporaryProofExpiresIn": { + "type": "string", + "format": "int64" + }, + "verificationProof": { + "type": "string" + }, + "verificationProofExpiresIn": { + "type": "string", + "format": "int64" + } + } + }, "IdpConfig": { "id": "IdpConfig", "type": "object", @@ -1189,6 +1328,10 @@ "description": "User creation timestamp.", "format": "int64" }, + "customAttributes": { + "type": "string", + "description": "The custom attributes to be set in the user's id token." + }, "customAuth": { "type": "boolean", "description": "Whether the user is authenticated by the developer." @@ -1485,6 +1628,10 @@ "type": "string", "description": "The GITKit token for authenticated user." }, + "isNewUser": { + "type": "boolean", + "description": "True if it's a new user sign-in, false if it's a returning user." + }, "kind": { "type": "string", "description": "The fixed string \"identitytoolkit#VerifyCustomTokenResponse\".", @@ -1697,6 +1844,21 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "sendVerificationCode": { + "id": "identitytoolkit.relyingparty.sendVerificationCode", + "path": "sendVerificationCode", + "httpMethod": "POST", + "description": "Send SMS verification code.", + "request": { + "$ref": "IdentitytoolkitRelyingpartySendVerificationCodeRequest" + }, + "response": { + "$ref": "IdentitytoolkitRelyingpartySendVerificationCodeResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "setAccountInfo": { "id": "identitytoolkit.relyingparty.setAccountInfo", "path": "setAccountInfo", @@ -1817,6 +1979,21 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "verifyPhoneNumber": { + "id": "identitytoolkit.relyingparty.verifyPhoneNumber", + "path": "verifyPhoneNumber", + "httpMethod": "POST", + "description": "Verifies ownership of a phone number and creates/updates the user account accordingly.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest" + }, + "response": { + "$ref": "IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } } diff --git a/etc/api/kgsearch/v1/kgsearch-api.json b/etc/api/kgsearch/v1/kgsearch-api.json index a7d90a4080..a4f00c436d 100644 --- a/etc/api/kgsearch/v1/kgsearch-api.json +++ b/etc/api/kgsearch/v1/kgsearch-api.json @@ -1,36 +1,42 @@ { - "version_module": "True", + "ownerName": "Google", + "discoveryVersion": "v1", + "version_module": true, "resources": { "entities": { "methods": { "search": { - "flatPath": "v1/entities:search", "path": "v1/entities:search", "id": "kgsearch.entities.search", "description": "Searches Knowledge Graph for entities that match the constraints.\nA list of matched entities will be returned in response, which will be in\nJSON-LD format and compatible with http://schema.org", + "httpMethod": "GET", + "parameterOrder": [], "response": { "$ref": "SearchResponse" }, - "parameterOrder": [], - "httpMethod": "GET", "parameters": { - "languages": { - "repeated": true, + "indent": { "location": "query", - "description": "The list of language codes (defined in ISO 693) to run the query with,\ne.g. 'en'.", - "type": "string" + "description": "Enables indenting of json results.", + "type": "boolean" }, - "ids": { - "description": "The list of entity id to be used for search instead of query string.\nTo specify multiple ids in the HTTP request, repeat the parameter in the\nURL as in ...?ids=A&ids=B", + "languages": { + "description": "The list of language codes (defined in ISO 693) to run the query with,\ne.g. 'en'.", "type": "string", "repeated": true, "location": "query" }, + "ids": { + "repeated": true, + "location": "query", + "description": "The list of entity id to be used for search instead of query string.\nTo specify multiple ids in the HTTP request, repeat the parameter in the\nURL as in ...?ids=A&ids=B", + "type": "string" + }, "limit": { - "description": "Limits the number of entities to be returned.", + "location": "query", "format": "int32", - "type": "integer", - "location": "query" + "description": "Limits the number of entities to be returned.", + "type": "integer" }, "prefix": { "description": "Enables prefix match against names and aliases of entities", @@ -38,99 +44,41 @@ "location": "query" }, "query": { + "location": "query", "description": "The literal query string for search.", - "type": "string", - "location": "query" + "type": "string" }, "types": { "description": "Restricts returned entities with these types, e.g. Person\n(as defined in http://schema.org/Person). If multiple types are specified,\nreturned entities will contain one or more of these types.", "type": "string", "repeated": true, "location": "query" - }, - "indent": { - "type": "boolean", - "location": "query", - "description": "Enables indenting of json results." } - } + }, + "flatPath": "v1/entities:search" } } } }, "parameters": { - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, "quotaUser": { "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.", "type": "string", "location": "query" }, "pp": { - "type": "boolean", + "description": "Pretty-print response.", "default": "true", - "location": "query", - "description": "Pretty-print response." - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", + "type": "boolean", "location": "query" }, "bearer_token": { + "location": "query", "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", "type": "string", "location": "query" }, @@ -140,46 +88,100 @@ "type": "string" }, "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", + "default": "true", "type": "boolean", - "default": "true" + "location": "query", + "description": "Returns response with indentations and line breaks." + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" } }, "schemas": { "SearchResponse": { + "description": "Response message includes the context and a list of matching results\nwhich contain the detail of associated entities.", "type": "object", "properties": { + "itemListElement": { + "description": "The item list of search results.", + "items": { + "type": "any" + }, + "type": "array" + }, + "@context": { + "description": "The local context applicable for the response. See more details at\nhttp://www.w3.org/TR/json-ld/#context-definitions.", + "type": "any" + }, "@type": { "description": "The schema type of top-level JSON-LD object, e.g. ItemList.", "type": "any" - }, - "@context": { - "type": "any", - "description": "The local context applicable for the response. See more details at\nhttp://www.w3.org/TR/json-ld/#context-definitions." - }, - "itemListElement": { - "description": "The item list of search results.", - "type": "array", - "items": { - "type": "any" - } } }, - "id": "SearchResponse", - "description": "Response message includes the context and a list of matching results\nwhich contain the detail of associated entities." + "id": "SearchResponse" } }, - "protocol": "rest", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, + "protocol": "rest", "version": "v1", "baseUrl": "https://kgsearch.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Searches the Google Knowledge Graph for entities.", "servicePath": "", + "description": "Searches the Google Knowledge Graph for entities.", + "kind": "discovery#restDescription", "rootUrl": "https://kgsearch.googleapis.com/", "basePath": "", "ownerDomain": "google.com", @@ -187,8 +189,6 @@ "batchPath": "batch", "id": "kgsearch:v1", "documentationLink": "https://developers.google.com/knowledge-graph/", - "revision": "20170109", - "title": "Knowledge Graph Search API", - "ownerName": "Google", - "discoveryVersion": "v1" + "revision": "20170925", + "title": "Knowledge Graph Search API" } diff --git a/etc/api/language/v1/language-api.json b/etc/api/language/v1/language-api.json index 32459ba277..7b0c648c49 100644 --- a/etc/api/language/v1/language-api.json +++ b/etc/api/language/v1/language-api.json @@ -1,496 +1,255 @@ { + "canonicalName": "Cloud Natural Language", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-language": { + "description": "Apply machine learning models to reveal the structure and meaning of text" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://language.googleapis.com/", + "ownerDomain": "google.com", + "name": "language", + "batchPath": "batch", + "title": "Google Cloud Natural Language API", + "ownerName": "Google", + "resources": { + "documents": { + "methods": { + "analyzeSentiment": { + "request": { + "$ref": "AnalyzeSentimentRequest" + }, + "description": "Analyzes the sentiment of the provided text.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/documents:analyzeSentiment", + "path": "v1/documents:analyzeSentiment", + "id": "language.documents.analyzeSentiment" + }, + "annotateText": { + "path": "v1/documents:annotateText", + "id": "language.documents.annotateText", + "description": "A convenience method that provides all the features that analyzeSentiment,\nanalyzeEntities, and analyzeSyntax provide in one call.", + "request": { + "$ref": "AnnotateTextRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnnotateTextResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/documents:annotateText" + }, + "analyzeEntitySentiment": { + "response": { + "$ref": "AnalyzeEntitySentimentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/documents:analyzeEntitySentiment", + "id": "language.documents.analyzeEntitySentiment", + "path": "v1/documents:analyzeEntitySentiment", + "description": "Finds entities, similar to AnalyzeEntities in the text and analyzes\nsentiment associated with each entity and its mentions.", + "request": { + "$ref": "AnalyzeEntitySentimentRequest" + } + }, + "analyzeEntities": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnalyzeEntitiesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/documents:analyzeEntities", + "path": "v1/documents:analyzeEntities", + "id": "language.documents.analyzeEntities", + "description": "Finds named entities (currently proper names and common nouns) in the text\nalong with entity types, salience, mentions for each entity, and\nother properties.", + "request": { + "$ref": "AnalyzeEntitiesRequest" + } + }, + "analyzeSyntax": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/documents:analyzeSyntax", + "path": "v1/documents:analyzeSyntax", + "id": "language.documents.analyzeSyntax", + "request": { + "$ref": "AnalyzeSyntaxRequest" + }, + "description": "Analyzes the syntax of the text and provides sentence boundaries and\ntokenization along with part of speech tags, dependency trees, and other\nproperties.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnalyzeSyntaxResponse" + } + } + } + } + }, + "parameters": { + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + } + }, + "version": "v1", + "baseUrl": "https://language.googleapis.com/", + "servicePath": "", + "description": "Provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, entity sentiment analysis, and text annotations.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "language:v1", + "documentationLink": "https://cloud.google.com/natural-language/", + "revision": "20170918", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "AnalyzeSyntaxRequest": { - "description": "The syntax analysis request message.", + "Features": { + "id": "Features", + "description": "All available features for sentiment, syntax, and semantic analysis.\nSetting each one to true will enable that specific analysis for the input.", "type": "object", "properties": { - "document": { - "description": "Input document.", - "$ref": "Document" + "extractEntitySentiment": { + "description": "Extract entities and their associated sentiment.", + "type": "boolean" }, - "encodingType": { - "description": "The encoding type used by the API to calculate offsets.", - "type": "string", - "enumDescriptions": [ - "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." - ], - "enum": [ - "NONE", - "UTF8", - "UTF16", - "UTF32" - ] + "extractDocumentSentiment": { + "description": "Extract document-level sentiment.", + "type": "boolean" + }, + "extractSyntax": { + "description": "Extract syntax information.", + "type": "boolean" + }, + "extractEntities": { + "description": "Extract entities.", + "type": "boolean" } - }, - "id": "AnalyzeSyntaxRequest" - }, - "AnalyzeSentimentResponse": { - "description": "The sentiment analysis response message.", - "type": "object", - "properties": { - "sentences": { - "description": "The sentiment for all the sentences in the document.", - "type": "array", - "items": { - "$ref": "Sentence" - } - }, - "documentSentiment": { - "description": "The overall sentiment of the input document.", - "$ref": "Sentiment" - }, - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - } - }, - "id": "AnalyzeSentimentResponse" - }, - "AnalyzeEntitiesResponse": { - "description": "The entity analysis response message.", - "type": "object", - "properties": { - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - }, - "entities": { - "description": "The recognized entities in the input document.", - "type": "array", - "items": { - "$ref": "Entity" - } - } - }, - "id": "AnalyzeEntitiesResponse" - }, - "Entity": { - "description": "Represents a phrase in the text that is a known entity, such as\na person, an organization, or location. The API associates information, such\nas salience and mentions, with entities.", - "type": "object", - "properties": { - "mentions": { - "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", - "type": "array", - "items": { - "$ref": "EntityMention" - } - }, - "name": { - "description": "The representative name for the entity.", - "type": "string" - }, - "type": { - "enumDescriptions": [ - "Unknown", - "Person", - "Location", - "Organization", - "Event", - "Work of art", - "Consumer goods", - "Other types" - ], - "enum": [ - "UNKNOWN", - "PERSON", - "LOCATION", - "ORGANIZATION", - "EVENT", - "WORK_OF_ART", - "CONSUMER_GOOD", - "OTHER" - ], - "description": "The entity type.", - "type": "string" - }, - "metadata": { - "description": "Metadata associated with the entity.\n\nCurrently, Wikipedia URLs and Knowledge Graph MIDs are provided, if\navailable. The associated keys are \"wikipedia_url\" and \"mid\", respectively.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "salience": { - "description": "The salience score associated with the entity in the [0, 1.0] range.\n\nThe salience score for an entity provides information about the\nimportance or centrality of that entity to the entire document text.\nScores closer to 0 are less salient, while scores closer to 1.0 are highly\nsalient.", - "format": "float", - "type": "number" - } - }, - "id": "Entity" - }, - "AnalyzeSyntaxResponse": { - "description": "The syntax analysis response message.", - "type": "object", - "properties": { - "sentences": { - "description": "Sentences in the input document.", - "type": "array", - "items": { - "$ref": "Sentence" - } - }, - "tokens": { - "description": "Tokens, along with their syntactic information, in the input document.", - "type": "array", - "items": { - "$ref": "Token" - } - }, - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - } - }, - "id": "AnalyzeSyntaxResponse" - }, - "AnnotateTextRequest": { - "description": "The request message for the text annotation API, which can perform multiple\nanalysis types (sentiment, entities, and syntax) in one call.", - "type": "object", - "properties": { - "encodingType": { - "description": "The encoding type used by the API to calculate offsets.", - "type": "string", - "enumDescriptions": [ - "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." - ], - "enum": [ - "NONE", - "UTF8", - "UTF16", - "UTF32" - ] - }, - "document": { - "$ref": "Document", - "description": "Input document." - }, - "features": { - "description": "The enabled features.", - "$ref": "Features" - } - }, - "id": "AnnotateTextRequest" - }, - "AnalyzeSentimentRequest": { - "description": "The sentiment analysis request message.", - "type": "object", - "properties": { - "encodingType": { - "description": "The encoding type used by the API to calculate sentence offsets.", - "type": "string", - "enumDescriptions": [ - "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." - ], - "enum": [ - "NONE", - "UTF8", - "UTF16", - "UTF32" - ] - }, - "document": { - "description": "Input document.", - "$ref": "Document" - } - }, - "id": "AnalyzeSentimentRequest" - }, - "AnnotateTextResponse": { - "description": "The text annotations response message.", - "type": "object", - "properties": { - "documentSentiment": { - "$ref": "Sentiment", - "description": "The overall sentiment for the document. Populated if the user enables\nAnnotateTextRequest.Features.extract_document_sentiment." - }, - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - }, - "sentences": { - "description": "Sentences in the input document. Populated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", - "type": "array", - "items": { - "$ref": "Sentence" - } - }, - "tokens": { - "description": "Tokens, along with their syntactic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", - "type": "array", - "items": { - "$ref": "Token" - } - }, - "entities": { - "description": "Entities, along with their semantic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_entities.", - "type": "array", - "items": { - "$ref": "Entity" - } - } - }, - "id": "AnnotateTextResponse" - }, - "DependencyEdge": { - "description": "Represents dependency parse tree information for a token. (For more\ninformation on dependency labels, see\nhttp://www.aclweb.org/anthology/P13-2017", - "type": "object", - "properties": { - "headTokenIndex": { - "description": "Represents the head of this token in the dependency tree.\nThis is the index of the token which has an arc going to this token.\nThe index is the position of the token in the array of tokens returned\nby the API method. If this token is a root token, then the\n`head_token_index` is its own index.", - "format": "int32", - "type": "integer" - }, - "label": { - "enumDescriptions": [ - "Unknown", - "Abbreviation modifier", - "Adjectival complement", - "Adverbial clause modifier", - "Adverbial modifier", - "Adjectival modifier of an NP", - "Appositional modifier of an NP", - "Attribute dependent of a copular verb", - "Auxiliary (non-main) verb", - "Passive auxiliary", - "Coordinating conjunction", - "Clausal complement of a verb or adjective", - "Conjunct", - "Clausal subject", - "Clausal passive subject", - "Dependency (unable to determine)", - "Determiner", - "Discourse", - "Direct object", - "Expletive", - "Goes with (part of a word in a text not well edited)", - "Indirect object", - "Marker (word introducing a subordinate clause)", - "Multi-word expression", - "Multi-word verbal expression", - "Negation modifier", - "Noun compound modifier", - "Noun phrase used as an adverbial modifier", - "Nominal subject", - "Passive nominal subject", - "Numeric modifier of a noun", - "Element of compound number", - "Punctuation mark", - "Parataxis relation", - "Participial modifier", - "The complement of a preposition is a clause", - "Object of a preposition", - "Possession modifier", - "Postverbal negative particle", - "Predicate complement", - "Preconjunt", - "Predeterminer", - "Prefix", - "Prepositional modifier", - "The relationship between a verb and verbal morpheme", - "Particle", - "Associative or possessive marker", - "Quantifier phrase modifier", - "Relative clause modifier", - "Complementizer in relative clause", - "Ellipsis without a preceding predicate", - "Referent", - "Remnant", - "Reparandum", - "Root", - "Suffix specifying a unit of number", - "Suffix", - "Temporal modifier", - "Topic marker", - "Clause headed by an infinite form of the verb that modifies a noun", - "Vocative", - "Open clausal complement", - "Name suffix", - "Name title", - "Adverbial phrase modifier", - "Causative auxiliary", - "Helper auxiliary", - "Rentaishi (Prenominal modifier)", - "Foreign words", - "Keyword", - "List for chains of comparable items", - "Nominalized clause", - "Nominalized clausal subject", - "Nominalized clausal passive", - "Compound of numeric modifier", - "Copula", - "Dislocated relation (for fronted/topicalized elements)" - ], - "enum": [ - "UNKNOWN", - "ABBREV", - "ACOMP", - "ADVCL", - "ADVMOD", - "AMOD", - "APPOS", - "ATTR", - "AUX", - "AUXPASS", - "CC", - "CCOMP", - "CONJ", - "CSUBJ", - "CSUBJPASS", - "DEP", - "DET", - "DISCOURSE", - "DOBJ", - "EXPL", - "GOESWITH", - "IOBJ", - "MARK", - "MWE", - "MWV", - "NEG", - "NN", - "NPADVMOD", - "NSUBJ", - "NSUBJPASS", - "NUM", - "NUMBER", - "P", - "PARATAXIS", - "PARTMOD", - "PCOMP", - "POBJ", - "POSS", - "POSTNEG", - "PRECOMP", - "PRECONJ", - "PREDET", - "PREF", - "PREP", - "PRONL", - "PRT", - "PS", - "QUANTMOD", - "RCMOD", - "RCMODREL", - "RDROP", - "REF", - "REMNANT", - "REPARANDUM", - "ROOT", - "SNUM", - "SUFF", - "TMOD", - "TOPIC", - "VMOD", - "VOCATIVE", - "XCOMP", - "SUFFIX", - "TITLE", - "ADVPHMOD", - "AUXCAUS", - "AUXVV", - "DTMOD", - "FOREIGN", - "KW", - "LIST", - "NOMC", - "NOMCSUBJ", - "NOMCSUBJPASS", - "NUMC", - "COP", - "DISLOCATED" - ], - "description": "The parse label for the token.", - "type": "string" - } - }, - "id": "DependencyEdge" - }, - "TextSpan": { - "description": "Represents an output piece of text.", - "type": "object", - "properties": { - "beginOffset": { - "description": "The API calculates the beginning offset of the content in the original\ndocument according to the EncodingType specified in the API request.", - "format": "int32", - "type": "integer" - }, - "content": { - "description": "The content of the output text.", - "type": "string" - } - }, - "id": "TextSpan" - }, - "Token": { - "description": "Represents the smallest syntactic building block of the text.", - "type": "object", - "properties": { - "text": { - "$ref": "TextSpan", - "description": "The token text." - }, - "dependencyEdge": { - "description": "Dependency tree parse for this token.", - "$ref": "DependencyEdge" - }, - "lemma": { - "description": "[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.", - "type": "string" - }, - "partOfSpeech": { - "$ref": "PartOfSpeech", - "description": "Parts of speech tag for this token." - } - }, - "id": "Token" - }, - "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - } - }, - "id": "Status" + } }, "EntityMention": { + "id": "EntityMention", "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", "type": "object", "properties": { - "text": { - "description": "The mention text.", - "$ref": "TextSpan" - }, "type": { + "description": "The type of the entity mention.", + "type": "string", "enumDescriptions": [ "Unknown", "Proper name", @@ -500,37 +259,53 @@ "TYPE_UNKNOWN", "PROPER", "COMMON" - ], - "description": "The type of the entity mention.", - "type": "string" + ] + }, + "text": { + "$ref": "TextSpan", + "description": "The mention text." + }, + "sentiment": { + "$ref": "Sentiment", + "description": "For calls to AnalyzeEntitySentiment or if\nAnnotateTextRequest.Features.extract_entity_sentiment is set to\ntrue, this field will contain the sentiment expressed for this mention of\nthe entity in the provided document." } - }, - "id": "EntityMention" + } }, - "Features": { - "description": "All available features for sentiment, syntax, and semantic analysis.\nSetting each one to true will enable that specific analysis for the input.", + "Sentence": { + "id": "Sentence", + "description": "Represents a sentence in the input document.", "type": "object", "properties": { - "extractSyntax": { - "description": "Extract syntax information.", - "type": "boolean" + "text": { + "description": "The sentence text.", + "$ref": "TextSpan" }, - "extractDocumentSentiment": { - "description": "Extract document-level sentiment.", - "type": "boolean" - }, - "extractEntities": { - "description": "Extract entities.", - "type": "boolean" + "sentiment": { + "description": "For calls to AnalyzeSentiment or if\nAnnotateTextRequest.Features.extract_document_sentiment is set to\ntrue, this field will contain the sentiment for the sentence.", + "$ref": "Sentiment" } - }, - "id": "Features" + } }, "Document": { + "id": "Document", "description": "################################################################ #\n\nRepresents the input to API methods.", "type": "object", "properties": { + "gcsContentUri": { + "description": "The Google Cloud Storage URI where the file content is located.\nThis URI must be of the form: gs://bucket_name/object_name. For more\ndetails, see https://cloud.google.com/storage/docs/reference-uris.\nNOTE: Cloud Storage object versioning is not supported.", + "type": "string" + }, + "language": { + "description": "The language of the document (if not specified, the language is\nautomatically detected). Both ISO and BCP-47 language codes are\naccepted.\u003cbr\u003e\n[Language Support](/natural-language/docs/languages)\nlists currently supported languages for each API method.\nIf the language (either specified by the caller or automatically detected)\nis not supported by the called API method, an `INVALID_ARGUMENT` error\nis returned.", + "type": "string" + }, + "content": { + "description": "The content of the input in string format.", + "type": "string" + }, "type": { + "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`,\nreturns an `INVALID_ARGUMENT` error.", + "type": "string", "enumDescriptions": [ "The content type is not specified.", "Plain text", @@ -540,65 +315,14 @@ "TYPE_UNSPECIFIED", "PLAIN_TEXT", "HTML" - ], - "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`,\nreturns an `INVALID_ARGUMENT` error.", - "type": "string" - }, - "content": { - "description": "The content of the input in string format.", - "type": "string" - }, - "gcsContentUri": { - "description": "The Google Cloud Storage URI where the file content is located.\nThis URI must be of the form: gs://bucket_name/object_name. For more\ndetails, see https://cloud.google.com/storage/docs/reference-uris.\nNOTE: Cloud Storage object versioning is not supported.", - "type": "string" - }, - "language": { - "description": "The language of the document (if not specified, the language is\nautomatically detected). Both ISO and BCP-47 language codes are\naccepted.\u003cbr\u003e\n[Language Support](/natural-language/docs/languages)\nlists currently supported languages for each API method.\nIf the language (either specified by the caller or automatically detected)\nis not supported by the called API method, an `INVALID_ARGUMENT` error\nis returned.", - "type": "string" + ] } - }, - "id": "Document" - }, - "Sentence": { - "description": "Represents a sentence in the input document.", - "type": "object", - "properties": { - "text": { - "$ref": "TextSpan", - "description": "The sentence text." - }, - "sentiment": { - "description": "For calls to AnalyzeSentiment or if\nAnnotateTextRequest.Features.extract_document_sentiment is set to\ntrue, this field will contain the sentiment for the sentence.", - "$ref": "Sentiment" - } - }, - "id": "Sentence" - }, - "Sentiment": { - "description": "Represents the feeling associated with the entire text or entities in\nthe text.", - "type": "object", - "properties": { - "score": { - "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", - "format": "float", - "type": "number" - }, - "magnitude": { - "description": "A non-negative number in the [0, +inf) range, which represents\nthe absolute magnitude of sentiment regardless of score (positive or\nnegative).", - "format": "float", - "type": "number" - } - }, - "id": "Sentiment" + } }, "AnalyzeEntitiesRequest": { "description": "The entity analysis request message.", "type": "object", "properties": { - "document": { - "description": "Input document.", - "$ref": "Document" - }, "encodingType": { "description": "The encoding type used by the API to calculate offsets.", "type": "string", @@ -614,28 +338,81 @@ "UTF16", "UTF32" ] + }, + "document": { + "description": "Input document.", + "$ref": "Document" } }, "id": "AnalyzeEntitiesRequest" }, + "Sentiment": { + "id": "Sentiment", + "description": "Represents the feeling associated with the entire text or entities in\nthe text.", + "type": "object", + "properties": { + "score": { + "format": "float", + "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", + "type": "number" + }, + "magnitude": { + "format": "float", + "description": "A non-negative number in the [0, +inf) range, which represents\nthe absolute magnitude of sentiment regardless of score (positive or\nnegative).", + "type": "number" + } + } + }, + "AnalyzeEntitySentimentResponse": { + "id": "AnalyzeEntitySentimentResponse", + "description": "The entity-level sentiment analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "entities": { + "description": "The recognized entities in the input document with associated sentiments.", + "items": { + "$ref": "Entity" + }, + "type": "array" + } + } + }, + "AnalyzeEntitySentimentRequest": { + "id": "AnalyzeEntitySentimentRequest", + "description": "The entity-level sentiment analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate offsets.", + "type": "string" + }, + "document": { + "$ref": "Document", + "description": "Input document." + } + } + }, "PartOfSpeech": { + "id": "PartOfSpeech", "description": "Represents part of speech information for a token. Parts of speech\nare as defined in\nhttp://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf", "type": "object", "properties": { - "reciprocity": { - "description": "The grammatical reciprocity.", - "type": "string", - "enumDescriptions": [ - "Reciprocity is not applicable in the analyzed language or is not\npredicted.", - "Reciprocal", - "Non-reciprocal" - ], - "enum": [ - "RECIPROCITY_UNKNOWN", - "RECIPROCAL", - "NON_RECIPROCAL" - ] - }, "form": { "enumDescriptions": [ "Form is not applicable in the analyzed language or is not predicted.", @@ -701,6 +478,8 @@ ] }, "aspect": { + "description": "The grammatical aspect.", + "type": "string", "enumDescriptions": [ "Aspect is not applicable in the analyzed language or is not predicted.", "Perfective", @@ -712,9 +491,7 @@ "PERFECTIVE", "IMPERFECTIVE", "PROGRESSIVE" - ], - "description": "The grammatical aspect.", - "type": "string" + ] }, "mood": { "enumDescriptions": [ @@ -739,6 +516,8 @@ "type": "string" }, "tag": { + "description": "The part of speech tag.", + "type": "string", "enumDescriptions": [ "Unknown", "Adjective", @@ -770,9 +549,7 @@ "VERB", "X", "AFFIX" - ], - "description": "The part of speech tag.", - "type": "string" + ] }, "gender": { "enumDescriptions": [ @@ -861,6 +638,8 @@ "type": "string" }, "tense": { + "description": "The grammatical tense.", + "type": "string", "enumDescriptions": [ "Tense is not applicable in the analyzed language or is not predicted.", "Conditional", @@ -878,208 +657,524 @@ "PRESENT", "IMPERFECT", "PLUPERFECT" + ] + }, + "reciprocity": { + "description": "The grammatical reciprocity.", + "type": "string", + "enumDescriptions": [ + "Reciprocity is not applicable in the analyzed language or is not\npredicted.", + "Reciprocal", + "Non-reciprocal" ], - "description": "The grammatical tense.", - "type": "string" + "enum": [ + "RECIPROCITY_UNKNOWN", + "RECIPROCAL", + "NON_RECIPROCAL" + ] + } + } + }, + "AnalyzeSyntaxRequest": { + "description": "The syntax analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "description": "The encoding type used by the API to calculate offsets.", + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ] + }, + "document": { + "$ref": "Document", + "description": "Input document." } }, - "id": "PartOfSpeech" + "id": "AnalyzeSyntaxRequest" + }, + "AnalyzeSentimentResponse": { + "id": "AnalyzeSentimentResponse", + "description": "The sentiment analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "description": "The sentiment for all the sentences in the document.", + "items": { + "$ref": "Sentence" + }, + "type": "array" + }, + "documentSentiment": { + "$ref": "Sentiment", + "description": "The overall sentiment of the input document." + } + } + }, + "AnalyzeEntitiesResponse": { + "id": "AnalyzeEntitiesResponse", + "description": "The entity analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "entities": { + "description": "The recognized entities in the input document.", + "items": { + "$ref": "Entity" + }, + "type": "array" + } + } + }, + "Entity": { + "description": "Represents a phrase in the text that is a known entity, such as\na person, an organization, or location. The API associates information, such\nas salience and mentions, with entities.", + "type": "object", + "properties": { + "mentions": { + "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", + "items": { + "$ref": "EntityMention" + }, + "type": "array" + }, + "name": { + "description": "The representative name for the entity.", + "type": "string" + }, + "type": { + "enumDescriptions": [ + "Unknown", + "Person", + "Location", + "Organization", + "Event", + "Work of art", + "Consumer goods", + "Other types" + ], + "enum": [ + "UNKNOWN", + "PERSON", + "LOCATION", + "ORGANIZATION", + "EVENT", + "WORK_OF_ART", + "CONSUMER_GOOD", + "OTHER" + ], + "description": "The entity type.", + "type": "string" + }, + "metadata": { + "description": "Metadata associated with the entity.\n\nCurrently, Wikipedia URLs and Knowledge Graph MIDs are provided, if\navailable. The associated keys are \"wikipedia_url\" and \"mid\", respectively.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "salience": { + "format": "float", + "description": "The salience score associated with the entity in the [0, 1.0] range.\n\nThe salience score for an entity provides information about the\nimportance or centrality of that entity to the entire document text.\nScores closer to 0 are less salient, while scores closer to 1.0 are highly\nsalient.", + "type": "number" + }, + "sentiment": { + "description": "For calls to AnalyzeEntitySentiment or if\nAnnotateTextRequest.Features.extract_entity_sentiment is set to\ntrue, this field will contain the aggregate sentiment expressed for this\nentity in the provided document.", + "$ref": "Sentiment" + } + }, + "id": "Entity" + }, + "AnalyzeSyntaxResponse": { + "id": "AnalyzeSyntaxResponse", + "description": "The syntax analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "description": "Sentences in the input document.", + "items": { + "$ref": "Sentence" + }, + "type": "array" + }, + "tokens": { + "description": "Tokens, along with their syntactic information, in the input document.", + "items": { + "$ref": "Token" + }, + "type": "array" + } + } + }, + "AnnotateTextRequest": { + "description": "The request message for the text annotation API, which can perform multiple\nanalysis types (sentiment, entities, and syntax) in one call.", + "type": "object", + "properties": { + "encodingType": { + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate offsets.", + "type": "string" + }, + "document": { + "$ref": "Document", + "description": "Input document." + }, + "features": { + "description": "The enabled features.", + "$ref": "Features" + } + }, + "id": "AnnotateTextRequest" + }, + "AnnotateTextResponse": { + "id": "AnnotateTextResponse", + "description": "The text annotations response message.", + "type": "object", + "properties": { + "documentSentiment": { + "description": "The overall sentiment for the document. Populated if the user enables\nAnnotateTextRequest.Features.extract_document_sentiment.", + "$ref": "Sentiment" + }, + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "description": "Sentences in the input document. Populated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", + "items": { + "$ref": "Sentence" + }, + "type": "array" + }, + "tokens": { + "description": "Tokens, along with their syntactic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", + "items": { + "$ref": "Token" + }, + "type": "array" + }, + "entities": { + "description": "Entities, along with their semantic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_entities.", + "items": { + "$ref": "Entity" + }, + "type": "array" + } + } + }, + "AnalyzeSentimentRequest": { + "id": "AnalyzeSentimentRequest", + "description": "The sentiment analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "description": "The encoding type used by the API to calculate sentence offsets.", + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ] + }, + "document": { + "$ref": "Document", + "description": "Input document." + } + } + }, + "DependencyEdge": { + "description": "Represents dependency parse tree information for a token. (For more\ninformation on dependency labels, see\nhttp://www.aclweb.org/anthology/P13-2017", + "type": "object", + "properties": { + "label": { + "enumDescriptions": [ + "Unknown", + "Abbreviation modifier", + "Adjectival complement", + "Adverbial clause modifier", + "Adverbial modifier", + "Adjectival modifier of an NP", + "Appositional modifier of an NP", + "Attribute dependent of a copular verb", + "Auxiliary (non-main) verb", + "Passive auxiliary", + "Coordinating conjunction", + "Clausal complement of a verb or adjective", + "Conjunct", + "Clausal subject", + "Clausal passive subject", + "Dependency (unable to determine)", + "Determiner", + "Discourse", + "Direct object", + "Expletive", + "Goes with (part of a word in a text not well edited)", + "Indirect object", + "Marker (word introducing a subordinate clause)", + "Multi-word expression", + "Multi-word verbal expression", + "Negation modifier", + "Noun compound modifier", + "Noun phrase used as an adverbial modifier", + "Nominal subject", + "Passive nominal subject", + "Numeric modifier of a noun", + "Element of compound number", + "Punctuation mark", + "Parataxis relation", + "Participial modifier", + "The complement of a preposition is a clause", + "Object of a preposition", + "Possession modifier", + "Postverbal negative particle", + "Predicate complement", + "Preconjunt", + "Predeterminer", + "Prefix", + "Prepositional modifier", + "The relationship between a verb and verbal morpheme", + "Particle", + "Associative or possessive marker", + "Quantifier phrase modifier", + "Relative clause modifier", + "Complementizer in relative clause", + "Ellipsis without a preceding predicate", + "Referent", + "Remnant", + "Reparandum", + "Root", + "Suffix specifying a unit of number", + "Suffix", + "Temporal modifier", + "Topic marker", + "Clause headed by an infinite form of the verb that modifies a noun", + "Vocative", + "Open clausal complement", + "Name suffix", + "Name title", + "Adverbial phrase modifier", + "Causative auxiliary", + "Helper auxiliary", + "Rentaishi (Prenominal modifier)", + "Foreign words", + "Keyword", + "List for chains of comparable items", + "Nominalized clause", + "Nominalized clausal subject", + "Nominalized clausal passive", + "Compound of numeric modifier", + "Copula", + "Dislocated relation (for fronted/topicalized elements)", + "Aspect marker", + "Genitive modifier", + "Genitive object", + "Infinitival modifier", + "Measure", + "Nominal complement of a noun" + ], + "enum": [ + "UNKNOWN", + "ABBREV", + "ACOMP", + "ADVCL", + "ADVMOD", + "AMOD", + "APPOS", + "ATTR", + "AUX", + "AUXPASS", + "CC", + "CCOMP", + "CONJ", + "CSUBJ", + "CSUBJPASS", + "DEP", + "DET", + "DISCOURSE", + "DOBJ", + "EXPL", + "GOESWITH", + "IOBJ", + "MARK", + "MWE", + "MWV", + "NEG", + "NN", + "NPADVMOD", + "NSUBJ", + "NSUBJPASS", + "NUM", + "NUMBER", + "P", + "PARATAXIS", + "PARTMOD", + "PCOMP", + "POBJ", + "POSS", + "POSTNEG", + "PRECOMP", + "PRECONJ", + "PREDET", + "PREF", + "PREP", + "PRONL", + "PRT", + "PS", + "QUANTMOD", + "RCMOD", + "RCMODREL", + "RDROP", + "REF", + "REMNANT", + "REPARANDUM", + "ROOT", + "SNUM", + "SUFF", + "TMOD", + "TOPIC", + "VMOD", + "VOCATIVE", + "XCOMP", + "SUFFIX", + "TITLE", + "ADVPHMOD", + "AUXCAUS", + "AUXVV", + "DTMOD", + "FOREIGN", + "KW", + "LIST", + "NOMC", + "NOMCSUBJ", + "NOMCSUBJPASS", + "NUMC", + "COP", + "DISLOCATED", + "ASP", + "GMOD", + "GOBJ", + "INFMOD", + "MES", + "NCOMP" + ], + "description": "The parse label for the token.", + "type": "string" + }, + "headTokenIndex": { + "format": "int32", + "description": "Represents the head of this token in the dependency tree.\nThis is the index of the token which has an arc going to this token.\nThe index is the position of the token in the array of tokens returned\nby the API method. If this token is a root token, then the\n`head_token_index` is its own index.", + "type": "integer" + } + }, + "id": "DependencyEdge" + }, + "Token": { + "description": "Represents the smallest syntactic building block of the text.", + "type": "object", + "properties": { + "dependencyEdge": { + "description": "Dependency tree parse for this token.", + "$ref": "DependencyEdge" + }, + "text": { + "description": "The token text.", + "$ref": "TextSpan" + }, + "lemma": { + "description": "[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.", + "type": "string" + }, + "partOfSpeech": { + "$ref": "PartOfSpeech", + "description": "Parts of speech tag for this token." + } + }, + "id": "Token" + }, + "TextSpan": { + "id": "TextSpan", + "description": "Represents an output piece of text.", + "type": "object", + "properties": { + "beginOffset": { + "format": "int32", + "description": "The API calculates the beginning offset of the content in the original\ndocument according to the EncodingType specified in the API request.", + "type": "integer" + }, + "content": { + "description": "The content of the output text.", + "type": "string" + } + } + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + } + }, + "id": "Status" } }, "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, - "protocol": "rest", - "canonicalName": "Cloud Natural Language", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - } - } - } - }, - "rootUrl": "https://language.googleapis.com/", - "ownerDomain": "google.com", - "name": "language", - "batchPath": "batch", - "title": "Google Cloud Natural Language API", - "ownerName": "Google", - "resources": { - "documents": { - "methods": { - "analyzeSyntax": { - "request": { - "$ref": "AnalyzeSyntaxRequest" - }, - "description": "Analyzes the syntax of the text and provides sentence boundaries and\ntokenization along with part of speech tags, dependency trees, and other\nproperties.", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "AnalyzeSyntaxResponse" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/documents:analyzeSyntax", - "id": "language.documents.analyzeSyntax", - "path": "v1/documents:analyzeSyntax" - }, - "analyzeSentiment": { - "flatPath": "v1/documents:analyzeSentiment", - "id": "language.documents.analyzeSentiment", - "path": "v1/documents:analyzeSentiment", - "description": "Analyzes the sentiment of the provided text.", - "request": { - "$ref": "AnalyzeSentimentRequest" - }, - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "AnalyzeSentimentResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {} - }, - "annotateText": { - "flatPath": "v1/documents:annotateText", - "id": "language.documents.annotateText", - "path": "v1/documents:annotateText", - "description": "A convenience method that provides all the features that analyzeSentiment,\nanalyzeEntities, and analyzeSyntax provide in one call.", - "request": { - "$ref": "AnnotateTextRequest" - }, - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "AnnotateTextResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {} - }, - "analyzeEntities": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "AnalyzeEntitiesResponse" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/documents:analyzeEntities", - "id": "language.documents.analyzeEntities", - "path": "v1/documents:analyzeEntities", - "request": { - "$ref": "AnalyzeEntitiesRequest" - }, - "description": "Finds named entities (currently proper names and common nouns) in the text\nalong with entity types, salience, mentions for each entity, and\nother properties." - } - } - } - }, - "parameters": { - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "type": "string", - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - } - }, - "version": "v1", - "baseUrl": "https://language.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, entity sentiment analysis, and text annotations.", - "servicePath": "", - "basePath": "", - "id": "language:v1", - "revision": "20170515", - "documentationLink": "https://cloud.google.com/natural-language/" + "protocol": "rest" } diff --git a/etc/api/language/v1beta1/language-api.json b/etc/api/language/v1beta1/language-api.json index 21aedd5c62..75bfb4753e 100644 --- a/etc/api/language/v1beta1/language-api.json +++ b/etc/api/language/v1beta1/language-api.json @@ -1,21 +1,362 @@ { - "version": "v1beta1", - "baseUrl": "https://language.googleapis.com/", - "description": "Provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, entity sentiment analysis, and text annotations.", - "kind": "discovery#restDescription", - "servicePath": "", "basePath": "", - "revision": "20170515", "id": "language:v1beta1", "documentationLink": "https://cloud.google.com/natural-language/", + "revision": "20170918", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { + "Token": { + "description": "Represents the smallest syntactic building block of the text.", + "type": "object", + "properties": { + "partOfSpeech": { + "$ref": "PartOfSpeech", + "description": "Parts of speech tag for this token." + }, + "dependencyEdge": { + "$ref": "DependencyEdge", + "description": "Dependency tree parse for this token." + }, + "text": { + "description": "The token text.", + "$ref": "TextSpan" + }, + "lemma": { + "type": "string", + "description": "[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token." + } + }, + "id": "Token" + }, + "TextSpan": { + "description": "Represents an output piece of text.", + "type": "object", + "properties": { + "content": { + "description": "The content of the output text.", + "type": "string" + }, + "beginOffset": { + "format": "int32", + "description": "The API calculates the beginning offset of the content in the original\ndocument according to the EncodingType specified in the API request.", + "type": "integer" + } + }, + "id": "TextSpan" + }, + "Status": { + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + } + }, + "Features": { + "description": "All available features for sentiment, syntax, and semantic analysis.\nSetting each one to true will enable that specific analysis for the input.", + "type": "object", + "properties": { + "extractDocumentSentiment": { + "description": "Extract document-level sentiment.", + "type": "boolean" + }, + "extractSyntax": { + "description": "Extract syntax information.", + "type": "boolean" + }, + "extractEntities": { + "description": "Extract entities.", + "type": "boolean" + } + }, + "id": "Features" + }, + "EntityMention": { + "properties": { + "type": { + "enum": [ + "TYPE_UNKNOWN", + "PROPER", + "COMMON" + ], + "description": "The type of the entity mention.", + "type": "string", + "enumDescriptions": [ + "Unknown", + "Proper name", + "Common noun (or noun compound)" + ] + }, + "text": { + "description": "The mention text.", + "$ref": "TextSpan" + } + }, + "id": "EntityMention", + "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", + "type": "object" + }, + "Document": { + "properties": { + "content": { + "description": "The content of the input in string format.", + "type": "string" + }, + "type": { + "enumDescriptions": [ + "The content type is not specified.", + "Plain text", + "HTML" + ], + "enum": [ + "TYPE_UNSPECIFIED", + "PLAIN_TEXT", + "HTML" + ], + "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`,\nreturns an `INVALID_ARGUMENT` error.", + "type": "string" + }, + "gcsContentUri": { + "description": "The Google Cloud Storage URI where the file content is located.\nThis URI must be of the form: gs://bucket_name/object_name. For more\ndetails, see https://cloud.google.com/storage/docs/reference-uris.\nNOTE: Cloud Storage object versioning is not supported.", + "type": "string" + }, + "language": { + "description": "The language of the document (if not specified, the language is\nautomatically detected). Both ISO and BCP-47 language codes are\naccepted.\u003cbr\u003e\n[Language Support](/natural-language/docs/languages)\nlists currently supported languages for each API method.\nIf the language (either specified by the caller or automatically detected)\nis not supported by the called API method, an `INVALID_ARGUMENT` error\nis returned.", + "type": "string" + } + }, + "id": "Document", + "description": "################################################################ #\n\nRepresents the input to API methods.", + "type": "object" + }, + "Sentence": { + "description": "Represents a sentence in the input document.", + "type": "object", + "properties": { + "text": { + "$ref": "TextSpan", + "description": "The sentence text." + }, + "sentiment": { + "description": "For calls to AnalyzeSentiment or if\nAnnotateTextRequest.Features.extract_document_sentiment is set to\ntrue, this field will contain the sentiment for the sentence.", + "$ref": "Sentiment" + } + }, + "id": "Sentence" + }, + "AnalyzeEntitiesRequest": { + "description": "The entity analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate offsets.", + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ] + }, + "document": { + "$ref": "Document", + "description": "Input document." + } + }, + "id": "AnalyzeEntitiesRequest" + }, + "Sentiment": { + "description": "Represents the feeling associated with the entire text or entities in\nthe text.", + "type": "object", + "properties": { + "score": { + "format": "float", + "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", + "type": "number" + }, + "polarity": { + "format": "float", + "description": "DEPRECATED FIELD - This field is being deprecated in\nfavor of score. Please refer to our documentation at\nhttps://cloud.google.com/natural-language/docs for more information.", + "type": "number" + }, + "magnitude": { + "format": "float", + "description": "A non-negative number in the [0, +inf) range, which represents\nthe absolute magnitude of sentiment regardless of score (positive or\nnegative).", + "type": "number" + } + }, + "id": "Sentiment" + }, "PartOfSpeech": { "description": "Represents part of speech information for a token.", "type": "object", "properties": { + "voice": { + "enumDescriptions": [ + "Voice is not applicable in the analyzed language or is not predicted.", + "Active", + "Causative", + "Passive" + ], + "enum": [ + "VOICE_UNKNOWN", + "ACTIVE", + "CAUSATIVE", + "PASSIVE" + ], + "description": "The grammatical voice.", + "type": "string" + }, + "aspect": { + "enum": [ + "ASPECT_UNKNOWN", + "PERFECTIVE", + "IMPERFECTIVE", + "PROGRESSIVE" + ], + "description": "The grammatical aspect.", + "type": "string", + "enumDescriptions": [ + "Aspect is not applicable in the analyzed language or is not predicted.", + "Perfective", + "Imperfective", + "Progressive" + ] + }, + "mood": { + "description": "The grammatical mood.", + "type": "string", + "enumDescriptions": [ + "Mood is not applicable in the analyzed language or is not predicted.", + "Conditional", + "Imperative", + "Indicative", + "Interrogative", + "Jussive", + "Subjunctive" + ], + "enum": [ + "MOOD_UNKNOWN", + "CONDITIONAL_MOOD", + "IMPERATIVE", + "INDICATIVE", + "INTERROGATIVE", + "JUSSIVE", + "SUBJUNCTIVE" + ] + }, + "tag": { + "enum": [ + "UNKNOWN", + "ADJ", + "ADP", + "ADV", + "CONJ", + "DET", + "NOUN", + "NUM", + "PRON", + "PRT", + "PUNCT", + "VERB", + "X", + "AFFIX" + ], + "description": "The part of speech tag.", + "type": "string", + "enumDescriptions": [ + "Unknown", + "Adjective", + "Adposition (preposition and postposition)", + "Adverb", + "Conjunction", + "Determiner", + "Noun (common and proper)", + "Cardinal number", + "Pronoun", + "Particle or other function word", + "Punctuation", + "Verb (all tenses and modes)", + "Other: foreign words, typos, abbreviations", + "Affix" + ] + }, + "gender": { + "enum": [ + "GENDER_UNKNOWN", + "FEMININE", + "MASCULINE", + "NEUTER" + ], + "description": "The grammatical gender.", + "type": "string", + "enumDescriptions": [ + "Gender is not applicable in the analyzed language or is not predicted.", + "Feminine", + "Masculine", + "Neuter" + ] + }, + "person": { + "enumDescriptions": [ + "Person is not applicable in the analyzed language or is not predicted.", + "First", + "Second", + "Third", + "Reflexive" + ], + "enum": [ + "PERSON_UNKNOWN", + "FIRST", + "SECOND", + "THIRD", + "REFLEXIVE_PERSON" + ], + "description": "The grammatical person.", + "type": "string" + }, + "proper": { + "enum": [ + "PROPER_UNKNOWN", + "PROPER", + "NOT_PROPER" + ], + "description": "The grammatical properness.", + "type": "string", + "enumDescriptions": [ + "Proper is not applicable in the analyzed language or is not predicted.", + "Proper", + "Not proper" + ] + }, "case": { + "type": "string", "enumDescriptions": [ "Case is not applicable in the analyzed language or is not predicted.", "Accusative", @@ -50,10 +391,10 @@ "RELATIVE_CASE", "VOCATIVE" ], - "description": "The grammatical case.", - "type": "string" + "description": "The grammatical case." }, "tense": { + "type": "string", "enumDescriptions": [ "Tense is not applicable in the analyzed language or is not predicted.", "Conditional", @@ -72,8 +413,7 @@ "IMPERFECT", "PLUPERFECT" ], - "description": "The grammatical tense.", - "type": "string" + "description": "The grammatical tense." }, "reciprocity": { "enum": [ @@ -90,6 +430,7 @@ ] }, "form": { + "type": "string", "enumDescriptions": [ "Form is not applicable in the analyzed language or is not predicted.", "Adnomial", @@ -118,16 +459,9 @@ "ORDER", "SPECIFIC" ], - "description": "The grammatical form.", - "type": "string" + "description": "The grammatical form." }, "number": { - "enumDescriptions": [ - "Number is not applicable in the analyzed language or is not predicted.", - "Singular", - "Plural", - "Dual" - ], "enum": [ "NUMBER_UNKNOWN", "SINGULAR", @@ -135,296 +469,20 @@ "DUAL" ], "description": "The grammatical number.", - "type": "string" - }, - "voice": { - "enum": [ - "VOICE_UNKNOWN", - "ACTIVE", - "CAUSATIVE", - "PASSIVE" - ], - "description": "The grammatical voice.", "type": "string", "enumDescriptions": [ - "Voice is not applicable in the analyzed language or is not predicted.", - "Active", - "Causative", - "Passive" - ] - }, - "aspect": { - "enumDescriptions": [ - "Aspect is not applicable in the analyzed language or is not predicted.", - "Perfective", - "Imperfective", - "Progressive" - ], - "enum": [ - "ASPECT_UNKNOWN", - "PERFECTIVE", - "IMPERFECTIVE", - "PROGRESSIVE" - ], - "description": "The grammatical aspect.", - "type": "string" - }, - "mood": { - "enumDescriptions": [ - "Mood is not applicable in the analyzed language or is not predicted.", - "Conditional", - "Imperative", - "Indicative", - "Interrogative", - "Jussive", - "Subjunctive" - ], - "enum": [ - "MOOD_UNKNOWN", - "CONDITIONAL_MOOD", - "IMPERATIVE", - "INDICATIVE", - "INTERROGATIVE", - "JUSSIVE", - "SUBJUNCTIVE" - ], - "description": "The grammatical mood.", - "type": "string" - }, - "tag": { - "enumDescriptions": [ - "Unknown", - "Adjective", - "Adposition (preposition and postposition)", - "Adverb", - "Conjunction", - "Determiner", - "Noun (common and proper)", - "Cardinal number", - "Pronoun", - "Particle or other function word", - "Punctuation", - "Verb (all tenses and modes)", - "Other: foreign words, typos, abbreviations", - "Affix" - ], - "enum": [ - "UNKNOWN", - "ADJ", - "ADP", - "ADV", - "CONJ", - "DET", - "NOUN", - "NUM", - "PRON", - "PRT", - "PUNCT", - "VERB", - "X", - "AFFIX" - ], - "description": "The part of speech tag.", - "type": "string" - }, - "gender": { - "enumDescriptions": [ - "Gender is not applicable in the analyzed language or is not predicted.", - "Feminine", - "Masculine", - "Neuter" - ], - "enum": [ - "GENDER_UNKNOWN", - "FEMININE", - "MASCULINE", - "NEUTER" - ], - "description": "The grammatical gender.", - "type": "string" - }, - "person": { - "enumDescriptions": [ - "Person is not applicable in the analyzed language or is not predicted.", - "First", - "Second", - "Third", - "Reflexive" - ], - "enum": [ - "PERSON_UNKNOWN", - "FIRST", - "SECOND", - "THIRD", - "REFLEXIVE_PERSON" - ], - "description": "The grammatical person.", - "type": "string" - }, - "proper": { - "enum": [ - "PROPER_UNKNOWN", - "PROPER", - "NOT_PROPER" - ], - "description": "The grammatical properness.", - "type": "string", - "enumDescriptions": [ - "Proper is not applicable in the analyzed language or is not predicted.", - "Proper", - "Not proper" + "Number is not applicable in the analyzed language or is not predicted.", + "Singular", + "Plural", + "Dual" ] } }, "id": "PartOfSpeech" }, "AnalyzeSyntaxRequest": { - "properties": { - "encodingType": { - "enumDescriptions": [ - "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." - ], - "enum": [ - "NONE", - "UTF8", - "UTF16", - "UTF32" - ], - "description": "The encoding type used by the API to calculate offsets.", - "type": "string" - }, - "document": { - "$ref": "Document", - "description": "Input document." - } - }, - "id": "AnalyzeSyntaxRequest", "description": "The syntax analysis request message.", - "type": "object" - }, - "AnalyzeSentimentResponse": { - "description": "The sentiment analysis response message.", "type": "object", - "properties": { - "documentSentiment": { - "$ref": "Sentiment", - "description": "The overall sentiment of the input document." - }, - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - }, - "sentences": { - "description": "The sentiment for all the sentences in the document.", - "type": "array", - "items": { - "$ref": "Sentence" - } - } - }, - "id": "AnalyzeSentimentResponse" - }, - "AnalyzeEntitiesResponse": { - "properties": { - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - }, - "entities": { - "description": "The recognized entities in the input document.", - "type": "array", - "items": { - "$ref": "Entity" - } - } - }, - "id": "AnalyzeEntitiesResponse", - "description": "The entity analysis response message.", - "type": "object" - }, - "Entity": { - "description": "Represents a phrase in the text that is a known entity, such as\na person, an organization, or location. The API associates information, such\nas salience and mentions, with entities.", - "type": "object", - "properties": { - "mentions": { - "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", - "type": "array", - "items": { - "$ref": "EntityMention" - } - }, - "name": { - "description": "The representative name for the entity.", - "type": "string" - }, - "type": { - "enum": [ - "UNKNOWN", - "PERSON", - "LOCATION", - "ORGANIZATION", - "EVENT", - "WORK_OF_ART", - "CONSUMER_GOOD", - "OTHER" - ], - "description": "The entity type.", - "type": "string", - "enumDescriptions": [ - "Unknown", - "Person", - "Location", - "Organization", - "Event", - "Work of art", - "Consumer goods", - "Other types" - ] - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Metadata associated with the entity.\n\nCurrently, Wikipedia URLs and Knowledge Graph MIDs are provided, if\navailable. The associated keys are \"wikipedia_url\" and \"mid\", respectively.", - "type": "object" - }, - "salience": { - "description": "The salience score associated with the entity in the [0, 1.0] range.\n\nThe salience score for an entity provides information about the\nimportance or centrality of that entity to the entire document text.\nScores closer to 0 are less salient, while scores closer to 1.0 are highly\nsalient.", - "format": "float", - "type": "number" - } - }, - "id": "Entity" - }, - "AnalyzeSyntaxResponse": { - "properties": { - "language": { - "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", - "type": "string" - }, - "sentences": { - "description": "Sentences in the input document.", - "type": "array", - "items": { - "$ref": "Sentence" - } - }, - "tokens": { - "description": "Tokens, along with their syntactic information, in the input document.", - "type": "array", - "items": { - "$ref": "Token" - } - } - }, - "id": "AnalyzeSyntaxResponse", - "description": "The syntax analysis response message.", - "type": "object" - }, - "AnnotateTextRequest": { "properties": { "encodingType": { "enumDescriptions": [ @@ -445,18 +503,137 @@ "document": { "description": "Input document.", "$ref": "Document" - }, - "features": { - "$ref": "Features", - "description": "The enabled features." } }, - "id": "AnnotateTextRequest", - "description": "The request message for the text annotation API, which can perform multiple\nanalysis types (sentiment, entities, and syntax) in one call.", + "id": "AnalyzeSyntaxRequest" + }, + "AnalyzeSentimentResponse": { + "properties": { + "documentSentiment": { + "description": "The overall sentiment of the input document.", + "$ref": "Sentiment" + }, + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "items": { + "$ref": "Sentence" + }, + "type": "array", + "description": "The sentiment for all the sentences in the document." + } + }, + "id": "AnalyzeSentimentResponse", + "description": "The sentiment analysis response message.", "type": "object" }, - "AnalyzeSentimentRequest": { + "AnalyzeEntitiesResponse": { + "description": "The entity analysis response message.", + "type": "object", "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "entities": { + "description": "The recognized entities in the input document.", + "items": { + "$ref": "Entity" + }, + "type": "array" + } + }, + "id": "AnalyzeEntitiesResponse" + }, + "Entity": { + "description": "Represents a phrase in the text that is a known entity, such as\na person, an organization, or location. The API associates information, such\nas salience and mentions, with entities.", + "type": "object", + "properties": { + "salience": { + "format": "float", + "description": "The salience score associated with the entity in the [0, 1.0] range.\n\nThe salience score for an entity provides information about the\nimportance or centrality of that entity to the entire document text.\nScores closer to 0 are less salient, while scores closer to 1.0 are highly\nsalient.", + "type": "number" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the entity.\n\nCurrently, Wikipedia URLs and Knowledge Graph MIDs are provided, if\navailable. The associated keys are \"wikipedia_url\" and \"mid\", respectively.", + "type": "object" + }, + "type": { + "enumDescriptions": [ + "Unknown", + "Person", + "Location", + "Organization", + "Event", + "Work of art", + "Consumer goods", + "Other types" + ], + "enum": [ + "UNKNOWN", + "PERSON", + "LOCATION", + "ORGANIZATION", + "EVENT", + "WORK_OF_ART", + "CONSUMER_GOOD", + "OTHER" + ], + "description": "The entity type.", + "type": "string" + }, + "mentions": { + "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", + "items": { + "$ref": "EntityMention" + }, + "type": "array" + }, + "name": { + "description": "The representative name for the entity.", + "type": "string" + } + }, + "id": "Entity" + }, + "AnalyzeSyntaxResponse": { + "description": "The syntax analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "items": { + "$ref": "Sentence" + }, + "type": "array", + "description": "Sentences in the input document." + }, + "tokens": { + "items": { + "$ref": "Token" + }, + "type": "array", + "description": "Tokens, along with their syntactic information, in the input document." + } + }, + "id": "AnalyzeSyntaxResponse" + }, + "AnnotateTextRequest": { + "description": "The request message for the text annotation API, which can perform multiple\nanalysis types (sentiment, entities, and syntax) in one call.", + "type": "object", + "properties": { + "features": { + "description": "The enabled features.", + "$ref": "Features" + }, "encodingType": { "enumDescriptions": [ "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", @@ -470,7 +647,7 @@ "UTF16", "UTF32" ], - "description": "The encoding type used by the API to calculate sentence offsets for the\nsentence sentiment.", + "description": "The encoding type used by the API to calculate offsets.", "type": "string" }, "document": { @@ -478,54 +655,77 @@ "description": "Input document." } }, + "id": "AnnotateTextRequest" + }, + "AnalyzeSentimentRequest": { "id": "AnalyzeSentimentRequest", "description": "The sentiment analysis request message.", - "type": "object" + "type": "object", + "properties": { + "encodingType": { + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate sentence offsets for the\nsentence sentiment." + }, + "document": { + "$ref": "Document", + "description": "Input document." + } + } }, "AnnotateTextResponse": { + "description": "The text annotations response message.", + "type": "object", "properties": { + "entities": { + "description": "Entities, along with their semantic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_entities.", + "items": { + "$ref": "Entity" + }, + "type": "array" + }, + "documentSentiment": { + "$ref": "Sentiment", + "description": "The overall sentiment for the document. Populated if the user enables\nAnnotateTextRequest.Features.extract_document_sentiment." + }, "language": { "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", "type": "string" }, "sentences": { - "description": "Sentences in the input document. Populated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", - "type": "array", "items": { "$ref": "Sentence" - } + }, + "type": "array", + "description": "Sentences in the input document. Populated if the user enables\nAnnotateTextRequest.Features.extract_syntax." }, "tokens": { "description": "Tokens, along with their syntactic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", - "type": "array", "items": { "$ref": "Token" - } - }, - "entities": { - "description": "Entities, along with their semantic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_entities.", - "type": "array", - "items": { - "$ref": "Entity" - } - }, - "documentSentiment": { - "$ref": "Sentiment", - "description": "The overall sentiment for the document. Populated if the user enables\nAnnotateTextRequest.Features.extract_document_sentiment." + }, + "type": "array" } }, - "id": "AnnotateTextResponse", - "description": "The text annotations response message.", - "type": "object" + "id": "AnnotateTextResponse" }, "DependencyEdge": { + "description": "Represents dependency parse tree information for a token.", + "type": "object", "properties": { - "headTokenIndex": { - "description": "Represents the head of this token in the dependency tree.\nThis is the index of the token which has an arc going to this token.\nThe index is the position of the token in the array of tokens returned\nby the API method. If this token is a root token, then the\n`head_token_index` is its own index.", - "format": "int32", - "type": "integer" - }, "label": { + "type": "string", "enumDescriptions": [ "Unknown", "Abbreviation modifier", @@ -603,7 +803,13 @@ "Nominalized clausal passive", "Compound of numeric modifier", "Copula", - "Dislocated relation (for fronted/topicalized elements)" + "Dislocated relation (for fronted/topicalized elements)", + "Aspect marker", + "Genitive modifier", + "Genitive object", + "Infinitival modifier", + "Measure", + "Nominal complement of a noun" ], "enum": [ "UNKNOWN", @@ -682,227 +888,28 @@ "NOMCSUBJPASS", "NUMC", "COP", - "DISLOCATED" + "DISLOCATED", + "ASP", + "GMOD", + "GOBJ", + "INFMOD", + "MES", + "NCOMP" ], - "description": "The parse label for the token.", - "type": "string" - } - }, - "id": "DependencyEdge", - "description": "Represents dependency parse tree information for a token.", - "type": "object" - }, - "TextSpan": { - "description": "Represents an output piece of text.", - "type": "object", - "properties": { - "beginOffset": { - "description": "The API calculates the beginning offset of the content in the original\ndocument according to the EncodingType specified in the API request.", + "description": "The parse label for the token." + }, + "headTokenIndex": { "format": "int32", + "description": "Represents the head of this token in the dependency tree.\nThis is the index of the token which has an arc going to this token.\nThe index is the position of the token in the array of tokens returned\nby the API method. If this token is a root token, then the\n`head_token_index` is its own index.", "type": "integer" - }, - "content": { - "description": "The content of the output text.", - "type": "string" } }, - "id": "TextSpan" - }, - "Token": { - "properties": { - "partOfSpeech": { - "$ref": "PartOfSpeech", - "description": "Parts of speech tag for this token." - }, - "text": { - "description": "The token text.", - "$ref": "TextSpan" - }, - "dependencyEdge": { - "$ref": "DependencyEdge", - "description": "Dependency tree parse for this token." - }, - "lemma": { - "description": "[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.", - "type": "string" - } - }, - "id": "Token", - "description": "Represents the smallest syntactic building block of the text.", - "type": "object" - }, - "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - } - }, - "id": "Status" - }, - "EntityMention": { - "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", - "type": "object", - "properties": { - "text": { - "description": "The mention text.", - "$ref": "TextSpan" - }, - "type": { - "enumDescriptions": [ - "Unknown", - "Proper name", - "Common noun (or noun compound)" - ], - "enum": [ - "TYPE_UNKNOWN", - "PROPER", - "COMMON" - ], - "description": "The type of the entity mention.", - "type": "string" - } - }, - "id": "EntityMention" - }, - "Features": { - "description": "All available features for sentiment, syntax, and semantic analysis.\nSetting each one to true will enable that specific analysis for the input.", - "type": "object", - "properties": { - "extractSyntax": { - "description": "Extract syntax information.", - "type": "boolean" - }, - "extractDocumentSentiment": { - "description": "Extract document-level sentiment.", - "type": "boolean" - }, - "extractEntities": { - "description": "Extract entities.", - "type": "boolean" - } - }, - "id": "Features" - }, - "Document": { - "description": "################################################################ #\n\nRepresents the input to API methods.", - "type": "object", - "properties": { - "gcsContentUri": { - "description": "The Google Cloud Storage URI where the file content is located.\nThis URI must be of the form: gs://bucket_name/object_name. For more\ndetails, see https://cloud.google.com/storage/docs/reference-uris.\nNOTE: Cloud Storage object versioning is not supported.", - "type": "string" - }, - "language": { - "description": "The language of the document (if not specified, the language is\nautomatically detected). Both ISO and BCP-47 language codes are\naccepted.\u003cbr\u003e\n[Language Support](/natural-language/docs/languages)\nlists currently supported languages for each API method.\nIf the language (either specified by the caller or automatically detected)\nis not supported by the called API method, an `INVALID_ARGUMENT` error\nis returned.", - "type": "string" - }, - "type": { - "enumDescriptions": [ - "The content type is not specified.", - "Plain text", - "HTML" - ], - "enum": [ - "TYPE_UNSPECIFIED", - "PLAIN_TEXT", - "HTML" - ], - "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`,\nreturns an `INVALID_ARGUMENT` error.", - "type": "string" - }, - "content": { - "description": "The content of the input in string format.", - "type": "string" - } - }, - "id": "Document" - }, - "Sentence": { - "properties": { - "text": { - "$ref": "TextSpan", - "description": "The sentence text." - }, - "sentiment": { - "description": "For calls to AnalyzeSentiment or if\nAnnotateTextRequest.Features.extract_document_sentiment is set to\ntrue, this field will contain the sentiment for the sentence.", - "$ref": "Sentiment" - } - }, - "id": "Sentence", - "description": "Represents a sentence in the input document.", - "type": "object" - }, - "Sentiment": { - "description": "Represents the feeling associated with the entire text or entities in\nthe text.", - "type": "object", - "properties": { - "polarity": { - "description": "DEPRECATED FIELD - This field is being deprecated in\nfavor of score. Please refer to our documentation at\nhttps://cloud.google.com/natural-language/docs for more information.", - "format": "float", - "type": "number" - }, - "score": { - "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", - "format": "float", - "type": "number" - }, - "magnitude": { - "description": "A non-negative number in the [0, +inf) range, which represents\nthe absolute magnitude of sentiment regardless of score (positive or\nnegative).", - "format": "float", - "type": "number" - } - }, - "id": "Sentiment" - }, - "AnalyzeEntitiesRequest": { - "properties": { - "encodingType": { - "enum": [ - "NONE", - "UTF8", - "UTF16", - "UTF32" - ], - "description": "The encoding type used by the API to calculate offsets.", - "type": "string", - "enumDescriptions": [ - "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", - "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." - ] - }, - "document": { - "$ref": "Document", - "description": "Input document." - } - }, - "id": "AnalyzeEntitiesRequest", - "description": "The entity analysis request message.", - "type": "object" + "id": "DependencyEdge" } }, "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" }, "protocol": "rest", "canonicalName": "Cloud Natural Language", @@ -911,6 +918,9 @@ "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-language": { + "description": "Apply machine learning models to reveal the structure and meaning of text" } } } @@ -924,59 +934,43 @@ "resources": { "documents": { "methods": { - "analyzeSentiment": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "AnalyzeSentimentResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {}, - "flatPath": "v1beta1/documents:analyzeSentiment", - "id": "language.documents.analyzeSentiment", - "path": "v1beta1/documents:analyzeSentiment", - "description": "Analyzes the sentiment of the provided text.", - "request": { - "$ref": "AnalyzeSentimentRequest" - } - }, "annotateText": { + "request": { + "$ref": "AnnotateTextRequest" + }, + "description": "A convenience method that provides all the features that analyzeSentiment,\nanalyzeEntities, and analyzeSyntax provide in one call.", "response": { "$ref": "AnnotateTextResponse" }, "parameterOrder": [], "httpMethod": "POST", - "parameters": {}, "scopes": [ + "https://www.googleapis.com/auth/cloud-language", "https://www.googleapis.com/auth/cloud-platform" ], + "parameters": {}, "flatPath": "v1beta1/documents:annotateText", - "path": "v1beta1/documents:annotateText", "id": "language.documents.annotateText", - "request": { - "$ref": "AnnotateTextRequest" - }, - "description": "A convenience method that provides all the features that analyzeSentiment,\nanalyzeEntities, and analyzeSyntax provide in one call." + "path": "v1beta1/documents:annotateText" }, "analyzeEntities": { - "id": "language.documents.analyzeEntities", - "path": "v1beta1/documents:analyzeEntities", "request": { "$ref": "AnalyzeEntitiesRequest" }, "description": "Finds named entities (currently proper names and common nouns) in the text\nalong with entity types, salience, mentions for each entity, and\nother properties.", - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "AnalyzeEntitiesResponse" }, - "parameters": {}, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ + "https://www.googleapis.com/auth/cloud-language", "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta1/documents:analyzeEntities" + "parameters": {}, + "flatPath": "v1beta1/documents:analyzeEntities", + "id": "language.documents.analyzeEntities", + "path": "v1beta1/documents:analyzeEntities" }, "analyzeSyntax": { "response": { @@ -984,44 +978,60 @@ }, "parameterOrder": [], "httpMethod": "POST", + "parameters": {}, "scopes": [ + "https://www.googleapis.com/auth/cloud-language", "https://www.googleapis.com/auth/cloud-platform" ], - "parameters": {}, "flatPath": "v1beta1/documents:analyzeSyntax", - "path": "v1beta1/documents:analyzeSyntax", "id": "language.documents.analyzeSyntax", + "path": "v1beta1/documents:analyzeSyntax", "description": "Analyzes the syntax of the text and provides sentence boundaries and\ntokenization along with part of speech tags, dependency trees, and other\nproperties.", "request": { "$ref": "AnalyzeSyntaxRequest" } + }, + "analyzeSentiment": { + "path": "v1beta1/documents:analyzeSentiment", + "id": "language.documents.analyzeSentiment", + "request": { + "$ref": "AnalyzeSentimentRequest" + }, + "description": "Analyzes the sentiment of the provided text.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta1/documents:analyzeSentiment" } } } }, "parameters": { - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "fields": { "location": "query", "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, "$.xgafv": { + "description": "V1 error format.", + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -1030,18 +1040,9 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" + ] }, "alt": { - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -1053,18 +1054,20 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query" + "location": "query", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" }, "key": { "location": "query", "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.", "type": "string" }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, "quotaUser": { "location": "query", "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.", @@ -1073,8 +1076,8 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" }, "oauth_token": { "location": "query", @@ -1085,6 +1088,22 @@ "location": "query", "description": "OAuth bearer token.", "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" } - } + }, + "version": "v1beta1", + "baseUrl": "https://language.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, entity sentiment analysis, and text annotations.", + "servicePath": "" } diff --git a/etc/api/language/v1beta2/language-api.json b/etc/api/language/v1beta2/language-api.json new file mode 100644 index 0000000000..1a732a4436 --- /dev/null +++ b/etc/api/language/v1beta2/language-api.json @@ -0,0 +1,1251 @@ +{ + "version_module": true, + "schemas": { + "AnalyzeEntitySentimentRequest": { + "description": "The entity-level sentiment analysis request message.", + "type": "object", + "properties": { + "document": { + "$ref": "Document", + "description": "Input document." + }, + "encodingType": { + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate offsets.", + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ] + } + }, + "id": "AnalyzeEntitySentimentRequest" + }, + "PartOfSpeech": { + "description": "Represents part of speech information for a token.", + "type": "object", + "properties": { + "person": { + "enum": [ + "PERSON_UNKNOWN", + "FIRST", + "SECOND", + "THIRD", + "REFLEXIVE_PERSON" + ], + "description": "The grammatical person.", + "type": "string", + "enumDescriptions": [ + "Person is not applicable in the analyzed language or is not predicted.", + "First", + "Second", + "Third", + "Reflexive" + ] + }, + "proper": { + "enumDescriptions": [ + "Proper is not applicable in the analyzed language or is not predicted.", + "Proper", + "Not proper" + ], + "enum": [ + "PROPER_UNKNOWN", + "PROPER", + "NOT_PROPER" + ], + "description": "The grammatical properness.", + "type": "string" + }, + "case": { + "type": "string", + "enumDescriptions": [ + "Case is not applicable in the analyzed language or is not predicted.", + "Accusative", + "Adverbial", + "Complementive", + "Dative", + "Genitive", + "Instrumental", + "Locative", + "Nominative", + "Oblique", + "Partitive", + "Prepositional", + "Reflexive", + "Relative", + "Vocative" + ], + "enum": [ + "CASE_UNKNOWN", + "ACCUSATIVE", + "ADVERBIAL", + "COMPLEMENTIVE", + "DATIVE", + "GENITIVE", + "INSTRUMENTAL", + "LOCATIVE", + "NOMINATIVE", + "OBLIQUE", + "PARTITIVE", + "PREPOSITIONAL", + "REFLEXIVE_CASE", + "RELATIVE_CASE", + "VOCATIVE" + ], + "description": "The grammatical case." + }, + "tense": { + "enum": [ + "TENSE_UNKNOWN", + "CONDITIONAL_TENSE", + "FUTURE", + "PAST", + "PRESENT", + "IMPERFECT", + "PLUPERFECT" + ], + "description": "The grammatical tense.", + "type": "string", + "enumDescriptions": [ + "Tense is not applicable in the analyzed language or is not predicted.", + "Conditional", + "Future", + "Past", + "Present", + "Imperfect", + "Pluperfect" + ] + }, + "reciprocity": { + "type": "string", + "enumDescriptions": [ + "Reciprocity is not applicable in the analyzed language or is not\npredicted.", + "Reciprocal", + "Non-reciprocal" + ], + "enum": [ + "RECIPROCITY_UNKNOWN", + "RECIPROCAL", + "NON_RECIPROCAL" + ], + "description": "The grammatical reciprocity." + }, + "form": { + "description": "The grammatical form.", + "type": "string", + "enumDescriptions": [ + "Form is not applicable in the analyzed language or is not predicted.", + "Adnomial", + "Auxiliary", + "Complementizer", + "Final ending", + "Gerund", + "Realis", + "Irrealis", + "Short form", + "Long form", + "Order form", + "Specific form" + ], + "enum": [ + "FORM_UNKNOWN", + "ADNOMIAL", + "AUXILIARY", + "COMPLEMENTIZER", + "FINAL_ENDING", + "GERUND", + "REALIS", + "IRREALIS", + "SHORT", + "LONG", + "ORDER", + "SPECIFIC" + ] + }, + "number": { + "enum": [ + "NUMBER_UNKNOWN", + "SINGULAR", + "PLURAL", + "DUAL" + ], + "description": "The grammatical number.", + "type": "string", + "enumDescriptions": [ + "Number is not applicable in the analyzed language or is not predicted.", + "Singular", + "Plural", + "Dual" + ] + }, + "voice": { + "type": "string", + "enumDescriptions": [ + "Voice is not applicable in the analyzed language or is not predicted.", + "Active", + "Causative", + "Passive" + ], + "enum": [ + "VOICE_UNKNOWN", + "ACTIVE", + "CAUSATIVE", + "PASSIVE" + ], + "description": "The grammatical voice." + }, + "aspect": { + "enum": [ + "ASPECT_UNKNOWN", + "PERFECTIVE", + "IMPERFECTIVE", + "PROGRESSIVE" + ], + "description": "The grammatical aspect.", + "type": "string", + "enumDescriptions": [ + "Aspect is not applicable in the analyzed language or is not predicted.", + "Perfective", + "Imperfective", + "Progressive" + ] + }, + "mood": { + "enumDescriptions": [ + "Mood is not applicable in the analyzed language or is not predicted.", + "Conditional", + "Imperative", + "Indicative", + "Interrogative", + "Jussive", + "Subjunctive" + ], + "enum": [ + "MOOD_UNKNOWN", + "CONDITIONAL_MOOD", + "IMPERATIVE", + "INDICATIVE", + "INTERROGATIVE", + "JUSSIVE", + "SUBJUNCTIVE" + ], + "description": "The grammatical mood.", + "type": "string" + }, + "tag": { + "enum": [ + "UNKNOWN", + "ADJ", + "ADP", + "ADV", + "CONJ", + "DET", + "NOUN", + "NUM", + "PRON", + "PRT", + "PUNCT", + "VERB", + "X", + "AFFIX" + ], + "description": "The part of speech tag.", + "type": "string", + "enumDescriptions": [ + "Unknown", + "Adjective", + "Adposition (preposition and postposition)", + "Adverb", + "Conjunction", + "Determiner", + "Noun (common and proper)", + "Cardinal number", + "Pronoun", + "Particle or other function word", + "Punctuation", + "Verb (all tenses and modes)", + "Other: foreign words, typos, abbreviations", + "Affix" + ] + }, + "gender": { + "description": "The grammatical gender.", + "type": "string", + "enumDescriptions": [ + "Gender is not applicable in the analyzed language or is not predicted.", + "Feminine", + "Masculine", + "Neuter" + ], + "enum": [ + "GENDER_UNKNOWN", + "FEMININE", + "MASCULINE", + "NEUTER" + ] + } + }, + "id": "PartOfSpeech" + }, + "ClassificationCategory": { + "type": "object", + "properties": { + "confidence": { + "format": "float", + "description": "The classifier's confidence of the category. Number represents how certain\nthe classifier is that this category represents the given text.", + "type": "number" + }, + "name": { + "description": "The name of the category representing the document.", + "type": "string" + } + }, + "id": "ClassificationCategory", + "description": "Represents a category returned from the text classifier." + }, + "AnalyzeSyntaxRequest": { + "description": "The syntax analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate offsets." + }, + "document": { + "$ref": "Document", + "description": "Input document." + } + }, + "id": "AnalyzeSyntaxRequest" + }, + "AnalyzeEntitiesResponse": { + "description": "The entity analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "entities": { + "description": "The recognized entities in the input document.", + "items": { + "$ref": "Entity" + }, + "type": "array" + } + }, + "id": "AnalyzeEntitiesResponse" + }, + "Entity": { + "description": "Represents a phrase in the text that is a known entity, such as\na person, an organization, or location. The API associates information, such\nas salience and mentions, with entities.", + "type": "object", + "properties": { + "name": { + "description": "The representative name for the entity.", + "type": "string" + }, + "type": { + "enum": [ + "UNKNOWN", + "PERSON", + "LOCATION", + "ORGANIZATION", + "EVENT", + "WORK_OF_ART", + "CONSUMER_GOOD", + "OTHER" + ], + "description": "The entity type.", + "type": "string", + "enumDescriptions": [ + "Unknown", + "Person", + "Location", + "Organization", + "Event", + "Work of art", + "Consumer goods", + "Other types" + ] + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the entity.\n\nCurrently, Wikipedia URLs and Knowledge Graph MIDs are provided, if\navailable. The associated keys are \"wikipedia_url\" and \"mid\", respectively.", + "type": "object" + }, + "salience": { + "format": "float", + "description": "The salience score associated with the entity in the [0, 1.0] range.\n\nThe salience score for an entity provides information about the\nimportance or centrality of that entity to the entire document text.\nScores closer to 0 are less salient, while scores closer to 1.0 are highly\nsalient.", + "type": "number" + }, + "sentiment": { + "description": "For calls to AnalyzeEntitySentiment or if\nAnnotateTextRequest.Features.extract_entity_sentiment is set to\ntrue, this field will contain the aggregate sentiment expressed for this\nentity in the provided document.", + "$ref": "Sentiment" + }, + "mentions": { + "items": { + "$ref": "EntityMention" + }, + "type": "array", + "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions." + } + }, + "id": "Entity" + }, + "AnnotateTextRequest": { + "description": "The request message for the text annotation API, which can perform multiple\nanalysis types (sentiment, entities, and syntax) in one call.", + "type": "object", + "properties": { + "encodingType": { + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate offsets.", + "type": "string" + }, + "document": { + "$ref": "Document", + "description": "Input document." + }, + "features": { + "description": "The enabled features.", + "$ref": "Features" + } + }, + "id": "AnnotateTextRequest" + }, + "AnalyzeSentimentRequest": { + "description": "The sentiment analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate sentence offsets for the\nsentence sentiment.", + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ] + }, + "document": { + "description": "Input document.", + "$ref": "Document" + } + }, + "id": "AnalyzeSentimentRequest" + }, + "Status": { + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + } + } + }, + "Features": { + "description": "All available features for sentiment, syntax, and semantic analysis.\nSetting each one to true will enable that specific analysis for the input.", + "type": "object", + "properties": { + "extractEntitySentiment": { + "description": "Extract entities and their associated sentiment.", + "type": "boolean" + }, + "extractDocumentSentiment": { + "description": "Extract document-level sentiment.", + "type": "boolean" + }, + "extractSyntax": { + "type": "boolean", + "description": "Extract syntax information." + }, + "extractEntities": { + "description": "Extract entities.", + "type": "boolean" + }, + "classifyText": { + "description": "Classify the full document into categories.", + "type": "boolean" + } + }, + "id": "Features" + }, + "Document": { + "properties": { + "language": { + "type": "string", + "description": "The language of the document (if not specified, the language is\nautomatically detected). Both ISO and BCP-47 language codes are\naccepted.\u003cbr\u003e\n[Language Support](/natural-language/docs/languages)\nlists currently supported languages for each API method.\nIf the language (either specified by the caller or automatically detected)\nis not supported by the called API method, an `INVALID_ARGUMENT` error\nis returned." + }, + "content": { + "description": "The content of the input in string format.", + "type": "string" + }, + "type": { + "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`,\nreturns an `INVALID_ARGUMENT` error.", + "type": "string", + "enumDescriptions": [ + "The content type is not specified.", + "Plain text", + "HTML" + ], + "enum": [ + "TYPE_UNSPECIFIED", + "PLAIN_TEXT", + "HTML" + ] + }, + "gcsContentUri": { + "description": "The Google Cloud Storage URI where the file content is located.\nThis URI must be of the form: gs://bucket_name/object_name. For more\ndetails, see https://cloud.google.com/storage/docs/reference-uris.\nNOTE: Cloud Storage object versioning is not supported.", + "type": "string" + } + }, + "id": "Document", + "description": "################################################################ #\n\nRepresents the input to API methods.", + "type": "object" + }, + "AnalyzeEntitiesRequest": { + "description": "The entity analysis request message.", + "type": "object", + "properties": { + "encodingType": { + "description": "The encoding type used by the API to calculate offsets.", + "type": "string", + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and Javascript are examples of\nlanguages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively." + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ] + }, + "document": { + "$ref": "Document", + "description": "Input document." + } + }, + "id": "AnalyzeEntitiesRequest" + }, + "ClassifyTextRequest": { + "type": "object", + "properties": { + "document": { + "$ref": "Document", + "description": "Input document." + } + }, + "id": "ClassifyTextRequest", + "description": "The document classification request message." + }, + "AnalyzeEntitySentimentResponse": { + "description": "The entity-level sentiment analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "entities": { + "description": "The recognized entities in the input document with associated sentiments.", + "items": { + "$ref": "Entity" + }, + "type": "array" + } + }, + "id": "AnalyzeEntitySentimentResponse" + }, + "AnalyzeSentimentResponse": { + "description": "The sentiment analysis response message.", + "type": "object", + "properties": { + "documentSentiment": { + "$ref": "Sentiment", + "description": "The overall sentiment of the input document." + }, + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "description": "The sentiment for all the sentences in the document.", + "items": { + "$ref": "Sentence" + }, + "type": "array" + } + }, + "id": "AnalyzeSentimentResponse" + }, + "AnalyzeSyntaxResponse": { + "description": "The syntax analysis response message.", + "type": "object", + "properties": { + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "sentences": { + "items": { + "$ref": "Sentence" + }, + "type": "array", + "description": "Sentences in the input document." + }, + "tokens": { + "description": "Tokens, along with their syntactic information, in the input document.", + "items": { + "$ref": "Token" + }, + "type": "array" + } + }, + "id": "AnalyzeSyntaxResponse" + }, + "AnnotateTextResponse": { + "type": "object", + "properties": { + "documentSentiment": { + "$ref": "Sentiment", + "description": "The overall sentiment for the document. Populated if the user enables\nAnnotateTextRequest.Features.extract_document_sentiment." + }, + "categories": { + "description": "Categories identified in the input document.", + "items": { + "$ref": "ClassificationCategory" + }, + "type": "array" + }, + "language": { + "description": "The language of the text, which will be the same as the language specified\nin the request or, if not specified, the automatically-detected language.\nSee Document.language field for more details.", + "type": "string" + }, + "entities": { + "description": "Entities, along with their semantic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_entities.", + "items": { + "$ref": "Entity" + }, + "type": "array" + }, + "sentences": { + "items": { + "$ref": "Sentence" + }, + "type": "array", + "description": "Sentences in the input document. Populated if the user enables\nAnnotateTextRequest.Features.extract_syntax." + }, + "tokens": { + "description": "Tokens, along with their syntactic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_syntax.", + "items": { + "$ref": "Token" + }, + "type": "array" + } + }, + "id": "AnnotateTextResponse", + "description": "The text annotations response message." + }, + "DependencyEdge": { + "id": "DependencyEdge", + "description": "Represents dependency parse tree information for a token.", + "type": "object", + "properties": { + "headTokenIndex": { + "format": "int32", + "description": "Represents the head of this token in the dependency tree.\nThis is the index of the token which has an arc going to this token.\nThe index is the position of the token in the array of tokens returned\nby the API method. If this token is a root token, then the\n`head_token_index` is its own index.", + "type": "integer" + }, + "label": { + "description": "The parse label for the token.", + "type": "string", + "enumDescriptions": [ + "Unknown", + "Abbreviation modifier", + "Adjectival complement", + "Adverbial clause modifier", + "Adverbial modifier", + "Adjectival modifier of an NP", + "Appositional modifier of an NP", + "Attribute dependent of a copular verb", + "Auxiliary (non-main) verb", + "Passive auxiliary", + "Coordinating conjunction", + "Clausal complement of a verb or adjective", + "Conjunct", + "Clausal subject", + "Clausal passive subject", + "Dependency (unable to determine)", + "Determiner", + "Discourse", + "Direct object", + "Expletive", + "Goes with (part of a word in a text not well edited)", + "Indirect object", + "Marker (word introducing a subordinate clause)", + "Multi-word expression", + "Multi-word verbal expression", + "Negation modifier", + "Noun compound modifier", + "Noun phrase used as an adverbial modifier", + "Nominal subject", + "Passive nominal subject", + "Numeric modifier of a noun", + "Element of compound number", + "Punctuation mark", + "Parataxis relation", + "Participial modifier", + "The complement of a preposition is a clause", + "Object of a preposition", + "Possession modifier", + "Postverbal negative particle", + "Predicate complement", + "Preconjunt", + "Predeterminer", + "Prefix", + "Prepositional modifier", + "The relationship between a verb and verbal morpheme", + "Particle", + "Associative or possessive marker", + "Quantifier phrase modifier", + "Relative clause modifier", + "Complementizer in relative clause", + "Ellipsis without a preceding predicate", + "Referent", + "Remnant", + "Reparandum", + "Root", + "Suffix specifying a unit of number", + "Suffix", + "Temporal modifier", + "Topic marker", + "Clause headed by an infinite form of the verb that modifies a noun", + "Vocative", + "Open clausal complement", + "Name suffix", + "Name title", + "Adverbial phrase modifier", + "Causative auxiliary", + "Helper auxiliary", + "Rentaishi (Prenominal modifier)", + "Foreign words", + "Keyword", + "List for chains of comparable items", + "Nominalized clause", + "Nominalized clausal subject", + "Nominalized clausal passive", + "Compound of numeric modifier", + "Copula", + "Dislocated relation (for fronted/topicalized elements)", + "Aspect marker", + "Genitive modifier", + "Genitive object", + "Infinitival modifier", + "Measure", + "Nominal complement of a noun" + ], + "enum": [ + "UNKNOWN", + "ABBREV", + "ACOMP", + "ADVCL", + "ADVMOD", + "AMOD", + "APPOS", + "ATTR", + "AUX", + "AUXPASS", + "CC", + "CCOMP", + "CONJ", + "CSUBJ", + "CSUBJPASS", + "DEP", + "DET", + "DISCOURSE", + "DOBJ", + "EXPL", + "GOESWITH", + "IOBJ", + "MARK", + "MWE", + "MWV", + "NEG", + "NN", + "NPADVMOD", + "NSUBJ", + "NSUBJPASS", + "NUM", + "NUMBER", + "P", + "PARATAXIS", + "PARTMOD", + "PCOMP", + "POBJ", + "POSS", + "POSTNEG", + "PRECOMP", + "PRECONJ", + "PREDET", + "PREF", + "PREP", + "PRONL", + "PRT", + "PS", + "QUANTMOD", + "RCMOD", + "RCMODREL", + "RDROP", + "REF", + "REMNANT", + "REPARANDUM", + "ROOT", + "SNUM", + "SUFF", + "TMOD", + "TOPIC", + "VMOD", + "VOCATIVE", + "XCOMP", + "SUFFIX", + "TITLE", + "ADVPHMOD", + "AUXCAUS", + "AUXVV", + "DTMOD", + "FOREIGN", + "KW", + "LIST", + "NOMC", + "NOMCSUBJ", + "NOMCSUBJPASS", + "NUMC", + "COP", + "DISLOCATED", + "ASP", + "GMOD", + "GOBJ", + "INFMOD", + "MES", + "NCOMP" + ] + } + } + }, + "TextSpan": { + "id": "TextSpan", + "description": "Represents an output piece of text.", + "type": "object", + "properties": { + "beginOffset": { + "type": "integer", + "format": "int32", + "description": "The API calculates the beginning offset of the content in the original\ndocument according to the EncodingType specified in the API request." + }, + "content": { + "description": "The content of the output text.", + "type": "string" + } + } + }, + "Token": { + "description": "Represents the smallest syntactic building block of the text.", + "type": "object", + "properties": { + "partOfSpeech": { + "$ref": "PartOfSpeech", + "description": "Parts of speech tag for this token." + }, + "dependencyEdge": { + "$ref": "DependencyEdge", + "description": "Dependency tree parse for this token." + }, + "text": { + "$ref": "TextSpan", + "description": "The token text." + }, + "lemma": { + "description": "[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.", + "type": "string" + } + }, + "id": "Token" + }, + "EntityMention": { + "properties": { + "type": { + "description": "The type of the entity mention.", + "type": "string", + "enumDescriptions": [ + "Unknown", + "Proper name", + "Common noun (or noun compound)" + ], + "enum": [ + "TYPE_UNKNOWN", + "PROPER", + "COMMON" + ] + }, + "text": { + "description": "The mention text.", + "$ref": "TextSpan" + }, + "sentiment": { + "$ref": "Sentiment", + "description": "For calls to AnalyzeEntitySentiment or if\nAnnotateTextRequest.Features.extract_entity_sentiment is set to\ntrue, this field will contain the sentiment expressed for this mention of\nthe entity in the provided document." + } + }, + "id": "EntityMention", + "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", + "type": "object" + }, + "ClassifyTextResponse": { + "description": "The document classification response message.", + "type": "object", + "properties": { + "categories": { + "description": "Categories representing the input document.", + "items": { + "$ref": "ClassificationCategory" + }, + "type": "array" + } + }, + "id": "ClassifyTextResponse" + }, + "Sentence": { + "id": "Sentence", + "description": "Represents a sentence in the input document.", + "type": "object", + "properties": { + "text": { + "$ref": "TextSpan", + "description": "The sentence text." + }, + "sentiment": { + "$ref": "Sentiment", + "description": "For calls to AnalyzeSentiment or if\nAnnotateTextRequest.Features.extract_document_sentiment is set to\ntrue, this field will contain the sentiment for the sentence." + } + } + }, + "Sentiment": { + "description": "Represents the feeling associated with the entire text or entities in\nthe text.", + "type": "object", + "properties": { + "score": { + "format": "float", + "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", + "type": "number" + }, + "magnitude": { + "format": "float", + "description": "A non-negative number in the [0, +inf) range, which represents\nthe absolute magnitude of sentiment regardless of score (positive or\nnegative).", + "type": "number" + } + }, + "id": "Sentiment" + } + }, + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "canonicalName": "Cloud Natural Language", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-language": { + "description": "Apply machine learning models to reveal the structure and meaning of text" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://language.googleapis.com/", + "ownerDomain": "google.com", + "name": "language", + "batchPath": "batch", + "title": "Google Cloud Natural Language API", + "ownerName": "Google", + "resources": { + "documents": { + "methods": { + "analyzeEntitySentiment": { + "flatPath": "v1beta2/documents:analyzeEntitySentiment", + "id": "language.documents.analyzeEntitySentiment", + "path": "v1beta2/documents:analyzeEntitySentiment", + "request": { + "$ref": "AnalyzeEntitySentimentRequest" + }, + "description": "Finds entities, similar to AnalyzeEntities in the text and analyzes\nsentiment associated with each entity and its mentions.", + "response": { + "$ref": "AnalyzeEntitySentimentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {} + }, + "analyzeEntities": { + "response": { + "$ref": "AnalyzeEntitiesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta2/documents:analyzeEntities", + "id": "language.documents.analyzeEntities", + "path": "v1beta2/documents:analyzeEntities", + "request": { + "$ref": "AnalyzeEntitiesRequest" + }, + "description": "Finds named entities (currently proper names and common nouns) in the text\nalong with entity types, salience, mentions for each entity, and\nother properties." + }, + "analyzeSyntax": { + "description": "Analyzes the syntax of the text and provides sentence boundaries and\ntokenization along with part of speech tags, dependency trees, and other\nproperties.", + "request": { + "$ref": "AnalyzeSyntaxRequest" + }, + "response": { + "$ref": "AnalyzeSyntaxResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/documents:analyzeSyntax", + "id": "language.documents.analyzeSyntax", + "path": "v1beta2/documents:analyzeSyntax" + }, + "annotateText": { + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/documents:annotateText", + "path": "v1beta2/documents:annotateText", + "id": "language.documents.annotateText", + "description": "A convenience method that provides all syntax, sentiment, entity, and\nclassification features in one call.", + "request": { + "$ref": "AnnotateTextRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnnotateTextResponse" + } + }, + "classifyText": { + "request": { + "$ref": "ClassifyTextRequest" + }, + "description": "Classifies a document into categories.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "ClassifyTextResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta2/documents:classifyText", + "path": "v1beta2/documents:classifyText", + "id": "language.documents.classifyText" + }, + "analyzeSentiment": { + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/documents:analyzeSentiment", + "id": "language.documents.analyzeSentiment", + "path": "v1beta2/documents:analyzeSentiment", + "description": "Analyzes the sentiment of the provided text.", + "request": { + "$ref": "AnalyzeSentimentRequest" + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "default": "true", + "type": "boolean", + "location": "query", + "description": "Pretty-print response." + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + } + }, + "version": "v1beta2", + "baseUrl": "https://language.googleapis.com/", + "servicePath": "", + "description": "Provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, entity sentiment analysis, and text annotations.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "language:v1beta2", + "revision": "20170918", + "documentationLink": "https://cloud.google.com/natural-language/", + "discoveryVersion": "v1" +} diff --git a/etc/api/licensing/v1/licensing-api.json b/etc/api/licensing/v1/licensing-api.json index a6015c6ce3..64e2935616 100644 --- a/etc/api/licensing/v1/licensing-api.json +++ b/etc/api/licensing/v1/licensing-api.json @@ -20,7 +20,7 @@ "basePath": "/apps/licensing/v1/product/", "rootUrl": "https://www.googleapis.com/", "servicePath": "apps/licensing/v1/product/", - "batchPath": "batch", + "batchPath": "batch/licensing/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/logging/v2/crates/1.0.6-api+20170918 b/etc/api/logging/v2/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/logging/v2/logging-api.json b/etc/api/logging/v2/logging-api.json index 55398119ed..6a7a63003c 100644 --- a/etc/api/logging/v2/logging-api.json +++ b/etc/api/logging/v2/logging-api.json @@ -1,252 +1,52 @@ { - "resources": { - "folders": { - "resources": { - "logs": { - "methods": { - "delete": { - "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", - "httpMethod": "DELETE", - "parameterOrder": [ - "logName" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "logName": { - "location": "path", - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+/logs/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "flatPath": "v2/folders/{foldersId}/logs/{logsId}", - "id": "logging.folders.logs.delete", - "path": "v2/{+logName}" - }, - "list": { - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - "response": { - "$ref": "ListLogsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "parent": { - "location": "path", - "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$" - }, - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v2/folders/{foldersId}/logs", - "id": "logging.folders.logs.list", - "path": "v2/{+parent}/logs" - } - } + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "canonicalName": "Logging", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/logging.write": { + "description": "Submit log data for your projects" }, - "sinks": { - "methods": { - "delete": { - "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - "id": "logging.folders.sinks.delete", - "path": "v2/{+sinkName}", - "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "sinkName" - ], - "parameters": { - "sinkName": { - "pattern": "^folders/[^/]+/sinks/[^/]+$", - "location": "path", - "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ] - }, - "list": { - "parameters": { - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "parent": { - "location": "path", - "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2/folders/{foldersId}/sinks", - "path": "v2/{+parent}/sinks", - "id": "logging.folders.sinks.list", - "description": "Lists sinks.", - "response": { - "$ref": "ListSinksResponse" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "GET" - }, - "get": { - "path": "v2/{+sinkName}", - "id": "logging.folders.sinks.get", - "description": "Gets a sink.", - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "sinkName" - ], - "httpMethod": "GET", - "parameters": { - "sinkName": { - "pattern": "^folders/[^/]+/sinks/[^/]+$", - "location": "path", - "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}" - }, - "update": { - "request": { - "$ref": "LogSink" - }, - "description": "Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field.", - "httpMethod": "PUT", - "parameterOrder": [ - "sinkName" - ], - "response": { - "$ref": "LogSink" - }, - "parameters": { - "sinkName": { - "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+/sinks/[^/]+$", - "location": "path" - }, - "uniqueWriterIdentity": { - "location": "query", - "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is false.", - "type": "boolean" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - "id": "logging.folders.sinks.update", - "path": "v2/{+sinkName}" - }, - "create": { - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "parent": { - "location": "path", - "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", - "required": true, - "type": "string", - "pattern": "^folders/[^/]+$" - }, - "uniqueWriterIdentity": { - "type": "boolean", - "location": "query", - "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink." - } - }, - "flatPath": "v2/folders/{foldersId}/sinks", - "path": "v2/{+parent}/sinks", - "id": "logging.folders.sinks.create", - "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - "request": { - "$ref": "LogSink" - } - } - } + "https://www.googleapis.com/auth/logging.read": { + "description": "View log data for your projects" + }, + "https://www.googleapis.com/auth/logging.admin": { + "description": "Administrate log data for your projects" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" } } - }, + } + }, + "rootUrl": "https://logging.googleapis.com/", + "ownerDomain": "google.com", + "name": "logging", + "batchPath": "batch", + "title": "Stackdriver Logging API", + "ownerName": "Google", + "resources": { "monitoredResourceDescriptors": { "methods": { "list": { - "description": "Lists the descriptors for monitored resource types used by Stackdriver Logging.", - "httpMethod": "GET", - "parameterOrder": [], "response": { "$ref": "ListMonitoredResourceDescriptorsResponse" }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], "parameters": { "pageToken": { "type": "string", @@ -254,105 +54,57 @@ "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call." }, "pageSize": { - "type": "integer", - "location": "query", + "format": "int32", "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32" + "type": "integer", + "location": "query" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], "flatPath": "v2/monitoredResourceDescriptors", "id": "logging.monitoredResourceDescriptors.list", - "path": "v2/monitoredResourceDescriptors" + "path": "v2/monitoredResourceDescriptors", + "description": "Lists the descriptors for monitored resource types used by Stackdriver Logging." } } }, "organizations": { "resources": { - "logs": { + "sinks": { "methods": { "delete": { - "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", - "id": "logging.organizations.logs.delete", - "path": "v2/{+logName}", - "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", - "httpMethod": "DELETE", - "parameterOrder": [ - "logName" - ], "response": { "$ref": "Empty" }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "DELETE", "parameters": { - "logName": { + "sinkName": { + "pattern": "^organizations/[^/]+/sinks/[^/]+$", "location": "path", - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "required": true, + "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", "type": "string", - "pattern": "^organizations/[^/]+/logs/[^/]+$" + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" - ] + ], + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "id": "logging.organizations.sinks.delete", + "path": "v2/{+sinkName}", + "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted." }, - "list": { - "flatPath": "v2/organizations/{organizationsId}/logs", - "id": "logging.organizations.logs.list", - "path": "v2/{+parent}/logs", - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "ListLogsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "parent": { - "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - } - } - } - } - }, - "sinks": { - "methods": { "list": { "id": "logging.organizations.sinks.list", "path": "v2/{+parent}/sinks", "description": "Lists sinks.", - "httpMethod": "GET", "response": { "$ref": "ListSinksResponse" }, + "httpMethod": "GET", "parameterOrder": [ "parent" ], @@ -363,108 +115,46 @@ "https://www.googleapis.com/auth/logging.read" ], "parameters": { - "parent": { - "location": "path", - "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$" - }, "pageToken": { "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", "type": "string", "location": "query" }, "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", "format": "int32", - "type": "integer" + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path" } }, "flatPath": "v2/organizations/{organizationsId}/sinks" }, - "get": { - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "sinkName" - ], - "httpMethod": "GET", - "parameters": { - "sinkName": { - "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+/sinks/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - "path": "v2/{+sinkName}", - "id": "logging.organizations.sinks.get", - "description": "Gets a sink." - }, - "update": { - "id": "logging.organizations.sinks.update", - "path": "v2/{+sinkName}", - "description": "Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field.", - "request": { - "$ref": "LogSink" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "sinkName" - ], - "response": { - "$ref": "LogSink" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "sinkName": { - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+/sinks/[^/]+$", - "location": "path", - "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\"." - }, - "uniqueWriterIdentity": { - "location": "query", - "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is false.", - "type": "boolean" - } - }, - "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}" - }, "create": { - "response": { - "$ref": "LogSink" - }, + "httpMethod": "POST", "parameterOrder": [ "parent" ], - "httpMethod": "POST", + "response": { + "$ref": "LogSink" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" ], "parameters": { "parent": { - "required": true, - "type": "string", "pattern": "^organizations/[^/]+$", "location": "path", - "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\"." + "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", + "type": "string", + "required": true }, "uniqueWriterIdentity": { "location": "query", @@ -475,36 +165,348 @@ "flatPath": "v2/organizations/{organizationsId}/sinks", "path": "v2/{+parent}/sinks", "id": "logging.organizations.sinks.create", - "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", "request": { "$ref": "LogSink" - } + }, + "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink." }, - "delete": { + "get": { + "path": "v2/{+sinkName}", + "id": "logging.organizations.sinks.get", + "description": "Gets a sink.", + "httpMethod": "GET", "response": { - "$ref": "Empty" + "$ref": "LogSink" }, "parameterOrder": [ "sinkName" ], - "httpMethod": "DELETE", "parameters": { "sinkName": { - "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, + "location": "path", + "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/sinks/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}" + }, + "patch": { + "request": { + "$ref": "LogSink" + }, + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string", + "location": "query" + }, + "uniqueWriterIdentity": { + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.", + "type": "boolean", + "location": "query" + }, + "sinkName": { + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, "pattern": "^organizations/[^/]+/sinks/[^/]+$", "location": "path" } }, + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "id": "logging.organizations.sinks.patch", + "path": "v2/{+sinkName}" + }, + "update": { + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PUT", + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string" + }, + "uniqueWriterIdentity": { + "type": "boolean", + "location": "query", + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false." + }, + "sinkName": { + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/sinks/[^/]+$", + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\"." + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" ], "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "id": "logging.organizations.sinks.update", "path": "v2/{+sinkName}", - "id": "logging.organizations.sinks.delete", - "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted." + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "request": { + "$ref": "LogSink" + } + } + } + }, + "logs": { + "methods": { + "list": { + "flatPath": "v2/organizations/{organizationsId}/logs", + "id": "logging.organizations.logs.list", + "path": "v2/{+parent}/logs", + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + "response": { + "$ref": "ListLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available." + }, + "parent": { + "location": "path", + "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$" + } + } + }, + "delete": { + "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", + "httpMethod": "DELETE", + "parameterOrder": [ + "logName" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "logName": { + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/logs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", + "path": "v2/{+logName}", + "id": "logging.organizations.logs.delete" + } + } + }, + "exclusions": { + "methods": { + "delete": { + "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + "id": "logging.organizations.exclusions.delete", + "path": "v2/{+name}", + "description": "Deletes an exclusion.", + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "name": { + "description": "Required. The resource name of an existing exclusion to delete:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + "location": "path" + } + } + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "LogExclusion" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + "type": "string" + }, + "name": { + "description": "Required. The resource name of the exclusion to update:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.organizations.exclusions.patch", + "request": { + "$ref": "LogExclusion" + }, + "description": "Changes one or more properties of an existing exclusion." + }, + "get": { + "description": "Gets the description of an exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + "location": "path", + "description": "Required. The resource name of an existing exclusion:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\"." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + "id": "logging.organizations.exclusions.get", + "path": "v2/{+name}" + }, + "list": { + "flatPath": "v2/organizations/{organizationsId}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.organizations.exclusions.list", + "description": "Lists all the exclusions in a parent resource.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListExclusionsResponse" + }, + "parameters": { + "parent": { + "pattern": "^organizations/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogExclusion" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "parent": { + "pattern": "^organizations/[^/]+$", + "location": "path", + "description": "Required. The parent resource in which to create the exclusion:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", + "type": "string", + "required": true + } + }, + "flatPath": "v2/organizations/{organizationsId}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.organizations.exclusions.create", + "request": { + "$ref": "LogExclusion" + }, + "description": "Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource." } } } @@ -513,129 +515,53 @@ "entries": { "methods": { "list": { - "path": "v2/entries:list", - "id": "logging.entries.list", - "description": "Lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to export log entries, see Exporting Logs.", - "request": { - "$ref": "ListLogEntriesRequest" - }, + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "ListLogEntriesResponse" }, - "parameterOrder": [], - "httpMethod": "POST", + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", "https://www.googleapis.com/auth/logging.admin", "https://www.googleapis.com/auth/logging.read" ], - "parameters": {}, - "flatPath": "v2/entries:list" + "flatPath": "v2/entries:list", + "path": "v2/entries:list", + "id": "logging.entries.list", + "description": "Lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to export log entries, see Exporting Logs.", + "request": { + "$ref": "ListLogEntriesRequest" + } }, "write": { - "response": { - "$ref": "WriteLogEntriesResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "flatPath": "v2/entries:write", "path": "v2/entries:write", "id": "logging.entries.write", "request": { "$ref": "WriteLogEntriesRequest" }, - "description": "Writes log entries to Stackdriver Logging." + "description": "Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "WriteLogEntriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "parameters": {}, + "flatPath": "v2/entries:write" } } }, "projects": { "resources": { - "logs": { - "methods": { - "delete": { - "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "logName" - ], - "httpMethod": "DELETE", - "parameters": { - "logName": { - "pattern": "^projects/[^/]+/logs/[^/]+$", - "location": "path", - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "flatPath": "v2/projects/{projectsId}/logs/{logsId}", - "path": "v2/{+logName}", - "id": "logging.projects.logs.delete" - }, - "list": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "parent": { - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v2/projects/{projectsId}/logs", - "id": "logging.projects.logs.list", - "path": "v2/{+parent}/logs", - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - "httpMethod": "GET", - "response": { - "$ref": "ListLogsResponse" - }, - "parameterOrder": [ - "parent" - ] - } - } - }, "sinks": { "methods": { "create": { - "flatPath": "v2/projects/{projectsId}/sinks", - "path": "v2/{+parent}/sinks", - "id": "logging.projects.sinks.create", - "request": { - "$ref": "LogSink" - }, - "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", "response": { "$ref": "LogSink" }, @@ -644,38 +570,124 @@ ], "httpMethod": "POST", "parameters": { + "parent": { + "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + }, "uniqueWriterIdentity": { "location": "query", "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", "type": "boolean" - }, - "parent": { - "location": "path", - "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" - ] + ], + "flatPath": "v2/projects/{projectsId}/sinks", + "id": "logging.projects.sinks.create", + "path": "v2/{+parent}/sinks", + "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + "request": { + "$ref": "LogSink" + } }, - "delete": { - "httpMethod": "DELETE", + "patch": { + "request": { + "$ref": "LogSink" + }, + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string", + "location": "query" + }, + "uniqueWriterIdentity": { + "type": "boolean", + "location": "query", + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false." + }, + "sinkName": { + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/sinks/[^/]+$" + } + }, + "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", + "id": "logging.projects.sinks.patch", + "path": "v2/{+sinkName}" + }, + "get": { + "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.projects.sinks.get", + "description": "Gets a sink.", + "httpMethod": "GET", "parameterOrder": [ "sinkName" ], "response": { - "$ref": "Empty" + "$ref": "LogSink" }, "parameters": { "sinkName": { - "location": "path", - "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, "type": "string", + "required": true, + "pattern": "^projects/[^/]+/sinks/[^/]+$", + "location": "path", + "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\"." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "update": { + "httpMethod": "PUT", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "LogSink" + }, + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string" + }, + "uniqueWriterIdentity": { + "type": "boolean", + "location": "query", + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false." + }, + "sinkName": { + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, "pattern": "^projects/[^/]+/sinks/[^/]+$" } }, @@ -683,19 +695,121 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" ], + "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.projects.sinks.update", + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "request": { + "$ref": "LogSink" + } + }, + "delete": { "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", "id": "logging.projects.sinks.delete", "path": "v2/{+sinkName}", - "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted." + "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "sinkName": { + "location": "path", + "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/sinks/[^/]+$" + } + } }, "list": { - "httpMethod": "GET", + "description": "Lists sinks.", "response": { "$ref": "ListSinksResponse" }, "parameterOrder": [ "parent" ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call." + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer" + }, + "parent": { + "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/projects/{projectsId}/sinks", + "id": "logging.projects.sinks.list", + "path": "v2/{+parent}/sinks" + } + } + }, + "logs": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "logName" + ], + "parameters": { + "logName": { + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/logs/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/projects/{projectsId}/logs/{logsId}", + "path": "v2/{+logName}", + "id": "logging.projects.logs.delete", + "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted." + }, + "list": { + "flatPath": "v2/projects/{projectsId}/logs", + "id": "logging.projects.logs.list", + "path": "v2/{+parent}/logs", + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + "response": { + "$ref": "ListLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", @@ -703,30 +817,492 @@ "https://www.googleapis.com/auth/logging.read" ], "parameters": { + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + }, "parent": { "pattern": "^projects/[^/]+$", "location": "path", - "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true + } + } + } + } + }, + "exclusions": { + "methods": { + "delete": { + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/exclusions/[^/]+$", + "location": "path", + "description": "Required. The resource name of an existing exclusion to delete:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true + } + }, + "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + "id": "logging.projects.exclusions.delete", + "path": "v2/{+name}", + "description": "Deletes an exclusion." + }, + "patch": { + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/exclusions/[^/]+$", + "location": "path", + "description": "Required. The resource name of the exclusion to update:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + "id": "logging.projects.exclusions.patch", + "path": "v2/{+name}", + "description": "Changes one or more properties of an existing exclusion.", + "request": { + "$ref": "LogExclusion" + } + }, + "get": { + "description": "Gets the description of an exclusion.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "LogExclusion" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "name": { + "description": "Required. The resource name of an existing exclusion:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", "required": true, - "type": "string" + "pattern": "^projects/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.projects.exclusions.get" + }, + "list": { + "response": { + "$ref": "ListExclusionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call." + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/projects/{projectsId}/exclusions", + "id": "logging.projects.exclusions.list", + "path": "v2/{+parent}/exclusions", + "description": "Lists all the exclusions in a parent resource." + }, + "create": { + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "parent": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The parent resource in which to create the exclusion:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\"." + } + }, + "flatPath": "v2/projects/{projectsId}/exclusions", + "id": "logging.projects.exclusions.create", + "path": "v2/{+parent}/exclusions", + "request": { + "$ref": "LogExclusion" + }, + "description": "Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource." + } + } + }, + "metrics": { + "methods": { + "get": { + "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}", + "path": "v2/{+metricName}", + "id": "logging.projects.metrics.get", + "description": "Gets a logs-based metric.", + "httpMethod": "GET", + "parameterOrder": [ + "metricName" + ], + "response": { + "$ref": "LogMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "metricName": { + "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/metrics/[^/]+$", + "location": "path" + } + } + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListLogMetricsResponse" + }, + "parameters": { + "parent": { + "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/projects/{projectsId}/metrics", + "path": "v2/{+parent}/metrics", + "id": "logging.projects.metrics.list", + "description": "Lists logs-based metrics." + }, + "update": { + "httpMethod": "PUT", + "parameterOrder": [ + "metricName" + ], + "response": { + "$ref": "LogMetric" + }, + "parameters": { + "metricName": { + "pattern": "^projects/[^/]+/metrics/[^/]+$", + "location": "path", + "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}", + "path": "v2/{+metricName}", + "id": "logging.projects.metrics.update", + "description": "Creates or updates a logs-based metric.", + "request": { + "$ref": "LogMetric" + } + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.", + "type": "string", + "required": true + } + }, + "flatPath": "v2/projects/{projectsId}/metrics", + "path": "v2/{+parent}/metrics", + "id": "logging.projects.metrics.create", + "request": { + "$ref": "LogMetric" + }, + "description": "Creates a logs-based metric." + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "parameters": { + "metricName": { + "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/metrics/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}", + "id": "logging.projects.metrics.delete", + "path": "v2/{+metricName}", + "description": "Deletes a logs-based metric." + } + } + } + } + }, + "billingAccounts": { + "resources": { + "sinks": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "sinkName": { + "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.billingAccounts.sinks.delete", + "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted." + }, + "list": { + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "response": { + "$ref": "ListSinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer" + }, + "parent": { + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n" }, "pageToken": { "location": "query", "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", "type": "string" - }, - "pageSize": { - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer", - "location": "query" } }, - "flatPath": "v2/projects/{projectsId}/sinks", - "id": "logging.projects.sinks.list", + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + "id": "logging.billingAccounts.sinks.list", "path": "v2/{+parent}/sinks", "description": "Lists sinks." }, + "create": { + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + "path": "v2/{+parent}/sinks", + "id": "logging.billingAccounts.sinks.create", + "request": { + "$ref": "LogSink" + }, + "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "parent": { + "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+$", + "location": "path" + }, + "uniqueWriterIdentity": { + "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", + "type": "boolean", + "location": "query" + } + } + }, + "patch": { + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string" + }, + "uniqueWriterIdentity": { + "location": "query", + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.", + "type": "boolean" + }, + "sinkName": { + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + "id": "logging.billingAccounts.sinks.patch", + "path": "v2/{+sinkName}" + }, "get": { "httpMethod": "GET", "parameterOrder": [ @@ -735,24 +1311,24 @@ "response": { "$ref": "LogSink" }, + "parameters": { + "sinkName": { + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + "location": "path", + "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\"." + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", "https://www.googleapis.com/auth/logging.admin", "https://www.googleapis.com/auth/logging.read" ], - "parameters": { - "sinkName": { - "pattern": "^projects/[^/]+/sinks/[^/]+$", - "location": "path", - "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string" - } - }, - "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", - "id": "logging.projects.sinks.get", + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", "path": "v2/{+sinkName}", + "id": "logging.billingAccounts.sinks.get", "description": "Gets a sink." }, "update": { @@ -763,131 +1339,53 @@ "sinkName" ], "httpMethod": "PUT", + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string" + }, + "uniqueWriterIdentity": { + "type": "boolean", + "location": "query", + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false." + }, + "sinkName": { + "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" ], - "parameters": { - "sinkName": { - "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/sinks/[^/]+$", - "location": "path" - }, - "uniqueWriterIdentity": { - "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is false.", - "type": "boolean", - "location": "query" - } - }, - "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + "id": "logging.billingAccounts.sinks.update", "path": "v2/{+sinkName}", - "id": "logging.projects.sinks.update", - "description": "Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field.", + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", "request": { "$ref": "LogSink" } } } }, - "metrics": { + "logs": { "methods": { - "update": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "parameters": { - "metricName": { - "pattern": "^projects/[^/]+/metrics/[^/]+$", - "location": "path", - "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.", - "required": true, - "type": "string" - } - }, - "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}", - "id": "logging.projects.metrics.update", - "path": "v2/{+metricName}", - "description": "Creates or updates a logs-based metric.", - "request": { - "$ref": "LogMetric" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "metricName" - ], - "response": { - "$ref": "LogMetric" - } - }, - "create": { - "request": { - "$ref": "LogMetric" - }, - "description": "Creates a logs-based metric.", - "response": { - "$ref": "LogMetric" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "parameters": { - "parent": { - "location": "path", - "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "flatPath": "v2/projects/{projectsId}/metrics", - "path": "v2/{+parent}/metrics", - "id": "logging.projects.metrics.create" - }, - "delete": { - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "metricName" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "parameters": { - "metricName": { - "pattern": "^projects/[^/]+/metrics/[^/]+$", - "location": "path", - "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", - "required": true, - "type": "string" - } - }, - "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}", - "path": "v2/{+metricName}", - "id": "logging.projects.metrics.delete", - "description": "Deletes a logs-based metric." - }, "list": { + "id": "logging.billingAccounts.logs.list", + "path": "v2/{+parent}/logs", + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", "response": { - "$ref": "ListLogMetricsResponse" + "$ref": "ListLogsResponse" }, + "httpMethod": "GET", "parameterOrder": [ "parent" ], - "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", @@ -901,32 +1399,120 @@ "location": "query" }, "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", "format": "int32", - "type": "integer" + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" }, "parent": { + "pattern": "^billingAccounts/[^/]+$", "location": "path", - "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n", - "required": true, + "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", "type": "string", - "pattern": "^projects/[^/]+$" + "required": true } }, - "flatPath": "v2/projects/{projectsId}/metrics", - "path": "v2/{+parent}/metrics", - "id": "logging.projects.metrics.list", - "description": "Lists logs-based metrics." + "flatPath": "v2/billingAccounts/{billingAccountsId}/logs" + }, + "delete": { + "id": "logging.billingAccounts.logs.delete", + "path": "v2/{+logName}", + "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "logName" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "logName": { + "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", + "location": "path", + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}" + } + } + }, + "exclusions": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of an existing exclusion to delete:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.billingAccounts.exclusions.delete", + "description": "Deletes an exclusion." + }, + "patch": { + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the exclusion to update:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", + "location": "path" + }, + "updateMask": { + "format": "google-fieldmask", + "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + "id": "logging.billingAccounts.exclusions.patch", + "path": "v2/{+name}", + "request": { + "$ref": "LogExclusion" + }, + "description": "Changes one or more properties of an existing exclusion." }, "get": { - "httpMethod": "GET", - "parameterOrder": [ - "metricName" - ], "response": { - "$ref": "LogMetric" + "$ref": "LogExclusion" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", @@ -934,25 +1520,304 @@ "https://www.googleapis.com/auth/logging.read" ], "parameters": { - "metricName": { - "pattern": "^projects/[^/]+/metrics/[^/]+$", - "location": "path", - "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", + "name": { + "description": "Required. The resource name of an existing exclusion:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", "required": true, - "type": "string" + "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", + "location": "path" } }, - "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}", - "id": "logging.projects.metrics.get", - "path": "v2/{+metricName}", - "description": "Gets a logs-based metric." + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + "id": "logging.billingAccounts.exclusions.get", + "path": "v2/{+name}", + "description": "Gets the description of an exclusion." + }, + "list": { + "description": "Lists all the exclusions in a parent resource.", + "response": { + "$ref": "ListExclusionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + }, + "parent": { + "pattern": "^billingAccounts/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions", + "id": "logging.billingAccounts.exclusions.list", + "path": "v2/{+parent}/exclusions" + }, + "create": { + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+$", + "location": "path", + "description": "Required. The parent resource in which to create the exclusion:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\"." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions", + "id": "logging.billingAccounts.exclusions.create", + "path": "v2/{+parent}/exclusions", + "description": "Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + "request": { + "$ref": "LogExclusion" + } } } } } }, - "billingAccounts": { + "folders": { "resources": { + "sinks": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListSinksResponse" + }, + "parameterOrder": [ + "parent" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer" + }, + "parent": { + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true + } + }, + "flatPath": "v2/folders/{foldersId}/sinks", + "path": "v2/{+parent}/sinks", + "id": "logging.folders.sinks.list", + "description": "Lists sinks." + }, + "create": { + "flatPath": "v2/folders/{foldersId}/sinks", + "id": "logging.folders.sinks.create", + "path": "v2/{+parent}/sinks", + "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "uniqueWriterIdentity": { + "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", + "type": "boolean", + "location": "query" + }, + "parent": { + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\"." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "get": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "sinkName": { + "location": "path", + "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+/sinks/[^/]+$" + } + }, + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "id": "logging.folders.sinks.get", + "path": "v2/{+sinkName}", + "description": "Gets a sink.", + "response": { + "$ref": "LogSink" + }, + "httpMethod": "GET", + "parameterOrder": [ + "sinkName" + ] + }, + "patch": { + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "id": "logging.folders.sinks.patch", + "path": "v2/{+sinkName}", + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string" + }, + "uniqueWriterIdentity": { + "type": "boolean", + "location": "query", + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false." + }, + "sinkName": { + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+/sinks/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "update": { + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PUT", + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string", + "location": "query" + }, + "uniqueWriterIdentity": { + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.", + "type": "boolean", + "location": "query" + }, + "sinkName": { + "pattern": "^folders/[^/]+/sinks/[^/]+$", + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "id": "logging.folders.sinks.update", + "path": "v2/{+sinkName}", + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "request": { + "$ref": "LogSink" + } + }, + "delete": { + "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + "httpMethod": "DELETE", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "sinkName": { + "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+/sinks/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.folders.sinks.delete" + } + } + }, "logs": { "methods": { "delete": { @@ -963,33 +1828,39 @@ "logName" ], "httpMethod": "DELETE", - "parameters": { - "logName": { - "required": true, - "type": "string", - "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", - "location": "path", - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry." - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}", + "parameters": { + "logName": { + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+/logs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/folders/{foldersId}/logs/{logsId}", + "id": "logging.folders.logs.delete", "path": "v2/{+logName}", - "id": "logging.billingAccounts.logs.delete", "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted." }, "list": { "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], "response": { "$ref": "ListLogsResponse" }, + "parameterOrder": [ + "parent" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], "parameters": { "pageToken": { "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", @@ -998,192 +1869,182 @@ }, "pageSize": { "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", "type": "integer" }, "parent": { - "required": true, "type": "string", - "pattern": "^billingAccounts/[^/]+$", + "required": true, + "pattern": "^folders/[^/]+$", "location": "path", "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/logs", - "id": "logging.billingAccounts.logs.list", - "path": "v2/{+parent}/logs" + "flatPath": "v2/folders/{foldersId}/logs", + "path": "v2/{+parent}/logs", + "id": "logging.folders.logs.list" } } }, - "sinks": { + "exclusions": { "methods": { - "delete": { - "parameters": { - "sinkName": { - "location": "path", - "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - "id": "logging.billingAccounts.sinks.delete", - "path": "v2/{+sinkName}", - "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - "httpMethod": "DELETE", - "parameterOrder": [ - "sinkName" - ], - "response": { - "$ref": "Empty" - } - }, - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListSinksResponse" - }, - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "pattern": "^billingAccounts/[^/]+$", - "location": "path", - "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", - "id": "logging.billingAccounts.sinks.list", - "path": "v2/{+parent}/sinks", - "description": "Lists sinks." - }, - "get": { - "id": "logging.billingAccounts.sinks.get", - "path": "v2/{+sinkName}", - "description": "Gets a sink.", - "httpMethod": "GET", - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "sinkName" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "sinkName": { - "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", - "location": "path" - } - }, - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}" - }, - "update": { - "parameters": { - "sinkName": { - "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", - "location": "path" - }, - "uniqueWriterIdentity": { - "location": "query", - "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is false.", - "type": "boolean" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - "id": "logging.billingAccounts.sinks.update", - "path": "v2/{+sinkName}", - "request": { - "$ref": "LogSink" - }, - "description": "Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field.", - "httpMethod": "PUT", - "parameterOrder": [ - "sinkName" - ], - "response": { - "$ref": "LogSink" - } - }, "create": { + "description": "Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + "request": { + "$ref": "LogExclusion" + }, "response": { - "$ref": "LogSink" + "$ref": "LogExclusion" }, "parameterOrder": [ "parent" ], "httpMethod": "POST", + "parameters": { + "parent": { + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "Required. The parent resource in which to create the exclusion:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/exclusions", + "id": "logging.folders.exclusions.create", + "path": "v2/{+parent}/exclusions" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/logging.admin" ], "parameters": { - "parent": { + "name": { "location": "path", - "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", - "required": true, + "description": "Required. The resource name of an existing exclusion to delete:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", "type": "string", - "pattern": "^billingAccounts/[^/]+$" - }, - "uniqueWriterIdentity": { - "location": "query", - "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", - "type": "boolean" + "required": true, + "pattern": "^folders/[^/]+/exclusions/[^/]+$" } }, - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", - "path": "v2/{+parent}/sinks", - "id": "logging.billingAccounts.sinks.create", - "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.folders.exclusions.delete", + "description": "Deletes an exclusion." + }, + "patch": { + "id": "logging.folders.exclusions.patch", + "path": "v2/{+name}", "request": { - "$ref": "LogSink" - } + "$ref": "LogExclusion" + }, + "description": "Changes one or more properties of an existing exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "updateMask": { + "format": "google-fieldmask", + "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + "type": "string", + "location": "query" + }, + "name": { + "description": "Required. The resource name of the exclusion to update:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".", + "type": "string", + "required": true, + "pattern": "^folders/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}" + }, + "get": { + "description": "Gets the description of an exclusion.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "LogExclusion" + }, + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^folders/[^/]+/exclusions/[^/]+$", + "location": "path", + "description": "Required. The resource name of an existing exclusion:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\"." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.folders.exclusions.get" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListExclusionsResponse" + }, + "parameters": { + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + }, + "parent": { + "type": "string", + "required": true, + "pattern": "^folders/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2/folders/{foldersId}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.folders.exclusions.list", + "description": "Lists all the exclusions in a parent resource." } } } @@ -1191,26 +2052,15 @@ } }, "parameters": { - "quotaUser": { - "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.", + "oauth_token": { "type": "string", - "location": "query" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" + "location": "query", + "description": "OAuth 2.0 token for the current user." }, "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", "type": "string", - "location": "query" + "location": "query", + "description": "OAuth bearer token." }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", @@ -1218,9 +2068,14 @@ "location": "query" }, "prettyPrint": { + "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", "location": "query" }, "fields": { @@ -1228,30 +2083,30 @@ "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, "callback": { - "type": "string", "location": "query", - "description": "JSONP" + "description": "JSONP", + "type": "string" }, "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], "location": "query", "enum": [ "1", "2" ], "description": "V1 error format.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -1260,12 +2115,7 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] + "default": "json" }, "key": { "location": "query", @@ -1273,9 +2123,20 @@ "type": "string" }, "access_token": { - "location": "query", "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", "type": "string" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" } }, "version": "v2", @@ -1284,384 +2145,15 @@ "description": "Writes log entries and manages your Stackdriver Logging configuration.", "kind": "discovery#restDescription", "basePath": "", - "documentationLink": "https://cloud.google.com/logging/docs/", "id": "logging:v2", - "revision": "20170516", + "revision": "20170918", + "documentationLink": "https://cloud.google.com/logging/docs/", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "ListLogEntriesRequest": { - "type": "object", - "properties": { - "orderBy": { - "description": "Optional. How the results should be sorted. Presently, the only permitted values are \"timestamp asc\" (default) and \"timestamp desc\". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values.", - "type": "string" - }, - "resourceNames": { - "description": "Required. Names of one or more parent resources from which to retrieve log entries:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nProjects listed in the project_ids field are added to this list.", - "type": "array", - "items": { - "type": "string" - } - }, - "filter": { - "description": "Optional. A filter that chooses which log entries to return. See Advanced Logs Filters. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of the filter is 20000 characters.", - "type": "string" - }, - "projectIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: \"my-project-1A\". If present, these project identifiers are converted to resource name format and added to the list of resources in resource_names." - }, - "pageToken": { - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "type": "integer", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of next_page_token in the response indicates that more results might be available.", - "format": "int32" - } - }, - "id": "ListLogEntriesRequest", - "description": "The parameters to ListLogEntries." - }, - "RequestLog": { - "description": "Complete log information about a single HTTP request to an App Engine application.", - "type": "object", - "properties": { - "line": { - "description": "A list of log lines emitted by the application while serving this request.", - "type": "array", - "items": { - "$ref": "LogLine" - } - }, - "referrer": { - "description": "Referrer URL of request.", - "type": "string" - }, - "taskQueueName": { - "description": "Queue name of the request, in the case of an offline request.", - "type": "string" - }, - "requestId": { - "description": "Globally unique identifier for a request, which is based on the request start time. Request IDs for requests which started later will compare greater as strings than those for requests which started earlier.", - "type": "string" - }, - "nickname": { - "description": "The logged-in user who made the request.Most likely, this is the part of the user's email before the @ sign. The field value is the same for different requests from the same user, but different users can have similar names. This information is also available to the application via the App Engine Users API.This field will be populated starting with App Engine 1.9.21.", - "type": "string" - }, - "pendingTime": { - "description": "Time this request spent in the pending request queue.", - "format": "google-duration", - "type": "string" - }, - "resource": { - "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". The fragment identifier, which is identified by the # character, is not included.", - "type": "string" - }, - "status": { - "description": "HTTP response status code. Example: 200, 404.", - "format": "int32", - "type": "integer" - }, - "taskName": { - "description": "Task name of the request, in the case of an offline request.", - "type": "string" - }, - "urlMapEntry": { - "type": "string", - "description": "File or class that handled the request." - }, - "instanceIndex": { - "description": "If the instance processing this request belongs to a manually scaled module, then this is the 0-based index of the instance. Otherwise, this value is -1.", - "format": "int32", - "type": "integer" - }, - "finished": { - "description": "Whether this request is finished or active.", - "type": "boolean" - }, - "host": { - "description": "Internet host and port number of the resource being requested.", - "type": "string" - }, - "httpVersion": { - "description": "HTTP version of request. Example: \"HTTP/1.1\".", - "type": "string" - }, - "startTime": { - "description": "Time when the request started.", - "format": "google-datetime", - "type": "string" - }, - "latency": { - "type": "string", - "description": "Latency of the request.", - "format": "google-duration" - }, - "ip": { - "description": "Origin IP address.", - "type": "string" - }, - "appId": { - "description": "Application that handled this request.", - "type": "string" - }, - "appEngineRelease": { - "description": "App Engine release version.", - "type": "string" - }, - "method": { - "description": "Request method. Example: \"GET\", \"HEAD\", \"PUT\", \"POST\", \"DELETE\".", - "type": "string" - }, - "cost": { - "description": "An indication of the relative cost of serving this request.", - "format": "double", - "type": "number" - }, - "instanceId": { - "description": "An identifier for the instance that handled the request.", - "type": "string" - }, - "megaCycles": { - "description": "Number of CPU megacycles used to process request.", - "format": "int64", - "type": "string" - }, - "first": { - "description": "Whether this is the first RequestLog entry for this request. If an active request has several RequestLog entries written to Stackdriver Logging, then this field will be set for one of them.", - "type": "boolean" - }, - "versionId": { - "description": "Version of the application that handled this request.", - "type": "string" - }, - "moduleId": { - "description": "Module of the application that handled this request.", - "type": "string" - }, - "endTime": { - "description": "Time when the request finished.", - "format": "google-datetime", - "type": "string" - }, - "userAgent": { - "description": "User agent that made the request.", - "type": "string" - }, - "wasLoadingRequest": { - "description": "Whether this was a loading request for the instance.", - "type": "boolean" - }, - "sourceReference": { - "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.", - "type": "array", - "items": { - "$ref": "SourceReference" - } - }, - "responseSize": { - "type": "string", - "description": "Size in bytes sent back to client by request.", - "format": "int64" - }, - "traceId": { - "description": "Stackdriver Trace identifier for this request.", - "type": "string" - } - }, - "id": "RequestLog" - }, - "ListMonitoredResourceDescriptorsResponse": { - "description": "Result returned from ListMonitoredResourceDescriptors.", - "type": "object", - "properties": { - "resourceDescriptors": { - "description": "A list of resource descriptors.", - "type": "array", - "items": { - "$ref": "MonitoredResourceDescriptor" - } - }, - "nextPageToken": { - "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", - "type": "string" - } - }, - "id": "ListMonitoredResourceDescriptorsResponse" - }, - "SourceReference": { - "properties": { - "repository": { - "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", - "type": "string" - }, - "revisionId": { - "description": "The canonical and persistent identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"", - "type": "string" - } - }, - "id": "SourceReference", - "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", - "type": "object" - }, - "WriteLogEntriesResponse": { - "properties": {}, - "id": "WriteLogEntriesResponse", - "description": "Result returned from WriteLogEntries. empty", - "type": "object" - }, - "LogMetric": { - "id": "LogMetric", - "description": "Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.", - "type": "object", - "properties": { - "name": { - "description": "Required. The client-assigned metric identifier. Examples: \"error_count\", \"nginx/requests\".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: \"projects/my-project/metrics/nginx%2Frequests\".", - "type": "string" - }, - "description": { - "description": "Optional. A description of this metric, which is used in documentation.", - "type": "string" - }, - "version": { - "enum": [ - "V2", - "V1" - ], - "description": "Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.", - "type": "string", - "enumDescriptions": [ - "Stackdriver Logging API v2.", - "Stackdriver Logging API v1." - ] - }, - "filter": { - "description": "Required. An advanced logs filter which is used to match log entries. Example:\n\"resource.type=gae_app AND severity\u003e=ERROR\"\nThe maximum length of the filter is 20000 characters.", - "type": "string" - } - } - }, - "LogEntryOperation": { - "description": "Additional information about a potentially long-running operation with which a log entry is associated.", - "type": "object", - "properties": { - "last": { - "description": "Optional. Set this to True if this is the last log entry in the operation.", - "type": "boolean" - }, - "id": { - "description": "Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.", - "type": "string" - }, - "producer": { - "description": "Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: \"MyDivision.MyBigCompany.com\", \"github.com/MyProject/MyApplication\".", - "type": "string" - }, - "first": { - "description": "Optional. Set this to True if this is the first log entry in the operation.", - "type": "boolean" - } - }, - "id": "LogEntryOperation" - }, - "MonitoredResource": { - "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n", - "type": "object", - "properties": { - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".", - "type": "object" - }, - "type": { - "description": "Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance.", - "type": "string" - } - }, - "id": "MonitoredResource" - }, - "WriteLogEntriesRequest": { - "description": "The parameters to WriteLogEntries.", - "type": "object", - "properties": { - "logName": { - "description": "Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\" or \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "type": "string" - }, - "entries": { - "description": "Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are inserted into those log entries in this list that do not provide their own values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and less than later entries. Otherwise, the order of log entries in this list does not matter.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry.", - "type": "array", - "items": { - "$ref": "LogEntry" - } - }, - "partialSuccess": { - "description": "Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method.", - "type": "boolean" - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry.", - "type": "object" - }, - "resource": { - "description": "Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example:\n{ \"type\": \"gce_instance\",\n \"labels\": {\n \"zone\": \"us-central1-a\", \"instance_id\": \"00000000000000000000\" }}\nSee LogEntry.", - "$ref": "MonitoredResource" - } - }, - "id": "WriteLogEntriesRequest" - }, "LogSink": { - "description": "Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.", "type": "object", "properties": { - "filter": { - "description": "Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format:\nlogName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity\u003e=ERROR\n", - "type": "string" - }, - "destination": { - "description": "Required. The export destination:\n\"storage.googleapis.com/[GCS_BUCKET]\"\n\"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]\"\n\"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]\"\nThe sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks.", - "type": "string" - }, - "endTime": { - "description": "Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time.", - "format": "google-datetime", - "type": "string" - }, - "startTime": { - "description": "Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated.", - "format": "google-datetime", - "type": "string" - }, - "writerIdentity": { - "description": "Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting access for a resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.", - "type": "string" - }, - "outputVersionFormat": { - "enum": [ - "VERSION_FORMAT_UNSPECIFIED", - "V2", - "V1" - ], - "description": "Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API.", - "type": "string", - "enumDescriptions": [ - "An unspecified format version that will default to V2.", - "LogEntry version 2 format.", - "LogEntry version 1 format." - ] - }, "name": { "description": "Required. The client-assigned sink identifier, unique within the project. Example: \"my-syslog-errors-to-pubsub\". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods.", "type": "string" @@ -1669,14 +2161,48 @@ "includeChildren": { "description": "Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then logs from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression. For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent. To only export entries from certain child projects, filter on the project part of the log name:\nlogName:(\"projects/test-project1/\" OR \"projects/test-project2/\") AND\nresource.type=gce_instance\n", "type": "boolean" + }, + "destination": { + "description": "Required. The export destination:\n\"storage.googleapis.com/[GCS_BUCKET]\"\n\"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]\"\n\"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]\"\nThe sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks.", + "type": "string" + }, + "filter": { + "description": "Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. For example:\nlogName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity\u003e=ERROR\n", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Deprecated. This field is ignored when creating or updating sinks.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Deprecated. This field is ignored when creating or updating sinks.", + "type": "string" + }, + "writerIdentity": { + "description": "Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting access for a resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.", + "type": "string" + }, + "outputVersionFormat": { + "description": "Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed.", + "type": "string", + "enumDescriptions": [ + "An unspecified format version that will default to V2.", + "LogEntry version 2 format.", + "LogEntry version 1 format." + ], + "enum": [ + "VERSION_FORMAT_UNSPECIFIED", + "V2", + "V1" + ] } }, - "id": "LogSink" + "id": "LogSink", + "description": "Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder." }, "ListLogsResponse": { - "id": "ListLogsResponse", - "description": "Result returned from ListLogs.", - "type": "object", "properties": { "nextPageToken": { "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", @@ -1684,80 +2210,15 @@ }, "logNames": { "description": "A list of log names. For example, \"projects/my-project/syslog\" or \"organizations/123/cloudresourcemanager.googleapis.com%2Factivity\".", - "type": "array", "items": { "type": "string" - } - } - } - }, - "HttpRequest": { - "description": "A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.", - "type": "object", - "properties": { - "cacheLookup": { - "description": "Whether or not a cache lookup was attempted.", - "type": "boolean" - }, - "cacheHit": { - "description": "Whether or not an entity was served from cache (with or without validation).", - "type": "boolean" - }, - "cacheValidatedWithOriginServer": { - "description": "Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.", - "type": "boolean" - }, - "status": { - "description": "The response code indicating the status of response. Examples: 200, 404.", - "format": "int32", - "type": "integer" - }, - "referer": { - "description": "The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).", - "type": "string" - }, - "latency": { - "description": "The request processing latency on the server, from the time the request was received until the response was sent.", - "format": "google-duration", - "type": "string" - }, - "userAgent": { - "description": "The user agent sent by the client. Example: \"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)\".", - "type": "string" - }, - "cacheFillBytes": { - "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.", - "format": "int64", - "type": "string" - }, - "requestMethod": { - "description": "The request method. Examples: \"GET\", \"HEAD\", \"PUT\", \"POST\".", - "type": "string" - }, - "requestSize": { - "description": "The size of the HTTP request message in bytes, including the request headers and the request body.", - "format": "int64", - "type": "string" - }, - "responseSize": { - "description": "The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.", - "format": "int64", - "type": "string" - }, - "requestUrl": { - "type": "string", - "description": "The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: \"http://example.com/some/info?color=red\"." - }, - "remoteIp": { - "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: \"192.168.1.1\", \"FE80::0202:B3FF:FE1E:8329\".", - "type": "string" - }, - "serverIp": { - "description": "The IP address (IPv4 or IPv6) of the origin server that the request was sent to.", - "type": "string" + }, + "type": "array" } }, - "id": "HttpRequest" + "id": "ListLogsResponse", + "description": "Result returned from ListLogs.", + "type": "object" }, "ListSinksResponse": { "id": "ListSinksResponse", @@ -1770,73 +2231,117 @@ }, "sinks": { "description": "A list of sinks.", - "type": "array", "items": { "$ref": "LogSink" - } + }, + "type": "array" } } }, - "LabelDescriptor": { - "description": "A description of a label.", + "HttpRequest": { + "description": "A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.", "type": "object", "properties": { - "key": { - "description": "The label key.", - "type": "string" - }, - "description": { - "description": "A human-readable description for the label.", - "type": "string" - }, - "valueType": { - "enum": [ - "STRING", - "BOOL", - "INT64" - ], - "description": "The type of data that can be assigned to the label.", + "referer": { "type": "string", - "enumDescriptions": [ - "A variable-length string. This is the default.", - "Boolean; true or false.", - "A 64-bit signed integer." - ] + "description": "The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)." + }, + "userAgent": { + "description": "The user agent sent by the client. Example: \"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)\".", + "type": "string" + }, + "latency": { + "format": "google-duration", + "description": "The request processing latency on the server, from the time the request was received until the response was sent.", + "type": "string" + }, + "cacheFillBytes": { + "format": "int64", + "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.", + "type": "string" + }, + "requestMethod": { + "description": "The request method. Examples: \"GET\", \"HEAD\", \"PUT\", \"POST\".", + "type": "string" + }, + "protocol": { + "description": "Protocol used for the request. Examples: \"HTTP/1.1\", \"HTTP/2\", \"websocket\"", + "type": "string" + }, + "responseSize": { + "format": "int64", + "description": "The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.", + "type": "string" + }, + "requestSize": { + "format": "int64", + "description": "The size of the HTTP request message in bytes, including the request headers and the request body.", + "type": "string" + }, + "requestUrl": { + "description": "The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: \"http://example.com/some/info?color=red\".", + "type": "string" + }, + "remoteIp": { + "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: \"192.168.1.1\", \"FE80::0202:B3FF:FE1E:8329\".", + "type": "string" + }, + "serverIp": { + "description": "The IP address (IPv4 or IPv6) of the origin server that the request was sent to.", + "type": "string" + }, + "cacheLookup": { + "description": "Whether or not a cache lookup was attempted.", + "type": "boolean" + }, + "cacheHit": { + "description": "Whether or not an entity was served from cache (with or without validation).", + "type": "boolean" + }, + "cacheValidatedWithOriginServer": { + "type": "boolean", + "description": "Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True." + }, + "status": { + "format": "int32", + "description": "The response code indicating the status of response. Examples: 200, 404.", + "type": "integer" } }, - "id": "LabelDescriptor" + "id": "HttpRequest" }, "MonitoredResourceDescriptor": { + "description": "An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of \"gce_instance\" and specifies the use of the labels \"instance_id\" and \"zone\" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API.", "type": "object", "properties": { - "labels": { - "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\".", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } - }, "name": { "description": "Optional. The resource name of the monitored resource descriptor: \"projects/{project_id}/monitoredResourceDescriptors/{type}\" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format \"monitoredResourceDescriptors/{type}\".", "type": "string" }, - "displayName": { - "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".", - "type": "string" - }, "description": { "description": "Optional. A detailed description of the monitored resource type that might be used in documentation.", "type": "string" }, + "displayName": { + "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".", + "type": "string" + }, "type": { "description": "Required. The monitored resource type. For example, the type \"cloudsql_database\" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters.", "type": "string" + }, + "labels": { + "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\".", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" } }, - "id": "MonitoredResourceDescriptor", - "description": "An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of \"gce_instance\" and specifies the use of the labels \"instance_id\" and \"zone\" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API." + "id": "MonitoredResourceDescriptor" }, "LogEntrySourceLocation": { + "description": "Additional information about the source code location that produced the log entry.", "type": "object", "properties": { "file": { @@ -1848,37 +2353,39 @@ "type": "string" }, "line": { - "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.", "format": "int64", + "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.", "type": "string" } }, - "id": "LogEntrySourceLocation", - "description": "Additional information about the source code location that produced the log entry." + "id": "LogEntrySourceLocation" }, "ListLogEntriesResponse": { + "id": "ListLogEntriesResponse", "description": "Result returned from ListLogEntries.", "type": "object", "properties": { + "entries": { + "description": "A list of log entries. If entries is empty, nextPageToken may still be returned, indicating that more entries may exist. See nextPageToken for more information.", + "items": { + "$ref": "LogEntry" + }, + "type": "array" + }, "nextPageToken": { "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search.", "type": "string" - }, - "entries": { - "description": "A list of log entries.", - "type": "array", - "items": { - "$ref": "LogEntry" - } } - }, - "id": "ListLogEntriesResponse" + } }, "LogLine": { - "id": "LogLine", "description": "Application log line emitted while processing a request.", "type": "object", "properties": { + "logMessage": { + "description": "App-provided log message.", + "type": "string" + }, "severity": { "enumDescriptions": [ "(0) The log entry has no assigned severity level.", @@ -1905,136 +2412,39 @@ "description": "Severity of this log entry.", "type": "string" }, - "logMessage": { - "description": "App-provided log message.", - "type": "string" - }, "sourceLocation": { "$ref": "SourceLocation", "description": "Where in the source code this log message was written." }, "time": { + "format": "google-datetime", "description": "Approximate time when this log entry was made.", - "format": "google-datetime", - "type": "string" - } - } - }, - "ListLogMetricsResponse": { - "id": "ListLogMetricsResponse", - "description": "Result returned from ListLogMetrics.", - "type": "object", - "properties": { - "metrics": { - "description": "A list of logs-based metrics.", - "type": "array", - "items": { - "$ref": "LogMetric" - } - }, - "nextPageToken": { - "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", - "type": "string" - } - } - }, - "LogEntry": { - "type": "object", - "properties": { - "protoPayload": { - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "description": "The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.", - "type": "object" - }, - "trace": { - "description": "Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824", - "type": "string" - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional. A set of user-defined (key, value) data that provides additional information about the log entry.", - "type": "object" - }, - "severity": { - "enum": [ - "DEFAULT", - "DEBUG", - "INFO", - "NOTICE", - "WARNING", - "ERROR", - "CRITICAL", - "ALERT", - "EMERGENCY" - ], - "description": "Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.", - "type": "string", - "enumDescriptions": [ - "(0) The log entry has no assigned severity level.", - "(100) Debug or trace information.", - "(200) Routine information, such as ongoing status or performance.", - "(300) Normal but significant events, such as start up, shut down, or a configuration change.", - "(400) Warning events might cause problems.", - "(500) Error events are likely to cause problems.", - "(600) Critical events cause more severe problems or outages.", - "(700) A person must take an action immediately.", - "(800) One or more systems are unusable." - ] - }, - "sourceLocation": { - "description": "Optional. Source code location information associated with the log entry, if any.", - "$ref": "LogEntrySourceLocation" - }, - "timestamp": { - "description": "Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted.", - "format": "google-datetime", - "type": "string" - }, - "receiveTimestamp": { - "type": "string", - "description": "Output only. The time the log entry was received by Stackdriver Logging.", - "format": "google-datetime" - }, - "logName": { - "type": "string", - "description": "Required. The resource name of the log to which this log entry belongs:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded within log_name. Example: \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". [LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results." - }, - "httpRequest": { - "$ref": "HttpRequest", - "description": "Optional. Information about the HTTP request associated with this log entry, if applicable." - }, - "resource": { - "$ref": "MonitoredResource", - "description": "Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error." - }, - "jsonPayload": { - "description": "The log entry payload, represented as a structure that is expressed as a JSON object.", - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object." - } - }, - "insertId": { - "type": "string", - "description": "Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value." - }, - "operation": { - "description": "Optional. Information about an operation associated with the log entry, if applicable.", - "$ref": "LogEntryOperation" - }, - "textPayload": { - "description": "The log entry payload, represented as a Unicode string (UTF-8).", "type": "string" } }, - "id": "LogEntry", - "description": "An individual entry in a log." + "id": "LogLine" + }, + "Linear": { + "id": "Linear", + "description": "Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): offset + (width * i). Lower bound (1 \u003c= i \u003c N): offset + (width * (i - 1)).", + "type": "object", + "properties": { + "offset": { + "format": "double", + "description": "Lower bound of the first bucket.", + "type": "number" + }, + "numFiniteBuckets": { + "format": "int32", + "description": "Must be greater than 0.", + "type": "integer" + }, + "width": { + "format": "double", + "description": "Must be greater than 0.", + "type": "number" + } + } }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", @@ -2047,53 +2457,685 @@ "type": "object", "properties": { "file": { - "description": "Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", - "type": "string" + "type": "string", + "description": "Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name." }, "functionName": { "description": "Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information is used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).", "type": "string" }, "line": { - "type": "string", + "format": "int64", "description": "Line within the source file.", - "format": "int64" + "type": "string" } }, "id": "SourceLocation" - } - }, - "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, - "protocol": "rest", - "canonicalName": "Logging", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" + }, + "ListLogEntriesRequest": { + "properties": { + "projectIds": { + "description": "Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: \"my-project-1A\". If present, these project identifiers are converted to resource name format and added to the list of resources in resource_names.", + "items": { + "type": "string" + }, + "type": "array" }, - "https://www.googleapis.com/auth/logging.admin": { - "description": "Administrate log data for your projects" + "filter": { + "description": "Optional. A filter that chooses which log entries to return. See Advanced Logs Filters. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of the filter is 20000 characters.", + "type": "string" }, - "https://www.googleapis.com/auth/logging.read": { - "description": "View log data for your projects" + "pageToken": { + "type": "string", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call." }, - "https://www.googleapis.com/auth/logging.write": { - "description": "Submit log data for your projects" + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of next_page_token in the response indicates that more results might be available.", + "type": "integer" }, - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" + "orderBy": { + "description": "Optional. How the results should be sorted. Presently, the only permitted values are \"timestamp asc\" (default) and \"timestamp desc\". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values.", + "type": "string" + }, + "resourceNames": { + "description": "Required. Names of one or more parent resources from which to retrieve log entries:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nProjects listed in the project_ids field are added to this list.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ListLogEntriesRequest", + "description": "The parameters to ListLogEntries.", + "type": "object" + }, + "Explicit": { + "properties": { + "bounds": { + "description": "The values must be monotonically increasing.", + "items": { + "format": "double", + "type": "number" + }, + "type": "array" + } + }, + "id": "Explicit", + "description": "Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): boundsi Lower bound (1 \u003c= i \u003c N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets.", + "type": "object" + }, + "SourceReference": { + "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", + "type": "object", + "properties": { + "repository": { + "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", + "type": "string" + }, + "revisionId": { + "description": "The canonical and persistent identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"", + "type": "string" + } + }, + "id": "SourceReference" + }, + "WriteLogEntriesResponse": { + "description": "Result returned from WriteLogEntries. empty", + "type": "object", + "properties": {}, + "id": "WriteLogEntriesResponse" + }, + "Exponential": { + "properties": { + "numFiniteBuckets": { + "format": "int32", + "description": "Must be greater than 0.", + "type": "integer" + }, + "growthFactor": { + "type": "number", + "format": "double", + "description": "Must be greater than 1." + }, + "scale": { + "format": "double", + "description": "Must be greater than 0.", + "type": "number" + } + }, + "id": "Exponential", + "description": "Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): scale * (growth_factor ^ i). Lower bound (1 \u003c= i \u003c N): scale * (growth_factor ^ (i - 1)).", + "type": "object" + }, + "WriteLogEntriesRequest": { + "description": "The parameters to WriteLogEntries.", + "type": "object", + "properties": { + "partialSuccess": { + "description": "Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method.", + "type": "boolean" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry." + }, + "resource": { + "$ref": "MonitoredResource", + "description": "Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example:\n{ \"type\": \"gce_instance\",\n \"labels\": {\n \"zone\": \"us-central1-a\", \"instance_id\": \"00000000000000000000\" }}\nSee LogEntry." + }, + "entries": { + "description": "Required. The log entries to send to Stackdriver Logging. The order of log entries in this list does not matter. Values supplied in this method's log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future might be discarded. Discarding does not return an error.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry.", + "items": { + "$ref": "LogEntry" + }, + "type": "array" + }, + "logName": { + "description": "Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\" or \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string" + } + }, + "id": "WriteLogEntriesRequest" + }, + "LabelDescriptor": { + "description": "A description of a label.", + "type": "object", + "properties": { + "description": { + "description": "A human-readable description for the label.", + "type": "string" + }, + "valueType": { + "enumDescriptions": [ + "A variable-length string. This is the default.", + "Boolean; true or false.", + "A 64-bit signed integer." + ], + "enum": [ + "STRING", + "BOOL", + "INT64" + ], + "description": "The type of data that can be assigned to the label.", + "type": "string" + }, + "key": { + "description": "The label key.", + "type": "string" + } + }, + "id": "LabelDescriptor" + }, + "BucketOptions": { + "id": "BucketOptions", + "description": "BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i \u003e 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.", + "type": "object", + "properties": { + "exponentialBuckets": { + "description": "The exponential buckets.", + "$ref": "Exponential" + }, + "explicitBuckets": { + "description": "The explicit buckets.", + "$ref": "Explicit" + }, + "linearBuckets": { + "description": "The linear bucket.", + "$ref": "Linear" } } + }, + "ListLogMetricsResponse": { + "description": "Result returned from ListLogMetrics.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", + "type": "string" + }, + "metrics": { + "items": { + "$ref": "LogMetric" + }, + "type": "array", + "description": "A list of logs-based metrics." + } + }, + "id": "ListLogMetricsResponse" + }, + "MetricDescriptor": { + "id": "MetricDescriptor", + "description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.", + "type": "object", + "properties": { + "name": { + "description": "The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id:\n\"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"\n", + "type": "string" + }, + "type": { + "description": "The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example:\n\"custom.googleapis.com/invoice/paid/amount\"\n\"appengine.googleapis.com/http/server/response_latencies\"\n", + "type": "string" + }, + "valueType": { + "enumDescriptions": [ + "Do not use this default value.", + "The value is a boolean. This value type can be used only if the metric kind is GAUGE.", + "The value is a signed 64-bit integer.", + "The value is a double precision floating point number.", + "The value is a text string. This value type can be used only if the metric kind is GAUGE.", + "The value is a Distribution.", + "The value is money." + ], + "enum": [ + "VALUE_TYPE_UNSPECIFIED", + "BOOL", + "INT64", + "DOUBLE", + "STRING", + "DISTRIBUTION", + "MONEY" + ], + "description": "Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.", + "type": "string" + }, + "metricKind": { + "description": "Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.", + "type": "string", + "enumDescriptions": [ + "Do not use this default value.", + "An instantaneous measurement of a value.", + "The change in a value during a time interval.", + "A value accumulated over a time interval. Cumulative measurements in a time series should have the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points." + ], + "enum": [ + "METRIC_KIND_UNSPECIFIED", + "GAUGE", + "DELTA", + "CUMULATIVE" + ] + }, + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "type": "string" + }, + "displayName": { + "type": "string", + "description": "A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example \"Request count\"." + }, + "unit": { + "description": "The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)\nbit bit\nBy byte\ns second\nmin minute\nh hour\nd dayPrefixes (PREFIX)\nk kilo (10**3)\nM mega (10**6)\nG giga (10**9)\nT tera (10**12)\nP peta (10**15)\nE exa (10**18)\nZ zetta (10**21)\nY yotta (10**24)\nm milli (10**-3)\nu micro (10**-6)\nn nano (10**-9)\np pico (10**-12)\nf femto (10**-15)\na atto (10**-18)\nz zepto (10**-21)\ny yocto (10**-24)\nKi kibi (2**10)\nMi mebi (2**20)\nGi gibi (2**30)\nTi tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors:\n/ division (as an infix operator, e.g. 1/s).\n. multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows:\nExpression = Component { \".\" Component } { \"/\" Component } ;\n\nComponent = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\nAnnotation = \"{\" NAME \"}\" ;\nNotes:\nAnnotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s.\nNAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'.", + "type": "string" + }, + "labels": { + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array", + "description": "The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed." + } + } + }, + "LogEntry": { + "id": "LogEntry", + "description": "An individual entry in a log.", + "type": "object", + "properties": { + "receiveTimestamp": { + "format": "google-datetime", + "description": "Output only. The time the log entry was received by Stackdriver Logging.", + "type": "string" + }, + "timestamp": { + "format": "google-datetime", + "description": "Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Stackdriver Logging assigns it the current time.Incoming log entries should have timestamps that are no more than the logs retention period in the past, and no more than 24 hours in the future. See the entries.write API method for more information.", + "type": "string" + }, + "logName": { + "description": "Required. The resource name of the log to which this log entry belongs:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded within log_name. Example: \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". [LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.", + "type": "string" + }, + "resource": { + "$ref": "MonitoredResource", + "description": "Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error." + }, + "httpRequest": { + "description": "Optional. Information about the HTTP request associated with this log entry, if applicable.", + "$ref": "HttpRequest" + }, + "jsonPayload": { + "description": "The log entry payload, represented as a structure that is expressed as a JSON object.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "insertId": { + "description": "Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging assigns its own unique identifier. The insert_id is also used to order log entries that have the same timestamp value.", + "type": "string" + }, + "operation": { + "$ref": "LogEntryOperation", + "description": "Optional. Information about an operation associated with the log entry, if applicable." + }, + "textPayload": { + "description": "The log entry payload, represented as a Unicode string (UTF-8).", + "type": "string" + }, + "protoPayload": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A set of user-defined (key, value) data that provides additional information about the log entry.", + "type": "object" + }, + "trace": { + "description": "Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824", + "type": "string" + }, + "severity": { + "enumDescriptions": [ + "(0) The log entry has no assigned severity level.", + "(100) Debug or trace information.", + "(200) Routine information, such as ongoing status or performance.", + "(300) Normal but significant events, such as start up, shut down, or a configuration change.", + "(400) Warning events might cause problems.", + "(500) Error events are likely to cause problems.", + "(600) Critical events cause more severe problems or outages.", + "(700) A person must take an action immediately.", + "(800) One or more systems are unusable." + ], + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ], + "description": "Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.", + "type": "string" + }, + "sourceLocation": { + "description": "Optional. Source code location information associated with the log entry, if any.", + "$ref": "LogEntrySourceLocation" + } + } + }, + "RequestLog": { + "properties": { + "ip": { + "description": "Origin IP address.", + "type": "string" + }, + "appId": { + "type": "string", + "description": "Application that handled this request." + }, + "appEngineRelease": { + "description": "App Engine release version.", + "type": "string" + }, + "method": { + "description": "Request method. Example: \"GET\", \"HEAD\", \"PUT\", \"POST\", \"DELETE\".", + "type": "string" + }, + "cost": { + "format": "double", + "description": "An indication of the relative cost of serving this request.", + "type": "number" + }, + "instanceId": { + "description": "An identifier for the instance that handled the request.", + "type": "string" + }, + "megaCycles": { + "format": "int64", + "description": "Number of CPU megacycles used to process request.", + "type": "string" + }, + "first": { + "description": "Whether this is the first RequestLog entry for this request. If an active request has several RequestLog entries written to Stackdriver Logging, then this field will be set for one of them.", + "type": "boolean" + }, + "versionId": { + "description": "Version of the application that handled this request.", + "type": "string" + }, + "moduleId": { + "description": "Module of the application that handled this request.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time when the request finished.", + "type": "string" + }, + "userAgent": { + "description": "User agent that made the request.", + "type": "string" + }, + "wasLoadingRequest": { + "description": "Whether this was a loading request for the instance.", + "type": "boolean" + }, + "sourceReference": { + "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + }, + "type": "array" + }, + "responseSize": { + "format": "int64", + "description": "Size in bytes sent back to client by request.", + "type": "string" + }, + "traceId": { + "type": "string", + "description": "Stackdriver Trace identifier for this request." + }, + "line": { + "description": "A list of log lines emitted by the application while serving this request.", + "items": { + "$ref": "LogLine" + }, + "type": "array" + }, + "taskQueueName": { + "description": "Queue name of the request, in the case of an offline request.", + "type": "string" + }, + "referrer": { + "description": "Referrer URL of request.", + "type": "string" + }, + "requestId": { + "description": "Globally unique identifier for a request, which is based on the request start time. Request IDs for requests which started later will compare greater as strings than those for requests which started earlier.", + "type": "string" + }, + "nickname": { + "type": "string", + "description": "The logged-in user who made the request.Most likely, this is the part of the user's email before the @ sign. The field value is the same for different requests from the same user, but different users can have similar names. This information is also available to the application via the App Engine Users API.This field will be populated starting with App Engine 1.9.21." + }, + "pendingTime": { + "format": "google-duration", + "description": "Time this request spent in the pending request queue.", + "type": "string" + }, + "resource": { + "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". The fragment identifier, which is identified by the # character, is not included.", + "type": "string" + }, + "status": { + "format": "int32", + "description": "HTTP response status code. Example: 200, 404.", + "type": "integer" + }, + "taskName": { + "description": "Task name of the request, in the case of an offline request.", + "type": "string" + }, + "urlMapEntry": { + "description": "File or class that handled the request.", + "type": "string" + }, + "instanceIndex": { + "format": "int32", + "description": "If the instance processing this request belongs to a manually scaled module, then this is the 0-based index of the instance. Otherwise, this value is -1.", + "type": "integer" + }, + "finished": { + "description": "Whether this request is finished or active.", + "type": "boolean" + }, + "host": { + "description": "Internet host and port number of the resource being requested.", + "type": "string" + }, + "httpVersion": { + "description": "HTTP version of request. Example: \"HTTP/1.1\".", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time when the request started.", + "type": "string" + }, + "latency": { + "type": "string", + "format": "google-duration", + "description": "Latency of the request." + } + }, + "id": "RequestLog", + "description": "Complete log information about a single HTTP request to an App Engine application.", + "type": "object" + }, + "LogExclusion": { + "id": "LogExclusion", + "description": "Specifies a set of log entries that are not to be stored in Stackdriver Logging. If your project receives a large volume of logs, you might be able to use exclusions to reduce your chargeable logs. Exclusions are processed after log sinks, so you can export log entries before they are excluded. Audit log entries and log entries from Amazon Web Services are never excluded.", + "type": "object", + "properties": { + "disabled": { + "type": "boolean", + "description": "Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can use exclusions.patch to change the value of this field." + }, + "filter": { + "description": "Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. For example, the following filter matches 99% of low-severity log entries from load balancers:\n\"resource.type=http_load_balancer severity\u003cERROR sample(insertId, 0.99)\"\n", + "type": "string" + }, + "name": { + "description": "Required. A client-assigned identifier, such as \"load-balancer-exclusion\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + "type": "string" + }, + "description": { + "description": "Optional. A description of this exclusion.", + "type": "string" + } + } + }, + "ListMonitoredResourceDescriptorsResponse": { + "id": "ListMonitoredResourceDescriptorsResponse", + "description": "Result returned from ListMonitoredResourceDescriptors.", + "type": "object", + "properties": { + "resourceDescriptors": { + "description": "A list of resource descriptors.", + "items": { + "$ref": "MonitoredResourceDescriptor" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", + "type": "string" + } + } + }, + "ListExclusionsResponse": { + "description": "Result returned from ListExclusions.", + "type": "object", + "properties": { + "exclusions": { + "items": { + "$ref": "LogExclusion" + }, + "type": "array", + "description": "A list of exclusions." + }, + "nextPageToken": { + "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.", + "type": "string" + } + }, + "id": "ListExclusionsResponse" + }, + "LogEntryOperation": { + "description": "Additional information about a potentially long-running operation with which a log entry is associated.", + "type": "object", + "properties": { + "last": { + "description": "Optional. Set this to True if this is the last log entry in the operation.", + "type": "boolean" + }, + "id": { + "description": "Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.", + "type": "string" + }, + "first": { + "type": "boolean", + "description": "Optional. Set this to True if this is the first log entry in the operation." + }, + "producer": { + "description": "Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: \"MyDivision.MyBigCompany.com\", \"github.com/MyProject/MyApplication\".", + "type": "string" + } + }, + "id": "LogEntryOperation" + }, + "LogMetric": { + "description": "Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options.", + "type": "object", + "properties": { + "description": { + "description": "Optional. A description of this metric, which is used in documentation.", + "type": "string" + }, + "bucketOptions": { + "$ref": "BucketOptions", + "description": "Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values." + }, + "valueExtractor": { + "description": "Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the log entry field from which the value is to be extracted. 2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, \".*quantity=(\\d+).*\")", + "type": "string" + }, + "name": { + "description": "Required. The client-assigned metric identifier. Examples: \"error_count\", \"nginx/requests\".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: \"projects/my-project/metrics/nginx%2Frequests\".", + "type": "string" + }, + "labelExtractors": { + "description": "Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.The extracted value is converted to the type defined in the label descriptor. If the either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "version": { + "enum": [ + "V2", + "V1" + ], + "description": "Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed.", + "type": "string", + "enumDescriptions": [ + "Stackdriver Logging API v2.", + "Stackdriver Logging API v1." + ] + }, + "metricDescriptor": { + "$ref": "MetricDescriptor", + "description": "Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of \"1\". Such a metric counts the number of log entries matching the filter expression.The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description." + }, + "filter": { + "description": "Required. An advanced logs filter which is used to match log entries. Example:\n\"resource.type=gae_app AND severity\u003e=ERROR\"\nThe maximum length of the filter is 20000 characters.", + "type": "string" + } + }, + "id": "LogMetric" + }, + "MonitoredResource": { + "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n", + "type": "object", + "properties": { + "type": { + "description": "Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance.", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".", + "type": "object" + } + }, + "id": "MonitoredResource" } - }, - "rootUrl": "https://logging.googleapis.com/", - "ownerDomain": "google.com", - "name": "logging", - "batchPath": "batch", - "title": "Stackdriver Logging API", - "ownerName": "Google" + } } diff --git a/etc/api/logging/v2beta1/crates/1.0.6-api+20170918 b/etc/api/logging/v2beta1/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/logging/v2beta1/logging-api.json b/etc/api/logging/v2beta1/logging-api.json index e867d87b5a..bfb094ae7c 100644 --- a/etc/api/logging/v2beta1/logging-api.json +++ b/etc/api/logging/v2beta1/logging-api.json @@ -1,25 +1,922 @@ { + "batchPath": "batch", + "title": "Stackdriver Logging API", + "ownerName": "Google", + "resources": { + "organizations": { + "resources": { + "logs": { + "methods": { + "delete": { + "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", + "httpMethod": "DELETE", + "parameterOrder": [ + "logName" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "logName": { + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+/logs/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2beta1/organizations/{organizationsId}/logs/{logsId}", + "path": "v2beta1/{+logName}", + "id": "logging.organizations.logs.delete" + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer" + }, + "parent": { + "type": "string", + "required": true, + "pattern": "^organizations/[^/]+$", + "location": "path", + "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n" + } + }, + "flatPath": "v2beta1/organizations/{organizationsId}/logs", + "path": "v2beta1/{+parent}/logs", + "id": "logging.organizations.logs.list", + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed." + } + } + } + } + }, + "entries": { + "methods": { + "list": { + "description": "Lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to export log entries, see Exporting Logs.", + "request": { + "$ref": "ListLogEntriesRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "ListLogEntriesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2beta1/entries:list", + "path": "v2beta1/entries:list", + "id": "logging.entries.list" + }, + "write": { + "description": "Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging.", + "request": { + "$ref": "WriteLogEntriesRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "WriteLogEntriesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "flatPath": "v2beta1/entries:write", + "path": "v2beta1/entries:write", + "id": "logging.entries.write" + } + } + }, + "projects": { + "resources": { + "sinks": { + "methods": { + "delete": { + "id": "logging.projects.sinks.delete", + "path": "v2beta1/{+sinkName}", + "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "parameterOrder": [ + "sinkName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "sinkName": { + "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/sinks/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}" + }, + "get": { + "description": "Gets a sink.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "sinkName": { + "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/sinks/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", + "id": "logging.projects.sinks.get", + "path": "v2beta1/{+sinkName}" + }, + "list": { + "description": "Lists sinks.", + "response": { + "$ref": "ListSinksResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer" + }, + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/sinks", + "id": "logging.projects.sinks.list", + "path": "v2beta1/{+parent}/sinks" + }, + "update": { + "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", + "id": "logging.projects.sinks.update", + "path": "v2beta1/{+sinkName}", + "request": { + "$ref": "LogSink" + }, + "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.", + "type": "string" + }, + "uniqueWriterIdentity": { + "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.", + "type": "boolean", + "location": "query" + }, + "sinkName": { + "pattern": "^projects/[^/]+/sinks/[^/]+$", + "location": "path", + "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", + "type": "string", + "required": true + } + } + }, + "create": { + "flatPath": "v2beta1/projects/{projectsId}/sinks", + "id": "logging.projects.sinks.create", + "path": "v2beta1/{+parent}/sinks", + "request": { + "$ref": "LogSink" + }, + "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "parent": { + "location": "path", + "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "uniqueWriterIdentity": { + "location": "query", + "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", + "type": "boolean" + } + } + } + } + }, + "logs": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2beta1/projects/{projectsId}/logs", + "path": "v2beta1/{+parent}/logs", + "id": "logging.projects.logs.list", + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed." + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "logName" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "logName": { + "pattern": "^projects/[^/]+/logs/[^/]+$", + "location": "path", + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2beta1/projects/{projectsId}/logs/{logsId}", + "path": "v2beta1/{+logName}", + "id": "logging.projects.logs.delete", + "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted." + } + } + }, + "metrics": { + "methods": { + "get": { + "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}", + "id": "logging.projects.metrics.get", + "path": "v2beta1/{+metricName}", + "description": "Gets a logs-based metric.", + "response": { + "$ref": "LogMetric" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "metricName": { + "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/metrics/[^/]+$", + "location": "path" + } + } + }, + "list": { + "description": "Lists logs-based metrics.", + "response": { + "$ref": "ListLogMetricsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string", + "location": "query" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available." + }, + "parent": { + "location": "path", + "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2beta1/projects/{projectsId}/metrics", + "id": "logging.projects.metrics.list", + "path": "v2beta1/{+parent}/metrics" + }, + "update": { + "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}", + "path": "v2beta1/{+metricName}", + "id": "logging.projects.metrics.update", + "request": { + "$ref": "LogMetric" + }, + "description": "Creates or updates a logs-based metric.", + "httpMethod": "PUT", + "parameterOrder": [ + "metricName" + ], + "response": { + "$ref": "LogMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "parameters": { + "metricName": { + "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/metrics/[^/]+$", + "location": "path" + } + } + }, + "create": { + "description": "Creates a logs-based metric.", + "request": { + "$ref": "LogMetric" + }, + "response": { + "$ref": "LogMetric" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "flatPath": "v2beta1/projects/{projectsId}/metrics", + "id": "logging.projects.metrics.create", + "path": "v2beta1/{+parent}/metrics" + }, + "delete": { + "description": "Deletes a logs-based metric.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "DELETE", + "parameters": { + "metricName": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/metrics/[^/]+$", + "location": "path", + "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ], + "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}", + "id": "logging.projects.metrics.delete", + "path": "v2beta1/{+metricName}" + } + } + } + } + }, + "billingAccounts": { + "resources": { + "logs": { + "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "logName" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "logName": { + "location": "path", + "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+/logs/[^/]+$" + } + }, + "flatPath": "v2beta1/billingAccounts/{billingAccountsId}/logs/{logsId}", + "id": "logging.billingAccounts.logs.delete", + "path": "v2beta1/{+logName}", + "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted." + }, + "list": { + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + "response": { + "$ref": "ListLogsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", + "type": "string", + "required": true, + "pattern": "^billingAccounts/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2beta1/billingAccounts/{billingAccountsId}/logs", + "id": "logging.billingAccounts.logs.list", + "path": "v2beta1/{+parent}/logs" + } + } + } + } + }, + "monitoredResourceDescriptors": { + "methods": { + "list": { + "id": "logging.monitoredResourceDescriptors.list", + "path": "v2beta1/monitoredResourceDescriptors", + "description": "Lists the descriptors for monitored resource types used by Stackdriver Logging.", + "response": { + "$ref": "ListMonitoredResourceDescriptorsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "flatPath": "v2beta1/monitoredResourceDescriptors" + } + } + } + }, + "parameters": { + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + } + }, "version": "v2beta1", "baseUrl": "https://logging.googleapis.com/", "description": "Writes log entries and manages your Stackdriver Logging configuration.", "kind": "discovery#restDescription", "servicePath": "", "basePath": "", - "id": "logging:v2beta1", + "revision": "20170918", "documentationLink": "https://cloud.google.com/logging/docs/", - "revision": "20170516", + "id": "logging:v2beta1", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { + "ListLogEntriesRequest": { + "description": "The parameters to ListLogEntries.", + "type": "object", + "properties": { + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call.", + "type": "string" + }, + "pageSize": { + "type": "integer", + "format": "int32", + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of next_page_token in the response indicates that more results might be available." + }, + "orderBy": { + "description": "Optional. How the results should be sorted. Presently, the only permitted values are \"timestamp asc\" (default) and \"timestamp desc\". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values.", + "type": "string" + }, + "resourceNames": { + "description": "Required. Names of one or more parent resources from which to retrieve log entries:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nProjects listed in the project_ids field are added to this list.", + "items": { + "type": "string" + }, + "type": "array" + }, + "filter": { + "description": "Optional. A filter that chooses which log entries to return. See Advanced Logs Filters. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of the filter is 20000 characters.", + "type": "string" + }, + "projectIds": { + "description": "Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: \"my-project-1A\". If present, these project identifiers are converted to resource name format and added to the list of resources in resource_names.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "ListLogEntriesRequest" + }, + "Explicit": { + "description": "Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): boundsi Lower bound (1 \u003c= i \u003c N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets.", + "type": "object", + "properties": { + "bounds": { + "items": { + "format": "double", + "type": "number" + }, + "type": "array", + "description": "The values must be monotonically increasing." + } + }, + "id": "Explicit" + }, + "SourceReference": { + "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", + "type": "object", + "properties": { + "repository": { + "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", + "type": "string" + }, + "revisionId": { + "description": "The canonical and persistent identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"", + "type": "string" + } + }, + "id": "SourceReference" + }, + "WriteLogEntriesResponse": { + "type": "object", + "properties": {}, + "id": "WriteLogEntriesResponse", + "description": "Result returned from WriteLogEntries. empty" + }, + "Exponential": { + "description": "Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): scale * (growth_factor ^ i). Lower bound (1 \u003c= i \u003c N): scale * (growth_factor ^ (i - 1)).", + "type": "object", + "properties": { + "scale": { + "format": "double", + "description": "Must be greater than 0.", + "type": "number" + }, + "numFiniteBuckets": { + "format": "int32", + "description": "Must be greater than 0.", + "type": "integer" + }, + "growthFactor": { + "format": "double", + "description": "Must be greater than 1.", + "type": "number" + } + }, + "id": "Exponential" + }, + "WriteLogEntriesRequest": { + "description": "The parameters to WriteLogEntries.", + "type": "object", + "properties": { + "entries": { + "description": "Required. The log entries to send to Stackdriver Logging. The order of log entries in this list does not matter. Values supplied in this method's log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future might be discarded. Discarding does not return an error.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry.", + "items": { + "$ref": "LogEntry" + }, + "type": "array" + }, + "logName": { + "description": "Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\" or \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", + "type": "string" + }, + "partialSuccess": { + "description": "Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method.", + "type": "boolean" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry." + }, + "resource": { + "$ref": "MonitoredResource", + "description": "Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example:\n{ \"type\": \"gce_instance\",\n \"labels\": {\n \"zone\": \"us-central1-a\", \"instance_id\": \"00000000000000000000\" }}\nSee LogEntry." + } + }, + "id": "WriteLogEntriesRequest" + }, + "LabelDescriptor": { + "description": "A description of a label.", + "type": "object", + "properties": { + "valueType": { + "enumDescriptions": [ + "A variable-length string. This is the default.", + "Boolean; true or false.", + "A 64-bit signed integer." + ], + "enum": [ + "STRING", + "BOOL", + "INT64" + ], + "description": "The type of data that can be assigned to the label.", + "type": "string" + }, + "key": { + "type": "string", + "description": "The label key." + }, + "description": { + "description": "A human-readable description for the label.", + "type": "string" + } + }, + "id": "LabelDescriptor" + }, + "BucketOptions": { + "description": "BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i \u003e 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.", + "type": "object", + "properties": { + "exponentialBuckets": { + "description": "The exponential buckets.", + "$ref": "Exponential" + }, + "explicitBuckets": { + "$ref": "Explicit", + "description": "The explicit buckets." + }, + "linearBuckets": { + "description": "The linear bucket.", + "$ref": "Linear" + } + }, + "id": "BucketOptions" + }, "ListLogMetricsResponse": { "type": "object", "properties": { "metrics": { "description": "A list of logs-based metrics.", - "type": "array", "items": { "$ref": "LogMetric" - } + }, + "type": "array" }, "nextPageToken": { "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", @@ -29,55 +926,90 @@ "id": "ListLogMetricsResponse", "description": "Result returned from ListLogMetrics." }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "MetricDescriptor": { + "id": "MetricDescriptor", + "description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.", "type": "object", - "properties": {}, - "id": "Empty" + "properties": { + "valueType": { + "description": "Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.", + "type": "string", + "enumDescriptions": [ + "Do not use this default value.", + "The value is a boolean. This value type can be used only if the metric kind is GAUGE.", + "The value is a signed 64-bit integer.", + "The value is a double precision floating point number.", + "The value is a text string. This value type can be used only if the metric kind is GAUGE.", + "The value is a Distribution.", + "The value is money." + ], + "enum": [ + "VALUE_TYPE_UNSPECIFIED", + "BOOL", + "INT64", + "DOUBLE", + "STRING", + "DISTRIBUTION", + "MONEY" + ] + }, + "metricKind": { + "enumDescriptions": [ + "Do not use this default value.", + "An instantaneous measurement of a value.", + "The change in a value during a time interval.", + "A value accumulated over a time interval. Cumulative measurements in a time series should have the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points." + ], + "enum": [ + "METRIC_KIND_UNSPECIFIED", + "GAUGE", + "DELTA", + "CUMULATIVE" + ], + "description": "Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.", + "type": "string" + }, + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "type": "string" + }, + "displayName": { + "description": "A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example \"Request count\".", + "type": "string" + }, + "unit": { + "description": "The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)\nbit bit\nBy byte\ns second\nmin minute\nh hour\nd dayPrefixes (PREFIX)\nk kilo (10**3)\nM mega (10**6)\nG giga (10**9)\nT tera (10**12)\nP peta (10**15)\nE exa (10**18)\nZ zetta (10**21)\nY yotta (10**24)\nm milli (10**-3)\nu micro (10**-6)\nn nano (10**-9)\np pico (10**-12)\nf femto (10**-15)\na atto (10**-18)\nz zepto (10**-21)\ny yocto (10**-24)\nKi kibi (2**10)\nMi mebi (2**20)\nGi gibi (2**30)\nTi tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors:\n/ division (as an infix operator, e.g. 1/s).\n. multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows:\nExpression = Component { \".\" Component } { \"/\" Component } ;\n\nComponent = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\nAnnotation = \"{\" NAME \"}\" ;\nNotes:\nAnnotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s.\nNAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'.", + "type": "string" + }, + "labels": { + "description": "The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + }, + "name": { + "description": "The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id:\n\"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"\n", + "type": "string" + }, + "type": { + "description": "The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example:\n\"custom.googleapis.com/invoice/paid/amount\"\n\"appengine.googleapis.com/http/server/response_latencies\"\n", + "type": "string" + } + } }, "LogEntry": { - "id": "LogEntry", "description": "An individual entry in a log.", "type": "object", "properties": { - "severity": { - "enum": [ - "DEFAULT", - "DEBUG", - "INFO", - "NOTICE", - "WARNING", - "ERROR", - "CRITICAL", - "ALERT", - "EMERGENCY" - ], - "description": "Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.", - "type": "string", - "enumDescriptions": [ - "(0) The log entry has no assigned severity level.", - "(100) Debug or trace information.", - "(200) Routine information, such as ongoing status or performance.", - "(300) Normal but significant events, such as start up, shut down, or a configuration change.", - "(400) Warning events might cause problems.", - "(500) Error events are likely to cause problems.", - "(600) Critical events cause more severe problems or outages.", - "(700) A person must take an action immediately.", - "(800) One or more systems are unusable." - ] - }, - "sourceLocation": { - "$ref": "LogEntrySourceLocation", - "description": "Optional. Source code location information associated with the log entry, if any." - }, "timestamp": { - "description": "Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted.", + "type": "string", "format": "google-datetime", - "type": "string" + "description": "Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Stackdriver Logging assigns it the current time.Incoming log entries should have timestamps that are no more than the logs retention period in the past, and no more than 24 hours in the future. See the entries.write API method for more information." }, "receiveTimestamp": { - "description": "Output only. The time the log entry was received by Stackdriver Logging.", "format": "google-datetime", + "description": "Output only. The time the log entry was received by Stackdriver Logging.", "type": "string" }, "logName": { @@ -100,13 +1032,13 @@ "description": "The log entry payload, represented as a structure that is expressed as a JSON object.", "type": "object" }, - "insertId": { - "description": "Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value.", - "type": "string" - }, "operation": { - "$ref": "LogEntryOperation", - "description": "Optional. Information about an operation associated with the log entry, if applicable." + "description": "Optional. Information about an operation associated with the log entry, if applicable.", + "$ref": "LogEntryOperation" + }, + "insertId": { + "description": "Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging assigns its own unique identifier. The insert_id is also used to order log entries that have the same timestamp value.", + "type": "string" }, "textPayload": { "description": "The log entry payload, represented as a Unicode string (UTF-8).", @@ -114,12 +1046,16 @@ }, "protoPayload": { "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" }, "description": "The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.", "type": "object" }, + "trace": { + "description": "Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824", + "type": "string" + }, "labels": { "additionalProperties": { "type": "string" @@ -127,621 +1063,9 @@ "description": "Optional. A set of user-defined (key, value) data that provides additional information about the log entry.", "type": "object" }, - "trace": { - "description": "Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824", - "type": "string" - } - } - }, - "SourceLocation": { - "type": "object", - "properties": { - "file": { - "description": "Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", - "type": "string" - }, - "functionName": { - "type": "string", - "description": "Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information is used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python)." - }, - "line": { - "description": "Line within the source file.", - "format": "int64", - "type": "string" - } - }, - "id": "SourceLocation", - "description": "Specifies a location in a source code file." - }, - "ListLogEntriesRequest": { - "description": "The parameters to ListLogEntries.", - "type": "object", - "properties": { - "orderBy": { - "description": "Optional. How the results should be sorted. Presently, the only permitted values are \"timestamp asc\" (default) and \"timestamp desc\". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values.", - "type": "string" - }, - "resourceNames": { - "description": "Required. Names of one or more parent resources from which to retrieve log entries:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nProjects listed in the project_ids field are added to this list.", - "type": "array", - "items": { - "type": "string" - } - }, - "filter": { - "description": "Optional. A filter that chooses which log entries to return. See Advanced Logs Filters. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of the filter is 20000 characters.", - "type": "string" - }, - "projectIds": { - "description": "Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: \"my-project-1A\". If present, these project identifiers are converted to resource name format and added to the list of resources in resource_names.", - "type": "array", - "items": { - "type": "string" - } - }, - "pageToken": { - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of next_page_token in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - } - }, - "id": "ListLogEntriesRequest" - }, - "RequestLog": { - "type": "object", - "properties": { - "line": { - "description": "A list of log lines emitted by the application while serving this request.", - "type": "array", - "items": { - "$ref": "LogLine" - } - }, - "referrer": { - "type": "string", - "description": "Referrer URL of request." - }, - "taskQueueName": { - "description": "Queue name of the request, in the case of an offline request.", - "type": "string" - }, - "requestId": { - "description": "Globally unique identifier for a request, which is based on the request start time. Request IDs for requests which started later will compare greater as strings than those for requests which started earlier.", - "type": "string" - }, - "nickname": { - "description": "The logged-in user who made the request.Most likely, this is the part of the user's email before the @ sign. The field value is the same for different requests from the same user, but different users can have similar names. This information is also available to the application via the App Engine Users API.This field will be populated starting with App Engine 1.9.21.", - "type": "string" - }, - "status": { - "description": "HTTP response status code. Example: 200, 404.", - "format": "int32", - "type": "integer" - }, - "resource": { - "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". The fragment identifier, which is identified by the # character, is not included.", - "type": "string" - }, - "pendingTime": { - "description": "Time this request spent in the pending request queue.", - "format": "google-duration", - "type": "string" - }, - "taskName": { - "description": "Task name of the request, in the case of an offline request.", - "type": "string" - }, - "urlMapEntry": { - "description": "File or class that handled the request.", - "type": "string" - }, - "instanceIndex": { - "description": "If the instance processing this request belongs to a manually scaled module, then this is the 0-based index of the instance. Otherwise, this value is -1.", - "format": "int32", - "type": "integer" - }, - "finished": { - "type": "boolean", - "description": "Whether this request is finished or active." - }, - "host": { - "description": "Internet host and port number of the resource being requested.", - "type": "string" - }, - "httpVersion": { - "description": "HTTP version of request. Example: \"HTTP/1.1\".", - "type": "string" - }, - "startTime": { - "description": "Time when the request started.", - "format": "google-datetime", - "type": "string" - }, - "latency": { - "type": "string", - "description": "Latency of the request.", - "format": "google-duration" - }, - "ip": { - "description": "Origin IP address.", - "type": "string" - }, - "appId": { - "description": "Application that handled this request.", - "type": "string" - }, - "appEngineRelease": { - "description": "App Engine release version.", - "type": "string" - }, - "method": { - "description": "Request method. Example: \"GET\", \"HEAD\", \"PUT\", \"POST\", \"DELETE\".", - "type": "string" - }, - "cost": { - "type": "number", - "description": "An indication of the relative cost of serving this request.", - "format": "double" - }, - "instanceId": { - "description": "An identifier for the instance that handled the request.", - "type": "string" - }, - "megaCycles": { - "description": "Number of CPU megacycles used to process request.", - "format": "int64", - "type": "string" - }, - "first": { - "description": "Whether this is the first RequestLog entry for this request. If an active request has several RequestLog entries written to Stackdriver Logging, then this field will be set for one of them.", - "type": "boolean" - }, - "versionId": { - "type": "string", - "description": "Version of the application that handled this request." - }, - "moduleId": { - "description": "Module of the application that handled this request.", - "type": "string" - }, - "endTime": { - "description": "Time when the request finished.", - "format": "google-datetime", - "type": "string" - }, - "userAgent": { - "description": "User agent that made the request.", - "type": "string" - }, - "wasLoadingRequest": { - "description": "Whether this was a loading request for the instance.", - "type": "boolean" - }, - "sourceReference": { - "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.", - "type": "array", - "items": { - "$ref": "SourceReference" - } - }, - "responseSize": { - "type": "string", - "description": "Size in bytes sent back to client by request.", - "format": "int64" - }, - "traceId": { - "description": "Stackdriver Trace identifier for this request.", - "type": "string" - } - }, - "id": "RequestLog", - "description": "Complete log information about a single HTTP request to an App Engine application." - }, - "ListMonitoredResourceDescriptorsResponse": { - "type": "object", - "properties": { - "nextPageToken": { - "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", - "type": "string" - }, - "resourceDescriptors": { - "description": "A list of resource descriptors.", - "type": "array", - "items": { - "$ref": "MonitoredResourceDescriptor" - } - } - }, - "id": "ListMonitoredResourceDescriptorsResponse", - "description": "Result returned from ListMonitoredResourceDescriptors." - }, - "SourceReference": { - "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", - "type": "object", - "properties": { - "revisionId": { - "type": "string", - "description": "The canonical and persistent identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"" - }, - "repository": { - "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", - "type": "string" - } - }, - "id": "SourceReference" - }, - "LogMetric": { - "description": "Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.", - "type": "object", - "properties": { - "version": { - "description": "Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.", - "type": "string", - "enumDescriptions": [ - "Stackdriver Logging API v2.", - "Stackdriver Logging API v1." - ], - "enum": [ - "V2", - "V1" - ] - }, - "filter": { - "description": "Required. An advanced logs filter which is used to match log entries. Example:\n\"resource.type=gae_app AND severity\u003e=ERROR\"\nThe maximum length of the filter is 20000 characters.", - "type": "string" - }, - "name": { - "description": "Required. The client-assigned metric identifier. Examples: \"error_count\", \"nginx/requests\".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: \"projects/my-project/metrics/nginx%2Frequests\".", - "type": "string" - }, - "description": { - "description": "Optional. A description of this metric, which is used in documentation.", - "type": "string" - } - }, - "id": "LogMetric" - }, - "WriteLogEntriesResponse": { - "description": "Result returned from WriteLogEntries. empty", - "type": "object", - "properties": {}, - "id": "WriteLogEntriesResponse" - }, - "LogEntryOperation": { - "properties": { - "producer": { - "type": "string", - "description": "Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: \"MyDivision.MyBigCompany.com\", \"github.com/MyProject/MyApplication\"." - }, - "first": { - "description": "Optional. Set this to True if this is the first log entry in the operation.", - "type": "boolean" - }, - "last": { - "description": "Optional. Set this to True if this is the last log entry in the operation.", - "type": "boolean" - }, - "id": { - "description": "Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.", - "type": "string" - } - }, - "id": "LogEntryOperation", - "description": "Additional information about a potentially long-running operation with which a log entry is associated.", - "type": "object" - }, - "MonitoredResource": { - "id": "MonitoredResource", - "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n", - "type": "object", - "properties": { - "labels": { - "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance.", - "type": "string" - } - } - }, - "WriteLogEntriesRequest": { - "description": "The parameters to WriteLogEntries.", - "type": "object", - "properties": { - "logName": { - "description": "Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\" or \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "type": "string" - }, - "entries": { - "description": "Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are inserted into those log entries in this list that do not provide their own values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and less than later entries. Otherwise, the order of log entries in this list does not matter.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry.", - "type": "array", - "items": { - "$ref": "LogEntry" - } - }, - "partialSuccess": { - "description": "Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method.", - "type": "boolean" - }, - "labels": { - "description": "Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "resource": { - "$ref": "MonitoredResource", - "description": "Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example:\n{ \"type\": \"gce_instance\",\n \"labels\": {\n \"zone\": \"us-central1-a\", \"instance_id\": \"00000000000000000000\" }}\nSee LogEntry." - } - }, - "id": "WriteLogEntriesRequest" - }, - "LogSink": { - "properties": { - "filter": { - "description": "Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format:\nlogName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity\u003e=ERROR\n", - "type": "string" - }, - "destination": { - "type": "string", - "description": "Required. The export destination:\n\"storage.googleapis.com/[GCS_BUCKET]\"\n\"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]\"\n\"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]\"\nThe sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks." - }, - "endTime": { - "description": "Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time.", - "format": "google-datetime", - "type": "string" - }, - "startTime": { - "description": "Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated.", - "format": "google-datetime", - "type": "string" - }, - "writerIdentity": { - "description": "Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting access for a resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.", - "type": "string" - }, - "outputVersionFormat": { - "enumDescriptions": [ - "An unspecified format version that will default to V2.", - "LogEntry version 2 format.", - "LogEntry version 1 format." - ], - "enum": [ - "VERSION_FORMAT_UNSPECIFIED", - "V2", - "V1" - ], - "description": "Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API.", - "type": "string" - }, - "name": { - "description": "Required. The client-assigned sink identifier, unique within the project. Example: \"my-syslog-errors-to-pubsub\". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods.", - "type": "string" - }, - "includeChildren": { - "description": "Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then logs from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression. For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent. To only export entries from certain child projects, filter on the project part of the log name:\nlogName:(\"projects/test-project1/\" OR \"projects/test-project2/\") AND\nresource.type=gce_instance\n", - "type": "boolean" - } - }, - "id": "LogSink", - "description": "Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.", - "type": "object" - }, - "ListLogsResponse": { - "type": "object", - "properties": { - "nextPageToken": { - "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", - "type": "string" - }, - "logNames": { - "description": "A list of log names. For example, \"projects/my-project/syslog\" or \"organizations/123/cloudresourcemanager.googleapis.com%2Factivity\".", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "ListLogsResponse", - "description": "Result returned from ListLogs." - }, - "HttpRequest": { - "description": "A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.", - "type": "object", - "properties": { - "cacheLookup": { - "type": "boolean", - "description": "Whether or not a cache lookup was attempted." - }, - "cacheHit": { - "description": "Whether or not an entity was served from cache (with or without validation).", - "type": "boolean" - }, - "cacheValidatedWithOriginServer": { - "description": "Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.", - "type": "boolean" - }, - "status": { - "description": "The response code indicating the status of response. Examples: 200, 404.", - "format": "int32", - "type": "integer" - }, - "referer": { - "description": "The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).", - "type": "string" - }, - "userAgent": { - "description": "The user agent sent by the client. Example: \"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)\".", - "type": "string" - }, - "latency": { - "description": "The request processing latency on the server, from the time the request was received until the response was sent.", - "format": "google-duration", - "type": "string" - }, - "cacheFillBytes": { - "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.", - "format": "int64", - "type": "string" - }, - "requestMethod": { - "description": "The request method. Examples: \"GET\", \"HEAD\", \"PUT\", \"POST\".", - "type": "string" - }, - "requestSize": { - "description": "The size of the HTTP request message in bytes, including the request headers and the request body.", - "format": "int64", - "type": "string" - }, - "responseSize": { - "description": "The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.", - "format": "int64", - "type": "string" - }, - "requestUrl": { - "description": "The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: \"http://example.com/some/info?color=red\".", - "type": "string" - }, - "serverIp": { - "description": "The IP address (IPv4 or IPv6) of the origin server that the request was sent to.", - "type": "string" - }, - "remoteIp": { - "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: \"192.168.1.1\", \"FE80::0202:B3FF:FE1E:8329\".", - "type": "string" - } - }, - "id": "HttpRequest" - }, - "ListSinksResponse": { - "description": "Result returned from ListSinks.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.", - "type": "string" - }, - "sinks": { - "description": "A list of sinks.", - "type": "array", - "items": { - "$ref": "LogSink" - } - } - }, - "id": "ListSinksResponse" - }, - "LabelDescriptor": { - "description": "A description of a label.", - "type": "object", - "properties": { - "valueType": { - "enum": [ - "STRING", - "BOOL", - "INT64" - ], - "description": "The type of data that can be assigned to the label.", - "type": "string", - "enumDescriptions": [ - "A variable-length string. This is the default.", - "Boolean; true or false.", - "A 64-bit signed integer." - ] - }, - "key": { - "description": "The label key.", - "type": "string" - }, - "description": { - "description": "A human-readable description for the label.", - "type": "string" - } - }, - "id": "LabelDescriptor" - }, - "MonitoredResourceDescriptor": { - "description": "An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of \"gce_instance\" and specifies the use of the labels \"instance_id\" and \"zone\" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API.", - "type": "object", - "properties": { - "type": { - "description": "Required. The monitored resource type. For example, the type \"cloudsql_database\" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters.", - "type": "string" - }, - "labels": { - "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\".", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } - }, - "name": { - "description": "Optional. The resource name of the monitored resource descriptor: \"projects/{project_id}/monitoredResourceDescriptors/{type}\" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format \"monitoredResourceDescriptors/{type}\".", - "type": "string" - }, - "displayName": { - "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".", - "type": "string" - }, - "description": { - "description": "Optional. A detailed description of the monitored resource type that might be used in documentation.", - "type": "string" - } - }, - "id": "MonitoredResourceDescriptor" - }, - "LogEntrySourceLocation": { - "description": "Additional information about the source code location that produced the log entry.", - "type": "object", - "properties": { - "file": { - "description": "Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", - "type": "string" - }, - "function": { - "description": "Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).", - "type": "string" - }, - "line": { - "type": "string", - "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.", - "format": "int64" - } - }, - "id": "LogEntrySourceLocation" - }, - "ListLogEntriesResponse": { - "properties": { - "nextPageToken": { - "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search.", - "type": "string" - }, - "entries": { - "description": "A list of log entries.", - "type": "array", - "items": { - "$ref": "LogEntry" - } - } - }, - "id": "ListLogEntriesResponse", - "description": "Result returned from ListLogEntries.", - "type": "object" - }, - "LogLine": { - "description": "Application log line emitted while processing a request.", - "type": "object", - "properties": { "severity": { + "description": "Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.", + "type": "string", "enumDescriptions": [ "(0) The log entry has no assigned severity level.", "(100) Debug or trace information.", @@ -763,25 +1087,594 @@ "CRITICAL", "ALERT", "EMERGENCY" + ] + }, + "sourceLocation": { + "description": "Optional. Source code location information associated with the log entry, if any.", + "$ref": "LogEntrySourceLocation" + } + }, + "id": "LogEntry" + }, + "RequestLog": { + "description": "Complete log information about a single HTTP request to an App Engine application.", + "type": "object", + "properties": { + "line": { + "description": "A list of log lines emitted by the application while serving this request.", + "items": { + "$ref": "LogLine" + }, + "type": "array" + }, + "referrer": { + "description": "Referrer URL of request.", + "type": "string" + }, + "taskQueueName": { + "description": "Queue name of the request, in the case of an offline request.", + "type": "string" + }, + "requestId": { + "description": "Globally unique identifier for a request, which is based on the request start time. Request IDs for requests which started later will compare greater as strings than those for requests which started earlier.", + "type": "string" + }, + "nickname": { + "description": "The logged-in user who made the request.Most likely, this is the part of the user's email before the @ sign. The field value is the same for different requests from the same user, but different users can have similar names. This information is also available to the application via the App Engine Users API.This field will be populated starting with App Engine 1.9.21.", + "type": "string" + }, + "pendingTime": { + "format": "google-duration", + "description": "Time this request spent in the pending request queue.", + "type": "string" + }, + "resource": { + "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". The fragment identifier, which is identified by the # character, is not included.", + "type": "string" + }, + "status": { + "format": "int32", + "description": "HTTP response status code. Example: 200, 404.", + "type": "integer" + }, + "taskName": { + "type": "string", + "description": "Task name of the request, in the case of an offline request." + }, + "urlMapEntry": { + "description": "File or class that handled the request.", + "type": "string" + }, + "instanceIndex": { + "format": "int32", + "description": "If the instance processing this request belongs to a manually scaled module, then this is the 0-based index of the instance. Otherwise, this value is -1.", + "type": "integer" + }, + "finished": { + "description": "Whether this request is finished or active.", + "type": "boolean" + }, + "host": { + "description": "Internet host and port number of the resource being requested.", + "type": "string" + }, + "httpVersion": { + "description": "HTTP version of request. Example: \"HTTP/1.1\".", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time when the request started.", + "type": "string" + }, + "latency": { + "format": "google-duration", + "description": "Latency of the request.", + "type": "string" + }, + "ip": { + "description": "Origin IP address.", + "type": "string" + }, + "appId": { + "description": "Application that handled this request.", + "type": "string" + }, + "appEngineRelease": { + "description": "App Engine release version.", + "type": "string" + }, + "method": { + "description": "Request method. Example: \"GET\", \"HEAD\", \"PUT\", \"POST\", \"DELETE\".", + "type": "string" + }, + "cost": { + "format": "double", + "description": "An indication of the relative cost of serving this request.", + "type": "number" + }, + "instanceId": { + "description": "An identifier for the instance that handled the request.", + "type": "string" + }, + "megaCycles": { + "format": "int64", + "description": "Number of CPU megacycles used to process request.", + "type": "string" + }, + "first": { + "description": "Whether this is the first RequestLog entry for this request. If an active request has several RequestLog entries written to Stackdriver Logging, then this field will be set for one of them.", + "type": "boolean" + }, + "versionId": { + "description": "Version of the application that handled this request.", + "type": "string" + }, + "moduleId": { + "description": "Module of the application that handled this request.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Time when the request finished.", + "type": "string" + }, + "userAgent": { + "description": "User agent that made the request.", + "type": "string" + }, + "wasLoadingRequest": { + "description": "Whether this was a loading request for the instance.", + "type": "boolean" + }, + "sourceReference": { + "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + }, + "type": "array" + }, + "responseSize": { + "format": "int64", + "description": "Size in bytes sent back to client by request.", + "type": "string" + }, + "traceId": { + "description": "Stackdriver Trace identifier for this request.", + "type": "string" + } + }, + "id": "RequestLog" + }, + "ListMonitoredResourceDescriptorsResponse": { + "description": "Result returned from ListMonitoredResourceDescriptors.", + "type": "object", + "properties": { + "resourceDescriptors": { + "description": "A list of resource descriptors.", + "items": { + "$ref": "MonitoredResourceDescriptor" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", + "type": "string" + } + }, + "id": "ListMonitoredResourceDescriptorsResponse" + }, + "LogMetric": { + "properties": { + "description": { + "description": "Optional. A description of this metric, which is used in documentation.", + "type": "string" + }, + "valueExtractor": { + "type": "string", + "description": "Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the log entry field from which the value is to be extracted. 2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, \".*quantity=(\\d+).*\")" + }, + "bucketOptions": { + "description": "Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values.", + "$ref": "BucketOptions" + }, + "name": { + "description": "Required. The client-assigned metric identifier. Examples: \"error_count\", \"nginx/requests\".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: \"projects/my-project/metrics/nginx%2Frequests\".", + "type": "string" + }, + "labelExtractors": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.The extracted value is converted to the type defined in the label descriptor. If the either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project.", + "type": "object" + }, + "metricDescriptor": { + "$ref": "MetricDescriptor", + "description": "Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of \"1\". Such a metric counts the number of log entries matching the filter expression.The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description." + }, + "version": { + "enum": [ + "V2", + "V1" ], - "description": "Severity of this log entry.", + "description": "Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed.", + "type": "string", + "enumDescriptions": [ + "Stackdriver Logging API v2.", + "Stackdriver Logging API v1." + ] + }, + "filter": { + "description": "Required. An advanced logs filter which is used to match log entries. Example:\n\"resource.type=gae_app AND severity\u003e=ERROR\"\nThe maximum length of the filter is 20000 characters.", + "type": "string" + } + }, + "id": "LogMetric", + "description": "Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options.", + "type": "object" + }, + "LogEntryOperation": { + "description": "Additional information about a potentially long-running operation with which a log entry is associated.", + "type": "object", + "properties": { + "last": { + "description": "Optional. Set this to True if this is the last log entry in the operation.", + "type": "boolean" + }, + "id": { + "type": "string", + "description": "Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation." + }, + "first": { + "description": "Optional. Set this to True if this is the first log entry in the operation.", + "type": "boolean" + }, + "producer": { + "description": "Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: \"MyDivision.MyBigCompany.com\", \"github.com/MyProject/MyApplication\".", + "type": "string" + } + }, + "id": "LogEntryOperation" + }, + "MonitoredResource": { + "id": "MonitoredResource", + "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n", + "type": "object", + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".", + "type": "object" + }, + "type": { + "description": "Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance.", + "type": "string" + } + } + }, + "LogSink": { + "description": "Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.", + "type": "object", + "properties": { + "name": { + "description": "Required. The client-assigned sink identifier, unique within the project. Example: \"my-syslog-errors-to-pubsub\". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods.", "type": "string" }, - "logMessage": { - "description": "App-provided log message.", + "includeChildren": { + "description": "Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then logs from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression. For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent. To only export entries from certain child projects, filter on the project part of the log name:\nlogName:(\"projects/test-project1/\" OR \"projects/test-project2/\") AND\nresource.type=gce_instance\n", + "type": "boolean" + }, + "filter": { + "description": "Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. For example:\nlogName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity\u003e=ERROR\n", "type": "string" }, + "destination": { + "description": "Required. The export destination:\n\"storage.googleapis.com/[GCS_BUCKET]\"\n\"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]\"\n\"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]\"\nThe sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "Deprecated. This field is ignored when creating or updating sinks.", + "type": "string" + }, + "writerIdentity": { + "description": "Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting access for a resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Deprecated. This field is ignored when creating or updating sinks.", + "type": "string" + }, + "outputVersionFormat": { + "enumDescriptions": [ + "An unspecified format version that will default to V2.", + "LogEntry version 2 format.", + "LogEntry version 1 format." + ], + "enum": [ + "VERSION_FORMAT_UNSPECIFIED", + "V2", + "V1" + ], + "description": "Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed.", + "type": "string" + } + }, + "id": "LogSink" + }, + "ListLogsResponse": { + "properties": { + "logNames": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of log names. For example, \"projects/my-project/syslog\" or \"organizations/123/cloudresourcemanager.googleapis.com%2Factivity\"." + }, + "nextPageToken": { + "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.", + "type": "string" + } + }, + "id": "ListLogsResponse", + "description": "Result returned from ListLogs.", + "type": "object" + }, + "ListSinksResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.", + "type": "string" + }, + "sinks": { + "description": "A list of sinks.", + "items": { + "$ref": "LogSink" + }, + "type": "array" + } + }, + "id": "ListSinksResponse", + "description": "Result returned from ListSinks." + }, + "HttpRequest": { + "properties": { + "userAgent": { + "description": "The user agent sent by the client. Example: \"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)\".", + "type": "string" + }, + "latency": { + "format": "google-duration", + "description": "The request processing latency on the server, from the time the request was received until the response was sent.", + "type": "string" + }, + "cacheFillBytes": { + "type": "string", + "format": "int64", + "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted." + }, + "requestMethod": { + "description": "The request method. Examples: \"GET\", \"HEAD\", \"PUT\", \"POST\".", + "type": "string" + }, + "requestSize": { + "format": "int64", + "description": "The size of the HTTP request message in bytes, including the request headers and the request body.", + "type": "string" + }, + "responseSize": { + "format": "int64", + "description": "The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.", + "type": "string" + }, + "protocol": { + "description": "Protocol used for the request. Examples: \"HTTP/1.1\", \"HTTP/2\", \"websocket\"", + "type": "string" + }, + "requestUrl": { + "type": "string", + "description": "The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: \"http://example.com/some/info?color=red\"." + }, + "remoteIp": { + "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: \"192.168.1.1\", \"FE80::0202:B3FF:FE1E:8329\".", + "type": "string" + }, + "serverIp": { + "description": "The IP address (IPv4 or IPv6) of the origin server that the request was sent to.", + "type": "string" + }, + "cacheLookup": { + "description": "Whether or not a cache lookup was attempted.", + "type": "boolean" + }, + "cacheHit": { + "description": "Whether or not an entity was served from cache (with or without validation).", + "type": "boolean" + }, + "cacheValidatedWithOriginServer": { + "description": "Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.", + "type": "boolean" + }, + "status": { + "format": "int32", + "description": "The response code indicating the status of response. Examples: 200, 404.", + "type": "integer" + }, + "referer": { + "description": "The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).", + "type": "string" + } + }, + "id": "HttpRequest", + "description": "A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.", + "type": "object" + }, + "MonitoredResourceDescriptor": { + "description": "An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of \"gce_instance\" and specifies the use of the labels \"instance_id\" and \"zone\" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API.", + "type": "object", + "properties": { + "name": { + "description": "Optional. The resource name of the monitored resource descriptor: \"projects/{project_id}/monitoredResourceDescriptors/{type}\" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format \"monitoredResourceDescriptors/{type}\".", + "type": "string" + }, + "description": { + "type": "string", + "description": "Optional. A detailed description of the monitored resource type that might be used in documentation." + }, + "displayName": { + "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".", + "type": "string" + }, + "type": { + "description": "Required. The monitored resource type. For example, the type \"cloudsql_database\" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters.", + "type": "string" + }, + "labels": { + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array", + "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\"." + } + }, + "id": "MonitoredResourceDescriptor" + }, + "LogEntrySourceLocation": { + "properties": { + "file": { + "description": "Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", + "type": "string" + }, + "function": { + "description": "Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).", + "type": "string" + }, + "line": { + "format": "int64", + "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.", + "type": "string" + } + }, + "id": "LogEntrySourceLocation", + "description": "Additional information about the source code location that produced the log entry.", + "type": "object" + }, + "ListLogEntriesResponse": { + "description": "Result returned from ListLogEntries.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search.", + "type": "string" + }, + "entries": { + "description": "A list of log entries. If entries is empty, nextPageToken may still be returned, indicating that more entries may exist. See nextPageToken for more information.", + "items": { + "$ref": "LogEntry" + }, + "type": "array" + } + }, + "id": "ListLogEntriesResponse" + }, + "LogLine": { + "description": "Application log line emitted while processing a request.", + "type": "object", + "properties": { "sourceLocation": { "$ref": "SourceLocation", "description": "Where in the source code this log message was written." }, "time": { - "description": "Approximate time when this log entry was made.", "format": "google-datetime", + "description": "Approximate time when this log entry was made.", "type": "string" + }, + "logMessage": { + "type": "string", + "description": "App-provided log message." + }, + "severity": { + "description": "Severity of this log entry.", + "type": "string", + "enumDescriptions": [ + "(0) The log entry has no assigned severity level.", + "(100) Debug or trace information.", + "(200) Routine information, such as ongoing status or performance.", + "(300) Normal but significant events, such as start up, shut down, or a configuration change.", + "(400) Warning events might cause problems.", + "(500) Error events are likely to cause problems.", + "(600) Critical events cause more severe problems or outages.", + "(700) A person must take an action immediately.", + "(800) One or more systems are unusable." + ], + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ] } }, "id": "LogLine" + }, + "Linear": { + "properties": { + "numFiniteBuckets": { + "format": "int32", + "description": "Must be greater than 0.", + "type": "integer" + }, + "width": { + "format": "double", + "description": "Must be greater than 0.", + "type": "number" + }, + "offset": { + "format": "double", + "description": "Lower bound of the first bucket.", + "type": "number" + } + }, + "id": "Linear", + "description": "Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): offset + (width * i). Lower bound (1 \u003c= i \u003c N): offset + (width * (i - 1)).", + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "SourceLocation": { + "description": "Specifies a location in a source code file.", + "type": "object", + "properties": { + "file": { + "description": "Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", + "type": "string" + }, + "functionName": { + "description": "Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information is used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).", + "type": "string" + }, + "line": { + "format": "int64", + "description": "Line within the source file.", + "type": "string" + } + }, + "id": "SourceLocation" } }, "icons": { @@ -793,17 +1686,17 @@ "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/logging.admin": { - "description": "Administrate log data for your projects" + "https://www.googleapis.com/auth/logging.write": { + "description": "Submit log data for your projects" }, "https://www.googleapis.com/auth/logging.read": { "description": "View log data for your projects" }, - "https://www.googleapis.com/auth/logging.write": { - "description": "Submit log data for your projects" + "https://www.googleapis.com/auth/logging.admin": { + "description": "Administrate log data for your projects" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" @@ -813,719 +1706,5 @@ }, "rootUrl": "https://logging.googleapis.com/", "ownerDomain": "google.com", - "name": "logging", - "batchPath": "batch", - "title": "Stackdriver Logging API", - "ownerName": "Google", - "resources": { - "projects": { - "resources": { - "logs": { - "methods": { - "list": { - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "ListLogsResponse" - }, - "parameters": { - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - }, - "parent": { - "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2beta1/projects/{projectsId}/logs", - "id": "logging.projects.logs.list", - "path": "v2beta1/{+parent}/logs" - }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "logName" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "logName": { - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/logs/[^/]+$", - "location": "path" - } - }, - "flatPath": "v2beta1/projects/{projectsId}/logs/{logsId}", - "id": "logging.projects.logs.delete", - "path": "v2beta1/{+logName}", - "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted." - } - } - }, - "sinks": { - "methods": { - "update": { - "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", - "id": "logging.projects.sinks.update", - "path": "v2beta1/{+sinkName}", - "description": "Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field.", - "request": { - "$ref": "LogSink" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "sinkName" - ], - "response": { - "$ref": "LogSink" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "sinkName": { - "location": "path", - "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/sinks/[^/]+$" - }, - "uniqueWriterIdentity": { - "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is false.", - "type": "boolean", - "location": "query" - } - } - }, - "create": { - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "uniqueWriterIdentity": { - "location": "query", - "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", - "type": "boolean" - }, - "parent": { - "location": "path", - "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - } - }, - "flatPath": "v2beta1/projects/{projectsId}/sinks", - "path": "v2beta1/{+parent}/sinks", - "id": "logging.projects.sinks.create", - "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - "request": { - "$ref": "LogSink" - } - }, - "delete": { - "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - "httpMethod": "DELETE", - "parameterOrder": [ - "sinkName" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "sinkName": { - "location": "path", - "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/sinks/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", - "id": "logging.projects.sinks.delete", - "path": "v2beta1/{+sinkName}" - }, - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListSinksResponse" - }, - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "location": "path", - "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - }, - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2beta1/projects/{projectsId}/sinks", - "id": "logging.projects.sinks.list", - "path": "v2beta1/{+parent}/sinks", - "description": "Lists sinks." - }, - "get": { - "description": "Gets a sink.", - "httpMethod": "GET", - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "sinkName" - ], - "parameters": { - "sinkName": { - "pattern": "^projects/[^/]+/sinks/[^/]+$", - "location": "path", - "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", - "id": "logging.projects.sinks.get", - "path": "v2beta1/{+sinkName}" - } - } - }, - "metrics": { - "methods": { - "create": { - "response": { - "$ref": "LogMetric" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "parameters": { - "parent": { - "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - } - }, - "flatPath": "v2beta1/projects/{projectsId}/metrics", - "path": "v2beta1/{+parent}/metrics", - "id": "logging.projects.metrics.create", - "description": "Creates a logs-based metric.", - "request": { - "$ref": "LogMetric" - } - }, - "delete": { - "id": "logging.projects.metrics.delete", - "path": "v2beta1/{+metricName}", - "description": "Deletes a logs-based metric.", - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "metricName" - ], - "parameters": { - "metricName": { - "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/metrics/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}" - }, - "list": { - "response": { - "$ref": "ListLogMetricsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "parameters": { - "pageSize": { - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "parent": { - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2beta1/projects/{projectsId}/metrics", - "path": "v2beta1/{+parent}/metrics", - "id": "logging.projects.metrics.list", - "description": "Lists logs-based metrics." - }, - "get": { - "description": "Gets a logs-based metric.", - "response": { - "$ref": "LogMetric" - }, - "parameterOrder": [ - "metricName" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "metricName": { - "pattern": "^projects/[^/]+/metrics/[^/]+$", - "location": "path", - "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", - "required": true, - "type": "string" - } - }, - "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}", - "path": "v2beta1/{+metricName}", - "id": "logging.projects.metrics.get" - }, - "update": { - "response": { - "$ref": "LogMetric" - }, - "parameterOrder": [ - "metricName" - ], - "httpMethod": "PUT", - "parameters": { - "metricName": { - "location": "path", - "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/metrics/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}", - "path": "v2beta1/{+metricName}", - "id": "logging.projects.metrics.update", - "request": { - "$ref": "LogMetric" - }, - "description": "Creates or updates a logs-based metric." - } - } - } - } - }, - "billingAccounts": { - "resources": { - "logs": { - "methods": { - "delete": { - "flatPath": "v2beta1/billingAccounts/{billingAccountsId}/logs/{logsId}", - "id": "logging.billingAccounts.logs.delete", - "path": "v2beta1/{+logName}", - "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.", - "httpMethod": "DELETE", - "parameterOrder": [ - "logName" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "logName": { - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "required": true, - "type": "string", - "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", - "location": "path" - } - } - }, - "list": { - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - "response": { - "$ref": "ListLogsResponse" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - }, - "parent": { - "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^billingAccounts/[^/]+$", - "location": "path" - }, - "pageToken": { - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v2beta1/billingAccounts/{billingAccountsId}/logs", - "path": "v2beta1/{+parent}/logs", - "id": "logging.billingAccounts.logs.list" - } - } - } - } - }, - "monitoredResourceDescriptors": { - "methods": { - "list": { - "response": { - "$ref": "ListMonitoredResourceDescriptorsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - }, - "pageToken": { - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v2beta1/monitoredResourceDescriptors", - "path": "v2beta1/monitoredResourceDescriptors", - "id": "logging.monitoredResourceDescriptors.list", - "description": "Lists the descriptors for monitored resource types used by Stackdriver Logging." - } - } - }, - "organizations": { - "resources": { - "logs": { - "methods": { - "list": { - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "ListLogsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "parameters": { - "pageToken": { - "location": "query", - "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - "format": "int32", - "type": "integer" - }, - "parent": { - "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+$", - "location": "path" - } - }, - "flatPath": "v2beta1/organizations/{organizationsId}/logs", - "id": "logging.organizations.logs.list", - "path": "v2beta1/{+parent}/logs" - }, - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "logName" - ], - "httpMethod": "DELETE", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "logName": { - "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.", - "required": true, - "type": "string", - "pattern": "^organizations/[^/]+/logs/[^/]+$", - "location": "path" - } - }, - "flatPath": "v2beta1/organizations/{organizationsId}/logs/{logsId}", - "path": "v2beta1/{+logName}", - "id": "logging.organizations.logs.delete", - "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted." - } - } - } - } - }, - "entries": { - "methods": { - "list": { - "id": "logging.entries.list", - "path": "v2beta1/entries:list", - "request": { - "$ref": "ListLogEntriesRequest" - }, - "description": "Lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to export log entries, see Exporting Logs.", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "ListLogEntriesResponse" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.read" - ], - "flatPath": "v2beta1/entries:list" - }, - "write": { - "request": { - "$ref": "WriteLogEntriesRequest" - }, - "description": "Writes log entries to Stackdriver Logging.", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "WriteLogEntriesResponse" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" - ], - "flatPath": "v2beta1/entries:write", - "id": "logging.entries.write", - "path": "v2beta1/entries:write" - } - } - } - }, - "parameters": { - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Pretty-print response." - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - } - } + "name": "logging" } diff --git a/etc/api/manufacturers/v1/crates/1.0.6-api+20170808 b/etc/api/manufacturers/v1/crates/1.0.6-api+20170808 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/manufacturers/v1/manufacturers-api.json b/etc/api/manufacturers/v1/manufacturers-api.json index 3384e5fd16..e29d537fb6 100644 --- a/etc/api/manufacturers/v1/manufacturers-api.json +++ b/etc/api/manufacturers/v1/manufacturers-api.json @@ -1,89 +1,202 @@ { + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, + "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + } + }, + "version": "v1", + "baseUrl": "https://manufacturers.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Public API for managing Manufacturer Center related data.", + "servicePath": "", + "basePath": "", + "id": "manufacturers:v1", + "revision": "20170808", + "documentationLink": "https://developers.google.com/manufacturers/", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { + "Count": { + "description": "The number of products in a single package. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#count.", + "type": "object", + "properties": { + "unit": { + "description": "The unit in which these products are counted.", + "type": "string" + }, + "value": { + "format": "int64", + "description": "The numeric value of the number of products in a package.", + "type": "string" + } + }, + "id": "Count" + }, "Product": { "description": "Product data.", "type": "object", "properties": { - "uploadedAttributes": { - "$ref": "Attributes", - "description": "Attributes of the product uploaded via the Manufacturer Center API or via\nfeeds." - }, - "parent": { - "type": "string", - "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account.\n@OutputOnly" - }, - "manuallyProvidedAttributes": { - "$ref": "Attributes", - "description": "Attributes of the product provided manually via the Manufacturer Center UI.\n@OutputOnly" - }, - "targetCountry": { - "type": "string", - "description": "The target country of the product as a CLDR territory code (for example,\nUS).\n@OutputOnly" - }, - "contentLanguage": { - "description": "The content language of the product as a two-letter ISO 639-1 language code\n(for example, en).\n@OutputOnly", - "type": "string" - }, "name": { "description": "Name in the format `{target_country}:{content_language}:{product_id}`.\n\n`target_country` - The target country of the product as a CLDR territory\n code (for example, US).\n\n`content_language` - The content language of the product as a two-letter\n ISO 639-1 language code (for example, en).\n\n`product_id` - The ID of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#id.\n@OutputOnly", "type": "string" }, "issues": { "description": "A server-generated list of issues associated with the product.\n@OutputOnly", - "type": "array", "items": { "$ref": "Issue" - } + }, + "type": "array" }, "manuallyDeletedAttributes": { - "type": "array", + "description": "Names of the attributes of the product deleted manually via the\nManufacturer Center UI.\n@OutputOnly", "items": { "type": "string" }, - "description": "Names of the attributes of the product deleted manually via the\nManufacturer Center UI.\n@OutputOnly" + "type": "array" }, "finalAttributes": { - "description": "Final attributes of the product. The final attributes are obtained by\noverriding the uploaded attributes with the manually provided and deleted\nattributes. Google systems only process, evaluate, review, and/or use final\nattributes.\n@OutputOnly", - "$ref": "Attributes" + "$ref": "Attributes", + "description": "Final attributes of the product. The final attributes are obtained by\noverriding the uploaded attributes with the manually provided and deleted\nattributes. Google systems only process, evaluate, review, and/or use final\nattributes.\n@OutputOnly" }, "productId": { - "type": "string", - "description": "The ID of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#id.\n@OutputOnly" + "description": "The ID of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#id.\n@OutputOnly", + "type": "string" + }, + "uploadedAttributes": { + "$ref": "Attributes", + "description": "Attributes of the product uploaded via the Manufacturer Center API or via\nfeeds." + }, + "parent": { + "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account.\n@OutputOnly", + "type": "string" + }, + "manuallyProvidedAttributes": { + "description": "Attributes of the product provided manually via the Manufacturer Center UI.\n@OutputOnly", + "$ref": "Attributes" + }, + "targetCountry": { + "description": "The target country of the product as a CLDR territory code (for example,\nUS).\n@OutputOnly", + "type": "string" + }, + "contentLanguage": { + "description": "The content language of the product as a two-letter ISO 639-1 language code\n(for example, en).\n@OutputOnly", + "type": "string" } }, "id": "Product" }, "Capacity": { + "description": "The capacity of a product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#capacity.", + "type": "object", "properties": { - "value": { - "description": "The numeric value of the capacity.", - "format": "int64", - "type": "string" - }, "unit": { "description": "The unit of the capacity, i.e., MB, GB, or TB.", "type": "string" + }, + "value": { + "type": "string", + "format": "int64", + "description": "The numeric value of the capacity." } }, - "id": "Capacity", - "description": "The capacity of a product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#capacity.", - "type": "object" + "id": "Capacity" }, "ListProductsResponse": { "type": "object", "properties": { + "products": { + "description": "List of the products.", + "items": { + "$ref": "Product" + }, + "type": "array" + }, "nextPageToken": { "description": "The token for the retrieval of the next page of product statuses.", "type": "string" - }, - "products": { - "description": "List of the products.", - "type": "array", - "items": { - "$ref": "Product" - } } }, "id": "ListProductsResponse" @@ -92,6 +205,10 @@ "description": "A product detail of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productdetail.", "type": "object", "properties": { + "attributeName": { + "description": "The name of the attribute.", + "type": "string" + }, "attributeValue": { "description": "The value of the attribute.", "type": "string" @@ -99,42 +216,12 @@ "sectionName": { "description": "A short section name that can be reused between multiple product details.", "type": "string" - }, - "attributeName": { - "description": "The name of the attribute.", - "type": "string" } }, "id": "ProductDetail" }, - "FeatureDescription": { - "description": "A feature description of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#featuredesc.", - "type": "object", - "properties": { - "image": { - "$ref": "Image", - "description": "An optional image describing the feature." - }, - "headline": { - "description": "A short description of the feature.", - "type": "string" - }, - "text": { - "description": "A detailed description of the feature.", - "type": "string" - } - }, - "id": "FeatureDescription" - }, "Issue": { - "description": "Product issue.", - "type": "object", "properties": { - "timestamp": { - "type": "string", - "description": "The timestamp when this issue appeared.", - "format": "google-datetime" - }, "severity": { "enum": [ "SEVERITY_UNSPECIFIED", @@ -156,15 +243,47 @@ "type": "string" }, "type": { - "description": "The server-generated type of the issue, for example,\n“INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc.", - "type": "string" + "type": "string", + "description": "The server-generated type of the issue, for example,\n“INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc." }, "attribute": { "description": "If present, the attribute that triggered the issue. For more information\nabout attributes, see\nhttps://support.google.com/manufacturers/answer/6124116.", "type": "string" + }, + "timestamp": { + "type": "string", + "format": "google-datetime", + "description": "The timestamp when this issue appeared." } }, - "id": "Issue" + "id": "Issue", + "description": "Product issue.", + "type": "object" + }, + "FeatureDescription": { + "description": "A feature description of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#featuredesc.", + "type": "object", + "properties": { + "image": { + "$ref": "Image", + "description": "An optional image describing the feature." + }, + "headline": { + "description": "A short description of the feature.", + "type": "string" + }, + "text": { + "description": "A detailed description of the feature.", + "type": "string" + } + }, + "id": "FeatureDescription" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" }, "Price": { "type": "object", @@ -174,8 +293,8 @@ "type": "string" }, "amount": { - "description": "The numeric value of the price.", - "type": "string" + "type": "string", + "description": "The numeric value of the price." } }, "id": "Price", @@ -185,25 +304,9 @@ "description": "An image.", "type": "object", "properties": { - "type": { - "type": "string", - "enumDescriptions": [ - "Type is unspecified. Should not be used.", - "The image was crawled from a provided URL.", - "The image was uploaded." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "CRAWLED", - "UPLOADED" - ], - "description": "The type of the image, i.e., crawled or uploaded.\n@OutputOnly" - }, - "imageUrl": { - "description": "The URL of the image. For crawled images, this is the provided URL. For\nuploaded images, this is a serving URL from Google if the image has been\nprocessed successfully.", - "type": "string" - }, "status": { + "description": "The status of the image.\n@OutputOnly", + "type": "string", "enumDescriptions": [ "Status is unspecified. Should not be used.", "Image was uploaded and is being processed.", @@ -229,8 +332,24 @@ "DECODING_ERROR", "TOO_BIG", "CRAWL_SKIPPED" + ] + }, + "type": { + "enum": [ + "TYPE_UNSPECIFIED", + "CRAWLED", + "UPLOADED" ], - "description": "The status of the image.\n@OutputOnly", + "description": "The type of the image, i.e., crawled or uploaded.\n@OutputOnly", + "type": "string", + "enumDescriptions": [ + "Type is unspecified. Should not be used.", + "The image was crawled from a provided URL.", + "The image was uploaded." + ] + }, + "imageUrl": { + "description": "The URL of the image. For crawled images, this is the provided URL. For\nuploaded images, this is a serving URL from Google if the image has been\nprocessed successfully.", "type": "string" } }, @@ -240,16 +359,82 @@ "description": "Attributes of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116.", "type": "object", "properties": { + "flavor": { + "description": "The flavor of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#flavor.", + "type": "string" + }, + "productDetail": { + "description": "The details of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productdetail.", + "items": { + "$ref": "ProductDetail" + }, + "type": "array" + }, + "ageGroup": { + "description": "The target age group of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#agegroup.", + "type": "string" + }, + "mpn": { + "description": "The Manufacturer Part Number (MPN) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#mpn.", + "type": "string" + }, + "productPageUrl": { + "description": "The URL of the detail page of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productpage.", + "type": "string" + }, + "releaseDate": { + "description": "The release date of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#release.", + "type": "string" + }, + "gtin": { + "description": "The Global Trade Item Number (GTIN) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#gtin.", + "items": { + "type": "string" + }, + "type": "array" + }, + "itemGroupId": { + "description": "The item group id of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#itemgroupid.", + "type": "string" + }, + "productLine": { + "description": "The name of the group of products related to the product. For more\ninformation, see\nhttps://support.google.com/manufacturers/answer/6124116#productline.", + "type": "string" + }, + "capacity": { + "$ref": "Capacity", + "description": "The capacity of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#capacity." + }, + "description": { + "type": "string", + "description": "The description of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#description." + }, + "gender": { + "type": "string", + "description": "The target gender of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#gender." + }, + "sizeSystem": { + "description": "The size system of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#sizesystem.", + "type": "string" + }, + "theme": { + "description": "The theme of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#theme.", + "type": "string" + }, + "pattern": { + "description": "The pattern of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#pattern.", + "type": "string" + }, "imageLink": { "$ref": "Image", "description": "The image of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#image." }, "productType": { - "description": "The category of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#producttype.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array", + "description": "The category of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#producttype." }, "format": { "description": "The format of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#format.", @@ -257,44 +442,49 @@ }, "additionalImageLink": { "description": "The additional images of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#addlimage.", - "type": "array", "items": { "$ref": "Image" - } + }, + "type": "array" }, "videoLink": { "description": "The videos of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#video.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "color": { "description": "The color of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#color.", "type": "string" }, "productName": { - "description": "The canonical name of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productname.", - "type": "string" + "type": "string", + "description": "The canonical name of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productname." }, "sizeType": { "description": "The size type of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#sizetype.", "type": "string" }, "suggestedRetailPrice": { - "description": "The suggested retail price (MSRP) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#price.", - "$ref": "Price" + "$ref": "Price", + "description": "The suggested retail price (MSRP) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#price." }, "featureDescription": { "description": "The rich format description of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#featuredesc.", - "type": "array", "items": { "$ref": "FeatureDescription" - } + }, + "type": "array" + }, + "targetAccountId": { + "format": "int64", + "description": "The target account id. Should only be used in the accounts of the data\npartners.", + "type": "string" }, "size": { - "description": "The size of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#size.", - "type": "string" + "type": "string", + "description": "The size of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#size." }, "title": { "description": "The title of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#title.", @@ -308,108 +498,26 @@ "description": "The brand name of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#brand.", "type": "string" }, + "material": { + "description": "The material of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#material.", + "type": "string" + }, "disclosureDate": { "description": "The disclosure date of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#disclosure.", "type": "string" }, - "material": { - "type": "string", - "description": "The material of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#material." - }, "scent": { "description": "The scent of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#scent.", "type": "string" - }, - "flavor": { - "description": "The flavor of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#flavor.", - "type": "string" - }, - "productDetail": { - "description": "The details of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productdetail.", - "type": "array", - "items": { - "$ref": "ProductDetail" - } - }, - "ageGroup": { - "type": "string", - "description": "The target age group of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#agegroup." - }, - "mpn": { - "description": "The Manufacturer Part Number (MPN) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#mpn.", - "type": "string" - }, - "productPageUrl": { - "type": "string", - "description": "The URL of the detail page of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productpage." - }, - "releaseDate": { - "description": "The release date of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#release.", - "type": "string" - }, - "itemGroupId": { - "type": "string", - "description": "The item group id of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#itemgroupid." - }, - "gtin": { - "description": "The Global Trade Item Number (GTIN) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#gtin.", - "type": "array", - "items": { - "type": "string" - } - }, - "productLine": { - "description": "The name of the group of products related to the product. For more\ninformation, see\nhttps://support.google.com/manufacturers/answer/6124116#productline.", - "type": "string" - }, - "capacity": { - "$ref": "Capacity", - "description": "The capacity of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#capacity." - }, - "description": { - "description": "The description of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#description.", - "type": "string" - }, - "gender": { - "description": "The target gender of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#gender.", - "type": "string" - }, - "sizeSystem": { - "description": "The size system of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#sizesystem.", - "type": "string" - }, - "theme": { - "description": "The theme of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#theme.", - "type": "string" - }, - "pattern": { - "description": "The pattern of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#pattern.", - "type": "string" } }, "id": "Attributes" - }, - "Count": { - "description": "The number of products in a single package. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#count.", - "type": "object", - "properties": { - "value": { - "type": "string", - "description": "The numeric value of the number of products in a package.", - "format": "int64" - }, - "unit": { - "description": "The unit in which these products are counted.", - "type": "string" - } - }, - "id": "Count" } }, "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "canonicalName": "Manufacturer Center", "auth": { @@ -432,43 +540,41 @@ "resources": { "products": { "methods": { - "list": { - "parameterOrder": [ - "parent" - ], + "delete": { + "flatPath": "v1/accounts/{accountsId}/products/{productsId}", + "path": "v1/{+parent}/products/{+name}", + "id": "manufacturers.accounts.products.delete", + "description": "Deletes the product from a Manufacturer Center account.", + "httpMethod": "DELETE", "response": { - "$ref": "ListProductsResponse" + "$ref": "Empty" }, - "httpMethod": "GET", + "parameterOrder": [ + "parent", + "name" + ], "parameters": { - "pageToken": { - "location": "query", - "description": "The token returned by the previous request.", - "type": "string" - }, - "pageSize": { - "description": "Maximum number of product statuses to return in the response, used for\npaging.", - "format": "int32", - "type": "integer", - "location": "query" + "name": { + "pattern": "^[^/]+$", + "location": "path", + "description": "Name in the format `{target_country}:{content_language}:{product_id}`.\n\n`target_country` - The target country of the product as a CLDR territory\n code (for example, US).\n\n`content_language` - The content language of the product as a two-letter\n ISO 639-1 language code (for example, en).\n\n`product_id` - The ID of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#id.", + "type": "string", + "required": true }, "parent": { + "location": "path", "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account.", - "required": true, "type": "string", - "pattern": "^accounts/[^/]+$", - "location": "path" + "required": true, + "pattern": "^accounts/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/manufacturercenter" - ], - "flatPath": "v1/accounts/{accountsId}/products", - "id": "manufacturers.accounts.products.list", - "path": "v1/{+parent}/products", - "description": "Lists all the products in a Manufacturer Center account." + ] }, "get": { + "description": "Gets the product from a Manufacturer Center account, including product\nissues.\n\nA recently updated product takes around 15 minutes to process. Changes are\nonly visible after it has been processed. While some issues may be\navailable once the product has been processed, other issues may take days\nto appear.", "response": { "$ref": "Product" }, @@ -481,126 +587,100 @@ "https://www.googleapis.com/auth/manufacturercenter" ], "parameters": { - "name": { - "pattern": "^[^/]+$", - "location": "path", - "description": "Name in the format `{target_country}:{content_language}:{product_id}`.\n\n`target_country` - The target country of the product as a CLDR territory\n code (for example, US).\n\n`content_language` - The content language of the product as a two-letter\n ISO 639-1 language code (for example, en).\n\n`product_id` - The ID of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#id.", - "required": true, - "type": "string" - }, "parent": { + "location": "path", "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account.", - "required": true, "type": "string", - "pattern": "^accounts/[^/]+$", + "required": true, + "pattern": "^accounts/[^/]+$" + }, + "name": { + "description": "Name in the format `{target_country}:{content_language}:{product_id}`.\n\n`target_country` - The target country of the product as a CLDR territory\n code (for example, US).\n\n`content_language` - The content language of the product as a two-letter\n ISO 639-1 language code (for example, en).\n\n`product_id` - The ID of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#id.", + "type": "string", + "required": true, + "pattern": "^[^/]+$", "location": "path" } }, "flatPath": "v1/accounts/{accountsId}/products/{productsId}", - "path": "v1/{+parent}/products/{+name}", "id": "manufacturers.accounts.products.get", - "description": "Gets the product from a Manufacturer Center account, including product\nissues." + "path": "v1/{+parent}/products/{+name}" + }, + "list": { + "path": "v1/{+parent}/products", + "id": "manufacturers.accounts.products.list", + "description": "Lists all the products in a Manufacturer Center account.", + "httpMethod": "GET", + "response": { + "$ref": "ListProductsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account.", + "type": "string", + "required": true, + "pattern": "^accounts/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "The token returned by the previous request.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of product statuses to return in the response, used for\npaging.", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/manufacturercenter" + ], + "flatPath": "v1/accounts/{accountsId}/products" + }, + "update": { + "path": "v1/{+parent}/products/{+name}", + "id": "manufacturers.accounts.products.update", + "request": { + "$ref": "Product" + }, + "description": "Inserts or updates the product in a Manufacturer Center account.\n\nThe checks at upload time are minimal. All required attributes need to be\npresent for a product to be valid. Issues may show up later\nafter the API has accepted an update for a product and it is possible to\noverwrite an existing valid product with an invalid product. To detect\nthis, you should retrieve the product and check it for issues once the\nupdated version is available.\n\nInserted or updated products first need to be processed before they can be\nretrieved. Until then, new products will be unavailable, and retrieval\nof updated products will return the original state of the product.", + "httpMethod": "PUT", + "parameterOrder": [ + "parent", + "name" + ], + "response": { + "$ref": "Product" + }, + "scopes": [ + "https://www.googleapis.com/auth/manufacturercenter" + ], + "parameters": { + "name": { + "pattern": "^[^/]+$", + "location": "path", + "description": "Name in the format `{target_country}:{content_language}:{product_id}`.\n\n`target_country` - The target country of the product as a CLDR territory\n code (for example, US).\n\n`content_language` - The content language of the product as a two-letter\n ISO 639-1 language code (for example, en).\n\n`product_id` - The ID of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#id.", + "type": "string", + "required": true + }, + "parent": { + "location": "path", + "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account.", + "type": "string", + "required": true, + "pattern": "^accounts/[^/]+$" + } + }, + "flatPath": "v1/accounts/{accountsId}/products/{productsId}" } } } } } - }, - "parameters": { - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "type": "string", - "location": "query", - "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." - }, - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "type": "string", - "location": "query", - "description": "OAuth bearer token." - }, - "upload_protocol": { - "type": "string", - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - } - }, - "version": "v1", - "baseUrl": "https://manufacturers.googleapis.com/", - "servicePath": "", - "description": "Public API for managing Manufacturer Center related data.", - "kind": "discovery#restDescription", - "basePath": "", - "revision": "20170412", - "documentationLink": "https://developers.google.com/manufacturers/", - "id": "manufacturers:v1" + } } diff --git a/etc/api/mirror/v1/mirror-api.json b/etc/api/mirror/v1/mirror-api.json index 3c1525de08..56dedeed40 100644 --- a/etc/api/mirror/v1/mirror-api.json +++ b/etc/api/mirror/v1/mirror-api.json @@ -23,7 +23,7 @@ "basePath": "/mirror/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "mirror/v1/", - "batchPath": "batch", + "batchPath": "batch/mirror/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/ml/v1/crates/1.0.6-api+20170926 b/etc/api/ml/v1/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/ml/v1/crates/1.0.6-cli+20170926 b/etc/api/ml/v1/crates/1.0.6-cli+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/ml/v1beta1/ml-api.json b/etc/api/ml/v1/ml-api.json similarity index 66% rename from etc/api/ml/v1beta1/ml-api.json rename to etc/api/ml/v1/ml-api.json index c4393cad87..0e30c99f3b 100644 --- a/etc/api/ml/v1beta1/ml-api.json +++ b/etc/api/ml/v1/ml-api.json @@ -1,83 +1,214 @@ { - "description": "An API to enable creating and using machine learning models.", - "kind": "discovery#restDescription", - "servicePath": "", - "basePath": "", - "id": "ml:v1beta1", - "documentationLink": "https://cloud.google.com/ml/", - "revision": "20170515", - "discoveryVersion": "v1", - "version_module": "True", "schemas": { - "GoogleCloudMlV1__ManualScaling": { - "id": "GoogleCloudMlV1__ManualScaling", - "description": "Options for manually scaling a model.", + "GoogleLongrunning__ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "GoogleLongrunning__Operation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "GoogleLongrunning__ListOperationsResponse" + }, + "GoogleCloudMlV1__ManualScaling": { "properties": { "nodes": { - "type": "integer", - "description": "The number of nodes to allocate for this model. These nodes are always up,\nstarting from the time the model is deployed, so the cost of operating\nthis model will be proportional to nodes * number of hours since\ndeployment.", - "format": "int32" + "format": "int32", + "description": "The number of nodes to allocate for this model. These nodes are always up,\nstarting from the time the model is deployed, so the cost of operating\nthis model will be proportional to `nodes` * number of hours since\nlast billing cycle plus the cost for each prediction performed.", + "type": "integer" } - } + }, + "id": "GoogleCloudMlV1__ManualScaling", + "description": "Options for manually scaling a model.", + "type": "object" }, - "GoogleCloudMlV1beta1_HyperparameterOutput_HyperparameterMetric": { - "description": "An observed value of a metric.", + "GoogleIamV1__Binding": { + "properties": { + "condition": { + "description": "The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently.\nThis field is GOOGLE_INTERNAL.", + "$ref": "GoogleType__Expr" + }, + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "GoogleIamV1__Binding", + "description": "Associates `members` with a `role`.", + "type": "object" + }, + "GoogleCloudMlV1__TrainingOutput": { + "description": "Represents results of a training job. Output only.", "type": "object", "properties": { - "trainingStep": { - "description": "The global training step for this metric.", - "format": "int64", - "type": "string" + "trials": { + "description": "Results for individual Hyperparameter trials.\nOnly set for hyperparameter tuning jobs.", + "items": { + "$ref": "GoogleCloudMlV1__HyperparameterOutput" + }, + "type": "array" }, - "objectiveValue": { - "description": "The objective value at this training step.", + "completedTrialCount": { + "type": "string", + "format": "int64", + "description": "The number of hyperparameter tuning trials that completed successfully.\nOnly set for hyperparameter tuning jobs." + }, + "isHyperparameterTuningJob": { + "description": "Whether this job is a hyperparameter tuning job.", + "type": "boolean" + }, + "consumedMLUnits": { "format": "double", + "description": "The amount of ML units consumed by the job.", "type": "number" } }, - "id": "GoogleCloudMlV1beta1_HyperparameterOutput_HyperparameterMetric" + "id": "GoogleCloudMlV1__TrainingOutput" }, - "GoogleCloudMlV1beta1__ParameterSpec": { + "GoogleCloudMlV1__PredictRequest": { + "id": "GoogleCloudMlV1__PredictRequest", + "description": "Request for predictions to be issued against a trained model.\n\nThe body of the request is a single JSON object with a single top-level\nfield:\n\n\u003cdl\u003e\n \u003cdt\u003einstances\u003c/dt\u003e\n \u003cdd\u003eA JSON array containing values representing the instances to use for\n prediction.\u003c/dd\u003e\n\u003c/dl\u003e\n\nThe structure of each element of the instances list is determined by your\nmodel's input definition. Instances can include named inputs or can contain\nonly unlabeled values.\n\nNot all data includes named inputs. Some instances will be simple\nJSON values (boolean, number, or string). However, instances are often lists\nof simple values, or complex nested lists. Here are some examples of request\nbodies:\n\nCSV data with each row encoded as a string value:\n\u003cpre\u003e\n{\"instances\": [\"1.0,true,\\\\\"x\\\\\"\", \"-2.0,false,\\\\\"y\\\\\"\"]}\n\u003c/pre\u003e\nPlain text:\n\u003cpre\u003e\n{\"instances\": [\"the quick brown fox\", \"la bruja le dio\"]}\n\u003c/pre\u003e\nSentences encoded as lists of words (vectors of strings):\n\u003cpre\u003e\n{\n \"instances\": [\n [\"the\",\"quick\",\"brown\"],\n [\"la\",\"bruja\",\"le\"],\n ...\n ]\n}\n\u003c/pre\u003e\nFloating point scalar values:\n\u003cpre\u003e\n{\"instances\": [0.0, 1.1, 2.2]}\n\u003c/pre\u003e\nVectors of integers:\n\u003cpre\u003e\n{\n \"instances\": [\n [0, 1, 2],\n [3, 4, 5],\n ...\n ]\n}\n\u003c/pre\u003e\nTensors (in this case, two-dimensional tensors):\n\u003cpre\u003e\n{\n \"instances\": [\n [\n [0, 1, 2],\n [3, 4, 5]\n ],\n ...\n ]\n}\n\u003c/pre\u003e\nImages can be represented different ways. In this encoding scheme the first\ntwo dimensions represent the rows and columns of the image, and the third\ncontains lists (vectors) of the R, G, and B values for each pixel.\n\u003cpre\u003e\n{\n \"instances\": [\n [\n [\n [138, 30, 66],\n [130, 20, 56],\n ...\n ],\n [\n [126, 38, 61],\n [122, 24, 57],\n ...\n ],\n ...\n ],\n ...\n ]\n}\n\u003c/pre\u003e\nJSON strings must be encoded as UTF-8. To send binary data, you must\nbase64-encode the data and mark it as binary. To mark a JSON string\nas binary, replace it with a JSON object with a single attribute named `b64`:\n\u003cpre\u003e{\"b64\": \"...\"} \u003c/pre\u003e\nFor example:\n\nTwo Serialized tf.Examples (fake data, for illustrative purposes only):\n\u003cpre\u003e\n{\"instances\": [{\"b64\": \"X5ad6u\"}, {\"b64\": \"IA9j4nx\"}]}\n\u003c/pre\u003e\nTwo JPEG image byte strings (fake data, for illustrative purposes only):\n\u003cpre\u003e\n{\"instances\": [{\"b64\": \"ASa8asdf\"}, {\"b64\": \"JLK7ljk3\"}]}\n\u003c/pre\u003e\nIf your data includes named references, format each instance as a JSON object\nwith the named references as the keys:\n\nJSON input data to be preprocessed:\n\u003cpre\u003e\n{\n \"instances\": [\n {\n \"a\": 1.0,\n \"b\": true,\n \"c\": \"x\"\n },\n {\n \"a\": -2.0,\n \"b\": false,\n \"c\": \"y\"\n }\n ]\n}\n\u003c/pre\u003e\nSome models have an underlying TensorFlow graph that accepts multiple input\ntensors. In this case, you should use the names of JSON name/value pairs to\nidentify the input tensors, as shown in the following exmaples:\n\nFor a graph with input tensor aliases \"tag\" (string) and \"image\"\n(base64-encoded string):\n\u003cpre\u003e\n{\n \"instances\": [\n {\n \"tag\": \"beach\",\n \"image\": {\"b64\": \"ASa8asdf\"}\n },\n {\n \"tag\": \"car\",\n \"image\": {\"b64\": \"JLK7ljk3\"}\n }\n ]\n}\n\u003c/pre\u003e\nFor a graph with input tensor aliases \"tag\" (string) and \"image\"\n(3-dimensional array of 8-bit ints):\n\u003cpre\u003e\n{\n \"instances\": [\n {\n \"tag\": \"beach\",\n \"image\": [\n [\n [138, 30, 66],\n [130, 20, 56],\n ...\n ],\n [\n [126, 38, 61],\n [122, 24, 57],\n ...\n ],\n ...\n ]\n },\n {\n \"tag\": \"car\",\n \"image\": [\n [\n [255, 0, 102],\n [255, 0, 97],\n ...\n ],\n [\n [254, 1, 101],\n [254, 2, 93],\n ...\n ],\n ...\n ]\n },\n ...\n ]\n}\n\u003c/pre\u003e\nIf the call is successful, the response body will contain one prediction\nentry per instance in the request body. If prediction fails for any\ninstance, the response body will contain no predictions and will contian\na single error entry instead.", + "type": "object", + "properties": { + "httpBody": { + "description": "\nRequired. The prediction request body.", + "$ref": "GoogleApi__HttpBody" + } + } + }, + "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric": { + "description": "An observed value of a metric.", + "type": "object", + "properties": { + "objectiveValue": { + "format": "double", + "description": "The objective value at this training step.", + "type": "number" + }, + "trainingStep": { + "format": "int64", + "description": "The global training step for this metric.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric" + }, + "GoogleCloudMlV1__Version": { + "description": "Represents a version of the model.\n\nEach version is a trained model deployed in the cloud, ready to handle\nprediction requests. A model can have multiple versions. You can get\ninformation about all of the versions of a given model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list).\n\nNext ID: 19\nLINT.IfChange", + "type": "object", + "properties": { + "isDefault": { + "description": "Output only. If true, this version will be used to handle prediction\nrequests that do not specify a version.\n\nYou can change the default version by calling\n[projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault).", + "type": "boolean" + }, + "autoScaling": { + "description": "Automatically scale the number of nodes used to serve the model in\nresponse to increases and decreases in traffic. Care should be\ntaken to ramp up traffic according to the model's ability to scale\nor you will start seeing increases in latency and 429 response codes.", + "$ref": "GoogleCloudMlV1__AutoScaling" + }, + "createTime": { + "format": "google-datetime", + "description": "Output only. The time the version was created.", + "type": "string" + }, + "manualScaling": { + "description": "Manually select the number of nodes to use for serving the\nmodel. You should generally use `auto_scaling` with an appropriate\n`min_nodes` instead, but this option is available if you want more\npredictable billing. Beware that latency and error rates will increase\nif the traffic exceeds that capability of the system to serve it based\non the selected number of nodes.", + "$ref": "GoogleCloudMlV1__ManualScaling" + }, + "state": { + "enum": [ + "UNKNOWN", + "READY", + "CREATING", + "FAILED", + "DELETING" + ], + "description": "Output only. The state of a version.", + "type": "string", + "enumDescriptions": [ + "The version state is unspecified.", + "The version is ready for prediction.", + "The version is in the process of creation.", + "The version failed to be created, possibly cancelled.\n`error_message` should contain the details of the failure.", + "The version is in the process of deletion." + ] + }, + "name": { + "description": "Required.The name specified for the version when it was created.\n\nThe version name must be unique within the model it is created in.", + "type": "string" + }, + "errorMessage": { + "description": "Output only. The details of a failure or a cancellation.", + "type": "string" + }, + "lastUseTime": { + "format": "google-datetime", + "description": "Output only. The time the version was last used for prediction.", + "type": "string" + }, + "runtimeVersion": { + "description": "Optional. The Google Cloud ML runtime version to use for this deployment.\nIf not set, Google Cloud ML will choose a version.", + "type": "string" + }, + "description": { + "description": "Optional. The description specified for the version when it was created.", + "type": "string" + }, + "deploymentUri": { + "description": "Required. The Google Cloud Storage location of the trained model used to\ncreate the version. See the\n[overview of model\ndeployment](/ml-engine/docs/concepts/deployment-overview) for more\ninformation.\n\nWhen passing Version to\n[projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create)\nthe model service uses the specified location as the source of the model.\nOnce deployed, the model version is hosted by the prediction service, so\nthis location is useful only as a historical record.\nThe total number of model files can't exceed 1000.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__Version" + }, + "GoogleCloudMlV1__ParameterSpec": { "description": "Represents a single hyperparameter to optimize.", "type": "object", "properties": { - "minValue": { - "description": "Required if type is `DOUBLE` or `INTEGER`. This field\nshould be unset if type is `CATEGORICAL`. This value should be integers if\ntype is INTEGER.", - "format": "double", - "type": "number" - }, "discreteValues": { "description": "Required if type is `DISCRETE`.\nA list of feasible points.\nThe list should be in strictly increasing order. For instance, this\nparameter might have possible settings of 1.5, 2.5, and 4.0. This list\nshould not contain more than 1,000 values.", - "type": "array", "items": { "format": "double", "type": "number" - } + }, + "type": "array" }, "scaleType": { - "type": "string", - "enumDescriptions": [ - "By default, no scaling is applied.", - "Scales the feasible space to (0, 1) linearly.", - "Scales the feasible space logarithmically to (0, 1). The entire feasible\nspace must be strictly positive.", - "Scales the feasible space \"reverse\" logarithmically to (0, 1). The result\nis that values close to the top of the feasible space are spread out more\nthan points near the bottom. The entire feasible space must be strictly\npositive." - ], "enum": [ "NONE", "UNIT_LINEAR_SCALE", "UNIT_LOG_SCALE", "UNIT_REVERSE_LOG_SCALE" ], - "description": "Optional. How the parameter should be scaled to the hypercube.\nLeave unset for categorical parameters.\nSome kind of scaling is strongly recommended for real or integral\nparameters (e.g., `UNIT_LINEAR_SCALE`)." + "description": "Optional. How the parameter should be scaled to the hypercube.\nLeave unset for categorical parameters.\nSome kind of scaling is strongly recommended for real or integral\nparameters (e.g., `UNIT_LINEAR_SCALE`).", + "type": "string", + "enumDescriptions": [ + "By default, no scaling is applied.", + "Scales the feasible space to (0, 1) linearly.", + "Scales the feasible space logarithmically to (0, 1). The entire feasible\nspace must be strictly positive.", + "Scales the feasible space \"reverse\" logarithmically to (0, 1). The result\nis that values close to the top of the feasible space are spread out more\nthan points near the bottom. The entire feasible space must be strictly\npositive." + ] }, "maxValue": { - "description": "Required if typeis `DOUBLE` or `INTEGER`. This field\nshould be unset if type is `CATEGORICAL`. This value should be integers if\ntype is `INTEGER`.", "format": "double", + "description": "Required if typeis `DOUBLE` or `INTEGER`. This field\nshould be unset if type is `CATEGORICAL`. This value should be integers if\ntype is `INTEGER`.", "type": "number" }, "type": { - "description": "Required. The type of the parameter.", "type": "string", "enumDescriptions": [ "You must specify a valid type. Using this unspecified type will result in\nan error.", @@ -92,417 +223,64 @@ "INTEGER", "CATEGORICAL", "DISCRETE" - ] - }, - "categoricalValues": { - "description": "Required if type is `CATEGORICAL`. The list of possible categories.", - "type": "array", - "items": { - "type": "string" - } + ], + "description": "Required. The type of the parameter." }, "parameterName": { "description": "Required. The parameter name must be unique amongst all ParameterConfigs in\na HyperparameterSpec message. E.g., \"learning_rate\".", "type": "string" - } - }, - "id": "GoogleCloudMlV1beta1__ParameterSpec" - }, - "GoogleCloudMlV1beta1__PredictionOutput": { - "description": "Represents results of a prediction job.", - "type": "object", - "properties": { - "outputPath": { - "description": "The output Google Cloud Storage location provided at the job creation time.", - "type": "string" }, - "nodeHours": { - "description": "Node hours used by the batch prediction job.", - "format": "double", - "type": "number" - }, - "predictionCount": { - "description": "The number of generated predictions.", - "format": "int64", - "type": "string" - }, - "errorCount": { - "description": "The number of data instances which resulted in errors.", - "format": "int64", - "type": "string" - } - }, - "id": "GoogleCloudMlV1beta1__PredictionOutput" - }, - "GoogleCloudMlV1beta1__TrainingOutput": { - "properties": { - "completedTrialCount": { - "description": "The number of hyperparameter tuning trials that completed successfully.\nOnly set for hyperparameter tuning jobs.", - "format": "int64", - "type": "string" - }, - "isHyperparameterTuningJob": { - "description": "Whether this job is a hyperparameter tuning job.", - "type": "boolean" - }, - "consumedMLUnits": { - "description": "The amount of ML units consumed by the job.", - "format": "double", - "type": "number" - }, - "trials": { - "description": "Results for individual Hyperparameter trials.\nOnly set for hyperparameter tuning jobs.", - "type": "array", + "categoricalValues": { + "description": "Required if type is `CATEGORICAL`. The list of possible categories.", "items": { - "$ref": "GoogleCloudMlV1beta1__HyperparameterOutput" - } - } - }, - "id": "GoogleCloudMlV1beta1__TrainingOutput", - "description": "Represents results of a training job. Output only.", - "type": "object" - }, - "GoogleCloudMlV1__Version": { - "description": "Represents a version of the model.\n\nEach version is a trained model deployed in the cloud, ready to handle\nprediction requests. A model can have multiple versions. You can get\ninformation about all of the versions of a given model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list).", - "type": "object", - "properties": { - "description": { - "description": "Optional. The description specified for the version when it was created.", - "type": "string" - }, - "deploymentUri": { - "description": "Required. The Google Cloud Storage location of the trained model used to\ncreate the version. See the\n[overview of model\ndeployment](/ml-engine/docs/concepts/deployment-overview) for more\ninformaiton.\n\nWhen passing Version to\n[projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create)\nthe model service uses the specified location as the source of the model.\nOnce deployed, the model version is hosted by the prediction service, so\nthis location is useful only as a historical record.\nThe total number of model files can't exceed 1000.", - "type": "string" - }, - "isDefault": { - "type": "boolean", - "description": "Output only. If true, this version will be used to handle prediction\nrequests that do not specify a version.\n\nYou can change the default version by calling\n[projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault)." - }, - "createTime": { - "description": "Output only. The time the version was created.", - "format": "google-datetime", - "type": "string" - }, - "manualScaling": { - "$ref": "GoogleCloudMlV1__ManualScaling", - "description": "Optional. Manually select the number of nodes to use for serving the\nmodel. If unset (i.e., by default), the number of nodes used to serve\nthe model automatically scales with traffic. However, care should be\ntaken to ramp up traffic according to the model's ability to scale. If\nyour model needs to handle bursts of traffic beyond it's ability to\nscale, it is recommended you set this field appropriately." - }, - "name": { - "description": "Required.The name specified for the version when it was created.\n\nThe version name must be unique within the model it is created in.", - "type": "string" - }, - "lastUseTime": { - "type": "string", - "description": "Output only. The time the version was last used for prediction.", - "format": "google-datetime" - }, - "runtimeVersion": { - "description": "Optional. The Google Cloud ML runtime version to use for this deployment.\nIf not set, Google Cloud ML will choose a version.", - "type": "string" - } - }, - "id": "GoogleCloudMlV1__Version" - }, - "GoogleCloudMlV1beta1__HyperparameterSpec": { - "description": "Represents a set of hyperparameters to optimize.", - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "$ref": "GoogleCloudMlV1beta1__ParameterSpec" - }, - "description": "Required. The set of parameters to tune." - }, - "maxTrials": { - "description": "Optional. How many training trials should be attempted to optimize\nthe specified hyperparameters.\n\nDefaults to one.", - "format": "int32", - "type": "integer" - }, - "maxParallelTrials": { - "description": "Optional. The number of training trials to run concurrently.\nYou can reduce the time it takes to perform hyperparameter tuning by adding\ntrials in parallel. However, each trail only benefits from the information\ngained in completed trials. That means that a trial does not get access to\nthe results of trials running at the same time, which could reduce the\nquality of the overall optimization.\n\nEach trial will use the same scale tier and machine types.\n\nDefaults to one.", - "format": "int32", - "type": "integer" - }, - "goal": { - "description": "Required. The type of goal to use for tuning. Available types are\n`MAXIMIZE` and `MINIMIZE`.\n\nDefaults to `MAXIMIZE`.", - "type": "string", - "enumDescriptions": [ - "Goal Type will default to maximize.", - "Maximize the goal metric.", - "Minimize the goal metric." - ], - "enum": [ - "GOAL_TYPE_UNSPECIFIED", - "MAXIMIZE", - "MINIMIZE" - ] - }, - "hyperparameterMetricTag": { - "description": "Optional. The Tensorflow summary tag name to use for optimizing trials. For\ncurrent versions of Tensorflow, this tag name should exactly match what is\nshown in Tensorboard, including all scopes. For versions of Tensorflow\nprior to 0.12, this should be only the tag passed to tf.Summary.\nBy default, \"training/hptuning/metric\" will be used.", - "type": "string" - } - }, - "id": "GoogleCloudMlV1beta1__HyperparameterSpec" - }, - "GoogleCloudMlV1beta1__OperationMetadata": { - "description": "Represents the metadata of the long-running operation.", - "type": "object", - "properties": { - "createTime": { - "description": "The time the operation was submitted.", - "format": "google-datetime", - "type": "string" - }, - "modelName": { - "description": "Contains the name of the model associated with the operation.", - "type": "string" - }, - "version": { - "$ref": "GoogleCloudMlV1beta1__Version", - "description": "Contains the version associated with the operation." - }, - "endTime": { - "type": "string", - "description": "The time operation processing completed.", - "format": "google-datetime" - }, - "operationType": { - "enumDescriptions": [ - "Unspecified operation type.", - "An operation to create a new version.", - "An operation to delete an existing version.", - "An operation to delete an existing model." - ], - "enum": [ - "OPERATION_TYPE_UNSPECIFIED", - "CREATE_VERSION", - "DELETE_VERSION", - "DELETE_MODEL" - ], - "description": "The operation type.", - "type": "string" - }, - "startTime": { - "description": "The time operation processing started.", - "format": "google-datetime", - "type": "string" - }, - "isCancellationRequested": { - "description": "Indicates whether a request to cancel this operation has been made.", - "type": "boolean" - } - }, - "id": "GoogleCloudMlV1beta1__OperationMetadata" - }, - "GoogleCloudMlV1__OperationMetadata": { - "description": "Represents the metadata of the long-running operation.", - "type": "object", - "properties": { - "createTime": { - "description": "The time the operation was submitted.", - "format": "google-datetime", - "type": "string" - }, - "modelName": { - "description": "Contains the name of the model associated with the operation.", - "type": "string" - }, - "version": { - "$ref": "GoogleCloudMlV1__Version", - "description": "Contains the version associated with the operation." - }, - "endTime": { - "description": "The time operation processing completed.", - "format": "google-datetime", - "type": "string" - }, - "operationType": { - "enumDescriptions": [ - "Unspecified operation type.", - "An operation to create a new version.", - "An operation to delete an existing version.", - "An operation to delete an existing model." - ], - "enum": [ - "OPERATION_TYPE_UNSPECIFIED", - "CREATE_VERSION", - "DELETE_VERSION", - "DELETE_MODEL" - ], - "description": "The operation type.", - "type": "string" - }, - "startTime": { - "description": "The time operation processing started.", - "format": "google-datetime", - "type": "string" - }, - "isCancellationRequested": { - "type": "boolean", - "description": "Indicates whether a request to cancel this operation has been made." - } - }, - "id": "GoogleCloudMlV1__OperationMetadata" - }, - "GoogleCloudMlV1beta1__ListModelsResponse": { - "properties": { - "models": { - "description": "The list of models.", - "type": "array", - "items": { - "$ref": "GoogleCloudMlV1beta1__Model" - } - }, - "nextPageToken": { - "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", - "type": "string" - } - }, - "id": "GoogleCloudMlV1beta1__ListModelsResponse", - "description": "Response message for the ListModels method.", - "type": "object" - }, - "GoogleLongrunning__Operation": { - "id": "GoogleLongrunning__Operation", - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", - "type": "object", - "properties": { - "metadata": { - "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", - "type": "boolean" - }, - "response": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", - "type": "object" - }, - "name": { - "type": "string", - "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`." - }, - "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "$ref": "GoogleRpc__Status" - } - } - }, - "GoogleCloudMlV1beta1__HyperparameterOutput": { - "id": "GoogleCloudMlV1beta1__HyperparameterOutput", - "description": "Represents the result of a single hyperparameter tuning trial from a\ntraining job. The TrainingOutput object that is returned on successful\ncompletion of a training job with hyperparameter tuning includes a list\nof HyperparameterOutput objects, one for each successful trial.", - "type": "object", - "properties": { - "allMetrics": { - "type": "array", - "items": { - "$ref": "GoogleCloudMlV1beta1_HyperparameterOutput_HyperparameterMetric" - }, - "description": "All recorded object metrics for this trial." - }, - "finalMetric": { - "description": "The final objective metric seen for this trial.", - "$ref": "GoogleCloudMlV1beta1_HyperparameterOutput_HyperparameterMetric" - }, - "hyperparameters": { - "additionalProperties": { "type": "string" }, - "description": "The hyperparameters given to this trial.", - "type": "object" + "type": "array" }, - "trialId": { - "type": "string", - "description": "The trial id for these results." - } - } - }, - "GoogleProtobuf__Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "GoogleProtobuf__Empty" - }, - "GoogleCloudMlV1beta1__ManualScaling": { - "description": "Options for manually scaling a model.", - "type": "object", - "properties": { - "nodes": { - "description": "The number of nodes to allocate for this model. These nodes are always up,\nstarting from the time the model is deployed, so the cost of operating\nthis model will be proportional to nodes * number of hours since\ndeployment.", - "format": "int32", - "type": "integer" + "minValue": { + "format": "double", + "description": "Required if type is `DOUBLE` or `INTEGER`. This field\nshould be unset if type is `CATEGORICAL`. This value should be integers if\ntype is INTEGER.", + "type": "number" } }, - "id": "GoogleCloudMlV1beta1__ManualScaling" + "id": "GoogleCloudMlV1__ParameterSpec" }, - "GoogleRpc__Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - } - }, - "id": "GoogleRpc__Status" - }, - "GoogleCloudMlV1beta1__PredictRequest": { - "type": "object", - "properties": { - "httpBody": { - "$ref": "GoogleApi__HttpBody", - "description": "\nRequired. The prediction request body." - } - }, - "id": "GoogleCloudMlV1beta1__PredictRequest", - "description": "Request for predictions to be issued against a trained model.\n\nThe body of the request is a single JSON object with a single top-level\nfield:\n\n\u003cdl\u003e\n \u003cdt\u003einstances\u003c/dt\u003e\n \u003cdd\u003eA JSON array containing values representing the instances to use for\n prediction.\u003c/dd\u003e\n\u003c/dl\u003e\n\nThe structure of each element of the instances list is determined by your\nmodel's input definition. Instances can include named inputs or can contain\nonly unlabeled values.\n\nNot all data includes named inputs. Some instances will be simple\nJSON values (boolean, number, or string). However, instances are often lists\nof simple values, or complex nested lists. Here are some examples of request\nbodies:\n\nCSV data with each row encoded as a string value:\n\u003cpre\u003e\n{\"instances\": [\"1.0,true,\\\\\"x\\\\\"\", \"-2.0,false,\\\\\"y\\\\\"\"]}\n\u003c/pre\u003e\nPlain text:\n\u003cpre\u003e\n{\"instances\": [\"the quick brown fox\", \"la bruja le dio\"]}\n\u003c/pre\u003e\nSentences encoded as lists of words (vectors of strings):\n\u003cpre\u003e\n{\n \"instances\": [\n [\"the\",\"quick\",\"brown\"],\n [\"la\",\"bruja\",\"le\"],\n ...\n ]\n}\n\u003c/pre\u003e\nFloating point scalar values:\n\u003cpre\u003e\n{\"instances\": [0.0, 1.1, 2.2]}\n\u003c/pre\u003e\nVectors of integers:\n\u003cpre\u003e\n{\n \"instances\": [\n [0, 1, 2],\n [3, 4, 5],\n ...\n ]\n}\n\u003c/pre\u003e\nTensors (in this case, two-dimensional tensors):\n\u003cpre\u003e\n{\n \"instances\": [\n [\n [0, 1, 2],\n [3, 4, 5]\n ],\n ...\n ]\n}\n\u003c/pre\u003e\nImages can be represented different ways. In this encoding scheme the first\ntwo dimensions represent the rows and columns of the image, and the third\ncontains lists (vectors) of the R, G, and B values for each pixel.\n\u003cpre\u003e\n{\n \"instances\": [\n [\n [\n [138, 30, 66],\n [130, 20, 56],\n ...\n ],\n [\n [126, 38, 61],\n [122, 24, 57],\n ...\n ],\n ...\n ],\n ...\n ]\n}\n\u003c/pre\u003e\nJSON strings must be encoded as UTF-8. To send binary data, you must\nbase64-encode the data and mark it as binary. To mark a JSON string\nas binary, replace it with a JSON object with a single attribute named `b64`:\n\u003cpre\u003e{\"b64\": \"...\"} \u003c/pre\u003e\nFor example:\n\nTwo Serialized tf.Examples (fake data, for illustrative purposes only):\n\u003cpre\u003e\n{\"instances\": [{\"b64\": \"X5ad6u\"}, {\"b64\": \"IA9j4nx\"}]}\n\u003c/pre\u003e\nTwo JPEG image byte strings (fake data, for illustrative purposes only):\n\u003cpre\u003e\n{\"instances\": [{\"b64\": \"ASa8asdf\"}, {\"b64\": \"JLK7ljk3\"}]}\n\u003c/pre\u003e\nIf your data includes named references, format each instance as a JSON object\nwith the named references as the keys:\n\nJSON input data to be preprocessed:\n\u003cpre\u003e\n{\n \"instances\": [\n {\n \"a\": 1.0,\n \"b\": true,\n \"c\": \"x\"\n },\n {\n \"a\": -2.0,\n \"b\": false,\n \"c\": \"y\"\n }\n ]\n}\n\u003c/pre\u003e\nSome models have an underlying TensorFlow graph that accepts multiple input\ntensors. In this case, you should use the names of JSON name/value pairs to\nidentify the input tensors, as shown in the following exmaples:\n\nFor a graph with input tensor aliases \"tag\" (string) and \"image\"\n(base64-encoded string):\n\u003cpre\u003e\n{\n \"instances\": [\n {\n \"tag\": \"beach\",\n \"image\": {\"b64\": \"ASa8asdf\"}\n },\n {\n \"tag\": \"car\",\n \"image\": {\"b64\": \"JLK7ljk3\"}\n }\n ]\n}\n\u003c/pre\u003e\nFor a graph with input tensor aliases \"tag\" (string) and \"image\"\n(3-dimensional array of 8-bit ints):\n\u003cpre\u003e\n{\n \"instances\": [\n {\n \"tag\": \"beach\",\n \"image\": [\n [\n [138, 30, 66],\n [130, 20, 56],\n ...\n ],\n [\n [126, 38, 61],\n [122, 24, 57],\n ...\n ],\n ...\n ]\n },\n {\n \"tag\": \"car\",\n \"image\": [\n [\n [255, 0, 102],\n [255, 0, 97],\n ...\n ],\n [\n [254, 1, 101],\n [254, 2, 93],\n ...\n ],\n ...\n ]\n },\n ...\n ]\n}\n\u003c/pre\u003e\nIf the call is successful, the response body will contain one prediction\nentry per instance in the request body. If prediction fails for any\ninstance, the response body will contain no predictions and will contian\na single error entry instead." - }, - "GoogleApi__HttpBody": { - "type": "object", - "properties": { - "data": { - "description": "HTTP body binary data.", - "format": "byte", - "type": "string" - }, - "contentType": { - "description": "The HTTP Content-Type string representing the content type of the body.", - "type": "string" - } - }, - "id": "GoogleApi__HttpBody", - "description": "Message that represents an arbitrary HTTP body. It should only be used for\npayload formats that can't be represented as JSON, such as raw binary or\nan HTML page.\n\n\nThis message can be used both in streaming and non-streaming API methods in\nthe request as well as the response.\n\nIt can be used as a top-level request field, which is convenient if one\nwants to extract parameters from either the URL or HTTP template into the\nrequest fields and also want access to the raw HTTP body.\n\nExample:\n\n message GetResourceRequest {\n // A unique request id.\n string request_id = 1;\n\n // The raw HTTP body is bound to this field.\n google.api.HttpBody http_body = 2;\n }\n\n service ResourceService {\n rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);\n rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty);\n }\n\nExample with streaming methods:\n\n service CaldavService {\n rpc GetCalendar(stream google.api.HttpBody)\n returns (stream google.api.HttpBody);\n rpc UpdateCalendar(stream google.api.HttpBody)\n returns (stream google.api.HttpBody);\n }\n\nUse of this type only changes how the request and response bodies are\nhandled, all other features will continue to work unchanged." - }, - "GoogleCloudMlV1beta1__PredictionInput": { + "GoogleCloudMlV1__PredictionInput": { "description": "Represents input parameters for a prediction job.", "type": "object", "properties": { + "dataFormat": { + "enumDescriptions": [ + "Unspecified format.", + "The source file is a text file with instances separated by the\nnew-line character.", + "The source file is a TFRecord file.", + "The source file is a GZIP-compressed TFRecord file." + ], + "enum": [ + "DATA_FORMAT_UNSPECIFIED", + "TEXT", + "TF_RECORD", + "TF_RECORD_GZIP" + ], + "description": "Required. The format of the input data files.", + "type": "string" + }, + "runtimeVersion": { + "description": "Optional. The Google Cloud ML runtime version to use for this batch\nprediction. If not set, Google Cloud ML will pick the runtime version used\nduring the CreateVersion request for this model version, or choose the\nlatest stable version when model version information is not available\nsuch as when the model is specified by uri.", + "type": "string" + }, + "batchSize": { + "format": "int64", + "description": "Optional. Number of records per batch, defaults to 64.\nThe service will buffer batch_size number of records in memory before\ninvoking one Tensorflow prediction call internally. So take the record\nsize and memory available into consideration when setting this parameter.", + "type": "string" + }, + "inputPaths": { + "description": "Required. The Google Cloud Storage location of the input data files.\nMay contain wildcards.", + "items": { + "type": "string" + }, + "type": "array" + }, "region": { "description": "Required. The Google Compute Engine region to run the prediction job in.", "type": "string" @@ -519,137 +297,264 @@ "description": "Required. The output Google Cloud Storage location.", "type": "string" }, - "maxWorkerCount": { - "description": "Optional. The maximum number of workers to be used for parallel processing.\nDefaults to 10 if not specified.", - "format": "int64", - "type": "string" - }, "uri": { "description": "Use this field if you want to specify a Google Cloud Storage path for\nthe model to use.", "type": "string" }, - "dataFormat": { - "description": "Required. The format of the input data files.", - "type": "string", - "enumDescriptions": [ - "Unspecified format.", - "The source file is a text file with instances separated by the\nnew-line character.", - "The source file is a TFRecord file.", - "The source file is a GZIP-compressed TFRecord file." - ], - "enum": [ - "DATA_FORMAT_UNSPECIFIED", - "TEXT", - "TF_RECORD", - "TF_RECORD_GZIP" - ] - }, - "runtimeVersion": { - "description": "Optional. The Google Cloud ML runtime version to use for this batch\nprediction. If not set, Google Cloud ML will pick the runtime version used\nduring the CreateVersion request for this model version, or choose the\nlatest stable version when model version information is not available\nsuch as when the model is specified by uri.", + "maxWorkerCount": { + "format": "int64", + "description": "Optional. The maximum number of workers to be used for parallel processing.\nDefaults to 10 if not specified.", "type": "string" - }, - "inputPaths": { - "description": "Required. The Google Cloud Storage location of the input data files.\nMay contain wildcards.", - "type": "array", - "items": { - "type": "string" - } } }, - "id": "GoogleCloudMlV1beta1__PredictionInput" + "id": "GoogleCloudMlV1__PredictionInput" }, - "GoogleCloudMlV1beta1__ListVersionsResponse": { - "description": "Response message for the ListVersions method.", + "GoogleType__Expr": { + "description": "Represents an expression text. Example:\n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\"", "type": "object", "properties": { - "versions": { - "description": "The list of versions.", - "type": "array", - "items": { - "$ref": "GoogleCloudMlV1beta1__Version" - } - }, - "nextPageToken": { - "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", - "type": "string" - } - }, - "id": "GoogleCloudMlV1beta1__ListVersionsResponse" - }, - "GoogleCloudMlV1beta1__Version": { - "properties": { - "lastUseTime": { - "description": "Output only. The time the version was last used for prediction.", - "format": "google-datetime", - "type": "string" - }, - "runtimeVersion": { - "description": "Optional. The Google Cloud ML runtime version to use for this deployment.\nIf not set, Google Cloud ML will choose a version.", - "type": "string" - }, "description": { - "description": "Optional. The description specified for the version when it was created.", + "description": "An optional description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI.", "type": "string" }, - "deploymentUri": { - "description": "Required. The Google Cloud Storage location of the trained model used to\ncreate the version. See the\n[overview of model\ndeployment](/ml-engine/docs/concepts/deployment-overview) for more\ninformaiton.\n\nWhen passing Version to\n[projects.models.versions.create](/ml-engine/reference/rest/v1beta1/projects.models.versions/create)\nthe model service uses the specified location as the source of the model.\nOnce deployed, the model version is hosted by the prediction service, so\nthis location is useful only as a historical record.\nThe total number of model files can't exceed 1000.", + "expression": { + "description": "Textual representation of an expression in\nCommon Expression Language syntax.\n\nThe application context of the containing message determines which\nwell-known feature set of CEL is supported.", "type": "string" }, - "isDefault": { - "type": "boolean", - "description": "Output only. If true, this version will be used to handle prediction\nrequests that do not specify a version.\n\nYou can change the default version by calling\n[projects.methods.versions.setDefault](/ml-engine/reference/rest/v1beta1/projects.models.versions/setDefault)." - }, - "createTime": { - "description": "Output only. The time the version was created.", - "format": "google-datetime", + "location": { + "description": "An optional string indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file.", "type": "string" }, - "manualScaling": { - "$ref": "GoogleCloudMlV1beta1__ManualScaling", - "description": "Optional. Manually select the number of nodes to use for serving the\nmodel. If unset (i.e., by default), the number of nodes used to serve\nthe model automatically scales with traffic. However, care should be\ntaken to ramp up traffic according to the model's ability to scale. If\nyour model needs to handle bursts of traffic beyond it's ability to\nscale, it is recommended you set this field appropriately." - }, - "name": { - "description": "Required.The name specified for the version when it was created.\n\nThe version name must be unique within the model it is created in.", + "title": { + "description": "An optional title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.", "type": "string" } }, - "id": "GoogleCloudMlV1beta1__Version", - "description": "Represents a version of the model.\n\nEach version is a trained model deployed in the cloud, ready to handle\nprediction requests. A model can have multiple versions. You can get\ninformation about all of the versions of a given model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list).", - "type": "object" + "id": "GoogleType__Expr" }, - "GoogleCloudMlV1beta1__ListJobsResponse": { + "GoogleIamV1__AuditLogConfig": { + "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", + "type": "object", + "properties": { + "logType": { + "enum": [ + "LOG_TYPE_UNSPECIFIED", + "ADMIN_READ", + "DATA_WRITE", + "DATA_READ" + ], + "description": "The log type that this config enables.", + "type": "string", + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ] + }, + "exemptedMembers": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members." + } + }, + "id": "GoogleIamV1__AuditLogConfig" + }, + "GoogleCloudMlV1__OperationMetadata": { + "description": "Represents the metadata of the long-running operation.\n\nNext ID: 9", + "type": "object", + "properties": { + "createTime": { + "format": "google-datetime", + "description": "The time the operation was submitted.", + "type": "string" + }, + "modelName": { + "description": "Contains the name of the model associated with the operation.", + "type": "string" + }, + "version": { + "description": "Contains the version associated with the operation.", + "$ref": "GoogleCloudMlV1__Version" + }, + "endTime": { + "format": "google-datetime", + "description": "The time operation processing completed.", + "type": "string" + }, + "operationType": { + "type": "string", + "enumDescriptions": [ + "Unspecified operation type.", + "An operation to create a new version.", + "An operation to delete an existing version.", + "An operation to delete an existing model.", + "An operation to update an existing model.", + "An operation to update an existing version." + ], + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "CREATE_VERSION", + "DELETE_VERSION", + "DELETE_MODEL", + "UPDATE_MODEL", + "UPDATE_VERSION" + ], + "description": "The operation type." + }, + "startTime": { + "format": "google-datetime", + "description": "The time operation processing started.", + "type": "string" + }, + "isCancellationRequested": { + "type": "boolean", + "description": "Indicates whether a request to cancel this operation has been made." + } + }, + "id": "GoogleCloudMlV1__OperationMetadata" + }, + "GoogleCloudMlV1__HyperparameterSpec": { + "description": "Represents a set of hyperparameters to optimize.", + "type": "object", + "properties": { + "maxTrials": { + "format": "int32", + "description": "Optional. How many training trials should be attempted to optimize\nthe specified hyperparameters.\n\nDefaults to one.", + "type": "integer" + }, + "params": { + "description": "Required. The set of parameters to tune.", + "items": { + "$ref": "GoogleCloudMlV1__ParameterSpec" + }, + "type": "array" + }, + "maxParallelTrials": { + "format": "int32", + "description": "Optional. The number of training trials to run concurrently.\nYou can reduce the time it takes to perform hyperparameter tuning by adding\ntrials in parallel. However, each trail only benefits from the information\ngained in completed trials. That means that a trial does not get access to\nthe results of trials running at the same time, which could reduce the\nquality of the overall optimization.\n\nEach trial will use the same scale tier and machine types.\n\nDefaults to one.", + "type": "integer" + }, + "hyperparameterMetricTag": { + "description": "Optional. The Tensorflow summary tag name to use for optimizing trials. For\ncurrent versions of Tensorflow, this tag name should exactly match what is\nshown in Tensorboard, including all scopes. For versions of Tensorflow\nprior to 0.12, this should be only the tag passed to tf.Summary.\nBy default, \"training/hptuning/metric\" will be used.", + "type": "string" + }, + "goal": { + "description": "Required. The type of goal to use for tuning. Available types are\n`MAXIMIZE` and `MINIMIZE`.\n\nDefaults to `MAXIMIZE`.", + "type": "string", + "enumDescriptions": [ + "Goal Type will default to maximize.", + "Maximize the goal metric.", + "Minimize the goal metric." + ], + "enum": [ + "GOAL_TYPE_UNSPECIFIED", + "MAXIMIZE", + "MINIMIZE" + ] + } + }, + "id": "GoogleCloudMlV1__HyperparameterSpec" + }, + "GoogleCloudMlV1__ListJobsResponse": { "description": "Response message for the ListJobs method.", "type": "object", "properties": { "jobs": { "description": "The list of jobs.", - "type": "array", "items": { - "$ref": "GoogleCloudMlV1beta1__Job" - } + "$ref": "GoogleCloudMlV1__Job" + }, + "type": "array" }, "nextPageToken": { "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", "type": "string" } }, - "id": "GoogleCloudMlV1beta1__ListJobsResponse" + "id": "GoogleCloudMlV1__ListJobsResponse" }, - "GoogleCloudMlV1beta1__CancelJobRequest": { - "description": "Request message for the CancelJob method.", + "GoogleCloudMlV1__SetDefaultVersionRequest": { + "description": "Request message for the SetDefaultVersion request.", "type": "object", "properties": {}, - "id": "GoogleCloudMlV1beta1__CancelJobRequest" + "id": "GoogleCloudMlV1__SetDefaultVersionRequest" }, - "GoogleCloudMlV1beta1__Model": { + "GoogleLongrunning__Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { - "regions": { - "description": "Optional. The list of regions where the model is going to be deployed.\nCurrently only one region per model is supported.\nDefaults to 'us-central1' if nothing is set.\nNote:\n* No matter where a model is deployed, it can always be accessed by\n users from anywhere, both for online and batch prediction.\n* The region for a batch prediction job is set by the region field when\n submitting the batch prediction job and does not take its value from\n this field.", - "type": "array", + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "GoogleRpc__Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable." + } + }, + "id": "GoogleLongrunning__Operation" + }, + "GoogleIamV1__AuditConfig": { + "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", + "type": "object", + "properties": { + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.\nNext ID: 4", + "items": { + "$ref": "GoogleIamV1__AuditLogConfig" + }, + "type": "array" + }, + "exemptedMembers": { "items": { "type": "string" - } + }, + "type": "array" + }, + "service": { + "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services.", + "type": "string" + } + }, + "id": "GoogleIamV1__AuditConfig" + }, + "GoogleCloudMlV1__Model": { + "description": "Represents a machine learning solution.\n\nA model can have multiple versions, each of which is a deployed, trained\nmodel ready to receive prediction requests. The model itself is just a\ncontainer.\n\nNext ID: 8", + "type": "object", + "properties": { + "defaultVersion": { + "description": "Output only. The default version of the model. This version will be used to\nhandle prediction requests that do not specify a version.\n\nYou can change the default version by calling\n[projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault).", + "$ref": "GoogleCloudMlV1__Version" + }, + "regions": { + "description": "Optional. The list of regions where the model is going to be deployed.\nCurrently only one region per model is supported.\nDefaults to 'us-central1' if nothing is set.\nNote:\n* No matter where a model is deployed, it can always be accessed by\n users from anywhere, both for online and batch prediction.\n* The region for a batch prediction job is set by the region field when\n submitting the batch prediction job and does not take its value from\n this field.", + "items": { + "type": "string" + }, + "type": "array" }, "name": { "description": "Required. The name specified for the model when it was created.\n\nThe model name must be unique within the project it is created in.", @@ -662,66 +567,236 @@ "onlinePredictionLogging": { "description": "Optional. If true, enables StackDriver Logging for online prediction.\nDefault is false.", "type": "boolean" - }, - "defaultVersion": { - "description": "Output only. The default version of the model. This version will be used to\nhandle prediction requests that do not specify a version.\n\nYou can change the default version by calling\n[projects.methods.versions.setDefault](/ml-engine/reference/rest/v1beta1/projects.models.versions/setDefault).", - "$ref": "GoogleCloudMlV1beta1__Version" } }, - "id": "GoogleCloudMlV1beta1__Model", - "description": "Represents a machine learning solution.\n\nA model can have multiple versions, each of which is a deployed, trained\nmodel ready to receive prediction requests. The model itself is just a\ncontainer." + "id": "GoogleCloudMlV1__Model" }, - "GoogleCloudMlV1beta1__Job": { - "id": "GoogleCloudMlV1beta1__Job", - "description": "Represents a training or prediction job.", + "GoogleProtobuf__Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "GoogleProtobuf__Empty" + }, + "GoogleIamV1__TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", "type": "object", "properties": { - "errorMessage": { - "description": "Output only. The details of a failure or a cancellation.", + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "GoogleIamV1__TestIamPermissionsRequest" + }, + "GoogleCloudMlV1__CancelJobRequest": { + "description": "Request message for the CancelJob method.", + "type": "object", + "properties": {}, + "id": "GoogleCloudMlV1__CancelJobRequest" + }, + "GoogleCloudMlV1__ListVersionsResponse": { + "description": "Response message for the ListVersions method.", + "type": "object", + "properties": { + "versions": { + "description": "The list of versions.", + "items": { + "$ref": "GoogleCloudMlV1__Version" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__ListVersionsResponse" + }, + "GoogleRpc__Status": { + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", "type": "string" }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + } + }, + "id": "GoogleRpc__Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons." + }, + "GoogleCloudMlV1__AutoScaling": { + "description": "Options for automatically scaling a model.", + "type": "object", + "properties": { + "minNodes": { + "format": "int32", + "description": "Optional. The minimum number of nodes to allocate for this model. These\nnodes are always up, starting from the time the model is deployed, so the\ncost of operating this model will be at least\n`rate` * `min_nodes` * number of hours since last billing cycle,\nwhere `rate` is the cost per node-hour as documented in\n[pricing](https://cloud.google.com/ml-engine/pricing#prediction_pricing),\neven if no predictions are performed. There is additional cost for each\nprediction performed.\n\nUnlike manual scaling, if the load gets too heavy for the nodes\nthat are up, the service will automatically add nodes to handle the\nincreased load as well as scale back as traffic drops, always maintaining\nat least `min_nodes`. You will be charged for the time in which additional\nnodes are used.\n\nIf not specified, `min_nodes` defaults to 0, in which case, when traffic\nto a model stops (and after a cool-down period), nodes will be shut down\nand no charges will be incurred until traffic to the model resumes.", + "type": "integer" + } + }, + "id": "GoogleCloudMlV1__AutoScaling" + }, + "GoogleCloudMlV1__ListModelsResponse": { + "description": "Response message for the ListModels method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", + "type": "string" + }, + "models": { + "description": "The list of models.", + "items": { + "$ref": "GoogleCloudMlV1__Model" + }, + "type": "array" + } + }, + "id": "GoogleCloudMlV1__ListModelsResponse" + }, + "GoogleCloudMlV1__TrainingInput": { + "description": "Represents input parameters for a training job.", + "type": "object", + "properties": { + "runtimeVersion": { + "description": "Optional. The Google Cloud ML runtime version to use for training. If not\nset, Google Cloud ML will choose the latest stable version.", + "type": "string" + }, + "pythonModule": { + "description": "Required. The Python module name to run after installing the packages.", + "type": "string" + }, + "workerType": { + "description": "Optional. Specifies the type of virtual machine to use for your training\njob's worker nodes.\n\nThe supported values are the same as those described in the entry for\n`masterType`.\n\nThis value must be present when `scaleTier` is set to `CUSTOM` and\n`workerCount` is greater than zero.", + "type": "string" + }, + "args": { + "description": "Optional. Command line arguments to pass to the program.", + "items": { + "type": "string" + }, + "type": "array" + }, + "region": { + "description": "Required. The Google Compute Engine region to run the training job in.", + "type": "string" + }, + "parameterServerType": { + "type": "string", + "description": "Optional. Specifies the type of virtual machine to use for your training\njob's parameter server.\n\nThe supported values are the same as those described in the entry for\n`master_type`.\n\nThis value must be present when `scaleTier` is set to `CUSTOM` and\n`parameter_server_count` is greater than zero." + }, + "scaleTier": { + "enum": [ + "BASIC", + "STANDARD_1", + "PREMIUM_1", + "BASIC_GPU", + "BASIC_TPU", + "CUSTOM" + ], + "description": "Required. Specifies the machine types, the number of replicas for workers\nand parameter servers.", + "type": "string", + "enumDescriptions": [ + "A single worker instance. This tier is suitable for learning how to use\nCloud ML, and for experimenting with new models using small datasets.", + "Many workers and a few parameter servers.", + "A large number of workers with many parameter servers.", + "A single worker instance [with a\nGPU](/ml-engine/docs/how-tos/using-gpus).", + "A single worker instance with a [Cloud TPU](/tpu)", + "The CUSTOM tier is not a set tier, but rather enables you to use your\nown cluster specification. When you use this tier, set values to\nconfigure your processing cluster according to these guidelines:\n\n* You _must_ set `TrainingInput.masterType` to specify the type\n of machine to use for your master node. This is the only required\n setting.\n\n* You _may_ set `TrainingInput.workerCount` to specify the number of\n workers to use. If you specify one or more workers, you _must_ also\n set `TrainingInput.workerType` to specify the type of machine to use\n for your worker nodes.\n\n* You _may_ set `TrainingInput.parameterServerCount` to specify the\n number of parameter servers to use. If you specify one or more\n parameter servers, you _must_ also set\n `TrainingInput.parameterServerType` to specify the type of machine to\n use for your parameter servers.\n\nNote that all of your workers must use the same machine type, which can\nbe different from your parameter server type and master type. Your\nparameter servers must likewise use the same machine type, which can be\ndifferent from your worker type and master type." + ] + }, + "jobDir": { + "description": "Optional. A Google Cloud Storage path in which to store training outputs\nand other data needed for training. This path is passed to your TensorFlow\nprogram as the 'job_dir' command-line argument. The benefit of specifying\nthis field is that Cloud ML validates the path for use in training.", + "type": "string" + }, + "hyperparameters": { + "$ref": "GoogleCloudMlV1__HyperparameterSpec", + "description": "Optional. The set of Hyperparameters to tune." + }, + "parameterServerCount": { + "format": "int64", + "description": "Optional. The number of parameter server replicas to use for the training\njob. Each replica in the cluster will be of the type specified in\n`parameter_server_type`.\n\nThis value can only be used when `scale_tier` is set to `CUSTOM`.If you\nset this value, you must also set `parameter_server_type`.", + "type": "string" + }, + "packageUris": { + "description": "Required. The Google Cloud Storage location of the packages with\nthe training program and any additional dependencies.\nThe maximum number of package URIs is 100.", + "items": { + "type": "string" + }, + "type": "array" + }, + "workerCount": { + "format": "int64", + "description": "Optional. The number of worker replicas to use for the training job. Each\nreplica in the cluster will be of the type specified in `worker_type`.\n\nThis value can only be used when `scale_tier` is set to `CUSTOM`. If you\nset this value, you must also set `worker_type`.", + "type": "string" + }, + "masterType": { + "description": "Optional. Specifies the type of virtual machine to use for your training\njob's master worker.\n\nThe following types are supported:\n\n\u003cdl\u003e\n \u003cdt\u003estandard\u003c/dt\u003e\n \u003cdd\u003e\n A basic machine configuration suitable for training simple models with\n small to moderate datasets.\n \u003c/dd\u003e\n \u003cdt\u003elarge_model\u003c/dt\u003e\n \u003cdd\u003e\n A machine with a lot of memory, specially suited for parameter servers\n when your model is large (having many hidden layers or layers with very\n large numbers of nodes).\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_s\u003c/dt\u003e\n \u003cdd\u003e\n A machine suitable for the master and workers of the cluster when your\n model requires more computation than the standard machine can handle\n satisfactorily.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_m\u003c/dt\u003e\n \u003cdd\u003e\n A machine with roughly twice the number of cores and roughly double the\n memory of \u003ccode suppresswarning=\"true\"\u003ecomplex_model_s\u003c/code\u003e.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_l\u003c/dt\u003e\n \u003cdd\u003e\n A machine with roughly twice the number of cores and roughly double the\n memory of \u003ccode suppresswarning=\"true\"\u003ecomplex_model_m\u003c/code\u003e.\n \u003c/dd\u003e\n \u003cdt\u003estandard_gpu\u003c/dt\u003e\n \u003cdd\u003e\n A machine equivalent to \u003ccode suppresswarning=\"true\"\u003estandard\u003c/code\u003e that\n also includes a\n \u003ca href=\"/ml-engine/docs/how-tos/using-gpus\"\u003e\n GPU that you can use in your trainer\u003c/a\u003e.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_m_gpu\u003c/dt\u003e\n \u003cdd\u003e\n A machine equivalent to\n \u003ccode suppresswarning=\"true\"\u003ecomplex_model_m\u003c/code\u003e that also includes\n four GPUs.\n \u003c/dd\u003e\n\u003c/dl\u003e\n\nYou must set this value when `scaleTier` is set to `CUSTOM`.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__TrainingInput" + }, + "GoogleCloudMlV1__Job": { + "properties": { "jobId": { "description": "Required. The user-specified id of the job.", "type": "string" }, + "errorMessage": { + "description": "Output only. The details of a failure or a cancellation.", + "type": "string" + }, "endTime": { - "description": "Output only. When the job processing was completed.", "format": "google-datetime", + "description": "Output only. When the job processing was completed.", "type": "string" }, "startTime": { - "type": "string", + "format": "google-datetime", "description": "Output only. When the job processing was started.", - "format": "google-datetime" + "type": "string" }, "predictionOutput": { - "$ref": "GoogleCloudMlV1beta1__PredictionOutput", + "$ref": "GoogleCloudMlV1__PredictionOutput", "description": "The current prediction job result." }, "trainingOutput": { - "$ref": "GoogleCloudMlV1beta1__TrainingOutput", + "$ref": "GoogleCloudMlV1__TrainingOutput", "description": "The current training job result." }, + "trainingInput": { + "description": "Input parameters to create a training job.", + "$ref": "GoogleCloudMlV1__TrainingInput" + }, "createTime": { - "description": "Output only. When the job was created.", "format": "google-datetime", + "description": "Output only. When the job was created.", "type": "string" }, - "trainingInput": { - "$ref": "GoogleCloudMlV1beta1__TrainingInput", - "description": "Input parameters to create a training job." + "predictionInput": { + "$ref": "GoogleCloudMlV1__PredictionInput", + "description": "Input parameters to create a prediction job." }, "state": { - "enumDescriptions": [ - "The job state is unspecified.", - "The job has been just created and processing has not yet begun.", - "The service is preparing to run the job.", - "The job is in progress.", - "The job completed successfully.", - "The job failed.\n`error_message` should contain the details of the failure.", - "The job is being cancelled.\n`error_message` should describe the reason for the cancellation.", - "The job has been cancelled.\n`error_message` should describe the reason for the cancellation." - ], "enum": [ "STATE_UNSPECIFIED", "QUEUED", @@ -733,121 +808,58 @@ "CANCELLED" ], "description": "Output only. The detailed state of a job.", - "type": "string" - }, - "predictionInput": { - "$ref": "GoogleCloudMlV1beta1__PredictionInput", - "description": "Input parameters to create a prediction job." - } - } - }, - "GoogleCloudMlV1beta1__TrainingInput": { - "description": "Represents input parameters for a training job.", - "type": "object", - "properties": { - "pythonModule": { - "description": "Required. The Python module name to run after installing the packages.", - "type": "string" - }, - "workerType": { - "description": "Optional. Specifies the type of virtual machine to use for your training\njob's worker nodes.\n\nThe supported values are the same as those described in the entry for\n`masterType`.\n\nThis value must be present when `scaleTier` is set to `CUSTOM` and\n`workerCount` is greater than zero.", - "type": "string" - }, - "args": { - "description": "Optional. Command line arguments to pass to the program.", - "type": "array", - "items": { - "type": "string" - } - }, - "region": { - "description": "Required. The Google Compute Engine region to run the training job in.", - "type": "string" - }, - "parameterServerType": { - "description": "Optional. Specifies the type of virtual machine to use for your training\njob's parameter server.\n\nThe supported values are the same as those described in the entry for\n`master_type`.\n\nThis value must be present when `scaleTier` is set to `CUSTOM` and\n`parameter_server_count` is greater than zero.", - "type": "string" - }, - "scaleTier": { - "enumDescriptions": [ - "A single worker instance. This tier is suitable for learning how to use\nCloud ML, and for experimenting with new models using small datasets.", - "Many workers and a few parameter servers.", - "A large number of workers with many parameter servers.", - "A single worker instance [with a GPU](/ml-engine/docs/how-tos/using-gpus).", - "The CUSTOM tier is not a set tier, but rather enables you to use your\nown cluster specification. When you use this tier, set values to\nconfigure your processing cluster according to these guidelines:\n\n* You _must_ set `TrainingInput.masterType` to specify the type\n of machine to use for your master node. This is the only required\n setting.\n\n* You _may_ set `TrainingInput.workerCount` to specify the number of\n workers to use. If you specify one or more workers, you _must_ also\n set `TrainingInput.workerType` to specify the type of machine to use\n for your worker nodes.\n\n* You _may_ set `TrainingInput.parameterServerCount` to specify the\n number of parameter servers to use. If you specify one or more\n parameter servers, you _must_ also set\n `TrainingInput.parameterServerType` to specify the type of machine to\n use for your parameter servers.\n\nNote that all of your workers must use the same machine type, which can\nbe different from your parameter server type and master type. Your\nparameter servers must likewise use the same machine type, which can be\ndifferent from your worker type and master type." - ], - "enum": [ - "BASIC", - "STANDARD_1", - "PREMIUM_1", - "BASIC_GPU", - "CUSTOM" - ], - "description": "Required. Specifies the machine types, the number of replicas for workers\nand parameter servers.", - "type": "string" - }, - "jobDir": { "type": "string", - "description": "Optional. A Google Cloud Storage path in which to store training outputs\nand other data needed for training. This path is passed to your TensorFlow\nprogram as the 'job_dir' command-line argument. The benefit of specifying\nthis field is that Cloud ML validates the path for use in training." - }, - "hyperparameters": { - "$ref": "GoogleCloudMlV1beta1__HyperparameterSpec", - "description": "Optional. The set of Hyperparameters to tune." - }, - "parameterServerCount": { - "description": "Optional. The number of parameter server replicas to use for the training\njob. Each replica in the cluster will be of the type specified in\n`parameter_server_type`.\n\nThis value can only be used when `scale_tier` is set to `CUSTOM`.If you\nset this value, you must also set `parameter_server_type`.", - "format": "int64", - "type": "string" - }, - "packageUris": { - "description": "Required. The Google Cloud Storage location of the packages with\nthe training program and any additional dependencies.\nThe maximum number of package URIs is 100.", - "type": "array", - "items": { - "type": "string" - } - }, - "workerCount": { - "description": "Optional. The number of worker replicas to use for the training job. Each\nreplica in the cluster will be of the type specified in `worker_type`.\n\nThis value can only be used when `scale_tier` is set to `CUSTOM`. If you\nset this value, you must also set `worker_type`.", - "format": "int64", - "type": "string" - }, - "masterType": { - "description": "Optional. Specifies the type of virtual machine to use for your training\njob's master worker.\n\nThe following types are supported:\n\n\u003cdl\u003e\n \u003cdt\u003estandard\u003c/dt\u003e\n \u003cdd\u003e\n A basic machine configuration suitable for training simple models with\n small to moderate datasets.\n \u003c/dd\u003e\n \u003cdt\u003elarge_model\u003c/dt\u003e\n \u003cdd\u003e\n A machine with a lot of memory, specially suited for parameter servers\n when your model is large (having many hidden layers or layers with very\n large numbers of nodes).\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_s\u003c/dt\u003e\n \u003cdd\u003e\n A machine suitable for the master and workers of the cluster when your\n model requires more computation than the standard machine can handle\n satisfactorily.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_m\u003c/dt\u003e\n \u003cdd\u003e\n A machine with roughly twice the number of cores and roughly double the\n memory of \u003ccode suppresswarning=\"true\"\u003ecomplex_model_s\u003c/code\u003e.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_l\u003c/dt\u003e\n \u003cdd\u003e\n A machine with roughly twice the number of cores and roughly double the\n memory of \u003ccode suppresswarning=\"true\"\u003ecomplex_model_m\u003c/code\u003e.\n \u003c/dd\u003e\n \u003cdt\u003estandard_gpu\u003c/dt\u003e\n \u003cdd\u003e\n A machine equivalent to \u003ccode suppresswarning=\"true\"\u003estandard\u003c/code\u003e that\n also includes a\n \u003ca href=\"/ml-engine/docs/how-tos/using-gpus\"\u003e\n GPU that you can use in your trainer\u003c/a\u003e.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_m_gpu\u003c/dt\u003e\n \u003cdd\u003e\n A machine equivalent to\n \u003ccode suppresswarning=\"true\"\u003ecomplex_model_m\u003c/code\u003e that also includes\n four GPUs.\n \u003c/dd\u003e\n\u003c/dl\u003e\n\nYou must set this value when `scaleTier` is set to `CUSTOM`.", - "type": "string" - }, - "runtimeVersion": { - "description": "Optional. The Google Cloud ML runtime version to use for training. If not\nset, Google Cloud ML will choose the latest stable version.", - "type": "string" + "enumDescriptions": [ + "The job state is unspecified.", + "The job has been just created and processing has not yet begun.", + "The service is preparing to run the job.", + "The job is in progress.", + "The job completed successfully.", + "The job failed.\n`error_message` should contain the details of the failure.", + "The job is being cancelled.\n`error_message` should describe the reason for the cancellation.", + "The job has been cancelled.\n`error_message` should describe the reason for the cancellation." + ] } }, - "id": "GoogleCloudMlV1beta1__TrainingInput" - }, - "GoogleLongrunning__ListOperationsResponse": { - "properties": { - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "GoogleLongrunning__Operation" - } - } - }, - "id": "GoogleLongrunning__ListOperationsResponse", - "description": "The response message for Operations.ListOperations.", + "id": "GoogleCloudMlV1__Job", + "description": "Represents a training or prediction job.\n\nNext ID: 16", "type": "object" }, - "GoogleCloudMlV1beta1__GetConfigResponse": { - "id": "GoogleCloudMlV1beta1__GetConfigResponse", + "GoogleApi__HttpBody": { + "description": "Message that represents an arbitrary HTTP body. It should only be used for\npayload formats that can't be represented as JSON, such as raw binary or\nan HTML page.\n\n\nThis message can be used both in streaming and non-streaming API methods in\nthe request as well as the response.\n\nIt can be used as a top-level request field, which is convenient if one\nwants to extract parameters from either the URL or HTTP template into the\nrequest fields and also want access to the raw HTTP body.\n\nExample:\n\n message GetResourceRequest {\n // A unique request id.\n string request_id = 1;\n\n // The raw HTTP body is bound to this field.\n google.api.HttpBody http_body = 2;\n }\n\n service ResourceService {\n rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);\n rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty);\n }\n\nExample with streaming methods:\n\n service CaldavService {\n rpc GetCalendar(stream google.api.HttpBody)\n returns (stream google.api.HttpBody);\n rpc UpdateCalendar(stream google.api.HttpBody)\n returns (stream google.api.HttpBody);\n }\n\nUse of this type only changes how the request and response bodies are\nhandled, all other features will continue to work unchanged.", + "type": "object", + "properties": { + "contentType": { + "description": "The HTTP Content-Type string representing the content type of the body.", + "type": "string" + }, + "extensions": { + "description": "Application specific response metadata. Must be set in the first response\nfor streaming APIs.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": "array" + }, + "data": { + "format": "byte", + "description": "HTTP body binary data.", + "type": "string" + } + }, + "id": "GoogleApi__HttpBody" + }, + "GoogleCloudMlV1__GetConfigResponse": { + "id": "GoogleCloudMlV1__GetConfigResponse", "description": "Returns service account information associated with a project.", "type": "object", "properties": { "serviceAccountProject": { - "description": "The project number for `service_account`.", "format": "int64", + "description": "The project number for `service_account`.", "type": "string" }, "serviceAccount": { @@ -856,17 +868,130 @@ } } }, - "GoogleCloudMlV1beta1__SetDefaultVersionRequest": { - "description": "Request message for the SetDefaultVersion request.", + "GoogleIamV1__TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", "type": "object", - "properties": {}, - "id": "GoogleCloudMlV1beta1__SetDefaultVersionRequest" + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "GoogleIamV1__TestIamPermissionsResponse" + }, + "GoogleIamV1__SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "$ref": "GoogleIamV1__Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." + }, + "updateMask": { + "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", + "type": "string" + } + }, + "id": "GoogleIamV1__SetIamPolicyRequest" + }, + "GoogleCloudMlV1__HyperparameterOutput": { + "description": "Represents the result of a single hyperparameter tuning trial from a\ntraining job. The TrainingOutput object that is returned on successful\ncompletion of a training job with hyperparameter tuning includes a list\nof HyperparameterOutput objects, one for each successful trial.", + "type": "object", + "properties": { + "allMetrics": { + "description": "All recorded object metrics for this trial. This field is not currently\npopulated.", + "items": { + "$ref": "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric" + }, + "type": "array" + }, + "finalMetric": { + "description": "The final objective metric seen for this trial.", + "$ref": "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric" + }, + "hyperparameters": { + "additionalProperties": { + "type": "string" + }, + "description": "The hyperparameters given to this trial.", + "type": "object" + }, + "trialId": { + "description": "The trial id for these results.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__HyperparameterOutput" + }, + "GoogleCloudMlV1__PredictionOutput": { + "properties": { + "predictionCount": { + "format": "int64", + "description": "The number of generated predictions.", + "type": "string" + }, + "errorCount": { + "format": "int64", + "description": "The number of data instances which resulted in errors.", + "type": "string" + }, + "nodeHours": { + "format": "double", + "description": "Node hours used by the batch prediction job.", + "type": "number" + }, + "outputPath": { + "description": "The output Google Cloud Storage location provided at the job creation time.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__PredictionOutput", + "description": "Represents results of a prediction job.", + "type": "object" + }, + "GoogleIamV1__Policy": { + "id": "GoogleIamV1__Policy", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "GoogleIamV1__AuditConfig" + }, + "type": "array" + }, + "bindings": { + "items": { + "$ref": "GoogleIamV1__Binding" + }, + "type": "array", + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error." + }, + "iamOwned": { + "type": "boolean" + }, + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + } + } } }, "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "canonicalName": "Cloud Machine Learning Engine", "auth": { @@ -889,66 +1014,212 @@ "methods": { "getConfig": { "response": { - "$ref": "GoogleCloudMlV1beta1__GetConfigResponse" + "$ref": "GoogleCloudMlV1__GetConfigResponse" }, - "httpMethod": "GET", "parameterOrder": [ "name" ], - "parameters": { - "name": { - "description": "Required. The project name.\n\nAuthorization: requires `Viewer` role on the specified project.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - } - }, + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta1/projects/{projectsId}:getConfig", - "path": "v1beta1/{+name}:getConfig", + "parameters": { + "name": { + "location": "path", + "description": "Required. The project name.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}:getConfig", "id": "ml.projects.getConfig", + "path": "v1/{+name}:getConfig", "description": "Get the service account information associated with your project. You need\nthis information in order to grant the service account persmissions for\nthe Google Cloud Storage location where you put your model training code\nfor training the model with Google Cloud Machine Learning." }, "predict": { - "description": "Performs prediction on the data in the request.\n\n**** REMOVE FROM GENERATED DOCUMENTATION", + "flatPath": "v1/projects/{projectsId}:predict", + "id": "ml.projects.predict", + "path": "v1/{+name}:predict", "request": { - "$ref": "GoogleCloudMlV1beta1__PredictRequest" + "$ref": "GoogleCloudMlV1__PredictRequest" }, - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], + "description": "Performs prediction on the data in the request.\n\n**** REMOVE FROM GENERATED DOCUMENTATION", "response": { "$ref": "GoogleApi__HttpBody" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "name": { - "description": "Required. The resource name of a model or a version.\n\nAuthorization: requires `Viewer` role on the parent project.", - "required": true, "type": "string", + "required": true, "pattern": "^projects/.+$", - "location": "path" + "location": "path", + "description": "Required. The resource name of a model or a version.\n\nAuthorization: requires the `predict` permission on the specified resource." } - }, - "flatPath": "v1beta1/projects/{projectsId}:predict", - "id": "ml.projects.predict", - "path": "v1beta1/{+name}:predict" + } } }, "resources": { "jobs": { "methods": { - "cancel": { - "description": "Cancels a running job.", - "request": { - "$ref": "GoogleCloudMlV1beta1__CancelJobRequest" + "get": { + "id": "ml.projects.jobs.get", + "path": "v1/{+name}", + "description": "Describes a job.", + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "response": { + "$ref": "GoogleCloudMlV1__Job" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "location": "path", + "description": "Required. The name of the job to get the description of.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}" + }, + "testIamPermissions": { + "id": "ml.projects.jobs.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "GoogleIamV1__TestIamPermissionsRequest" + }, + "response": { + "$ref": "GoogleIamV1__TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:testIamPermissions" + }, + "list": { + "description": "Lists the jobs in the project.", + "response": { + "$ref": "GoogleCloudMlV1__ListJobsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Optional. The number of jobs to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.", + "type": "integer" + }, + "parent": { + "location": "path", + "description": "Required. The name of the project for which to list jobs.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "filter": { + "description": "Optional. Specifies the subset of jobs to retrieve.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/jobs", + "id": "ml.projects.jobs.list", + "path": "v1/{+parent}/jobs" + }, + "setIamPolicy": { + "response": { + "$ref": "GoogleIamV1__Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/jobs/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:setIamPolicy", + "id": "ml.projects.jobs.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "GoogleIamV1__SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." + }, + "create": { + "id": "ml.projects.jobs.create", + "path": "v1/{+parent}/jobs", + "request": { + "$ref": "GoogleCloudMlV1__Job" + }, + "description": "Creates a training or a batch prediction job.", + "response": { + "$ref": "GoogleCloudMlV1__Job" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "location": "path", + "description": "Required. The project name.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs" + }, + "cancel": { "response": { "$ref": "GoogleProtobuf__Empty" }, @@ -956,124 +1227,494 @@ "name" ], "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { "name": { - "description": "Required. The name of the job to cancel.\n\nAuthorization: requires `Editor` role on the parent project.", - "required": true, + "description": "Required. The name of the job to cancel.", "type": "string", + "required": true, "pattern": "^projects/[^/]+/jobs/[^/]+$", "location": "path" } }, - "flatPath": "v1beta1/projects/{projectsId}/jobs/{jobsId}:cancel", - "path": "v1beta1/{+name}:cancel", - "id": "ml.projects.jobs.cancel" - }, - "list": { - "flatPath": "v1beta1/projects/{projectsId}/jobs", - "path": "v1beta1/{+parent}/jobs", - "id": "ml.projects.jobs.list", - "description": "Lists the jobs in the project.", - "parameterOrder": [ - "parent" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" ], + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:cancel", + "id": "ml.projects.jobs.cancel", + "path": "v1/{+name}:cancel", + "description": "Cancels a running job.", + "request": { + "$ref": "GoogleCloudMlV1__CancelJobRequest" + } + }, + "getIamPolicy": { + "id": "ml.projects.jobs.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", "response": { - "$ref": "GoogleCloudMlV1beta1__ListJobsResponse" + "$ref": "GoogleIamV1__Policy" }, + "parameterOrder": [ + "resource" + ], "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "parent": { - "location": "path", - "description": "Required. The name of the project for which to list jobs.\n\nAuthorization: requires `Viewer` role on the specified project.", + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", "required": true, + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:getIamPolicy" + } + } + }, + "models": { + "methods": { + "testIamPermissions": { + "request": { + "$ref": "GoogleIamV1__TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "GoogleIamV1__TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", "type": "string", - "pattern": "^projects/[^/]+$" - }, - "filter": { - "description": "Optional. Specifies the subset of jobs to retrieve.", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "ml.projects.models.testIamPermissions" + }, + "delete": { + "id": "ml.projects.models.delete", + "path": "v1/{+name}", + "description": "Deletes a model.\n\nYou can only delete a model if there are no versions in it. You can delete\nversions by calling\n[projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete).", + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the model.", "type": "string", - "location": "query" - }, + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}" + }, + "list": { + "response": { + "$ref": "GoogleCloudMlV1__ListModelsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { "pageToken": { "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.", "type": "string", "location": "query" }, "pageSize": { - "description": "Optional. The number of jobs to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.", "format": "int32", + "description": "Optional. The number of models to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.", "type": "integer", "location": "query" + }, + "parent": { + "description": "Required. The name of the project whose models are to be listed.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" } - } + }, + "flatPath": "v1/projects/{projectsId}/models", + "id": "ml.projects.models.list", + "path": "v1/{+parent}/models", + "description": "Lists the models in a project.\n\nEach project can contain multiple models, and each model can have multiple\nversions." + }, + "setIamPolicy": { + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}:setIamPolicy", + "id": "ml.projects.models.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "GoogleIamV1__SetIamPolicyRequest" + }, + "response": { + "$ref": "GoogleIamV1__Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST" + }, + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The project name.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/models", + "id": "ml.projects.models.create", + "path": "v1/{+parent}/models", + "request": { + "$ref": "GoogleCloudMlV1__Model" + }, + "description": "Creates a model which will later contain one or more versions.\n\nYou must add at least one version before you can request predictions from\nthe model. Add versions by calling\n[projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create).", + "response": { + "$ref": "GoogleCloudMlV1__Model" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST" + }, + "getIamPolicy": { + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "GoogleIamV1__Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}:getIamPolicy", + "id": "ml.projects.models.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy" }, "get": { - "description": "Describes a job.", + "httpMethod": "GET", "response": { - "$ref": "GoogleCloudMlV1beta1__Job" + "$ref": "GoogleCloudMlV1__Model" }, "parameterOrder": [ "name" ], - "httpMethod": "GET", "parameters": { "name": { - "pattern": "^projects/[^/]+/jobs/[^/]+$", + "pattern": "^projects/[^/]+/models/[^/]+$", "location": "path", - "description": "Required. The name of the job to get the description of.\n\nAuthorization: requires `Viewer` role on the parent project.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/jobs/{jobsId}", - "path": "v1beta1/{+name}", - "id": "ml.projects.jobs.get" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "GoogleCloudMlV1beta1__Job" - }, - "parameters": { - "parent": { - "location": "path", - "description": "Required. The project name.\n\nAuthorization: requires `Editor` role on the specified project.", - "required": true, + "description": "Required. The name of the model.", "type": "string", - "pattern": "^projects/[^/]+$" + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta1/projects/{projectsId}/jobs", - "id": "ml.projects.jobs.create", - "path": "v1beta1/{+parent}/jobs", - "request": { - "$ref": "GoogleCloudMlV1beta1__Job" - }, - "description": "Creates a training or a batch prediction job." + "flatPath": "v1/projects/{projectsId}/models/{modelsId}", + "path": "v1/{+name}", + "id": "ml.projects.models.get", + "description": "Gets information about a model, including its name, the description (if\nset), and the default version (if at least one version of the model has\nbeen deployed)." + } + }, + "resources": { + "versions": { + "methods": { + "get": { + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", + "id": "ml.projects.models.versions.get", + "path": "v1/{+name}", + "description": "Gets information about a model version.\n\nModels can have multiple versions. You can call\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list)\nto get the same information that this method returns for all of the\nversions of a model.", + "response": { + "$ref": "GoogleCloudMlV1__Version" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the version.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$", + "location": "path" + } + } + }, + "list": { + "description": "Gets basic information about all the versions of a model.\n\nIf you expect that a model has a lot of versions, or if you need to handle\nonly a limited number of results at a time, you can request that the list\nbe retrieved in batches (called pages):", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "GoogleCloudMlV1__ListVersionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Required. The name of the model for which to list the version.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Optional. The number of versions to retrieve per \"page\" of results. If\nthere are more remaining results than this number, the response message\nwill contain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions", + "path": "v1/{+parent}/versions", + "id": "ml.projects.models.versions.list" + }, + "create": { + "description": "Creates a new version of a model from a trained TensorFlow model.\n\nIf the version created in the cloud by this call is the first deployed\nversion of the specified model, it will be made the default version of the\nmodel. When you add a version to a model that already has one or more\nversions, the default version does not automatically change. If you want a\nnew version to be the default, you must call\n[projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault).", + "request": { + "$ref": "GoogleCloudMlV1__Version" + }, + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Required. The name of the model.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions", + "id": "ml.projects.models.versions.create", + "path": "v1/{+parent}/versions" + }, + "setDefault": { + "response": { + "$ref": "GoogleCloudMlV1__Version" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the version to make the default for the model. You\ncan get the names of all the versions of a model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list).", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}:setDefault", + "id": "ml.projects.models.versions.setDefault", + "path": "v1/{+name}:setDefault", + "request": { + "$ref": "GoogleCloudMlV1__SetDefaultVersionRequest" + }, + "description": "Designates a version to be the default for the model.\n\nThe default version is used for prediction requests made against the model\nthat don't specify a version.\n\nThe first version to be created for a model is automatically set as the\ndefault. You must make any subsequent changes to the default version\nsetting manually using this method." + }, + "delete": { + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", + "path": "v1/{+name}", + "id": "ml.projects.models.versions.delete", + "description": "Deletes a model version.\n\nEach model can have multiple versions deployed and in use at any given\ntime. Use this method to remove a single version.\n\nNote: You cannot delete the version that is set as the default version\nof the model unless it is the only remaining version.", + "httpMethod": "DELETE", + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the version. You can get the names of all the\nversions of a model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list).", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } }, "operations": { "methods": { + "delete": { + "response": { + "$ref": "GoogleProtobuf__Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be deleted.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/operations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}", + "id": "ml.projects.operations.delete", + "path": "v1/{+name}", + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`." + }, + "get": { + "id": "ml.projects.operations.get", + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}" + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "GoogleLongrunning__ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "type": "string", + "location": "query", + "description": "The standard list filter." + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + } + }, + "flatPath": "v1/projects/{projectsId}/operations", + "path": "v1/{+name}/operations", + "id": "ml.projects.operations.list", + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id." + }, "cancel": { - "flatPath": "v1beta1/projects/{projectsId}/operations/{operationsId}:cancel", - "path": "v1beta1/{+name}:cancel", - "id": "ml.projects.operations.cancel", "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", "response": { "$ref": "GoogleProtobuf__Empty" @@ -1085,372 +1726,18 @@ "parameters": { "name": { "description": "The name of the operation resource to be cancelled.", - "required": true, "type": "string", + "required": true, "pattern": "^projects/[^/]+/operations/[^/]+$", "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "delete": { - "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", - "parameterOrder": [ - "name" ], - "httpMethod": "DELETE", - "response": { - "$ref": "GoogleProtobuf__Empty" - }, - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation resource to be deleted.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/operations/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/operations/{operationsId}", - "id": "ml.projects.operations.delete", - "path": "v1beta1/{+name}" - }, - "list": { - "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding below allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`.", - "httpMethod": "GET", - "response": { - "$ref": "GoogleLongrunning__ListOperationsResponse" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "The name of the operation collection." - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "The standard list page size.", - "format": "int32" - }, - "filter": { - "location": "query", - "description": "The standard list filter.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/operations", - "id": "ml.projects.operations.list", - "path": "v1beta1/{+name}/operations" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "GoogleLongrunning__Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "description": "The name of the operation resource.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/operations/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/operations/{operationsId}", - "id": "ml.projects.operations.get", - "path": "v1beta1/{+name}", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." - } - } - }, - "models": { - "methods": { - "delete": { - "response": { - "$ref": "GoogleLongrunning__Operation" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "DELETE", - "parameters": { - "name": { - "pattern": "^projects/[^/]+/models/[^/]+$", - "location": "path", - "description": "Required. The name of the model.\n\nAuthorization: requires `Editor` role on the parent project.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}", - "id": "ml.projects.models.delete", - "path": "v1beta1/{+name}", - "description": "Deletes a model.\n\nYou can only delete a model if there are no versions in it. You can delete\nversions by calling\n[projects.models.versions.delete](/ml-engine/reference/rest/v1beta1/projects.models.versions/delete)." - }, - "list": { - "path": "v1beta1/{+parent}/models", - "id": "ml.projects.models.list", - "description": "Lists the models in a project.\n\nEach project can contain multiple models, and each model can have multiple\nversions.", - "response": { - "$ref": "GoogleCloudMlV1beta1__ListModelsResponse" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "GET", - "parameters": { - "pageToken": { - "type": "string", - "location": "query", - "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call." - }, - "pageSize": { - "description": "Optional. The number of models to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "parent": { - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Required. The name of the project whose models are to be listed.\n\nAuthorization: requires `Viewer` role on the specified project.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/models" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "GoogleCloudMlV1beta1__Model" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "location": "path", - "description": "Required. The name of the model.\n\nAuthorization: requires `Viewer` role on the parent project.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/models/[^/]+$" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}", - "id": "ml.projects.models.get", - "path": "v1beta1/{+name}", - "description": "Gets information about a model, including its name, the description (if\nset), and the default version (if at least one version of the model has\nbeen deployed)." - }, - "create": { - "response": { - "$ref": "GoogleCloudMlV1beta1__Model" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "parent": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path", - "description": "Required. The project name.\n\nAuthorization: requires `Editor` role on the specified project." - } - }, - "flatPath": "v1beta1/projects/{projectsId}/models", - "path": "v1beta1/{+parent}/models", - "id": "ml.projects.models.create", - "description": "Creates a model which will later contain one or more versions.\n\nYou must add at least one version before you can request predictions from\nthe model. Add versions by calling\n[projects.models.versions.create](/ml-engine/reference/rest/v1beta1/projects.models.versions/create).", - "request": { - "$ref": "GoogleCloudMlV1beta1__Model" - } - } - }, - "resources": { - "versions": { - "methods": { - "delete": { - "response": { - "$ref": "GoogleLongrunning__Operation" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$", - "location": "path", - "description": "Required. The name of the version. You can get the names of all the\nversions of a model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list).\n\nAuthorization: requires `Editor` role on the parent project." - } - }, - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", - "path": "v1beta1/{+name}", - "id": "ml.projects.models.versions.delete", - "description": "Deletes a model version.\n\nEach model can have multiple versions deployed and in use at any given\ntime. Use this method to remove a single version.\n\nNote: You cannot delete the version that is set as the default version\nof the model unless it is the only remaining version." - }, - "list": { - "description": "Gets basic information about all the versions of a model.\n\nIf you expect that a model has a lot of versions, or if you need to handle\nonly a limited number of results at a time, you can request that the list\nbe retrieved in batches (called pages):", - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "GoogleCloudMlV1beta1__ListVersionsResponse" - }, - "parameters": { - "parent": { - "pattern": "^projects/[^/]+/models/[^/]+$", - "location": "path", - "description": "Required. The name of the model for which to list the version.\n\nAuthorization: requires `Viewer` role on the parent project.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.", - "type": "string" - }, - "pageSize": { - "description": "Optional. The number of versions to retrieve per \"page\" of results. If\nthere are more remaining results than this number, the response message\nwill contain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}/versions", - "id": "ml.projects.models.versions.list", - "path": "v1beta1/{+parent}/versions" - }, - "get": { - "description": "Gets information about a model version.\n\nModels can have multiple versions. You can call\n[projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list)\nto get the same information that this method returns for all of the\nversions of a model.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "GoogleCloudMlV1beta1__Version" - }, - "parameters": { - "name": { - "location": "path", - "description": "Required. The name of the version.\n\nAuthorization: requires `Viewer` role on the parent project.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", - "id": "ml.projects.models.versions.get", - "path": "v1beta1/{+name}" - }, - "create": { - "request": { - "$ref": "GoogleCloudMlV1beta1__Version" - }, - "description": "Creates a new version of a model from a trained TensorFlow model.\n\nIf the version created in the cloud by this call is the first deployed\nversion of the specified model, it will be made the default version of the\nmodel. When you add a version to a model that already has one or more\nversions, the default version does not automatically change. If you want a\nnew version to be the default, you must call\n[projects.models.versions.setDefault](/ml-engine/reference/rest/v1beta1/projects.models.versions/setDefault).", - "response": { - "$ref": "GoogleLongrunning__Operation" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "parameters": { - "parent": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/models/[^/]+$", - "location": "path", - "description": "Required. The name of the model.\n\nAuthorization: requires `Editor` role on the parent project." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}/versions", - "path": "v1beta1/{+parent}/versions", - "id": "ml.projects.models.versions.create" - }, - "setDefault": { - "response": { - "$ref": "GoogleCloudMlV1beta1__Version" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "location": "path", - "description": "Required. The name of the version to make the default for the model. You\ncan get the names of all the versions of a model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list).\n\nAuthorization: requires `Editor` role on the parent project.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}:setDefault", - "path": "v1beta1/{+name}:setDefault", - "id": "ml.projects.models.versions.setDefault", - "description": "Designates a version to be the default for the model.\n\nThe default version is used for prediction requests made against the model\nthat don't specify a version.\n\nThe first version to be created for a model is automatically set as the\ndefault. You must make any subsequent changes to the default version\nsetting manually using this method.", - "request": { - "$ref": "GoogleCloudMlV1beta1__SetDefaultVersionRequest" - } - } - } + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel", + "id": "ml.projects.operations.cancel", + "path": "v1/{+name}:cancel" } } } @@ -1458,73 +1745,31 @@ } }, "parameters": { - "alt": { - "type": "string", - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, "upload_protocol": { "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string" }, "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", + "default": "true", "type": "boolean", - "default": "true" + "location": "query", + "description": "Returns response with indentations and line breaks." }, "fields": { + "location": "query", "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" + "type": "string" }, "uploadType": { + "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { "type": "string", - "location": "query" + "location": "query", + "description": "JSONP" }, "$.xgafv": { "location": "query", @@ -1539,12 +1784,63 @@ "v2 error format" ] }, - "callback": { + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", - "description": "JSONP", + "description": "Data format for response.", + "default": "json" + }, + "key": { + "location": "query", + "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.", "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" } }, - "version": "v1beta1", - "baseUrl": "https://ml.googleapis.com/" + "version": "v1", + "baseUrl": "https://ml.googleapis.com/", + "servicePath": "", + "description": "An API to enable creating and using machine learning models.", + "kind": "discovery#restDescription", + "basePath": "", + "documentationLink": "https://cloud.google.com/ml/", + "revision": "20170926", + "id": "ml:v1", + "discoveryVersion": "v1", + "version_module": true } diff --git a/etc/api/monitoring/v3/crates/1.0.6-api+20170918 b/etc/api/monitoring/v3/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/monitoring/v3/crates/1.0.6-cli+20170918 b/etc/api/monitoring/v3/crates/1.0.6-cli+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/monitoring/v3/monitoring-api.json b/etc/api/monitoring/v3/monitoring-api.json index cc0f192bce..75bac9b6d7 100644 --- a/etc/api/monitoring/v3/monitoring-api.json +++ b/etc/api/monitoring/v3/monitoring-api.json @@ -1,254 +1,10 @@ { - "ownerName": "Google", "resources": { "projects": { "resources": { - "groups": { - "methods": { - "delete": { - "description": "Deletes an existing group.", - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring" - ], - "parameters": { - "name": { - "location": "path", - "description": "The group to delete. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/groups/[^/]+$" - } - }, - "flatPath": "v3/projects/{projectsId}/groups/{groupsId}", - "id": "monitoring.projects.groups.delete", - "path": "v3/{+name}" - }, - "list": { - "description": "Lists the existing groups.", - "response": { - "$ref": "ListGroupsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "parameters": { - "pageSize": { - "description": "A positive number that is the maximum number of results to return.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "ancestorsOfGroup": { - "location": "query", - "description": "A group name: \"projects/{project_id_or_number}/groups/{group_id}\". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty.", - "type": "string" - }, - "name": { - "location": "path", - "description": "The project whose groups are to be listed. The format is \"projects/{project_id_or_number}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - }, - "childrenOfGroup": { - "description": "A group name: \"projects/{project_id_or_number}/groups/{group_id}\". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty.", - "type": "string", - "location": "query" - }, - "descendantsOfGroup": { - "description": "A group name: \"projects/{project_id_or_number}/groups/{group_id}\". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth.", - "type": "string", - "location": "query" - }, - "pageToken": { - "location": "query", - "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read" - ], - "flatPath": "v3/projects/{projectsId}/groups", - "path": "v3/{+name}/groups", - "id": "monitoring.projects.groups.list" - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Group" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "location": "path", - "description": "The group to retrieve. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/groups/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read" - ], - "flatPath": "v3/projects/{projectsId}/groups/{groupsId}", - "id": "monitoring.projects.groups.get", - "path": "v3/{+name}", - "description": "Gets a single group." - }, - "update": { - "path": "v3/{+name}", - "id": "monitoring.projects.groups.update", - "description": "Updates an existing group. You can change any group attributes except name.", - "request": { - "$ref": "Group" - }, - "response": { - "$ref": "Group" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring" - ], - "parameters": { - "name": { - "location": "path", - "description": "Output only. The name of this group. The format is \"projects/{project_id_or_number}/groups/{group_id}\". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/groups/[^/]+$" - }, - "validateOnly": { - "location": "query", - "description": "If true, validate this request but do not update the existing group.", - "type": "boolean" - } - }, - "flatPath": "v3/projects/{projectsId}/groups/{groupsId}" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Group" - }, - "parameters": { - "name": { - "location": "path", - "description": "The project in which to create the group. The format is \"projects/{project_id_or_number}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - }, - "validateOnly": { - "description": "If true, validate this request but do not create the group.", - "type": "boolean", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring" - ], - "flatPath": "v3/projects/{projectsId}/groups", - "id": "monitoring.projects.groups.create", - "path": "v3/{+name}/groups", - "request": { - "$ref": "Group" - }, - "description": "Creates a new group." - } - }, - "resources": { - "members": { - "methods": { - "list": { - "path": "v3/{+name}/members", - "id": "monitoring.projects.groups.members.list", - "description": "Lists the monitored resources that are members of a group.", - "response": { - "$ref": "ListGroupMembersResponse" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "parameters": { - "name": { - "description": "The group whose members are listed. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/groups/[^/]+$", - "location": "path" - }, - "interval.endTime": { - "description": "Required. The end of the time interval.", - "format": "google-datetime", - "type": "string", - "location": "query" - }, - "filter": { - "location": "query", - "description": "An optional list filter describing the members to be returned. The filter may reference the type, labels, and metadata of monitored resources that comprise the group. For example, to return only resources representing Compute Engine VM instances, use this filter:\nresource.type = \"gce_instance\"\n", - "type": "string" - }, - "pageToken": { - "type": "string", - "location": "query", - "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call." - }, - "interval.startTime": { - "description": "Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.", - "format": "google-datetime", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "A positive number that is the maximum number of results to return.", - "format": "int32", - "type": "integer" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read" - ], - "flatPath": "v3/projects/{projectsId}/groups/{groupsId}/members" - } - } - } - } - }, - "collectdTimeSeries": { + "timeSeries": { "methods": { "create": { - "request": { - "$ref": "CreateCollectdTimeSeriesRequest" - }, - "description": "Stackdriver Monitoring Agent only: Creates a new time series.\u003caside class=\"caution\"\u003eThis method is only for use by the Stackdriver Monitoring Agent. Use projects.timeSeries.create instead.\u003c/aside\u003e", "httpMethod": "POST", "parameterOrder": [ "name" @@ -258,11 +14,11 @@ }, "parameters": { "name": { + "pattern": "^projects/[^/]+$", "location": "path", - "description": "The project in which to create the time series. The format is \"projects/PROJECT_ID_OR_NUMBER\".", - "required": true, + "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", "type": "string", - "pattern": "^projects/[^/]+$" + "required": true } }, "scopes": [ @@ -270,63 +26,20 @@ "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/monitoring.write" ], - "flatPath": "v3/projects/{projectsId}/collectdTimeSeries", - "id": "monitoring.projects.collectdTimeSeries.create", - "path": "v3/{+name}/collectdTimeSeries" - } - } - }, - "timeSeries": { - "methods": { + "flatPath": "v3/projects/{projectsId}/timeSeries", + "path": "v3/{+name}/timeSeries", + "id": "monitoring.projects.timeSeries.create", + "description": "Creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.", + "request": { + "$ref": "CreateTimeSeriesRequest" + } + }, "list": { - "response": { - "$ref": "ListTimeSeriesResponse" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read" - ], "parameters": { - "aggregation.groupByFields": { - "description": "The set of fields to preserve when crossSeriesReducer is specified. The groupByFields determine how the time series are partitioned into subsets prior to applying the aggregation function. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The crossSeriesReducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in groupByFields are aggregated away. If groupByFields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If crossSeriesReducer is not defined, this field is ignored.", - "type": "string", - "repeated": true, - "location": "query" - }, - "name": { - "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - }, - "interval.endTime": { - "description": "Required. The end of the time interval.", - "format": "google-datetime", - "type": "string", - "location": "query" - }, - "aggregation.alignmentPeriod": { - "location": "query", - "description": "The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds. After per-time series alignment, each time series will contain data points only on the period boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then this field is ignored. If perSeriesAligner is specified and does not equal ALIGN_NONE, then this field must be defined; otherwise an error is returned.", - "format": "google-duration", - "type": "string" - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "A positive number that is the maximum number of results to return. When view field sets to FULL, it limits the number of Points server will return; if view field is HEADERS, it limits the number of TimeSeries server will return.", - "format": "int32" - }, "orderBy": { - "location": "query", "description": "Specifies the order in which the points of the time series should be returned. By default, results are not ordered. Currently, this field must be left blank.", - "type": "string" + "type": "string", + "location": "query" }, "aggregation.crossSeriesReducer": { "location": "query", @@ -354,13 +67,11 @@ "location": "query" }, "pageToken": { + "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", "type": "string", - "location": "query", - "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call." + "location": "query" }, "aggregation.perSeriesAligner": { - "description": "The approach to be used to align individual time series. Not all alignment functions may be applied to all time series, depending on the metric type and value type of the original time series. Alignment may change the metric type or the value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned.", - "type": "string", "location": "query", "enum": [ "ALIGN_NONE", @@ -380,13 +91,15 @@ "ALIGN_PERCENTILE_95", "ALIGN_PERCENTILE_50", "ALIGN_PERCENTILE_05" - ] + ], + "description": "The approach to be used to align individual time series. Not all alignment functions may be applied to all time series, depending on the metric type and value type of the original time series. Alignment may change the metric type or the value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned.", + "type": "string" }, "interval.startTime": { - "description": "Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.", + "location": "query", "format": "google-datetime", - "type": "string", - "location": "query" + "description": "Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.", + "type": "string" }, "view": { "location": "query", @@ -396,66 +109,68 @@ ], "description": "Specifies which information is returned about the time series.", "type": "string" + }, + "name": { + "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "aggregation.groupByFields": { + "repeated": true, + "location": "query", + "description": "The set of fields to preserve when crossSeriesReducer is specified. The groupByFields determine how the time series are partitioned into subsets prior to applying the aggregation function. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The crossSeriesReducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in groupByFields are aggregated away. If groupByFields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If crossSeriesReducer is not defined, this field is ignored.", + "type": "string" + }, + "interval.endTime": { + "location": "query", + "format": "google-datetime", + "description": "Required. The end of the time interval.", + "type": "string" + }, + "aggregation.alignmentPeriod": { + "format": "google-duration", + "description": "The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds. After per-time series alignment, each time series will contain data points only on the period boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then this field is ignored. If perSeriesAligner is specified and does not equal ALIGN_NONE, then this field must be defined; otherwise an error is returned.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "A positive number that is the maximum number of results to return. When view field sets to FULL, it limits the number of Points server will return; if view field is HEADERS, it limits the number of TimeSeries server will return.", + "type": "integer" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], "flatPath": "v3/projects/{projectsId}/timeSeries", - "path": "v3/{+name}/timeSeries", "id": "monitoring.projects.timeSeries.list", - "description": "Lists time series that match a filter. This method does not require a Stackdriver account." - }, - "create": { - "description": "Creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.", - "request": { - "$ref": "CreateTimeSeriesRequest" - }, + "path": "v3/{+name}/timeSeries", + "description": "Lists time series that match a filter. This method does not require a Stackdriver account.", "response": { - "$ref": "Empty" + "$ref": "ListTimeSeriesResponse" }, "parameterOrder": [ "name" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.write" - ], - "parameters": { - "name": { - "location": "path", - "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - } - }, - "flatPath": "v3/projects/{projectsId}/timeSeries", - "path": "v3/{+name}/timeSeries", - "id": "monitoring.projects.timeSeries.create" + "httpMethod": "GET" } } }, "metricDescriptors": { "methods": { "create": { - "request": { - "$ref": "MetricDescriptor" - }, - "description": "Creates a new metric descriptor. User-created metric descriptors define custom metrics.", - "response": { - "$ref": "MetricDescriptor" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", "parameters": { "name": { - "location": "path", "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "required": true, "type": "string", - "pattern": "^projects/[^/]+$" + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" } }, "scopes": [ @@ -464,94 +179,98 @@ "https://www.googleapis.com/auth/monitoring.write" ], "flatPath": "v3/projects/{projectsId}/metricDescriptors", + "id": "monitoring.projects.metricDescriptors.create", "path": "v3/{+name}/metricDescriptors", - "id": "monitoring.projects.metricDescriptors.create" - }, - "delete": { - "description": "Deletes a metric descriptor. Only user-created custom metrics can be deleted.", - "httpMethod": "DELETE", + "description": "Creates a new metric descriptor. User-created metric descriptors define custom metrics.", + "request": { + "$ref": "MetricDescriptor" + }, + "response": { + "$ref": "MetricDescriptor" + }, "parameterOrder": [ "name" ], + "httpMethod": "POST" + }, + "delete": { + "description": "Deletes a metric descriptor. Only user-created custom metrics can be deleted.", "response": { "$ref": "Empty" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ], "parameters": { "name": { + "pattern": "^projects/[^/]+/metricDescriptors/.+$", + "location": "path", "description": "The metric descriptor on which to execute the request. The format is \"projects/{project_id_or_number}/metricDescriptors/{metric_id}\". An example of {metric_id} is: \"custom.googleapis.com/my_test_metric\".", - "required": true, "type": "string", + "required": true + } + }, + "flatPath": "v3/projects/{projectsId}/metricDescriptors/{metricDescriptorsId}", + "id": "monitoring.projects.metricDescriptors.delete", + "path": "v3/{+name}" + }, + "get": { + "parameters": { + "name": { + "description": "The metric descriptor on which to execute the request. The format is \"projects/{project_id_or_number}/metricDescriptors/{metric_id}\". An example value of {metric_id} is \"compute.googleapis.com/instance/disk/read_bytes_count\".", + "type": "string", + "required": true, "pattern": "^projects/[^/]+/metricDescriptors/.+$", "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring" - ], - "flatPath": "v3/projects/{projectsId}/metricDescriptors/{metricDescriptorsId}", - "id": "monitoring.projects.metricDescriptors.delete", - "path": "v3/{+name}" - }, - "list": { "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/monitoring.read", "https://www.googleapis.com/auth/monitoring.write" ], - "parameters": { - "filter": { - "description": "If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics:\nmetric.type = starts_with(\"custom.googleapis.com/\")\n", - "type": "string", - "location": "query" - }, - "name": { - "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - }, - "pageToken": { - "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "A positive number that is the maximum number of results to return.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v3/projects/{projectsId}/metricDescriptors", - "path": "v3/{+name}/metricDescriptors", - "id": "monitoring.projects.metricDescriptors.list", - "description": "Lists metric descriptors that match a filter. This method does not require a Stackdriver account.", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ListMetricDescriptorsResponse" - }, - "httpMethod": "GET" - }, - "get": { + "flatPath": "v3/projects/{projectsId}/metricDescriptors/{metricDescriptorsId}", + "path": "v3/{+name}", + "id": "monitoring.projects.metricDescriptors.get", + "description": "Gets a single metric descriptor. This method does not require a Stackdriver account.", "httpMethod": "GET", "response": { "$ref": "MetricDescriptor" }, "parameterOrder": [ "name" - ], + ] + }, + "list": { "parameters": { + "pageToken": { + "location": "query", + "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", + "type": "string" + }, "name": { - "description": "The metric descriptor on which to execute the request. The format is \"projects/{project_id_or_number}/metricDescriptors/{metric_id}\". An example value of {metric_id} is \"compute.googleapis.com/instance/disk/read_bytes_count\".", - "required": true, + "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", "type": "string", - "pattern": "^projects/[^/]+/metricDescriptors/.+$", + "required": true, + "pattern": "^projects/[^/]+$", "location": "path" + }, + "pageSize": { + "format": "int32", + "description": "A positive number that is the maximum number of results to return.", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics:\nmetric.type = starts_with(\"custom.googleapis.com/\")\n", + "type": "string" } }, "scopes": [ @@ -560,15 +279,50 @@ "https://www.googleapis.com/auth/monitoring.read", "https://www.googleapis.com/auth/monitoring.write" ], - "flatPath": "v3/projects/{projectsId}/metricDescriptors/{metricDescriptorsId}", - "id": "monitoring.projects.metricDescriptors.get", - "path": "v3/{+name}", - "description": "Gets a single metric descriptor. This method does not require a Stackdriver account." + "flatPath": "v3/projects/{projectsId}/metricDescriptors", + "path": "v3/{+name}/metricDescriptors", + "id": "monitoring.projects.metricDescriptors.list", + "description": "Lists metric descriptors that match a filter. This method does not require a Stackdriver account.", + "httpMethod": "GET", + "response": { + "$ref": "ListMetricDescriptorsResponse" + }, + "parameterOrder": [ + "name" + ] } } }, "monitoredResourceDescriptors": { "methods": { + "get": { + "description": "Gets a single monitored resource descriptor. This method does not require a Stackdriver account.", + "httpMethod": "GET", + "response": { + "$ref": "MonitoredResourceDescriptor" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/monitoredResourceDescriptors/[^/]+$", + "location": "path", + "description": "The monitored resource descriptor to get. The format is \"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}\". The {resource_type} is a predefined type, such as cloudsql_database.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read", + "https://www.googleapis.com/auth/monitoring.write" + ], + "flatPath": "v3/projects/{projectsId}/monitoredResourceDescriptors/{monitoredResourceDescriptorsId}", + "path": "v3/{+name}", + "id": "monitoring.projects.monitoredResourceDescriptors.get" + }, "list": { "response": { "$ref": "ListMonitoredResourceDescriptorsResponse" @@ -577,69 +331,314 @@ "name" ], "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read", + "https://www.googleapis.com/auth/monitoring.write" + ], "parameters": { - "name": { - "location": "path", - "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - }, "pageToken": { "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", "type": "string", "location": "query" }, + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", + "type": "string", + "required": true + }, "pageSize": { "location": "query", - "description": "A positive number that is the maximum number of results to return.", "format": "int32", + "description": "A positive number that is the maximum number of results to return.", "type": "integer" }, "filter": { - "location": "query", "description": "An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label:\nresource.type = starts_with(\"gce_\") AND resource.label:id\n", - "type": "string" + "type": "string", + "location": "query" + } + }, + "flatPath": "v3/projects/{projectsId}/monitoredResourceDescriptors", + "id": "monitoring.projects.monitoredResourceDescriptors.list", + "path": "v3/{+name}/monitoredResourceDescriptors", + "description": "Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account." + } + } + }, + "groups": { + "methods": { + "create": { + "id": "monitoring.projects.groups.create", + "path": "v3/{+name}/groups", + "description": "Creates a new group.", + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Group" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "validateOnly": { + "description": "If true, validate this request but do not create the group.", + "type": "boolean", + "location": "query" + }, + "name": { + "description": "The project in which to create the group. The format is \"projects/{project_id_or_number}\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read", - "https://www.googleapis.com/auth/monitoring.write" + "https://www.googleapis.com/auth/monitoring" ], - "flatPath": "v3/projects/{projectsId}/monitoredResourceDescriptors", - "path": "v3/{+name}/monitoredResourceDescriptors", - "id": "monitoring.projects.monitoredResourceDescriptors.list", - "description": "Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account." + "flatPath": "v3/projects/{projectsId}/groups" + }, + "delete": { + "description": "Deletes an existing group.", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The group to delete. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ], + "flatPath": "v3/projects/{projectsId}/groups/{groupsId}", + "id": "monitoring.projects.groups.delete", + "path": "v3/{+name}" }, "get": { + "id": "monitoring.projects.groups.get", + "path": "v3/{+name}", + "description": "Gets a single group.", "response": { - "$ref": "MonitoredResourceDescriptor" + "$ref": "Group" }, "httpMethod": "GET", "parameterOrder": [ "name" ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path", + "description": "The group to retrieve. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], + "flatPath": "v3/projects/{projectsId}/groups/{groupsId}" + }, + "list": { + "id": "monitoring.projects.groups.list", + "path": "v3/{+name}/groups", + "description": "Lists the existing groups.", + "response": { + "$ref": "ListGroupsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The project whose groups are to be listed. The format is \"projects/{project_id_or_number}\".", + "type": "string", + "required": true + }, + "childrenOfGroup": { + "description": "A group name: \"projects/{project_id_or_number}/groups/{group_id}\". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty.", + "type": "string", + "location": "query" + }, + "descendantsOfGroup": { + "location": "query", + "description": "A group name: \"projects/{project_id_or_number}/groups/{group_id}\". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "A positive number that is the maximum number of results to return.", + "type": "integer", + "location": "query" + }, + "ancestorsOfGroup": { + "description": "A group name: \"projects/{project_id_or_number}/groups/{group_id}\". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], + "flatPath": "v3/projects/{projectsId}/groups" + }, + "update": { + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Group" + }, + "parameters": { + "validateOnly": { + "description": "If true, validate this request but do not update the existing group.", + "type": "boolean", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path", + "description": "Output only. The name of this group. The format is \"projects/{project_id_or_number}/groups/{group_id}\". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ], + "flatPath": "v3/projects/{projectsId}/groups/{groupsId}", + "path": "v3/{+name}", + "id": "monitoring.projects.groups.update", + "description": "Updates an existing group. You can change any group attributes except name.", + "request": { + "$ref": "Group" + } + } + }, + "resources": { + "members": { + "methods": { + "list": { + "parameters": { + "name": { + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path", + "description": "The group whose members are listed. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", + "type": "string", + "required": true + }, + "interval.endTime": { + "location": "query", + "format": "google-datetime", + "description": "Required. The end of the time interval.", + "type": "string" + }, + "filter": { + "location": "query", + "description": "An optional list filter describing the members to be returned. The filter may reference the type, labels, and metadata of monitored resources that comprise the group. For example, to return only resources representing Compute Engine VM instances, use this filter:\nresource.type = \"gce_instance\"\n", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "A positive number that is the maximum number of results to return.", + "type": "integer", + "location": "query" + }, + "interval.startTime": { + "location": "query", + "format": "google-datetime", + "description": "Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], + "flatPath": "v3/projects/{projectsId}/groups/{groupsId}/members", + "id": "monitoring.projects.groups.members.list", + "path": "v3/{+name}/members", + "description": "Lists the monitored resources that are members of a group.", + "response": { + "$ref": "ListGroupMembersResponse" + }, + "httpMethod": "GET", + "parameterOrder": [ + "name" + ] + } + } + } + } + }, + "collectdTimeSeries": { + "methods": { + "create": { + "id": "monitoring.projects.collectdTimeSeries.create", + "path": "v3/{+name}/collectdTimeSeries", + "request": { + "$ref": "CreateCollectdTimeSeriesRequest" + }, + "description": "Stackdriver Monitoring Agent only: Creates a new time series.\u003caside class=\"caution\"\u003eThis method is only for use by the Stackdriver Monitoring Agent. Use projects.timeSeries.create instead.\u003c/aside\u003e", + "response": { + "$ref": "CreateCollectdTimeSeriesResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read", "https://www.googleapis.com/auth/monitoring.write" ], "parameters": { "name": { - "pattern": "^projects/[^/]+/monitoredResourceDescriptors/[^/]+$", + "pattern": "^projects/[^/]+$", "location": "path", - "description": "The monitored resource descriptor to get. The format is \"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}\". The {resource_type} is a predefined type, such as cloudsql_database.", - "required": true, - "type": "string" + "description": "The project in which to create the time series. The format is \"projects/PROJECT_ID_OR_NUMBER\".", + "type": "string", + "required": true } }, - "flatPath": "v3/projects/{projectsId}/monitoredResourceDescriptors/{monitoredResourceDescriptorsId}", - "path": "v3/{+name}", - "id": "monitoring.projects.monitoredResourceDescriptors.get", - "description": "Gets a single monitored resource descriptor. This method does not require a Stackdriver account." + "flatPath": "v3/projects/{projectsId}/collectdTimeSeries" } } } @@ -647,22 +646,30 @@ } }, "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, "fields": { - "location": "query", "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "type": "string", + "location": "query" }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "callback": { - "description": "JSONP", "type": "string", "location": "query" }, "$.xgafv": { + "description": "V1 error format.", + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -671,9 +678,12 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", - "type": "string" + ] + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" }, "alt": { "enumDescriptions": [ @@ -692,14 +702,14 @@ "type": "string" }, "access_token": { - "location": "query", "description": "OAuth access token.", - "type": "string" + "type": "string", + "location": "query" }, "key": { - "location": "query", "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.", - "type": "string" + "type": "string", + "location": "query" }, "quotaUser": { "location": "query", @@ -709,8 +719,8 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" }, "bearer_token": { "location": "query", @@ -718,141 +728,102 @@ "type": "string" }, "oauth_token": { - "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." + "type": "string", + "location": "query" } }, "version": "v3", "baseUrl": "https://monitoring.googleapis.com/", "servicePath": "", - "description": "Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages.", "kind": "discovery#restDescription", + "description": "Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages.", "basePath": "", + "revision": "20170918", "documentationLink": "https://cloud.google.com/monitoring/api/", - "revision": "20170519", "id": "monitoring:v3", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "Range": { - "description": "The range of the population values.", + "CollectdValue": { + "description": "A single data point from a collectd-based plugin.", "type": "object", "properties": { - "max": { - "description": "The maximum of the population values.", - "format": "double", - "type": "number" + "value": { + "$ref": "TypedValue", + "description": "The measurement value." }, - "min": { - "description": "The minimum of the population values.", - "format": "double", - "type": "number" - } - }, - "id": "Range" - }, - "ListGroupsResponse": { - "description": "The ListGroups response.", - "type": "object", - "properties": { - "group": { - "description": "The groups that match the specified filters.", - "type": "array", - "items": { - "$ref": "Group" - } + "dataSourceType": { + "description": "The type of measurement.", + "type": "string", + "enumDescriptions": [ + "An unspecified data source type. This corresponds to google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.", + "An instantaneous measurement of a varying quantity. This corresponds to google.api.MetricDescriptor.MetricKind.GAUGE.", + "A cumulative value over time. This corresponds to google.api.MetricDescriptor.MetricKind.CUMULATIVE.", + "A rate of change of the measurement.", + "An amount of change since the last measurement interval. This corresponds to google.api.MetricDescriptor.MetricKind.DELTA." + ], + "enum": [ + "UNSPECIFIED_DATA_SOURCE_TYPE", + "GAUGE", + "COUNTER", + "DERIVE", + "ABSOLUTE" + ] }, - "nextPageToken": { - "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", + "dataSourceName": { + "description": "The data source for the collectd value. For example there are two data sources for network measurements: \"rx\" and \"tx\".", "type": "string" } }, - "id": "ListGroupsResponse" + "id": "CollectdValue" }, - "CreateCollectdTimeSeriesRequest": { - "description": "The CreateCollectdTimeSeries request.", + "Status": { + "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be:\nSimple to use and understand for most users\nFlexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include:\nPartial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.\nWorkflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.\nBatch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.\nAsynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.\nLogging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { - "resource": { - "$ref": "MonitoredResource", - "description": "The monitored resource associated with the time series." - }, - "collectdPayloads": { - "description": "The collectd payloads representing the time series data. You must not include more than a single point for each time series, so no two payloads can have the same values for all of the fields plugin, plugin_instance, type, and type_instance.", - "type": "array", - "items": { - "$ref": "CollectdPayload" - } - }, - "collectdVersion": { - "description": "The version of collectd that collected the data. Example: \"5.3.0-192.el6\".", - "type": "string" - } - }, - "id": "CreateCollectdTimeSeriesRequest" - }, - "ListGroupMembersResponse": { - "description": "The ListGroupMembers response.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", - "type": "string" - }, - "totalSize": { - "description": "The total number of elements matching this request.", + "code": { "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, - "members": { - "description": "A set of monitored resources in the group.", - "type": "array", - "items": { - "$ref": "MonitoredResource" - } - } - }, - "id": "ListGroupMembersResponse" - }, - "ListMonitoredResourceDescriptorsResponse": { - "id": "ListMonitoredResourceDescriptorsResponse", - "description": "The ListMonitoredResourceDescriptors response.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", "type": "string" }, - "resourceDescriptors": { - "description": "The monitored resource descriptors that are available to this project and that match filter, if present.", - "type": "array", + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", "items": { - "$ref": "MonitoredResourceDescriptor" - } + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "SourceContext": { + "id": "SourceContext", + "description": "SourceContext represents information about the source of a protobuf element, like the file in which it is defined.", + "type": "object", + "properties": { + "fileName": { + "description": "The path-qualified name of the .proto file that contained the associated protobuf element. For example: \"google/protobuf/source_context.proto\".", + "type": "string" } } }, - "TimeSeries": { - "description": "A collection of data points that describes the time-varying values of a metric. A time series is identified by a combination of a fully-specified monitored resource and a fully-specified metric. This type is used for both listing and creating time series.", + "MetricDescriptor": { + "id": "MetricDescriptor", + "description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.", "type": "object", "properties": { - "resource": { - "$ref": "MonitoredResource", - "description": "The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data." - }, "metricKind": { + "description": "Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.", + "type": "string", "enumDescriptions": [ "Do not use this default value.", "An instantaneous measurement of a value.", @@ -864,20 +835,34 @@ "GAUGE", "DELTA", "CUMULATIVE" - ], - "description": "The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE.", + ] + }, + "displayName": { + "description": "A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example \"Request count\".", "type": "string" }, - "metric": { - "description": "The associated metric. A fully-specified metric used to identify the time series.", - "$ref": "Metric" + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "type": "string" }, - "points": { - "description": "The data points of this time series. When listing time series, the order of the points is specified by the list method.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION.", - "type": "array", + "unit": { + "description": "The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)\nbit bit\nBy byte\ns second\nmin minute\nh hour\nd dayPrefixes (PREFIX)\nk kilo (10**3)\nM mega (10**6)\nG giga (10**9)\nT tera (10**12)\nP peta (10**15)\nE exa (10**18)\nZ zetta (10**21)\nY yotta (10**24)\nm milli (10**-3)\nu micro (10**-6)\nn nano (10**-9)\np pico (10**-12)\nf femto (10**-15)\na atto (10**-18)\nz zepto (10**-21)\ny yocto (10**-24)\nKi kibi (2**10)\nMi mebi (2**20)\nGi gibi (2**30)\nTi tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors:\n/ division (as an infix operator, e.g. 1/s).\n. multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows:\nExpression = Component { \".\" Component } { \"/\" Component } ;\n\nComponent = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\nAnnotation = \"{\" NAME \"}\" ;\nNotes:\nAnnotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s.\nNAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'.", + "type": "string" + }, + "labels": { + "description": "The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.", "items": { - "$ref": "Point" - } + "$ref": "LabelDescriptor" + }, + "type": "array" + }, + "name": { + "description": "The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id:\n\"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"\n", + "type": "string" + }, + "type": { + "description": "The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example:\n\"custom.googleapis.com/invoice/paid/amount\"\n\"appengine.googleapis.com/http/server/response_latencies\"\n", + "type": "string" }, "valueType": { "enumDescriptions": [ @@ -898,9 +883,166 @@ "DISTRIBUTION", "MONEY" ], - "description": "The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field.", + "description": "Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.", "type": "string" } + } + }, + "Range": { + "description": "The range of the population values.", + "type": "object", + "properties": { + "min": { + "format": "double", + "description": "The minimum of the population values.", + "type": "number" + }, + "max": { + "format": "double", + "description": "The maximum of the population values.", + "type": "number" + } + }, + "id": "Range" + }, + "ListGroupsResponse": { + "description": "The ListGroups response.", + "type": "object", + "properties": { + "group": { + "description": "The groups that match the specified filters.", + "items": { + "$ref": "Group" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", + "type": "string" + } + }, + "id": "ListGroupsResponse" + }, + "ListGroupMembersResponse": { + "description": "The ListGroupMembers response.", + "type": "object", + "properties": { + "totalSize": { + "format": "int32", + "description": "The total number of elements matching this request.", + "type": "integer" + }, + "members": { + "description": "A set of monitored resources in the group.", + "items": { + "$ref": "MonitoredResource" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", + "type": "string" + } + }, + "id": "ListGroupMembersResponse" + }, + "CreateCollectdTimeSeriesRequest": { + "id": "CreateCollectdTimeSeriesRequest", + "description": "The CreateCollectdTimeSeries request.", + "type": "object", + "properties": { + "collectdPayloads": { + "description": "The collectd payloads representing the time series data. You must not include more than a single point for each time series, so no two payloads can have the same values for all of the fields plugin, plugin_instance, type, and type_instance.", + "items": { + "$ref": "CollectdPayload" + }, + "type": "array" + }, + "resource": { + "$ref": "MonitoredResource", + "description": "The monitored resource associated with the time series." + }, + "collectdVersion": { + "description": "The version of collectd that collected the data. Example: \"5.3.0-192.el6\".", + "type": "string" + } + } + }, + "ListMonitoredResourceDescriptorsResponse": { + "id": "ListMonitoredResourceDescriptorsResponse", + "description": "The ListMonitoredResourceDescriptors response.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", + "type": "string" + }, + "resourceDescriptors": { + "description": "The monitored resource descriptors that are available to this project and that match filter, if present.", + "items": { + "$ref": "MonitoredResourceDescriptor" + }, + "type": "array" + } + } + }, + "TimeSeries": { + "description": "A collection of data points that describes the time-varying values of a metric. A time series is identified by a combination of a fully-specified monitored resource and a fully-specified metric. This type is used for both listing and creating time series.", + "type": "object", + "properties": { + "resource": { + "description": "The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data.", + "$ref": "MonitoredResource" + }, + "metricKind": { + "enumDescriptions": [ + "Do not use this default value.", + "An instantaneous measurement of a value.", + "The change in a value during a time interval.", + "A value accumulated over a time interval. Cumulative measurements in a time series should have the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points." + ], + "enum": [ + "METRIC_KIND_UNSPECIFIED", + "GAUGE", + "DELTA", + "CUMULATIVE" + ], + "description": "The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE.", + "type": "string" + }, + "points": { + "description": "The data points of this time series. When listing time series, the order of the points is specified by the list method.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION.", + "items": { + "$ref": "Point" + }, + "type": "array" + }, + "metric": { + "description": "The associated metric. A fully-specified metric used to identify the time series.", + "$ref": "Metric" + }, + "valueType": { + "description": "The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field.", + "type": "string", + "enumDescriptions": [ + "Do not use this default value.", + "The value is a boolean. This value type can be used only if the metric kind is GAUGE.", + "The value is a signed 64-bit integer.", + "The value is a double precision floating point number.", + "The value is a text string. This value type can be used only if the metric kind is GAUGE.", + "The value is a Distribution.", + "The value is money." + ], + "enum": [ + "VALUE_TYPE_UNSPECIFIED", + "BOOL", + "INT64", + "DOUBLE", + "STRING", + "DISTRIBUTION", + "MONEY" + ] + } }, "id": "TimeSeries" }, @@ -910,10 +1052,10 @@ "properties": { "timeSeries": { "description": "The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each TimeSeries value must fully specify a unique time series by supplying all label values for the metric and the monitored resource.", - "type": "array", "items": { "$ref": "TimeSeries" - } + }, + "type": "array" } }, "id": "CreateTimeSeriesRequest" @@ -923,40 +1065,42 @@ "type": "object", "properties": { "range": { - "description": "If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Stackdriver Monitoring API v3.", - "$ref": "Range" - }, - "mean": { - "description": "The arithmetic mean of the values in the population. If count is zero then this field must be zero.", - "format": "double", - "type": "number" + "$ref": "Range", + "description": "If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Stackdriver Monitoring API v3." }, "count": { - "type": "string", + "format": "int64", "description": "The number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided.", - "format": "int64" + "type": "string" + }, + "mean": { + "format": "double", + "description": "The arithmetic mean of the values in the population. If count is zero then this field must be zero.", + "type": "number" }, "bucketCounts": { "description": "Required in the Stackdriver Monitoring API v3. The values for each bucket specified in bucket_options. The sum of the values in bucketCounts must equal the value in the count field of the Distribution object. The order of the bucket counts follows the numbering schemes described for the three bucket types. The underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; and the overflow bucket has number N-1. The size of bucket_counts must not be greater than N. If the size is less than N, then the remaining buckets are assigned values of zero.", - "type": "array", "items": { "format": "int64", "type": "string" - } + }, + "type": "array" }, "bucketOptions": { "description": "Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries.", "$ref": "BucketOptions" }, "sumOfSquaredDeviation": { - "description": "The sum of squared deviations from the mean of the values in the population. For values x_i this is:\nSum[i=1..n]((x_i - mean)^2)\nKnuth, \"The Art of Computer Programming\", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass.If count is zero then this field must be zero.", "format": "double", + "description": "The sum of squared deviations from the mean of the values in the population. For values x_i this is:\nSum[i=1..n]((x_i - mean)^2)\nKnuth, \"The Art of Computer Programming\", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass.If count is zero then this field must be zero.", "type": "number" } }, "id": "Distribution" }, "MonitoredResource": { + "id": "MonitoredResource", + "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n", "type": "object", "properties": { "type": { @@ -964,111 +1108,159 @@ "type": "string" }, "labels": { + "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".", - "type": "object" + } } - }, - "id": "MonitoredResource", - "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n" + } }, "ListMetricDescriptorsResponse": { + "id": "ListMetricDescriptorsResponse", "description": "The ListMetricDescriptors response.", "type": "object", "properties": { + "nextPageToken": { + "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", + "type": "string" + }, "metricDescriptors": { "description": "The metric descriptors that are available to the project and that match the value of filter, if present.", - "type": "array", "items": { "$ref": "MetricDescriptor" - } + }, + "type": "array" + } + } + }, + "CollectdPayloadError": { + "description": "Describes the error status for payloads that were not written.", + "type": "object", + "properties": { + "valueErrors": { + "description": "Records the error status for values that were not written due to an error.Failed payloads for which nothing is written will not include partial value errors.", + "items": { + "$ref": "CollectdValueError" + }, + "type": "array" }, - "nextPageToken": { - "type": "string", - "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method." + "error": { + "description": "Records the error status for the payload. If this field is present, the partial errors for nested values won't be populated.", + "$ref": "Status" + }, + "index": { + "format": "int32", + "description": "The zero-based index in CreateCollectdTimeSeriesRequest.collectd_payloads.", + "type": "integer" } }, - "id": "ListMetricDescriptorsResponse" + "id": "CollectdPayloadError" }, "MonitoredResourceDescriptor": { + "id": "MonitoredResourceDescriptor", "description": "An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of \"gce_instance\" and specifies the use of the labels \"instance_id\" and \"zone\" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API.", "type": "object", "properties": { + "labels": { + "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\".", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + }, "name": { "description": "Optional. The resource name of the monitored resource descriptor: \"projects/{project_id}/monitoredResourceDescriptors/{type}\" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format \"monitoredResourceDescriptors/{type}\".", "type": "string" }, - "displayName": { - "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".", - "type": "string" - }, "description": { "description": "Optional. A detailed description of the monitored resource type that might be used in documentation.", "type": "string" }, + "displayName": { + "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".", + "type": "string" + }, "type": { "description": "Required. The monitored resource type. For example, the type \"cloudsql_database\" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters.", "type": "string" - }, - "labels": { - "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\".", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } } - }, - "id": "MonitoredResourceDescriptor" + } }, "TypedValue": { - "id": "TypedValue", "description": "A single strongly-typed value.", "type": "object", "properties": { - "boolValue": { - "description": "A Boolean value: true or false.", - "type": "boolean" + "distributionValue": { + "description": "A distribution value.", + "$ref": "Distribution" }, "stringValue": { "description": "A variable-length string value.", "type": "string" }, + "boolValue": { + "description": "A Boolean value: true or false.", + "type": "boolean" + }, "doubleValue": { - "description": "A 64-bit double-precision floating-point number. Its magnitude is approximately ±10\u003csup\u003e±300\u003c/sup\u003e and it has 16 significant digits of precision.", "format": "double", + "description": "A 64-bit double-precision floating-point number. Its magnitude is approximately ±10\u003csup\u003e±300\u003c/sup\u003e and it has 16 significant digits of precision.", "type": "number" }, "int64Value": { - "type": "string", + "format": "int64", "description": "A 64-bit integer. Its range is approximately ±9.2x10\u003csup\u003e18\u003c/sup\u003e.", - "format": "int64" - }, - "distributionValue": { - "description": "A distribution value.", - "$ref": "Distribution" + "type": "string" } - } + }, + "id": "TypedValue" }, - "CollectdPayload": { + "CollectdValueError": { + "description": "Describes the error status for values that were not written.", "type": "object", "properties": { + "error": { + "description": "Records the error status for the value.", + "$ref": "Status" + }, + "index": { + "format": "int32", + "description": "The zero-based index in CollectdPayload.values within the parent CreateCollectdTimeSeriesRequest.collectd_payloads.", + "type": "integer" + } + }, + "id": "CollectdValueError" + }, + "CollectdPayload": { + "description": "A collection of data points sent from a collectd-based plugin. See the collectd documentation for more information.", + "type": "object", + "properties": { + "pluginInstance": { + "description": "The instance name of the plugin Example: \"hdcl\".", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "The end time of the interval.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "The start time of the interval.", + "type": "string" + }, "values": { "description": "The measured values during this time interval. Each value must have a different dataSourceName.", - "type": "array", "items": { "$ref": "CollectdValue" - } + }, + "type": "array" }, "typeInstance": { "description": "The measurement type instance. Example: \"used\".", "type": "string" }, - "type": { - "description": "The measurement type. Example: \"memory\".", - "type": "string" - }, "metadata": { "additionalProperties": { "$ref": "TypedValue" @@ -1076,52 +1268,62 @@ "description": "The measurement metadata. Example: \"process_id\" -\u003e 12345", "type": "object" }, + "type": { + "description": "The measurement type. Example: \"memory\".", + "type": "string" + }, "plugin": { "description": "The name of the plugin. Example: \"disk\".", "type": "string" - }, - "pluginInstance": { - "description": "The instance name of the plugin Example: \"hdcl\".", - "type": "string" - }, - "endTime": { - "description": "The end time of the interval.", - "format": "google-datetime", - "type": "string" - }, - "startTime": { - "description": "The start time of the interval.", - "format": "google-datetime", - "type": "string" } }, - "id": "CollectdPayload", - "description": "A collection of data points sent from a collectd-based plugin. See the collectd documentation for more information." + "id": "CollectdPayload" + }, + "CreateCollectdTimeSeriesResponse": { + "description": "The CreateCollectdTimeSeries response.", + "type": "object", + "properties": { + "payloadErrors": { + "description": "Records the error status for points that were not written due to an error.Failed requests for which nothing is written will return an error response instead.", + "items": { + "$ref": "CollectdPayloadError" + }, + "type": "array" + } + }, + "id": "CreateCollectdTimeSeriesResponse" }, "Linear": { - "id": "Linear", "description": "Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): offset + (width * i). Lower bound (1 \u003c= i \u003c N): offset + (width * (i - 1)).", "type": "object", "properties": { - "width": { - "description": "Must be greater than 0.", - "format": "double", - "type": "number" - }, "offset": { - "description": "Lower bound of the first bucket.", "format": "double", + "description": "Lower bound of the first bucket.", "type": "number" }, "numFiniteBuckets": { - "description": "Must be greater than 0.", "format": "int32", + "description": "Must be greater than 0.", "type": "integer" + }, + "width": { + "format": "double", + "description": "Must be greater than 0.", + "type": "number" } - } + }, + "id": "Linear" }, "Option": { + "id": "Option", + "description": "A protocol buffer option, which can be attached to a message, field, enumeration, etc.", + "type": "object", "properties": { + "name": { + "description": "The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, \"map_entry\". For custom options, it should be the fully-qualified name. For example, \"google.api.http\".", + "type": "string" + }, "value": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", @@ -1129,15 +1331,8 @@ }, "description": "The option's value packed in an Any message. If the value is a primitive, the corresponding wrapper type defined in google/protobuf/wrappers.proto should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type.", "type": "object" - }, - "name": { - "description": "The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, \"map_entry\". For custom options, it should be the fully-qualified name. For example, \"google.api.http\".", - "type": "string" } - }, - "id": "Option", - "description": "A protocol buffer option, which can be attached to a message, field, enumeration, etc.", - "type": "object" + } }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.", @@ -1146,55 +1341,55 @@ "id": "Empty" }, "Explicit": { + "id": "Explicit", + "description": "Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): boundsi Lower bound (1 \u003c= i \u003c N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets.", + "type": "object", "properties": { "bounds": { "description": "The values must be monotonically increasing.", - "type": "array", "items": { - "type": "number", - "format": "double" - } + "format": "double", + "type": "number" + }, + "type": "array" } - }, - "id": "Explicit", - "description": "Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): boundsi Lower bound (1 \u003c= i \u003c N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets.", - "type": "object" + } }, "TimeInterval": { + "id": "TimeInterval", "description": "A time interval extending just after a start time through an end time. If the start time is the same as the end time, then the interval represents a single point in time.", "type": "object", "properties": { "endTime": { - "description": "Required. The end of the time interval.", "format": "google-datetime", + "description": "Required. The end of the time interval.", "type": "string" }, "startTime": { - "description": "Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.", "format": "google-datetime", + "description": "Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.", "type": "string" } - }, - "id": "TimeInterval" + } }, "Exponential": { "description": "Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): scale * (growth_factor ^ i). Lower bound (1 \u003c= i \u003c N): scale * (growth_factor ^ (i - 1)).", "type": "object", "properties": { "growthFactor": { - "description": "Must be greater than 1.", "format": "double", + "description": "Must be greater than 1.", "type": "number" }, "scale": { - "description": "Must be greater than 0.", "format": "double", + "description": "Must be greater than 0.", "type": "number" }, "numFiniteBuckets": { - "type": "integer", + "format": "int32", "description": "Must be greater than 0.", - "format": "int32" + "type": "integer" } }, "id": "Exponential" @@ -1215,9 +1410,47 @@ "id": "Point" }, "Field": { + "id": "Field", "description": "A single field of a message type.", "type": "object", "properties": { + "packed": { + "description": "Whether to use alternative packed wire representation.", + "type": "boolean" + }, + "cardinality": { + "enumDescriptions": [ + "For fields with unknown cardinality.", + "For optional fields.", + "For required fields. Proto2 syntax only.", + "For repeated fields." + ], + "enum": [ + "CARDINALITY_UNKNOWN", + "CARDINALITY_OPTIONAL", + "CARDINALITY_REQUIRED", + "CARDINALITY_REPEATED" + ], + "description": "The field cardinality.", + "type": "string" + }, + "defaultValue": { + "description": "The string value of the default value of this field. Proto2 syntax only.", + "type": "string" + }, + "name": { + "description": "The field name.", + "type": "string" + }, + "typeUrl": { + "description": "The field type URL, without the scheme, for message or enumeration types. Example: \"type.googleapis.com/google.protobuf.Timestamp\".", + "type": "string" + }, + "number": { + "format": "int32", + "description": "The field number.", + "type": "integer" + }, "jsonName": { "description": "The field JSON name.", "type": "string" @@ -1270,73 +1503,35 @@ }, "options": { "description": "The protocol buffer options.", - "type": "array", "items": { "$ref": "Option" - } + }, + "type": "array" }, "oneofIndex": { + "format": "int32", "description": "The index of the field type in Type.oneofs, for message or enumeration types. The first type has index 1; zero means the type is not in the list.", - "format": "int32", - "type": "integer" - }, - "cardinality": { - "enum": [ - "CARDINALITY_UNKNOWN", - "CARDINALITY_OPTIONAL", - "CARDINALITY_REQUIRED", - "CARDINALITY_REPEATED" - ], - "description": "The field cardinality.", - "type": "string", - "enumDescriptions": [ - "For fields with unknown cardinality.", - "For optional fields.", - "For required fields. Proto2 syntax only.", - "For repeated fields." - ] - }, - "packed": { - "description": "Whether to use alternative packed wire representation.", - "type": "boolean" - }, - "defaultValue": { - "description": "The string value of the default value of this field. Proto2 syntax only.", - "type": "string" - }, - "name": { - "description": "The field name.", - "type": "string" - }, - "typeUrl": { - "description": "The field type URL, without the scheme, for message or enumeration types. Example: \"type.googleapis.com/google.protobuf.Timestamp\".", - "type": "string" - }, - "number": { - "description": "The field number.", - "format": "int32", "type": "integer" } - }, - "id": "Field" + } }, "Metric": { + "description": "A specific metric, identified by specifying values for all of the labels of a MetricDescriptor.", + "type": "object", "properties": { - "type": { - "description": "An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.", - "type": "string" - }, "labels": { "additionalProperties": { "type": "string" }, "description": "The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.", "type": "object" + }, + "type": { + "description": "An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.", + "type": "string" } }, - "id": "Metric", - "description": "A specific metric, identified by specifying values for all of the labels of a MetricDescriptor.", - "type": "object" + "id": "Metric" }, "ListTimeSeriesResponse": { "description": "The ListTimeSeries response.", @@ -1344,10 +1539,10 @@ "properties": { "timeSeries": { "description": "One or more time series that match the filter included in the request.", - "type": "array", "items": { "$ref": "TimeSeries" - } + }, + "type": "array" }, "nextPageToken": { "description": "If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method.", @@ -1357,12 +1552,21 @@ "id": "ListTimeSeriesResponse" }, "LabelDescriptor": { + "id": "LabelDescriptor", + "description": "A description of a label.", + "type": "object", "properties": { + "key": { + "description": "The label key.", + "type": "string" + }, "description": { "description": "A human-readable description for the label.", "type": "string" }, "valueType": { + "description": "The type of data that can be assigned to the label.", + "type": "string", "enumDescriptions": [ "A variable-length string. This is the default.", "Boolean; true or false.", @@ -1372,66 +1576,9 @@ "STRING", "BOOL", "INT64" - ], - "description": "The type of data that can be assigned to the label.", - "type": "string" - }, - "key": { - "description": "The label key.", - "type": "string" + ] } - }, - "id": "LabelDescriptor", - "description": "A description of a label.", - "type": "object" - }, - "Type": { - "type": "object", - "properties": { - "options": { - "type": "array", - "items": { - "$ref": "Option" - }, - "description": "The protocol buffer options." - }, - "fields": { - "description": "The list of fields.", - "type": "array", - "items": { - "$ref": "Field" - } - }, - "name": { - "description": "The fully qualified message name.", - "type": "string" - }, - "oneofs": { - "description": "The list of types appearing in oneof definitions in this type.", - "type": "array", - "items": { - "type": "string" - } - }, - "sourceContext": { - "description": "The source context.", - "$ref": "SourceContext" - }, - "syntax": { - "enumDescriptions": [ - "Syntax proto2.", - "Syntax proto3." - ], - "enum": [ - "SYNTAX_PROTO2", - "SYNTAX_PROTO3" - ], - "description": "The source syntax.", - "type": "string" - } - }, - "id": "Type", - "description": "A protocol buffer message type." + } }, "Group": { "id": "Group", @@ -1442,14 +1589,14 @@ "description": "The filter used to determine which monitored resources belong to this group.", "type": "string" }, - "name": { - "description": "Output only. The name of this group. The format is \"projects/{project_id_or_number}/groups/{group_id}\". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically.", - "type": "string" - }, "parentName": { "description": "The name of the group's parent, if it has one. The format is \"projects/{project_id_or_number}/groups/{group_id}\". For groups with no parent, parentName is the empty string, \"\".", "type": "string" }, + "name": { + "description": "Output only. The name of this group. The format is \"projects/{project_id_or_number}/groups/{group_id}\". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically.", + "type": "string" + }, "displayName": { "description": "A user-assigned name for this group, used only for display purposes.", "type": "string" @@ -1460,162 +1607,94 @@ } } }, + "Type": { + "id": "Type", + "description": "A protocol buffer message type.", + "type": "object", + "properties": { + "name": { + "description": "The fully qualified message name.", + "type": "string" + }, + "oneofs": { + "description": "The list of types appearing in oneof definitions in this type.", + "items": { + "type": "string" + }, + "type": "array" + }, + "syntax": { + "description": "The source syntax.", + "type": "string", + "enumDescriptions": [ + "Syntax proto2.", + "Syntax proto3." + ], + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ] + }, + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." + }, + "options": { + "description": "The protocol buffer options.", + "items": { + "$ref": "Option" + }, + "type": "array" + }, + "fields": { + "description": "The list of fields.", + "items": { + "$ref": "Field" + }, + "type": "array" + } + } + }, "BucketOptions": { + "id": "BucketOptions", + "description": "BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i \u003e 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.", + "type": "object", "properties": { "exponentialBuckets": { "description": "The exponential buckets.", "$ref": "Exponential" }, + "explicitBuckets": { + "$ref": "Explicit", + "description": "The explicit buckets." + }, "linearBuckets": { "$ref": "Linear", "description": "The linear bucket." - }, - "explicitBuckets": { - "description": "The explicit buckets.", - "$ref": "Explicit" } - }, - "id": "BucketOptions", - "description": "BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i \u003e 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.", - "type": "object" - }, - "CollectdValue": { - "description": "A single data point from a collectd-based plugin.", - "type": "object", - "properties": { - "value": { - "description": "The measurement value.", - "$ref": "TypedValue" - }, - "dataSourceType": { - "enumDescriptions": [ - "An unspecified data source type. This corresponds to google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.", - "An instantaneous measurement of a varying quantity. This corresponds to google.api.MetricDescriptor.MetricKind.GAUGE.", - "A cumulative value over time. This corresponds to google.api.MetricDescriptor.MetricKind.CUMULATIVE.", - "A rate of change of the measurement.", - "An amount of change since the last measurement interval. This corresponds to google.api.MetricDescriptor.MetricKind.DELTA." - ], - "enum": [ - "UNSPECIFIED_DATA_SOURCE_TYPE", - "GAUGE", - "COUNTER", - "DERIVE", - "ABSOLUTE" - ], - "description": "The type of measurement.", - "type": "string" - }, - "dataSourceName": { - "description": "The data source for the collectd value. For example there are two data sources for network measurements: \"rx\" and \"tx\".", - "type": "string" - } - }, - "id": "CollectdValue" - }, - "SourceContext": { - "description": "SourceContext represents information about the source of a protobuf element, like the file in which it is defined.", - "type": "object", - "properties": { - "fileName": { - "description": "The path-qualified name of the .proto file that contained the associated protobuf element. For example: \"google/protobuf/source_context.proto\".", - "type": "string" - } - }, - "id": "SourceContext" - }, - "MetricDescriptor": { - "description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.", - "type": "object", - "properties": { - "metricKind": { - "description": "Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.", - "type": "string", - "enumDescriptions": [ - "Do not use this default value.", - "An instantaneous measurement of a value.", - "The change in a value during a time interval.", - "A value accumulated over a time interval. Cumulative measurements in a time series should have the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points." - ], - "enum": [ - "METRIC_KIND_UNSPECIFIED", - "GAUGE", - "DELTA", - "CUMULATIVE" - ] - }, - "description": { - "description": "A detailed description of the metric, which can be used in documentation.", - "type": "string" - }, - "displayName": { - "description": "A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example \"Request count\".", - "type": "string" - }, - "unit": { - "type": "string", - "description": "The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)\nbit bit\nBy byte\ns second\nmin minute\nh hour\nd dayPrefixes (PREFIX)\nk kilo (10**3)\nM mega (10**6)\nG giga (10**9)\nT tera (10**12)\nP peta (10**15)\nE exa (10**18)\nZ zetta (10**21)\nY yotta (10**24)\nm milli (10**-3)\nu micro (10**-6)\nn nano (10**-9)\np pico (10**-12)\nf femto (10**-15)\na atto (10**-18)\nz zepto (10**-21)\ny yocto (10**-24)\nKi kibi (2**10)\nMi mebi (2**20)\nGi gibi (2**30)\nTi tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors:\n/ division (as an infix operator, e.g. 1/s).\n. multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows:\nExpression = Component { \".\" Component } { \"/\" Component } ;\n\nComponent = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\nAnnotation = \"{\" NAME \"}\" ;\nNotes:\nAnnotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s.\nNAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'." - }, - "labels": { - "description": "The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } - }, - "name": { - "description": "The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id:\n\"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"\n", - "type": "string" - }, - "type": { - "description": "The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example:\n\"custom.googleapis.com/invoice/paid/amount\"\n\"appengine.googleapis.com/http/server/response_latencies\"\n", - "type": "string" - }, - "valueType": { - "description": "Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.", - "type": "string", - "enumDescriptions": [ - "Do not use this default value.", - "The value is a boolean. This value type can be used only if the metric kind is GAUGE.", - "The value is a signed 64-bit integer.", - "The value is a double precision floating point number.", - "The value is a text string. This value type can be used only if the metric kind is GAUGE.", - "The value is a Distribution.", - "The value is money." - ], - "enum": [ - "VALUE_TYPE_UNSPECIFIED", - "BOOL", - "INT64", - "DOUBLE", - "STRING", - "DISTRIBUTION", - "MONEY" - ] - } - }, - "id": "MetricDescriptor" + } } }, "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" }, "protocol": "rest", "canonicalName": "Monitoring", "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/monitoring": { - "description": "View and write monitoring data for all of your Google and third-party Cloud and API projects" - }, "https://www.googleapis.com/auth/monitoring.write": { "description": "Publish metric data to your Google Cloud projects" }, + "https://www.googleapis.com/auth/monitoring.read": { + "description": "View monitoring data for all of your Google Cloud and third-party projects" + }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" }, - "https://www.googleapis.com/auth/monitoring.read": { - "description": "View monitoring data for all of your Google Cloud and third-party projects" + "https://www.googleapis.com/auth/monitoring": { + "description": "View and write monitoring data for all of your Google and third-party Cloud and API projects" } } } @@ -1624,5 +1703,7 @@ "ownerDomain": "google.com", "name": "monitoring", "batchPath": "batch", - "title": "Stackdriver Monitoring API" + "fullyEncodeReservedExpansion": true, + "title": "Stackdriver Monitoring API", + "ownerName": "Google" } diff --git a/etc/api/oauth2/v1/oauth2-api.json b/etc/api/oauth2/v1/oauth2-api.json index 9838be754f..1de8b48fe7 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/yA-nmrGtGyV39fzR7zooTCbGs10\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/PozAB5R3hMeaeI5NL5FrPjwfUdY\"", "discoveryVersion": "v1", "id": "oauth2:v1", "name": "oauth2", "version": "v1", - "revision": "20170509", + "revision": "20170807", "title": "Google OAuth2 API", "description": "Obtains end-user authorization grants for use with other Google APIs.", "ownerDomain": "google.com", @@ -20,7 +20,7 @@ "basePath": "/", "rootUrl": "https://www.googleapis.com/", "servicePath": "", - "batchPath": "batch", + "batchPath": "batch/oauth2/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/oauth2/v2/oauth2-api.json b/etc/api/oauth2/v2/oauth2-api.json index 277bbd1d2c..7cd7d2a7fb 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/JnT6R6N-Azl-6h2VUiLhx9Ixv98\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/UI_PjeJG3puXfKEXm-20UHWIhYQ\"", "discoveryVersion": "v1", "id": "oauth2:v2", "name": "oauth2", "version": "v2", - "revision": "20170509", + "revision": "20170807", "title": "Google OAuth2 API", "description": "Obtains end-user authorization grants for use with other Google APIs.", "ownerDomain": "google.com", diff --git a/etc/api/oslogin/v1alpha/oslogin-api.json b/etc/api/oslogin/v1alpha/oslogin-api.json new file mode 100644 index 0000000000..d362de76e3 --- /dev/null +++ b/etc/api/oslogin/v1alpha/oslogin-api.json @@ -0,0 +1,397 @@ +{ + "ownerDomain": "google.com", + "name": "oslogin", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud OS Login API", + "ownerName": "Google", + "resources": { + "users": { + "methods": { + "importSshPublicKey": { + "description": "Adds an SSH public key and returns the profile information. Default POSIX\naccount information is set when no username and UID exist as part of the\nlogin profile.", + "request": { + "$ref": "SshPublicKey" + }, + "response": { + "$ref": "ImportSshPublicKeyResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "The unique ID for the user in format `users/{user}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1alpha/users/{usersId}:importSshPublicKey", + "id": "oslogin.users.importSshPublicKey", + "path": "v1alpha/{+parent}:importSshPublicKey" + }, + "getLoginProfile": { + "description": "Retrieves the profile information used for logging in to a virtual machine\non Google Compute Engine.", + "response": { + "$ref": "LoginProfile" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ], + "parameters": { + "name": { + "description": "The unique ID for the user in format `users/{user}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1alpha/users/{usersId}/loginProfile", + "id": "oslogin.users.getLoginProfile", + "path": "v1alpha/{+name}/loginProfile" + } + }, + "resources": { + "sshPublicKeys": { + "methods": { + "patch": { + "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + "request": { + "$ref": "SshPublicKey" + }, + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "SshPublicKey" + }, + "parameters": { + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Mask to control which fields get updated. Updates all if not present.", + "type": "string" + }, + "name": { + "description": "The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1alpha/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1alpha/{+name}", + "id": "oslogin.users.sshPublicKeys.patch" + }, + "get": { + "description": "Retrieves an SSH public key.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "SshPublicKey" + }, + "parameters": { + "name": { + "location": "path", + "description": "The fingerprint of the public key to retrieve. Public keys are identified\nby their SHA-256 fingerprint. The fingerprint of the public key is in\nformat `users/{user}/sshPublicKeys/{fingerprint}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1alpha/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1alpha/{+name}", + "id": "oslogin.users.sshPublicKeys.get" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "parameters": { + "name": { + "description": "The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1alpha/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "id": "oslogin.users.sshPublicKeys.delete", + "path": "v1alpha/{+name}", + "description": "Deletes an SSH public key." + } + } + } + } + } + }, + "parameters": { + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + } + }, + "version": "v1alpha", + "baseUrl": "https://oslogin.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Manages OS login configuration for Directory API users.", + "servicePath": "", + "basePath": "", + "id": "oslogin:v1alpha", + "documentationLink": "https://cloud.google.com/compute/docs/oslogin/rest/", + "revision": "20170926", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "PosixAccount": { + "description": "The POSIX account information associated with a Directory API User.", + "type": "object", + "properties": { + "shell": { + "description": "The path to the logic shell for this account.", + "type": "string" + }, + "homeDirectory": { + "description": "The path to the home directory for this account.", + "type": "string" + }, + "systemId": { + "description": "System identifier for which account the username or uid applies to.\nBy default, the empty value is used.", + "type": "string" + }, + "gecos": { + "description": "The GECOS (user information) entry for this account.", + "type": "string" + }, + "primary": { + "description": "Only one POSIX account can be marked as primary.", + "type": "boolean" + }, + "gid": { + "format": "int64", + "description": "The default group ID.", + "type": "string" + }, + "uid": { + "format": "int64", + "description": "The user ID.", + "type": "string" + }, + "username": { + "description": "The username of the POSIX account.", + "type": "string" + } + }, + "id": "PosixAccount" + }, + "LoginProfile": { + "description": "The Directory API profile information used for logging in to a virtual\nmachine on Google Compute Engine.", + "type": "object", + "properties": { + "suspended": { + "description": "Indicates if the user is suspended.", + "type": "boolean" + }, + "sshPublicKeys": { + "additionalProperties": { + "$ref": "SshPublicKey" + }, + "description": "A map from SSH public key fingerprint to the associated key object.", + "type": "object" + }, + "posixAccounts": { + "description": "The list of POSIX accounts associated with the Directory API user.", + "items": { + "$ref": "PosixAccount" + }, + "type": "array" + }, + "name": { + "description": "A unique user ID for identifying the user.", + "type": "string" + } + }, + "id": "LoginProfile" + }, + "SshPublicKey": { + "description": "The SSH public key information associated with a Directory API User.", + "type": "object", + "properties": { + "expirationTimeUsec": { + "format": "int64", + "description": "An expiration time in microseconds since epoch.", + "type": "string" + }, + "fingerprint": { + "description": "The SHA-256 fingerprint of the SSH public key.\nOutput only.", + "type": "string" + }, + "key": { + "description": "Public key text in SSH format, defined by\n\u003ca href=\"https://www.ietf.org/rfc/rfc4253.txt\" target=\"_blank\"\u003eRFC4253\u003c/a\u003e\nsection 6.6.", + "type": "string" + } + }, + "id": "SshPublicKey" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "ImportSshPublicKeyResponse": { + "description": "A response message for importing an SSH public key.", + "type": "object", + "properties": { + "loginProfile": { + "description": "The login profile information for the user.", + "$ref": "LoginProfile" + } + }, + "id": "ImportSshPublicKeyResponse" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "canonicalName": "Cloud OS Login", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute": { + "description": "View and manage your Google Compute Engine resources" + } + } + } + }, + "rootUrl": "https://oslogin.googleapis.com/" +} diff --git a/etc/api/oslogin/v1beta/crates/1.0.6-api+20170926 b/etc/api/oslogin/v1beta/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/oslogin/v1beta/crates/1.0.6-cli+20170926 b/etc/api/oslogin/v1beta/crates/1.0.6-cli+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/oslogin/v1beta/oslogin-api.json b/etc/api/oslogin/v1beta/oslogin-api.json new file mode 100644 index 0000000000..d643e92381 --- /dev/null +++ b/etc/api/oslogin/v1beta/oslogin-api.json @@ -0,0 +1,397 @@ +{ + "version": "v1beta", + "baseUrl": "https://oslogin.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Manages OS login configuration for Directory API users.", + "servicePath": "", + "basePath": "", + "revision": "20170926", + "documentationLink": "https://cloud.google.com/compute/docs/oslogin/rest/", + "id": "oslogin:v1beta", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "LoginProfile": { + "type": "object", + "properties": { + "posixAccounts": { + "items": { + "$ref": "PosixAccount" + }, + "type": "array", + "description": "The list of POSIX accounts associated with the user." + }, + "name": { + "description": "The primary email address that uniquely identifies the user.", + "type": "string" + }, + "suspended": { + "type": "boolean", + "description": "Indicates if the user is suspended. A suspended user cannot log in but\ntheir profile information is retained." + }, + "sshPublicKeys": { + "additionalProperties": { + "$ref": "SshPublicKey" + }, + "description": "A map from SSH public key fingerprint to the associated key object.", + "type": "object" + } + }, + "id": "LoginProfile", + "description": "The user profile information used for logging in to a virtual machine on\nGoogle Compute Engine." + }, + "SshPublicKey": { + "description": "The SSH public key information associated with a Directory API User.", + "type": "object", + "properties": { + "expirationTimeUsec": { + "type": "string", + "format": "int64", + "description": "An expiration time in microseconds since epoch." + }, + "fingerprint": { + "type": "string", + "description": "The SHA-256 fingerprint of the SSH public key.\nOutput only." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by\n\u003ca href=\"https://www.ietf.org/rfc/rfc4253.txt\" target=\"_blank\"\u003eRFC4253\u003c/a\u003e\nsection 6.6." + } + }, + "id": "SshPublicKey" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "ImportSshPublicKeyResponse": { + "type": "object", + "properties": { + "loginProfile": { + "$ref": "LoginProfile", + "description": "The login profile information for the user." + } + }, + "id": "ImportSshPublicKeyResponse", + "description": "A response message for importing an SSH public key." + }, + "PosixAccount": { + "description": "The POSIX account information associated with a Directory API User.", + "type": "object", + "properties": { + "gecos": { + "type": "string", + "description": "The GECOS (user information) entry for this account." + }, + "systemId": { + "type": "string", + "description": "System identifier for which account the username or uid applies to.\nBy default, the empty value is used." + }, + "primary": { + "type": "boolean", + "description": "Only one POSIX account can be marked as primary." + }, + "gid": { + "format": "int64", + "description": "The default group ID.", + "type": "string" + }, + "uid": { + "format": "int64", + "description": "The user ID.", + "type": "string" + }, + "username": { + "type": "string", + "description": "The username of the POSIX account." + }, + "shell": { + "type": "string", + "description": "The path to the logic shell for this account." + }, + "homeDirectory": { + "description": "The path to the home directory for this account.", + "type": "string" + } + }, + "id": "PosixAccount" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "canonicalName": "Cloud OS Login", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://oslogin.googleapis.com/", + "ownerDomain": "google.com", + "name": "oslogin", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud OS Login API", + "ownerName": "Google", + "resources": { + "users": { + "methods": { + "importSshPublicKey": { + "response": { + "$ref": "ImportSshPublicKeyResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "The unique ID for the user in format `users/{user}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1beta/users/{usersId}:importSshPublicKey", + "id": "oslogin.users.importSshPublicKey", + "path": "v1beta/{+parent}:importSshPublicKey", + "description": "Adds an SSH public key and returns the profile information. Default POSIX\naccount information is set when no username and UID exist as part of the\nlogin profile.", + "request": { + "$ref": "SshPublicKey" + } + }, + "getLoginProfile": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "LoginProfile" + }, + "parameters": { + "name": { + "location": "path", + "description": "The unique ID for the user in format `users/{user}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ], + "flatPath": "v1beta/users/{usersId}/loginProfile", + "path": "v1beta/{+name}/loginProfile", + "id": "oslogin.users.getLoginProfile", + "description": "Retrieves the profile information used for logging in to a virtual machine\non Google Compute Engine." + } + }, + "resources": { + "sshPublicKeys": { + "methods": { + "delete": { + "flatPath": "v1beta/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1beta/{+name}", + "id": "oslogin.users.sshPublicKeys.delete", + "description": "Deletes an SSH public key.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "location": "path", + "description": "The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "patch": { + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "type": "string", + "location": "query", + "format": "google-fieldmask", + "description": "Mask to control which fields get updated. Updates all if not present." + }, + "name": { + "location": "path", + "description": "The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1beta/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "id": "oslogin.users.sshPublicKeys.patch", + "path": "v1beta/{+name}", + "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + "request": { + "$ref": "SshPublicKey" + } + }, + "get": { + "description": "Retrieves an SSH public key.", + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "The fingerprint of the public key to retrieve. Public keys are identified\nby their SHA-256 fingerprint. The fingerprint of the public key is in\nformat `users/{user}/sshPublicKeys/{fingerprint}`.", + "type": "string", + "required": true, + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1beta/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "id": "oslogin.users.sshPublicKeys.get", + "path": "v1beta/{+name}" + } + } + } + } + } + }, + "parameters": { + "pp": { + "default": "true", + "type": "boolean", + "location": "query", + "description": "Pretty-print response." + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "type": "string", + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." + }, + "alt": { + "location": "query", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ] + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "type": "string", + "location": "query", + "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." + }, + "quotaUser": { + "type": "string", + "location": "query", + "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." + } + } +} diff --git a/etc/api/pagespeedonline/v1/pagespeedonline-api.json b/etc/api/pagespeedonline/v1/pagespeedonline-api.json index 1c410cc3d7..004f43a080 100644 --- a/etc/api/pagespeedonline/v1/pagespeedonline-api.json +++ b/etc/api/pagespeedonline/v1/pagespeedonline-api.json @@ -20,7 +20,7 @@ "basePath": "/pagespeedonline/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "pagespeedonline/v1/", - "batchPath": "batch", + "batchPath": "batch/pagespeedonline/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/pagespeedonline/v2/pagespeedonline-api.json b/etc/api/pagespeedonline/v2/pagespeedonline-api.json index c7d6c91a5e..bed89066f2 100644 --- a/etc/api/pagespeedonline/v2/pagespeedonline-api.json +++ b/etc/api/pagespeedonline/v2/pagespeedonline-api.json @@ -20,7 +20,7 @@ "basePath": "/pagespeedonline/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "pagespeedonline/v2/", - "batchPath": "batch", + "batchPath": "batch/pagespeedonline/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/partners/v2/crates/1.0.6-api+20170912 b/etc/api/partners/v2/crates/1.0.6-api+20170912 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/partners/v2/crates/1.0.6-cli+20170912 b/etc/api/partners/v2/crates/1.0.6-cli+20170912 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/partners/v2/partners-api.json b/etc/api/partners/v2/partners-api.json index 234381b934..887c9ee3d9 100644 --- a/etc/api/partners/v2/partners-api.json +++ b/etc/api/partners/v2/partners-api.json @@ -1,41 +1,25 @@ { - "basePath": "", - "ownerDomain": "google.com", - "name": "partners", - "batchPath": "batch", - "revision": "20170503", - "documentationLink": "https://developers.google.com/partners/", - "id": "partners:v2", - "title": "Google Partners API", "discoveryVersion": "v1", "ownerName": "Google", - "version_module": "True", + "version_module": true, "resources": { - "users": { + "v2": { "methods": { - "createCompanyRelation": { + "getPartnersstatus": { + "flatPath": "v2/partnersstatus", + "path": "v2/partnersstatus", + "id": "partners.getPartnersstatus", + "description": "Gets Partners Status of the logged in user's agency.\nShould only be called if the logged in user is the admin of the agency.", + "httpMethod": "GET", + "parameterOrder": [], "response": { - "$ref": "CompanyRelation" + "$ref": "GetPartnersStatusResponse" }, - "parameterOrder": [ - "userId" - ], - "httpMethod": "PUT", "parameters": { - "requestMetadata.partnersSessionId": { - "description": "Google Partners session ID.", - "type": "string", - "location": "query" - }, - "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string", - "location": "query" - }, "requestMetadata.trafficSource.trafficSourceId": { + "type": "string", "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us." }, "requestMetadata.locale": { "location": "query", @@ -43,60 +27,47 @@ "type": "string" }, "requestMetadata.userOverrides.ipAddress": { - "location": "query", "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string" + "type": "string", + "location": "query" }, "requestMetadata.experimentIds": { + "repeated": true, "location": "query", "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true - }, - "userId": { - "location": "path", - "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.", - "required": true, "type": "string" }, "requestMetadata.trafficSource.trafficSubId": { + "location": "query", "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.userOverrides.userId": { "type": "string", - "location": "query" + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID." + }, + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" } - }, - "flatPath": "v2/users/{userId}/companyRelation", - "path": "v2/users/{userId}/companyRelation", - "id": "partners.users.createCompanyRelation", - "description": "Creates a user's company relation. Affiliates the user to a company.", - "request": { - "$ref": "CompanyRelation" } }, - "deleteCompanyRelation": { - "response": { - "$ref": "Empty" + "updateLeads": { + "flatPath": "v2/leads", + "id": "partners.updateLeads", + "path": "v2/leads", + "description": "Updates the specified lead.", + "request": { + "$ref": "Lead" }, - "parameterOrder": [ - "userId" - ], - "httpMethod": "DELETE", + "response": { + "$ref": "Lead" + }, + "parameterOrder": [], + "httpMethod": "PATCH", "parameters": { - "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.locale": { - "location": "query", - "description": "Locale to use for the current request.", - "type": "string" - }, - "requestMetadata.userOverrides.ipAddress": { - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string", - "location": "query" - }, "requestMetadata.experimentIds": { "description": "Experiment IDs the current request belongs to.", "type": "string", @@ -108,10 +79,187 @@ "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string" }, + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" + }, + "requestMetadata.userOverrides.userId": { + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.locale": { + "type": "string", + "location": "query", + "description": "Locale to use for the current request." + }, + "requestMetadata.userOverrides.ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string", + "location": "query" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.\nOnly `state` and `adwords_customer_id` are currently supported.", + "type": "string" + } + } + }, + "updateCompanies": { + "request": { + "$ref": "Company" + }, + "description": "Update company.\nShould only be called within the context of an authorized logged in user.", + "response": { + "$ref": "Company" + }, + "parameterOrder": [], + "httpMethod": "PATCH", + "parameters": { + "requestMetadata.trafficSource.trafficSubId": { + "type": "string", + "location": "query", + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us." + }, + "requestMetadata.userOverrides.userId": { + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string" + }, + "requestMetadata.partnersSessionId": { + "description": "Google Partners session ID.", + "type": "string", + "location": "query" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.locale": { + "location": "query", + "description": "Locale to use for the current request.", + "type": "string" + }, + "requestMetadata.userOverrides.ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string", + "location": "query" + }, + "updateMask": { + "location": "query", + "format": "google-fieldmask", + "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.", + "type": "string" + }, + "requestMetadata.experimentIds": { + "repeated": true, + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string" + } + }, + "flatPath": "v2/companies", + "id": "partners.updateCompanies", + "path": "v2/companies" + } + } + }, + "users": { + "methods": { + "deleteCompanyRelation": { + "id": "partners.users.deleteCompanyRelation", + "path": "v2/users/{userId}/companyRelation", + "description": "Deletes a user's company relation. Unaffiliaites the user from a company.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "userId" + ], + "httpMethod": "DELETE", + "parameters": { + "requestMetadata.userOverrides.userId": { + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.locale": { + "type": "string", + "location": "query", + "description": "Locale to use for the current request." + }, + "requestMetadata.userOverrides.ipAddress": { + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string" + }, + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true, + "location": "query" + }, + "userId": { + "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.", + "type": "string", + "required": true, + "location": "path" + }, + "requestMetadata.trafficSource.trafficSubId": { + "location": "query", + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + } + }, + "flatPath": "v2/users/{userId}/companyRelation" + }, + "createCompanyRelation": { + "httpMethod": "PUT", + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "CompanyRelation" + }, + "parameters": { + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true, + "location": "query" + }, "userId": { "location": "path", "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.", - "required": true, + "type": "string", + "required": true + }, + "requestMetadata.trafficSource.trafficSubId": { + "location": "query", + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.userOverrides.userId": { + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string" }, "requestMetadata.partnersSessionId": { @@ -119,21 +267,33 @@ "description": "Google Partners session ID.", "type": "string" }, - "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", + "requestMetadata.trafficSource.trafficSourceId": { + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string", "location": "query" + }, + "requestMetadata.locale": { + "location": "query", + "description": "Locale to use for the current request.", + "type": "string" + }, + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address." } }, "flatPath": "v2/users/{userId}/companyRelation", "path": "v2/users/{userId}/companyRelation", - "id": "partners.users.deleteCompanyRelation", - "description": "Deletes a user's company relation. Unaffiliaites the user from a company." + "id": "partners.users.createCompanyRelation", + "request": { + "$ref": "CompanyRelation" + }, + "description": "Creates a user's company relation. Affiliates the user to a company." }, "get": { - "flatPath": "v2/users/{userId}", - "id": "partners.users.get", "path": "v2/users/{userId}", + "id": "partners.users.get", "description": "Gets a user.", "httpMethod": "GET", "parameterOrder": [ @@ -143,30 +303,13 @@ "$ref": "User" }, "parameters": { - "requestMetadata.experimentIds": { - "location": "query", - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true - }, - "requestMetadata.trafficSource.trafficSubId": { - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "requestMetadata.userOverrides.userId": { + "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string", "location": "query" }, - "userId": { - "description": "Identifier of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean the currently\nauthenticated user.", - "required": true, - "type": "string", - "location": "path" - }, "requestMetadata.partnersSessionId": { - "location": "query", "description": "Google Partners session ID.", - "type": "string" - }, - "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string", "location": "query" }, @@ -191,19 +334,10 @@ "location": "query" }, "requestMetadata.userOverrides.ipAddress": { - "location": "query", "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string" - } - } - }, - "updateProfile": { - "httpMethod": "PATCH", - "parameterOrder": [], - "response": { - "$ref": "UserProfile" - }, - "parameters": { + "type": "string", + "location": "query" + }, "requestMetadata.experimentIds": { "location": "query", "description": "Experiment IDs the current request belongs to.", @@ -215,86 +349,161 @@ "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string" }, - "requestMetadata.partnersSessionId": { - "location": "query", - "description": "Google Partners session ID.", - "type": "string" - }, - "requestMetadata.userOverrides.userId": { - "location": "query", - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "userId": { + "location": "path", + "description": "Identifier of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean the currently\nauthenticated user.", "type": "string", - "location": "query" + "required": true + } + }, + "flatPath": "v2/users/{userId}" + }, + "updateProfile": { + "description": "Updates a user's profile. A user can only update their own profile and\nshould only be called within the context of a logged in user.", + "request": { + "$ref": "UserProfile" + }, + "httpMethod": "PATCH", + "parameterOrder": [], + "response": { + "$ref": "UserProfile" + }, + "parameters": { + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" }, "requestMetadata.locale": { + "location": "query", "description": "Locale to use for the current request.", - "type": "string", - "location": "query" + "type": "string" }, "requestMetadata.userOverrides.ipAddress": { "description": "IP address to use instead of the user's geo-located IP address.", "type": "string", "location": "query" + }, + "requestMetadata.experimentIds": { + "repeated": true, + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string" + }, + "requestMetadata.trafficSource.trafficSubId": { + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string", + "location": "query" + }, + "requestMetadata.userOverrides.userId": { + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" } }, "flatPath": "v2/users/profile", - "id": "partners.users.updateProfile", "path": "v2/users/profile", - "description": "Updates a user's profile. A user can only update their own profile and\nshould only be called within the context of a logged in user.", - "request": { - "$ref": "UserProfile" - } + "id": "partners.users.updateProfile" } } }, "companies": { "methods": { - "get": { - "flatPath": "v2/companies/{companyId}", - "id": "partners.companies.get", - "path": "v2/companies/{companyId}", - "description": "Gets a company.", + "list": { "httpMethod": "GET", - "parameterOrder": [ - "companyId" - ], + "parameterOrder": [], "response": { - "$ref": "GetCompanyResponse" + "$ref": "ListCompaniesResponse" }, "parameters": { - "requestMetadata.trafficSource.trafficSourceId": { - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "specializations": { + "repeated": true, + "location": "query", + "enum": [ + "BADGE_SPECIALIZATION_UNKNOWN", + "BADGE_SPECIALIZATION_ADWORDS_SEARCH", + "BADGE_SPECIALIZATION_ADWORDS_DISPLAY", + "BADGE_SPECIALIZATION_ADWORDS_MOBILE", + "BADGE_SPECIALIZATION_ADWORDS_VIDEO", + "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" + ], + "description": "List of specializations that the returned agencies should provide. If this\nis not empty, any returned agency must have at least one of these\nspecializations, or one of the services in the \"services\" field.", + "type": "string" + }, + "maxMonthlyBudget.currencyCode": { + "description": "The 3-letter currency code defined in ISO 4217.", "type": "string", "location": "query" }, - "requestMetadata.userOverrides.ipAddress": { + "requestMetadata.userOverrides.userId": { + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string", + "location": "query" + }, + "minMonthlyBudget.currencyCode": { "location": "query", - "description": "IP address to use instead of the user's geo-located IP address.", + "description": "The 3-letter currency code defined in ISO 4217.", "type": "string" }, - "companyId": { - "location": "path", - "description": "The ID of the company to retrieve.", - "required": true, - "type": "string" - }, - "currencyCode": { + "view": { + "description": "The view of the `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.", + "type": "string", "location": "query", - "description": "If the company's budget is in a different currency code than this one, then\nthe converted budget is converted to this currency code.", + "enum": [ + "COMPANY_VIEW_UNSPECIFIED", + "CV_GOOGLE_PARTNER_SEARCH" + ] + }, + "address": { + "description": "The address to use when searching for companies.\nIf not given, the geo-located address of the request is used.", + "type": "string", + "location": "query" + }, + "requestMetadata.locale": { + "location": "query", + "description": "Locale to use for the current request.", "type": "string" }, - "requestMetadata.experimentIds": { - "description": "Experiment IDs the current request belongs to.", + "minMonthlyBudget.units": { + "type": "string", + "location": "query", + "format": "int64", + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar." + }, + "maxMonthlyBudget.nanos": { + "format": "int32", + "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "type": "integer", + "location": "query" + }, + "services": { + "description": "List of services that the returned agencies should provide. If this is\nnot empty, any returned agency must have at least one of these services,\nor one of the specializations in the \"specializations\" field.", "type": "string", "repeated": true, - "location": "query" + "location": "query", + "enum": [ + "SERVICE_UNSPECIFIED", + "S_ADVANCED_ADWORDS_SUPPORT", + "S_ADVERTISING_ON_GOOGLE", + "S_AN_ENHANCED_WEBSITE", + "S_AN_ONLINE_MARKETING_PLAN", + "S_MOBILE_AND_VIDEO_ADS", + "S_MOBILE_WEBSITE_SERVICES" + ] }, - "orderBy": { - "description": "How to order addresses within the returned company. Currently, only\n`address` and `address desc` is supported which will sorted by closest to\nfarthest in distance from given address and farthest to closest distance\nfrom given address respectively.", + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "maxMonthlyBudget.units": { + "format": "int64", + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", "type": "string", "location": "query" }, @@ -303,61 +512,31 @@ "type": "string", "location": "query" }, - "requestMetadata.partnersSessionId": { + "minMonthlyBudget.nanos": { + "type": "integer", "location": "query", - "description": "Google Partners session ID.", - "type": "string" + "format": "int32", + "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000." }, - "requestMetadata.userOverrides.userId": { - "location": "query", - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string" - }, - "view": { - "description": "The view of `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.", - "type": "string", - "location": "query", - "enum": [ - "COMPANY_VIEW_UNSPECIFIED", - "CV_GOOGLE_PARTNER_SEARCH" - ] - }, - "requestMetadata.locale": { - "description": "Locale to use for the current request.", - "type": "string", - "location": "query" - }, - "address": { - "description": "The address to use for sorting the company's addresses by proximity.\nIf not given, the geo-located address of the request is used.\nUsed when order_by is set.", - "type": "string", - "location": "query" - } - } - }, - "list": { - "description": "Lists companies.", - "response": { - "$ref": "ListCompaniesResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { "requestMetadata.partnersSessionId": { "description": "Google Partners session ID.", "type": "string", "location": "query" }, - "companyName": { - "description": "Company name to search for.", - "type": "string", - "location": "query" - }, "pageToken": { "location": "query", "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListCompaniesResponse.next_page_token`\nreturned from the previous call to\nListCompanies.", "type": "string" }, + "companyName": { + "location": "query", + "description": "Company name to search for.", + "type": "string" + }, "industries": { + "description": "List of industries the company can help with.", + "type": "string", + "repeated": true, "location": "query", "enum": [ "INDUSTRY_UNSPECIFIED", @@ -371,10 +550,7 @@ "I_RETAIL", "I_TECHNOLOGY", "I_TRAVEL" - ], - "description": "List of industries the company can help with.", - "type": "string", - "repeated": true + ] }, "websiteUrl": { "location": "query", @@ -382,16 +558,16 @@ "type": "string" }, "gpsMotivations": { - "description": "List of reasons for using Google Partner Search to get companies.", - "type": "string", - "repeated": true, "location": "query", "enum": [ "GPS_MOTIVATION_UNSPECIFIED", "GPSM_HELP_WITH_ADVERTISING", "GPSM_HELP_WITH_WEBSITE", "GPSM_NO_WEBSITE" - ] + ], + "description": "List of reasons for using Google Partner Search to get companies.", + "type": "string", + "repeated": true }, "languageCodes": { "description": "List of language codes that company can support. Only primary language\nsubtags are accepted as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").", @@ -400,10 +576,10 @@ "location": "query" }, "pageSize": { - "location": "query", - "description": "Requested page size. Server may return fewer companies than requested.\nIf unspecified, server picks an appropriate default.", "format": "int32", - "type": "integer" + "description": "Requested page size. Server may return fewer companies than requested.\nIf unspecified, server picks an appropriate default.", + "type": "integer", + "location": "query" }, "requestMetadata.userOverrides.ipAddress": { "description": "IP address to use instead of the user's geo-located IP address.", @@ -417,111 +593,96 @@ "location": "query" }, "orderBy": { + "location": "query", "description": "How to order addresses within the returned companies. Currently, only\n`address` and `address desc` is supported which will sorted by closest to\nfarthest in distance from given address and farthest to closest distance\nfrom given address respectively.", + "type": "string" + } + }, + "flatPath": "v2/companies", + "path": "v2/companies", + "id": "partners.companies.list", + "description": "Lists companies." + }, + "get": { + "response": { + "$ref": "GetCompanyResponse" + }, + "parameterOrder": [ + "companyId" + ], + "httpMethod": "GET", + "parameters": { + "requestMetadata.trafficSource.trafficSourceId": { + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string", "location": "query" }, - "specializations": { - "description": "List of specializations that the returned agencies should provide. If this\nis not empty, any returned agency must have at least one of these\nspecializations, or one of the services in the \"services\" field.", + "requestMetadata.userOverrides.ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string", + "location": "query" + }, + "companyId": { + "description": "The ID of the company to retrieve.", + "type": "string", + "required": true, + "location": "path" + }, + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", "type": "string", "repeated": true, - "location": "query", - "enum": [ - "BADGE_SPECIALIZATION_UNKNOWN", - "BADGE_SPECIALIZATION_ADWORDS_SEARCH", - "BADGE_SPECIALIZATION_ADWORDS_DISPLAY", - "BADGE_SPECIALIZATION_ADWORDS_MOBILE", - "BADGE_SPECIALIZATION_ADWORDS_VIDEO", - "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" - ] + "location": "query" }, - "maxMonthlyBudget.currencyCode": { + "currencyCode": { + "description": "If the company's budget is in a different currency code than this one, then\nthe converted budget is converted to this currency code.", + "type": "string", + "location": "query" + }, + "orderBy": { "location": "query", - "description": "The 3-letter currency code defined in ISO 4217.", + "description": "How to order addresses within the returned company. Currently, only\n`address` and `address desc` is supported which will sorted by closest to\nfarthest in distance from given address and farthest to closest distance\nfrom given address respectively.", "type": "string" }, + "requestMetadata.trafficSource.trafficSubId": { + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "type": "string", + "location": "query", + "description": "Google Partners session ID." + }, "requestMetadata.userOverrides.userId": { "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string", "location": "query" }, - "minMonthlyBudget.currencyCode": { - "description": "The 3-letter currency code defined in ISO 4217.", - "type": "string", - "location": "query" - }, "view": { - "description": "The view of the `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.", - "type": "string", - "location": "query", "enum": [ "COMPANY_VIEW_UNSPECIFIED", "CV_GOOGLE_PARTNER_SEARCH" - ] + ], + "description": "The view of `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.", + "type": "string", + "location": "query" }, "requestMetadata.locale": { + "location": "query", "description": "Locale to use for the current request.", - "type": "string", - "location": "query" + "type": "string" }, "address": { - "description": "The address to use when searching for companies.\nIf not given, the geo-located address of the request is used.", - "type": "string", - "location": "query" - }, - "minMonthlyBudget.units": { - "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", - "format": "int64", - "type": "string", - "location": "query" - }, - "maxMonthlyBudget.nanos": { "location": "query", - "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", - "format": "int32", - "type": "integer" - }, - "services": { - "location": "query", - "enum": [ - "SERVICE_UNSPECIFIED", - "S_ADVANCED_ADWORDS_SUPPORT", - "S_ADVERTISING_ON_GOOGLE", - "S_AN_ENHANCED_WEBSITE", - "S_AN_ONLINE_MARKETING_PLAN", - "S_MOBILE_AND_VIDEO_ADS", - "S_MOBILE_WEBSITE_SERVICES" - ], - "description": "List of services that the returned agencies should provide. If this is\nnot empty, any returned agency must have at least one of these services,\nor one of the specializations in the \"specializations\" field.", - "type": "string", - "repeated": true - }, - "maxMonthlyBudget.units": { - "location": "query", - "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", - "format": "int64", + "description": "The address to use for sorting the company's addresses by proximity.\nIf not given, the geo-located address of the request is used.\nUsed when order_by is set.", "type": "string" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.trafficSource.trafficSubId": { - "location": "query", - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "minMonthlyBudget.nanos": { - "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", - "format": "int32", - "type": "integer", - "location": "query" } }, - "flatPath": "v2/companies", - "path": "v2/companies", - "id": "partners.companies.list" + "flatPath": "v2/companies/{companyId}", + "id": "partners.companies.get", + "path": "v2/companies/{companyId}", + "description": "Gets a company." } }, "resources": { @@ -542,14 +703,14 @@ "parameters": { "companyId": { "description": "The ID of the company to contact.", - "required": true, "type": "string", + "required": true, "location": "path" } }, "flatPath": "v2/companies/{companyId}/leads", - "id": "partners.companies.leads.create", - "path": "v2/companies/{companyId}/leads" + "path": "v2/companies/{companyId}/leads", + "id": "partners.companies.leads.create" } } } @@ -558,25 +719,29 @@ "userEvents": { "methods": { "log": { + "parameters": {}, "flatPath": "v2/userEvents:log", - "path": "v2/userEvents:log", "id": "partners.userEvents.log", + "path": "v2/userEvents:log", + "description": "Logs a user event.", "request": { "$ref": "LogUserEventRequest" }, - "description": "Logs a user event.", "response": { "$ref": "LogUserEventResponse" }, "parameterOrder": [], - "httpMethod": "POST", - "parameters": {} + "httpMethod": "POST" } } }, "clientMessages": { "methods": { "log": { + "request": { + "$ref": "LogMessageRequest" + }, + "description": "Logs a generic message from the client, such as\n`Failed to render component`, `Profile page is running slow`,\n`More than 500 users have accessed this result.`, etc.", "response": { "$ref": "LogMessageResponse" }, @@ -584,19 +749,14 @@ "httpMethod": "POST", "parameters": {}, "flatPath": "v2/clientMessages:log", - "path": "v2/clientMessages:log", "id": "partners.clientMessages.log", - "request": { - "$ref": "LogMessageRequest" - }, - "description": "Logs a generic message from the client, such as\n`Failed to render component`, `Profile page is running slow`,\n`More than 500 users have accessed this result.`, etc." + "path": "v2/clientMessages:log" } } }, "exams": { "methods": { "getToken": { - "description": "Gets an Exam Token for a Partner's user to take an exam in the Exams System", "response": { "$ref": "ExamToken" }, @@ -605,30 +765,15 @@ ], "httpMethod": "GET", "parameters": { - "requestMetadata.userOverrides.userId": { - "location": "query", - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string" - }, - "requestMetadata.partnersSessionId": { - "location": "query", - "description": "Google Partners session ID.", - "type": "string" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, "requestMetadata.locale": { "description": "Locale to use for the current request.", "type": "string", "location": "query" }, "requestMetadata.userOverrides.ipAddress": { + "location": "query", "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string", - "location": "query" + "type": "string" }, "requestMetadata.experimentIds": { "description": "Experiment IDs the current request belongs to.", @@ -637,9 +782,9 @@ "location": "query" }, "requestMetadata.trafficSource.trafficSubId": { + "location": "query", "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string", - "location": "query" + "type": "string" }, "examType": { "location": "path", @@ -657,62 +802,8 @@ "CET_MOBILE_SITES" ], "description": "The exam type we are requesting a token for.", - "required": true, - "type": "string" - } - }, - "flatPath": "v2/exams/{examType}/token", - "path": "v2/exams/{examType}/token", - "id": "partners.exams.getToken" - } - } - }, - "leads": { - "methods": { - "list": { - "description": "Lists advertiser leads for a user's associated company.\nShould only be called within the context of an authorized logged in user.", - "response": { - "$ref": "ListLeadsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "pageSize": { - "location": "query", - "description": "Requested page size. Server may return fewer leads than requested.\nIf unspecified, server picks an appropriate default.", - "format": "int32", - "type": "integer" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string", - "location": "query" - }, - "requestMetadata.locale": { - "location": "query", - "description": "Locale to use for the current request.", - "type": "string" - }, - "requestMetadata.userOverrides.ipAddress": { - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string", - "location": "query" - }, - "requestMetadata.experimentIds": { - "location": "query", - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true - }, - "orderBy": { - "description": "How to order Leads. Currently, only `create_time`\nand `create_time desc` are supported", - "type": "string", - "location": "query" - }, - "requestMetadata.trafficSource.trafficSubId": { - "location": "query", - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" + "required": true }, "requestMetadata.userOverrides.userId": { "location": "query", @@ -724,46 +815,122 @@ "description": "Google Partners session ID.", "type": "string" }, - "pageToken": { - "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListLeadsResponse.next_page_token`\nreturned from the previous call to\nListLeads.", + "requestMetadata.trafficSource.trafficSourceId": { + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string", "location": "query" } }, - "flatPath": "v2/leads", - "path": "v2/leads", - "id": "partners.leads.list" + "flatPath": "v2/exams/{examType}/token", + "id": "partners.exams.getToken", + "path": "v2/exams/{examType}/token", + "description": "Gets an Exam Token for a Partner's user to take an exam in the Exams System" } } }, - "offers": { + "leads": { "methods": { "list": { - "response": { - "$ref": "ListOffersResponse" - }, - "parameterOrder": [], "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListLeadsResponse" + }, "parameters": { + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" + }, + "requestMetadata.userOverrides.userId": { + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListLeadsResponse.next_page_token`\nreturned from the previous call to\nListLeads.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. Server may return fewer leads than requested.\nIf unspecified, server picks an appropriate default.", + "type": "integer" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.locale": { + "location": "query", + "description": "Locale to use for the current request.", + "type": "string" + }, + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address." + }, "requestMetadata.experimentIds": { "description": "Experiment IDs the current request belongs to.", "type": "string", "repeated": true, "location": "query" }, + "requestMetadata.trafficSource.trafficSubId": { + "location": "query", + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "orderBy": { + "description": "How to order Leads. Currently, only `create_time`\nand `create_time desc` are supported", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2/leads", + "path": "v2/leads", + "id": "partners.leads.list", + "description": "Lists advertiser leads for a user's associated company.\nShould only be called within the context of an authorized logged in user." + } + } + }, + "offers": { + "methods": { + "list": { + "description": "Lists the Offers available for the current user", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListOffersResponse" + }, + "parameters": { + "requestMetadata.userOverrides.ipAddress": { + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string" + }, + "requestMetadata.experimentIds": { + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true + }, "requestMetadata.trafficSource.trafficSubId": { "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", "type": "string", "location": "query" }, - "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string", - "location": "query" - }, "requestMetadata.partnersSessionId": { + "type": "string", "location": "query", - "description": "Google Partners session ID.", + "description": "Google Partners session ID." + }, + "requestMetadata.userOverrides.userId": { + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string" }, "requestMetadata.trafficSource.trafficSourceId": { @@ -775,17 +942,11 @@ "description": "Locale to use for the current request.", "type": "string", "location": "query" - }, - "requestMetadata.userOverrides.ipAddress": { - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string", - "location": "query" } }, "flatPath": "v2/offers", "path": "v2/offers", - "id": "partners.offers.list", - "description": "Lists the Offers available for the current user" + "id": "partners.offers.list" } }, "resources": { @@ -799,11 +960,32 @@ "$ref": "ListOffersHistoryResponse" }, "parameters": { - "requestMetadata.partnersSessionId": { - "description": "Google Partners session ID.", + "entireCompany": { + "type": "boolean", + "location": "query", + "description": "if true, show history for the entire company. Requires user to be admin." + }, + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true, + "location": "query" + }, + "requestMetadata.trafficSource.trafficSubId": { + "location": "query", + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "orderBy": { + "description": "Comma-separated list of fields to order by, e.g.: \"foo,bar,baz\".\nUse \"foo desc\" to sort descending.\nList of valid field names is: name, offer_code, expiration_time, status,\n last_modified_time, sender_name, creation_time, country_code,\n offer_type.", "type": "string", "location": "query" }, + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" + }, "requestMetadata.userOverrides.userId": { "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string", @@ -815,15 +997,15 @@ "type": "string" }, "pageSize": { - "description": "Maximum number of rows to return per page.", "format": "int32", + "description": "Maximum number of rows to return per page.", "type": "integer", "location": "query" }, "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" + "type": "string", + "location": "query" }, "requestMetadata.locale": { "location": "query", @@ -834,96 +1016,19 @@ "description": "IP address to use instead of the user's geo-located IP address.", "type": "string", "location": "query" - }, - "requestMetadata.experimentIds": { - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true, - "location": "query" - }, - "entireCompany": { - "location": "query", - "description": "if true, show history for the entire company. Requires user to be admin.", - "type": "boolean" - }, - "requestMetadata.trafficSource.trafficSubId": { - "location": "query", - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "orderBy": { - "description": "Comma-separated list of fields to order by, e.g.: \"foo,bar,baz\".\nUse \"foo desc\" to sort descending.\nList of valid field names is: name, offer_code, expiration_time, status,\n last_modified_time, sender_name, creation_time, country_code,\n offer_type.", - "type": "string", - "location": "query" } }, "flatPath": "v2/offers/history", - "id": "partners.offers.history.list", - "path": "v2/offers/history" + "path": "v2/offers/history", + "id": "partners.offers.history.list" } } } } }, - "userStates": { - "methods": { - "list": { - "description": "Lists states for current user.", - "response": { - "$ref": "ListUserStatesResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "requestMetadata.partnersSessionId": { - "location": "query", - "description": "Google Partners session ID.", - "type": "string" - }, - "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string", - "location": "query" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.locale": { - "location": "query", - "description": "Locale to use for the current request.", - "type": "string" - }, - "requestMetadata.userOverrides.ipAddress": { - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string", - "location": "query" - }, - "requestMetadata.experimentIds": { - "location": "query", - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true - }, - "requestMetadata.trafficSource.trafficSubId": { - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v2/userStates", - "path": "v2/userStates", - "id": "partners.userStates.list" - } - } - }, "analytics": { "methods": { "list": { - "flatPath": "v2/analytics", - "path": "v2/analytics", - "id": "partners.analytics.list", "description": "Lists analytics data for a user's associated company.\nShould only be called within the context of an authorized logged in user.", "response": { "$ref": "ListAnalyticsResponse" @@ -931,21 +1036,10 @@ "parameterOrder": [], "httpMethod": "GET", "parameters": { - "requestMetadata.experimentIds": { - "location": "query", - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true - }, - "requestMetadata.trafficSource.trafficSubId": { - "location": "query", - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string", - "location": "query" + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID." }, "requestMetadata.partnersSessionId": { "location": "query", @@ -959,14 +1053,14 @@ }, "pageSize": { "location": "query", - "description": "Requested page size. Server may return fewer analytics than requested.\nIf unspecified or set to 0, default value is 30.\nSpecifies the number of days in the date range when querying analytics.\nThe `page_token` represents the end date of the date range\nand the start date is calculated using the `page_size` as the number\nof days BEFORE the end date.\nMust be a non-negative integer.", "format": "int32", + "description": "Requested page size. Server may return fewer analytics than requested.\nIf unspecified or set to 0, default value is 30.\nSpecifies the number of days in the date range when querying analytics.\nThe `page_token` represents the end date of the date range\nand the start date is calculated using the `page_size` as the number\nof days BEFORE the end date.\nMust be a non-negative integer.", "type": "integer" }, "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string", - "location": "query" + "type": "string" }, "requestMetadata.locale": { "description": "Locale to use for the current request.", @@ -977,212 +1071,120 @@ "location": "query", "description": "IP address to use instead of the user's geo-located IP address.", "type": "string" + }, + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true, + "location": "query" + }, + "requestMetadata.trafficSource.trafficSubId": { + "type": "string", + "location": "query", + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us." } - } + }, + "flatPath": "v2/analytics", + "id": "partners.analytics.list", + "path": "v2/analytics" } } }, - "v2": { + "userStates": { "methods": { - "getPartnersstatus": { - "flatPath": "v2/partnersstatus", - "path": "v2/partnersstatus", - "id": "partners.getPartnersstatus", - "description": "Gets Partners Status of the logged in user's agency.\nShould only be called if the logged in user is the admin of the agency.", - "response": { - "$ref": "GetPartnersStatusResponse" + "list": { + "parameters": { + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true, + "location": "query" + }, + "requestMetadata.trafficSource.trafficSubId": { + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "location": "query", + "description": "Google Partners session ID.", + "type": "string" + }, + "requestMetadata.userOverrides.userId": { + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "location": "query", + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "requestMetadata.locale": { + "description": "Locale to use for the current request.", + "type": "string", + "location": "query" + }, + "requestMetadata.userOverrides.ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string", + "location": "query" + } }, - "parameterOrder": [], + "flatPath": "v2/userStates", + "path": "v2/userStates", + "id": "partners.userStates.list", + "description": "Lists states for current user.", "httpMethod": "GET", - "parameters": { - "requestMetadata.userOverrides.userId": { - "location": "query", - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string" - }, - "requestMetadata.partnersSessionId": { - "location": "query", - "description": "Google Partners session ID.", - "type": "string" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.locale": { - "location": "query", - "description": "Locale to use for the current request.", - "type": "string" - }, - "requestMetadata.userOverrides.ipAddress": { - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string", - "location": "query" - }, - "requestMetadata.experimentIds": { - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true, - "location": "query" - }, - "requestMetadata.trafficSource.trafficSubId": { - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string", - "location": "query" - } - } - }, - "updateLeads": { - "flatPath": "v2/leads", - "path": "v2/leads", - "id": "partners.updateLeads", - "request": { - "$ref": "Lead" - }, - "description": "Updates the specified lead.", - "response": { - "$ref": "Lead" - }, - "parameterOrder": [], - "httpMethod": "PATCH", - "parameters": { - "updateMask": { - "location": "query", - "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.\nOnly `state` and `adwords_customer_id` are currently supported.", - "format": "google-fieldmask", - "type": "string" - }, - "requestMetadata.experimentIds": { - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true, - "location": "query" - }, - "requestMetadata.trafficSource.trafficSubId": { - "location": "query", - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.partnersSessionId": { - "description": "Google Partners session ID.", - "type": "string", - "location": "query" - }, - "requestMetadata.userOverrides.userId": { - "location": "query", - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string" - }, - "requestMetadata.trafficSource.trafficSourceId": { - "location": "query", - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.locale": { - "description": "Locale to use for the current request.", - "type": "string", - "location": "query" - }, - "requestMetadata.userOverrides.ipAddress": { - "location": "query", - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string" - } - } - }, - "updateCompanies": { - "description": "Update company.\nShould only be called within the context of an authorized logged in user.", - "request": { - "$ref": "Company" - }, - "httpMethod": "PATCH", "parameterOrder": [], "response": { - "$ref": "Company" - }, - "parameters": { - "requestMetadata.trafficSource.trafficSourceId": { - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string", - "location": "query" - }, - "requestMetadata.locale": { - "location": "query", - "description": "Locale to use for the current request.", - "type": "string" - }, - "requestMetadata.userOverrides.ipAddress": { - "location": "query", - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string" - }, - "updateMask": { - "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.", - "format": "google-fieldmask", - "type": "string", - "location": "query" - }, - "requestMetadata.experimentIds": { - "description": "Experiment IDs the current request belongs to.", - "type": "string", - "repeated": true, - "location": "query" - }, - "requestMetadata.trafficSource.trafficSubId": { - "location": "query", - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "requestMetadata.userOverrides.userId": { - "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string", - "location": "query" - }, - "requestMetadata.partnersSessionId": { - "location": "query", - "description": "Google Partners session ID.", - "type": "string" - } - }, - "flatPath": "v2/companies", - "id": "partners.updateCompanies", - "path": "v2/companies" + "$ref": "ListUserStatesResponse" + } } } } }, "parameters": { - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", "location": "query" }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], + "prettyPrint": { + "default": "true", + "type": "boolean", "location": "query", + "description": "Returns response with indentations and line breaks." + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { "enum": [ "1", "2" ], "description": "V1 error format.", - "type": "string" - }, - "callback": { - "description": "JSONP", "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], "location": "query" }, "alt": { - "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -1195,12 +1197,13 @@ "json", "media", "proto" - ] + ], + "type": "string" }, "access_token": { + "type": "string", "location": "query", - "description": "OAuth access token.", - "type": "string" + "description": "OAuth access token." }, "key": { "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.", @@ -1215,47 +1218,955 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" }, "oauth_token": { + "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "type": "string" }, "bearer_token": { - "location": "query", "description": "OAuth bearer token.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", + "type": "string", "location": "query" } }, "schemas": { + "AnalyticsSummary": { + "description": "Analytics aggregated data for a `Company` for a given date range.", + "type": "object", + "properties": { + "profileViewsCount": { + "format": "int32", + "description": "Aggregated number of profile views for the `Company` for given date range.", + "type": "integer" + }, + "searchViewsCount": { + "type": "integer", + "format": "int32", + "description": "Aggregated number of times users saw the `Company`\nin Google Partners Search results for given date range." + }, + "contactsCount": { + "format": "int32", + "description": "Aggregated number of times users contacted the `Company`\nfor given date range.", + "type": "integer" + } + }, + "id": "AnalyticsSummary" + }, + "LogMessageRequest": { + "type": "object", + "properties": { + "clientInfo": { + "additionalProperties": { + "type": "string" + }, + "description": "Map of client info, such as URL, browser navigator, browser platform, etc.", + "type": "object" + }, + "requestMetadata": { + "$ref": "RequestMetadata", + "description": "Current request metadata." + }, + "level": { + "enumDescriptions": [ + "Unchosen.", + "Message level for tracing information.", + "Message level for informational messages.", + "Message level for potential problems.", + "Message level for serious failures." + ], + "enum": [ + "MESSAGE_LEVEL_UNSPECIFIED", + "ML_FINE", + "ML_INFO", + "ML_WARNING", + "ML_SEVERE" + ], + "description": "Message level of client message.", + "type": "string" + }, + "details": { + "description": "Details about the client message.", + "type": "string" + } + }, + "id": "LogMessageRequest", + "description": "Request message for\nLogClientMessage." + }, + "DebugInfo": { + "description": "Debug information about this request.", + "type": "object", + "properties": { + "serverTraceInfo": { + "description": "Server-side debug stack trace.", + "type": "string" + }, + "serverInfo": { + "description": "Info about the server that serviced this request.", + "type": "string" + }, + "serviceUrl": { + "description": "URL of the service that handled this request.", + "type": "string" + } + }, + "id": "DebugInfo" + }, + "Lead": { + "description": "A lead resource that represents an advertiser contact for a `Company`. These\nare usually generated via Google Partner Search (the advertiser portal).", + "type": "object", + "properties": { + "comments": { + "description": "Comments lead source gave.", + "type": "string" + }, + "id": { + "description": "ID of the lead.", + "type": "string" + }, + "adwordsCustomerId": { + "format": "int64", + "description": "The AdWords Customer ID of the lead.", + "type": "string" + }, + "phoneNumber": { + "description": "Phone number of lead source.", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "Timestamp of when this lead was created.", + "type": "string" + }, + "marketingOptIn": { + "description": "Whether or not the lead signed up for marketing emails", + "type": "boolean" + }, + "type": { + "description": "Type of lead.", + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Google Partner Search." + ], + "enum": [ + "LEAD_TYPE_UNSPECIFIED", + "LT_GPS" + ] + }, + "minMonthlyBudget": { + "description": "The minimum monthly budget lead source is willing to spend.", + "$ref": "Money" + }, + "givenName": { + "description": "First name of lead source.", + "type": "string" + }, + "languageCode": { + "description": "Language code of the lead's language preference, as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").", + "type": "string" + }, + "websiteUrl": { + "description": "Website URL of lead source.", + "type": "string" + }, + "gpsMotivations": { + "description": "List of reasons for using Google Partner Search and creating a lead.", + "items": { + "type": "string", + "enum": [ + "GPS_MOTIVATION_UNSPECIFIED", + "GPSM_HELP_WITH_ADVERTISING", + "GPSM_HELP_WITH_WEBSITE", + "GPSM_NO_WEBSITE" + ] + }, + "type": "array", + "enumDescriptions": [ + "Unchosen.", + "Advertiser needs help with their advertising.", + "Advertiser needs help with their website.", + "Advertiser does not have a website." + ] + }, + "state": { + "enumDescriptions": [ + "Unchosen.", + "Lead not yet contacted.", + "Lead has been contacted.", + "Lead has become a client.", + "Lead in a state not covered by other options." + ], + "enum": [ + "LEAD_STATE_UNSPECIFIED", + "LEAD", + "CONTACTED", + "CLIENT", + "OTHER" + ], + "description": "The lead's state in relation to the company.", + "type": "string" + }, + "email": { + "description": "Email address of lead source.", + "type": "string" + }, + "familyName": { + "description": "Last name of lead source.", + "type": "string" + } + }, + "id": "Lead" + }, + "ListUserStatesResponse": { + "description": "Response message for\nListUserStates.", + "type": "object", + "properties": { + "userStates": { + "description": "User's states.", + "items": { + "enum": [ + "USER_STATE_UNSPECIFIED", + "US_REQUIRES_RECAPTCHA_FOR_GPS_CONTACT" + ], + "type": "string" + }, + "type": "array", + "enumDescriptions": [ + "Unchosen.", + "User must pass \u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e to\ncontact a Partner via Google Partner Search." + ] + }, + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + } + }, + "id": "ListUserStatesResponse" + }, + "CompanyRelation": { + "description": "A CompanyRelation resource representing information about a user's\naffiliation and standing with a company in Partners.", + "type": "object", + "properties": { + "internalCompanyId": { + "description": "The internal company ID.\nOnly available for a whitelisted set of api clients.", + "type": "string" + }, + "specializationStatus": { + "description": "The list of Google Partners specialization statuses for the company.", + "items": { + "$ref": "SpecializationStatus" + }, + "type": "array" + }, + "badgeTier": { + "enumDescriptions": [ + "Tier badge is not set.", + "Agency has regular partner badge.", + "Agency has premier badge." + ], + "enum": [ + "BADGE_TIER_NONE", + "BADGE_TIER_REGULAR", + "BADGE_TIER_PREMIER" + ], + "description": "Whether the company is a Partner.", + "type": "string" + }, + "phoneNumber": { + "description": "The phone number for the company's primary address.", + "type": "string" + }, + "website": { + "description": "The website URL for this company.", + "type": "string" + }, + "primaryCountryCode": { + "type": "string", + "description": "The primary country code of the company." + }, + "companyId": { + "description": "The ID of the company. There may be no id if this is a\npending company.5", + "type": "string" + }, + "primaryLanguageCode": { + "description": "The primary language code of the company.", + "type": "string" + }, + "logoUrl": { + "description": "A URL to a profile photo, e.g. a G+ profile photo.", + "type": "string" + }, + "resolvedTimestamp": { + "format": "google-datetime", + "description": "The timestamp when the user was approved.\n@OutputOnly", + "type": "string" + }, + "companyAdmin": { + "description": "Indicates if the user is an admin for this company.", + "type": "boolean" + }, + "isPending": { + "description": "The flag that indicates if the company is pending verification.", + "type": "boolean" + }, + "address": { + "description": "The primary address for this company.", + "type": "string" + }, + "creationTime": { + "type": "string", + "format": "google-datetime", + "description": "The timestamp of when affiliation was requested.\n@OutputOnly" + }, + "state": { + "description": "The state of relationship, in terms of approvals.", + "type": "string", + "enumDescriptions": [ + "Default unspecified value.", + "User has filled in a request to be associated with an company.\nNow waiting email confirmation.", + "Pending approval from company.\nEmail confirmation will not approve this one.", + "Approved by company." + ], + "enum": [ + "USER_COMPANY_REATION_STATE_NONE_SPECIFIED", + "USER_COMPANY_RELATION_STATE_AWAIT_EMAIL", + "USER_COMPANY_RELATION_STATE_AWAIT_ADMIN", + "USER_COMPANY_RELATION_STATE_APPROVED" + ] + }, + "primaryAddress": { + "description": "The primary location of the company.", + "$ref": "Location" + }, + "managerAccount": { + "format": "int64", + "description": "The AdWords manager account # associated this company.", + "type": "string" + }, + "name": { + "description": "The name (in the company's primary language) for the company.", + "type": "string" + }, + "segment": { + "description": "The segment the company is classified as.", + "items": { + "type": "string", + "enum": [ + "COMPANY_SEGMENT_UNKNOWN", + "COMPANY_SEGMENT_NAL", + "COMPANY_SEGMENT_PSP", + "COMPANY_SEGMENT_PPSP" + ] + }, + "type": "array", + "enumDescriptions": [ + "Default segment indicates an unknown.", + "Segment representing a selected group of Partners", + "Segment representing Premier SMB Partners, an AdWords partnership program.", + "A segment of Premier SMB Partners that have relationship with Google." + ] + } + }, + "id": "CompanyRelation" + }, + "Date": { + "id": "Date", + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "month": { + "format": "int32", + "description": "Month of year. Must be from 1 to 12.", + "type": "integer" + }, + "day": { + "type": "integer", + "format": "int32", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant." + }, + "year": { + "format": "int32", + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "type": "integer" + } + } + }, + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object" + }, + "TrafficSource": { + "description": "Source of traffic for the current request.", + "type": "object", + "properties": { + "trafficSourceId": { + "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + }, + "trafficSubId": { + "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", + "type": "string" + } + }, + "id": "TrafficSource" + }, + "CreateLeadRequest": { + "description": "Request message for CreateLead.", + "type": "object", + "properties": { + "requestMetadata": { + "description": "Current request metadata.", + "$ref": "RequestMetadata" + }, + "recaptchaChallenge": { + "description": "\u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e challenge info.", + "$ref": "RecaptchaChallenge" + }, + "lead": { + "description": "The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED`\nand either `email` or `phone_number` must be provided.", + "$ref": "Lead" + } + }, + "id": "CreateLeadRequest" + }, + "RequestMetadata": { + "description": "Common data that is in each API request.", + "type": "object", + "properties": { + "trafficSource": { + "description": "Source of traffic for the current request.", + "$ref": "TrafficSource" + }, + "experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "items": { + "type": "string" + }, + "type": "array" + }, + "locale": { + "description": "Locale to use for the current request.", + "type": "string" + }, + "partnersSessionId": { + "description": "Google Partners session ID.", + "type": "string" + }, + "userOverrides": { + "description": "Values to use instead of the user's respective defaults for the current\nrequest. These are only honored by whitelisted products.", + "$ref": "UserOverrides" + } + }, + "id": "RequestMetadata" + }, + "EventData": { + "id": "EventData", + "description": "Key value data pair for an event.", + "type": "object", + "properties": { + "key": { + "enum": [ + "EVENT_DATA_TYPE_UNSPECIFIED", + "ACTION", + "AGENCY_ID", + "AGENCY_NAME", + "AGENCY_PHONE_NUMBER", + "AGENCY_WEBSITE", + "BUDGET", + "CENTER_POINT", + "CERTIFICATION", + "COMMENT", + "COUNTRY", + "CURRENCY", + "CURRENTLY_VIEWED_AGENCY_ID", + "DISTANCE", + "DISTANCE_TYPE", + "EXAM", + "HISTORY_TOKEN", + "ID", + "INDUSTRY", + "INSIGHT_TAG", + "LANGUAGE", + "LOCATION", + "MARKETING_OPT_IN", + "QUERY", + "SEARCH_START_INDEX", + "SERVICE", + "SHOW_VOW", + "SOLUTION", + "TRAFFIC_SOURCE_ID", + "TRAFFIC_SUB_ID", + "VIEW_PORT", + "WEBSITE", + "DETAILS", + "EXPERIMENT_ID", + "GPS_MOTIVATION", + "URL", + "ELEMENT_FOCUS", + "PROGRESS" + ], + "description": "Data type.", + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Action data.", + "Agency ID data.", + "Agency name data.", + "Agency phone number data.", + "Agency website data.", + "Budget data.", + "Center-point data.", + "Certification data.", + "Comment data.", + "Country data.", + "Currency data.", + "Currently viewed agency ID data.", + "Distance data.", + "Distance type data.", + "Exam data.", + "History token data.", + "Identifier data.", + "Industry data.", + "Insight tag data.", + "Language data.", + "Location data.", + "Marketing opt-in data.", + "Query data.", + "Search start index data.", + "Service data.", + "Show vow data.", + "Solution data.", + "Traffic source ID data.", + "Traffic sub ID data.", + "Viewport data.", + "Website data.", + "Details data.", + "Experiment ID data.", + "Google Partner Search motivation data.", + "URL data.", + "Element we wanted user to focus on.", + "Progress when viewing an item \\[0-100\\]." + ] + }, + "values": { + "description": "Data values.", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "ExamStatus": { + "id": "ExamStatus", + "description": "A user's information on a specific exam.", + "type": "object", + "properties": { + "examType": { + "enum": [ + "CERTIFICATION_EXAM_TYPE_UNSPECIFIED", + "CET_ADWORDS_FUNDAMENTALS", + "CET_ADWORDS_ADVANCED_SEARCH", + "CET_ADWORDS_ADVANCED_DISPLAY", + "CET_VIDEO_ADS", + "CET_DOUBLECLICK", + "CET_ANALYTICS", + "CET_SHOPPING", + "CET_MOBILE", + "CET_DIGITAL_SALES", + "CET_MOBILE_SITES" + ], + "description": "The type of the exam.", + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Adwords Fundamentals exam.", + "AdWords advanced search exam.", + "AdWords advanced display exam.", + "VideoAds exam.", + "DoubleClick exam.", + "Analytics exam.", + "Shopping exam.", + "Mobile exam.", + "Digital Sales exam.", + "Mobile Sites exam." + ] + }, + "passed": { + "description": "Whether this exam has been passed and not expired.", + "type": "boolean" + }, + "taken": { + "format": "google-datetime", + "description": "The date the user last taken this exam.", + "type": "string" + }, + "warning": { + "type": "boolean", + "description": "Whether this exam is in the state of warning." + }, + "expiration": { + "format": "google-datetime", + "description": "Date this exam is due to expire.", + "type": "string" + }, + "lastPassed": { + "format": "google-datetime", + "description": "The date the user last passed this exam.", + "type": "string" + } + } + }, + "ListOffersResponse": { + "description": "Response for ListOffer.", + "type": "object", + "properties": { + "noOfferReason": { + "enumDescriptions": [ + "Unset.", + "Not an MCC.", + "Offer limit has been reached.", + "Ineligible for offers." + ], + "enum": [ + "NO_OFFER_REASON_UNSPECIFIED", + "NO_OFFER_REASON_NO_MCC", + "NO_OFFER_REASON_LIMIT_REACHED", + "NO_OFFER_REASON_INELIGIBLE" + ], + "description": "Reason why no Offers are available.", + "type": "string" + }, + "availableOffers": { + "items": { + "$ref": "AvailableOffer" + }, + "type": "array", + "description": "Available Offers to be distributed." + }, + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + } + }, + "id": "ListOffersResponse" + }, + "CountryOfferInfo": { + "properties": { + "getYAmount": { + "type": "string", + "description": "(localized) Get Y amount for that country's offer." + }, + "spendXAmount": { + "description": "(localized) Spend X amount for that country's offer.", + "type": "string" + }, + "offerCountryCode": { + "description": "Country code for which offer codes may be requested.", + "type": "string" + }, + "offerType": { + "enum": [ + "OFFER_TYPE_UNSPECIFIED", + "OFFER_TYPE_SPEND_X_GET_Y", + "OFFER_TYPE_VIDEO", + "OFFER_TYPE_SPEND_MATCH" + ], + "description": "Type of offer country is eligible for.", + "type": "string", + "enumDescriptions": [ + "Unset.", + "AdWords spend X get Y.", + "Youtube video.", + "Spend Match up to Y." + ] + } + }, + "id": "CountryOfferInfo", + "description": "Offer info by country.", + "type": "object" + }, + "ListCompaniesResponse": { + "description": "Response message for\nListCompanies.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve next page of results.\nPass this value in the `ListCompaniesRequest.page_token` field in the\nsubsequent call to\nListCompanies to retrieve the\nnext page of results.", + "type": "string" + }, + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "companies": { + "description": "The list of companies.", + "items": { + "$ref": "Company" + }, + "type": "array" + } + }, + "id": "ListCompaniesResponse" + }, + "OfferCustomer": { + "id": "OfferCustomer", + "description": "Customers qualified for an offer.", + "type": "object", + "properties": { + "adwordsUrl": { + "description": "URL to the customer's AdWords page.", + "type": "string" + }, + "eligibilityDaysLeft": { + "format": "int32", + "description": "Days the customer is still eligible.", + "type": "integer" + }, + "offerType": { + "enum": [ + "OFFER_TYPE_UNSPECIFIED", + "OFFER_TYPE_SPEND_X_GET_Y", + "OFFER_TYPE_VIDEO", + "OFFER_TYPE_SPEND_MATCH" + ], + "description": "Type of the offer", + "type": "string", + "enumDescriptions": [ + "Unset.", + "AdWords spend X get Y.", + "Youtube video.", + "Spend Match up to Y." + ] + }, + "externalCid": { + "format": "int64", + "description": "External CID for the customer.", + "type": "string" + }, + "countryCode": { + "description": "Country code of the customer.", + "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "Time the customer was created.", + "type": "string" + }, + "getYAmount": { + "description": "Formatted Get Y amount with currency code.", + "type": "string" + }, + "name": { + "description": "Name of the customer.", + "type": "string" + }, + "spendXAmount": { + "description": "Formatted Spend X amount with currency code.", + "type": "string" + } + } + }, + "CertificationStatus": { + "properties": { + "type": { + "enumDescriptions": [ + "Unchosen.", + "AdWords certified.", + "YouTube certified.", + "VideoAds certified.", + "Analytics certified.", + "DoubleClick certified.", + "Shopping certified.", + "Mobile certified.", + "Digital sales certified.", + "AdWords Search certified.", + "AdWords Display certified.", + "Mobile Sites certified." + ], + "enum": [ + "CERTIFICATION_TYPE_UNSPECIFIED", + "CT_ADWORDS", + "CT_YOUTUBE", + "CT_VIDEOADS", + "CT_ANALYTICS", + "CT_DOUBLECLICK", + "CT_SHOPPING", + "CT_MOBILE", + "CT_DIGITAL_SALES", + "CT_ADWORDS_SEARCH", + "CT_ADWORDS_DISPLAY", + "CT_MOBILE_SITES" + ], + "description": "The type of the certification.", + "type": "string" + }, + "userCount": { + "format": "int32", + "description": "Number of people who are certified,", + "type": "integer" + }, + "isCertified": { + "description": "Whether certification is passing.", + "type": "boolean" + }, + "examStatuses": { + "items": { + "$ref": "CertificationExamStatus" + }, + "type": "array", + "description": "List of certification exam statuses." + } + }, + "id": "CertificationStatus", + "description": "Google Partners certification status.", + "type": "object" + }, + "LocalizedCompanyInfo": { + "type": "object", + "properties": { + "languageCode": { + "description": "Language code of the localized company info, as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").", + "type": "string" + }, + "countryCodes": { + "description": "List of country codes for the localized company info.", + "items": { + "type": "string" + }, + "type": "array" + }, + "overview": { + "description": "Localized brief description that the company uses to advertise themselves.", + "type": "string" + }, + "displayName": { + "description": "Localized display name.", + "type": "string" + } + }, + "id": "LocalizedCompanyInfo", + "description": "The localized company information." + }, + "LogUserEventResponse": { + "id": "LogUserEventResponse", + "description": "Response message for\nLogUserEvent.", + "type": "object", + "properties": { + "responseMetadata": { + "description": "Current response metadata.", + "$ref": "ResponseMetadata" + } + } + }, + "ListOffersHistoryResponse": { + "description": "Response for ListOfferHistory.", + "type": "object", + "properties": { + "canShowEntireCompany": { + "description": "True if the user has the option to show entire company history.", + "type": "boolean" + }, + "totalResults": { + "format": "int32", + "description": "Number of results across all pages.", + "type": "integer" + }, + "showingEntireCompany": { + "type": "boolean", + "description": "True if this response is showing entire company history." + }, + "offers": { + "description": "Historical offers meeting request.", + "items": { + "$ref": "HistoricalOffer" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Supply this token in a ListOffersHistoryRequest to retrieve the next page.", + "type": "string" + }, + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + } + }, + "id": "ListOffersHistoryResponse" + }, + "LogMessageResponse": { + "description": "Response message for\nLogClientMessage.", + "type": "object", + "properties": { + "responseMetadata": { + "description": "Current response metadata.", + "$ref": "ResponseMetadata" + } + }, + "id": "LogMessageResponse" + }, + "SpecializationStatus": { + "description": "Agency specialization status", + "type": "object", + "properties": { + "badgeSpecialization": { + "enum": [ + "BADGE_SPECIALIZATION_UNKNOWN", + "BADGE_SPECIALIZATION_ADWORDS_SEARCH", + "BADGE_SPECIALIZATION_ADWORDS_DISPLAY", + "BADGE_SPECIALIZATION_ADWORDS_MOBILE", + "BADGE_SPECIALIZATION_ADWORDS_VIDEO", + "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" + ], + "description": "The specialization this status is for.", + "type": "string", + "enumDescriptions": [ + "Unknown specialization", + "AdWords Search specialization", + "AdWords Display specialization", + "AdWords Mobile specialization", + "AdWords Video specialization", + "AdWords Shopping specialization" + ] + }, + "badgeSpecializationState": { + "enumDescriptions": [ + "Unknown state", + "Specialization passed", + "Specialization not passed", + "Specialization in grace" + ], + "enum": [ + "BADGE_SPECIALIZATION_STATE_UNKNOWN", + "BADGE_SPECIALIZATION_STATE_PASSED", + "BADGE_SPECIALIZATION_STATE_NOT_PASSED", + "BADGE_SPECIALIZATION_STATE_IN_GRACE" + ], + "description": "State of agency specialization.", + "type": "string" + } + }, + "id": "SpecializationStatus" + }, "Certification": { "description": "A user's information on a specific certification.", "type": "object", "properties": { - "achieved": { - "description": "Whether this certification has been achieved.", + "warning": { + "description": "Whether this certification is in the state of warning.", "type": "boolean" }, "expiration": { - "description": "Date this certification is due to expire.", "format": "google-datetime", + "description": "Date this certification is due to expire.", "type": "string" }, - "warning": { - "description": "Whether this certification is in the state of warning.", + "achieved": { + "description": "Whether this certification has been achieved.", "type": "boolean" }, "certificationType": { @@ -1291,8 +2202,8 @@ ] }, "lastAchieved": { - "description": "The date the user last achieved certification.", "format": "google-datetime", + "description": "The date the user last achieved certification.", "type": "string" } }, @@ -1302,58 +2213,62 @@ "description": "A resource representing a user of the Partners platform.", "type": "object", "properties": { + "examStatus": { + "description": "The list of exams the user ever taken. For each type of exam, only one\nentry is listed.", + "items": { + "$ref": "ExamStatus" + }, + "type": "array" + }, + "id": { + "description": "The ID of the user.", + "type": "string" + }, "publicProfile": { - "description": "Information about a user's external public profile outside Google Partners.", - "$ref": "PublicProfile" + "$ref": "PublicProfile", + "description": "Information about a user's external public profile outside Google Partners." + }, + "certificationStatus": { + "description": "The list of achieved certifications. These are calculated based on exam\nresults and other requirements.\n@OutputOnly", + "items": { + "$ref": "Certification" + }, + "type": "array" }, "companyVerificationEmail": { "description": "The email address used by the user used for company verification.\n@OutputOnly", "type": "string" }, - "certificationStatus": { - "description": "The list of achieved certifications. These are calculated based on exam\nresults and other requirements.\n@OutputOnly", - "type": "array", - "items": { - "$ref": "Certification" - } + "profile": { + "$ref": "UserProfile", + "description": "The profile information of a Partners user, contains all the directly\neditable user information." }, "company": { - "description": "The company that the user is associated with.\nIf not present, the user is not associated with any company.", - "$ref": "CompanyRelation" - }, - "profile": { - "description": "The profile information of a Partners user, contains all the directly\neditable user information.", - "$ref": "UserProfile" + "$ref": "CompanyRelation", + "description": "The company that the user is associated with.\nIf not present, the user is not associated with any company." }, "lastAccessTime": { - "description": "The most recent time the user interacted with the Partners site.\n@OutputOnly", "format": "google-datetime", + "description": "The most recent time the user interacted with the Partners site.\n@OutputOnly", "type": "string" }, "availableAdwordsManagerAccounts": { "description": "This is the list of AdWords Manager Accounts the user has edit access to.\nIf the user has edit access to multiple accounts, the user can choose the\npreferred account and we use this when a personal account is needed. Can\nbe empty meaning the user has access to no accounts.\n@OutputOnly", - "type": "array", "items": { "$ref": "AdWordsManagerAccountInfo" - } + }, + "type": "array" }, "primaryEmails": { "description": "The list of emails the user has access to/can select as primary.\n@OutputOnly", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, - "examStatus": { - "description": "The list of exams the user ever taken. For each type of exam, only one\nentry is listed.", - "type": "array", - "items": { - "$ref": "ExamStatus" - } - }, - "id": { - "description": "The ID of the user.", - "type": "string" + "internalId": { + "type": "string", + "description": "The internal user ID.\nOnly available for a whitelisted set of api clients." } }, "id": "User" @@ -1362,24 +2277,24 @@ "description": "Response message for\nListAnalytics.", "type": "object", "properties": { - "analytics": { - "description": "The list of analytics.\nSorted in ascending order of\nAnalytics.event_date.", - "type": "array", - "items": { - "$ref": "Analytics" - } - }, "nextPageToken": { "description": "A token to retrieve next page of results.\nPass this value in the `ListAnalyticsRequest.page_token` field in the\nsubsequent call to\nListAnalytics to retrieve the\nnext page of results.", "type": "string" }, + "analyticsSummary": { + "$ref": "AnalyticsSummary", + "description": "Aggregated information across the response's\nanalytics." + }, "responseMetadata": { "$ref": "ResponseMetadata", "description": "Current response metadata." }, - "analyticsSummary": { - "description": "Aggregated information across the response's\nanalytics.", - "$ref": "AnalyticsSummary" + "analytics": { + "description": "The list of analytics.\nSorted in ascending order of\nAnalytics.event_date.", + "items": { + "$ref": "Analytics" + }, + "type": "array" } }, "id": "ListAnalyticsResponse" @@ -1392,21 +2307,21 @@ "description": "A token to retrieve next page of results.\nPass this value in the `ListLeadsRequest.page_token` field in the\nsubsequent call to\nListLeads to retrieve the\nnext page of results.", "type": "string" }, + "totalSize": { + "format": "int32", + "description": "The total count of leads for the given company.", + "type": "integer" + }, "responseMetadata": { "description": "Current response metadata.", "$ref": "ResponseMetadata" }, - "totalSize": { - "description": "The total count of leads for the given company.", - "format": "int32", - "type": "integer" - }, "leads": { "description": "The list of leads.", - "type": "array", "items": { "$ref": "Lead" - } + }, + "type": "array" } }, "id": "ListLeadsResponse" @@ -1415,13 +2330,36 @@ "description": "A company resource in the Google Partners API. Once certified, it qualifies\nfor being searched by advertisers.", "type": "object", "properties": { - "publicProfile": { - "$ref": "PublicProfile", - "description": "Basic information from the company's public profile." + "primaryAdwordsManagerAccountId": { + "format": "int64", + "description": "The Primary AdWords Manager Account id.", + "type": "string" }, - "primaryLocation": { - "description": "The primary location of the company.", - "$ref": "Location" + "name": { + "description": "The name of the company.", + "type": "string" + }, + "localizedInfos": { + "description": "The list of localized info for the company.", + "items": { + "$ref": "LocalizedCompanyInfo" + }, + "type": "array" + }, + "certificationStatuses": { + "description": "The list of Google Partners certification statuses for the company.", + "items": { + "$ref": "CertificationStatus" + }, + "type": "array" + }, + "id": { + "description": "The ID of the company.", + "type": "string" + }, + "originalMinMonthlyBudget": { + "$ref": "Money", + "description": "The unconverted minimum monthly budget that the company accepts for partner\nbusiness." }, "services": { "enumDescriptions": [ @@ -1434,7 +2372,6 @@ "Help with mobile websites." ], "description": "Services the company can help with.", - "type": "array", "items": { "type": "string", "enum": [ @@ -1446,20 +2383,26 @@ "S_MOBILE_AND_VIDEO_ADS", "S_MOBILE_WEBSITE_SERVICES" ] - } + }, + "type": "array" }, - "originalMinMonthlyBudget": { - "description": "The unconverted minimum monthly budget that the company accepts for partner\nbusiness.", - "$ref": "Money" + "primaryLocation": { + "description": "The primary location of the company.", + "$ref": "Location" + }, + "publicProfile": { + "$ref": "PublicProfile", + "description": "Basic information from the company's public profile." }, "ranks": { "description": "Information related to the ranking of the company within the list of\ncompanies.", - "type": "array", "items": { "$ref": "Rank" - } + }, + "type": "array" }, "badgeTier": { + "type": "string", "enumDescriptions": [ "Tier badge is not set.", "Agency has regular partner badge.", @@ -1470,35 +2413,16 @@ "BADGE_TIER_REGULAR", "BADGE_TIER_PREMIER" ], - "description": "Partner badge tier", - "type": "string" + "description": "Partner badge tier" }, "specializationStatus": { "description": "The list of Google Partners specialization statuses for the company.", - "type": "array", "items": { "$ref": "SpecializationStatus" - } + }, + "type": "array" }, "companyTypes": { - "description": "Company type labels listed on the company's profile.", - "type": "array", - "items": { - "enum": [ - "COMPANY_TYPE_UNSPECIFIED", - "FULL_SERVICE_AGENCY", - "MEDIA_AGENCY", - "CREATIVE_AGENCY", - "CDIGITAL_AGENCY", - "SEM_SEO", - "PERFORMANCE_MARKETING", - "ADVERTISING_TOOL_DEVELOPMENT", - "PR", - "SELF_MANAGED", - "RESELLER" - ], - "type": "string" - }, "enumDescriptions": [ "Unchosen.", "Handles all aspects of the advertising process.", @@ -1511,26 +2435,38 @@ "Establishes favorable relationship with public through low/no-cost\ncommunications.", "Does not manage other company's accounts, manages own marketing programs.", "Full-service AdWords account management for local businesses." - ] + ], + "description": "Company type labels listed on the company's profile.", + "items": { + "type": "string", + "enum": [ + "COMPANY_TYPE_UNSPECIFIED", + "FULL_SERVICE_AGENCY", + "MEDIA_AGENCY", + "CREATIVE_AGENCY", + "CDIGITAL_AGENCY", + "SEM_SEO", + "PERFORMANCE_MARKETING", + "ADVERTISING_TOOL_DEVELOPMENT", + "PR", + "SELF_MANAGED", + "RESELLER" + ] + }, + "type": "array" }, "autoApprovalEmailDomains": { "description": "Email domains that allow users with a matching email address to get\nauto-approved for associating with this company.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "primaryLanguageCode": { "description": "The primary language code of the company, as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").", "type": "string" }, "profileStatus": { - "enumDescriptions": [ - "Unchosen.", - "Company profile does not show up publicly.", - "Company profile can only be viewed by the profile's URL\nand not by Google Partner Search.", - "Company profile can be viewed by the profile's URL\nand by Google Partner Search." - ], "enum": [ "COMPANY_PROFILE_STATUS_UNSPECIFIED", "HIDDEN", @@ -1538,35 +2474,26 @@ "SEARCHABLE" ], "description": "The public viewability status of the company's profile.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Company profile does not show up publicly.", + "Company profile can only be viewed by the profile's URL\nand not by Google Partner Search.", + "Company profile can be viewed by the profile's URL\nand by Google Partner Search." + ] }, "locations": { "description": "The list of all company locations.\nIf set, must include the\nprimary_location\nin the list.", - "type": "array", "items": { "$ref": "Location" - } + }, + "type": "array" }, "convertedMinMonthlyBudget": { "description": "The minimum monthly budget that the company accepts for partner business,\nconverted to the requested currency code.", "$ref": "Money" }, "industries": { - "enumDescriptions": [ - "Unchosen.", - "The automotive industry.", - "The business-to-business industry.", - "The consumer packaged goods industry.", - "The education industry.", - "The finance industry.", - "The healthcare industry.", - "The media and entertainment industry.", - "The retail industry.", - "The technology industry.", - "The travel industry." - ], - "description": "Industries the company can help with.", - "type": "array", "items": { "enum": [ "INDUSTRY_UNSPECIFIED", @@ -1582,45 +2509,33 @@ "I_TRAVEL" ], "type": "string" - } + }, + "type": "array", + "enumDescriptions": [ + "Unchosen.", + "The automotive industry.", + "The business-to-business industry.", + "The consumer packaged goods industry.", + "The education industry.", + "The finance industry.", + "The healthcare industry.", + "The media and entertainment industry.", + "The retail industry.", + "The technology industry.", + "The travel industry." + ], + "description": "Industries the company can help with." + }, + "additionalWebsites": { + "description": "URL of the company's additional websites used to verify the dynamic badges.\nThese are stored as full URLs as entered by the user, but only the TLD will\nbe used for the actual verification.", + "items": { + "type": "string" + }, + "type": "array" }, "websiteUrl": { "description": "URL of the company's website.", "type": "string" - }, - "additionalWebsites": { - "description": "URL of the company's additional websites used to verify the dynamic badges.\nThese are stored as full URLs as entered by the user, but only the TLD will\nbe used for the actual verification.", - "type": "array", - "items": { - "type": "string" - } - }, - "primaryAdwordsManagerAccountId": { - "description": "The Primary AdWords Manager Account id.", - "format": "int64", - "type": "string" - }, - "name": { - "description": "The name of the company.", - "type": "string" - }, - "localizedInfos": { - "description": "The list of localized info for the company.", - "type": "array", - "items": { - "$ref": "LocalizedCompanyInfo" - } - }, - "id": { - "description": "The ID of the company.", - "type": "string" - }, - "certificationStatuses": { - "description": "The list of Google Partners certification statuses for the company.", - "type": "array", - "items": { - "$ref": "CertificationStatus" - } } }, "id": "Company" @@ -1629,10 +2544,6 @@ "description": "Response message for CreateLead.", "type": "object", "properties": { - "lead": { - "$ref": "Lead", - "description": "Lead that was created depending on the outcome of\n\u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e validation." - }, "recaptchaStatus": { "enumDescriptions": [ "Unchosen.", @@ -1649,6 +2560,10 @@ "description": "The outcome of \u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e\nvalidation.", "type": "string" }, + "lead": { + "$ref": "Lead", + "description": "Lead that was created depending on the outcome of\n\u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e validation." + }, "responseMetadata": { "$ref": "ResponseMetadata", "description": "Current response metadata." @@ -1657,7 +2572,6 @@ "id": "CreateLeadResponse" }, "GetCompanyResponse": { - "description": "Response message for GetCompany.", "type": "object", "properties": { "company": { @@ -1665,32 +2579,28 @@ "$ref": "Company" }, "responseMetadata": { - "$ref": "ResponseMetadata", - "description": "Current response metadata." + "description": "Current response metadata.", + "$ref": "ResponseMetadata" } }, - "id": "GetCompanyResponse" + "id": "GetCompanyResponse", + "description": "Response message for GetCompany." }, "Location": { - "description": "A location with address and geographic coordinates. May optionally contain a\ndetailed (multi-field) version of the address.", "type": "object", "properties": { - "administrativeArea": { - "description": "Top-level administrative subdivision of this country.", - "type": "string" - }, "locality": { "description": "Generally refers to the city/town portion of an address.", "type": "string" }, + "administrativeArea": { + "description": "Top-level administrative subdivision of this country.", + "type": "string" + }, "latLng": { "$ref": "LatLng", "description": "The latitude and longitude of the location, in degrees." }, - "address": { - "description": "The single string version of the address.", - "type": "string" - }, "dependentLocality": { "description": "Dependent locality or sublocality. Used for UK dependent localities, or\nneighborhoods or boroughs in other locations.", "type": "string" @@ -1699,6 +2609,10 @@ "description": "CLDR (Common Locale Data Repository) region code .", "type": "string" }, + "address": { + "description": "The single string version of the address.", + "type": "string" + }, "postalCode": { "description": "Values are frequently alphanumeric.", "type": "string" @@ -1713,26 +2627,28 @@ }, "addressLine": { "description": "The following address lines represent the most specific part of any\naddress.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "Location" + "id": "Location", + "description": "A location with address and geographic coordinates. May optionally contain a\ndetailed (multi-field) version of the address." }, "ExamToken": { + "id": "ExamToken", "description": "A token that allows a user to take an exam.", "type": "object", "properties": { "examId": { - "description": "The id of the exam the token is for.", "format": "int64", + "description": "The id of the exam the token is for.", "type": "string" }, "token": { - "description": "The token, only present if the user has access to the exam.", - "type": "string" + "type": "string", + "description": "The token, only present if the user has access to the exam." }, "examType": { "description": "The type of the exam the token belongs to.", @@ -1764,19 +2680,31 @@ "CET_MOBILE_SITES" ] } - }, - "id": "ExamToken" + } }, "CertificationExamStatus": { "description": "Status for a Google Partners certification exam.", "type": "object", "properties": { "numberUsersPass": { - "description": "The number of people who have passed the certification exam.", "format": "int32", + "description": "The number of people who have passed the certification exam.", "type": "integer" }, "type": { + "enum": [ + "CERTIFICATION_EXAM_TYPE_UNSPECIFIED", + "CET_ADWORDS_FUNDAMENTALS", + "CET_ADWORDS_ADVANCED_SEARCH", + "CET_ADWORDS_ADVANCED_DISPLAY", + "CET_VIDEO_ADS", + "CET_DOUBLECLICK", + "CET_ANALYTICS", + "CET_SHOPPING", + "CET_MOBILE", + "CET_DIGITAL_SALES", + "CET_MOBILE_SITES" + ], "description": "The type of certification exam.", "type": "string", "enumDescriptions": [ @@ -1791,19 +2719,6 @@ "Mobile exam.", "Digital Sales exam.", "Mobile Sites exam." - ], - "enum": [ - "CERTIFICATION_EXAM_TYPE_UNSPECIFIED", - "CET_ADWORDS_FUNDAMENTALS", - "CET_ADWORDS_ADVANCED_SEARCH", - "CET_ADWORDS_ADVANCED_DISPLAY", - "CET_VIDEO_ADS", - "CET_DOUBLECLICK", - "CET_ANALYTICS", - "CET_SHOPPING", - "CET_MOBILE", - "CET_DIGITAL_SALES", - "CET_MOBILE_SITES" ] } }, @@ -1821,14 +2736,14 @@ "description": "An opt-in about receiving email with customized AdWords campaign management\ntips.", "type": "boolean" }, + "phoneContact": { + "type": "boolean", + "description": "An opt-in to allow recieivng phone calls about their Partners account." + }, "physicalMail": { "description": "An opt-in to receive special promotional gifts and material in the mail.", "type": "boolean" }, - "phoneContact": { - "description": "An opt-in to allow recieivng phone calls about their Partners account.", - "type": "boolean" - }, "marketComm": { "description": "An opt-in about receiving email from Partners marketing teams. Includes\nmember-only events and special promotional offers for Google products.", "type": "boolean" @@ -1837,7 +2752,6 @@ "id": "OptIns" }, "Rank": { - "description": "Information related to ranking of results.", "type": "object", "properties": { "type": { @@ -1853,12 +2767,13 @@ "type": "string" }, "value": { - "description": "The numerical value of the rank.", "format": "double", + "description": "The numerical value of the rank.", "type": "number" } }, - "id": "Rank" + "id": "Rank", + "description": "Information related to ranking of results." }, "UserProfile": { "description": "The profile information of a Partners user.", @@ -1869,8 +2784,8 @@ "type": "string" }, "adwordsManagerAccount": { - "description": "If the user has edit access to multiple accounts, the user can choose the\npreferred account and it is used when a personal account is needed. Can\nbe empty.", "format": "int64", + "description": "If the user has edit access to multiple accounts, the user can choose the\npreferred account and it is used when a personal account is needed. Can\nbe empty.", "type": "string" }, "primaryCountryCode": { @@ -1883,10 +2798,10 @@ }, "channels": { "description": "A list of ids representing which channels the user selected they were in.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "profilePublic": { "description": "Whether the user's public profile is visible to anyone with the URL.", @@ -1894,14 +2809,14 @@ }, "jobFunctions": { "description": "A list of ids represnting which job categories the user selected.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "givenName": { - "description": "The user's given name.", - "type": "string" + "type": "string", + "description": "The user's given name." }, "address": { "$ref": "Location", @@ -1909,37 +2824,38 @@ }, "industries": { "description": "A list of ids representing which industries the user selected.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "languages": { + "description": "The list of languages this user understands.", + "items": { + "type": "string" + }, + "type": "array" }, "familyName": { "description": "The user's family name.", "type": "string" }, "emailOptIns": { - "$ref": "OptIns", - "description": "The list of opt-ins for the user, related to communication preferences." - }, - "languages": { - "description": "The list of languages this user understands.", - "type": "array", - "items": { - "type": "string" - } + "description": "The list of opt-ins for the user, related to communication preferences.", + "$ref": "OptIns" }, "markets": { "description": "A list of ids representing which markets the user was interested in.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "UserProfile" }, "GetPartnersStatusResponse": { + "id": "GetPartnersStatusResponse", "description": "Response message for\nGetPartnersStatus.", "type": "object", "properties": { @@ -1947,23 +2863,15 @@ "description": "Current response metadata.", "$ref": "ResponseMetadata" } - }, - "id": "GetPartnersStatusResponse" + } }, "HistoricalOffer": { "description": "Historical information about a Google Partners Offer.", "type": "object", "properties": { - "creationTime": { - "description": "Time offer was first created.", - "format": "google-datetime", - "type": "string" - }, - "clientEmail": { - "description": "Email address for client.", - "type": "string" - }, "status": { + "description": "Status of the offer.", + "type": "string", "enumDescriptions": [ "Unset.", "Offer distributed.", @@ -1977,22 +2885,24 @@ "OFFER_STATUS_REDEEMED", "OFFER_STATUS_AWARDED", "OFFER_STATUS_EXPIRED" - ], - "description": "Status of the offer.", + ] + }, + "clientEmail": { + "description": "Email address for client.", "type": "string" }, "clientId": { - "description": "ID of client.", + "type": "string", "format": "int64", - "type": "string" + "description": "ID of client." }, "clientName": { "description": "Name of the client.", "type": "string" }, "lastModifiedTime": { - "description": "Time last action was taken.", "format": "google-datetime", + "description": "Time last action was taken.", "type": "string" }, "adwordsUrl": { @@ -2024,13 +2934,18 @@ "type": "string" }, "expirationTime": { - "description": "Time this offer expires.", "format": "google-datetime", + "description": "Time this offer expires.", "type": "string" }, "offerCode": { "description": "Offer code.", "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "Time offer was first created.", + "type": "string" } }, "id": "HistoricalOffer" @@ -2039,13 +2954,13 @@ "description": "Values to use instead of the user's respective defaults. These are only\nhonored by whitelisted products.", "type": "object", "properties": { - "ipAddress": { - "description": "IP address to use instead of the user's geo-located IP address.", - "type": "string" - }, "userId": { "description": "Logged-in user ID to impersonate instead of the user's ID.", "type": "string" + }, + "ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string" } }, "id": "UserOverrides" @@ -2054,240 +2969,11 @@ "description": "Request message for\nLogUserEvent.", "type": "object", "properties": { - "url": { - "description": "The URL where the event occurred.", - "type": "string" - }, - "requestMetadata": { - "$ref": "RequestMetadata", - "description": "Current request metadata." - }, - "eventDatas": { - "description": "List of event data for the event.", - "type": "array", - "items": { - "$ref": "EventData" - } - }, - "eventScope": { - "enumDescriptions": [ - "Unchosen.", - "Based on visitor.", - "Based on session.", - "Based on page visit." - ], - "enum": [ - "EVENT_SCOPE_UNSPECIFIED", - "VISITOR", - "SESSION", - "PAGE" - ], - "description": "The scope of the event.", - "type": "string" - }, - "eventCategory": { - "description": "The category the action belongs to.", - "type": "string", - "enumDescriptions": [ - "Unchosen.", - "Google Partner Search category.", - "Google Partner sign-up flow category.", - "Google Partner portal category.", - "Google Partner portal my-profile category.", - "Google Partner portal certifications category.", - "Google Partner portal community category.", - "Google Partner portal insights category.", - "Google Partner portal clients category.", - "Google Partner portal public user profile category.", - "Google Partner panel category.", - "Google Partner portal last admin dialog category.", - "Google Partner client category.", - "Google Partner portal company profile category.", - "External links category.", - "Google Partner landing category." - ], - "enum": [ - "EVENT_CATEGORY_UNSPECIFIED", - "GOOGLE_PARTNER_SEARCH", - "GOOGLE_PARTNER_SIGNUP_FLOW", - "GOOGLE_PARTNER_PORTAL", - "GOOGLE_PARTNER_PORTAL_MY_PROFILE", - "GOOGLE_PARTNER_PORTAL_CERTIFICATIONS", - "GOOGLE_PARTNER_PORTAL_COMMUNITY", - "GOOGLE_PARTNER_PORTAL_INSIGHTS", - "GOOGLE_PARTNER_PORTAL_CLIENTS", - "GOOGLE_PARTNER_PUBLIC_USER_PROFILE", - "GOOGLE_PARTNER_PANEL", - "GOOGLE_PARTNER_PORTAL_LAST_ADMIN_DIALOG", - "GOOGLE_PARTNER_CLIENT", - "GOOGLE_PARTNER_PORTAL_COMPANY_PROFILE", - "EXTERNAL_LINKS", - "GOOGLE_PARTNER_LANDING" - ] - }, "lead": { - "description": "Advertiser lead information.", - "$ref": "Lead" + "$ref": "Lead", + "description": "Advertiser lead information." }, "eventAction": { - "enumDescriptions": [ - "Unchosen.", - "Advertiser clicked `Find a partner` bottom button.", - "Advertiser clicked `Find a partner` top button.", - "Agency clicked `Join now` bottom button.", - "Agency clicked `Join now` top button.", - "Advertiser canceled partner contact form.", - "Advertiser started partner contact form.", - "Advertiser completed partner contact form.", - "Advertiser entered email in contact form.", - "Advertiser entered name in contact form.", - "Advertiser entered phone in contact form.", - "Advertiser failed \u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e\nin contact form.", - "Company viewed by advertiser.", - "Advertiser canceled partner contact form on Google Partner Search.", - "Advertiser changed a top search parameter.", - "Advertiser started partner contact form on Google Partner Search.", - "Advertiser clicked `Show more partners` bottom button.", - "Advertiser completed partner contact form on Google Partner Search.", - "Advertiser saw no partners available with search criteria.", - "Advertiser performed search on Google Partner Search.", - "Advertiser viewed a partner on Google Partner Search.", - "Advertiser canceled partner contact form on profile page.", - "Advertiser started partner contact form on profile page.", - "Advertiser clicked partner website.", - "Advertiser completed contact form on profile page.", - "Advertiser viewed a partner profile.", - "Agency clicked `accept Terms Of Service` button.", - "Agency changed Terms Of Service country.", - "Agency added address in profile portal.", - "Agency added phone number in profile portal.", - "Agency changed primary account association.", - "Agency changed primary country association.", - "Agency clicked `affiliate` button in profile portal.", - "Agency clicked `give edit access` in profile portal.", - "Agency clicked `log out` in profile portal.", - "Agency clicked profile portal left nav.", - "Agency clicked `save and continue` at bottom of complete profile.", - "Agency clicked `unaffiliate` in profile portal.", - "Agency filled out company affiliation in profile portal.", - "Agency successfully connected with company in profile portal.", - "Agency clicked create MCC in profile portal.", - "Agency did not have an MCC associated on profile portal.", - "Agency had an MCC associated on profile portal.", - "Agency added job function in profile portal.", - "Agency looked at job function drop-down.", - "Agency selected `account manage` as job function.", - "Agency selected `account planner` as job function.", - "Agency selected `Analytics` as job function.", - "Agency selected `creative` as job function.", - "Agency selected `media buyer` as job function.", - "Agency selected `media planner` as job function.", - "Agency selected `other` as job function.", - "Agency selected `production` as job function.", - "Agency selected `SEO` as job function.", - "Agency selected `sales rep` as job function.", - "Agency selected `search specialist` as job function.", - "Agency added channels in profile portal.", - "Agency looked at `add channel` drop-down.", - "Agency selected `cross channel` from add channel drop-down.", - "Agency selected `display` from add channel drop-down.", - "Agency selected `mobile` from add channel drop-down.", - "Agency selected `search` from add channel drop-down.", - "Agency selected `social` from add channel drop-down.", - "Agency selected `tools` from add channel drop-down.", - "Agency selected `YouTube` from add channel drop-down.", - "Agency added industries in profile portal.", - "Agency changed `add industries` drop-down.", - "Agency added markets in profile portal.", - "Agency changed `add markets` drop-down.", - "Agency checked `recieve mail promotions` in profile portal.", - "Agency checked `recieve mail promotions` in sign-up.", - "Agency selected `opt-in beta tests and market research`.", - "Agency selected `opt-in beta tests` in profile portal.", - "Agency selected `opt-in news` in profile portal.", - "Agency selected `opt-in news invitations and promotions`.", - "Agency selected `opt-in performance SUG` in profile portal.", - "Agency selected `opt-in performance suggestions`.", - "Agency selected `opt-in select all email notifications`.", - "Agency selected `select all opt-ins` in profile portal.", - "Agency clicked back button on `connect with company`.", - "Agency clicked continue to overview on `connect with company`.", - "Agency clicked `create MCC connect with company not found`.", - "Agency clicked `give edit access connect with company not found`.", - "Agency clicked `log out connect with company not found`.", - "Agency clicked `skip for now on connect with company page`.", - "Agency closed connection to company.", - "Agency completed field connect with company.", - "Agency found company to connect with.", - "Agency successfully created company.", - "Agency added new company location.", - "Agency clicked community `join now link` in portal notifications.", - "Agency clicked `connect to company` link in portal notifications.", - "Agency cliecked `get certified` link in portal notifications.", - "Agency clicked `get VideoAds certified` link in portal notifications.", - "Agency clicked `link to MCC` link in portal notifications.", - "Agency clicked `insight content` in portal.", - "Agency clicked `insights view now pitch decks` in portal.", - "Agency clicked `insights` left nav in portal.", - "Agency clicked `insights upload content`.", - "Agency clicked `insights viewed deprecated`.", - "Agency clicked `community` left nav in portal.", - "Agency clicked `join community` button in community portal.", - "Agency clicked `certifications` left nav in portal.", - "Agency clicked `certifications product` left nav in portal.", - "Agency clicked `partner status` left nav in portal.", - "Agency clicked `partner status product` left nav in portal.", - "Agency clicked `offers` left nav in portal.", - "Agency clicked `send` button on offers page.", - "Agency clicked `exam details` on certifications AdWords page.", - "Agency clicked `see exams` certifications main page.", - "Agency clicked `take exam` on certifications exam page.", - "Agency opened `last admin` dialog.", - "Agency opened dialog with no users.", - "Agency promoted user to admin.", - "Agency unaffiliated.", - "Agency changed roles.", - "Advertiser clicked `company name` link to profile.", - "Advertiser viewed AdWords certificate.", - "Advertiser viewed AdWords Search certificate.", - "Advertiser viewed AdWords Display certificate.", - "Advertiser clicked AdWords certificate help icon.", - "Advertiser viewed Analytics certificate.", - "Advertiser viewed DoubleClick certificate.", - "Advertiser viewed Mobile Sites certificate.", - "Advertiser viewed VideoAds certificate.", - "Advertiser clicked Shopping certificate help icon.", - "Advertiser clicked VideoAds certificate help icon.", - "Clicked `help` at bottom.", - "Clicked `help` at top.", - "Client error occurred.", - "Agency clicked left nav `stories`.", - "Click occured.", - "Advertiser clicked Mobile certificate help icon.", - "Agency failed the company verification.", - "User visited the landing portion of Google Partners.", - "User visited the Google Partner Search portion of Google Partners.", - "User visited the agency portal portion of Google Partners.", - "User cancelled signing up.", - "User cancelled signing up their company.", - "Agency clicked `Sign in` top button.", - "Agency clicked `save and continue` at bottom of incomplete profile.", - "Agency unselected `opt-in news invitations and promotions`.", - "Agency unselected `opt-in beta tests and market research`.", - "Agency unselected `opt-in performance suggestions`.", - "Agency selected `opt-out unselect all email notifications`.", - "Agency linked their individual MCC.", - "Agency was suggested to user for affiliation.", - "Agency ignored suggested agencies and begin searching.", - "Agency picked a suggested agency.", - "Agency searched for agencies.", - "Agency picked a searched agency.", - "Agency dismissed affiliation widget.", - "Agency clicked on the download link for downloading content.", - "Agency user is maklingg progress viewing a content item.", - "Agency clicked `cancel Terms Of Service` button.", - "Advertiser entered website in contact form." - ], "enum": [ "EVENT_ACTION_UNSPECIFIED", "SMB_CLICKED_FIND_A_PARTNER_BUTTON_BOTTOM", @@ -2416,6 +3102,7 @@ "SMB_VIEWED_VIDEO_ADS_CERTIFICATE", "SMB_VIEWED_SHOPPING_CERTIFICATE", "SMB_CLICKED_VIDEO_ADS_CERTIFICATE_HELP_ICON", + "SMB_VIEWED_DIGITAL_SALES_CERTIFICATE", "CLICKED_HELP_AT_BOTTOM", "CLICKED_HELP_AT_TOP", "CLIENT_ERROR", @@ -2447,45 +3134,275 @@ "SMB_ENTERED_WEBSITE_IN_CONTACT_PARTNER_FORM" ], "description": "The action that occurred.", + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Advertiser clicked `Find a partner` bottom button.", + "Advertiser clicked `Find a partner` top button.", + "Agency clicked `Join now` bottom button.", + "Agency clicked `Join now` top button.", + "Advertiser canceled partner contact form.", + "Advertiser started partner contact form.", + "Advertiser completed partner contact form.", + "Advertiser entered email in contact form.", + "Advertiser entered name in contact form.", + "Advertiser entered phone in contact form.", + "Advertiser failed \u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e\nin contact form.", + "Company viewed by advertiser.", + "Advertiser canceled partner contact form on Google Partner Search.", + "Advertiser changed a top search parameter.", + "Advertiser started partner contact form on Google Partner Search.", + "Advertiser clicked `Show more partners` bottom button.", + "Advertiser completed partner contact form on Google Partner Search.", + "Advertiser saw no partners available with search criteria.", + "Advertiser performed search on Google Partner Search.", + "Advertiser viewed a partner on Google Partner Search.", + "Advertiser canceled partner contact form on profile page.", + "Advertiser started partner contact form on profile page.", + "Advertiser clicked partner website.", + "Advertiser completed contact form on profile page.", + "Advertiser viewed a partner profile.", + "Agency clicked `accept Terms Of Service` button.", + "Agency changed Terms Of Service country.", + "Agency added address in profile portal.", + "Agency added phone number in profile portal.", + "Agency changed primary account association.", + "Agency changed primary country association.", + "Agency clicked `affiliate` button in profile portal.", + "Agency clicked `give edit access` in profile portal.", + "Agency clicked `log out` in profile portal.", + "Agency clicked profile portal left nav.", + "Agency clicked `save and continue` at bottom of complete profile.", + "Agency clicked `unaffiliate` in profile portal.", + "Agency filled out company affiliation in profile portal.", + "Agency successfully connected with company in profile portal.", + "Agency clicked create MCC in profile portal.", + "Agency did not have an MCC associated on profile portal.", + "Agency had an MCC associated on profile portal.", + "Agency added job function in profile portal.", + "Agency looked at job function drop-down.", + "Agency selected `account manage` as job function.", + "Agency selected `account planner` as job function.", + "Agency selected `Analytics` as job function.", + "Agency selected `creative` as job function.", + "Agency selected `media buyer` as job function.", + "Agency selected `media planner` as job function.", + "Agency selected `other` as job function.", + "Agency selected `production` as job function.", + "Agency selected `SEO` as job function.", + "Agency selected `sales rep` as job function.", + "Agency selected `search specialist` as job function.", + "Agency added channels in profile portal.", + "Agency looked at `add channel` drop-down.", + "Agency selected `cross channel` from add channel drop-down.", + "Agency selected `display` from add channel drop-down.", + "Agency selected `mobile` from add channel drop-down.", + "Agency selected `search` from add channel drop-down.", + "Agency selected `social` from add channel drop-down.", + "Agency selected `tools` from add channel drop-down.", + "Agency selected `YouTube` from add channel drop-down.", + "Agency added industries in profile portal.", + "Agency changed `add industries` drop-down.", + "Agency added markets in profile portal.", + "Agency changed `add markets` drop-down.", + "Agency checked `recieve mail promotions` in profile portal.", + "Agency checked `recieve mail promotions` in sign-up.", + "Agency selected `opt-in beta tests and market research`.", + "Agency selected `opt-in beta tests` in profile portal.", + "Agency selected `opt-in news` in profile portal.", + "Agency selected `opt-in news invitations and promotions`.", + "Agency selected `opt-in performance SUG` in profile portal.", + "Agency selected `opt-in performance suggestions`.", + "Agency selected `opt-in select all email notifications`.", + "Agency selected `select all opt-ins` in profile portal.", + "Agency clicked back button on `connect with company`.", + "Agency clicked continue to overview on `connect with company`.", + "Agency clicked `create MCC connect with company not found`.", + "Agency clicked `give edit access connect with company not found`.", + "Agency clicked `log out connect with company not found`.", + "Agency clicked `skip for now on connect with company page`.", + "Agency closed connection to company.", + "Agency completed field connect with company.", + "Agency found company to connect with.", + "Agency successfully created company.", + "Agency added new company location.", + "Agency clicked community `join now link` in portal notifications.", + "Agency clicked `connect to company` link in portal notifications.", + "Agency cliecked `get certified` link in portal notifications.", + "Agency clicked `get VideoAds certified` link in portal notifications.", + "Agency clicked `link to MCC` link in portal notifications.", + "Agency clicked `insight content` in portal.", + "Agency clicked `insights view now pitch decks` in portal.", + "Agency clicked `insights` left nav in portal.", + "Agency clicked `insights upload content`.", + "Agency clicked `insights viewed deprecated`.", + "Agency clicked `community` left nav in portal.", + "Agency clicked `join community` button in community portal.", + "Agency clicked `certifications` left nav in portal.", + "Agency clicked `certifications product` left nav in portal.", + "Agency clicked `partner status` left nav in portal.", + "Agency clicked `partner status product` left nav in portal.", + "Agency clicked `offers` left nav in portal.", + "Agency clicked `send` button on offers page.", + "Agency clicked `exam details` on certifications AdWords page.", + "Agency clicked `see exams` certifications main page.", + "Agency clicked `take exam` on certifications exam page.", + "Agency opened `last admin` dialog.", + "Agency opened dialog with no users.", + "Agency promoted user to admin.", + "Agency unaffiliated.", + "Agency changed roles.", + "Advertiser clicked `company name` link to profile.", + "Advertiser viewed AdWords certificate.", + "Advertiser viewed AdWords Search certificate.", + "Advertiser viewed AdWords Display certificate.", + "Advertiser clicked AdWords certificate help icon.", + "Advertiser viewed Analytics certificate.", + "Advertiser viewed DoubleClick certificate.", + "Advertiser viewed Mobile Sites certificate.", + "Advertiser viewed VideoAds certificate.", + "Advertiser clicked Shopping certificate help icon.", + "Advertiser clicked VideoAds certificate help icon.", + "Advertiser viewed Digital Sales certificate.", + "Clicked `help` at bottom.", + "Clicked `help` at top.", + "Client error occurred.", + "Agency clicked left nav `stories`.", + "Click occured.", + "Advertiser clicked Mobile certificate help icon.", + "Agency failed the company verification.", + "User visited the landing portion of Google Partners.", + "User visited the Google Partner Search portion of Google Partners.", + "User visited the agency portal portion of Google Partners.", + "User cancelled signing up.", + "User cancelled signing up their company.", + "Agency clicked `Sign in` top button.", + "Agency clicked `save and continue` at bottom of incomplete profile.", + "Agency unselected `opt-in news invitations and promotions`.", + "Agency unselected `opt-in beta tests and market research`.", + "Agency unselected `opt-in performance suggestions`.", + "Agency selected `opt-out unselect all email notifications`.", + "Agency linked their individual MCC.", + "Agency was suggested to user for affiliation.", + "Agency ignored suggested agencies and begin searching.", + "Agency picked a suggested agency.", + "Agency searched for agencies.", + "Agency picked a searched agency.", + "Agency dismissed affiliation widget.", + "Agency clicked on the download link for downloading content.", + "Agency user is maklingg progress viewing a content item.", + "Agency clicked `cancel Terms Of Service` button.", + "Advertiser entered website in contact form." + ] + }, + "url": { + "description": "The URL where the event occurred.", "type": "string" + }, + "requestMetadata": { + "$ref": "RequestMetadata", + "description": "Current request metadata." + }, + "eventDatas": { + "description": "List of event data for the event.", + "items": { + "$ref": "EventData" + }, + "type": "array" + }, + "eventScope": { + "description": "The scope of the event.", + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Based on visitor.", + "Based on session.", + "Based on page visit." + ], + "enum": [ + "EVENT_SCOPE_UNSPECIFIED", + "VISITOR", + "SESSION", + "PAGE" + ] + }, + "eventCategory": { + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Google Partner Search category.", + "Google Partner sign-up flow category.", + "Google Partner portal category.", + "Google Partner portal my-profile category.", + "Google Partner portal certifications category.", + "Google Partner portal community category.", + "Google Partner portal insights category.", + "Google Partner portal clients category.", + "Google Partner portal public user profile category.", + "Google Partner panel category.", + "Google Partner portal last admin dialog category.", + "Google Partner client category.", + "Google Partner portal company profile category.", + "External links category.", + "Google Partner landing category." + ], + "enum": [ + "EVENT_CATEGORY_UNSPECIFIED", + "GOOGLE_PARTNER_SEARCH", + "GOOGLE_PARTNER_SIGNUP_FLOW", + "GOOGLE_PARTNER_PORTAL", + "GOOGLE_PARTNER_PORTAL_MY_PROFILE", + "GOOGLE_PARTNER_PORTAL_CERTIFICATIONS", + "GOOGLE_PARTNER_PORTAL_COMMUNITY", + "GOOGLE_PARTNER_PORTAL_INSIGHTS", + "GOOGLE_PARTNER_PORTAL_CLIENTS", + "GOOGLE_PARTNER_PUBLIC_USER_PROFILE", + "GOOGLE_PARTNER_PANEL", + "GOOGLE_PARTNER_PORTAL_LAST_ADMIN_DIALOG", + "GOOGLE_PARTNER_CLIENT", + "GOOGLE_PARTNER_PORTAL_COMPANY_PROFILE", + "EXTERNAL_LINKS", + "GOOGLE_PARTNER_LANDING" + ], + "description": "The category the action belongs to." } }, "id": "LogUserEventRequest" }, "AnalyticsDataPoint": { + "id": "AnalyticsDataPoint", "description": "Details of the analytics events for a `Company` within a single day.", "type": "object", "properties": { "eventCount": { - "description": "Number of times the type of event occurred.\nMeaning depends on context (e.g. profile views, contacts, etc.).", "format": "int32", + "description": "Number of times the type of event occurred.\nMeaning depends on context (e.g. profile views, contacts, etc.).", "type": "integer" }, "eventLocations": { "description": "Location information of where these events occurred.", - "type": "array", "items": { "$ref": "LatLng" - } + }, + "type": "array" } - }, - "id": "AnalyticsDataPoint" + } }, "Analytics": { "description": "Analytics data for a `Company` within a single day.", "type": "object", "properties": { - "eventDate": { - "description": "Date on which these events occurred.", - "$ref": "Date" + "searchViews": { + "$ref": "AnalyticsDataPoint", + "description": "Instances of users seeing the `Company` in Google Partners Search results\non the specified date." }, "profileViews": { "$ref": "AnalyticsDataPoint", "description": "Instances of users viewing the `Company` profile\non the specified date." }, - "searchViews": { - "$ref": "AnalyticsDataPoint", - "description": "Instances of users seeing the `Company` in Google Partners Search results\non the specified date." + "eventDate": { + "$ref": "Date", + "description": "Date on which these events occurred." }, "contacts": { "$ref": "AnalyticsDataPoint", @@ -2494,50 +3411,51 @@ }, "id": "Analytics" }, - "AdWordsManagerAccountInfo": { - "description": "Information about a particular AdWords Manager Account.\nRead more at https://support.google.com/adwords/answer/6139186", - "type": "object", - "properties": { - "id": { - "description": "The AdWords Manager Account id.", - "format": "int64", - "type": "string" - }, - "customerName": { - "description": "Name of the customer this account represents.", - "type": "string" - } - }, - "id": "AdWordsManagerAccountInfo" - }, "PublicProfile": { "description": "Basic information from a public profile.", "type": "object", "properties": { "profileImage": { - "description": "The URL to the main profile image of the public profile.", - "type": "string" - }, - "displayName": { - "description": "The display name of the public profile.", - "type": "string" + "type": "string", + "description": "The URL to the main profile image of the public profile." }, "displayImageUrl": { "description": "The URL to the main display image of the public profile. Being deprecated.", "type": "string" }, - "id": { - "description": "The ID which can be used to retrieve more details about the public profile.", - "type": "string" + "displayName": { + "type": "string", + "description": "The display name of the public profile." }, "url": { "description": "The URL of the public profile.", "type": "string" + }, + "id": { + "description": "The ID which can be used to retrieve more details about the public profile.", + "type": "string" } }, "id": "PublicProfile" }, + "AdWordsManagerAccountInfo": { + "description": "Information about a particular AdWords Manager Account.\nRead more at https://support.google.com/adwords/answer/6139186", + "type": "object", + "properties": { + "customerName": { + "description": "Name of the customer this account represents.", + "type": "string" + }, + "id": { + "type": "string", + "format": "int64", + "description": "The AdWords Manager Account id." + } + }, + "id": "AdWordsManagerAccountInfo" + }, "ResponseMetadata": { + "id": "ResponseMetadata", "description": "Common data that is in each API response.", "type": "object", "properties": { @@ -2545,23 +3463,22 @@ "description": "Debug information about this request.", "$ref": "DebugInfo" } - }, - "id": "ResponseMetadata" + } }, "RecaptchaChallenge": { + "id": "RecaptchaChallenge", "description": "\u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e challenge info.", "type": "object", "properties": { - "id": { - "description": "The ID of the reCaptcha challenge.", - "type": "string" - }, "response": { "description": "The response to the reCaptcha challenge.", "type": "string" + }, + "id": { + "type": "string", + "description": "The ID of the reCaptcha challenge." } - }, - "id": "RecaptchaChallenge" + } }, "AvailableOffer": { "description": "Available Offers to be distributed.", @@ -2569,14 +3486,12 @@ "properties": { "countryOfferInfos": { "description": "Offer info by country.", - "type": "array", "items": { "$ref": "CountryOfferInfo" - } + }, + "type": "array" }, "offerType": { - "description": "Type of offer.", - "type": "string", "enumDescriptions": [ "Unset.", "AdWords spend X get Y.", @@ -2588,32 +3503,34 @@ "OFFER_TYPE_SPEND_X_GET_Y", "OFFER_TYPE_VIDEO", "OFFER_TYPE_SPEND_MATCH" - ] + ], + "description": "Type of offer.", + "type": "string" }, "maxAccountAge": { - "description": "The maximum age of an account [in days] to be eligible.", "format": "int32", + "description": "The maximum age of an account [in days] to be eligible.", "type": "integer" }, "qualifiedCustomer": { "description": "Customers who qualify for this offer.", - "type": "array", "items": { "$ref": "OfferCustomer" - } + }, + "type": "array" }, "terms": { "description": "Terms of the offer.", "type": "string" }, "showSpecialOfferCopy": { - "description": "Should special text be shown on the offers page.", - "type": "boolean" + "type": "boolean", + "description": "Should special text be shown on the offers page." }, "available": { - "description": "The number of codes for this offer that are available for distribution.", + "type": "integer", "format": "int32", - "type": "integer" + "description": "The number of codes for this offer that are available for distribution." }, "description": { "description": "Description of the offer.", @@ -2652,953 +3569,50 @@ "type": "boolean" }, "id": { - "description": "ID of this offer.", "format": "int64", + "description": "ID of this offer.", "type": "string" } }, "id": "AvailableOffer" }, "LatLng": { - "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)\n\nThe code in logs/storage/validator/logs_validator_traits.cc treats this type\nas if it were annotated as ST_LOCATION.", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", "type": "object", "properties": { - "latitude": { - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "longitude": { "format": "double", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", "type": "number" }, - "longitude": { - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "latitude": { "format": "double", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", "type": "number" } }, "id": "LatLng" }, "Money": { + "id": "Money", "description": "Represents an amount of money with its currency type.", "type": "object", "properties": { + "units": { + "format": "int64", + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "type": "string" + }, "currencyCode": { "description": "The 3-letter currency code defined in ISO 4217.", "type": "string" }, "nanos": { + "format": "int32", "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", - "format": "int32", - "type": "integer" - }, - "units": { - "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", - "format": "int64", - "type": "string" - } - }, - "id": "Money" - }, - "AnalyticsSummary": { - "description": "Analytics aggregated data for a `Company` for a given date range.", - "type": "object", - "properties": { - "contactsCount": { - "description": "Aggregated number of times users contacted the `Company`\nfor given date range.", - "format": "int32", - "type": "integer" - }, - "profileViewsCount": { - "description": "Aggregated number of profile views for the `Company` for given date range.", - "format": "int32", - "type": "integer" - }, - "searchViewsCount": { - "description": "Aggregated number of times users saw the `Company`\nin Google Partners Search results for given date range.", - "format": "int32", "type": "integer" } - }, - "id": "AnalyticsSummary" - }, - "LogMessageRequest": { - "description": "Request message for\nLogClientMessage.", - "type": "object", - "properties": { - "clientInfo": { - "description": "Map of client info, such as URL, browser navigator, browser platform, etc.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "requestMetadata": { - "$ref": "RequestMetadata", - "description": "Current request metadata." - }, - "level": { - "enumDescriptions": [ - "Unchosen.", - "Message level for tracing information.", - "Message level for informational messages.", - "Message level for potential problems.", - "Message level for serious failures." - ], - "enum": [ - "MESSAGE_LEVEL_UNSPECIFIED", - "ML_FINE", - "ML_INFO", - "ML_WARNING", - "ML_SEVERE" - ], - "description": "Message level of client message.", - "type": "string" - }, - "details": { - "description": "Details about the client message.", - "type": "string" - } - }, - "id": "LogMessageRequest" - }, - "DebugInfo": { - "description": "Debug information about this request.", - "type": "object", - "properties": { - "serviceUrl": { - "description": "URL of the service that handled this request.", - "type": "string" - }, - "serverInfo": { - "description": "Info about the server that serviced this request.", - "type": "string" - }, - "serverTraceInfo": { - "description": "Server-side debug stack trace.", - "type": "string" - } - }, - "id": "DebugInfo" - }, - "Lead": { - "description": "A lead resource that represents an advertiser contact for a `Company`. These\nare usually generated via Google Partner Search (the advertiser portal).", - "type": "object", - "properties": { - "minMonthlyBudget": { - "$ref": "Money", - "description": "The minimum monthly budget lead source is willing to spend." - }, - "givenName": { - "description": "First name of lead source.", - "type": "string" - }, - "websiteUrl": { - "description": "Website URL of lead source.", - "type": "string" - }, - "languageCode": { - "description": "Language code of the lead's language preference, as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").", - "type": "string" - }, - "state": { - "enumDescriptions": [ - "Unchosen.", - "Lead not yet contacted.", - "Lead has been contacted.", - "Lead has become a client.", - "Lead in a state not covered by other options." - ], - "enum": [ - "LEAD_STATE_UNSPECIFIED", - "LEAD", - "CONTACTED", - "CLIENT", - "OTHER" - ], - "description": "The lead's state in relation to the company.", - "type": "string" - }, - "gpsMotivations": { - "enumDescriptions": [ - "Unchosen.", - "Advertiser needs help with their advertising.", - "Advertiser needs help with their website.", - "Advertiser does not have a website." - ], - "description": "List of reasons for using Google Partner Search and creating a lead.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "GPS_MOTIVATION_UNSPECIFIED", - "GPSM_HELP_WITH_ADVERTISING", - "GPSM_HELP_WITH_WEBSITE", - "GPSM_NO_WEBSITE" - ] - } - }, - "email": { - "description": "Email address of lead source.", - "type": "string" - }, - "familyName": { - "description": "Last name of lead source.", - "type": "string" - }, - "comments": { - "description": "Comments lead source gave.", - "type": "string" - }, - "id": { - "description": "ID of the lead.", - "type": "string" - }, - "phoneNumber": { - "description": "Phone number of lead source.", - "type": "string" - }, - "adwordsCustomerId": { - "description": "The AdWords Customer ID of the lead.", - "format": "int64", - "type": "string" - }, - "createTime": { - "description": "Timestamp of when this lead was created.", - "format": "google-datetime", - "type": "string" - }, - "marketingOptIn": { - "description": "Whether or not the lead signed up for marketing emails", - "type": "boolean" - }, - "type": { - "description": "Type of lead.", - "type": "string", - "enumDescriptions": [ - "Unchosen.", - "Google Partner Search." - ], - "enum": [ - "LEAD_TYPE_UNSPECIFIED", - "LT_GPS" - ] - } - }, - "id": "Lead" - }, - "ListUserStatesResponse": { - "description": "Response message for\nListUserStates.", - "type": "object", - "properties": { - "responseMetadata": { - "description": "Current response metadata.", - "$ref": "ResponseMetadata" - }, - "userStates": { - "enumDescriptions": [ - "Unchosen.", - "User must pass \u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e to\ncontact a Partner via Google Partner Search." - ], - "description": "User's states.", - "type": "array", - "items": { - "enum": [ - "USER_STATE_UNSPECIFIED", - "US_REQUIRES_RECAPTCHA_FOR_GPS_CONTACT" - ], - "type": "string" - } - } - }, - "id": "ListUserStatesResponse" - }, - "CompanyRelation": { - "description": "A CompanyRelation resource representing information about a user's\naffiliation and standing with a company in Partners.", - "type": "object", - "properties": { - "companyAdmin": { - "description": "Indicates if the user is an admin for this company.", - "type": "boolean" - }, - "address": { - "description": "The primary address for this company.", - "type": "string" - }, - "isPending": { - "description": "The flag that indicates if the company is pending verification.", - "type": "boolean" - }, - "creationTime": { - "description": "The timestamp of when affiliation was requested.\n@OutputOnly", - "format": "google-datetime", - "type": "string" - }, - "state": { - "enumDescriptions": [ - "Default unspecified value.", - "User has filled in a request to be associated with an company.\nNow waiting email confirmation.", - "Pending approval from company.\nEmail confirmation will not approve this one.", - "Approved by company." - ], - "enum": [ - "USER_COMPANY_REATION_STATE_NONE_SPECIFIED", - "USER_COMPANY_RELATION_STATE_AWAIT_EMAIL", - "USER_COMPANY_RELATION_STATE_AWAIT_ADMIN", - "USER_COMPANY_RELATION_STATE_APPROVED" - ], - "description": "The state of relationship, in terms of approvals.", - "type": "string" - }, - "name": { - "description": "The name (in the company's primary language) for the company.", - "type": "string" - }, - "managerAccount": { - "description": "The AdWords manager account # associated this company.", - "format": "int64", - "type": "string" - }, - "segment": { - "description": "The segment the company is classified as.", - "type": "array", - "items": { - "enum": [ - "COMPANY_SEGMENT_UNKNOWN", - "COMPANY_SEGMENT_NAL", - "COMPANY_SEGMENT_PSP", - "COMPANY_SEGMENT_PPSP" - ], - "type": "string" - }, - "enumDescriptions": [ - "Default segment indicates an unknown.", - "Segment representing a selected group of Partners", - "Segment representing Premier SMB Partners, an AdWords partnership program.", - "A segment of Premier SMB Partners that have relationship with Google." - ] - }, - "specializationStatus": { - "description": "The list of Google Partners specialization statuses for the company.", - "type": "array", - "items": { - "$ref": "SpecializationStatus" - } - }, - "badgeTier": { - "enumDescriptions": [ - "Tier badge is not set.", - "Agency has regular partner badge.", - "Agency has premier badge." - ], - "enum": [ - "BADGE_TIER_NONE", - "BADGE_TIER_REGULAR", - "BADGE_TIER_PREMIER" - ], - "description": "Whether the company is a Partner.", - "type": "string" - }, - "phoneNumber": { - "description": "The phone number for the company's primary address.", - "type": "string" - }, - "website": { - "description": "The website URL for this company.", - "type": "string" - }, - "companyId": { - "description": "The ID of the company. There may be no id if this is a\npending company.5", - "type": "string" - }, - "logoUrl": { - "description": "A URL to a profile photo, e.g. a G+ profile photo.", - "type": "string" - }, - "resolvedTimestamp": { - "description": "The timestamp when the user was approved.\n@OutputOnly", - "format": "google-datetime", - "type": "string" - } - }, - "id": "CompanyRelation" - }, - "Date": { - "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", - "type": "object", - "properties": { - "year": { - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", - "format": "int32", - "type": "integer" - }, - "day": { - "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", - "format": "int32", - "type": "integer" - }, - "month": { - "description": "Month of year. Must be from 1 to 12.", - "format": "int32", - "type": "integer" - } - }, - "id": "Date" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - }, - "TrafficSource": { - "description": "Source of traffic for the current request.", - "type": "object", - "properties": { - "trafficSourceId": { - "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - }, - "trafficSubId": { - "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", - "type": "string" - } - }, - "id": "TrafficSource" - }, - "RequestMetadata": { - "description": "Common data that is in each API request.", - "type": "object", - "properties": { - "locale": { - "description": "Locale to use for the current request.", - "type": "string" - }, - "userOverrides": { - "description": "Values to use instead of the user's respective defaults for the current\nrequest. These are only honored by whitelisted products.", - "$ref": "UserOverrides" - }, - "partnersSessionId": { - "description": "Google Partners session ID.", - "type": "string" - }, - "experimentIds": { - "description": "Experiment IDs the current request belongs to.", - "type": "array", - "items": { - "type": "string" - } - }, - "trafficSource": { - "description": "Source of traffic for the current request.", - "$ref": "TrafficSource" - } - }, - "id": "RequestMetadata" - }, - "CreateLeadRequest": { - "description": "Request message for CreateLead.", - "type": "object", - "properties": { - "requestMetadata": { - "description": "Current request metadata.", - "$ref": "RequestMetadata" - }, - "lead": { - "description": "The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED`\nand either `email` or `phone_number` must be provided.", - "$ref": "Lead" - }, - "recaptchaChallenge": { - "$ref": "RecaptchaChallenge", - "description": "\u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e challenge info." - } - }, - "id": "CreateLeadRequest" - }, - "EventData": { - "description": "Key value data pair for an event.", - "type": "object", - "properties": { - "key": { - "enumDescriptions": [ - "Unchosen.", - "Action data.", - "Agency ID data.", - "Agency name data.", - "Agency phone number data.", - "Agency website data.", - "Budget data.", - "Center-point data.", - "Certification data.", - "Comment data.", - "Country data.", - "Currency data.", - "Currently viewed agency ID data.", - "Distance data.", - "Distance type data.", - "Exam data.", - "History token data.", - "Identifier data.", - "Industry data.", - "Insight tag data.", - "Language data.", - "Location data.", - "Marketing opt-in data.", - "Query data.", - "Search start index data.", - "Service data.", - "Show vow data.", - "Solution data.", - "Traffic source ID data.", - "Traffic sub ID data.", - "Viewport data.", - "Website data.", - "Details data.", - "Experiment ID data.", - "Google Partner Search motivation data.", - "URL data.", - "Element we wanted user to focus on.", - "Progress when viewing an item \\[0-100\\]." - ], - "enum": [ - "EVENT_DATA_TYPE_UNSPECIFIED", - "ACTION", - "AGENCY_ID", - "AGENCY_NAME", - "AGENCY_PHONE_NUMBER", - "AGENCY_WEBSITE", - "BUDGET", - "CENTER_POINT", - "CERTIFICATION", - "COMMENT", - "COUNTRY", - "CURRENCY", - "CURRENTLY_VIEWED_AGENCY_ID", - "DISTANCE", - "DISTANCE_TYPE", - "EXAM", - "HISTORY_TOKEN", - "ID", - "INDUSTRY", - "INSIGHT_TAG", - "LANGUAGE", - "LOCATION", - "MARKETING_OPT_IN", - "QUERY", - "SEARCH_START_INDEX", - "SERVICE", - "SHOW_VOW", - "SOLUTION", - "TRAFFIC_SOURCE_ID", - "TRAFFIC_SUB_ID", - "VIEW_PORT", - "WEBSITE", - "DETAILS", - "EXPERIMENT_ID", - "GPS_MOTIVATION", - "URL", - "ELEMENT_FOCUS", - "PROGRESS" - ], - "description": "Data type.", - "type": "string" - }, - "values": { - "description": "Data values.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "EventData" - }, - "ExamStatus": { - "description": "A user's information on a specific exam.", - "type": "object", - "properties": { - "warning": { - "description": "Whether this exam is in the state of warning.", - "type": "boolean" - }, - "expiration": { - "description": "Date this exam is due to expire.", - "format": "google-datetime", - "type": "string" - }, - "lastPassed": { - "description": "The date the user last passed this exam.", - "format": "google-datetime", - "type": "string" - }, - "examType": { - "enumDescriptions": [ - "Unchosen.", - "Adwords Fundamentals exam.", - "AdWords advanced search exam.", - "AdWords advanced display exam.", - "VideoAds exam.", - "DoubleClick exam.", - "Analytics exam.", - "Shopping exam.", - "Mobile exam.", - "Digital Sales exam.", - "Mobile Sites exam." - ], - "enum": [ - "CERTIFICATION_EXAM_TYPE_UNSPECIFIED", - "CET_ADWORDS_FUNDAMENTALS", - "CET_ADWORDS_ADVANCED_SEARCH", - "CET_ADWORDS_ADVANCED_DISPLAY", - "CET_VIDEO_ADS", - "CET_DOUBLECLICK", - "CET_ANALYTICS", - "CET_SHOPPING", - "CET_MOBILE", - "CET_DIGITAL_SALES", - "CET_MOBILE_SITES" - ], - "description": "The type of the exam.", - "type": "string" - }, - "taken": { - "description": "The date the user last taken this exam.", - "format": "google-datetime", - "type": "string" - }, - "passed": { - "description": "Whether this exam has been passed and not expired.", - "type": "boolean" - } - }, - "id": "ExamStatus" - }, - "ListOffersResponse": { - "description": "Response for ListOffer.", - "type": "object", - "properties": { - "responseMetadata": { - "description": "Current response metadata.", - "$ref": "ResponseMetadata" - }, - "noOfferReason": { - "description": "Reason why no Offers are available.", - "type": "string", - "enumDescriptions": [ - "Unset.", - "Not an MCC.", - "Offer limit has been reached.", - "Ineligible for offers." - ], - "enum": [ - "NO_OFFER_REASON_UNSPECIFIED", - "NO_OFFER_REASON_NO_MCC", - "NO_OFFER_REASON_LIMIT_REACHED", - "NO_OFFER_REASON_INELIGIBLE" - ] - }, - "availableOffers": { - "description": "Available Offers to be distributed.", - "type": "array", - "items": { - "$ref": "AvailableOffer" - } - } - }, - "id": "ListOffersResponse" - }, - "CountryOfferInfo": { - "description": "Offer info by country.", - "type": "object", - "properties": { - "offerCountryCode": { - "description": "Country code for which offer codes may be requested.", - "type": "string" - }, - "spendXAmount": { - "description": "(localized) Spend X amount for that country's offer.", - "type": "string" - }, - "offerType": { - "enumDescriptions": [ - "Unset.", - "AdWords spend X get Y.", - "Youtube video.", - "Spend Match up to Y." - ], - "enum": [ - "OFFER_TYPE_UNSPECIFIED", - "OFFER_TYPE_SPEND_X_GET_Y", - "OFFER_TYPE_VIDEO", - "OFFER_TYPE_SPEND_MATCH" - ], - "description": "Type of offer country is eligible for.", - "type": "string" - }, - "getYAmount": { - "description": "(localized) Get Y amount for that country's offer.", - "type": "string" - } - }, - "id": "CountryOfferInfo" - }, - "ListCompaniesResponse": { - "description": "Response message for\nListCompanies.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "A token to retrieve next page of results.\nPass this value in the `ListCompaniesRequest.page_token` field in the\nsubsequent call to\nListCompanies to retrieve the\nnext page of results.", - "type": "string" - }, - "responseMetadata": { - "$ref": "ResponseMetadata", - "description": "Current response metadata." - }, - "companies": { - "description": "The list of companies.", - "type": "array", - "items": { - "$ref": "Company" - } - } - }, - "id": "ListCompaniesResponse" - }, - "OfferCustomer": { - "description": "Customers qualified for an offer.", - "type": "object", - "properties": { - "getYAmount": { - "description": "Formatted Get Y amount with currency code.", - "type": "string" - }, - "name": { - "description": "Name of the customer.", - "type": "string" - }, - "spendXAmount": { - "description": "Formatted Spend X amount with currency code.", - "type": "string" - }, - "adwordsUrl": { - "description": "URL to the customer's AdWords page.", - "type": "string" - }, - "countryCode": { - "description": "Country code of the customer.", - "type": "string" - }, - "creationTime": { - "description": "Time the customer was created.", - "format": "google-datetime", - "type": "string" - }, - "eligibilityDaysLeft": { - "description": "Days the customer is still eligible.", - "format": "int32", - "type": "integer" - }, - "offerType": { - "description": "Type of the offer", - "type": "string", - "enumDescriptions": [ - "Unset.", - "AdWords spend X get Y.", - "Youtube video.", - "Spend Match up to Y." - ], - "enum": [ - "OFFER_TYPE_UNSPECIFIED", - "OFFER_TYPE_SPEND_X_GET_Y", - "OFFER_TYPE_VIDEO", - "OFFER_TYPE_SPEND_MATCH" - ] - }, - "externalCid": { - "description": "External CID for the customer.", - "format": "int64", - "type": "string" - } - }, - "id": "OfferCustomer" - }, - "CertificationStatus": { - "description": "Google Partners certification status.", - "type": "object", - "properties": { - "isCertified": { - "description": "Whether certification is passing.", - "type": "boolean" - }, - "examStatuses": { - "description": "List of certification exam statuses.", - "type": "array", - "items": { - "$ref": "CertificationExamStatus" - } - }, - "type": { - "description": "The type of the certification.", - "type": "string", - "enumDescriptions": [ - "Unchosen.", - "AdWords certified.", - "YouTube certified.", - "VideoAds certified.", - "Analytics certified.", - "DoubleClick certified.", - "Shopping certified.", - "Mobile certified.", - "Digital sales certified.", - "AdWords Search certified.", - "AdWords Display certified.", - "Mobile Sites certified." - ], - "enum": [ - "CERTIFICATION_TYPE_UNSPECIFIED", - "CT_ADWORDS", - "CT_YOUTUBE", - "CT_VIDEOADS", - "CT_ANALYTICS", - "CT_DOUBLECLICK", - "CT_SHOPPING", - "CT_MOBILE", - "CT_DIGITAL_SALES", - "CT_ADWORDS_SEARCH", - "CT_ADWORDS_DISPLAY", - "CT_MOBILE_SITES" - ] - }, - "userCount": { - "description": "Number of people who are certified,", - "format": "int32", - "type": "integer" - } - }, - "id": "CertificationStatus" - }, - "LocalizedCompanyInfo": { - "description": "The localized company information.", - "type": "object", - "properties": { - "displayName": { - "description": "Localized display name.", - "type": "string" - }, - "languageCode": { - "description": "Language code of the localized company info, as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").", - "type": "string" - }, - "countryCodes": { - "description": "List of country codes for the localized company info.", - "type": "array", - "items": { - "type": "string" - } - }, - "overview": { - "description": "Localized brief description that the company uses to advertise themselves.", - "type": "string" - } - }, - "id": "LocalizedCompanyInfo" - }, - "LogUserEventResponse": { - "description": "Response message for\nLogUserEvent.", - "type": "object", - "properties": { - "responseMetadata": { - "description": "Current response metadata.", - "$ref": "ResponseMetadata" - } - }, - "id": "LogUserEventResponse" - }, - "ListOffersHistoryResponse": { - "description": "Response for ListOfferHistory.", - "type": "object", - "properties": { - "canShowEntireCompany": { - "description": "True if the user has the option to show entire company history.", - "type": "boolean" - }, - "totalResults": { - "description": "Number of results across all pages.", - "format": "int32", - "type": "integer" - }, - "showingEntireCompany": { - "description": "True if this response is showing entire company history.", - "type": "boolean" - }, - "offers": { - "description": "Historical offers meeting request.", - "type": "array", - "items": { - "$ref": "HistoricalOffer" - } - }, - "nextPageToken": { - "description": "Supply this token in a ListOffersHistoryRequest to retrieve the next page.", - "type": "string" - }, - "responseMetadata": { - "description": "Current response metadata.", - "$ref": "ResponseMetadata" - } - }, - "id": "ListOffersHistoryResponse" - }, - "LogMessageResponse": { - "description": "Response message for\nLogClientMessage.", - "type": "object", - "properties": { - "responseMetadata": { - "$ref": "ResponseMetadata", - "description": "Current response metadata." - } - }, - "id": "LogMessageResponse" - }, - "SpecializationStatus": { - "description": "Agency specialization status", - "type": "object", - "properties": { - "badgeSpecialization": { - "description": "The specialization this status is for.", - "type": "string", - "enumDescriptions": [ - "Unknown specialization", - "AdWords Search specialization", - "AdWords Display specialization", - "AdWords Mobile specialization", - "AdWords Video specialization", - "AdWords Shopping specialization" - ], - "enum": [ - "BADGE_SPECIALIZATION_UNKNOWN", - "BADGE_SPECIALIZATION_ADWORDS_SEARCH", - "BADGE_SPECIALIZATION_ADWORDS_DISPLAY", - "BADGE_SPECIALIZATION_ADWORDS_MOBILE", - "BADGE_SPECIALIZATION_ADWORDS_VIDEO", - "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" - ] - }, - "badgeSpecializationState": { - "description": "State of agency specialization.", - "type": "string", - "enumDescriptions": [ - "Unknown state", - "Specialization passed", - "Specialization not passed", - "Specialization in grace" - ], - "enum": [ - "BADGE_SPECIALIZATION_STATE_UNKNOWN", - "BADGE_SPECIALIZATION_STATE_PASSED", - "BADGE_SPECIALIZATION_STATE_NOT_PASSED", - "BADGE_SPECIALIZATION_STATE_IN_GRACE" - ] - } - }, - "id": "SpecializationStatus" + } } }, "icons": { @@ -3609,8 +3623,16 @@ "version": "v2", "baseUrl": "https://partners.googleapis.com/", "canonicalName": "Partners", - "kind": "discovery#restDescription", "servicePath": "", "description": "Searches certified companies and creates contact leads with them, and also audits the usage of clients.", - "rootUrl": "https://partners.googleapis.com/" + "kind": "discovery#restDescription", + "rootUrl": "https://partners.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "partners", + "batchPath": "batch", + "id": "partners:v2", + "revision": "20170912", + "documentationLink": "https://developers.google.com/partners/", + "title": "Google Partners API" } diff --git a/etc/api/people/v1/crates/1.0.6-api+20170925 b/etc/api/people/v1/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/people/v1/people-api.json b/etc/api/people/v1/people-api.json index f312d14202..ebc8c59429 100644 --- a/etc/api/people/v1/people-api.json +++ b/etc/api/people/v1/people-api.json @@ -1,141 +1,17 @@ { - "baseUrl": "https://people.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Provides access to information about profiles and contacts.", - "servicePath": "", - "basePath": "", - "id": "people:v1", + "revision": "20170925", "documentationLink": "https://developers.google.com/people/", - "revision": "20170518", + "id": "people:v1", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "RelationshipStatus": { - "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the relationship status." - }, - "value": { - "description": "The relationship status. The value can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `single`\n* `inARelationship`\n* `engaged`\n* `married`\n* `itsComplicated`\n* `openRelationship`\n* `widowed`\n* `inDomesticPartnership`\n* `inCivilUnion`", - "type": "string" - }, - "formattedValue": { - "description": "The read-only value of the relationship status translated and formatted in\nthe viewer's account locale or the `Accept-Language` HTTP header locale.", - "type": "string" - } - }, - "id": "RelationshipStatus", - "description": "A person's read-only relationship status.", - "type": "object" - }, - "Tagline": { - "description": "A read-only brief one-line description of the person.", - "type": "object", - "properties": { - "metadata": { - "description": "Metadata about the tagline.", - "$ref": "FieldMetadata" - }, - "value": { - "description": "The tagline.", - "type": "string" - } - }, - "id": "Tagline" - }, - "Date": { - "description": "Represents a whole calendar date, for example a date of birth. The time\nof day and time zone are either specified elsewhere or are not\nsignificant. The date is relative to the\n[Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar).\nThe day may be 0 to represent a year and month where the day is not\nsignificant. The year may be 0 to represent a month and day independent\nof year; for example, anniversary date.", - "type": "object", - "properties": { - "month": { - "description": "Month of year. Must be from 1 to 12.", - "format": "int32", - "type": "integer" - }, - "year": { - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", - "format": "int32", - "type": "integer" - }, - "day": { - "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", - "format": "int32", - "type": "integer" - } - }, - "id": "Date" - }, - "Name": { - "description": "A person's name. If the name is a mononym, the family name is empty.", - "type": "object", - "properties": { - "phoneticFullName": { - "description": "The full name spelled as it sounds.", - "type": "string" - }, - "displayNameLastFirst": { - "description": "The read-only display name with the last name first formatted according to\nthe locale specified by the viewer's account or the\n\u003ccode\u003eAccept-Language\u003c/code\u003e HTTP header.", - "type": "string" - }, - "displayName": { - "description": "The read-only display name formatted according to the locale specified by\nthe viewer's account or the \u003ccode\u003eAccept-Language\u003c/code\u003e HTTP header.", - "type": "string" - }, - "honorificSuffix": { - "description": "The honorific suffixes, such as `Jr.`", - "type": "string" - }, - "honorificPrefix": { - "description": "The honorific prefixes, such as `Mrs.` or `Dr.`", - "type": "string" - }, - "phoneticHonorificSuffix": { - "description": "The honorific suffixes spelled as they sound.", - "type": "string" - }, - "middleName": { - "description": "The middle name(s).", - "type": "string" - }, - "givenName": { - "description": "The given name.", - "type": "string" - }, - "phoneticHonorificPrefix": { - "description": "The honorific prefixes spelled as they sound.", - "type": "string" - }, - "phoneticGivenName": { - "description": "The given name spelled as it sounds.", - "type": "string" - }, - "phoneticFamilyName": { - "description": "The family name spelled as it sounds.", - "type": "string" - }, - "familyName": { - "description": "The family name.", - "type": "string" - }, - "phoneticMiddleName": { - "description": "The middle name(s) spelled as they sound.", - "type": "string" - }, - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the name." - } - }, - "id": "Name" - }, "BraggingRights": { "description": "A person's bragging rights.", "type": "object", "properties": { "metadata": { - "description": "Metadata about the bragging rights.", - "$ref": "FieldMetadata" + "$ref": "FieldMetadata", + "description": "Metadata about the bragging rights." }, "value": { "description": "The bragging rights; for example, `climbed mount everest`.", @@ -144,25 +20,28 @@ }, "id": "BraggingRights" }, - "Locale": { - "description": "A person's locale preference.", - "type": "object", - "properties": { - "metadata": { - "description": "Metadata about the locale.", - "$ref": "FieldMetadata" - }, - "value": { - "description": "The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47)\nlanguage tag representing the locale.", - "type": "string" - } - }, - "id": "Locale" - }, "Organization": { - "description": "A person's past or current organization. Overlapping date ranges are\npermitted.", - "type": "object", "properties": { + "current": { + "description": "True if the organization is the person's current organization;\nfalse if the organization is a past organization.", + "type": "boolean" + }, + "startDate": { + "$ref": "Date", + "description": "The start date when the person joined the organization." + }, + "formattedType": { + "description": "The read-only type of the organization translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", + "type": "string" + }, + "domain": { + "description": "The domain name associated with the organization; for example, `google.com`.", + "type": "string" + }, + "department": { + "description": "The person's department at the organization.", + "type": "string" + }, "phoneticName": { "description": "The phonetic name of the organization.", "type": "string" @@ -191,72 +70,21 @@ "description": "Metadata about the organization.", "$ref": "FieldMetadata" }, - "location": { - "description": "The location of the organization office the person works at.", - "type": "string" - }, "title": { "description": "The person's job title at the organization.", "type": "string" }, - "current": { - "description": "True if the organization is the person's current organization;\nfalse if the organization is a past organization.", - "type": "boolean" - }, - "formattedType": { - "description": "The read-only type of the organization translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", - "type": "string" - }, - "startDate": { - "$ref": "Date", - "description": "The start date when the person joined the organization." - }, - "domain": { - "description": "The domain name associated with the organization; for example, `google.com`.", - "type": "string" - }, - "department": { - "description": "The person's department at the organization.", + "location": { + "description": "The location of the organization office the person works at.", "type": "string" } }, - "id": "Organization" - }, - "Biography": { - "description": "A person's short biography.", - "type": "object", - "properties": { - "contentType": { - "description": "The content type of the biography.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "Plain text.", - "HTML text." - ], - "enum": [ - "CONTENT_TYPE_UNSPECIFIED", - "TEXT_PLAIN", - "TEXT_HTML" - ] - }, - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the biography." - }, - "value": { - "description": "The short biography.", - "type": "string" - } - }, - "id": "Biography" + "id": "Organization", + "description": "A person's past or current organization. Overlapping date ranges are\npermitted.", + "type": "object" }, "AgeRangeType": { "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the age range." - }, "ageRange": { "enum": [ "AGE_RANGE_UNSPECIFIED", @@ -272,89 +100,56 @@ "Between eighteen and twenty.", "Twenty-one and older." ] + }, + "metadata": { + "description": "Metadata about the age range.", + "$ref": "FieldMetadata" } }, "id": "AgeRangeType", "description": "A person's age range.", "type": "object" }, - "FieldMetadata": { - "description": "Metadata about a field.", + "ListContactGroupsResponse": { + "description": "The response to a list contact groups request.", "type": "object", "properties": { - "primary": { - "description": "True if the field is the primary field; false if the field is a secondary\nfield.", - "type": "boolean" + "contactGroups": { + "description": "The list of contact groups. Members of the contact groups are not\npopulated.", + "type": "array", + "items": { + "$ref": "ContactGroup" + } }, - "source": { - "$ref": "Source", - "description": "The source of the field." - }, - "verified": { - "description": "True if the field is verified; false if the field is unverified. A\nverified field is typically a name, email address, phone number, or\nwebsite that has been confirmed to be owned by the person.", - "type": "boolean" - } - }, - "id": "FieldMetadata" - }, - "Source": { - "description": "The source of a field.", - "type": "object", - "properties": { - "profileMetadata": { - "description": "Metadata about a source of type PROFILE.", - "$ref": "ProfileMetadata" - }, - "type": { - "enumDescriptions": [ - "Unspecified.", - "[Google Account](https://accounts.google.com).", - "[Google profile](https://profiles.google.com). You can view the\nprofile at https://profiles.google.com/\u003cid\u003e where \u003cid\u003e is the source\nid.", - "[Google Apps domain profile](https://admin.google.com).", - "[Google contact](https://contacts.google.com). You can view the\ncontact at https://contact.google.com/\u003cid\u003e where \u003cid\u003e is the source\nid." - ], - "enum": [ - "SOURCE_TYPE_UNSPECIFIED", - "ACCOUNT", - "PROFILE", - "DOMAIN_PROFILE", - "CONTACT" - ], - "description": "The source type.", + "nextPageToken": { + "description": "The token that can be used to retrieve the next page of results.", "type": "string" }, - "etag": { - "description": "The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the\nsource. Used for web cache validation. Only populated in\nperson.metadata.sources.", - "type": "string" + "totalItems": { + "description": "The total number of items in the list without pagination.", + "format": "int32", + "type": "integer" }, - "id": { - "description": "The unique identifier within the source type generated by the server.", + "nextSyncToken": { + "description": "The token that can be used to retrieve changes since the last request.", "type": "string" } }, - "id": "Source" - }, - "RelationshipInterest": { - "description": "A person's read-only relationship interest .", - "type": "object", - "properties": { - "value": { - "description": "The kind of relationship the person is looking for. The value can be custom\nor predefined. Possible values include, but are not limited to, the\nfollowing values:\n\n* `friend`\n* `date`\n* `relationship`\n* `networking`", - "type": "string" - }, - "formattedValue": { - "description": "The value of the relationship interest translated and formatted in the\nviewer's account locale or the locale specified in the Accept-Language\nHTTP header.", - "type": "string" - }, - "metadata": { - "description": "Metadata about the relationship interest.", - "$ref": "FieldMetadata" - } - }, - "id": "RelationshipInterest" + "id": "ListContactGroupsResponse" }, "PersonResponse": { + "description": "The response for a single person", + "type": "object", "properties": { + "httpStatusCode": { + "description": "**DEPRECATED** (Please use status instead)\n\n[HTTP 1.1 status code]\n(http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).", + "format": "int32", + "type": "integer" + }, + "requestedResourceName": { + "description": "The original requested resource name. May be different than the resource\nname on the returned person.\n\nThe resource name can change when adding or removing fields that link a\ncontact and profile such as a verified email, verified phone number, or a\nprofile URL.", + "type": "string" + }, "person": { "description": "The person.", "$ref": "Person" @@ -362,25 +157,20 @@ "status": { "description": "The status of the response.", "$ref": "Status" - }, - "httpStatusCode": { - "description": "DEPRECATED(Please use status instead).\n[HTTP 1.1 status\ncode](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).", - "format": "int32", - "type": "integer" - }, - "requestedResourceName": { - "description": "The original requested resource name. May be different than the resource\nname on the returned person.\n\nThe resource name can change when adding or removing fields that link a\ncontact and profile such as a verified email, verified phone number, or a\nprofile URL.", - "type": "string" } }, - "id": "PersonResponse", - "description": "The response for a single person", - "type": "object" + "id": "PersonResponse" }, "Relation": { - "description": "A person's relation to another person.", - "type": "object", "properties": { + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the relation." + }, + "type": { + "description": "The person's relation to the other person. The type can be custom or predefined.\nPossible values include, but are not limited to, the following values:\n\n* `spouse`\n* `child`\n* `mother`\n* `father`\n* `parent`\n* `brother`\n* `sister`\n* `friend`\n* `relative`\n* `domesticPartner`\n* `manager`\n* `assistant`\n* `referredBy`\n* `partner`", + "type": "string" + }, "person": { "description": "The name of the other person this relation refers to.", "type": "string" @@ -388,79 +178,84 @@ "formattedType": { "description": "The type of the relation translated and formatted in the viewer's account\nlocale or the locale specified in the Accept-Language HTTP header.", "type": "string" - }, - "metadata": { - "description": "Metadata about the relation.", - "$ref": "FieldMetadata" - }, - "type": { - "description": "The person's relation to the other person. The type can be custom or predefined.\nPossible values include, but are not limited to, the following values:\n\n* `spouse`\n* `child`\n* `mother`\n* `father`\n* `parent`\n* `brother`\n* `sister`\n* `friend`\n* `relative`\n* `domesticPartner`\n* `manager`\n* `assistant`\n* `referredBy`\n* `partner`", - "type": "string" } }, - "id": "Relation" + "id": "Relation", + "description": "A person's relation to another person.", + "type": "object" }, "Occupation": { "description": "A person's occupation.", "type": "object", "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the occupation." - }, "value": { "description": "The occupation; for example, `carpenter`.", "type": "string" + }, + "metadata": { + "description": "Metadata about the occupation.", + "$ref": "FieldMetadata" } }, "id": "Occupation" }, + "ContactGroup": { + "description": "A contact group.", + "type": "object", + "properties": { + "memberResourceNames": { + "description": "The list of contact person resource names that are members of the contact\ngroup. The field is not populated for LIST requests and can only be updated\nthrough the\n[ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/members/modify).", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "The contact group name set by the group owner or a system provided name\nfor system groups.", + "type": "string" + }, + "memberCount": { + "description": "The total number of contacts in the group irrespective of max members in\nspecified in the request.", + "format": "int32", + "type": "integer" + }, + "metadata": { + "$ref": "ContactGroupMetadata", + "description": "Metadata about the contact group." + }, + "resourceName": { + "description": "The resource name for the contact group, assigned by the server. An ASCII\nstring, in the form of `contactGroups/`\u003cvar\u003econtact_group_id\u003c/var\u003e.", + "type": "string" + }, + "etag": { + "description": "The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the\nresource. Used for web cache validation.", + "type": "string" + }, + "groupType": { + "enumDescriptions": [ + "Unspecified.", + "User defined contact group.", + "System defined contact group." + ], + "enum": [ + "GROUP_TYPE_UNSPECIFIED", + "USER_CONTACT_GROUP", + "SYSTEM_CONTACT_GROUP" + ], + "description": "The read-only contact group type.", + "type": "string" + }, + "formattedName": { + "description": "The read-only name translated and formatted in the viewer's account locale\nor the `Accept-Language` HTTP header locale for system groups names.\nGroup names set by the owner are the same as name.", + "type": "string" + } + }, + "id": "ContactGroup" + }, "Person": { "description": "Information about a person merged from various data sources such as the\nauthenticated user's contacts and profile data.\n\nMost fields can have multiple items. The items in a field have no guaranteed\norder, but each non-empty field is guaranteed to have exactly one field with\n`metadata.primary` set to true.", "type": "object", "properties": { - "addresses": { - "description": "The person's street addresses.", - "type": "array", - "items": { - "$ref": "Address" - } - }, - "events": { - "description": "The person's events.", - "type": "array", - "items": { - "$ref": "Event" - } - }, - "memberships": { - "description": "The person's group memberships.", - "type": "array", - "items": { - "$ref": "Membership" - } - }, - "phoneNumbers": { - "description": "The person's phone numbers.", - "type": "array", - "items": { - "$ref": "PhoneNumber" - } - }, - "coverPhotos": { - "description": "The person's cover photos.", - "type": "array", - "items": { - "$ref": "CoverPhoto" - } - }, - "imClients": { - "description": "The person's instant messaging clients.", - "type": "array", - "items": { - "$ref": "ImClient" - } - }, "birthdays": { "description": "The person's birthdays.", "type": "array", @@ -468,6 +263,13 @@ "$ref": "Birthday" } }, + "userDefined": { + "description": "The person's user defined data.", + "type": "array", + "items": { + "$ref": "UserDefined" + } + }, "locales": { "description": "The person's locale preferences.", "type": "array", @@ -476,7 +278,7 @@ } }, "relationshipInterests": { - "description": "The kind of relationship the person is looking for.", + "description": "The person's read-only relationship interests.", "type": "array", "items": { "$ref": "RelationshipInterest" @@ -543,7 +345,7 @@ } }, "metadata": { - "description": "Metadata about the person.", + "description": "Read-only metadata about the person.", "$ref": "PersonMetadata" }, "residences": { @@ -568,7 +370,7 @@ } }, "resourceName": { - "description": "The resource name for the person, assigned by the server. An ASCII string\nwith a max length of 27 characters, in the form of `people/\u003cperson_id\u003e`.", + "description": "The resource name for the person, assigned by the server. An ASCII string\nwith a max length of 27 characters, in the form of\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.", "type": "string" }, "biographies": { @@ -586,14 +388,14 @@ } }, "relationshipStatuses": { - "description": "The person's relationship statuses.", + "description": "The person's read-only relationship statuses.", "type": "array", "items": { "$ref": "RelationshipStatus" } }, "photos": { - "description": "The person's photos.", + "description": "The person's read-only photos.", "type": "array", "items": { "$ref": "Photo" @@ -612,28 +414,569 @@ "EIGHTEEN_TO_TWENTY", "TWENTY_ONE_OR_OLDER" ], - "description": "DEPRECATED(Please read person.age_ranges instead). The person's age range.", + "description": "**DEPRECATED** (Please use `person.ageRanges` instead)**\n\nThe person's read-only age range.", "type": "string" }, "taglines": { - "description": "The person's taglines.", + "description": "The person's read-only taglines.", "type": "array", "items": { "$ref": "Tagline" } }, "ageRanges": { - "description": "The person's age ranges.", + "description": "The person's read-only age ranges.", "type": "array", "items": { "$ref": "AgeRangeType" } + }, + "addresses": { + "description": "The person's street addresses.", + "type": "array", + "items": { + "$ref": "Address" + } + }, + "events": { + "description": "The person's events.", + "type": "array", + "items": { + "$ref": "Event" + } + }, + "memberships": { + "description": "The person's read-only group memberships.", + "type": "array", + "items": { + "$ref": "Membership" + } + }, + "phoneNumbers": { + "description": "The person's phone numbers.", + "type": "array", + "items": { + "$ref": "PhoneNumber" + } + }, + "coverPhotos": { + "description": "The person's read-only cover photos.", + "type": "array", + "items": { + "$ref": "CoverPhoto" + } + }, + "imClients": { + "description": "The person's instant messaging clients.", + "type": "array", + "items": { + "$ref": "ImClient" + } } }, "id": "Person" }, - "GetPeopleResponse": { + "UpdateContactGroupRequest": { + "properties": { + "contactGroup": { + "description": "The contact group to update.", + "$ref": "ContactGroup" + } + }, + "id": "UpdateContactGroupRequest", + "description": "A request to update an existing contact group. Only the name can be updated.", + "type": "object" + }, + "ContactGroupMetadata": { + "properties": { + "updateTime": { + "description": "The time the group was last updated.", + "format": "google-datetime", + "type": "string" + }, + "deleted": { + "description": "True if the contact group resource has been deleted. Populated only for\n[`ListContactGroups`](/people/api/rest/v1/contactgroups/list) requests\nthat include a sync token.", + "type": "boolean" + } + }, + "id": "ContactGroupMetadata", + "description": "The read-only metadata about a contact group.", + "type": "object" + }, + "Residence": { + "description": "A person's past or current residence.", "type": "object", + "properties": { + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the residence." + }, + "current": { + "description": "True if the residence is the person's current residence;\nfalse if the residence is a past residence.", + "type": "boolean" + }, + "value": { + "description": "The address of the residence.", + "type": "string" + } + }, + "id": "Residence" + }, + "Event": { + "description": "An event related to the person.", + "type": "object", + "properties": { + "metadata": { + "description": "Metadata about the event.", + "$ref": "FieldMetadata" + }, + "type": { + "description": "The type of the event. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `anniversary`\n* `other`", + "type": "string" + }, + "date": { + "$ref": "Date", + "description": "The date of the event." + }, + "formattedType": { + "description": "The read-only type of the event translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", + "type": "string" + } + }, + "id": "Event" + }, + "ModifyContactGroupMembersResponse": { + "description": "The response to a modify contact group members request.", + "type": "object", + "properties": { + "notFoundResourceNames": { + "description": "The contact people resource names that were not found.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ModifyContactGroupMembersResponse" + }, + "ProfileMetadata": { + "description": "The read-only metadata about a profile.", + "type": "object", + "properties": { + "objectType": { + "enum": [ + "OBJECT_TYPE_UNSPECIFIED", + "PERSON", + "PAGE" + ], + "description": "The profile object type.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Person.", + "[Google+ Page.](http://www.google.com/+/brands/)" + ] + }, + "userTypes": { + "enumDescriptions": [ + "The user type is not known.", + "The user is a Google user.", + "The user is a Google+ user.", + "The user is a Google Apps for Work user." + ], + "description": "The user types.", + "type": "array", + "items": { + "enum": [ + "USER_TYPE_UNKNOWN", + "GOOGLE_USER", + "GPLUS_USER", + "GOOGLE_APPS_USER" + ], + "type": "string" + } + } + }, + "id": "ProfileMetadata" + }, + "Gender": { + "description": "A person's gender.", + "type": "object", + "properties": { + "value": { + "description": "The gender for the person. The gender can be custom or predefined.\nPossible values include, but are not limited to, the\nfollowing:\n\n* `male`\n* `female`\n* `other`\n* `unknown`", + "type": "string" + }, + "formattedValue": { + "description": "The read-only value of the gender translated and formatted in the viewer's\naccount locale or the `Accept-Language` HTTP header locale.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the gender." + } + }, + "id": "Gender" + }, + "CoverPhoto": { + "description": "A person's read-only cover photo. A large image shown on the person's\nprofile page that represents who they are or what they care about.", + "type": "object", + "properties": { + "url": { + "description": "The URL of the cover photo.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the cover photo." + }, + "default": { + "description": "True if the cover photo is the default cover photo;\nfalse if the cover photo is a user-provided cover photo.", + "type": "boolean" + } + }, + "id": "CoverPhoto" + }, + "Interest": { + "description": "One of the person's interests.", + "type": "object", + "properties": { + "value": { + "description": "The interest; for example, `stargazing`.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the interest." + } + }, + "id": "Interest" + }, + "EmailAddress": { + "description": "A person's email address.", + "type": "object", + "properties": { + "value": { + "description": "The email address.", + "type": "string" + }, + "formattedType": { + "description": "The read-only type of the email address translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", + "type": "string" + }, + "displayName": { + "description": "The display name of the email.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the email address." + }, + "type": { + "description": "The type of the email address. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `other`", + "type": "string" + } + }, + "id": "EmailAddress" + }, + "Nickname": { + "description": "A person's nickname.", + "type": "object", + "properties": { + "value": { + "description": "The nickname.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the nickname." + }, + "type": { + "enum": [ + "DEFAULT", + "MAIDEN_NAME", + "INITIALS", + "GPLUS", + "OTHER_NAME" + ], + "description": "The type of the nickname.", + "type": "string", + "enumDescriptions": [ + "Generic nickname.", + "Maiden name or birth family name. Used when the person's family name has\nchanged as a result of marriage.", + "Initials.", + "Google+ profile nickname.", + "A professional affiliation or other name; for example, `Dr. Smith.`" + ] + } + }, + "id": "Nickname" + }, + "Skill": { + "properties": { + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the skill." + }, + "value": { + "description": "The skill; for example, `underwater basket weaving`.", + "type": "string" + } + }, + "id": "Skill", + "description": "A skill that the person has.", + "type": "object" + }, + "Tagline": { + "description": "A read-only brief one-line description of the person.", + "type": "object", + "properties": { + "metadata": { + "description": "Metadata about the tagline.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The tagline.", + "type": "string" + } + }, + "id": "Tagline" + }, + "Date": { + "properties": { + "month": { + "description": "Month of year. Must be from 1 to 12.", + "format": "int32", + "type": "integer" + }, + "year": { + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "format": "int32", + "type": "integer" + }, + "day": { + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", + "format": "int32", + "type": "integer" + } + }, + "id": "Date", + "description": "Represents a whole calendar date, for example a date of birth. The time\nof day and time zone are either specified elsewhere or are not\nsignificant. The date is relative to the\n[Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar).\nThe day may be 0 to represent a year and month where the day is not\nsignificant. The year may be 0 to represent a month and day independent\nof year; for example, anniversary date.", + "type": "object" + }, + "Name": { + "properties": { + "phoneticFamilyName": { + "description": "The family name spelled as it sounds.", + "type": "string" + }, + "familyName": { + "description": "The family name.", + "type": "string" + }, + "phoneticMiddleName": { + "description": "The middle name(s) spelled as they sound.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the name." + }, + "phoneticFullName": { + "description": "The full name spelled as it sounds.", + "type": "string" + }, + "displayNameLastFirst": { + "description": "The read-only display name with the last name first formatted according to\nthe locale specified by the viewer's account or the\n`Accept-Language` HTTP header.", + "type": "string" + }, + "displayName": { + "description": "The read-only display name formatted according to the locale specified by\nthe viewer's account or the `Accept-Language` HTTP header.", + "type": "string" + }, + "honorificSuffix": { + "description": "The honorific suffixes, such as `Jr.`", + "type": "string" + }, + "honorificPrefix": { + "description": "The honorific prefixes, such as `Mrs.` or `Dr.`", + "type": "string" + }, + "phoneticHonorificSuffix": { + "description": "The honorific suffixes spelled as they sound.", + "type": "string" + }, + "middleName": { + "description": "The middle name(s).", + "type": "string" + }, + "givenName": { + "description": "The given name.", + "type": "string" + }, + "phoneticHonorificPrefix": { + "description": "The honorific prefixes spelled as they sound.", + "type": "string" + }, + "phoneticGivenName": { + "description": "The given name spelled as it sounds.", + "type": "string" + } + }, + "id": "Name", + "description": "A person's name. If the name is a mononym, the family name is empty.", + "type": "object" + }, + "Locale": { + "properties": { + "metadata": { + "description": "Metadata about the locale.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47)\nlanguage tag representing the locale.", + "type": "string" + } + }, + "id": "Locale", + "description": "A person's locale preference.", + "type": "object" + }, + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object" + }, + "UserDefined": { + "properties": { + "value": { + "description": "The end user specified value of the user defined data.", + "type": "string" + }, + "key": { + "description": "The end user specified key of the user defined data.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the user defined data.", + "$ref": "FieldMetadata" + } + }, + "id": "UserDefined", + "description": "Arbitrary user data that is populated by the end users.", + "type": "object" + }, + "Biography": { + "description": "A person's short biography.", + "type": "object", + "properties": { + "value": { + "description": "The short biography.", + "type": "string" + }, + "contentType": { + "enumDescriptions": [ + "Unspecified.", + "Plain text.", + "HTML text." + ], + "enum": [ + "CONTENT_TYPE_UNSPECIFIED", + "TEXT_PLAIN", + "TEXT_HTML" + ], + "description": "The content type of the biography.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the biography." + } + }, + "id": "Biography" + }, + "FieldMetadata": { + "description": "Metadata about a field.", + "type": "object", + "properties": { + "verified": { + "description": "True if the field is verified; false if the field is unverified. A\nverified field is typically a name, email address, phone number, or\nwebsite that has been confirmed to be owned by the person.", + "type": "boolean" + }, + "primary": { + "description": "True if the field is the primary field; false if the field is a secondary\nfield.", + "type": "boolean" + }, + "source": { + "$ref": "Source", + "description": "The source of the field." + } + }, + "id": "FieldMetadata" + }, + "Source": { + "properties": { + "etag": { + "description": "**Only populated in `person.metadata.sources`.**\n\nThe [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the\nsource. Used for web cache validation.", + "type": "string" + }, + "id": { + "description": "The unique identifier within the source type generated by the server.", + "type": "string" + }, + "profileMetadata": { + "$ref": "ProfileMetadata", + "description": "**Only populated in `person.metadata.sources`.**\n\nMetadata about a source of type PROFILE." + }, + "updateTime": { + "description": "**Only populated in `person.metadata.sources`.**\n\nLast update timestamp of this source.", + "format": "google-datetime", + "type": "string" + }, + "type": { + "enumDescriptions": [ + "Unspecified.", + "[Google Account](https://accounts.google.com).", + "[Google profile](https://profiles.google.com). You can view the\nprofile at https://profiles.google.com/\u003cvar\u003eid\u003c/var\u003e where\n\u003cvar\u003eid\u003c/var\u003e is the source id.", + "[Google Apps domain profile](https://admin.google.com).", + "[Google contact](https://contacts.google.com). You can view the\ncontact at https://contact.google.com/\u003cvar\u003eid\u003c/var\u003e where \u003cvar\u003eid\u003c/var\u003e\nis the source id." + ], + "enum": [ + "SOURCE_TYPE_UNSPECIFIED", + "ACCOUNT", + "PROFILE", + "DOMAIN_PROFILE", + "CONTACT" + ], + "description": "The source type.", + "type": "string" + } + }, + "id": "Source", + "description": "The source of a field.", + "type": "object" + }, + "RelationshipInterest": { + "properties": { + "formattedValue": { + "description": "The value of the relationship interest translated and formatted in the\nviewer's account locale or the locale specified in the Accept-Language\nHTTP header.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the relationship interest.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The kind of relationship the person is looking for. The value can be custom\nor predefined. Possible values include, but are not limited to, the\nfollowing values:\n\n* `friend`\n* `date`\n* `relationship`\n* `networking`", + "type": "string" + } + }, + "id": "RelationshipInterest", + "description": "A person's read-only relationship interest .", + "type": "object" + }, + "GetPeopleResponse": { "properties": { "responses": { "description": "The response for each requested resource name.", @@ -643,52 +986,56 @@ } } }, - "id": "GetPeopleResponse" - }, - "Photo": { - "description": "A person's read-only photo. A picture shown next to the person's name to\nhelp others recognize the person.", - "type": "object", - "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the photo." - }, - "url": { - "description": "The URL of the photo.", - "type": "string" - } - }, - "id": "Photo" + "id": "GetPeopleResponse", + "type": "object" }, "PhoneNumber": { "description": "A person's phone number.", "type": "object", "properties": { - "metadata": { - "description": "Metadata about the phone number.", - "$ref": "FieldMetadata" - }, - "type": { - "description": "The type of the phone number. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `mobile`\n* `homeFax`\n* `workFax`\n* `otherFax`\n* `pager`\n* `workMobile`\n* `workPager`\n* `main`\n* `googleVoice`\n* `other`", - "type": "string" - }, "value": { "description": "The phone number.", "type": "string" }, "formattedType": { - "description": "The read-only type of the phone number translated and formatted in the\nviewer's account locale or the the `Accept-Language` HTTP header locale.", + "description": "The read-only type of the phone number translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", "type": "string" }, "canonicalForm": { "description": "The read-only canonicalized [ITU-T E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf)\nform of the phone number.", "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the phone number." + }, + "type": { + "description": "The type of the phone number. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `mobile`\n* `homeFax`\n* `workFax`\n* `otherFax`\n* `pager`\n* `workMobile`\n* `workPager`\n* `main`\n* `googleVoice`\n* `other`", + "type": "string" } }, "id": "PhoneNumber" }, + "Photo": { + "properties": { + "url": { + "description": "The URL of the photo. You can change the desired size by appending a query\nparameter `sz=`\u003cvar\u003esize\u003c/var\u003e at the end of the url. Example:\n`https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50`", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the photo." + }, + "default": { + "description": "True if the photo is a default photo;\nfalse if the photo is a user-provided photo.", + "type": "boolean" + } + }, + "id": "Photo", + "description": "A person's read-only photo. A picture shown next to the person's name to\nhelp others recognize the person.", + "type": "object" + }, "ListConnectionsResponse": { - "type": "object", "properties": { "nextPageToken": { "description": "The token that can be used to retrieve the next page of results.", @@ -711,17 +1058,20 @@ "type": "integer" }, "totalPeople": { - "description": "DEPRECATED(Please use total_items). The total number of people in the list\nwithout pagination.", + "description": "**DEPRECATED** (Please use totalItems)\nThe total number of people in the list without pagination.", "format": "int32", "type": "integer" } }, - "id": "ListConnectionsResponse" + "id": "ListConnectionsResponse", + "type": "object" }, "Birthday": { - "description": "A person's birthday. At least one of the `date` and `text` fields are\nspecified. The `date` and `text` fields typically represent the same\ndate, but are not guaranteed to.", - "type": "object", "properties": { + "date": { + "description": "The date of the birthday.", + "$ref": "Date" + }, "metadata": { "$ref": "FieldMetadata", "description": "Metadata about the birthday." @@ -729,32 +1079,22 @@ "text": { "description": "A free-form string representing the user's birthday.", "type": "string" - }, - "date": { - "description": "The date of the birthday.", - "$ref": "Date" } }, - "id": "Birthday" + "id": "Birthday", + "description": "A person's birthday. At least one of the `date` and `text` fields are\nspecified. The `date` and `text` fields typically represent the same\ndate, but are not guaranteed to.", + "type": "object" }, - "Residence": { - "description": "A person's past or current residence.", + "CreateContactGroupRequest": { + "description": "A request to create a new contact group.", "type": "object", "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the residence." - }, - "current": { - "description": "True if the residence is the person's current residence;\nfalse if the residence is a past residence.", - "type": "boolean" - }, - "value": { - "description": "The address of the residence.", - "type": "string" + "contactGroup": { + "description": "The contact group to create.", + "$ref": "ContactGroup" } }, - "id": "Residence" + "id": "CreateContactGroupRequest" }, "Address": { "description": "A person's physical address. May be a P.O. box or street address. All fields\nare optional.", @@ -777,8 +1117,8 @@ "type": "string" }, "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the address." + "description": "Metadata about the address.", + "$ref": "FieldMetadata" }, "countryCode": { "description": "The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) country\ncode of the address.", @@ -823,20 +1163,9 @@ "id": "ContactGroupMembership" }, "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object", "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - }, "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "type": "array", "items": { "additionalProperties": { @@ -845,35 +1174,44 @@ }, "type": "object" } + }, + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" } }, - "id": "Status" - }, - "Event": { - "description": "An event related to the person.", - "type": "object", - "properties": { - "formattedType": { - "description": "The read-only type of the event translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", - "type": "string" - }, - "metadata": { - "description": "Metadata about the event.", - "$ref": "FieldMetadata" - }, - "type": { - "description": "The type of the event. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `anniversary`\n* `other`", - "type": "string" - }, - "date": { - "$ref": "Date", - "description": "The date of the event." - } - }, - "id": "Event" + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object" }, "PersonMetadata": { "properties": { + "objectType": { + "enumDescriptions": [ + "Unspecified.", + "Person.", + "[Google+ Page.](http://www.google.com/+/brands/)" + ], + "enum": [ + "OBJECT_TYPE_UNSPECIFIED", + "PERSON", + "PAGE" + ], + "description": "**DEPRECATED** (Please use\n`person.metadata.sources.profileMetadata.objectType` instead)\n\nThe type of the person object.", + "type": "string" + }, + "linkedPeopleResourceNames": { + "description": "Resource names of people linked to this resource.", + "type": "array", + "items": { + "type": "string" + } + }, "sources": { "description": "The sources of data for the person.", "type": "array", @@ -891,72 +1229,51 @@ "deleted": { "description": "True if the person resource has been deleted. Populated only for\n[`connections.list`](/people/api/rest/v1/people.connections/list) requests\nthat include a sync token.", "type": "boolean" - }, - "objectType": { - "description": "DEPRECATED(Please read person.metadata.sources.profile_metadata instead).\nThe type of the person object.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "Person.", - "[Google+ Page.](http://www.google.com/+/brands/)" - ], - "enum": [ - "OBJECT_TYPE_UNSPECIFIED", - "PERSON", - "PAGE" - ] - }, - "linkedPeopleResourceNames": { - "description": "Resource names of people linked to this resource.", - "type": "array", - "items": { - "type": "string" - } } }, "id": "PersonMetadata", "description": "The read-only metadata about a person.", "type": "object" }, - "ProfileMetadata": { + "ModifyContactGroupMembersRequest": { "properties": { - "objectType": { - "description": "The profile object type.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "Person.", - "[Google+ Page.](http://www.google.com/+/brands/)" - ], - "enum": [ - "OBJECT_TYPE_UNSPECIFIED", - "PERSON", - "PAGE" - ] + "resourceNamesToRemove": { + "description": "The resource names of the contact people to remove in the form of in the\nform of `people/`\u003cvar\u003eperson_id\u003c/var\u003e.", + "type": "array", + "items": { + "type": "string" + } + }, + "resourceNamesToAdd": { + "description": "The resource names of the contact people to add in the form of in the form\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.", + "type": "array", + "items": { + "type": "string" + } } }, - "id": "ProfileMetadata", - "description": "The read-only metadata about a profile.", + "id": "ModifyContactGroupMembersRequest", + "description": "A request to modify an existing contact group's members.", "type": "object" }, - "Gender": { - "description": "A person's gender.", - "type": "object", + "ContactGroupResponse": { "properties": { - "formattedValue": { - "description": "The read-only value of the gender translated and formatted in the viewer's\naccount locale or the `Accept-Language` HTTP header locale.", + "requestedResourceName": { + "description": "The original requested resource name.", "type": "string" }, - "metadata": { - "description": "Metadata about the gender.", - "$ref": "FieldMetadata" + "contactGroup": { + "description": "The contact group.", + "$ref": "ContactGroup" }, - "value": { - "description": "The gender for the person. The gender can be custom or predefined.\nPossible values include, but are not limited to, the\nfollowing:\n\n* `male`\n* `female`\n* `other`\n* `unknown`", - "type": "string" + "status": { + "$ref": "Status", + "description": "The status of the response." } }, - "id": "Gender" + "id": "ContactGroupResponse", + "description": "The response for a specific contact group.", + "type": "object" }, "Url": { "properties": { @@ -981,35 +1298,16 @@ "description": "A person's associated URLs.", "type": "object" }, - "CoverPhoto": { - "description": "A person's read-only cover photo. A large image shown on the person's\nprofile page that represents who they are or what they care about.", - "type": "object", - "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the cover photo." - }, - "default": { - "description": "True if the cover photo is the default cover photo;\nfalse if the cover photo is a user-provided cover photo.", - "type": "boolean" - }, - "url": { - "description": "The URL of the cover photo.", - "type": "string" - } - }, - "id": "CoverPhoto" - }, "ImClient": { "description": "A person's instant messaging client.", "type": "object", "properties": { - "formattedType": { - "description": "The read-only type of the IM client translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", + "formattedProtocol": { + "description": "The read-only protocol of the IM client formatted in the viewer's account\nlocale or the `Accept-Language` HTTP header locale.", "type": "string" }, - "protocol": { - "description": "The protocol of the IM client. The protocol can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `aim`\n* `msn`\n* `yahoo`\n* `skype`\n* `qq`\n* `googleTalk`\n* `icq`\n* `jabber`\n* `netMeeting`", + "formattedType": { + "description": "The read-only type of the IM client translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", "type": "string" }, "metadata": { @@ -1020,143 +1318,86 @@ "description": "The type of the IM client. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `other`", "type": "string" }, - "username": { - "description": "The user name used in the IM client.", + "protocol": { + "description": "The protocol of the IM client. The protocol can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `aim`\n* `msn`\n* `yahoo`\n* `skype`\n* `qq`\n* `googleTalk`\n* `icq`\n* `jabber`\n* `netMeeting`", "type": "string" }, - "formattedProtocol": { - "description": "The read-only protocol of the IM client formatted in the viewer's account\nlocale or the `Accept-Language` HTTP header locale.", + "username": { + "description": "The user name used in the IM client.", "type": "string" } }, "id": "ImClient" }, - "Interest": { - "description": "One of the person's interests.", - "type": "object", - "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the interest." - }, - "value": { - "description": "The interest; for example, `stargazing`.", - "type": "string" - } - }, - "id": "Interest" - }, - "Nickname": { - "properties": { - "metadata": { - "description": "Metadata about the nickname.", - "$ref": "FieldMetadata" - }, - "type": { - "enumDescriptions": [ - "Generic nickname.", - "Maiden name or birth family name. Used when the person's family name has\nchanged as a result of marriage.", - "Initials.", - "Google+ profile nickname.", - "A professional affiliation or other name; for example, `Dr. Smith.`" - ], - "enum": [ - "DEFAULT", - "MAIDEN_NAME", - "INITIALS", - "GPLUS", - "OTHER_NAME" - ], - "description": "The type of the nickname.", - "type": "string" - }, - "value": { - "description": "The nickname.", - "type": "string" - } - }, - "id": "Nickname", - "description": "A person's nickname.", - "type": "object" - }, - "EmailAddress": { - "description": "A person's email address.", - "type": "object", - "properties": { - "displayName": { - "description": "The display name of the email.", - "type": "string" - }, - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the email address." - }, - "type": { - "description": "The type of the email address. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `other`", - "type": "string" - }, - "value": { - "description": "The email address.", - "type": "string" - }, - "formattedType": { - "description": "The read-only type of the email address translated and formatted in the\nviewer's account locale or the `Accept-Language` HTTP header locale.", - "type": "string" - } - }, - "id": "EmailAddress" - }, - "Skill": { - "description": "A skill that the person has.", - "type": "object", - "properties": { - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the skill." - }, - "value": { - "description": "The skill; for example, `underwater basket weaving`.", - "type": "string" - } - }, - "id": "Skill" - }, "DomainMembership": { - "description": "A Google Apps Domain membership.", - "type": "object", "properties": { "inViewerDomain": { "description": "True if the person is in the viewer's Google Apps domain.", "type": "boolean" } }, - "id": "DomainMembership" + "id": "DomainMembership", + "description": "A Google Apps Domain membership.", + "type": "object" + }, + "BatchGetContactGroupsResponse": { + "properties": { + "responses": { + "description": "The list of responses for each requested contact group resource.", + "type": "array", + "items": { + "$ref": "ContactGroupResponse" + } + } + }, + "id": "BatchGetContactGroupsResponse", + "description": "The response to a batch get contact groups request.", + "type": "object" }, "Membership": { "description": "A person's read-only membership in a group.", "type": "object", "properties": { + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the membership." + }, "contactGroupMembership": { "$ref": "ContactGroupMembership", "description": "The contact group membership." }, "domainMembership": { - "description": "The domain membership.", - "$ref": "DomainMembership" - }, - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the membership." + "$ref": "DomainMembership", + "description": "The domain membership." } }, "id": "Membership" + }, + "RelationshipStatus": { + "description": "A person's read-only relationship status.", + "type": "object", + "properties": { + "formattedValue": { + "description": "The read-only value of the relationship status translated and formatted in\nthe viewer's account locale or the `Accept-Language` HTTP header locale.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the relationship status.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The relationship status. The value can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `single`\n* `inARelationship`\n* `engaged`\n* `married`\n* `itsComplicated`\n* `openRelationship`\n* `widowed`\n* `inDomesticPartnership`\n* `inCivilUnion`", + "type": "string" + } + }, + "id": "RelationshipStatus" } }, - "protocol": "rest", "icons": { "x32": "http://www.google.com/images/icons/product/search-32.gif", "x16": "http://www.google.com/images/icons/product/search-16.gif" }, + "protocol": "rest", "canonicalName": "People Service", "auth": { "oauth2": { @@ -1176,12 +1417,12 @@ "https://www.googleapis.com/auth/user.addresses.read": { "description": "View your street addresses" }, - "https://www.googleapis.com/auth/userinfo.email": { - "description": "View your email address" - }, "https://www.googleapis.com/auth/user.phonenumbers.read": { "description": "View your phone numbers" }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, "https://www.googleapis.com/auth/user.birthday.read": { "description": "View your complete date of birth" }, @@ -1202,65 +1443,28 @@ "methods": { "getBatchGet": { "httpMethod": "GET", + "parameterOrder": [], "response": { "$ref": "GetPeopleResponse" }, - "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/contacts", - "https://www.googleapis.com/auth/contacts.readonly", - "https://www.googleapis.com/auth/plus.login", - "https://www.googleapis.com/auth/user.addresses.read", - "https://www.googleapis.com/auth/user.birthday.read", - "https://www.googleapis.com/auth/user.emails.read", - "https://www.googleapis.com/auth/user.phonenumbers.read", - "https://www.googleapis.com/auth/userinfo.email", - "https://www.googleapis.com/auth/userinfo.profile" - ], "parameters": { + "personFields": { + "location": "query", + "description": "**Required.** A field mask to restrict which fields on each person are\nreturned. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* braggingRights\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* relationshipInterests\n* relationshipStatuses\n* residences\n* skills\n* taglines\n* urls", + "format": "google-fieldmask", + "type": "string" + }, "requestMask.includeField": { - "description": "Comma-separated list of fields to be included in the response. Omitting\nthis field will include all fields except for connections.list requests,\nwhich have a default mask that includes common fields like metadata, name,\nphoto, and profile url.\nEach path should start with `person.`: for example, `person.names` or\n`person.photos`.", + "description": "**Required.** Comma-separated list of person fields to be included in the\nresponse. Each path should start with `person.`: for example,\n`person.names` or `person.photos`.", "format": "google-fieldmask", "type": "string", "location": "query" }, "resourceNames": { - "description": "The resource name, such as one returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list),\nof one of the people to provide information about. You can include this\nparameter up to 50 times in one request.", - "type": "string", "repeated": true, - "location": "query" - } - }, - "flatPath": "v1/people:batchGet", - "id": "people.people.getBatchGet", - "path": "v1/people:batchGet", - "description": "Provides information about a list of specific people by specifying a list\nof requested resource names. Use `people/me` to indicate the authenticated\nuser." - }, - "get": { - "flatPath": "v1/people/{peopleId}", - "path": "v1/{+resourceName}", - "id": "people.people.get", - "description": "Provides information about a person for a resource name. Use\n`people/me` to indicate the authenticated user.", - "parameterOrder": [ - "resourceName" - ], - "httpMethod": "GET", - "response": { - "$ref": "Person" - }, - "parameters": { - "resourceName": { - "description": "The resource name of the person to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about any user, specify the resource name that\n identifies the user, such as the resource names returned by\n [`people.connections.list`](/people/api/rest/v1/people.connections/list).", - "required": true, - "type": "string", - "pattern": "^people/[^/]+$", - "location": "path" - }, - "requestMask.includeField": { - "description": "Comma-separated list of fields to be included in the response. Omitting\nthis field will include all fields except for connections.list requests,\nwhich have a default mask that includes common fields like metadata, name,\nphoto, and profile url.\nEach path should start with `person.`: for example, `person.names` or\n`person.photos`.", - "format": "google-fieldmask", - "type": "string", - "location": "query" + "location": "query", + "description": "The resource names of the people to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about a google account, specify\n `people/`\u003cvar\u003eaccount_id\u003c/var\u003e.\n- To get information about a contact, specify the resource name that\n identifies the contact as returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list).\n\nYou can include up to 50 resource names in one request.", + "type": "string" } }, "scopes": [ @@ -1273,30 +1477,168 @@ "https://www.googleapis.com/auth/user.phonenumbers.read", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile" - ] + ], + "flatPath": "v1/people:batchGet", + "id": "people.people.getBatchGet", + "path": "v1/people:batchGet", + "description": "Provides information about a list of specific people by specifying a list\nof requested resource names. Use `people/me` to indicate the authenticated\nuser.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified." + }, + "get": { + "path": "v1/{+resourceName}", + "id": "people.people.get", + "description": "Provides information about a person by specifying a resource name. Use\n`people/me` to indicate the authenticated user.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified.", + "response": { + "$ref": "Person" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly", + "https://www.googleapis.com/auth/plus.login", + "https://www.googleapis.com/auth/user.addresses.read", + "https://www.googleapis.com/auth/user.birthday.read", + "https://www.googleapis.com/auth/user.emails.read", + "https://www.googleapis.com/auth/user.phonenumbers.read", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ], + "parameters": { + "resourceName": { + "description": "The resource name of the person to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about a google account, specify\n `people/`\u003cvar\u003eaccount_id\u003c/var\u003e.\n- To get information about a contact, specify the resource name that\n identifies the contact as returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list).", + "required": true, + "type": "string", + "pattern": "^people/[^/]+$", + "location": "path" + }, + "personFields": { + "location": "query", + "description": "**Required.** A field mask to restrict which fields on the person are\nreturned. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* braggingRights\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* relationshipInterests\n* relationshipStatuses\n* residences\n* skills\n* taglines\n* urls", + "format": "google-fieldmask", + "type": "string" + }, + "requestMask.includeField": { + "location": "query", + "description": "**Required.** Comma-separated list of person fields to be included in the\nresponse. Each path should start with `person.`: for example,\n`person.names` or `person.photos`.", + "format": "google-fieldmask", + "type": "string" + } + }, + "flatPath": "v1/people/{peopleId}" + }, + "updateContact": { + "response": { + "$ref": "Person" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "PATCH", + "parameters": { + "resourceName": { + "pattern": "^people/[^/]+$", + "location": "path", + "description": "The resource name for the person, assigned by the server. An ASCII string\nwith a max length of 27 characters, in the form of\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.", + "required": true, + "type": "string" + }, + "updatePersonFields": { + "description": "**Required.** A field mask to restrict which fields on the person are\nupdated. Valid values are:\n\n* addresses\n* biographies\n* birthdays\n* braggingRights\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* relations\n* residences\n* skills\n* urls", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/people/{peopleId}:updateContact", + "path": "v1/{+resourceName}:updateContact", + "id": "people.people.updateContact", + "request": { + "$ref": "Person" + }, + "description": "Update contact data for an existing contact person. Any non-contact data\nwill not be modified.\n\nThe request throws a 400 error if `updatePersonFields` is not specified.\n\u003cbr\u003e\nThe request throws a 400 error if `person.metadata.sources` is not\nspecified for the contact to be updated.\n\u003cbr\u003e\nThe request throws a 412 error if `person.metadata.sources.etag` is\ndifferent than the contact's etag, which indicates the contact has changed\nsince its data was read. Clients should get the latest person and re-apply\ntheir updates to the latest person." + }, + "createContact": { + "description": "Create a new contact and return the person resource for that contact.", + "request": { + "$ref": "Person" + }, + "response": { + "$ref": "Person" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "parameters": { + "parent": { + "description": "The resource name of the owning person resource.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/people:createContact", + "path": "v1/people:createContact", + "id": "people.people.createContact" + }, + "deleteContact": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "DELETE", + "parameters": { + "resourceName": { + "pattern": "^people/[^/]+$", + "location": "path", + "description": "The resource name of the contact to delete.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/people/{peopleId}:deleteContact", + "path": "v1/{+resourceName}:deleteContact", + "id": "people.people.deleteContact", + "description": "Delete a contact person. Any non-contact data will not be deleted." } }, "resources": { "connections": { "methods": { "list": { - "flatPath": "v1/people/{peopleId}/connections", - "id": "people.people.connections.list", - "path": "v1/{+resourceName}/connections", - "description": "Provides a list of the authenticated user's contacts merged with any\nlinked profiles.", - "httpMethod": "GET", - "parameterOrder": [ - "resourceName" - ], "response": { "$ref": "ListConnectionsResponse" }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], "parameters": { "syncToken": { "description": "A sync token, returned by a previous call to `people.connections.list`.\nOnly resources changed since the sync token was created will be returned.", "type": "string", "location": "query" }, + "personFields": { + "description": "**Required.** A field mask to restrict which fields on each person are\nreturned. Valid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* braggingRights\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* relationshipInterests\n* relationshipStatuses\n* residences\n* skills\n* taglines\n* urls", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, "sortOrder": { "location": "query", "enum": [ @@ -1308,22 +1650,22 @@ "type": "string" }, "requestSyncToken": { - "location": "query", "description": "Whether the response should include a sync token, which can be used to get\nall changes since the last request.", - "type": "boolean" + "type": "boolean", + "location": "query" + }, + "resourceName": { + "description": "The resource name to return connections for. Only `people/me` is valid.", + "required": true, + "type": "string", + "pattern": "^people/[^/]+$", + "location": "path" }, "pageToken": { "description": "The token of the page to be returned.", "type": "string", "location": "query" }, - "resourceName": { - "location": "path", - "description": "The resource name to return connections for. Only `people/me` is valid.", - "required": true, - "type": "string", - "pattern": "^people/[^/]+$" - }, "pageSize": { "location": "query", "description": "The number of connections to include in the response. Valid values are\nbetween 1 and 2000, inclusive. Defaults to 100.", @@ -1331,16 +1673,224 @@ "type": "integer" }, "requestMask.includeField": { - "description": "Comma-separated list of fields to be included in the response. Omitting\nthis field will include all fields except for connections.list requests,\nwhich have a default mask that includes common fields like metadata, name,\nphoto, and profile url.\nEach path should start with `person.`: for example, `person.names` or\n`person.photos`.", + "description": "**Required.** Comma-separated list of person fields to be included in the\nresponse. Each path should start with `person.`: for example,\n`person.names` or `person.photos`.", "format": "google-fieldmask", "type": "string", "location": "query" } }, + "flatPath": "v1/people/{peopleId}/connections", + "path": "v1/{+resourceName}/connections", + "id": "people.people.connections.list", + "description": "Provides a list of the authenticated user's contacts merged with any\nconnected profiles.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified." + } + } + } + } + }, + "contactGroups": { + "methods": { + "create": { + "description": "Create a new contact group owned by the authenticated user.", + "request": { + "$ref": "CreateContactGroupRequest" + }, + "response": { + "$ref": "ContactGroup" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "parameters": {}, + "flatPath": "v1/contactGroups", + "path": "v1/contactGroups", + "id": "people.contactGroups.create" + }, + "get": { + "description": "Get a specific contact group owned by the authenticated user by specifying\na contact group resource name.", + "httpMethod": "GET", + "parameterOrder": [ + "resourceName" + ], + "response": { + "$ref": "ContactGroup" + }, + "parameters": { + "maxMembers": { + "description": "Specifies the maximum number of members to return.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "resourceName": { + "description": "The resource name of the contact group to get.", + "required": true, + "type": "string", + "pattern": "^contactGroups/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "flatPath": "v1/contactGroups/{contactGroupsId}", + "id": "people.contactGroups.get", + "path": "v1/{+resourceName}" + }, + "update": { + "response": { + "$ref": "ContactGroup" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "parameters": { + "resourceName": { + "description": "The resource name for the contact group, assigned by the server. An ASCII\nstring, in the form of `contactGroups/`\u003cvar\u003econtact_group_id\u003c/var\u003e.", + "required": true, + "type": "string", + "pattern": "^contactGroups/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/contactGroups/{contactGroupsId}", + "path": "v1/{+resourceName}", + "id": "people.contactGroups.update", + "description": "Update the name of an existing contact group owned by the authenticated\nuser.", + "request": { + "$ref": "UpdateContactGroupRequest" + } + }, + "batchGet": { + "response": { + "$ref": "BatchGetContactGroupsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "parameters": { + "maxMembers": { + "description": "Specifies the maximum number of members to return for each group.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "resourceNames": { + "description": "The resource names of the contact groups to get.", + "type": "string", + "repeated": true, + "location": "query" + } + }, + "flatPath": "v1/contactGroups:batchGet", + "path": "v1/contactGroups:batchGet", + "id": "people.contactGroups.batchGet", + "description": "Get a list of contact groups owned by the authenticated user by specifying\na list of contact group resource names." + }, + "delete": { + "path": "v1/{+resourceName}", + "id": "people.contactGroups.delete", + "description": "Delete an existing contact group owned by the authenticated user by\nspecifying a contact group resource name.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "parameters": { + "resourceName": { + "pattern": "^contactGroups/[^/]+$", + "location": "path", + "description": "The resource name of the contact group to delete.", + "required": true, + "type": "string" + }, + "deleteContacts": { + "description": "Set to true to also delete the contacts in the specified group.", + "type": "boolean", + "location": "query" + } + }, + "flatPath": "v1/contactGroups/{contactGroupsId}" + }, + "list": { + "description": "List all contact groups owned by the authenticated user. Members of the\ncontact groups are not populated.", + "response": { + "$ref": "ListContactGroupsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "The next_page_token value returned from a previous call to\n[ListContactGroups](/people/api/rest/v1/contactgroups/list).\nRequests the next page of resources.", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of resources to return.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "syncToken": { + "location": "query", + "description": "A sync token, returned by a previous call to `contactgroups.list`.\nOnly resources changed since the sync token was created will be returned.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "flatPath": "v1/contactGroups", + "path": "v1/contactGroups", + "id": "people.contactGroups.list" + } + }, + "resources": { + "members": { + "methods": { + "modify": { + "response": { + "$ref": "ModifyContactGroupMembersResponse" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "POST", "scopes": [ - "https://www.googleapis.com/auth/contacts", - "https://www.googleapis.com/auth/contacts.readonly" - ] + "https://www.googleapis.com/auth/contacts" + ], + "parameters": { + "resourceName": { + "pattern": "^contactGroups/[^/]+$", + "location": "path", + "description": "The resource name of the contact group to modify.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/contactGroups/{contactGroupsId}/members:modify", + "path": "v1/{+resourceName}/members:modify", + "id": "people.contactGroups.members.modify", + "description": "Modify the members of a contact group owned by the authenticated user.", + "request": { + "$ref": "ModifyContactGroupMembersRequest" + } } } } @@ -1349,40 +1899,40 @@ }, "parameters": { "key": { - "location": "query", "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.", - "type": "string" - }, - "access_token": { - "description": "OAuth access token.", "type": "string", "location": "query" }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, "quotaUser": { "location": "query", "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.", "type": "string" }, "pp": { + "location": "query", "description": "Pretty-print response.", "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "default": "true" }, "bearer_token": { + "location": "query", "description": "OAuth bearer token.", - "type": "string", - "location": "query" + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" }, "upload_protocol": { - "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "prettyPrint": { "location": "query", @@ -1390,35 +1940,40 @@ "type": "boolean", "default": "true" }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "location": "query", + "description": "JSONP", "type": "string" }, "$.xgafv": { + "enum": [ + "1", + "2" + ], "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "callback": { - "description": "JSONP", - "type": "string", "location": "query" }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -1427,13 +1982,13 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] + "default": "json" } }, - "version": "v1" + "version": "v1", + "baseUrl": "https://people.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Provides access to information about profiles and contacts.", + "servicePath": "", + "basePath": "" } diff --git a/etc/api/playcustomapp/v1/crates/1.0.6-api+20170622 b/etc/api/playcustomapp/v1/crates/1.0.6-api+20170622 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/playcustomapp/v1/crates/1.0.6-cli+20170622 b/etc/api/playcustomapp/v1/crates/1.0.6-cli+20170622 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/playcustomapp/v1/playcustomapp-api.json b/etc/api/playcustomapp/v1/playcustomapp-api.json new file mode 100644 index 0000000000..e814c24715 --- /dev/null +++ b/etc/api/playcustomapp/v1/playcustomapp-api.json @@ -0,0 +1,149 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/S9A8Fvkyeh8EMNMlBREkvuFfFUI\"", + "discoveryVersion": "v1", + "id": "playcustomapp:v1", + "name": "playcustomapp", + "version": "v1", + "revision": "20170622", + "title": "Google Play Custom App Publishing API", + "description": "An API to publish custom Android apps.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://developers.google.com/android/work/play/custom-app-api", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/playcustomapp/v1/accounts/", + "basePath": "/playcustomapp/v1/accounts/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "playcustomapp/v1/accounts/", + "batchPath": "batch/playcustomapp/v1", + "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/androidpublisher": { + "description": "View and manage your Google Play Developer account" + } + } + } + }, + "schemas": { + "CustomApp": { + "id": "CustomApp", + "type": "object", + "description": "This resource represents a custom app.", + "properties": { + "languageCode": { + "type": "string", + "description": "Default listing language in BCP 47 format." + }, + "title": { + "type": "string", + "description": "Title for the Android app." + } + } + } + }, + "resources": { + "accounts": { + "resources": { + "customApps": { + "methods": { + "create": { + "id": "playcustomapp.accounts.customApps.create", + "path": "{account}/customApps", + "httpMethod": "POST", + "description": "Create and publish a new custom app.", + "parameters": { + "account": { + "type": "string", + "description": "Developer account ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "account" + ], + "request": { + "$ref": "CustomApp" + }, + "response": { + "$ref": "CustomApp" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/playcustomapp/v1/accounts/{account}/customApps" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/playcustomapp/v1/accounts/{account}/customApps" + } + } + } + } + } + } + } + } + } +} diff --git a/etc/api/playmoviespartner/v1/crates/1.0.6-api+20170919 b/etc/api/playmoviespartner/v1/crates/1.0.6-api+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/playmoviespartner/v1/crates/1.0.6-cli+20170919 b/etc/api/playmoviespartner/v1/crates/1.0.6-cli+20170919 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/playmoviespartner/v1/playmoviespartner-api.json b/etc/api/playmoviespartner/v1/playmoviespartner-api.json index 888eca184e..d6df88876e 100644 --- a/etc/api/playmoviespartner/v1/playmoviespartner-api.json +++ b/etc/api/playmoviespartner/v1/playmoviespartner-api.json @@ -1,9 +1,571 @@ { + "baseUrl": "https://playmoviespartner.googleapis.com/", + "canonicalName": "Play Movies", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/playmovies_partner.readonly": { + "description": "View the digital assets you publish on Google Play Movies and TV" + } + } + } + }, + "kind": "discovery#restDescription", + "servicePath": "", + "description": "Gets the delivery status of titles for Google Play Movies Partners.", + "rootUrl": "https://playmoviespartner.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "playmoviespartner", + "batchPath": "batch", + "revision": "20170919", + "documentationLink": "https://developers.google.com/playmoviespartner/", + "id": "playmoviespartner:v1", + "title": "Google Play Movies Partner API", + "ownerName": "Google", + "discoveryVersion": "v1", + "resources": { + "accounts": { + "resources": { + "orders": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListOrdersResponse" + }, + "parameters": { + "accountId": { + "description": "REQUIRED. See _General rules_ for more information about this field.", + "type": "string", + "required": true, + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string" + }, + "customId": { + "description": "Filter Orders that match a case-insensitive, partner-specific custom id.", + "type": "string", + "location": "query" + }, + "videoIds": { + "location": "query", + "description": "Filter Orders that match any of the given `video_id`s.", + "type": "string", + "repeated": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "See _List methods rules_ for info about this field.", + "type": "integer" + }, + "pphNames": { + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "repeated": true, + "location": "query" + }, + "status": { + "location": "query", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_APPROVED", + "STATUS_FAILED", + "STATUS_PROCESSING", + "STATUS_UNFULFILLED", + "STATUS_NOT_AVAILABLE" + ], + "description": "Filter Orders that match one of the given status.", + "type": "string", + "repeated": true + }, + "studioNames": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "repeated": true + }, + "name": { + "description": "Filter that matches Orders with a `name`, `show`, `season` or `episode`\nthat contains the given case-insensitive name.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ], + "flatPath": "v1/accounts/{accountId}/orders", + "path": "v1/accounts/{accountId}/orders", + "id": "playmoviespartner.accounts.orders.list", + "description": "List Orders owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method." + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "orderId" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ], + "parameters": { + "orderId": { + "description": "REQUIRED. Order ID.", + "type": "string", + "required": true, + "location": "path" + }, + "accountId": { + "location": "path", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/accounts/{accountId}/orders/{orderId}", + "path": "v1/accounts/{accountId}/orders/{orderId}", + "id": "playmoviespartner.accounts.orders.get", + "description": "Get an Order given its id.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method." + } + } + }, + "avails": { + "methods": { + "list": { + "description": "List Avails owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.", + "response": { + "$ref": "ListAvailsResponse" + }, + "parameterOrder": [ + "accountId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ], + "parameters": { + "title": { + "description": "Filter that matches Avails with a `title_internal_alias`,\n`series_title_internal_alias`, `season_title_internal_alias`,\nor `episode_title_internal_alias` that contains the given\ncase-insensitive title.", + "type": "string", + "location": "query" + }, + "videoIds": { + "description": "Filter Avails that match any of the given `video_id`s.", + "type": "string", + "repeated": true, + "location": "query" + }, + "pageToken": { + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "See _List methods rules_ for info about this field.", + "type": "integer" + }, + "altIds": { + "description": "Filter Avails that match (case-insensitive) any of the given partner-specific custom ids.", + "type": "string", + "repeated": true, + "location": "query" + }, + "pphNames": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "repeated": true + }, + "altId": { + "location": "query", + "description": "Filter Avails that match a case-insensitive, partner-specific custom id.\nNOTE: this field is deprecated and will be removed on V2; `alt_ids`\nshould be used instead.", + "type": "string" + }, + "studioNames": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "repeated": true + }, + "accountId": { + "description": "REQUIRED. See _General rules_ for more information about this field.", + "type": "string", + "required": true, + "location": "path" + }, + "territories": { + "location": "query", + "description": "Filter Avails that match (case-insensitive) any of the given country codes,\nusing the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", + "type": "string", + "repeated": true + } + }, + "flatPath": "v1/accounts/{accountId}/avails", + "id": "playmoviespartner.accounts.avails.list", + "path": "v1/accounts/{accountId}/avails" + }, + "get": { + "description": "Get an Avail given its avail group id and avail id.", + "response": { + "$ref": "Avail" + }, + "parameterOrder": [ + "accountId", + "availId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ], + "parameters": { + "availId": { + "description": "REQUIRED. Avail ID.", + "type": "string", + "required": true, + "location": "path" + }, + "accountId": { + "description": "REQUIRED. See _General rules_ for more information about this field.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/accounts/{accountId}/avails/{availId}", + "id": "playmoviespartner.accounts.avails.get", + "path": "v1/accounts/{accountId}/avails/{availId}" + } + } + }, + "storeInfos": { + "methods": { + "list": { + "flatPath": "v1/accounts/{accountId}/storeInfos", + "path": "v1/accounts/{accountId}/storeInfos", + "id": "playmoviespartner.accounts.storeInfos.list", + "description": "List StoreInfos owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.", + "httpMethod": "GET", + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListStoreInfosResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ], + "parameters": { + "accountId": { + "location": "path", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "type": "string", + "required": true + }, + "seasonIds": { + "description": "Filter StoreInfos that match any of the given `season_id`s.", + "type": "string", + "repeated": true, + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string" + }, + "videoId": { + "location": "query", + "description": "Filter StoreInfos that match a given `video_id`.\nNOTE: this field is deprecated and will be removed on V2; `video_ids`\nshould be used instead.", + "type": "string" + }, + "videoIds": { + "location": "query", + "description": "Filter StoreInfos that match any of the given `video_id`s.", + "type": "string", + "repeated": true + }, + "pageSize": { + "format": "int32", + "description": "See _List methods rules_ for info about this field.", + "type": "integer", + "location": "query" + }, + "mids": { + "location": "query", + "description": "Filter StoreInfos that match any of the given `mid`s.", + "type": "string", + "repeated": true + }, + "pphNames": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "repeated": true + }, + "countries": { + "location": "query", + "description": "Filter StoreInfos that match (case-insensitive) any of the given country\ncodes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", + "type": "string", + "repeated": true + }, + "name": { + "location": "query", + "description": "Filter that matches StoreInfos with a `name` or `show_name`\nthat contains the given case-insensitive name.", + "type": "string" + }, + "studioNames": { + "location": "query", + "description": "See _List methods rules_ for info about this field.", + "type": "string", + "repeated": true + } + } + } + }, + "resources": { + "country": { + "methods": { + "get": { + "description": "Get a StoreInfo given its video id and country.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method.", + "response": { + "$ref": "StoreInfo" + }, + "parameterOrder": [ + "accountId", + "videoId", + "country" + ], + "httpMethod": "GET", + "parameters": { + "country": { + "location": "path", + "description": "REQUIRED. Edit country.", + "type": "string", + "required": true + }, + "videoId": { + "description": "REQUIRED. Video ID.", + "type": "string", + "required": true, + "location": "path" + }, + "accountId": { + "description": "REQUIRED. See _General rules_ for more information about this field.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ], + "flatPath": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}", + "id": "playmoviespartner.accounts.storeInfos.country.get", + "path": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}" + } + } + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + }, "schemas": { "Order": { "description": "An Order tracks the fulfillment of an Edit when delivered using the\nlegacy, non-component-based delivery.\n\nEach Order is uniquely identified by an `order_id`, which is generated\nby Google.\n\nExternally, Orders can also be identified by partners using its `custom_id`\n(when provided).", "type": "object", "properties": { + "countries": { + "description": "Countries where the Order is available,\nusing the \"ISO 3166-1 alpha-2\" format (example: \"US\").", + "items": { + "type": "string" + }, + "type": "array" + }, + "statusDetail": { + "enumDescriptions": [ + "Value could not be determined, please contact technical support if\nit should.", + "Approved by Google's Quality Control team.", + "Rejected by Google's Quality Control team, pending partner redelivery.", + "Internal error while processing the Order.", + "Waiting for initial delivery from partner.", + "Used on Orders that do not have Status, like TV Seasons.", + "Waiting for re-delivery from partner.", + "Asset was delivered by partner, but is being reviewed by Google's\nQuality Control team.", + "Waiting for Google to process the asset." + ], + "enum": [ + "ORDER_STATUS_UNSPECIFIED", + "ORDER_STATUS_QC_APPROVED", + "ORDER_STATUS_QC_REJECTION", + "ORDER_STATUS_INTERNAL_FIX", + "ORDER_STATUS_OPEN_ORDER", + "ORDER_STATUS_NOT_AVAILABLE", + "ORDER_STATUS_AWAITING_REDELIVERY", + "ORDER_STATUS_READY_FOR_QC", + "ORDER_STATUS_FILE_PROCESSING" + ], + "description": "Detailed status of the order", + "type": "string" + }, + "status": { + "enumDescriptions": [ + "Value could not be determined, please contact technical support if\nit should.", + "Approved by Google.", + "Waiting for partner to re-deliver the asset after a rejection by Google.", + "Waiting for Google to process the asset.", + "Waiting for partner to deliver the asset.", + "Used when Status is not available (i.e: Orders for TV Seasons)." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_APPROVED", + "STATUS_FAILED", + "STATUS_PROCESSING", + "STATUS_UNFULFILLED", + "STATUS_NOT_AVAILABLE" + ], + "description": "High-level status of the order.", + "type": "string" + }, + "earliestAvailStartTime": { + "format": "google-datetime", + "description": "Timestamp of the earliest start date of the Avails\nlinked to this Order.", + "type": "string" + }, + "name": { + "description": "Default Edit name,\nusually in the language of the country of origin.\nExample: \"Googlers, The\".", + "type": "string" + }, + "studioName": { + "description": "Name of the studio that owns the Edit ordered.", + "type": "string" + }, + "receivedTime": { + "format": "google-datetime", + "description": "Timestamp when the Order was fulfilled.", + "type": "string" + }, + "seasonName": { + "description": "Default Season name,\nusually in the language of the country of origin.\nOnly available for TV Edits\nExample: \"Googlers, The - A Brave New World\".", + "type": "string" + }, + "customId": { + "description": "ID that can be used to externally identify an Order.\nThis ID is provided by partners when submitting the Avails.\nExample: 'GOOGLER_2006'", + "type": "string" + }, + "channelName": { + "description": "YouTube Channel Name that should be used to fulfill the Order.\nExample: \"Google_channel\".", + "type": "string" + }, + "approvedTime": { + "format": "google-datetime", + "description": "Timestamp when the Order was approved.", + "type": "string" + }, + "showName": { + "description": "Default Show name,\nusually in the language of the country of origin.\nOnly available for TV Edits\nExample: \"Googlers, The\".", + "type": "string" + }, "normalizedPriority": { "description": "A simpler representation of the priority.", "type": "string", @@ -57,13 +619,13 @@ "type": "string" }, "orderedTime": { - "description": "Timestamp when the Order was created.", "format": "google-datetime", + "description": "Timestamp when the Order was created.", "type": "string" }, "priority": { - "description": "Order priority, as defined by Google.\nThe higher the value, the higher the priority.\nExample: 90", "format": "double", + "description": "Order priority, as defined by Google.\nThe higher the value, the higher the priority.\nExample: 90", "type": "number" }, "videoId": { @@ -73,98 +635,6 @@ "episodeName": { "description": "Default Episode name,\nusually in the language of the country of origin.\nOnly available for TV Edits\nExample: \"Googlers, The - Pilot\".", "type": "string" - }, - "countries": { - "description": "Countries where the Order is available,\nusing the \"ISO 3166-1 alpha-2\" format (example: \"US\").", - "type": "array", - "items": { - "type": "string" - } - }, - "statusDetail": { - "description": "Detailed status of the order", - "type": "string", - "enumDescriptions": [ - "Value could not be determined, please contact technical support if\nit should.", - "Approved by Google's Quality Control team.", - "Rejected by Google's Quality Control team, pending partner redelivery.", - "Internal error while processing the Order.", - "Waiting for initial delivery from partner.", - "Used on Orders that do not have Status, like TV Seasons.", - "Waiting for re-delivery from partner.", - "Asset was delivered by partner, but is being reviewed by Google's\nQuality Control team.", - "Waiting for Google to process the asset." - ], - "enum": [ - "ORDER_STATUS_UNSPECIFIED", - "ORDER_STATUS_QC_APPROVED", - "ORDER_STATUS_QC_REJECTION", - "ORDER_STATUS_INTERNAL_FIX", - "ORDER_STATUS_OPEN_ORDER", - "ORDER_STATUS_NOT_AVAILABLE", - "ORDER_STATUS_AWAITING_REDELIVERY", - "ORDER_STATUS_READY_FOR_QC", - "ORDER_STATUS_FILE_PROCESSING" - ] - }, - "status": { - "enumDescriptions": [ - "Value could not be determined, please contact technical support if\nit should.", - "Approved by Google.", - "Waiting for partner to re-deliver the asset after a rejection by Google.", - "Waiting for Google to process the asset.", - "Waiting for partner to deliver the asset.", - "Used when Status is not available (i.e: Orders for TV Seasons)." - ], - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_APPROVED", - "STATUS_FAILED", - "STATUS_PROCESSING", - "STATUS_UNFULFILLED", - "STATUS_NOT_AVAILABLE" - ], - "description": "High-level status of the order.", - "type": "string" - }, - "earliestAvailStartTime": { - "description": "Timestamp of the earliest start date of the Avails\nlinked to this Order.", - "format": "google-datetime", - "type": "string" - }, - "name": { - "description": "Default Edit name,\nusually in the language of the country of origin.\nExample: \"Googlers, The\".", - "type": "string" - }, - "studioName": { - "description": "Name of the studio that owns the Edit ordered.", - "type": "string" - }, - "receivedTime": { - "description": "Timestamp when the Order was fulfilled.", - "format": "google-datetime", - "type": "string" - }, - "seasonName": { - "description": "Default Season name,\nusually in the language of the country of origin.\nOnly available for TV Edits\nExample: \"Googlers, The - A Brave New World\".", - "type": "string" - }, - "customId": { - "description": "ID that can be used to externally identify an Order.\nThis ID is provided by partners when submitting the Avails.\nExample: 'GOOGLER_2006'", - "type": "string" - }, - "channelName": { - "description": "YouTube Channel Name that should be used to fulfill the Order.\nExample: \"Google_channel\".", - "type": "string" - }, - "approvedTime": { - "description": "Timestamp when the Order was approved.", - "format": "google-datetime", - "type": "string" - }, - "showName": { - "description": "Default Show name,\nusually in the language of the country of origin.\nOnly available for TV Edits\nExample: \"Googlers, The\".", - "type": "string" } }, "id": "Order" @@ -177,17 +647,17 @@ "description": "See 'List methods rules' for info about this field.", "type": "string" }, + "totalSize": { + "format": "int32", + "description": "See _List methods rules_ for more information about this field.", + "type": "integer" + }, "storeInfos": { "description": "List of StoreInfos that match the request criteria.", - "type": "array", "items": { "$ref": "StoreInfo" - } - }, - "totalSize": { - "description": "See _List methods rules_ for more information about this field.", - "format": "int32", - "type": "integer" + }, + "type": "array" } }, "id": "ListStoreInfosResponse" @@ -198,18 +668,18 @@ "properties": { "avails": { "description": "List of Avails that match the request criteria.", - "type": "array", "items": { "$ref": "Avail" - } + }, + "type": "array" }, "nextPageToken": { "description": "See _List methods rules_ for info about this field.", "type": "string" }, "totalSize": { - "description": "See _List methods rules_ for more information about this field.", "format": "int32", + "description": "See _List methods rules_ for more information about this field.", "type": "integer" } }, @@ -219,6 +689,56 @@ "description": "Information about a playable sequence (video) associated with an Edit\nand available at the Google Play Store.\n\nInternally, each StoreInfo is uniquely identified by a `video_id`\nand `country`.\n\nExternally, Title-level EIDR or Edit-level EIDR, if provided,\ncan also be used to identify a specific title or edit in a country.", "type": "object", "properties": { + "liveTime": { + "format": "google-datetime", + "description": "Timestamp when the Edit went live on the Store.", + "type": "string" + }, + "videoId": { + "description": "Google-generated ID identifying the video linked to the Edit.\nExample: 'gtry456_xc'", + "type": "string" + }, + "hasInfoCards": { + "description": "Whether the Edit has info cards.", + "type": "boolean" + }, + "hasVodOffer": { + "description": "Whether the Edit has a VOD offer.", + "type": "boolean" + }, + "pphNames": { + "description": "Name of the post-production houses that manage the Edit.", + "items": { + "type": "string" + }, + "type": "array" + }, + "episodeNumber": { + "description": "The number assigned to the episode within a season.\nOnly available on TV Edits.\nExample: \"1\".", + "type": "string" + }, + "studioName": { + "description": "Name of the studio that owns the Edit ordered.", + "type": "string" + }, + "subtitles": { + "description": "Subtitles available for this Edit.", + "items": { + "type": "string" + }, + "type": "array" + }, + "audioTracks": { + "description": "Audio tracks available for this Edit.", + "items": { + "type": "string" + }, + "type": "array" + }, + "showName": { + "description": "Default Show name, usually in the language of the country of\norigin.\nOnly available for TV Edits\nExample: \"Googlers, The\".", + "type": "string" + }, "country": { "description": "Country where Edit is available in ISO 3166-1 alpha-2 country\ncode.\nExample: \"US\".", "type": "string" @@ -292,56 +812,6 @@ "hasSdOffer": { "description": "Whether the Edit has a SD offer.", "type": "boolean" - }, - "liveTime": { - "description": "Timestamp when the Edit went live on the Store.", - "format": "google-datetime", - "type": "string" - }, - "videoId": { - "description": "Google-generated ID identifying the video linked to the Edit.\nExample: 'gtry456_xc'", - "type": "string" - }, - "hasInfoCards": { - "description": "Whether the Edit has info cards.", - "type": "boolean" - }, - "hasVodOffer": { - "description": "Whether the Edit has a VOD offer.", - "type": "boolean" - }, - "pphNames": { - "description": "Name of the post-production houses that manage the Edit.", - "type": "array", - "items": { - "type": "string" - } - }, - "episodeNumber": { - "description": "The number assigned to the episode within a season.\nOnly available on TV Edits.\nExample: \"1\".", - "type": "string" - }, - "studioName": { - "description": "Name of the studio that owns the Edit ordered.", - "type": "string" - }, - "subtitles": { - "description": "Subtitles available for this Edit.", - "type": "array", - "items": { - "type": "string" - } - }, - "audioTracks": { - "description": "Audio tracks available for this Edit.", - "type": "array", - "items": { - "type": "string" - } - }, - "showName": { - "description": "Default Show name, usually in the language of the country of\norigin.\nOnly available for TV Edits\nExample: \"Googlers, The\".", - "type": "string" } }, "id": "StoreInfo" @@ -350,6 +820,26 @@ "description": "An Avail describes the Availability Window of a specific Edit in a given\ncountry, which means the period Google is allowed to sell or rent the Edit.\n\nAvails are exposed in EMA format Version 1.6b (available at\nhttp://www.movielabs.com/md/avails/)\n\nStudios can see the Avails for the Titles they own.\nPost-production houses cannot see any Avails.", "type": "object", "properties": { + "seriesTitleInternalAlias": { + "description": "Title used by involved parties to refer to this series.\nOnly available on TV Avails.\nExample: \"Googlers, The\".", + "type": "string" + }, + "formatProfile": { + "description": "Indicates the format profile covered by the transaction.", + "type": "string", + "enumDescriptions": [ + "Value could not be determined, please contact technical support if\nit should.", + "Standard-definition format.", + "High-definition format.", + "4K UHD." + ], + "enum": [ + "FORMAT_PROFILE_UNSPECIFIED", + "SD", + "HD", + "UHD" + ] + }, "contentId": { "description": "Title Identifier. This should be the Title Level EIDR.\nExample: \"10.5240/1489-49A2-3956-4B2D-FE16-5\".", "type": "string" @@ -366,16 +856,16 @@ "description": "Spoken language of the intended audience.\nLanguage shall be encoded in accordance with RFC 5646.\nExample: \"fr\".", "type": "string" }, - "productId": { - "description": "Edit Identifier. This should be the Edit Level EIDR.\nExample: \"10.2340/1489-49A2-3956-4B2D-FE16-6\"", + "captionExemption": { + "description": "Communicating an exempt category as defined by FCC regulations.\nIt is not required for non-US Avails.\nExample: \"1\"", "type": "string" }, "displayName": { "description": "The name of the studio that owns the Edit referred in the Avail.\nThis is the equivalent of `studio_name` in other resources, but it follows\nthe EMA nomenclature.\nExample: \"Google Films\".", "type": "string" }, - "captionExemption": { - "description": "Communicating an exempt category as defined by FCC regulations.\nIt is not required for non-US Avails.\nExample: \"1\"", + "productId": { + "description": "Edit Identifier. This should be the Edit Level EIDR.\nExample: \"10.2340/1489-49A2-3956-4B2D-FE16-6\"", "type": "string" }, "seasonTitleInternalAlias": { @@ -395,6 +885,8 @@ "type": "string" }, "workType": { + "description": "Work type as enumerated in EMA.", + "type": "string", "enumDescriptions": [ "Value could not be determined, please contact technical support if\nit should.", "A movie picture.", @@ -408,9 +900,7 @@ "SEASON", "EPISODE", "BUNDLE" - ], - "description": "Work type as enumerated in EMA.", - "type": "string" + ] }, "availId": { "description": "ID internally generated by Google to uniquely identify an Avail.\nNot part of EMA Specs.", @@ -444,10 +934,6 @@ "description": "Communicating if caption file will be delivered.", "type": "boolean" }, - "seasonNumber": { - "description": "The number assigned to the season within a series.\nOnly available on TV Avails.\nExample: \"1\".", - "type": "string" - }, "licenseType": { "description": "Type of transaction.", "type": "string", @@ -466,6 +952,10 @@ "POEST" ] }, + "seasonNumber": { + "description": "The number assigned to the season within a series.\nOnly available on TV Avails.\nExample: \"1\".", + "type": "string" + }, "releaseDate": { "description": "Release date of the Title in earliest released territory.\nTypically it is just the year, but it is free-form as per EMA spec.\nExamples: \"1979\", \"Oct 2014\"", "type": "string" @@ -482,17 +972,17 @@ "description": "Start of term in YYYY-MM-DD format in the timezone of the\ncountry of the Avail.\nExample: \"2013-05-14\".", "type": "string" }, - "pphNames": { - "description": "Name of the post-production houses that manage the Avail.\nNot part of EMA Specs.", - "type": "array", - "items": { - "type": "string" - } - }, "ratingSystem": { "description": "Rating system applied to the version of title within territory\nof Avail.\nRating systems should be formatted as per\n[EMA ratings spec](http://www.movielabs.com/md/ratings/)\nExample: \"MPAA\"", "type": "string" }, + "pphNames": { + "description": "Name of the post-production houses that manage the Avail.\nNot part of EMA Specs.", + "items": { + "type": "string" + }, + "type": "array" + }, "seriesAltId": { "description": "Other identifier referring to the series, as defined by partner.\nOnly available on TV avails.\nExample: \"rs_googlers\".", "type": "string" @@ -504,26 +994,6 @@ "episodeNumber": { "description": "The number assigned to the episode within a season.\nOnly available on TV Avails.\nExample: \"3\".", "type": "string" - }, - "seriesTitleInternalAlias": { - "description": "Title used by involved parties to refer to this series.\nOnly available on TV Avails.\nExample: \"Googlers, The\".", - "type": "string" - }, - "formatProfile": { - "enumDescriptions": [ - "Value could not be determined, please contact technical support if\nit should.", - "Standard-definition format.", - "High-definition format.", - "4K UHD." - ], - "enum": [ - "FORMAT_PROFILE_UNSPECIFIED", - "SD", - "HD", - "UHD" - ], - "description": "Indicates the format profile covered by the transaction.", - "type": "string" } }, "id": "Avail" @@ -534,18 +1004,18 @@ "properties": { "orders": { "description": "List of Orders that match the request criteria.", - "type": "array", "items": { "$ref": "Order" - } + }, + "type": "array" }, "nextPageToken": { "description": "See _List methods rules_ for info about this field.", "type": "string" }, "totalSize": { - "description": "See _List methods rules_ for more information about this field.", "format": "int32", + "description": "See _List methods rules_ for more information about this field.", "type": "integer" } }, @@ -554,478 +1024,8 @@ }, "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, - "version": "v1", - "baseUrl": "https://playmoviespartner.googleapis.com/", - "canonicalName": "Play Movies", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/playmovies_partner.readonly": { - "description": "View the digital assets you publish on Google Play Movies and TV" - } - } - } - }, - "servicePath": "", - "description": "Gets the delivery status of titles for Google Play Movies Partners.", - "kind": "discovery#restDescription", - "rootUrl": "https://playmoviespartner.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "playmoviespartner", - "batchPath": "batch", - "id": "playmoviespartner:v1", - "documentationLink": "https://developers.google.com/playmoviespartner/", - "revision": "20170516", - "title": "Google Play Movies Partner API", - "discoveryVersion": "v1", - "ownerName": "Google", - "resources": { - "accounts": { - "resources": { - "avails": { - "methods": { - "get": { - "description": "Get an Avail given its avail group id and avail id.", - "httpMethod": "GET", - "parameterOrder": [ - "accountId", - "availId" - ], - "response": { - "$ref": "Avail" - }, - "parameters": { - "accountId": { - "description": "REQUIRED. See _General rules_ for more information about this field.", - "required": true, - "type": "string", - "location": "path" - }, - "availId": { - "description": "REQUIRED. Avail ID.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/playmovies_partner.readonly" - ], - "flatPath": "v1/accounts/{accountId}/avails/{availId}", - "id": "playmoviespartner.accounts.avails.get", - "path": "v1/accounts/{accountId}/avails/{availId}" - }, - "list": { - "flatPath": "v1/accounts/{accountId}/avails", - "id": "playmoviespartner.accounts.avails.list", - "path": "v1/accounts/{accountId}/avails", - "description": "List Avails owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.", - "httpMethod": "GET", - "parameterOrder": [ - "accountId" - ], - "response": { - "$ref": "ListAvailsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/playmovies_partner.readonly" - ], - "parameters": { - "pageSize": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "format": "int32", - "type": "integer" - }, - "altIds": { - "description": "Filter Avails that match (case-insensitive) any of the given partner-specific custom ids.", - "type": "string", - "repeated": true, - "location": "query" - }, - "pphNames": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "repeated": true - }, - "altId": { - "location": "query", - "description": "Filter Avails that match a case-insensitive, partner-specific custom id.\nNOTE: this field is deprecated and will be removed on V2; `alt_ids`\nshould be used instead.", - "type": "string" - }, - "studioNames": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "repeated": true - }, - "accountId": { - "description": "REQUIRED. See _General rules_ for more information about this field.", - "required": true, - "type": "string", - "location": "path" - }, - "territories": { - "description": "Filter Avails that match (case-insensitive) any of the given country codes,\nusing the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", - "type": "string", - "repeated": true, - "location": "query" - }, - "title": { - "location": "query", - "description": "Filter that matches Avails with a `title_internal_alias`,\n`series_title_internal_alias`, `season_title_internal_alias`,\nor `episode_title_internal_alias` that contains the given\ncase-insensitive title.", - "type": "string" - }, - "videoIds": { - "location": "query", - "description": "Filter Avails that match any of the given `video_id`s.", - "type": "string", - "repeated": true - }, - "pageToken": { - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "location": "query" - } - } - } - } - }, - "orders": { - "methods": { - "get": { - "description": "Get an Order given its id.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method.", - "httpMethod": "GET", - "parameterOrder": [ - "accountId", - "orderId" - ], - "response": { - "$ref": "Order" - }, - "parameters": { - "accountId": { - "location": "path", - "description": "REQUIRED. See _General rules_ for more information about this field.", - "required": true, - "type": "string" - }, - "orderId": { - "location": "path", - "description": "REQUIRED. Order ID.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/playmovies_partner.readonly" - ], - "flatPath": "v1/accounts/{accountId}/orders/{orderId}", - "id": "playmoviespartner.accounts.orders.get", - "path": "v1/accounts/{accountId}/orders/{orderId}" - }, - "list": { - "response": { - "$ref": "ListOrdersResponse" - }, - "parameterOrder": [ - "accountId" - ], - "httpMethod": "GET", - "parameters": { - "accountId": { - "location": "path", - "description": "REQUIRED. See _General rules_ for more information about this field.", - "required": true, - "type": "string" - }, - "pageToken": { - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "location": "query" - }, - "customId": { - "description": "Filter Orders that match a case-insensitive, partner-specific custom id.", - "type": "string", - "location": "query" - }, - "videoIds": { - "description": "Filter Orders that match any of the given `video_id`s.", - "type": "string", - "repeated": true, - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "format": "int32", - "type": "integer" - }, - "pphNames": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "repeated": true - }, - "status": { - "description": "Filter Orders that match one of the given status.", - "type": "string", - "repeated": true, - "location": "query", - "enum": [ - "STATUS_UNSPECIFIED", - "STATUS_APPROVED", - "STATUS_FAILED", - "STATUS_PROCESSING", - "STATUS_UNFULFILLED", - "STATUS_NOT_AVAILABLE" - ] - }, - "name": { - "description": "Filter that matches Orders with a `name`, `show`, `season` or `episode`\nthat contains the given case-insensitive name.", - "type": "string", - "location": "query" - }, - "studioNames": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "repeated": true - } - }, - "scopes": [ - "https://www.googleapis.com/auth/playmovies_partner.readonly" - ], - "flatPath": "v1/accounts/{accountId}/orders", - "path": "v1/accounts/{accountId}/orders", - "id": "playmoviespartner.accounts.orders.list", - "description": "List Orders owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method." - } - } - }, - "storeInfos": { - "methods": { - "list": { - "description": "List StoreInfos owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.", - "response": { - "$ref": "ListStoreInfosResponse" - }, - "parameterOrder": [ - "accountId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/playmovies_partner.readonly" - ], - "parameters": { - "pageSize": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "format": "int32", - "type": "integer" - }, - "mids": { - "description": "Filter StoreInfos that match any of the given `mid`s.", - "type": "string", - "repeated": true, - "location": "query" - }, - "pphNames": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "repeated": true - }, - "countries": { - "description": "Filter StoreInfos that match (case-insensitive) any of the given country\ncodes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", - "type": "string", - "repeated": true, - "location": "query" - }, - "studioNames": { - "location": "query", - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "repeated": true - }, - "name": { - "location": "query", - "description": "Filter that matches StoreInfos with a `name` or `show_name`\nthat contains the given case-insensitive name.", - "type": "string" - }, - "accountId": { - "description": "REQUIRED. See _General rules_ for more information about this field.", - "required": true, - "type": "string", - "location": "path" - }, - "seasonIds": { - "location": "query", - "description": "Filter StoreInfos that match any of the given `season_id`s.", - "type": "string", - "repeated": true - }, - "pageToken": { - "description": "See _List methods rules_ for info about this field.", - "type": "string", - "location": "query" - }, - "videoId": { - "location": "query", - "description": "Filter StoreInfos that match a given `video_id`.\nNOTE: this field is deprecated and will be removed on V2; `video_ids`\nshould be used instead.", - "type": "string" - }, - "videoIds": { - "location": "query", - "description": "Filter StoreInfos that match any of the given `video_id`s.", - "type": "string", - "repeated": true - } - }, - "flatPath": "v1/accounts/{accountId}/storeInfos", - "path": "v1/accounts/{accountId}/storeInfos", - "id": "playmoviespartner.accounts.storeInfos.list" - } - }, - "resources": { - "country": { - "methods": { - "get": { - "description": "Get a StoreInfo given its video id and country.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method.", - "httpMethod": "GET", - "parameterOrder": [ - "accountId", - "videoId", - "country" - ], - "response": { - "$ref": "StoreInfo" - }, - "parameters": { - "videoId": { - "location": "path", - "description": "REQUIRED. Video ID.", - "required": true, - "type": "string" - }, - "country": { - "location": "path", - "description": "REQUIRED. Edit country.", - "required": true, - "type": "string" - }, - "accountId": { - "description": "REQUIRED. See _General rules_ for more information about this field.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/playmovies_partner.readonly" - ], - "flatPath": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}", - "id": "playmoviespartner.accounts.storeInfos.country.get", - "path": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}" - } - } - } - } - } - } - } - }, - "parameters": { - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "type": "string", - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - } - } + "version": "v1" } diff --git a/etc/api/plus/v1/crates/1.0.6-api+20170828 b/etc/api/plus/v1/crates/1.0.6-api+20170828 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/plus/v1/crates/1.0.6-cli+20170828 b/etc/api/plus/v1/crates/1.0.6-cli+20170828 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/plus/v1/plus-api.json b/etc/api/plus/v1/plus-api.json index bd026e89c0..13f4eb82ce 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/kNuG-iOwAwwZbZ2LOdsW4iZeeSo\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/e5EzALeRN0V4G9pDZ9NMnYZoVEo\"", "discoveryVersion": "v1", "id": "plus:v1", "name": "plus", "version": "v1", - "revision": "20170410", + "revision": "20170828", "title": "Google+ API", "description": "Builds on top of the Google+ platform.", "ownerDomain": "google.com", diff --git a/etc/api/plusdomains/v1/crates/1.0.6-api+20170828 b/etc/api/plusdomains/v1/crates/1.0.6-api+20170828 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/plusdomains/v1/crates/1.0.6-cli+20170828 b/etc/api/plusdomains/v1/crates/1.0.6-cli+20170828 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/plusdomains/v1/plusdomains-api.json b/etc/api/plusdomains/v1/plusdomains-api.json index 10e342cb3a..2ff097a310 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/nRr68spNLglqnTLvRRGTS20kwyQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/mgTNhRz8BUIUTZvlG4NGzgfWt2o\"", "discoveryVersion": "v1", "id": "plusDomains:v1", "name": "plusDomains", "version": "v1", - "revision": "20170410", + "revision": "20170828", "title": "Google+ Domains API", "description": "Builds on top of the Google+ platform for Google Apps Domains.", "ownerDomain": "google.com", diff --git a/etc/api/prediction/v1.2/prediction-api.json b/etc/api/prediction/v1.2/prediction-api.json index c7d3b78c31..59a01d1969 100644 --- a/etc/api/prediction/v1.2/prediction-api.json +++ b/etc/api/prediction/v1.2/prediction-api.json @@ -20,7 +20,7 @@ "basePath": "/prediction/v1.2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "prediction/v1.2/", - "batchPath": "batch", + "batchPath": "batch/prediction/v1.2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/prediction/v1.3/prediction-api.json b/etc/api/prediction/v1.3/prediction-api.json index 465e6bd6af..0177d1d04a 100644 --- a/etc/api/prediction/v1.3/prediction-api.json +++ b/etc/api/prediction/v1.3/prediction-api.json @@ -20,7 +20,7 @@ "basePath": "/prediction/v1.3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "prediction/v1.3/", - "batchPath": "batch", + "batchPath": "batch/prediction/v1.3", "parameters": { "alt": { "type": "string", diff --git a/etc/api/prediction/v1.4/prediction-api.json b/etc/api/prediction/v1.4/prediction-api.json index 9d73050435..9a42e15591 100644 --- a/etc/api/prediction/v1.4/prediction-api.json +++ b/etc/api/prediction/v1.4/prediction-api.json @@ -20,7 +20,7 @@ "basePath": "/prediction/v1.4/", "rootUrl": "https://www.googleapis.com/", "servicePath": "prediction/v1.4/", - "batchPath": "batch", + "batchPath": "batch/prediction/v1.4", "parameters": { "alt": { "type": "string", diff --git a/etc/api/prediction/v1.5/prediction-api.json b/etc/api/prediction/v1.5/prediction-api.json index 48e48bdedd..5bf3e8bfb1 100644 --- a/etc/api/prediction/v1.5/prediction-api.json +++ b/etc/api/prediction/v1.5/prediction-api.json @@ -20,7 +20,7 @@ "basePath": "/prediction/v1.5/", "rootUrl": "https://www.googleapis.com/", "servicePath": "prediction/v1.5/", - "batchPath": "batch", + "batchPath": "batch/prediction/v1.5", "parameters": { "alt": { "type": "string", diff --git a/etc/api/prediction/v1.6/prediction-api.json b/etc/api/prediction/v1.6/prediction-api.json index d11b6f7bc4..00012fabca 100644 --- a/etc/api/prediction/v1.6/prediction-api.json +++ b/etc/api/prediction/v1.6/prediction-api.json @@ -20,7 +20,7 @@ "basePath": "/prediction/v1.6/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "prediction/v1.6/projects/", - "batchPath": "batch", + "batchPath": "batch/prediction/v1.6", "parameters": { "alt": { "type": "string", diff --git a/etc/api/proximitybeacon/v1beta1/crates/1.0.6-api+20170913 b/etc/api/proximitybeacon/v1beta1/crates/1.0.6-api+20170913 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/proximitybeacon/v1beta1/crates/1.0.6-cli+20170913 b/etc/api/proximitybeacon/v1beta1/crates/1.0.6-cli+20170913 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json b/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json index 237c45c4fa..22d2f138a6 100644 --- a/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json +++ b/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json @@ -1,94 +1,8 @@ { - "rootUrl": "https://proximitybeacon.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "proximitybeacon", - "batchPath": "batch", - "revision": "20170517", - "documentationLink": "https://developers.google.com/beacons/proximity/", - "id": "proximitybeacon:v1beta1", - "title": "Google Proximity Beacon API", - "discoveryVersion": "v1", "ownerName": "Google", - "version_module": "True", + "discoveryVersion": "v1", + "version_module": true, "resources": { - "beaconinfo": { - "methods": { - "getforobserved": { - "path": "v1beta1/beaconinfo:getforobserved", - "id": "proximitybeacon.beaconinfo.getforobserved", - "request": { - "$ref": "GetInfoForObservedBeaconsRequest" - }, - "description": "Given one or more beacon observations, returns any beacon information\nand attachments accessible to your application. Authorize by using the\n[API key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key)\nfor the application.", - "response": { - "$ref": "GetInfoForObservedBeaconsResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "flatPath": "v1beta1/beaconinfo:getforobserved" - } - } - }, - "namespaces": { - "methods": { - "list": { - "response": { - "$ref": "ListNamespacesResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "projectId": { - "location": "query", - "description": "The project id to list namespaces under.\nOptional.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "flatPath": "v1beta1/namespaces", - "path": "v1beta1/namespaces", - "id": "proximitybeacon.namespaces.list", - "description": "Lists all attachment namespaces owned by your Google Developers Console\nproject. Attachment data associated with a beacon must include a\nnamespaced type, and the namespace must be owned by your project.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project." - }, - "update": { - "httpMethod": "PUT", - "parameterOrder": [ - "namespaceName" - ], - "response": { - "$ref": "Namespace" - }, - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "parameters": { - "namespaceName": { - "description": "Resource name of this namespace. Namespaces names have the format:\n\u003ccode\u003enamespaces/\u003cvar\u003enamespace\u003c/var\u003e\u003c/code\u003e.", - "required": true, - "type": "string", - "pattern": "^namespaces/[^/]+$", - "location": "path" - }, - "projectId": { - "location": "query", - "description": "The project id of the namespace to update. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", - "type": "string" - } - }, - "flatPath": "v1beta1/namespaces/{namespacesId}", - "id": "proximitybeacon.namespaces.update", - "path": "v1beta1/{+namespaceName}", - "description": "Updates the information about the specified namespace. Only the namespace\nvisibility can be updated.", - "request": { - "$ref": "Namespace" - } - } - } - }, "v1beta1": { "methods": { "getEidparams": { @@ -97,22 +11,79 @@ "$ref": "EphemeralIdRegistrationParams" }, "parameterOrder": [], + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "parameters": {}, "flatPath": "v1beta1/eidparams", - "id": "proximitybeacon.getEidparams", "path": "v1beta1/eidparams", + "id": "proximitybeacon.getEidparams", "description": "Gets the Proximity Beacon API's current public key and associated\nparameters used to initiate the Diffie-Hellman key exchange required to\nregister a beacon that broadcasts the Eddystone-EID format. This key\nchanges periodically; clients may cache it and re-use the same public key\nto provision and register multiple beacons. However, clients should be\nprepared to refresh this key when they encounter an error registering an\nEddystone-EID beacon." } } }, "beacons": { "resources": { + "diagnostics": { + "methods": { + "list": { + "description": "List the diagnostics for a single beacon. You can also list diagnostics for\nall the beacons owned by your Google Developers Console project by using\nthe beacon name `beacons/-`.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project.", + "response": { + "$ref": "ListDiagnosticsResponse" + }, + "parameterOrder": [ + "beaconName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "parameters": { + "beaconName": { + "description": "Beacon that the diagnostics are for.", + "type": "string", + "required": true, + "pattern": "^beacons/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "Requests results that occur after the `page_token`, obtained from the\nresponse to a previous request. Optional.", + "type": "string", + "location": "query" + }, + "alertFilter": { + "location": "query", + "enum": [ + "ALERT_UNSPECIFIED", + "WRONG_LOCATION", + "LOW_BATTERY" + ], + "description": "Requests only beacons that have the given alert. For example, to find\nbeacons that have low batteries use `alert_filter=LOW_BATTERY`.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Specifies the maximum number of results to return. Defaults to\n10. Maximum 1000. Optional.", + "type": "integer" + }, + "projectId": { + "location": "query", + "description": "Requests only diagnostic records for the given project id. If not set,\nthen the project making the request will be used for looking up\ndiagnostic records. Optional.", + "type": "string" + } + }, + "flatPath": "v1beta1/beacons/{beaconsId}/diagnostics", + "id": "proximitybeacon.beacons.diagnostics.list", + "path": "v1beta1/{+beaconName}/diagnostics" + } + } + }, "attachments": { "methods": { "delete": { + "id": "proximitybeacon.beacons.attachments.delete", + "path": "v1beta1/{+attachmentName}", "description": "Deletes the specified attachment for the given beacon. Each attachment has\na unique attachment name (`attachmentName`) which is returned when you\nfetch the attachment data via this API. You specify this with the delete\nrequest to control which attachment is removed. This operation cannot be\nundone.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", "response": { "$ref": "Empty" @@ -121,26 +92,24 @@ "attachmentName" ], "httpMethod": "DELETE", + "parameters": { + "attachmentName": { + "description": "The attachment name (`attachmentName`) of\nthe attachment to remove. For example:\n`beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For\nEddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the\nbeacon's current EID, or its \"stable\" Eddystone-UID.\nRequired.", + "type": "string", + "required": true, + "pattern": "^beacons/[^/]+/attachments/[^/]+$", + "location": "path" + }, + "projectId": { + "description": "The project id of the attachment to delete. If not provided, the project\nthat is making the request is used.\nOptional.", + "type": "string", + "location": "query" + } + }, "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "parameters": { - "attachmentName": { - "pattern": "^beacons/[^/]+/attachments/[^/]+$", - "location": "path", - "description": "The attachment name (`attachmentName`) of\nthe attachment to remove. For example:\n`beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For\nEddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the\nbeacon's current EID, or its \"stable\" Eddystone-UID.\nRequired.", - "required": true, - "type": "string" - }, - "projectId": { - "location": "query", - "description": "The project id of the attachment to delete. If not provided, the project\nthat is making the request is used.\nOptional.", - "type": "string" - } - }, - "flatPath": "v1beta1/beacons/{beaconsId}/attachments/{attachmentsId}", - "path": "v1beta1/{+attachmentName}", - "id": "proximitybeacon.beacons.attachments.delete" + "flatPath": "v1beta1/beacons/{beaconsId}/attachments/{attachmentsId}" }, "list": { "response": { @@ -151,15 +120,10 @@ ], "httpMethod": "GET", "parameters": { - "namespacedType": { - "location": "query", - "description": "Specifies the namespace and type of attachment to include in response in\n\u003cvar\u003enamespace/type\u003c/var\u003e format. Accepts `*/*` to specify\n\"all types in all namespaces\".", - "type": "string" - }, "beaconName": { "description": "Beacon whose attachments should be fetched. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, "type": "string", + "required": true, "pattern": "^beacons/[^/]+$", "location": "path" }, @@ -167,48 +131,20 @@ "location": "query", "description": "The project id to list beacon attachments under. This field can be\nused when \"*\" is specified to mean all attachment namespaces. Projects\nmay have multiple attachments with multiple namespaces. If \"*\" is\nspecified and the projectId string is empty, then the project\nmaking the request is used.\nOptional.", "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "flatPath": "v1beta1/beacons/{beaconsId}/attachments", - "path": "v1beta1/{+beaconName}/attachments", - "id": "proximitybeacon.beacons.attachments.list", - "description": "Returns the attachments for the specified beacon that match the specified\nnamespaced-type pattern.\n\nTo control which namespaced types are returned, you add the\n`namespacedType` query parameter to the request. You must either use\n`*/*`, to return all attachments, or the namespace must be one of\nthe ones returned from the `namespaces` endpoint.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project." - }, - "create": { - "response": { - "$ref": "BeaconAttachment" - }, - "parameterOrder": [ - "beaconName" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "parameters": { - "beaconName": { - "pattern": "^beacons/[^/]+$", - "location": "path", - "description": "Beacon on which the attachment should be created. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, - "type": "string" }, - "projectId": { - "description": "The project id of the project the attachment will belong to. If\nthe project id is not specified then the project making the request\nis used.\nOptional.", - "type": "string", - "location": "query" + "namespacedType": { + "location": "query", + "description": "Specifies the namespace and type of attachment to include in response in\n\u003cvar\u003enamespace/type\u003c/var\u003e format. Accepts `*/*` to specify\n\"all types in all namespaces\".", + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], "flatPath": "v1beta1/beacons/{beaconsId}/attachments", + "id": "proximitybeacon.beacons.attachments.list", "path": "v1beta1/{+beaconName}/attachments", - "id": "proximitybeacon.beacons.attachments.create", - "description": "Associates the given data with the specified beacon. Attachment data must\ncontain two parts:\n\u003cul\u003e\n\u003cli\u003eA namespaced type.\u003c/li\u003e\n\u003cli\u003eThe actual attachment data itself.\u003c/li\u003e\n\u003c/ul\u003e\nThe namespaced type consists of two parts, the namespace and the type.\nThe namespace must be one of the values returned by the `namespaces`\nendpoint, while the type can be a string of any characters except for the\nforward slash (`/`) up to 100 characters in length.\n\nAttachment data can be up to 1024 bytes long.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", - "request": { - "$ref": "BeaconAttachment" - } + "description": "Returns the attachments for the specified beacon that match the specified\nnamespaced-type pattern.\n\nTo control which namespaced types are returned, you add the\n`namespacedType` query parameter to the request. You must either use\n`*/*`, to return all attachments, or the namespace must be one of\nthe ones returned from the `namespaces` endpoint.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project." }, "batchDelete": { "response": { @@ -218,13 +154,16 @@ "beaconName" ], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], "parameters": { "beaconName": { - "description": "The beacon whose attachments should be deleted. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, - "type": "string", "pattern": "^beacons/[^/]+$", - "location": "path" + "location": "path", + "description": "The beacon whose attachments should be deleted. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", + "type": "string", + "required": true }, "projectId": { "location": "query", @@ -232,78 +171,113 @@ "type": "string" }, "namespacedType": { - "location": "query", "description": "Specifies the namespace and type of attachments to delete in\n`namespace/type` format. Accepts `*/*` to specify\n\"all types in all namespaces\".\nOptional.", - "type": "string" + "type": "string", + "location": "query" } }, - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], "flatPath": "v1beta1/beacons/{beaconsId}/attachments:batchDelete", - "path": "v1beta1/{+beaconName}/attachments:batchDelete", "id": "proximitybeacon.beacons.attachments.batchDelete", + "path": "v1beta1/{+beaconName}/attachments:batchDelete", "description": "Deletes multiple attachments on a given beacon. This operation is\npermanent and cannot be undone.\n\nYou can optionally specify `namespacedType` to choose which attachments\nshould be deleted. If you do not specify `namespacedType`, all your\nattachments on the given beacon will be deleted. You also may explicitly\nspecify `*/*` to delete all.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project." - } - } - }, - "diagnostics": { - "methods": { - "list": { - "response": { - "$ref": "ListDiagnosticsResponse" - }, + }, + "create": { + "httpMethod": "POST", "parameterOrder": [ "beaconName" ], - "httpMethod": "GET", + "response": { + "$ref": "BeaconAttachment" + }, "parameters": { "beaconName": { "pattern": "^beacons/[^/]+$", "location": "path", - "description": "Beacon that the diagnostics are for.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "Requests results that occur after the `page_token`, obtained from the\nresponse to a previous request. Optional.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Specifies the maximum number of results to return. Defaults to\n10. Maximum 1000. Optional.", - "format": "int32", - "type": "integer" - }, - "alertFilter": { - "enum": [ - "ALERT_UNSPECIFIED", - "WRONG_LOCATION", - "LOW_BATTERY" - ], - "description": "Requests only beacons that have the given alert. For example, to find\nbeacons that have low batteries use `alert_filter=LOW_BATTERY`.", + "description": "Beacon on which the attachment should be created. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", "type": "string", - "location": "query" + "required": true }, "projectId": { - "description": "Requests only diagnostic records for the given project id. If not set,\nthen the project making the request will be used for looking up\ndiagnostic records. Optional.", - "type": "string", - "location": "query" + "location": "query", + "description": "The project id of the project the attachment will belong to. If\nthe project id is not specified then the project making the request\nis used.\nOptional.", + "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "flatPath": "v1beta1/beacons/{beaconsId}/diagnostics", - "path": "v1beta1/{+beaconName}/diagnostics", - "id": "proximitybeacon.beacons.diagnostics.list", - "description": "List the diagnostics for a single beacon. You can also list diagnostics for\nall the beacons owned by your Google Developers Console project by using\nthe beacon name `beacons/-`.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project." + "flatPath": "v1beta1/beacons/{beaconsId}/attachments", + "path": "v1beta1/{+beaconName}/attachments", + "id": "proximitybeacon.beacons.attachments.create", + "description": "Associates the given data with the specified beacon. Attachment data must\ncontain two parts:\n\u003cul\u003e\n\u003cli\u003eA namespaced type.\u003c/li\u003e\n\u003cli\u003eThe actual attachment data itself.\u003c/li\u003e\n\u003c/ul\u003e\nThe namespaced type consists of two parts, the namespace and the type.\nThe namespace must be one of the values returned by the `namespaces`\nendpoint, while the type can be a string of any characters except for the\nforward slash (`/`) up to 100 characters in length.\n\nAttachment data can be up to 1024 bytes long.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", + "request": { + "$ref": "BeaconAttachment" + } } } } }, "methods": { + "activate": { + "path": "v1beta1/{+beaconName}:activate", + "id": "proximitybeacon.beacons.activate", + "description": "Activates a beacon. A beacon that is active will return information\nand attachment data when queried via `beaconinfo.getforobserved`.\nCalling this method on an already active beacon will do nothing (but\nwill return a successful response code).\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", + "httpMethod": "POST", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "beaconName" + ], + "parameters": { + "beaconName": { + "pattern": "^beacons/[^/]+$", + "location": "path", + "description": "Beacon that should be activated. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", + "type": "string", + "required": true + }, + "projectId": { + "location": "query", + "description": "The project id of the beacon to activate. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "flatPath": "v1beta1/beacons/{beaconsId}:activate" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Beacon" + }, + "parameterOrder": [ + "beaconName" + ], + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "parameters": { + "beaconName": { + "description": "Resource name of this beacon. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", + "type": "string", + "required": true, + "pattern": "^beacons/[^/]+$", + "location": "path" + }, + "projectId": { + "location": "query", + "description": "The project id of the beacon to request. If the project id is not specified\nthen the project making the request is used. The project id must match the\nproject that owns the beacon.\nOptional.", + "type": "string" + } + }, + "flatPath": "v1beta1/beacons/{beaconsId}", + "path": "v1beta1/{+beaconName}", + "id": "proximitybeacon.beacons.get", + "description": "Returns detailed information about the specified beacon.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project.\n\nRequests may supply an Eddystone-EID beacon name in the form:\n`beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID\nbroadcast by the beacon. The returned `Beacon` object will contain the\nbeacon's stable Eddystone-UID. Clients not authorized to resolve the\nbeacon's ephemeral Eddystone-EID broadcast will receive an error." + }, "update": { "response": { "$ref": "Beacon" @@ -318,26 +292,29 @@ "parameters": { "beaconName": { "description": "Resource name of this beacon. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon.\n\nThis field must be left empty when registering. After reading a beacon,\nclients can use the name for future operations.", - "required": true, "type": "string", + "required": true, "pattern": "^beacons/[^/]+$", "location": "path" }, "projectId": { - "location": "query", "description": "The project id of the beacon to update. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", - "type": "string" + "type": "string", + "location": "query" } }, "flatPath": "v1beta1/beacons/{beaconsId}", - "path": "v1beta1/{+beaconName}", "id": "proximitybeacon.beacons.update", - "description": "Updates the information about the specified beacon. **Any field that you do\nnot populate in the submitted beacon will be permanently erased**, so you\nshould follow the \"read, modify, write\" pattern to avoid inadvertently\ndestroying data.\n\nChanges to the beacon status via this method will be silently ignored.\nTo update beacon status, use the separate methods on this API for\nactivation, deactivation, and decommissioning.\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", + "path": "v1beta1/{+beaconName}", "request": { "$ref": "Beacon" - } + }, + "description": "Updates the information about the specified beacon. **Any field that you do\nnot populate in the submitted beacon will be permanently erased**, so you\nshould follow the \"read, modify, write\" pattern to avoid inadvertently\ndestroying data.\n\nChanges to the beacon status via this method will be silently ignored.\nTo update beacon status, use the separate methods on this API for\nactivation, deactivation, and decommissioning.\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project." }, "decommission": { + "path": "v1beta1/{+beaconName}:decommission", + "id": "proximitybeacon.beacons.decommission", + "description": "Decommissions the specified beacon in the service. This beacon will no\nlonger be returned from `beaconinfo.getforobserved`. This operation is\npermanent -- you will not be able to re-register a beacon with this ID\nagain.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", "httpMethod": "POST", "response": { "$ref": "Empty" @@ -345,14 +322,11 @@ "parameterOrder": [ "beaconName" ], - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], "parameters": { "beaconName": { "description": "Beacon that should be decommissioned. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID of the beacon's \"stable\" UID.\nRequired.", - "required": true, "type": "string", + "required": true, "pattern": "^beacons/[^/]+$", "location": "path" }, @@ -362,78 +336,72 @@ "type": "string" } }, - "flatPath": "v1beta1/beacons/{beaconsId}:decommission", - "id": "proximitybeacon.beacons.decommission", - "path": "v1beta1/{+beaconName}:decommission", - "description": "Decommissions the specified beacon in the service. This beacon will no\nlonger be returned from `beaconinfo.getforobserved`. This operation is\npermanent -- you will not be able to re-register a beacon with this ID\nagain.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project." - }, - "delete": { - "id": "proximitybeacon.beacons.delete", - "path": "v1beta1/{+beaconName}", - "description": "Deletes the specified beacon including all diagnostics data for the beacon\nas well as any attachments on the beacon (including those belonging to\nother projects). This operation cannot be undone.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "beaconName" - ], "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "parameters": { - "beaconName": { - "description": "Beacon that should be deleted. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, - "type": "string", - "pattern": "^beacons/[^/]+$", - "location": "path" - }, - "projectId": { - "description": "The project id of the beacon to delete. If not provided, the project\nthat is making the request is used.\nOptional.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1beta1/beacons/{beaconsId}" + "flatPath": "v1beta1/beacons/{beaconsId}:decommission" }, - "deactivate": { - "description": "Deactivates a beacon. Once deactivated, the API will not return\ninformation nor attachment data for the beacon when queried via\n`beaconinfo.getforobserved`. Calling this method on an already inactive\nbeacon will do nothing (but will return a successful response code).\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", - "httpMethod": "POST", + "delete": { + "description": "Deletes the specified beacon including all diagnostics data for the beacon\nas well as any attachments on the beacon (including those belonging to\nother projects). This operation cannot be undone.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", "response": { "$ref": "Empty" }, "parameterOrder": [ "beaconName" ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], "parameters": { "beaconName": { "pattern": "^beacons/[^/]+$", "location": "path", - "description": "Beacon that should be deactivated. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, - "type": "string" + "description": "Beacon that should be deleted. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", + "type": "string", + "required": true }, "projectId": { - "description": "The project id of the beacon to deactivate. If the project id is not\nspecified then the project making the request is used. The project id must\nmatch the project that owns the beacon.\nOptional.", + "location": "query", + "description": "The project id of the beacon to delete. If not provided, the project\nthat is making the request is used.\nOptional.", + "type": "string" + } + }, + "flatPath": "v1beta1/beacons/{beaconsId}", + "id": "proximitybeacon.beacons.delete", + "path": "v1beta1/{+beaconName}" + }, + "deactivate": { + "id": "proximitybeacon.beacons.deactivate", + "path": "v1beta1/{+beaconName}:deactivate", + "description": "Deactivates a beacon. Once deactivated, the API will not return\ninformation nor attachment data for the beacon when queried via\n`beaconinfo.getforobserved`. Calling this method on an already inactive\nbeacon will do nothing (but will return a successful response code).\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "beaconName" + ], + "httpMethod": "POST", + "parameters": { + "beaconName": { + "description": "Beacon that should be deactivated. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", "type": "string", - "location": "query" + "required": true, + "pattern": "^beacons/[^/]+$", + "location": "path" + }, + "projectId": { + "location": "query", + "description": "The project id of the beacon to deactivate. If the project id is not\nspecified then the project making the request is used. The project id must\nmatch the project that owns the beacon.\nOptional.", + "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "flatPath": "v1beta1/beacons/{beaconsId}:deactivate", - "id": "proximitybeacon.beacons.deactivate", - "path": "v1beta1/{+beaconName}:deactivate" + "flatPath": "v1beta1/beacons/{beaconsId}:deactivate" }, "register": { - "path": "v1beta1/beacons:register", - "id": "proximitybeacon.beacons.register", - "description": "Registers a previously unregistered beacon given its `advertisedId`.\nThese IDs are unique within the system. An ID can be registered only once.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project.", - "request": { - "$ref": "Beacon" - }, "response": { "$ref": "Beacon" }, @@ -444,68 +412,88 @@ ], "parameters": { "projectId": { - "location": "query", "description": "The project id of the project the beacon will be registered to. If\nthe project id is not specified then the project making the request\nis used.\nOptional.", - "type": "string" + "type": "string", + "location": "query" } }, - "flatPath": "v1beta1/beacons:register" + "flatPath": "v1beta1/beacons:register", + "id": "proximitybeacon.beacons.register", + "path": "v1beta1/beacons:register", + "request": { + "$ref": "Beacon" + }, + "description": "Registers a previously unregistered beacon given its `advertisedId`.\nThese IDs are unique within the system. An ID can be registered only once.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project." }, "list": { "id": "proximitybeacon.beacons.list", "path": "v1beta1/beacons", "description": "Searches the beacon registry for beacons that match the given search\ncriteria. Only those beacons that the client has permission to list\nwill be returned.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project.", - "httpMethod": "GET", "response": { "$ref": "ListBeaconsResponse" }, "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], + "httpMethod": "GET", "parameters": { "pageToken": { - "description": "A pagination token obtained from a previous request to list beacons.", - "type": "string", - "location": "query" - }, - "q": { "location": "query", - "description": "Filter query string that supports the following field filters:\n\n* **description:`\"\u003cstring\u003e\"`**\n For example: **description:\"Room 3\"**\n Returns beacons whose description matches tokens in the string \"Room 3\"\n (not necessarily that exact string).\n The string must be double-quoted.\n* **status:`\u003cenum\u003e`**\n For example: **status:active**\n Returns beacons whose status matches the given value. Values must be\n one of the Beacon.Status enum values (case insensitive). Accepts\n multiple filters which will be combined with OR logic.\n* **stability:`\u003cenum\u003e`**\n For example: **stability:mobile**\n Returns beacons whose expected stability matches the given value.\n Values must be one of the Beacon.Stability enum values (case\n insensitive). Accepts multiple filters which will be combined with\n OR logic.\n* **place\\_id:`\"\u003cstring\u003e\"`**\n For example: **place\\_id:\"ChIJVSZzVR8FdkgRXGmmm6SslKw=\"**\n Returns beacons explicitly registered at the given place, expressed as\n a Place ID obtained from [Google Places API](/places/place-id). Does not\n match places inside the given place. Does not consider the beacon's\n actual location (which may be different from its registered place).\n Accepts multiple filters that will be combined with OR logic. The place\n ID must be double-quoted.\n* **registration\\_time`[\u003c|\u003e|\u003c=|\u003e=]\u003cinteger\u003e`**\n For example: **registration\\_time\u003e=1433116800**\n Returns beacons whose registration time matches the given filter.\n Supports the operators: \u003c, \u003e, \u003c=, and \u003e=. Timestamp must be expressed as\n an integer number of seconds since midnight January 1, 1970 UTC. Accepts\n at most two filters that will be combined with AND logic, to support\n \"between\" semantics. If more than two are supplied, the latter ones are\n ignored.\n* **lat:`\u003cdouble\u003e lng:\u003cdouble\u003e radius:\u003cinteger\u003e`**\n For example: **lat:51.1232343 lng:-1.093852 radius:1000**\n Returns beacons whose registered location is within the given circle.\n When any of these fields are given, all are required. Latitude and\n longitude must be decimal degrees between -90.0 and 90.0 and between\n -180.0 and 180.0 respectively. Radius must be an integer number of\n meters between 10 and 1,000,000 (1000 km).\n* **property:`\"\u003cstring\u003e=\u003cstring\u003e\"`**\n For example: **property:\"battery-type=CR2032\"**\n Returns beacons which have a property of the given name and value.\n Supports multiple filters which will be combined with OR logic.\n The entire name=value string must be double-quoted as one string.\n* **attachment\\_type:`\"\u003cstring\u003e\"`**\n For example: **attachment_type:\"my-namespace/my-type\"**\n Returns beacons having at least one attachment of the given namespaced\n type. Supports \"any within this namespace\" via the partial wildcard\n syntax: \"my-namespace/*\". Supports multiple filters which will be\n combined with OR logic. The string must be double-quoted.\n* **indoor\\_level:`\"\u003cstring\u003e\"`**\n For example: **indoor\\_level:\"1\"**\n Returns beacons which are located on the given indoor level. Accepts\n multiple filters that will be combined with OR logic.\n\nMultiple filters on the same field are combined with OR logic (except\nregistration_time which is combined with AND logic).\nMultiple filters on different fields are combined with AND logic.\nFilters should be separated by spaces.\n\nAs with any HTTP query string parameter, the whole filter expression must\nbe URL-encoded.\n\nExample REST request:\n`GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000`", + "description": "A pagination token obtained from a previous request to list beacons.", "type": "string" }, "pageSize": { - "description": "The maximum number of records to return for this request, up to a\nserver-defined upper limit.", "format": "int32", + "description": "The maximum number of records to return for this request, up to a\nserver-defined upper limit.", "type": "integer", "location": "query" }, + "q": { + "description": "Filter query string that supports the following field filters:\n\n* **description:`\"\u003cstring\u003e\"`**\n For example: **description:\"Room 3\"**\n Returns beacons whose description matches tokens in the string \"Room 3\"\n (not necessarily that exact string).\n The string must be double-quoted.\n* **status:`\u003cenum\u003e`**\n For example: **status:active**\n Returns beacons whose status matches the given value. Values must be\n one of the Beacon.Status enum values (case insensitive). Accepts\n multiple filters which will be combined with OR logic.\n* **stability:`\u003cenum\u003e`**\n For example: **stability:mobile**\n Returns beacons whose expected stability matches the given value.\n Values must be one of the Beacon.Stability enum values (case\n insensitive). Accepts multiple filters which will be combined with\n OR logic.\n* **place\\_id:`\"\u003cstring\u003e\"`**\n For example: **place\\_id:\"ChIJVSZzVR8FdkgRXGmmm6SslKw=\"**\n Returns beacons explicitly registered at the given place, expressed as\n a Place ID obtained from [Google Places API](/places/place-id). Does not\n match places inside the given place. Does not consider the beacon's\n actual location (which may be different from its registered place).\n Accepts multiple filters that will be combined with OR logic. The place\n ID must be double-quoted.\n* **registration\\_time`[\u003c|\u003e|\u003c=|\u003e=]\u003cinteger\u003e`**\n For example: **registration\\_time\u003e=1433116800**\n Returns beacons whose registration time matches the given filter.\n Supports the operators: \u003c, \u003e, \u003c=, and \u003e=. Timestamp must be expressed as\n an integer number of seconds since midnight January 1, 1970 UTC. Accepts\n at most two filters that will be combined with AND logic, to support\n \"between\" semantics. If more than two are supplied, the latter ones are\n ignored.\n* **lat:`\u003cdouble\u003e lng:\u003cdouble\u003e radius:\u003cinteger\u003e`**\n For example: **lat:51.1232343 lng:-1.093852 radius:1000**\n Returns beacons whose registered location is within the given circle.\n When any of these fields are given, all are required. Latitude and\n longitude must be decimal degrees between -90.0 and 90.0 and between\n -180.0 and 180.0 respectively. Radius must be an integer number of\n meters between 10 and 1,000,000 (1000 km).\n* **property:`\"\u003cstring\u003e=\u003cstring\u003e\"`**\n For example: **property:\"battery-type=CR2032\"**\n Returns beacons which have a property of the given name and value.\n Supports multiple filters which will be combined with OR logic.\n The entire name=value string must be double-quoted as one string.\n* **attachment\\_type:`\"\u003cstring\u003e\"`**\n For example: **attachment_type:\"my-namespace/my-type\"**\n Returns beacons having at least one attachment of the given namespaced\n type. Supports \"any within this namespace\" via the partial wildcard\n syntax: \"my-namespace/*\". Supports multiple filters which will be\n combined with OR logic. The string must be double-quoted.\n* **indoor\\_level:`\"\u003cstring\u003e\"`**\n For example: **indoor\\_level:\"1\"**\n Returns beacons which are located on the given indoor level. Accepts\n multiple filters that will be combined with OR logic.\n\nMultiple filters on the same field are combined with OR logic (except\nregistration_time which is combined with AND logic).\nMultiple filters on different fields are combined with AND logic.\nFilters should be separated by spaces.\n\nAs with any HTTP query string parameter, the whole filter expression must\nbe URL-encoded.\n\nExample REST request:\n`GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000`", + "type": "string", + "location": "query" + }, "projectId": { - "location": "query", "description": "The project id to list beacons under. If not present then the project\ncredential that made the request is used as the project.\nOptional.", - "type": "string" + "type": "string", + "location": "query" } }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], "flatPath": "v1beta1/beacons" - }, - "activate": { - "parameterOrder": [ - "beaconName" - ], + } + } + }, + "beaconinfo": { + "methods": { + "getforobserved": { + "response": { + "$ref": "GetInfoForObservedBeaconsResponse" + }, + "parameterOrder": [], "httpMethod": "POST", + "parameters": {}, + "flatPath": "v1beta1/beaconinfo:getforobserved", + "id": "proximitybeacon.beaconinfo.getforobserved", + "path": "v1beta1/beaconinfo:getforobserved", + "description": "Given one or more beacon observations, returns any beacon information\nand attachments accessible to your application. Authorize by using the\n[API key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key)\nfor the application.", + "request": { + "$ref": "GetInfoForObservedBeaconsRequest" + } + } + } + }, + "namespaces": { + "methods": { + "list": { + "httpMethod": "GET", "response": { - "$ref": "Empty" + "$ref": "ListNamespacesResponse" }, + "parameterOrder": [], "parameters": { - "beaconName": { - "description": "Beacon that should be activated. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, - "type": "string", - "pattern": "^beacons/[^/]+$", - "location": "path" - }, "projectId": { - "description": "The project id of the beacon to activate. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", + "description": "The project id to list namespaces under.\nOptional.", "type": "string", "location": "query" } @@ -513,94 +501,48 @@ "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "flatPath": "v1beta1/beacons/{beaconsId}:activate", - "path": "v1beta1/{+beaconName}:activate", - "id": "proximitybeacon.beacons.activate", - "description": "Activates a beacon. A beacon that is active will return information\nand attachment data when queried via `beaconinfo.getforobserved`.\nCalling this method on an already active beacon will do nothing (but\nwill return a successful response code).\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **Is owner** or **Can edit** permissions in the\nGoogle Developers Console project." + "flatPath": "v1beta1/namespaces", + "path": "v1beta1/namespaces", + "id": "proximitybeacon.namespaces.list", + "description": "Lists all attachment namespaces owned by your Google Developers Console\nproject. Attachment data associated with a beacon must include a\nnamespaced type, and the namespace must be owned by your project.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project." }, - "get": { - "description": "Returns detailed information about the specified beacon.\n\nAuthenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2)\nfrom a signed-in user with **viewer**, **Is owner** or **Can edit**\npermissions in the Google Developers Console project.\n\nRequests may supply an Eddystone-EID beacon name in the form:\n`beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID\nbroadcast by the beacon. The returned `Beacon` object will contain the\nbeacon's stable Eddystone-UID. Clients not authorized to resolve the\nbeacon's ephemeral Eddystone-EID broadcast will receive an error.", + "update": { "response": { - "$ref": "Beacon" + "$ref": "Namespace" }, "parameterOrder": [ - "beaconName" + "namespaceName" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "httpMethod": "GET", "parameters": { - "beaconName": { - "pattern": "^beacons/[^/]+$", + "namespaceName": { + "pattern": "^namespaces/[^/]+$", "location": "path", - "description": "Resource name of this beacon. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", - "required": true, - "type": "string" + "description": "Resource name of this namespace. Namespaces names have the format:\n\u003ccode\u003enamespaces/\u003cvar\u003enamespace\u003c/var\u003e\u003c/code\u003e.", + "type": "string", + "required": true }, "projectId": { - "description": "The project id of the beacon to request. If the project id is not specified\nthen the project making the request is used. The project id must match the\nproject that owns the beacon.\nOptional.", + "description": "The project id of the namespace to update. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", "type": "string", "location": "query" } }, - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "flatPath": "v1beta1/beacons/{beaconsId}", - "path": "v1beta1/{+beaconName}", - "id": "proximitybeacon.beacons.get" + "flatPath": "v1beta1/namespaces/{namespacesId}", + "id": "proximitybeacon.namespaces.update", + "path": "v1beta1/{+namespaceName}", + "request": { + "$ref": "Namespace" + }, + "description": "Updates the information about the specified namespace. Only the namespace\nvisibility can be updated." } } } }, "parameters": { - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, "alt": { "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -618,9 +560,9 @@ "type": "string" }, "key": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "access_token": { "description": "OAuth access token.", @@ -633,57 +575,264 @@ "type": "string" }, "pp": { + "location": "query", "description": "Pretty-print response.", - "type": "boolean", "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], "location": "query" } }, "schemas": { - "DeleteAttachmentsResponse": { - "description": "Response for a request to delete attachments.", + "BeaconAttachment": { + "description": "Project-specific data associated with a beacon.", "type": "object", "properties": { - "numDeleted": { - "description": "The number of attachments that were deleted.", - "format": "int32", - "type": "integer" + "attachmentName": { + "description": "Resource name of this attachment. Attachment names have the format:\n\u003ccode\u003ebeacons/\u003cvar\u003ebeacon_id\u003c/var\u003e/attachments/\u003cvar\u003eattachment_id\u003c/var\u003e\u003c/code\u003e.\nLeave this empty on creation.", + "type": "string" + }, + "namespacedType": { + "description": "Specifies what kind of attachment this is. Tells a client how to\ninterpret the `data` field. Format is \u003cvar\u003enamespace/type\u003c/var\u003e. Namespace\nprovides type separation between clients. Type describes the type of\n`data`, for use by the client when parsing the `data` field.\nRequired.", + "type": "string" + }, + "data": { + "format": "byte", + "description": "An opaque data container for client-provided data. Must be\n[base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP\nrequests, and will be so encoded (with padding) in responses.\nRequired.", + "type": "string" + }, + "creationTimeMs": { + "format": "google-datetime", + "description": "The UTC time when this attachment was created, in milliseconds since the\nUNIX epoch.", + "type": "string" } }, - "id": "DeleteAttachmentsResponse" + "id": "BeaconAttachment" }, - "EphemeralIdRegistrationParams": { + "EphemeralIdRegistration": { "properties": { - "minRotationPeriodExponent": { - "description": "Indicates the minimum rotation period supported by the service.\nSee EddystoneEidRegistration.rotation_period_exponent", - "format": "uint32", - "type": "integer" - }, - "maxRotationPeriodExponent": { - "description": "Indicates the maximum rotation period supported by the service.\nSee EddystoneEidRegistration.rotation_period_exponent", + "rotationPeriodExponent": { "format": "uint32", + "description": "Indicates the nominal period between each rotation of the beacon's\nephemeral ID. \"Nominal\" because the beacon should randomize the\nactual interval. See [the spec at github](https://github.com/google/eddystone/tree/master/eddystone-eid)\nfor details. This value corresponds to a power-of-two scaler on the\nbeacon's clock: when the scaler value is K, the beacon will begin\nbroadcasting a new ephemeral ID on average every 2^K seconds.", "type": "integer" }, "serviceEcdhPublicKey": { - "description": "The beacon service's public key for use by a beacon to derive its\nIdentity Key using Elliptic Curve Diffie-Hellman key exchange.", "format": "byte", + "description": "The service's public key used for the Elliptic curve Diffie-Hellman\nkey exchange. When this field is populated, `beacon_ecdh_public_key`\nmust also be populated, and `beacon_identity_key` must not be.", + "type": "string" + }, + "beaconIdentityKey": { + "format": "byte", + "description": "The private key of the beacon. If this field is populated,\n`beacon_ecdh_public_key` and `service_ecdh_public_key` must not be\npopulated.", + "type": "string" + }, + "initialEid": { + "format": "byte", + "description": "An initial ephemeral ID calculated using the clock value submitted as\n`initial_clock_value`, and the secret key generated by the\nDiffie-Hellman key exchange using `service_ecdh_public_key` and\n`service_ecdh_public_key`. This initial EID value will be used by the\nservice to confirm that the key exchange process was successful.", + "type": "string" + }, + "initialClockValue": { + "format": "uint64", + "description": "The initial clock value of the beacon. The beacon's clock must have\nbegun counting at this value immediately prior to transmitting this\nvalue to the resolving service. Significant delay in transmitting this\nvalue to the service risks registration or resolution failures. If a\nvalue is not provided, the default is zero.", + "type": "string" + }, + "beaconEcdhPublicKey": { + "format": "byte", + "description": "The beacon's public key used for the Elliptic curve Diffie-Hellman\nkey exchange. When this field is populated, `service_ecdh_public_key`\nmust also be populated, and `beacon_identity_key` must not be.", "type": "string" } }, - "id": "EphemeralIdRegistrationParams", - "description": "Information a client needs to provision and register beacons that\nbroadcast Eddystone-EID format beacon IDs, using Elliptic curve\nDiffie-Hellman key exchange. See\n[the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub.", + "id": "EphemeralIdRegistration", + "description": "Write-only registration parameters for beacons using Eddystone-EID format.\nTwo ways of securely registering an Eddystone-EID beacon with the service\nare supported:\n\n1. Perform an ECDH key exchange via this API, including a previous call\n to `GET /v1beta1/eidparams`. In this case the fields\n `beacon_ecdh_public_key` and `service_ecdh_public_key` should be\n populated and `beacon_identity_key` should not be populated. This\n method ensures that only the two parties in the ECDH key exchange can\n compute the identity key, which becomes a secret between them.\n2. Derive or obtain the beacon's identity key via other secure means\n (perhaps an ECDH key exchange between the beacon and a mobile device\n or any other secure method), and then submit the resulting identity key\n to the service. In this case `beacon_identity_key` field should be\n populated, and neither of `beacon_ecdh_public_key` nor\n `service_ecdh_public_key` fields should be. The security of this method\n depends on how securely the parties involved (in particular the\n bluetooth client) handle the identity key, and obviously on how\n securely the identity key was generated.\n\nSee [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub.", "type": "object" }, + "LatLng": { + "properties": { + "latitude": { + "format": "double", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "type": "number" + }, + "longitude": { + "format": "double", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "type": "number" + } + }, + "id": "LatLng", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "type": "object" + }, + "ListBeaconAttachmentsResponse": { + "properties": { + "attachments": { + "description": "The attachments that corresponded to the request params.", + "items": { + "$ref": "BeaconAttachment" + }, + "type": "array" + } + }, + "id": "ListBeaconAttachmentsResponse", + "description": "Response to `ListBeaconAttachments` that contains the requested attachments.", + "type": "object" + }, + "Namespace": { + "description": "An attachment namespace defines read and write access for all the attachments\ncreated under it. Each namespace is globally unique, and owned by one\nproject which is the only project that can create attachments under it.", + "type": "object", + "properties": { + "servingVisibility": { + "enum": [ + "VISIBILITY_UNSPECIFIED", + "UNLISTED", + "PUBLIC" + ], + "description": "Specifies what clients may receive attachments under this namespace\nvia `beaconinfo.getforobserved`.", + "type": "string", + "enumDescriptions": [ + "Do not use this value.", + "Served only to the project that owns the namespace.", + "Any project can subscribe to attachments under the namespace." + ] + }, + "namespaceName": { + "description": "Resource name of this namespace. Namespaces names have the format:\n\u003ccode\u003enamespaces/\u003cvar\u003enamespace\u003c/var\u003e\u003c/code\u003e.", + "type": "string" + } + }, + "id": "Namespace" + }, + "AttachmentInfo": { + "properties": { + "data": { + "format": "byte", + "description": "An opaque data container for client-provided data.", + "type": "string" + }, + "namespacedType": { + "description": "Specifies what kind of attachment this is. Tells a client how to\ninterpret the `data` field. Format is \u003cvar\u003enamespace/type\u003c/var\u003e, for\nexample \u003ccode\u003escrupulous-wombat-12345/welcome-message\u003c/code\u003e", + "type": "string" + } + }, + "id": "AttachmentInfo", + "description": "A subset of attachment information served via the\n`beaconinfo.getforobserved` method, used when your users encounter your\nbeacons.", + "type": "object" + }, + "BeaconInfo": { + "description": "A subset of beacon information served via the `beaconinfo.getforobserved`\nmethod, which you call when users of your app encounter your beacons.", + "type": "object", + "properties": { + "beaconName": { + "description": "The name under which the beacon is registered.", + "type": "string" + }, + "attachments": { + "description": "Attachments matching the type(s) requested.\nMay be empty if no attachment types were requested.", + "items": { + "$ref": "AttachmentInfo" + }, + "type": "array" + }, + "advertisedId": { + "description": "The ID advertised by the beacon.", + "$ref": "AdvertisedId" + } + }, + "id": "BeaconInfo" + }, + "DeleteAttachmentsResponse": { + "properties": { + "numDeleted": { + "format": "int32", + "description": "The number of attachments that were deleted.", + "type": "integer" + } + }, + "id": "DeleteAttachmentsResponse", + "description": "Response for a request to delete attachments.", + "type": "object" + }, + "EphemeralIdRegistrationParams": { + "description": "Information a client needs to provision and register beacons that\nbroadcast Eddystone-EID format beacon IDs, using Elliptic curve\nDiffie-Hellman key exchange. See\n[the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub.", + "type": "object", + "properties": { + "maxRotationPeriodExponent": { + "format": "uint32", + "description": "Indicates the maximum rotation period supported by the service.\nSee EddystoneEidRegistration.rotation_period_exponent", + "type": "integer" + }, + "minRotationPeriodExponent": { + "format": "uint32", + "description": "Indicates the minimum rotation period supported by the service.\nSee EddystoneEidRegistration.rotation_period_exponent", + "type": "integer" + }, + "serviceEcdhPublicKey": { + "format": "byte", + "description": "The beacon service's public key for use by a beacon to derive its\nIdentity Key using Elliptic Curve Diffie-Hellman key exchange.", + "type": "string" + } + }, + "id": "EphemeralIdRegistrationParams" + }, "Observation": { + "description": "Represents one beacon observed once.", + "type": "object", "properties": { "telemetry": { - "description": "The array of telemetry bytes received from the beacon. The server is\nresponsible for parsing it. This field may frequently be empty, as\nwith a beacon that transmits telemetry only occasionally.", "format": "byte", + "description": "The array of telemetry bytes received from the beacon. The server is\nresponsible for parsing it. This field may frequently be empty, as\nwith a beacon that transmits telemetry only occasionally.", "type": "string" }, "timestampMs": { - "description": "Time when the beacon was observed.", "format": "google-datetime", + "description": "Time when the beacon was observed.", "type": "string" }, "advertisedId": { @@ -691,18 +840,16 @@ "description": "The ID advertised by the beacon the client has encountered.\n\nIf the submitted `advertised_id` type is Eddystone-EID, then the client\nmust be authorized to resolve the given beacon. Otherwise no data will be\nreturned for that beacon.\nRequired." } }, - "id": "Observation", - "description": "Represents one beacon observed once.", - "type": "object" + "id": "Observation" }, "ListDiagnosticsResponse": { "properties": { "diagnostics": { "description": "The diagnostics matching the given request.", - "type": "array", "items": { "$ref": "Diagnostics" - } + }, + "type": "array" }, "nextPageToken": { "description": "Token that can be used for pagination. Returned only if the\nrequest matches more beacons than can be returned in this response.", @@ -714,42 +861,23 @@ "type": "object" }, "GetInfoForObservedBeaconsResponse": { + "description": "Information about the requested beacons, optionally including attachment\ndata.", + "type": "object", "properties": { "beacons": { "description": "Public information about beacons.\nMay be empty if the request matched no beacons.", - "type": "array", "items": { "$ref": "BeaconInfo" - } + }, + "type": "array" } }, - "id": "GetInfoForObservedBeaconsResponse", - "description": "Information about the requested beacons, optionally including attachment\ndata.", - "type": "object" + "id": "GetInfoForObservedBeaconsResponse" }, "Beacon": { + "description": "Details of a beacon device.", + "type": "object", "properties": { - "provisioningKey": { - "description": "Some beacons may require a user to provide an authorization key before\nchanging any of its configuration (e.g. broadcast frames, transmit power).\nThis field provides a place to store and control access to that key.\nThis field is populated in responses to `GET /v1beta1/beacons/3!beaconId`\nfrom users with write access to the given beacon. That is to say: If the\nuser is authorized to write the beacon's confidential data in the service,\nthe service considers them authorized to configure the beacon. Note\nthat this key grants nothing on the service, only on the beacon itself.", - "format": "byte", - "type": "string" - }, - "ephemeralIdRegistration": { - "description": "Write-only registration parameters for beacons using Eddystone-EID\n(remotely resolved ephemeral ID) format. This information will not be\npopulated in API responses. When submitting this data, the `advertised_id`\nfield must contain an ID of type Eddystone-UID. Any other ID type will\nresult in an error.", - "$ref": "EphemeralIdRegistration" - }, - "latLng": { - "description": "The location of the beacon, expressed as a latitude and longitude pair.\nThis location is given when the beacon is registered or updated. It does\nnot necessarily indicate the actual current location of the beacon.\nOptional.", - "$ref": "LatLng" - }, - "placeId": { - "description": "The [Google Places API](/places/place-id) Place ID of the place where\nthe beacon is deployed. This is given when the beacon is registered or\nupdated, not automatically detected in any way.\nOptional.", - "type": "string" - }, - "description": { - "description": "Free text used to identify and describe the beacon. Maximum length 140\ncharacters.\nOptional.", - "type": "string" - }, "properties": { "additionalProperties": { "type": "string" @@ -758,10 +886,16 @@ "type": "object" }, "indoorLevel": { - "description": "The indoor level information for this beacon, if known. As returned by the\nGoogle Maps API.\nOptional.", - "$ref": "IndoorLevel" + "$ref": "IndoorLevel", + "description": "The indoor level information for this beacon, if known. As returned by the\nGoogle Maps API.\nOptional." }, "status": { + "enumDescriptions": [ + "Do not use this value.", + "The \"normal\" in-use state of a beacon.", + "Beacon should no longer be used for any purpose. This is irreversible.", + "The beacon should not be visible to mobile devices. This is reversible." + ], "enum": [ "STATUS_UNSPECIFIED", "ACTIVE", @@ -769,13 +903,7 @@ "INACTIVE" ], "description": "Current status of the beacon.\nRequired.", - "type": "string", - "enumDescriptions": [ - "Do not use this value.", - "The \"normal\" in-use state of a beacon.", - "Beacon should no longer be used for any purpose. This is irreversible.", - "The beacon should not be visible to mobile devices. This is reversible." - ] + "type": "string" }, "beaconName": { "description": "Resource name of this beacon. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon.\n\nThis field must be left empty when registering. After reading a beacon,\nclients can use the name for future operations.", @@ -800,29 +928,38 @@ "type": "string" }, "advertisedId": { - "$ref": "AdvertisedId", - "description": "The identifier of a beacon as advertised by it. This field must be\npopulated when registering. It may be empty when updating a beacon\nrecord because it is ignored in updates.\n\nWhen registering a beacon that broadcasts Eddystone-EID, this field\nshould contain a \"stable\" Eddystone-UID that identifies the beacon and\nlinks it to its attachments. The stable Eddystone-UID is only used for\nadministering the beacon." - } - }, - "id": "Beacon", - "description": "Details of a beacon device.", - "type": "object" - }, - "AdvertisedId": { - "properties": { - "id": { - "description": "The actual beacon identifier, as broadcast by the beacon hardware. Must be\n[base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP\nrequests, and will be so encoded (with padding) in responses. The base64\nencoding should be of the binary byte-stream and not any textual (such as\nhex) representation thereof.\nRequired.", + "description": "The identifier of a beacon as advertised by it. This field must be\npopulated when registering. It may be empty when updating a beacon\nrecord because it is ignored in updates.\n\nWhen registering a beacon that broadcasts Eddystone-EID, this field\nshould contain a \"stable\" Eddystone-UID that identifies the beacon and\nlinks it to its attachments. The stable Eddystone-UID is only used for\nadministering the beacon.", + "$ref": "AdvertisedId" + }, + "provisioningKey": { "format": "byte", + "description": "Some beacons may require a user to provide an authorization key before\nchanging any of its configuration (e.g. broadcast frames, transmit power).\nThis field provides a place to store and control access to that key.\nThis field is populated in responses to `GET /v1beta1/beacons/3!beaconId`\nfrom users with write access to the given beacon. That is to say: If the\nuser is authorized to write the beacon's confidential data in the service,\nthe service considers them authorized to configure the beacon. Note\nthat this key grants nothing on the service, only on the beacon itself.", "type": "string" }, + "ephemeralIdRegistration": { + "$ref": "EphemeralIdRegistration", + "description": "Write-only registration parameters for beacons using Eddystone-EID\n(remotely resolved ephemeral ID) format. This information will not be\npopulated in API responses. When submitting this data, the `advertised_id`\nfield must contain an ID of type Eddystone-UID. Any other ID type will\nresult in an error." + }, + "latLng": { + "description": "The location of the beacon, expressed as a latitude and longitude pair.\nThis location is given when the beacon is registered or updated. It does\nnot necessarily indicate the actual current location of the beacon.\nOptional.", + "$ref": "LatLng" + }, + "placeId": { + "description": "The [Google Places API](/places/place-id) Place ID of the place where\nthe beacon is deployed. This is given when the beacon is registered or\nupdated, not automatically detected in any way.\nOptional.", + "type": "string" + }, + "description": { + "description": "Free text used to identify and describe the beacon. Maximum length 140\ncharacters.\nOptional.", + "type": "string" + } + }, + "id": "Beacon" + }, + "AdvertisedId": { + "description": "Defines a unique identifier of a beacon as broadcast by the device.", + "type": "object", + "properties": { "type": { - "enumDescriptions": [ - "Do not use this value.", - "Eddystone, an open beacon format that supports Android and iOS devices\nhttps://github.com/google/eddystone/wiki/Beacon-Specification", - "Apple iBeacon compatible beacon", - "See http://altbeacon.org and/or https://github.com/AltBeacon/spec.", - "Eddystone Ephemeral ID" - ], "enum": [ "TYPE_UNSPECIFIED", "EDDYSTONE", @@ -831,45 +968,55 @@ "EDDYSTONE_EID" ], "description": "Specifies the identifier type.\nRequired.", + "type": "string", + "enumDescriptions": [ + "Do not use this value.", + "Eddystone, an open beacon format that supports Android and iOS devices\nhttps://github.com/google/eddystone/wiki/Beacon-Specification", + "Apple iBeacon compatible beacon", + "See http://altbeacon.org and/or https://github.com/AltBeacon/spec.", + "Eddystone Ephemeral ID" + ] + }, + "id": { + "format": "byte", + "description": "The actual beacon identifier, as broadcast by the beacon hardware. Must be\n[base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP\nrequests, and will be so encoded (with padding) in responses. The base64\nencoding should be of the binary byte-stream and not any textual (such as\nhex) representation thereof.\nRequired.", "type": "string" } }, - "id": "AdvertisedId", - "description": "Defines a unique identifier of a beacon as broadcast by the device.", - "type": "object" + "id": "AdvertisedId" }, "IndoorLevel": { - "description": "Indoor level, a human-readable string as returned by Google Maps APIs,\nuseful to indicate which floor of a building a beacon is located on.", - "type": "object", "properties": { "name": { "description": "The name of this level.", "type": "string" } }, - "id": "IndoorLevel" + "id": "IndoorLevel", + "description": "Indoor level, a human-readable string as returned by Google Maps APIs,\nuseful to indicate which floor of a building a beacon is located on.", + "type": "object" }, "Date": { + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", + "type": "object", "properties": { - "year": { - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "month": { "format": "int32", + "description": "Month of year. Must be from 1 to 12.", "type": "integer" }, "day": { - "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", "format": "int32", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", "type": "integer" }, - "month": { - "description": "Month of year. Must be from 1 to 12.", + "year": { "format": "int32", + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", "type": "integer" } }, - "id": "Date", - "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", - "type": "object" + "id": "Date" }, "ListNamespacesResponse": { "description": "Response to ListNamespacesRequest that contains all the project's namespaces.", @@ -877,10 +1024,10 @@ "properties": { "namespaces": { "description": "The attachments that corresponded to the request params.", - "type": "array", "items": { "$ref": "Namespace" - } + }, + "type": "array" } }, "id": "ListNamespacesResponse" @@ -893,30 +1040,38 @@ "description": "An opaque pagination token that the client may provide in their next\nrequest to retrieve the next page of results.", "type": "string" }, + "totalCount": { + "format": "int64", + "description": "Estimate of the total number of beacons matched by the query. Higher\nvalues may be less accurate.", + "type": "string" + }, "beacons": { "description": "The beacons that matched the search criteria.", - "type": "array", "items": { "$ref": "Beacon" - } - }, - "totalCount": { - "description": "Estimate of the total number of beacons matched by the query. Higher\nvalues may be less accurate.", - "format": "int64", - "type": "string" + }, + "type": "array" } }, "id": "ListBeaconsResponse" }, "Diagnostics": { "properties": { + "estimatedLowBatteryDate": { + "$ref": "Date", + "description": "The date when the battery is expected to be low. If the value is missing\nthen there is no estimate for when the battery will be low.\nThis value is only an estimate, not an exact date." + }, "beaconName": { "description": "Resource name of the beacon. For Eddystone-EID beacons, this may\nbe the beacon's current EID, or the beacon's \"stable\" Eddystone-UID.", "type": "string" }, "alerts": { + "enumDescriptions": [ + "Invalid value. Should never appear.", + "The beacon has been reported in a location different than its registered\nlocation. This may indicate that the beacon has been moved. This signal\nis not 100% accurate, but indicates that further investigation is worth\nwhile.", + "The battery level for the beacon is low enough that, given the beacon's\ncurrent use, its battery will run out with in the next 60 days. This\nindicates that the battery should be replaced soon." + ], "description": "An unordered list of Alerts that the beacon has.", - "type": "array", "items": { "enum": [ "ALERT_UNSPECIFIED", @@ -925,208 +1080,44 @@ ], "type": "string" }, - "enumDescriptions": [ - "Invalid value. Should never appear.", - "The beacon has been reported in a location different than its registered\nlocation. This may indicate that the beacon has been moved. This signal\nis not 100% accurate, but indicates that further investigation is worth\nwhile.", - "The battery level for the beacon is low enough that, given the beacon's\ncurrent use, its battery will run out with in the next 60 days. This\nindicates that the battery should be replaced soon." - ] - }, - "estimatedLowBatteryDate": { - "$ref": "Date", - "description": "The date when the battery is expected to be low. If the value is missing\nthen there is no estimate for when the battery will be low.\nThis value is only an estimate, not an exact date." + "type": "array" } }, "id": "Diagnostics", "description": "Diagnostics for a single beacon.", "type": "object" }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - }, "GetInfoForObservedBeaconsRequest": { + "description": "Request for beacon and attachment information about beacons that\na mobile client has encountered \"in the wild\".", + "type": "object", "properties": { "observations": { "description": "The beacons that the client has encountered.\nAt least one must be given.", - "type": "array", "items": { "$ref": "Observation" - } + }, + "type": "array" }, "namespacedTypes": { "description": "Specifies what kind of attachments to include in the response.\nWhen given, the response will include only attachments of the given types.\nWhen empty, no attachments will be returned. Must be in the format\n\u003cvar\u003enamespace/type\u003c/var\u003e. Accepts `*` to specify all types in\nall namespaces owned by the client.\nOptional.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "GetInfoForObservedBeaconsRequest", - "description": "Request for beacon and attachment information about beacons that\na mobile client has encountered \"in the wild\".", - "type": "object" + "id": "GetInfoForObservedBeaconsRequest" }, - "BeaconAttachment": { - "description": "Project-specific data associated with a beacon.", - "type": "object", - "properties": { - "attachmentName": { - "description": "Resource name of this attachment. Attachment names have the format:\n\u003ccode\u003ebeacons/\u003cvar\u003ebeacon_id\u003c/var\u003e/attachments/\u003cvar\u003eattachment_id\u003c/var\u003e\u003c/code\u003e.\nLeave this empty on creation.", - "type": "string" - }, - "namespacedType": { - "description": "Specifies what kind of attachment this is. Tells a client how to\ninterpret the `data` field. Format is \u003cvar\u003enamespace/type\u003c/var\u003e. Namespace\nprovides type separation between clients. Type describes the type of\n`data`, for use by the client when parsing the `data` field.\nRequired.", - "type": "string" - }, - "data": { - "description": "An opaque data container for client-provided data. Must be\n[base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP\nrequests, and will be so encoded (with padding) in responses.\nRequired.", - "format": "byte", - "type": "string" - }, - "creationTimeMs": { - "description": "The UTC time when this attachment was created, in milliseconds since the\nUNIX epoch.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "BeaconAttachment" - }, - "EphemeralIdRegistration": { - "properties": { - "beaconEcdhPublicKey": { - "description": "The beacon's public key used for the Elliptic curve Diffie-Hellman\nkey exchange. When this field is populated, `service_ecdh_public_key`\nmust also be populated, and `beacon_identity_key` must not be.", - "format": "byte", - "type": "string" - }, - "initialClockValue": { - "description": "The initial clock value of the beacon. The beacon's clock must have\nbegun counting at this value immediately prior to transmitting this\nvalue to the resolving service. Significant delay in transmitting this\nvalue to the service risks registration or resolution failures. If a\nvalue is not provided, the default is zero.", - "format": "uint64", - "type": "string" - }, - "rotationPeriodExponent": { - "description": "Indicates the nominal period between each rotation of the beacon's\nephemeral ID. \"Nominal\" because the beacon should randomize the\nactual interval. See [the spec at github](https://github.com/google/eddystone/tree/master/eddystone-eid)\nfor details. This value corresponds to a power-of-two scaler on the\nbeacon's clock: when the scaler value is K, the beacon will begin\nbroadcasting a new ephemeral ID on average every 2^K seconds.", - "format": "uint32", - "type": "integer" - }, - "serviceEcdhPublicKey": { - "description": "The service's public key used for the Elliptic curve Diffie-Hellman\nkey exchange. When this field is populated, `beacon_ecdh_public_key`\nmust also be populated, and `beacon_identity_key` must not be.", - "format": "byte", - "type": "string" - }, - "beaconIdentityKey": { - "description": "The private key of the beacon. If this field is populated,\n`beacon_ecdh_public_key` and `service_ecdh_public_key` must not be\npopulated.", - "format": "byte", - "type": "string" - }, - "initialEid": { - "description": "An initial ephemeral ID calculated using the clock value submitted as\n`initial_clock_value`, and the secret key generated by the\nDiffie-Hellman key exchange using `service_ecdh_public_key` and\n`service_ecdh_public_key`. This initial EID value will be used by the\nservice to confirm that the key exchange process was successful.", - "format": "byte", - "type": "string" - } - }, - "id": "EphemeralIdRegistration", - "description": "Write-only registration parameters for beacons using Eddystone-EID format.\nTwo ways of securely registering an Eddystone-EID beacon with the service\nare supported:\n\n1. Perform an ECDH key exchange via this API, including a previous call\n to `GET /v1beta1/eidparams`. In this case the fields\n `beacon_ecdh_public_key` and `service_ecdh_public_key` should be\n populated and `beacon_identity_key` should not be populated. This\n method ensures that only the two parties in the ECDH key exchange can\n compute the identity key, which becomes a secret between them.\n2. Derive or obtain the beacon's identity key via other secure means\n (perhaps an ECDH key exchange between the beacon and a mobile device\n or any other secure method), and then submit the resulting identity key\n to the service. In this case `beacon_identity_key` field should be\n populated, and neither of `beacon_ecdh_public_key` nor\n `service_ecdh_public_key` fields should be. The security of this method\n depends on how securely the parties involved (in particular the\n bluetooth client) handle the identity key, and obviously on how\n securely the identity key was generated.\n\nSee [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub.", - "type": "object" - }, - "LatLng": { - "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", - "type": "object", - "properties": { - "longitude": { - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "format": "double", - "type": "number" - }, - "latitude": { - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "format": "double", - "type": "number" - } - }, - "id": "LatLng" - }, - "ListBeaconAttachmentsResponse": { - "properties": { - "attachments": { - "description": "The attachments that corresponded to the request params.", - "type": "array", - "items": { - "$ref": "BeaconAttachment" - } - } - }, - "id": "ListBeaconAttachmentsResponse", - "description": "Response to `ListBeaconAttachments` that contains the requested attachments.", - "type": "object" - }, - "Namespace": { - "properties": { - "namespaceName": { - "description": "Resource name of this namespace. Namespaces names have the format:\n\u003ccode\u003enamespaces/\u003cvar\u003enamespace\u003c/var\u003e\u003c/code\u003e.", - "type": "string" - }, - "servingVisibility": { - "enumDescriptions": [ - "Do not use this value.", - "Served only to the project that owns the namespace.", - "Any project can subscribe to attachments under the namespace." - ], - "enum": [ - "VISIBILITY_UNSPECIFIED", - "UNLISTED", - "PUBLIC" - ], - "description": "Specifies what clients may receive attachments under this namespace\nvia `beaconinfo.getforobserved`.", - "type": "string" - } - }, - "id": "Namespace", - "description": "An attachment namespace defines read and write access for all the attachments\ncreated under it. Each namespace is globally unique, and owned by one\nproject which is the only project that can create attachments under it.", - "type": "object" - }, - "AttachmentInfo": { - "properties": { - "data": { - "description": "An opaque data container for client-provided data.", - "format": "byte", - "type": "string" - }, - "namespacedType": { - "description": "Specifies what kind of attachment this is. Tells a client how to\ninterpret the `data` field. Format is \u003cvar\u003enamespace/type\u003c/var\u003e, for\nexample \u003ccode\u003escrupulous-wombat-12345/welcome-message\u003c/code\u003e", - "type": "string" - } - }, - "id": "AttachmentInfo", - "description": "A subset of attachment information served via the\n`beaconinfo.getforobserved` method, used when your users encounter your\nbeacons.", - "type": "object" - }, - "BeaconInfo": { - "properties": { - "beaconName": { - "description": "The name under which the beacon is registered.", - "type": "string" - }, - "advertisedId": { - "$ref": "AdvertisedId", - "description": "The ID advertised by the beacon." - }, - "attachments": { - "description": "Attachments matching the type(s) requested.\nMay be empty if no attachment types were requested.", - "type": "array", - "items": { - "$ref": "AttachmentInfo" - } - } - }, - "id": "BeaconInfo", - "description": "A subset of beacon information served via the `beaconinfo.getforobserved`\nmethod, which you call when users of your app encounter your beacons.", + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object" } }, "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "protocol": "rest", "version": "v1beta1", @@ -1142,5 +1133,14 @@ }, "servicePath": "", "description": "Registers, manages, indexes, and searches beacons.", - "kind": "discovery#restDescription" + "kind": "discovery#restDescription", + "rootUrl": "https://proximitybeacon.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "proximitybeacon", + "batchPath": "batch", + "documentationLink": "https://developers.google.com/beacons/proximity/", + "id": "proximitybeacon:v1beta1", + "revision": "20170913", + "title": "Google Proximity Beacon API" } diff --git a/etc/api/pubsub/v1/crates/1.0.6-api+20170829 b/etc/api/pubsub/v1/crates/1.0.6-api+20170829 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/pubsub/v1/crates/1.0.6-cli+20170829 b/etc/api/pubsub/v1/crates/1.0.6-cli+20170829 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/pubsub/v1/pubsub-api.json b/etc/api/pubsub/v1/pubsub-api.json index e77d2b8149..8db2743896 100644 --- a/etc/api/pubsub/v1/pubsub-api.json +++ b/etc/api/pubsub/v1/pubsub-api.json @@ -1,604 +1,57 @@ { - "rootUrl": "https://pubsub.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "pubsub", - "batchPath": "batch", - "revision": "20170502", - "documentationLink": "https://cloud.google.com/pubsub/docs", - "id": "pubsub:v1", - "title": "Google Cloud Pub/Sub API", - "discoveryVersion": "v1", - "ownerName": "Google", "resources": { "projects": { "resources": { - "subscriptions": { - "methods": { - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListSubscriptionsResponse" - }, - "parameterOrder": [ - "project" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "project": { - "description": "The name of the cloud project that subscriptions belong to.\nFormat is `projects/{project}`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that\nthis is a continuation of a prior `ListSubscriptions` call, and that the\nsystem should return the next page of data.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Maximum number of subscriptions to return.", - "format": "int32", - "type": "integer" - } - }, - "flatPath": "v1/projects/{projectsId}/subscriptions", - "id": "pubsub.projects.subscriptions.list", - "path": "v1/{+project}/subscriptions", - "description": "Lists matching subscriptions." - }, - "setIamPolicy": { - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy", - "path": "v1/{+resource}:setIamPolicy", - "id": "pubsub.projects.subscriptions.setIamPolicy", - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "request": { - "$ref": "SetIamPolicyRequest" - } - }, - "create": { - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}", - "path": "v1/{+name}", - "id": "pubsub.projects.subscriptions.create", - "description": "Creates a subscription to a given topic.\nIf the subscription already exists, returns `ALREADY_EXISTS`.\nIf the corresponding topic doesn't exist, returns `NOT_FOUND`.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic, conforming\nto the\n[resource name format](https://cloud.google.com/pubsub/docs/overview#names).\nThe generated name is populated in the returned Subscription object.\nNote that for REST API requests, you must specify a name in the request.", - "request": { - "$ref": "Subscription" - }, - "response": { - "$ref": "Subscription" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "name": { - "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path" - } - } - }, - "modifyAckDeadline": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "subscription" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline", - "path": "v1/{+subscription}:modifyAckDeadline", - "id": "pubsub.projects.subscriptions.modifyAckDeadline", - "description": "Modifies the ack deadline for a specific message. This method is useful\nto indicate that more time is needed to process a message by the\nsubscriber, or to make the message available for redelivery if the\nprocessing was interrupted. Note that this does not modify the\nsubscription-level `ackDeadlineSeconds` used for subsequent messages.", - "request": { - "$ref": "ModifyAckDeadlineRequest" - } - }, - "acknowledge": { - "httpMethod": "POST", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "The subscription whose message is being acknowledged.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge", - "id": "pubsub.projects.subscriptions.acknowledge", - "path": "v1/{+subscription}:acknowledge", - "description": "Acknowledges the messages associated with the `ack_ids` in the\n`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages\nfrom the subscription.\n\nAcknowledging a message whose ack deadline has expired may succeed,\nbut such a message may be redelivered later. Acknowledging a message more\nthan once will not result in an error.", - "request": { - "$ref": "AcknowledgeRequest" - } - }, - "getIamPolicy": { - "httpMethod": "GET", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:getIamPolicy", - "id": "pubsub.projects.subscriptions.getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset." - }, - "get": { - "description": "Gets the configuration details of a subscription.", - "parameterOrder": [ - "subscription" - ], - "httpMethod": "GET", - "response": { - "$ref": "Subscription" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "The name of the subscription to get.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}", - "path": "v1/{+subscription}", - "id": "pubsub.projects.subscriptions.get" - }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field." - } - }, - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:testIamPermissions", - "id": "pubsub.projects.subscriptions.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - } - }, - "modifyPushConfig": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "subscription" - ], - "httpMethod": "POST", - "parameters": { - "subscription": { - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig", - "path": "v1/{+subscription}:modifyPushConfig", - "id": "pubsub.projects.subscriptions.modifyPushConfig", - "request": { - "$ref": "ModifyPushConfigRequest" - }, - "description": "Modifies the `PushConfig` for a specified subscription.\n\nThis may be used to change a push subscription to a pull one (signified by\nan empty `PushConfig`) or vice versa, or change the endpoint URL and other\nattributes of a push subscription. Messages will accumulate for delivery\ncontinuously through the call regardless of changes to the `PushConfig`." - }, - "pull": { - "request": { - "$ref": "PullRequest" - }, - "description": "Pulls messages from the server. Returns an empty list if there are no\nmessages available in the backlog. The server may return `UNAVAILABLE` if\nthere are too many concurrent pull requests pending for the given\nsubscription.", - "response": { - "$ref": "PullResponse" - }, - "parameterOrder": [ - "subscription" - ], - "httpMethod": "POST", - "parameters": { - "subscription": { - "location": "path", - "description": "The subscription from which messages should be pulled.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:pull", - "path": "v1/{+subscription}:pull", - "id": "pubsub.projects.subscriptions.pull" - }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "subscription": { - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path", - "description": "The subscription to delete.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}", - "id": "pubsub.projects.subscriptions.delete", - "path": "v1/{+subscription}", - "description": "Deletes an existing subscription. All messages retained in the subscription\nare immediately dropped. Calls to `Pull` after deletion will return\n`NOT_FOUND`. After a subscription is deleted, a new one may be created with\nthe same name, but the new one has no association with the old\nsubscription or its topic unless the same topic is specified." - } - } - }, - "snapshots": { - "methods": { - "setIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "pattern": "^projects/[^/]+/snapshots/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:setIamPolicy", - "id": "pubsub.projects.snapshots.setIamPolicy", - "path": "v1/{+resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." - }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/snapshots/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field." - } - }, - "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:testIamPermissions", - "id": "pubsub.projects.snapshots.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - } - }, - "getIamPolicy": { - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/snapshots/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "id": "pubsub.projects.snapshots.getIamPolicy" - } - } - }, "topics": { - "methods": { - "delete": { - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "topic" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "topic": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path", - "description": "Name of the topic to delete.\nFormat is `projects/{project}/topics/{topic}`." - } - }, - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", - "id": "pubsub.projects.topics.delete", - "path": "v1/{+topic}", - "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic\ndoes not exist. After a topic is deleted, a new topic may be created with\nthe same name; this is an entirely new topic with none of the old\nconfiguration or subscriptions. Existing subscriptions to this topic are\nnot deleted, but their `topic` field is set to `_deleted-topic_`." - }, - "list": { - "path": "v1/{+project}/topics", - "id": "pubsub.projects.topics.list", - "description": "Lists matching topics.", - "parameterOrder": [ - "project" - ], - "httpMethod": "GET", - "response": { - "$ref": "ListTopicsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "pageToken": { - "location": "query", - "description": "The value returned by the last `ListTopicsResponse`; indicates that this is\na continuation of a prior `ListTopics` call, and that the system should\nreturn the next page of data.", - "type": "string" - }, - "pageSize": { - "description": "Maximum number of topics to return.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "project": { - "location": "path", - "description": "The name of the cloud project that topics belong to.\nFormat is `projects/{project}`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - } - }, - "flatPath": "v1/projects/{projectsId}/topics" - }, - "setIamPolicy": { - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:setIamPolicy", - "id": "pubsub.projects.topics.setIamPolicy", - "path": "v1/{+resource}:setIamPolicy" - }, - "create": { - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", - "id": "pubsub.projects.topics.create", - "path": "v1/{+name}", - "request": { - "$ref": "Topic" - }, - "description": "Creates the given topic with the given name.", - "httpMethod": "PUT", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Topic" - }, - "parameters": { - "name": { - "location": "path", - "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "getIamPolicy": { - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:getIamPolicy", - "id": "pubsub.projects.topics.getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "httpMethod": "GET", - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" + "resources": { + "subscriptions": { + "methods": { + "list": { + "id": "pubsub.projects.topics.subscriptions.list", + "path": "v1/{+topic}/subscriptions", + "description": "Lists the name of the subscriptions for this topic.", + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSubscriptions` call, and\nthat the system should return the next page of data.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of subscription names to return.", + "type": "integer", + "location": "query" + }, + "topic": { + "location": "path", + "description": "The name of the topic that subscriptions are attached to.\nFormat is `projects/{project}/topics/{topic}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}/subscriptions" } } - }, - "get": { - "parameters": { - "topic": { - "description": "The name of the topic to get.\nFormat is `projects/{project}/topics/{topic}`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", - "path": "v1/{+topic}", - "id": "pubsub.projects.topics.get", - "description": "Gets the configuration of a topic.", - "response": { - "$ref": "Topic" - }, - "parameterOrder": [ - "topic" - ], - "httpMethod": "GET" - }, + } + }, + "methods": { "publish": { + "request": { + "$ref": "PublishRequest" + }, + "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic\ndoes not exist. The message payload must not be empty; it must contain\n either a non-empty data field, or at least one attribute.", "response": { "$ref": "PublishResponse" }, @@ -613,35 +66,35 @@ "parameters": { "topic": { "description": "The messages in the request will be published on this topic.\nFormat is `projects/{project}/topics/{topic}`.", - "required": true, "type": "string", + "required": true, "pattern": "^projects/[^/]+/topics/[^/]+$", "location": "path" } }, "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:publish", - "path": "v1/{+topic}:publish", "id": "pubsub.projects.topics.publish", - "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic\ndoes not exist. The message payload must not be empty; it must contain\n either a non-empty data field, or at least one attribute.", - "request": { - "$ref": "PublishRequest" - } + "path": "v1/{+topic}:publish" }, "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, "response": { "$ref": "TestIamPermissionsResponse" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", "parameters": { "resource": { - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path", "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", "required": true, - "type": "string" + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" } }, "scopes": [ @@ -650,97 +103,607 @@ ], "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:testIamPermissions", "id": "pubsub.projects.topics.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "DELETE", + "parameters": { + "topic": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "Name of the topic to delete.\nFormat is `projects/{project}/topics/{topic}`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", + "id": "pubsub.projects.topics.delete", + "path": "v1/{+topic}", + "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic\ndoes not exist. After a topic is deleted, a new topic may be created with\nthe same name; this is an entirely new topic with none of the old\nconfiguration or subscriptions. Existing subscriptions to this topic are\nnot deleted, but their `topic` field is set to `_deleted-topic_`." + }, + "list": { + "description": "Lists matching topics.", + "response": { + "$ref": "ListTopicsResponse" + }, + "parameterOrder": [ + "project" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "project": { + "location": "path", + "description": "The name of the cloud project that topics belong to.\nFormat is `projects/{project}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + }, + "pageToken": { + "description": "The value returned by the last `ListTopicsResponse`; indicates that this is\na continuation of a prior `ListTopics` call, and that the system should\nreturn the next page of data.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of topics to return.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/topics", + "id": "pubsub.projects.topics.list", + "path": "v1/{+project}/topics" + }, + "setIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:setIamPolicy", + "id": "pubsub.projects.topics.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." + }, + "create": { + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "name": { + "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", + "path": "v1/{+name}", + "id": "pubsub.projects.topics.create", + "request": { + "$ref": "Topic" + }, + "description": "Creates the given topic with the given name." + }, + "getIamPolicy": { + "httpMethod": "GET", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "pubsub.projects.topics.getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset." + }, + "get": { + "description": "Gets the configuration of a topic.", + "response": { + "$ref": "Topic" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "GET", + "parameters": { + "topic": { + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "The name of the topic to get.\nFormat is `projects/{project}/topics/{topic}`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", + "id": "pubsub.projects.topics.get", + "path": "v1/{+topic}" + } + } + }, + "snapshots": { + "methods": { + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/snapshots/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:setIamPolicy", + "id": "pubsub.projects.snapshots.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy" + }, + "testIamPermissions": { "request": { "$ref": "TestIamPermissionsRequest" }, - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." - } - }, - "resources": { - "subscriptions": { - "methods": { - "list": { - "httpMethod": "GET", - "response": { - "$ref": "ListTopicSubscriptionsResponse" - }, - "parameterOrder": [ - "topic" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "pageSize": { - "type": "integer", - "location": "query", - "description": "Maximum number of subscription names to return.", - "format": "int32" - }, - "topic": { - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path", - "description": "The name of the topic that subscriptions are attached to.\nFormat is `projects/{project}/topics/{topic}`." - }, - "pageToken": { - "location": "query", - "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSubscriptions` call, and\nthat the system should return the next page of data.", - "type": "string" - } - }, - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}/subscriptions", - "id": "pubsub.projects.topics.subscriptions.list", - "path": "v1/{+topic}/subscriptions", - "description": "Lists the name of the subscriptions for this topic." + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/snapshots/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:testIamPermissions", + "id": "pubsub.projects.snapshots.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions" + }, + "getIamPolicy": { + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:getIamPolicy", + "id": "pubsub.projects.snapshots.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/snapshots/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field." } } } } + }, + "subscriptions": { + "methods": { + "acknowledge": { + "description": "Acknowledges the messages associated with the `ack_ids` in the\n`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages\nfrom the subscription.\n\nAcknowledging a message whose ack deadline has expired may succeed,\nbut such a message may be redelivered later. Acknowledging a message more\nthan once will not result in an error.", + "request": { + "$ref": "AcknowledgeRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "subscription": { + "description": "The subscription whose message is being acknowledged.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge", + "path": "v1/{+subscription}:acknowledge", + "id": "pubsub.projects.subscriptions.acknowledge" + }, + "getIamPolicy": { + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:getIamPolicy", + "id": "pubsub.projects.subscriptions.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyAckDeadline": { + "httpMethod": "POST", + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "subscription": { + "location": "path", + "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline", + "path": "v1/{+subscription}:modifyAckDeadline", + "id": "pubsub.projects.subscriptions.modifyAckDeadline", + "description": "Modifies the ack deadline for a specific message. This method is useful\nto indicate that more time is needed to process a message by the\nsubscriber, or to make the message available for redelivery if the\nprocessing was interrupted. Note that this does not modify the\nsubscription-level `ackDeadlineSeconds` used for subsequent messages.", + "request": { + "$ref": "ModifyAckDeadlineRequest" + } + }, + "get": { + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "GET", + "parameters": { + "subscription": { + "description": "The name of the subscription to get.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}", + "id": "pubsub.projects.subscriptions.get", + "path": "v1/{+subscription}", + "description": "Gets the configuration details of a subscription." + }, + "testIamPermissions": { + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "pubsub.projects.subscriptions.testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + } + }, + "modifyPushConfig": { + "httpMethod": "POST", + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig", + "path": "v1/{+subscription}:modifyPushConfig", + "id": "pubsub.projects.subscriptions.modifyPushConfig", + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "description": "Modifies the `PushConfig` for a specified subscription.\n\nThis may be used to change a push subscription to a pull one (signified by\nan empty `PushConfig`) or vice versa, or change the endpoint URL and other\nattributes of a push subscription. Messages will accumulate for delivery\ncontinuously through the call regardless of changes to the `PushConfig`." + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "parameters": { + "subscription": { + "location": "path", + "description": "The subscription to delete.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}", + "path": "v1/{+subscription}", + "id": "pubsub.projects.subscriptions.delete", + "description": "Deletes an existing subscription. All messages retained in the subscription\nare immediately dropped. Calls to `Pull` after deletion will return\n`NOT_FOUND`. After a subscription is deleted, a new one may be created with\nthe same name, but the new one has no association with the old\nsubscription or its topic unless the same topic is specified." + }, + "pull": { + "id": "pubsub.projects.subscriptions.pull", + "path": "v1/{+subscription}:pull", + "request": { + "$ref": "PullRequest" + }, + "description": "Pulls messages from the server. Returns an empty list if there are no\nmessages available in the backlog. The server may return `UNAVAILABLE` if\nthere are too many concurrent pull requests pending for the given\nsubscription.", + "response": { + "$ref": "PullResponse" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "location": "path", + "description": "The subscription from which messages should be pulled.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:pull" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "project": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The name of the cloud project that subscriptions belong to.\nFormat is `projects/{project}`." + }, + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that\nthis is a continuation of a prior `ListSubscriptions` call, and that the\nsystem should return the next page of data.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum number of subscriptions to return.", + "type": "integer" + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions", + "path": "v1/{+project}/subscriptions", + "id": "pubsub.projects.subscriptions.list", + "description": "Lists matching subscriptions." + }, + "create": { + "id": "pubsub.projects.subscriptions.create", + "path": "v1/{+name}", + "request": { + "$ref": "Subscription" + }, + "description": "Creates a subscription to a given topic.\nIf the subscription already exists, returns `ALREADY_EXISTS`.\nIf the corresponding topic doesn't exist, returns `NOT_FOUND`.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic, conforming\nto the\n[resource name format](https://cloud.google.com/pubsub/docs/overview#names).\nThe generated name is populated in the returned Subscription object.\nNote that for REST API requests, you must specify a name in the request.", + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}" + }, + "setIamPolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "pubsub.projects.subscriptions.setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." + } + } } } } }, "parameters": { - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, "quotaUser": { "location": "query", "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.", "type": "string" }, "pp": { + "location": "query", "description": "Pretty-print response.", - "type": "boolean", "default": "true", - "location": "query" + "type": "boolean" }, "oauth_token": { "description": "OAuth 2.0 token for the current user.", @@ -760,41 +723,260 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." + "default": "true", + "type": "boolean" }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", "location": "query" }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], "location": "query", "enum": [ "1", "2" ], "description": "V1 error format.", + "type": "string" + }, + "alt": { "type": "string", "enumDescriptions": [ - "v1 error format", - "v2 error format" + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" ] }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" } }, "schemas": { + "PublishResponse": { + "description": "Response for the `Publish` method.", + "type": "object", + "properties": { + "messageIds": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The server-assigned ID of each published message, in the same order as\nthe messages in the request. IDs are guaranteed to be unique within\nthe topic." + } + }, + "id": "PublishResponse" + }, + "Subscription": { + "description": "A subscription resource.", + "type": "object", + "properties": { + "name": { + "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", + "type": "string" + }, + "topic": { + "description": "The name of the topic from which this subscription is receiving messages.\nFormat is `projects/{project}/topics/{topic}`.\nThe value of this field will be `_deleted-topic_` if the topic has been\ndeleted.", + "type": "string" + }, + "pushConfig": { + "description": "If push delivery is used with this subscription, this field is\nused to configure it. An empty `pushConfig` signifies that the subscriber\nwill pull and ack messages using API methods.", + "$ref": "PushConfig" + }, + "ackDeadlineSeconds": { + "format": "int32", + "description": "This value is the maximum time after a subscriber receives a message\nbefore the subscriber should acknowledge the message. After message\ndelivery but before the ack deadline expires and before the message is\nacknowledged, it is an outstanding message and will not be delivered\nagain during that time (on a best-effort basis).\n\nFor pull subscriptions, this value is used as the initial value for the ack\ndeadline. To override this value for a given message, call\n`ModifyAckDeadline` with the corresponding `ack_id` if using\npull.\nThe minimum custom deadline you can specify is 10 seconds.\nThe maximum custom deadline you can specify is 600 seconds (10 minutes).\nIf this parameter is 0, a default value of 10 seconds is used.\n\nFor push delivery, this value is also used to set the request timeout for\nthe call to the push endpoint.\n\nIf the subscriber never acknowledges the message, the Pub/Sub\nsystem will eventually redeliver the message.", + "type": "integer" + } + }, + "id": "Subscription" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions)." + } + }, + "id": "TestIamPermissionsRequest" + }, + "Policy": { + "id": "Policy", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + } + } + }, + "Topic": { + "description": "A topic resource.", + "type": "object", + "properties": { + "name": { + "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", + "type": "string" + } + }, + "id": "Topic" + }, + "ModifyAckDeadlineRequest": { + "id": "ModifyAckDeadlineRequest", + "description": "Request for the ModifyAckDeadline method.", + "type": "object", + "properties": { + "ackIds": { + "description": "List of acknowledgment IDs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ackDeadlineSeconds": { + "format": "int32", + "description": "The new ack deadline with respect to the time this request was sent to\nthe Pub/Sub system. For example, if the value is 10, the new\nack deadline will expire 10 seconds after the `ModifyAckDeadline` call\nwas made. Specifying zero may immediately make the message available for\nanother pull request.\nThe minimum deadline you can specify is 0 seconds.\nThe maximum deadline you can specify is 600 seconds (10 minutes).", + "type": "integer" + } + } + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." + } + }, + "id": "SetIamPolicyRequest" + }, + "PubsubMessage": { + "description": "A message data and its attributes. The message payload must not be empty;\nit must contain either a non-empty data field, or at least one attribute.", + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "ID of this message, assigned by the server when the message is published.\nGuaranteed to be unique within the topic. This value may be read by a\nsubscriber that receives a `PubsubMessage` via a `Pull` call or a push\ndelivery. It must not be populated by the publisher in a `Publish` call." + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Optional attributes for this message." + }, + "publishTime": { + "format": "google-datetime", + "description": "The time at which the message was published, populated by the server when\nit receives the `Publish` call. It must not be populated by the\npublisher in a `Publish` call.", + "type": "string" + }, + "data": { + "format": "byte", + "description": "The message payload.", + "type": "string" + } + }, + "id": "PubsubMessage" + }, + "ModifyPushConfigRequest": { + "description": "Request for the ModifyPushConfig method.", + "type": "object", + "properties": { + "pushConfig": { + "$ref": "PushConfig", + "description": "The push configuration for future deliveries.\n\nAn empty `pushConfig` indicates that the Pub/Sub system should\nstop pushing messages from the given subscription and allow\nmessages to be pulled and acknowledged - effectively pausing\nthe subscription if `Pull` is not called." + } + }, + "id": "ModifyPushConfigRequest" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n" + }, + "role": { + "type": "string", + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired" + } + }, + "id": "Binding" + }, + "AcknowledgeRequest": { + "description": "Request for the Acknowledge method.", + "type": "object", + "properties": { + "ackIds": { + "description": "The acknowledgment ID for the messages being acknowledged that was returned\nby the Pub/Sub system in the `Pull` response. Must not be empty.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "AcknowledgeRequest" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, "ListTopicsResponse": { - "description": "Response for the `ListTopics` method.", "type": "object", "properties": { "nextPageToken": { @@ -803,33 +985,14 @@ }, "topics": { "description": "The resulting topics.", - "type": "array", "items": { "$ref": "Topic" - } + }, + "type": "array" } }, - "id": "ListTopicsResponse" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - }, - "AcknowledgeRequest": { - "properties": { - "ackIds": { - "description": "The acknowledgment ID for the messages being acknowledged that was returned\nby the Pub/Sub system in the `Pull` response. Must not be empty.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "AcknowledgeRequest", - "description": "Request for the Acknowledge method.", - "type": "object" + "id": "ListTopicsResponse", + "description": "Response for the `ListTopics` method." }, "ListTopicSubscriptionsResponse": { "id": "ListTopicSubscriptionsResponse", @@ -842,38 +1005,38 @@ }, "subscriptions": { "description": "The names of the subscriptions that match the request.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } } }, "PullResponse": { + "description": "Response for the `Pull` method.", "type": "object", "properties": { "receivedMessages": { - "description": "Received Pub/Sub messages. The Pub/Sub system will return zero messages if\nthere are no more available in the backlog. The Pub/Sub system may return\nfewer than the `maxMessages` requested even if there are more messages\navailable in the backlog.", - "type": "array", "items": { "$ref": "ReceivedMessage" - } + }, + "type": "array", + "description": "Received Pub/Sub messages. The Pub/Sub system will return zero messages if\nthere are no more available in the backlog. The Pub/Sub system may return\nfewer than the `maxMessages` requested even if there are more messages\navailable in the backlog." } }, - "id": "PullResponse", - "description": "Response for the `Pull` method." + "id": "PullResponse" }, "ReceivedMessage": { "description": "A message and its corresponding acknowledgment ID.", "type": "object", "properties": { + "message": { + "$ref": "PubsubMessage", + "description": "The message." + }, "ackId": { "description": "This ID can be used to acknowledge the received message.", "type": "string" - }, - "message": { - "description": "The message.", - "$ref": "PubsubMessage" } }, "id": "ReceivedMessage" @@ -882,41 +1045,41 @@ "description": "Configuration for a push delivery endpoint.", "type": "object", "properties": { + "attributes": { + "additionalProperties": { + "type": "string" + }, + "description": "Endpoint configuration attributes.\n\nEvery endpoint has a set of API supported attributes that can be used to\ncontrol different aspects of the message delivery.\n\nThe currently supported attribute is `x-goog-version`, which you can\nuse to change the format of the pushed message. This attribute\nindicates the version of the data expected by the endpoint. This\ncontrols the shape of the pushed message (i.e., its fields and metadata).\nThe endpoint version is based on the version of the Pub/Sub API.\n\nIf not present during the `CreateSubscription` call, it will default to\nthe version of the API used to make such call. If not present during a\n`ModifyPushConfig` call, its value will not be changed. `GetSubscription`\ncalls will always return a valid version, even if the subscription was\ncreated without this attribute.\n\nThe possible values for this attribute are:\n\n* `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.\n* `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", + "type": "object" + }, "pushEndpoint": { "description": "A URL locating the endpoint to which messages should be pushed.\nFor example, a Webhook endpoint might use \"https://example.com/push\".", "type": "string" - }, - "attributes": { - "description": "Endpoint configuration attributes.\n\nEvery endpoint has a set of API supported attributes that can be used to\ncontrol different aspects of the message delivery.\n\nThe currently supported attribute is `x-goog-version`, which you can\nuse to change the format of the pushed message. This attribute\nindicates the version of the data expected by the endpoint. This\ncontrols the shape of the pushed message (i.e., its fields and metadata).\nThe endpoint version is based on the version of the Pub/Sub API.\n\nIf not present during the `CreateSubscription` call, it will default to\nthe version of the API used to make such call. If not present during a\n`ModifyPushConfig` call, its value will not be changed. `GetSubscription`\ncalls will always return a valid version, even if the subscription was\ncreated without this attribute.\n\nThe possible values for this attribute are:\n\n* `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.\n* `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", - "type": "object", - "additionalProperties": { - "type": "string" - } } }, "id": "PushConfig" }, "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", "description": "Response message for `TestIamPermissions` method.", "type": "object", "properties": { "permissions": { "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } - }, - "id": "TestIamPermissionsResponse" + } }, "PullRequest": { "description": "Request for the `Pull` method.", "type": "object", "properties": { "maxMessages": { - "description": "The maximum number of messages returned for this request. The Pub/Sub\nsystem may return fewer than the number specified.", "format": "int32", + "description": "The maximum number of messages returned for this request. The Pub/Sub\nsystem may return fewer than the number specified.", "type": "integer" }, "returnImmediately": { @@ -927,22 +1090,22 @@ "id": "PullRequest" }, "ListSubscriptionsResponse": { - "id": "ListSubscriptionsResponse", "description": "Response for the `ListSubscriptions` method.", "type": "object", "properties": { "nextPageToken": { - "type": "string", - "description": "If not empty, indicates that there may be more subscriptions that match\nthe request; this value should be passed in a new\n`ListSubscriptionsRequest` to get more subscriptions." + "description": "If not empty, indicates that there may be more subscriptions that match\nthe request; this value should be passed in a new\n`ListSubscriptionsRequest` to get more subscriptions.", + "type": "string" }, "subscriptions": { "description": "The subscriptions that match the request.", - "type": "array", "items": { "$ref": "Subscription" - } + }, + "type": "array" } - } + }, + "id": "ListSubscriptionsResponse" }, "PublishRequest": { "description": "Request for the Publish method.", @@ -950,192 +1113,18 @@ "properties": { "messages": { "description": "The messages to publish.", - "type": "array", "items": { "$ref": "PubsubMessage" - } + }, + "type": "array" } }, "id": "PublishRequest" - }, - "PublishResponse": { - "properties": { - "messageIds": { - "description": "The server-assigned ID of each published message, in the same order as\nthe messages in the request. IDs are guaranteed to be unique within\nthe topic.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "PublishResponse", - "description": "Response for the `Publish` method.", - "type": "object" - }, - "Subscription": { - "description": "A subscription resource.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`." - }, - "topic": { - "description": "The name of the topic from which this subscription is receiving messages.\nFormat is `projects/{project}/topics/{topic}`.\nThe value of this field will be `_deleted-topic_` if the topic has been\ndeleted.", - "type": "string" - }, - "pushConfig": { - "$ref": "PushConfig", - "description": "If push delivery is used with this subscription, this field is\nused to configure it. An empty `pushConfig` signifies that the subscriber\nwill pull and ack messages using API methods." - }, - "ackDeadlineSeconds": { - "description": "This value is the maximum time after a subscriber receives a message\nbefore the subscriber should acknowledge the message. After message\ndelivery but before the ack deadline expires and before the message is\nacknowledged, it is an outstanding message and will not be delivered\nagain during that time (on a best-effort basis).\n\nFor pull subscriptions, this value is used as the initial value for the ack\ndeadline. To override this value for a given message, call\n`ModifyAckDeadline` with the corresponding `ack_id` if using\npull.\nThe minimum custom deadline you can specify is 10 seconds.\nThe maximum custom deadline you can specify is 600 seconds (10 minutes).\nIf this parameter is 0, a default value of 10 seconds is used.\n\nFor push delivery, this value is also used to set the request timeout for\nthe call to the push endpoint.\n\nIf the subscriber never acknowledges the message, the Pub/Sub\nsystem will eventually redeliver the message.", - "format": "int32", - "type": "integer" - } - }, - "id": "Subscription" - }, - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "TestIamPermissionsRequest" - }, - "Topic": { - "type": "object", - "properties": { - "name": { - "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", - "type": "string" - } - }, - "id": "Topic", - "description": "A topic resource." - }, - "Policy": { - "type": "object", - "properties": { - "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", - "items": { - "$ref": "Binding" - } - }, - "etag": { - "type": "string", - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", - "format": "byte" - }, - "version": { - "description": "Version of the `Policy`. The default version is 0.", - "format": "int32", - "type": "integer" - } - }, - "id": "Policy", - "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam)." - }, - "ModifyAckDeadlineRequest": { - "description": "Request for the ModifyAckDeadline method.", - "type": "object", - "properties": { - "ackDeadlineSeconds": { - "type": "integer", - "description": "The new ack deadline with respect to the time this request was sent to\nthe Pub/Sub system. For example, if the value is 10, the new\nack deadline will expire 10 seconds after the `ModifyAckDeadline` call\nwas made. Specifying zero may immediately make the message available for\nanother pull request.\nThe minimum deadline you can specify is 0 seconds.\nThe maximum deadline you can specify is 600 seconds (10 minutes).", - "format": "int32" - }, - "ackIds": { - "description": "List of acknowledgment IDs.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "ModifyAckDeadlineRequest" - }, - "SetIamPolicyRequest": { - "type": "object", - "properties": { - "policy": { - "$ref": "Policy", - "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." - } - }, - "id": "SetIamPolicyRequest", - "description": "Request message for `SetIamPolicy` method." - }, - "PubsubMessage": { - "properties": { - "attributes": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional attributes for this message.", - "type": "object" - }, - "messageId": { - "description": "ID of this message, assigned by the server when the message is published.\nGuaranteed to be unique within the topic. This value may be read by a\nsubscriber that receives a `PubsubMessage` via a `Pull` call or a push\ndelivery. It must not be populated by the publisher in a `Publish` call.", - "type": "string" - }, - "publishTime": { - "description": "The time at which the message was published, populated by the server when\nit receives the `Publish` call. It must not be populated by the\npublisher in a `Publish` call.", - "format": "google-datetime", - "type": "string" - }, - "data": { - "description": "The message payload.", - "format": "byte", - "type": "string" - } - }, - "id": "PubsubMessage", - "description": "A message data and its attributes. The message payload must not be empty;\nit must contain either a non-empty data field, or at least one attribute.", - "type": "object" - }, - "ModifyPushConfigRequest": { - "type": "object", - "properties": { - "pushConfig": { - "$ref": "PushConfig", - "description": "The push configuration for future deliveries.\n\nAn empty `pushConfig` indicates that the Pub/Sub system should\nstop pushing messages from the given subscription and allow\nmessages to be pulled and acknowledged - effectively pausing\nthe subscription if `Pull` is not called." - } - }, - "id": "ModifyPushConfigRequest", - "description": "Request for the ModifyPushConfig method." - }, - "Binding": { - "properties": { - "role": { - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", - "type": "string" - }, - "members": { - "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "Binding", - "description": "Associates `members` with a `role`.", - "type": "object" } }, "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "protocol": "rest", "version": "v1", @@ -1154,6 +1143,17 @@ } }, "kind": "discovery#restDescription", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n", "servicePath": "", - "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n" + "rootUrl": "https://pubsub.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "pubsub", + "batchPath": "batch", + "id": "pubsub:v1", + "documentationLink": "https://cloud.google.com/pubsub/docs", + "revision": "20170829", + "title": "Google Cloud Pub/Sub API", + "discoveryVersion": "v1", + "ownerName": "Google" } diff --git a/etc/api/pubsub/v1beta1a/pubsub-api.json b/etc/api/pubsub/v1beta1a/pubsub-api.json index 901c3ff873..a47aef5b85 100644 --- a/etc/api/pubsub/v1beta1a/pubsub-api.json +++ b/etc/api/pubsub/v1beta1a/pubsub-api.json @@ -1,77 +1,130 @@ { + "name": "pubsub", + "batchPath": "batch", + "revision": "20170829", + "documentationLink": "https://cloud.google.com/pubsub/docs", + "id": "pubsub:v1beta1a", + "title": "Google Cloud Pub/Sub API", + "ownerName": "Google", + "discoveryVersion": "v1", "resources": { "subscriptions": { "methods": { - "list": { + "modifyPushConfig": { + "path": "v1beta1a/subscriptions/modifyPushConfig", + "id": "pubsub.subscriptions.modifyPushConfig", + "description": "Modifies the \u003ccode\u003ePushConfig\u003c/code\u003e for a specified subscription.\nThis method can be used to suspend the flow of messages to an endpoint\nby clearing the \u003ccode\u003ePushConfig\u003c/code\u003e field in the request. Messages\nwill be accumulated for delivery even if no push configuration is\ndefined or while the configuration is modified.", + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Empty" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta1a/subscriptions/modifyPushConfig" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], "parameters": { - "query": { + "subscription": { + "description": "The subscription to delete.", "type": "string", - "location": "query", - "description": "A valid label query expression." - }, - "maxResults": { - "location": "query", - "description": "Maximum number of subscriptions to return.", - "format": "int32", - "type": "integer" - }, + "required": true, + "pattern": "^.+$", + "location": "path" + } + }, + "flatPath": "v1beta1a/subscriptions/{subscriptionsId}", + "id": "pubsub.subscriptions.delete", + "path": "v1beta1a/subscriptions/{+subscription}", + "description": "Deletes an existing subscription. All pending messages in the subscription\nare immediately dropped. Calls to Pull after deletion will return\nNOT_FOUND." + }, + "pull": { + "path": "v1beta1a/subscriptions/pull", + "id": "pubsub.subscriptions.pull", + "description": "Pulls a single message from the server.\nIf return_immediately is true, and no messages are available in the\nsubscription, this method returns FAILED_PRECONDITION. The system is free\nto return an UNAVAILABLE error if no messages are available in a\nreasonable amount of time (to reduce system load).", + "request": { + "$ref": "PullRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "PullResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta1a/subscriptions/pull" + }, + "list": { + "description": "Lists matching subscriptions.", + "httpMethod": "GET", + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "parameterOrder": [], + "parameters": { "pageToken": { "location": "query", "description": "The value obtained in the last \u003ccode\u003eListSubscriptionsResponse\u003c/code\u003e\nfor continuation.", "type": "string" + }, + "maxResults": { + "location": "query", + "format": "int32", + "description": "Maximum number of subscriptions to return.", + "type": "integer" + }, + "query": { + "description": "A valid label query expression.", + "type": "string", + "location": "query" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], "flatPath": "v1beta1a/subscriptions", - "id": "pubsub.subscriptions.list", "path": "v1beta1a/subscriptions", - "description": "Lists matching subscriptions.", - "httpMethod": "GET", - "parameterOrder": [], - "response": { - "$ref": "ListSubscriptionsResponse" - } + "id": "pubsub.subscriptions.list" }, "create": { + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": {}, "flatPath": "v1beta1a/subscriptions", "id": "pubsub.subscriptions.create", "path": "v1beta1a/subscriptions", "request": { "$ref": "Subscription" }, - "description": "Creates a subscription on a given topic for a given subscriber.\nIf the subscription already exists, returns ALREADY_EXISTS.\nIf the corresponding topic doesn't exist, returns NOT_FOUND.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic.", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Subscription" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "acknowledge": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta1a/subscriptions/acknowledge", - "path": "v1beta1a/subscriptions/acknowledge", - "id": "pubsub.subscriptions.acknowledge", - "request": { - "$ref": "AcknowledgeRequest" - }, - "description": "Acknowledges a particular received message: the Pub/Sub system can remove\nthe given message from the subscription. Acknowledging a message whose\nAck deadline has expired may succeed, but the message could have been\nalready redelivered. Acknowledging a message more than once will not\nresult in an error. This is only used for messages received via pull." + "description": "Creates a subscription on a given topic for a given subscriber.\nIf the subscription already exists, returns ALREADY_EXISTS.\nIf the corresponding topic doesn't exist, returns NOT_FOUND.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic." }, "modifyAckDeadline": { "description": "Modifies the Ack deadline for a message received from a pull request.", @@ -83,21 +136,66 @@ }, "parameterOrder": [], "httpMethod": "POST", + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], - "parameters": {}, "flatPath": "v1beta1a/subscriptions/modifyAckDeadline", - "path": "v1beta1a/subscriptions/modifyAckDeadline", - "id": "pubsub.subscriptions.modifyAckDeadline" + "id": "pubsub.subscriptions.modifyAckDeadline", + "path": "v1beta1a/subscriptions/modifyAckDeadline" + }, + "acknowledge": { + "flatPath": "v1beta1a/subscriptions/acknowledge", + "id": "pubsub.subscriptions.acknowledge", + "path": "v1beta1a/subscriptions/acknowledge", + "request": { + "$ref": "AcknowledgeRequest" + }, + "description": "Acknowledges a particular received message: the Pub/Sub system can remove\nthe given message from the subscription. Acknowledging a message whose\nAck deadline has expired may succeed, but the message could have been\nalready redelivered. Acknowledging a message more than once will not\nresult in an error. This is only used for messages received via pull.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": {} + }, + "get": { + "flatPath": "v1beta1a/subscriptions/{subscriptionsId}", + "id": "pubsub.subscriptions.get", + "path": "v1beta1a/subscriptions/{+subscription}", + "description": "Gets the configuration details of a subscription.", + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "GET", + "parameters": { + "subscription": { + "pattern": "^.+$", + "location": "path", + "description": "The name of the subscription to get.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] }, "pullBatch": { - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "PullBatchResponse" }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" @@ -106,106 +204,63 @@ "flatPath": "v1beta1a/subscriptions/pullBatch", "id": "pubsub.subscriptions.pullBatch", "path": "v1beta1a/subscriptions/pullBatch", - "description": "Pulls messages from the server. Returns an empty list if there are no\nmessages available in the backlog. The system is free to return UNAVAILABLE\nif there are too many pull requests outstanding for the given subscription.", "request": { "$ref": "PullBatchRequest" - } - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Subscription" }, - "parameters": { - "subscription": { - "pattern": "^.+$", - "location": "path", - "description": "The name of the subscription to get.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta1a/subscriptions/{subscriptionsId}", - "id": "pubsub.subscriptions.get", - "path": "v1beta1a/subscriptions/{+subscription}", - "description": "Gets the configuration details of a subscription." - }, - "modifyPushConfig": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Empty" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta1a/subscriptions/modifyPushConfig", - "id": "pubsub.subscriptions.modifyPushConfig", - "path": "v1beta1a/subscriptions/modifyPushConfig", - "request": { - "$ref": "ModifyPushConfigRequest" - }, - "description": "Modifies the \u003ccode\u003ePushConfig\u003c/code\u003e for a specified subscription.\nThis method can be used to suspend the flow of messages to an endpoint\nby clearing the \u003ccode\u003ePushConfig\u003c/code\u003e field in the request. Messages\nwill be accumulated for delivery even if no push configuration is\ndefined or while the configuration is modified." - }, - "delete": { - "flatPath": "v1beta1a/subscriptions/{subscriptionsId}", - "id": "pubsub.subscriptions.delete", - "path": "v1beta1a/subscriptions/{+subscription}", - "description": "Deletes an existing subscription. All pending messages in the subscription\nare immediately dropped. Calls to Pull after deletion will return\nNOT_FOUND.", - "httpMethod": "DELETE", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "pattern": "^.+$", - "location": "path", - "description": "The subscription to delete.", - "required": true, - "type": "string" - } - } - }, - "pull": { - "response": { - "$ref": "PullResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": {}, - "flatPath": "v1beta1a/subscriptions/pull", - "path": "v1beta1a/subscriptions/pull", - "id": "pubsub.subscriptions.pull", - "description": "Pulls a single message from the server.\nIf return_immediately is true, and no messages are available in the\nsubscription, this method returns FAILED_PRECONDITION. The system is free\nto return an UNAVAILABLE error if no messages are available in a\nreasonable amount of time (to reduce system load).", - "request": { - "$ref": "PullRequest" - } + "description": "Pulls messages from the server. Returns an empty list if there are no\nmessages available in the backlog. The system is free to return UNAVAILABLE\nif there are too many pull requests outstanding for the given subscription." } } }, "topics": { "methods": { + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Topic" + }, + "parameterOrder": [ + "topic" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "topic": { + "pattern": "^.+$", + "location": "path", + "description": "The name of the topic to get.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1a/topics/{topicsId}", + "path": "v1beta1a/topics/{+topic}", + "id": "pubsub.topics.get", + "description": "Gets the configuration of a topic. Since the topic only has the name\nattribute, this method is only useful to check the existence of a topic.\nIf other attributes are added in the future, they will be returned here." + }, + "publish": { + "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not\nexist.", + "request": { + "$ref": "PublishRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta1a/topics/publish", + "id": "pubsub.topics.publish", + "path": "v1beta1a/topics/publish" + }, "delete": { + "path": "v1beta1a/topics/{+topic}", + "id": "pubsub.topics.delete", "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does\nnot exist. After a topic is deleted, a new topic may be created with the\nsame name.", "httpMethod": "DELETE", "parameterOrder": [ @@ -220,25 +275,23 @@ ], "parameters": { "topic": { + "type": "string", + "required": true, "pattern": "^.+$", "location": "path", - "description": "Name of the topic to delete.", - "required": true, - "type": "string" + "description": "Name of the topic to delete." } }, - "flatPath": "v1beta1a/topics/{topicsId}", - "id": "pubsub.topics.delete", - "path": "v1beta1a/topics/{+topic}" + "flatPath": "v1beta1a/topics/{topicsId}" }, "publishBatch": { "flatPath": "v1beta1a/topics/publishBatch", - "id": "pubsub.topics.publishBatch", "path": "v1beta1a/topics/publishBatch", - "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does\nnot exist.", + "id": "pubsub.topics.publishBatch", "request": { "$ref": "PublishBatchRequest" }, + "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does\nnot exist.", "httpMethod": "POST", "parameterOrder": [], "response": { @@ -252,38 +305,42 @@ }, "list": { "description": "Lists matching topics.", - "httpMethod": "GET", "response": { "$ref": "ListTopicsResponse" }, "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], + "httpMethod": "GET", "parameters": { - "query": { - "location": "query", - "description": "A valid label query expression.", - "type": "string" - }, - "maxResults": { - "description": "Maximum number of topics to return.", - "format": "int32", - "type": "integer", - "location": "query" - }, "pageToken": { "location": "query", "description": "The value obtained in the last \u003ccode\u003eListTopicsResponse\u003c/code\u003e\nfor continuation.", "type": "string" + }, + "maxResults": { + "location": "query", + "format": "int32", + "description": "Maximum number of topics to return.", + "type": "integer" + }, + "query": { + "description": "A valid label query expression.", + "type": "string", + "location": "query" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], "flatPath": "v1beta1a/topics", "id": "pubsub.topics.list", "path": "v1beta1a/topics" }, "create": { + "description": "Creates the given topic with the given name.", + "request": { + "$ref": "Topic" + }, "response": { "$ref": "Topic" }, @@ -295,84 +352,46 @@ "https://www.googleapis.com/auth/pubsub" ], "flatPath": "v1beta1a/topics", - "path": "v1beta1a/topics", "id": "pubsub.topics.create", - "request": { - "$ref": "Topic" - }, - "description": "Creates the given topic with the given name." - }, - "get": { - "response": { - "$ref": "Topic" - }, - "parameterOrder": [ - "topic" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "topic": { - "description": "The name of the topic to get.", - "required": true, - "type": "string", - "pattern": "^.+$", - "location": "path" - } - }, - "flatPath": "v1beta1a/topics/{topicsId}", - "path": "v1beta1a/topics/{+topic}", - "id": "pubsub.topics.get", - "description": "Gets the configuration of a topic. Since the topic only has the name\nattribute, this method is only useful to check the existence of a topic.\nIf other attributes are added in the future, they will be returned here." - }, - "publish": { - "id": "pubsub.topics.publish", - "path": "v1beta1a/topics/publish", - "request": { - "$ref": "PublishRequest" - }, - "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not\nexist.", - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Empty" - }, - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta1a/topics/publish" + "path": "v1beta1a/topics" } } } }, "parameters": { + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", - "location": "query" + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." }, "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." }, "uploadType": { "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string" }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, "$.xgafv": { + "location": "query", "enum": [ "1", "2" @@ -382,8 +401,7 @@ "enumDescriptions": [ "v1 error format", "v2 error format" - ], - "location": "query" + ] }, "callback": { "location": "query", @@ -391,6 +409,11 @@ "type": "string" }, "alt": { + "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", "description": "Data format for response.", "default": "json", @@ -399,17 +422,12 @@ "media", "proto" ], - "type": "string", - "enumDescriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ] + "type": "string" }, "key": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "access_token": { "location": "query", @@ -417,30 +435,19 @@ "type": "string" }, "quotaUser": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "pp": { - "location": "query", "description": "Pretty-print response.", + "default": "true", "type": "boolean", - "default": "true" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "location": "query" } }, "schemas": { "ModifyAckDeadlineRequest": { - "type": "object", "properties": { "subscription": { "description": "Next Index: 5\nThe name of the subscription from which messages are being pulled.", @@ -451,20 +458,21 @@ "type": "string" }, "ackDeadlineSeconds": { - "description": "The new ack deadline with respect to the time this request was sent to the\nPub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack\ndeadline will expire 10 seconds after the ModifyAckDeadline call was made.\nSpecifying zero may immediately make the message available for another pull\nrequest.", "format": "int32", + "description": "The new ack deadline with respect to the time this request was sent to the\nPub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack\ndeadline will expire 10 seconds after the ModifyAckDeadline call was made.\nSpecifying zero may immediately make the message available for another pull\nrequest.", "type": "integer" }, "ackIds": { "description": "List of acknowledgment IDs. Either this field or ack_id\nshould be populated, not both.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "ModifyAckDeadlineRequest", - "description": "Request for the ModifyAckDeadline method." + "description": "Request for the ModifyAckDeadline method.", + "type": "object" }, "PullBatchRequest": { "description": "Request for the PullBatch method.", @@ -479,8 +487,8 @@ "type": "boolean" }, "maxEvents": { - "description": "The maximum number of PubsubEvents returned for this request. The Pub/Sub\nsystem may return fewer than the number of events specified.", "format": "int32", + "description": "The maximum number of PubsubEvents returned for this request. The Pub/Sub\nsystem may return fewer than the number of events specified.", "type": "integer" } }, @@ -490,62 +498,62 @@ "description": "A message data and its labels.", "type": "object", "properties": { + "data": { + "format": "byte", + "description": "The message payload.", + "type": "string" + }, "messageId": { "description": "ID of this message assigned by the server at publication time. Guaranteed\nto be unique within the topic. This value may be read by a subscriber\nthat receives a PubsubMessage via a Pull call or a push delivery. It must\nnot be populated by a publisher in a Publish call.", "type": "string" }, + "publishTime": { + "type": "string", + "format": "int64", + "description": "The time at which the message was published.\nThe time is milliseconds since the UNIX epoch." + }, "label": { "description": "Optional list of labels for this message. Keys in this collection must\nbe unique.", - "type": "array", "items": { "$ref": "Label" - } - }, - "publishTime": { - "description": "The time at which the message was published.\nThe time is milliseconds since the UNIX epoch.", - "format": "int64", - "type": "string" - }, - "data": { - "description": "The message payload.", - "format": "byte", - "type": "string" + }, + "type": "array" } }, "id": "PubsubMessage" }, "ModifyPushConfigRequest": { + "description": "Request for the ModifyPushConfig method.", "type": "object", "properties": { "pushConfig": { - "$ref": "PushConfig", - "description": "An empty \u003ccode\u003epush_config\u003c/code\u003e indicates that the Pub/Sub system should\npause pushing messages from the given subscription." + "description": "An empty \u003ccode\u003epush_config\u003c/code\u003e indicates that the Pub/Sub system should\npause pushing messages from the given subscription.", + "$ref": "PushConfig" }, "subscription": { "description": "The name of the subscription.", "type": "string" } }, - "id": "ModifyPushConfigRequest", - "description": "Request for the ModifyPushConfig method." + "id": "ModifyPushConfigRequest" }, - "AcknowledgeRequest": { + "ListTopicsResponse": { + "description": "Response for the ListTopics method.", + "type": "object", "properties": { - "subscription": { - "description": "The subscription whose message is being acknowledged.", - "type": "string" - }, - "ackId": { - "description": "The acknowledgment ID for the message being acknowledged. This was\nreturned by the Pub/Sub system in the Pull response.", - "type": "array", + "topic": { + "description": "The resulting topics.", "items": { - "type": "string" - } + "$ref": "Topic" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If not empty, indicates that there are more topics that match the request,\nand this value should be passed to the next \u003ccode\u003eListTopicsRequest\u003c/code\u003e\nto continue.", + "type": "string" } }, - "id": "AcknowledgeRequest", - "description": "Request for the Acknowledge method.", - "type": "object" + "id": "ListTopicsResponse" }, "PublishBatchRequest": { "description": "Request for the PublishBatch method.", @@ -553,10 +561,10 @@ "properties": { "messages": { "description": "The messages to publish.", - "type": "array", "items": { "$ref": "PubsubMessage" - } + }, + "type": "array" }, "topic": { "description": "The messages in the request will be published on this topic.", @@ -565,23 +573,23 @@ }, "id": "PublishBatchRequest" }, - "ListTopicsResponse": { - "description": "Response for the ListTopics method.", + "AcknowledgeRequest": { + "description": "Request for the Acknowledge method.", "type": "object", "properties": { - "nextPageToken": { - "type": "string", - "description": "If not empty, indicates that there are more topics that match the request,\nand this value should be passed to the next \u003ccode\u003eListTopicsRequest\u003c/code\u003e\nto continue." + "subscription": { + "description": "The subscription whose message is being acknowledged.", + "type": "string" }, - "topic": { - "description": "The resulting topics.", - "type": "array", + "ackId": { + "description": "The acknowledgment ID for the message being acknowledged. This was\nreturned by the Pub/Sub system in the Pull response.", "items": { - "$ref": "Topic" - } + "type": "string" + }, + "type": "array" } }, - "id": "ListTopicsResponse" + "id": "AcknowledgeRequest" }, "PullBatchResponse": { "description": "Response for the PullBatch method.", @@ -589,10 +597,10 @@ "properties": { "pullResponses": { "description": "Received Pub/Sub messages or status events. The Pub/Sub system will return\nzero messages if there are no more messages available in the backlog. The\nPub/Sub system may return fewer than the max_events requested even if\nthere are more messages available in the backlog.", - "type": "array", "items": { "$ref": "PullResponse" - } + }, + "type": "array" } }, "id": "PullBatchResponse" @@ -604,6 +612,8 @@ "id": "Empty" }, "PullResponse": { + "description": "Either a \u003ccode\u003ePubsubMessage\u003c/code\u003e or a truncation event. One of these two\nmust be populated.", + "type": "object", "properties": { "ackId": { "description": "This ID must be used to acknowledge the received event or message.", @@ -614,15 +624,13 @@ "$ref": "PubsubEvent" } }, - "id": "PullResponse", - "description": "Either a \u003ccode\u003ePubsubMessage\u003c/code\u003e or a truncation event. One of these two\nmust be populated.", - "type": "object" + "id": "PullResponse" }, "PushConfig": { "properties": { "pushEndpoint": { - "type": "string", - "description": "A URL locating the endpoint to which messages should be pushed.\nFor example, a Webhook endpoint might use \"https://example.com/push\"." + "description": "A URL locating the endpoint to which messages should be pushed.\nFor example, a Webhook endpoint might use \"https://example.com/push\".", + "type": "string" } }, "id": "PushConfig", @@ -630,6 +638,7 @@ "type": "object" }, "PullRequest": { + "id": "PullRequest", "description": "Request for the Pull method.", "type": "object", "properties": { @@ -638,11 +647,33 @@ "type": "string" }, "returnImmediately": { - "description": "If this is specified as true the system will respond immediately even if\nit is not able to return a message in the Pull response. Otherwise the\nsystem is allowed to wait until at least one message is available rather\nthan returning FAILED_PRECONDITION. The client may cancel the request if\nit does not wish to wait any longer for the response.", - "type": "boolean" + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if\nit is not able to return a message in the Pull response. Otherwise the\nsystem is allowed to wait until at least one message is available rather\nthan returning FAILED_PRECONDITION. The client may cancel the request if\nit does not wish to wait any longer for the response." } - }, - "id": "PullRequest" + } + }, + "PubsubEvent": { + "id": "PubsubEvent", + "description": "An event indicating a received message or truncation event.", + "type": "object", + "properties": { + "deleted": { + "description": "Indicates that this subscription has been deleted. (Note that pull\nsubscribers will always receive NOT_FOUND in response in their pull\nrequest on the subscription, rather than seeing this boolean.)", + "type": "boolean" + }, + "truncated": { + "type": "boolean", + "description": "Indicates that this subscription has been truncated." + }, + "message": { + "description": "A received message.", + "$ref": "PubsubMessage" + }, + "subscription": { + "description": "The subscription that received the event.", + "type": "string" + } + } }, "ListSubscriptionsResponse": { "description": "Response for the ListSubscriptions method.", @@ -653,39 +684,17 @@ "type": "string" }, "subscription": { - "description": "The subscriptions that match the request.", - "type": "array", "items": { "$ref": "Subscription" - } + }, + "type": "array", + "description": "The subscriptions that match the request." } }, "id": "ListSubscriptionsResponse" }, - "PubsubEvent": { - "properties": { - "truncated": { - "description": "Indicates that this subscription has been truncated.", - "type": "boolean" - }, - "deleted": { - "description": "Indicates that this subscription has been deleted. (Note that pull\nsubscribers will always receive NOT_FOUND in response in their pull\nrequest on the subscription, rather than seeing this boolean.)", - "type": "boolean" - }, - "message": { - "$ref": "PubsubMessage", - "description": "A received message." - }, - "subscription": { - "description": "The subscription that received the event.", - "type": "string" - } - }, - "id": "PubsubEvent", - "description": "An event indicating a received message or truncation event.", - "type": "object" - }, "PublishRequest": { + "description": "Request for the Publish method.", "type": "object", "properties": { "message": { @@ -697,17 +706,16 @@ "type": "string" } }, - "id": "PublishRequest", - "description": "Request for the Publish method." + "id": "PublishRequest" }, "PublishBatchResponse": { "properties": { "messageIds": { "description": "The server-assigned ID of each published message, in the same order as\nthe messages in the request. IDs are guaranteed to be unique within\nthe topic.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "PublishBatchResponse", @@ -715,31 +723,30 @@ "type": "object" }, "Subscription": { + "description": "A subscription resource.", "type": "object", "properties": { - "topic": { - "description": "The name of the topic from which this subscription is receiving messages.", - "type": "string" - }, - "pushConfig": { - "description": "If push delivery is used with this subscription, this field is\nused to configure it.", - "$ref": "PushConfig" - }, "ackDeadlineSeconds": { - "description": "For either push or pull delivery, the value is the maximum time after a\nsubscriber receives a message before the subscriber should acknowledge or\nNack the message. If the Ack deadline for a message passes without an\nAck or a Nack, the Pub/Sub system will eventually redeliver the message.\nIf a subscriber acknowledges after the deadline, the Pub/Sub system may\naccept the Ack, but it is possible that the message has been already\ndelivered again. Multiple Acks to the message are allowed and will\nsucceed.\n\nFor push delivery, this value is used to set the request timeout for\nthe call to the push endpoint.\n\nFor pull delivery, this value is used as the initial value for the Ack\ndeadline. It may be overridden for each message using its corresponding\nack_id with \u003ccode\u003eModifyAckDeadline\u003c/code\u003e.\nWhile a message is outstanding (i.e. it has been delivered to a pull\nsubscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub\nsystem will not deliver that message to another pull subscriber\n(on a best-effort basis).", "format": "int32", + "description": "For either push or pull delivery, the value is the maximum time after a\nsubscriber receives a message before the subscriber should acknowledge or\nNack the message. If the Ack deadline for a message passes without an\nAck or a Nack, the Pub/Sub system will eventually redeliver the message.\nIf a subscriber acknowledges after the deadline, the Pub/Sub system may\naccept the Ack, but it is possible that the message has been already\ndelivered again. Multiple Acks to the message are allowed and will\nsucceed.\n\nFor push delivery, this value is used to set the request timeout for\nthe call to the push endpoint.\n\nFor pull delivery, this value is used as the initial value for the Ack\ndeadline. It may be overridden for each message using its corresponding\nack_id with \u003ccode\u003eModifyAckDeadline\u003c/code\u003e.\nWhile a message is outstanding (i.e. it has been delivered to a pull\nsubscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub\nsystem will not deliver that message to another pull subscriber\n(on a best-effort basis).", "type": "integer" }, "name": { "description": "Name of the subscription.", "type": "string" + }, + "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\nused to configure it." } }, - "id": "Subscription", - "description": "A subscription resource." + "id": "Subscription" }, "Topic": { - "id": "Topic", "description": "A topic resource.", "type": "object", "properties": { @@ -747,7 +754,8 @@ "description": "Name of the topic.", "type": "string" } - } + }, + "id": "Topic" }, "Label": { "description": "A key-value pair applied to a given object.", @@ -758,8 +766,8 @@ "type": "string" }, "numValue": { - "description": "An integer value.", "format": "int64", + "description": "An integer value.", "type": "string" }, "key": { @@ -770,11 +778,11 @@ "id": "Label" } }, - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, "version": "v1beta1a", "baseUrl": "https://pubsub.googleapis.com/", "canonicalName": "Pubsub", @@ -795,13 +803,5 @@ "kind": "discovery#restDescription", "rootUrl": "https://pubsub.googleapis.com/", "basePath": "", - "ownerDomain": "google.com", - "name": "pubsub", - "batchPath": "batch", - "id": "pubsub:v1beta1a", - "documentationLink": "https://cloud.google.com/pubsub/docs", - "revision": "20170502", - "title": "Google Cloud Pub/Sub API", - "discoveryVersion": "v1", - "ownerName": "Google" + "ownerDomain": "google.com" } diff --git a/etc/api/pubsub/v1beta2/crates/1.0.6-api+20170829 b/etc/api/pubsub/v1beta2/crates/1.0.6-api+20170829 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/pubsub/v1beta2/crates/1.0.6-cli+20170829 b/etc/api/pubsub/v1beta2/crates/1.0.6-cli+20170829 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/pubsub/v1beta2/pubsub-api.json b/etc/api/pubsub/v1beta2/pubsub-api.json index 454a70b305..63b1e46d0b 100644 --- a/etc/api/pubsub/v1beta2/pubsub-api.json +++ b/etc/api/pubsub/v1beta2/pubsub-api.json @@ -1,59 +1,919 @@ { - "schemas": { - "Policy": { - "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", - "type": "object", - "properties": { - "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", - "items": { - "$ref": "Binding" + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "version": "v1beta2", + "baseUrl": "https://pubsub.googleapis.com/", + "canonicalName": "Pubsub", + "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/pubsub": { + "description": "View and manage Pub/Sub topics and subscriptions" + } + } + } + }, + "servicePath": "", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n", + "kind": "discovery#restDescription", + "rootUrl": "https://pubsub.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "pubsub", + "batchPath": "batch", + "id": "pubsub:v1beta2", + "documentationLink": "https://cloud.google.com/pubsub/docs", + "revision": "20170829", + "title": "Google Cloud Pub/Sub API", + "discoveryVersion": "v1", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "topics": { + "methods": { + "delete": { + "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic\ndoes not exist. After a topic is deleted, a new topic may be created with\nthe same name; this is an entirely new topic with none of the old\nconfiguration or subscriptions. Existing subscriptions to this topic are\nnot deleted, but their `topic` field is set to `_deleted-topic_`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "topic": { + "description": "Name of the topic to delete.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", + "id": "pubsub.projects.topics.delete", + "path": "v1beta2/{+topic}" + }, + "list": { + "id": "pubsub.projects.topics.list", + "path": "v1beta2/{+project}/topics", + "description": "Lists matching topics.", + "response": { + "$ref": "ListTopicsResponse" + }, + "parameterOrder": [ + "project" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "pageToken": { + "description": "The value returned by the last `ListTopicsResponse`; indicates that this is\na continuation of a prior `ListTopics` call, and that the system should\nreturn the next page of data.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of topics to return.", + "type": "integer", + "location": "query" + }, + "project": { + "description": "The name of the cloud project that topics belong to.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics" + }, + "create": { + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "name": { + "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", + "path": "v1beta2/{+name}", + "id": "pubsub.projects.topics.create", + "request": { + "$ref": "Topic" + }, + "description": "Creates the given topic with the given name." + }, + "setIamPolicy": { + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "id": "pubsub.projects.topics.setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + } + }, + "getIamPolicy": { + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:getIamPolicy", + "id": "pubsub.projects.topics.getIamPolicy", + "path": "v1beta2/{+resource}:getIamPolicy" + }, + "get": { + "description": "Gets the configuration of a topic.", + "httpMethod": "GET", + "response": { + "$ref": "Topic" + }, + "parameterOrder": [ + "topic" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "topic": { + "description": "The name of the topic to get.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", + "path": "v1beta2/{+topic}", + "id": "pubsub.projects.topics.get" + }, + "publish": { + "request": { + "$ref": "PublishRequest" + }, + "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic\ndoes not exist. The message payload must not be empty; it must contain\n either a non-empty data field, or at least one attribute.", + "httpMethod": "POST", + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "topic": { + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "The messages in the request will be published on this topic.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:publish", + "path": "v1beta2/{+topic}:publish", + "id": "pubsub.projects.topics.publish" + }, + "testIamPermissions": { + "id": "pubsub.projects.topics.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:testIamPermissions" + } + }, + "resources": { + "subscriptions": { + "methods": { + "list": { + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "pageToken": { + "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSubscriptions` call, and\nthat the system should return the next page of data.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Maximum number of subscription names to return.", + "type": "integer", + "location": "query" + }, + "topic": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "The name of the topic that subscriptions are attached to." + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}/subscriptions", + "id": "pubsub.projects.topics.subscriptions.list", + "path": "v1beta2/{+topic}/subscriptions", + "description": "Lists the name of the subscriptions for this topic." + } + } + } } }, - "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", - "format": "byte", - "type": "string" + "subscriptions": { + "methods": { + "acknowledge": { + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge", + "id": "pubsub.projects.subscriptions.acknowledge", + "path": "v1beta2/{+subscription}:acknowledge", + "request": { + "$ref": "AcknowledgeRequest" + }, + "description": "Acknowledges the messages associated with the `ack_ids` in the\n`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages\nfrom the subscription.\n\nAcknowledging a message whose ack deadline has expired may succeed,\nbut such a message may be redelivered later. Acknowledging a message more\nthan once will not result in an error.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "The subscription whose message is being acknowledged." + } + } + }, + "modifyAckDeadline": { + "description": "Modifies the ack deadline for a specific message. This method is useful\nto indicate that more time is needed to process a message by the\nsubscriber, or to make the message available for redelivery if the\nprocessing was interrupted. Note that this does not modify the\nsubscription-level `ackDeadlineSeconds` used for subsequent messages.", + "request": { + "$ref": "ModifyAckDeadlineRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "subscription": { + "description": "The name of the subscription.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline", + "path": "v1beta2/{+subscription}:modifyAckDeadline", + "id": "pubsub.projects.subscriptions.modifyAckDeadline" + }, + "getIamPolicy": { + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:getIamPolicy", + "id": "pubsub.projects.subscriptions.getIamPolicy", + "path": "v1beta2/{+resource}:getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + } + }, + "get": { + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", + "path": "v1beta2/{+subscription}", + "id": "pubsub.projects.subscriptions.get", + "description": "Gets the configuration details of a subscription.", + "httpMethod": "GET", + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "subscription" + ], + "parameters": { + "subscription": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "The name of the subscription to get." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "id": "pubsub.projects.subscriptions.testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." + }, + "modifyPushConfig": { + "description": "Modifies the `PushConfig` for a specified subscription.\n\nThis may be used to change a push subscription to a pull one (signified by\nan empty `PushConfig`) or vice versa, or change the endpoint URL and other\nattributes of a push subscription. Messages will accumulate for delivery\ncontinuously through the call regardless of changes to the `PushConfig`.", + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "POST", + "parameters": { + "subscription": { + "description": "The name of the subscription.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig", + "id": "pubsub.projects.subscriptions.modifyPushConfig", + "path": "v1beta2/{+subscription}:modifyPushConfig" + }, + "pull": { + "id": "pubsub.projects.subscriptions.pull", + "path": "v1beta2/{+subscription}:pull", + "description": "Pulls messages from the server. Returns an empty list if there are no\nmessages available in the backlog. The server may return `UNAVAILABLE` if\nthere are too many concurrent pull requests pending for the given\nsubscription.", + "request": { + "$ref": "PullRequest" + }, + "response": { + "$ref": "PullResponse" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "POST", + "parameters": { + "subscription": { + "description": "The subscription from which messages should be pulled.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:pull" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "The subscription to delete.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", + "id": "pubsub.projects.subscriptions.delete", + "path": "v1beta2/{+subscription}", + "description": "Deletes an existing subscription. All pending messages in the subscription\nare immediately dropped. Calls to `Pull` after deletion will return\n`NOT_FOUND`. After a subscription is deleted, a new one may be created with\nthe same name, but the new one has no association with the old\nsubscription, or its topic unless the same topic is specified." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "parameters": { + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that\nthis is a continuation of a prior `ListSubscriptions` call, and that the\nsystem should return the next page of data.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Maximum number of subscriptions to return.", + "type": "integer" + }, + "project": { + "description": "The name of the cloud project that subscriptions belong to.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/subscriptions", + "path": "v1beta2/{+project}/subscriptions", + "id": "pubsub.projects.subscriptions.list", + "description": "Lists matching subscriptions." + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "resource": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field." + } + }, + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "id": "pubsub.projects.subscriptions.setIamPolicy" + }, + "create": { + "path": "v1beta2/{+name}", + "id": "pubsub.projects.subscriptions.create", + "request": { + "$ref": "Subscription" + }, + "description": "Creates a subscription to a given topic.\nIf the subscription already exists, returns `ALREADY_EXISTS`.\nIf the corresponding topic doesn't exist, returns `NOT_FOUND`.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic. Note that\nfor REST API requests, you must specify a name.", + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "name": { + "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}" + } + } + } + } + } + }, + "parameters": { + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + } + }, + "schemas": { + "PushConfig": { + "description": "Configuration for a push delivery endpoint.", + "type": "object", + "properties": { + "attributes": { + "description": "Endpoint configuration attributes.\n\nEvery endpoint has a set of API supported attributes that can be used to\ncontrol different aspects of the message delivery.\n\nThe currently supported attribute is `x-goog-version`, which you can\nuse to change the format of the push message. This attribute\nindicates the version of the data expected by the endpoint. This\ncontrols the shape of the envelope (i.e. its fields and metadata).\nThe endpoint version is based on the version of the Pub/Sub\nAPI.\n\nIf not present during the `CreateSubscription` call, it will default to\nthe version of the API used to make such call. If not present during a\n`ModifyPushConfig` call, its value will not be changed. `GetSubscription`\ncalls will always return a valid version, even if the subscription was\ncreated without this attribute.\n\nThe possible values for this attribute are:\n\n* `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.\n* `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "version": { - "description": "Version of the `Policy`. The default version is 0.", + "pushEndpoint": { + "description": "A URL locating the endpoint to which messages should be pushed.\nFor example, a Webhook endpoint might use \"https://example.com/push\".", + "type": "string" + } + }, + "id": "PushConfig" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsResponse" + }, + "PullRequest": { + "description": "Request for the `Pull` method.", + "type": "object", + "properties": { + "returnImmediately": { + "description": "If this is specified as true the system will respond immediately even if\nit is not able to return a message in the `Pull` response. Otherwise the\nsystem is allowed to wait until at least one message is available rather\nthan returning no messages. The client may cancel the request if it does\nnot wish to wait any longer for the response.", + "type": "boolean" + }, + "maxMessages": { "format": "int32", + "description": "The maximum number of messages returned for this request. The Pub/Sub\nsystem may return fewer than the number specified.", "type": "integer" } }, - "id": "Policy" + "id": "PullRequest" + }, + "ListSubscriptionsResponse": { + "properties": { + "nextPageToken": { + "description": "If not empty, indicates that there may be more subscriptions that match\nthe request; this value should be passed in a new\n`ListSubscriptionsRequest` to get more subscriptions.", + "type": "string" + }, + "subscriptions": { + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + }, + "type": "array" + } + }, + "id": "ListSubscriptionsResponse", + "description": "Response for the `ListSubscriptions` method.", + "type": "object" + }, + "PublishRequest": { + "type": "object", + "properties": { + "messages": { + "items": { + "$ref": "PubsubMessage" + }, + "type": "array", + "description": "The messages to publish." + } + }, + "id": "PublishRequest", + "description": "Request for the Publish method." + }, + "PublishResponse": { + "description": "Response for the `Publish` method.", + "type": "object", + "properties": { + "messageIds": { + "description": "The server-assigned ID of each published message, in the same order as\nthe messages in the request. IDs are guaranteed to be unique within\nthe topic.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "PublishResponse" + }, + "Subscription": { + "description": "A subscription resource.", + "type": "object", + "properties": { + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is\nused to configure it. An empty `pushConfig` signifies that the subscriber\nwill pull and ack messages using API methods." + }, + "ackDeadlineSeconds": { + "format": "int32", + "description": "This value is the maximum time after a subscriber receives a message\nbefore the subscriber should acknowledge the message. After message\ndelivery but before the ack deadline expires and before the message is\nacknowledged, it is an outstanding message and will not be delivered\nagain during that time (on a best-effort basis).\n\nFor pull subscriptions, this value is used as the initial value for the ack\ndeadline. To override this value for a given message, call\n`ModifyAckDeadline` with the corresponding `ack_id` if using pull.\nThe maximum custom deadline you can specify is 600 seconds (10 minutes).\n\nFor push delivery, this value is also used to set the request timeout for\nthe call to the push endpoint.\n\nIf the subscriber never acknowledges the message, the Pub/Sub\nsystem will eventually redeliver the message.\n\nIf this parameter is 0, a default value of 10 seconds is used.", + "type": "integer" + }, + "name": { + "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", + "type": "string" + }, + "topic": { + "description": "The name of the topic from which this subscription is receiving messages.\nThe value of this field will be `_deleted-topic_` if the topic has been\ndeleted.", + "type": "string" + } + }, + "id": "Subscription" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest" + }, + "Policy": { + "id": "Policy", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + } + } }, "Topic": { - "description": "A topic resource.", - "type": "object", "properties": { "name": { "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", "type": "string" } }, - "id": "Topic" + "id": "Topic", + "description": "A topic resource.", + "type": "object" }, "ModifyAckDeadlineRequest": { "description": "Request for the ModifyAckDeadline method.", "type": "object", "properties": { + "ackIds": { + "description": "List of acknowledgment IDs.", + "items": { + "type": "string" + }, + "type": "array" + }, "ackId": { "description": "The acknowledgment ID. Either this or ack_ids must be populated, but not\nboth.", "type": "string" }, "ackDeadlineSeconds": { - "description": "The new ack deadline with respect to the time this request was sent to\nthe Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new\nack deadline will expire 10 seconds after the `ModifyAckDeadline` call\nwas made. Specifying zero may immediately make the message available for\nanother pull request.", + "type": "integer", "format": "int32", - "type": "integer" - }, - "ackIds": { - "description": "List of acknowledgment IDs.", - "type": "array", - "items": { - "type": "string" - } + "description": "The new ack deadline with respect to the time this request was sent to\nthe Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new\nack deadline will expire 10 seconds after the `ModifyAckDeadline` call\nwas made. Specifying zero may immediately make the message available for\nanother pull request." } }, "id": "ModifyAckDeadlineRequest" @@ -73,9 +933,18 @@ "description": "A message data and its attributes. The message payload must not be empty;\nit must contain either a non-empty data field, or at least one attribute.", "type": "object", "properties": { + "publishTime": { + "format": "google-datetime", + "description": "The time at which the message was published, populated by the server when\nit receives the `Publish` call. It must not be populated by the\npublisher in a `Publish` call.", + "type": "string" + }, "data": { - "description": "The message payload. For JSON requests, the value of this field must be\n[base64-encoded](https://tools.ietf.org/html/rfc4648).", "format": "byte", + "description": "The message payload. For JSON requests, the value of this field must be\n[base64-encoded](https://tools.ietf.org/html/rfc4648).", + "type": "string" + }, + "messageId": { + "description": "ID of this message, assigned by the server when the message is published.\nGuaranteed to be unique within the topic. This value may be read by a\nsubscriber that receives a `PubsubMessage` via a `Pull` call or a push\ndelivery. It must not be populated by the publisher in a `Publish` call.", "type": "string" }, "attributes": { @@ -84,21 +953,11 @@ }, "description": "Optional attributes for this message.", "type": "object" - }, - "messageId": { - "description": "ID of this message, assigned by the server when the message is published.\nGuaranteed to be unique within the topic. This value may be read by a\nsubscriber that receives a `PubsubMessage` via a `Pull` call or a push\ndelivery. It must not be populated by the publisher in a `Publish` call.", - "type": "string" - }, - "publishTime": { - "description": "The time at which the message was published, populated by the server when\nit receives the `Publish` call. It must not be populated by the\npublisher in a `Publish` call.", - "format": "google-datetime", - "type": "string" } }, "id": "PubsubMessage" }, "ModifyPushConfigRequest": { - "description": "Request for the ModifyPushConfig method.", "type": "object", "properties": { "pushConfig": { @@ -106,45 +965,26 @@ "$ref": "PushConfig" } }, - "id": "ModifyPushConfigRequest" + "id": "ModifyPushConfigRequest", + "description": "Request for the ModifyPushConfig method." }, "Binding": { - "description": "Associates `members` with a `role`.", - "type": "object", "properties": { "members": { - "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", "items": { "type": "string" - } + }, + "type": "array" }, "role": { "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", "type": "string" } }, - "id": "Binding" - }, - "AcknowledgeRequest": { - "description": "Request for the Acknowledge method.", - "type": "object", - "properties": { - "ackIds": { - "description": "The acknowledgment ID for the messages being acknowledged that was returned\nby the Pub/Sub system in the `Pull` response. Must not be empty.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "AcknowledgeRequest" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" + "id": "Binding", + "description": "Associates `members` with a `role`.", + "type": "object" }, "ListTopicsResponse": { "description": "Response for the `ListTopics` method.", @@ -156,14 +996,34 @@ }, "topics": { "description": "The resulting topics.", - "type": "array", "items": { "$ref": "Topic" - } + }, + "type": "array" } }, "id": "ListTopicsResponse" }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "AcknowledgeRequest": { + "description": "Request for the Acknowledge method.", + "type": "object", + "properties": { + "ackIds": { + "description": "The acknowledgment ID for the messages being acknowledged that was returned\nby the Pub/Sub system in the `Pull` response. Must not be empty.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "AcknowledgeRequest" + }, "ListTopicSubscriptionsResponse": { "description": "Response for the `ListTopicSubscriptions` method.", "type": "object", @@ -174,10 +1034,10 @@ }, "subscriptions": { "description": "The names of the subscriptions that match the request.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "ListTopicSubscriptionsResponse" @@ -188,888 +1048,28 @@ "properties": { "receivedMessages": { "description": "Received Pub/Sub messages. The Pub/Sub system will return zero messages if\nthere are no more available in the backlog. The Pub/Sub system may return\nfewer than the `maxMessages` requested even if there are more messages\navailable in the backlog.", - "type": "array", "items": { "$ref": "ReceivedMessage" - } + }, + "type": "array" } }, "id": "PullResponse" }, "ReceivedMessage": { + "id": "ReceivedMessage", "description": "A message and its corresponding acknowledgment ID.", "type": "object", "properties": { - "ackId": { - "description": "This ID can be used to acknowledge the received message.", - "type": "string" - }, "message": { "$ref": "PubsubMessage", "description": "The message." - } - }, - "id": "ReceivedMessage" - }, - "PushConfig": { - "description": "Configuration for a push delivery endpoint.", - "type": "object", - "properties": { - "pushEndpoint": { - "description": "A URL locating the endpoint to which messages should be pushed.\nFor example, a Webhook endpoint might use \"https://example.com/push\".", + }, + "ackId": { + "description": "This ID can be used to acknowledge the received message.", "type": "string" - }, - "attributes": { - "additionalProperties": { - "type": "string" - }, - "description": "Endpoint configuration attributes.\n\nEvery endpoint has a set of API supported attributes that can be used to\ncontrol different aspects of the message delivery.\n\nThe currently supported attribute is `x-goog-version`, which you can\nuse to change the format of the push message. This attribute\nindicates the version of the data expected by the endpoint. This\ncontrols the shape of the envelope (i.e. its fields and metadata).\nThe endpoint version is based on the version of the Pub/Sub\nAPI.\n\nIf not present during the `CreateSubscription` call, it will default to\nthe version of the API used to make such call. If not present during a\n`ModifyPushConfig` call, its value will not be changed. `GetSubscription`\ncalls will always return a valid version, even if the subscription was\ncreated without this attribute.\n\nThe possible values for this attribute are:\n\n* `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.\n* `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", - "type": "object" - } - }, - "id": "PushConfig" - }, - "TestIamPermissionsResponse": { - "description": "Response message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "TestIamPermissionsResponse" - }, - "PullRequest": { - "description": "Request for the `Pull` method.", - "type": "object", - "properties": { - "returnImmediately": { - "description": "If this is specified as true the system will respond immediately even if\nit is not able to return a message in the `Pull` response. Otherwise the\nsystem is allowed to wait until at least one message is available rather\nthan returning no messages. The client may cancel the request if it does\nnot wish to wait any longer for the response.", - "type": "boolean" - }, - "maxMessages": { - "description": "The maximum number of messages returned for this request. The Pub/Sub\nsystem may return fewer than the number specified.", - "format": "int32", - "type": "integer" - } - }, - "id": "PullRequest" - }, - "ListSubscriptionsResponse": { - "description": "Response for the `ListSubscriptions` method.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If not empty, indicates that there may be more subscriptions that match\nthe request; this value should be passed in a new\n`ListSubscriptionsRequest` to get more subscriptions.", - "type": "string" - }, - "subscriptions": { - "description": "The subscriptions that match the request.", - "type": "array", - "items": { - "$ref": "Subscription" - } - } - }, - "id": "ListSubscriptionsResponse" - }, - "PublishRequest": { - "description": "Request for the Publish method.", - "type": "object", - "properties": { - "messages": { - "description": "The messages to publish.", - "type": "array", - "items": { - "$ref": "PubsubMessage" - } - } - }, - "id": "PublishRequest" - }, - "PublishResponse": { - "description": "Response for the `Publish` method.", - "type": "object", - "properties": { - "messageIds": { - "description": "The server-assigned ID of each published message, in the same order as\nthe messages in the request. IDs are guaranteed to be unique within\nthe topic.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "PublishResponse" - }, - "Subscription": { - "description": "A subscription resource.", - "type": "object", - "properties": { - "ackDeadlineSeconds": { - "description": "This value is the maximum time after a subscriber receives a message\nbefore the subscriber should acknowledge the message. After message\ndelivery but before the ack deadline expires and before the message is\nacknowledged, it is an outstanding message and will not be delivered\nagain during that time (on a best-effort basis).\n\nFor pull subscriptions, this value is used as the initial value for the ack\ndeadline. To override this value for a given message, call\n`ModifyAckDeadline` with the corresponding `ack_id` if using pull.\nThe maximum custom deadline you can specify is 600 seconds (10 minutes).\n\nFor push delivery, this value is also used to set the request timeout for\nthe call to the push endpoint.\n\nIf the subscriber never acknowledges the message, the Pub/Sub\nsystem will eventually redeliver the message.\n\nIf this parameter is 0, a default value of 10 seconds is used.", - "format": "int32", - "type": "integer" - }, - "name": { - "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", - "type": "string" - }, - "topic": { - "description": "The name of the topic from which this subscription is receiving messages.\nThe value of this field will be `_deleted-topic_` if the topic has been\ndeleted.", - "type": "string" - }, - "pushConfig": { - "$ref": "PushConfig", - "description": "If push delivery is used with this subscription, this field is\nused to configure it. An empty `pushConfig` signifies that the subscriber\nwill pull and ack messages using API methods." - } - }, - "id": "Subscription" - }, - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "TestIamPermissionsRequest" - } - }, - "protocol": "rest", - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, - "version": "v1beta2", - "baseUrl": "https://pubsub.googleapis.com/", - "canonicalName": "Pubsub", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/pubsub": { - "description": "View and manage Pub/Sub topics and subscriptions" - }, - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" } } } - }, - "kind": "discovery#restDescription", - "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n", - "servicePath": "", - "rootUrl": "https://pubsub.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "pubsub", - "batchPath": "batch", - "revision": "20170502", - "documentationLink": "https://cloud.google.com/pubsub/docs", - "id": "pubsub:v1beta2", - "title": "Google Cloud Pub/Sub API", - "discoveryVersion": "v1", - "ownerName": "Google", - "resources": { - "projects": { - "resources": { - "topics": { - "methods": { - "getIamPolicy": { - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "GET", - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:getIamPolicy", - "path": "v1beta2/{+resource}:getIamPolicy", - "id": "pubsub.projects.topics.getIamPolicy" - }, - "get": { - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", - "id": "pubsub.projects.topics.get", - "path": "v1beta2/{+topic}", - "description": "Gets the configuration of a topic.", - "httpMethod": "GET", - "parameterOrder": [ - "topic" - ], - "response": { - "$ref": "Topic" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "topic": { - "description": "The name of the topic to get.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - } - }, - "publish": { - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:publish", - "path": "v1beta2/{+topic}:publish", - "id": "pubsub.projects.topics.publish", - "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic\ndoes not exist. The message payload must not be empty; it must contain\n either a non-empty data field, or at least one attribute.", - "request": { - "$ref": "PublishRequest" - }, - "response": { - "$ref": "PublishResponse" - }, - "parameterOrder": [ - "topic" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "topic": { - "description": "The messages in the request will be published on this topic.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - } - }, - "testIamPermissions": { - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:testIamPermissions", - "id": "pubsub.projects.topics.testIamPermissions", - "path": "v1beta2/{+resource}:testIamPermissions" - }, - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "topic" - ], - "httpMethod": "DELETE", - "parameters": { - "topic": { - "description": "Name of the topic to delete.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", - "path": "v1beta2/{+topic}", - "id": "pubsub.projects.topics.delete", - "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic\ndoes not exist. After a topic is deleted, a new topic may be created with\nthe same name; this is an entirely new topic with none of the old\nconfiguration or subscriptions. Existing subscriptions to this topic are\nnot deleted, but their `topic` field is set to `_deleted-topic_`." - }, - "list": { - "description": "Lists matching topics.", - "response": { - "$ref": "ListTopicsResponse" - }, - "parameterOrder": [ - "project" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "pageSize": { - "description": "Maximum number of topics to return.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "project": { - "location": "path", - "description": "The name of the cloud project that topics belong to.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - }, - "pageToken": { - "description": "The value returned by the last `ListTopicsResponse`; indicates that this is\na continuation of a prior `ListTopics` call, and that the system should\nreturn the next page of data.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/topics", - "path": "v1beta2/{+project}/topics", - "id": "pubsub.projects.topics.list" - }, - "setIamPolicy": { - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:setIamPolicy", - "path": "v1beta2/{+resource}:setIamPolicy", - "id": "pubsub.projects.topics.setIamPolicy", - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "request": { - "$ref": "SetIamPolicyRequest" - } - }, - "create": { - "response": { - "$ref": "Topic" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "PUT", - "parameters": { - "name": { - "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", - "path": "v1beta2/{+name}", - "id": "pubsub.projects.topics.create", - "request": { - "$ref": "Topic" - }, - "description": "Creates the given topic with the given name." - } - }, - "resources": { - "subscriptions": { - "methods": { - "list": { - "description": "Lists the name of the subscriptions for this topic.", - "httpMethod": "GET", - "parameterOrder": [ - "topic" - ], - "response": { - "$ref": "ListTopicSubscriptionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "pageSize": { - "description": "Maximum number of subscription names to return.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "topic": { - "location": "path", - "description": "The name of the topic that subscriptions are attached to.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/topics/[^/]+$" - }, - "pageToken": { - "location": "query", - "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSubscriptions` call, and\nthat the system should return the next page of data.", - "type": "string" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}/subscriptions", - "id": "pubsub.projects.topics.subscriptions.list", - "path": "v1beta2/{+topic}/subscriptions" - } - } - } - } - }, - "subscriptions": { - "methods": { - "acknowledge": { - "description": "Acknowledges the messages associated with the `ack_ids` in the\n`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages\nfrom the subscription.\n\nAcknowledging a message whose ack deadline has expired may succeed,\nbut such a message may be redelivered later. Acknowledging a message more\nthan once will not result in an error.", - "request": { - "$ref": "AcknowledgeRequest" - }, - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "subscription" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "location": "path", - "description": "The subscription whose message is being acknowledged.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge", - "path": "v1beta2/{+subscription}:acknowledge", - "id": "pubsub.projects.subscriptions.acknowledge" - }, - "modifyAckDeadline": { - "request": { - "$ref": "ModifyAckDeadlineRequest" - }, - "description": "Modifies the ack deadline for a specific message. This method is useful\nto indicate that more time is needed to process a message by the\nsubscriber, or to make the message available for redelivery if the\nprocessing was interrupted. Note that this does not modify the\nsubscription-level `ackDeadlineSeconds` used for subsequent messages.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "subscription" - ], - "httpMethod": "POST", - "parameters": { - "subscription": { - "location": "path", - "description": "The name of the subscription.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline", - "path": "v1beta2/{+subscription}:modifyAckDeadline", - "id": "pubsub.projects.subscriptions.modifyAckDeadline" - }, - "getIamPolicy": { - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:getIamPolicy", - "path": "v1beta2/{+resource}:getIamPolicy", - "id": "pubsub.projects.subscriptions.getIamPolicy" - }, - "get": { - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", - "id": "pubsub.projects.subscriptions.get", - "path": "v1beta2/{+subscription}", - "description": "Gets the configuration details of a subscription.", - "httpMethod": "GET", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Subscription" - }, - "parameters": { - "subscription": { - "location": "path", - "description": "The name of the subscription to get.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "testIamPermissions": { - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:testIamPermissions", - "path": "v1beta2/{+resource}:testIamPermissions", - "id": "pubsub.projects.subscriptions.testIamPermissions", - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - } - }, - "modifyPushConfig": { - "description": "Modifies the `PushConfig` for a specified subscription.\n\nThis may be used to change a push subscription to a pull one (signified by\nan empty `PushConfig`) or vice versa, or change the endpoint URL and other\nattributes of a push subscription. Messages will accumulate for delivery\ncontinuously through the call regardless of changes to the `PushConfig`.", - "request": { - "$ref": "ModifyPushConfigRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "description": "The name of the subscription.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig", - "id": "pubsub.projects.subscriptions.modifyPushConfig", - "path": "v1beta2/{+subscription}:modifyPushConfig" - }, - "delete": { - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", - "id": "pubsub.projects.subscriptions.delete", - "path": "v1beta2/{+subscription}", - "description": "Deletes an existing subscription. All pending messages in the subscription\nare immediately dropped. Calls to `Pull` after deletion will return\n`NOT_FOUND`. After a subscription is deleted, a new one may be created with\nthe same name, but the new one has no association with the old\nsubscription, or its topic unless the same topic is specified.", - "httpMethod": "DELETE", - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "subscription": { - "location": "path", - "description": "The subscription to delete.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - } - }, - "pull": { - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:pull", - "path": "v1beta2/{+subscription}:pull", - "id": "pubsub.projects.subscriptions.pull", - "request": { - "$ref": "PullRequest" - }, - "description": "Pulls messages from the server. Returns an empty list if there are no\nmessages available in the backlog. The server may return `UNAVAILABLE` if\nthere are too many concurrent pull requests pending for the given\nsubscription.", - "response": { - "$ref": "PullResponse" - }, - "parameterOrder": [ - "subscription" - ], - "httpMethod": "POST", - "parameters": { - "subscription": { - "description": "The subscription from which messages should be pulled.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "list": { - "description": "Lists matching subscriptions.", - "httpMethod": "GET", - "parameterOrder": [ - "project" - ], - "response": { - "$ref": "ListSubscriptionsResponse" - }, - "parameters": { - "pageToken": { - "location": "query", - "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that\nthis is a continuation of a prior `ListSubscriptions` call, and that the\nsystem should return the next page of data.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "Maximum number of subscriptions to return.", - "format": "int32", - "type": "integer" - }, - "project": { - "location": "path", - "description": "The name of the cloud project that subscriptions belong to.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta2/projects/{projectsId}/subscriptions", - "id": "pubsub.projects.subscriptions.list", - "path": "v1beta2/{+project}/subscriptions" - }, - "create": { - "response": { - "$ref": "Subscription" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "parameters": { - "name": { - "location": "path", - "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" - } - }, - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", - "path": "v1beta2/{+name}", - "id": "pubsub.projects.subscriptions.create", - "description": "Creates a subscription to a given topic.\nIf the subscription already exists, returns `ALREADY_EXISTS`.\nIf the corresponding topic doesn't exist, returns `NOT_FOUND`.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic. Note that\nfor REST API requests, you must specify a name.", - "request": { - "$ref": "Subscription" - } - }, - "setIamPolicy": { - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy", - "path": "v1beta2/{+resource}:setIamPolicy", - "id": "pubsub.projects.subscriptions.setIamPolicy" - } - } - } - } - } - }, - "parameters": { - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - } } } diff --git a/etc/api/qpxexpress/v1/qpxexpress-api.json b/etc/api/qpxexpress/v1/qpxexpress-api.json index dcde139919..577bfa72de 100644 --- a/etc/api/qpxexpress/v1/qpxexpress-api.json +++ b/etc/api/qpxexpress/v1/qpxexpress-api.json @@ -21,7 +21,7 @@ "basePath": "/qpxExpress/v1/trips/", "rootUrl": "https://www.googleapis.com/", "servicePath": "qpxExpress/v1/trips/", - "batchPath": "batch", + "batchPath": "batch/qpxExpress/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/replicapool/v1beta1/replicapool-api.json b/etc/api/replicapool/v1beta1/replicapool-api.json index f45c833c99..d688986bc6 100644 --- a/etc/api/replicapool/v1beta1/replicapool-api.json +++ b/etc/api/replicapool/v1beta1/replicapool-api.json @@ -23,7 +23,7 @@ "basePath": "/replicapool/v1beta1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "replicapool/v1beta1/projects/", - "batchPath": "batch", + "batchPath": "batch/replicapool/v1beta1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/replicapool/v1beta2/replicapool-api.json b/etc/api/replicapool/v1beta2/replicapool-api.json index 035368bc31..1cf395b985 100644 --- a/etc/api/replicapool/v1beta2/replicapool-api.json +++ b/etc/api/replicapool/v1beta2/replicapool-api.json @@ -23,7 +23,7 @@ "basePath": "/replicapool/v1beta2/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "replicapool/v1beta2/projects/", - "batchPath": "batch", + "batchPath": "batch/replicapool/v1beta2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json b/etc/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json index 1f771a5bca..6231b3477e 100644 --- a/etc/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json +++ b/etc/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json @@ -23,7 +23,7 @@ "basePath": "/replicapoolupdater/v1beta1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "replicapoolupdater/v1beta1/projects/", - "batchPath": "batch", + "batchPath": "batch/replicapoolupdater/v1beta1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/reseller/v1/reseller-api.json b/etc/api/reseller/v1/reseller-api.json index 0d9997fc99..022cd0be87 100644 --- a/etc/api/reseller/v1/reseller-api.json +++ b/etc/api/reseller/v1/reseller-api.json @@ -23,7 +23,7 @@ "basePath": "/apps/reseller/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "apps/reseller/v1/", - "batchPath": "batch", + "batchPath": "batch/reseller/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/resourceviews/v1beta2/resourceviews-api.json b/etc/api/resourceviews/v1beta2/resourceviews-api.json index 049ffe69ca..233acf3620 100644 --- a/etc/api/resourceviews/v1beta2/resourceviews-api.json +++ b/etc/api/resourceviews/v1beta2/resourceviews-api.json @@ -23,7 +23,7 @@ "basePath": "/resourceviews/v1beta2/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "resourceviews/v1beta2/projects/", - "batchPath": "batch", + "batchPath": "batch/resourceviews/v1beta2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/runtimeconfig/v1/runtimeconfig-api.json b/etc/api/runtimeconfig/v1/runtimeconfig-api.json index ae2fb0ce9d..696bda0be6 100644 --- a/etc/api/runtimeconfig/v1/runtimeconfig-api.json +++ b/etc/api/runtimeconfig/v1/runtimeconfig-api.json @@ -1,31 +1,29 @@ { - "discoveryVersion": "v1", - "version_module": "True", "schemas": { "CancelOperationRequest": { - "properties": {}, - "id": "CancelOperationRequest", "description": "The request message for Operations.CancelOperation.", - "type": "object" + "type": "object", + "properties": {}, + "id": "CancelOperationRequest" }, "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` which can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting purpose.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { + "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - }, - "type": "object" - } + } + }, + "type": "array" }, "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, "message": { @@ -35,40 +33,10 @@ }, "id": "Status" }, - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Operation" - } - } - }, - "id": "ListOperationsResponse" - }, "Operation": { "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { - "response": { - "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "name": { - "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", - "type": "string" - }, "error": { "$ref": "Status", "description": "The error result of the operation in case of failure or cancellation." @@ -82,12 +50,42 @@ "type": "object" }, "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" } }, "id": "Operation" }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + } + }, + "id": "ListOperationsResponse" + }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", "type": "object", @@ -117,16 +115,55 @@ "ownerDomain": "google.com", "name": "runtimeconfig", "batchPath": "batch", + "fullyEncodeReservedExpansion": true, "title": "Google Cloud Runtime Configuration API", "ownerName": "Google", "resources": { "operations": { "methods": { - "cancel": { - "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", - "request": { - "$ref": "CancelOperationRequest" + "list": { + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "type": "string", + "required": true, + "pattern": "^operations$" + }, + "pageSize": { + "format": "int32", + "description": "The standard list page size.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/operations", + "id": "runtimeconfig.operations.list", + "path": "v1/{+name}" + }, + "cancel": { "response": { "$ref": "Empty" }, @@ -141,140 +178,58 @@ "parameters": { "name": { "description": "The name of the operation resource to be cancelled.", - "required": true, "type": "string", + "required": true, "pattern": "^operations/.+$", "location": "path" } }, "flatPath": "v1/operations/{operationsId}:cancel", + "id": "runtimeconfig.operations.cancel", "path": "v1/{+name}:cancel", - "id": "runtimeconfig.operations.cancel" + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`." }, "delete": { - "httpMethod": "DELETE", "response": { "$ref": "Empty" }, "parameterOrder": [ "name" ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], "parameters": { "name": { "description": "The name of the operation resource to be deleted.", - "required": true, "type": "string", + "required": true, "pattern": "^operations/.+$", "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], "flatPath": "v1/operations/{operationsId}", "id": "runtimeconfig.operations.delete", "path": "v1/{+name}", "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`." - }, - "list": { - "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding below allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ListOperationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "name": { - "description": "The name of the operation collection.", - "required": true, - "type": "string", - "pattern": "^operations$", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "The standard list page token.", - "type": "string" - }, - "pageSize": { - "description": "The standard list page size.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "filter": { - "location": "query", - "description": "The standard list filter.", - "type": "string" - } - }, - "flatPath": "v1/operations", - "id": "runtimeconfig.operations.list", - "path": "v1/{+name}" } } } }, "parameters": { - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "key": { + "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.", "type": "string", "location": "query" }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { "location": "query", - "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.", + "description": "OAuth access token.", "type": "string" }, "quotaUser": { @@ -284,8 +239,8 @@ }, "pp": { "description": "Pretty-print response.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "oauth_token": { @@ -306,17 +261,63 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" } }, "version": "v1", "baseUrl": "https://runtimeconfig.googleapis.com/", "servicePath": "", - "kind": "discovery#restDescription", "description": "The Runtime Configurator allows you to dynamically configure and expose variables through Google Cloud Platform. In addition, you can also set Watchers and Waiters that will watch for changes to your data and return based on certain conditions.", + "kind": "discovery#restDescription", "basePath": "", - "revision": "20170429", + "id": "runtimeconfig:v1", "documentationLink": "https://cloud.google.com/deployment-manager/runtime-configurator/", - "id": "runtimeconfig:v1" + "revision": "20170829", + "discoveryVersion": "v1", + "version_module": true } diff --git a/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json b/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json index eb610f573f..b420ecacce 100644 --- a/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json +++ b/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json @@ -1,5 +1,815 @@ { - "version_module": "True", + "canonicalName": "Cloud RuntimeConfig", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloudruntimeconfig": { + "description": "Manage your Google Cloud Platform services' runtime configuration" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://runtimeconfig.googleapis.com/", + "ownerDomain": "google.com", + "name": "runtimeconfig", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Runtime Configuration API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "configs": { + "methods": { + "getIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:getIamPolicy", + "id": "runtimeconfig.projects.configs.getIamPolicy", + "path": "v1beta1/{+resource}:getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset." + }, + "get": { + "description": "Gets information about a RuntimeConfig resource.", + "response": { + "$ref": "RuntimeConfig" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/configs/[^/]+$", + "location": "path", + "description": "The name of the RuntimeConfig resource to retrieve, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", + "id": "runtimeconfig.projects.configs.get", + "path": "v1beta1/{+name}" + }, + "update": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", + "id": "runtimeconfig.projects.configs.update", + "path": "v1beta1/{+name}", + "description": "Updates a RuntimeConfig resource. The configuration must exist beforehand.", + "request": { + "$ref": "RuntimeConfig" + }, + "response": { + "$ref": "RuntimeConfig" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "parameters": { + "name": { + "location": "path", + "description": "The name of the RuntimeConfig resource to update, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "runtimeconfig.projects.configs.testIamPermissions" + }, + "delete": { + "description": "Deletes a RuntimeConfig resource.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "location": "path", + "description": "The RuntimeConfig resource to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.delete" + }, + "list": { + "response": { + "$ref": "ListConfigsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "type": "string", + "location": "query", + "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results." + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.", + "type": "integer" + }, + "parent": { + "location": "path", + "description": "The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848)\nfor this request, in the format `projects/[PROJECT_ID]`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs", + "id": "runtimeconfig.projects.configs.list", + "path": "v1beta1/{+parent}/configs", + "description": "Lists all the RuntimeConfig resources within project." + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/configs/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:setIamPolicy", + "path": "v1beta1/{+resource}:setIamPolicy", + "id": "runtimeconfig.projects.configs.setIamPolicy" + }, + "create": { + "description": "Creates a new RuntimeConfig resource. The configuration name must be\nunique within project.", + "request": { + "$ref": "RuntimeConfig" + }, + "response": { + "$ref": "RuntimeConfig" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "requestId": { + "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.", + "type": "string", + "location": "query" + }, + "parent": { + "description": "The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848)\nfor this request, in the format `projects/[PROJECT_ID]`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs", + "id": "runtimeconfig.projects.configs.create", + "path": "v1beta1/{+parent}/configs" + } + }, + "resources": { + "variables": { + "methods": { + "create": { + "response": { + "$ref": "Variable" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "requestId": { + "location": "query", + "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.", + "type": "string" + }, + "parent": { + "description": "The path to the RutimeConfig resource that this variable should belong to.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables", + "id": "runtimeconfig.projects.configs.variables.create", + "path": "v1beta1/{+parent}/variables", + "request": { + "$ref": "Variable" + }, + "description": "Creates a variable within the given configuration. You cannot create\na variable with a name that is a prefix of an existing variable name, or a\nname that has an existing variable name as a prefix.\n\nTo learn more about creating a variable, read the\n[Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables)\ndocumentation." + }, + "get": { + "description": "Gets information about a single variable.", + "response": { + "$ref": "Variable" + }, + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the variable to return, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", + "id": "runtimeconfig.projects.configs.variables.get", + "path": "v1beta1/{+name}" + }, + "watch": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "description": "The name of the variable to watch, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:watch", + "path": "v1beta1/{+name}:watch", + "id": "runtimeconfig.projects.configs.variables.watch", + "request": { + "$ref": "WatchVariableRequest" + }, + "description": "Watches a specific variable and waits for a change in the variable's value.\nWhen there is a change, this method returns the new value or times out.\n\nIf a variable is deleted while being watched, the `variableState` state is\nset to `DELETED` and the method returns the last known variable `value`.\n\nIf you set the deadline for watching to a larger value than internal timeout\n(60 seconds), the current variable value is returned and the `variableState`\nwill be `VARIABLE_STATE_UNSPECIFIED`.\n\nTo learn more about creating a watcher, read the\n[Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable)\ndocumentation." + }, + "update": { + "request": { + "$ref": "Variable" + }, + "description": "Updates an existing variable with a new value.", + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "description": "The name of the variable to update, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.variables.update" + }, + "testIamPermissions": { + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:testIamPermissions", + "id": "runtimeconfig.projects.configs.variables.testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + } + }, + "delete": { + "description": "Deletes a variable or multiple variables.\n\nIf you specify a variable name, then that variable is deleted. If you\nspecify a prefix and `recursive` is true, then all variables with that\nprefix are deleted. You must set a `recursive` to true if you delete\nvariables by prefix.", + "response": { + "$ref": "Empty" + }, + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "recursive": { + "location": "query", + "description": "Set to `true` to recursively delete multiple variables with the same\nprefix.", + "type": "boolean" + }, + "name": { + "location": "path", + "description": "The name of the variable to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", + "id": "runtimeconfig.projects.configs.variables.delete", + "path": "v1beta1/{+name}" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListVariablesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "returnValues": { + "type": "boolean", + "location": "query", + "description": "The flag indicates whether the user wants to return values of variables.\nIf true, then only those variables that user has IAM GetVariable permission\nwill be returned along with their values." + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results." + }, + "pageSize": { + "format": "int32", + "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.", + "type": "integer", + "location": "query" + }, + "parent": { + "location": "path", + "description": "The path to the RuntimeConfig resource for which you want to list variables.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$" + }, + "filter": { + "description": "Filters variables by matching the specified filter. For example:\n\n`projects/example-project/config/[CONFIG_NAME]/variables/example-variable`.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables", + "path": "v1beta1/{+parent}/variables", + "id": "runtimeconfig.projects.configs.variables.list", + "description": "Lists variables within given a configuration, matching any provided filters.\nThis only lists variable names, not the values, unless `return_values` is\ntrue, in which case only variables that user has IAM permission to GetVariable\nwill be returned." + } + } + }, + "waiters": { + "methods": { + "delete": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}", + "id": "runtimeconfig.projects.configs.waiters.delete", + "path": "v1beta1/{+name}", + "description": "Deletes the waiter with the specified name.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "description": "The Waiter resource to delete, in the format:\n\n `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$", + "location": "path" + } + } + }, + "get": { + "response": { + "$ref": "Waiter" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "description": "The fully-qualified name of the Waiter resource object to retrieve, in the\nformat:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}", + "id": "runtimeconfig.projects.configs.waiters.get", + "path": "v1beta1/{+name}", + "description": "Gets information about a single waiter." + }, + "list": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters", + "path": "v1beta1/{+parent}/waiters", + "id": "runtimeconfig.projects.configs.waiters.list", + "description": "List waiters within the given configuration.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListWaitersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.", + "type": "integer", + "location": "query" + }, + "parent": { + "location": "path", + "description": "The path to the configuration for which you want to get a list of waiters.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+$" + } + } + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "requestId": { + "location": "query", + "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.", + "type": "string" + }, + "parent": { + "pattern": "^projects/[^/]+/configs/[^/]+$", + "location": "path", + "description": "The path to the configuration that will own the waiter.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters", + "path": "v1beta1/{+parent}/waiters", + "id": "runtimeconfig.projects.configs.waiters.create", + "request": { + "$ref": "Waiter" + }, + "description": "Creates a Waiter resource. This operation returns a long-running Operation\nresource which can be polled for completion. However, a waiter with the\ngiven name will exist (and can be retrieved) prior to the operation\ncompleting. If the operation fails, the failed Waiter resource will\nstill exist and must be deleted prior to subsequent creation attempts." + }, + "testIamPermissions": { + "id": "runtimeconfig.projects.configs.waiters.testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}:testIamPermissions" + } + } + }, + "operations": { + "methods": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.operations.get" + }, + "testIamPermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}:testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "runtimeconfig.projects.configs.operations.testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." + } + } + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + }, + "version": "v1beta1", + "baseUrl": "https://runtimeconfig.googleapis.com/", + "kind": "discovery#restDescription", + "description": "The Runtime Configurator allows you to dynamically configure and expose variables through Google Cloud Platform. In addition, you can also set Watchers and Waiters that will watch for changes to your data and return based on certain conditions.", + "servicePath": "", + "basePath": "", + "revision": "20170829", + "documentationLink": "https://cloud.google.com/deployment-manager/runtime-configurator/", + "id": "runtimeconfig:v1beta1", + "discoveryVersion": "v1", + "version_module": true, "schemas": { "Operation": { "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", @@ -18,8 +828,8 @@ "type": "string" }, "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "$ref": "Status" + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." }, "metadata": { "additionalProperties": { @@ -30,28 +840,30 @@ "type": "object" }, "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" } }, "id": "Operation" }, "SetIamPolicyRequest": { - "properties": { - "policy": { - "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them.", - "$ref": "Policy" - } - }, "id": "SetIamPolicyRequest", "description": "Request message for `SetIamPolicy` method.", - "type": "object" + "type": "object", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." + } + } }, "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", "properties": { "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, "message": { @@ -59,1094 +871,283 @@ "type": "string" }, "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { + "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - }, - "type": "object" - } + } + }, + "type": "array" } }, - "id": "Status", - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` which can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting purpose.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object" + "id": "Status" }, "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", "properties": { "members": { - "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", "items": { "type": "string" - } + }, + "type": "array" }, "role": { "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", "type": "string" } }, - "id": "Binding", - "description": "Associates `members` with a `role`.", - "type": "object" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" + "id": "Binding" }, "Cardinality": { "description": "A Cardinality condition for the Waiter resource. A cardinality condition is\nmet when the number of variables under a specified path prefix reaches a\npredefined number. For example, if you set a Cardinality condition where\nthe `path` is set to `/foo` and the number of paths is set to 2, the\nfollowing variables would meet the condition in a RuntimeConfig resource:\n\n+ `/foo/variable1 = \"value1\"`\n+ `/foo/variable2 = \"value2\"`\n+ `/bar/variable3 = \"value3\"`\n\nIt would not would not satisify the same condition with the `number` set to\n3, however, because there is only 2 paths that start with `/foo`.\nCardinality conditions are recursive; all subtrees under the specific\npath prefix are counted.", "type": "object", "properties": { + "number": { + "type": "integer", + "format": "int32", + "description": "The number variables under the `path` that must exist to meet this\ncondition. Defaults to 1 if not specified." + }, "path": { "description": "The root of the variable subtree to monitor. For example, `/foo`.", "type": "string" - }, - "number": { - "description": "The number variables under the `path` that must exist to meet this\ncondition. Defaults to 1 if not specified.", - "format": "int32", - "type": "integer" } }, "id": "Cardinality" }, + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {} + }, "ListConfigsResponse": { + "description": "`ListConfigs()` returns the following response. The order of returned\nobjects is arbitrary; that is, it is not ordered in any particular way.", + "type": "object", "properties": { "configs": { "description": "A list of the configurations in the project. The order of returned\nobjects is arbitrary; that is, it is not ordered in any particular way.", - "type": "array", "items": { "$ref": "RuntimeConfig" - } + }, + "type": "array" }, "nextPageToken": { "description": "This token allows you to get the next page of results for list requests.\nIf the number of results is larger than `pageSize`, use the `nextPageToken`\nas a value for the query parameter `pageToken` in the next list request.\nSubsequent list requests will have their own `nextPageToken` to continue\npaging through the results", "type": "string" } }, - "id": "ListConfigsResponse", - "description": "`ListConfigs()` returns the following response. The order of returned\nobjects is arbitrary; that is, it is not ordered in any particular way.", - "type": "object" + "id": "ListConfigsResponse" }, "EndCondition": { - "description": "The condition that a Waiter resource is waiting for.", - "type": "object", "properties": { "cardinality": { "$ref": "Cardinality", "description": "The cardinality of the `EndCondition`." } }, - "id": "EndCondition" + "id": "EndCondition", + "description": "The condition that a Waiter resource is waiting for.", + "type": "object" }, "TestIamPermissionsResponse": { "description": "Response message for `TestIamPermissions` method.", "type": "object", "properties": { "permissions": { - "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed." } }, "id": "TestIamPermissionsResponse" }, "ListVariablesResponse": { + "description": "Response for the `ListVariables()` method.", + "type": "object", "properties": { "variables": { "description": "A list of variables and their values. The order of returned variable\nobjects is arbitrary.", - "type": "array", "items": { "$ref": "Variable" - } + }, + "type": "array" }, "nextPageToken": { "description": "This token allows you to get the next page of results for list requests.\nIf the number of results is larger than `pageSize`, use the `nextPageToken`\nas a value for the query parameter `pageToken` in the next list request.\nSubsequent list requests will have their own `nextPageToken` to continue\npaging through the results", "type": "string" } }, - "id": "ListVariablesResponse", - "description": "Response for the `ListVariables()` method.", - "type": "object" + "id": "ListVariablesResponse" }, "RuntimeConfig": { + "description": "A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig\nservice. A RuntimeConfig resource consists of metadata and a hierarchy of\nvariables.", + "type": "object", "properties": { - "name": { - "description": "The resource name of a runtime config. The name must have the format:\n\n projects/[PROJECT_ID]/configs/[CONFIG_NAME]\n\nThe `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is an\narbitrary name that matches RFC 1035 segment specification. The length of\n`[CONFIG_NAME]` must be less than 64 bytes.\n\nYou pick the RuntimeConfig resource name, but the server will validate that\nthe name adheres to this format. After you create the resource, you cannot\nchange the resource's name.", - "type": "string" - }, "description": { "description": "An optional description of the RuntimeConfig object.", "type": "string" + }, + "name": { + "description": "The resource name of a runtime config. The name must have the format:\n\n projects/[PROJECT_ID]/configs/[CONFIG_NAME]\n\nThe `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is an\narbitrary name that matches RFC 1035 segment specification. The length of\n`[CONFIG_NAME]` must be less than 64 bytes.\n\nYou pick the RuntimeConfig resource name, but the server will validate that\nthe name adheres to this format. After you create the resource, you cannot\nchange the resource's name.", + "type": "string" } }, - "id": "RuntimeConfig", - "description": "A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig\nservice. A RuntimeConfig resource consists of metadata and a hierarchy of\nvariables.", - "type": "object" + "id": "RuntimeConfig" }, "WatchVariableRequest": { + "id": "WatchVariableRequest", "description": "Request for the `WatchVariable()` method.", "type": "object", "properties": { "newerThan": { - "description": "If specified, checks the current timestamp of the variable and if the\ncurrent timestamp is newer than `newerThan` timestamp, the method returns\nimmediately.\n\nIf not specified or the variable has an older timestamp, the watcher waits\nfor a the value to change before returning.", "format": "google-datetime", + "description": "If specified, checks the current timestamp of the variable and if the\ncurrent timestamp is newer than `newerThan` timestamp, the method returns\nimmediately.\n\nIf not specified or the variable has an older timestamp, the watcher waits\nfor a the value to change before returning.", "type": "string" } - }, - "id": "WatchVariableRequest" + } }, "ListWaitersResponse": { "description": "Response for the `ListWaiters()` method.\nOrder of returned waiter objects is arbitrary.", "type": "object", "properties": { + "waiters": { + "description": "Found waiters in the project.", + "items": { + "$ref": "Waiter" + }, + "type": "array" + }, "nextPageToken": { "description": "This token allows you to get the next page of results for list requests.\nIf the number of results is larger than `pageSize`, use the `nextPageToken`\nas a value for the query parameter `pageToken` in the next list request.\nSubsequent list requests will have their own `nextPageToken` to continue\npaging through the results", "type": "string" - }, - "waiters": { - "description": "Found waiters in the project.", - "type": "array", - "items": { - "$ref": "Waiter" - } } }, "id": "ListWaitersResponse" }, + "Waiter": { + "type": "object", + "properties": { + "error": { + "$ref": "Status", + "description": "[Output Only] If the waiter ended due to a failure or timeout, this value\nwill be set." + }, + "failure": { + "$ref": "EndCondition", + "description": "[Optional] The failure condition of this waiter. If this condition is met,\n`done` will be set to `true` and the `error` code will be set to `ABORTED`.\nThe failure condition takes precedence over the success condition. If both\nconditions are met, a failure will be indicated. This value is optional; if\nno failure condition is set, the only failure scenario will be a timeout." + }, + "success": { + "description": "[Required] The success condition. If this condition is met, `done` will be\nset to `true` and the `error` value will remain unset. The failure condition\ntakes precedence over the success condition. If both conditions are met, a\nfailure will be indicated.", + "$ref": "EndCondition" + }, + "done": { + "description": "[Output Only] If the value is `false`, it means the waiter is still waiting\nfor one of its conditions to be met.\n\nIf true, the waiter has finished. If the waiter finished due to a timeout\nor failure, `error` will be set.", + "type": "boolean" + }, + "createTime": { + "format": "google-datetime", + "description": "[Output Only] The instant at which this Waiter resource was created. Adding\nthe value of `timeout` to this instant yields the timeout deadline for the\nwaiter.", + "type": "string" + }, + "timeout": { + "format": "google-duration", + "description": "[Required] Specifies the timeout of the waiter in seconds, beginning from\nthe instant that `waiters().create` method is called. If this time elapses\nbefore the success or failure conditions are met, the waiter fails and sets\nthe `error` code to `DEADLINE_EXCEEDED`.", + "type": "string" + }, + "name": { + "description": "The name of the Waiter resource, in the format:\n\n projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]\n\nThe `[PROJECT_ID]` must be a valid Google Cloud project ID,\nthe `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the\n`[WAITER_NAME]` must match RFC 1035 segment specification, and the length\nof `[WAITER_NAME]` must be less than 64 bytes.\n\nAfter you create a Waiter resource, you cannot change the resource name.", + "type": "string" + } + }, + "id": "Waiter", + "description": "A Waiter resource waits for some end condition within a RuntimeConfig resource\nto be met before it returns. For example, assume you have a distributed\nsystem where each node writes to a Variable resource indidicating the node's\nreadiness as part of the startup process.\n\nYou then configure a Waiter resource with the success condition set to wait\nuntil some number of nodes have checked in. Afterwards, your application\nruns some arbitrary code after the condition has been met and the waiter\nreturns successfully.\n\nOnce created, a Waiter resource is immutable.\n\nTo learn more about using waiters, read the\n[Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter)\ndocumentation." + }, "TestIamPermissionsRequest": { "description": "Request message for `TestIamPermissions` method.", "type": "object", "properties": { "permissions": { "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "TestIamPermissionsRequest" }, - "Waiter": { - "description": "A Waiter resource waits for some end condition within a RuntimeConfig resource\nto be met before it returns. For example, assume you have a distributed\nsystem where each node writes to a Variable resource indidicating the node's\nreadiness as part of the startup process.\n\nYou then configure a Waiter resource with the success condition set to wait\nuntil some number of nodes have checked in. Afterwards, your application\nruns some arbitrary code after the condition has been met and the waiter\nreturns successfully.\n\nOnce created, a Waiter resource is immutable.\n\nTo learn more about using waiters, read the\n[Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter)\ndocumentation.", + "Variable": { + "description": "Describes a single variable within a RuntimeConfig resource.\nThe name denotes the hierarchical variable name. For example,\n`ports/serving_port` is a valid variable name. The variable value is an\nopaque string and only leaf variables can have values (that is, variables\nthat do not have any child variables).", "type": "object", "properties": { - "done": { - "description": "[Output Only] If the value is `false`, it means the waiter is still waiting\nfor one of its conditions to be met.\n\nIf true, the waiter has finished. If the waiter finished due to a timeout\nor failure, `error` will be set.", - "type": "boolean" + "state": { + "type": "string", + "enumDescriptions": [ + "Default variable state.", + "The variable was updated, while `variables().watch` was executing.", + "The variable was deleted, while `variables().watch` was executing." + ], + "enum": [ + "VARIABLE_STATE_UNSPECIFIED", + "UPDATED", + "DELETED" + ], + "description": "[Ouput only] The current state of the variable. The variable state indicates\nthe outcome of the `variables().watch` call and is visible through the\n`get` and `list` calls." }, - "createTime": { - "description": "[Output Only] The instant at which this Waiter resource was created. Adding\nthe value of `timeout` to this instant yields the timeout deadline for the\nwaiter.", + "updateTime": { "format": "google-datetime", - "type": "string" - }, - "timeout": { - "description": "[Required] Specifies the timeout of the waiter in seconds, beginning from\nthe instant that `waiters().create` method is called. If this time elapses\nbefore the success or failure conditions are met, the waiter fails and sets\nthe `error` code to `DEADLINE_EXCEEDED`.", - "format": "google-duration", + "description": "[Output Only] The time of the last variable update.", "type": "string" }, "name": { - "description": "The name of the Waiter resource, in the format:\n\n projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]\n\nThe `[PROJECT_ID]` must be a valid Google Cloud project ID,\nthe `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the\n`[WAITER_NAME]` must match RFC 1035 segment specification, and the length\nof `[WAITER_NAME]` must be less than 64 bytes.\n\nAfter you create a Waiter resource, you cannot change the resource name.", + "description": "The name of the variable resource, in the format:\n\n projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]\n\nThe `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a\nvalid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system\nfile path naming.\n\nThe `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and\ndashes. Slashes are used as path element separators and are not part of the\n`[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least one\nnon-slash character. Multiple slashes are coalesced into single slash\ncharacter. Each path segment should follow RFC 1035 segment specification.\nThe length of a `[VARIABLE_NAME]` must be less than 256 bytes.\n\nOnce you create a variable, you cannot change the variable name.", "type": "string" }, - "error": { - "description": "[Output Only] If the waiter ended due to a failure or timeout, this value\nwill be set.", - "$ref": "Status" + "text": { + "description": "The string value of the variable. The length of the value must be less\nthan 4096 bytes. Empty values are also accepted. For example,\n`text: \"my text value\"`. The string must be valid UTF-8.", + "type": "string" }, - "failure": { - "$ref": "EndCondition", - "description": "[Optional] The failure condition of this waiter. If this condition is met,\n`done` will be set to `true` and the `error` code will be set to `ABORTED`.\nThe failure condition takes precedence over the success condition. If both\nconditions are met, a failure will be indicated. This value is optional; if\nno failure condition is set, the only failure scenario will be a timeout." - }, - "success": { - "$ref": "EndCondition", - "description": "[Required] The success condition. If this condition is met, `done` will be\nset to `true` and the `error` value will remain unset. The failure condition\ntakes precedence over the success condition. If both conditions are met, a\nfailure will be indicated." + "value": { + "format": "byte", + "description": "The binary value of the variable. The length of the value must be less\nthan 4096 bytes. Empty values are also accepted. The value must be\nbase64 encoded. Only one of `value` or `text` can be set.", + "type": "string" } }, - "id": "Waiter" + "id": "Variable" }, "Policy": { "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", "type": "object", "properties": { "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string", "format": "byte", - "type": "string" + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly." }, "version": { - "description": "Version of the `Policy`. The default version is 0.", "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", "type": "integer" }, "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", "items": { "$ref": "Binding" - } + }, + "type": "array" } }, "id": "Policy" - }, - "Variable": { - "description": "Describes a single variable within a RuntimeConfig resource.\nThe name denotes the hierarchical variable name. For example,\n`ports/serving_port` is a valid variable name. The variable value is an\nopaque string and only leaf variables can have values (that is, variables\nthat do not have any child variables).", - "type": "object", - "properties": { - "text": { - "description": "The string value of the variable. The length of the value must be less\nthan 4096 bytes. Empty values are also accepted. For example,\n`text: \"my text value\"`. The string must be valid UTF-8.", - "type": "string" - }, - "value": { - "description": "The binary value of the variable. The length of the value must be less\nthan 4096 bytes. Empty values are also accepted. The value must be\nbase64 encoded. Only one of `value` or `text` can be set.", - "format": "byte", - "type": "string" - }, - "updateTime": { - "description": "[Output Only] The time of the last variable update.", - "format": "google-datetime", - "type": "string" - }, - "state": { - "enum": [ - "VARIABLE_STATE_UNSPECIFIED", - "UPDATED", - "DELETED" - ], - "description": "[Ouput only] The current state of the variable. The variable state indicates\nthe outcome of the `variables().watch` call and is visible through the\n`get` and `list` calls.", - "type": "string", - "enumDescriptions": [ - "Default variable state.", - "The variable was updated, while `variables().watch` was executing.", - "The variable was deleted, while `variables().watch` was executing." - ] - }, - "name": { - "description": "The name of the variable resource, in the format:\n\n projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]\n\nThe `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a\nvalid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system\nfile path naming.\n\nThe `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and\ndashes. Slashes are used as path element separators and are not part of the\n`[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least one\nnon-slash character. Multiple slashes are coalesced into single slash\ncharacter. Each path segment should follow RFC 1035 segment specification.\nThe length of a `[VARIABLE_NAME]` must be less than 256 bytes.\n\nOnce you create a variable, you cannot change the variable name.", - "type": "string" - } - }, - "id": "Variable" } }, - "protocol": "rest", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "canonicalName": "Cloud RuntimeConfig", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloudruntimeconfig": { - "description": "Manage your Google Cloud Platform services' runtime configuration" - }, - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - } - } - } - }, - "rootUrl": "https://runtimeconfig.googleapis.com/", - "ownerDomain": "google.com", - "name": "runtimeconfig", - "batchPath": "batch", - "title": "Google Cloud Runtime Configuration API", - "ownerName": "Google", - "resources": { - "projects": { - "resources": { - "configs": { - "methods": { - "get": { - "httpMethod": "GET", - "response": { - "$ref": "RuntimeConfig" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path", - "description": "The name of the RuntimeConfig resource to retrieve, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", - "id": "runtimeconfig.projects.configs.get", - "path": "v1beta1/{+name}", - "description": "Gets information about a RuntimeConfig resource." - }, - "update": { - "response": { - "$ref": "RuntimeConfig" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "PUT", - "parameters": { - "name": { - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path", - "description": "The name of the RuntimeConfig resource to update, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", - "path": "v1beta1/{+name}", - "id": "runtimeconfig.projects.configs.update", - "request": { - "$ref": "RuntimeConfig" - }, - "description": "Updates a RuntimeConfig resource. The configuration must exist beforehand." - }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:testIamPermissions", - "id": "runtimeconfig.projects.configs.testIamPermissions", - "path": "v1beta1/{+resource}:testIamPermissions", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." - }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "name": { - "location": "path", - "description": "The RuntimeConfig resource to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", - "id": "runtimeconfig.projects.configs.delete", - "path": "v1beta1/{+name}", - "description": "Deletes a RuntimeConfig resource." - }, - "list": { - "description": "Lists all the RuntimeConfig resources within project.", - "response": { - "$ref": "ListConfigsResponse" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "GET", - "parameters": { - "pageSize": { - "location": "query", - "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.", - "format": "int32", - "type": "integer" - }, - "parent": { - "description": "The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848)\nfor this request, in the format `projects/[PROJECT_ID]`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - }, - "pageToken": { - "location": "query", - "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs", - "path": "v1beta1/{+parent}/configs", - "id": "runtimeconfig.projects.configs.list" - }, - "create": { - "description": "Creates a new RuntimeConfig resource. The configuration name must be\nunique within project.", - "request": { - "$ref": "RuntimeConfig" - }, - "response": { - "$ref": "RuntimeConfig" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "requestId": { - "location": "query", - "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.", - "type": "string" - }, - "parent": { - "description": "The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848)\nfor this request, in the format `projects/[PROJECT_ID]`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs", - "path": "v1beta1/{+parent}/configs", - "id": "runtimeconfig.projects.configs.create" - }, - "setIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:setIamPolicy", - "id": "runtimeconfig.projects.configs.setIamPolicy", - "path": "v1beta1/{+resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." - }, - "getIamPolicy": { - "id": "runtimeconfig.projects.configs.getIamPolicy", - "path": "v1beta1/{+resource}:getIamPolicy", - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "httpMethod": "GET", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:getIamPolicy" - } - }, - "resources": { - "variables": { - "methods": { - "update": { - "httpMethod": "PUT", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Variable" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "name": { - "location": "path", - "description": "The name of the variable to update, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", - "id": "runtimeconfig.projects.configs.variables.update", - "path": "v1beta1/{+name}", - "description": "Updates an existing variable with a new value.", - "request": { - "$ref": "Variable" - } - }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:testIamPermissions", - "id": "runtimeconfig.projects.configs.variables.testIamPermissions", - "path": "v1beta1/{+resource}:testIamPermissions", - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - } - }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "recursive": { - "description": "Set to `true` to recursively delete multiple variables with the same\nprefix.", - "type": "boolean", - "location": "query" - }, - "name": { - "location": "path", - "description": "The name of the variable to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", - "id": "runtimeconfig.projects.configs.variables.delete", - "path": "v1beta1/{+name}", - "description": "Deletes a variable or multiple variables.\n\nIf you specify a variable name, then that variable is deleted. If you\nspecify a prefix and `recursive` is true, then all variables with that\nprefix are deleted. You must set a `recursive` to true if you delete\nvariables by prefix." - }, - "list": { - "description": "Lists variables within given a configuration, matching any provided filters.\nThis only lists variable names, not the values, unless `return_values` is\ntrue, in which case only variables that user has IAM permission to GetVariable\nwill be returned.", - "response": { - "$ref": "ListVariablesResponse" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "pageSize": { - "location": "query", - "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.", - "format": "int32", - "type": "integer" - }, - "parent": { - "description": "The path to the RuntimeConfig resource for which you want to list variables.\nThe configuration must exist beforehand; the path must by in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path" - }, - "filter": { - "location": "query", - "description": "Filters variables by matching the specified filter. For example:\n\n`projects/example-project/config/[CONFIG_NAME]/variables/example-variable`.", - "type": "string" - }, - "pageToken": { - "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.", - "type": "string", - "location": "query" - }, - "returnValues": { - "location": "query", - "description": "The flag indicates whether the user wants to return values of variables.\nIf true, then only those variables that user has IAM GetVariable permission\nwill be returned along with their values.", - "type": "boolean" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables", - "path": "v1beta1/{+parent}/variables", - "id": "runtimeconfig.projects.configs.variables.list" - }, - "create": { - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables", - "path": "v1beta1/{+parent}/variables", - "id": "runtimeconfig.projects.configs.variables.create", - "description": "Creates a variable within the given configuration. You cannot create\na variable with a name that is a prefix of an existing variable name, or a\nname that has an existing variable name as a prefix.\n\nTo learn more about creating a variable, read the\n[Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables)\ndocumentation.", - "request": { - "$ref": "Variable" - }, - "response": { - "$ref": "Variable" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "requestId": { - "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.", - "type": "string", - "location": "query" - }, - "parent": { - "description": "The path to the RutimeConfig resource that this variable should belong to.\nThe configuration must exist beforehand; the path must by in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path" - } - } - }, - "get": { - "id": "runtimeconfig.projects.configs.variables.get", - "path": "v1beta1/{+name}", - "description": "Gets information about a single variable.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Variable" - }, - "parameters": { - "name": { - "description": "The name of the variable to return, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}" - }, - "watch": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Variable" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "name": { - "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", - "location": "path", - "description": "The name of the variable to watch, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:watch", - "id": "runtimeconfig.projects.configs.variables.watch", - "path": "v1beta1/{+name}:watch", - "description": "Watches a specific variable and waits for a change in the variable's value.\nWhen there is a change, this method returns the new value or times out.\n\nIf a variable is deleted while being watched, the `variableState` state is\nset to `DELETED` and the method returns the last known variable `value`.\n\nIf you set the deadline for watching to a larger value than internal timeout\n(60 seconds), the current variable value is returned and the `variableState`\nwill be `VARIABLE_STATE_UNSPECIFIED`.\n\nTo learn more about creating a watcher, read the\n[Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable)\ndocumentation.", - "request": { - "$ref": "WatchVariableRequest" - } - } - } - }, - "operations": { - "methods": { - "testIamPermissions": { - "id": "runtimeconfig.projects.configs.operations.testIamPermissions", - "path": "v1beta1/{+resource}:testIamPermissions", - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$", - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}:testIamPermissions" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "name": { - "description": "The name of the operation resource.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}", - "id": "runtimeconfig.projects.configs.operations.get", - "path": "v1beta1/{+name}", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." - } - } - }, - "waiters": { - "methods": { - "list": { - "description": "List waiters within the given configuration.", - "response": { - "$ref": "ListWaitersResponse" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "pageSize": { - "location": "query", - "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.", - "format": "int32", - "type": "integer" - }, - "parent": { - "description": "The path to the configuration for which you want to get a list of waiters.\nThe configuration must exist beforehand; the path must by in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path" - }, - "pageToken": { - "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters", - "path": "v1beta1/{+parent}/waiters", - "id": "runtimeconfig.projects.configs.waiters.list" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Waiter" - }, - "parameters": { - "name": { - "description": "The fully-qualified name of the Waiter resource object to retrieve, in the\nformat:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}", - "id": "runtimeconfig.projects.configs.waiters.get", - "path": "v1beta1/{+name}", - "description": "Gets information about a single waiter." - }, - "create": { - "request": { - "$ref": "Waiter" - }, - "description": "Creates a Waiter resource. This operation returns a long-running Operation\nresource which can be polled for completion. However, a waiter with the\ngiven name will exist (and can be retrieved) prior to the operation\ncompleting. If the operation fails, the failed Waiter resource will\nstill exist and must be deleted prior to subsequent creation attempts.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "parent" - ], - "httpMethod": "POST", - "parameters": { - "requestId": { - "location": "query", - "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.", - "type": "string" - }, - "parent": { - "location": "path", - "description": "The path to the configuration that will own the waiter.\nThe configuration must exist beforehand; the path must by in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters", - "path": "v1beta1/{+parent}/waiters", - "id": "runtimeconfig.projects.configs.waiters.create" - }, - "testIamPermissions": { - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}:testIamPermissions", - "id": "runtimeconfig.projects.configs.waiters.testIamPermissions", - "path": "v1beta1/{+resource}:testIamPermissions", - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$", - "location": "path" - } - } - }, - "delete": { - "parameterOrder": [ - "name" - ], - "httpMethod": "DELETE", - "response": { - "$ref": "Empty" - }, - "parameters": { - "name": { - "description": "The Waiter resource to delete, in the format:\n\n `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`", - "required": true, - "type": "string", - "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig" - ], - "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}", - "path": "v1beta1/{+name}", - "id": "runtimeconfig.projects.configs.waiters.delete", - "description": "Deletes the waiter with the specified name." - } - } - } - } - } - } - } - }, - "parameters": { - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "quotaUser": { - "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.", - "type": "string", - "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - } - }, - "version": "v1beta1", - "baseUrl": "https://runtimeconfig.googleapis.com/", - "kind": "discovery#restDescription", - "description": "The Runtime Configurator allows you to dynamically configure and expose variables through Google Cloud Platform. In addition, you can also set Watchers and Waiters that will watch for changes to your data and return based on certain conditions.", - "servicePath": "", - "basePath": "", - "documentationLink": "https://cloud.google.com/deployment-manager/runtime-configurator/", - "revision": "20170429", - "id": "runtimeconfig:v1beta1", - "discoveryVersion": "v1" + "protocol": "rest" } diff --git a/etc/api/safebrowsing/v4/crates/1.0.6-api+20170921 b/etc/api/safebrowsing/v4/crates/1.0.6-api+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/safebrowsing/v4/crates/1.0.6-cli+20170921 b/etc/api/safebrowsing/v4/crates/1.0.6-cli+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/safebrowsing/v4/safebrowsing-api.json b/etc/api/safebrowsing/v4/safebrowsing-api.json index d0116f9d54..cd498f607b 100644 --- a/etc/api/safebrowsing/v4/safebrowsing-api.json +++ b/etc/api/safebrowsing/v4/safebrowsing-api.json @@ -5,7 +5,7 @@ "batchPath": "batch", "id": "safebrowsing:v4", "documentationLink": "https://developers.google.com/safe-browsing/", - "revision": "20170509", + "revision": "20170921", "title": "Google Safe Browsing API", "discoveryVersion": "v1", "ownerName": "Google", @@ -13,29 +13,29 @@ "fullHashes": { "methods": { "find": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "FindFullHashesResponse" - }, - "parameters": {}, - "flatPath": "v4/fullHashes:find", - "id": "safebrowsing.fullHashes.find", - "path": "v4/fullHashes:find", + "description": "Finds the full hashes that match the requested hash prefixes.", "request": { "$ref": "FindFullHashesRequest" }, - "description": "Finds the full hashes that match the requested hash prefixes." + "response": { + "$ref": "FindFullHashesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "flatPath": "v4/fullHashes:find", + "id": "safebrowsing.fullHashes.find", + "path": "v4/fullHashes:find" } } }, "encodedUpdates": { "methods": { "get": { + "httpMethod": "GET", "response": { "$ref": "FetchThreatListUpdatesResponse" }, - "httpMethod": "GET", "parameterOrder": [ "encodedRequest" ], @@ -51,11 +51,11 @@ "location": "query" }, "encodedRequest": { - "description": "A serialized FetchThreatListUpdatesRequest proto.", - "format": "byte", - "required": true, "type": "string", - "location": "path" + "required": true, + "location": "path", + "format": "byte", + "description": "A serialized FetchThreatListUpdatesRequest proto." } }, "flatPath": "v4/encodedUpdates/{encodedRequest}", @@ -68,10 +68,10 @@ "threatListUpdates": { "methods": { "fetch": { + "description": "Fetches the most recent threat list updates. A client can request updates\nfor multiple lists at once.", "request": { "$ref": "FetchThreatListUpdatesRequest" }, - "description": "Fetches the most recent threat list updates. A client can request updates\nfor multiple lists at once.", "response": { "$ref": "FetchThreatListUpdatesResponse" }, @@ -79,8 +79,8 @@ "httpMethod": "POST", "parameters": {}, "flatPath": "v4/threatListUpdates:fetch", - "path": "v4/threatListUpdates:fetch", - "id": "safebrowsing.threatListUpdates.fetch" + "id": "safebrowsing.threatListUpdates.fetch", + "path": "v4/threatListUpdates:fetch" } } }, @@ -89,26 +89,26 @@ "get": { "parameters": { "clientId": { + "description": "A client ID that (hopefully) uniquely identifies the client implementation\nof the Safe Browsing API.", "type": "string", - "location": "query", - "description": "A client ID that (hopefully) uniquely identifies the client implementation\nof the Safe Browsing API." + "location": "query" }, "clientVersion": { + "type": "string", "location": "query", - "description": "The version of the client implementation.", - "type": "string" + "description": "The version of the client implementation." }, "encodedRequest": { "location": "path", - "description": "A serialized FindFullHashesRequest proto.", "format": "byte", - "required": true, - "type": "string" + "description": "A serialized FindFullHashesRequest proto.", + "type": "string", + "required": true } }, "flatPath": "v4/encodedFullHashes/{encodedRequest}", - "path": "v4/encodedFullHashes/{encodedRequest}", "id": "safebrowsing.encodedFullHashes.get", + "path": "v4/encodedFullHashes/{encodedRequest}", "description": "", "response": { "$ref": "FindFullHashesResponse" @@ -123,6 +123,7 @@ "threatLists": { "methods": { "list": { + "description": "Lists the Safe Browsing threat lists available for download.", "response": { "$ref": "ListThreatListsResponse" }, @@ -130,28 +131,27 @@ "httpMethod": "GET", "parameters": {}, "flatPath": "v4/threatLists", - "path": "v4/threatLists", "id": "safebrowsing.threatLists.list", - "description": "Lists the Safe Browsing threat lists available for download." + "path": "v4/threatLists" } } }, "threatMatches": { "methods": { "find": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "FindThreatMatchesResponse" - }, - "parameters": {}, "flatPath": "v4/threatMatches:find", "id": "safebrowsing.threatMatches.find", "path": "v4/threatMatches:find", - "description": "Finds the threat entries that match the Safe Browsing lists.", "request": { "$ref": "FindThreatMatchesRequest" - } + }, + "description": "Finds the threat entries that match the Safe Browsing lists.", + "response": { + "$ref": "FindThreatMatchesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {} } } } @@ -163,26 +163,21 @@ "location": "query" }, "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", "default": "true", + "type": "boolean", + "location": "query", + "description": "Returns response with indentations and line breaks." + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", "location": "query" }, "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { "location": "query", - "description": "Selector specifying which fields to include in a partial response.", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string" }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, "$.xgafv": { "enumDescriptions": [ "v1 error format", @@ -196,9 +191,12 @@ "description": "V1 error format.", "type": "string" }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, "alt": { - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -210,18 +208,20 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query" - }, - "access_token": { "location": "query", - "description": "OAuth access token.", - "type": "string" + "description": "Data format for response.", + "default": "json" }, "key": { "type": "string", "location": "query", "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." }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, "quotaUser": { "location": "query", "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.", @@ -229,417 +229,46 @@ }, "pp": { "description": "Pretty-print response.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, "bearer_token": { - "location": "query", "description": "OAuth bearer token.", - "type": "string" + "type": "string", + "location": "query" }, "oauth_token": { + "description": "OAuth 2.0 token for the current user.", "type": "string", - "location": "query", - "description": "OAuth 2.0 token for the current user." + "location": "query" } }, "schemas": { - "ThreatEntryMetadata": { - "id": "ThreatEntryMetadata", - "description": "The metadata associated with a specific threat entry. The client is expected\nto know the metadata key/value pairs associated with each threat type.", - "type": "object", - "properties": { - "entries": { - "description": "The metadata entries.", - "type": "array", - "items": { - "$ref": "MetadataEntry" - } - } - } - }, - "RawIndices": { - "type": "object", - "properties": { - "indices": { - "description": "The indices to remove from a lexicographically-sorted local list.", - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - } - }, - "id": "RawIndices", - "description": "A set of raw indices to remove from a local list." - }, - "RawHashes": { - "description": "The uncompressed threat entries in hash format of a particular prefix length.\nHashes can be anywhere from 4 to 32 bytes in size. A large majority are 4\nbytes, but some hashes are lengthened if they collide with the hash of a\npopular URL.\n\nUsed for sending ThreatEntrySet to clients that do not support compression,\nor when sending non-4-byte hashes to clients that do support compression.", - "type": "object", - "properties": { - "rawHashes": { - "description": "The hashes, in binary format, concatenated into one long string. Hashes are\nsorted in lexicographic order. For JSON API users, hashes are\nbase64-encoded.", - "format": "byte", - "type": "string" - }, - "prefixSize": { - "description": "The number of bytes for each prefix encoded below. This field can be\nanywhere from 4 (shortest prefix) to 32 (full SHA256 hash).", - "format": "int32", - "type": "integer" - } - }, - "id": "RawHashes" - }, - "FetchThreatListUpdatesResponse": { - "type": "object", - "properties": { - "listUpdateResponses": { - "description": "The list updates requested by the clients.", - "type": "array", - "items": { - "$ref": "ListUpdateResponse" - } - }, - "minimumWaitDuration": { - "description": "The minimum duration the client must wait before issuing any update\nrequest. If this field is not set clients may update as soon as they want.", - "format": "google-duration", - "type": "string" - } - }, - "id": "FetchThreatListUpdatesResponse" - }, - "Checksum": { - "description": "The expected state of a client's local database.", - "type": "object", - "properties": { - "sha256": { - "description": "The SHA256 hash of the client state; that is, of the sorted list of all\nhashes present in the database.", - "format": "byte", - "type": "string" - } - }, - "id": "Checksum" - }, - "FindFullHashesResponse": { - "id": "FindFullHashesResponse", - "type": "object", - "properties": { - "minimumWaitDuration": { - "description": "The minimum duration the client must wait before issuing any find hashes\nrequest. If this field is not set, clients can issue a request as soon as\nthey want.", - "format": "google-duration", - "type": "string" - }, - "matches": { - "description": "The full hashes that matched the requested prefixes.", - "type": "array", - "items": { - "$ref": "ThreatMatch" - } - }, - "negativeCacheDuration": { - "type": "string", - "description": "For requested entities that did not match the threat list, how long to\ncache the response.", - "format": "google-duration" - } - } - }, - "ThreatEntrySet": { - "description": "A set of threats that should be added or removed from a client's local\ndatabase.", - "type": "object", - "properties": { - "compressionType": { - "enumDescriptions": [ - "Unknown.", - "Raw, uncompressed data.", - "Rice-Golomb encoded data." - ], - "enum": [ - "COMPRESSION_TYPE_UNSPECIFIED", - "RAW", - "RICE" - ], - "description": "The compression type for the entries in this set.", - "type": "string" - }, - "riceIndices": { - "$ref": "RiceDeltaEncoding", - "description": "The encoded local, lexicographically-sorted list indices, using a\nGolomb-Rice encoding. Used for sending compressed removal indices. The\nremoval indices (uint32) are sorted in ascending order, then delta encoded\nand stored as encoded_data." - }, - "rawIndices": { - "$ref": "RawIndices", - "description": "The raw removal indices for a local list." - }, - "rawHashes": { - "$ref": "RawHashes", - "description": "The raw SHA256-formatted entries." - }, - "riceHashes": { - "description": "The encoded 4-byte prefixes of SHA256-formatted entries, using a\nGolomb-Rice encoding. The hashes are converted to uint32, sorted in\nascending order, then delta encoded and stored as encoded_data.", - "$ref": "RiceDeltaEncoding" - } - }, - "id": "ThreatEntrySet" - }, - "FindFullHashesRequest": { - "properties": { - "client": { - "description": "The client metadata.", - "$ref": "ClientInfo" - }, - "threatInfo": { - "description": "The lists and hashes to be checked.", - "$ref": "ThreatInfo" - }, - "apiClient": { - "$ref": "ClientInfo", - "description": "Client metadata associated with callers of higher-level APIs built on top\nof the client's implementation." - }, - "clientStates": { - "description": "The current client states for each of the client's local threat lists.", - "type": "array", - "items": { - "format": "byte", - "type": "string" - } - } - }, - "id": "FindFullHashesRequest", - "description": "Request to return full hashes matched by the provided hash prefixes.", - "type": "object" - }, - "ListUpdateRequest": { - "description": "A single list update request.", - "type": "object", - "properties": { - "state": { - "description": "The current state of the client for the requested list (the encrypted\nclient state that was received from the last successful list update).", - "format": "byte", - "type": "string" - }, - "platformType": { - "enumDescriptions": [ - "Unknown platform.", - "Threat posed to Windows.", - "Threat posed to Linux.", - "Threat posed to Android.", - "Threat posed to OS X.", - "Threat posed to iOS.", - "Threat posed to at least one of the defined platforms.", - "Threat posed to all defined platforms.", - "Threat posed to Chrome." - ], - "enum": [ - "PLATFORM_TYPE_UNSPECIFIED", - "WINDOWS", - "LINUX", - "ANDROID", - "OSX", - "IOS", - "ANY_PLATFORM", - "ALL_PLATFORMS", - "CHROME" - ], - "description": "The type of platform at risk by entries present in the list.", - "type": "string" - }, - "threatType": { - "enum": [ - "THREAT_TYPE_UNSPECIFIED", - "MALWARE", - "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE", - "POTENTIALLY_HARMFUL_APPLICATION" - ], - "description": "The type of threat posed by entries present in the list.", - "type": "string", - "enumDescriptions": [ - "Unknown.", - "Malware threat type.", - "Social engineering threat type.", - "Unwanted software threat type.", - "Potentially harmful application threat type." - ] - }, - "constraints": { - "$ref": "Constraints", - "description": "The constraints associated with this request." - }, - "threatEntryType": { - "enumDescriptions": [ - "Unspecified.", - "A URL.", - "An executable program.", - "An IP range.", - "Chrome extension.", - "Filename.", - "CERT" - ], - "enum": [ - "THREAT_ENTRY_TYPE_UNSPECIFIED", - "URL", - "EXECUTABLE", - "IP_RANGE", - "CHROME_EXTENSION", - "FILENAME", - "CERT" - ], - "description": "The types of entries present in the list.", - "type": "string" - } - }, - "id": "ListUpdateRequest" - }, - "FetchThreatListUpdatesRequest": { - "type": "object", - "properties": { - "client": { - "description": "The client metadata.", - "$ref": "ClientInfo" - }, - "listUpdateRequests": { - "type": "array", - "items": { - "$ref": "ListUpdateRequest" - }, - "description": "The requested threat list updates." - } - }, - "id": "FetchThreatListUpdatesRequest", - "description": "Describes a Safe Browsing API update request. Clients can request updates for\nmultiple lists in a single request.\nNOTE: Field index 2 is unused.\nNEXT: 5" - }, - "ListUpdateResponse": { - "description": "An update to an individual list.", - "type": "object", - "properties": { - "platformType": { - "description": "The platform type for which data is returned.", - "type": "string", - "enumDescriptions": [ - "Unknown platform.", - "Threat posed to Windows.", - "Threat posed to Linux.", - "Threat posed to Android.", - "Threat posed to OS X.", - "Threat posed to iOS.", - "Threat posed to at least one of the defined platforms.", - "Threat posed to all defined platforms.", - "Threat posed to Chrome." - ], - "enum": [ - "PLATFORM_TYPE_UNSPECIFIED", - "WINDOWS", - "LINUX", - "ANDROID", - "OSX", - "IOS", - "ANY_PLATFORM", - "ALL_PLATFORMS", - "CHROME" - ] - }, - "threatEntryType": { - "enumDescriptions": [ - "Unspecified.", - "A URL.", - "An executable program.", - "An IP range.", - "Chrome extension.", - "Filename.", - "CERT" - ], - "enum": [ - "THREAT_ENTRY_TYPE_UNSPECIFIED", - "URL", - "EXECUTABLE", - "IP_RANGE", - "CHROME_EXTENSION", - "FILENAME", - "CERT" - ], - "description": "The format of the threats.", - "type": "string" - }, - "additions": { - "description": "A set of entries to add to a local threat type's list. Repeated to allow\nfor a combination of compressed and raw data to be sent in a single\nresponse.", - "type": "array", - "items": { - "$ref": "ThreatEntrySet" - } - }, - "checksum": { - "$ref": "Checksum", - "description": "The expected SHA256 hash of the client state; that is, of the sorted list\nof all hashes present in the database after applying the provided update.\nIf the client state doesn't match the expected state, the client must\ndisregard this update and retry later." - }, - "responseType": { - "type": "string", - "enumDescriptions": [ - "Unknown.", - "Partial updates are applied to the client's existing local database.", - "Full updates replace the client's entire local database. This means\nthat either the client was seriously out-of-date or the client is\nbelieved to be corrupt." - ], - "enum": [ - "RESPONSE_TYPE_UNSPECIFIED", - "PARTIAL_UPDATE", - "FULL_UPDATE" - ], - "description": "The type of response. This may indicate that an action is required by the\nclient when the response is received." - }, - "threatType": { - "description": "The threat type for which data is returned.", - "type": "string", - "enumDescriptions": [ - "Unknown.", - "Malware threat type.", - "Social engineering threat type.", - "Unwanted software threat type.", - "Potentially harmful application threat type." - ], - "enum": [ - "THREAT_TYPE_UNSPECIFIED", - "MALWARE", - "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE", - "POTENTIALLY_HARMFUL_APPLICATION" - ] - }, - "removals": { - "description": "A set of entries to remove from a local threat type's list. In practice,\nthis field is empty or contains exactly one ThreatEntrySet.", - "type": "array", - "items": { - "$ref": "ThreatEntrySet" - } - }, - "newClientState": { - "description": "The new client state, in encrypted format. Opaque to clients.", - "format": "byte", - "type": "string" - } - }, - "id": "ListUpdateResponse" - }, "Constraints": { + "description": "The constraints for this update.", + "type": "object", "properties": { - "maxDatabaseEntries": { - "description": "Sets the maximum number of entries that the client is willing to have\nin the local database. This should be a power of 2 between 2**10 and\n2**20. If zero, no database size limit is set.", - "format": "int32", - "type": "integer" - }, "region": { "description": "Requests the list for a specific geographic location. If not set the\nserver may pick that value based on the user's IP address. Expects ISO\n3166-1 alpha-2 format.", "type": "string" }, + "maxDatabaseEntries": { + "format": "int32", + "description": "Sets the maximum number of entries that the client is willing to have\nin the local database. This should be a power of 2 between 2**10 and\n2**20. If zero, no database size limit is set.", + "type": "integer" + }, "supportedCompressions": { "description": "The compression types supported by the client.", - "type": "array", "items": { - "type": "string", "enum": [ "COMPRESSION_TYPE_UNSPECIFIED", "RAW", "RICE" - ] + ], + "type": "string" }, + "type": "array", "enumDescriptions": [ "Unknown.", "Raw, uncompressed data.", @@ -647,20 +276,87 @@ ] }, "maxUpdateEntries": { - "description": "The maximum size in number of entries. The update will not contain more\nentries than this value. This should be a power of 2 between 2**10 and\n2**20. If zero, no update size limit is set.", "format": "int32", + "description": "The maximum size in number of entries. The update will not contain more\nentries than this value. This should be a power of 2 between 2**10 and\n2**20. If zero, no update size limit is set.", "type": "integer" } }, - "id": "Constraints", - "description": "The constraints for this update.", - "type": "object" + "id": "Constraints" }, "ThreatMatch": { + "description": "A match when checking a threat entry in the Safe Browsing threat lists.", + "type": "object", "properties": { + "threatEntryType": { + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ], + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" + ], + "description": "The threat entry type matching this threat.", + "type": "string" + }, + "cacheDuration": { + "format": "google-duration", + "description": "The cache lifetime for the returned match. Clients must not cache this\nresponse for more than this duration to avoid false positives.", + "type": "string" + }, + "threatType": { + "enumDescriptions": [ + "Unknown.", + "Malware threat type.", + "Social engineering threat type.", + "Unwanted software threat type.", + "Potentially harmful application threat type.", + "Social engineering threat type for internal use.", + "API abuse threat type.", + "Malicious binary threat type.", + "Client side detection whitelist threat type.", + "Client side download detection whitelist threat type.", + "Client incident threat type.", + "Whitelist used when detecting client incident threats.\nThis enum was never launched and should be re-used for the next list.", + "List used for offline APK checks in PAM.", + "Patterns to be used for activating the subresource filter. Interstitial\nwill not be shown for patterns from this list." + ], + "enum": [ + "THREAT_TYPE_UNSPECIFIED", + "MALWARE", + "SOCIAL_ENGINEERING", + "UNWANTED_SOFTWARE", + "POTENTIALLY_HARMFUL_APPLICATION", + "SOCIAL_ENGINEERING_INTERNAL", + "API_ABUSE", + "MALICIOUS_BINARY", + "CSD_WHITELIST", + "CSD_DOWNLOAD_WHITELIST", + "CLIENT_INCIDENT", + "CLIENT_INCIDENT_WHITELIST", + "APK_MALWARE_OFFLINE", + "SUBRESOURCE_FILTER" + ], + "description": "The threat type matching this threat.", + "type": "string" + }, + "threatEntryMetadata": { + "$ref": "ThreatEntryMetadata", + "description": "Optional metadata associated with this threat." + }, "threat": { - "$ref": "ThreatEntry", - "description": "The threat matching this threat." + "description": "The threat matching this threat.", + "$ref": "ThreatEntry" }, "platformType": { "enumDescriptions": [ @@ -687,9 +383,151 @@ ], "description": "The platform type matching this threat.", "type": "string" + } + }, + "id": "ThreatMatch" + }, + "ListThreatListsResponse": { + "type": "object", + "properties": { + "threatLists": { + "items": { + "$ref": "ThreatListDescriptor" + }, + "type": "array", + "description": "The lists available for download by the client." + } + }, + "id": "ListThreatListsResponse" + }, + "RiceDeltaEncoding": { + "type": "object", + "properties": { + "encodedData": { + "format": "byte", + "description": "The encoded deltas that are encoded using the Golomb-Rice coder.", + "type": "string" + }, + "firstValue": { + "format": "int64", + "description": "The offset of the first entry in the encoded data, or, if only a single\ninteger was encoded, that single integer's value.", + "type": "string" + }, + "numEntries": { + "format": "int32", + "description": "The number of entries that are delta encoded in the encoded data. If only a\nsingle integer was encoded, this will be zero and the single value will be\nstored in `first_value`.", + "type": "integer" + }, + "riceParameter": { + "format": "int32", + "description": "The Golomb-Rice parameter, which is a number between 2 and 28. This field\nis missing (that is, zero) if `num_entries` is zero.", + "type": "integer" + } + }, + "id": "RiceDeltaEncoding", + "description": "The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or\ncompressed removal indices." + }, + "FindThreatMatchesResponse": { + "type": "object", + "properties": { + "matches": { + "description": "The threat list matches.", + "items": { + "$ref": "ThreatMatch" + }, + "type": "array" + } + }, + "id": "FindThreatMatchesResponse" + }, + "ThreatEntry": { + "properties": { + "digest": { + "format": "byte", + "description": "The digest of an executable in SHA256 format. The API supports both\nbinary and hex digests. For JSON requests, digests are base64-encoded.", + "type": "string" + }, + "hash": { + "format": "byte", + "description": "A hash prefix, consisting of the most significant 4-32 bytes of a SHA256\nhash. This field is in binary format. For JSON requests, hashes are\nbase64-encoded.", + "type": "string" + }, + "url": { + "description": "A URL.", + "type": "string" + } + }, + "id": "ThreatEntry", + "description": "An individual threat; for example, a malicious URL or its hash\nrepresentation. Only one of these fields should be set.", + "type": "object" + }, + "ThreatListDescriptor": { + "description": "Describes an individual threat list. A list is defined by three parameters:\nthe type of threat posed, the type of platform targeted by the threat, and\nthe type of entries in the list.", + "type": "object", + "properties": { + "platformType": { + "enum": [ + "PLATFORM_TYPE_UNSPECIFIED", + "WINDOWS", + "LINUX", + "ANDROID", + "OSX", + "IOS", + "ANY_PLATFORM", + "ALL_PLATFORMS", + "CHROME" + ], + "description": "The platform type targeted by the list's entries.", + "type": "string", + "enumDescriptions": [ + "Unknown platform.", + "Threat posed to Windows.", + "Threat posed to Linux.", + "Threat posed to Android.", + "Threat posed to OS X.", + "Threat posed to iOS.", + "Threat posed to at least one of the defined platforms.", + "Threat posed to all defined platforms.", + "Threat posed to Chrome." + ] + }, + "threatType": { + "enum": [ + "THREAT_TYPE_UNSPECIFIED", + "MALWARE", + "SOCIAL_ENGINEERING", + "UNWANTED_SOFTWARE", + "POTENTIALLY_HARMFUL_APPLICATION", + "SOCIAL_ENGINEERING_INTERNAL", + "API_ABUSE", + "MALICIOUS_BINARY", + "CSD_WHITELIST", + "CSD_DOWNLOAD_WHITELIST", + "CLIENT_INCIDENT", + "CLIENT_INCIDENT_WHITELIST", + "APK_MALWARE_OFFLINE", + "SUBRESOURCE_FILTER" + ], + "description": "The threat type posed by the list's entries.", + "type": "string", + "enumDescriptions": [ + "Unknown.", + "Malware threat type.", + "Social engineering threat type.", + "Unwanted software threat type.", + "Potentially harmful application threat type.", + "Social engineering threat type for internal use.", + "API abuse threat type.", + "Malicious binary threat type.", + "Client side detection whitelist threat type.", + "Client side download detection whitelist threat type.", + "Client incident threat type.", + "Whitelist used when detecting client incident threats.\nThis enum was never launched and should be re-used for the next list.", + "List used for offline APK checks in PAM.", + "Patterns to be used for activating the subresource filter. Interstitial\nwill not be shown for patterns from this list." + ] }, "threatEntryType": { - "description": "The threat entry type matching this threat.", "type": "string", "enumDescriptions": [ "Unspecified.", @@ -708,121 +546,362 @@ "CHROME_EXTENSION", "FILENAME", "CERT" - ] - }, - "cacheDuration": { - "description": "The cache lifetime for the returned match. Clients must not cache this\nresponse for more than this duration to avoid false positives.", - "format": "google-duration", + ], + "description": "The entry types contained in the list." + } + }, + "id": "ThreatListDescriptor" + }, + "MetadataEntry": { + "description": "A single metadata entry.", + "type": "object", + "properties": { + "key": { + "format": "byte", + "description": "The metadata entry key. For JSON requests, the key is base64-encoded.", "type": "string" }, - "threatEntryMetadata": { - "$ref": "ThreatEntryMetadata", - "description": "Optional metadata associated with this threat." + "value": { + "format": "byte", + "description": "The metadata entry value. For JSON requests, the value is base64-encoded.", + "type": "string" + } + }, + "id": "MetadataEntry" + }, + "ClientInfo": { + "description": "The client metadata associated with Safe Browsing API requests.", + "type": "object", + "properties": { + "clientVersion": { + "description": "The version of the client implementation.", + "type": "string" }, - "threatType": { - "description": "The threat type matching this threat.", - "type": "string", + "clientId": { + "description": "A client ID that (hopefully) uniquely identifies the client implementation\nof the Safe Browsing API.", + "type": "string" + } + }, + "id": "ClientInfo" + }, + "ThreatInfo": { + "description": "The information regarding one or more threats that a client submits when\nchecking for matches in threat lists.", + "type": "object", + "properties": { + "threatEntryTypes": { + "description": "The entry types to be checked.", + "items": { + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" + ], + "type": "string" + }, + "type": "array", + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ] + }, + "threatTypes": { + "items": { + "type": "string", + "enum": [ + "THREAT_TYPE_UNSPECIFIED", + "MALWARE", + "SOCIAL_ENGINEERING", + "UNWANTED_SOFTWARE", + "POTENTIALLY_HARMFUL_APPLICATION", + "SOCIAL_ENGINEERING_INTERNAL", + "API_ABUSE", + "MALICIOUS_BINARY", + "CSD_WHITELIST", + "CSD_DOWNLOAD_WHITELIST", + "CLIENT_INCIDENT", + "CLIENT_INCIDENT_WHITELIST", + "APK_MALWARE_OFFLINE", + "SUBRESOURCE_FILTER" + ] + }, + "type": "array", "enumDescriptions": [ "Unknown.", "Malware threat type.", "Social engineering threat type.", "Unwanted software threat type.", - "Potentially harmful application threat type." + "Potentially harmful application threat type.", + "Social engineering threat type for internal use.", + "API abuse threat type.", + "Malicious binary threat type.", + "Client side detection whitelist threat type.", + "Client side download detection whitelist threat type.", + "Client incident threat type.", + "Whitelist used when detecting client incident threats.\nThis enum was never launched and should be re-used for the next list.", + "List used for offline APK checks in PAM.", + "Patterns to be used for activating the subresource filter. Interstitial\nwill not be shown for patterns from this list." ], - "enum": [ - "THREAT_TYPE_UNSPECIFIED", - "MALWARE", - "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE", - "POTENTIALLY_HARMFUL_APPLICATION" - ] - } - }, - "id": "ThreatMatch", - "description": "A match when checking a threat entry in the Safe Browsing threat lists.", - "type": "object" - }, - "ListThreatListsResponse": { - "properties": { - "threatLists": { - "type": "array", + "description": "The threat types to be checked." + }, + "platformTypes": { + "enumDescriptions": [ + "Unknown platform.", + "Threat posed to Windows.", + "Threat posed to Linux.", + "Threat posed to Android.", + "Threat posed to OS X.", + "Threat posed to iOS.", + "Threat posed to at least one of the defined platforms.", + "Threat posed to all defined platforms.", + "Threat posed to Chrome." + ], + "description": "The platform types to be checked.", "items": { - "$ref": "ThreatListDescriptor" + "enum": [ + "PLATFORM_TYPE_UNSPECIFIED", + "WINDOWS", + "LINUX", + "ANDROID", + "OSX", + "IOS", + "ANY_PLATFORM", + "ALL_PLATFORMS", + "CHROME" + ], + "type": "string" }, - "description": "The lists available for download by the client." + "type": "array" + }, + "threatEntries": { + "description": "The threat entries to be checked.", + "items": { + "$ref": "ThreatEntry" + }, + "type": "array" } }, - "id": "ListThreatListsResponse", + "id": "ThreatInfo" + }, + "FindThreatMatchesRequest": { + "properties": { + "client": { + "description": "The client metadata.", + "$ref": "ClientInfo" + }, + "threatInfo": { + "description": "The lists and entries to be checked for matches.", + "$ref": "ThreatInfo" + } + }, + "id": "FindThreatMatchesRequest", + "description": "Request to check entries against lists.", "type": "object" }, - "RiceDeltaEncoding": { - "description": "The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or\ncompressed removal indices.", + "ThreatEntryMetadata": { + "description": "The metadata associated with a specific threat entry. The client is expected\nto know the metadata key/value pairs associated with each threat type.", "type": "object", "properties": { - "firstValue": { - "description": "The offset of the first entry in the encoded data, or, if only a single\ninteger was encoded, that single integer's value.", - "format": "int64", - "type": "string" - }, - "encodedData": { - "type": "string", - "description": "The encoded deltas that are encoded using the Golomb-Rice coder.", - "format": "byte" - }, - "numEntries": { - "description": "The number of entries that are delta encoded in the encoded data. If only a\nsingle integer was encoded, this will be zero and the single value will be\nstored in `first_value`.", - "format": "int32", - "type": "integer" - }, - "riceParameter": { - "description": "The Golomb-Rice parameter, which is a number between 2 and 28. This field\nis missing (that is, zero) if `num_entries` is zero.", - "format": "int32", - "type": "integer" + "entries": { + "description": "The metadata entries.", + "items": { + "$ref": "MetadataEntry" + }, + "type": "array" } }, - "id": "RiceDeltaEncoding" + "id": "ThreatEntryMetadata" }, - "ThreatEntry": { + "RawIndices": { + "description": "A set of raw indices to remove from a local list.", + "type": "object", "properties": { - "digest": { - "description": "The digest of an executable in SHA256 format. The API supports both\nbinary and hex digests. For JSON requests, digests are base64-encoded.", - "format": "byte", - "type": "string" + "indices": { + "description": "The indices to remove from a lexicographically-sorted local list.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + } + }, + "id": "RawIndices" + }, + "RawHashes": { + "description": "The uncompressed threat entries in hash format of a particular prefix length.\nHashes can be anywhere from 4 to 32 bytes in size. A large majority are 4\nbytes, but some hashes are lengthened if they collide with the hash of a\npopular URL.\n\nUsed for sending ThreatEntrySet to clients that do not support compression,\nor when sending non-4-byte hashes to clients that do support compression.", + "type": "object", + "properties": { + "prefixSize": { + "format": "int32", + "description": "The number of bytes for each prefix encoded below. This field can be\nanywhere from 4 (shortest prefix) to 32 (full SHA256 hash).", + "type": "integer" }, - "hash": { - "description": "A hash prefix, consisting of the most significant 4-32 bytes of a SHA256\nhash. This field is in binary format. For JSON requests, hashes are\nbase64-encoded.", + "rawHashes": { "format": "byte", - "type": "string" - }, - "url": { - "description": "A URL.", + "description": "The hashes, in binary format, concatenated into one long string. Hashes are\nsorted in lexicographic order. For JSON API users, hashes are\nbase64-encoded.", "type": "string" } }, - "id": "ThreatEntry", - "description": "An individual threat; for example, a malicious URL or its hash\nrepresentation. Only one of these fields should be set.", - "type": "object" + "id": "RawHashes" }, - "FindThreatMatchesResponse": { + "FetchThreatListUpdatesResponse": { "type": "object", + "properties": { + "minimumWaitDuration": { + "format": "google-duration", + "description": "The minimum duration the client must wait before issuing any update\nrequest. If this field is not set clients may update as soon as they want.", + "type": "string" + }, + "listUpdateResponses": { + "description": "The list updates requested by the clients.", + "items": { + "$ref": "ListUpdateResponse" + }, + "type": "array" + } + }, + "id": "FetchThreatListUpdatesResponse" + }, + "FindFullHashesResponse": { "properties": { "matches": { - "description": "The threat list matches.", - "type": "array", + "description": "The full hashes that matched the requested prefixes.", "items": { "$ref": "ThreatMatch" - } + }, + "type": "array" + }, + "negativeCacheDuration": { + "format": "google-duration", + "description": "For requested entities that did not match the threat list, how long to\ncache the response.", + "type": "string" + }, + "minimumWaitDuration": { + "format": "google-duration", + "description": "The minimum duration the client must wait before issuing any find hashes\nrequest. If this field is not set, clients can issue a request as soon as\nthey want.", + "type": "string" } }, - "id": "FindThreatMatchesResponse" + "id": "FindFullHashesResponse", + "type": "object" }, - "ThreatListDescriptor": { - "id": "ThreatListDescriptor", - "description": "Describes an individual threat list. A list is defined by three parameters:\nthe type of threat posed, the type of platform targeted by the threat, and\nthe type of entries in the list.", + "Checksum": { + "description": "The expected state of a client's local database.", "type": "object", "properties": { + "sha256": { + "type": "string", + "format": "byte", + "description": "The SHA256 hash of the client state; that is, of the sorted list of all\nhashes present in the database." + } + }, + "id": "Checksum" + }, + "ThreatEntrySet": { + "description": "A set of threats that should be added or removed from a client's local\ndatabase.", + "type": "object", + "properties": { + "riceIndices": { + "$ref": "RiceDeltaEncoding", + "description": "The encoded local, lexicographically-sorted list indices, using a\nGolomb-Rice encoding. Used for sending compressed removal indices. The\nremoval indices (uint32) are sorted in ascending order, then delta encoded\nand stored as encoded_data." + }, + "compressionType": { + "type": "string", + "enumDescriptions": [ + "Unknown.", + "Raw, uncompressed data.", + "Rice-Golomb encoded data." + ], + "enum": [ + "COMPRESSION_TYPE_UNSPECIFIED", + "RAW", + "RICE" + ], + "description": "The compression type for the entries in this set." + }, + "rawIndices": { + "$ref": "RawIndices", + "description": "The raw removal indices for a local list." + }, + "rawHashes": { + "description": "The raw SHA256-formatted entries.", + "$ref": "RawHashes" + }, + "riceHashes": { + "$ref": "RiceDeltaEncoding", + "description": "The encoded 4-byte prefixes of SHA256-formatted entries, using a\nGolomb-Rice encoding. The hashes are converted to uint32, sorted in\nascending order, then delta encoded and stored as encoded_data." + } + }, + "id": "ThreatEntrySet" + }, + "FindFullHashesRequest": { + "description": "Request to return full hashes matched by the provided hash prefixes.", + "type": "object", + "properties": { + "apiClient": { + "description": "Client metadata associated with callers of higher-level APIs built on top\nof the client's implementation.", + "$ref": "ClientInfo" + }, + "clientStates": { + "description": "The current client states for each of the client's local threat lists.", + "items": { + "format": "byte", + "type": "string" + }, + "type": "array" + }, + "client": { + "description": "The client metadata.", + "$ref": "ClientInfo" + }, + "threatInfo": { + "description": "The lists and hashes to be checked.", + "$ref": "ThreatInfo" + } + }, + "id": "FindFullHashesRequest" + }, + "ListUpdateRequest": { + "description": "A single list update request.", + "type": "object", + "properties": { + "threatEntryType": { + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" + ], + "description": "The types of entries present in the list.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ] + }, + "state": { + "format": "byte", + "description": "The current state of the client for the requested list (the encrypted\nclient state that was received from the last successful list update).", + "type": "string" + }, "platformType": { - "description": "The platform type targeted by the list's entries.", + "description": "The type of platform at risk by entries present in the list.", "type": "string", "enumDescriptions": [ "Unknown platform.", @@ -847,131 +926,159 @@ "CHROME" ] }, + "constraints": { + "$ref": "Constraints", + "description": "The constraints associated with this request." + }, "threatType": { "enumDescriptions": [ "Unknown.", "Malware threat type.", "Social engineering threat type.", "Unwanted software threat type.", - "Potentially harmful application threat type." + "Potentially harmful application threat type.", + "Social engineering threat type for internal use.", + "API abuse threat type.", + "Malicious binary threat type.", + "Client side detection whitelist threat type.", + "Client side download detection whitelist threat type.", + "Client incident threat type.", + "Whitelist used when detecting client incident threats.\nThis enum was never launched and should be re-used for the next list.", + "List used for offline APK checks in PAM.", + "Patterns to be used for activating the subresource filter. Interstitial\nwill not be shown for patterns from this list." ], "enum": [ "THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", "UNWANTED_SOFTWARE", - "POTENTIALLY_HARMFUL_APPLICATION" + "POTENTIALLY_HARMFUL_APPLICATION", + "SOCIAL_ENGINEERING_INTERNAL", + "API_ABUSE", + "MALICIOUS_BINARY", + "CSD_WHITELIST", + "CSD_DOWNLOAD_WHITELIST", + "CLIENT_INCIDENT", + "CLIENT_INCIDENT_WHITELIST", + "APK_MALWARE_OFFLINE", + "SUBRESOURCE_FILTER" ], - "description": "The threat type posed by the list's entries.", + "description": "The type of threat posed by entries present in the list.", "type": "string" + } + }, + "id": "ListUpdateRequest" + }, + "FetchThreatListUpdatesRequest": { + "id": "FetchThreatListUpdatesRequest", + "description": "Describes a Safe Browsing API update request. Clients can request updates for\nmultiple lists in a single request.\nNOTE: Field index 2 is unused.\nNEXT: 5", + "type": "object", + "properties": { + "listUpdateRequests": { + "items": { + "$ref": "ListUpdateRequest" + }, + "type": "array", + "description": "The requested threat list updates." }, - "threatEntryType": { - "description": "The entry types contained in the list.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "A URL.", - "An executable program.", - "An IP range.", - "Chrome extension.", - "Filename.", - "CERT" - ], - "enum": [ - "THREAT_ENTRY_TYPE_UNSPECIFIED", - "URL", - "EXECUTABLE", - "IP_RANGE", - "CHROME_EXTENSION", - "FILENAME", - "CERT" - ] + "client": { + "description": "The client metadata.", + "$ref": "ClientInfo" } } }, - "MetadataEntry": { - "description": "A single metadata entry.", + "ListUpdateResponse": { + "id": "ListUpdateResponse", + "description": "An update to an individual list.", "type": "object", "properties": { - "value": { - "description": "The metadata entry value. For JSON requests, the value is base64-encoded.", - "format": "byte", - "type": "string" - }, - "key": { - "description": "The metadata entry key. For JSON requests, the key is base64-encoded.", - "format": "byte", - "type": "string" - } - }, - "id": "MetadataEntry" - }, - "ClientInfo": { - "type": "object", - "properties": { - "clientId": { - "description": "A client ID that (hopefully) uniquely identifies the client implementation\nof the Safe Browsing API.", - "type": "string" - }, - "clientVersion": { - "description": "The version of the client implementation.", - "type": "string" - } - }, - "id": "ClientInfo", - "description": "The client metadata associated with Safe Browsing API requests." - }, - "ThreatInfo": { - "description": "The information regarding one or more threats that a client submits when\nchecking for matches in threat lists.", - "type": "object", - "properties": { - "threatEntryTypes": { - "description": "The entry types to be checked.", - "type": "array", + "additions": { + "description": "A set of entries to add to a local threat type's list. Repeated to allow\nfor a combination of compressed and raw data to be sent in a single\nresponse.", "items": { - "type": "string", - "enum": [ - "THREAT_ENTRY_TYPE_UNSPECIFIED", - "URL", - "EXECUTABLE", - "IP_RANGE", - "CHROME_EXTENSION", - "FILENAME", - "CERT" - ] + "$ref": "ThreatEntrySet" }, + "type": "array" + }, + "responseType": { + "description": "The type of response. This may indicate that an action is required by the\nclient when the response is received.", + "type": "string", "enumDescriptions": [ - "Unspecified.", - "A URL.", - "An executable program.", - "An IP range.", - "Chrome extension.", - "Filename.", - "CERT" + "Unknown.", + "Partial updates are applied to the client's existing local database.", + "Full updates replace the client's entire local database. This means\nthat either the client was seriously out-of-date or the client is\nbelieved to be corrupt." + ], + "enum": [ + "RESPONSE_TYPE_UNSPECIFIED", + "PARTIAL_UPDATE", + "FULL_UPDATE" ] }, - "threatTypes": { - "description": "The threat types to be checked.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "THREAT_TYPE_UNSPECIFIED", - "MALWARE", - "SOCIAL_ENGINEERING", - "UNWANTED_SOFTWARE", - "POTENTIALLY_HARMFUL_APPLICATION" - ] - }, + "checksum": { + "description": "The expected SHA256 hash of the client state; that is, of the sorted list\nof all hashes present in the database after applying the provided update.\nIf the client state doesn't match the expected state, the client must\ndisregard this update and retry later.", + "$ref": "Checksum" + }, + "threatType": { "enumDescriptions": [ "Unknown.", "Malware threat type.", "Social engineering threat type.", "Unwanted software threat type.", - "Potentially harmful application threat type." - ] + "Potentially harmful application threat type.", + "Social engineering threat type for internal use.", + "API abuse threat type.", + "Malicious binary threat type.", + "Client side detection whitelist threat type.", + "Client side download detection whitelist threat type.", + "Client incident threat type.", + "Whitelist used when detecting client incident threats.\nThis enum was never launched and should be re-used for the next list.", + "List used for offline APK checks in PAM.", + "Patterns to be used for activating the subresource filter. Interstitial\nwill not be shown for patterns from this list." + ], + "enum": [ + "THREAT_TYPE_UNSPECIFIED", + "MALWARE", + "SOCIAL_ENGINEERING", + "UNWANTED_SOFTWARE", + "POTENTIALLY_HARMFUL_APPLICATION", + "SOCIAL_ENGINEERING_INTERNAL", + "API_ABUSE", + "MALICIOUS_BINARY", + "CSD_WHITELIST", + "CSD_DOWNLOAD_WHITELIST", + "CLIENT_INCIDENT", + "CLIENT_INCIDENT_WHITELIST", + "APK_MALWARE_OFFLINE", + "SUBRESOURCE_FILTER" + ], + "description": "The threat type for which data is returned.", + "type": "string" }, - "platformTypes": { + "newClientState": { + "format": "byte", + "description": "The new client state, in encrypted format. Opaque to clients.", + "type": "string" + }, + "removals": { + "description": "A set of entries to remove from a local threat type's list. In practice,\nthis field is empty or contains exactly one ThreatEntrySet.", + "items": { + "$ref": "ThreatEntrySet" + }, + "type": "array" + }, + "platformType": { + "enum": [ + "PLATFORM_TYPE_UNSPECIFIED", + "WINDOWS", + "LINUX", + "ANDROID", + "OSX", + "IOS", + "ANY_PLATFORM", + "ALL_PLATFORMS", + "CHROME" + ], + "description": "The platform type for which data is returned.", + "type": "string", "enumDescriptions": [ "Unknown platform.", "Threat posed to Windows.", @@ -982,48 +1089,31 @@ "Threat posed to at least one of the defined platforms.", "Threat posed to all defined platforms.", "Threat posed to Chrome." + ] + }, + "threatEntryType": { + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" ], - "description": "The platform types to be checked.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "PLATFORM_TYPE_UNSPECIFIED", - "WINDOWS", - "LINUX", - "ANDROID", - "OSX", - "IOS", - "ANY_PLATFORM", - "ALL_PLATFORMS", - "CHROME" - ] - } - }, - "threatEntries": { - "description": "The threat entries to be checked.", - "type": "array", - "items": { - "$ref": "ThreatEntry" - } + "description": "The format of the threats.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ] } - }, - "id": "ThreatInfo" - }, - "FindThreatMatchesRequest": { - "description": "Request to check entries against lists.", - "type": "object", - "properties": { - "client": { - "$ref": "ClientInfo", - "description": "The client metadata." - }, - "threatInfo": { - "$ref": "ThreatInfo", - "description": "The lists and entries to be checked for matches." - } - }, - "id": "FindThreatMatchesRequest" + } } }, "icons": { @@ -1033,7 +1123,7 @@ "protocol": "rest", "version": "v4", "baseUrl": "https://safebrowsing.googleapis.com/", - "description": "The Safe Browsing API is an experimental API that allows client applications to check URLs against Google's constantly-updated blacklists of suspected phishing and malware pages. Your client application can use the API to download an encrypted table for local, client-side lookups of URLs.", + "description": "Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.", "servicePath": "", "kind": "discovery#restDescription", "rootUrl": "https://safebrowsing.googleapis.com/" diff --git a/etc/api/script/v1/script-api.json b/etc/api/script/v1/script-api.json index 38f20ab7e9..64a60928c5 100644 --- a/etc/api/script/v1/script-api.json +++ b/etc/api/script/v1/script-api.json @@ -1,7 +1,56 @@ { - "revision": "20170509", + "version": "v1", + "baseUrl": "https://script.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/drive": { + "description": "View and manage the files in your Google Drive" + }, + "https://www.googleapis.com/auth/admin.directory.user": { + "description": "View and manage the provisioning of users on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.group": { + "description": "View and manage the provisioning of groups on your domain" + }, + "https://www.googleapis.com/auth/spreadsheets": { + "description": "View and manage your spreadsheets in Google Drive" + }, + "https://mail.google.com/": { + "description": "Read, send, delete, and manage your email" + }, + "https://www.googleapis.com/auth/forms": { + "description": "View and manage your forms in Google Drive" + }, + "https://www.google.com/m8/feeds": { + "description": "Manage your contacts" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, + "https://www.google.com/calendar/feeds": { + "description": "Manage your calendars" + }, + "https://www.googleapis.com/auth/groups": { + "description": "View and manage your Google Groups" + }, + "https://www.googleapis.com/auth/forms.currentonly": { + "description": "View and manage forms that this application has been installed in" + } + } + } + }, + "kind": "discovery#restDescription", + "description": "Executes functions in Google Apps Script projects.", + "servicePath": "", + "rootUrl": "https://script.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "script", + "batchPath": "batch", "id": "script:v1", "documentationLink": "https://developers.google.com/apps-script/execution/rest/v1/scripts/run", + "revision": "20170918", "title": "Google Apps Script Execution API", "discoveryVersion": "v1", "ownerName": "Google", @@ -9,6 +58,8 @@ "scripts": { "methods": { "run": { + "id": "script.scripts.run", + "path": "v1/scripts/{scriptId}:run", "request": { "$ref": "ExecutionRequest" }, @@ -22,10 +73,10 @@ }, "parameters": { "scriptId": { - "location": "path", - "description": "The project key of the script to be executed. To find the project key, open\nthe project in the script editor and select **File \u003e Project properties**.", + "description": "The script ID of the script to be executed. To find the script ID, open\nthe project in the script editor and select **File \u003e Project properties**.", "required": true, - "type": "string" + "type": "string", + "location": "path" } }, "scopes": [ @@ -41,34 +92,21 @@ "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1/scripts/{scriptId}:run", - "id": "script.scripts.run", - "path": "v1/scripts/{scriptId}:run" + "flatPath": "v1/scripts/{scriptId}:run" } } } }, "parameters": { - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, "fields": { - "description": "Selector specifying which fields to include in a partial response.", "type": "string", - "location": "query" + "location": "query", + "description": "Selector specifying which fields to include in a partial response." }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "callback": { "location": "query", @@ -76,17 +114,17 @@ "type": "string" }, "$.xgafv": { + "enum": [ + "1", + "2" + ], "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" ], - "location": "query", - "enum": [ - "1", - "2" - ] + "location": "query" }, "alt": { "type": "string", @@ -110,9 +148,9 @@ "location": "query" }, "access_token": { - "location": "query", "description": "OAuth access token.", - "type": "string" + "type": "string", + "location": "query" }, "quotaUser": { "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.", @@ -134,51 +172,27 @@ "location": "query", "description": "OAuth 2.0 token for the current user.", "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "type": "boolean", + "default": "true", + "location": "query", + "description": "Returns response with indentations and line breaks." } }, "schemas": { - "ScriptStackTraceElement": { - "description": "A stack trace through the script that shows where the execution failed.", - "type": "object", + "Status": { "properties": { - "function": { - "description": "The name of the function that failed.", - "type": "string" - }, - "lineNumber": { - "description": "The line number where the script failed.", + "code": { + "description": "The status code. For this API, this value will always be 3, corresponding to an \u003ccode\u003eINVALID_ARGUMENT\u003c/code\u003e error.", "format": "int32", "type": "integer" - } - }, - "id": "ScriptStackTraceElement" - }, - "ExecutionError": { - "description": "An object that provides information about the nature of an error in the Apps\nScript Execution API. If an\n`run` call succeeds but the\nscript function (or Apps Script itself) throws an exception, the response\nbody's `error` field contains a\n`Status` object. The `Status` object's `details` field\ncontains an array with a single one of these `ExecutionError` objects.", - "type": "object", - "properties": { - "errorMessage": { - "description": "The error message thrown by Apps Script, usually localized into the user's\nlanguage.", - "type": "string" }, - "scriptStackTraceElements": { - "description": "An array of objects that provide a stack trace through the script to show\nwhere the execution failed, with the deepest call first.", - "type": "array", - "items": { - "$ref": "ScriptStackTraceElement" - } - }, - "errorType": { - "description": "The error type, for example `TypeError` or `ReferenceError`. If the error\ntype is unavailable, this field is not included.", - "type": "string" - } - }, - "id": "ExecutionError" - }, - "Status": { - "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, the response body's `error` field will contain this `Status` object.", - "type": "object", - "properties": { "message": { "description": "A developer-facing error message, which is in English. Any user-facing error message is localized and sent in the [`google.rpc.Status.details`](google.rpc.Status.details) field, or localized by the client.", "type": "string" @@ -193,30 +207,19 @@ "type": "object" }, "description": "An array that contains a single `ExecutionError` object that provides information about the nature of the error." - }, - "code": { - "description": "The status code. For this API, this value will always be 3, corresponding to an INVALID_ARGUMENT error.", - "format": "int32", - "type": "integer" } }, - "id": "Status" + "id": "Status", + "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, the response body's `error` field will contain this `Status` object.", + "type": "object" }, "ExecutionRequest": { - "id": "ExecutionRequest", "description": "A request to run the function in a script. The script is identified by the\nspecified `script_id`. Executing a function on a script returns results\nbased on the implementation of the script.", "type": "object", "properties": { - "parameters": { - "description": "The parameters to be passed to the function being executed. The object type\nfor each parameter should match the expected type in Apps Script.\nParameters cannot be Apps Script-specific object types (such as a\n`Document` or a `Calendar`); they can only be primitive types such as\n`string`, `number`, `array`, `object`, or `boolean`. Optional.", - "type": "array", - "items": { - "type": "any" - } - }, "sessionState": { - "description": "For Android add-ons only. An ID that represents the user's current session\nin the Android app for Google Docs or Sheets, included as extra data in the\n[`Intent`](https://developer.android.com/guide/components/intents-filters.html)\nthat launches the add-on. When an Android add-on is run with a session\nstate, it gains the privileges of a\n[bound](https://developers.google.com/apps-script/guides/bound) script —\nthat is, it can access information like the user's current cursor position\n(in Docs) or selected cell (in Sheets). To retrieve the state, call\n`Intent.getStringExtra(\"com.google.android.apps.docs.addons.SessionState\")`.\nOptional.", - "type": "string" + "type": "string", + "description": "For Android add-ons only. An ID that represents the user's current session\nin the Android app for Google Docs or Sheets, included as extra data in the\n[`Intent`](https://developer.android.com/guide/components/intents-filters.html)\nthat launches the add-on. When an Android add-on is run with a session\nstate, it gains the privileges of a\n[bound](https://developers.google.com/apps-script/guides/bound) script —\nthat is, it can access information like the user's current cursor position\n(in Docs) or selected cell (in Sheets). To retrieve the state, call\n`Intent.getStringExtra(\"com.google.android.apps.docs.addons.SessionState\")`.\nOptional." }, "function": { "description": "The name of the function to execute in the given script. The name does not\ninclude parentheses or parameters.", @@ -225,31 +228,16 @@ "devMode": { "description": "If `true` and the user is an owner of the script, the script runs at the\nmost recently saved version rather than the version deployed for use with\nthe Execution API. Optional; default is `false`.", "type": "boolean" - } - } - }, - "JoinAsyncRequest": { - "description": "A request to retrieve the results from a collection of requests,\nspecified by the operation resource names.", - "type": "object", - "properties": { - "scriptId": { - "type": "string", - "description": "The script id which specifies the script which all processes in the names\nfield must be from." }, - "names": { - "description": "List of operation resource names that we want to join,\nas returned from a call to RunAsync.", + "parameters": { + "description": "The parameters to be passed to the function being executed. The object type\nfor each parameter should match the expected type in Apps Script.\nParameters cannot be Apps Script-specific object types (such as a\n`Document` or a `Calendar`); they can only be primitive types such as\n`string`, `number`, `array`, `object`, or `boolean`. Optional.", "type": "array", "items": { - "type": "string" + "type": "any" } - }, - "timeout": { - "description": "Timeout for information retrieval in milliseconds.", - "format": "google-duration", - "type": "string" } }, - "id": "JoinAsyncRequest" + "id": "ExecutionRequest" }, "ExecutionResponse": { "description": "An object that provides the return value of a function executed through the\nApps Script Execution API. If a\n`run` call succeeds and the\nscript function returns successfully, the response body's\n`response` field contains this\n`ExecutionResponse` object.", @@ -266,6 +254,10 @@ "description": "The response will not arrive until the function finishes executing. The maximum runtime is listed in the guide to [limitations in Apps Script](https://developers.google.com/apps-script/guides/services/quotas#current_limitations).\n\u003cp\u003eIf the script function returns successfully, the `response` field will contain an `ExecutionResponse` object with the function's return value in the object's `result` field.\u003c/p\u003e\n\u003cp\u003eIf the script function (or Apps Script itself) throws an exception, the `error` field will contain a `Status` object. The `Status` object's `details` field will contain an array with a single `ExecutionError` object that provides information about the nature of the error.\u003c/p\u003e\n\u003cp\u003eIf the `run` call itself fails (for example, because of a malformed request or an authorization error), the method will return an HTTP response code in the 4XX range with a different format for the response body. Client libraries will automatically convert a 4XX response into an exception class.\u003c/p\u003e", "type": "object", "properties": { + "done": { + "description": "This field is only used with asynchronous executions and indicates whether or not the script execution has completed. A completed execution has a populated response field containing the `ExecutionResponse` from function that was executed.", + "type": "boolean" + }, "response": { "description": "If the script function returns successfully, this field will contain an `ExecutionResponse` object with the function's return value as the object's `result` field.", "type": "object", @@ -274,96 +266,63 @@ "type": "any" } }, - "name": { - "description": "This field is not used.", - "type": "string" - }, "error": { "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, this field will contain a `Status` object. The `Status` object's `details` field will contain an array with a single `ExecutionError` object that provides information about the nature of the error.", "$ref": "Status" }, "metadata": { - "type": "object", "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." }, - "description": "This field is not used." - }, - "done": { "description": "This field is not used.", - "type": "boolean" + "type": "object" } }, "id": "Operation" }, - "JoinAsyncResponse": { + "ScriptStackTraceElement": { + "id": "ScriptStackTraceElement", + "description": "A stack trace through the script that shows where the execution failed.", "type": "object", "properties": { - "results": { - "additionalProperties": { - "$ref": "Operation" - }, - "description": "The return values for each script function, in a map of operation resource\nnames to the Operation containing the result of the process. The response\nwill contain either an error or the result of the script function.", - "type": "object" - } - }, - "id": "JoinAsyncResponse", - "description": "An object that provides the return value for the JoinAsync method." - } - }, - "protocol": "rest", - "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" - }, - "version": "v1", - "baseUrl": "https://script.googleapis.com/", - "auth": { - "oauth2": { - "scopes": { - "https://www.google.com/calendar/feeds": { - "description": "Manage your calendars" + "lineNumber": { + "description": "The line number where the script failed.", + "format": "int32", + "type": "integer" }, - "https://www.googleapis.com/auth/groups": { - "description": "View and manage your Google Groups" - }, - "https://www.googleapis.com/auth/forms.currentonly": { - "description": "View and manage forms that this application has been installed in" - }, - "https://www.googleapis.com/auth/drive": { - "description": "View and manage the files in your Google Drive" - }, - "https://www.googleapis.com/auth/spreadsheets": { - "description": "View and manage your spreadsheets in Google Drive" - }, - "https://www.googleapis.com/auth/admin.directory.user": { - "description": "View and manage the provisioning of users on your domain" - }, - "https://mail.google.com/": { - "description": "Read, send, delete, and manage your email" - }, - "https://www.googleapis.com/auth/admin.directory.group": { - "description": "View and manage the provisioning of groups on your domain" - }, - "https://www.googleapis.com/auth/forms": { - "description": "View and manage your forms in Google Drive" - }, - "https://www.google.com/m8/feeds": { - "description": "Manage your contacts" - }, - "https://www.googleapis.com/auth/userinfo.email": { - "description": "View your email address" + "function": { + "type": "string", + "description": "The name of the function that failed." } } + }, + "ExecutionError": { + "description": "An object that provides information about the nature of an error in the Apps\nScript Execution API. If an\n`run` call succeeds but the\nscript function (or Apps Script itself) throws an exception, the response\nbody's `error` field contains a\n`Status` object. The `Status` object's `details` field\ncontains an array with a single one of these `ExecutionError` objects.", + "type": "object", + "properties": { + "errorType": { + "description": "The error type, for example `TypeError` or `ReferenceError`. If the error\ntype is unavailable, this field is not included.", + "type": "string" + }, + "errorMessage": { + "description": "The error message thrown by Apps Script, usually localized into the user's\nlanguage.", + "type": "string" + }, + "scriptStackTraceElements": { + "description": "An array of objects that provide a stack trace through the script to show\nwhere the execution failed, with the deepest call first.", + "type": "array", + "items": { + "$ref": "ScriptStackTraceElement" + } + } + }, + "id": "ExecutionError" } }, - "kind": "discovery#restDescription", - "description": "Executes Google Apps Script projects.", - "servicePath": "", - "rootUrl": "https://script.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "script", - "batchPath": "batch" + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest" } diff --git a/etc/api/searchconsole/v1/crates/1.0.6-api+20170926 b/etc/api/searchconsole/v1/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/searchconsole/v1/crates/1.0.6-cli+20170926 b/etc/api/searchconsole/v1/crates/1.0.6-cli+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/searchconsole/v1/searchconsole-api.json b/etc/api/searchconsole/v1/searchconsole-api.json index dda04857a6..42d446159f 100644 --- a/etc/api/searchconsole/v1/searchconsole-api.json +++ b/etc/api/searchconsole/v1/searchconsole-api.json @@ -1,41 +1,26 @@ { - "version": "v1", - "baseUrl": "https://searchconsole.googleapis.com/", - "canonicalName": "Search Console", - "servicePath": "", - "description": "Provides tools for running validation tests against single URLs", - "kind": "discovery#restDescription", - "rootUrl": "https://searchconsole.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "searchconsole", - "batchPath": "batch", - "documentationLink": "https://developers.google.com/webmaster-tools/search-console-api/", - "id": "searchconsole:v1", - "revision": "20170520", - "title": "Google Search Console URL Testing Tools API", "discoveryVersion": "v1", "ownerName": "Google", - "version_module": "True", + "version_module": true, "resources": { "urlTestingTools": { "resources": { "mobileFriendlyTest": { "methods": { "run": { - "httpMethod": "POST", - "parameterOrder": [], + "request": { + "$ref": "RunMobileFriendlyTestRequest" + }, + "description": "Runs Mobile-Friendly Test for a given URL.", "response": { "$ref": "RunMobileFriendlyTestResponse" }, + "parameterOrder": [], + "httpMethod": "POST", "parameters": {}, "flatPath": "v1/urlTestingTools/mobileFriendlyTest:run", "path": "v1/urlTestingTools/mobileFriendlyTest:run", - "id": "searchconsole.urlTestingTools.mobileFriendlyTest.run", - "description": "Runs Mobile-Friendly Test for a given URL.", - "request": { - "$ref": "RunMobileFriendlyTestRequest" - } + "id": "searchconsole.urlTestingTools.mobileFriendlyTest.run" } } } @@ -43,6 +28,16 @@ } }, "parameters": { + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, "$.xgafv": { "enumDescriptions": [ "v1 error format", @@ -57,13 +52,11 @@ "type": "string" }, "callback": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "alt": { - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -75,58 +68,50 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" + "location": "query", + "description": "Data format for response.", + "default": "json" }, "access_token": { "location": "query", "description": "OAuth access token.", "type": "string" }, + "key": { + "location": "query", + "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.", + "type": "string" + }, "quotaUser": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "pp": { - "location": "query", "description": "Pretty-print response.", + "type": "boolean", "default": "true", - "type": "boolean" + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" }, "bearer_token": { "location": "query", "description": "OAuth bearer token.", "type": "string" }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, "upload_protocol": { "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string" }, "prettyPrint": { - "location": "query", "description": "Returns response with indentations and line breaks.", + "type": "boolean", "default": "true", - "type": "boolean" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", "location": "query" } }, @@ -162,17 +147,17 @@ }, "RunMobileFriendlyTestResponse": { "properties": { - "resourceIssues": { - "description": "Information about embedded resources issues.", - "items": { - "$ref": "ResourceIssue" - }, - "type": "array" - }, "testStatus": { "$ref": "TestStatus", "description": "Final state of the test, can be either complete or an error." }, + "resourceIssues": { + "description": "Information about embedded resources issues.", + "type": "array", + "items": { + "$ref": "ResourceIssue" + } + }, "mobileFriendliness": { "enum": [ "MOBILE_FRIENDLY_TEST_RESULT_UNSPECIFIED", @@ -189,10 +174,10 @@ }, "mobileFriendlyIssues": { "description": "List of mobile-usability issues.", + "type": "array", "items": { "$ref": "MobileFriendlyIssue" - }, - "type": "array" + } }, "screenshot": { "description": "Screenshot of the requested URL.", @@ -208,8 +193,8 @@ "type": "object", "properties": { "blockedResource": { - "$ref": "BlockedResource", - "description": "Describes a blocked resource issue." + "description": "Describes a blocked resource issue.", + "$ref": "BlockedResource" } }, "id": "ResourceIssue" @@ -230,6 +215,12 @@ "type": "object", "properties": { "status": { + "enumDescriptions": [ + "Internal error when running this test. Please try running the test again.", + "Inspection has completed without errors.", + "Inspection terminated in an error state. This indicates a problem in\nGoogle's infrastructure, not a user error. Please try again later.", + "Google can not access the URL because of a user error such as a robots.txt\nblockage, a 403 or 500 code etc. Please make sure that the URL provided is\naccessible by Googlebot and is not password protected." + ], "enum": [ "TEST_STATUS_UNSPECIFIED", "COMPLETE", @@ -237,13 +228,7 @@ "PAGE_UNREACHABLE" ], "description": "Status of the test.", - "type": "string", - "enumDescriptions": [ - "Internal error when running this test. Please try running the test again.", - "Inspection has completed without errors.", - "Inspection terminated in an error state. This indicates a problem in\nGoogle's infrastructure, not a user error. Please try again later.", - "Google can not access the URL because of a user error such as a robots.txt\nblockage, a 403 or 500 code etc. Please make sure that the URL provided is\naccessible by Googlebot and is not password protected." - ] + "type": "string" }, "details": { "description": "Error details if applicable.", @@ -256,21 +241,19 @@ "description": "Describe image data.", "type": "object", "properties": { - "mimeType": { - "description": "The mime-type of the image data.", + "data": { + "description": "Image data in format determined by the mime type. Currently, the format\nwill always be \"image/png\", but this might change in the future.", + "format": "byte", "type": "string" }, - "data": { - "format": "byte", - "description": "Image data in format determined by the mime type. Currently, the format\nwill always be \"image/png\", but this might change in the future.", + "mimeType": { + "description": "The mime-type of the image data.", "type": "string" } }, "id": "Image" }, "RunMobileFriendlyTestRequest": { - "description": "Mobile-friendly test request.", - "type": "object", "properties": { "url": { "description": "URL for inspection.", @@ -281,12 +264,29 @@ "type": "boolean" } }, - "id": "RunMobileFriendlyTestRequest" + "id": "RunMobileFriendlyTestRequest", + "description": "Mobile-friendly test request.", + "type": "object" } }, + "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, - "protocol": "rest" + "version": "v1", + "baseUrl": "https://searchconsole.googleapis.com/", + "canonicalName": "Search Console", + "kind": "discovery#restDescription", + "description": "Provides tools for running validation tests against single URLs", + "servicePath": "", + "rootUrl": "https://searchconsole.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "searchconsole", + "batchPath": "batch", + "id": "searchconsole:v1", + "documentationLink": "https://developers.google.com/webmaster-tools/search-console-api/", + "revision": "20170926", + "title": "Google Search Console URL Testing Tools API" } diff --git a/etc/api/servicecontrol/v1/servicecontrol-api.json b/etc/api/servicecontrol/v1/servicecontrol-api.json index e57f10f49e..8e0eb2fd82 100644 --- a/etc/api/servicecontrol/v1/servicecontrol-api.json +++ b/etc/api/servicecontrol/v1/servicecontrol-api.json @@ -1,957 +1,286 @@ { - "revision": "20170515", - "documentationLink": "https://cloud.google.com/service-control/", - "id": "servicecontrol:v1", - "discoveryVersion": "v1", - "version_module": "True", - "schemas": { - "CheckRequest": { - "description": "Request message for the Check method.", - "type": "object", - "properties": { - "operation": { - "$ref": "Operation", - "description": "The operation to be checked." - }, - "requestProjectSettings": { - "description": "Requests the project settings to be returned as part of the check response.", - "type": "boolean" - }, - "serviceConfigId": { - "description": "Specifies which version of service configuration should be used to process\nthe request.\n\nIf unspecified or no matching version can be found, the\nlatest one will be used.", - "type": "string" - }, - "skipActivationCheck": { - "description": "Indicates if service activation check should be skipped for this request.\nDefault behavior is to perform the check and apply relevant quota.", - "type": "boolean" - } - }, - "id": "CheckRequest" - }, - "QuotaOperation": { - "description": "Represents information regarding a quota operation.", - "type": "object", - "properties": { - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" + "ownerDomain": "google.com", + "name": "servicecontrol", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Service Control API", + "ownerName": "Google", + "resources": { + "services": { + "methods": { + "endReconciliation": { + "request": { + "$ref": "EndReconciliationRequest" }, - "description": "Labels describing the operation." - }, - "consumerId": { - "description": "Identity of the consumer for whom this quota operation is being performed.\n\nThis can be in one of the following formats:\n project:\u003cproject_id\u003e,\n project_number:\u003cproject_number\u003e,\n api_key:\u003capi_key\u003e.", - "type": "string" - }, - "operationId": { - "description": "Identity of the operation. This must be unique within the scope of the\nservice that generated the operation. If the service calls AllocateQuota\nand ReleaseQuota on the same operation, the two calls should carry the\nsame ID.\n\nUUID version 4 is recommended, though not required. In scenarios where an\noperation is computed from existing information and an idempotent id is\ndesirable for deduplication purpose, UUID version 5 is recommended. See\nRFC 4122 for details.", - "type": "string" - }, - "methodName": { - "description": "Fully qualified name of the API method for which this quota operation is\nrequested. This name is used for matching quota rules or metric rules and\nbilling status rules defined in service configuration. This field is not\nrequired if the quota operation is performed on non-API resources.\n\nExample of an RPC method name:\n google.example.library.v1.LibraryService.CreateShelf", - "type": "string" - }, - "quotaMode": { - "enumDescriptions": [ - "", - "For AllocateQuota request, allocates quota for the amount specified in\nthe service configuration or specified using the quota metrics. If the\namount is higher than the available quota, allocation error will be\nreturned and no quota will be allocated.\nFor ReleaseQuota request, this mode is supported only for precise quota\nlimits. In this case, this operation releases quota for the amount\nspecified in the service configuration or specified using the quota\nmetrics. If the release can make used quota negative, release error\nwill be returned and no quota will be released.", - "For AllocateQuota request, this mode is supported only for imprecise\nquota limits. In this case, the operation allocates quota for the amount\nspecified in the service configuration or specified using the quota\nmetrics. If the amount is higher than the available quota, request does\nnot fail but all available quota will be allocated.\nFor ReleaseQuota request, this mode is supported for both precise quota\nlimits and imprecise quota limits. In this case, this operation releases\nquota for the amount specified in the service configuration or specified\nusing the quota metrics. If the release can make used quota\nnegative, request does not fail but only the used quota will be\nreleased. After the ReleaseQuota request completes, the used quota\nwill be 0, and never goes to negative.", - "For AllocateQuota request, only checks if there is enough quota\navailable and does not change the available quota. No lock is placed on\nthe available quota either. Not supported for ReleaseQuota request." + "description": "Signals the quota controller that service ends the ongoing usage\nreconciliation.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", + "response": { + "$ref": "EndReconciliationResponse" + }, + "parameterOrder": [ + "serviceName" ], - "enum": [ - "UNSPECIFIED", - "NORMAL", - "BEST_EFFORT", - "CHECK_ONLY" + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" ], - "description": "Quota mode for this operation.", - "type": "string" + "parameters": { + "serviceName": { + "type": "string", + "required": true, + "location": "path", + "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name." + } + }, + "flatPath": "v1/services/{serviceName}:endReconciliation", + "id": "servicecontrol.services.endReconciliation", + "path": "v1/services/{serviceName}:endReconciliation" }, - "quotaMetrics": { - "description": "Represents information about this operation. Each MetricValueSet\ncorresponds to a metric defined in the service configuration.\nThe data type used in the MetricValueSet must agree with\nthe data type specified in the metric definition.\n\nWithin a single operation, it is not allowed to have more than one\nMetricValue instances that have the same metric names and identical\nlabel value combinations. If a request has such duplicated MetricValue\ninstances, the entire request is rejected with\nan invalid argument error.", - "type": "array", - "items": { - "$ref": "MetricValueSet" - } - } - }, - "id": "QuotaOperation" - }, - "EndReconciliationRequest": { - "type": "object", - "properties": { - "serviceConfigId": { - "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used.", - "type": "string" - }, - "reconciliationOperation": { - "description": "Operation that describes the quota reconciliation.", - "$ref": "QuotaOperation" - } - }, - "id": "EndReconciliationRequest" - }, - "ReportInfo": { - "properties": { - "quotaInfo": { - "description": "Quota usage info when processing the `Operation`.", - "$ref": "QuotaInfo" - }, - "operationId": { - "description": "The Operation.operation_id value from the request.", - "type": "string" - } - }, - "id": "ReportInfo", - "type": "object" - }, - "ReportResponse": { - "description": "Response message for the Report method.", - "type": "object", - "properties": { - "serviceConfigId": { - "description": "The actual config id used to process the request.", - "type": "string" - }, - "reportErrors": { - "description": "Partial failures, one for each `Operation` in the request that failed\nprocessing. There are three possible combinations of the RPC status:\n\n1. The combination of a successful RPC status and an empty `report_errors`\n list indicates a complete success where all `Operations` in the\n request are processed successfully.\n2. The combination of a successful RPC status and a non-empty\n `report_errors` list indicates a partial success where some\n `Operations` in the request succeeded. Each\n `Operation` that failed processing has a corresponding item\n in this list.\n3. A failed RPC status indicates a general non-deterministic failure.\n When this happens, it's impossible to know which of the\n 'Operations' in the request succeeded or failed.", - "type": "array", - "items": { - "$ref": "ReportError" - } - }, - "reportInfos": { - "description": "Quota usage for each quota release `Operation` request.\n\nFully or partially failed quota release request may or may not be present\nin `report_quota_info`. For example, a failed quota release request will\nhave the current quota usage info when precise quota library returns the\ninfo. A deadline exceeded quota request will not have quota usage info.\n\nIf there is no quota release request, report_quota_info will be empty.\n", - "type": "array", - "items": { - "$ref": "ReportInfo" - } - } - }, - "id": "ReportResponse" - }, - "Operation": { - "description": "Represents information regarding an operation.", - "type": "object", - "properties": { - "startTime": { - "description": "Required. Start time of the operation.", - "format": "google-datetime", - "type": "string" - }, - "importance": { - "enum": [ - "LOW", - "HIGH", - "DEBUG" + "report": { + "request": { + "$ref": "ReportRequest" + }, + "description": "Reports operation results to Google Service Control, such as logs and\nmetrics. It should be called after an operation is completed.\n\nIf feasible, the client should aggregate reporting data for up to 5\nseconds to reduce API traffic. Limiting aggregation to 5 seconds is to\nreduce data loss during client crashes. Clients should carefully choose\nthe aggregation time window to avoid data loss risk more than 0.01%\nfor business and compliance reasons.\n\nNOTE: the ReportRequest has the size limit of 1MB.\n\nThis method requires the `servicemanagement.services.report` permission\non the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", + "response": { + "$ref": "ReportResponse" + }, + "parameterOrder": [ + "serviceName" ], - "description": "DO NOT USE. This is an experimental field.", - "type": "string", - "enumDescriptions": [ - "The API implementation may cache and aggregate the data.\nThe data may be lost when rare and unexpected system failures occur.", - "The API implementation doesn't cache and aggregate the data.\nIf the method returns successfully, it's guaranteed that the data has\nbeen persisted in durable storage.", - "In addition to the behavior described in HIGH, DEBUG enables\nadditional validation logic that is only useful during the onboarding\nprocess. This is only available to Google internal services and\nthe service must be whitelisted by chemist-dev@google.com in order\nto use this level." - ] + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ], + "parameters": { + "serviceName": { + "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/services/{serviceName}:report", + "id": "servicecontrol.services.report", + "path": "v1/services/{serviceName}:report" }, - "resourceContainer": { - "description": "The resource name of the parent of a resource in the resource hierarchy.\n\nThis can be in one of the following formats:\n - “projects/\u003cproject-id or project-number\u003e”\n - “folders/\u003cfolder-id\u003e”\n - “organizations/\u003corganization-id\u003e”", - "type": "string" + "allocateQuota": { + "description": "Attempts to allocate quota for the specified consumer. It should be called\nbefore the operation is executed.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Cloud IAM](https://cloud.google.com/iam).\n\n**NOTE:** The client **must** fail-open on server errors `INTERNAL`,\n`UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system\nreliability, the server may inject these errors to prohibit any hard\ndependency on the quota functionality.", + "request": { + "$ref": "AllocateQuotaRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "AllocateQuotaResponse" + }, + "parameters": { + "serviceName": { + "location": "path", + "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ], + "flatPath": "v1/services/{serviceName}:allocateQuota", + "path": "v1/services/{serviceName}:allocateQuota", + "id": "servicecontrol.services.allocateQuota" }, - "labels": { - "description": "Labels describing the operation. Only the following labels are allowed:\n\n- Labels describing monitored resources as defined in\n the service configuration.\n- Default labels of metric values. When specified, labels defined in the\n metric value override these default.\n- The following labels defined by Google Cloud Platform:\n - `cloud.googleapis.com/location` describing the location where the\n operation happened,\n - `servicecontrol.googleapis.com/user_agent` describing the user agent\n of the API request,\n - `servicecontrol.googleapis.com/service_agent` describing the service\n used to handle the API request (e.g. ESP),\n - `servicecontrol.googleapis.com/platform` describing the platform\n where the API is served (e.g. GAE, GCE, GKE).", - "type": "object", - "additionalProperties": { - "type": "string" - } + "startReconciliation": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ], + "parameters": { + "serviceName": { + "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/services/{serviceName}:startReconciliation", + "id": "servicecontrol.services.startReconciliation", + "path": "v1/services/{serviceName}:startReconciliation", + "request": { + "$ref": "StartReconciliationRequest" + }, + "description": "Unlike rate quota, allocation quota does not get refilled periodically.\nSo, it is possible that the quota usage as seen by the service differs from\nwhat the One Platform considers the usage is. This is expected to happen\nonly rarely, but over time this can accumulate. Services can invoke\nStartReconciliation and EndReconciliation to correct this usage drift, as\ndescribed below:\n1. Service sends StartReconciliation with a timestamp in future for each\n metric that needs to be reconciled. The timestamp being in future allows\n to account for in-flight AllocateQuota and ReleaseQuota requests for the\n same metric.\n2. One Platform records this timestamp and starts tracking subsequent\n AllocateQuota and ReleaseQuota requests until EndReconciliation is\n called.\n3. At or after the time specified in the StartReconciliation, service\n sends EndReconciliation with the usage that needs to be reconciled to.\n4. One Platform adjusts its own record of usage for that metric to the\n value specified in EndReconciliation by taking in to account any\n allocation or release between StartReconciliation and EndReconciliation.\n\nSignals the quota controller that the service wants to perform a usage\nreconciliation as specified in the request.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", + "response": { + "$ref": "StartReconciliationResponse" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "POST" }, - "logEntries": { - "description": "Represents information to be logged.", - "type": "array", - "items": { - "$ref": "LogEntry" - } + "check": { + "description": "Checks an operation with Google Service Control to decide whether\nthe given operation should proceed. It should be called before the\noperation is executed.\n\nIf feasible, the client should cache the check results and reuse them for\n60 seconds. In case of server errors, the client can rely on the cached\nresults for longer time.\n\nNOTE: the CheckRequest has the size limit of 64KB.\n\nThis method requires the `servicemanagement.services.check` permission\non the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", + "request": { + "$ref": "CheckRequest" + }, + "response": { + "$ref": "CheckResponse" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "POST", + "parameters": { + "serviceName": { + "location": "path", + "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ], + "flatPath": "v1/services/{serviceName}:check", + "id": "servicecontrol.services.check", + "path": "v1/services/{serviceName}:check" }, - "userLabels": { - "description": "User defined labels for the resource that this operation is associated\nwith.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "metricValueSets": { - "description": "Represents information about this operation. Each MetricValueSet\ncorresponds to a metric defined in the service configuration.\nThe data type used in the MetricValueSet must agree with\nthe data type specified in the metric definition.\n\nWithin a single operation, it is not allowed to have more than one\nMetricValue instances that have the same metric names and identical\nlabel value combinations. If a request has such duplicated MetricValue\ninstances, the entire request is rejected with\nan invalid argument error.", - "type": "array", - "items": { - "$ref": "MetricValueSet" - } - }, - "quotaProperties": { - "$ref": "QuotaProperties", - "description": "Represents the properties needed for quota check. Applicable only if this\noperation is for a quota check request." - }, - "consumerId": { - "description": "Identity of the consumer who is using the service.\nThis field should be filled in for the operations initiated by a\nconsumer, but not for service-initiated operations that are\nnot related to a specific consumer.\n\nThis can be in one of the following formats:\n project:\u003cproject_id\u003e,\n project_number:\u003cproject_number\u003e,\n api_key:\u003capi_key\u003e.", - "type": "string" - }, - "operationId": { - "type": "string", - "description": "Identity of the operation. This must be unique within the scope of the\nservice that generated the operation. If the service calls\nCheck() and Report() on the same operation, the two calls should carry\nthe same id.\n\nUUID version 4 is recommended, though not required.\nIn scenarios where an operation is computed from existing information\nand an idempotent id is desirable for deduplication purpose, UUID version 5\nis recommended. See RFC 4122 for details." - }, - "endTime": { - "description": "End time of the operation.\nRequired when the operation is used in ServiceController.Report,\nbut optional when the operation is used in ServiceController.Check.", - "format": "google-datetime", - "type": "string" - }, - "operationName": { - "description": "Fully qualified name of the operation. Reserved for future use.", - "type": "string" - } - }, - "id": "Operation" - }, - "CheckResponse": { - "description": "Response message for the Check method.", - "type": "object", - "properties": { - "operationId": { - "description": "The same operation_id value used in the CheckRequest.\nUsed for logging and diagnostics purposes.", - "type": "string" - }, - "checkErrors": { - "description": "Indicate the decision of the check.\n\nIf no check errors are present, the service should process the operation.\nOtherwise the service should use the list of errors to determine the\nappropriate action.", - "type": "array", - "items": { - "$ref": "CheckError" - } - }, - "checkInfo": { - "description": "Feedback data returned from the server during processing a Check request.", - "$ref": "CheckInfo" - }, - "quotaInfo": { - "$ref": "QuotaInfo", - "description": "Quota information for the check request associated with this response.\n" - }, - "serviceConfigId": { - "type": "string", - "description": "The actual config id used to process the request." - } - }, - "id": "CheckResponse" - }, - "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object", - "properties": { - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" + "releaseQuota": { + "flatPath": "v1/services/{serviceName}:releaseQuota", + "id": "servicecontrol.services.releaseQuota", + "path": "v1/services/{serviceName}:releaseQuota", + "request": { + "$ref": "ReleaseQuotaRequest" + }, + "description": "Releases previously allocated quota done through AllocateQuota method.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Cloud IAM](https://cloud.google.com/iam).\n\n\n**NOTE:** The client **must** fail-open on server errors `INTERNAL`,\n`UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system\nreliability, the server may inject these errors to prohibit any hard\ndependency on the quota functionality.", + "response": { + "$ref": "ReleaseQuotaResponse" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ], + "parameters": { + "serviceName": { + "location": "path", + "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", + "type": "string", + "required": true } } - }, - "code": { - "type": "integer", - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", - "type": "string" - } - }, - "id": "Status" - }, - "ReportRequest": { - "description": "Request message for the Report method.", - "type": "object", - "properties": { - "operations": { - "description": "Operations to be reported.\n\nTypically the service should report one operation per request.\nPutting multiple operations into a single request is allowed, but should\nbe used only when multiple operations are natually available at the time\nof the report.\n\nIf multiple operations are in a single request, the total request size\nshould be no larger than 1MB. See ReportResponse.report_errors for\npartial failure behavior.", - "type": "array", - "items": { - "$ref": "Operation" - } - }, - "serviceConfigId": { - "description": "Specifies which version of service config should be used to process the\nrequest.\n\nIf unspecified or no matching version can be found, the\nlatest one will be used.", - "type": "string" - } - }, - "id": "ReportRequest" - }, - "AuditLog": { - "description": "Common audit log format for Google Cloud Platform API operations.\n\n", - "type": "object", - "properties": { - "resourceName": { - "description": "The resource or collection that is the target of the operation.\nThe name is a scheme-less URI, not including the API service name.\nFor example:\n\n \"shelves/SHELF_ID/books\"\n \"shelves/SHELF_ID/books/BOOK_ID\"", - "type": "string" - }, - "authorizationInfo": { - "description": "Authorization information. If there are multiple\nresources or permissions involved, then there is\none AuthorizationInfo element for each {resource, permission} tuple.", - "type": "array", - "items": { - "$ref": "AuthorizationInfo" - } - }, - "request": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The operation request. This may not include all request parameters,\nsuch as those that are too large, privacy-sensitive, or duplicated\nelsewhere in the log record.\nIt should never include user-generated data, such as file contents.\nWhen the JSON object represented here has a proto equivalent, the proto\nname will be indicated in the `@type` property.", - "type": "object" - }, - "serviceData": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "Other service-specific data about the request, response, and other\nactivities." - }, - "requestMetadata": { - "description": "Metadata about the operation.", - "$ref": "RequestMetadata" - }, - "numResponseItems": { - "description": "The number of items returned from a List or Query API method,\nif applicable.", - "format": "int64", - "type": "string" - }, - "authenticationInfo": { - "description": "Authentication information.", - "$ref": "AuthenticationInfo" - }, - "status": { - "description": "The status of the overall operation.", - "$ref": "Status" - }, - "serviceName": { - "description": "The name of the API service performing the operation. For example,\n`\"datastore.googleapis.com\"`.", - "type": "string" - }, - "response": { - "description": "The operation response. This may not include all response elements,\nsuch as those that are too large, privacy-sensitive, or duplicated\nelsewhere in the log record.\nIt should never include user-generated data, such as file contents.\nWhen the JSON object represented here has a proto equivalent, the proto\nname will be indicated in the `@type` property.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } - }, - "methodName": { - "description": "The name of the service method or operation.\nFor API calls, this should be the name of the API method.\nFor example,\n\n \"google.datastore.v1.Datastore.RunQuery\"\n \"google.logging.v1.LoggingService.DeleteLog\"", - "type": "string" - } - }, - "id": "AuditLog" - }, - "LogEntry": { - "id": "LogEntry", - "description": "An individual log entry.", - "type": "object", - "properties": { - "structPayload": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The log entry payload, represented as a structure that\nis expressed as a JSON object." - }, - "textPayload": { - "type": "string", - "description": "The log entry payload, represented as a Unicode string (UTF-8)." - }, - "protoPayload": { - "description": "The log entry payload, represented as a protocol buffer that is\nexpressed as a JSON object. You can only pass `protoPayload`\nvalues that belong to a set of approved types.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "timestamp": { - "description": "The time the event described by the log entry occurred. If\nomitted, defaults to operation start time.", - "format": "google-datetime", - "type": "string" - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "A set of user-defined (key, value) data that provides additional\ninformation about the log entry.", - "type": "object" - }, - "severity": { - "enumDescriptions": [ - "(0) The log entry has no assigned severity level.", - "(100) Debug or trace information.", - "(200) Routine information, such as ongoing status or performance.", - "(300) Normal but significant events, such as start up, shut down, or\na configuration change.", - "(400) Warning events might cause problems.", - "(500) Error events are likely to cause problems.", - "(600) Critical events cause more severe problems or outages.", - "(700) A person must take an action immediately.", - "(800) One or more systems are unusable." - ], - "enum": [ - "DEFAULT", - "DEBUG", - "INFO", - "NOTICE", - "WARNING", - "ERROR", - "CRITICAL", - "ALERT", - "EMERGENCY" - ], - "description": "The severity of the log entry. The default value is\n`LogSeverity.DEFAULT`.", - "type": "string" - }, - "name": { - "type": "string", - "description": "Required. The log to which this log entry belongs. Examples: `\"syslog\"`,\n`\"book_log\"`." - }, - "insertId": { - "type": "string", - "description": "A unique ID for the log entry used for deduplication. If omitted,\nthe implementation will generate one based on operation_id." } } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" }, - "MetricValue": { - "properties": { - "startTime": { - "description": "The start of the time period over which this metric value's measurement\napplies. The time period has different semantics for different metric\ntypes (cumulative, delta, and gauge). See the metric definition\ndocumentation in the service configuration for details.", - "format": "google-datetime", - "type": "string" - }, - "moneyValue": { - "description": "A money value.", - "$ref": "Money" - }, - "stringValue": { - "description": "A text string value.", - "type": "string" - }, - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "The labels describing the metric value.\nSee comments on google.api.servicecontrol.v1.Operation.labels for\nthe overriding relationship.", - "type": "object" - }, - "doubleValue": { - "type": "number", - "description": "A double precision floating point value.", - "format": "double" - }, - "int64Value": { - "description": "A signed 64-bit integer value.", - "format": "int64", - "type": "string" - }, - "distributionValue": { - "$ref": "Distribution", - "description": "A distribution value." - }, - "boolValue": { - "description": "A boolean value.", - "type": "boolean" - }, - "endTime": { - "description": "The end of the time period over which this metric value's measurement\napplies.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "MetricValue", - "description": "Represents a single metric value.", - "type": "object" + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" }, - "Money": { - "properties": { - "currencyCode": { - "description": "The 3-letter currency code defined in ISO 4217.", - "type": "string" - }, - "nanos": { - "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", - "format": "int32", - "type": "integer" - }, - "units": { - "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", - "format": "int64", - "type": "string" - } - }, - "id": "Money", - "description": "Represents an amount of money with its currency type.", - "type": "object" + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" }, - "EndReconciliationResponse": { - "type": "object", - "properties": { - "operationId": { - "description": "The same operation_id value used in the EndReconciliationRequest. Used for\nlogging and diagnostics purposes.", - "type": "string" - }, - "reconciliationErrors": { - "description": "Indicates the decision of the reconciliation end.", - "type": "array", - "items": { - "$ref": "QuotaError" - } - }, - "serviceConfigId": { - "description": "ID of the actual config used to process the request.", - "type": "string" - }, - "quotaMetrics": { - "description": "Metric values as tracked by One Platform before the adjustment was made.\nThe following metrics will be included:\n\n1. Per quota metric total usage will be specified using the following gauge\nmetric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n2. Value for each quota limit associated with the metrics will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"\n\n3. Delta value of the usage after the reconciliation for limits associated\nwith the metrics will be specified using the following metric:\n \"serviceruntime.googleapis.com/allocation/reconciliation_delta\"\nThe delta value is defined as:\n new_usage_from_client - existing_value_in_spanner.\nThis metric is not defined in serviceruntime.yaml or in Cloud Monarch.\nThis metric is meant for callers' use only. Since this metric is not\ndefined in the monitoring backend, reporting on this metric will result in\nan error.", - "type": "array", - "items": { - "$ref": "MetricValueSet" - } - } - }, - "id": "EndReconciliationResponse" + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" }, - "ExplicitBuckets": { - "type": "object", - "properties": { - "bounds": { - "type": "array", - "items": { - "format": "double", - "type": "number" - }, - "description": "'bound' is a list of strictly increasing boundaries between\nbuckets. Note that a list of length N-1 defines N buckets because\nof fenceposting. See comments on `bucket_options` for details.\n\nThe i'th finite bucket covers the interval\n [bound[i-1], bound[i])\nwhere i ranges from 1 to bound_size() - 1. Note that there are no\nfinite buckets at all if 'bound' only contains a single element; in\nthat special case the single bound defines the boundary between the\nunderflow and overflow buckets.\n\nbucket number lower bound upper bound\n i == 0 (underflow) -inf bound[i]\n 0 \u003c i \u003c bound_size() bound[i-1] bound[i]\n i == bound_size() (overflow) bound[i-1] +inf" - } - }, - "id": "ExplicitBuckets", - "description": "Describing buckets with arbitrary user-provided width." + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" }, - "Distribution": { - "description": "Distribution represents a frequency distribution of double-valued sample\npoints. It contains the size of the population of sample points plus\nadditional optional information:\n\n - the arithmetic mean of the samples\n - the minimum and maximum of the samples\n - the sum-squared-deviation of the samples, used to compute variance\n - a histogram of the values of the sample points", - "type": "object", - "properties": { - "explicitBuckets": { - "$ref": "ExplicitBuckets", - "description": "Buckets with arbitrary user-provided width." - }, - "maximum": { - "description": "The maximum of the population of values. Ignored if `count` is zero.", - "format": "double", - "type": "number" - }, - "sumOfSquaredDeviation": { - "description": "The sum of squared deviations from the mean:\n Sum[i=1..count]((x_i - mean)^2)\nwhere each x_i is a sample values. If `count` is zero then this field\nmust be zero, otherwise validation of the request fails.", - "format": "double", - "type": "number" - }, - "exponentialBuckets": { - "$ref": "ExponentialBuckets", - "description": "Buckets with exponentially growing width." - }, - "linearBuckets": { - "description": "Buckets with constant width.", - "$ref": "LinearBuckets" - }, - "minimum": { - "description": "The minimum of the population of values. Ignored if `count` is zero.", - "format": "double", - "type": "number" - }, - "count": { - "type": "string", - "description": "The total number of samples in the distribution. Must be \u003e= 0.", - "format": "int64" - }, - "mean": { - "description": "The arithmetic mean of the samples in the distribution. If `count` is\nzero then this field must be zero.", - "format": "double", - "type": "number" - }, - "bucketCounts": { - "description": "The number of samples in each histogram bucket. `bucket_counts` are\noptional. If present, they must sum to the `count` value.\n\nThe buckets are defined below in `bucket_option`. There are N buckets.\n`bucket_counts[0]` is the number of samples in the underflow bucket.\n`bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples\nin each of the finite buckets. And `bucket_counts[N] is the number\nof samples in the overflow bucket. See the comments of `bucket_option`\nbelow for more details.\n\nAny suffix of trailing zeros may be omitted.", - "type": "array", - "items": { - "format": "int64", - "type": "string" - } - } - }, - "id": "Distribution" + "$.xgafv": { + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" }, - "ExponentialBuckets": { - "description": "Describing buckets with exponentially growing width.", - "type": "object", - "properties": { - "scale": { - "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be \u003e 0.", - "format": "double", - "type": "number" - }, - "numFiniteBuckets": { - "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", - "format": "int32", - "type": "integer" - }, - "growthFactor": { - "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be larger than 1.0.", - "format": "double", - "type": "number" - } - }, - "id": "ExponentialBuckets" + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" }, - "AuthorizationInfo": { - "id": "AuthorizationInfo", - "description": "Authorization information for the operation.", - "type": "object", - "properties": { - "resource": { - "description": "The resource being accessed, as a REST-style string. For example:\n\n bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID", - "type": "string" - }, - "granted": { - "type": "boolean", - "description": "Whether or not authorization for `resource` and `permission`\nwas granted." - }, - "permission": { - "description": "The required IAM permission.", - "type": "string" - } - } + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." }, - "StartReconciliationResponse": { - "type": "object", - "properties": { - "quotaMetrics": { - "description": "Metric values as tracked by One Platform before the start of\nreconciliation. The following metrics will be included:\n\n1. Per quota metric total usage will be specified using the following gauge\nmetric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n2. Value for each quota limit associated with the metrics will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"", - "type": "array", - "items": { - "$ref": "MetricValueSet" - } - }, - "operationId": { - "description": "The same operation_id value used in the StartReconciliationRequest. Used\nfor logging and diagnostics purposes.", - "type": "string" - }, - "reconciliationErrors": { - "type": "array", - "items": { - "$ref": "QuotaError" - }, - "description": "Indicates the decision of the reconciliation start." - }, - "serviceConfigId": { - "description": "ID of the actual config used to process the request.", - "type": "string" - } - }, - "id": "StartReconciliationResponse" + "key": { + "location": "query", + "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.", + "type": "string" }, - "QuotaProperties": { - "description": "Represents the properties needed for quota operations.", - "type": "object", - "properties": { - "limitByIds": { - "additionalProperties": { - "type": "string" - }, - "description": "LimitType IDs that should be used for checking quota. Key in this map\nshould be a valid LimitType string, and the value is the ID to be used. For\nexample, an entry \u003cUSER, 123\u003e will cause all user quota limits to use 123\nas the user ID. See google/api/quota.proto for the definition of LimitType.\nCLIENT_PROJECT: Not supported.\nUSER: Value of this entry will be used for enforcing user-level quota\n limits. If none specified, caller IP passed in the\n servicecontrol.googleapis.com/caller_ip label will be used instead.\n If the server cannot resolve a value for this LimitType, an error\n will be thrown. No validation will be performed on this ID.\nDeprecated: use servicecontrol.googleapis.com/user label to send user ID.", - "type": "object" - }, - "quotaMode": { - "enum": [ - "ACQUIRE", - "ACQUIRE_BEST_EFFORT", - "CHECK", - "RELEASE" - ], - "description": "Quota mode for this operation.", - "type": "string", - "enumDescriptions": [ - "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation fails and returns\nerror.", - "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation does not fail and\navailable quota goes down to zero but it returns error.", - "Does not change any available quota. Only checks if there is enough\nquota.\nNo lock is placed on the checked tokens neither.", - "Increases available quota by the operation cost specified for the\noperation." - ] - } - }, - "id": "QuotaProperties" + "quotaUser": { + "location": "query", + "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.", + "type": "string" }, - "LinearBuckets": { - "description": "Describing buckets with constant width.", - "type": "object", - "properties": { - "numFiniteBuckets": { - "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", - "format": "int32", - "type": "integer" - }, - "width": { - "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.\nMust be strictly positive.", - "format": "double", - "type": "number" - }, - "offset": { - "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.", - "format": "double", - "type": "number" - } - }, - "id": "LinearBuckets" + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" }, - "AuthenticationInfo": { - "description": "Authentication information for the operation.", - "type": "object", - "properties": { - "principalEmail": { - "description": "The email address of the authenticated user making the request.", - "type": "string" - }, - "authoritySelector": { - "description": "The authority selector specified by the requestor, if any.\nIt is not guaranteed that the principal was allowed to use this authority.", - "type": "string" - } - }, - "id": "AuthenticationInfo" - }, - "AllocateQuotaResponse": { - "description": "Response message for the AllocateQuota method.", - "type": "object", - "properties": { - "quotaMetrics": { - "description": "Quota metrics to indicate the result of allocation. Depending on the\nrequest, one or more of the following metrics will be included:\n\n1. For rate quota, per quota group or per quota metric incremental usage\nwill be specified using the following delta metric:\n \"serviceruntime.googleapis.com/api/consumer/quota_used_count\"\n\n2. For allocation quota, per quota metric total usage will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n3. For both rate quota and allocation quota, the quota limit reached\ncondition will be specified using the following boolean metric:\n \"serviceruntime.googleapis.com/quota/exceeded\"\n\n4. For allocation quota, value for each quota limit associated with\nthe metrics will be specified using the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"", - "type": "array", - "items": { - "$ref": "MetricValueSet" - } - }, - "operationId": { - "description": "The same operation_id value used in the AllocateQuotaRequest. Used for\nlogging and diagnostics purposes.", - "type": "string" - }, - "serviceConfigId": { - "type": "string", - "description": "ID of the actual config used to process the request." - }, - "allocateErrors": { - "description": "Indicates the decision of the allocate.", - "type": "array", - "items": { - "$ref": "QuotaError" - } - } - }, - "id": "AllocateQuotaResponse" - }, - "ReleaseQuotaRequest": { - "properties": { - "serviceConfigId": { - "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used.", - "type": "string" - }, - "releaseOperation": { - "$ref": "QuotaOperation", - "description": "Operation that describes the quota release." - } - }, - "id": "ReleaseQuotaRequest", - "description": "Request message for the ReleaseQuota method.", - "type": "object" - }, - "QuotaError": { - "type": "object", - "properties": { - "subject": { - "description": "Subject to whom this error applies. See the specific enum for more details\non this field. For example, \"clientip:\u003cip address of client\u003e\" or\n\"project:\u003cGoogle developer project id\u003e\".", - "type": "string" - }, - "description": { - "description": "Free-form text that provides details on the cause of the error.", - "type": "string" - }, - "code": { - "enum": [ - "UNSPECIFIED", - "RESOURCE_EXHAUSTED", - "PROJECT_SUSPENDED", - "SERVICE_NOT_ENABLED", - "BILLING_NOT_ACTIVE", - "PROJECT_DELETED", - "PROJECT_INVALID", - "IP_ADDRESS_BLOCKED", - "REFERER_BLOCKED", - "CLIENT_APP_BLOCKED", - "API_KEY_INVALID", - "API_KEY_EXPIRED", - "SPATULA_HEADER_INVALID", - "LOAS_ROLE_INVALID", - "NO_LOAS_PROJECT", - "PROJECT_STATUS_UNAVAILABLE", - "SERVICE_STATUS_UNAVAILABLE", - "BILLING_STATUS_UNAVAILABLE", - "QUOTA_SYSTEM_UNAVAILABLE" - ], - "description": "Error code.", - "type": "string", - "enumDescriptions": [ - "This is never used.", - "Quota allocation failed.\nSame as google.rpc.Code.RESOURCE_EXHAUSTED.", - "Consumer project has been suspended.", - "Consumer has not enabled the service.", - "Consumer cannot access the service because billing is disabled.", - "Consumer's project has been marked as deleted (soft deletion).", - "Consumer's project number or ID does not represent a valid project.", - "IP address of the consumer is invalid for the specific consumer\nproject.", - "Referer address of the consumer request is invalid for the specific\nconsumer project.", - "Client application of the consumer request is invalid for the\nspecific consumer project.", - "Specified API key is invalid.", - "Specified API Key has expired.", - "Consumer's spatula header is invalid.", - "The consumer's LOAS role is invalid.", - "The consumer's LOAS role has no associated project.", - "The backend server for looking up project id/number is unavailable.", - "The backend server for checking service status is unavailable.", - "The backend server for checking billing status is unavailable.", - "The backend server for checking quota limits is unavailable." - ] - } - }, - "id": "QuotaError" - }, - "RequestMetadata": { - "description": "Metadata about the request.", - "type": "object", - "properties": { - "callerIp": { - "description": "The IP address of the caller.", - "type": "string" - }, - "callerSuppliedUserAgent": { - "description": "The user agent of the caller.\nThis information is not authenticated and should be treated accordingly.\nFor example:\n\n+ `google-api-python-client/1.4.0`:\n The request was made by the Google API client for Python.\n+ `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`:\n The request was made by the Google Cloud SDK CLI (gcloud).\n+ `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`:\n The request was made from the `my-project` App Engine app.", - "type": "string" - } - }, - "id": "RequestMetadata" - }, - "CheckInfo": { - "type": "object", - "properties": { - "unusedArguments": { - "description": "A list of fields and label keys that are ignored by the server.\nThe client doesn't need to send them for following requests to improve\nperformance and allow better aggregation.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "CheckInfo" - }, - "ReleaseQuotaResponse": { - "description": "Response message for the ReleaseQuota method.", - "type": "object", - "properties": { - "quotaMetrics": { - "description": "Quota metrics to indicate the result of release. Depending on the\nrequest, one or more of the following metrics will be included:\n\n1. For rate quota, per quota group or per quota metric released amount\nwill be specified using the following delta metric:\n \"serviceruntime.googleapis.com/api/consumer/quota_refund_count\"\n\n2. For allocation quota, per quota metric total usage will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n3. For allocation quota, value for each quota limit associated with\nthe metrics will be specified using the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"", - "type": "array", - "items": { - "$ref": "MetricValueSet" - } - }, - "operationId": { - "description": "The same operation_id value used in the ReleaseQuotaRequest. Used for\nlogging and diagnostics purposes.", - "type": "string" - }, - "serviceConfigId": { - "description": "ID of the actual config used to process the request.", - "type": "string" - }, - "releaseErrors": { - "description": "Indicates the decision of the release.", - "type": "array", - "items": { - "$ref": "QuotaError" - } - } - }, - "id": "ReleaseQuotaResponse" - }, - "AllocateQuotaRequest": { - "id": "AllocateQuotaRequest", - "description": "Request message for the AllocateQuota method.", - "type": "object", - "properties": { - "allocationMode": { - "enumDescriptions": [ - "", - "Allocates quota for the amount specified in the service configuration or\nspecified using the quota_metrics. If the amount is higher than the\navailable quota, allocation error will be returned and no quota will be\nallocated.", - "Allocates quota for the amount specified in the service configuration or\nspecified using the quota_metrics. If the amount is higher than the\navailable quota, request does not fail but all available quota will be\nallocated.", - "Only checks if there is enough quota available and does not change the\navailable quota. No lock is placed on the available quota either." - ], - "enum": [ - "UNSPECIFIED", - "NORMAL", - "BEST_EFFORT", - "CHECK_ONLY" - ], - "description": "Allocation mode for this operation.\nDeprecated: use QuotaMode inside the QuotaOperation.", - "type": "string" - }, - "serviceConfigId": { - "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used.", - "type": "string" - }, - "allocateOperation": { - "description": "Operation that describes the quota allocation.", - "$ref": "QuotaOperation" - } - } - }, - "MetricValueSet": { - "description": "Represents a set of metric values in the same metric.\nEach metric value in the set should have a unique combination of start time,\nend time, and label values.", - "type": "object", - "properties": { - "metricName": { - "description": "The metric name defined in the service configuration.", - "type": "string" - }, - "metricValues": { - "description": "The values in this metric.", - "type": "array", - "items": { - "$ref": "MetricValue" - } - } - }, - "id": "MetricValueSet" - }, - "ReportError": { - "id": "ReportError", - "description": "Represents the processing error of one `Operation` in the request.", - "type": "object", - "properties": { - "status": { - "description": "Details of the error when processing the `Operation`.", - "$ref": "Status" - }, - "operationId": { - "description": "The Operation.operation_id value from the request.", - "type": "string" - } - } + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + } + }, + "version": "v1", + "baseUrl": "https://servicecontrol.googleapis.com/", + "servicePath": "", + "description": "Google Service Control provides control plane functionality to managed services, such as logging, monitoring, and status checks.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170918", + "id": "servicecontrol:v1", + "documentationLink": "https://cloud.google.com/service-control/", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { "CheckError": { + "id": "CheckError", "description": "Defines the errors to be returned in\ngoogle.api.servicecontrol.v1.CheckResponse.check_errors.", "type": "object", "properties": { @@ -1031,343 +360,1070 @@ "description": "The error code.", "type": "string" } - }, - "id": "CheckError" + } }, "StartReconciliationRequest": { + "description": "Request message for QuotaController.StartReconciliation.", + "type": "object", + "properties": { + "serviceConfigId": { + "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used.", + "type": "string" + }, + "reconciliationOperation": { + "$ref": "QuotaOperation", + "description": "Operation that describes the quota reconciliation." + } + }, + "id": "StartReconciliationRequest" + }, + "QuotaInfo": { + "description": "Contains the quota information for a quota check response.", + "type": "object", + "properties": { + "quotaConsumed": { + "additionalProperties": { + "format": "int32", + "type": "integer" + }, + "description": "Map of quota group name to the actual number of tokens consumed. If the\nquota check was not successful, then this will not be populated due to no\nquota consumption.\n\nWe are not merging this field with 'quota_metrics' field because of the\ncomplexity of scaling in Chemist client code base. For simplicity, we will\nkeep this field for Castor (that scales quota usage) and 'quota_metrics'\nfor SuperQuota (that doesn't scale quota usage).\n", + "type": "object" + }, + "quotaMetrics": { + "description": "Quota metrics to indicate the usage. Depending on the check request, one or\nmore of the following metrics will be included:\n\n1. For rate quota, per quota group or per quota metric incremental usage\nwill be specified using the following delta metric:\n \"serviceruntime.googleapis.com/api/consumer/quota_used_count\"\n\n2. For allocation quota, per quota metric total usage will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n3. For both rate quota and allocation quota, the quota limit reached\ncondition will be specified using the following boolean metric:\n \"serviceruntime.googleapis.com/quota/exceeded\"", + "items": { + "$ref": "MetricValueSet" + }, + "type": "array" + }, + "limitExceeded": { + "description": "Quota Metrics that have exceeded quota limits.\nFor QuotaGroup-based quota, this is QuotaGroup.name\nFor QuotaLimit-based quota, this is QuotaLimit.name\nSee: google.api.Quota\nDeprecated: Use quota_metrics to get per quota group limit exceeded status.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "QuotaInfo" + }, + "ConsumerInfo": { + "description": "`ConsumerInfo` provides information about the consumer project.", + "type": "object", + "properties": { + "projectNumber": { + "format": "int64", + "description": "The Google cloud project number, e.g. 1234567890. A value of 0 indicates\nno project number is found.", + "type": "string" + } + }, + "id": "ConsumerInfo" + }, + "CheckRequest": { + "description": "Request message for the Check method.", + "type": "object", + "properties": { + "serviceConfigId": { + "description": "Specifies which version of service configuration should be used to process\nthe request.\n\nIf unspecified or no matching version can be found, the\nlatest one will be used.", + "type": "string" + }, + "skipActivationCheck": { + "description": "Indicates if service activation check should be skipped for this request.\nDefault behavior is to perform the check and apply relevant quota.", + "type": "boolean" + }, + "requestProjectSettings": { + "description": "Requests the project settings to be returned as part of the check response.", + "type": "boolean" + }, + "operation": { + "$ref": "Operation", + "description": "The operation to be checked." + } + }, + "id": "CheckRequest" + }, + "QuotaOperation": { + "description": "Represents information regarding a quota operation.", + "type": "object", + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels describing the operation.", + "type": "object" + }, + "consumerId": { + "description": "Identity of the consumer for whom this quota operation is being performed.\n\nThis can be in one of the following formats:\n project:\u003cproject_id\u003e,\n project_number:\u003cproject_number\u003e,\n api_key:\u003capi_key\u003e.", + "type": "string" + }, + "operationId": { + "description": "Identity of the operation. This is expected to be unique within the scope\nof the service that generated the operation, and guarantees idempotency in\ncase of retries.\n\nUUID version 4 is recommended, though not required. In scenarios where an\noperation is computed from existing information and an idempotent id is\ndesirable for deduplication purpose, UUID version 5 is recommended. See\nRFC 4122 for details.", + "type": "string" + }, + "methodName": { + "description": "Fully qualified name of the API method for which this quota operation is\nrequested. This name is used for matching quota rules or metric rules and\nbilling status rules defined in service configuration. This field is not\nrequired if the quota operation is performed on non-API resources.\n\nExample of an RPC method name:\n google.example.library.v1.LibraryService.CreateShelf", + "type": "string" + }, + "quotaMode": { + "description": "Quota mode for this operation.", + "type": "string", + "enumDescriptions": [ + "Guard against implicit default. Must not be used.", + "For AllocateQuota request, allocates quota for the amount specified in\nthe service configuration or specified using the quota metrics. If the\namount is higher than the available quota, allocation error will be\nreturned and no quota will be allocated.\nFor ReleaseQuota request, this mode is supported only for precise quota\nlimits. In this case, this operation releases quota for the amount\nspecified in the service configuration or specified using the quota\nmetrics. If the release can make used quota negative, release error\nwill be returned and no quota will be released.", + "For AllocateQuota request, this mode is supported only for imprecise\nquota limits. In this case, the operation allocates quota for the amount\nspecified in the service configuration or specified using the quota\nmetrics. If the amount is higher than the available quota, request does\nnot fail but all available quota will be allocated.\nFor ReleaseQuota request, this mode is supported for both precise quota\nlimits and imprecise quota limits. In this case, this operation releases\nquota for the amount specified in the service configuration or specified\nusing the quota metrics. If the release can make used quota\nnegative, request does not fail but only the used quota will be\nreleased. After the ReleaseQuota request completes, the used quota\nwill be 0, and never goes to negative.", + "For AllocateQuota request, only checks if there is enough quota\navailable and does not change the available quota. No lock is placed on\nthe available quota either. Not supported for ReleaseQuota request." + ], + "enum": [ + "UNSPECIFIED", + "NORMAL", + "BEST_EFFORT", + "CHECK_ONLY" + ] + }, + "quotaMetrics": { + "description": "Represents information about this operation. Each MetricValueSet\ncorresponds to a metric defined in the service configuration.\nThe data type used in the MetricValueSet must agree with\nthe data type specified in the metric definition.\n\nWithin a single operation, it is not allowed to have more than one\nMetricValue instances that have the same metric names and identical\nlabel value combinations. If a request has such duplicated MetricValue\ninstances, the entire request is rejected with\nan invalid argument error.", + "items": { + "$ref": "MetricValueSet" + }, + "type": "array" + } + }, + "id": "QuotaOperation" + }, + "EndReconciliationRequest": { + "description": "Request message for QuotaController.EndReconciliation.", "type": "object", "properties": { "reconciliationOperation": { - "description": "Operation that describes the quota reconciliation.", - "$ref": "QuotaOperation" + "$ref": "QuotaOperation", + "description": "Operation that describes the quota reconciliation." }, "serviceConfigId": { "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used.", "type": "string" } }, - "id": "StartReconciliationRequest" + "id": "EndReconciliationRequest" }, - "QuotaInfo": { - "id": "QuotaInfo", - "description": "Contains the quota information for a quota check response.", + "ReportInfo": { + "id": "ReportInfo", + "description": "Contains additional info about the report operation.", "type": "object", "properties": { - "limitExceeded": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Quota Metrics that have exceeded quota limits.\nFor QuotaGroup-based quota, this is QuotaGroup.name\nFor QuotaLimit-based quota, this is QuotaLimit.name\nSee: google.api.Quota\nDeprecated: Use quota_metrics to get per quota group limit exceeded status." + "operationId": { + "description": "The Operation.operation_id value from the request.", + "type": "string" }, - "quotaConsumed": { + "quotaInfo": { + "description": "Quota usage info when processing the `Operation`.", + "$ref": "QuotaInfo" + } + } + }, + "ReportResponse": { + "description": "Response message for the Report method.", + "type": "object", + "properties": { + "reportInfos": { + "description": "Quota usage for each quota release `Operation` request.\n\nFully or partially failed quota release request may or may not be present\nin `report_quota_info`. For example, a failed quota release request will\nhave the current quota usage info when precise quota library returns the\ninfo. A deadline exceeded quota request will not have quota usage info.\n\nIf there is no quota release request, report_quota_info will be empty.\n", + "items": { + "$ref": "ReportInfo" + }, + "type": "array" + }, + "serviceConfigId": { + "description": "The actual config id used to process the request.", + "type": "string" + }, + "reportErrors": { + "items": { + "$ref": "ReportError" + }, + "type": "array", + "description": "Partial failures, one for each `Operation` in the request that failed\nprocessing. There are three possible combinations of the RPC status:\n\n1. The combination of a successful RPC status and an empty `report_errors`\n list indicates a complete success where all `Operations` in the\n request are processed successfully.\n2. The combination of a successful RPC status and a non-empty\n `report_errors` list indicates a partial success where some\n `Operations` in the request succeeded. Each\n `Operation` that failed processing has a corresponding item\n in this list.\n3. A failed RPC status indicates a general non-deterministic failure.\n When this happens, it's impossible to know which of the\n 'Operations' in the request succeeded or failed." + } + }, + "id": "ReportResponse" + }, + "Operation": { + "description": "Represents information regarding an operation.", + "type": "object", + "properties": { + "consumerId": { + "description": "Identity of the consumer who is using the service.\nThis field should be filled in for the operations initiated by a\nconsumer, but not for service-initiated operations that are\nnot related to a specific consumer.\n\nThis can be in one of the following formats:\n project:\u003cproject_id\u003e,\n project_number:\u003cproject_number\u003e,\n api_key:\u003capi_key\u003e.", + "type": "string" + }, + "operationId": { + "description": "Identity of the operation. This must be unique within the scope of the\nservice that generated the operation. If the service calls\nCheck() and Report() on the same operation, the two calls should carry\nthe same id.\n\nUUID version 4 is recommended, though not required.\nIn scenarios where an operation is computed from existing information\nand an idempotent id is desirable for deduplication purpose, UUID version 5\nis recommended. See RFC 4122 for details.", + "type": "string" + }, + "operationName": { + "description": "Fully qualified name of the operation. Reserved for future use.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "End time of the operation.\nRequired when the operation is used in ServiceController.Report,\nbut optional when the operation is used in ServiceController.Check.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Required. Start time of the operation.", + "type": "string" + }, + "importance": { + "description": "DO NOT USE. This is an experimental field.", + "type": "string", + "enumDescriptions": [ + "The API implementation may cache and aggregate the data.\nThe data may be lost when rare and unexpected system failures occur.", + "The API implementation doesn't cache and aggregate the data.\nIf the method returns successfully, it's guaranteed that the data has\nbeen persisted in durable storage.", + "In addition to the behavior described in HIGH, DEBUG enables\nadditional validation logic that is only useful during the onboarding\nprocess. This is only available to Google internal services and\nthe service must be whitelisted by chemist-dev@google.com in order\nto use this level." + ], + "enum": [ + "LOW", + "HIGH", + "DEBUG" + ] + }, + "resourceContainer": { + "type": "string", + "description": "The resource name of the parent of a resource in the resource hierarchy.\n\nThis can be in one of the following formats:\n - “projects/\u003cproject-id or project-number\u003e”\n - “folders/\u003cfolder-id\u003e”\n - “organizations/\u003corganization-id\u003e”" + }, + "labels": { "type": "object", "additionalProperties": { - "format": "int32", - "type": "integer" + "type": "string" }, - "description": "Map of quota group name to the actual number of tokens consumed. If the\nquota check was not successful, then this will not be populated due to no\nquota consumption.\nDeprecated: Use quota_metrics to get per quota group usage." + "description": "Labels describing the operation. Only the following labels are allowed:\n\n- Labels describing monitored resources as defined in\n the service configuration.\n- Default labels of metric values. When specified, labels defined in the\n metric value override these default.\n- The following labels defined by Google Cloud Platform:\n - `cloud.googleapis.com/location` describing the location where the\n operation happened,\n - `servicecontrol.googleapis.com/user_agent` describing the user agent\n of the API request,\n - `servicecontrol.googleapis.com/service_agent` describing the service\n used to handle the API request (e.g. ESP),\n - `servicecontrol.googleapis.com/platform` describing the platform\n where the API is served (e.g. GAE, GCE, GKE)." }, - "quotaMetrics": { - "type": "array", + "resources": { + "description": "The resources that are involved in the operation.", + "items": { + "$ref": "ResourceInfo" + }, + "type": "array" + }, + "logEntries": { + "description": "Represents information to be logged.", + "items": { + "$ref": "LogEntry" + }, + "type": "array" + }, + "userLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "User defined labels for the resource that this operation is associated\nwith. Only a combination of 1000 user labels per consumer project are\nallowed.", + "type": "object" + }, + "metricValueSets": { + "description": "Represents information about this operation. Each MetricValueSet\ncorresponds to a metric defined in the service configuration.\nThe data type used in the MetricValueSet must agree with\nthe data type specified in the metric definition.\n\nWithin a single operation, it is not allowed to have more than one\nMetricValue instances that have the same metric names and identical\nlabel value combinations. If a request has such duplicated MetricValue\ninstances, the entire request is rejected with\nan invalid argument error.", "items": { "$ref": "MetricValueSet" }, - "description": "Quota metrics to indicate the usage. Depending on the check request, one or\nmore of the following metrics will be included:\n\n1. For rate quota, per quota group or per quota metric incremental usage\nwill be specified using the following delta metric:\n \"serviceruntime.googleapis.com/api/consumer/quota_used_count\"\n\n2. For allocation quota, per quota metric total usage will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n3. For both rate quota and allocation quota, the quota limit reached\ncondition will be specified using the following boolean metric:\n \"serviceruntime.googleapis.com/quota/exceeded\"" + "type": "array" + }, + "quotaProperties": { + "$ref": "QuotaProperties", + "description": "Represents the properties needed for quota check. Applicable only if this\noperation is for a quota check request." + } + }, + "id": "Operation" + }, + "CheckResponse": { + "description": "Response message for the Check method.", + "type": "object", + "properties": { + "checkInfo": { + "$ref": "CheckInfo", + "description": "Feedback data returned from the server during processing a Check request." + }, + "checkErrors": { + "description": "Indicate the decision of the check.\n\nIf no check errors are present, the service should process the operation.\nOtherwise the service should use the list of errors to determine the\nappropriate action.", + "items": { + "$ref": "CheckError" + }, + "type": "array" + }, + "operationId": { + "description": "The same operation_id value used in the CheckRequest.\nUsed for logging and diagnostics purposes.", + "type": "string" + }, + "serviceConfigId": { + "description": "The actual config id used to process the request.", + "type": "string" + }, + "quotaInfo": { + "$ref": "QuotaInfo", + "description": "Quota information for the check request associated with this response.\n" + } + }, + "id": "CheckResponse" + }, + "AllocateInfo": { + "type": "object", + "properties": { + "unusedArguments": { + "description": "A list of label keys that were unused by the server in processing the\nrequest. Thus, for similar requests repeated in a certain future time\nwindow, the caller can choose to ignore these labels in the requests\nto achieve better client-side cache hits and quota aggregation.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "AllocateInfo" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "ReportRequest": { + "description": "Request message for the Report method.", + "type": "object", + "properties": { + "serviceConfigId": { + "description": "Specifies which version of service config should be used to process the\nrequest.\n\nIf unspecified or no matching version can be found, the\nlatest one will be used.", + "type": "string" + }, + "operations": { + "items": { + "$ref": "Operation" + }, + "type": "array", + "description": "Operations to be reported.\n\nTypically the service should report one operation per request.\nPutting multiple operations into a single request is allowed, but should\nbe used only when multiple operations are natually available at the time\nof the report.\n\nIf multiple operations are in a single request, the total request size\nshould be no larger than 1MB. See ReportResponse.report_errors for\npartial failure behavior." + } + }, + "id": "ReportRequest" + }, + "AuditLog": { + "description": "Common audit log format for Google Cloud Platform API operations.\n\n", + "type": "object", + "properties": { + "resourceName": { + "description": "The resource or collection that is the target of the operation.\nThe name is a scheme-less URI, not including the API service name.\nFor example:\n\n \"shelves/SHELF_ID/books\"\n \"shelves/SHELF_ID/books/BOOK_ID\"", + "type": "string" + }, + "serviceData": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Deprecated, use `metadata` field instead.\nOther service-specific data about the request, response, and other\nactivities.", + "type": "object" + }, + "numResponseItems": { + "format": "int64", + "description": "The number of items returned from a List or Query API method,\nif applicable.", + "type": "string" + }, + "authorizationInfo": { + "description": "Authorization information. If there are multiple\nresources or permissions involved, then there is\none AuthorizationInfo element for each {resource, permission} tuple.", + "items": { + "$ref": "AuthorizationInfo" + }, + "type": "array" + }, + "request": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + }, + "description": "The operation request. This may not include all request parameters,\nsuch as those that are too large, privacy-sensitive, or duplicated\nelsewhere in the log record.\nIt should never include user-generated data, such as file contents.\nWhen the JSON object represented here has a proto equivalent, the proto\nname will be indicated in the `@type` property.", + "type": "object" + }, + "requestMetadata": { + "description": "Metadata about the operation.", + "$ref": "RequestMetadata" + }, + "authenticationInfo": { + "$ref": "AuthenticationInfo", + "description": "Authentication information." + }, + "status": { + "description": "The status of the overall operation.", + "$ref": "Status" + }, + "serviceName": { + "type": "string", + "description": "The name of the API service performing the operation. For example,\n`\"datastore.googleapis.com\"`." + }, + "response": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The operation response. This may not include all response elements,\nsuch as those that are too large, privacy-sensitive, or duplicated\nelsewhere in the log record.\nIt should never include user-generated data, such as file contents.\nWhen the JSON object represented here has a proto equivalent, the proto\nname will be indicated in the `@type` property.", + "type": "object" + }, + "metadata": { + "description": "Other service-specific data about the request, response, and other\ninformation associated with the current audited event.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "type": "array" + }, + "methodName": { + "description": "The name of the service method or operation.\nFor API calls, this should be the name of the API method.\nFor example,\n\n \"google.datastore.v1.Datastore.RunQuery\"\n \"google.logging.v1.LoggingService.DeleteLog\"", + "type": "string" + } + }, + "id": "AuditLog" + }, + "LogEntry": { + "description": "An individual log entry.", + "type": "object", + "properties": { + "protoPayload": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The log entry payload, represented as a protocol buffer that is\nexpressed as a JSON object. The only accepted type currently is\nAuditLog.", + "type": "object" + }, + "timestamp": { + "format": "google-datetime", + "description": "The time the event described by the log entry occurred. If\nomitted, defaults to operation start time.", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "A set of user-defined (key, value) data that provides additional\ninformation about the log entry.", + "type": "object" + }, + "severity": { + "enumDescriptions": [ + "(0) The log entry has no assigned severity level.", + "(100) Debug or trace information.", + "(200) Routine information, such as ongoing status or performance.", + "(300) Normal but significant events, such as start up, shut down, or\na configuration change.", + "(400) Warning events might cause problems.", + "(500) Error events are likely to cause problems.", + "(600) Critical events cause more severe problems or outages.", + "(700) A person must take an action immediately.", + "(800) One or more systems are unusable." + ], + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ], + "description": "The severity of the log entry. The default value is\n`LogSeverity.DEFAULT`.", + "type": "string" + }, + "insertId": { + "description": "A unique ID for the log entry used for deduplication. If omitted,\nthe implementation will generate one based on operation_id.", + "type": "string" + }, + "name": { + "description": "Required. The log to which this log entry belongs. Examples: `\"syslog\"`,\n`\"book_log\"`.", + "type": "string" + }, + "structPayload": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The log entry payload, represented as a structure that\nis expressed as a JSON object.", + "type": "object" + }, + "textPayload": { + "description": "The log entry payload, represented as a Unicode string (UTF-8).", + "type": "string" + } + }, + "id": "LogEntry" + }, + "MetricValue": { + "type": "object", + "properties": { + "doubleValue": { + "type": "number", + "format": "double", + "description": "A double precision floating point value." + }, + "int64Value": { + "format": "int64", + "description": "A signed 64-bit integer value.", + "type": "string" + }, + "distributionValue": { + "$ref": "Distribution", + "description": "A distribution value." + }, + "boolValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "endTime": { + "format": "google-datetime", + "description": "The end of the time period over which this metric value's measurement\napplies.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "The start of the time period over which this metric value's measurement\napplies. The time period has different semantics for different metric\ntypes (cumulative, delta, and gauge). See the metric definition\ndocumentation in the service configuration for details.", + "type": "string" + }, + "moneyValue": { + "$ref": "Money", + "description": "A money value." + }, + "stringValue": { + "description": "A text string value.", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The labels describing the metric value.\nSee comments on google.api.servicecontrol.v1.Operation.labels for\nthe overriding relationship.", + "type": "object" + } + }, + "id": "MetricValue", + "description": "Represents a single metric value." + }, + "Money": { + "description": "Represents an amount of money with its currency type.", + "type": "object", + "properties": { + "currencyCode": { + "description": "The 3-letter currency code defined in ISO 4217.", + "type": "string" + }, + "nanos": { + "format": "int32", + "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "type": "integer" + }, + "units": { + "format": "int64", + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "type": "string" + } + }, + "id": "Money" + }, + "EndReconciliationResponse": { + "description": "Response message for QuotaController.EndReconciliation.", + "type": "object", + "properties": { + "reconciliationErrors": { + "description": "Indicates the decision of the reconciliation end.", + "items": { + "$ref": "QuotaError" + }, + "type": "array" + }, + "operationId": { + "description": "The same operation_id value used in the EndReconciliationRequest. Used for\nlogging and diagnostics purposes.", + "type": "string" + }, + "serviceConfigId": { + "description": "ID of the actual config used to process the request.", + "type": "string" + }, + "quotaMetrics": { + "description": "Metric values as tracked by One Platform before the adjustment was made.\nThe following metrics will be included:\n\n1. Per quota metric total usage will be specified using the following gauge\nmetric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n2. Value for each quota limit associated with the metrics will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"\n\n3. Delta value of the usage after the reconciliation for limits associated\nwith the metrics will be specified using the following metric:\n \"serviceruntime.googleapis.com/allocation/reconciliation_delta\"\nThe delta value is defined as:\n new_usage_from_client - existing_value_in_spanner.\nThis metric is not defined in serviceruntime.yaml or in Cloud Monarch.\nThis metric is meant for callers' use only. Since this metric is not\ndefined in the monitoring backend, reporting on this metric will result in\nan error.", + "items": { + "$ref": "MetricValueSet" + }, + "type": "array" + } + }, + "id": "EndReconciliationResponse" + }, + "Distribution": { + "properties": { + "exponentialBuckets": { + "$ref": "ExponentialBuckets", + "description": "Buckets with exponentially growing width." + }, + "minimum": { + "format": "double", + "description": "The minimum of the population of values. Ignored if `count` is zero.", + "type": "number" + }, + "linearBuckets": { + "$ref": "LinearBuckets", + "description": "Buckets with constant width." + }, + "count": { + "type": "string", + "format": "int64", + "description": "The total number of samples in the distribution. Must be \u003e= 0." + }, + "mean": { + "format": "double", + "description": "The arithmetic mean of the samples in the distribution. If `count` is\nzero then this field must be zero.", + "type": "number" + }, + "bucketCounts": { + "description": "The number of samples in each histogram bucket. `bucket_counts` are\noptional. If present, they must sum to the `count` value.\n\nThe buckets are defined below in `bucket_option`. There are N buckets.\n`bucket_counts[0]` is the number of samples in the underflow bucket.\n`bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples\nin each of the finite buckets. And `bucket_counts[N] is the number\nof samples in the overflow bucket. See the comments of `bucket_option`\nbelow for more details.\n\nAny suffix of trailing zeros may be omitted.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "explicitBuckets": { + "$ref": "ExplicitBuckets", + "description": "Buckets with arbitrary user-provided width." + }, + "maximum": { + "format": "double", + "description": "The maximum of the population of values. Ignored if `count` is zero.", + "type": "number" + }, + "sumOfSquaredDeviation": { + "format": "double", + "description": "The sum of squared deviations from the mean:\n Sum[i=1..count]((x_i - mean)^2)\nwhere each x_i is a sample values. If `count` is zero then this field\nmust be zero, otherwise validation of the request fails.", + "type": "number" + } + }, + "id": "Distribution", + "description": "Distribution represents a frequency distribution of double-valued sample\npoints. It contains the size of the population of sample points plus\nadditional optional information:\n\n - the arithmetic mean of the samples\n - the minimum and maximum of the samples\n - the sum-squared-deviation of the samples, used to compute variance\n - a histogram of the values of the sample points", + "type": "object" + }, + "ExplicitBuckets": { + "description": "Describing buckets with arbitrary user-provided width.", + "type": "object", + "properties": { + "bounds": { + "description": "'bound' is a list of strictly increasing boundaries between\nbuckets. Note that a list of length N-1 defines N buckets because\nof fenceposting. See comments on `bucket_options` for details.\n\nThe i'th finite bucket covers the interval\n [bound[i-1], bound[i])\nwhere i ranges from 1 to bound_size() - 1. Note that there are no\nfinite buckets at all if 'bound' only contains a single element; in\nthat special case the single bound defines the boundary between the\nunderflow and overflow buckets.\n\nbucket number lower bound upper bound\n i == 0 (underflow) -inf bound[i]\n 0 \u003c i \u003c bound_size() bound[i-1] bound[i]\n i == bound_size() (overflow) bound[i-1] +inf", + "items": { + "format": "double", + "type": "number" + }, + "type": "array" + } + }, + "id": "ExplicitBuckets" + }, + "ExponentialBuckets": { + "description": "Describing buckets with exponentially growing width.", + "type": "object", + "properties": { + "growthFactor": { + "format": "double", + "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be larger than 1.0.", + "type": "number" + }, + "scale": { + "format": "double", + "description": "The i'th exponential bucket covers the interval\n [scale * growth_factor^(i-1), scale * growth_factor^i)\nwhere i ranges from 1 to num_finite_buckets inclusive.\nMust be \u003e 0.", + "type": "number" + }, + "numFiniteBuckets": { + "format": "int32", + "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", + "type": "integer" + } + }, + "id": "ExponentialBuckets" + }, + "AuthorizationInfo": { + "properties": { + "resource": { + "description": "The resource being accessed, as a REST-style string. For example:\n\n bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID", + "type": "string" + }, + "granted": { + "description": "Whether or not authorization for `resource` and `permission`\nwas granted.", + "type": "boolean" + }, + "permission": { + "description": "The required IAM permission.", + "type": "string" + } + }, + "id": "AuthorizationInfo", + "description": "Authorization information for the operation.", + "type": "object" + }, + "ResourceInfo": { + "id": "ResourceInfo", + "description": "DO NOT USE.\nThis definition is not ready for use yet.", + "type": "object", + "properties": { + "resourceName": { + "description": "Name of the resource. This is used for auditing purposes.", + "type": "string" + }, + "resourceContainer": { + "description": "The identifier of the parent of this resource instance.\nMust be in one of the following formats:\n - “projects/\u003cproject-id or project-number\u003e”\n - “folders/\u003cfolder-id\u003e”\n - “organizations/\u003corganization-id\u003e”", + "type": "string" } } + }, + "StartReconciliationResponse": { + "description": "Response message for QuotaController.StartReconciliation.", + "type": "object", + "properties": { + "reconciliationErrors": { + "description": "Indicates the decision of the reconciliation start.", + "items": { + "$ref": "QuotaError" + }, + "type": "array" + }, + "operationId": { + "description": "The same operation_id value used in the StartReconciliationRequest. Used\nfor logging and diagnostics purposes.", + "type": "string" + }, + "serviceConfigId": { + "description": "ID of the actual config used to process the request.", + "type": "string" + }, + "quotaMetrics": { + "description": "Metric values as tracked by One Platform before the start of\nreconciliation. The following metrics will be included:\n\n1. Per quota metric total usage will be specified using the following gauge\nmetric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n2. Value for each quota limit associated with the metrics will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"", + "items": { + "$ref": "MetricValueSet" + }, + "type": "array" + } + }, + "id": "StartReconciliationResponse" + }, + "QuotaProperties": { + "id": "QuotaProperties", + "description": "Represents the properties needed for quota operations.", + "type": "object", + "properties": { + "quotaMode": { + "enumDescriptions": [ + "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation fails and returns\nerror.", + "Decreases available quota by the cost specified for the operation.\nIf cost is higher than available quota, operation does not fail and\navailable quota goes down to zero but it returns error.", + "Does not change any available quota. Only checks if there is enough\nquota.\nNo lock is placed on the checked tokens neither.", + "Increases available quota by the operation cost specified for the\noperation." + ], + "enum": [ + "ACQUIRE", + "ACQUIRE_BEST_EFFORT", + "CHECK", + "RELEASE" + ], + "description": "Quota mode for this operation.", + "type": "string" + }, + "limitByIds": { + "additionalProperties": { + "type": "string" + }, + "description": "LimitType IDs that should be used for checking quota. Key in this map\nshould be a valid LimitType string, and the value is the ID to be used. For\nexample, an entry \u003cUSER, 123\u003e will cause all user quota limits to use 123\nas the user ID. See google/api/quota.proto for the definition of LimitType.\nCLIENT_PROJECT: Not supported.\nUSER: Value of this entry will be used for enforcing user-level quota\n limits. If none specified, caller IP passed in the\n servicecontrol.googleapis.com/caller_ip label will be used instead.\n If the server cannot resolve a value for this LimitType, an error\n will be thrown. No validation will be performed on this ID.\nDeprecated: use servicecontrol.googleapis.com/user label to send user ID.", + "type": "object" + } + } + }, + "LinearBuckets": { + "properties": { + "numFiniteBuckets": { + "format": "int32", + "description": "The number of finite buckets. With the underflow and overflow buckets,\nthe total number of buckets is `num_finite_buckets` + 2.\nSee comments on `bucket_options` for details.", + "type": "integer" + }, + "width": { + "type": "number", + "format": "double", + "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.\nMust be strictly positive." + }, + "offset": { + "format": "double", + "description": "The i'th linear bucket covers the interval\n [offset + (i-1) * width, offset + i * width)\nwhere i ranges from 1 to num_finite_buckets, inclusive.", + "type": "number" + } + }, + "id": "LinearBuckets", + "description": "Describing buckets with constant width.", + "type": "object" + }, + "AuthenticationInfo": { + "properties": { + "principalEmail": { + "description": "The email address of the authenticated user (or service account on behalf\nof third party principal) making the request. For privacy reasons, the\nprincipal email address is redacted for all read-only operations that fail\nwith a \"permission denied\" error.", + "type": "string" + }, + "authoritySelector": { + "description": "The authority selector specified by the requestor, if any.\nIt is not guaranteed that the principal was allowed to use this authority.", + "type": "string" + }, + "thirdPartyPrincipal": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + }, + "description": "The third party identification (if any) of the authenticated user making\nthe request.\nWhen the JSON object represented here has a proto equivalent, the proto\nname will be indicated in the `@type` property.", + "type": "object" + } + }, + "id": "AuthenticationInfo", + "description": "Authentication information for the operation.", + "type": "object" + }, + "AllocateQuotaResponse": { + "id": "AllocateQuotaResponse", + "description": "Response message for the AllocateQuota method.", + "type": "object", + "properties": { + "operationId": { + "type": "string", + "description": "The same operation_id value used in the AllocateQuotaRequest. Used for\nlogging and diagnostics purposes." + }, + "allocateInfo": { + "$ref": "AllocateInfo", + "description": "WARNING: DO NOT use this field until this warning message is removed." + }, + "serviceConfigId": { + "description": "ID of the actual config used to process the request.", + "type": "string" + }, + "allocateErrors": { + "description": "Indicates the decision of the allocate.", + "items": { + "$ref": "QuotaError" + }, + "type": "array" + }, + "quotaMetrics": { + "description": "Quota metrics to indicate the result of allocation. Depending on the\nrequest, one or more of the following metrics will be included:\n\n1. For rate quota, per quota group or per quota metric incremental usage\nwill be specified using the following delta metric:\n \"serviceruntime.googleapis.com/api/consumer/quota_used_count\"\n\n2. For allocation quota, per quota metric total usage will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n3. For both rate quota and allocation quota, the quota limit reached\ncondition will be specified using the following boolean metric:\n \"serviceruntime.googleapis.com/quota/exceeded\"\n\n4. For allocation quota, value for each quota limit associated with\nthe metrics will be specified using the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"", + "items": { + "$ref": "MetricValueSet" + }, + "type": "array" + } + } + }, + "ReleaseQuotaRequest": { + "properties": { + "serviceConfigId": { + "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used.", + "type": "string" + }, + "releaseOperation": { + "$ref": "QuotaOperation", + "description": "Operation that describes the quota release." + } + }, + "id": "ReleaseQuotaRequest", + "description": "Request message for the ReleaseQuota method.", + "type": "object" + }, + "QuotaError": { + "description": "Represents error information for QuotaOperation.", + "type": "object", + "properties": { + "description": { + "description": "Free-form text that provides details on the cause of the error.", + "type": "string" + }, + "subject": { + "type": "string", + "description": "Subject to whom this error applies. See the specific enum for more details\non this field. For example, \"clientip:\u003cip address of client\u003e\" or\n\"project:\u003cGoogle developer project id\u003e\"." + }, + "code": { + "type": "string", + "enumDescriptions": [ + "This is never used.", + "Quota allocation failed.\nSame as google.rpc.Code.RESOURCE_EXHAUSTED.", + "Quota release failed. This error is ONLY returned on a NORMAL release.\nMore formally: if a user requests a release of 10 tokens, but only\n5 tokens were previously allocated, in a BEST_EFFORT release, this will\nbe considered a success, 5 tokens will be released, and the result will\nbe \"Ok\". If this is done in NORMAL mode, no tokens will be released,\nand an OUT_OF_RANGE error will be returned.\nSame as google.rpc.Code.OUT_OF_RANGE.", + "Consumer cannot access the service because the service requires active\nbilling.", + "Consumer's project has been marked as deleted (soft deletion).", + "Specified API key is invalid.", + "Specified API Key has expired.", + "Consumer's spatula header is invalid.", + "The consumer's LOAS role is invalid.", + "The consumer's LOAS role has no associated project.", + "The backend server for looking up project id/number is unavailable.", + "The backend server for checking service status is unavailable.", + "The backend server for checking billing status is unavailable.", + "The backend server for checking quota limits is unavailable." + ], + "enum": [ + "UNSPECIFIED", + "RESOURCE_EXHAUSTED", + "OUT_OF_RANGE", + "BILLING_NOT_ACTIVE", + "PROJECT_DELETED", + "API_KEY_INVALID", + "API_KEY_EXPIRED", + "SPATULA_HEADER_INVALID", + "LOAS_ROLE_INVALID", + "NO_LOAS_PROJECT", + "PROJECT_STATUS_UNAVAILABLE", + "SERVICE_STATUS_UNAVAILABLE", + "BILLING_STATUS_UNAVAILABLE", + "QUOTA_SYSTEM_UNAVAILABLE" + ], + "description": "Error code." + } + }, + "id": "QuotaError" + }, + "RequestMetadata": { + "description": "Metadata about the request.", + "type": "object", + "properties": { + "callerIp": { + "description": "The IP address of the caller.\nFor caller from internet, this will be public IPv4 or IPv6 address.\nFor caller from GCE VM with external IP address, this will be the VM's\nexternal IP address. For caller from GCE VM without external IP address, if\nthe VM is in the same GCP organization (or project) as the accessed\nresource, `caller_ip` will be the GCE VM's internal IPv4 address, otherwise\nit will be redacted to \"gce-internal-ip\".\nSee https://cloud.google.com/compute/docs/vpc/ for more information.", + "type": "string" + }, + "callerSuppliedUserAgent": { + "description": "The user agent of the caller.\nThis information is not authenticated and should be treated accordingly.\nFor example:\n\n+ `google-api-python-client/1.4.0`:\n The request was made by the Google API client for Python.\n+ `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`:\n The request was made by the Google Cloud SDK CLI (gcloud).\n+ `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`:\n The request was made from the `my-project` App Engine app.\nNOLINT", + "type": "string" + } + }, + "id": "RequestMetadata" + }, + "CheckInfo": { + "type": "object", + "properties": { + "consumerInfo": { + "description": "Consumer info of this check.", + "$ref": "ConsumerInfo" + }, + "unusedArguments": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of fields and label keys that are ignored by the server.\nThe client doesn't need to send them for following requests to improve\nperformance and allow better aggregation." + } + }, + "id": "CheckInfo", + "description": "Contains additional information about the check operation." + }, + "AllocateQuotaRequest": { + "properties": { + "serviceConfigId": { + "type": "string", + "description": "Specifies which version of service configuration should be used to process\nthe request. If unspecified or no matching version can be found, the latest\none will be used." + }, + "allocateOperation": { + "$ref": "QuotaOperation", + "description": "Operation that describes the quota allocation." + } + }, + "id": "AllocateQuotaRequest", + "description": "Request message for the AllocateQuota method.", + "type": "object" + }, + "ReleaseQuotaResponse": { + "description": "Response message for the ReleaseQuota method.", + "type": "object", + "properties": { + "quotaMetrics": { + "description": "Quota metrics to indicate the result of release. Depending on the\nrequest, one or more of the following metrics will be included:\n\n1. For rate quota, per quota group or per quota metric released amount\nwill be specified using the following delta metric:\n \"serviceruntime.googleapis.com/api/consumer/quota_refund_count\"\n\n2. For allocation quota, per quota metric total usage will be specified\nusing the following gauge metric:\n \"serviceruntime.googleapis.com/allocation/consumer/quota_used_count\"\n\n3. For allocation quota, value for each quota limit associated with\nthe metrics will be specified using the following gauge metric:\n \"serviceruntime.googleapis.com/quota/limit\"", + "items": { + "$ref": "MetricValueSet" + }, + "type": "array" + }, + "operationId": { + "description": "The same operation_id value used in the ReleaseQuotaRequest. Used for\nlogging and diagnostics purposes.", + "type": "string" + }, + "serviceConfigId": { + "description": "ID of the actual config used to process the request.", + "type": "string" + }, + "releaseErrors": { + "description": "Indicates the decision of the release.", + "items": { + "$ref": "QuotaError" + }, + "type": "array" + } + }, + "id": "ReleaseQuotaResponse" + }, + "MetricValueSet": { + "id": "MetricValueSet", + "description": "Represents a set of metric values in the same metric.\nEach metric value in the set should have a unique combination of start time,\nend time, and label values.", + "type": "object", + "properties": { + "metricName": { + "description": "The metric name defined in the service configuration.", + "type": "string" + }, + "metricValues": { + "description": "The values in this metric.", + "items": { + "$ref": "MetricValue" + }, + "type": "array" + } + } + }, + "ReportError": { + "properties": { + "status": { + "$ref": "Status", + "description": "Details of the error when processing the Operation." + }, + "operationId": { + "description": "The Operation.operation_id value from the request.", + "type": "string" + } + }, + "id": "ReportError", + "description": "Represents the processing error of one Operation in the request.", + "type": "object" } }, "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, "canonicalName": "Service Control", "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/servicecontrol": { - "description": "Manage your Google Service Control data" - }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/servicecontrol": { + "description": "Manage your Google Service Control data" } } } }, - "rootUrl": "https://servicecontrol.googleapis.com/", - "ownerDomain": "google.com", - "name": "servicecontrol", - "batchPath": "batch", - "title": "Google Service Control API", - "ownerName": "Google", - "resources": { - "services": { - "methods": { - "allocateQuota": { - "httpMethod": "POST", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "AllocateQuotaResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ], - "parameters": { - "serviceName": { - "location": "path", - "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/services/{serviceName}:allocateQuota", - "id": "servicecontrol.services.allocateQuota", - "path": "v1/services/{serviceName}:allocateQuota", - "description": "Attempts to allocate quota for the specified consumer. It should be called\nbefore the operation is executed.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).\n\n**NOTE:** the client code **must** fail-open if the server returns one\nof the following quota errors:\n- `PROJECT_STATUS_UNAVAILABLE`\n- `SERVICE_STATUS_UNAVAILABLE`\n- `BILLING_STATUS_UNAVAILABLE`\n- `QUOTA_SYSTEM_UNAVAILABLE`\n\nThe server may inject above errors to prohibit any hard dependency\non the quota system.", - "request": { - "$ref": "AllocateQuotaRequest" - } - }, - "startReconciliation": { - "flatPath": "v1/services/{serviceName}:startReconciliation", - "id": "servicecontrol.services.startReconciliation", - "path": "v1/services/{serviceName}:startReconciliation", - "description": "Unlike rate quota, allocation quota does not get refilled periodically.\nSo, it is possible that the quota usage as seen by the service differs from\nwhat the One Platform considers the usage is. This is expected to happen\nonly rarely, but over time this can accumulate. Services can invoke\nStartReconciliation and EndReconciliation to correct this usage drift, as\ndescribed below:\n1. Service sends StartReconciliation with a timestamp in future for each\n metric that needs to be reconciled. The timestamp being in future allows\n to account for in-flight AllocateQuota and ReleaseQuota requests for the\n same metric.\n2. One Platform records this timestamp and starts tracking subsequent\n AllocateQuota and ReleaseQuota requests until EndReconciliation is\n called.\n3. At or after the time specified in the StartReconciliation, service\n sends EndReconciliation with the usage that needs to be reconciled to.\n4. One Platform adjusts its own record of usage for that metric to the\n value specified in EndReconciliation by taking in to account any\n allocation or release between StartReconciliation and EndReconciliation.\n\nSignals the quota controller that the service wants to perform a usage\nreconciliation as specified in the request.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", - "request": { - "$ref": "StartReconciliationRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "StartReconciliationResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ], - "parameters": { - "serviceName": { - "location": "path", - "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", - "required": true, - "type": "string" - } - } - }, - "check": { - "response": { - "$ref": "CheckResponse" - }, - "parameterOrder": [ - "serviceName" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ], - "parameters": { - "serviceName": { - "required": true, - "type": "string", - "location": "path", - "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name." - } - }, - "flatPath": "v1/services/{serviceName}:check", - "path": "v1/services/{serviceName}:check", - "id": "servicecontrol.services.check", - "description": "Checks an operation with Google Service Control to decide whether\nthe given operation should proceed. It should be called before the\noperation is executed.\n\nIf feasible, the client should cache the check results and reuse them for\n60 seconds. In case of server errors, the client can rely on the cached\nresults for longer time.\n\nNOTE: the `CheckRequest` has the size limit of 64KB.\n\nThis method requires the `servicemanagement.services.check` permission\non the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", - "request": { - "$ref": "CheckRequest" - } - }, - "releaseQuota": { - "request": { - "$ref": "ReleaseQuotaRequest" - }, - "description": "Releases previously allocated quota done through AllocateQuota method.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).\n\n**NOTE:** the client code **must** fail-open if the server returns one\nof the following quota errors:\n- `PROJECT_STATUS_UNAVAILABLE`\n- `SERVICE_STATUS_UNAVAILABLE`\n- `BILLING_STATUS_UNAVAILABLE`\n- `QUOTA_SYSTEM_UNAVAILABLE`\n\nThe server may inject above errors to prohibit any hard dependency\non the quota system.", - "response": { - "$ref": "ReleaseQuotaResponse" - }, - "parameterOrder": [ - "serviceName" - ], - "httpMethod": "POST", - "parameters": { - "serviceName": { - "location": "path", - "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ], - "flatPath": "v1/services/{serviceName}:releaseQuota", - "path": "v1/services/{serviceName}:releaseQuota", - "id": "servicecontrol.services.releaseQuota" - }, - "endReconciliation": { - "parameters": { - "serviceName": { - "location": "path", - "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ], - "flatPath": "v1/services/{serviceName}:endReconciliation", - "path": "v1/services/{serviceName}:endReconciliation", - "id": "servicecontrol.services.endReconciliation", - "request": { - "$ref": "EndReconciliationRequest" - }, - "description": "Signals the quota controller that service ends the ongoing usage\nreconciliation.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", - "response": { - "$ref": "EndReconciliationResponse" - }, - "parameterOrder": [ - "serviceName" - ], - "httpMethod": "POST" - }, - "report": { - "response": { - "$ref": "ReportResponse" - }, - "parameterOrder": [ - "serviceName" - ], - "httpMethod": "POST", - "parameters": { - "serviceName": { - "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ], - "flatPath": "v1/services/{serviceName}:report", - "path": "v1/services/{serviceName}:report", - "id": "servicecontrol.services.report", - "request": { - "$ref": "ReportRequest" - }, - "description": "Reports operation results to Google Service Control, such as logs and\nmetrics. It should be called after an operation is completed.\n\nIf feasible, the client should aggregate reporting data for up to 5\nseconds to reduce API traffic. Limiting aggregation to 5 seconds is to\nreduce data loss during client crashes. Clients should carefully choose\nthe aggregation time window to avoid data loss risk more than 0.01%\nfor business and compliance reasons.\n\nNOTE: the `ReportRequest` has the size limit of 1MB.\n\nThis method requires the `servicemanagement.services.report` permission\non the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam)." - } - } - } - }, - "parameters": { - "alt": { - "type": "string", - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", - "location": "query" - }, - "oauth_token": { - "type": "string", - "location": "query", - "description": "OAuth 2.0 token for the current user." - }, - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "$.xgafv": { - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ] - } - }, - "version": "v1", - "baseUrl": "https://servicecontrol.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Google Service Control provides control plane functionality to managed services, such as logging, monitoring, and status checks.", - "servicePath": "", - "basePath": "" + "rootUrl": "https://servicecontrol.googleapis.com/" } diff --git a/etc/api/servicemanagement/v1/servicemanagement-api.json b/etc/api/servicemanagement/v1/servicemanagement-api.json index 5c0f4c433f..b9cb4858b6 100644 --- a/etc/api/servicemanagement/v1/servicemanagement-api.json +++ b/etc/api/servicemanagement/v1/servicemanagement-api.json @@ -1,1012 +1,176 @@ { - "basePath": "", - "ownerDomain": "google.com", - "name": "servicemanagement", - "batchPath": "batch", - "revision": "20170512", - "id": "servicemanagement:v1", "documentationLink": "https://cloud.google.com/service-management/", - "title": "Google Service Management API", + "revision": "20170916", + "id": "servicemanagement:v1", "discoveryVersion": "v1", - "ownerName": "Google", - "resources": { - "services": { - "methods": { - "get": { - "description": "Gets a managed service. Authentication is required unless the service is\npublic.", - "httpMethod": "GET", - "response": { + "schemas": { + "ListServicesResponse": { + "description": "Response message for `ListServices` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token that can be passed to `ListServices` to resume a paginated query.", + "type": "string" + }, + "services": { + "description": "The returned services will only have the name field set.", + "items": { "$ref": "ManagedService" }, - "parameterOrder": [ - "serviceName" - ], - "parameters": { - "serviceName": { - "description": "The name of the service. See the `ServiceManager` overview for naming\nrequirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{serviceName}", - "id": "servicemanagement.services.get", - "path": "v1/services/{serviceName}" - }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameters": { - "resource": { - "required": true, - "type": "string", - "pattern": "^services/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{servicesId}:testIamPermissions", - "id": "servicemanagement.services.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." - }, - "getConfig": { - "httpMethod": "GET", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "Service" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "parameters": { - "serviceName": { - "required": true, - "type": "string", - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`." - }, - "configId": { - "location": "query", - "description": "The id of the service configuration resource.", - "type": "string" - }, - "view": { - "description": "Specifies which parts of the Service Config should be returned in the\nresponse.", - "type": "string", - "location": "query", - "enum": [ - "BASIC", - "FULL" - ] - } - }, - "flatPath": "v1/services/{serviceName}/config", - "id": "servicemanagement.services.getConfig", - "path": "v1/services/{serviceName}/config", - "description": "Gets a service configuration (version) for a managed service." - }, - "delete": { - "httpMethod": "DELETE", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "serviceName" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "parameters": { - "serviceName": { - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/services/{serviceName}", - "id": "servicemanagement.services.delete", - "path": "v1/services/{serviceName}", - "description": "Deletes a managed service. This method will change the service to the\n`Soft-Delete` state for 30 days. Within this period, service producers may\ncall UndeleteService to restore the service.\nAfter 30 days, the service will be permanently deleted.\n\nOperation\u003cresponse: google.protobuf.Empty\u003e" - }, - "enable": { - "parameters": { - "serviceName": { - "location": "path", - "description": "Name of the service to enable. Specifying an unknown service name will\ncause the request to fail.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "flatPath": "v1/services/{serviceName}:enable", - "id": "servicemanagement.services.enable", - "path": "v1/services/{serviceName}:enable", - "request": { - "$ref": "EnableServiceRequest" - }, - "description": "Enables a service for a project, so it can be used\nfor the project. See\n[Cloud Auth Guide](https://cloud.google.com/docs/authentication) for\nmore information.\n\nOperation\u003cresponse: EnableServiceResponse\u003e", - "httpMethod": "POST", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "Operation" - } - }, - "setIamPolicy": { - "parameters": { - "resource": { - "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^services/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "flatPath": "v1/services/{servicesId}:setIamPolicy", - "path": "v1/{+resource}:setIamPolicy", - "id": "servicemanagement.services.setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST" - }, - "disable": { - "httpMethod": "POST", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "serviceName": { - "location": "path", - "description": "Name of the service to disable. Specifying an unknown service name\nwill cause the request to fail.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "flatPath": "v1/services/{serviceName}:disable", - "id": "servicemanagement.services.disable", - "path": "v1/services/{serviceName}:disable", - "request": { - "$ref": "DisableServiceRequest" - }, - "description": "Disables a service for a project, so it can no longer be\nbe used for the project. It prevents accidental usage that may cause\nunexpected billing charges or security leaks.\n\nOperation\u003cresponse: DisableServiceResponse\u003e" - }, - "getIamPolicy": { - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^services/[^/]+$", - "location": "path" - } - }, - "flatPath": "v1/services/{servicesId}:getIamPolicy", - "path": "v1/{+resource}:getIamPolicy", - "id": "servicemanagement.services.getIamPolicy", - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "request": { - "$ref": "GetIamPolicyRequest" - } - }, - "undelete": { - "description": "Revives a previously deleted managed service. The method restores the\nservice using the configuration at the time the service was deleted.\nThe target service must exist and must have been deleted within the\nlast 30 days.\n\nOperation\u003cresponse: UndeleteServiceResponse\u003e", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "serviceName" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "parameters": { - "serviceName": { - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/services/{serviceName}:undelete", - "path": "v1/services/{serviceName}:undelete", - "id": "servicemanagement.services.undelete" - }, - "list": { - "flatPath": "v1/services", - "id": "servicemanagement.services.list", - "path": "v1/services", - "description": "Lists managed services.\n\nReturns all public services. For authenticated users, also returns all\nservices the calling user has \"servicemanagement.services.get\" permission\nfor.\n\n**BETA:** If the caller specifies the `consumer_id`, it returns only the\nservices enabled on the consumer. The `consumer_id` must have the format\nof \"project:{PROJECT-ID}\".", - "httpMethod": "GET", - "parameterOrder": [], - "response": { - "$ref": "ListServicesResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "parameters": { - "pageSize": { - "description": "Requested size of the next page of data.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "producerProjectId": { - "location": "query", - "description": "Include services produced by the specified project.", - "type": "string" - }, - "consumerId": { - "description": "Include services consumed by the specified consumer.\n\nThe Google Service Management implementation accepts the following\nforms:\n- project:\u003cproject_id\u003e", - "type": "string", - "location": "query" - }, - "pageToken": { - "location": "query", - "description": "Token identifying which result to start with; returned by a previous list\ncall.", - "type": "string" - } - } - }, - "create": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "flatPath": "v1/services", - "path": "v1/services", - "id": "servicemanagement.services.create", - "request": { - "$ref": "ManagedService" - }, - "description": "Creates a new managed service.\nPlease note one producer project can own no more than 20 services.\n\nOperation\u003cresponse: ManagedService\u003e" - }, - "generateConfigReport": { - "description": "Generates and returns a report (errors, warnings and changes from\nexisting configurations) associated with\nGenerateConfigReportRequest.new_value\n\nIf GenerateConfigReportRequest.old_value is specified,\nGenerateConfigReportRequest will contain a single ChangeReport based on the\ncomparison between GenerateConfigReportRequest.new_value and\nGenerateConfigReportRequest.old_value.\nIf GenerateConfigReportRequest.old_value is not specified, this method\nwill compare GenerateConfigReportRequest.new_value with the last pushed\nservice configuration.", - "request": { - "$ref": "GenerateConfigReportRequest" - }, - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "GenerateConfigReportResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "parameters": {}, - "flatPath": "v1/services:generateConfigReport", - "id": "servicemanagement.services.generateConfigReport", - "path": "v1/services:generateConfigReport" + "type": "array" } }, - "resources": { - "configs": { - "methods": { - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "Service" - }, - "parameters": { - "serviceName": { - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "flatPath": "v1/services/{serviceName}/configs", - "id": "servicemanagement.services.configs.create", - "path": "v1/services/{serviceName}/configs", - "request": { - "$ref": "Service" - }, - "description": "Creates a new service configuration (version) for a managed service.\nThis method only stores the service configuration. To roll out the service\nconfiguration to backend systems please call\nCreateServiceRollout." - }, - "submit": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "parameters": { - "serviceName": { - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/services/{serviceName}/configs:submit", - "id": "servicemanagement.services.configs.submit", - "path": "v1/services/{serviceName}/configs:submit", - "description": "Creates a new service configuration (version) for a managed service based\non\nuser-supplied configuration source files (for example: OpenAPI\nSpecification). This method stores the source configurations as well as the\ngenerated service configuration. To rollout the service configuration to\nother services,\nplease call CreateServiceRollout.\n\nOperation\u003cresponse: SubmitConfigSourceResponse\u003e", - "request": { - "$ref": "SubmitConfigSourceRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "Operation" - } - }, - "list": { - "response": { - "$ref": "ListServiceConfigsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [ - "serviceName" - ], - "parameters": { - "serviceName": { - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "The token of the page to retrieve.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "The max number of items to include in the response list.", - "format": "int32", - "type": "integer" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{serviceName}/configs", - "path": "v1/services/{serviceName}/configs", - "id": "servicemanagement.services.configs.list", - "description": "Lists the history of the service configuration for a managed service,\nfrom the newest to the oldest." - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Service" - }, - "parameterOrder": [ - "serviceName", - "configId" - ], - "parameters": { - "serviceName": { - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string", - "location": "path" - }, - "configId": { - "description": "The id of the service configuration resource.", - "required": true, - "type": "string", - "location": "path" - }, - "view": { - "location": "query", - "enum": [ - "BASIC", - "FULL" - ], - "description": "Specifies which parts of the Service Config should be returned in the\nresponse.", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{serviceName}/configs/{configId}", - "id": "servicemanagement.services.configs.get", - "path": "v1/services/{serviceName}/configs/{configId}", - "description": "Gets a service configuration (version) for a managed service." - } - } + "id": "ListServicesResponse" + }, + "Endpoint": { + "description": "`Endpoint` describes a network endpoint that serves a set of APIs.\nA service may expose any number of endpoints, and all endpoints share the\nsame service configuration, such as quota configuration and monitoring\nconfiguration.\n\nExample service configuration:\n\n name: library-example.googleapis.com\n endpoints:\n # Below entry makes 'google.example.library.v1.Library'\n # API be served from endpoint address library-example.googleapis.com.\n # It also allows HTTP OPTIONS calls to be passed to the backend, for\n # it to decide whether the subsequent cross-origin request is\n # allowed to proceed.\n - name: library-example.googleapis.com\n allow_cors: true", + "type": "object", + "properties": { + "apis": { + "description": "The list of APIs served by this endpoint.\n\nIf no APIs are specified this translates to \"all APIs\" exported by the\nservice, as defined in the top-level service configuration.", + "items": { + "type": "string" + }, + "type": "array" }, - "consumers": { - "methods": { - "testIamPermissions": { - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameters": { - "resource": { - "pattern": "^services/[^/]+/consumers/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:testIamPermissions", - "id": "servicemanagement.services.consumers.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions" - }, - "getIamPolicy": { - "path": "v1/{+resource}:getIamPolicy", - "id": "servicemanagement.services.consumers.getIamPolicy", - "request": { - "$ref": "GetIamPolicyRequest" - }, - "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", - "response": { - "$ref": "Policy" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string", - "pattern": "^services/[^/]+/consumers/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:getIamPolicy" - }, - "setIamPolicy": { - "parameters": { - "resource": { - "pattern": "^services/[^/]+/consumers/[^/]+$", - "location": "path", - "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:setIamPolicy", - "id": "servicemanagement.services.consumers.setIamPolicy", - "path": "v1/{+resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "response": { - "$ref": "Policy" - } - } - } + "allowCors": { + "type": "boolean", + "description": "Allowing\n[CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka\ncross-domain traffic, would allow the backends served from this endpoint to\nreceive and respond to HTTP OPTIONS requests. The response will be used by\nthe browser to determine whether the subsequent cross-origin request is\nallowed to proceed." }, - "rollouts": { - "methods": { - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "serviceName" - ], - "response": { - "$ref": "ListServiceRolloutsResponse" - }, - "parameters": { - "serviceName": { - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string" - }, - "pageToken": { - "location": "query", - "description": "The token of the page to retrieve.", - "type": "string" - }, - "pageSize": { - "location": "query", - "description": "The max number of items to include in the response list.", - "format": "int32", - "type": "integer" - }, - "filter": { - "location": "query", - "description": "Use `filter` to return subset of rollouts.\nThe following filters are supported:\n -- To limit the results to only those in\n [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS',\n use filter='status=SUCCESS'\n -- To limit the results to those in\n [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED'\n or 'FAILED', use filter='status=CANCELLED OR status=FAILED'", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "flatPath": "v1/services/{serviceName}/rollouts", - "id": "servicemanagement.services.rollouts.list", - "path": "v1/services/{serviceName}/rollouts", - "description": "Lists the history of the service configuration rollouts for a managed\nservice, from the newest to the oldest." - }, - "get": { - "response": { - "$ref": "Rollout" - }, - "parameterOrder": [ - "serviceName", - "rolloutId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ], - "parameters": { - "serviceName": { - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", - "required": true, - "type": "string" - }, - "rolloutId": { - "description": "The id of the rollout resource.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v1/services/{serviceName}/rollouts/{rolloutId}", - "path": "v1/services/{serviceName}/rollouts/{rolloutId}", - "id": "servicemanagement.services.rollouts.get", - "description": "Gets a service configuration rollout." - }, - "create": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "serviceName" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "parameters": { - "serviceName": { - "required": true, - "type": "string", - "location": "path", - "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`." - } - }, - "flatPath": "v1/services/{serviceName}/rollouts", - "path": "v1/services/{serviceName}/rollouts", - "id": "servicemanagement.services.rollouts.create", - "description": "Creates a new service configuration rollout. Based on rollout, the\nGoogle Service Management will roll out the service configurations to\ndifferent backend services. For example, the logging configuration will be\npushed to Google Cloud Logging.\n\nPlease note that any previous pending and running Rollouts and associated\nOperations will be automatically cancelled so that the latest Rollout will\nnot be blocked by previous Rollouts.\n\nOperation\u003cresponse: Rollout\u003e", - "request": { - "$ref": "Rollout" - } - } - } + "aliases": { + "items": { + "type": "string" + }, + "type": "array", + "description": "DEPRECATED: This field is no longer supported. Instead of using aliases,\nplease specify multiple google.api.Endpoint for each of the intented\nalias.\n\nAdditional names that this endpoint will be hosted on." + }, + "name": { + "type": "string", + "description": "The canonical name of this endpoint." + }, + "target": { + "description": "The specification of an Internet routable address of API frontend that will\nhandle requests to this [API Endpoint](https://cloud.google.com/apis/design/glossary).\nIt should be either a valid IPv4 address or a fully-qualified domain name.\nFor example, \"8.8.8.8\" or \"myservice.appspot.com\".", + "type": "string" + }, + "features": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The list of features enabled on this endpoint." } - } + }, + "id": "Endpoint" }, - "operations": { - "methods": { - "list": { - "flatPath": "v1/operations", - "id": "servicemanagement.operations.list", - "path": "v1/operations", - "description": "Lists service operations that match the specified filter in the request.", - "httpMethod": "GET", - "response": { - "$ref": "ListOperationsResponse" - }, - "parameterOrder": [], - "parameters": { - "filter": { - "location": "query", - "description": "A string for filtering Operations.\n The following filter fields are supported:\n\n * serviceName: Required. Only `=` operator is allowed.\n * startTime: The time this job was started, in ISO 8601 format.\n Allowed operators are `\u003e=`, `\u003e`, `\u003c=`, and `\u003c`.\n * status: Can be `done`, `in_progress`, or `failed`. Allowed\n operators are `=`, and `!=`.\n\n Filter expression supports conjunction (AND) and disjunction (OR)\n logical operators. However, the serviceName restriction must be at the\n top-level and can only be combined with other restrictions via the AND\n logical operator.\n\n Examples:\n\n * `serviceName={some-service}.googleapis.com`\n * `serviceName={some-service}.googleapis.com AND startTime\u003e=\"2017-02-01\"`\n * `serviceName={some-service}.googleapis.com AND status=done`\n * `serviceName={some-service}.googleapis.com AND (status=done OR startTime\u003e=\"2017-02-01\")`", - "type": "string" - }, - "name": { - "location": "query", - "description": "Not used.", - "type": "string" - }, - "pageToken": { - "description": "The standard list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The maximum number of operations to return. If unspecified, defaults to\n50. The maximum value is 100.", - "format": "int32", - "type": "integer" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ] - }, - "get": { - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/service.management" - ], - "parameters": { - "name": { - "required": true, - "type": "string", - "pattern": "^operations/.+$", - "location": "path", - "description": "The name of the operation resource." - } - }, - "flatPath": "v1/operations/{operationsId}", - "id": "servicemanagement.operations.get", - "path": "v1/{+name}", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "httpMethod": "GET", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "name" - ] + "OAuthRequirements": { + "description": "OAuth scopes are a way to define data and permissions on data. For example,\nthere are scopes defined for \"Read-only access to Google Calendar\" and\n\"Access to Cloud Platform\". Users can consent to a scope for an application,\ngiving it permission to access that data on their behalf.\n\nOAuth scope specifications should be fairly coarse grained; a user will need\nto see and understand the text description of what your scope means.\n\nIn most cases: use one or at most two OAuth scopes for an entire family of\nproducts. If your product has multiple APIs, you should probably be sharing\nthe OAuth scope across all of those APIs.\n\nWhen you need finer grained OAuth consent screens: talk with your product\nmanagement about how developers will use them in practice.\n\nPlease note that even though each of the canonical scopes is enough for a\nrequest to be accepted and passed to the backend, a request can still fail\ndue to the backend requiring additional scopes or permissions.", + "type": "object", + "properties": { + "canonicalScopes": { + "type": "string", + "description": "The list of publicly documented OAuth scopes that are allowed access. An\nOAuth token containing any of these scopes will be accepted.\n\nExample:\n\n canonical_scopes: https://www.googleapis.com/auth/calendar,\n https://www.googleapis.com/auth/calendar.read" } - } - } - }, - "parameters": { - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" + }, + "id": "OAuthRequirements" }, - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed." + } + }, + "id": "TestIamPermissionsResponse" }, - "fields": { - "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." + "GetIamPolicyRequest": { + "properties": {}, + "id": "GetIamPolicyRequest", + "description": "Request message for `GetIamPolicy` method.", + "type": "object" }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "Usage": { + "description": "Configuration controlling usage of a service.", + "type": "object", + "properties": { + "requirements": { + "description": "Requirements that must be satisfied before a consumer project can use the\nservice. Each requirement is of the form \u003cservice.name\u003e/\u003crequirement-id\u003e;\nfor example 'serviceusage.googleapis.com/billing-enabled'.", + "items": { + "type": "string" + }, + "type": "array" + }, + "producerNotificationChannel": { + "description": "The full resource name of a channel used for sending notifications to the\nservice producer.\n\nGoogle Service Management currently only supports\n[Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification\nchannel. To use Google Cloud Pub/Sub as the channel, this must be the name\nof a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format\ndocumented in https://cloud.google.com/pubsub/docs/overview.", + "type": "string" + }, + "rules": { + "description": "A list of usage rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "UsageRule" + }, + "type": "array" + } + }, + "id": "Usage" }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "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", - "description": "Data format for response.", - "default": "json" - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "quotaUser": { - "type": "string", - "location": "query", - "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." - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - } - }, - "schemas": { "Context": { "description": "`Context` defines which contexts an API requests.\n\nExample:\n\n context:\n rules:\n - selector: \"*\"\n requested:\n - google.rpc.context.ProjectContext\n - google.rpc.context.OriginContext\n\nThe above specifies that all methods in the API request\n`google.rpc.context.ProjectContext` and\n`google.rpc.context.OriginContext`.\n\nAvailable context types are defined in package\n`google.rpc.context`.", "type": "object", "properties": { "rules": { "description": "A list of RPC context rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", "items": { "$ref": "ContextRule" - } + }, + "type": "array" } }, "id": "Context" }, - "Rule": { - "description": "A rule to be applied in a Policy.", - "type": "object", - "properties": { - "notIn": { - "type": "array", - "items": { - "type": "string" - }, - "description": "If one or more 'not_in' clauses are specified, the rule matches\nif the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.\nThe format for in and not_in entries is the same as for members in a\nBinding (see google/iam/v1/policy.proto)." - }, - "description": { - "description": "Human-readable description of the rule.", - "type": "string" - }, - "conditions": { - "description": "Additional restrictions that must be met", - "type": "array", - "items": { - "$ref": "Condition" - } - }, - "logConfig": { - "type": "array", - "items": { - "$ref": "LogConfig" - }, - "description": "The config returned to callers of tech.iam.IAM.CheckPolicy for any entries\nthat match the LOG action." - }, - "in": { - "description": "If one or more 'in' clauses are specified, the rule matches if\nthe PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "A permission is a string of form '\u003cservice\u003e.\u003cresource type\u003e.\u003cverb\u003e'\n(e.g., 'storage.buckets.list'). A value of '*' matches all permissions,\nand a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.", - "type": "array", - "items": { - "type": "string" - } - }, - "action": { - "enumDescriptions": [ - "Default no action.", - "Matching 'Entries' grant access.", - "Matching 'Entries' grant access and the caller promises to log\nthe request per the returned log_configs.", - "Matching 'Entries' deny access.", - "Matching 'Entries' deny access and the caller promises to log\nthe request per the returned log_configs.", - "Matching 'Entries' tell IAM.Check callers to generate logs." - ], - "enum": [ - "NO_ACTION", - "ALLOW", - "ALLOW_WITH_LOG", - "DENY", - "DENY_WITH_LOG", - "LOG" - ], - "description": "Required", - "type": "string" - } - }, - "id": "Rule" - }, - "LogConfig": { - "description": "Specifies what kind of log the caller must write", - "type": "object", - "properties": { - "dataAccess": { - "description": "Data access options.", - "$ref": "DataAccessOptions" - }, - "cloudAudit": { - "description": "Cloud audit options.", - "$ref": "CloudAuditOptions" - }, - "counter": { - "description": "Counter options.", - "$ref": "CounterOptions" - } - }, - "id": "LogConfig" - }, "LogDescriptor": { - "description": "A description of a log type. Example in YAML format:\n\n - name: library.googleapis.com/activity_history\n description: The history of borrowing and returning library items.\n display_name: Activity\n labels:\n - key: /customer_id\n description: Identifier of a library customer", - "type": "object", "properties": { - "labels": { - "description": "The set of labels that are available to describe a specific log entry.\nRuntime requests that contain labels not specified here are\nconsidered invalid.", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } - }, - "name": { - "description": "The name of the log. It must be less than 512 characters long and can\ninclude the following characters: upper- and lower-case alphanumeric\ncharacters [A-Za-z0-9], and punctuation characters including\nslash, underscore, hyphen, period [/_-.].", + "displayName": { + "description": "The human-readable name for this log. This information appears on\nthe user interface and should be concise.", "type": "string" }, "description": { "description": "A human-readable description of this log. This information appears in\nthe documentation and can contain details.", "type": "string" }, - "displayName": { + "labels": { + "description": "The set of labels that are available to describe a specific log entry.\nRuntime requests that contain labels not specified here are\nconsidered invalid.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + }, + "name": { "type": "string", - "description": "The human-readable name for this log. This information appears on\nthe user interface and should be concise." + "description": "The name of the log. It must be less than 512 characters long and can\ninclude the following characters: upper- and lower-case alphanumeric\ncharacters [A-Za-z0-9], and punctuation characters including\nslash, underscore, hyphen, period [/_-.]." } }, - "id": "LogDescriptor" + "id": "LogDescriptor", + "description": "A description of a log type. Example in YAML format:\n\n - name: library.googleapis.com/activity_history\n description: The history of borrowing and returning library items.\n display_name: Activity\n labels:\n - key: /customer_id\n description: Identifier of a library customer", + "type": "object" }, "ConfigFile": { + "id": "ConfigFile", "description": "Generic specification of a source configuration file", "type": "object", "properties": { - "fileContents": { - "description": "The bytes that constitute the file.", - "format": "byte", - "type": "string" - }, - "filePath": { - "description": "The file name of the configuration file (full or relative path).", - "type": "string" - }, "fileType": { "enum": [ "FILE_TYPE_UNSPECIFIED", "SERVICE_CONFIG_YAML", "OPEN_API_JSON", "OPEN_API_YAML", - "FILE_DESCRIPTOR_SET_PROTO" + "FILE_DESCRIPTOR_SET_PROTO", + "PROTO_FILE" ], "description": "The type of configuration file this represents.", "type": "string", @@ -1015,14 +179,52 @@ "YAML-specification of service.", "OpenAPI specification, serialized in JSON.", "OpenAPI specification, serialized in YAML.", - "FileDescriptorSet, generated by protoc.\n\nTo generate, use protoc with imports and source info included.\nFor an example test.proto file, the following command would put the value\nin a new file named out.pb.\n\n$protoc --include_imports --include_source_info test.proto -o out.pb" + "FileDescriptorSet, generated by protoc.\n\nTo generate, use protoc with imports and source info included.\nFor an example test.proto file, the following command would put the value\nin a new file named out.pb.\n\n$protoc --include_imports --include_source_info test.proto -o out.pb", + "Uncompiled Proto file. Used for storage and display purposes only,\ncurrently server-side compilation is not supported. Should match the\ninputs to 'protoc' command used to generated FILE_DESCRIPTOR_SET_PROTO. A\nfile of this type can only be included if at least one file of type\nFILE_DESCRIPTOR_SET_PROTO is included." ] + }, + "fileContents": { + "format": "byte", + "description": "The bytes that constitute the file.", + "type": "string" + }, + "filePath": { + "description": "The file name of the configuration file (full or relative path).", + "type": "string" + } + } + }, + "MonitoredResourceDescriptor": { + "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent APIs can support different monitored resource types. APIs generally\nprovide a `list` method that returns the monitored resource descriptors used\nby the API.", + "type": "object", + "properties": { + "labels": { + "description": "Required. A set of labels used to describe instances of this monitored\nresource type. For example, an individual Google Cloud SQL database is\nidentified by values for the labels `\"database_id\"` and `\"zone\"`.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + }, + "name": { + "description": "Optional. The resource name of the monitored resource descriptor:\n`\"projects/{project_id}/monitoredResourceDescriptors/{type}\"` where\n{type} is the value of the `type` field in this object and\n{project_id} is a project ID that provides API-specific context for\naccessing the type. APIs that do not use project information can use the\nresource name format `\"monitoredResourceDescriptors/{type}\"`.", + "type": "string" + }, + "description": { + "description": "Optional. A detailed description of the monitored resource type that might\nbe used in documentation.", + "type": "string" + }, + "displayName": { + "description": "Optional. A concise name for the monitored resource type that might be\ndisplayed in user interfaces. It should be a Title Cased Noun Phrase,\nwithout any article or other determiners. For example,\n`\"Google Cloud SQL Database\"`.", + "type": "string" + }, + "type": { + "description": "Required. The monitored resource type. For example, the type\n`\"cloudsql_database\"` represents databases in Google Cloud SQL.\nThe maximum length of this value is 256 characters.", + "type": "string" } }, - "id": "ConfigFile" + "id": "MonitoredResourceDescriptor" }, "CustomErrorRule": { - "description": "A custom error rule.", "type": "object", "properties": { "isErrorType": { @@ -1034,55 +236,13 @@ "type": "string" } }, - "id": "CustomErrorRule" - }, - "MonitoredResourceDescriptor": { - "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent APIs can support different monitored resource types. APIs generally\nprovide a `list` method that returns the monitored resource descriptors used\nby the API.", - "type": "object", - "properties": { - "labels": { - "description": "Required. A set of labels used to describe instances of this monitored\nresource type. For example, an individual Google Cloud SQL database is\nidentified by values for the labels `\"database_id\"` and `\"zone\"`.", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } - }, - "name": { - "description": "Optional. The resource name of the monitored resource descriptor:\n`\"projects/{project_id}/monitoredResourceDescriptors/{type}\"` where\n{type} is the value of the `type` field in this object and\n{project_id} is a project ID that provides API-specific context for\naccessing the type. APIs that do not use project information can use the\nresource name format `\"monitoredResourceDescriptors/{type}\"`.", - "type": "string" - }, - "displayName": { - "description": "Optional. A concise name for the monitored resource type that might be\ndisplayed in user interfaces. It should be a Title Cased Noun Phrase,\nwithout any article or other determiners. For example,\n`\"Google Cloud SQL Database\"`.", - "type": "string" - }, - "description": { - "description": "Optional. A detailed description of the monitored resource type that might\nbe used in documentation.", - "type": "string" - }, - "type": { - "description": "Required. The monitored resource type. For example, the type\n`\"cloudsql_database\"` represents databases in Google Cloud SQL.\nThe maximum length of this value is 256 characters.", - "type": "string" - } - }, - "id": "MonitoredResourceDescriptor" - }, - "CustomAuthRequirements": { - "properties": { - "provider": { - "description": "A configuration string containing connection information for the\nauthentication provider, typically formatted as a SmartService string\n(go/smartservice).", - "type": "string" - } - }, - "id": "CustomAuthRequirements", - "description": "Configuration for a custom authentication provider.", - "type": "object" + "id": "CustomErrorRule", + "description": "A custom error rule." }, "MediaDownload": { + "description": "Defines the Media configuration for a service in case of a download.\nUse this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead [][google.bytestream.RestByteStream] as an API to\nyour configuration for Bytestream methods.", + "type": "object", "properties": { - "completeNotification": { - "description": "A boolean that determines whether a notification for the completion of a\ndownload should be sent to the backend.", - "type": "boolean" - }, "enabled": { "description": "Whether download is enabled.", "type": "boolean" @@ -1091,99 +251,112 @@ "description": "DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED.\n\nSpecify name of the download service if one is used for download.", "type": "string" }, - "maxDirectDownloadSize": { - "description": "Optional maximum acceptable size for direct download.\nThe size is specified in bytes.", - "format": "int64", - "type": "string" + "completeNotification": { + "description": "A boolean that determines whether a notification for the completion of a\ndownload should be sent to the backend.", + "type": "boolean" }, "dropzone": { "description": "Name of the Scotty dropzone to use for the current API.", "type": "string" }, + "maxDirectDownloadSize": { + "format": "int64", + "description": "Optional maximum acceptable size for direct download.\nThe size is specified in bytes.", + "type": "string" + }, "useDirectDownload": { "description": "A boolean that determines if direct download from ESF should be used for\ndownload of this media.", "type": "boolean" } }, - "id": "MediaDownload", - "description": "Defines the Media configuration for a service in case of a download.\nUse this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead [][google.bytestream.RestByteStream] as an API to\nyour configuration for Bytestream methods.", - "type": "object" + "id": "MediaDownload" + }, + "CustomAuthRequirements": { + "description": "Configuration for a custom authentication provider.", + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "A configuration string containing connection information for the\nauthentication provider, typically formatted as a SmartService string\n(go/smartservice)." + } + }, + "id": "CustomAuthRequirements" }, "ChangeReport": { - "type": "object", "properties": { "configChanges": { "description": "List of changes between two service configurations.\nThe changes will be alphabetically sorted based on the identifier\nof each change.\nA ConfigChange identifier is a dot separated path to the configuration.\nExample: visibility.rules[selector='LibraryService.CreateBook'].restriction", - "type": "array", "items": { "$ref": "ConfigChange" - } + }, + "type": "array" } }, "id": "ChangeReport", - "description": "Change report associated with a particular service configuration.\n\nIt contains a list of ConfigChanges based on the comparison between\ntwo service configurations." + "description": "Change report associated with a particular service configuration.\n\nIt contains a list of ConfigChanges based on the comparison between\ntwo service configurations.", + "type": "object" }, "DisableServiceRequest": { - "description": "Request message for DisableService method.", - "type": "object", "properties": { "consumerId": { - "type": "string", - "description": "The identity of consumer resource which service disablement will be\napplied to.\n\nThe Google Service Management implementation accepts the following\nforms:\n- \"project:\u003cproject_id\u003e\"\n\nNote: this is made compatible with\ngoogle.api.servicecontrol.v1.Operation.consumer_id." + "description": "The identity of consumer resource which service disablement will be\napplied to.\n\nThe Google Service Management implementation accepts the following\nforms:\n- \"project:\u003cproject_id\u003e\"\n\nNote: this is made compatible with\ngoogle.api.servicecontrol.v1.Operation.consumer_id.", + "type": "string" } }, - "id": "DisableServiceRequest" + "id": "DisableServiceRequest", + "description": "Request message for DisableService method.", + "type": "object" }, "SubmitConfigSourceResponse": { - "id": "SubmitConfigSourceResponse", - "description": "Response message for SubmitConfigSource method.", "type": "object", "properties": { "serviceConfig": { "$ref": "Service", "description": "The generated service configuration." } - } + }, + "id": "SubmitConfigSourceResponse", + "description": "Response message for SubmitConfigSource method." }, "MediaUpload": { "description": "Defines the Media configuration for a service in case of an upload.\nUse this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead [][google.bytestream.RestByteStream] as an API to\nyour configuration for Bytestream methods.", "type": "object", "properties": { - "mimeTypes": { - "description": "An array of mimetype patterns. Esf will only accept uploads that match one\nof the given patterns.", - "type": "array", - "items": { - "type": "string" - } - }, - "maxSize": { - "description": "Optional maximum acceptable size for an upload.\nThe size is specified in bytes.", - "format": "int64", - "type": "string" - }, - "completeNotification": { - "description": "A boolean that determines whether a notification for the completion of an\nupload should be sent to the backend. These notifications will not be seen\nby the client and will not consume quota.", + "enabled": { + "description": "Whether upload is enabled.", "type": "boolean" }, "progressNotification": { "description": "Whether to receive a notification for progress changes of media upload.", "type": "boolean" }, - "enabled": { - "description": "Whether upload is enabled.", + "completeNotification": { + "description": "A boolean that determines whether a notification for the completion of an\nupload should be sent to the backend. These notifications will not be seen\nby the client and will not consume quota.", "type": "boolean" }, "dropzone": { - "description": "Name of the Scotty dropzone to use for the current API.", - "type": "string" + "type": "string", + "description": "Name of the Scotty dropzone to use for the current API." }, "startNotification": { - "type": "boolean", - "description": "Whether to receive a notification on the start of media upload." + "description": "Whether to receive a notification on the start of media upload.", + "type": "boolean" }, "uploadService": { "description": "DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED.\n\nSpecify name of the upload service if one is used for upload.", "type": "string" + }, + "mimeTypes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "An array of mimetype patterns. Esf will only accept uploads that match one\nof the given patterns." + }, + "maxSize": { + "format": "int64", + "description": "Optional maximum acceptable size for an upload.\nThe size is specified in bytes.", + "type": "string" } }, "id": "MediaUpload" @@ -1193,77 +366,97 @@ "type": "object", "properties": { "description": { - "description": "Useful description for why this advice was applied and what actions should\nbe taken to mitigate any implied risks.", - "type": "string" + "type": "string", + "description": "Useful description for why this advice was applied and what actions should\nbe taken to mitigate any implied risks." } }, "id": "Advice" }, "ManagedService": { - "description": "The full representation of a Service that is managed by\nGoogle Service Management.", "type": "object", "properties": { "producerProjectId": { - "description": "ID of the project that produces and owns this service.", - "type": "string" + "type": "string", + "description": "ID of the project that produces and owns this service." }, "serviceName": { "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements.", "type": "string" } }, - "id": "ManagedService" + "id": "ManagedService", + "description": "The full representation of a Service that is managed by\nGoogle Service Management." }, "UsageRule": { + "type": "object", "properties": { "selector": { "description": "Selects the methods to which this rule applies. Use '*' to indicate all\nmethods in all APIs.\n\nRefer to selector for syntax details.", "type": "string" }, + "skipServiceControl": { + "description": "True, if the method should skip service control. If so, no control plane\nfeature (like quota and billing) will be enabled.", + "type": "boolean" + }, "allowUnregisteredCalls": { "description": "True, if the method allows unregistered calls; false otherwise.", "type": "boolean" } }, "id": "UsageRule", - "description": "Usage configuration rules for the service.\n\nNOTE: Under development.\n\n\nUse this rule to configure unregistered calls for the service. Unregistered\ncalls are calls that do not contain consumer project identity.\n(Example: calls that do not contain an API key).\nBy default, API methods do not allow unregistered calls, and each method call\nmust be identified by a consumer project identity. Use this rule to\nallow/disallow unregistered calls.\n\nExample of an API that wants to allow unregistered calls for entire service.\n\n usage:\n rules:\n - selector: \"*\"\n allow_unregistered_calls: true\n\nExample of a method that wants to allow unregistered calls.\n\n usage:\n rules:\n - selector: \"google.example.library.v1.LibraryService.CreateBook\"\n allow_unregistered_calls: true", - "type": "object" - }, - "AuthRequirement": { - "description": "User-defined authentication requirements, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).", - "type": "object", - "properties": { - "audiences": { - "type": "string", - "description": "NOTE: This will be deprecated soon, once AuthProvider.audiences is\nimplemented and accepted in all the runtime components.\n\nThe list of JWT\n[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).\nthat are allowed to access. A JWT containing any of these audiences will\nbe accepted. When this setting is absent, only JWTs with audience\n\"https://Service_name/API_name\"\nwill be accepted. For example, if no audiences are in the setting,\nLibraryService API will only accept JWTs with the following audience\n\"https://library-example.googleapis.com/google.example.library.v1.LibraryService\".\n\nExample:\n\n audiences: bookstore_android.apps.googleusercontent.com,\n bookstore_web.apps.googleusercontent.com" - }, - "providerId": { - "description": "id from authentication provider.\n\nExample:\n\n provider_id: bookstore_auth", - "type": "string" - } - }, - "id": "AuthRequirement" + "description": "Usage configuration rules for the service.\n\nNOTE: Under development.\n\n\nUse this rule to configure unregistered calls for the service. Unregistered\ncalls are calls that do not contain consumer project identity.\n(Example: calls that do not contain an API key).\nBy default, API methods do not allow unregistered calls, and each method call\nmust be identified by a consumer project identity. Use this rule to\nallow/disallow unregistered calls.\n\nExample of an API that wants to allow unregistered calls for entire service.\n\n usage:\n rules:\n - selector: \"*\"\n allow_unregistered_calls: true\n\nExample of a method that wants to allow unregistered calls.\n\n usage:\n rules:\n - selector: \"google.example.library.v1.LibraryService.CreateBook\"\n allow_unregistered_calls: true" }, "TrafficPercentStrategy": { - "description": "Strategy that specifies how Google Service Control should select\ndifferent\nversions of service configurations based on traffic percentage.\n\nOne example of how to gradually rollout a new service configuration using\nthis\nstrategy:\nDay 1\n\n Rollout {\n id: \"example.googleapis.com/rollout_20160206\"\n traffic_percent_strategy {\n percentages: {\n \"example.googleapis.com/20160201\": 70.00\n \"example.googleapis.com/20160206\": 30.00\n }\n }\n }\n\nDay 2\n\n Rollout {\n id: \"example.googleapis.com/rollout_20160207\"\n traffic_percent_strategy: {\n percentages: {\n \"example.googleapis.com/20160206\": 100.00\n }\n }\n }", + "description": "Strategy that specifies how clients of Google Service Controller want to\nsend traffic to use different config versions. This is generally\nused by API proxy to split traffic based on your configured precentage for\neach config version.\n\nOne example of how to gradually rollout a new service configuration using\nthis\nstrategy:\nDay 1\n\n Rollout {\n id: \"example.googleapis.com/rollout_20160206\"\n traffic_percent_strategy {\n percentages: {\n \"example.googleapis.com/20160201\": 70.00\n \"example.googleapis.com/20160206\": 30.00\n }\n }\n }\n\nDay 2\n\n Rollout {\n id: \"example.googleapis.com/rollout_20160207\"\n traffic_percent_strategy: {\n percentages: {\n \"example.googleapis.com/20160206\": 100.00\n }\n }\n }", "type": "object", "properties": { "percentages": { + "type": "object", "additionalProperties": { - "format": "double", - "type": "number" + "type": "number", + "format": "double" }, - "description": "Maps service configuration IDs to their corresponding traffic percentage.\nKey is the service configuration ID, Value is the traffic percentage\nwhich must be greater than 0.0 and the sum must equal to 100.0.", - "type": "object" + "description": "Maps service configuration IDs to their corresponding traffic percentage.\nKey is the service configuration ID, Value is the traffic percentage\nwhich must be greater than 0.0 and the sum must equal to 100.0." } }, "id": "TrafficPercentStrategy" }, - "Documentation": { - "id": "Documentation", - "description": "`Documentation` provides the information for describing a service.\n\nExample:\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: \u003e\n The Google Calendar API gives access\n to most calendar features.\n pages:\n - name: Overview\n content: (== include google/foo/overview.md ==)\n - name: Tutorial\n content: (== include google/foo/tutorial.md ==)\n subpages;\n - name: Java\n content: (== include google/foo/tutorial_java.md ==)\n rules:\n - selector: google.calendar.Calendar.Get\n description: \u003e\n ...\n - selector: google.calendar.Calendar.Put\n description: \u003e\n ...\n\u003c/code\u003e\u003c/pre\u003e\nDocumentation is provided in markdown syntax. In addition to\nstandard markdown features, definition lists, tables and fenced\ncode blocks are supported. Section headers can be provided and are\ninterpreted relative to the section nesting of the context where\na documentation fragment is embedded.\n\nDocumentation from the IDL is merged with documentation defined\nvia the config at normalization time, where documentation provided\nby config rules overrides IDL provided.\n\nA number of constructs specific to the API platform are supported\nin documentation text.\n\nIn order to reference a proto element, the following\nnotation can be used:\n\u003cpre\u003e\u003ccode\u003e[fully.qualified.proto.name][]\u003c/code\u003e\u003c/pre\u003e\nTo override the display text used for the link, this can be used:\n\u003cpre\u003e\u003ccode\u003e[display text][fully.qualified.proto.name]\u003c/code\u003e\u003c/pre\u003e\nText can be excluded from doc using the following notation:\n\u003cpre\u003e\u003ccode\u003e(-- internal comment --)\u003c/code\u003e\u003c/pre\u003e\nComments can be made conditional using a visibility label. The below\ntext will be only rendered if the `BETA` label is available:\n\u003cpre\u003e\u003ccode\u003e(--BETA: comment for BETA users --)\u003c/code\u003e\u003c/pre\u003e\nA few directives are available in documentation. Note that\ndirectives must appear on a single line to be properly\nidentified. The `include` directive includes a markdown file from\nan external source:\n\u003cpre\u003e\u003ccode\u003e(== include path/to/file ==)\u003c/code\u003e\u003c/pre\u003e\nThe `resource_for` directive marks a message to be the resource of\na collection in REST view. If it is not specified, tools attempt\nto infer the resource from the operations in a collection:\n\u003cpre\u003e\u003ccode\u003e(== resource_for v1.shelves.books ==)\u003c/code\u003e\u003c/pre\u003e\nThe directive `suppress_warning` does not directly affect documentation\nand is documented together with service config validation.", + "AuthRequirement": { + "id": "AuthRequirement", + "description": "User-defined authentication requirements, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).", "type": "object", "properties": { + "providerId": { + "description": "id from authentication provider.\n\nExample:\n\n provider_id: bookstore_auth", + "type": "string" + }, + "audiences": { + "type": "string", + "description": "NOTE: This will be deprecated soon, once AuthProvider.audiences is\nimplemented and accepted in all the runtime components.\n\nThe list of JWT\n[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).\nthat are allowed to access. A JWT containing any of these audiences will\nbe accepted. When this setting is absent, only JWTs with audience\n\"https://Service_name/API_name\"\nwill be accepted. For example, if no audiences are in the setting,\nLibraryService API will only accept JWTs with the following audience\n\"https://library-example.googleapis.com/google.example.library.v1.LibraryService\".\n\nExample:\n\n audiences: bookstore_android.apps.googleusercontent.com,\n bookstore_web.apps.googleusercontent.com" + } + } + }, + "Documentation": { + "type": "object", + "properties": { + "overview": { + "description": "Declares a single overview page. For example:\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: ...\n overview: (== include overview.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nThis is a shortcut for the following declaration (using pages style):\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: ...\n pages:\n - name: Overview\n content: (== include overview.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nNote: you cannot specify both `overview` field and `pages` field.", + "type": "string" + }, + "rules": { + "items": { + "$ref": "DocumentationRule" + }, + "type": "array", + "description": "A list of documentation rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." + }, + "pages": { + "description": "The top level pages for the documentation set.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, "summary": { "description": "A short summary of what the service does. Can only be provided by\nplain text.", "type": "string" @@ -1271,115 +464,23 @@ "documentationRootUrl": { "description": "The URL to the root of documentation.", "type": "string" - }, - "rules": { - "description": "A list of documentation rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", - "items": { - "$ref": "DocumentationRule" - } - }, - "overview": { - "description": "Declares a single overview page. For example:\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: ...\n overview: (== include overview.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nThis is a shortcut for the following declaration (using pages style):\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: ...\n pages:\n - name: Overview\n content: (== include overview.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nNote: you cannot specify both `overview` field and `pages` field.", - "type": "string" - }, - "pages": { - "description": "The top level pages for the documentation set.", - "type": "array", - "items": { - "$ref": "Page" - } - } - } - }, - "Condition": { - "description": "A condition to be met.", - "type": "object", - "properties": { - "svc": { - "description": "Trusted attributes discharged by the service.", - "type": "string" - }, - "sys": { - "enumDescriptions": [ - "Default non-attribute type", - "Region of the resource", - "Service name", - "Resource name", - "IP address of the caller" - ], - "enum": [ - "NO_ATTR", - "REGION", - "SERVICE", - "NAME", - "IP" - ], - "description": "Trusted attributes supplied by any service that owns resources and uses\nthe IAM system for access control.", - "type": "string" - }, - "value": { - "description": "DEPRECATED. Use 'values' instead.", - "type": "string" - }, - "values": { - "description": "The objects of the condition. This is mutually exclusive with 'value'.", - "type": "array", - "items": { - "type": "string" - } - }, - "iam": { - "description": "Trusted attributes supplied by the IAM system.", - "type": "string", - "enumDescriptions": [ - "Default non-attribute.", - "Either principal or (if present) authority selector.", - "The principal (even if an authority selector is present), which\nmust only be used for attribution, not authorization.", - "An approver (distinct from the requester) that has authorized this\nrequest.\nWhen used with IN, the condition indicates that one of the approvers\nassociated with the request matches the specified principal, or is a\nmember of the specified group. Approvers can only grant additional\naccess, and are thus only used in a strictly positive context\n(e.g. ALLOW/IN or DENY/NOT_IN).\nSee: go/rpc-security-policy-dynamicauth.", - "What types of justifications have been supplied with this request.\nString values should match enum names from tech.iam.JustificationType,\ne.g. \"MANUAL_STRING\". It is not permitted to grant access based on\nthe *absence* of a justification, so justification conditions can only\nbe used in a \"positive\" context (e.g., ALLOW/IN or DENY/NOT_IN).\n\nMultiple justifications, e.g., a Buganizer ID and a manually-entered\nreason, are normal and supported." - ], - "enum": [ - "NO_ATTR", - "AUTHORITY", - "ATTRIBUTION", - "APPROVER", - "JUSTIFICATION_TYPE" - ] - }, - "op": { - "enumDescriptions": [ - "Default no-op.", - "DEPRECATED. Use IN instead.", - "DEPRECATED. Use NOT_IN instead.", - "The condition is true if the subject (or any element of it if it is\na set) matches any of the supplied values.", - "The condition is true if the subject (or every element of it if it is\na set) matches none of the supplied values.", - "Subject is discharged" - ], - "enum": [ - "NO_OP", - "EQUALS", - "NOT_EQUALS", - "IN", - "NOT_IN", - "DISCHARGED" - ], - "description": "An operator to apply the subject with.", - "type": "string" } }, - "id": "Condition" + "id": "Documentation", + "description": "`Documentation` provides the information for describing a service.\n\nExample:\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: \u003e\n The Google Calendar API gives access\n to most calendar features.\n pages:\n - name: Overview\n content: (== include google/foo/overview.md ==)\n - name: Tutorial\n content: (== include google/foo/tutorial.md ==)\n subpages;\n - name: Java\n content: (== include google/foo/tutorial_java.md ==)\n rules:\n - selector: google.calendar.Calendar.Get\n description: \u003e\n ...\n - selector: google.calendar.Calendar.Put\n description: \u003e\n ...\n\u003c/code\u003e\u003c/pre\u003e\nDocumentation is provided in markdown syntax. In addition to\nstandard markdown features, definition lists, tables and fenced\ncode blocks are supported. Section headers can be provided and are\ninterpreted relative to the section nesting of the context where\na documentation fragment is embedded.\n\nDocumentation from the IDL is merged with documentation defined\nvia the config at normalization time, where documentation provided\nby config rules overrides IDL provided.\n\nA number of constructs specific to the API platform are supported\nin documentation text.\n\nIn order to reference a proto element, the following\nnotation can be used:\n\u003cpre\u003e\u003ccode\u003e[fully.qualified.proto.name][]\u003c/code\u003e\u003c/pre\u003e\nTo override the display text used for the link, this can be used:\n\u003cpre\u003e\u003ccode\u003e[display text][fully.qualified.proto.name]\u003c/code\u003e\u003c/pre\u003e\nText can be excluded from doc using the following notation:\n\u003cpre\u003e\u003ccode\u003e(-- internal comment --)\u003c/code\u003e\u003c/pre\u003e\nComments can be made conditional using a visibility label. The below\ntext will be only rendered if the `BETA` label is available:\n\u003cpre\u003e\u003ccode\u003e(--BETA: comment for BETA users --)\u003c/code\u003e\u003c/pre\u003e\nA few directives are available in documentation. Note that\ndirectives must appear on a single line to be properly\nidentified. The `include` directive includes a markdown file from\nan external source:\n\u003cpre\u003e\u003ccode\u003e(== include path/to/file ==)\u003c/code\u003e\u003c/pre\u003e\nThe `resource_for` directive marks a message to be the resource of\na collection in REST view. If it is not specified, tools attempt\nto infer the resource from the operations in a collection:\n\u003cpre\u003e\u003ccode\u003e(== resource_for v1.shelves.books ==)\u003c/code\u003e\u003c/pre\u003e\nThe directive `suppress_warning` does not directly affect documentation\nand is documented together with service config validation." }, "AuditLogConfig": { + "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", "type": "object", "properties": { + "exemptedMembers": { + "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members.", + "items": { + "type": "string" + }, + "type": "array" + }, "logType": { - "enumDescriptions": [ - "Default case. Should never be this.", - "Admin reads. Example: CloudIAM getIamPolicy", - "Data writes. Example: CloudSQL Users create", - "Data reads. Example: CloudSQL Users list" - ], "enum": [ "LOG_TYPE_UNSPECIFIED", "ADMIN_READ", @@ -1387,44 +488,47 @@ "DATA_READ" ], "description": "The log type that this config enables.", - "type": "string" - }, - "exemptedMembers": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members." + "type": "string", + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ] } }, - "id": "AuditLogConfig", - "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging." + "id": "AuditLogConfig" }, "ConfigSource": { - "id": "ConfigSource", "description": "Represents a source file which is used to generate the service configuration\ndefined by `google.api.Service`.", "type": "object", "properties": { - "id": { - "description": "A unique ID for a specific instance of this message, typically assigned\nby the client for tracking purpose. If empty, the server may choose to\ngenerate one instead.", - "type": "string" - }, "files": { - "type": "array", + "description": "Set of source configuration files that are used to generate a service\nconfiguration (`google.api.Service`).", "items": { "$ref": "ConfigFile" }, - "description": "Set of source configuration files that are used to generate a service\nconfiguration (`google.api.Service`)." + "type": "array" + }, + "id": { + "description": "A unique ID for a specific instance of this message, typically assigned\nby the client for tracking purpose. If empty, the server may choose to\ngenerate one instead.", + "type": "string" } - } + }, + "id": "ConfigSource" }, "BackendRule": { "description": "A backend rule provides configuration for an individual API element.", "type": "object", "properties": { - "minDeadline": { - "description": "Minimum deadline in seconds needed for this method. Calls having deadline\nvalue lower than this will be rejected.", + "deadline": { "format": "double", + "description": "The number of seconds to wait for a response from a request. The default\ndeadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds.", + "type": "number" + }, + "minDeadline": { + "format": "double", + "description": "Minimum deadline in seconds needed for this method. Calls having deadline\nvalue lower than this will be rejected.", "type": "number" }, "address": { @@ -1434,11 +538,6 @@ "selector": { "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", "type": "string" - }, - "deadline": { - "description": "The number of seconds to wait for a response from a request. The\ndefault depends on the deployment context.", - "format": "double", - "type": "number" } }, "id": "BackendRule" @@ -1447,34 +546,33 @@ "description": "Authentication rules for the service.\n\nBy default, if a method has any authentication requirements, every request\nmust include a valid credential matching one of the requirements.\nIt's an error to include more than one kind of credential in a single\nrequest.\n\nIf a method doesn't have any auth requirements, request credentials will be\nignored.", "type": "object", "properties": { - "requirements": { - "description": "Requirements for additional authentication providers.", - "type": "array", - "items": { - "$ref": "AuthRequirement" - } + "allowWithoutCredential": { + "type": "boolean", + "description": "Whether to allow requests without a credential. The credential can be\nan OAuth token, Google cookies (first-party auth) or EndUserCreds.\n\nFor requests without credentials, if the service control environment is\nspecified, each incoming request **must** be associated with a service\nconsumer. This can be done by passing an API key that belongs to a consumer\nproject." }, "selector": { - "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", - "type": "string" - }, - "allowWithoutCredential": { - "description": "Whether to allow requests without a credential. The credential can be\nan OAuth token, Google cookies (first-party auth) or EndUserCreds.\n\nFor requests without credentials, if the service control environment is\nspecified, each incoming request **must** be associated with a service\nconsumer. This can be done by passing an API key that belongs to a consumer\nproject.", - "type": "boolean" - }, - "oauth": { - "$ref": "OAuthRequirements", - "description": "The requirements for OAuth credentials." + "type": "string", + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details." }, "customAuth": { "$ref": "CustomAuthRequirements", "description": "Configuration for custom authentication." + }, + "oauth": { + "description": "The requirements for OAuth credentials.", + "$ref": "OAuthRequirements" + }, + "requirements": { + "items": { + "$ref": "AuthRequirement" + }, + "type": "array", + "description": "Requirements for additional authentication providers." } }, "id": "AuthenticationRule" }, "UndeleteServiceResponse": { - "description": "Response message for UndeleteService method.", "type": "object", "properties": { "service": { @@ -1482,71 +580,59 @@ "description": "Revived service resource." } }, - "id": "UndeleteServiceResponse" + "id": "UndeleteServiceResponse", + "description": "Response message for UndeleteService method." }, "Policy": { "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", "type": "object", "properties": { - "iamOwned": { - "type": "boolean" - }, - "rules": { - "type": "array", - "items": { - "$ref": "Rule" - }, - "description": "If more than one rule is specified, the rules are applied in the following\nmanner:\n- All matching LOG rules are always applied.\n- If any DENY/DENY_WITH_LOG rule matches, permission is denied.\n Logging will be applied if one or more matching rule requires logging.\n- Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is\n granted.\n Logging will be applied if one or more matching rule requires logging.\n- Otherwise, if no rule applies, permission is denied." - }, "version": { - "description": "Version of the `Policy`. The default version is 0.", "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", "type": "integer" }, "auditConfigs": { - "type": "array", + "description": "Specifies cloud audit logging configuration for this policy.", "items": { "$ref": "AuditConfig" }, - "description": "Specifies cloud audit logging configuration for this policy." + "type": "array" }, "bindings": { - "description": "Associates a list of `members` to a `role`.\nMultiple `bindings` must not be specified for the same `role`.\n`bindings` with no members will result in an error.", - "type": "array", + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", "items": { "$ref": "Binding" - } + }, + "type": "array" + }, + "iamOwned": { + "type": "boolean" }, "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", "type": "string" } }, "id": "Policy" }, "Api": { - "description": "Api is a light-weight descriptor for a protocol buffer service.", + "description": "Api is a light-weight descriptor for an API Interface.\n\nInterfaces are also described as \"protocol buffer services\" in some contexts,\nsuch as by the \"service\" keyword in a .proto file, but they are different\nfrom API Services, which represent a concrete implementation of an interface\nas opposed to simply a description of methods and bindings. They are also\nsometimes simply referred to as \"APIs\" in other contexts, such as the name of\nthis message itself. See https://cloud.google.com/apis/design/glossary for\ndetailed terminology.", "type": "object", "properties": { "methods": { - "type": "array", "items": { "$ref": "Method" }, - "description": "The methods of this api, in unspecified order." + "type": "array", + "description": "The methods of this interface, in unspecified order." }, "name": { - "description": "The fully qualified name of this api, including package name\nfollowed by the api's simple name.", + "description": "The fully qualified name of this interface, including package name\nfollowed by the interface's simple name.", "type": "string" }, - "sourceContext": { - "$ref": "SourceContext", - "description": "Source context for the protocol buffer service represented by this\nmessage." - }, "syntax": { - "description": "The source syntax of the service.", - "type": "string", "enumDescriptions": [ "Syntax `proto2`.", "Syntax `proto3`." @@ -1554,71 +640,71 @@ "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" - ] + ], + "description": "The source syntax of the service.", + "type": "string" + }, + "sourceContext": { + "description": "Source context for the protocol buffer service represented by this\nmessage.", + "$ref": "SourceContext" }, "version": { - "description": "A version string for this api. If specified, must have the form\n`major-version.minor-version`, as in `1.10`. If the minor version\nis omitted, it defaults to zero. If the entire version field is\nempty, the major version is derived from the package name, as\noutlined below. If the field is not empty, the version in the\npackage name will be verified to be consistent with what is\nprovided here.\n\nThe versioning schema uses [semantic\nversioning](http://semver.org) where the major version number\nindicates a breaking change and the minor version an additive,\nnon-breaking change. Both version numbers are signals to users\nwhat to expect from different versions, and should be carefully\nchosen based on the product plan.\n\nThe major version is also reflected in the package name of the\nAPI, which must end in `v\u003cmajor-version\u003e`, as in\n`google.feature.v1`. For major versions 0 and 1, the suffix can\nbe omitted. Zero major versions must only be used for\nexperimental, none-GA apis.\n", + "description": "A version string for this interface. If specified, must have the form\n`major-version.minor-version`, as in `1.10`. If the minor version is\nomitted, it defaults to zero. If the entire version field is empty, the\nmajor version is derived from the package name, as outlined below. If the\nfield is not empty, the version in the package name will be verified to be\nconsistent with what is provided here.\n\nThe versioning schema uses [semantic\nversioning](http://semver.org) where the major version number\nindicates a breaking change and the minor version an additive,\nnon-breaking change. Both version numbers are signals to users\nwhat to expect from different versions, and should be carefully\nchosen based on the product plan.\n\nThe major version is also reflected in the package name of the\ninterface, which must end in `v\u003cmajor-version\u003e`, as in\n`google.feature.v1`. For major versions 0 and 1, the suffix can\nbe omitted. Zero major versions must only be used for\nexperimental, non-GA interfaces.\n", "type": "string" }, "mixins": { - "description": "Included APIs. See Mixin.", - "type": "array", + "description": "Included interfaces. See Mixin.", "items": { "$ref": "Mixin" - } + }, + "type": "array" }, "options": { - "description": "Any metadata attached to the API.", - "type": "array", + "description": "Any metadata attached to the interface.", "items": { "$ref": "Option" - } + }, + "type": "array" } }, "id": "Api" }, - "DataAccessOptions": { - "description": "Write a Data Access (Gin) log", - "type": "object", - "properties": {}, - "id": "DataAccessOptions" - }, "MetricRule": { - "description": "Bind API methods to metrics. Binding a method to a metric causes that\nmetric's configured quota, billing, and monitoring behaviors to apply to the\nmethod call.\n\nUsed by metric-based quotas only.", + "id": "MetricRule", + "description": "Bind API methods to metrics. Binding a method to a metric causes that\nmetric's configured quota behaviors to apply to the method call.", "type": "object", "properties": { - "selector": { - "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", - "type": "string" - }, "metricCosts": { "additionalProperties": { - "type": "string", - "format": "int64" + "format": "int64", + "type": "string" }, "description": "Metrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.", "type": "object" + }, + "selector": { + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" } - }, - "id": "MetricRule" + } }, "Authentication": { "description": "`Authentication` defines the authentication configuration for an API.\n\nExample for an API targeted for external use:\n\n name: calendar.googleapis.com\n authentication:\n providers:\n - id: google_calendar_auth\n jwks_uri: https://www.googleapis.com/oauth2/v1/certs\n issuer: https://securetoken.google.com\n rules:\n - selector: \"*\"\n requirements:\n provider_id: google_calendar_auth", "type": "object", "properties": { "providers": { - "description": "Defines a set of authentication providers that a service supports.", - "type": "array", "items": { "$ref": "AuthProvider" - } + }, + "type": "array", + "description": "Defines a set of authentication providers that a service supports." }, "rules": { - "description": "A list of authentication rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", "items": { "$ref": "AuthenticationRule" - } + }, + "type": "array", + "description": "A list of authentication rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." } }, "id": "Authentication" @@ -1628,16 +714,16 @@ "type": "object", "properties": { "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", - "type": "boolean" + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable." }, "response": { - "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - } + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`." }, "name": { "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", @@ -1649,8 +735,8 @@ }, "metadata": { "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." }, "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", "type": "object" @@ -1659,8 +745,16 @@ "id": "Operation" }, "Page": { + "description": "Represents a documentation page. A page can contain subpages to represent\nnested documentation set structure.", "type": "object", "properties": { + "subpages": { + "description": "Subpages of this page. The order of subpages specified here will be\nhonored in the generated docset.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, "name": { "description": "The name of the page. It will be used as an identity of the page to\ngenerate URI of the page, text of the link to this page in navigation,\netc. The full page name (start from the root page name to this page\nconcatenated with `.`) can be used as reference to the page in your\ndocumentation. For example:\n\u003cpre\u003e\u003ccode\u003epages:\n- name: Tutorial\n content: (== include tutorial.md ==)\n subpages:\n - name: Java\n content: (== include tutorial_java.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nYou can reference `Java` page using Markdown reference link syntax:\n`Java`.", "type": "string" @@ -1668,23 +762,17 @@ "content": { "description": "The Markdown content of the page. You can use \u003ccode\u003e(== include {path} ==)\u003c/code\u003e\nto include content from a Markdown file.", "type": "string" - }, - "subpages": { - "description": "Subpages of this page. The order of subpages specified here will be\nhonored in the generated docset.", - "type": "array", - "items": { - "$ref": "Page" - } } }, - "id": "Page", - "description": "Represents a documentation page. A page can contain subpages to represent\nnested documentation set structure." + "id": "Page" }, "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", "properties": { "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, "message": { @@ -1692,20 +780,18 @@ "type": "string" }, "details": { - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - } + }, + "type": "object" }, - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use." + "type": "array" } }, - "id": "Status", - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object" + "id": "Status" }, "Binding": { "description": "Associates `members` with a `role`.", @@ -1713,20 +799,39 @@ "properties": { "members": { "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "role": { "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", "type": "string" + }, + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently.\nThis field is GOOGLE_INTERNAL." } }, "id": "Binding" }, "AuthProvider": { + "id": "AuthProvider", + "description": "Configuration for an anthentication provider, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).", + "type": "object", "properties": { + "authorizationUrl": { + "description": "Redirect URL if JWT token is required but no present or is expired.\nImplement authorizationUrl of securityDefinitions in OpenAPI spec.", + "type": "string" + }, + "issuer": { + "description": "Identifies the principal that issued the JWT. See\nhttps://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1\nUsually a URL or an email address.\n\nExample: https://securetoken.google.com\nExample: 1234567-compute@developer.gserviceaccount.com", + "type": "string" + }, + "id": { + "description": "The unique identifier of the auth provider. It will be referred to by\n`AuthRequirement.provider_id`.\n\nExample: \"bookstore_auth\".", + "type": "string" + }, "jwksUri": { "description": "URL of the provider's public key set to validate signature of the JWT. See\n[OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).\nOptional if the key set document:\n - can be retrieved from\n [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html\n of the issuer.\n - can be inferred from the email domain of the issuer (e.g. a Google service account).\n\nExample: https://www.googleapis.com/oauth2/v1/certs", "type": "string" @@ -1734,74 +839,63 @@ "audiences": { "description": "The list of JWT\n[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).\nthat are allowed to access. A JWT containing any of these audiences will\nbe accepted. When this setting is absent, only JWTs with audience\n\"https://Service_name/API_name\"\nwill be accepted. For example, if no audiences are in the setting,\nLibraryService API will only accept JWTs with the following audience\n\"https://library-example.googleapis.com/google.example.library.v1.LibraryService\".\n\nExample:\n\n audiences: bookstore_android.apps.googleusercontent.com,\n bookstore_web.apps.googleusercontent.com", "type": "string" - }, - "id": { - "type": "string", - "description": "The unique identifier of the auth provider. It will be referred to by\n`AuthRequirement.provider_id`.\n\nExample: \"bookstore_auth\"." - }, - "issuer": { - "description": "Identifies the principal that issued the JWT. See\nhttps://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1\nUsually a URL or an email address.\n\nExample: https://securetoken.google.com\nExample: 1234567-compute@developer.gserviceaccount.com", - "type": "string" } - }, - "id": "AuthProvider", - "description": "Configuration for an anthentication provider, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).", - "type": "object" + } }, "Service": { "description": "`Service` is the root object of Google service configuration schema. It\ndescribes basic information about a service, such as the name and the\ntitle, and delegates other aspects to sub-sections. Each sub-section is\neither a proto message or a repeated proto message that configures a\nspecific aspect, such as auth. See each proto message definition for details.\n\nExample:\n\n type: google.api.Service\n config_version: 3\n name: calendar.googleapis.com\n title: Google Calendar API\n apis:\n - name: google.calendar.v3.Calendar\n authentication:\n providers:\n - id: google_calendar_auth\n jwks_uri: https://www.googleapis.com/oauth2/v1/certs\n issuer: https://securetoken.google.com\n rules:\n - selector: \"*\"\n requirements:\n provider_id: google_calendar_auth", "type": "object", "properties": { "usage": { - "$ref": "Usage", - "description": "Configuration controlling usage of this service." + "description": "Configuration controlling usage of this service.", + "$ref": "Usage" }, "metrics": { "description": "Defines the metrics used by this service.", - "type": "array", "items": { "$ref": "MetricDescriptor" - } + }, + "type": "array" }, "authentication": { "$ref": "Authentication", "description": "Auth configuration." }, "experimental": { - "$ref": "Experimental", - "description": "Experimental configuration." + "description": "Experimental configuration.", + "$ref": "Experimental" }, "control": { - "description": "Configuration for the service control plane.", - "$ref": "Control" + "$ref": "Control", + "description": "Configuration for the service control plane." }, "configVersion": { - "type": "integer", - "description": "The version of the service configuration. The config version may\ninfluence interpretation of the configuration, for example, to\ndetermine defaults. This is documented together with applicable\noptions. The current default for the config version itself is `3`.", - "format": "uint32" + "format": "uint32", + "description": "The semantic version of the service configuration. The config version\naffects the interpretation of the service configuration. For example,\ncertain features are enabled by default for certain config versions.\nThe latest config version is `3`.", + "type": "integer" }, "monitoring": { - "description": "Monitoring configuration.", - "$ref": "Monitoring" + "$ref": "Monitoring", + "description": "Monitoring configuration." + }, + "producerProjectId": { + "type": "string", + "description": "The Google project that owns this service." }, "systemTypes": { "description": "A list of all proto message types included in this API service.\nIt serves similar purpose as [google.api.Service.types], except that\nthese types are not needed by user-defined APIs. Therefore, they will not\nshow up in the generated discovery doc. This field should only be used\nto define system APIs in ESF.", - "type": "array", "items": { "$ref": "Type" - } - }, - "producerProjectId": { - "description": "The id of the Google developer project that owns the service.\nMembers of this project can manage the service configuration,\nmanage consumption of the service, etc.", - "type": "string" + }, + "type": "array" }, "visibility": { "description": "API visibility configuration.", "$ref": "Visibility" }, "quota": { - "description": "Quota configuration.", - "$ref": "Quota" + "$ref": "Quota", + "description": "Quota configuration." }, "name": { "description": "The DNS address at which this service is available,\ne.g. `calendar.googleapis.com`.", @@ -1812,79 +906,79 @@ "description": "Custom error configuration." }, "title": { - "description": "The product title associated with this service.", + "description": "The product title for this service.", "type": "string" }, "endpoints": { "description": "Configuration for network endpoints. If this is empty, then an endpoint\nwith the same name as the service is automatically generated to service all\ndefined APIs.", - "type": "array", "items": { "$ref": "Endpoint" - } - }, - "logs": { - "description": "Defines the logs used by this service.", - "type": "array", - "items": { - "$ref": "LogDescriptor" - } + }, + "type": "array" }, "apis": { "description": "A list of API interfaces exported by this service. Only the `name` field\nof the google.protobuf.Api needs to be provided by the configuration\nauthor, as the remaining fields will be derived from the IDL during the\nnormalization process. It is an error to specify an API interface here\nwhich cannot be resolved against the associated IDL files.", - "type": "array", "items": { "$ref": "Api" - } + }, + "type": "array" + }, + "logs": { + "description": "Defines the logs used by this service.", + "items": { + "$ref": "LogDescriptor" + }, + "type": "array" }, "types": { "description": "A list of all proto message types included in this API service.\nTypes referenced directly or indirectly by the `apis` are\nautomatically included. Messages which are not referenced but\nshall be included, such as types used by the `google.protobuf.Any` type,\nshould be listed here by name. Example:\n\n types:\n - name: google.protobuf.Int32", - "type": "array", "items": { "$ref": "Type" - } + }, + "type": "array" }, "sourceInfo": { - "description": "Output only. The source information for this configuration if available.", - "$ref": "SourceInfo" + "$ref": "SourceInfo", + "description": "Output only. The source information for this configuration if available." }, "http": { "$ref": "Http", "description": "HTTP configuration." }, "backend": { - "description": "API backend configuration.", - "$ref": "Backend" + "$ref": "Backend", + "description": "API backend configuration." }, "systemParameters": { - "$ref": "SystemParameters", - "description": "System parameter configuration." + "description": "System parameter configuration.", + "$ref": "SystemParameters" }, "documentation": { - "description": "Additional API documentation.", - "$ref": "Documentation" + "$ref": "Documentation", + "description": "Additional API documentation." + }, + "monitoredResources": { + "description": "Defines the monitored resources used by this service. This is required\nby the Service.monitoring and Service.logging configurations.", + "items": { + "$ref": "MonitoredResourceDescriptor" + }, + "type": "array" }, "logging": { "description": "Logging configuration.", "$ref": "Logging" }, - "monitoredResources": { - "type": "array", - "items": { - "$ref": "MonitoredResourceDescriptor" - }, - "description": "Defines the monitored resources used by this service. This is required\nby the Service.monitoring and Service.logging configurations." - }, - "enums": { - "description": "A list of all enum types included in this API service. Enums\nreferenced directly or indirectly by the `apis` are automatically\nincluded. Enums which are not referenced but shall be included\nshould be listed here by name. Example:\n\n enums:\n - name: google.someapi.v1.SomeEnum", - "type": "array", - "items": { - "$ref": "Enum" - } - }, "context": { "description": "Context configuration.", "$ref": "Context" }, + "enums": { + "description": "A list of all enum types included in this API service. Enums\nreferenced directly or indirectly by the `apis` are automatically\nincluded. Enums which are not referenced but shall be included\nshould be listed here by name. Example:\n\n enums:\n - name: google.someapi.v1.SomeEnum", + "items": { + "$ref": "Enum" + }, + "type": "array" + }, "id": { "description": "A unique ID for a specific instance of this message, typically assigned\nby the client for tracking purpose. If empty, the server may choose to\ngenerate one instead.", "type": "string" @@ -1901,15 +995,15 @@ "type": "string" }, "options": { - "type": "array", + "description": "Protocol buffer options.", "items": { "$ref": "Option" }, - "description": "Protocol buffer options." + "type": "array" }, "number": { - "description": "Enum value number.", "format": "int32", + "description": "Enum value number.", "type": "integer" } }, @@ -1919,58 +1013,27 @@ "description": "The response message for Operations.ListOperations.", "type": "object", "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + }, "nextPageToken": { "description": "The standard List next-page token.", "type": "string" - }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Operation" - } } }, "id": "ListOperationsResponse" }, - "OperationMetadata": { - "description": "The metadata associated with a long running operation resource.", - "type": "object", - "properties": { - "progressPercentage": { - "description": "Percentage of completion of this operation, ranging from 0 to 100.", - "format": "int32", - "type": "integer" - }, - "startTime": { - "description": "The start time of the operation.", - "format": "google-datetime", - "type": "string" - }, - "resourceNames": { - "description": "The full name of the resources that this operation is directly\nassociated with.", - "type": "array", - "items": { - "type": "string" - } - }, - "steps": { - "description": "Detailed status information for each step. The order is undetermined.", - "type": "array", - "items": { - "$ref": "Step" - } - } - }, - "id": "OperationMetadata" - }, "CustomHttpPattern": { "description": "A custom pattern is used for defining custom HTTP verb.", "type": "object", "properties": { "path": { - "description": "The path matched by this custom verb.", - "type": "string" + "type": "string", + "description": "The path matched by this custom verb." }, "kind": { "description": "The name of this custom HTTP verb.", @@ -1979,81 +1042,85 @@ }, "id": "CustomHttpPattern" }, + "OperationMetadata": { + "description": "The metadata associated with a long running operation resource.", + "type": "object", + "properties": { + "progressPercentage": { + "format": "int32", + "description": "Percentage of completion of this operation, ranging from 0 to 100.", + "type": "integer" + }, + "startTime": { + "format": "google-datetime", + "description": "The start time of the operation.", + "type": "string" + }, + "steps": { + "description": "Detailed status information for each step. The order is undetermined.", + "items": { + "$ref": "Step" + }, + "type": "array" + }, + "resourceNames": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The full name of the resources that this operation is directly\nassociated with." + } + }, + "id": "OperationMetadata" + }, "SystemParameterRule": { "description": "Define a system parameter rule mapping system parameter definitions to\nmethods.", "type": "object", "properties": { "selector": { - "type": "string", - "description": "Selects the methods to which this rule applies. Use '*' to indicate all\nmethods in all APIs.\n\nRefer to selector for syntax details." + "description": "Selects the methods to which this rule applies. Use '*' to indicate all\nmethods in all APIs.\n\nRefer to selector for syntax details.", + "type": "string" }, "parameters": { - "description": "Define parameters. Multiple names may be defined for a parameter.\nFor a given method call, only one of them should be used. If multiple\nnames are used the behavior is implementation-dependent.\nIf none of the specified names are present the behavior is\nparameter-dependent.", - "type": "array", "items": { "$ref": "SystemParameter" - } + }, + "type": "array", + "description": "Define parameters. Multiple names may be defined for a parameter.\nFor a given method call, only one of them should be used. If multiple\nnames are used the behavior is implementation-dependent.\nIf none of the specified names are present the behavior is\nparameter-dependent." } }, "id": "SystemParameterRule" }, - "VisibilityRule": { - "id": "VisibilityRule", - "description": "A visibility rule provides visibility configuration for an individual API\nelement.", - "type": "object", - "properties": { - "restriction": { - "type": "string", - "description": "A comma-separated list of visibility labels that apply to the `selector`.\nAny of the listed labels can be used to grant the visibility.\n\nIf a rule has multiple labels, removing one of the labels but not all of\nthem can break clients.\n\nExample:\n\n visibility:\n rules:\n - selector: google.calendar.Calendar.EnhancedSearch\n restriction: GOOGLE_INTERNAL, TRUSTED_TESTER\n\nRemoving GOOGLE_INTERNAL from this restriction will break clients that\nrely on this method and only had access to it through GOOGLE_INTERNAL." - }, - "selector": { - "description": "Selects methods, messages, fields, enums, etc. to which this rule applies.\n\nRefer to selector for syntax details.", - "type": "string" - } - } - }, "HttpRule": { - "description": "`HttpRule` defines the mapping of an RPC method to one or more HTTP\nREST APIs. The mapping determines what portions of the request\nmessage are populated from the path, query parameters, or body of\nthe HTTP request. The mapping is typically specified as an\n`google.api.http` annotation, see \"google/api/annotations.proto\"\nfor details.\n\nThe mapping consists of a field specifying the path template and\nmethod kind. The path template can refer to fields in the request\nmessage, as in the example below which describes a REST GET\noperation on a resource collection of messages:\n\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http).get = \"/v1/messages/{message_id}/{sub.subfield}\";\n }\n }\n message GetMessageRequest {\n message SubMessage {\n string subfield = 1;\n }\n string message_id = 1; // mapped to the URL\n SubMessage sub = 2; // `sub.subfield` is url-mapped\n }\n message Message {\n string text = 1; // content of the resource\n }\n\nThe same http annotation can alternatively be expressed inside the\n`GRPC API Configuration` YAML file.\n\n http:\n rules:\n - selector: \u003cproto_package_name\u003e.Messaging.GetMessage\n get: /v1/messages/{message_id}/{sub.subfield}\n\nThis definition enables an automatic, bidrectional mapping of HTTP\nJSON to RPC. Example:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456/foo` | `GetMessage(message_id: \"123456\" sub: SubMessage(subfield: \"foo\"))`\n\nIn general, not only fields but also field paths can be referenced\nfrom a path pattern. Fields mapped to the path pattern cannot be\nrepeated and must have a primitive (non-message) type.\n\nAny fields in the request message which are not bound by the path\npattern automatically become (optional) HTTP query\nparameters. Assume the following definition of the request message:\n\n\n message GetMessageRequest {\n message SubMessage {\n string subfield = 1;\n }\n string message_id = 1; // mapped to the URL\n int64 revision = 2; // becomes a parameter\n SubMessage sub = 3; // `sub.subfield` becomes a parameter\n }\n\n\nThis enables a HTTP JSON to RPC mapping as below:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: \"123456\" revision: 2 sub: SubMessage(subfield: \"foo\"))`\n\nNote that fields which are mapped to HTTP parameters must have a\nprimitive type or a repeated primitive type. Message types are not\nallowed. In the case of a repeated type, the parameter can be\nrepeated in the URL, as in `...?param=A¶m=B`.\n\nFor HTTP method kinds which allow a request body, the `body` field\nspecifies the mapping. Consider a REST update method on the\nmessage resource collection:\n\n\n service Messaging {\n rpc UpdateMessage(UpdateMessageRequest) returns (Message) {\n option (google.api.http) = {\n put: \"/v1/messages/{message_id}\"\n body: \"message\"\n };\n }\n }\n message UpdateMessageRequest {\n string message_id = 1; // mapped to the URL\n Message message = 2; // mapped to the body\n }\n\n\nThe following HTTP JSON to RPC mapping is enabled, where the\nrepresentation of the JSON in the request body is determined by\nprotos JSON encoding:\n\nHTTP | RPC\n-----|-----\n`PUT /v1/messages/123456 { \"text\": \"Hi!\" }` | `UpdateMessage(message_id: \"123456\" message { text: \"Hi!\" })`\n\nThe special name `*` can be used in the body mapping to define that\nevery field not bound by the path template should be mapped to the\nrequest body. This enables the following alternative definition of\nthe update method:\n\n service Messaging {\n rpc UpdateMessage(Message) returns (Message) {\n option (google.api.http) = {\n put: \"/v1/messages/{message_id}\"\n body: \"*\"\n };\n }\n }\n message Message {\n string message_id = 1;\n string text = 2;\n }\n\n\nThe following HTTP JSON to RPC mapping is enabled:\n\nHTTP | RPC\n-----|-----\n`PUT /v1/messages/123456 { \"text\": \"Hi!\" }` | `UpdateMessage(message_id: \"123456\" text: \"Hi!\")`\n\nNote that when using `*` in the body mapping, it is not possible to\nhave HTTP parameters, as all fields not bound by the path end in\nthe body. This makes this option more rarely used in practice of\ndefining REST APIs. The common usage of `*` is in custom methods\nwhich don't use the URL at all for transferring data.\n\nIt is possible to define multiple HTTP methods for one RPC by using\nthe `additional_bindings` option. Example:\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http) = {\n get: \"/v1/messages/{message_id}\"\n additional_bindings {\n get: \"/v1/users/{user_id}/messages/{message_id}\"\n }\n };\n }\n }\n message GetMessageRequest {\n string message_id = 1;\n string user_id = 2;\n }\n\n\nThis enables the following two alternative HTTP JSON to RPC\nmappings:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456` | `GetMessage(message_id: \"123456\")`\n`GET /v1/users/me/messages/123456` | `GetMessage(user_id: \"me\" message_id: \"123456\")`\n\n# Rules for HTTP mapping\n\nThe rules for mapping HTTP path, query parameters, and body fields\nto the request message are as follows:\n\n1. The `body` field specifies either `*` or a field path, or is\n omitted. If omitted, it assumes there is no HTTP body.\n2. Leaf fields (recursive expansion of nested messages in the\n request) can be classified into three types:\n (a) Matched in the URL template.\n (b) Covered by body (if body is `*`, everything except (a) fields;\n else everything under the body field)\n (c) All other fields.\n3. URL query parameters found in the HTTP request are mapped to (c) fields.\n4. Any body sent with an HTTP request can contain only (b) fields.\n\nThe syntax of the path template is as follows:\n\n Template = \"/\" Segments [ Verb ] ;\n Segments = Segment { \"/\" Segment } ;\n Segment = \"*\" | \"**\" | LITERAL | Variable ;\n Variable = \"{\" FieldPath [ \"=\" Segments ] \"}\" ;\n FieldPath = IDENT { \".\" IDENT } ;\n Verb = \":\" LITERAL ;\n\nThe syntax `*` matches a single path segment. It follows the semantics of\n[RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String\nExpansion.\n\nThe syntax `**` matches zero or more path segments. It follows the semantics\nof [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved\nExpansion. NOTE: it must be the last segment in the path except the Verb.\n\nThe syntax `LITERAL` matches literal text in the URL path.\n\nThe syntax `Variable` matches the entire path as specified by its template;\nthis nested template must not contain further variables. If a variable\nmatches a single path segment, its template may be omitted, e.g. `{var}`\nis equivalent to `{var=*}`.\n\nNOTE: the field paths in variables and in the `body` must not refer to\nrepeated fields or map fields.\n\nUse CustomHttpPattern to specify any HTTP method that is not included in the\n`pattern` field, such as HEAD, or \"*\" to leave the HTTP method unspecified for\na given URL path rule. The wild-card rule is useful for services that provide\ncontent to Web (HTML) clients.", + "description": "`HttpRule` defines the mapping of an RPC method to one or more HTTP\nREST API methods. The mapping specifies how different portions of the RPC\nrequest message are mapped to URL path, URL query parameters, and\nHTTP request body. The mapping is typically specified as an\n`google.api.http` annotation on the RPC method,\nsee \"google/api/annotations.proto\" for details.\n\nThe mapping consists of a field specifying the path template and\nmethod kind. The path template can refer to fields in the request\nmessage, as in the example below which describes a REST GET\noperation on a resource collection of messages:\n\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http).get = \"/v1/messages/{message_id}/{sub.subfield}\";\n }\n }\n message GetMessageRequest {\n message SubMessage {\n string subfield = 1;\n }\n string message_id = 1; // mapped to the URL\n SubMessage sub = 2; // `sub.subfield` is url-mapped\n }\n message Message {\n string text = 1; // content of the resource\n }\n\nThe same http annotation can alternatively be expressed inside the\n`GRPC API Configuration` YAML file.\n\n http:\n rules:\n - selector: \u003cproto_package_name\u003e.Messaging.GetMessage\n get: /v1/messages/{message_id}/{sub.subfield}\n\nThis definition enables an automatic, bidrectional mapping of HTTP\nJSON to RPC. Example:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456/foo` | `GetMessage(message_id: \"123456\" sub: SubMessage(subfield: \"foo\"))`\n\nIn general, not only fields but also field paths can be referenced\nfrom a path pattern. Fields mapped to the path pattern cannot be\nrepeated and must have a primitive (non-message) type.\n\nAny fields in the request message which are not bound by the path\npattern automatically become (optional) HTTP query\nparameters. Assume the following definition of the request message:\n\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http).get = \"/v1/messages/{message_id}\";\n }\n }\n message GetMessageRequest {\n message SubMessage {\n string subfield = 1;\n }\n string message_id = 1; // mapped to the URL\n int64 revision = 2; // becomes a parameter\n SubMessage sub = 3; // `sub.subfield` becomes a parameter\n }\n\n\nThis enables a HTTP JSON to RPC mapping as below:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: \"123456\" revision: 2 sub: SubMessage(subfield: \"foo\"))`\n\nNote that fields which are mapped to HTTP parameters must have a\nprimitive type or a repeated primitive type. Message types are not\nallowed. In the case of a repeated type, the parameter can be\nrepeated in the URL, as in `...?param=A¶m=B`.\n\nFor HTTP method kinds which allow a request body, the `body` field\nspecifies the mapping. Consider a REST update method on the\nmessage resource collection:\n\n\n service Messaging {\n rpc UpdateMessage(UpdateMessageRequest) returns (Message) {\n option (google.api.http) = {\n put: \"/v1/messages/{message_id}\"\n body: \"message\"\n };\n }\n }\n message UpdateMessageRequest {\n string message_id = 1; // mapped to the URL\n Message message = 2; // mapped to the body\n }\n\n\nThe following HTTP JSON to RPC mapping is enabled, where the\nrepresentation of the JSON in the request body is determined by\nprotos JSON encoding:\n\nHTTP | RPC\n-----|-----\n`PUT /v1/messages/123456 { \"text\": \"Hi!\" }` | `UpdateMessage(message_id: \"123456\" message { text: \"Hi!\" })`\n\nThe special name `*` can be used in the body mapping to define that\nevery field not bound by the path template should be mapped to the\nrequest body. This enables the following alternative definition of\nthe update method:\n\n service Messaging {\n rpc UpdateMessage(Message) returns (Message) {\n option (google.api.http) = {\n put: \"/v1/messages/{message_id}\"\n body: \"*\"\n };\n }\n }\n message Message {\n string message_id = 1;\n string text = 2;\n }\n\n\nThe following HTTP JSON to RPC mapping is enabled:\n\nHTTP | RPC\n-----|-----\n`PUT /v1/messages/123456 { \"text\": \"Hi!\" }` | `UpdateMessage(message_id: \"123456\" text: \"Hi!\")`\n\nNote that when using `*` in the body mapping, it is not possible to\nhave HTTP parameters, as all fields not bound by the path end in\nthe body. This makes this option more rarely used in practice of\ndefining REST APIs. The common usage of `*` is in custom methods\nwhich don't use the URL at all for transferring data.\n\nIt is possible to define multiple HTTP methods for one RPC by using\nthe `additional_bindings` option. Example:\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http) = {\n get: \"/v1/messages/{message_id}\"\n additional_bindings {\n get: \"/v1/users/{user_id}/messages/{message_id}\"\n }\n };\n }\n }\n message GetMessageRequest {\n string message_id = 1;\n string user_id = 2;\n }\n\n\nThis enables the following two alternative HTTP JSON to RPC\nmappings:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456` | `GetMessage(message_id: \"123456\")`\n`GET /v1/users/me/messages/123456` | `GetMessage(user_id: \"me\" message_id: \"123456\")`\n\n# Rules for HTTP mapping\n\nThe rules for mapping HTTP path, query parameters, and body fields\nto the request message are as follows:\n\n1. The `body` field specifies either `*` or a field path, or is\n omitted. If omitted, it indicates there is no HTTP request body.\n2. Leaf fields (recursive expansion of nested messages in the\n request) can be classified into three types:\n (a) Matched in the URL template.\n (b) Covered by body (if body is `*`, everything except (a) fields;\n else everything under the body field)\n (c) All other fields.\n3. URL query parameters found in the HTTP request are mapped to (c) fields.\n4. Any body sent with an HTTP request can contain only (b) fields.\n\nThe syntax of the path template is as follows:\n\n Template = \"/\" Segments [ Verb ] ;\n Segments = Segment { \"/\" Segment } ;\n Segment = \"*\" | \"**\" | LITERAL | Variable ;\n Variable = \"{\" FieldPath [ \"=\" Segments ] \"}\" ;\n FieldPath = IDENT { \".\" IDENT } ;\n Verb = \":\" LITERAL ;\n\nThe syntax `*` matches a single path segment. The syntax `**` matches zero\nor more path segments, which must be the last part of the path except the\n`Verb`. The syntax `LITERAL` matches literal text in the path.\n\nThe syntax `Variable` matches part of the URL path as specified by its\ntemplate. A variable template must not contain other variables. If a variable\nmatches a single path segment, its template may be omitted, e.g. `{var}`\nis equivalent to `{var=*}`.\n\nIf a variable contains exactly one path segment, such as `\"{var}\"` or\n`\"{var=*}\"`, when such a variable is expanded into a URL path, all characters\nexcept `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the\nDiscovery Document as `{var}`.\n\nIf a variable contains one or more path segments, such as `\"{var=foo/*}\"`\nor `\"{var=**}\"`, when such a variable is expanded into a URL path, all\ncharacters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables\nshow up in the Discovery Document as `{+var}`.\n\nNOTE: While the single segment variable matches the semantics of\n[RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2\nSimple String Expansion, the multi segment variable **does not** match\nRFC 6570 Reserved Expansion. The reason is that the Reserved Expansion\ndoes not expand special characters like `?` and `#`, which would lead\nto invalid URLs.\n\nNOTE: the field paths in variables and in the `body` must not refer to\nrepeated fields or map fields.", "type": "object", "properties": { - "put": { - "description": "Used for updating a resource.", - "type": "string" - }, - "delete": { - "description": "Used for deleting a resource.", - "type": "string" - }, "body": { "description": "The name of the request field whose value is mapped to the HTTP body, or\n`*` for mapping all fields not captured by the path pattern to the HTTP\nbody. NOTE: the referred field must not be a repeated field and must be\npresent at the top-level of request message type.", "type": "string" }, - "mediaDownload": { - "description": "Use this only for Scotty Requests. Do not use this for bytestream methods.\nFor media support, add instead [][google.bytestream.RestByteStream] as an\nAPI to your configuration.", - "$ref": "MediaDownload" - }, "post": { "description": "Used for creating a resource.", "type": "string" }, + "mediaDownload": { + "$ref": "MediaDownload", + "description": "Use this only for Scotty Requests. Do not use this for bytestream methods.\nFor media support, add instead [][google.bytestream.RestByteStream] as an\nAPI to your configuration." + }, "additionalBindings": { - "description": "Additional HTTP bindings for the selector. Nested bindings must\nnot contain an `additional_bindings` field themselves (that is,\nthe nesting may only be one level deep).", - "type": "array", "items": { "$ref": "HttpRule" - } - }, - "restCollection": { - "description": "Optional. The REST collection name is by default derived from the URL\npattern. If specified, this field overrides the default collection name.\nExample:\n\n rpc AddressesAggregatedList(AddressesAggregatedListRequest)\n returns (AddressesAggregatedListResponse) {\n option (google.api.http) = {\n get: \"/v1/projects/{project_id}/aggregated/addresses\"\n rest_collection: \"projects.addresses\"\n };\n }\n\nThis method has the automatically derived collection name\n\"projects.aggregated\". Because, semantically, this rpc is actually an\noperation on the \"projects.addresses\" collection, the `rest_collection`\nfield is configured to override the derived collection name.", - "type": "string" + }, + "type": "array", + "description": "Additional HTTP bindings for the selector. Nested bindings must\nnot contain an `additional_bindings` field themselves (that is,\nthe nesting may only be one level deep)." }, "responseBody": { "description": "The name of the response field whose value is mapped to the HTTP body of\nresponse. Other response fields are ignored. This field is optional. When\nnot set, the response message will be used as HTTP body of response.\nNOTE: the referred field must be not a repeated field and must be present\nat the top-level of response message type.", "type": "string" }, "mediaUpload": { - "description": "Use this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead\n[][google.bytestream.RestByteStream] as an API to your\nconfiguration for Bytestream methods.", - "$ref": "MediaUpload" + "$ref": "MediaUpload", + "description": "Use this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead\n[][google.bytestream.RestByteStream] as an API to your\nconfiguration for Bytestream methods." }, "selector": { "description": "Selects methods to which this rule applies.\n\nRefer to selector for syntax details.", @@ -2061,20 +1128,45 @@ }, "custom": { "$ref": "CustomHttpPattern", - "description": "Custom pattern is used for defining custom verbs." + "description": "The custom pattern is used for specifying an HTTP method that is not\nincluded in the `pattern` field, such as HEAD, or \"*\" to leave the\nHTTP method unspecified for this rule. The wild-card rule is useful\nfor services that provide content to Web (HTML) clients." + }, + "get": { + "description": "Used for listing and getting information about resources.", + "type": "string" }, "patch": { "description": "Used for updating a resource.", "type": "string" }, - "get": { - "description": "Used for listing and getting information about resources.", + "put": { + "description": "Used for updating a resource.", + "type": "string" + }, + "delete": { + "description": "Used for deleting a resource.", "type": "string" } }, "id": "HttpRule" }, + "VisibilityRule": { + "type": "object", + "properties": { + "restriction": { + "description": "A comma-separated list of visibility labels that apply to the `selector`.\nAny of the listed labels can be used to grant the visibility.\n\nIf a rule has multiple labels, removing one of the labels but not all of\nthem can break clients.\n\nExample:\n\n visibility:\n rules:\n - selector: google.calendar.Calendar.EnhancedSearch\n restriction: GOOGLE_INTERNAL, TRUSTED_TESTER\n\nRemoving GOOGLE_INTERNAL from this restriction will break clients that\nrely on this method and only had access to it through GOOGLE_INTERNAL.", + "type": "string" + }, + "selector": { + "type": "string", + "description": "Selects methods, messages, fields, enums, etc. to which this rule applies.\n\nRefer to selector for syntax details." + } + }, + "id": "VisibilityRule", + "description": "A visibility rule provides visibility configuration for an individual API\nelement." + }, "MonitoringDestination": { + "description": "Configuration of a specific monitoring destination (the producer project\nor the consumer project).", + "type": "object", "properties": { "monitoredResource": { "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section.", @@ -2082,45 +1174,30 @@ }, "metrics": { "description": "Names of the metrics to report to this monitoring destination.\nEach name must be defined in Service.metrics section.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "MonitoringDestination", - "description": "Configuration of a specific monitoring destination (the producer project\nor the consumer project).", - "type": "object" + "id": "MonitoringDestination" }, "Visibility": { - "id": "Visibility", "description": "`Visibility` defines restrictions for the visibility of service\nelements. Restrictions are specified using visibility labels\n(e.g., TRUSTED_TESTER) that are elsewhere linked to users and projects.\n\nUsers and projects can have access to more than one visibility label. The\neffective visibility for multiple labels is the union of each label's\nelements, plus any unrestricted elements.\n\nIf an element and its parents have no restrictions, visibility is\nunconditionally granted.\n\nExample:\n\n visibility:\n rules:\n - selector: google.calendar.Calendar.EnhancedSearch\n restriction: TRUSTED_TESTER\n - selector: google.calendar.Calendar.Delegate\n restriction: GOOGLE_INTERNAL\n\nHere, all methods are publicly visible except for the restricted methods\nEnhancedSearch and Delegate.", "type": "object", "properties": { "rules": { - "type": "array", + "description": "A list of visibility rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", "items": { "$ref": "VisibilityRule" }, - "description": "A list of visibility rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." - } - } - }, - "SystemParameters": { - "description": "### System parameter configuration\n\nA system parameter is a special kind of parameter defined by the API\nsystem, not by an individual API. It is typically mapped to an HTTP header\nand/or a URL query parameter. This configuration specifies which methods\nchange the names of the system parameters.", - "type": "object", - "properties": { - "rules": { - "description": "Define system parameters.\n\nThe parameters defined here will override the default parameters\nimplemented by the system. If this field is missing from the service\nconfig, default system parameters will be used. Default system parameters\nand names is implementation-dependent.\n\nExample: define api key for all methods\n\n system_parameters\n rules:\n - selector: \"*\"\n parameters:\n - name: api_key\n url_query_parameter: api_key\n\n\nExample: define 2 api key names for a specific method.\n\n system_parameters\n rules:\n - selector: \"/ListShelves\"\n parameters:\n - name: api_key\n http_header: Api-Key1\n - name: api_key\n http_header: Api-Key2\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", - "items": { - "$ref": "SystemParameterRule" - } + "type": "array" } }, - "id": "SystemParameters" + "id": "Visibility" }, "ConfigChange": { + "id": "ConfigChange", "description": "Output generated from semantically comparing two versions of a service\nconfiguration.\n\nIncludes detailed information about a field that have changed with\napplicable advice about potential consequences for the change, such as\nbackwards-incompatibility.", "type": "object", "properties": { @@ -2129,6 +1206,8 @@ "type": "string" }, "changeType": { + "description": "The type for this change, either ADDED, REMOVED, or MODIFIED.", + "type": "string", "enumDescriptions": [ "No value was provided.", "The changed object exists in the 'new' service configuration, but not\nin the 'old' service configuration.", @@ -2140,56 +1219,62 @@ "ADDED", "REMOVED", "MODIFIED" - ], - "description": "The type for this change, either ADDED, REMOVED, or MODIFIED.", - "type": "string" + ] }, "element": { - "type": "string", - "description": "Object hierarchy path to the change, with levels separated by a '.'\ncharacter. For repeated fields, an applicable unique identifier field is\nused for the index (usually selector, name, or id). For maps, the term\n'key' is used. If the field has no unique identifier, the numeric index\nis used.\nExamples:\n- visibility.rules[selector==\"google.LibraryService.CreateBook\"].restriction\n- quota.metric_rules[selector==\"google\"].metric_costs[key==\"reads\"].value\n- logging.producer_destinations[0]" - }, - "oldValue": { - "description": "Value of the changed object in the old Service configuration,\nin JSON format. This field will not be populated if ChangeType == ADDED.", + "description": "Object hierarchy path to the change, with levels separated by a '.'\ncharacter. For repeated fields, an applicable unique identifier field is\nused for the index (usually selector, name, or id). For maps, the term\n'key' is used. If the field has no unique identifier, the numeric index\nis used.\nExamples:\n- visibility.rules[selector==\"google.LibraryService.CreateBook\"].restriction\n- quota.metric_rules[selector==\"google\"].metric_costs[key==\"reads\"].value\n- logging.producer_destinations[0]", "type": "string" }, "advices": { "description": "Collection of advice provided for this change, useful for determining the\npossible impact of this change.", - "type": "array", "items": { "$ref": "Advice" - } - } - }, - "id": "ConfigChange" - }, - "Quota": { - "properties": { - "metricRules": { - "description": "List of `MetricRule` definitions, each one mapping a selected method to one\nor more metrics.\n\nUsed by metric-based quotas only.", - "type": "array", - "items": { - "$ref": "MetricRule" - } + }, + "type": "array" }, - "limits": { - "description": "List of `QuotaLimit` definitions for the service.\n\nUsed by metric-based quotas only.", - "type": "array", + "oldValue": { + "type": "string", + "description": "Value of the changed object in the old Service configuration,\nin JSON format. This field will not be populated if ChangeType == ADDED." + } + } + }, + "SystemParameters": { + "description": "### System parameter configuration\n\nA system parameter is a special kind of parameter defined by the API\nsystem, not by an individual API. It is typically mapped to an HTTP header\nand/or a URL query parameter. This configuration specifies which methods\nchange the names of the system parameters.", + "type": "object", + "properties": { + "rules": { "items": { - "$ref": "QuotaLimit" - } + "$ref": "SystemParameterRule" + }, + "type": "array", + "description": "Define system parameters.\n\nThe parameters defined here will override the default parameters\nimplemented by the system. If this field is missing from the service\nconfig, default system parameters will be used. Default system parameters\nand names is implementation-dependent.\n\nExample: define api key for all methods\n\n system_parameters\n rules:\n - selector: \"*\"\n parameters:\n - name: api_key\n url_query_parameter: api_key\n\n\nExample: define 2 api key names for a specific method.\n\n system_parameters\n rules:\n - selector: \"/ListShelves\"\n parameters:\n - name: api_key\n http_header: Api-Key1\n - name: api_key\n http_header: Api-Key2\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." } }, - "id": "Quota", - "description": "Quota configuration helps to achieve fairness and budgeting in service\nusage.\n\nThe quota configuration works this way:\n- The service configuration defines a set of metrics.\n- For API calls, the quota.metric_rules maps methods to metrics with\n corresponding costs.\n- The quota.limits defines limits on the metrics, which will be used for\n quota checks at runtime.\n\nAn example quota configuration in yaml format:\n\n quota:\n\n - name: apiWriteQpsPerProject\n metric: library.googleapis.com/write_calls\n unit: \"1/min/{project}\" # rate limit for consumer projects\n values:\n STANDARD: 10000\n\n\n # The metric rules bind all methods to the read_calls metric,\n # except for the UpdateBook and DeleteBook methods. These two methods\n # are mapped to the write_calls metric, with the UpdateBook method\n # consuming at twice rate as the DeleteBook method.\n metric_rules:\n - selector: \"*\"\n metric_costs:\n library.googleapis.com/read_calls: 1\n - selector: google.example.library.v1.LibraryService.UpdateBook\n metric_costs:\n library.googleapis.com/write_calls: 2\n - selector: google.example.library.v1.LibraryService.DeleteBook\n metric_costs:\n library.googleapis.com/write_calls: 1\n\n Corresponding Metric definition:\n\n metrics:\n - name: library.googleapis.com/read_calls\n display_name: Read requests\n metric_kind: DELTA\n value_type: INT64\n\n - name: library.googleapis.com/write_calls\n display_name: Write requests\n metric_kind: DELTA\n value_type: INT64", - "type": "object" + "id": "SystemParameters" }, "Rollout": { "description": "A rollout resource that defines how service configuration versions are pushed\nto control plane systems. Typically, you create a new version of the\nservice config, and then create a Rollout to push the service config.", "type": "object", "properties": { + "createdBy": { + "description": "The user who created the Rollout. Readonly.", + "type": "string" + }, + "trafficPercentStrategy": { + "$ref": "TrafficPercentStrategy", + "description": "Google Service Control selects service configurations based on\ntraffic percentage." + }, + "rolloutId": { + "description": "Optional unique identifier of this Rollout. Only lower case letters, digits\n and '-' are allowed.\n\nIf not specified by client, the server will generate one. The generated id\nwill have the form of \u003cdate\u003e\u003crevision number\u003e, where \"date\" is the create\ndate in ISO 8601 format. \"revision number\" is a monotonically increasing\npositive number that is reset every day for each service.\nAn example of the generated rollout_id is '2016-02-16r1'", + "type": "string" + }, + "deleteServiceStrategy": { + "description": "The strategy associated with a rollout to delete a `ManagedService`.\nReadonly.", + "$ref": "DeleteServiceStrategy" + }, "createTime": { - "description": "Creation time of the rollout. Readonly.", "format": "google-datetime", + "description": "Creation time of the rollout. Readonly.", "type": "string" }, "status": { @@ -2217,72 +1302,81 @@ "serviceName": { "description": "The name of the service associated with this Rollout.", "type": "string" - }, - "createdBy": { - "description": "The user who created the Rollout. Readonly.", - "type": "string" - }, - "trafficPercentStrategy": { - "$ref": "TrafficPercentStrategy", - "description": "Google Service Control selects service configurations based on\ntraffic percentage." - }, - "rolloutId": { - "description": "Optional unique identifier of this Rollout. Only lower case letters, digits\n and '-' are allowed.\n\nIf not specified by client, the server will generate one. The generated id\nwill have the form of \u003cdate\u003e\u003crevision number\u003e, where \"date\" is the create\ndate in ISO 8601 format. \"revision number\" is a monotonically increasing\npositive number that is reset every day for each service.\nAn example of the generated rollout_id is '2016-02-16r1'", - "type": "string" - }, - "deleteServiceStrategy": { - "description": "The strategy associated with a rollout to delete a `ManagedService`.\nReadonly.", - "$ref": "DeleteServiceStrategy" } }, "id": "Rollout" }, + "Quota": { + "id": "Quota", + "description": "Quota configuration helps to achieve fairness and budgeting in service\nusage.\n\nThe quota configuration works this way:\n- The service configuration defines a set of metrics.\n- For API calls, the quota.metric_rules maps methods to metrics with\n corresponding costs.\n- The quota.limits defines limits on the metrics, which will be used for\n quota checks at runtime.\n\nAn example quota configuration in yaml format:\n\n quota:\n\n - name: apiWriteQpsPerProject\n metric: library.googleapis.com/write_calls\n unit: \"1/min/{project}\" # rate limit for consumer projects\n values:\n STANDARD: 10000\n\n\n # The metric rules bind all methods to the read_calls metric,\n # except for the UpdateBook and DeleteBook methods. These two methods\n # are mapped to the write_calls metric, with the UpdateBook method\n # consuming at twice rate as the DeleteBook method.\n metric_rules:\n - selector: \"*\"\n metric_costs:\n library.googleapis.com/read_calls: 1\n - selector: google.example.library.v1.LibraryService.UpdateBook\n metric_costs:\n library.googleapis.com/write_calls: 2\n - selector: google.example.library.v1.LibraryService.DeleteBook\n metric_costs:\n library.googleapis.com/write_calls: 1\n\n Corresponding Metric definition:\n\n metrics:\n - name: library.googleapis.com/read_calls\n display_name: Read requests\n metric_kind: DELTA\n value_type: INT64\n\n - name: library.googleapis.com/write_calls\n display_name: Write requests\n metric_kind: DELTA\n value_type: INT64", + "type": "object", + "properties": { + "limits": { + "description": "List of `QuotaLimit` definitions for the service.", + "items": { + "$ref": "QuotaLimit" + }, + "type": "array" + }, + "metricRules": { + "description": "List of `MetricRule` definitions, each one mapping a selected method to one\nor more metrics.", + "items": { + "$ref": "MetricRule" + }, + "type": "array" + } + } + }, "GenerateConfigReportRequest": { - "description": "Request message for GenerateConfigReport method.", "type": "object", "properties": { "oldConfig": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, "description": "Service configuration against which the comparison will be done.\nFor this version of API, the supported types are\ngoogle.api.servicemanagement.v1.ConfigRef,\ngoogle.api.servicemanagement.v1.ConfigSource,\nand google.api.Service", - "type": "object" - }, - "newConfig": { - "description": "Service configuration for which we want to generate the report.\nFor this version of API, the supported types are\ngoogle.api.servicemanagement.v1.ConfigRef,\ngoogle.api.servicemanagement.v1.ConfigSource,\nand google.api.Service", "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" } + }, + "newConfig": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service configuration for which we want to generate the report.\nFor this version of API, the supported types are\ngoogle.api.servicemanagement.v1.ConfigRef,\ngoogle.api.servicemanagement.v1.ConfigSource,\nand google.api.Service", + "type": "object" } }, - "id": "GenerateConfigReportRequest" + "id": "GenerateConfigReportRequest", + "description": "Request message for GenerateConfigReport method." }, "SetIamPolicyRequest": { "description": "Request message for `SetIamPolicy` method.", "type": "object", "properties": { - "policy": { - "$ref": "Policy", - "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." - }, "updateMask": { - "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", "type": "string" + }, + "policy": { + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them.", + "$ref": "Policy" } }, "id": "SetIamPolicyRequest" }, + "DeleteServiceStrategy": { + "id": "DeleteServiceStrategy", + "description": "Strategy used to delete a service. This strategy is a placeholder only\nused by the system generated rollout to delete a service.", + "type": "object", + "properties": {} + }, "Step": { "description": "Represents the status of one operation step.", "type": "object", "properties": { "status": { - "description": "The status code.", - "type": "string", "enumDescriptions": [ "Unspecifed code.", "The operation or step has completed without errors.", @@ -2298,7 +1392,9 @@ "IN_PROGRESS", "FAILED", "CANCELLED" - ] + ], + "description": "The status code.", + "type": "string" }, "description": { "description": "The short description of the step.", @@ -2307,143 +1403,69 @@ }, "id": "Step" }, - "DeleteServiceStrategy": { - "type": "object", - "properties": {}, - "id": "DeleteServiceStrategy", - "description": "Strategy used to delete a service. This strategy is a placeholder only\nused by the system generated rollout to delete a service." - }, "LoggingDestination": { - "id": "LoggingDestination", "description": "Configuration of a specific logging destination (the producer project\nor the consumer project).", "type": "object", "properties": { "logs": { "description": "Names of the logs to be sent to this destination. Each name must\nbe defined in the Service.logs section. If the log name is\nnot a domain scoped name, it will be automatically prefixed with\nthe service name followed by \"/\".", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "monitoredResource": { "description": "The monitored resource type. The type must be defined in the\nService.monitored_resources section.", "type": "string" } - } + }, + "id": "LoggingDestination" }, "Option": { - "description": "A protocol buffer option, which can be attached to a message, field,\nenumeration, etc.", - "type": "object", "properties": { + "value": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "The option's value packed in an Any message. If the value is a primitive,\nthe corresponding wrapper type defined in google/protobuf/wrappers.proto\nshould be used. If the value is an enum, it should be stored as an int32\nvalue using the google.protobuf.Int32Value type.", + "type": "object" + }, "name": { "description": "The option's name. For protobuf built-in options (options defined in\ndescriptor.proto), this is the short name. For example, `\"map_entry\"`.\nFor custom options, it should be the fully-qualified name. For example,\n`\"google.api.http\"`.", "type": "string" - }, - "value": { - "description": "The option's value packed in an Any message. If the value is a primitive,\nthe corresponding wrapper type defined in google/protobuf/wrappers.proto\nshould be used. If the value is an enum, it should be stored as an int32\nvalue using the google.protobuf.Int32Value type.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } } }, - "id": "Option" + "id": "Option", + "description": "A protocol buffer option, which can be attached to a message, field,\nenumeration, etc.", + "type": "object" }, "Logging": { - "id": "Logging", "description": "Logging configuration of the service.\n\nThe following example shows how to configure logs to be sent to the\nproducer and consumer projects. In the example, the `activity_history`\nlog is sent to both the producer and consumer projects, whereas the\n`purchase_history` log is only sent to the producer project.\n\n monitored_resources:\n - type: library.googleapis.com/branch\n labels:\n - key: /city\n description: The city where the library branch is located in.\n - key: /name\n description: The name of the branch.\n logs:\n - name: activity_history\n labels:\n - key: /customer_id\n - name: purchase_history\n logging:\n producer_destinations:\n - monitored_resource: library.googleapis.com/branch\n logs:\n - activity_history\n - purchase_history\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n logs:\n - activity_history", "type": "object", "properties": { "consumerDestinations": { - "type": "array", + "description": "Logging configurations for sending logs to the consumer project.\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none consumer destination.", "items": { "$ref": "LoggingDestination" }, - "description": "Logging configurations for sending logs to the consumer project.\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none consumer destination." + "type": "array" }, "producerDestinations": { - "description": "Logging configurations for sending logs to the producer project.\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none producer destination.", - "type": "array", "items": { "$ref": "LoggingDestination" - } - } - } - }, - "QuotaLimit": { - "id": "QuotaLimit", - "description": "`QuotaLimit` defines a specific limit that applies over a specified duration\nfor a limit type. There can be at most one limit for a duration and limit\ntype combination defined within a `QuotaGroup`.", - "type": "object", - "properties": { - "duration": { - "description": "Duration of this limit in textual notation. Example: \"100s\", \"24h\", \"1d\".\nFor duration longer than a day, only multiple of days is supported. We\nsupport only \"100s\" and \"1d\" for now. Additional support will be added in\nthe future. \"0\" indicates indefinite duration.\n\nUsed by group-based quotas only.", - "type": "string" - }, - "freeTier": { - "description": "Free tier value displayed in the Developers Console for this limit.\nThe free tier is the number of tokens that will be subtracted from the\nbilled amount when billing is enabled.\nThis field can only be set on a limit with duration \"1d\", in a billable\ngroup; it is invalid on any other limit. If this field is not set, it\ndefaults to 0, indicating that there is no free tier for this service.\n\nUsed by group-based quotas only.", - "format": "int64", - "type": "string" - }, - "defaultLimit": { - "description": "Default number of tokens that can be consumed during the specified\nduration. This is the number of tokens assigned when a client\napplication developer activates the service for his/her project.\n\nSpecifying a value of 0 will block all requests. This can be used if you\nare provisioning quota to selected consumers and blocking others.\nSimilarly, a value of -1 will indicate an unlimited quota. No other\nnegative values are allowed.\n\nUsed by group-based quotas only.", - "format": "int64", - "type": "string" - }, - "description": { - "description": "Optional. User-visible, extended description for this quota limit.\nShould be used only when more context is needed to understand this limit\nthan provided by the limit's display name (see: `display_name`).", - "type": "string" - }, - "displayName": { - "description": "User-visible display name for this limit.\nOptional. If not set, the UI will provide a default display name based on\nthe quota configuration. This field can be used to override the default\ndisplay name generated from the configuration.", - "type": "string" - }, - "metric": { - "description": "The name of the metric this quota limit applies to. The quota limits with\nthe same metric will be checked together during runtime. The metric must be\ndefined within the service config.\n\nUsed by metric-based quotas only.", - "type": "string" - }, - "values": { - "additionalProperties": { - "format": "int64", - "type": "string" }, - "description": "Tiered limit values. Also allows for regional or zone overrides for these\nvalues if \"/{region}\" or \"/{zone}\" is specified in the unit field.\n\nCurrently supported tiers from low to high:\nVERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH\n\nTo apply different limit values for users according to their tiers, specify\nthe values for the tiers you want to differentiate. For example:\n{LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000}\n\nThe limit value for each tier is optional except for the tier STANDARD.\nThe limit value for an unspecified tier falls to the value of its next\ntier towards tier STANDARD. For the above example, the limit value for tier\nSTANDARD is 500.\n\nTo apply the same limit value for all users, just specify limit value for\ntier STANDARD. For example: {STANDARD:500}.\n\nTo apply a regional overide for a tier, add a map entry with key\n\"\u003cTIER\u003e/\u003cregion\u003e\", where \u003cregion\u003e is a region name. Similarly, for a zone\noverride, add a map entry with key \"\u003cTIER\u003e/{zone}\".\nFurther, a wildcard can be used at the end of a zone name in order to\nspecify zone level overrides. For example:\nLOW: 10, STANDARD: 50, HIGH: 100,\nLOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200,\nLOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80\n\nThe regional overrides tier set for each region must be the same as\nthe tier set for default limit values. Same rule applies for zone overrides\ntier as well.\n\nUsed by metric-based quotas only.", - "type": "object" - }, - "unit": { - "description": "Specify the unit of the quota limit. It uses the same syntax as\nMetric.unit. The supported unit kinds are determined by the quota\nbackend system.\n\nThe [Google Service Control](https://cloud.google.com/service-control)\nsupports the following unit components:\n* One of the time intevals:\n * \"/min\" for quota every minute.\n * \"/d\" for quota every 24 hours, starting 00:00 US Pacific Time.\n * Otherwise the quota won't be reset by time, such as storage limit.\n* One and only one of the granted containers:\n * \"/{organization}\" quota for an organization.\n * \"/{project}\" quota for a project.\n * \"/{folder}\" quota for a folder.\n * \"/{resource}\" quota for a universal resource.\n* Zero or more quota segmentation dimension. Not all combos are valid.\n * \"/{region}\" quota for every region. Not to be used with time intervals.\n * Otherwise the resources granted on the target is not segmented.\n * \"/{zone}\" quota for every zone. Not to be used with time intervals.\n * Otherwise the resources granted on the target is not segmented.\n * \"/{resource}\" quota for a resource associated with a project or org.\n\nHere are some examples:\n* \"1/min/{project}\" for quota per minute per project.\n* \"1/min/{user}\" for quota per minute per user.\n* \"1/min/{organization}\" for quota per minute per organization.\n\nNote: the order of unit components is insignificant.\nThe \"1\" at the beginning is required to follow the metric unit syntax.\n\nUsed by metric-based quotas only.", - "type": "string" - }, - "maxLimit": { - "description": "Maximum number of tokens that can be consumed during the specified\nduration. Client application developers can override the default limit up\nto this maximum. If specified, this value cannot be set to a value less\nthan the default limit. If not specified, it is set to the default limit.\n\nTo allow clients to apply overrides with no upper bound, set this to -1,\nindicating unlimited maximum quota.\n\nUsed by group-based quotas only.", - "format": "int64", - "type": "string" - }, - "name": { - "type": "string", - "description": "Name of the quota limit. The name is used to refer to the limit when\noverriding the default limit on per-consumer basis.\n\nFor group-based quota limits, the name must be unique within the quota\ngroup. If a name is not provided, it will be generated from the limit_by\nand duration fields.\n\nFor metric-based quota limits, the name must be provided, and it must be\nunique within the service. The name can only include alphanumeric\ncharacters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.\n\nThe name of a limit is used as a unique identifier for this limit.\nTherefore, once a limit has been put into use, its name should be\nimmutable. You can use the display_name field to provide a user-friendly\nname for the limit. The display name can be evolved over time without\naffecting the identity of the limit." + "type": "array", + "description": "Logging configurations for sending logs to the producer project.\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none producer destination." } - } + }, + "id": "Logging" }, "Method": { - "description": "Method represents a method of an api.", + "id": "Method", + "description": "Method represents a method of an API interface.", "type": "object", "properties": { - "responseTypeUrl": { - "description": "The URL of the output message type.", - "type": "string" - }, - "options": { - "description": "Any metadata attached to the method.", - "type": "array", - "items": { - "$ref": "Option" - } - }, - "responseStreaming": { - "type": "boolean", - "description": "If true, the response is streamed." - }, "name": { "description": "The simple name of this method.", "type": "string" @@ -2457,7 +1479,6 @@ "type": "boolean" }, "syntax": { - "description": "The source syntax of this method.", "type": "string", "enumDescriptions": [ "Syntax `proto2`.", @@ -2466,28 +1487,79 @@ "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" - ] - } - }, - "id": "Method" - }, - "ListServiceRolloutsResponse": { - "description": "Response message for ListServiceRollouts method.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "The token of the next page of results.", + ], + "description": "The source syntax of this method." + }, + "responseTypeUrl": { + "description": "The URL of the output message type.", "type": "string" }, - "rollouts": { - "description": "The list of rollout resources.", - "type": "array", + "options": { + "description": "Any metadata attached to the method.", "items": { - "$ref": "Rollout" - } + "$ref": "Option" + }, + "type": "array" + }, + "responseStreaming": { + "description": "If true, the response is streamed.", + "type": "boolean" + } + } + }, + "QuotaLimit": { + "description": "`QuotaLimit` defines a specific limit that applies over a specified duration\nfor a limit type. There can be at most one limit for a duration and limit\ntype combination defined within a `QuotaGroup`.", + "type": "object", + "properties": { + "maxLimit": { + "format": "int64", + "description": "Maximum number of tokens that can be consumed during the specified\nduration. Client application developers can override the default limit up\nto this maximum. If specified, this value cannot be set to a value less\nthan the default limit. If not specified, it is set to the default limit.\n\nTo allow clients to apply overrides with no upper bound, set this to -1,\nindicating unlimited maximum quota.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "name": { + "description": "Name of the quota limit. The name is used to refer to the limit when\noverriding the default limit on per-consumer basis.\n\nFor metric-based quota limits, the name must be provided, and it must be\nunique within the service. The name can only include alphanumeric\ncharacters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.\n\nThe name of a limit is used as a unique identifier for this limit.\nTherefore, once a limit has been put into use, its name should be\nimmutable. You can use the display_name field to provide a user-friendly\nname for the limit. The display name can be evolved over time without\naffecting the identity of the limit.", + "type": "string" + }, + "duration": { + "type": "string", + "description": "Duration of this limit in textual notation. Example: \"100s\", \"24h\", \"1d\".\nFor duration longer than a day, only multiple of days is supported. We\nsupport only \"100s\" and \"1d\" for now. Additional support will be added in\nthe future. \"0\" indicates indefinite duration.\n\nUsed by group-based quotas only." + }, + "freeTier": { + "format": "int64", + "description": "Free tier value displayed in the Developers Console for this limit.\nThe free tier is the number of tokens that will be subtracted from the\nbilled amount when billing is enabled.\nThis field can only be set on a limit with duration \"1d\", in a billable\ngroup; it is invalid on any other limit. If this field is not set, it\ndefaults to 0, indicating that there is no free tier for this service.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "defaultLimit": { + "format": "int64", + "description": "Default number of tokens that can be consumed during the specified\nduration. This is the number of tokens assigned when a client\napplication developer activates the service for his/her project.\n\nSpecifying a value of 0 will block all requests. This can be used if you\nare provisioning quota to selected consumers and blocking others.\nSimilarly, a value of -1 will indicate an unlimited quota. No other\nnegative values are allowed.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "description": { + "description": "Optional. User-visible, extended description for this quota limit.\nShould be used only when more context is needed to understand this limit\nthan provided by the limit's display name (see: `display_name`).", + "type": "string" + }, + "metric": { + "description": "The name of the metric this quota limit applies to. The quota limits with\nthe same metric will be checked together during runtime. The metric must be\ndefined within the service config.\n\nUsed by metric-based quotas only.", + "type": "string" + }, + "displayName": { + "type": "string", + "description": "User-visible display name for this limit.\nOptional. If not set, the UI will provide a default display name based on\nthe quota configuration. This field can be used to override the default\ndisplay name generated from the configuration." + }, + "values": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "Tiered limit values, currently only STANDARD is supported.", + "type": "object" + }, + "unit": { + "description": "Specify the unit of the quota limit. It uses the same syntax as\nMetric.unit. The supported unit kinds are determined by the quota\nbackend system.\n\nThe [Google Service Control](https://cloud.google.com/service-control)\nsupports the following unit components:\n* One of the time intevals:\n * \"/min\" for quota every minute.\n * \"/d\" for quota every 24 hours, starting 00:00 US Pacific Time.\n * Otherwise the quota won't be reset by time, such as storage limit.\n* One and only one of the granted containers:\n * \"/{project}\" quota for a project\n\nHere are some examples:\n* \"1/min/{project}\" for quota per minute per project.\n\nNote: the order of unit components is insignificant.\nThe \"1\" at the beginning is required to follow the metric unit syntax.\n\nUsed by metric-based quotas only.", + "type": "string" } }, - "id": "ListServiceRolloutsResponse" + "id": "QuotaLimit" }, "ConfigRef": { "description": "Represents a service configuration with its name and id.", @@ -2500,11 +1572,30 @@ }, "id": "ConfigRef" }, + "ListServiceRolloutsResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The token of the next page of results." + }, + "rollouts": { + "description": "The list of rollout resources.", + "items": { + "$ref": "Rollout" + }, + "type": "array" + } + }, + "id": "ListServiceRolloutsResponse", + "description": "Response message for ListServiceRollouts method." + }, "Mixin": { + "description": "Declares an API Interface to be included in this interface. The including\ninterface must redeclare all the methods from the included interface, but\ndocumentation and options are inherited as follows:\n\n- If after comment and whitespace stripping, the documentation\n string of the redeclared method is empty, it will be inherited\n from the original method.\n\n- Each annotation belonging to the service config (http,\n visibility) which is not set in the redeclared method will be\n inherited.\n\n- If an http annotation is inherited, the path pattern will be\n modified as follows. Any version prefix will be replaced by the\n version of the including interface plus the root path if\n specified.\n\nExample of a simple mixin:\n\n package google.acl.v1;\n service AccessControl {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v1/{resource=**}:getAcl\";\n }\n }\n\n package google.storage.v2;\n service Storage {\n // rpc GetAcl(GetAclRequest) returns (Acl);\n\n // Get a data record.\n rpc GetData(GetDataRequest) returns (Data) {\n option (google.api.http).get = \"/v2/{resource=**}\";\n }\n }\n\nExample of a mixin configuration:\n\n apis:\n - name: google.storage.v2.Storage\n mixins:\n - name: google.acl.v1.AccessControl\n\nThe mixin construct implies that all methods in `AccessControl` are\nalso declared with same name and request/response types in\n`Storage`. A documentation generator or annotation processor will\nsee the effective `Storage.GetAcl` method after inherting\ndocumentation and annotations as follows:\n\n service Storage {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v2/{resource=**}:getAcl\";\n }\n ...\n }\n\nNote how the version in the path pattern changed from `v1` to `v2`.\n\nIf the `root` field in the mixin is specified, it should be a\nrelative path under which inherited HTTP paths are placed. Example:\n\n apis:\n - name: google.storage.v2.Storage\n mixins:\n - name: google.acl.v1.AccessControl\n root: acls\n\nThis implies the following inherited HTTP annotation:\n\n service Storage {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\";\n }\n ...\n }", "type": "object", "properties": { "name": { - "description": "The fully qualified name of the API which is included.", + "description": "The fully qualified name of the interface which is included.", "type": "string" }, "root": { @@ -2512,13 +1603,18 @@ "type": "string" } }, - "id": "Mixin", - "description": "Declares an API to be included in this API. The including API must\nredeclare all the methods from the included API, but documentation\nand options are inherited as follows:\n\n- If after comment and whitespace stripping, the documentation\n string of the redeclared method is empty, it will be inherited\n from the original method.\n\n- Each annotation belonging to the service config (http,\n visibility) which is not set in the redeclared method will be\n inherited.\n\n- If an http annotation is inherited, the path pattern will be\n modified as follows. Any version prefix will be replaced by the\n version of the including API plus the root path if specified.\n\nExample of a simple mixin:\n\n package google.acl.v1;\n service AccessControl {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v1/{resource=**}:getAcl\";\n }\n }\n\n package google.storage.v2;\n service Storage {\n // rpc GetAcl(GetAclRequest) returns (Acl);\n\n // Get a data record.\n rpc GetData(GetDataRequest) returns (Data) {\n option (google.api.http).get = \"/v2/{resource=**}\";\n }\n }\n\nExample of a mixin configuration:\n\n apis:\n - name: google.storage.v2.Storage\n mixins:\n - name: google.acl.v1.AccessControl\n\nThe mixin construct implies that all methods in `AccessControl` are\nalso declared with same name and request/response types in\n`Storage`. A documentation generator or annotation processor will\nsee the effective `Storage.GetAcl` method after inherting\ndocumentation and annotations as follows:\n\n service Storage {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v2/{resource=**}:getAcl\";\n }\n ...\n }\n\nNote how the version in the path pattern changed from `v1` to `v2`.\n\nIf the `root` field in the mixin is specified, it should be a\nrelative path under which inherited HTTP paths are placed. Example:\n\n apis:\n - name: google.storage.v2.Storage\n mixins:\n - name: google.acl.v1.AccessControl\n root: acls\n\nThis implies the following inherited HTTP annotation:\n\n service Storage {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\";\n }\n ...\n }" + "id": "Mixin" }, "FlowOperationMetadata": { + "id": "FlowOperationMetadata", "description": "The metadata associated with a long running operation resource.", "type": "object", "properties": { + "deadline": { + "format": "google-datetime", + "description": "Deadline for the flow to complete, to prevent orphaned Operations.\n\nIf the flow has not completed by this time, it may be terminated by\nthe engine, or force-failed by Operation lookup.\n\nNote that this is not a hard deadline after which the Flow will\ndefinitely be failed, rather it is a deadline after which it is reasonable\nto suspect a problem and other parts of the system may kill operation\nto ensure we don't have orphans.\nsee also: go/prevent-orphaned-operations", + "type": "string" + }, "cancelState": { "enumDescriptions": [ "Default state, cancellable but not cancelled.", @@ -2533,68 +1629,47 @@ "description": "The state of the operation with respect to cancellation.", "type": "string" }, - "deadline": { - "type": "string", - "description": "Deadline for the flow to complete, to prevent orphaned Operations.\n\nIf the flow has not completed by this time, it may be terminated by\nthe engine, or force-failed by Operation lookup.\n\nNote that this is not a hard deadline after which the Flow will\ndefinitely be failed, rather it is a deadline after which it is reasonable\nto suspect a problem and other parts of the system may kill operation\nto ensure we don't have orphans.\nsee also: go/prevent-orphaned-operations", - "format": "google-datetime" - }, "startTime": { - "description": "The start time of the operation.", "format": "google-datetime", - "type": "string" - }, - "flowName": { - "description": "The name of the top-level flow corresponding to this operation.\nMust be equal to the \"name\" field for a FlowName enum.", + "description": "The start time of the operation.", "type": "string" }, "resourceNames": { "description": "The full name of the resources that this flow is directly associated with.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" + }, + "flowName": { + "description": "The name of the top-level flow corresponding to this operation.\nMust be equal to the \"name\" field for a FlowName enum.", + "type": "string" } - }, - "id": "FlowOperationMetadata" + } }, "CustomError": { + "description": "Customize service error responses. For example, list any service\nspecific protobuf types that can appear in error detail lists of\nerror responses.\n\nExample:\n\n custom_error:\n types:\n - google.foo.v1.CustomError\n - google.foo.v1.AnotherError", + "type": "object", "properties": { "types": { "description": "The list of custom error detail types, e.g. 'google.foo.v1.CustomError'.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "rules": { "description": "The list of custom error rules that apply to individual API messages.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", "items": { "$ref": "CustomErrorRule" - } + }, + "type": "array" } }, - "id": "CustomError", - "description": "Customize service error responses. For example, list any service\nspecific protobuf types that can appear in error detail lists of\nerror responses.\n\nExample:\n\n custom_error:\n types:\n - google.foo.v1.CustomError\n - google.foo.v1.AnotherError", - "type": "object" - }, - "CounterOptions": { - "description": "Options for counters", - "type": "object", - "properties": { - "metric": { - "description": "The metric to update.", - "type": "string" - }, - "field": { - "description": "The field value to attribute.", - "type": "string" - } - }, - "id": "CounterOptions" + "id": "CustomError" }, "Http": { - "description": "Defines the HTTP configuration for a service. It contains a list of\nHttpRule, each specifying the mapping of an RPC method\nto one or more HTTP REST API methods.", + "description": "Defines the HTTP configuration for an API service. It contains a list of\nHttpRule, each specifying the mapping of an RPC method\nto one or more HTTP REST API methods.", "type": "object", "properties": { "fullyDecodeReservedExpansion": { @@ -2602,32 +1677,32 @@ "type": "boolean" }, "rules": { - "type": "array", + "description": "A list of HTTP configuration rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", "items": { "$ref": "HttpRule" }, - "description": "A list of HTTP configuration rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." + "type": "array" } }, "id": "Http" }, "SourceInfo": { - "description": "Source information used to create a Service Config", - "type": "object", "properties": { "sourceFiles": { "description": "All files used during config generation.", - "type": "array", "items": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, "type": "object" - } + }, + "type": "array" } }, - "id": "SourceInfo" + "id": "SourceInfo", + "description": "Source information used to create a Service Config", + "type": "object" }, "Control": { "description": "Selects and configures the service controller used by the service. The\nservice controller handles features like abuse, quota, billing, logging,\nmonitoring, etc.", @@ -2641,23 +1716,23 @@ "id": "Control" }, "SystemParameter": { - "description": "Define a parameter's name and location. The parameter may be passed as either\nan HTTP header or a URL query parameter, and if both are passed the behavior\nis implementation-dependent.", "type": "object", "properties": { "name": { - "description": "Define the name of the parameter, such as \"api_key\" . It is case sensitive.", - "type": "string" + "type": "string", + "description": "Define the name of the parameter, such as \"api_key\" . It is case sensitive." }, "urlQueryParameter": { - "description": "Define the URL query parameter name to use for the parameter. It is case\nsensitive.", - "type": "string" + "type": "string", + "description": "Define the URL query parameter name to use for the parameter. It is case\nsensitive." }, "httpHeader": { - "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive.", - "type": "string" + "type": "string", + "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive." } }, - "id": "SystemParameter" + "id": "SystemParameter", + "description": "Define a parameter's name and location. The parameter may be passed as either\nan HTTP header or a URL query parameter, and if both are passed the behavior\nis implementation-dependent." }, "Monitoring": { "description": "Monitoring configuration of the service.\n\nThe example below shows how to configure monitored resources and metrics\nfor monitoring. In the example, a monitored resource and two metrics are\ndefined. The `library.googleapis.com/book/returned_count` metric is sent\nto both producer and consumer projects, whereas the\n`library.googleapis.com/book/overdue_count` metric is only sent to the\nconsumer project.\n\n monitored_resources:\n - type: library.googleapis.com/branch\n labels:\n - key: /city\n description: The city where the library branch is located in.\n - key: /name\n description: The name of the branch.\n metrics:\n - name: library.googleapis.com/book/returned_count\n metric_kind: DELTA\n value_type: INT64\n labels:\n - key: /customer_id\n - name: library.googleapis.com/book/overdue_count\n metric_kind: GAUGE\n value_type: INT64\n labels:\n - key: /customer_id\n monitoring:\n producer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/returned_count\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/returned_count\n - library.googleapis.com/book/overdue_count", @@ -2665,34 +1740,74 @@ "properties": { "consumerDestinations": { "description": "Monitoring configurations for sending metrics to the consumer project.\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A metric can be used in at most\none consumer destination.", - "type": "array", "items": { "$ref": "MonitoringDestination" - } + }, + "type": "array" }, "producerDestinations": { "description": "Monitoring configurations for sending metrics to the producer project.\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A metric can be used in at most\none producer destination.", - "type": "array", "items": { "$ref": "MonitoringDestination" - } + }, + "type": "array" } }, "id": "Monitoring" }, "Field": { + "description": "A single field of a message type.", "type": "object", "properties": { + "oneofIndex": { + "format": "int32", + "description": "The index of the field type in `Type.oneofs`, for message or enumeration\ntypes. The first type has index 1; zero means the type is not in the list.", + "type": "integer" + }, + "packed": { + "description": "Whether to use alternative packed wire representation.", + "type": "boolean" + }, + "cardinality": { + "enum": [ + "CARDINALITY_UNKNOWN", + "CARDINALITY_OPTIONAL", + "CARDINALITY_REQUIRED", + "CARDINALITY_REPEATED" + ], + "description": "The field cardinality.", + "type": "string", + "enumDescriptions": [ + "For fields with unknown cardinality.", + "For optional fields.", + "For required fields. Proto2 syntax only.", + "For repeated fields." + ] + }, + "defaultValue": { + "description": "The string value of the default value of this field. Proto2 syntax only.", + "type": "string" + }, + "name": { + "description": "The field name.", + "type": "string" + }, "typeUrl": { "description": "The field type URL, without the scheme, for message or enumeration\ntypes. Example: `\"type.googleapis.com/google.protobuf.Timestamp\"`.", "type": "string" }, "number": { - "description": "The field number.", "format": "int32", + "description": "The field number.", "type": "integer" }, + "jsonName": { + "description": "The field JSON name.", + "type": "string" + }, "kind": { + "description": "The field type.", + "type": "string", "enumDescriptions": [ "Field type unknown.", "Field type double.", @@ -2734,85 +1849,52 @@ "TYPE_SFIXED64", "TYPE_SINT32", "TYPE_SINT64" - ], - "description": "The field type.", - "type": "string" - }, - "jsonName": { - "description": "The field JSON name.", - "type": "string" + ] }, "options": { "description": "The protocol buffer options.", - "type": "array", "items": { "$ref": "Option" - } - }, - "oneofIndex": { - "description": "The index of the field type in `Type.oneofs`, for message or enumeration\ntypes. The first type has index 1; zero means the type is not in the list.", - "format": "int32", - "type": "integer" - }, - "cardinality": { - "enumDescriptions": [ - "For fields with unknown cardinality.", - "For optional fields.", - "For required fields. Proto2 syntax only.", - "For repeated fields." - ], - "enum": [ - "CARDINALITY_UNKNOWN", - "CARDINALITY_OPTIONAL", - "CARDINALITY_REQUIRED", - "CARDINALITY_REPEATED" - ], - "description": "The field cardinality.", - "type": "string" - }, - "packed": { - "description": "Whether to use alternative packed wire representation.", - "type": "boolean" - }, - "defaultValue": { - "description": "The string value of the default value of this field. Proto2 syntax only.", - "type": "string" - }, - "name": { - "description": "The field name.", - "type": "string" + }, + "type": "array" } }, - "id": "Field", - "description": "A single field of a message type." + "id": "Field" }, "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", - "type": "object", "properties": { "permissions": { "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "TestIamPermissionsRequest" + "id": "TestIamPermissionsRequest", + "description": "Request message for `TestIamPermissions` method.", + "type": "object" }, "Enum": { "type": "object", "properties": { + "enumvalue": { + "description": "Enum value definitions.", + "items": { + "$ref": "EnumValue" + }, + "type": "array" + }, + "name": { + "description": "Enum type name.", + "type": "string" + }, "options": { "description": "Protocol buffer options.", - "type": "array", "items": { "$ref": "Option" - } - }, - "sourceContext": { - "$ref": "SourceContext", - "description": "The source context." + }, + "type": "array" }, "syntax": { "description": "The source syntax.", @@ -2826,16 +1908,9 @@ "SYNTAX_PROTO3" ] }, - "name": { - "type": "string", - "description": "Enum type name." - }, - "enumvalue": { - "description": "Enum value definitions.", - "type": "array", - "items": { - "$ref": "EnumValue" - } + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." } }, "id": "Enum", @@ -2846,8 +1921,8 @@ "type": "object", "properties": { "consumerId": { - "description": "The identity of consumer resource which service enablement will be\napplied to.\n\nThe Google Service Management implementation accepts the following\nforms:\n- \"project:\u003cproject_id\u003e\"\n\nNote: this is made compatible with\ngoogle.api.servicecontrol.v1.Operation.consumer_id.", - "type": "string" + "type": "string", + "description": "The identity of consumer resource which service enablement will be\napplied to.\n\nThe Google Service Management implementation accepts the following\nforms:\n- \"project:\u003cproject_id\u003e\"\n\nNote: this is made compatible with\ngoogle.api.servicecontrol.v1.Operation.consumer_id." } }, "id": "EnableServiceRequest" @@ -2857,24 +1932,24 @@ "type": "object", "properties": { "message": { - "description": "Message describing the error or warning.", - "type": "string" + "type": "string", + "description": "Message describing the error or warning." }, "location": { - "description": "File name and line number of the error or warning.", - "type": "string" + "type": "string", + "description": "File name and line number of the error or warning." }, "kind": { + "enumDescriptions": [ + "Warnings and errors", + "Only errors" + ], "enum": [ "WARNING", "ERROR" ], "description": "The kind of diagnostic information provided.", - "type": "string", - "enumDescriptions": [ - "Warnings and errors", - "Only errors" - ] + "type": "string" } }, "id": "Diagnostic" @@ -2883,6 +1958,14 @@ "description": "A description of a label.", "type": "object", "properties": { + "key": { + "description": "The label key.", + "type": "string" + }, + "description": { + "description": "A human-readable description for the label.", + "type": "string" + }, "valueType": { "enum": [ "STRING", @@ -2896,173 +1979,165 @@ "Boolean; true or false.", "A 64-bit signed integer." ] - }, - "key": { - "description": "The label key.", - "type": "string" - }, - "description": { - "type": "string", - "description": "A human-readable description for the label." } }, "id": "LabelDescriptor" }, + "Type": { + "id": "Type", + "description": "A protocol buffer message type.", + "type": "object", + "properties": { + "syntax": { + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ], + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax.", + "type": "string" + }, + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." + }, + "options": { + "description": "The protocol buffer options.", + "items": { + "$ref": "Option" + }, + "type": "array" + }, + "fields": { + "description": "The list of fields.", + "items": { + "$ref": "Field" + }, + "type": "array" + }, + "name": { + "description": "The fully qualified message name.", + "type": "string" + }, + "oneofs": { + "description": "The list of types appearing in `oneof` definitions in this type.", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, "GenerateConfigReportResponse": { - "id": "GenerateConfigReportResponse", "description": "Response message for GenerateConfigReport method.", "type": "object", "properties": { + "changeReports": { + "description": "list of ChangeReport, each corresponding to comparison between two\nservice configurations.", + "items": { + "$ref": "ChangeReport" + }, + "type": "array" + }, "id": { "description": "ID of the service configuration this report belongs to.", "type": "string" }, "diagnostics": { "description": "Errors / Linter warnings associated with the service definition this\nreport\nbelongs to.", - "type": "array", "items": { "$ref": "Diagnostic" - } + }, + "type": "array" }, "serviceName": { "description": "Name of the service this report belongs to.", "type": "string" - }, - "changeReports": { - "description": "list of ChangeReport, each corresponding to comparison between two\nservice configurations.", - "type": "array", - "items": { - "$ref": "ChangeReport" - } - } - } - }, - "Type": { - "description": "A protocol buffer message type.", - "type": "object", - "properties": { - "options": { - "type": "array", - "items": { - "$ref": "Option" - }, - "description": "The protocol buffer options." - }, - "fields": { - "description": "The list of fields.", - "type": "array", - "items": { - "$ref": "Field" - } - }, - "name": { - "type": "string", - "description": "The fully qualified message name." - }, - "oneofs": { - "description": "The list of types appearing in `oneof` definitions in this type.", - "type": "array", - "items": { - "type": "string" - } - }, - "syntax": { - "enum": [ - "SYNTAX_PROTO2", - "SYNTAX_PROTO3" - ], - "description": "The source syntax.", - "type": "string", - "enumDescriptions": [ - "Syntax `proto2`.", - "Syntax `proto3`." - ] - }, - "sourceContext": { - "$ref": "SourceContext", - "description": "The source context." } }, - "id": "Type" - }, - "Experimental": { - "description": "Experimental service configuration. These configuration options can\nonly be used by whitelisted users.", - "type": "object", - "properties": { - "authorization": { - "description": "Authorization configuration.", - "$ref": "AuthorizationConfig" - } - }, - "id": "Experimental" + "id": "GenerateConfigReportResponse" }, "ListServiceConfigsResponse": { "description": "Response message for ListServiceConfigs method.", "type": "object", "properties": { - "serviceConfigs": { - "description": "The list of service configuration resources.", - "type": "array", - "items": { - "$ref": "Service" - } - }, "nextPageToken": { "description": "The token of the next page of results.", "type": "string" + }, + "serviceConfigs": { + "description": "The list of service configuration resources.", + "items": { + "$ref": "Service" + }, + "type": "array" } }, "id": "ListServiceConfigsResponse" }, + "Experimental": { + "id": "Experimental", + "description": "Experimental service configuration. These configuration options can\nonly be used by whitelisted users.", + "type": "object", + "properties": { + "authorization": { + "$ref": "AuthorizationConfig", + "description": "Authorization configuration." + } + } + }, + "Backend": { + "id": "Backend", + "description": "`Backend` defines the backend configuration for a service.", + "type": "object", + "properties": { + "rules": { + "description": "A list of API backend rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "BackendRule" + }, + "type": "array" + } + } + }, "AuditConfig": { "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", "type": "object", "properties": { "service": { - "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services.", - "type": "string" + "type": "string", + "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services." }, "auditLogConfigs": { "description": "The configuration for logging of each type of permission.\nNext ID: 4", - "type": "array", "items": { "$ref": "AuditLogConfig" - } + }, + "type": "array" }, "exemptedMembers": { - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, "id": "AuditConfig" }, - "Backend": { - "description": "`Backend` defines the backend configuration for a service.", - "type": "object", - "properties": { - "rules": { - "description": "A list of API backend rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", - "items": { - "$ref": "BackendRule" - } - } - }, - "id": "Backend" - }, "SubmitConfigSourceRequest": { "description": "Request message for SubmitConfigSource method.", "type": "object", "properties": { - "configSource": { - "$ref": "ConfigSource", - "description": "The source configuration for the service." - }, "validateOnly": { "description": "Optional. If set, this will result in the generation of a\n`google.api.Service` configuration based on the `ConfigSource` provided,\nbut the generated config and the sources will NOT be persisted.", "type": "boolean" + }, + "configSource": { + "$ref": "ConfigSource", + "description": "The source configuration for the service." } }, "id": "SubmitConfigSourceRequest" @@ -3072,8 +2147,8 @@ "type": "object", "properties": { "provider": { - "type": "string", - "description": "The name of the authorization provider, such as\nfirebaserules.googleapis.com." + "description": "The name of the authorization provider, such as\nfirebaserules.googleapis.com.", + "type": "string" } }, "id": "AuthorizationConfig" @@ -3082,89 +2157,68 @@ "description": "A documentation rule provides information about individual API elements.", "type": "object", "properties": { - "selector": { - "description": "The selector is a comma-separated list of patterns. Each pattern is a\nqualified name of the element which may end in \"*\", indicating a wildcard.\nWildcards are only allowed at the end and for a whole component of the\nqualified name, i.e. \"foo.*\" is ok, but not \"foo.b*\" or \"foo.*.bar\". To\nspecify a default for all applicable elements, the whole pattern \"*\"\nis used.", - "type": "string" - }, "description": { - "description": "Description of the selected API(s).", - "type": "string" + "type": "string", + "description": "Description of the selected API(s)." }, "deprecationDescription": { "description": "Deprecation description of the selected element(s). It can be provided if an\nelement is marked as `deprecated`.", "type": "string" + }, + "selector": { + "description": "The selector is a comma-separated list of patterns. Each pattern is a\nqualified name of the element which may end in \"*\", indicating a wildcard.\nWildcards are only allowed at the end and for a whole component of the\nqualified name, i.e. \"foo.*\" is ok, but not \"foo.b*\" or \"foo.*.bar\". To\nspecify a default for all applicable elements, the whole pattern \"*\"\nis used.", + "type": "string" } }, "id": "DocumentationRule" }, - "CloudAuditOptions": { - "description": "Write a Cloud Audit log", - "type": "object", - "properties": { - "logName": { - "enum": [ - "UNSPECIFIED_LOG_NAME", - "ADMIN_ACTIVITY", - "DATA_ACCESS" - ], - "description": "The log_name to populate in the Cloud Audit Record.", - "type": "string", - "enumDescriptions": [ - "Default. Should not be used.", - "Corresponds to \"cloudaudit.googleapis.com/activity\"", - "Corresponds to \"cloudaudit.googleapis.com/data_access\"" - ] - } - }, - "id": "CloudAuditOptions" - }, "ContextRule": { + "description": "A context rule provides information about the context for an individual API\nelement.", + "type": "object", "properties": { "requested": { "description": "A list of full type names of requested contexts.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "selector": { - "type": "string", - "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details." + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" }, "provided": { "description": "A list of full type names of provided contexts.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } }, - "id": "ContextRule", - "description": "A context rule provides information about the context for an individual API\nelement.", - "type": "object" + "id": "ContextRule" }, "MetricDescriptor": { + "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.", + "type": "object", "properties": { - "unit": { - "description": "The unit in which the metric value is reported. It is only applicable\nif the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The\nsupported units are a subset of [The Unified Code for Units of\nMeasure](http://unitsofmeasure.org/ucum.html) standard:\n\n**Basic units (UNIT)**\n\n* `bit` bit\n* `By` byte\n* `s` second\n* `min` minute\n* `h` hour\n* `d` day\n\n**Prefixes (PREFIX)**\n\n* `k` kilo (10**3)\n* `M` mega (10**6)\n* `G` giga (10**9)\n* `T` tera (10**12)\n* `P` peta (10**15)\n* `E` exa (10**18)\n* `Z` zetta (10**21)\n* `Y` yotta (10**24)\n* `m` milli (10**-3)\n* `u` micro (10**-6)\n* `n` nano (10**-9)\n* `p` pico (10**-12)\n* `f` femto (10**-15)\n* `a` atto (10**-18)\n* `z` zepto (10**-21)\n* `y` yocto (10**-24)\n* `Ki` kibi (2**10)\n* `Mi` mebi (2**20)\n* `Gi` gibi (2**30)\n* `Ti` tebi (2**40)\n\n**Grammar**\n\nThe grammar includes the dimensionless unit `1`, such as `1/s`.\n\nThe grammar also includes these connectors:\n\n* `/` division (as an infix operator, e.g. `1/s`).\n* `.` multiplication (as an infix operator, e.g. `GBy.d`)\n\nThe grammar for a unit is as follows:\n\n Expression = Component { \".\" Component } { \"/\" Component } ;\n\n Component = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\n Annotation = \"{\" NAME \"}\" ;\n\nNotes:\n\n* `Annotation` is just a comment if it follows a `UNIT` and is\n equivalent to `1` if it is used alone. For examples,\n `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.\n* `NAME` is a sequence of non-blank printable ASCII characters not\n containing '{' or '}'.", - "type": "string" - }, - "labels": { - "description": "The set of labels that can be used to describe a specific\ninstance of this metric type. For example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", - "type": "array", - "items": { - "$ref": "LabelDescriptor" - } - }, "name": { - "type": "string", - "description": "The resource name of the metric descriptor. Depending on the\nimplementation, the name typically includes: (1) the parent resource name\nthat defines the scope of the metric type or of its data; and (2) the\nmetric's URL-encoded type, which also appears in the `type` field of this\ndescriptor. For example, following is the resource name of a custom\nmetric within the GCP project `my-project-id`:\n\n \"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"" + "description": "The resource name of the metric descriptor. Depending on the\nimplementation, the name typically includes: (1) the parent resource name\nthat defines the scope of the metric type or of its data; and (2) the\nmetric's URL-encoded type, which also appears in the `type` field of this\ndescriptor. For example, following is the resource name of a custom\nmetric within the GCP project `my-project-id`:\n\n \"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"", + "type": "string" }, "type": { "description": "The metric type, including its DNS name prefix. The type is not\nURL-encoded. All user-defined custom metric types have the DNS name\n`custom.googleapis.com`. Metric types should use a natural hierarchical\ngrouping. For example:\n\n \"custom.googleapis.com/invoice/paid/amount\"\n \"appengine.googleapis.com/http/server/response_latencies\"", "type": "string" }, "valueType": { + "enumDescriptions": [ + "Do not use this default value.", + "The value is a boolean.\nThis value type can be used only if the metric kind is `GAUGE`.", + "The value is a signed 64-bit integer.", + "The value is a double precision floating point number.", + "The value is a text string.\nThis value type can be used only if the metric kind is `GAUGE`.", + "The value is a `Distribution`.", + "The value is money." + ], "enum": [ "VALUE_TYPE_UNSPECIFIED", "BOOL", @@ -3175,18 +2229,15 @@ "MONEY" ], "description": "Whether the measurement is an integer, a floating-point number, etc.\nSome combinations of `metric_kind` and `value_type` might not be supported.", - "type": "string", - "enumDescriptions": [ - "Do not use this default value.", - "The value is a boolean.\nThis value type can be used only if the metric kind is `GAUGE`.", - "The value is a signed 64-bit integer.", - "The value is a double precision floating point number.", - "The value is a text string.\nThis value type can be used only if the metric kind is `GAUGE`.", - "The value is a `Distribution`.", - "The value is money." - ] + "type": "string" }, "metricKind": { + "enumDescriptions": [ + "Do not use this default value.", + "An instantaneous measurement of a value.", + "The change in a value during a time interval.", + "A value accumulated over a time interval. Cumulative\nmeasurements in a time series should have the same start time\nand increasing end times, until an event resets the cumulative\nvalue to zero and sets a new start time for the following\npoints." + ], "enum": [ "METRIC_KIND_UNSPECIFIED", "GAUGE", @@ -3194,29 +2245,31 @@ "CUMULATIVE" ], "description": "Whether the metric records instantaneous values, changes to a value, etc.\nSome combinations of `metric_kind` and `value_type` might not be supported.", - "type": "string", - "enumDescriptions": [ - "Do not use this default value.", - "An instantaneous measurement of a value.", - "The change in a value during a time interval.", - "A value accumulated over a time interval. Cumulative\nmeasurements in a time series should have the same start time\nand increasing end times, until an event resets the cumulative\nvalue to zero and sets a new start time for the following\npoints." - ] - }, - "displayName": { - "description": "A concise name for the metric, which can be displayed in user interfaces.\nUse sentence case without an ending period, for example \"Request count\".", "type": "string" }, "description": { "description": "A detailed description of the metric, which can be used in documentation.", "type": "string" + }, + "displayName": { + "type": "string", + "description": "A concise name for the metric, which can be displayed in user interfaces.\nUse sentence case without an ending period, for example \"Request count\"." + }, + "unit": { + "description": "The unit in which the metric value is reported. It is only applicable\nif the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The\nsupported units are a subset of [The Unified Code for Units of\nMeasure](http://unitsofmeasure.org/ucum.html) standard:\n\n**Basic units (UNIT)**\n\n* `bit` bit\n* `By` byte\n* `s` second\n* `min` minute\n* `h` hour\n* `d` day\n\n**Prefixes (PREFIX)**\n\n* `k` kilo (10**3)\n* `M` mega (10**6)\n* `G` giga (10**9)\n* `T` tera (10**12)\n* `P` peta (10**15)\n* `E` exa (10**18)\n* `Z` zetta (10**21)\n* `Y` yotta (10**24)\n* `m` milli (10**-3)\n* `u` micro (10**-6)\n* `n` nano (10**-9)\n* `p` pico (10**-12)\n* `f` femto (10**-15)\n* `a` atto (10**-18)\n* `z` zepto (10**-21)\n* `y` yocto (10**-24)\n* `Ki` kibi (2**10)\n* `Mi` mebi (2**20)\n* `Gi` gibi (2**30)\n* `Ti` tebi (2**40)\n\n**Grammar**\n\nThe grammar includes the dimensionless unit `1`, such as `1/s`.\n\nThe grammar also includes these connectors:\n\n* `/` division (as an infix operator, e.g. `1/s`).\n* `.` multiplication (as an infix operator, e.g. `GBy.d`)\n\nThe grammar for a unit is as follows:\n\n Expression = Component { \".\" Component } { \"/\" Component } ;\n\n Component = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\n Annotation = \"{\" NAME \"}\" ;\n\nNotes:\n\n* `Annotation` is just a comment if it follows a `UNIT` and is\n equivalent to `1` if it is used alone. For examples,\n `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.\n* `NAME` is a sequence of non-blank printable ASCII characters not\n containing '{' or '}'.", + "type": "string" + }, + "labels": { + "description": "The set of labels that can be used to describe a specific\ninstance of this metric type. For example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" } }, - "id": "MetricDescriptor", - "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.", - "type": "object" + "id": "MetricDescriptor" }, "SourceContext": { - "description": "`SourceContext` represents information about the source of a\nprotobuf element, like the file in which it is defined.", "type": "object", "properties": { "fileName": { @@ -3224,130 +2277,38 @@ "type": "string" } }, - "id": "SourceContext" + "id": "SourceContext", + "description": "`SourceContext` represents information about the source of a\nprotobuf element, like the file in which it is defined." }, - "ListServicesResponse": { - "description": "Response message for `ListServices` method.", + "Expr": { + "description": "Represents an expression text. Example:\n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\"", "type": "object", "properties": { - "services": { - "description": "The returned services will only have the name field set.", - "type": "array", - "items": { - "$ref": "ManagedService" - } + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI." }, - "nextPageToken": { - "description": "Token that can be passed to `ListServices` to resume a paginated query.", + "expression": { + "type": "string", + "description": "Textual representation of an expression in\nCommon Expression Language syntax.\n\nThe application context of the containing message determines which\nwell-known feature set of CEL is supported." + }, + "location": { + "description": "An optional string indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file.", + "type": "string" + }, + "title": { + "description": "An optional title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.", "type": "string" } }, - "id": "ListServicesResponse" - }, - "Endpoint": { - "description": "`Endpoint` describes a network endpoint that serves a set of APIs.\nA service may expose any number of endpoints, and all endpoints share the\nsame service configuration, such as quota configuration and monitoring\nconfiguration.\n\nExample service configuration:\n\n name: library-example.googleapis.com\n endpoints:\n # Below entry makes 'google.example.library.v1.Library'\n # API be served from endpoint address library-example.googleapis.com.\n # It also allows HTTP OPTIONS calls to be passed to the backend, for\n # it to decide whether the subsequent cross-origin request is\n # allowed to proceed.\n - name: library-example.googleapis.com\n allow_cors: true", - "type": "object", - "properties": { - "apis": { - "description": "The list of APIs served by this endpoint.\n\nIf no APIs are specified this translates to \"all APIs\" exported by the\nservice, as defined in the top-level service configuration.", - "type": "array", - "items": { - "type": "string" - } - }, - "allowCors": { - "description": "Allowing\n[CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka\ncross-domain traffic, would allow the backends served from this endpoint to\nreceive and respond to HTTP OPTIONS requests. The response will be used by\nthe browser to determine whether the subsequent cross-origin request is\nallowed to proceed.", - "type": "boolean" - }, - "aliases": { - "type": "array", - "items": { - "type": "string" - }, - "description": "DEPRECATED: This field is no longer supported. Instead of using aliases,\nplease specify multiple google.api.Endpoint for each of the intented\nalias.\n\nAdditional names that this endpoint will be hosted on." - }, - "target": { - "description": "The specification of an Internet routable address of API frontend that will\nhandle requests to this [API Endpoint](https://cloud.google.com/apis/design/glossary).\nIt should be either a valid IPv4 address or a fully-qualified domain name.\nFor example, \"8.8.8.8\" or \"myservice.appspot.com\".", - "type": "string" - }, - "name": { - "description": "The canonical name of this endpoint.", - "type": "string" - }, - "features": { - "description": "The list of features enabled on this endpoint.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "Endpoint" - }, - "OAuthRequirements": { - "description": "OAuth scopes are a way to define data and permissions on data. For example,\nthere are scopes defined for \"Read-only access to Google Calendar\" and\n\"Access to Cloud Platform\". Users can consent to a scope for an application,\ngiving it permission to access that data on their behalf.\n\nOAuth scope specifications should be fairly coarse grained; a user will need\nto see and understand the text description of what your scope means.\n\nIn most cases: use one or at most two OAuth scopes for an entire family of\nproducts. If your product has multiple APIs, you should probably be sharing\nthe OAuth scope across all of those APIs.\n\nWhen you need finer grained OAuth consent screens: talk with your product\nmanagement about how developers will use them in practice.\n\nPlease note that even though each of the canonical scopes is enough for a\nrequest to be accepted and passed to the backend, a request can still fail\ndue to the backend requiring additional scopes or permissions.", - "type": "object", - "properties": { - "canonicalScopes": { - "description": "The list of publicly documented OAuth scopes that are allowed access. An\nOAuth token containing any of these scopes will be accepted.\n\nExample:\n\n canonical_scopes: https://www.googleapis.com/auth/calendar,\n https://www.googleapis.com/auth/calendar.read", - "type": "string" - } - }, - "id": "OAuthRequirements" - }, - "TestIamPermissionsResponse": { - "description": "Response message for `TestIamPermissions` method.", - "type": "object", - "properties": { - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed." - } - }, - "id": "TestIamPermissionsResponse" - }, - "GetIamPolicyRequest": { - "description": "Request message for `GetIamPolicy` method.", - "type": "object", - "properties": {}, - "id": "GetIamPolicyRequest" - }, - "Usage": { - "description": "Configuration controlling usage of a service.", - "type": "object", - "properties": { - "requirements": { - "description": "Requirements that must be satisfied before a consumer project can use the\nservice. Each requirement is of the form \u003cservice.name\u003e/\u003crequirement-id\u003e;\nfor example 'serviceusage.googleapis.com/billing-enabled'.", - "type": "array", - "items": { - "type": "string" - } - }, - "producerNotificationChannel": { - "description": "The full resource name of a channel used for sending notifications to the\nservice producer.\n\nGoogle Service Management currently only supports\n[Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification\nchannel. To use Google Cloud Pub/Sub as the channel, this must be the name\nof a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format\ndocumented in https://cloud.google.com/pubsub/docs/overview.", - "type": "string" - }, - "rules": { - "description": "A list of usage rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", - "type": "array", - "items": { - "$ref": "UsageRule" - } - } - }, - "id": "Usage" + "id": "Expr" } }, "protocol": "rest", "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "version": "v1", - "baseUrl": "https://servicemanagement.googleapis.com/", "canonicalName": "Service Management", "auth": { "oauth2": { @@ -3358,17 +2319,878 @@ "https://www.googleapis.com/auth/service.management": { "description": "Manage your Google API service configuration" }, - "https://www.googleapis.com/auth/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" - }, "https://www.googleapis.com/auth/service.management.readonly": { "description": "View your Google API service configuration" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" } } } }, - "kind": "discovery#restDescription", + "rootUrl": "https://servicemanagement.googleapis.com/", + "ownerDomain": "google.com", + "name": "servicemanagement", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Service Management API", + "ownerName": "Google", + "resources": { + "services": { + "methods": { + "list": { + "description": "Lists managed services.\n\nReturns all public services. For authenticated users, also returns all\nservices the calling user has \"servicemanagement.services.get\" permission\nfor.\n\n**BETA:** If the caller specifies the `consumer_id`, it returns only the\nservices enabled on the consumer. The `consumer_id` must have the format\nof \"project:{PROJECT-ID}\".", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListServicesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "parameters": { + "consumerId": { + "description": "Include services consumed by the specified consumer.\n\nThe Google Service Management implementation accepts the following\nforms:\n- project:\u003cproject_id\u003e", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "Token identifying which result to start with; returned by a previous list\ncall.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested size of the next page of data.", + "type": "integer" + }, + "producerProjectId": { + "type": "string", + "location": "query", + "description": "Include services produced by the specified project." + } + }, + "flatPath": "v1/services", + "path": "v1/services", + "id": "servicemanagement.services.list" + }, + "create": { + "request": { + "$ref": "ManagedService" + }, + "description": "Creates a new managed service.\nPlease note one producer project can own no more than 20 services.\n\nOperation\u003cresponse: ManagedService\u003e", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": {}, + "flatPath": "v1/services", + "id": "servicemanagement.services.create", + "path": "v1/services" + }, + "generateConfigReport": { + "request": { + "$ref": "GenerateConfigReportRequest" + }, + "description": "Generates and returns a report (errors, warnings and changes from\nexisting configurations) associated with\nGenerateConfigReportRequest.new_value\n\nIf GenerateConfigReportRequest.old_value is specified,\nGenerateConfigReportRequest will contain a single ChangeReport based on the\ncomparison between GenerateConfigReportRequest.new_value and\nGenerateConfigReportRequest.old_value.\nIf GenerateConfigReportRequest.old_value is not specified, this method\nwill compare GenerateConfigReportRequest.new_value with the last pushed\nservice configuration.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GenerateConfigReportResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": {}, + "flatPath": "v1/services:generateConfigReport", + "path": "v1/services:generateConfigReport", + "id": "servicemanagement.services.generateConfigReport" + }, + "get": { + "id": "servicemanagement.services.get", + "path": "v1/services/{serviceName}", + "description": "Gets a managed service. Authentication is required unless the service is\npublic.", + "response": { + "$ref": "ManagedService" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "GET", + "parameters": { + "serviceName": { + "description": "The name of the service. See the `ServiceManager` overview for naming\nrequirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "flatPath": "v1/services/{serviceName}" + }, + "testIamPermissions": { + "path": "v1/{+resource}:testIamPermissions", + "id": "servicemanagement.services.testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^services/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "flatPath": "v1/services/{servicesId}:testIamPermissions" + }, + "getConfig": { + "path": "v1/services/{serviceName}/config", + "id": "servicemanagement.services.getConfig", + "description": "Gets a service configuration (version) for a managed service.", + "httpMethod": "GET", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "serviceName" + ], + "parameters": { + "serviceName": { + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true + }, + "configId": { + "type": "string", + "location": "query", + "description": "The id of the service configuration resource." + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Specifies which parts of the Service Config should be returned in the\nresponse.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "flatPath": "v1/services/{serviceName}/config" + }, + "delete": { + "description": "Deletes a managed service. This method will change the service to the\n`Soft-Delete` state for 30 days. Within this period, service producers may\ncall UndeleteService to restore the service.\nAfter 30 days, the service will be permanently deleted.\n\nOperation\u003cresponse: google.protobuf.Empty\u003e", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "serviceName": { + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/services/{serviceName}", + "id": "servicemanagement.services.delete", + "path": "v1/services/{serviceName}" + }, + "enable": { + "httpMethod": "POST", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "serviceName": { + "type": "string", + "required": true, + "location": "path", + "description": "Name of the service to enable. Specifying an unknown service name will\ncause the request to fail." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/services/{serviceName}:enable", + "path": "v1/services/{serviceName}:enable", + "id": "servicemanagement.services.enable", + "description": "Enables a service for a project, so it can be used\nfor the project. See\n[Cloud Auth Guide](https://cloud.google.com/docs/authentication) for\nmore information.\n\nOperation\u003cresponse: EnableServiceResponse\u003e", + "request": { + "$ref": "EnableServiceRequest" + } + }, + "setIamPolicy": { + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "pattern": "^services/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/services/{servicesId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "servicemanagement.services.setIamPolicy" + }, + "disable": { + "httpMethod": "POST", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "serviceName": { + "description": "Name of the service to disable. Specifying an unknown service name\nwill cause the request to fail.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/services/{serviceName}:disable", + "path": "v1/services/{serviceName}:disable", + "id": "servicemanagement.services.disable", + "description": "Disables a service for a project, so it can no longer be\nbe used for the project. It prevents accidental usage that may cause\nunexpected billing charges or security leaks.\n\nOperation\u003cresponse: DisableServiceResponse\u003e", + "request": { + "$ref": "DisableServiceRequest" + } + }, + "getIamPolicy": { + "flatPath": "v1/services/{servicesId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "servicemanagement.services.getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "parameters": { + "resource": { + "pattern": "^services/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true + } + } + }, + "undelete": { + "description": "Revives a previously deleted managed service. The method restores the\nservice using the configuration at the time the service was deleted.\nThe target service must exist and must have been deleted within the\nlast 30 days.\n\nOperation\u003cresponse: UndeleteServiceResponse\u003e", + "httpMethod": "POST", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "serviceName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "serviceName": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`." + } + }, + "flatPath": "v1/services/{serviceName}:undelete", + "path": "v1/services/{serviceName}:undelete", + "id": "servicemanagement.services.undelete" + } + }, + "resources": { + "configs": { + "methods": { + "submit": { + "httpMethod": "POST", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "serviceName": { + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/services/{serviceName}/configs:submit", + "path": "v1/services/{serviceName}/configs:submit", + "id": "servicemanagement.services.configs.submit", + "description": "Creates a new service configuration (version) for a managed service based\non\nuser-supplied configuration source files (for example: OpenAPI\nSpecification). This method stores the source configurations as well as the\ngenerated service configuration. To rollout the service configuration to\nother services,\nplease call CreateServiceRollout.\n\nOperation\u003cresponse: SubmitConfigSourceResponse\u003e", + "request": { + "$ref": "SubmitConfigSourceRequest" + } + }, + "get": { + "description": "Gets a service configuration (version) for a managed service.", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "serviceName", + "configId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "parameters": { + "configId": { + "location": "path", + "description": "The id of the service configuration resource.", + "type": "string", + "required": true + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Specifies which parts of the Service Config should be returned in the\nresponse.", + "type": "string" + }, + "serviceName": { + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/services/{serviceName}/configs/{configId}", + "id": "servicemanagement.services.configs.get", + "path": "v1/services/{serviceName}/configs/{configId}" + }, + "list": { + "flatPath": "v1/services/{serviceName}/configs", + "id": "servicemanagement.services.configs.list", + "path": "v1/services/{serviceName}/configs", + "description": "Lists the history of the service configuration for a managed service,\nfrom the newest to the oldest.", + "response": { + "$ref": "ListServiceConfigsResponse" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "GET", + "parameters": { + "serviceName": { + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true + }, + "pageToken": { + "location": "query", + "description": "The token of the page to retrieve.", + "type": "string" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "The max number of items to include in the response list." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ] + }, + "create": { + "flatPath": "v1/services/{serviceName}/configs", + "path": "v1/services/{serviceName}/configs", + "id": "servicemanagement.services.configs.create", + "description": "Creates a new service configuration (version) for a managed service.\nThis method only stores the service configuration. To roll out the service\nconfiguration to backend systems please call\nCreateServiceRollout.", + "request": { + "$ref": "Service" + }, + "httpMethod": "POST", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "Service" + }, + "parameters": { + "serviceName": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ] + } + } + }, + "consumers": { + "methods": { + "testIamPermissions": { + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^services/[^/]+/consumers/[^/]+$" + } + }, + "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:testIamPermissions", + "id": "servicemanagement.services.consumers.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning." + }, + "getIamPolicy": { + "id": "servicemanagement.services.consumers.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^services/[^/]+/consumers/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:getIamPolicy" + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^services/[^/]+/consumers/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "servicemanagement.services.consumers.setIamPolicy" + } + } + }, + "rollouts": { + "methods": { + "get": { + "flatPath": "v1/services/{serviceName}/rollouts/{rolloutId}", + "id": "servicemanagement.services.rollouts.get", + "path": "v1/services/{serviceName}/rollouts/{rolloutId}", + "description": "Gets a service configuration rollout.", + "response": { + "$ref": "Rollout" + }, + "parameterOrder": [ + "serviceName", + "rolloutId" + ], + "httpMethod": "GET", + "parameters": { + "serviceName": { + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true + }, + "rolloutId": { + "type": "string", + "required": true, + "location": "path", + "description": "The id of the rollout resource." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ] + }, + "list": { + "flatPath": "v1/services/{serviceName}/rollouts", + "path": "v1/services/{serviceName}/rollouts", + "id": "servicemanagement.services.rollouts.list", + "description": "Lists the history of the service configuration rollouts for a managed\nservice, from the newest to the oldest.", + "httpMethod": "GET", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "ListServiceRolloutsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ], + "parameters": { + "serviceName": { + "type": "string", + "required": true, + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`." + }, + "pageToken": { + "location": "query", + "description": "The token of the page to retrieve.", + "type": "string" + }, + "pageSize": { + "format": "int32", + "description": "The max number of items to include in the response list.", + "type": "integer", + "location": "query" + }, + "filter": { + "description": "Use `filter` to return subset of rollouts.\nThe following filters are supported:\n -- To limit the results to only those in\n [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS',\n use filter='status=SUCCESS'\n -- To limit the results to those in\n [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED'\n or 'FAILED', use filter='status=CANCELLED OR status=FAILED'", + "type": "string", + "location": "query" + } + } + }, + "create": { + "flatPath": "v1/services/{serviceName}/rollouts", + "path": "v1/services/{serviceName}/rollouts", + "id": "servicemanagement.services.rollouts.create", + "request": { + "$ref": "Rollout" + }, + "description": "Creates a new service configuration rollout. Based on rollout, the\nGoogle Service Management will roll out the service configurations to\ndifferent backend services. For example, the logging configuration will be\npushed to Google Cloud Logging.\n\nPlease note that any previous pending and running Rollouts and associated\nOperations will be automatically cancelled so that the latest Rollout will\nnot be blocked by previous Rollouts.\n\nOperation\u003cresponse: Rollout\u003e", + "httpMethod": "POST", + "parameterOrder": [ + "serviceName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "serviceName": { + "location": "path", + "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.", + "type": "string", + "required": true + } + } + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^operations/.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/operations/{operationsId}", + "id": "servicemanagement.operations.get", + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + }, + "list": { + "id": "servicemanagement.operations.list", + "path": "v1/operations", + "description": "Lists service operations that match the specified filter in the request.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "name": { + "description": "Not used.", + "type": "string", + "location": "query" + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "The maximum number of operations to return. If unspecified, defaults to\n50. The maximum value is 100." + }, + "filter": { + "location": "query", + "description": "A string for filtering Operations.\n The following filter fields are supported:\n\n * serviceName: Required. Only `=` operator is allowed.\n * startTime: The time this job was started, in ISO 8601 format.\n Allowed operators are `\u003e=`, `\u003e`, `\u003c=`, and `\u003c`.\n * status: Can be `done`, `in_progress`, or `failed`. Allowed\n operators are `=`, and `!=`.\n\n Filter expression supports conjunction (AND) and disjunction (OR)\n logical operators. However, the serviceName restriction must be at the\n top-level and can only be combined with other restrictions via the AND\n logical operator.\n\n Examples:\n\n * `serviceName={some-service}.googleapis.com`\n * `serviceName={some-service}.googleapis.com AND startTime\u003e=\"2017-02-01\"`\n * `serviceName={some-service}.googleapis.com AND status=done`\n * `serviceName={some-service}.googleapis.com AND (status=done OR startTime\u003e=\"2017-02-01\")`", + "type": "string" + } + }, + "flatPath": "v1/operations" + } + } + } + }, + "parameters": { + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + } + }, + "version": "v1", + "baseUrl": "https://servicemanagement.googleapis.com/", "servicePath": "", "description": "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers.", - "rootUrl": "https://servicemanagement.googleapis.com/" + "kind": "discovery#restDescription", + "basePath": "" } diff --git a/etc/api/serviceuser/v1/serviceuser-api.json b/etc/api/serviceuser/v1/serviceuser-api.json new file mode 100644 index 0000000000..46bbf94b92 --- /dev/null +++ b/etc/api/serviceuser/v1/serviceuser-api.json @@ -0,0 +1,2002 @@ +{ + "ownerDomain": "google.com", + "name": "serviceuser", + "batchPath": "batch", + "title": "Google Service User API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "services": { + "methods": { + "disable": { + "request": { + "$ref": "DisableServiceRequest" + }, + "description": "Disable a service so it can no longer be used with a\nproject. This prevents unintended usage that may cause unexpected billing\ncharges or security leaks.\n\nOperation\u003cresponse: google.protobuf.Empty\u003e", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "name": { + "description": "Name of the consumer and the service to disable for that consumer.\n\nThe Service User implementation accepts the following forms for consumer:\n- \"project:\u003cproject_id\u003e\"\n\nA valid path would be:\n- /v1/projects/my-project/services/servicemanagement.googleapis.com:disable", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/services/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/services/{servicesId}:disable", + "path": "v1/{+name}:disable", + "id": "serviceuser.projects.services.disable" + }, + "enable": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "Name of the consumer and the service to enable for that consumer.\n\nA valid path would be:\n- /v1/projects/my-project/services/servicemanagement.googleapis.com:enable", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/services/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/projects/{projectsId}/services/{servicesId}:enable", + "id": "serviceuser.projects.services.enable", + "path": "v1/{+name}:enable", + "description": "Enable a service so it can be used with a project.\nSee [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for\nmore information.\n\nOperation\u003cresponse: google.protobuf.Empty\u003e", + "request": { + "$ref": "EnableServiceRequest" + } + }, + "list": { + "flatPath": "v1/projects/{projectsId}/services", + "path": "v1/{+parent}/services", + "id": "serviceuser.projects.services.list", + "description": "List enabled services for the specified consumer.", + "httpMethod": "GET", + "response": { + "$ref": "ListEnabledServicesResponse" + }, + "parameterOrder": [ + "parent" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "Token identifying which result to start with; returned by a previous list\ncall.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested size of the next page of data.", + "type": "integer" + }, + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "List enabled services for the specified parent.\n\nAn example valid parent would be:\n- projects/my-project", + "type": "string", + "required": true + } + } + } + } + } + } + }, + "services": { + "methods": { + "search": { + "description": "Search available services.\n\nWhen no filter is specified, returns all accessible services. For\nauthenticated users, also returns all services the calling user has\n\"servicemanagement.services.bind\" permission for.", + "response": { + "$ref": "SearchServicesResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "description": "Token identifying which result to start with; returned by a previous list\ncall.", + "type": "string", + "location": "query" + }, + "pageSize": { + "format": "int32", + "description": "Requested size of the next page of data.", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/services:search", + "id": "serviceuser.services.search", + "path": "v1/services:search" + } + } + } + }, + "parameters": { + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + } + }, + "version": "v1", + "baseUrl": "https://serviceuser.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use.", + "servicePath": "", + "basePath": "", + "revision": "20170916", + "documentationLink": "https://cloud.google.com/service-management/", + "id": "serviceuser:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Authentication": { + "type": "object", + "properties": { + "providers": { + "items": { + "$ref": "AuthProvider" + }, + "type": "array", + "description": "Defines a set of authentication providers that a service supports." + }, + "rules": { + "description": "A list of authentication rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "AuthenticationRule" + }, + "type": "array" + } + }, + "id": "Authentication", + "description": "`Authentication` defines the authentication configuration for an API.\n\nExample for an API targeted for external use:\n\n name: calendar.googleapis.com\n authentication:\n providers:\n - id: google_calendar_auth\n jwks_uri: https://www.googleapis.com/oauth2/v1/certs\n issuer: https://securetoken.google.com\n rules:\n - selector: \"*\"\n requirements:\n provider_id: google_calendar_auth" + }, + "Operation": { + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + } + } + }, + "Page": { + "description": "Represents a documentation page. A page can contain subpages to represent\nnested documentation set structure.", + "type": "object", + "properties": { + "subpages": { + "description": "Subpages of this page. The order of subpages specified here will be\nhonored in the generated docset.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, + "name": { + "description": "The name of the page. It will be used as an identity of the page to\ngenerate URI of the page, text of the link to this page in navigation,\netc. The full page name (start from the root page name to this page\nconcatenated with `.`) can be used as reference to the page in your\ndocumentation. For example:\n\u003cpre\u003e\u003ccode\u003epages:\n- name: Tutorial\n content: (== include tutorial.md ==)\n subpages:\n - name: Java\n content: (== include tutorial_java.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nYou can reference `Java` page using Markdown reference link syntax:\n`Java`.", + "type": "string" + }, + "content": { + "description": "The Markdown content of the page. You can use \u003ccode\u003e(== include {path} ==)\u003c/code\u003e\nto include content from a Markdown file.", + "type": "string" + } + }, + "id": "Page" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + } + }, + "id": "Status" + }, + "AuthProvider": { + "description": "Configuration for an anthentication provider, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).", + "type": "object", + "properties": { + "jwksUri": { + "description": "URL of the provider's public key set to validate signature of the JWT. See\n[OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).\nOptional if the key set document:\n - can be retrieved from\n [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html\n of the issuer.\n - can be inferred from the email domain of the issuer (e.g. a Google service account).\n\nExample: https://www.googleapis.com/oauth2/v1/certs", + "type": "string" + }, + "audiences": { + "description": "The list of JWT\n[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).\nthat are allowed to access. A JWT containing any of these audiences will\nbe accepted. When this setting is absent, only JWTs with audience\n\"https://Service_name/API_name\"\nwill be accepted. For example, if no audiences are in the setting,\nLibraryService API will only accept JWTs with the following audience\n\"https://library-example.googleapis.com/google.example.library.v1.LibraryService\".\n\nExample:\n\n audiences: bookstore_android.apps.googleusercontent.com,\n bookstore_web.apps.googleusercontent.com", + "type": "string" + }, + "authorizationUrl": { + "description": "Redirect URL if JWT token is required but no present or is expired.\nImplement authorizationUrl of securityDefinitions in OpenAPI spec.", + "type": "string" + }, + "issuer": { + "description": "Identifies the principal that issued the JWT. See\nhttps://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1\nUsually a URL or an email address.\n\nExample: https://securetoken.google.com\nExample: 1234567-compute@developer.gserviceaccount.com", + "type": "string" + }, + "id": { + "type": "string", + "description": "The unique identifier of the auth provider. It will be referred to by\n`AuthRequirement.provider_id`.\n\nExample: \"bookstore_auth\"." + } + }, + "id": "AuthProvider" + }, + "EnumValue": { + "type": "object", + "properties": { + "options": { + "description": "Protocol buffer options.", + "items": { + "$ref": "Option" + }, + "type": "array" + }, + "number": { + "format": "int32", + "description": "Enum value number.", + "type": "integer" + }, + "name": { + "type": "string", + "description": "Enum value name." + } + }, + "id": "EnumValue", + "description": "Enum value definition." + }, + "Service": { + "properties": { + "name": { + "description": "The DNS address at which this service is available,\ne.g. `calendar.googleapis.com`.", + "type": "string" + }, + "customError": { + "$ref": "CustomError", + "description": "Custom error configuration." + }, + "title": { + "description": "The product title for this service.", + "type": "string" + }, + "endpoints": { + "description": "Configuration for network endpoints. If this is empty, then an endpoint\nwith the same name as the service is automatically generated to service all\ndefined APIs.", + "items": { + "$ref": "Endpoint" + }, + "type": "array" + }, + "apis": { + "items": { + "$ref": "Api" + }, + "type": "array", + "description": "A list of API interfaces exported by this service. Only the `name` field\nof the google.protobuf.Api needs to be provided by the configuration\nauthor, as the remaining fields will be derived from the IDL during the\nnormalization process. It is an error to specify an API interface here\nwhich cannot be resolved against the associated IDL files." + }, + "logs": { + "description": "Defines the logs used by this service.", + "items": { + "$ref": "LogDescriptor" + }, + "type": "array" + }, + "types": { + "description": "A list of all proto message types included in this API service.\nTypes referenced directly or indirectly by the `apis` are\nautomatically included. Messages which are not referenced but\nshall be included, such as types used by the `google.protobuf.Any` type,\nshould be listed here by name. Example:\n\n types:\n - name: google.protobuf.Int32", + "items": { + "$ref": "Type" + }, + "type": "array" + }, + "sourceInfo": { + "$ref": "SourceInfo", + "description": "Output only. The source information for this configuration if available." + }, + "http": { + "$ref": "Http", + "description": "HTTP configuration." + }, + "backend": { + "description": "API backend configuration.", + "$ref": "Backend" + }, + "systemParameters": { + "$ref": "SystemParameters", + "description": "System parameter configuration." + }, + "documentation": { + "description": "Additional API documentation.", + "$ref": "Documentation" + }, + "logging": { + "$ref": "Logging", + "description": "Logging configuration." + }, + "monitoredResources": { + "description": "Defines the monitored resources used by this service. This is required\nby the Service.monitoring and Service.logging configurations.", + "items": { + "$ref": "MonitoredResourceDescriptor" + }, + "type": "array" + }, + "context": { + "$ref": "Context", + "description": "Context configuration." + }, + "enums": { + "items": { + "$ref": "Enum" + }, + "type": "array", + "description": "A list of all enum types included in this API service. Enums\nreferenced directly or indirectly by the `apis` are automatically\nincluded. Enums which are not referenced but shall be included\nshould be listed here by name. Example:\n\n enums:\n - name: google.someapi.v1.SomeEnum" + }, + "id": { + "description": "A unique ID for a specific instance of this message, typically assigned\nby the client for tracking purpose. If empty, the server may choose to\ngenerate one instead.", + "type": "string" + }, + "usage": { + "$ref": "Usage", + "description": "Configuration controlling usage of this service." + }, + "metrics": { + "description": "Defines the metrics used by this service.", + "items": { + "$ref": "MetricDescriptor" + }, + "type": "array" + }, + "authentication": { + "$ref": "Authentication", + "description": "Auth configuration." + }, + "experimental": { + "$ref": "Experimental", + "description": "Experimental configuration." + }, + "control": { + "$ref": "Control", + "description": "Configuration for the service control plane." + }, + "configVersion": { + "format": "uint32", + "description": "The semantic version of the service configuration. The config version\naffects the interpretation of the service configuration. For example,\ncertain features are enabled by default for certain config versions.\nThe latest config version is `3`.", + "type": "integer" + }, + "monitoring": { + "$ref": "Monitoring", + "description": "Monitoring configuration." + }, + "producerProjectId": { + "description": "The Google project that owns this service.", + "type": "string" + }, + "systemTypes": { + "description": "A list of all proto message types included in this API service.\nIt serves similar purpose as [google.api.Service.types], except that\nthese types are not needed by user-defined APIs. Therefore, they will not\nshow up in the generated discovery doc. This field should only be used\nto define system APIs in ESF.", + "items": { + "$ref": "Type" + }, + "type": "array" + }, + "visibility": { + "$ref": "Visibility", + "description": "API visibility configuration." + }, + "quota": { + "description": "Quota configuration.", + "$ref": "Quota" + } + }, + "id": "Service", + "description": "`Service` is the root object of Google service configuration schema. It\ndescribes basic information about a service, such as the name and the\ntitle, and delegates other aspects to sub-sections. Each sub-section is\neither a proto message or a repeated proto message that configures a\nspecific aspect, such as auth. See each proto message definition for details.\n\nExample:\n\n type: google.api.Service\n config_version: 3\n name: calendar.googleapis.com\n title: Google Calendar API\n apis:\n - name: google.calendar.v3.Calendar\n authentication:\n providers:\n - id: google_calendar_auth\n jwks_uri: https://www.googleapis.com/oauth2/v1/certs\n issuer: https://securetoken.google.com\n rules:\n - selector: \"*\"\n requirements:\n provider_id: google_calendar_auth", + "type": "object" + }, + "OperationMetadata": { + "description": "The metadata associated with a long running operation resource.", + "type": "object", + "properties": { + "startTime": { + "format": "google-datetime", + "description": "The start time of the operation.", + "type": "string" + }, + "steps": { + "description": "Detailed status information for each step. The order is undetermined.", + "items": { + "$ref": "Step" + }, + "type": "array" + }, + "resourceNames": { + "description": "The full name of the resources that this operation is directly\nassociated with.", + "items": { + "type": "string" + }, + "type": "array" + }, + "progressPercentage": { + "format": "int32", + "description": "Percentage of completion of this operation, ranging from 0 to 100.", + "type": "integer" + } + }, + "id": "OperationMetadata" + }, + "CustomHttpPattern": { + "description": "A custom pattern is used for defining custom HTTP verb.", + "type": "object", + "properties": { + "kind": { + "description": "The name of this custom HTTP verb.", + "type": "string" + }, + "path": { + "description": "The path matched by this custom verb.", + "type": "string" + } + }, + "id": "CustomHttpPattern" + }, + "PublishedService": { + "description": "The published version of a Service that is managed by\nGoogle Service Management.", + "type": "object", + "properties": { + "service": { + "description": "The service's published configuration.", + "$ref": "Service" + }, + "name": { + "type": "string", + "description": "The resource name of the service.\n\nA valid name would be:\n- services/serviceuser.googleapis.com" + } + }, + "id": "PublishedService" + }, + "SystemParameterRule": { + "description": "Define a system parameter rule mapping system parameter definitions to\nmethods.", + "type": "object", + "properties": { + "parameters": { + "description": "Define parameters. Multiple names may be defined for a parameter.\nFor a given method call, only one of them should be used. If multiple\nnames are used the behavior is implementation-dependent.\nIf none of the specified names are present the behavior is\nparameter-dependent.", + "items": { + "$ref": "SystemParameter" + }, + "type": "array" + }, + "selector": { + "description": "Selects the methods to which this rule applies. Use '*' to indicate all\nmethods in all APIs.\n\nRefer to selector for syntax details.", + "type": "string" + } + }, + "id": "SystemParameterRule" + }, + "VisibilityRule": { + "description": "A visibility rule provides visibility configuration for an individual API\nelement.", + "type": "object", + "properties": { + "restriction": { + "description": "A comma-separated list of visibility labels that apply to the `selector`.\nAny of the listed labels can be used to grant the visibility.\n\nIf a rule has multiple labels, removing one of the labels but not all of\nthem can break clients.\n\nExample:\n\n visibility:\n rules:\n - selector: google.calendar.Calendar.EnhancedSearch\n restriction: GOOGLE_INTERNAL, TRUSTED_TESTER\n\nRemoving GOOGLE_INTERNAL from this restriction will break clients that\nrely on this method and only had access to it through GOOGLE_INTERNAL.", + "type": "string" + }, + "selector": { + "description": "Selects methods, messages, fields, enums, etc. to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + } + }, + "id": "VisibilityRule" + }, + "HttpRule": { + "description": "`HttpRule` defines the mapping of an RPC method to one or more HTTP\nREST API methods. The mapping specifies how different portions of the RPC\nrequest message are mapped to URL path, URL query parameters, and\nHTTP request body. The mapping is typically specified as an\n`google.api.http` annotation on the RPC method,\nsee \"google/api/annotations.proto\" for details.\n\nThe mapping consists of a field specifying the path template and\nmethod kind. The path template can refer to fields in the request\nmessage, as in the example below which describes a REST GET\noperation on a resource collection of messages:\n\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http).get = \"/v1/messages/{message_id}/{sub.subfield}\";\n }\n }\n message GetMessageRequest {\n message SubMessage {\n string subfield = 1;\n }\n string message_id = 1; // mapped to the URL\n SubMessage sub = 2; // `sub.subfield` is url-mapped\n }\n message Message {\n string text = 1; // content of the resource\n }\n\nThe same http annotation can alternatively be expressed inside the\n`GRPC API Configuration` YAML file.\n\n http:\n rules:\n - selector: \u003cproto_package_name\u003e.Messaging.GetMessage\n get: /v1/messages/{message_id}/{sub.subfield}\n\nThis definition enables an automatic, bidrectional mapping of HTTP\nJSON to RPC. Example:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456/foo` | `GetMessage(message_id: \"123456\" sub: SubMessage(subfield: \"foo\"))`\n\nIn general, not only fields but also field paths can be referenced\nfrom a path pattern. Fields mapped to the path pattern cannot be\nrepeated and must have a primitive (non-message) type.\n\nAny fields in the request message which are not bound by the path\npattern automatically become (optional) HTTP query\nparameters. Assume the following definition of the request message:\n\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http).get = \"/v1/messages/{message_id}\";\n }\n }\n message GetMessageRequest {\n message SubMessage {\n string subfield = 1;\n }\n string message_id = 1; // mapped to the URL\n int64 revision = 2; // becomes a parameter\n SubMessage sub = 3; // `sub.subfield` becomes a parameter\n }\n\n\nThis enables a HTTP JSON to RPC mapping as below:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: \"123456\" revision: 2 sub: SubMessage(subfield: \"foo\"))`\n\nNote that fields which are mapped to HTTP parameters must have a\nprimitive type or a repeated primitive type. Message types are not\nallowed. In the case of a repeated type, the parameter can be\nrepeated in the URL, as in `...?param=A¶m=B`.\n\nFor HTTP method kinds which allow a request body, the `body` field\nspecifies the mapping. Consider a REST update method on the\nmessage resource collection:\n\n\n service Messaging {\n rpc UpdateMessage(UpdateMessageRequest) returns (Message) {\n option (google.api.http) = {\n put: \"/v1/messages/{message_id}\"\n body: \"message\"\n };\n }\n }\n message UpdateMessageRequest {\n string message_id = 1; // mapped to the URL\n Message message = 2; // mapped to the body\n }\n\n\nThe following HTTP JSON to RPC mapping is enabled, where the\nrepresentation of the JSON in the request body is determined by\nprotos JSON encoding:\n\nHTTP | RPC\n-----|-----\n`PUT /v1/messages/123456 { \"text\": \"Hi!\" }` | `UpdateMessage(message_id: \"123456\" message { text: \"Hi!\" })`\n\nThe special name `*` can be used in the body mapping to define that\nevery field not bound by the path template should be mapped to the\nrequest body. This enables the following alternative definition of\nthe update method:\n\n service Messaging {\n rpc UpdateMessage(Message) returns (Message) {\n option (google.api.http) = {\n put: \"/v1/messages/{message_id}\"\n body: \"*\"\n };\n }\n }\n message Message {\n string message_id = 1;\n string text = 2;\n }\n\n\nThe following HTTP JSON to RPC mapping is enabled:\n\nHTTP | RPC\n-----|-----\n`PUT /v1/messages/123456 { \"text\": \"Hi!\" }` | `UpdateMessage(message_id: \"123456\" text: \"Hi!\")`\n\nNote that when using `*` in the body mapping, it is not possible to\nhave HTTP parameters, as all fields not bound by the path end in\nthe body. This makes this option more rarely used in practice of\ndefining REST APIs. The common usage of `*` is in custom methods\nwhich don't use the URL at all for transferring data.\n\nIt is possible to define multiple HTTP methods for one RPC by using\nthe `additional_bindings` option. Example:\n\n service Messaging {\n rpc GetMessage(GetMessageRequest) returns (Message) {\n option (google.api.http) = {\n get: \"/v1/messages/{message_id}\"\n additional_bindings {\n get: \"/v1/users/{user_id}/messages/{message_id}\"\n }\n };\n }\n }\n message GetMessageRequest {\n string message_id = 1;\n string user_id = 2;\n }\n\n\nThis enables the following two alternative HTTP JSON to RPC\nmappings:\n\nHTTP | RPC\n-----|-----\n`GET /v1/messages/123456` | `GetMessage(message_id: \"123456\")`\n`GET /v1/users/me/messages/123456` | `GetMessage(user_id: \"me\" message_id: \"123456\")`\n\n# Rules for HTTP mapping\n\nThe rules for mapping HTTP path, query parameters, and body fields\nto the request message are as follows:\n\n1. The `body` field specifies either `*` or a field path, or is\n omitted. If omitted, it indicates there is no HTTP request body.\n2. Leaf fields (recursive expansion of nested messages in the\n request) can be classified into three types:\n (a) Matched in the URL template.\n (b) Covered by body (if body is `*`, everything except (a) fields;\n else everything under the body field)\n (c) All other fields.\n3. URL query parameters found in the HTTP request are mapped to (c) fields.\n4. Any body sent with an HTTP request can contain only (b) fields.\n\nThe syntax of the path template is as follows:\n\n Template = \"/\" Segments [ Verb ] ;\n Segments = Segment { \"/\" Segment } ;\n Segment = \"*\" | \"**\" | LITERAL | Variable ;\n Variable = \"{\" FieldPath [ \"=\" Segments ] \"}\" ;\n FieldPath = IDENT { \".\" IDENT } ;\n Verb = \":\" LITERAL ;\n\nThe syntax `*` matches a single path segment. The syntax `**` matches zero\nor more path segments, which must be the last part of the path except the\n`Verb`. The syntax `LITERAL` matches literal text in the path.\n\nThe syntax `Variable` matches part of the URL path as specified by its\ntemplate. A variable template must not contain other variables. If a variable\nmatches a single path segment, its template may be omitted, e.g. `{var}`\nis equivalent to `{var=*}`.\n\nIf a variable contains exactly one path segment, such as `\"{var}\"` or\n`\"{var=*}\"`, when such a variable is expanded into a URL path, all characters\nexcept `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the\nDiscovery Document as `{var}`.\n\nIf a variable contains one or more path segments, such as `\"{var=foo/*}\"`\nor `\"{var=**}\"`, when such a variable is expanded into a URL path, all\ncharacters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables\nshow up in the Discovery Document as `{+var}`.\n\nNOTE: While the single segment variable matches the semantics of\n[RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2\nSimple String Expansion, the multi segment variable **does not** match\nRFC 6570 Reserved Expansion. The reason is that the Reserved Expansion\ndoes not expand special characters like `?` and `#`, which would lead\nto invalid URLs.\n\nNOTE: the field paths in variables and in the `body` must not refer to\nrepeated fields or map fields.", + "type": "object", + "properties": { + "additionalBindings": { + "description": "Additional HTTP bindings for the selector. Nested bindings must\nnot contain an `additional_bindings` field themselves (that is,\nthe nesting may only be one level deep).", + "items": { + "$ref": "HttpRule" + }, + "type": "array" + }, + "responseBody": { + "description": "The name of the response field whose value is mapped to the HTTP body of\nresponse. Other response fields are ignored. This field is optional. When\nnot set, the response message will be used as HTTP body of response.\nNOTE: the referred field must be not a repeated field and must be present\nat the top-level of response message type.", + "type": "string" + }, + "restCollection": { + "description": "DO NOT USE. This is an experimental field.\n\nOptional. The REST collection name is by default derived from the URL\npattern. If specified, this field overrides the default collection name.\nExample:\n\n rpc AddressesAggregatedList(AddressesAggregatedListRequest)\n returns (AddressesAggregatedListResponse) {\n option (google.api.http) = {\n get: \"/v1/projects/{project_id}/aggregated/addresses\"\n rest_collection: \"projects.addresses\"\n };\n }\n\nThis method has the automatically derived collection name\n\"projects.aggregated\". Because, semantically, this rpc is actually an\noperation on the \"projects.addresses\" collection, the `rest_collection`\nfield is configured to override the derived collection name.", + "type": "string" + }, + "mediaUpload": { + "$ref": "MediaUpload", + "description": "Use this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead\n[][google.bytestream.RestByteStream] as an API to your\nconfiguration for Bytestream methods." + }, + "selector": { + "description": "Selects methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + }, + "custom": { + "$ref": "CustomHttpPattern", + "description": "The custom pattern is used for specifying an HTTP method that is not\nincluded in the `pattern` field, such as HEAD, or \"*\" to leave the\nHTTP method unspecified for this rule. The wild-card rule is useful\nfor services that provide content to Web (HTML) clients." + }, + "patch": { + "description": "Used for updating a resource.", + "type": "string" + }, + "get": { + "description": "Used for listing and getting information about resources.", + "type": "string" + }, + "put": { + "description": "Used for updating a resource.", + "type": "string" + }, + "authorizations": { + "items": { + "$ref": "AuthorizationRule" + }, + "type": "array", + "description": "Specifies the permission(s) required for an API element for the overall\nAPI request to succeed. It is typically used to mark request message fields\nthat contain the name of the resource and indicates the permissions that\nwill be checked on that resource." + }, + "delete": { + "description": "Used for deleting a resource.", + "type": "string" + }, + "body": { + "description": "The name of the request field whose value is mapped to the HTTP body, or\n`*` for mapping all fields not captured by the path pattern to the HTTP\nbody. NOTE: the referred field must not be a repeated field and must be\npresent at the top-level of request message type.", + "type": "string" + }, + "post": { + "description": "Used for creating a resource.", + "type": "string" + }, + "mediaDownload": { + "$ref": "MediaDownload", + "description": "Use this only for Scotty Requests. Do not use this for bytestream methods.\nFor media support, add instead [][google.bytestream.RestByteStream] as an\nAPI to your configuration." + }, + "restMethodName": { + "type": "string", + "description": "DO NOT USE. This is an experimental field.\n\nOptional. The rest method name is by default derived from the URL\npattern. If specified, this field overrides the default method name.\nExample:\n\n rpc CreateResource(CreateResourceRequest)\n returns (CreateResourceResponse) {\n option (google.api.http) = {\n post: \"/v1/resources\",\n body: \"resource\",\n rest_method_name: \"insert\"\n };\n }\n\nThis method has the automatically derived rest method name\n\"create\", but for backwards compatibility with apiary, it is specified as\ninsert." + } + }, + "id": "HttpRule" + }, + "MonitoringDestination": { + "description": "Configuration of a specific monitoring destination (the producer project\nor the consumer project).", + "type": "object", + "properties": { + "monitoredResource": { + "type": "string", + "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section." + }, + "metrics": { + "description": "Names of the metrics to report to this monitoring destination.\nEach name must be defined in Service.metrics section.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "MonitoringDestination" + }, + "Visibility": { + "id": "Visibility", + "description": "`Visibility` defines restrictions for the visibility of service\nelements. Restrictions are specified using visibility labels\n(e.g., TRUSTED_TESTER) that are elsewhere linked to users and projects.\n\nUsers and projects can have access to more than one visibility label. The\neffective visibility for multiple labels is the union of each label's\nelements, plus any unrestricted elements.\n\nIf an element and its parents have no restrictions, visibility is\nunconditionally granted.\n\nExample:\n\n visibility:\n rules:\n - selector: google.calendar.Calendar.EnhancedSearch\n restriction: TRUSTED_TESTER\n - selector: google.calendar.Calendar.Delegate\n restriction: GOOGLE_INTERNAL\n\nHere, all methods are publicly visible except for the restricted methods\nEnhancedSearch and Delegate.", + "type": "object", + "properties": { + "rules": { + "description": "A list of visibility rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "VisibilityRule" + }, + "type": "array" + } + } + }, + "SystemParameters": { + "description": "### System parameter configuration\n\nA system parameter is a special kind of parameter defined by the API\nsystem, not by an individual API. It is typically mapped to an HTTP header\nand/or a URL query parameter. This configuration specifies which methods\nchange the names of the system parameters.", + "type": "object", + "properties": { + "rules": { + "items": { + "$ref": "SystemParameterRule" + }, + "type": "array", + "description": "Define system parameters.\n\nThe parameters defined here will override the default parameters\nimplemented by the system. If this field is missing from the service\nconfig, default system parameters will be used. Default system parameters\nand names is implementation-dependent.\n\nExample: define api key for all methods\n\n system_parameters\n rules:\n - selector: \"*\"\n parameters:\n - name: api_key\n url_query_parameter: api_key\n\n\nExample: define 2 api key names for a specific method.\n\n system_parameters\n rules:\n - selector: \"/ListShelves\"\n parameters:\n - name: api_key\n http_header: Api-Key1\n - name: api_key\n http_header: Api-Key2\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." + } + }, + "id": "SystemParameters" + }, + "Quota": { + "description": "Quota configuration helps to achieve fairness and budgeting in service\nusage.\n\nThe quota configuration works this way:\n- The service configuration defines a set of metrics.\n- For API calls, the quota.metric_rules maps methods to metrics with\n corresponding costs.\n- The quota.limits defines limits on the metrics, which will be used for\n quota checks at runtime.\n\nAn example quota configuration in yaml format:\n\n quota:\n\n - name: apiWriteQpsPerProject\n metric: library.googleapis.com/write_calls\n unit: \"1/min/{project}\" # rate limit for consumer projects\n values:\n STANDARD: 10000\n\n\n # The metric rules bind all methods to the read_calls metric,\n # except for the UpdateBook and DeleteBook methods. These two methods\n # are mapped to the write_calls metric, with the UpdateBook method\n # consuming at twice rate as the DeleteBook method.\n metric_rules:\n - selector: \"*\"\n metric_costs:\n library.googleapis.com/read_calls: 1\n - selector: google.example.library.v1.LibraryService.UpdateBook\n metric_costs:\n library.googleapis.com/write_calls: 2\n - selector: google.example.library.v1.LibraryService.DeleteBook\n metric_costs:\n library.googleapis.com/write_calls: 1\n\n Corresponding Metric definition:\n\n metrics:\n - name: library.googleapis.com/read_calls\n display_name: Read requests\n metric_kind: DELTA\n value_type: INT64\n\n - name: library.googleapis.com/write_calls\n display_name: Write requests\n metric_kind: DELTA\n value_type: INT64", + "type": "object", + "properties": { + "limits": { + "description": "List of `QuotaLimit` definitions for the service.", + "items": { + "$ref": "QuotaLimit" + }, + "type": "array" + }, + "metricRules": { + "description": "List of `MetricRule` definitions, each one mapping a selected method to one\nor more metrics.", + "items": { + "$ref": "MetricRule" + }, + "type": "array" + } + }, + "id": "Quota" + }, + "Step": { + "description": "Represents the status of one operation step.", + "type": "object", + "properties": { + "status": { + "enum": [ + "STATUS_UNSPECIFIED", + "DONE", + "NOT_STARTED", + "IN_PROGRESS", + "FAILED", + "CANCELLED" + ], + "description": "The status code.", + "type": "string", + "enumDescriptions": [ + "Unspecifed code.", + "The operation or step has completed without errors.", + "The operation or step has not started yet.", + "The operation or step is in progress.", + "The operation or step has completed with errors. If the operation is\nrollbackable, the rollback completed with errors too.", + "The operation or step has completed with cancellation." + ] + }, + "description": { + "description": "The short description of the step.", + "type": "string" + } + }, + "id": "Step" + }, + "LoggingDestination": { + "description": "Configuration of a specific logging destination (the producer project\nor the consumer project).", + "type": "object", + "properties": { + "logs": { + "description": "Names of the logs to be sent to this destination. Each name must\nbe defined in the Service.logs section. If the log name is\nnot a domain scoped name, it will be automatically prefixed with\nthe service name followed by \"/\".", + "items": { + "type": "string" + }, + "type": "array" + }, + "monitoredResource": { + "description": "The monitored resource type. The type must be defined in the\nService.monitored_resources section.", + "type": "string" + } + }, + "id": "LoggingDestination" + }, + "Option": { + "description": "A protocol buffer option, which can be attached to a message, field,\nenumeration, etc.", + "type": "object", + "properties": { + "name": { + "description": "The option's name. For protobuf built-in options (options defined in\ndescriptor.proto), this is the short name. For example, `\"map_entry\"`.\nFor custom options, it should be the fully-qualified name. For example,\n`\"google.api.http\"`.", + "type": "string" + }, + "value": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "The option's value packed in an Any message. If the value is a primitive,\nthe corresponding wrapper type defined in google/protobuf/wrappers.proto\nshould be used. If the value is an enum, it should be stored as an int32\nvalue using the google.protobuf.Int32Value type.", + "type": "object" + } + }, + "id": "Option" + }, + "Logging": { + "description": "Logging configuration of the service.\n\nThe following example shows how to configure logs to be sent to the\nproducer and consumer projects. In the example, the `activity_history`\nlog is sent to both the producer and consumer projects, whereas the\n`purchase_history` log is only sent to the producer project.\n\n monitored_resources:\n - type: library.googleapis.com/branch\n labels:\n - key: /city\n description: The city where the library branch is located in.\n - key: /name\n description: The name of the branch.\n logs:\n - name: activity_history\n labels:\n - key: /customer_id\n - name: purchase_history\n logging:\n producer_destinations:\n - monitored_resource: library.googleapis.com/branch\n logs:\n - activity_history\n - purchase_history\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n logs:\n - activity_history", + "type": "object", + "properties": { + "consumerDestinations": { + "description": "Logging configurations for sending logs to the consumer project.\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none consumer destination.", + "items": { + "$ref": "LoggingDestination" + }, + "type": "array" + }, + "producerDestinations": { + "description": "Logging configurations for sending logs to the producer project.\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none producer destination.", + "items": { + "$ref": "LoggingDestination" + }, + "type": "array" + } + }, + "id": "Logging" + }, + "QuotaLimit": { + "type": "object", + "properties": { + "duration": { + "description": "Duration of this limit in textual notation. Example: \"100s\", \"24h\", \"1d\".\nFor duration longer than a day, only multiple of days is supported. We\nsupport only \"100s\" and \"1d\" for now. Additional support will be added in\nthe future. \"0\" indicates indefinite duration.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "freeTier": { + "format": "int64", + "description": "Free tier value displayed in the Developers Console for this limit.\nThe free tier is the number of tokens that will be subtracted from the\nbilled amount when billing is enabled.\nThis field can only be set on a limit with duration \"1d\", in a billable\ngroup; it is invalid on any other limit. If this field is not set, it\ndefaults to 0, indicating that there is no free tier for this service.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "defaultLimit": { + "format": "int64", + "description": "Default number of tokens that can be consumed during the specified\nduration. This is the number of tokens assigned when a client\napplication developer activates the service for his/her project.\n\nSpecifying a value of 0 will block all requests. This can be used if you\nare provisioning quota to selected consumers and blocking others.\nSimilarly, a value of -1 will indicate an unlimited quota. No other\nnegative values are allowed.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "displayName": { + "description": "User-visible display name for this limit.\nOptional. If not set, the UI will provide a default display name based on\nthe quota configuration. This field can be used to override the default\ndisplay name generated from the configuration.", + "type": "string" + }, + "description": { + "description": "Optional. User-visible, extended description for this quota limit.\nShould be used only when more context is needed to understand this limit\nthan provided by the limit's display name (see: `display_name`).", + "type": "string" + }, + "metric": { + "description": "The name of the metric this quota limit applies to. The quota limits with\nthe same metric will be checked together during runtime. The metric must be\ndefined within the service config.\n\nUsed by metric-based quotas only.", + "type": "string" + }, + "values": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "Tiered limit values, currently only STANDARD is supported.", + "type": "object" + }, + "unit": { + "description": "Specify the unit of the quota limit. It uses the same syntax as\nMetric.unit. The supported unit kinds are determined by the quota\nbackend system.\n\nThe [Google Service Control](https://cloud.google.com/service-control)\nsupports the following unit components:\n* One of the time intevals:\n * \"/min\" for quota every minute.\n * \"/d\" for quota every 24 hours, starting 00:00 US Pacific Time.\n * Otherwise the quota won't be reset by time, such as storage limit.\n* One and only one of the granted containers:\n * \"/{project}\" quota for a project\n\nHere are some examples:\n* \"1/min/{project}\" for quota per minute per project.\n\nNote: the order of unit components is insignificant.\nThe \"1\" at the beginning is required to follow the metric unit syntax.\n\nUsed by metric-based quotas only.", + "type": "string" + }, + "maxLimit": { + "format": "int64", + "description": "Maximum number of tokens that can be consumed during the specified\nduration. Client application developers can override the default limit up\nto this maximum. If specified, this value cannot be set to a value less\nthan the default limit. If not specified, it is set to the default limit.\n\nTo allow clients to apply overrides with no upper bound, set this to -1,\nindicating unlimited maximum quota.\n\nUsed by group-based quotas only.", + "type": "string" + }, + "name": { + "description": "Name of the quota limit. The name is used to refer to the limit when\noverriding the default limit on per-consumer basis.\n\nFor metric-based quota limits, the name must be provided, and it must be\nunique within the service. The name can only include alphanumeric\ncharacters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.\n\nThe name of a limit is used as a unique identifier for this limit.\nTherefore, once a limit has been put into use, its name should be\nimmutable. You can use the display_name field to provide a user-friendly\nname for the limit. The display name can be evolved over time without\naffecting the identity of the limit.", + "type": "string" + } + }, + "id": "QuotaLimit", + "description": "`QuotaLimit` defines a specific limit that applies over a specified duration\nfor a limit type. There can be at most one limit for a duration and limit\ntype combination defined within a `QuotaGroup`." + }, + "Method": { + "properties": { + "responseStreaming": { + "description": "If true, the response is streamed.", + "type": "boolean" + }, + "name": { + "description": "The simple name of this method.", + "type": "string" + }, + "requestTypeUrl": { + "description": "A URL of the input message type.", + "type": "string" + }, + "requestStreaming": { + "description": "If true, the request is streamed.", + "type": "boolean" + }, + "syntax": { + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ], + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax of this method.", + "type": "string" + }, + "responseTypeUrl": { + "description": "The URL of the output message type.", + "type": "string" + }, + "options": { + "description": "Any metadata attached to the method.", + "items": { + "$ref": "Option" + }, + "type": "array" + } + }, + "id": "Method", + "description": "Method represents a method of an API interface.", + "type": "object" + }, + "Mixin": { + "type": "object", + "properties": { + "name": { + "description": "The fully qualified name of the interface which is included.", + "type": "string" + }, + "root": { + "description": "If non-empty specifies a path under which inherited HTTP paths\nare rooted.", + "type": "string" + } + }, + "id": "Mixin", + "description": "Declares an API Interface to be included in this interface. The including\ninterface must redeclare all the methods from the included interface, but\ndocumentation and options are inherited as follows:\n\n- If after comment and whitespace stripping, the documentation\n string of the redeclared method is empty, it will be inherited\n from the original method.\n\n- Each annotation belonging to the service config (http,\n visibility) which is not set in the redeclared method will be\n inherited.\n\n- If an http annotation is inherited, the path pattern will be\n modified as follows. Any version prefix will be replaced by the\n version of the including interface plus the root path if\n specified.\n\nExample of a simple mixin:\n\n package google.acl.v1;\n service AccessControl {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v1/{resource=**}:getAcl\";\n }\n }\n\n package google.storage.v2;\n service Storage {\n // rpc GetAcl(GetAclRequest) returns (Acl);\n\n // Get a data record.\n rpc GetData(GetDataRequest) returns (Data) {\n option (google.api.http).get = \"/v2/{resource=**}\";\n }\n }\n\nExample of a mixin configuration:\n\n apis:\n - name: google.storage.v2.Storage\n mixins:\n - name: google.acl.v1.AccessControl\n\nThe mixin construct implies that all methods in `AccessControl` are\nalso declared with same name and request/response types in\n`Storage`. A documentation generator or annotation processor will\nsee the effective `Storage.GetAcl` method after inherting\ndocumentation and annotations as follows:\n\n service Storage {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v2/{resource=**}:getAcl\";\n }\n ...\n }\n\nNote how the version in the path pattern changed from `v1` to `v2`.\n\nIf the `root` field in the mixin is specified, it should be a\nrelative path under which inherited HTTP paths are placed. Example:\n\n apis:\n - name: google.storage.v2.Storage\n mixins:\n - name: google.acl.v1.AccessControl\n root: acls\n\nThis implies the following inherited HTTP annotation:\n\n service Storage {\n // Get the underlying ACL object.\n rpc GetAcl(GetAclRequest) returns (Acl) {\n option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\";\n }\n ...\n }" + }, + "CustomError": { + "description": "Customize service error responses. For example, list any service\nspecific protobuf types that can appear in error detail lists of\nerror responses.\n\nExample:\n\n custom_error:\n types:\n - google.foo.v1.CustomError\n - google.foo.v1.AnotherError", + "type": "object", + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The list of custom error detail types, e.g. 'google.foo.v1.CustomError'." + }, + "rules": { + "description": "The list of custom error rules that apply to individual API messages.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "CustomErrorRule" + }, + "type": "array" + } + }, + "id": "CustomError" + }, + "Http": { + "id": "Http", + "description": "Defines the HTTP configuration for an API service. It contains a list of\nHttpRule, each specifying the mapping of an RPC method\nto one or more HTTP REST API methods.", + "type": "object", + "properties": { + "fullyDecodeReservedExpansion": { + "description": "When set to true, URL path parmeters will be fully URI-decoded except in\ncases of single segment matches in reserved expansion, where \"%2F\" will be\nleft encoded.\n\nThe default behavior is to not decode RFC 6570 reserved characters in multi\nsegment matches.", + "type": "boolean" + }, + "rules": { + "description": "A list of HTTP configuration rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "HttpRule" + }, + "type": "array" + } + } + }, + "SourceInfo": { + "id": "SourceInfo", + "description": "Source information used to create a Service Config", + "type": "object", + "properties": { + "sourceFiles": { + "description": "All files used during config generation.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": "array" + } + } + }, + "Control": { + "id": "Control", + "description": "Selects and configures the service controller used by the service. The\nservice controller handles features like abuse, quota, billing, logging,\nmonitoring, etc.", + "type": "object", + "properties": { + "environment": { + "description": "The service control environment to use. If empty, no control plane\nfeature (like quota and billing) will be enabled.", + "type": "string" + } + } + }, + "SystemParameter": { + "id": "SystemParameter", + "description": "Define a parameter's name and location. The parameter may be passed as either\nan HTTP header or a URL query parameter, and if both are passed the behavior\nis implementation-dependent.", + "type": "object", + "properties": { + "name": { + "description": "Define the name of the parameter, such as \"api_key\" . It is case sensitive.", + "type": "string" + }, + "urlQueryParameter": { + "type": "string", + "description": "Define the URL query parameter name to use for the parameter. It is case\nsensitive." + }, + "httpHeader": { + "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive.", + "type": "string" + } + } + }, + "Field": { + "description": "A single field of a message type.", + "type": "object", + "properties": { + "typeUrl": { + "description": "The field type URL, without the scheme, for message or enumeration\ntypes. Example: `\"type.googleapis.com/google.protobuf.Timestamp\"`.", + "type": "string" + }, + "number": { + "format": "int32", + "description": "The field number.", + "type": "integer" + }, + "jsonName": { + "description": "The field JSON name.", + "type": "string" + }, + "kind": { + "enumDescriptions": [ + "Field type unknown.", + "Field type double.", + "Field type float.", + "Field type int64.", + "Field type uint64.", + "Field type int32.", + "Field type fixed64.", + "Field type fixed32.", + "Field type bool.", + "Field type string.", + "Field type group. Proto2 syntax only, and deprecated.", + "Field type message.", + "Field type bytes.", + "Field type uint32.", + "Field type enum.", + "Field type sfixed32.", + "Field type sfixed64.", + "Field type sint32.", + "Field type sint64." + ], + "enum": [ + "TYPE_UNKNOWN", + "TYPE_DOUBLE", + "TYPE_FLOAT", + "TYPE_INT64", + "TYPE_UINT64", + "TYPE_INT32", + "TYPE_FIXED64", + "TYPE_FIXED32", + "TYPE_BOOL", + "TYPE_STRING", + "TYPE_GROUP", + "TYPE_MESSAGE", + "TYPE_BYTES", + "TYPE_UINT32", + "TYPE_ENUM", + "TYPE_SFIXED32", + "TYPE_SFIXED64", + "TYPE_SINT32", + "TYPE_SINT64" + ], + "description": "The field type.", + "type": "string" + }, + "options": { + "items": { + "$ref": "Option" + }, + "type": "array", + "description": "The protocol buffer options." + }, + "oneofIndex": { + "format": "int32", + "description": "The index of the field type in `Type.oneofs`, for message or enumeration\ntypes. The first type has index 1; zero means the type is not in the list.", + "type": "integer" + }, + "packed": { + "description": "Whether to use alternative packed wire representation.", + "type": "boolean" + }, + "cardinality": { + "enumDescriptions": [ + "For fields with unknown cardinality.", + "For optional fields.", + "For required fields. Proto2 syntax only.", + "For repeated fields." + ], + "enum": [ + "CARDINALITY_UNKNOWN", + "CARDINALITY_OPTIONAL", + "CARDINALITY_REQUIRED", + "CARDINALITY_REPEATED" + ], + "description": "The field cardinality.", + "type": "string" + }, + "defaultValue": { + "description": "The string value of the default value of this field. Proto2 syntax only.", + "type": "string" + }, + "name": { + "description": "The field name.", + "type": "string" + } + }, + "id": "Field" + }, + "Monitoring": { + "description": "Monitoring configuration of the service.\n\nThe example below shows how to configure monitored resources and metrics\nfor monitoring. In the example, a monitored resource and two metrics are\ndefined. The `library.googleapis.com/book/returned_count` metric is sent\nto both producer and consumer projects, whereas the\n`library.googleapis.com/book/overdue_count` metric is only sent to the\nconsumer project.\n\n monitored_resources:\n - type: library.googleapis.com/branch\n labels:\n - key: /city\n description: The city where the library branch is located in.\n - key: /name\n description: The name of the branch.\n metrics:\n - name: library.googleapis.com/book/returned_count\n metric_kind: DELTA\n value_type: INT64\n labels:\n - key: /customer_id\n - name: library.googleapis.com/book/overdue_count\n metric_kind: GAUGE\n value_type: INT64\n labels:\n - key: /customer_id\n monitoring:\n producer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/returned_count\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/returned_count\n - library.googleapis.com/book/overdue_count", + "type": "object", + "properties": { + "producerDestinations": { + "description": "Monitoring configurations for sending metrics to the producer project.\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A metric can be used in at most\none producer destination.", + "items": { + "$ref": "MonitoringDestination" + }, + "type": "array" + }, + "consumerDestinations": { + "description": "Monitoring configurations for sending metrics to the consumer project.\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A metric can be used in at most\none consumer destination.", + "items": { + "$ref": "MonitoringDestination" + }, + "type": "array" + } + }, + "id": "Monitoring" + }, + "Enum": { + "description": "Enum type definition.", + "type": "object", + "properties": { + "enumvalue": { + "description": "Enum value definitions.", + "items": { + "$ref": "EnumValue" + }, + "type": "array" + }, + "name": { + "description": "Enum type name.", + "type": "string" + }, + "options": { + "description": "Protocol buffer options.", + "items": { + "$ref": "Option" + }, + "type": "array" + }, + "syntax": { + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ] + }, + "sourceContext": { + "description": "The source context.", + "$ref": "SourceContext" + } + }, + "id": "Enum" + }, + "LabelDescriptor": { + "properties": { + "key": { + "description": "The label key.", + "type": "string" + }, + "description": { + "description": "A human-readable description for the label.", + "type": "string" + }, + "valueType": { + "type": "string", + "enumDescriptions": [ + "A variable-length string. This is the default.", + "Boolean; true or false.", + "A 64-bit signed integer." + ], + "enum": [ + "STRING", + "BOOL", + "INT64" + ], + "description": "The type of data that can be assigned to the label." + } + }, + "id": "LabelDescriptor", + "description": "A description of a label.", + "type": "object" + }, + "EnableServiceRequest": { + "properties": {}, + "id": "EnableServiceRequest", + "description": "Request message for EnableService method.", + "type": "object" + }, + "Type": { + "description": "A protocol buffer message type.", + "type": "object", + "properties": { + "fields": { + "description": "The list of fields.", + "items": { + "$ref": "Field" + }, + "type": "array" + }, + "name": { + "description": "The fully qualified message name.", + "type": "string" + }, + "oneofs": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The list of types appearing in `oneof` definitions in this type." + }, + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." + }, + "syntax": { + "description": "The source syntax.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ], + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ] + }, + "options": { + "description": "The protocol buffer options.", + "items": { + "$ref": "Option" + }, + "type": "array" + } + }, + "id": "Type" + }, + "Experimental": { + "description": "Experimental service configuration. These configuration options can\nonly be used by whitelisted users.", + "type": "object", + "properties": { + "authorization": { + "description": "Authorization configuration.", + "$ref": "AuthorizationConfig" + } + }, + "id": "Experimental" + }, + "Backend": { + "description": "`Backend` defines the backend configuration for a service.", + "type": "object", + "properties": { + "rules": { + "description": "A list of API backend rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "BackendRule" + }, + "type": "array" + } + }, + "id": "Backend" + }, + "AuthorizationConfig": { + "type": "object", + "properties": { + "provider": { + "description": "The name of the authorization provider, such as\nfirebaserules.googleapis.com.", + "type": "string" + } + }, + "id": "AuthorizationConfig", + "description": "Configuration of authorization.\n\nThis section determines the authorization provider, if unspecified, then no\nauthorization check will be done.\n\nExample:\n\n experimental:\n authorization:\n provider: firebaserules.googleapis.com" + }, + "DocumentationRule": { + "description": "A documentation rule provides information about individual API elements.", + "type": "object", + "properties": { + "deprecationDescription": { + "description": "Deprecation description of the selected element(s). It can be provided if an\nelement is marked as `deprecated`.", + "type": "string" + }, + "selector": { + "description": "The selector is a comma-separated list of patterns. Each pattern is a\nqualified name of the element which may end in \"*\", indicating a wildcard.\nWildcards are only allowed at the end and for a whole component of the\nqualified name, i.e. \"foo.*\" is ok, but not \"foo.b*\" or \"foo.*.bar\". To\nspecify a default for all applicable elements, the whole pattern \"*\"\nis used.", + "type": "string" + }, + "description": { + "description": "Description of the selected API(s).", + "type": "string" + } + }, + "id": "DocumentationRule" + }, + "ContextRule": { + "id": "ContextRule", + "description": "A context rule provides information about the context for an individual API\nelement.", + "type": "object", + "properties": { + "selector": { + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + }, + "provided": { + "description": "A list of full type names of provided contexts.", + "items": { + "type": "string" + }, + "type": "array" + }, + "requested": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of full type names of requested contexts." + } + } + }, + "SourceContext": { + "description": "`SourceContext` represents information about the source of a\nprotobuf element, like the file in which it is defined.", + "type": "object", + "properties": { + "fileName": { + "type": "string", + "description": "The path-qualified name of the .proto file that contained the associated\nprotobuf element. For example: `\"google/protobuf/source_context.proto\"`." + } + }, + "id": "SourceContext" + }, + "MetricDescriptor": { + "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.", + "type": "object", + "properties": { + "name": { + "description": "The resource name of the metric descriptor. Depending on the\nimplementation, the name typically includes: (1) the parent resource name\nthat defines the scope of the metric type or of its data; and (2) the\nmetric's URL-encoded type, which also appears in the `type` field of this\ndescriptor. For example, following is the resource name of a custom\nmetric within the GCP project `my-project-id`:\n\n \"projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"", + "type": "string" + }, + "type": { + "description": "The metric type, including its DNS name prefix. The type is not\nURL-encoded. All user-defined custom metric types have the DNS name\n`custom.googleapis.com`. Metric types should use a natural hierarchical\ngrouping. For example:\n\n \"custom.googleapis.com/invoice/paid/amount\"\n \"appengine.googleapis.com/http/server/response_latencies\"", + "type": "string" + }, + "valueType": { + "enumDescriptions": [ + "Do not use this default value.", + "The value is a boolean.\nThis value type can be used only if the metric kind is `GAUGE`.", + "The value is a signed 64-bit integer.", + "The value is a double precision floating point number.", + "The value is a text string.\nThis value type can be used only if the metric kind is `GAUGE`.", + "The value is a `Distribution`.", + "The value is money." + ], + "enum": [ + "VALUE_TYPE_UNSPECIFIED", + "BOOL", + "INT64", + "DOUBLE", + "STRING", + "DISTRIBUTION", + "MONEY" + ], + "description": "Whether the measurement is an integer, a floating-point number, etc.\nSome combinations of `metric_kind` and `value_type` might not be supported.", + "type": "string" + }, + "metricKind": { + "description": "Whether the metric records instantaneous values, changes to a value, etc.\nSome combinations of `metric_kind` and `value_type` might not be supported.", + "type": "string", + "enumDescriptions": [ + "Do not use this default value.", + "An instantaneous measurement of a value.", + "The change in a value during a time interval.", + "A value accumulated over a time interval. Cumulative\nmeasurements in a time series should have the same start time\nand increasing end times, until an event resets the cumulative\nvalue to zero and sets a new start time for the following\npoints." + ], + "enum": [ + "METRIC_KIND_UNSPECIFIED", + "GAUGE", + "DELTA", + "CUMULATIVE" + ] + }, + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "type": "string" + }, + "displayName": { + "description": "A concise name for the metric, which can be displayed in user interfaces.\nUse sentence case without an ending period, for example \"Request count\".", + "type": "string" + }, + "unit": { + "description": "The unit in which the metric value is reported. It is only applicable\nif the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The\nsupported units are a subset of [The Unified Code for Units of\nMeasure](http://unitsofmeasure.org/ucum.html) standard:\n\n**Basic units (UNIT)**\n\n* `bit` bit\n* `By` byte\n* `s` second\n* `min` minute\n* `h` hour\n* `d` day\n\n**Prefixes (PREFIX)**\n\n* `k` kilo (10**3)\n* `M` mega (10**6)\n* `G` giga (10**9)\n* `T` tera (10**12)\n* `P` peta (10**15)\n* `E` exa (10**18)\n* `Z` zetta (10**21)\n* `Y` yotta (10**24)\n* `m` milli (10**-3)\n* `u` micro (10**-6)\n* `n` nano (10**-9)\n* `p` pico (10**-12)\n* `f` femto (10**-15)\n* `a` atto (10**-18)\n* `z` zepto (10**-21)\n* `y` yocto (10**-24)\n* `Ki` kibi (2**10)\n* `Mi` mebi (2**20)\n* `Gi` gibi (2**30)\n* `Ti` tebi (2**40)\n\n**Grammar**\n\nThe grammar includes the dimensionless unit `1`, such as `1/s`.\n\nThe grammar also includes these connectors:\n\n* `/` division (as an infix operator, e.g. `1/s`).\n* `.` multiplication (as an infix operator, e.g. `GBy.d`)\n\nThe grammar for a unit is as follows:\n\n Expression = Component { \".\" Component } { \"/\" Component } ;\n\n Component = [ PREFIX ] UNIT [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\n Annotation = \"{\" NAME \"}\" ;\n\nNotes:\n\n* `Annotation` is just a comment if it follows a `UNIT` and is\n equivalent to `1` if it is used alone. For examples,\n `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.\n* `NAME` is a sequence of non-blank printable ASCII characters not\n containing '{' or '}'.", + "type": "string" + }, + "labels": { + "description": "The set of labels that can be used to describe a specific\ninstance of this metric type. For example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + } + }, + "id": "MetricDescriptor" + }, + "ListEnabledServicesResponse": { + "description": "Response message for `ListEnabledServices` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token that can be passed to `ListEnabledServices` to resume a paginated\nquery.", + "type": "string" + }, + "services": { + "description": "Services enabled for the specified parent.", + "items": { + "$ref": "PublishedService" + }, + "type": "array" + } + }, + "id": "ListEnabledServicesResponse" + }, + "Endpoint": { + "description": "`Endpoint` describes a network endpoint that serves a set of APIs.\nA service may expose any number of endpoints, and all endpoints share the\nsame service configuration, such as quota configuration and monitoring\nconfiguration.\n\nExample service configuration:\n\n name: library-example.googleapis.com\n endpoints:\n # Below entry makes 'google.example.library.v1.Library'\n # API be served from endpoint address library-example.googleapis.com.\n # It also allows HTTP OPTIONS calls to be passed to the backend, for\n # it to decide whether the subsequent cross-origin request is\n # allowed to proceed.\n - name: library-example.googleapis.com\n allow_cors: true", + "type": "object", + "properties": { + "apis": { + "description": "The list of APIs served by this endpoint.\n\nIf no APIs are specified this translates to \"all APIs\" exported by the\nservice, as defined in the top-level service configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "allowCors": { + "description": "Allowing\n[CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka\ncross-domain traffic, would allow the backends served from this endpoint to\nreceive and respond to HTTP OPTIONS requests. The response will be used by\nthe browser to determine whether the subsequent cross-origin request is\nallowed to proceed.", + "type": "boolean" + }, + "aliases": { + "description": "DEPRECATED: This field is no longer supported. Instead of using aliases,\nplease specify multiple google.api.Endpoint for each of the intented\nalias.\n\nAdditional names that this endpoint will be hosted on.", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string", + "description": "The canonical name of this endpoint." + }, + "target": { + "type": "string", + "description": "The specification of an Internet routable address of API frontend that will\nhandle requests to this [API Endpoint](https://cloud.google.com/apis/design/glossary).\nIt should be either a valid IPv4 address or a fully-qualified domain name.\nFor example, \"8.8.8.8\" or \"myservice.appspot.com\"." + }, + "features": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The list of features enabled on this endpoint." + } + }, + "id": "Endpoint" + }, + "OAuthRequirements": { + "description": "OAuth scopes are a way to define data and permissions on data. For example,\nthere are scopes defined for \"Read-only access to Google Calendar\" and\n\"Access to Cloud Platform\". Users can consent to a scope for an application,\ngiving it permission to access that data on their behalf.\n\nOAuth scope specifications should be fairly coarse grained; a user will need\nto see and understand the text description of what your scope means.\n\nIn most cases: use one or at most two OAuth scopes for an entire family of\nproducts. If your product has multiple APIs, you should probably be sharing\nthe OAuth scope across all of those APIs.\n\nWhen you need finer grained OAuth consent screens: talk with your product\nmanagement about how developers will use them in practice.\n\nPlease note that even though each of the canonical scopes is enough for a\nrequest to be accepted and passed to the backend, a request can still fail\ndue to the backend requiring additional scopes or permissions.", + "type": "object", + "properties": { + "canonicalScopes": { + "type": "string", + "description": "The list of publicly documented OAuth scopes that are allowed access. An\nOAuth token containing any of these scopes will be accepted.\n\nExample:\n\n canonical_scopes: https://www.googleapis.com/auth/calendar,\n https://www.googleapis.com/auth/calendar.read" + } + }, + "id": "OAuthRequirements" + }, + "Usage": { + "description": "Configuration controlling usage of a service.", + "type": "object", + "properties": { + "producerNotificationChannel": { + "description": "The full resource name of a channel used for sending notifications to the\nservice producer.\n\nGoogle Service Management currently only supports\n[Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification\nchannel. To use Google Cloud Pub/Sub as the channel, this must be the name\nof a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format\ndocumented in https://cloud.google.com/pubsub/docs/overview.", + "type": "string" + }, + "rules": { + "description": "A list of usage rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "UsageRule" + }, + "type": "array" + }, + "requirements": { + "description": "Requirements that must be satisfied before a consumer project can use the\nservice. Each requirement is of the form \u003cservice.name\u003e/\u003crequirement-id\u003e;\nfor example 'serviceusage.googleapis.com/billing-enabled'.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "Usage" + }, + "Context": { + "type": "object", + "properties": { + "rules": { + "description": "A list of RPC context rules that apply to individual API methods.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "ContextRule" + }, + "type": "array" + } + }, + "id": "Context", + "description": "`Context` defines which contexts an API requests.\n\nExample:\n\n context:\n rules:\n - selector: \"*\"\n requested:\n - google.rpc.context.ProjectContext\n - google.rpc.context.OriginContext\n\nThe above specifies that all methods in the API request\n`google.rpc.context.ProjectContext` and\n`google.rpc.context.OriginContext`.\n\nAvailable context types are defined in package\n`google.rpc.context`." + }, + "LogDescriptor": { + "description": "A description of a log type. Example in YAML format:\n\n - name: library.googleapis.com/activity_history\n description: The history of borrowing and returning library items.\n display_name: Activity\n labels:\n - key: /customer_id\n description: Identifier of a library customer", + "type": "object", + "properties": { + "labels": { + "description": "The set of labels that are available to describe a specific log entry.\nRuntime requests that contain labels not specified here are\nconsidered invalid.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + }, + "name": { + "description": "The name of the log. It must be less than 512 characters long and can\ninclude the following characters: upper- and lower-case alphanumeric\ncharacters [A-Za-z0-9], and punctuation characters including\nslash, underscore, hyphen, period [/_-.].", + "type": "string" + }, + "displayName": { + "description": "The human-readable name for this log. This information appears on\nthe user interface and should be concise.", + "type": "string" + }, + "description": { + "description": "A human-readable description of this log. This information appears in\nthe documentation and can contain details.", + "type": "string" + } + }, + "id": "LogDescriptor" + }, + "CustomErrorRule": { + "description": "A custom error rule.", + "type": "object", + "properties": { + "isErrorType": { + "description": "Mark this message as possible payload in error response. Otherwise,\nobjects of this type will be filtered when they appear in error payload.", + "type": "boolean" + }, + "selector": { + "description": "Selects messages to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + } + }, + "id": "CustomErrorRule" + }, + "MonitoredResourceDescriptor": { + "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent APIs can support different monitored resource types. APIs generally\nprovide a `list` method that returns the monitored resource descriptors used\nby the API.", + "type": "object", + "properties": { + "labels": { + "description": "Required. A set of labels used to describe instances of this monitored\nresource type. For example, an individual Google Cloud SQL database is\nidentified by values for the labels `\"database_id\"` and `\"zone\"`.", + "items": { + "$ref": "LabelDescriptor" + }, + "type": "array" + }, + "name": { + "description": "Optional. The resource name of the monitored resource descriptor:\n`\"projects/{project_id}/monitoredResourceDescriptors/{type}\"` where\n{type} is the value of the `type` field in this object and\n{project_id} is a project ID that provides API-specific context for\naccessing the type. APIs that do not use project information can use the\nresource name format `\"monitoredResourceDescriptors/{type}\"`.", + "type": "string" + }, + "description": { + "description": "Optional. A detailed description of the monitored resource type that might\nbe used in documentation.", + "type": "string" + }, + "displayName": { + "type": "string", + "description": "Optional. A concise name for the monitored resource type that might be\ndisplayed in user interfaces. It should be a Title Cased Noun Phrase,\nwithout any article or other determiners. For example,\n`\"Google Cloud SQL Database\"`." + }, + "type": { + "description": "Required. The monitored resource type. For example, the type\n`\"cloudsql_database\"` represents databases in Google Cloud SQL.\nThe maximum length of this value is 256 characters.", + "type": "string" + } + }, + "id": "MonitoredResourceDescriptor" + }, + "MediaDownload": { + "properties": { + "useDirectDownload": { + "description": "A boolean that determines if direct download from ESF should be used for\ndownload of this media.", + "type": "boolean" + }, + "enabled": { + "description": "Whether download is enabled.", + "type": "boolean" + }, + "downloadService": { + "description": "DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED.\n\nSpecify name of the download service if one is used for download.", + "type": "string" + }, + "completeNotification": { + "description": "A boolean that determines whether a notification for the completion of a\ndownload should be sent to the backend.", + "type": "boolean" + }, + "maxDirectDownloadSize": { + "format": "int64", + "description": "Optional maximum acceptable size for direct download.\nThe size is specified in bytes.", + "type": "string" + }, + "dropzone": { + "description": "Name of the Scotty dropzone to use for the current API.", + "type": "string" + } + }, + "id": "MediaDownload", + "description": "Defines the Media configuration for a service in case of a download.\nUse this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead [][google.bytestream.RestByteStream] as an API to\nyour configuration for Bytestream methods.", + "type": "object" + }, + "CustomAuthRequirements": { + "properties": { + "provider": { + "description": "A configuration string containing connection information for the\nauthentication provider, typically formatted as a SmartService string\n(go/smartservice).", + "type": "string" + } + }, + "id": "CustomAuthRequirements", + "description": "Configuration for a custom authentication provider.", + "type": "object" + }, + "DisableServiceRequest": { + "type": "object", + "properties": {}, + "id": "DisableServiceRequest", + "description": "Request message for DisableService method." + }, + "AuthorizationRule": { + "description": "Authorization rule for API services.\n\nIt specifies the permission(s) required for an API element for the overall\nAPI request to succeed. It is typically used to mark request message fields\nthat contain the name of the resource and indicates the permissions that\nwill be checked on that resource.\n\nFor example:\n\n package google.storage.v1;\n\n message CopyObjectRequest {\n string source = 1 [\n (google.api.authz).permissions = \"storage.objects.get\"];\n\n string destination = 2 [\n (google.api.authz).permissions =\n \"storage.objects.create,storage.objects.update\"];\n }", + "type": "object", + "properties": { + "selector": { + "description": "Selects the API elements to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + }, + "permissions": { + "description": "The required permissions. The acceptable values vary depend on the\nauthorization system used. For Google APIs, it should be a comma-separated\nGoogle IAM permission values. When multiple permissions are listed, the\nsemantics is not defined by the system. Additional documentation must\nbe provided manually.", + "type": "string" + } + }, + "id": "AuthorizationRule" + }, + "SearchServicesResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token that can be passed to `ListAvailableServices` to resume a paginated\nquery.", + "type": "string" + }, + "services": { + "description": "Services available publicly or available to the authenticated caller.", + "items": { + "$ref": "PublishedService" + }, + "type": "array" + } + }, + "id": "SearchServicesResponse", + "description": "Response message for SearchServices method." + }, + "MediaUpload": { + "description": "Defines the Media configuration for a service in case of an upload.\nUse this only for Scotty Requests. Do not use this for media support using\nBytestream, add instead [][google.bytestream.RestByteStream] as an API to\nyour configuration for Bytestream methods.", + "type": "object", + "properties": { + "completeNotification": { + "description": "A boolean that determines whether a notification for the completion of an\nupload should be sent to the backend. These notifications will not be seen\nby the client and will not consume quota.", + "type": "boolean" + }, + "progressNotification": { + "description": "Whether to receive a notification for progress changes of media upload.", + "type": "boolean" + }, + "enabled": { + "description": "Whether upload is enabled.", + "type": "boolean" + }, + "dropzone": { + "description": "Name of the Scotty dropzone to use for the current API.", + "type": "string" + }, + "startNotification": { + "description": "Whether to receive a notification on the start of media upload.", + "type": "boolean" + }, + "uploadService": { + "description": "DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED.\n\nSpecify name of the upload service if one is used for upload.", + "type": "string" + }, + "mimeTypes": { + "description": "An array of mimetype patterns. Esf will only accept uploads that match one\nof the given patterns.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxSize": { + "format": "int64", + "description": "Optional maximum acceptable size for an upload.\nThe size is specified in bytes.", + "type": "string" + } + }, + "id": "MediaUpload" + }, + "UsageRule": { + "description": "Usage configuration rules for the service.\n\nNOTE: Under development.\n\n\nUse this rule to configure unregistered calls for the service. Unregistered\ncalls are calls that do not contain consumer project identity.\n(Example: calls that do not contain an API key).\nBy default, API methods do not allow unregistered calls, and each method call\nmust be identified by a consumer project identity. Use this rule to\nallow/disallow unregistered calls.\n\nExample of an API that wants to allow unregistered calls for entire service.\n\n usage:\n rules:\n - selector: \"*\"\n allow_unregistered_calls: true\n\nExample of a method that wants to allow unregistered calls.\n\n usage:\n rules:\n - selector: \"google.example.library.v1.LibraryService.CreateBook\"\n allow_unregistered_calls: true", + "type": "object", + "properties": { + "selector": { + "description": "Selects the methods to which this rule applies. Use '*' to indicate all\nmethods in all APIs.\n\nRefer to selector for syntax details.", + "type": "string" + }, + "skipServiceControl": { + "description": "True, if the method should skip service control. If so, no control plane\nfeature (like quota and billing) will be enabled.", + "type": "boolean" + }, + "allowUnregisteredCalls": { + "description": "True, if the method allows unregistered calls; false otherwise.", + "type": "boolean" + } + }, + "id": "UsageRule" + }, + "AuthRequirement": { + "description": "User-defined authentication requirements, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).", + "type": "object", + "properties": { + "providerId": { + "description": "id from authentication provider.\n\nExample:\n\n provider_id: bookstore_auth", + "type": "string" + }, + "audiences": { + "type": "string", + "description": "NOTE: This will be deprecated soon, once AuthProvider.audiences is\nimplemented and accepted in all the runtime components.\n\nThe list of JWT\n[audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).\nthat are allowed to access. A JWT containing any of these audiences will\nbe accepted. When this setting is absent, only JWTs with audience\n\"https://Service_name/API_name\"\nwill be accepted. For example, if no audiences are in the setting,\nLibraryService API will only accept JWTs with the following audience\n\"https://library-example.googleapis.com/google.example.library.v1.LibraryService\".\n\nExample:\n\n audiences: bookstore_android.apps.googleusercontent.com,\n bookstore_web.apps.googleusercontent.com" + } + }, + "id": "AuthRequirement" + }, + "Documentation": { + "description": "`Documentation` provides the information for describing a service.\n\nExample:\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: \u003e\n The Google Calendar API gives access\n to most calendar features.\n pages:\n - name: Overview\n content: (== include google/foo/overview.md ==)\n - name: Tutorial\n content: (== include google/foo/tutorial.md ==)\n subpages;\n - name: Java\n content: (== include google/foo/tutorial_java.md ==)\n rules:\n - selector: google.calendar.Calendar.Get\n description: \u003e\n ...\n - selector: google.calendar.Calendar.Put\n description: \u003e\n ...\n\u003c/code\u003e\u003c/pre\u003e\nDocumentation is provided in markdown syntax. In addition to\nstandard markdown features, definition lists, tables and fenced\ncode blocks are supported. Section headers can be provided and are\ninterpreted relative to the section nesting of the context where\na documentation fragment is embedded.\n\nDocumentation from the IDL is merged with documentation defined\nvia the config at normalization time, where documentation provided\nby config rules overrides IDL provided.\n\nA number of constructs specific to the API platform are supported\nin documentation text.\n\nIn order to reference a proto element, the following\nnotation can be used:\n\u003cpre\u003e\u003ccode\u003e[fully.qualified.proto.name][]\u003c/code\u003e\u003c/pre\u003e\nTo override the display text used for the link, this can be used:\n\u003cpre\u003e\u003ccode\u003e[display text][fully.qualified.proto.name]\u003c/code\u003e\u003c/pre\u003e\nText can be excluded from doc using the following notation:\n\u003cpre\u003e\u003ccode\u003e(-- internal comment --)\u003c/code\u003e\u003c/pre\u003e\nComments can be made conditional using a visibility label. The below\ntext will be only rendered if the `BETA` label is available:\n\u003cpre\u003e\u003ccode\u003e(--BETA: comment for BETA users --)\u003c/code\u003e\u003c/pre\u003e\nA few directives are available in documentation. Note that\ndirectives must appear on a single line to be properly\nidentified. The `include` directive includes a markdown file from\nan external source:\n\u003cpre\u003e\u003ccode\u003e(== include path/to/file ==)\u003c/code\u003e\u003c/pre\u003e\nThe `resource_for` directive marks a message to be the resource of\na collection in REST view. If it is not specified, tools attempt\nto infer the resource from the operations in a collection:\n\u003cpre\u003e\u003ccode\u003e(== resource_for v1.shelves.books ==)\u003c/code\u003e\u003c/pre\u003e\nThe directive `suppress_warning` does not directly affect documentation\nand is documented together with service config validation.", + "type": "object", + "properties": { + "summary": { + "description": "A short summary of what the service does. Can only be provided by\nplain text.", + "type": "string" + }, + "documentationRootUrl": { + "description": "The URL to the root of documentation.", + "type": "string" + }, + "overview": { + "description": "Declares a single overview page. For example:\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: ...\n overview: (== include overview.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nThis is a shortcut for the following declaration (using pages style):\n\u003cpre\u003e\u003ccode\u003edocumentation:\n summary: ...\n pages:\n - name: Overview\n content: (== include overview.md ==)\n\u003c/code\u003e\u003c/pre\u003e\nNote: you cannot specify both `overview` field and `pages` field.", + "type": "string" + }, + "rules": { + "description": "A list of documentation rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.", + "items": { + "$ref": "DocumentationRule" + }, + "type": "array" + }, + "pages": { + "description": "The top level pages for the documentation set.", + "items": { + "$ref": "Page" + }, + "type": "array" + } + }, + "id": "Documentation" + }, + "AuthenticationRule": { + "description": "Authentication rules for the service.\n\nBy default, if a method has any authentication requirements, every request\nmust include a valid credential matching one of the requirements.\nIt's an error to include more than one kind of credential in a single\nrequest.\n\nIf a method doesn't have any auth requirements, request credentials will be\nignored.", + "type": "object", + "properties": { + "requirements": { + "items": { + "$ref": "AuthRequirement" + }, + "type": "array", + "description": "Requirements for additional authentication providers." + }, + "allowWithoutCredential": { + "description": "Whether to allow requests without a credential. The credential can be\nan OAuth token, Google cookies (first-party auth) or EndUserCreds.\n\nFor requests without credentials, if the service control environment is\nspecified, each incoming request **must** be associated with a service\nconsumer. This can be done by passing an API key that belongs to a consumer\nproject.", + "type": "boolean" + }, + "selector": { + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + }, + "customAuth": { + "$ref": "CustomAuthRequirements", + "description": "Configuration for custom authentication." + }, + "oauth": { + "$ref": "OAuthRequirements", + "description": "The requirements for OAuth credentials." + } + }, + "id": "AuthenticationRule" + }, + "BackendRule": { + "properties": { + "minDeadline": { + "type": "number", + "format": "double", + "description": "Minimum deadline in seconds needed for this method. Calls having deadline\nvalue lower than this will be rejected." + }, + "address": { + "description": "The address of the API backend.", + "type": "string" + }, + "selector": { + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + }, + "deadline": { + "format": "double", + "description": "The number of seconds to wait for a response from a request. The default\ndeadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds.", + "type": "number" + } + }, + "id": "BackendRule", + "description": "A backend rule provides configuration for an individual API element.", + "type": "object" + }, + "Api": { + "id": "Api", + "description": "Api is a light-weight descriptor for an API Interface.\n\nInterfaces are also described as \"protocol buffer services\" in some contexts,\nsuch as by the \"service\" keyword in a .proto file, but they are different\nfrom API Services, which represent a concrete implementation of an interface\nas opposed to simply a description of methods and bindings. They are also\nsometimes simply referred to as \"APIs\" in other contexts, such as the name of\nthis message itself. See https://cloud.google.com/apis/design/glossary for\ndetailed terminology.", + "type": "object", + "properties": { + "methods": { + "description": "The methods of this interface, in unspecified order.", + "items": { + "$ref": "Method" + }, + "type": "array" + }, + "name": { + "description": "The fully qualified name of this interface, including package name\nfollowed by the interface's simple name.", + "type": "string" + }, + "syntax": { + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax of the service.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ] + }, + "sourceContext": { + "description": "Source context for the protocol buffer service represented by this\nmessage.", + "$ref": "SourceContext" + }, + "version": { + "type": "string", + "description": "A version string for this interface. If specified, must have the form\n`major-version.minor-version`, as in `1.10`. If the minor version is\nomitted, it defaults to zero. If the entire version field is empty, the\nmajor version is derived from the package name, as outlined below. If the\nfield is not empty, the version in the package name will be verified to be\nconsistent with what is provided here.\n\nThe versioning schema uses [semantic\nversioning](http://semver.org) where the major version number\nindicates a breaking change and the minor version an additive,\nnon-breaking change. Both version numbers are signals to users\nwhat to expect from different versions, and should be carefully\nchosen based on the product plan.\n\nThe major version is also reflected in the package name of the\ninterface, which must end in `v\u003cmajor-version\u003e`, as in\n`google.feature.v1`. For major versions 0 and 1, the suffix can\nbe omitted. Zero major versions must only be used for\nexperimental, non-GA interfaces.\n" + }, + "mixins": { + "description": "Included interfaces. See Mixin.", + "items": { + "$ref": "Mixin" + }, + "type": "array" + }, + "options": { + "items": { + "$ref": "Option" + }, + "type": "array", + "description": "Any metadata attached to the interface." + } + } + }, + "MetricRule": { + "type": "object", + "properties": { + "metricCosts": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "Metrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.", + "type": "object" + }, + "selector": { + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details.", + "type": "string" + } + }, + "id": "MetricRule", + "description": "Bind API methods to metrics. Binding a method to a metric causes that\nmetric's configured quota behaviors to apply to the method call." + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "canonicalName": "Service User", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/service.management": { + "description": "Manage your Google API service configuration" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://serviceuser.googleapis.com/" +} diff --git a/etc/api/shared.yaml b/etc/api/shared.yaml index 449cb2f3b0..18d1d39f6f 100644 --- a/etc/api/shared.yaml +++ b/etc/api/shared.yaml @@ -18,6 +18,8 @@ api: - compute - servicecontrol - servicemanagement + # defines its own `Option` type + - serviceuser - language - speech - adexchangebuyer2 @@ -35,6 +37,8 @@ api: - datastore - consumersurveys - script + # redefinition of types apparently + - streetviewpublish - oauth2 # Recursive type - we don't handle cycles yet it appears - slides diff --git a/etc/api/sheets/v4/sheets-api.json b/etc/api/sheets/v4/sheets-api.json index 3ba4126b70..270caf289e 100644 --- a/etc/api/sheets/v4/sheets-api.json +++ b/etc/api/sheets/v4/sheets-api.json @@ -1,21 +1,44 @@ { - "title": "Google Sheets API", - "ownerName": "Google", "resources": { "spreadsheets": { "methods": { - "get": { - "flatPath": "v4/spreadsheets/{spreadsheetId}", - "path": "v4/spreadsheets/{spreadsheetId}", - "id": "sheets.spreadsheets.get", - "description": "Returns the spreadsheet at the given ID.\nThe caller must specify the spreadsheet ID.\n\nBy default, data within grids will not be returned.\nYou can include grid data one of two ways:\n\n* Specify a field mask listing your desired fields using the `fields` URL\nparameter in HTTP\n\n* Set the includeGridData\nURL parameter to true. If a field mask is set, the `includeGridData`\nparameter is ignored\n\nFor large spreadsheets, it is recommended to retrieve only the specific\nfields of the spreadsheet that you want.\n\nTo retrieve only subsets of the spreadsheet, use the\nranges URL parameter.\nMultiple ranges can be specified. Limiting the range will\nreturn only the portions of the spreadsheet that intersect the requested\nranges. Ranges are specified using A1 notation.", + "getByDataFilter": { + "parameters": { + "spreadsheetId": { + "description": "The spreadsheet to request.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "flatPath": "v4/spreadsheets/{spreadsheetId}:getByDataFilter", + "id": "sheets.spreadsheets.getByDataFilter", + "path": "v4/spreadsheets/{spreadsheetId}:getByDataFilter", + "description": "Returns the spreadsheet at the given ID.\nThe caller must specify the spreadsheet ID.\n\nThis method differs from GetSpreadsheet in that it allows selecting\nwhich subsets of spreadsheet data to return by specifying a\ndataFilters parameter.\nMultiple DataFilters can be specified. Specifying one or\nmore data filters will return the portions of the spreadsheet that\nintersect ranges matched by any of the filters.\n\nBy default, data within grids will not be returned.\nYou can include grid data one of two ways:\n\n* Specify a field mask listing your desired fields using the `fields` URL\nparameter in HTTP\n\n* Set the includeGridData\nparameter to true. If a field mask is set, the `includeGridData`\nparameter is ignored\n\nFor large spreadsheets, it is recommended to retrieve only the specific\nfields of the spreadsheet that you want.", + "request": { + "$ref": "GetSpreadsheetByDataFilterRequest" + }, "response": { "$ref": "Spreadsheet" }, "parameterOrder": [ "spreadsheetId" ], + "httpMethod": "POST" + }, + "get": { "httpMethod": "GET", + "response": { + "$ref": "Spreadsheet" + }, + "parameterOrder": [ + "spreadsheetId" + ], "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", @@ -24,79 +47,285 @@ "https://www.googleapis.com/auth/spreadsheets.readonly" ], "parameters": { - "ranges": { - "location": "query", - "description": "The ranges to retrieve from the spreadsheet.", - "type": "string", - "repeated": true - }, - "includeGridData": { - "description": "True if grid data should be returned.\nThis parameter is ignored if a field mask was set in the request.", - "type": "boolean", - "location": "query" - }, "spreadsheetId": { "location": "path", "description": "The spreadsheet to request.", - "required": true, - "type": "string" + "type": "string", + "required": true + }, + "includeGridData": { + "location": "query", + "description": "True if grid data should be returned.\nThis parameter is ignored if a field mask was set in the request.", + "type": "boolean" + }, + "ranges": { + "description": "The ranges to retrieve from the spreadsheet.", + "type": "string", + "repeated": true, + "location": "query" } - } - }, - "create": { - "scopes": [ - "https://www.googleapis.com/auth/drive", - "https://www.googleapis.com/auth/drive.file", - "https://www.googleapis.com/auth/spreadsheets" - ], - "parameters": {}, - "flatPath": "v4/spreadsheets", - "id": "sheets.spreadsheets.create", - "path": "v4/spreadsheets", - "description": "Creates a spreadsheet, returning the newly created spreadsheet.", - "request": { - "$ref": "Spreadsheet" }, - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Spreadsheet" - } + "flatPath": "v4/spreadsheets/{spreadsheetId}", + "path": "v4/spreadsheets/{spreadsheetId}", + "id": "sheets.spreadsheets.get", + "description": "Returns the spreadsheet at the given ID.\nThe caller must specify the spreadsheet ID.\n\nBy default, data within grids will not be returned.\nYou can include grid data one of two ways:\n\n* Specify a field mask listing your desired fields using the `fields` URL\nparameter in HTTP\n\n* Set the includeGridData\nURL parameter to true. If a field mask is set, the `includeGridData`\nparameter is ignored\n\nFor large spreadsheets, it is recommended to retrieve only the specific\nfields of the spreadsheet that you want.\n\nTo retrieve only subsets of the spreadsheet, use the\nranges URL parameter.\nMultiple ranges can be specified. Limiting the range will\nreturn only the portions of the spreadsheet that intersect the requested\nranges. Ranges are specified using A1 notation." }, "batchUpdate": { - "flatPath": "v4/spreadsheets/{spreadsheetId}:batchUpdate", "path": "v4/spreadsheets/{spreadsheetId}:batchUpdate", "id": "sheets.spreadsheets.batchUpdate", "request": { "$ref": "BatchUpdateSpreadsheetRequest" }, "description": "Applies one or more updates to the spreadsheet.\n\nEach request is validated before\nbeing applied. If any request is not valid then the entire request will\nfail and nothing will be applied.\n\nSome requests have replies to\ngive you some information about how\nthey are applied. The replies will mirror the requests. For example,\nif you applied 4 updates and the 3rd one had a reply, then the\nresponse will have 2 empty replies, the actual reply, and another empty\nreply, in that order.\n\nDue to the collaborative nature of spreadsheets, it is not guaranteed that\nthe spreadsheet will reflect exactly your changes after this completes,\nhowever it is guaranteed that the updates in the request will be\napplied together atomically. Your changes may be altered with respect to\ncollaborator changes. If there are no collaborators, the spreadsheet\nshould reflect your changes.", - "response": { - "$ref": "BatchUpdateSpreadsheetResponse" - }, + "httpMethod": "POST", "parameterOrder": [ "spreadsheetId" ], - "httpMethod": "POST", - "parameters": { - "spreadsheetId": { - "required": true, - "type": "string", - "location": "path", - "description": "The spreadsheet to apply the updates to." - } + "response": { + "$ref": "BatchUpdateSpreadsheetResponse" }, "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/spreadsheets" - ] + ], + "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The spreadsheet to apply the updates to.", + "type": "string", + "required": true + } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}:batchUpdate" + }, + "create": { + "description": "Creates a spreadsheet, returning the newly created spreadsheet.", + "request": { + "$ref": "Spreadsheet" + }, + "response": { + "$ref": "Spreadsheet" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "flatPath": "v4/spreadsheets", + "id": "sheets.spreadsheets.create", + "path": "v4/spreadsheets" } }, "resources": { + "developerMetadata": { + "methods": { + "search": { + "response": { + "$ref": "SearchDeveloperMetadataResponse" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "parameters": { + "spreadsheetId": { + "description": "The ID of the spreadsheet to retrieve metadata from.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}/developerMetadata:search", + "id": "sheets.spreadsheets.developerMetadata.search", + "path": "v4/spreadsheets/{spreadsheetId}/developerMetadata:search", + "request": { + "$ref": "SearchDeveloperMetadataRequest" + }, + "description": "Returns all developer metadata matching the specified DataFilter.\nIf the provided DataFilter represents a DeveloperMetadataLookup object,\nthis will return all DeveloperMetadata entries selected by it. If the\nDataFilter represents a location in a spreadsheet, this will return all\ndeveloper metadata associated with locations intersecting that region." + }, + "get": { + "path": "v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}", + "id": "sheets.spreadsheets.developerMetadata.get", + "description": "Returns the developer metadata with the specified id.\nThe caller must specify the spreadsheet ID and the developer metadata's\nunique metadataId.", + "httpMethod": "GET", + "parameterOrder": [ + "spreadsheetId", + "metadataId" + ], + "response": { + "$ref": "DeveloperMetadata" + }, + "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to retrieve metadata from.", + "type": "string", + "required": true + }, + "metadataId": { + "location": "path", + "format": "int32", + "description": "The ID of the developer metadata to retrieve.", + "type": "integer", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "flatPath": "v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}" + } + } + }, "values": { "methods": { - "append": { + "batchUpdate": { + "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to update.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchUpdate", + "id": "sheets.spreadsheets.values.batchUpdate", + "path": "v4/spreadsheets/{spreadsheetId}/values:batchUpdate", + "description": "Sets values in one or more ranges of a spreadsheet.\nThe caller must specify the spreadsheet ID,\na valueInputOption, and one or more\nValueRanges.", + "request": { + "$ref": "BatchUpdateValuesRequest" + }, + "response": { + "$ref": "BatchUpdateValuesResponse" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "POST" + }, + "batchGet": { + "description": "Returns one or more ranges of values from a spreadsheet.\nThe caller must specify the spreadsheet ID and one or more ranges.", + "httpMethod": "GET", + "parameterOrder": [ + "spreadsheetId" + ], + "response": { + "$ref": "BatchGetValuesResponse" + }, + "parameters": { + "spreadsheetId": { + "description": "The ID of the spreadsheet to retrieve data from.", + "type": "string", + "required": true, + "location": "path" + }, + "dateTimeRenderOption": { + "description": "How dates, times, and durations should be represented in the output.\nThis is ignored if value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", + "type": "string", + "location": "query", + "enum": [ + "SERIAL_NUMBER", + "FORMATTED_STRING" + ] + }, + "valueRenderOption": { + "description": "How values should be represented in the output.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string", + "location": "query", + "enum": [ + "FORMATTED_VALUE", + "UNFORMATTED_VALUE", + "FORMULA" + ] + }, + "majorDimension": { + "location": "query", + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ], + "description": "The major dimension that results should use.\n\nFor example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,\nthen requesting `range=A1:B2,majorDimension=ROWS` will return\n`[[1,2],[3,4]]`,\nwhereas requesting `range=A1:B2,majorDimension=COLUMNS` will return\n`[[1,3],[2,4]]`.", + "type": "string" + }, + "ranges": { + "description": "The A1 notation of the values to retrieve.", + "type": "string", + "repeated": true, + "location": "query" + } + }, + "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/spreadsheets", + "https://www.googleapis.com/auth/spreadsheets.readonly" + ], + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchGet", + "path": "v4/spreadsheets/{spreadsheetId}/values:batchGet", + "id": "sheets.spreadsheets.values.batchGet" + }, + "clear": { + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "parameters": { + "spreadsheetId": { + "description": "The ID of the spreadsheet to update.", + "type": "string", + "required": true, + "location": "path" + }, + "range": { + "description": "The A1 notation of the values to clear.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}:clear", + "id": "sheets.spreadsheets.values.clear", + "path": "v4/spreadsheets/{spreadsheetId}/values/{range}:clear", + "request": { + "$ref": "ClearValuesRequest" + }, + "description": "Clears values from a spreadsheet.\nThe caller must specify the spreadsheet ID and range.\nOnly values are cleared -- all other properties of the cell (such as\nformatting, data validation, etc..) are kept.", + "response": { + "$ref": "ClearValuesResponse" + }, + "parameterOrder": [ + "spreadsheetId", + "range" + ], + "httpMethod": "POST" + }, + "batchClearByDataFilter": { + "response": { + "$ref": "BatchClearValuesByDataFilterResponse" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", @@ -106,18 +335,55 @@ "spreadsheetId": { "location": "path", "description": "The ID of the spreadsheet to update.", + "type": "string", + "required": true + } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter", + "id": "sheets.spreadsheets.values.batchClearByDataFilter", + "path": "v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter", + "request": { + "$ref": "BatchClearValuesByDataFilterRequest" + }, + "description": "Clears one or more ranges of values from a spreadsheet.\nThe caller must specify the spreadsheet ID and one or more\nDataFilters. Ranges matching any of the specified data\nfilters will be cleared. Only values are cleared -- all other properties\nof the cell (such as formatting, data validation, etc..) are kept." + }, + "append": { + "parameters": { + "responseDateTimeRenderOption": { + "description": "Determines how dates, times, and durations in the response should be\nrendered. This is ignored if response_value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", + "type": "string", + "location": "query", + "enum": [ + "SERIAL_NUMBER", + "FORMATTED_STRING" + ] + }, + "range": { + "description": "The A1 notation of a range to search for a logical table of data.\nValues will be appended after the last row of the table.", + "type": "string", "required": true, - "type": "string" + "location": "path" + }, + "includeValuesInResponse": { + "description": "Determines if the update response should include the values\nof the cells that were appended. By default, responses\ndo not include the updated values.", + "type": "boolean", + "location": "query" + }, + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to update.", + "type": "string", + "required": true }, "responseValueRenderOption": { - "type": "string", "location": "query", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], - "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE." + "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string" }, "insertDataOption": { "location": "query", @@ -137,31 +403,16 @@ ], "description": "How the input data should be interpreted.", "type": "string" - }, - "responseDateTimeRenderOption": { - "location": "query", - "enum": [ - "SERIAL_NUMBER", - "FORMATTED_STRING" - ], - "description": "Determines how dates, times, and durations in the response should be\nrendered. This is ignored if response_value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", - "type": "string" - }, - "includeValuesInResponse": { - "location": "query", - "description": "Determines if the update response should include the values\nof the cells that were appended. By default, responses\ndo not include the updated values.", - "type": "boolean" - }, - "range": { - "location": "path", - "description": "The A1 notation of a range to search for a logical table of data.\nValues will be appended after the last row of the table.", - "required": true, - "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}:append", - "id": "sheets.spreadsheets.values.append", "path": "v4/spreadsheets/{spreadsheetId}/values/{range}:append", + "id": "sheets.spreadsheets.values.append", "description": "Appends values to a spreadsheet. The input range is used to search for\nexisting data and find a \"table\" within that range. Values will be\nappended to the next row of the table, starting with the first column of\nthe table. See the\n[guide](/sheets/api/guides/values#appending_values)\nand\n[sample code](/sheets/api/samples/writing#append_values)\nfor specific details of how tables are detected and data is appended.\n\nThe caller must specify the spreadsheet ID, range, and\na valueInputOption. The `valueInputOption` only\ncontrols how the input data will be added to the sheet (column-wise or\nrow-wise), it does not influence what cell the data starts being written\nto.", "request": { "$ref": "ValueRange" @@ -175,23 +426,38 @@ "$ref": "AppendValuesResponse" } }, - "batchClear": { - "parameters": { - "spreadsheetId": { - "required": true, - "type": "string", - "location": "path", - "description": "The ID of the spreadsheet to update." - } + "batchGetByDataFilter": { + "path": "v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter", + "id": "sheets.spreadsheets.values.batchGetByDataFilter", + "request": { + "$ref": "BatchGetValuesByDataFilterRequest" + }, + "description": "Returns one or more ranges of values from a spreadsheet that match the\nspecified data filters. The caller must specify the spreadsheet ID and\none or more DataFilters. Ranges that match any of the data\nfilters in the request will be returned.", + "httpMethod": "POST", + "parameterOrder": [ + "spreadsheetId" + ], + "response": { + "$ref": "BatchGetValuesByDataFilterResponse" }, "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/spreadsheets" ], - "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchClear", - "id": "sheets.spreadsheets.values.batchClear", + "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to retrieve data from.", + "type": "string", + "required": true + } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter" + }, + "batchClear": { "path": "v4/spreadsheets/{spreadsheetId}/values:batchClear", + "id": "sheets.spreadsheets.values.batchClear", "request": { "$ref": "BatchClearValuesRequest" }, @@ -202,22 +468,59 @@ ], "response": { "$ref": "BatchClearValuesResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/spreadsheets" + ], + "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to update.", + "type": "string", + "required": true + } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchClear" }, "get": { + "description": "Returns a range of values from a spreadsheet.\nThe caller must specify the spreadsheet ID and a range.", "httpMethod": "GET", + "response": { + "$ref": "ValueRange" + }, "parameterOrder": [ "spreadsheetId", "range" ], - "response": { - "$ref": "ValueRange" - }, + "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/spreadsheets", + "https://www.googleapis.com/auth/spreadsheets.readonly" + ], "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to retrieve data from.", + "type": "string", + "required": true + }, "range": { "location": "path", "description": "The A1 notation of the values to retrieve.", - "required": true, + "type": "string", + "required": true + }, + "dateTimeRenderOption": { + "location": "query", + "enum": [ + "SERIAL_NUMBER", + "FORMATTED_STRING" + ], + "description": "How dates, times, and durations should be represented in the output.\nThis is ignored if value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", "type": "string" }, "valueRenderOption": { @@ -230,51 +533,28 @@ "description": "How values should be represented in the output.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", "type": "string" }, - "dateTimeRenderOption": { - "type": "string", - "location": "query", - "enum": [ - "SERIAL_NUMBER", - "FORMATTED_STRING" - ], - "description": "How dates, times, and durations should be represented in the output.\nThis is ignored if value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]." - }, "majorDimension": { + "location": "query", "enum": [ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" ], "description": "The major dimension that results should use.\n\nFor example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,\nthen requesting `range=A1:B2,majorDimension=ROWS` will return\n`[[1,2],[3,4]]`,\nwhereas requesting `range=A1:B2,majorDimension=COLUMNS` will return\n`[[1,3],[2,4]]`.", - "type": "string", - "location": "query" - }, - "spreadsheetId": { - "location": "path", - "description": "The ID of the spreadsheet to retrieve data from.", - "required": true, "type": "string" } }, - "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/spreadsheets", - "https://www.googleapis.com/auth/spreadsheets.readonly" - ], "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}", - "id": "sheets.spreadsheets.values.get", "path": "v4/spreadsheets/{spreadsheetId}/values/{range}", - "description": "Returns a range of values from a spreadsheet.\nThe caller must specify the spreadsheet ID and a range." + "id": "sheets.spreadsheets.values.get" }, "update": { - "id": "sheets.spreadsheets.values.update", "path": "v4/spreadsheets/{spreadsheetId}/values/{range}", - "description": "Sets values in a range of a spreadsheet.\nThe caller must specify the spreadsheet ID, range, and\na valueInputOption.", + "id": "sheets.spreadsheets.values.update", "request": { "$ref": "ValueRange" }, + "description": "Sets values in a range of a spreadsheet.\nThe caller must specify the spreadsheet ID, range, and\na valueInputOption.", "httpMethod": "PUT", "parameterOrder": [ "spreadsheetId", @@ -289,15 +569,42 @@ "https://www.googleapis.com/auth/spreadsheets" ], "parameters": { - "valueInputOption": { - "description": "How the input data should be interpreted.", + "range": { + "description": "The A1 notation of the values to update.", "type": "string", + "required": true, + "location": "path" + }, + "includeValuesInResponse": { + "description": "Determines if the update response should include the values\nof the cells that were updated. By default, responses\ndo not include the updated values.\nIf the range to write was larger than than the range actually written,\nthe response will include all values in the requested range (excluding\ntrailing empty rows and columns).", + "type": "boolean", + "location": "query" + }, + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to update.", + "type": "string", + "required": true + }, + "responseValueRenderOption": { + "location": "query", + "enum": [ + "FORMATTED_VALUE", + "UNFORMATTED_VALUE", + "FORMULA" + ], + "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string" + }, + "valueInputOption": { "location": "query", "enum": [ "INPUT_VALUE_OPTION_UNSPECIFIED", "RAW", "USER_ENTERED" - ] + ], + "description": "How the input data should be interpreted.", + "type": "string" }, "responseDateTimeRenderOption": { "description": "Determines how dates, times, and durations in the response should be\nrendered. This is ignored if response_value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", @@ -307,49 +614,11 @@ "SERIAL_NUMBER", "FORMATTED_STRING" ] - }, - "includeValuesInResponse": { - "description": "Determines if the update response should include the values\nof the cells that were updated. By default, responses\ndo not include the updated values.\nIf the range to write was larger than than the range actually written,\nthe response will include all values in the requested range (excluding\ntrailing empty rows and columns).", - "type": "boolean", - "location": "query" - }, - "range": { - "location": "path", - "description": "The A1 notation of the values to update.", - "required": true, - "type": "string" - }, - "spreadsheetId": { - "location": "path", - "description": "The ID of the spreadsheet to update.", - "required": true, - "type": "string" - }, - "responseValueRenderOption": { - "type": "string", - "location": "query", - "enum": [ - "FORMATTED_VALUE", - "UNFORMATTED_VALUE", - "FORMULA" - ], - "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE." } }, "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}" }, - "batchUpdate": { - "description": "Sets values in one or more ranges of a spreadsheet.\nThe caller must specify the spreadsheet ID,\na valueInputOption, and one or more\nValueRanges.", - "request": { - "$ref": "BatchUpdateValuesRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "spreadsheetId" - ], - "response": { - "$ref": "BatchUpdateValuesResponse" - }, + "batchUpdateByDataFilter": { "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", @@ -359,133 +628,42 @@ "spreadsheetId": { "location": "path", "description": "The ID of the spreadsheet to update.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, - "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchUpdate", - "id": "sheets.spreadsheets.values.batchUpdate", - "path": "v4/spreadsheets/{spreadsheetId}/values:batchUpdate" - }, - "batchGet": { - "httpMethod": "GET", - "response": { - "$ref": "BatchGetValuesResponse" + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter", + "path": "v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter", + "id": "sheets.spreadsheets.values.batchUpdateByDataFilter", + "request": { + "$ref": "BatchUpdateValuesByDataFilterRequest" }, + "description": "Sets values in one or more ranges of a spreadsheet.\nThe caller must specify the spreadsheet ID,\na valueInputOption, and one or more\nDataFilterValueRanges.", + "httpMethod": "POST", "parameterOrder": [ "spreadsheetId" ], - "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/spreadsheets", - "https://www.googleapis.com/auth/spreadsheets.readonly" - ], - "parameters": { - "valueRenderOption": { - "location": "query", - "enum": [ - "FORMATTED_VALUE", - "UNFORMATTED_VALUE", - "FORMULA" - ], - "description": "How values should be represented in the output.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", - "type": "string" - }, - "dateTimeRenderOption": { - "location": "query", - "enum": [ - "SERIAL_NUMBER", - "FORMATTED_STRING" - ], - "description": "How dates, times, and durations should be represented in the output.\nThis is ignored if value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", - "type": "string" - }, - "ranges": { - "description": "The A1 notation of the values to retrieve.", - "type": "string", - "repeated": true, - "location": "query" - }, - "majorDimension": { - "location": "query", - "enum": [ - "DIMENSION_UNSPECIFIED", - "ROWS", - "COLUMNS" - ], - "description": "The major dimension that results should use.\n\nFor example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,\nthen requesting `range=A1:B2,majorDimension=ROWS` will return\n`[[1,2],[3,4]]`,\nwhereas requesting `range=A1:B2,majorDimension=COLUMNS` will return\n`[[1,3],[2,4]]`.", - "type": "string" - }, - "spreadsheetId": { - "description": "The ID of the spreadsheet to retrieve data from.", - "required": true, - "type": "string", - "location": "path" - } - }, - "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchGet", - "id": "sheets.spreadsheets.values.batchGet", - "path": "v4/spreadsheets/{spreadsheetId}/values:batchGet", - "description": "Returns one or more ranges of values from a spreadsheet.\nThe caller must specify the spreadsheet ID and one or more ranges." - }, - "clear": { "response": { - "$ref": "ClearValuesResponse" - }, - "parameterOrder": [ - "spreadsheetId", - "range" - ], - "httpMethod": "POST", - "parameters": { - "range": { - "location": "path", - "description": "The A1 notation of the values to clear.", - "required": true, - "type": "string" - }, - "spreadsheetId": { - "location": "path", - "description": "The ID of the spreadsheet to update.", - "required": true, - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/drive", - "https://www.googleapis.com/auth/drive.file", - "https://www.googleapis.com/auth/spreadsheets" - ], - "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}:clear", - "path": "v4/spreadsheets/{spreadsheetId}/values/{range}:clear", - "id": "sheets.spreadsheets.values.clear", - "request": { - "$ref": "ClearValuesRequest" - }, - "description": "Clears values from a spreadsheet.\nThe caller must specify the spreadsheet ID and range.\nOnly values are cleared -- all other properties of the cell (such as\nformatting, data validation, etc..) are kept." + "$ref": "BatchUpdateValuesByDataFilterResponse" + } } } }, "sheets": { "methods": { "copyTo": { - "flatPath": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo", - "id": "sheets.spreadsheets.sheets.copyTo", - "path": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo", - "description": "Copies a single sheet from a spreadsheet to another spreadsheet.\nReturns the properties of the newly created sheet.", "request": { "$ref": "CopySheetToAnotherSpreadsheetRequest" }, - "httpMethod": "POST", + "description": "Copies a single sheet from a spreadsheet to another spreadsheet.\nReturns the properties of the newly created sheet.", + "response": { + "$ref": "SheetProperties" + }, "parameterOrder": [ "spreadsheetId", "sheetId" ], - "response": { - "$ref": "SheetProperties" - }, + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", @@ -493,19 +671,22 @@ ], "parameters": { "sheetId": { - "description": "The ID of the sheet to copy.", + "location": "path", "format": "int32", - "required": true, + "description": "The ID of the sheet to copy.", "type": "integer", - "location": "path" + "required": true }, "spreadsheetId": { - "required": true, - "type": "string", "location": "path", - "description": "The ID of the spreadsheet containing the sheet to copy." + "description": "The ID of the spreadsheet containing the sheet to copy.", + "type": "string", + "required": true } - } + }, + "flatPath": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo", + "id": "sheets.spreadsheets.sheets.copyTo", + "path": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo" } } } @@ -513,35 +694,23 @@ } }, "parameters": { - "upload_protocol": { - "type": "string", - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." - }, "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" + "default": "true", + "type": "boolean" }, "fields": { "location": "query", "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, - "callback": { + "uploadType": { "location": "query", - "description": "JSONP", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string" }, "$.xgafv": { - "description": "V1 error format.", - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -550,7 +719,14 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" }, "alt": { "enum": [ @@ -568,26 +744,26 @@ "description": "Data format for response.", "default": "json" }, - "key": { - "location": "query", - "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.", - "type": "string" - }, "access_token": { "description": "OAuth access token.", "type": "string", "location": "query" }, + "key": { + "location": "query", + "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.", + "type": "string" + }, "quotaUser": { + "location": "query", "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.", - "type": "string", - "location": "query" + "type": "string" }, "pp": { - "location": "query", "description": "Pretty-print response.", + "default": "true", "type": "boolean", - "default": "true" + "location": "query" }, "bearer_token": { "location": "query", @@ -598,1564 +774,83 @@ "location": "query", "description": "OAuth 2.0 token for the current user.", "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" } }, "version": "v4", "baseUrl": "https://sheets.googleapis.com/", - "servicePath": "", "kind": "discovery#restDescription", "description": "Reads and writes Google Sheets.", + "servicePath": "", "basePath": "", - "id": "sheets:v4", + "revision": "20170922", "documentationLink": "https://developers.google.com/sheets/", - "revision": "20170510", + "id": "sheets:v4", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { - "CopySheetToAnotherSpreadsheetRequest": { - "id": "CopySheetToAnotherSpreadsheetRequest", - "description": "The request to copy a sheet across spreadsheets.", + "BatchUpdateValuesByDataFilterResponse": { + "id": "BatchUpdateValuesByDataFilterResponse", + "description": "The response when updating a range of values in a spreadsheet.", "type": "object", "properties": { - "destinationSpreadsheetId": { - "description": "The ID of the spreadsheet to copy the sheet to.", - "type": "string" - } - } - }, - "PivotGroupSortValueBucket": { - "properties": { - "valuesIndex": { - "description": "The offset in the PivotTable.values list which the values in this\ngrouping should be sorted by.", + "totalUpdatedCells": { "format": "int32", + "description": "The total number of cells updated.", "type": "integer" }, - "buckets": { - "description": "Determines the bucket from which values are chosen to sort.\n\nFor example, in a pivot table with one row group & two column groups,\nthe row group can list up to two values. The first value corresponds\nto a value within the first column group, and the second value\ncorresponds to a value in the second column group. If no values\nare listed, this would indicate that the row should be sorted according\nto the \"Grand Total\" over the column groups. If a single value is listed,\nthis would correspond to using the \"Total\" of that bucket.", - "type": "array", - "items": { - "$ref": "ExtendedValue" - } - } - }, - "id": "PivotGroupSortValueBucket", - "description": "Information about which values in a pivot group should be used for sorting.", - "type": "object" - }, - "EmbeddedObjectPosition": { - "properties": { - "newSheet": { - "description": "If true, the embedded object will be put on a new sheet whose ID\nis chosen for you. Used only when writing.", - "type": "boolean" - }, - "sheetId": { - "description": "The sheet this is on. Set only if the embedded object\nis on its own sheet. Must be non-negative.", + "totalUpdatedColumns": { "format": "int32", + "description": "The total number of columns where at least one cell in the column was\nupdated.", "type": "integer" }, - "overlayPosition": { - "description": "The position at which the object is overlaid on top of a grid.", - "$ref": "OverlayPosition" - } - }, - "id": "EmbeddedObjectPosition", - "description": "The position of an embedded object such as a chart.", - "type": "object" - }, - "DeleteProtectedRangeRequest": { - "type": "object", - "properties": { - "protectedRangeId": { - "description": "The ID of the protected range to delete.", - "format": "int32", - "type": "integer" - } - }, - "id": "DeleteProtectedRangeRequest", - "description": "Deletes the protected range with the given ID." - }, - "AutoFillRequest": { - "description": "Fills in more data based on existing data.", - "type": "object", - "properties": { - "range": { - "$ref": "GridRange", - "description": "The range to autofill. This will examine the range and detect\nthe location that has data and automatically fill that data\nin to the rest of the range." - }, - "useAlternateSeries": { - "description": "True if we should generate data with the \"alternate\" series.\nThis differs based on the type and amount of source data.", - "type": "boolean" - }, - "sourceAndDestination": { - "$ref": "SourceAndDestination", - "description": "The source and destination areas to autofill.\nThis explicitly lists the source of the autofill and where to\nextend that data." - } - }, - "id": "AutoFillRequest" - }, - "GradientRule": { - "type": "object", - "properties": { - "minpoint": { - "$ref": "InterpolationPoint", - "description": "The starting interpolation point." - }, - "maxpoint": { - "$ref": "InterpolationPoint", - "description": "The final interpolation point." - }, - "midpoint": { - "description": "An optional midway interpolation point.", - "$ref": "InterpolationPoint" - } - }, - "id": "GradientRule", - "description": "A rule that applies a gradient color scale format, based on\nthe interpolation points listed. The format of a cell will vary\nbased on its contents as compared to the values of the interpolation\npoints." - }, - "SetBasicFilterRequest": { - "description": "Sets the basic filter associated with a sheet.", - "type": "object", - "properties": { - "filter": { - "$ref": "BasicFilter", - "description": "The filter to set." - } - }, - "id": "SetBasicFilterRequest" - }, - "ClearValuesRequest": { - "description": "The request for clearing a range of values in a spreadsheet.", - "type": "object", - "properties": {}, - "id": "ClearValuesRequest" - }, - "InterpolationPoint": { - "properties": { - "color": { - "$ref": "Color", - "description": "The color this interpolation point should use." - }, - "type": { - "enumDescriptions": [ - "The default value, do not use.", - "The interpolation point will use the minimum value in the\ncells over the range of the conditional format.", - "The interpolation point will use the maximum value in the\ncells over the range of the conditional format.", - "The interpolation point will use exactly the value in\nInterpolationPoint.value.", - "The interpolation point will be the given percentage over\nall the cells in the range of the conditional format.\nThis is equivalent to NUMBER if the value was:\n`=(MAX(FLATTEN(range)) * (value / 100))\n + (MIN(FLATTEN(range)) * (1 - (value / 100)))`\n(where errors in the range are ignored when flattening).", - "The interpolation point will be the given percentile\nover all the cells in the range of the conditional format.\nThis is equivalent to NUMBER if the value was:\n`=PERCENTILE(FLATTEN(range), value / 100)`\n(where errors in the range are ignored when flattening)." - ], - "enum": [ - "INTERPOLATION_POINT_TYPE_UNSPECIFIED", - "MIN", - "MAX", - "NUMBER", - "PERCENT", - "PERCENTILE" - ], - "description": "How the value should be interpreted.", - "type": "string" - }, - "value": { - "description": "The value this interpolation point uses. May be a formula.\nUnused if type is MIN or\nMAX.", - "type": "string" - } - }, - "id": "InterpolationPoint", - "description": "A single interpolation point on a gradient conditional format.\nThese pin the gradient color scale according to the color,\ntype and value chosen.", - "type": "object" - }, - "FindReplaceResponse": { - "properties": { - "rowsChanged": { - "description": "The number of rows changed.", - "format": "int32", - "type": "integer" - }, - "sheetsChanged": { - "description": "The number of sheets changed.", - "format": "int32", - "type": "integer" - }, - "formulasChanged": { - "type": "integer", - "description": "The number of formula cells changed.", - "format": "int32" - }, - "valuesChanged": { - "description": "The number of non-formula cells changed.", - "format": "int32", - "type": "integer" - }, - "occurrencesChanged": { - "description": "The number of occurrences (possibly multiple within a cell) changed.\nFor example, if replacing `\"e\"` with `\"o\"` in `\"Google Sheets\"`, this would\nbe `\"3\"` because `\"Google Sheets\"` -\u003e `\"Googlo Shoots\"`.", - "format": "int32", - "type": "integer" - } - }, - "id": "FindReplaceResponse", - "description": "The result of the find/replace.", - "type": "object" - }, - "DeleteEmbeddedObjectRequest": { - "description": "Deletes the embedded object with the given ID.", - "type": "object", - "properties": { - "objectId": { - "description": "The ID of the embedded object to delete.", - "format": "int32", - "type": "integer" - } - }, - "id": "DeleteEmbeddedObjectRequest" - }, - "DuplicateFilterViewRequest": { - "properties": { - "filterId": { - "description": "The ID of the filter being duplicated.", - "format": "int32", - "type": "integer" - } - }, - "id": "DuplicateFilterViewRequest", - "description": "Duplicates a particular filter view.", - "type": "object" - }, - "DeleteSheetRequest": { - "properties": { - "sheetId": { - "description": "The ID of the sheet to delete.", - "format": "int32", - "type": "integer" - } - }, - "id": "DeleteSheetRequest", - "description": "Deletes the requested sheet.", - "type": "object" - }, - "UpdateConditionalFormatRuleResponse": { - "description": "The result of updating a conditional format rule.", - "type": "object", - "properties": { - "newIndex": { - "description": "The index of the new rule.", - "format": "int32", - "type": "integer" - }, - "oldIndex": { - "description": "The old index of the rule. Not set if a rule was replaced\n(because it is the same as new_index).", - "format": "int32", - "type": "integer" - }, - "newRule": { - "description": "The new rule that replaced the old rule (if replacing),\nor the rule that was moved (if moved)", - "$ref": "ConditionalFormatRule" - }, - "oldRule": { - "description": "The old (deleted) rule. Not set if a rule was moved\n(because it is the same as new_rule).", - "$ref": "ConditionalFormatRule" - } - }, - "id": "UpdateConditionalFormatRuleResponse" - }, - "DuplicateSheetRequest": { - "id": "DuplicateSheetRequest", - "description": "Duplicates the contents of a sheet.", - "type": "object", - "properties": { - "sourceSheetId": { - "description": "The sheet to duplicate.", - "format": "int32", - "type": "integer" - }, - "newSheetId": { - "description": "If set, the ID of the new sheet. If not set, an ID is chosen.\nIf set, the ID must not conflict with any existing sheet ID.\nIf set, it must be non-negative.", - "format": "int32", - "type": "integer" - }, - "insertSheetIndex": { - "description": "The zero-based index where the new sheet should be inserted.\nThe index of all sheets after this are incremented.", - "format": "int32", - "type": "integer" - }, - "newSheetName": { - "type": "string", - "description": "The name of the new sheet. If empty, a new name is chosen for you." - } - } - }, - "ConditionValue": { - "description": "The value of the condition.", - "type": "object", - "properties": { - "relativeDate": { - "enumDescriptions": [ - "Default value, do not use.", - "The value is one year before today.", - "The value is one month before today.", - "The value is one week before today.", - "The value is yesterday.", - "The value is today.", - "The value is tomorrow." - ], - "enum": [ - "RELATIVE_DATE_UNSPECIFIED", - "PAST_YEAR", - "PAST_MONTH", - "PAST_WEEK", - "YESTERDAY", - "TODAY", - "TOMORROW" - ], - "description": "A relative date (based on the current date).\nValid only if the type is\nDATE_BEFORE,\nDATE_AFTER,\nDATE_ON_OR_BEFORE or\nDATE_ON_OR_AFTER.\n\nRelative dates are not supported in data validation.\nThey are supported only in conditional formatting and\nconditional filters.", - "type": "string" - }, - "userEnteredValue": { - "description": "A value the condition is based on.\nThe value will be parsed as if the user typed into a cell.\nFormulas are supported (and must begin with an `=`).", - "type": "string" - } - }, - "id": "ConditionValue" - }, - "ExtendedValue": { - "description": "The kinds of value that a cell in a spreadsheet can have.", - "type": "object", - "properties": { - "numberValue": { - "description": "Represents a double value.\nNote: Dates, Times and DateTimes are represented as doubles in\n\"serial number\" format.", - "format": "double", - "type": "number" - }, - "errorValue": { - "$ref": "ErrorValue", - "description": "Represents an error.\nThis field is read-only." - }, - "stringValue": { - "description": "Represents a string value.\nLeading single quotes are not included. For example, if the user typed\n`'123` into the UI, this would be represented as a `stringValue` of\n`\"123\"`.", - "type": "string" - }, - "boolValue": { - "description": "Represents a boolean value.", - "type": "boolean" - }, - "formulaValue": { - "description": "Represents a formula.", - "type": "string" - } - }, - "id": "ExtendedValue" - }, - "AddChartRequest": { - "properties": { - "chart": { - "$ref": "EmbeddedChart", - "description": "The chart that should be added to the spreadsheet, including the position\nwhere it should be placed. The chartId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a chart that already exists.)" - } - }, - "id": "AddChartRequest", - "description": "Adds a chart to a sheet in the spreadsheet.", - "type": "object" - }, - "Spreadsheet": { - "description": "Resource that represents a spreadsheet.", - "type": "object", - "properties": { - "properties": { - "$ref": "SpreadsheetProperties", - "description": "Overall properties of a spreadsheet." - }, - "spreadsheetId": { - "description": "The ID of the spreadsheet.\nThis field is read-only.", - "type": "string" - }, - "sheets": { - "description": "The sheets that are part of a spreadsheet.", - "type": "array", - "items": { - "$ref": "Sheet" - } - }, - "namedRanges": { - "description": "The named ranges defined in a spreadsheet.", - "type": "array", - "items": { - "$ref": "NamedRange" - } - }, - "spreadsheetUrl": { - "description": "The url of the spreadsheet.\nThis field is read-only.", - "type": "string" - } - }, - "id": "Spreadsheet" - }, - "BatchClearValuesResponse": { - "description": "The response when clearing a range of values in a spreadsheet.", - "type": "object", - "properties": { - "clearedRanges": { - "description": "The ranges that were cleared, in A1 notation.\n(If the requests were for an unbounded range or a ranger larger\n than the bounds of the sheet, this will be the actual ranges\n that were cleared, bounded to the sheet's limits.)", - "type": "array", - "items": { - "type": "string" - } - }, "spreadsheetId": { "description": "The spreadsheet the updates were applied to.", "type": "string" - } - }, - "id": "BatchClearValuesResponse" - }, - "BandedRange": { - "description": "A banded (alternating colors) range in a sheet.", - "type": "object", - "properties": { - "rowProperties": { - "$ref": "BandingProperties", - "description": "Properties for row bands. These properties will be applied on a row-by-row\nbasis throughout all the rows in the range. At least one of\nrow_properties or column_properties must be specified." }, - "columnProperties": { - "description": "Properties for column bands. These properties will be applied on a column-\nby-column basis throughout all the columns in the range. At least one of\nrow_properties or column_properties must be specified.", - "$ref": "BandingProperties" - }, - "range": { - "$ref": "GridRange", - "description": "The range over which these properties are applied." - }, - "bandedRangeId": { - "description": "The id of the banded range.", - "format": "int32", - "type": "integer" - } - }, - "id": "BandedRange" - }, - "UpdateProtectedRangeRequest": { - "description": "Updates an existing protected range with the specified\nprotectedRangeId.", - "type": "object", - "properties": { - "protectedRange": { - "$ref": "ProtectedRange", - "description": "The protected range to update with the new properties." - }, - "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `protectedRange` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" - } - }, - "id": "UpdateProtectedRangeRequest" - }, - "TextFormat": { - "description": "The format of a run of text in a cell.\nAbsent values indicate that the field isn't specified.", - "type": "object", - "properties": { - "italic": { - "description": "True if the text is italicized.", - "type": "boolean" - }, - "strikethrough": { - "description": "True if the text has a strikethrough.", - "type": "boolean" - }, - "fontSize": { - "description": "The size of the font.", + "totalUpdatedRows": { "format": "int32", + "description": "The total number of rows where at least one cell in the row was updated.", "type": "integer" }, - "underline": { - "description": "True if the text is underlined.", - "type": "boolean" - }, - "foregroundColor": { - "$ref": "Color", - "description": "The foreground color of the text." - }, - "bold": { - "description": "True if the text is bold.", - "type": "boolean" - }, - "fontFamily": { - "description": "The font family.", - "type": "string" - } - }, - "id": "TextFormat" - }, - "AddSheetResponse": { - "description": "The result of adding a sheet.", - "type": "object", - "properties": { - "properties": { - "$ref": "SheetProperties", - "description": "The properties of the newly added sheet." - } - }, - "id": "AddSheetResponse" - }, - "AddFilterViewResponse": { - "type": "object", - "properties": { - "filter": { - "$ref": "FilterView", - "description": "The newly added filter view." - } - }, - "id": "AddFilterViewResponse", - "description": "The result of adding a filter view." - }, - "IterativeCalculationSettings": { - "description": "Settings to control how circular dependencies are resolved with iterative\ncalculation.", - "type": "object", - "properties": { - "maxIterations": { - "description": "When iterative calculation is enabled, the maximum number of calculation\nrounds to perform.", - "format": "int32", - "type": "integer" - }, - "convergenceThreshold": { - "description": "When iterative calculation is enabled and successive results differ by\nless than this threshold value, the calculation rounds stop.", - "format": "double", - "type": "number" - } - }, - "id": "IterativeCalculationSettings" - }, - "SpreadsheetProperties": { - "description": "Properties of a spreadsheet.", - "type": "object", - "properties": { - "defaultFormat": { - "description": "The default format of all cells in the spreadsheet.\nCellData.effectiveFormat will not be set if the\ncell's format is equal to this default format.\nThis field is read-only.", - "$ref": "CellFormat" - }, - "autoRecalc": { - "enumDescriptions": [ - "Default value. This value must not be used.", - "Volatile functions are updated on every change.", - "Volatile functions are updated on every change and every minute.", - "Volatile functions are updated on every change and hourly." - ], - "enum": [ - "RECALCULATION_INTERVAL_UNSPECIFIED", - "ON_CHANGE", - "MINUTE", - "HOUR" - ], - "description": "The amount of time to wait before volatile functions are recalculated.", - "type": "string" - }, - "title": { - "description": "The title of the spreadsheet.", - "type": "string" - }, - "timeZone": { - "description": "The time zone of the spreadsheet, in CLDR format such as\n`America/New_York`. If the time zone isn't recognized, this may\nbe a custom time zone such as `GMT-07:00`.", - "type": "string" - }, - "locale": { - "description": "The locale of the spreadsheet in one of the following formats:\n\n* an ISO 639-1 language code such as `en`\n\n* an ISO 639-2 language code such as `fil`, if no 639-1 code exists\n\n* a combination of the ISO language code and country code, such as `en_US`\n\nNote: when updating this field, not all locales/languages are supported.", - "type": "string" - }, - "iterativeCalculationSettings": { - "description": "Determines whether and how circular references are resolved with iterative\ncalculation. Absence of this field means that circular references will\nresult in calculation errors.", - "$ref": "IterativeCalculationSettings" - } - }, - "id": "SpreadsheetProperties" - }, - "OverlayPosition": { - "description": "The location an object is overlaid on top of a grid.", - "type": "object", - "properties": { - "anchorCell": { - "$ref": "GridCoordinate", - "description": "The cell the object is anchored to." - }, - "offsetYPixels": { - "description": "The vertical offset, in pixels, that the object is offset\nfrom the anchor cell.", - "format": "int32", - "type": "integer" - }, - "heightPixels": { - "description": "The height of the object, in pixels. Defaults to 371.", - "format": "int32", - "type": "integer" - }, - "widthPixels": { - "description": "The width of the object, in pixels. Defaults to 600.", - "format": "int32", - "type": "integer" - }, - "offsetXPixels": { - "type": "integer", - "description": "The horizontal offset, in pixels, that the object is offset\nfrom the anchor cell.", - "format": "int32" - } - }, - "id": "OverlayPosition" - }, - "RepeatCellRequest": { - "id": "RepeatCellRequest", - "description": "Updates all cells in the range to the values in the given Cell object.\nOnly the fields listed in the fields field are updated; others are\nunchanged.\n\nIf writing a cell with a formula, the formula's ranges will automatically\nincrement for each field in the range.\nFor example, if writing a cell with formula `=A1` into range B2:C4,\nB2 would be `=A1`, B3 would be `=A2`, B4 would be `=A3`,\nC2 would be `=B1`, C3 would be `=B2`, C4 would be `=B3`.\n\nTo keep the formula's ranges static, use the `$` indicator.\nFor example, use the formula `=$A$1` to prevent both the row and the\ncolumn from incrementing.", - "type": "object", - "properties": { - "range": { - "description": "The range to repeat the cell in.", - "$ref": "GridRange" - }, - "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `cell` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" - }, - "cell": { - "$ref": "CellData", - "description": "The data to write." - } - } - }, - "AddChartResponse": { - "description": "The result of adding a chart to a spreadsheet.", - "type": "object", - "properties": { - "chart": { - "description": "The newly added chart.", - "$ref": "EmbeddedChart" - } - }, - "id": "AddChartResponse" - }, - "InsertDimensionRequest": { - "id": "InsertDimensionRequest", - "description": "Inserts rows or columns in a sheet at a particular index.", - "type": "object", - "properties": { - "inheritFromBefore": { - "description": "Whether dimension properties should be extended from the dimensions\nbefore or after the newly inserted dimensions.\nTrue to inherit from the dimensions before (in which case the start\nindex must be greater than 0), and false to inherit from the dimensions\nafter.\n\nFor example, if row index 0 has red background and row index 1\nhas a green background, then inserting 2 rows at index 1 can inherit\neither the green or red background. If `inheritFromBefore` is true,\nthe two new rows will be red (because the row before the insertion point\nwas red), whereas if `inheritFromBefore` is false, the two new rows will\nbe green (because the row after the insertion point was green).", - "type": "boolean" - }, - "range": { - "description": "The dimensions to insert. Both the start and end indexes must be bounded.", - "$ref": "DimensionRange" - } - } - }, - "UpdateSpreadsheetPropertiesRequest": { - "description": "Updates properties of a spreadsheet.", - "type": "object", - "properties": { - "properties": { - "$ref": "SpreadsheetProperties", - "description": "The properties to update." - }, - "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root 'properties' is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" - } - }, - "id": "UpdateSpreadsheetPropertiesRequest" - }, - "ProtectedRange": { - "description": "A protected range.", - "type": "object", - "properties": { - "unprotectedRanges": { - "description": "The list of unprotected ranges within a protected sheet.\nUnprotected ranges are only supported on protected sheets.", - "type": "array", + "responses": { + "description": "The response for each range updated.", "items": { - "$ref": "GridRange" - } - }, - "namedRangeId": { - "description": "The named range this protected range is backed by, if any.\n\nWhen writing, only one of range or named_range_id\nmay be set.", - "type": "string" - }, - "protectedRangeId": { - "description": "The ID of the protected range.\nThis field is read-only.", - "format": "int32", - "type": "integer" - }, - "warningOnly": { - "description": "True if this protected range will show a warning when editing.\nWarning-based protection means that every user can edit data in the\nprotected range, except editing will prompt a warning asking the user\nto confirm the edit.\n\nWhen writing: if this field is true, then editors is ignored.\nAdditionally, if this field is changed from true to false and the\n`editors` field is not set (nor included in the field mask), then\nthe editors will be set to all the editors in the document.", - "type": "boolean" - }, - "requestingUserCanEdit": { - "description": "True if the user who requested this protected range can edit the\nprotected area.\nThis field is read-only.", - "type": "boolean" - }, - "range": { - "description": "The range that is being protected.\nThe range may be fully unbounded, in which case this is considered\na protected sheet.\n\nWhen writing, only one of range or named_range_id\nmay be set.", - "$ref": "GridRange" - }, - "editors": { - "$ref": "Editors", - "description": "The users and groups with edit access to the protected range.\nThis field is only visible to users with edit access to the protected\nrange and the document.\nEditors are not supported with warning_only protection." - }, - "description": { - "description": "The description of this protected range.", - "type": "string" - } - }, - "id": "ProtectedRange" - }, - "BatchUpdateValuesRequest": { - "description": "The request for updating more than one range of values in a spreadsheet.", - "type": "object", - "properties": { - "responseValueRenderOption": { - "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", - "type": "string", - "enumDescriptions": [ - "Values will be calculated & formatted in the reply according to the\ncell's formatting. Formatting is based on the spreadsheet's locale,\nnot the requesting user's locale.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return `\"$1.23\"`.", - "Values will be calculated, but not formatted in the reply.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return the number `1.23`.", - "Values will not be calculated. The reply will include the formulas.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen A2 would return `\"=A1\"`." - ], - "enum": [ - "FORMATTED_VALUE", - "UNFORMATTED_VALUE", - "FORMULA" - ] - }, - "includeValuesInResponse": { - "description": "Determines if the update response should include the values\nof the cells that were updated. By default, responses\ndo not include the updated values. The `updatedData` field within\neach of the BatchUpdateValuesResponse.responses will contain\nthe updated values. If the range to write was larger than than the range\nactually written, the response will include all values in the requested\nrange (excluding trailing empty rows and columns).", - "type": "boolean" - }, - "valueInputOption": { - "description": "How the input data should be interpreted.", - "type": "string", - "enumDescriptions": [ - "Default input value. This value must not be used.", - "The values the user has entered will not be parsed and will be stored\nas-is.", - "The values will be parsed as if the user typed them into the UI.\nNumbers will stay as numbers, but strings may be converted to numbers,\ndates, etc. following the same rules that are applied when entering\ntext into a cell via the Google Sheets UI." - ], - "enum": [ - "INPUT_VALUE_OPTION_UNSPECIFIED", - "RAW", - "USER_ENTERED" - ] - }, - "data": { - "description": "The new values to apply to the spreadsheet.", - "type": "array", - "items": { - "$ref": "ValueRange" - } - }, - "responseDateTimeRenderOption": { - "enumDescriptions": [ - "Instructs date, time, datetime, and duration fields to be output\nas doubles in \"serial number\" format, as popularized by Lotus 1-2-3.\nThe whole number portion of the value (left of the decimal) counts\nthe days since December 30th 1899. The fractional portion (right of\nthe decimal) counts the time as a fraction of the day. For example,\nJanuary 1st 1900 at noon would be 2.5, 2 because it's 2 days after\nDecember 30st 1899, and .5 because noon is half a day. February 1st\n1900 at 3pm would be 33.625. This correctly treats the year 1900 as\nnot a leap year.", - "Instructs date, time, datetime, and duration fields to be output\nas strings in their given number format (which is dependent\non the spreadsheet locale)." - ], - "enum": [ - "SERIAL_NUMBER", - "FORMATTED_STRING" - ], - "description": "Determines how dates, times, and durations in the response should be\nrendered. This is ignored if response_value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", - "type": "string" - } - }, - "id": "BatchUpdateValuesRequest" - }, - "DimensionProperties": { - "id": "DimensionProperties", - "description": "Properties about a dimension.", - "type": "object", - "properties": { - "pixelSize": { - "description": "The height (if a row) or width (if a column) of the dimension in pixels.", - "format": "int32", - "type": "integer" - }, - "hiddenByFilter": { - "description": "True if this dimension is being filtered.\nThis field is read-only.", - "type": "boolean" - }, - "hiddenByUser": { - "description": "True if this dimension is explicitly hidden.", - "type": "boolean" - } - } - }, - "DimensionRange": { - "description": "A range along a single dimension on a sheet.\nAll indexes are zero-based.\nIndexes are half open: the start index is inclusive\nand the end index is exclusive.\nMissing indexes indicate the range is unbounded on that side.", - "type": "object", - "properties": { - "startIndex": { - "type": "integer", - "description": "The start (inclusive) of the span, or not set if unbounded.", - "format": "int32" - }, - "endIndex": { - "description": "The end (exclusive) of the span, or not set if unbounded.", - "format": "int32", - "type": "integer" - }, - "sheetId": { - "description": "The sheet this span is on.", - "format": "int32", - "type": "integer" - }, - "dimension": { - "enum": [ - "DIMENSION_UNSPECIFIED", - "ROWS", - "COLUMNS" - ], - "description": "The dimension of the span.", - "type": "string", - "enumDescriptions": [ - "The default value, do not use.", - "Operates on the rows of a sheet.", - "Operates on the columns of a sheet." - ] - } - }, - "id": "DimensionRange" - }, - "NamedRange": { - "id": "NamedRange", - "description": "A named range.", - "type": "object", - "properties": { - "name": { - "description": "The name of the named range.", - "type": "string" - }, - "namedRangeId": { - "description": "The ID of the named range.", - "type": "string" - }, - "range": { - "description": "The range this represents.", - "$ref": "GridRange" - } - } - }, - "CutPasteRequest": { - "id": "CutPasteRequest", - "description": "Moves data from the source to the destination.", - "type": "object", - "properties": { - "source": { - "description": "The source data to cut.", - "$ref": "GridRange" - }, - "pasteType": { - "enum": [ - "PASTE_NORMAL", - "PASTE_VALUES", - "PASTE_FORMAT", - "PASTE_NO_BORDERS", - "PASTE_FORMULA", - "PASTE_DATA_VALIDATION", - "PASTE_CONDITIONAL_FORMATTING" - ], - "description": "What kind of data to paste. All the source data will be cut, regardless\nof what is pasted.", - "type": "string", - "enumDescriptions": [ - "Paste values, formulas, formats, and merges.", - "Paste the values ONLY without formats, formulas, or merges.", - "Paste the format and data validation only.", - "Like PASTE_NORMAL but without borders.", - "Paste the formulas only.", - "Paste the data validation only.", - "Paste the conditional formatting rules only." - ] - }, - "destination": { - "$ref": "GridCoordinate", - "description": "The top-left coordinate where the data should be pasted." - } - } - }, - "BasicChartSeries": { - "description": "A single series of data in a chart.\nFor example, if charting stock prices over time, multiple series may exist,\none for the \"Open Price\", \"High Price\", \"Low Price\" and \"Close Price\".", - "type": "object", - "properties": { - "targetAxis": { - "description": "The minor axis that will specify the range of values for this series.\nFor example, if charting stocks over time, the \"Volume\" series\nmay want to be pinned to the right with the prices pinned to the left,\nbecause the scale of trading volume is different than the scale of\nprices.\nIt is an error to specify an axis that isn't a valid minor axis\nfor the chart's type.", - "type": "string", - "enumDescriptions": [ - "Default value, do not use.", - "The axis rendered at the bottom of a chart.\nFor most charts, this is the standard major axis.\nFor bar charts, this is a minor axis.", - "The axis rendered at the left of a chart.\nFor most charts, this is a minor axis.\nFor bar charts, this is the standard major axis.", - "The axis rendered at the right of a chart.\nFor most charts, this is a minor axis.\nFor bar charts, this is an unusual major axis." - ], - "enum": [ - "BASIC_CHART_AXIS_POSITION_UNSPECIFIED", - "BOTTOM_AXIS", - "LEFT_AXIS", - "RIGHT_AXIS" - ] - }, - "series": { - "$ref": "ChartData", - "description": "The data being visualized in this chart series." - }, - "type": { - "enumDescriptions": [ - "Default value, do not use.", - "A \u003ca href=\"/chart/interactive/docs/gallery/barchart\"\u003ebar chart\u003c/a\u003e.", - "A \u003ca href=\"/chart/interactive/docs/gallery/linechart\"\u003eline chart\u003c/a\u003e.", - "An \u003ca href=\"/chart/interactive/docs/gallery/areachart\"\u003earea chart\u003c/a\u003e.", - "A \u003ca href=\"/chart/interactive/docs/gallery/columnchart\"\u003ecolumn chart\u003c/a\u003e.", - "A \u003ca href=\"/chart/interactive/docs/gallery/scatterchart\"\u003escatter chart\u003c/a\u003e.", - "A \u003ca href=\"/chart/interactive/docs/gallery/combochart\"\u003ecombo chart\u003c/a\u003e." - ], - "enum": [ - "BASIC_CHART_TYPE_UNSPECIFIED", - "BAR", - "LINE", - "AREA", - "COLUMN", - "SCATTER", - "COMBO" - ], - "description": "The type of this series. Valid only if the\nchartType is\nCOMBO.\nDifferent types will change the way the series is visualized.\nOnly LINE, AREA,\nand COLUMN are supported.", - "type": "string" - } - }, - "id": "BasicChartSeries" - }, - "Borders": { - "description": "The borders of the cell.", - "type": "object", - "properties": { - "bottom": { - "$ref": "Border", - "description": "The bottom border of the cell." - }, - "top": { - "$ref": "Border", - "description": "The top border of the cell." - }, - "left": { - "$ref": "Border", - "description": "The left border of the cell." - }, - "right": { - "description": "The right border of the cell.", - "$ref": "Border" - } - }, - "id": "Borders" - }, - "AutoResizeDimensionsRequest": { - "properties": { - "dimensions": { - "$ref": "DimensionRange", - "description": "The dimensions to automatically resize.\nOnly COLUMNS are supported." - } - }, - "id": "AutoResizeDimensionsRequest", - "description": "Automatically resizes one or more dimensions based on the contents\nof the cells in that dimension.", - "type": "object" - }, - "UpdateBordersRequest": { - "description": "Updates the borders of a range.\nIf a field is not set in the request, that means the border remains as-is.\nFor example, with two subsequent UpdateBordersRequest:\n\n 1. range: A1:A5 `{ top: RED, bottom: WHITE }`\n 2. range: A1:A5 `{ left: BLUE }`\n\nThat would result in A1:A5 having a borders of\n`{ top: RED, bottom: WHITE, left: BLUE }`.\nIf you want to clear a border, explicitly set the style to\nNONE.", - "type": "object", - "properties": { - "innerVertical": { - "$ref": "Border", - "description": "The vertical border to put within the range." - }, - "right": { - "description": "The border to put at the right of the range.", - "$ref": "Border" - }, - "range": { - "$ref": "GridRange", - "description": "The range whose borders should be updated." - }, - "innerHorizontal": { - "$ref": "Border", - "description": "The horizontal border to put within the range." - }, - "top": { - "$ref": "Border", - "description": "The border to put at the top of the range." - }, - "left": { - "$ref": "Border", - "description": "The border to put at the left of the range." - }, - "bottom": { - "$ref": "Border", - "description": "The border to put at the bottom of the range." - } - }, - "id": "UpdateBordersRequest" - }, - "CellFormat": { - "properties": { - "textRotation": { - "$ref": "TextRotation", - "description": "The rotation applied to text in a cell" - }, - "wrapStrategy": { - "enumDescriptions": [ - "The default value, do not use.", - "Lines that are longer than the cell width will be written in the next\ncell over, so long as that cell is empty. If the next cell over is\nnon-empty, this behaves the same as CLIP. The text will never wrap\nto the next line unless the user manually inserts a new line.\nExample:\n\n | First sentence. |\n | Manual newline that is very long. \u003c- Text continues into next cell\n | Next newline. |", - "This wrap strategy represents the old Google Sheets wrap strategy where\nwords that are longer than a line are clipped rather than broken. This\nstrategy is not supported on all platforms and is being phased out.\nExample:\n\n | Cell has a |\n | loooooooooo| \u003c- Word is clipped.\n | word. |", - "Lines that are longer than the cell width will be clipped.\nThe text will never wrap to the next line unless the user manually\ninserts a new line.\nExample:\n\n | First sentence. |\n | Manual newline t| \u003c- Text is clipped\n | Next newline. |", - "Words that are longer than a line are wrapped at the character level\nrather than clipped.\nExample:\n\n | Cell has a |\n | loooooooooo| \u003c- Word is broken.\n | ong word. |" - ], - "enum": [ - "WRAP_STRATEGY_UNSPECIFIED", - "OVERFLOW_CELL", - "LEGACY_WRAP", - "CLIP", - "WRAP" - ], - "description": "The wrap strategy for the value in the cell.", - "type": "string" - }, - "numberFormat": { - "$ref": "NumberFormat", - "description": "A format describing how number values should be represented to the user." - }, - "hyperlinkDisplayType": { - "enumDescriptions": [ - "The default value: the hyperlink is rendered. Do not use this.", - "A hyperlink should be explicitly rendered.", - "A hyperlink should not be rendered." - ], - "enum": [ - "HYPERLINK_DISPLAY_TYPE_UNSPECIFIED", - "LINKED", - "PLAIN_TEXT" - ], - "description": "How a hyperlink, if it exists, should be displayed in the cell.", - "type": "string" - }, - "horizontalAlignment": { - "type": "string", - "enumDescriptions": [ - "The horizontal alignment is not specified. Do not use this.", - "The text is explicitly aligned to the left of the cell.", - "The text is explicitly aligned to the center of the cell.", - "The text is explicitly aligned to the right of the cell." - ], - "enum": [ - "HORIZONTAL_ALIGN_UNSPECIFIED", - "LEFT", - "CENTER", - "RIGHT" - ], - "description": "The horizontal alignment of the value in the cell." - }, - "textFormat": { - "description": "The format of the text in the cell (unless overridden by a format run).", - "$ref": "TextFormat" - }, - "backgroundColor": { - "description": "The background color of the cell.", - "$ref": "Color" - }, - "padding": { - "description": "The padding of the cell.", - "$ref": "Padding" - }, - "verticalAlignment": { - "description": "The vertical alignment of the value in the cell.", - "type": "string", - "enumDescriptions": [ - "The vertical alignment is not specified. Do not use this.", - "The text is explicitly aligned to the top of the cell.", - "The text is explicitly aligned to the middle of the cell.", - "The text is explicitly aligned to the bottom of the cell." - ], - "enum": [ - "VERTICAL_ALIGN_UNSPECIFIED", - "TOP", - "MIDDLE", - "BOTTOM" - ] - }, - "borders": { - "$ref": "Borders", - "description": "The borders of the cell." - }, - "textDirection": { - "description": "The direction of the text in the cell.", - "type": "string", - "enumDescriptions": [ - "The text direction is not specified. Do not use this.", - "The text direction of left-to-right was set by the user.", - "The text direction of right-to-left was set by the user." - ], - "enum": [ - "TEXT_DIRECTION_UNSPECIFIED", - "LEFT_TO_RIGHT", - "RIGHT_TO_LEFT" - ] - } - }, - "id": "CellFormat", - "description": "The format of a cell.", - "type": "object" - }, - "ClearValuesResponse": { - "description": "The response when clearing a range of values in a spreadsheet.", - "type": "object", - "properties": { - "clearedRange": { - "description": "The range (in A1 notation) that was cleared.\n(If the request was for an unbounded range or a ranger larger\n than the bounds of the sheet, this will be the actual range\n that was cleared, bounded to the sheet's limits.)", - "type": "string" - }, - "spreadsheetId": { - "description": "The spreadsheet the updates were applied to.", - "type": "string" - } - }, - "id": "ClearValuesResponse" - }, - "DeleteConditionalFormatRuleRequest": { - "description": "Deletes a conditional format rule at the given index.\nAll subsequent rules' indexes are decremented.", - "type": "object", - "properties": { - "sheetId": { - "description": "The sheet the rule is being deleted from.", - "format": "int32", - "type": "integer" - }, - "index": { - "description": "The zero-based index of the rule to be deleted.", - "format": "int32", - "type": "integer" - } - }, - "id": "DeleteConditionalFormatRuleRequest" - }, - "AddBandingResponse": { - "description": "The result of adding a banded range.", - "type": "object", - "properties": { - "bandedRange": { - "$ref": "BandedRange", - "description": "The banded range that was added." - } - }, - "id": "AddBandingResponse" - }, - "DeleteNamedRangeRequest": { - "description": "Removes the named range with the given ID from the spreadsheet.", - "type": "object", - "properties": { - "namedRangeId": { - "description": "The ID of the named range to delete.", - "type": "string" - } - }, - "id": "DeleteNamedRangeRequest" - }, - "ChartData": { - "description": "The data included in a domain or series.", - "type": "object", - "properties": { - "sourceRange": { - "$ref": "ChartSourceRange", - "description": "The source ranges of the data." - } - }, - "id": "ChartData" - }, - "BatchGetValuesResponse": { - "description": "The response when retrieving more than one range of values in a spreadsheet.", - "type": "object", - "properties": { - "valueRanges": { - "description": "The requested values. The order of the ValueRanges is the same as the\norder of the requested ranges.", - "type": "array", - "items": { - "$ref": "ValueRange" - } - }, - "spreadsheetId": { - "description": "The ID of the spreadsheet the data was retrieved from.", - "type": "string" - } - }, - "id": "BatchGetValuesResponse" - }, - "UpdateBandingRequest": { - "id": "UpdateBandingRequest", - "description": "Updates properties of the supplied banded range.", - "type": "object", - "properties": { - "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `bandedRange` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" - }, - "bandedRange": { - "$ref": "BandedRange", - "description": "The banded range to update with the new properties." - } - } - }, - "Color": { - "description": "Represents a color in the RGBA color space. This representation is designed\nfor simplicity of conversion to/from color representations in various\nlanguages over compactness; for example, the fields of this representation\ncan be trivially provided to the constructor of \"java.awt.Color\" in Java; it\ncan also be trivially provided to UIColor's \"+colorWithRed:green:blue:alpha\"\nmethod in iOS; and, with just a little work, it can be easily formatted into\na CSS \"rgba()\" string in JavaScript, as well. Here are some examples:\n\nExample (Java):\n\n import com.google.type.Color;\n\n // ...\n public static java.awt.Color fromProto(Color protocolor) {\n float alpha = protocolor.hasAlpha()\n ? protocolor.getAlpha().getValue()\n : 1.0;\n\n return new java.awt.Color(\n protocolor.getRed(),\n protocolor.getGreen(),\n protocolor.getBlue(),\n alpha);\n }\n\n public static Color toProto(java.awt.Color color) {\n float red = (float) color.getRed();\n float green = (float) color.getGreen();\n float blue = (float) color.getBlue();\n float denominator = 255.0;\n Color.Builder resultBuilder =\n Color\n .newBuilder()\n .setRed(red / denominator)\n .setGreen(green / denominator)\n .setBlue(blue / denominator);\n int alpha = color.getAlpha();\n if (alpha != 255) {\n result.setAlpha(\n FloatValue\n .newBuilder()\n .setValue(((float) alpha) / denominator)\n .build());\n }\n return resultBuilder.build();\n }\n // ...\n\nExample (iOS / Obj-C):\n\n // ...\n static UIColor* fromProto(Color* protocolor) {\n float red = [protocolor red];\n float green = [protocolor green];\n float blue = [protocolor blue];\n FloatValue* alpha_wrapper = [protocolor alpha];\n float alpha = 1.0;\n if (alpha_wrapper != nil) {\n alpha = [alpha_wrapper value];\n }\n return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];\n }\n\n static Color* toProto(UIColor* color) {\n CGFloat red, green, blue, alpha;\n if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {\n return nil;\n }\n Color* result = [Color alloc] init];\n [result setRed:red];\n [result setGreen:green];\n [result setBlue:blue];\n if (alpha \u003c= 0.9999) {\n [result setAlpha:floatWrapperWithValue(alpha)];\n }\n [result autorelease];\n return result;\n }\n // ...\n\n Example (JavaScript):\n\n // ...\n\n var protoToCssColor = function(rgb_color) {\n var redFrac = rgb_color.red || 0.0;\n var greenFrac = rgb_color.green || 0.0;\n var blueFrac = rgb_color.blue || 0.0;\n var red = Math.floor(redFrac * 255);\n var green = Math.floor(greenFrac * 255);\n var blue = Math.floor(blueFrac * 255);\n\n if (!('alpha' in rgb_color)) {\n return rgbToCssColor_(red, green, blue);\n }\n\n var alphaFrac = rgb_color.alpha.value || 0.0;\n var rgbParams = [red, green, blue].join(',');\n return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');\n };\n\n var rgbToCssColor_ = function(red, green, blue) {\n var rgbNumber = new Number((red \u003c\u003c 16) | (green \u003c\u003c 8) | blue);\n var hexString = rgbNumber.toString(16);\n var missingZeros = 6 - hexString.length;\n var resultBuilder = ['#'];\n for (var i = 0; i \u003c missingZeros; i++) {\n resultBuilder.push('0');\n }\n resultBuilder.push(hexString);\n return resultBuilder.join('');\n };\n\n // ...", - "type": "object", - "properties": { - "green": { - "description": "The amount of green in the color as a value in the interval [0, 1].", - "format": "float", - "type": "number" - }, - "blue": { - "type": "number", - "description": "The amount of blue in the color as a value in the interval [0, 1].", - "format": "float" - }, - "alpha": { - "description": "The fraction of this color that should be applied to the pixel. That is,\nthe final pixel color is defined by the equation:\n\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n\nThis means that a value of 1.0 corresponds to a solid color, whereas\na value of 0.0 corresponds to a completely transparent color. This\nuses a wrapper message rather than a simple float scalar so that it is\npossible to distinguish between a default value and the value being unset.\nIf omitted, this color object is to be rendered as a solid color\n(as if the alpha value had been explicitly given with a value of 1.0).", - "format": "float", - "type": "number" - }, - "red": { - "description": "The amount of red in the color as a value in the interval [0, 1].", - "format": "float", - "type": "number" - } - }, - "id": "Color" - }, - "PivotGroup": { - "description": "A single grouping (either row or column) in a pivot table.", - "type": "object", - "properties": { - "sortOrder": { - "enum": [ - "SORT_ORDER_UNSPECIFIED", - "ASCENDING", - "DESCENDING" - ], - "description": "The order the values in this group should be sorted.", - "type": "string", - "enumDescriptions": [ - "Default value, do not use this.", - "Sort ascending.", - "Sort descending." - ] - }, - "valueBucket": { - "description": "The bucket of the opposite pivot group to sort by.\nIf not specified, sorting is alphabetical by this group's values.", - "$ref": "PivotGroupSortValueBucket" - }, - "sourceColumnOffset": { - "description": "The column offset of the source range that this grouping is based on.\n\nFor example, if the source was `C10:E15`, a `sourceColumnOffset` of `0`\nmeans this group refers to column `C`, whereas the offset `1` would refer\nto column `D`.", - "format": "int32", - "type": "integer" - }, - "showTotals": { - "description": "True if the pivot table should include the totals for this grouping.", - "type": "boolean" - }, - "valueMetadata": { - "description": "Metadata about values in the grouping.", - "type": "array", - "items": { - "$ref": "PivotGroupValueMetadata" - } - } - }, - "id": "PivotGroup" - }, - "PivotTable": { - "description": "A pivot table.", - "type": "object", - "properties": { - "criteria": { - "additionalProperties": { - "$ref": "PivotFilterCriteria" + "$ref": "UpdateValuesByDataFilterResponse" }, - "description": "An optional mapping of filters per source column offset.\n\nThe filters will be applied before aggregating data into the pivot table.\nThe map's key is the column offset of the source range that you want to\nfilter, and the value is the criteria for that column.\n\nFor example, if the source was `C10:E15`, a key of `0` will have the filter\nfor column `C`, whereas the key `1` is for column `D`.", - "type": "object" + "type": "array" }, - "rows": { - "description": "Each row grouping in the pivot table.", - "type": "array", - "items": { - "$ref": "PivotGroup" - } - }, - "valueLayout": { - "enumDescriptions": [ - "Values are laid out horizontally (as columns).", - "Values are laid out vertically (as rows)." - ], - "enum": [ - "HORIZONTAL", - "VERTICAL" - ], - "description": "Whether values should be listed horizontally (as columns)\nor vertically (as rows).", - "type": "string" - }, - "source": { - "$ref": "GridRange", - "description": "The range the pivot table is reading data from." - }, - "columns": { - "type": "array", - "items": { - "$ref": "PivotGroup" - }, - "description": "Each column grouping in the pivot table." - }, - "values": { - "description": "A list of values to include in the pivot table.", - "type": "array", - "items": { - "$ref": "PivotValue" - } - } - }, - "id": "PivotTable" - }, - "ChartSourceRange": { - "properties": { - "sources": { - "description": "The ranges of data for a series or domain.\nExactly one dimension must have a length of 1,\nand all sources in the list must have the same dimension\nwith length 1.\nThe domain (if it exists) & all series must have the same number\nof source ranges. If using more than one source range, then the source\nrange at a given offset must be contiguous across the domain and series.\n\nFor example, these are valid configurations:\n\n domain sources: A1:A5\n series1 sources: B1:B5\n series2 sources: D6:D10\n\n domain sources: A1:A5, C10:C12\n series1 sources: B1:B5, D10:D12\n series2 sources: C1:C5, E10:E12", - "type": "array", - "items": { - "$ref": "GridRange" - } - } - }, - "id": "ChartSourceRange", - "description": "Source ranges for a chart.", - "type": "object" - }, - "AppendCellsRequest": { - "description": "Adds new cells after the last row with data in a sheet,\ninserting new rows into the sheet if necessary.", - "type": "object", - "properties": { - "rows": { - "description": "The data to append.", - "type": "array", - "items": { - "$ref": "RowData" - } - }, - "fields": { - "description": "The fields of CellData that should be updated.\nAt least one field must be specified.\nThe root is the CellData; 'row.values.' should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" - }, - "sheetId": { - "description": "The sheet ID to append the data to.", - "format": "int32", - "type": "integer" - } - }, - "id": "AppendCellsRequest" - }, - "ValueRange": { - "id": "ValueRange", - "description": "Data within a range of the spreadsheet.", - "type": "object", - "properties": { - "majorDimension": { - "enumDescriptions": [ - "The default value, do not use.", - "Operates on the rows of a sheet.", - "Operates on the columns of a sheet." - ], - "enum": [ - "DIMENSION_UNSPECIFIED", - "ROWS", - "COLUMNS" - ], - "description": "The major dimension of the values.\n\nFor output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,\nthen requesting `range=A1:B2,majorDimension=ROWS` will return\n`[[1,2],[3,4]]`,\nwhereas requesting `range=A1:B2,majorDimension=COLUMNS` will return\n`[[1,3],[2,4]]`.\n\nFor input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]`\nwill set `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS`\nthen `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`.\n\nWhen writing, if this field is not set, it defaults to ROWS.", - "type": "string" - }, - "values": { - "description": "The data that was read or to be written. This is an array of arrays,\nthe outer array representing all the data and each inner array\nrepresenting a major dimension. Each item in the inner array\ncorresponds with one cell.\n\nFor output, empty trailing rows and columns will not be included.\n\nFor input, supported value types are: bool, string, and double.\nNull values will be skipped.\nTo set a cell to an empty value, set the string value to an empty string.", - "type": "array", - "items": { - "type": "array", - "items": { - "type": "any" - } - } - }, - "range": { - "description": "The range the values cover, in A1 notation.\nFor output, this range indicates the entire requested range,\neven though the values will exclude trailing rows and columns.\nWhen appending values, this field represents the range to search for a\ntable, after which values will be appended.", - "type": "string" - } - } - }, - "AddBandingRequest": { - "id": "AddBandingRequest", - "description": "Adds a new banded range to the spreadsheet.", - "type": "object", - "properties": { - "bandedRange": { - "description": "The banded range to add. The bandedRangeId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a range that already exists.)", - "$ref": "BandedRange" - } - } - }, - "Response": { - "description": "A single response from an update.", - "type": "object", - "properties": { - "addSheet": { - "$ref": "AddSheetResponse", - "description": "A reply from adding a sheet." - }, - "updateConditionalFormatRule": { - "description": "A reply from updating a conditional format rule.", - "$ref": "UpdateConditionalFormatRuleResponse" - }, - "addNamedRange": { - "description": "A reply from adding a named range.", - "$ref": "AddNamedRangeResponse" - }, - "addFilterView": { - "description": "A reply from adding a filter view.", - "$ref": "AddFilterViewResponse" - }, - "addBanding": { - "description": "A reply from adding a banded range.", - "$ref": "AddBandingResponse" - }, - "addProtectedRange": { - "description": "A reply from adding a protected range.", - "$ref": "AddProtectedRangeResponse" - }, - "duplicateSheet": { - "description": "A reply from duplicating a sheet.", - "$ref": "DuplicateSheetResponse" - }, - "updateEmbeddedObjectPosition": { - "$ref": "UpdateEmbeddedObjectPositionResponse", - "description": "A reply from updating an embedded object's position." - }, - "deleteConditionalFormatRule": { - "$ref": "DeleteConditionalFormatRuleResponse", - "description": "A reply from deleting a conditional format rule." - }, - "duplicateFilterView": { - "$ref": "DuplicateFilterViewResponse", - "description": "A reply from duplicating a filter view." - }, - "addChart": { - "description": "A reply from adding a chart.", - "$ref": "AddChartResponse" - }, - "findReplace": { - "$ref": "FindReplaceResponse", - "description": "A reply from doing a find/replace." - } - }, - "id": "Response" - }, - "InsertRangeRequest": { - "description": "Inserts cells into a range, shifting the existing cells over or down.", - "type": "object", - "properties": { - "range": { - "$ref": "GridRange", - "description": "The range to insert new cells into." - }, - "shiftDimension": { - "description": "The dimension which will be shifted when inserting cells.\nIf ROWS, existing cells will be shifted down.\nIf COLUMNS, existing cells will be shifted right.", - "type": "string", - "enumDescriptions": [ - "The default value, do not use.", - "Operates on the rows of a sheet.", - "Operates on the columns of a sheet." - ], - "enum": [ - "DIMENSION_UNSPECIFIED", - "ROWS", - "COLUMNS" - ] - } - }, - "id": "InsertRangeRequest" - }, - "TextFormatRun": { - "id": "TextFormatRun", - "description": "A run of a text format. The format of this run continues until the start\nindex of the next run.\nWhen updating, all fields must be set.", - "type": "object", - "properties": { - "format": { - "description": "The format of this run. Absent values inherit the cell's format.", - "$ref": "TextFormat" - }, - "startIndex": { - "description": "The character index where this run starts.", + "totalUpdatedSheets": { "format": "int32", + "description": "The total number of sheets where at least one cell in the sheet was\nupdated.", "type": "integer" } } }, - "EmbeddedChart": { - "description": "A chart embedded in a sheet.", - "type": "object", - "properties": { - "chartId": { - "description": "The ID of the chart.", - "format": "int32", - "type": "integer" - }, - "position": { - "description": "The position of the chart.", - "$ref": "EmbeddedObjectPosition" - }, - "spec": { - "description": "The specification of the chart.", - "$ref": "ChartSpec" - } - }, - "id": "EmbeddedChart" - }, - "AddNamedRangeResponse": { - "description": "The result of adding a named range.", - "type": "object", - "properties": { - "namedRange": { - "description": "The named range to add.", - "$ref": "NamedRange" - } - }, - "id": "AddNamedRangeResponse" - }, "RowData": { + "id": "RowData", "description": "Data about each cell in a row.", "type": "object", "properties": { "values": { "description": "The values in the row, one per column.", - "type": "array", "items": { "$ref": "CellData" - } + }, + "type": "array" } - }, - "id": "RowData" + } }, "Border": { + "id": "Border", "description": "A border along a cell.", "type": "object", "properties": { - "color": { - "$ref": "Color", - "description": "The color of the border." - }, - "width": { - "description": "The width of the border, in pixels.\nDeprecated; the width is determined by the \"style\" field.", - "format": "int32", - "type": "integer" - }, "style": { - "description": "The style of the border.", - "type": "string", "enumDescriptions": [ "The style is not specified. Do not use this.", "The border is dotted.", @@ -2175,71 +870,82 @@ "SOLID_THICK", "NONE", "DOUBLE" - ] + ], + "description": "The style of the border.", + "type": "string" + }, + "color": { + "$ref": "Color", + "description": "The color of the border." + }, + "width": { + "format": "int32", + "description": "The width of the border, in pixels.\nDeprecated; the width is determined by the \"style\" field.", + "type": "integer" } - }, - "id": "Border" + } }, "GridData": { + "id": "GridData", "description": "Data in the grid, as well as metadata about the dimensions.", "type": "object", "properties": { "columnMetadata": { "description": "Metadata about the requested columns in the grid, starting with the column\nin start_column.", - "type": "array", "items": { "$ref": "DimensionProperties" - } + }, + "type": "array" }, "startColumn": { - "type": "integer", + "format": "int32", "description": "The first column this GridData refers to, zero-based.", - "format": "int32" + "type": "integer" }, "rowMetadata": { "description": "Metadata about the requested rows in the grid, starting with the row\nin start_row.", - "type": "array", "items": { "$ref": "DimensionProperties" - } + }, + "type": "array" }, "rowData": { "description": "The data in the grid, one entry per row,\nstarting with the row in startRow.\nThe values in RowData will correspond to columns starting\nat start_column.", - "type": "array", "items": { "$ref": "RowData" - } + }, + "type": "array" }, "startRow": { - "type": "integer", + "format": "int32", "description": "The first row this GridData refers to, zero-based.", - "format": "int32" + "type": "integer" } - }, - "id": "GridData" + } }, - "FindReplaceRequest": { + "UpdateNamedRangeRequest": { + "id": "UpdateNamedRangeRequest", + "description": "Updates properties of the named range with the specified\nnamedRangeId.", "type": "object", "properties": { - "searchByRegex": { - "description": "True if the find value is a regex.\nThe regular expression and replacement should follow Java regex rules\nat https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html.\nThe replacement string is allowed to refer to capturing groups.\nFor example, if one cell has the contents `\"Google Sheets\"` and another\nhas `\"Google Docs\"`, then searching for `\"o.* (.*)\"` with a replacement of\n`\"$1 Rocks\"` would change the contents of the cells to\n`\"GSheets Rocks\"` and `\"GDocs Rocks\"` respectively.", - "type": "boolean" + "namedRange": { + "$ref": "NamedRange", + "description": "The named range to update with the new properties." }, - "find": { - "description": "The value to search.", + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `namedRange` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "type": "string" - }, - "replacement": { - "description": "The value to use as the replacement.", - "type": "string" - }, - "range": { - "$ref": "GridRange", - "description": "The range to find/replace over." - }, + } + } + }, + "FindReplaceRequest": { + "description": "Finds and replaces data in cells over a range, sheet, or all sheets.", + "type": "object", + "properties": { "sheetId": { - "description": "The sheet to find/replace over.", "format": "int32", + "description": "The sheet to find/replace over.", "type": "integer" }, "allSheets": { @@ -2257,79 +963,93 @@ "matchEntireCell": { "description": "True if the find value should match the entire cell.", "type": "boolean" - } - }, - "id": "FindReplaceRequest", - "description": "Finds and replaces data in cells over a range, sheet, or all sheets." - }, - "UpdateNamedRangeRequest": { - "type": "object", - "properties": { - "namedRange": { - "$ref": "NamedRange", - "description": "The named range to update with the new properties." }, - "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `namedRange` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", + "find": { + "description": "The value to search.", "type": "string" + }, + "searchByRegex": { + "description": "True if the find value is a regex.\nThe regular expression and replacement should follow Java regex rules\nat https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html.\nThe replacement string is allowed to refer to capturing groups.\nFor example, if one cell has the contents `\"Google Sheets\"` and another\nhas `\"Google Docs\"`, then searching for `\"o.* (.*)\"` with a replacement of\n`\"$1 Rocks\"` would change the contents of the cells to\n`\"GSheets Rocks\"` and `\"GDocs Rocks\"` respectively.", + "type": "boolean" + }, + "replacement": { + "description": "The value to use as the replacement.", + "type": "string" + }, + "range": { + "$ref": "GridRange", + "description": "The range to find/replace over." } }, - "id": "UpdateNamedRangeRequest", - "description": "Updates properties of the named range with the specified\nnamedRangeId." + "id": "FindReplaceRequest" }, "AddSheetRequest": { "description": "Adds a new sheet.\nWhen a sheet is added at a given index,\nall subsequent sheets' indexes are incremented.\nTo add an object sheet, use AddChartRequest instead and specify\nEmbeddedObjectPosition.sheetId or\nEmbeddedObjectPosition.newSheet.", "type": "object", "properties": { "properties": { - "description": "The properties the new sheet should have.\nAll properties are optional.\nThe sheetId field is optional; if one is not\nset, an id will be randomly generated. (It is an error to specify the ID\nof a sheet that already exists.)", - "$ref": "SheetProperties" + "$ref": "SheetProperties", + "description": "The properties the new sheet should have.\nAll properties are optional.\nThe sheetId field is optional; if one is not\nset, an id will be randomly generated. (It is an error to specify the ID\nof a sheet that already exists.)" } }, "id": "AddSheetRequest" }, "UpdateCellsRequest": { + "id": "UpdateCellsRequest", + "description": "Updates all cells in a range with new data.", "type": "object", "properties": { - "start": { - "description": "The coordinate to start writing data at.\nAny number of rows and columns (including a different number of\ncolumns per row) may be written.", - "$ref": "GridCoordinate" - }, "range": { "description": "The range to write data to.\n\nIf the data in rows does not cover the entire requested range,\nthe fields matching those set in fields will be cleared.", "$ref": "GridRange" }, + "fields": { + "format": "google-fieldmask", + "description": "The fields of CellData that should be updated.\nAt least one field must be specified.\nThe root is the CellData; 'row.values.' should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + }, "rows": { "description": "The data to write.", - "type": "array", "items": { "$ref": "RowData" - } + }, + "type": "array" }, - "fields": { - "description": "The fields of CellData that should be updated.\nAt least one field must be specified.\nThe root is the CellData; 'row.values.' should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" + "start": { + "$ref": "GridCoordinate", + "description": "The coordinate to start writing data at.\nAny number of rows and columns (including a different number of\ncolumns per row) may be written." + } + } + }, + "RandomizeRangeRequest": { + "description": "Randomizes the order of the rows in a range.", + "type": "object", + "properties": { + "range": { + "$ref": "GridRange", + "description": "The range to randomize." } }, - "id": "UpdateCellsRequest", - "description": "Updates all cells in a range with new data." + "id": "RandomizeRangeRequest" }, "DeleteConditionalFormatRuleResponse": { + "id": "DeleteConditionalFormatRuleResponse", "description": "The result of deleting a conditional format rule.", "type": "object", "properties": { "rule": { - "$ref": "ConditionalFormatRule", - "description": "The rule that was deleted." + "description": "The rule that was deleted.", + "$ref": "ConditionalFormatRule" } - }, - "id": "DeleteConditionalFormatRuleResponse" + } }, "DeleteRangeRequest": { + "description": "Deletes a range of cells, shifting other cells into the deleted area.", + "type": "object", "properties": { "shiftDimension": { + "description": "The dimension from which deleted cells will be replaced with.\nIf ROWS, existing cells will be shifted upward to\nreplace the deleted cells. If COLUMNS, existing cells\nwill be shifted left to replace the deleted cells.", + "type": "string", "enumDescriptions": [ "The default value, do not use.", "Operates on the rows of a sheet.", @@ -2339,37 +1059,33 @@ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" - ], - "description": "The dimension from which deleted cells will be replaced with.\nIf ROWS, existing cells will be shifted upward to\nreplace the deleted cells. If COLUMNS, existing cells\nwill be shifted left to replace the deleted cells.", - "type": "string" + ] }, "range": { - "$ref": "GridRange", - "description": "The range of cells to delete." + "description": "The range of cells to delete.", + "$ref": "GridRange" } }, - "id": "DeleteRangeRequest", - "description": "Deletes a range of cells, shifting other cells into the deleted area.", - "type": "object" + "id": "DeleteRangeRequest" }, "GridCoordinate": { "id": "GridCoordinate", "description": "A coordinate in a sheet.\nAll indexes are zero-based.", "type": "object", "properties": { - "rowIndex": { - "description": "The row index of the coordinate.", + "sheetId": { "format": "int32", + "description": "The sheet this coordinate is on.", "type": "integer" }, "columnIndex": { - "description": "The column index of the coordinate.", "format": "int32", + "description": "The column index of the coordinate.", "type": "integer" }, - "sheetId": { - "description": "The sheet this coordinate is on.", + "rowIndex": { "format": "int32", + "description": "The row index of the coordinate.", "type": "integer" } } @@ -2379,17 +1095,48 @@ "type": "object", "properties": { "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `properties` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `properties` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "type": "string" }, "properties": { - "$ref": "SheetProperties", - "description": "The properties to update." + "description": "The properties to update.", + "$ref": "SheetProperties" } }, "id": "UpdateSheetPropertiesRequest" }, + "GridProperties": { + "id": "GridProperties", + "description": "Properties of a grid.", + "type": "object", + "properties": { + "rowCount": { + "format": "int32", + "description": "The number of rows in the grid.", + "type": "integer" + }, + "hideGridlines": { + "description": "True if the grid isn't showing gridlines in the UI.", + "type": "boolean" + }, + "frozenRowCount": { + "format": "int32", + "description": "The number of rows that are frozen in the grid.", + "type": "integer" + }, + "frozenColumnCount": { + "format": "int32", + "description": "The number of columns that are frozen in the grid.", + "type": "integer" + }, + "columnCount": { + "format": "int32", + "description": "The number of columns in the grid.", + "type": "integer" + } + } + }, "UnmergeCellsRequest": { "description": "Unmerges cells in the given range.", "type": "object", @@ -2401,47 +1148,17 @@ }, "id": "UnmergeCellsRequest" }, - "GridProperties": { - "description": "Properties of a grid.", + "SortSpec": { + "id": "SortSpec", + "description": "A sort order associated with a specific column or row.", "type": "object", - "properties": { - "frozenRowCount": { - "type": "integer", - "description": "The number of rows that are frozen in the grid.", - "format": "int32" - }, - "hideGridlines": { - "description": "True if the grid isn't showing gridlines in the UI.", - "type": "boolean" - }, - "columnCount": { - "description": "The number of columns in the grid.", - "format": "int32", - "type": "integer" - }, - "frozenColumnCount": { - "description": "The number of columns that are frozen in the grid.", - "format": "int32", - "type": "integer" - }, - "rowCount": { - "description": "The number of rows in the grid.", - "format": "int32", - "type": "integer" - } - }, - "id": "GridProperties" - }, - "SortSpec": { "properties": { "dimensionIndex": { - "description": "The dimension the sort should be applied to.", "format": "int32", + "description": "The dimension the sort should be applied to.", "type": "integer" }, "sortOrder": { - "description": "The order data should be sorted.", - "type": "string", "enumDescriptions": [ "Default value, do not use this.", "Sort ascending.", @@ -2451,87 +1168,93 @@ "SORT_ORDER_UNSPECIFIED", "ASCENDING", "DESCENDING" - ] + ], + "description": "The order data should be sorted.", + "type": "string" + } + } + }, + "Sheet": { + "description": "A sheet in a spreadsheet.", + "type": "object", + "properties": { + "bandedRanges": { + "description": "The banded (i.e. alternating colors) ranges on this sheet.", + "items": { + "$ref": "BandedRange" + }, + "type": "array" + }, + "properties": { + "$ref": "SheetProperties", + "description": "The properties of the sheet." + }, + "charts": { + "description": "The specifications of every chart on this sheet.", + "items": { + "$ref": "EmbeddedChart" + }, + "type": "array" + }, + "filterViews": { + "description": "The filter views in this sheet.", + "items": { + "$ref": "FilterView" + }, + "type": "array" + }, + "conditionalFormats": { + "description": "The conditional format rules in this sheet.", + "items": { + "$ref": "ConditionalFormatRule" + }, + "type": "array" + }, + "protectedRanges": { + "description": "The protected ranges in this sheet.", + "items": { + "$ref": "ProtectedRange" + }, + "type": "array" + }, + "developerMetadata": { + "description": "The developer metadata associated with a sheet.", + "items": { + "$ref": "DeveloperMetadata" + }, + "type": "array" + }, + "basicFilter": { + "description": "The filter on this sheet, if any.", + "$ref": "BasicFilter" + }, + "merges": { + "description": "The ranges that are merged together.", + "items": { + "$ref": "GridRange" + }, + "type": "array" + }, + "data": { + "description": "Data in the grid, if this is a grid sheet.\nThe number of GridData objects returned is dependent on the number of\nranges requested on this sheet. For example, if this is representing\n`Sheet1`, and the spreadsheet was requested with ranges\n`Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first GridData will have a\nstartRow/startColumn of `0`,\nwhile the second one will have `startRow 14` (zero-based row 15),\nand `startColumn 3` (zero-based column D).", + "items": { + "$ref": "GridData" + }, + "type": "array" } }, - "id": "SortSpec", - "description": "A sort order associated with a specific column or row.", - "type": "object" + "id": "Sheet" }, "UpdateEmbeddedObjectPositionResponse": { + "description": "The result of updating an embedded object's position.", + "type": "object", "properties": { "position": { "$ref": "EmbeddedObjectPosition", "description": "The new position of the embedded object." } }, - "id": "UpdateEmbeddedObjectPositionResponse", - "description": "The result of updating an embedded object's position.", - "type": "object" - }, - "Sheet": { - "description": "A sheet in a spreadsheet.", - "type": "object", - "properties": { - "basicFilter": { - "$ref": "BasicFilter", - "description": "The filter on this sheet, if any." - }, - "merges": { - "description": "The ranges that are merged together.", - "type": "array", - "items": { - "$ref": "GridRange" - } - }, - "data": { - "description": "Data in the grid, if this is a grid sheet.\nThe number of GridData objects returned is dependent on the number of\nranges requested on this sheet. For example, if this is representing\n`Sheet1`, and the spreadsheet was requested with ranges\n`Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first GridData will have a\nstartRow/startColumn of `0`,\nwhile the second one will have `startRow 14` (zero-based row 15),\nand `startColumn 3` (zero-based column D).", - "type": "array", - "items": { - "$ref": "GridData" - } - }, - "bandedRanges": { - "description": "The banded (i.e. alternating colors) ranges on this sheet.", - "type": "array", - "items": { - "$ref": "BandedRange" - } - }, - "charts": { - "description": "The specifications of every chart on this sheet.", - "type": "array", - "items": { - "$ref": "EmbeddedChart" - } - }, - "properties": { - "description": "The properties of the sheet.", - "$ref": "SheetProperties" - }, - "filterViews": { - "description": "The filter views in this sheet.", - "type": "array", - "items": { - "$ref": "FilterView" - } - }, - "conditionalFormats": { - "description": "The conditional format rules in this sheet.", - "type": "array", - "items": { - "$ref": "ConditionalFormatRule" - } - }, - "protectedRanges": { - "description": "The protected ranges in this sheet.", - "type": "array", - "items": { - "$ref": "ProtectedRange" - } - } - }, - "id": "Sheet" + "id": "UpdateEmbeddedObjectPositionResponse" }, "BooleanRule": { "id": "BooleanRule", @@ -2543,12 +1266,31 @@ "$ref": "CellFormat" }, "condition": { - "$ref": "BooleanCondition", - "description": "The condition of the rule. If the condition evaluates to true,\nthe format will be applied." + "description": "The condition of the rule. If the condition evaluates to true,\nthe format will be applied.", + "$ref": "BooleanCondition" } } }, + "FilterCriteria": { + "description": "Criteria for showing/hiding rows in a filter or filter view.", + "type": "object", + "properties": { + "condition": { + "description": "A condition that must be true for values to be shown.\n(This does not override hiddenValues -- if a value is listed there,\n it will still be hidden.)", + "$ref": "BooleanCondition" + }, + "hiddenValues": { + "description": "Values that should be hidden.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "FilterCriteria" + }, "PivotGroupValueMetadata": { + "id": "PivotGroupValueMetadata", "description": "Metadata about a value in a pivot grouping.", "type": "object", "properties": { @@ -2560,88 +1302,78 @@ "description": "True if the data corresponding to the value is collapsed.", "type": "boolean" } - }, - "id": "PivotGroupValueMetadata" - }, - "FilterCriteria": { - "properties": { - "hiddenValues": { - "description": "Values that should be hidden.", - "type": "array", - "items": { - "type": "string" - } - }, - "condition": { - "$ref": "BooleanCondition", - "description": "A condition that must be true for values to be shown.\n(This does not override hiddenValues -- if a value is listed there,\n it will still be hidden.)" - } - }, - "id": "FilterCriteria", - "description": "Criteria for showing/hiding rows in a filter or filter view.", - "type": "object" + } }, "Editors": { + "id": "Editors", + "description": "The editors of a protected range.", + "type": "object", "properties": { "users": { - "type": "array", + "description": "The email addresses of users with edit access to the protected range.", "items": { "type": "string" }, - "description": "The email addresses of users with edit access to the protected range." - }, - "groups": { - "description": "The email addresses of groups with edit access to the protected range.", - "type": "array", - "items": { - "type": "string" - } + "type": "array" }, "domainUsersCanEdit": { "description": "True if anyone in the document's domain has edit access to the protected\nrange. Domain protection is only supported on documents within a domain.", "type": "boolean" + }, + "groups": { + "description": "The email addresses of groups with edit access to the protected range.", + "items": { + "type": "string" + }, + "type": "array" } - }, - "id": "Editors", - "description": "The editors of a protected range.", - "type": "object" + } }, "UpdateConditionalFormatRuleRequest": { + "description": "Updates a conditional format rule at the given index,\nor moves a conditional format rule to another index.", "type": "object", "properties": { - "index": { - "description": "The zero-based index of the rule that should be replaced or moved.", - "format": "int32", - "type": "integer" - }, "sheetId": { - "description": "The sheet of the rule to move. Required if new_index is set,\nunused otherwise.", "format": "int32", + "description": "The sheet of the rule to move. Required if new_index is set,\nunused otherwise.", "type": "integer" }, "newIndex": { - "description": "The zero-based new index the rule should end up at.", "format": "int32", + "description": "The zero-based new index the rule should end up at.", "type": "integer" }, "rule": { - "description": "The rule that should replace the rule at the given index.", - "$ref": "ConditionalFormatRule" + "$ref": "ConditionalFormatRule", + "description": "The rule that should replace the rule at the given index." + }, + "index": { + "format": "int32", + "description": "The zero-based index of the rule that should be replaced or moved.", + "type": "integer" } }, - "id": "UpdateConditionalFormatRuleRequest", - "description": "Updates a conditional format rule at the given index,\nor moves a conditional format rule to another index." + "id": "UpdateConditionalFormatRuleRequest" + }, + "BasicChartDomain": { + "description": "The domain of a chart.\nFor example, if charting stock prices over time, this would be the date.", + "type": "object", + "properties": { + "domain": { + "$ref": "ChartData", + "description": "The data of the domain. For example, if charting stock prices over time,\nthis is the data representing the dates." + }, + "reversed": { + "description": "True to reverse the order of the domain values (horizontal axis).", + "type": "boolean" + } + }, + "id": "BasicChartDomain" }, "DataValidationRule": { + "description": "A data validation rule.", + "type": "object", "properties": { - "showCustomUi": { - "description": "True if the UI should be customized based on the kind of condition.\nIf true, \"List\" conditions will show a dropdown.", - "type": "boolean" - }, - "strict": { - "description": "True if invalid data should be rejected.", - "type": "boolean" - }, "inputMessage": { "description": "A message to show the user when adding data to the cell.", "type": "string" @@ -2649,42 +1381,37 @@ "condition": { "$ref": "BooleanCondition", "description": "The condition that data in the cell must match." - } - }, - "id": "DataValidationRule", - "description": "A data validation rule.", - "type": "object" - }, - "BasicChartDomain": { - "description": "The domain of a chart.\nFor example, if charting stock prices over time, this would be the date.", - "type": "object", - "properties": { - "domain": { - "description": "The data of the domain. For example, if charting stock prices over time,\nthis is the data representing the dates.", - "$ref": "ChartData" - } - }, - "id": "BasicChartDomain" - }, - "PasteDataRequest": { - "properties": { - "html": { - "description": "True if the data is HTML.", + }, + "showCustomUi": { + "description": "True if the UI should be customized based on the kind of condition.\nIf true, \"List\" conditions will show a dropdown.", "type": "boolean" }, + "strict": { + "description": "True if invalid data should be rejected.", + "type": "boolean" + } + }, + "id": "DataValidationRule" + }, + "PasteDataRequest": { + "description": "Inserts data into the spreadsheet starting at the specified coordinate.", + "type": "object", + "properties": { "coordinate": { - "description": "The coordinate at which the data should start being inserted.", - "$ref": "GridCoordinate" - }, - "data": { - "description": "The data to insert.", - "type": "string" + "$ref": "GridCoordinate", + "description": "The coordinate at which the data should start being inserted." }, "delimiter": { "description": "The delimiter in the data.", "type": "string" }, + "data": { + "description": "The data to insert.", + "type": "string" + }, "type": { + "description": "How the data should be pasted.", + "type": "string", "enumDescriptions": [ "Paste values, formulas, formats, and merges.", "Paste the values ONLY without formats, formulas, or merges.", @@ -2702,22 +1429,37 @@ "PASTE_FORMULA", "PASTE_DATA_VALIDATION", "PASTE_CONDITIONAL_FORMATTING" - ], - "description": "How the data should be pasted.", - "type": "string" + ] + }, + "html": { + "description": "True if the data is HTML.", + "type": "boolean" } }, - "id": "PasteDataRequest", - "description": "Inserts data into the spreadsheet starting at the specified coordinate.", - "type": "object" + "id": "PasteDataRequest" + }, + "UpdateDeveloperMetadataResponse": { + "description": "The response from updating developer metadata.", + "type": "object", + "properties": { + "developerMetadata": { + "description": "The updated developer metadata.", + "items": { + "$ref": "DeveloperMetadata" + }, + "type": "array" + } + }, + "id": "UpdateDeveloperMetadataResponse" }, "AppendDimensionRequest": { + "id": "AppendDimensionRequest", "description": "Appends rows or columns to the end of a sheet.", "type": "object", "properties": { "sheetId": { - "description": "The sheet to append rows or columns to.", "format": "int32", + "description": "The sheet to append rows or columns to.", "type": "integer" }, "dimension": { @@ -2735,14 +1477,14 @@ "type": "string" }, "length": { - "type": "integer", + "format": "int32", "description": "The number of rows or columns to append.", - "format": "int32" + "type": "integer" } - }, - "id": "AppendDimensionRequest" + } }, "AddNamedRangeRequest": { + "description": "Adds a named range to the spreadsheet.", "type": "object", "properties": { "namedRange": { @@ -2750,8 +1492,18 @@ "description": "The named range to add. The namedRangeId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a range that already exists.)" } }, - "id": "AddNamedRangeRequest", - "description": "Adds a named range to the spreadsheet." + "id": "AddNamedRangeRequest" + }, + "CreateDeveloperMetadataResponse": { + "description": "The response from creating developer metadata.", + "type": "object", + "properties": { + "developerMetadata": { + "$ref": "DeveloperMetadata", + "description": "The developer metadata that was created." + } + }, + "id": "CreateDeveloperMetadataResponse" }, "UpdateEmbeddedObjectPositionRequest": { "description": "Update an embedded object's position (such as a moving or resizing a\nchart or image).", @@ -2762,51 +1514,57 @@ "description": "An explicit position to move the embedded object to.\nIf newPosition.sheetId is set,\na new sheet with that ID will be created.\nIf newPosition.newSheet is set to true,\na new sheet will be created with an ID that will be chosen for you." }, "fields": { - "description": "The fields of OverlayPosition\nthat should be updated when setting a new position. Used only if\nnewPosition.overlayPosition\nis set, in which case at least one field must\nbe specified. The root `newPosition.overlayPosition` is implied and\nshould not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "format": "google-fieldmask", + "description": "The fields of OverlayPosition\nthat should be updated when setting a new position. Used only if\nnewPosition.overlayPosition\nis set, in which case at least one field must\nbe specified. The root `newPosition.overlayPosition` is implied and\nshould not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "type": "string" }, "objectId": { - "description": "The ID of the object to moved.", "format": "int32", + "description": "The ID of the object to moved.", "type": "integer" } }, "id": "UpdateEmbeddedObjectPositionRequest" }, "TextRotation": { + "id": "TextRotation", + "description": "The rotation applied to text in a cell.", + "type": "object", "properties": { "angle": { - "description": "The angle between the standard orientation and the desired orientation.\nMeasured in degrees. Valid values are between -90 and 90. Positive\nangles are angled upwards, negative are angled downwards.\n\nNote: For LTR text direction positive angles are in the counterclockwise\ndirection, whereas for RTL they are in the clockwise direction", "format": "int32", + "description": "The angle between the standard orientation and the desired orientation.\nMeasured in degrees. Valid values are between -90 and 90. Positive\nangles are angled upwards, negative are angled downwards.\n\nNote: For LTR text direction positive angles are in the counterclockwise\ndirection, whereas for RTL they are in the clockwise direction", "type": "integer" }, "vertical": { "description": "If true, text reads top to bottom, but the orientation of individual\ncharacters is unchanged.\nFor example:\n\n | V |\n | e |\n | r |\n | t |\n | i |\n | c |\n | a |\n | l |", "type": "boolean" } - }, - "id": "TextRotation", - "description": "The rotation applied to text in a cell.", - "type": "object" + } }, "PieChartSpec": { + "id": "PieChartSpec", + "description": "A \u003ca href=\"/chart/interactive/docs/gallery/piechart\"\u003epie chart\u003c/a\u003e.", + "type": "object", "properties": { - "domain": { - "$ref": "ChartData", - "description": "The data that covers the domain of the pie chart." - }, "threeDimensional": { "description": "True if the pie is three dimensional.", "type": "boolean" }, + "domain": { + "description": "The data that covers the domain of the pie chart.", + "$ref": "ChartData" + }, "series": { "$ref": "ChartData", "description": "The data that covers the one and only series of the pie chart." }, + "pieHole": { + "format": "double", + "description": "The size of the hole in the pie chart.", + "type": "number" + }, "legendPosition": { - "description": "Where the legend of the pie chart should be drawn.", - "type": "string", "enumDescriptions": [ "Default value, do not use.", "The legend is rendered on the bottom of the chart.", @@ -2824,81 +1582,80 @@ "TOP_LEGEND", "NO_LEGEND", "LABELED_LEGEND" - ] + ], + "description": "Where the legend of the pie chart should be drawn.", + "type": "string" + } + } + }, + "UpdateDeveloperMetadataRequest": { + "description": "A request to update properties of developer metadata.\nUpdates the properties of the developer metadata selected by the filters to\nthe values provided in the DeveloperMetadata resource. Callers must\nspecify the properties they wish to update in the fields parameter, as well\nas specify at least one DataFilter matching the metadata they wish to\nupdate.", + "type": "object", + "properties": { + "developerMetadata": { + "$ref": "DeveloperMetadata", + "description": "The value that all metadata matched by the data filters will be updated to." }, - "pieHole": { - "description": "The size of the hole in the pie chart.", - "format": "double", - "type": "number" + "dataFilters": { + "description": "The filters matching the developer metadata entries to update.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `developerMetadata` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" } }, - "id": "PieChartSpec", - "description": "A \u003ca href=\"/chart/interactive/docs/gallery/piechart\"\u003epie chart\u003c/a\u003e.", - "type": "object" + "id": "UpdateDeveloperMetadataRequest" }, "UpdateFilterViewRequest": { "description": "Updates properties of the filter view.", "type": "object", "properties": { "filter": { - "$ref": "FilterView", - "description": "The new properties of the filter view." + "description": "The new properties of the filter view.", + "$ref": "FilterView" }, "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `filter` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `filter` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", "type": "string" } }, "id": "UpdateFilterViewRequest" }, "ConditionalFormatRule": { + "id": "ConditionalFormatRule", "description": "A rule describing a conditional format.", "type": "object", "properties": { - "booleanRule": { - "description": "The formatting is either \"on\" or \"off\" according to the rule.", - "$ref": "BooleanRule" - }, "ranges": { "description": "The ranges that will be formatted if the condition is true.\nAll the ranges must be on the same grid.", - "type": "array", "items": { "$ref": "GridRange" - } + }, + "type": "array" }, "gradientRule": { - "$ref": "GradientRule", - "description": "The formatting will vary based on the gradients in the rule." + "description": "The formatting will vary based on the gradients in the rule.", + "$ref": "GradientRule" + }, + "booleanRule": { + "$ref": "BooleanRule", + "description": "The formatting is either \"on\" or \"off\" according to the rule." } - }, - "id": "ConditionalFormatRule" + } }, "CopyPasteRequest": { "description": "Copies data from the source to the destination.", "type": "object", "properties": { - "destination": { - "$ref": "GridRange", - "description": "The location to paste to. If the range covers a span that's\na multiple of the source's height or width, then the\ndata will be repeated to fill in the destination range.\nIf the range is smaller than the source range, the entire\nsource data will still be copied (beyond the end of the destination range)." - }, - "pasteOrientation": { - "enumDescriptions": [ - "Paste normally.", - "Paste transposed, where all rows become columns and vice versa." - ], - "enum": [ - "NORMAL", - "TRANSPOSE" - ], - "description": "How that data should be oriented when pasting.", - "type": "string" - }, - "source": { - "description": "The source range to copy.", - "$ref": "GridRange" - }, "pasteType": { + "description": "What kind of data to paste.", + "type": "string", "enumDescriptions": [ "Paste values, formulas, formats, and merges.", "Paste the values ONLY without formats, formulas, or merges.", @@ -2916,8 +1673,26 @@ "PASTE_FORMULA", "PASTE_DATA_VALIDATION", "PASTE_CONDITIONAL_FORMATTING" + ] + }, + "source": { + "description": "The source range to copy.", + "$ref": "GridRange" + }, + "destination": { + "description": "The location to paste to. If the range covers a span that's\na multiple of the source's height or width, then the\ndata will be repeated to fill in the destination range.\nIf the range is smaller than the source range, the entire\nsource data will still be copied (beyond the end of the destination range).", + "$ref": "GridRange" + }, + "pasteOrientation": { + "enumDescriptions": [ + "Paste normally.", + "Paste transposed, where all rows become columns and vice versa." ], - "description": "What kind of data to paste.", + "enum": [ + "NORMAL", + "TRANSPOSE" + ], + "description": "How that data should be oriented when pasting.", "type": "string" } }, @@ -2927,6 +1702,46 @@ "description": "A single kind of update to apply to a spreadsheet.", "type": "object", "properties": { + "duplicateFilterView": { + "$ref": "DuplicateFilterViewRequest", + "description": "Duplicates a filter view." + }, + "addChart": { + "description": "Adds a chart.", + "$ref": "AddChartRequest" + }, + "findReplace": { + "$ref": "FindReplaceRequest", + "description": "Finds and replaces occurrences of some text with other text." + }, + "updateChartSpec": { + "description": "Updates a chart's specifications.", + "$ref": "UpdateChartSpecRequest" + }, + "textToColumns": { + "$ref": "TextToColumnsRequest", + "description": "Converts a column of text into many columns of text." + }, + "updateProtectedRange": { + "$ref": "UpdateProtectedRangeRequest", + "description": "Updates a protected range." + }, + "addSheet": { + "$ref": "AddSheetRequest", + "description": "Adds a sheet." + }, + "copyPaste": { + "description": "Copies data from one area and pastes it to another.", + "$ref": "CopyPasteRequest" + }, + "deleteFilterView": { + "description": "Deletes a filter view from a sheet.", + "$ref": "DeleteFilterViewRequest" + }, + "insertDimension": { + "description": "Inserts new rows or columns in a sheet.", + "$ref": "InsertDimensionRequest" + }, "deleteRange": { "description": "Deletes a range of cells from a sheet, shifting the remaining cells.", "$ref": "DeleteRangeRequest" @@ -2936,44 +1751,56 @@ "description": "Removes a banded range" }, "addFilterView": { - "$ref": "AddFilterViewRequest", - "description": "Adds a filter view." + "description": "Adds a filter view.", + "$ref": "AddFilterViewRequest" + }, + "updateBorders": { + "description": "Updates the borders in a range of cells.", + "$ref": "UpdateBordersRequest" }, "setDataValidation": { "$ref": "SetDataValidationRequest", "description": "Sets data validation for one or more cells." }, - "updateBorders": { - "$ref": "UpdateBordersRequest", - "description": "Updates the borders in a range of cells." - }, "deleteConditionalFormatRule": { - "description": "Deletes an existing conditional format rule.", - "$ref": "DeleteConditionalFormatRuleRequest" - }, - "repeatCell": { - "$ref": "RepeatCellRequest", - "description": "Repeats a single cell across a range." + "$ref": "DeleteConditionalFormatRuleRequest", + "description": "Deletes an existing conditional format rule." }, "clearBasicFilter": { - "$ref": "ClearBasicFilterRequest", - "description": "Clears the basic filter on a sheet." + "description": "Clears the basic filter on a sheet.", + "$ref": "ClearBasicFilterRequest" + }, + "repeatCell": { + "description": "Repeats a single cell across a range.", + "$ref": "RepeatCellRequest" }, "appendDimension": { - "description": "Appends dimensions to the end of a sheet.", - "$ref": "AppendDimensionRequest" + "$ref": "AppendDimensionRequest", + "description": "Appends dimensions to the end of a sheet." }, "updateConditionalFormatRule": { "$ref": "UpdateConditionalFormatRuleRequest", "description": "Updates an existing conditional format rule." }, + "createDeveloperMetadata": { + "$ref": "CreateDeveloperMetadataRequest", + "description": "Creates new developer metadata" + }, "insertRange": { "description": "Inserts new cells in a sheet, shifting the existing cells.", "$ref": "InsertRangeRequest" }, "moveDimension": { - "description": "Moves rows or columns to another location in a sheet.", - "$ref": "MoveDimensionRequest" + "$ref": "MoveDimensionRequest", + "description": "Moves rows or columns to another location in a sheet." + }, + "deleteDeveloperMetadata": { + "description": "Deletes developer metadata", + "$ref": "DeleteDeveloperMetadataRequest" + }, + "randomizeRange": { + "$ref": "RandomizeRangeRequest", + "description": "Randomizes the order of the rows in a range." }, "updateBanding": { "description": "Updates a banded range", @@ -2984,28 +1811,32 @@ "description": "Adds a protected range." }, "deleteNamedRange": { - "$ref": "DeleteNamedRangeRequest", - "description": "Deletes a named range." + "description": "Deletes a named range.", + "$ref": "DeleteNamedRangeRequest" }, "duplicateSheet": { "description": "Duplicates a sheet.", "$ref": "DuplicateSheetRequest" }, "deleteSheet": { - "$ref": "DeleteSheetRequest", - "description": "Deletes a sheet." + "description": "Deletes a sheet.", + "$ref": "DeleteSheetRequest" }, "unmergeCells": { "$ref": "UnmergeCellsRequest", "description": "Unmerges merged cells." }, "updateEmbeddedObjectPosition": { - "$ref": "UpdateEmbeddedObjectPositionRequest", - "description": "Updates an embedded object's (e.g. chart, image) position." + "description": "Updates an embedded object's (e.g. chart, image) position.", + "$ref": "UpdateEmbeddedObjectPositionRequest" }, "updateDimensionProperties": { - "$ref": "UpdateDimensionPropertiesRequest", - "description": "Updates dimensions' properties." + "description": "Updates dimensions' properties.", + "$ref": "UpdateDimensionPropertiesRequest" + }, + "updateDeveloperMetadata": { + "$ref": "UpdateDeveloperMetadataRequest", + "description": "Updates an existing developer metadata entry" }, "pasteData": { "$ref": "PasteDataRequest", @@ -3019,13 +1850,13 @@ "$ref": "AddConditionalFormatRuleRequest", "description": "Adds a new conditional format rule." }, - "addNamedRange": { - "description": "Adds a named range.", - "$ref": "AddNamedRangeRequest" - }, "updateCells": { - "description": "Updates many cells at once.", - "$ref": "UpdateCellsRequest" + "$ref": "UpdateCellsRequest", + "description": "Updates many cells at once." + }, + "addNamedRange": { + "$ref": "AddNamedRangeRequest", + "description": "Adds a named range." }, "updateSpreadsheetProperties": { "$ref": "UpdateSpreadsheetPropertiesRequest", @@ -3043,25 +1874,25 @@ "description": "Adds a new banded range", "$ref": "AddBandingRequest" }, - "autoResizeDimensions": { - "description": "Automatically resizes one or more dimensions based on the contents\nof the cells in that dimension.", - "$ref": "AutoResizeDimensionsRequest" - }, "appendCells": { "description": "Appends cells after the last row with data in a sheet.", "$ref": "AppendCellsRequest" }, + "autoResizeDimensions": { + "$ref": "AutoResizeDimensionsRequest", + "description": "Automatically resizes one or more dimensions based on the contents\nof the cells in that dimension." + }, "cutPaste": { - "$ref": "CutPasteRequest", - "description": "Cuts data from one area and pastes it to another." + "description": "Cuts data from one area and pastes it to another.", + "$ref": "CutPasteRequest" }, "mergeCells": { "$ref": "MergeCellsRequest", "description": "Merges cells together." }, "updateNamedRange": { - "description": "Updates a named range.", - "$ref": "UpdateNamedRangeRequest" + "$ref": "UpdateNamedRangeRequest", + "description": "Updates a named range." }, "updateSheetProperties": { "$ref": "UpdateSheetPropertiesRequest", @@ -3072,65 +1903,31 @@ "$ref": "AutoFillRequest" }, "deleteDimension": { - "$ref": "DeleteDimensionRequest", - "description": "Deletes rows or columns in a sheet." + "description": "Deletes rows or columns in a sheet.", + "$ref": "DeleteDimensionRequest" }, "sortRange": { - "description": "Sorts data in a range.", - "$ref": "SortRangeRequest" + "$ref": "SortRangeRequest", + "description": "Sorts data in a range." }, "deleteProtectedRange": { "$ref": "DeleteProtectedRangeRequest", "description": "Deletes a protected range." - }, - "duplicateFilterView": { - "$ref": "DuplicateFilterViewRequest", - "description": "Duplicates a filter view." - }, - "addChart": { - "$ref": "AddChartRequest", - "description": "Adds a chart." - }, - "findReplace": { - "$ref": "FindReplaceRequest", - "description": "Finds and replaces occurrences of some text with other text." - }, - "updateChartSpec": { - "$ref": "UpdateChartSpecRequest", - "description": "Updates a chart's specifications." - }, - "textToColumns": { - "description": "Converts a column of text into many columns of text.", - "$ref": "TextToColumnsRequest" - }, - "addSheet": { - "description": "Adds a sheet.", - "$ref": "AddSheetRequest" - }, - "updateProtectedRange": { - "$ref": "UpdateProtectedRangeRequest", - "description": "Updates a protected range." - }, - "deleteFilterView": { - "description": "Deletes a filter view from a sheet.", - "$ref": "DeleteFilterViewRequest" - }, - "copyPaste": { - "description": "Copies data from one area and pastes it to another.", - "$ref": "CopyPasteRequest" - }, - "insertDimension": { - "$ref": "InsertDimensionRequest", - "description": "Inserts new rows or columns in a sheet." } }, "id": "Request" }, "BooleanCondition": { - "id": "BooleanCondition", "description": "A condition that can evaluate to true or false.\nBooleanConditions are used by conditional formatting,\ndata validation, and the criteria in filters.", "type": "object", "properties": { + "values": { + "description": "The values of the condition. The number of supported values depends\non the condition type. Some support zero values,\nothers one or two values,\nand ConditionType.ONE_OF_LIST supports an arbitrary number of values.", + "items": { + "$ref": "ConditionValue" + }, + "type": "array" + }, "type": { "description": "The type of condition.", "type": "string", @@ -3196,76 +1993,94 @@ "NOT_BLANK", "CUSTOM_FORMULA" ] - }, - "values": { - "type": "array", - "items": { - "$ref": "ConditionValue" - }, - "description": "The values of the condition. The number of supported values depends\non the condition type. Some support zero values,\nothers one or two values,\nand ConditionType.ONE_OF_LIST supports an arbitrary number of values." } - } + }, + "id": "BooleanCondition" }, "GridRange": { - "id": "GridRange", "description": "A range on a sheet.\nAll indexes are zero-based.\nIndexes are half open, e.g the start index is inclusive\nand the end index is exclusive -- [start_index, end_index).\nMissing indexes indicate the range is unbounded on that side.\n\nFor example, if `\"Sheet1\"` is sheet ID 0, then:\n\n `Sheet1!A1:A1 == sheet_id: 0,\n start_row_index: 0, end_row_index: 1,\n start_column_index: 0, end_column_index: 1`\n\n `Sheet1!A3:B4 == sheet_id: 0,\n start_row_index: 2, end_row_index: 4,\n start_column_index: 0, end_column_index: 2`\n\n `Sheet1!A:B == sheet_id: 0,\n start_column_index: 0, end_column_index: 2`\n\n `Sheet1!A5:B == sheet_id: 0,\n start_row_index: 4,\n start_column_index: 0, end_column_index: 2`\n\n `Sheet1 == sheet_id:0`\n\nThe start index must always be less than or equal to the end index.\nIf the start index equals the end index, then the range is empty.\nEmpty ranges are typically not meaningful and are usually rendered in the\nUI as `#REF!`.", "type": "object", "properties": { - "endRowIndex": { - "description": "The end row (exclusive) of the range, or not set if unbounded.", - "format": "int32", - "type": "integer" - }, - "endColumnIndex": { - "type": "integer", - "description": "The end column (exclusive) of the range, or not set if unbounded.", - "format": "int32" - }, "startRowIndex": { - "description": "The start row (inclusive) of the range, or not set if unbounded.", "format": "int32", + "description": "The start row (inclusive) of the range, or not set if unbounded.", "type": "integer" }, "startColumnIndex": { - "description": "The start column (inclusive) of the range, or not set if unbounded.", "format": "int32", + "description": "The start column (inclusive) of the range, or not set if unbounded.", "type": "integer" }, "sheetId": { - "description": "The sheet this range is on.", "format": "int32", + "description": "The sheet this range is on.", + "type": "integer" + }, + "endColumnIndex": { + "format": "int32", + "description": "The end column (exclusive) of the range, or not set if unbounded.", + "type": "integer" + }, + "endRowIndex": { + "format": "int32", + "description": "The end row (exclusive) of the range, or not set if unbounded.", "type": "integer" } - } + }, + "id": "GridRange" }, "BasicChartSpec": { "description": "The specification for a basic chart. See BasicChartType for the list\nof charts this supports.", "type": "object", "properties": { + "domains": { + "description": "The domain of data this is charting.\nOnly a single domain is supported.", + "items": { + "$ref": "BasicChartDomain" + }, + "type": "array" + }, + "lineSmoothing": { + "description": "Gets whether all lines should be rendered smooth or straight by default.\nApplies to Line charts.", + "type": "boolean" + }, "headerCount": { - "description": "The number of rows or columns in the data that are \"headers\".\nIf not set, Google Sheets will guess how many rows are headers based\non the data.\n\n(Note that BasicChartAxis.title may override the axis title\n inferred from the header values.)", "format": "int32", + "description": "The number of rows or columns in the data that are \"headers\".\nIf not set, Google Sheets will guess how many rows are headers based\non the data.\n\n(Note that BasicChartAxis.title may override the axis title\n inferred from the header values.)", "type": "integer" }, + "stackedType": { + "enumDescriptions": [ + "Default value, do not use.", + "Series are not stacked.", + "Series values are stacked, each value is rendered vertically beginning\nfrom the top of the value below it.", + "Vertical stacks are stretched to reach the top of the chart, with\nvalues laid out as percentages of each other." + ], + "enum": [ + "BASIC_CHART_STACKED_TYPE_UNSPECIFIED", + "NOT_STACKED", + "STACKED", + "PERCENT_STACKED" + ], + "description": "The stacked type for charts that support vertical stacking.\nApplies to Area, Bar, Column, and Stepped Area charts.", + "type": "string" + }, + "threeDimensional": { + "description": "True to make the chart 3D.\nApplies to Bar and Column charts.", + "type": "boolean" + }, "axis": { "description": "The axis on the chart.", - "type": "array", "items": { "$ref": "BasicChartAxis" - } + }, + "type": "array" + }, + "interpolateNulls": { + "description": "If some values in a series are missing, gaps may appear in the chart (e.g,\nsegments of lines in a line chart will be missing). To eliminate these\ngaps set this to true.\nApplies to Line, Area, and Combo charts.", + "type": "boolean" }, "chartType": { - "enum": [ - "BASIC_CHART_TYPE_UNSPECIFIED", - "BAR", - "LINE", - "AREA", - "COLUMN", - "SCATTER", - "COMBO" - ], - "description": "The type of the chart.", - "type": "string", "enumDescriptions": [ "Default value, do not use.", "A \u003ca href=\"/chart/interactive/docs/gallery/barchart\"\u003ebar chart\u003c/a\u003e.", @@ -3273,25 +2088,30 @@ "An \u003ca href=\"/chart/interactive/docs/gallery/areachart\"\u003earea chart\u003c/a\u003e.", "A \u003ca href=\"/chart/interactive/docs/gallery/columnchart\"\u003ecolumn chart\u003c/a\u003e.", "A \u003ca href=\"/chart/interactive/docs/gallery/scatterchart\"\u003escatter chart\u003c/a\u003e.", - "A \u003ca href=\"/chart/interactive/docs/gallery/combochart\"\u003ecombo chart\u003c/a\u003e." - ] + "A \u003ca href=\"/chart/interactive/docs/gallery/combochart\"\u003ecombo chart\u003c/a\u003e.", + "A \u003ca href=\"/chart/interactive/docs/gallery/steppedareachart\"\u003estepped area chart\u003c/a\u003e." + ], + "enum": [ + "BASIC_CHART_TYPE_UNSPECIFIED", + "BAR", + "LINE", + "AREA", + "COLUMN", + "SCATTER", + "COMBO", + "STEPPED_AREA" + ], + "description": "The type of the chart.", + "type": "string" }, "series": { "description": "The data this chart is visualizing.", - "type": "array", "items": { "$ref": "BasicChartSeries" - } + }, + "type": "array" }, "legendPosition": { - "enum": [ - "BASIC_CHART_LEGEND_POSITION_UNSPECIFIED", - "BOTTOM_LEGEND", - "LEFT_LEGEND", - "RIGHT_LEGEND", - "TOP_LEGEND", - "NO_LEGEND" - ], "description": "The position of the chart legend.", "type": "string", "enumDescriptions": [ @@ -3301,25 +2121,98 @@ "The legend is rendered on the right of the chart.", "The legend is rendered on the top of the chart.", "No legend is rendered." + ], + "enum": [ + "BASIC_CHART_LEGEND_POSITION_UNSPECIFIED", + "BOTTOM_LEGEND", + "LEFT_LEGEND", + "RIGHT_LEGEND", + "TOP_LEGEND", + "NO_LEGEND" ] - }, - "domains": { - "description": "The domain of data this is charting.\nOnly a single domain is supported.", - "type": "array", - "items": { - "$ref": "BasicChartDomain" - } } }, "id": "BasicChartSpec" }, + "BubbleChartSpec": { + "description": "A \u003ca href=\"/chart/interactive/docs/gallery/bubblechart\"\u003ebubble chart\u003c/a\u003e.", + "type": "object", + "properties": { + "bubbleMinRadiusSize": { + "format": "int32", + "description": "The minimum radius size of the bubbles, in pixels.\nIf specific, the field must be a positive value.", + "type": "integer" + }, + "bubbleMaxRadiusSize": { + "format": "int32", + "description": "The max radius size of the bubbles, in pixels.\nIf specified, the field must be a positive value.", + "type": "integer" + }, + "series": { + "$ref": "ChartData", + "description": "The data contianing the bubble y-values. These values locate the bubbles\nin the chart vertically." + }, + "legendPosition": { + "enumDescriptions": [ + "Default value, do not use.", + "The legend is rendered on the bottom of the chart.", + "The legend is rendered on the left of the chart.", + "The legend is rendered on the right of the chart.", + "The legend is rendered on the top of the chart.", + "No legend is rendered.", + "The legend is rendered inside the chart area." + ], + "enum": [ + "BUBBLE_CHART_LEGEND_POSITION_UNSPECIFIED", + "BOTTOM_LEGEND", + "LEFT_LEGEND", + "RIGHT_LEGEND", + "TOP_LEGEND", + "NO_LEGEND", + "INSIDE_LEGEND" + ], + "description": "Where the legend of the chart should be drawn.", + "type": "string" + }, + "domain": { + "$ref": "ChartData", + "description": "The data containing the bubble x-values. These values locate the bubbles\nin the chart horizontally." + }, + "bubbleSizes": { + "description": "The data contianing the bubble sizes. Bubble sizes are used to draw\nthe bubbles at different sizes relative to each other.\nIf specified, group_ids must also be specified. This field is\noptional.", + "$ref": "ChartData" + }, + "bubbleOpacity": { + "format": "float", + "description": "The opacity of the bubbles between 0 and 1.0.\n0 is fully transparent and 1 is fully opaque.", + "type": "number" + }, + "bubbleBorderColor": { + "description": "The bubble border color.", + "$ref": "Color" + }, + "bubbleTextStyle": { + "$ref": "TextFormat", + "description": "The format of the text inside the bubbles.\nUnderline and Strikethrough are not supported." + }, + "groupIds": { + "description": "The data containing the bubble group IDs. All bubbles with the same group\nID will be drawn in the same color. If bubble_sizes is specified then\nthis field must also be specified but may contain blank values.\nThis field is optional.", + "$ref": "ChartData" + }, + "bubbleLabels": { + "$ref": "ChartData", + "description": "The data containing the bubble labels. These do not need to be unique." + } + }, + "id": "BubbleChartSpec" + }, "SetDataValidationRequest": { "description": "Sets a data validation rule to every cell in the range.\nTo clear validation in a range, call this with no rule specified.", "type": "object", "properties": { "rule": { - "description": "The data validation rule to set on each cell in the range,\nor empty to clear the data validation in the range.", - "$ref": "DataValidationRule" + "$ref": "DataValidationRule", + "description": "The data validation rule to set on each cell in the range,\nor empty to clear the data validation in the range." }, "range": { "$ref": "GridRange", @@ -3329,99 +2222,152 @@ "id": "SetDataValidationRequest" }, "CellData": { + "id": "CellData", "description": "Data about a specific cell.", "type": "object", "properties": { + "formattedValue": { + "description": "The formatted value of the cell.\nThis is the value as it's shown to the user.\nThis field is read-only.", + "type": "string" + }, + "textFormatRuns": { + "description": "Runs of rich text applied to subsections of the cell. Runs are only valid\non user entered strings, not formulas, bools, or numbers.\nRuns start at specific indexes in the text and continue until the next\nrun. Properties of a run will continue unless explicitly changed\nin a subsequent run (and properties of the first run will continue\nthe properties of the cell unless explicitly changed).\n\nWhen writing, the new runs will overwrite any prior runs. When writing a\nnew user_entered_value, previous runs will be erased.", + "items": { + "$ref": "TextFormatRun" + }, + "type": "array" + }, + "hyperlink": { + "description": "A hyperlink this cell points to, if any.\nThis field is read-only. (To set it, use a `=HYPERLINK` formula\nin the userEnteredValue.formulaValue\nfield.)", + "type": "string" + }, "pivotTable": { - "$ref": "PivotTable", - "description": "A pivot table anchored at this cell. The size of pivot table itself\nis computed dynamically based on its data, grouping, filters, values,\netc. Only the top-left cell of the pivot table contains the pivot table\ndefinition. The other cells will contain the calculated values of the\nresults of the pivot in their effective_value fields." + "description": "A pivot table anchored at this cell. The size of pivot table itself\nis computed dynamically based on its data, grouping, filters, values,\netc. Only the top-left cell of the pivot table contains the pivot table\ndefinition. The other cells will contain the calculated values of the\nresults of the pivot in their effective_value fields.", + "$ref": "PivotTable" }, "userEnteredFormat": { - "$ref": "CellFormat", - "description": "The format the user entered for the cell.\n\nWhen writing, the new format will be merged with the existing format." + "description": "The format the user entered for the cell.\n\nWhen writing, the new format will be merged with the existing format.", + "$ref": "CellFormat" }, "effectiveFormat": { - "$ref": "CellFormat", - "description": "The effective format being used by the cell.\nThis includes the results of applying any conditional formatting and,\nif the cell contains a formula, the computed number format.\nIf the effective format is the default format, effective format will\nnot be written.\nThis field is read-only." + "description": "The effective format being used by the cell.\nThis includes the results of applying any conditional formatting and,\nif the cell contains a formula, the computed number format.\nIf the effective format is the default format, effective format will\nnot be written.\nThis field is read-only.", + "$ref": "CellFormat" }, "note": { "description": "Any note on the cell.", "type": "string" }, - "userEnteredValue": { - "$ref": "ExtendedValue", - "description": "The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`\nNote: Dates, Times and DateTimes are represented as doubles in\nserial number format." - }, "dataValidation": { - "description": "A data validation rule on the cell, if any.\n\nWhen writing, the new data validation rule will overwrite any prior rule.", - "$ref": "DataValidationRule" + "$ref": "DataValidationRule", + "description": "A data validation rule on the cell, if any.\n\nWhen writing, the new data validation rule will overwrite any prior rule." + }, + "userEnteredValue": { + "description": "The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`\nNote: Dates, Times and DateTimes are represented as doubles in\nserial number format.", + "$ref": "ExtendedValue" }, "effectiveValue": { "description": "The effective value of the cell. For cells with formulas, this will be\nthe calculated value. For cells with literals, this will be\nthe same as the user_entered_value.\nThis field is read-only.", "$ref": "ExtendedValue" + } + } + }, + "BatchUpdateValuesByDataFilterRequest": { + "id": "BatchUpdateValuesByDataFilterRequest", + "description": "The request for updating more than one range of values in a spreadsheet.", + "type": "object", + "properties": { + "responseValueRenderOption": { + "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string", + "enumDescriptions": [ + "Values will be calculated & formatted in the reply according to the\ncell's formatting. Formatting is based on the spreadsheet's locale,\nnot the requesting user's locale.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return `\"$1.23\"`.", + "Values will be calculated, but not formatted in the reply.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return the number `1.23`.", + "Values will not be calculated. The reply will include the formulas.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen A2 would return `\"=A1\"`." + ], + "enum": [ + "FORMATTED_VALUE", + "UNFORMATTED_VALUE", + "FORMULA" + ] }, - "textFormatRuns": { - "description": "Runs of rich text applied to subsections of the cell. Runs are only valid\non user entered strings, not formulas, bools, or numbers.\nRuns start at specific indexes in the text and continue until the next\nrun. Properties of a run will continue unless explicitly changed\nin a subsequent run (and properties of the first run will continue\nthe properties of the cell unless explicitly changed).\n\nWhen writing, the new runs will overwrite any prior runs. When writing a\nnew user_entered_value, previous runs will be erased.", - "type": "array", + "includeValuesInResponse": { + "description": "Determines if the update response should include the values\nof the cells that were updated. By default, responses\ndo not include the updated values. The `updatedData` field within\neach of the BatchUpdateValuesResponse.responses will contain\nthe updated values. If the range to write was larger than than the range\nactually written, the response will include all values in the requested\nrange (excluding trailing empty rows and columns).", + "type": "boolean" + }, + "data": { + "description": "The new values to apply to the spreadsheet. If more than one range is\nmatched by the specified DataFilter the specified values will be\napplied to all of of those ranges.", "items": { - "$ref": "TextFormatRun" - } + "$ref": "DataFilterValueRange" + }, + "type": "array" }, - "formattedValue": { - "description": "The formatted value of the cell.\nThis is the value as it's shown to the user.\nThis field is read-only.", + "valueInputOption": { + "enumDescriptions": [ + "Default input value. This value must not be used.", + "The values the user has entered will not be parsed and will be stored\nas-is.", + "The values will be parsed as if the user typed them into the UI.\nNumbers will stay as numbers, but strings may be converted to numbers,\ndates, etc. following the same rules that are applied when entering\ntext into a cell via the Google Sheets UI." + ], + "enum": [ + "INPUT_VALUE_OPTION_UNSPECIFIED", + "RAW", + "USER_ENTERED" + ], + "description": "How the input data should be interpreted.", "type": "string" }, - "hyperlink": { - "description": "A hyperlink this cell points to, if any.\nThis field is read-only. (To set it, use a `=HYPERLINK` formula\nin the userEnteredValue.formulaValue\nfield.)", + "responseDateTimeRenderOption": { + "enumDescriptions": [ + "Instructs date, time, datetime, and duration fields to be output\nas doubles in \"serial number\" format, as popularized by Lotus 1-2-3.\nThe whole number portion of the value (left of the decimal) counts\nthe days since December 30th 1899. The fractional portion (right of\nthe decimal) counts the time as a fraction of the day. For example,\nJanuary 1st 1900 at noon would be 2.5, 2 because it's 2 days after\nDecember 30st 1899, and .5 because noon is half a day. February 1st\n1900 at 3pm would be 33.625. This correctly treats the year 1900 as\nnot a leap year.", + "Instructs date, time, datetime, and duration fields to be output\nas strings in their given number format (which is dependent\non the spreadsheet locale)." + ], + "enum": [ + "SERIAL_NUMBER", + "FORMATTED_STRING" + ], + "description": "Determines how dates, times, and durations in the response should be\nrendered. This is ignored if response_value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is\nDateTimeRenderOption.SERIAL_NUMBER.", "type": "string" } - }, - "id": "CellData" + } }, "BatchUpdateSpreadsheetRequest": { "description": "The request for updating any aspect of a spreadsheet.", "type": "object", "properties": { - "requests": { - "description": "A list of updates to apply to the spreadsheet.\nRequests will be applied in the order they are specified.\nIf any request is not valid, no requests will be applied.", - "type": "array", + "responseIncludeGridData": { + "description": "True if grid data should be returned. Meaningful only if\nif include_spreadsheet_response is 'true'.\nThis parameter is ignored if a field mask was set in the request.", + "type": "boolean" + }, + "responseRanges": { + "description": "Limits the ranges included in the response spreadsheet.\nMeaningful only if include_spreadsheet_response is 'true'.", "items": { - "$ref": "Request" - } + "type": "string" + }, + "type": "array" }, "includeSpreadsheetInResponse": { "description": "Determines if the update response should include the spreadsheet\nresource.", "type": "boolean" }, - "responseRanges": { - "description": "Limits the ranges included in the response spreadsheet.\nMeaningful only if include_spreadsheet_response is 'true'.", - "type": "array", + "requests": { + "description": "A list of updates to apply to the spreadsheet.\nRequests will be applied in the order they are specified.\nIf any request is not valid, no requests will be applied.", "items": { - "type": "string" - } - }, - "responseIncludeGridData": { - "description": "True if grid data should be returned. Meaningful only if\nif include_spreadsheet_response is 'true'.\nThis parameter is ignored if a field mask was set in the request.", - "type": "boolean" + "$ref": "Request" + }, + "type": "array" } }, "id": "BatchUpdateSpreadsheetRequest" }, "BasicChartAxis": { + "id": "BasicChartAxis", "description": "An axis of the chart.\nA chart may not have more than one axis per\naxis position.", "type": "object", "properties": { - "format": { - "$ref": "TextFormat", - "description": "The format of the title.\nOnly valid if the axis is not associated with the domain." + "title": { + "description": "The title of this axis. If set, this overrides any title inferred\nfrom headers of the data.", + "type": "string" }, "position": { - "enum": [ - "BASIC_CHART_AXIS_POSITION_UNSPECIFIED", - "BOTTOM_AXIS", - "LEFT_AXIS", - "RIGHT_AXIS" - ], "description": "The position of this axis.", "type": "string", "enumDescriptions": [ @@ -3429,142 +2375,236 @@ "The axis rendered at the bottom of a chart.\nFor most charts, this is the standard major axis.\nFor bar charts, this is a minor axis.", "The axis rendered at the left of a chart.\nFor most charts, this is a minor axis.\nFor bar charts, this is the standard major axis.", "The axis rendered at the right of a chart.\nFor most charts, this is a minor axis.\nFor bar charts, this is an unusual major axis." + ], + "enum": [ + "BASIC_CHART_AXIS_POSITION_UNSPECIFIED", + "BOTTOM_AXIS", + "LEFT_AXIS", + "RIGHT_AXIS" ] }, - "title": { - "description": "The title of this axis. If set, this overrides any title inferred\nfrom headers of the data.", - "type": "string" + "format": { + "description": "The format of the title.\nOnly valid if the axis is not associated with the domain.", + "$ref": "TextFormat" } - }, - "id": "BasicChartAxis" + } }, "Padding": { "description": "The amount of padding around the cell, in pixels.\nWhen updating padding, every field must be specified.", "type": "object", "properties": { "top": { - "description": "The top padding of the cell.", "format": "int32", + "description": "The top padding of the cell.", "type": "integer" }, "left": { - "description": "The left padding of the cell.", "format": "int32", + "description": "The left padding of the cell.", "type": "integer" }, "right": { - "description": "The right padding of the cell.", "format": "int32", + "description": "The right padding of the cell.", "type": "integer" }, "bottom": { - "description": "The bottom padding of the cell.", "format": "int32", + "description": "The bottom padding of the cell.", "type": "integer" } }, "id": "Padding" }, "DeleteDimensionRequest": { - "id": "DeleteDimensionRequest", "description": "Deletes the dimensions from the sheet.", "type": "object", "properties": { "range": { - "$ref": "DimensionRange", - "description": "The dimensions to delete from the sheet." + "description": "The dimensions to delete from the sheet.", + "$ref": "DimensionRange" } - } + }, + "id": "DeleteDimensionRequest" }, "UpdateChartSpecRequest": { + "id": "UpdateChartSpecRequest", "description": "Updates a chart's specifications.\n(This does not move or resize a chart. To move or resize a chart, use\n UpdateEmbeddedObjectPositionRequest.)", "type": "object", "properties": { "chartId": { - "description": "The ID of the chart to update.", "format": "int32", + "description": "The ID of the chart to update.", "type": "integer" }, "spec": { - "$ref": "ChartSpec", - "description": "The specification to apply to the chart." + "description": "The specification to apply to the chart.", + "$ref": "ChartSpec" } - }, - "id": "UpdateChartSpecRequest" + } }, "DeleteFilterViewRequest": { "description": "Deletes a particular filter view.", "type": "object", "properties": { "filterId": { - "description": "The ID of the filter to delete.", "format": "int32", + "description": "The ID of the filter to delete.", "type": "integer" } }, "id": "DeleteFilterViewRequest" }, + "BatchGetValuesByDataFilterRequest": { + "description": "The request for retrieving a range of values in a spreadsheet selected by a\nset of DataFilters.", + "type": "object", + "properties": { + "majorDimension": { + "description": "The major dimension that results should use.\n\nFor example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,\nthen a request that selects that range and sets `majorDimension=ROWS` will\nreturn `[[1,2],[3,4]]`,\nwhereas a request that sets `majorDimension=COLUMNS` will return\n`[[1,3],[2,4]]`.", + "type": "string", + "enumDescriptions": [ + "The default value, do not use.", + "Operates on the rows of a sheet.", + "Operates on the columns of a sheet." + ], + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ] + }, + "dataFilters": { + "description": "The data filters used to match the ranges of values to retrieve. Ranges\nthat match any of the specified data filters will be included in the\nresponse.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + }, + "dateTimeRenderOption": { + "enumDescriptions": [ + "Instructs date, time, datetime, and duration fields to be output\nas doubles in \"serial number\" format, as popularized by Lotus 1-2-3.\nThe whole number portion of the value (left of the decimal) counts\nthe days since December 30th 1899. The fractional portion (right of\nthe decimal) counts the time as a fraction of the day. For example,\nJanuary 1st 1900 at noon would be 2.5, 2 because it's 2 days after\nDecember 30st 1899, and .5 because noon is half a day. February 1st\n1900 at 3pm would be 33.625. This correctly treats the year 1900 as\nnot a leap year.", + "Instructs date, time, datetime, and duration fields to be output\nas strings in their given number format (which is dependent\non the spreadsheet locale)." + ], + "enum": [ + "SERIAL_NUMBER", + "FORMATTED_STRING" + ], + "description": "How dates, times, and durations should be represented in the output.\nThis is ignored if value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].", + "type": "string" + }, + "valueRenderOption": { + "description": "How values should be represented in the output.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string", + "enumDescriptions": [ + "Values will be calculated & formatted in the reply according to the\ncell's formatting. Formatting is based on the spreadsheet's locale,\nnot the requesting user's locale.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return `\"$1.23\"`.", + "Values will be calculated, but not formatted in the reply.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return the number `1.23`.", + "Values will not be calculated. The reply will include the formulas.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen A2 would return `\"=A1\"`." + ], + "enum": [ + "FORMATTED_VALUE", + "UNFORMATTED_VALUE", + "FORMULA" + ] + } + }, + "id": "BatchGetValuesByDataFilterRequest" + }, + "DeleteDeveloperMetadataResponse": { + "description": "The response from deleting developer metadata.", + "type": "object", + "properties": { + "deletedDeveloperMetadata": { + "description": "The metadata that was deleted.", + "items": { + "$ref": "DeveloperMetadata" + }, + "type": "array" + } + }, + "id": "DeleteDeveloperMetadataResponse" + }, "BatchUpdateValuesResponse": { + "id": "BatchUpdateValuesResponse", "description": "The response when updating a range of values in a spreadsheet.", "type": "object", "properties": { + "spreadsheetId": { + "description": "The spreadsheet the updates were applied to.", + "type": "string" + }, "totalUpdatedRows": { - "description": "The total number of rows where at least one cell in the row was updated.", "format": "int32", + "description": "The total number of rows where at least one cell in the row was updated.", "type": "integer" }, "responses": { "description": "One UpdateValuesResponse per requested range, in the same order as\nthe requests appeared.", - "type": "array", "items": { "$ref": "UpdateValuesResponse" - } + }, + "type": "array" }, "totalUpdatedSheets": { - "description": "The total number of sheets where at least one cell in the sheet was\nupdated.", "format": "int32", + "description": "The total number of sheets where at least one cell in the sheet was\nupdated.", "type": "integer" }, "totalUpdatedCells": { - "description": "The total number of cells updated.", "format": "int32", + "description": "The total number of cells updated.", "type": "integer" }, "totalUpdatedColumns": { - "type": "integer", + "format": "int32", "description": "The total number of columns where at least one cell in the column was\nupdated.", - "format": "int32" - }, - "spreadsheetId": { - "description": "The spreadsheet the updates were applied to.", - "type": "string" + "type": "integer" } - }, - "id": "BatchUpdateValuesResponse" + } }, "SortRangeRequest": { "description": "Sorts data in rows based on a sort order per column.", "type": "object", "properties": { "range": { - "$ref": "GridRange", - "description": "The range to sort." + "description": "The range to sort.", + "$ref": "GridRange" }, "sortSpecs": { "description": "The sort order per column. Later specifications are used when values\nare equal in the earlier specifications.", - "type": "array", "items": { "$ref": "SortSpec" - } + }, + "type": "array" } }, "id": "SortRangeRequest" }, + "MatchedDeveloperMetadata": { + "id": "MatchedDeveloperMetadata", + "description": "A developer metadata entry and the data filters specified in the original\nrequest that matched it.", + "type": "object", + "properties": { + "developerMetadata": { + "description": "The developer metadata matching the specified filters.", + "$ref": "DeveloperMetadata" + }, + "dataFilters": { + "description": "All filters matching the returned developer metadata.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + } + } + }, "MergeCellsRequest": { + "id": "MergeCellsRequest", + "description": "Merges all cells in the range.", + "type": "object", "properties": { "range": { - "$ref": "GridRange", - "description": "The range of cells to merge." + "description": "The range of cells to merge.", + "$ref": "GridRange" }, "mergeType": { "enumDescriptions": [ @@ -3580,35 +2620,70 @@ "description": "How the cells should be merged.", "type": "string" } - }, - "id": "MergeCellsRequest", - "description": "Merges all cells in the range.", - "type": "object" + } }, "AddProtectedRangeRequest": { - "properties": { - "protectedRange": { - "$ref": "ProtectedRange", - "description": "The protected range to be added. The\nprotectedRangeId field is optional; if\none is not set, an id will be randomly generated. (It is an error to\nspecify the ID of a range that already exists.)" - } - }, "id": "AddProtectedRangeRequest", "description": "Adds a new protected range.", - "type": "object" + "type": "object", + "properties": { + "protectedRange": { + "description": "The protected range to be added. The\nprotectedRangeId field is optional; if\none is not set, an id will be randomly generated. (It is an error to\nspecify the ID of a range that already exists.)", + "$ref": "ProtectedRange" + } + } }, "BatchClearValuesRequest": { + "id": "BatchClearValuesRequest", "description": "The request for clearing more than one range of values in a spreadsheet.", "type": "object", "properties": { "ranges": { "description": "The ranges to clear, in A1 notation.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" } - }, - "id": "BatchClearValuesRequest" + } + }, + "DeveloperMetadata": { + "id": "DeveloperMetadata", + "description": "Developer metadata associated with a location or object in a spreadsheet.\nDeveloper metadata may be used to associate arbitrary data with various\nparts of a spreadsheet and will remain associated at those locations as they\nmove around and the spreadsheet is edited. For example, if developer\nmetadata is associated with row 5 and another row is then subsequently\ninserted above row 5, that original metadata will still be associated with\nthe row it was first associated with (what is now row 6). If the associated\nobject is deleted its metadata will be deleted too.", + "type": "object", + "properties": { + "metadataKey": { + "description": "The metadata key. There may be multiple metadata in a spreadsheet with the\nsame key. Developer metadata must always have a key specified.", + "type": "string" + }, + "visibility": { + "description": "The metadata visibility. Developer metadata must always have a visibility\nspecified.", + "type": "string", + "enumDescriptions": [ + "Default value.", + "Document-visible metadata is accessible from any developer project with\naccess to the document.", + "Project-visible metadata is only visible to and accessible by the developer\nproject that created the metadata." + ], + "enum": [ + "DEVELOPER_METADATA_VISIBILITY_UNSPECIFIED", + "DOCUMENT", + "PROJECT" + ] + }, + "location": { + "description": "The location where the metadata is associated.", + "$ref": "DeveloperMetadataLocation" + }, + "metadataId": { + "format": "int32", + "description": "The spreadsheet-scoped unique ID that identifies the metadata. IDs may be\nspecified when metadata is created, otherwise one will be randomly\ngenerated and assigned. Must be positive.", + "type": "integer" + }, + "metadataValue": { + "description": "Data associated with the metadata's key.", + "type": "string" + } + } }, "DuplicateFilterViewResponse": { "description": "The result of a filter view being duplicated.", @@ -3622,43 +2697,33 @@ "id": "DuplicateFilterViewResponse" }, "DuplicateSheetResponse": { - "id": "DuplicateSheetResponse", "description": "The result of duplicating a sheet.", "type": "object", "properties": { "properties": { - "description": "The properties of the duplicate sheet.", - "$ref": "SheetProperties" + "$ref": "SheetProperties", + "description": "The properties of the duplicate sheet." } - } + }, + "id": "DuplicateSheetResponse" }, "ClearBasicFilterRequest": { + "id": "ClearBasicFilterRequest", "description": "Clears the basic filter, if any exists on the sheet.", "type": "object", "properties": { "sheetId": { - "description": "The sheet ID on which the basic filter should be cleared.", "format": "int32", + "description": "The sheet ID on which the basic filter should be cleared.", "type": "integer" } - }, - "id": "ClearBasicFilterRequest" + } }, "TextToColumnsRequest": { "description": "Splits a column of text into multiple columns,\nbased on a delimiter in each cell.", "type": "object", "properties": { - "delimiter": { - "description": "The delimiter to use. Used only if delimiterType is\nCUSTOM.", - "type": "string" - }, - "source": { - "description": "The source data range. This must span exactly one column.", - "$ref": "GridRange" - }, "delimiterType": { - "description": "The delimiter type to use.", - "type": "string", "enumDescriptions": [ "Default value. This value must not be used.", "\",\"", @@ -3674,49 +2739,63 @@ "PERIOD", "SPACE", "CUSTOM" - ] + ], + "description": "The delimiter type to use.", + "type": "string" + }, + "source": { + "description": "The source data range. This must span exactly one column.", + "$ref": "GridRange" + }, + "delimiter": { + "description": "The delimiter to use. Used only if delimiterType is\nCUSTOM.", + "type": "string" } }, "id": "TextToColumnsRequest" }, "DeleteBandingRequest": { + "id": "DeleteBandingRequest", "description": "Removes the banded range with the given ID from the spreadsheet.", "type": "object", "properties": { "bandedRangeId": { - "description": "The ID of the banded range to delete.", "format": "int32", + "description": "The ID of the banded range to delete.", "type": "integer" } - }, - "id": "DeleteBandingRequest" + } }, "BatchUpdateSpreadsheetResponse": { + "id": "BatchUpdateSpreadsheetResponse", "description": "The reply for batch updating a spreadsheet.", "type": "object", "properties": { - "replies": { - "description": "The reply of the updates. This maps 1:1 with the updates, although\nreplies to some requests may be empty.", - "type": "array", - "items": { - "$ref": "Response" - } - }, - "updatedSpreadsheet": { - "$ref": "Spreadsheet", - "description": "The spreadsheet after updates were applied. This is only set if\n[BatchUpdateSpreadsheetRequest.include_spreadsheet_in_response] is `true`." - }, "spreadsheetId": { "description": "The spreadsheet the updates were applied to.", "type": "string" + }, + "updatedSpreadsheet": { + "description": "The spreadsheet after updates were applied. This is only set if\n[BatchUpdateSpreadsheetRequest.include_spreadsheet_in_response] is `true`.", + "$ref": "Spreadsheet" + }, + "replies": { + "description": "The reply of the updates. This maps 1:1 with the updates, although\nreplies to some requests may be empty.", + "items": { + "$ref": "Response" + }, + "type": "array" } - }, - "id": "BatchUpdateSpreadsheetResponse" + } }, "AppendValuesResponse": { "description": "The response when updating a range of values in a spreadsheet.", "type": "object", "properties": { + "spreadsheetId": { + "description": "The spreadsheet the updates were applied to.", + "type": "string" + }, "updates": { "$ref": "UpdateValuesResponse", "description": "Information about the updates that were applied." @@ -3724,14 +2803,40 @@ "tableRange": { "description": "The range (in A1 notation) of the table that values are being appended to\n(before the values were appended).\nEmpty if no table was found.", "type": "string" - }, - "spreadsheetId": { - "description": "The spreadsheet the updates were applied to.", - "type": "string" } }, "id": "AppendValuesResponse" }, + "MoveDimensionRequest": { + "description": "Moves one or more rows or columns.", + "type": "object", + "properties": { + "destinationIndex": { + "format": "int32", + "description": "The zero-based start index of where to move the source data to,\nbased on the coordinates *before* the source data is removed\nfrom the grid. Existing data will be shifted down or right\n(depending on the dimension) to make room for the moved dimensions.\nThe source dimensions are removed from the grid, so the\nthe data may end up in a different index than specified.\n\nFor example, given `A1..A5` of `0, 1, 2, 3, 4` and wanting to move\n`\"1\"` and `\"2\"` to between `\"3\"` and `\"4\"`, the source would be\n`ROWS [1..3)`,and the destination index would be `\"4\"`\n(the zero-based index of row 5).\nThe end result would be `A1..A5` of `0, 3, 1, 2, 4`.", + "type": "integer" + }, + "source": { + "$ref": "DimensionRange", + "description": "The source dimensions to move." + } + }, + "id": "MoveDimensionRequest" + }, + "PivotFilterCriteria": { + "description": "Criteria for showing/hiding rows in a pivot table.", + "type": "object", + "properties": { + "visibleValues": { + "description": "Values that should be included. Values not listed here are excluded.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "PivotFilterCriteria" + }, "AddFilterViewRequest": { "description": "Adds a filter view.", "type": "object", @@ -3743,60 +2848,71 @@ }, "id": "AddFilterViewRequest" }, - "PivotFilterCriteria": { - "description": "Criteria for showing/hiding rows in a pivot table.", - "type": "object", - "properties": { - "visibleValues": { - "description": "Values that should be included. Values not listed here are excluded.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "PivotFilterCriteria" - }, - "MoveDimensionRequest": { - "description": "Moves one or more rows or columns.", - "type": "object", - "properties": { - "destinationIndex": { - "type": "integer", - "description": "The zero-based start index of where to move the source data to,\nbased on the coordinates *before* the source data is removed\nfrom the grid. Existing data will be shifted down or right\n(depending on the dimension) to make room for the moved dimensions.\nThe source dimensions are removed from the grid, so the\nthe data may end up in a different index than specified.\n\nFor example, given `A1..A5` of `0, 1, 2, 3, 4` and wanting to move\n`\"1\"` and `\"2\"` to between `\"3\"` and `\"4\"`, the source would be\n`ROWS [1..3)`,and the destination index would be `\"4\"`\n(the zero-based index of row 5).\nThe end result would be `A1..A5` of `0, 3, 1, 2, 4`.", - "format": "int32" - }, - "source": { - "$ref": "DimensionRange", - "description": "The source dimensions to move." - } - }, - "id": "MoveDimensionRequest" - }, "AddConditionalFormatRuleRequest": { "id": "AddConditionalFormatRuleRequest", "description": "Adds a new conditional format rule at the given index.\nAll subsequent rules' indexes are incremented.", "type": "object", "properties": { "rule": { - "description": "The rule to add.", - "$ref": "ConditionalFormatRule" + "$ref": "ConditionalFormatRule", + "description": "The rule to add." }, "index": { - "description": "The zero-based index where the rule should be inserted.", "format": "int32", + "description": "The zero-based index where the rule should be inserted.", "type": "integer" } } }, - "ChartSpec": { + "CreateDeveloperMetadataRequest": { + "id": "CreateDeveloperMetadataRequest", + "description": "A request to create developer metadata.", "type": "object", "properties": { - "basicChart": { - "$ref": "BasicChartSpec", - "description": "A basic chart specification, can be one of many kinds of charts.\nSee BasicChartType for the list of all\ncharts this supports." + "developerMetadata": { + "description": "The developer metadata to create.", + "$ref": "DeveloperMetadata" + } + } + }, + "ChartSpec": { + "description": "The specifications of a chart.", + "type": "object", + "properties": { + "titleTextFormat": { + "description": "The title text format.\nStrikethrough and underline are not supported.", + "$ref": "TextFormat" + }, + "title": { + "description": "The title of the chart.", + "type": "string" + }, + "altText": { + "description": "The alternative text that describes the chart. This is often used\nfor accessibility.", + "type": "string" + }, + "histogramChart": { + "$ref": "HistogramChartSpec", + "description": "A histogram chart specification." + }, + "candlestickChart": { + "$ref": "CandlestickChartSpec", + "description": "A candlestick chart specification." + }, + "bubbleChart": { + "$ref": "BubbleChartSpec", + "description": "A bubble chart specification." + }, + "fontName": { + "description": "The name of the font to use by default for all chart text (e.g. title,\naxis labels, legend). If a font is specified for a specific part of the\nchart it will override this font name.", + "type": "string" + }, + "maximized": { + "description": "True to make a chart fill the entire space in which it's rendered with\nminimum padding. False to use the default padding.\n(Not applicable to Geo and Org charts.)", + "type": "boolean" }, "hiddenDimensionStrategy": { + "description": "Determines how the charts will use hidden rows or columns.", "type": "string", "enumDescriptions": [ "Default value, do not use.", @@ -3811,27 +2927,50 @@ "SKIP_HIDDEN_ROWS", "SKIP_HIDDEN_COLUMNS", "SHOW_ALL" - ], - "description": "Determines how the charts will use hidden rows or columns." + ] }, - "title": { - "description": "The title of the chart.", - "type": "string" + "backgroundColor": { + "description": "The background color of the entire chart.\nNot applicable to Org charts.", + "$ref": "Color" + }, + "basicChart": { + "$ref": "BasicChartSpec", + "description": "A basic chart specification, can be one of many kinds of charts.\nSee BasicChartType for the list of all\ncharts this supports." + }, + "orgChart": { + "$ref": "OrgChartSpec", + "description": "An org chart specification." }, "pieChart": { "$ref": "PieChartSpec", "description": "A pie chart specification." } }, - "id": "ChartSpec", - "description": "The specifications of a chart." + "id": "ChartSpec" + }, + "BatchGetValuesByDataFilterResponse": { + "id": "BatchGetValuesByDataFilterResponse", + "description": "The response when retrieving more than one range of values in a spreadsheet\nselected by DataFilters.", + "type": "object", + "properties": { + "spreadsheetId": { + "description": "The ID of the spreadsheet the data was retrieved from.", + "type": "string" + }, + "valueRanges": { + "description": "The requested values with the list of data filters that matched them.", + "items": { + "$ref": "MatchedValueRange" + }, + "type": "array" + } + } }, "NumberFormat": { + "description": "The number format of a cell.", "type": "object", "properties": { "type": { - "description": "The type of the number format.\nWhen writing, this field must be set.", - "type": "string", "enumDescriptions": [ "The number format is not specified\nand is based on the contents of the cell.\nDo not explicitly use this.", "Text formatting, e.g `1000.12`", @@ -3853,97 +2992,37 @@ "TIME", "DATE_TIME", "SCIENTIFIC" - ] + ], + "description": "The type of the number format.\nWhen writing, this field must be set.", + "type": "string" }, "pattern": { "description": "Pattern string used for formatting. If not set, a default pattern based on\nthe user's locale will be used if necessary for the given type.\nSee the [Date and Number Formats guide](/sheets/api/guides/formats) for more\ninformation about the supported patterns.", "type": "string" } }, - "id": "NumberFormat", - "description": "The number format of a cell." + "id": "NumberFormat" }, - "SheetProperties": { - "description": "Properties of a sheet.", + "DataFilterValueRange": { + "description": "A range of values whose location is specified by a DataFilter.", "type": "object", "properties": { - "title": { - "description": "The name of the sheet.", - "type": "string" + "dataFilter": { + "description": "The data filter describing the location of the values in the spreadsheet.", + "$ref": "DataFilter" }, - "tabColor": { - "$ref": "Color", - "description": "The color of the tab in the UI." + "values": { + "description": "The data to be written. If the provided values exceed any of the ranges\nmatched by the data filter then the request will fail. If the provided\nvalues are less than the matched ranges only the specified values will be\nwritten, existing values in the matched ranges will remain unaffected.", + "items": { + "items": { + "type": "any" + }, + "type": "array" + }, + "type": "array" }, - "index": { - "description": "The index of the sheet within the spreadsheet.\nWhen adding or updating sheet properties, if this field\nis excluded then the sheet will be added or moved to the end\nof the sheet list. When updating sheet indices or inserting\nsheets, movement is considered in \"before the move\" indexes.\nFor example, if there were 3 sheets (S1, S2, S3) in order to\nmove S1 ahead of S2 the index would have to be set to 2. A sheet\nindex update request will be ignored if the requested index is\nidentical to the sheets current index or if the requested new\nindex is equal to the current sheet index + 1.", - "format": "int32", - "type": "integer" - }, - "sheetId": { - "description": "The ID of the sheet. Must be non-negative.\nThis field cannot be changed once set.", - "format": "int32", - "type": "integer" - }, - "rightToLeft": { - "description": "True if the sheet is an RTL sheet instead of an LTR sheet.", - "type": "boolean" - }, - "hidden": { - "description": "True if the sheet is hidden in the UI, false if it's visible.", - "type": "boolean" - }, - "sheetType": { - "enum": [ - "SHEET_TYPE_UNSPECIFIED", - "GRID", - "OBJECT" - ], - "description": "The type of sheet. Defaults to GRID.\nThis field cannot be changed once set.", - "type": "string", - "enumDescriptions": [ - "Default value, do not use.", - "The sheet is a grid.", - "The sheet has no grid and instead has an object like a chart or image." - ] - }, - "gridProperties": { - "$ref": "GridProperties", - "description": "Additional properties of the sheet if this sheet is a grid.\n(If the sheet is an object sheet, containing a chart or image, then\nthis field will be absent.)\nWhen writing it is an error to set any grid properties on non-grid sheets." - } - }, - "id": "SheetProperties" - }, - "UpdateDimensionPropertiesRequest": { - "description": "Updates properties of dimensions within the specified range.", - "type": "object", - "properties": { - "range": { - "$ref": "DimensionRange", - "description": "The rows or columns to update." - }, - "fields": { - "description": "The fields that should be updated. At least one field must be specified.\nThe root `properties` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", - "format": "google-fieldmask", - "type": "string" - }, - "properties": { - "$ref": "DimensionProperties", - "description": "Properties to update." - } - }, - "id": "UpdateDimensionPropertiesRequest" - }, - "SourceAndDestination": { - "description": "A combination of a source range and how to extend that source.", - "type": "object", - "properties": { - "source": { - "description": "The location of the data to use as the source of the autofill.", - "$ref": "GridRange" - }, - "dimension": { - "description": "The dimension that data should be filled into.", + "majorDimension": { + "description": "The major dimension of the values.", "type": "string", "enumDescriptions": [ "The default value, do not use.", @@ -3955,11 +3034,122 @@ "ROWS", "COLUMNS" ] + } + }, + "id": "DataFilterValueRange" + }, + "CandlestickDomain": { + "description": "The domain of a CandlestickChart.", + "type": "object", + "properties": { + "reversed": { + "description": "True to reverse the order of the domain values (horizontal axis).", + "type": "boolean" + }, + "data": { + "description": "The data of the CandlestickDomain.", + "$ref": "ChartData" + } + }, + "id": "CandlestickDomain" + }, + "SheetProperties": { + "description": "Properties of a sheet.", + "type": "object", + "properties": { + "title": { + "description": "The name of the sheet.", + "type": "string" + }, + "index": { + "format": "int32", + "description": "The index of the sheet within the spreadsheet.\nWhen adding or updating sheet properties, if this field\nis excluded then the sheet will be added or moved to the end\nof the sheet list. When updating sheet indices or inserting\nsheets, movement is considered in \"before the move\" indexes.\nFor example, if there were 3 sheets (S1, S2, S3) in order to\nmove S1 ahead of S2 the index would have to be set to 2. A sheet\nindex update request will be ignored if the requested index is\nidentical to the sheets current index or if the requested new\nindex is equal to the current sheet index + 1.", + "type": "integer" + }, + "tabColor": { + "description": "The color of the tab in the UI.", + "$ref": "Color" + }, + "sheetId": { + "format": "int32", + "description": "The ID of the sheet. Must be non-negative.\nThis field cannot be changed once set.", + "type": "integer" + }, + "rightToLeft": { + "description": "True if the sheet is an RTL sheet instead of an LTR sheet.", + "type": "boolean" + }, + "hidden": { + "description": "True if the sheet is hidden in the UI, false if it's visible.", + "type": "boolean" + }, + "gridProperties": { + "description": "Additional properties of the sheet if this sheet is a grid.\n(If the sheet is an object sheet, containing a chart or image, then\nthis field will be absent.)\nWhen writing it is an error to set any grid properties on non-grid sheets.", + "$ref": "GridProperties" + }, + "sheetType": { + "enumDescriptions": [ + "Default value, do not use.", + "The sheet is a grid.", + "The sheet has no grid and instead has an object like a chart or image." + ], + "enum": [ + "SHEET_TYPE_UNSPECIFIED", + "GRID", + "OBJECT" + ], + "description": "The type of sheet. Defaults to GRID.\nThis field cannot be changed once set.", + "type": "string" + } + }, + "id": "SheetProperties" + }, + "UpdateDimensionPropertiesRequest": { + "description": "Updates properties of dimensions within the specified range.", + "type": "object", + "properties": { + "properties": { + "$ref": "DimensionProperties", + "description": "Properties to update." + }, + "range": { + "description": "The rows or columns to update.", + "$ref": "DimensionRange" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `properties` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + } + }, + "id": "UpdateDimensionPropertiesRequest" + }, + "SourceAndDestination": { + "description": "A combination of a source range and how to extend that source.", + "type": "object", + "properties": { + "dimension": { + "enumDescriptions": [ + "The default value, do not use.", + "Operates on the rows of a sheet.", + "Operates on the columns of a sheet." + ], + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ], + "description": "The dimension that data should be filled into.", + "type": "string" }, "fillLength": { - "description": "The number of rows or columns that data should be filled into.\nPositive numbers expand beyond the last row or last column\nof the source. Negative numbers expand before the first row\nor first column of the source.", "format": "int32", + "description": "The number of rows or columns that data should be filled into.\nPositive numbers expand beyond the last row or last column\nof the source. Negative numbers expand before the first row\nor first column of the source.", "type": "integer" + }, + "source": { + "$ref": "GridRange", + "description": "The location of the data to use as the source of the autofill." } }, "id": "SourceAndDestination" @@ -3968,9 +3158,14 @@ "description": "A filter view.", "type": "object", "properties": { - "range": { - "$ref": "GridRange", - "description": "The range this filter view covers.\n\nWhen writing, only one of range or named_range_id\nmay be set." + "namedRangeId": { + "description": "The named range this filter view is backed by, if any.\n\nWhen writing, only one of range or named_range_id\nmay be set.", + "type": "string" + }, + "filterViewId": { + "format": "int32", + "description": "The ID of the filter view.", + "type": "integer" }, "criteria": { "additionalProperties": { @@ -3983,30 +3178,86 @@ "description": "The name of the filter view.", "type": "string" }, + "range": { + "description": "The range this filter view covers.\n\nWhen writing, only one of range or named_range_id\nmay be set.", + "$ref": "GridRange" + }, "sortSpecs": { - "type": "array", + "description": "The sort order per column. Later specifications are used when values\nare equal in the earlier specifications.", "items": { "$ref": "SortSpec" }, - "description": "The sort order per column. Later specifications are used when values\nare equal in the earlier specifications." - }, - "namedRangeId": { - "description": "The named range this filter view is backed by, if any.\n\nWhen writing, only one of range or named_range_id\nmay be set.", - "type": "string" - }, - "filterViewId": { - "description": "The ID of the filter view.", - "format": "int32", - "type": "integer" + "type": "array" } }, "id": "FilterView" }, + "OrgChartSpec": { + "id": "OrgChartSpec", + "description": "An \u003ca href=\"/chart/interactive/docs/gallery/orgchart\"\u003eorg chart\u003c/a\u003e.\nOrg charts require a unique set of labels in labels and may\noptionally include parent_labels and tooltips.\nparent_labels contain, for each node, the label identifying the parent\nnode. tooltips contain, for each node, an optional tooltip.\n\nFor example, to describe an OrgChart with Alice as the CEO, Bob as the\nPresident (reporting to Alice) and Cathy as VP of Sales (also reporting to\nAlice), have labels contain \"Alice\", \"Bob\", \"Cathy\",\nparent_labels contain \"\", \"Alice\", \"Alice\" and tooltips contain\n\"CEO\", \"President\", \"VP Sales\".", + "type": "object", + "properties": { + "selectedNodeColor": { + "$ref": "Color", + "description": "The color of the selected org chart nodes." + }, + "parentLabels": { + "$ref": "ChartData", + "description": "The data containing the label of the parent for the corresponding node.\nA blank value indicates that the node has no parent and is a top-level\nnode.\nThis field is optional." + }, + "nodeSize": { + "description": "The size of the org chart nodes.", + "type": "string", + "enumDescriptions": [ + "Default value, do not use.", + "The small org chart node size.", + "The medium org chart node size.", + "The large org chart node size." + ], + "enum": [ + "ORG_CHART_LABEL_SIZE_UNSPECIFIED", + "SMALL", + "MEDIUM", + "LARGE" + ] + }, + "labels": { + "$ref": "ChartData", + "description": "The data containing the labels for all the nodes in the chart. Labels\nmust be unique." + }, + "nodeColor": { + "description": "The color of the org chart nodes.", + "$ref": "Color" + }, + "tooltips": { + "$ref": "ChartData", + "description": "The data containing the tooltip for the corresponding node. A blank value\nresults in no tooltip being displayed for the node.\nThis field is optional." + } + } + }, + "SearchDeveloperMetadataRequest": { + "id": "SearchDeveloperMetadataRequest", + "description": "A request to retrieve all developer metadata matching the set of specified\ncriteria.", + "type": "object", + "properties": { + "dataFilters": { + "description": "The data filters describing the criteria used to determine which\nDeveloperMetadata entries to return. DeveloperMetadata matching any of the\nspecified filters will be included in the response.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + } + } + }, "BandingProperties": { "id": "BandingProperties", "description": "Properties referring a single dimension (either row or column). If both\nBandedRange.row_properties and BandedRange.column_properties are\nset, the fill colors are applied to cells according to the following rules:\n\n* header_color and footer_color take priority over band colors.\n* first_band_color takes priority over second_band_color.\n* row_properties takes priority over column_properties.\n\nFor example, the first row color takes priority over the first column\ncolor, but the first column color takes priority over the second row color.\nSimilarly, the row header takes priority over the column header in the\ntop left cell, but the column header takes priority over the first row\ncolor if the row header is not set.", "type": "object", "properties": { + "headerColor": { + "description": "The color of the first row or column. If this field is set, the first\nrow or column will be filled with this color and the colors will\nalternate between first_band_color and second_band_color starting\nfrom the second row or column. Otherwise, the first row or column will be\nfilled with first_band_color and the colors will proceed to alternate\nas they normally would.", + "$ref": "Color" + }, "firstBandColor": { "$ref": "Color", "description": "The first color that is alternating. (Required)" @@ -4016,12 +3267,8 @@ "$ref": "Color" }, "footerColor": { - "$ref": "Color", - "description": "The color of the last row or column. If this field is not set, the last\nrow or column will be filled with either first_band_color or\nsecond_band_color, depending on the color of the previous row or\ncolumn." - }, - "headerColor": { - "$ref": "Color", - "description": "The color of the first row or column. If this field is set, the first\nrow or column will be filled with this color and the colors will\nalternate between first_band_color and second_band_color starting\nfrom the second row or column. Otherwise, the first row or column will be\nfilled with first_band_color and the colors will proceed to alternate\nas they normally would." + "description": "The color of the last row or column. If this field is not set, the last\nrow or column will be filled with either first_band_color or\nsecond_band_color, depending on the color of the previous row or\ncolumn.", + "$ref": "Color" } } }, @@ -4030,44 +3277,105 @@ "type": "object", "properties": { "protectedRange": { - "$ref": "ProtectedRange", - "description": "The newly added protected range." + "description": "The newly added protected range.", + "$ref": "ProtectedRange" } }, "id": "AddProtectedRangeResponse" }, "BasicFilter": { + "id": "BasicFilter", "description": "The default filter associated with a sheet.", "type": "object", "properties": { - "range": { - "$ref": "GridRange", - "description": "The range the filter covers." - }, "criteria": { - "description": "The criteria for showing/hiding values per column.\nThe map's key is the column index, and the value is the criteria for\nthat column.", - "type": "object", "additionalProperties": { "$ref": "FilterCriteria" - } + }, + "description": "The criteria for showing/hiding values per column.\nThe map's key is the column index, and the value is the criteria for\nthat column.", + "type": "object" + }, + "range": { + "description": "The range the filter covers.", + "$ref": "GridRange" }, "sortSpecs": { "description": "The sort order per column. Later specifications are used when values\nare equal in the earlier specifications.", - "type": "array", "items": { "$ref": "SortSpec" - } + }, + "type": "array" + } + } + }, + "CandlestickSeries": { + "id": "CandlestickSeries", + "description": "The series of a CandlestickData.", + "type": "object", + "properties": { + "data": { + "$ref": "ChartData", + "description": "The data of the CandlestickSeries." + } + } + }, + "HistogramChartSpec": { + "description": "A \u003ca href=\"/chart/interactive/docs/gallery/histogram\"\u003ehistogram chart\u003c/a\u003e.\nA histogram chart groups data items into bins, displaying each bin as a\ncolumn of stacked items. Histograms are used to display the distribution\nof a dataset. Each column of items represents a range into which those\nitems fall. The number of bins can be chosen automatically or specified\nexplicitly.", + "type": "object", + "properties": { + "bucketSize": { + "format": "double", + "description": "By default the bucket size (the range of values stacked in a single\ncolumn) is chosen automatically, but it may be overridden here.\nE.g., A bucket size of 1.5 results in buckets from 0 - 1.5, 1.5 - 3.0, etc.\nCannot be negative.\nThis field is optional.", + "type": "number" + }, + "outlierPercentile": { + "format": "double", + "description": "The outlier percentile is used to ensure that outliers do not adversely\naffect the calculation of bucket sizes. For example, setting an outlier\npercentile of 0.05 indicates that the top and bottom 5% of values when\ncalculating buckets. The values are still included in the chart, they will\nbe added to the first or last buckets instead of their own buckets.\nMust be between 0.0 and 0.5.", + "type": "number" + }, + "showItemDividers": { + "description": "Whether horizontal divider lines should be displayed between items in each\ncolumn.", + "type": "boolean" + }, + "series": { + "description": "The series for a histogram may be either a single series of values to be\nbucketed or multiple series, each of the same length, containing the name\nof the series followed by the values to be bucketed for that series.", + "items": { + "$ref": "HistogramSeries" + }, + "type": "array" + }, + "legendPosition": { + "enumDescriptions": [ + "Default value, do not use.", + "The legend is rendered on the bottom of the chart.", + "The legend is rendered on the left of the chart.", + "The legend is rendered on the right of the chart.", + "The legend is rendered on the top of the chart.", + "No legend is rendered.", + "The legend is rendered inside the chart area." + ], + "enum": [ + "HISTOGRAM_CHART_LEGEND_POSITION_UNSPECIFIED", + "BOTTOM_LEGEND", + "LEFT_LEGEND", + "RIGHT_LEGEND", + "TOP_LEGEND", + "NO_LEGEND", + "INSIDE_LEGEND" + ], + "description": "The position of the chart legend.", + "type": "string" } }, - "id": "BasicFilter" + "id": "HistogramChartSpec" }, "UpdateValuesResponse": { "description": "The response when updating a range of values in a spreadsheet.", "type": "object", "properties": { "updatedColumns": { - "description": "The number of columns where at least one cell in the column was updated.", "format": "int32", + "description": "The number of columns where at least one cell in the column was updated.", "type": "integer" }, "spreadsheetId": { @@ -4079,23 +3387,65 @@ "type": "string" }, "updatedCells": { + "format": "int32", "description": "The number of cells updated.", - "format": "int32", - "type": "integer" - }, - "updatedRows": { - "description": "The number of rows where at least one cell in the row was updated.", - "format": "int32", "type": "integer" }, "updatedData": { "$ref": "ValueRange", "description": "The values of the cells after updates were applied.\nThis is only included if the request's `includeValuesInResponse` field\nwas `true`." + }, + "updatedRows": { + "format": "int32", + "description": "The number of rows where at least one cell in the row was updated.", + "type": "integer" } }, "id": "UpdateValuesResponse" }, + "ErrorValue": { + "description": "An error in a cell.", + "type": "object", + "properties": { + "type": { + "description": "The type of error.", + "type": "string", + "enumDescriptions": [ + "The default error type, do not use this.", + "Corresponds to the `#ERROR!` error.", + "Corresponds to the `#NULL!` error.", + "Corresponds to the `#DIV/0` error.", + "Corresponds to the `#VALUE!` error.", + "Corresponds to the `#REF!` error.", + "Corresponds to the `#NAME?` error.", + "Corresponds to the `#NUM`! error.", + "Corresponds to the `#N/A` error.", + "Corresponds to the `Loading...` state." + ], + "enum": [ + "ERROR_TYPE_UNSPECIFIED", + "ERROR", + "NULL_VALUE", + "DIVIDE_BY_ZERO", + "VALUE", + "REF", + "NAME", + "NUM", + "N_A", + "LOADING" + ] + }, + "message": { + "description": "A message with more information about the error\n(in the spreadsheet's locale).", + "type": "string" + } + }, + "id": "ErrorValue" + }, "PivotValue": { + "id": "PivotValue", + "description": "The definition of how a value in a pivot table should be calculated.", + "type": "object", "properties": { "formula": { "description": "A custom formula to calculate the value. The formula must start\nwith an `=` character.", @@ -4140,82 +3490,1892 @@ "type": "string" }, "sourceColumnOffset": { - "description": "The column offset of the source range that this value reads from.\n\nFor example, if the source was `C10:E15`, a `sourceColumnOffset` of `0`\nmeans this value refers to column `C`, whereas the offset `1` would\nrefer to column `D`.", "format": "int32", + "description": "The column offset of the source range that this value reads from.\n\nFor example, if the source was `C10:E15`, a `sourceColumnOffset` of `0`\nmeans this value refers to column `C`, whereas the offset `1` would\nrefer to column `D`.", "type": "integer" }, "name": { "description": "A name to use for the value. This is only used if formula was set.\nOtherwise, the column name is used.", "type": "string" } - }, - "id": "PivotValue", - "description": "The definition of how a value in a pivot table should be calculated.", - "type": "object" + } }, - "ErrorValue": { - "description": "An error in a cell.", + "CopySheetToAnotherSpreadsheetRequest": { + "description": "The request to copy a sheet across spreadsheets.", + "type": "object", + "properties": { + "destinationSpreadsheetId": { + "description": "The ID of the spreadsheet to copy the sheet to.", + "type": "string" + } + }, + "id": "CopySheetToAnotherSpreadsheetRequest" + }, + "PivotGroupSortValueBucket": { + "description": "Information about which values in a pivot group should be used for sorting.", + "type": "object", + "properties": { + "valuesIndex": { + "format": "int32", + "description": "The offset in the PivotTable.values list which the values in this\ngrouping should be sorted by.", + "type": "integer" + }, + "buckets": { + "description": "Determines the bucket from which values are chosen to sort.\n\nFor example, in a pivot table with one row group & two column groups,\nthe row group can list up to two values. The first value corresponds\nto a value within the first column group, and the second value\ncorresponds to a value in the second column group. If no values\nare listed, this would indicate that the row should be sorted according\nto the \"Grand Total\" over the column groups. If a single value is listed,\nthis would correspond to using the \"Total\" of that bucket.", + "items": { + "$ref": "ExtendedValue" + }, + "type": "array" + } + }, + "id": "PivotGroupSortValueBucket" + }, + "DeleteDeveloperMetadataRequest": { + "id": "DeleteDeveloperMetadataRequest", + "description": "A request to delete developer metadata.", + "type": "object", + "properties": { + "dataFilter": { + "description": "The data filter describing the criteria used to select which developer\nmetadata entry to delete.", + "$ref": "DataFilter" + } + } + }, + "CandlestickChartSpec": { + "description": "A \u003ca href=\"/chart/interactive/docs/gallery/candlestickchart\"\u003ecandlestick chart\u003c/a\u003e.", + "type": "object", + "properties": { + "data": { + "description": "The Candlestick chart data.\nOnly one CandlestickData is supported.", + "items": { + "$ref": "CandlestickData" + }, + "type": "array" + }, + "domain": { + "$ref": "CandlestickDomain", + "description": "The domain data (horizontal axis) for the candlestick chart. String data\nwill be treated as discrete labels, other data will be treated as\ncontinuous values." + } + }, + "id": "CandlestickChartSpec" + }, + "BatchClearValuesByDataFilterResponse": { + "id": "BatchClearValuesByDataFilterResponse", + "description": "The response when clearing a range of values selected with\nDataFilters in a spreadsheet.", + "type": "object", + "properties": { + "spreadsheetId": { + "description": "The spreadsheet the updates were applied to.", + "type": "string" + }, + "clearedRanges": { + "description": "The ranges that were cleared, in A1 notation.\n(If the requests were for an unbounded range or a ranger larger\n than the bounds of the sheet, this will be the actual ranges\n that were cleared, bounded to the sheet's limits.)", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "CandlestickData": { + "id": "CandlestickData", + "description": "The Candlestick chart data, each containing the low, open, close, and high\nvalues for a series.", + "type": "object", + "properties": { + "highSeries": { + "description": "The range data (vertical axis) for the high/maximum value for each\ncandle. This is the top of the candle's center line.", + "$ref": "CandlestickSeries" + }, + "closeSeries": { + "$ref": "CandlestickSeries", + "description": "The range data (vertical axis) for the close/final value for each candle.\nThis is the top of the candle body. If greater than the open value the\ncandle will be filled. Otherwise the candle will be hollow." + }, + "lowSeries": { + "description": "The range data (vertical axis) for the low/minimum value for each candle.\nThis is the bottom of the candle's center line.", + "$ref": "CandlestickSeries" + }, + "openSeries": { + "description": "The range data (vertical axis) for the open/initial value for each\ncandle. This is the bottom of the candle body. If less than the close\nvalue the candle will be filled. Otherwise the candle will be hollow.", + "$ref": "CandlestickSeries" + } + } + }, + "EmbeddedObjectPosition": { + "id": "EmbeddedObjectPosition", + "description": "The position of an embedded object such as a chart.", + "type": "object", + "properties": { + "overlayPosition": { + "description": "The position at which the object is overlaid on top of a grid.", + "$ref": "OverlayPosition" + }, + "sheetId": { + "format": "int32", + "description": "The sheet this is on. Set only if the embedded object\nis on its own sheet. Must be non-negative.", + "type": "integer" + }, + "newSheet": { + "description": "If true, the embedded object will be put on a new sheet whose ID\nis chosen for you. Used only when writing.", + "type": "boolean" + } + } + }, + "DeleteProtectedRangeRequest": { + "id": "DeleteProtectedRangeRequest", + "description": "Deletes the protected range with the given ID.", + "type": "object", + "properties": { + "protectedRangeId": { + "format": "int32", + "description": "The ID of the protected range to delete.", + "type": "integer" + } + } + }, + "DeveloperMetadataLookup": { + "description": "Selects DeveloperMetadata that matches all of the specified fields. For\nexample, if only a metadata ID is specified this will consider the\nDeveloperMetadata with that particular unique ID. If a metadata key is\nspecified, all developer metadata with that key will be considered. If a\nkey, visibility, and location type are all specified, then all\ndeveloper metadata with that key, visibility, and associated with a\nlocation of that type will be considered. In general, this\nselects all DeveloperMetadata that matches the intersection of all the\nspecified fields; any field or combination of fields may be specified.", + "type": "object", + "properties": { + "metadataValue": { + "description": "Limits the selected developer metadata to that which has a matching\nDeveloperMetadata.metadata_value.", + "type": "string" + }, + "metadataLocation": { + "description": "Limits the selected developer metadata to those entries associated with\nthe specified location. This field either matches exact locations or all\nintersecting locations according the specified\nlocationMatchingStrategy.", + "$ref": "DeveloperMetadataLocation" + }, + "locationMatchingStrategy": { + "enumDescriptions": [ + "Default value. This value must not be used.", + "Indicates that a specified location should be matched exactly. For\nexample, if row three were specified as a location this matching strategy\nwould only match developer metadata also associated on row three. Metadata\nassociated on other locations would not be considered.", + "Indicates that a specified location should match that exact location as\nwell as any intersecting locations. For example, if row three were\nspecified as a location this matching strategy would match developer\nmetadata associated on row three as well as metadata associated on\nlocations that intersect row three. If, for instance, there was developer\nmetadata associated on column B, this matching strategy would also match\nthat location because column B intersects row three." + ], + "enum": [ + "DEVELOPER_METADATA_LOCATION_MATCHING_STRATEGY_UNSPECIFIED", + "EXACT_LOCATION", + "INTERSECTING_LOCATION" + ], + "description": "Determines how this lookup matches the location. If this field is\nspecified as EXACT, only developer metadata associated on the exact\nlocation specified will be matched. If this field is specified to INTERSECTING,\ndeveloper metadata associated on intersecting locations will also be\nmatched. If left unspecified, this field will assume a default value of\nINTERSECTING.\nIf this field is specified, a metadataLocation\nmust also be specified.", + "type": "string" + }, + "locationType": { + "enumDescriptions": [ + "Default value.", + "Developer metadata associated on an entire row dimension.", + "Developer metadata associated on an entire column dimension.", + "Developer metadata associated on an entire sheet.", + "Developer metadata associated on the entire spreadsheet." + ], + "enum": [ + "DEVELOPER_METADATA_LOCATION_TYPE_UNSPECIFIED", + "ROW", + "COLUMN", + "SHEET", + "SPREADSHEET" + ], + "description": "Limits the selected developer metadata to those entries which are\nassociated with locations of the specified type. For example, specifying\nthis as ROW will only consider\ndeveloper metadata associated on rows. If left unspecified, all location\ntypes will be considered. This field cannot be specified as\nSPREADSHEET when the\nlocationMatchingStrategy is\nspecified as INTERSECTING or when the\nmetadataLocation is specified as a\nnon-spreadsheet location: spreadsheet metadata cannot intersect any other\ndeveloper metadata location. This field also must be left unspecified when the\nlocationMatchingStrategy is\nspecified as EXACT.", + "type": "string" + }, + "metadataKey": { + "description": "Limits the selected developer metadata to that which has a matching\nDeveloperMetadata.metadata_key.", + "type": "string" + }, + "visibility": { + "description": "Limits the selected developer metadata to that which has a matching\nDeveloperMetadata.visibility. If left unspecified, all developer\nmetadata visibile to the requesting project will be considered.", + "type": "string", + "enumDescriptions": [ + "Default value.", + "Document-visible metadata is accessible from any developer project with\naccess to the document.", + "Project-visible metadata is only visible to and accessible by the developer\nproject that created the metadata." + ], + "enum": [ + "DEVELOPER_METADATA_VISIBILITY_UNSPECIFIED", + "DOCUMENT", + "PROJECT" + ] + }, + "metadataId": { + "format": "int32", + "description": "Limits the selected developer metadata to that which has a matching\nDeveloperMetadata.metadata_id.", + "type": "integer" + } + }, + "id": "DeveloperMetadataLookup" + }, + "AutoFillRequest": { + "description": "Fills in more data based on existing data.", + "type": "object", + "properties": { + "range": { + "description": "The range to autofill. This will examine the range and detect\nthe location that has data and automatically fill that data\nin to the rest of the range.", + "$ref": "GridRange" + }, + "useAlternateSeries": { + "description": "True if we should generate data with the \"alternate\" series.\nThis differs based on the type and amount of source data.", + "type": "boolean" + }, + "sourceAndDestination": { + "$ref": "SourceAndDestination", + "description": "The source and destination areas to autofill.\nThis explicitly lists the source of the autofill and where to\nextend that data." + } + }, + "id": "AutoFillRequest" + }, + "GradientRule": { + "description": "A rule that applies a gradient color scale format, based on\nthe interpolation points listed. The format of a cell will vary\nbased on its contents as compared to the values of the interpolation\npoints.", + "type": "object", + "properties": { + "maxpoint": { + "$ref": "InterpolationPoint", + "description": "The final interpolation point." + }, + "minpoint": { + "description": "The starting interpolation point.", + "$ref": "InterpolationPoint" + }, + "midpoint": { + "$ref": "InterpolationPoint", + "description": "An optional midway interpolation point." + } + }, + "id": "GradientRule" + }, + "SetBasicFilterRequest": { + "id": "SetBasicFilterRequest", + "description": "Sets the basic filter associated with a sheet.", + "type": "object", + "properties": { + "filter": { + "description": "The filter to set.", + "$ref": "BasicFilter" + } + } + }, + "ClearValuesRequest": { + "id": "ClearValuesRequest", + "description": "The request for clearing a range of values in a spreadsheet.", + "type": "object", + "properties": {} + }, + "InterpolationPoint": { + "id": "InterpolationPoint", + "description": "A single interpolation point on a gradient conditional format.\nThese pin the gradient color scale according to the color,\ntype and value chosen.", + "type": "object", + "properties": { + "color": { + "description": "The color this interpolation point should use.", + "$ref": "Color" + }, + "type": { + "enumDescriptions": [ + "The default value, do not use.", + "The interpolation point will use the minimum value in the\ncells over the range of the conditional format.", + "The interpolation point will use the maximum value in the\ncells over the range of the conditional format.", + "The interpolation point will use exactly the value in\nInterpolationPoint.value.", + "The interpolation point will be the given percentage over\nall the cells in the range of the conditional format.\nThis is equivalent to NUMBER if the value was:\n`=(MAX(FLATTEN(range)) * (value / 100))\n + (MIN(FLATTEN(range)) * (1 - (value / 100)))`\n(where errors in the range are ignored when flattening).", + "The interpolation point will be the given percentile\nover all the cells in the range of the conditional format.\nThis is equivalent to NUMBER if the value was:\n`=PERCENTILE(FLATTEN(range), value / 100)`\n(where errors in the range are ignored when flattening)." + ], + "enum": [ + "INTERPOLATION_POINT_TYPE_UNSPECIFIED", + "MIN", + "MAX", + "NUMBER", + "PERCENT", + "PERCENTILE" + ], + "description": "How the value should be interpreted.", + "type": "string" + }, + "value": { + "description": "The value this interpolation point uses. May be a formula.\nUnused if type is MIN or\nMAX.", + "type": "string" + } + } + }, + "BatchClearValuesByDataFilterRequest": { + "description": "The request for clearing more than one range selected by a\nDataFilter in a spreadsheet.", + "type": "object", + "properties": { + "dataFilters": { + "description": "The DataFilters used to determine which ranges to clear.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + } + }, + "id": "BatchClearValuesByDataFilterRequest" + }, + "GetSpreadsheetByDataFilterRequest": { + "id": "GetSpreadsheetByDataFilterRequest", + "description": "The request for retrieving a Spreadsheet.", + "type": "object", + "properties": { + "includeGridData": { + "description": "True if grid data should be returned.\nThis parameter is ignored if a field mask was set in the request.", + "type": "boolean" + }, + "dataFilters": { + "description": "The DataFilters used to select which ranges to retrieve from\nthe spreadsheet.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + } + } + }, + "DeleteEmbeddedObjectRequest": { + "id": "DeleteEmbeddedObjectRequest", + "description": "Deletes the embedded object with the given ID.", + "type": "object", + "properties": { + "objectId": { + "format": "int32", + "description": "The ID of the embedded object to delete.", + "type": "integer" + } + } + }, + "FindReplaceResponse": { + "description": "The result of the find/replace.", + "type": "object", + "properties": { + "formulasChanged": { + "format": "int32", + "description": "The number of formula cells changed.", + "type": "integer" + }, + "valuesChanged": { + "format": "int32", + "description": "The number of non-formula cells changed.", + "type": "integer" + }, + "occurrencesChanged": { + "format": "int32", + "description": "The number of occurrences (possibly multiple within a cell) changed.\nFor example, if replacing `\"e\"` with `\"o\"` in `\"Google Sheets\"`, this would\nbe `\"3\"` because `\"Google Sheets\"` -\u003e `\"Googlo Shoots\"`.", + "type": "integer" + }, + "rowsChanged": { + "format": "int32", + "description": "The number of rows changed.", + "type": "integer" + }, + "sheetsChanged": { + "format": "int32", + "description": "The number of sheets changed.", + "type": "integer" + } + }, + "id": "FindReplaceResponse" + }, + "UpdateValuesByDataFilterResponse": { + "description": "The response when updating a range of values by a data filter in a\nspreadsheet.", + "type": "object", + "properties": { + "updatedData": { + "$ref": "ValueRange", + "description": "The values of the cells in the range matched by the dataFilter after all\nupdates were applied. This is only included if the request's\n`includeValuesInResponse` field was `true`." + }, + "updatedRows": { + "format": "int32", + "description": "The number of rows where at least one cell in the row was updated.", + "type": "integer" + }, + "updatedColumns": { + "format": "int32", + "description": "The number of columns where at least one cell in the column was updated.", + "type": "integer" + }, + "updatedRange": { + "description": "The range (in A1 notation) that updates were applied to.", + "type": "string" + }, + "updatedCells": { + "format": "int32", + "description": "The number of cells updated.", + "type": "integer" + }, + "dataFilter": { + "description": "The data filter that selected the range that was updated.", + "$ref": "DataFilter" + } + }, + "id": "UpdateValuesByDataFilterResponse" + }, + "DeleteSheetRequest": { + "description": "Deletes the requested sheet.", + "type": "object", + "properties": { + "sheetId": { + "format": "int32", + "description": "The ID of the sheet to delete.", + "type": "integer" + } + }, + "id": "DeleteSheetRequest" + }, + "DuplicateFilterViewRequest": { + "description": "Duplicates a particular filter view.", + "type": "object", + "properties": { + "filterId": { + "format": "int32", + "description": "The ID of the filter being duplicated.", + "type": "integer" + } + }, + "id": "DuplicateFilterViewRequest" + }, + "MatchedValueRange": { + "id": "MatchedValueRange", + "description": "A value range that was matched by one or more data filers.", + "type": "object", + "properties": { + "valueRange": { + "description": "The values matched by the DataFilter.", + "$ref": "ValueRange" + }, + "dataFilters": { + "description": "The DataFilters from the request that matched the range of\nvalues.", + "items": { + "$ref": "DataFilter" + }, + "type": "array" + } + } + }, + "DeveloperMetadataLocation": { + "id": "DeveloperMetadataLocation", + "description": "A location where metadata may be associated in a spreadsheet.", + "type": "object", + "properties": { + "sheetId": { + "format": "int32", + "description": "The ID of the sheet when metadata is associated with an entire sheet.", + "type": "integer" + }, + "spreadsheet": { + "description": "True when metadata is associated with an entire spreadsheet.", + "type": "boolean" + }, + "locationType": { + "enumDescriptions": [ + "Default value.", + "Developer metadata associated on an entire row dimension.", + "Developer metadata associated on an entire column dimension.", + "Developer metadata associated on an entire sheet.", + "Developer metadata associated on the entire spreadsheet." + ], + "enum": [ + "DEVELOPER_METADATA_LOCATION_TYPE_UNSPECIFIED", + "ROW", + "COLUMN", + "SHEET", + "SPREADSHEET" + ], + "description": "The type of location this object represents. This field is read-only.", + "type": "string" + }, + "dimensionRange": { + "description": "Represents the row or column when metadata is associated with\na dimension. The specified DimensionRange must represent a single row\nor column; it cannot be unbounded or span multiple rows or columns.", + "$ref": "DimensionRange" + } + } + }, + "UpdateConditionalFormatRuleResponse": { + "id": "UpdateConditionalFormatRuleResponse", + "description": "The result of updating a conditional format rule.", + "type": "object", + "properties": { + "newIndex": { + "format": "int32", + "description": "The index of the new rule.", + "type": "integer" + }, + "newRule": { + "description": "The new rule that replaced the old rule (if replacing),\nor the rule that was moved (if moved)", + "$ref": "ConditionalFormatRule" + }, + "oldIndex": { + "format": "int32", + "description": "The old index of the rule. Not set if a rule was replaced\n(because it is the same as new_index).", + "type": "integer" + }, + "oldRule": { + "$ref": "ConditionalFormatRule", + "description": "The old (deleted) rule. Not set if a rule was moved\n(because it is the same as new_rule)." + } + } + }, + "DuplicateSheetRequest": { + "description": "Duplicates the contents of a sheet.", + "type": "object", + "properties": { + "newSheetName": { + "description": "The name of the new sheet. If empty, a new name is chosen for you.", + "type": "string" + }, + "sourceSheetId": { + "format": "int32", + "description": "The sheet to duplicate.", + "type": "integer" + }, + "newSheetId": { + "format": "int32", + "description": "If set, the ID of the new sheet. If not set, an ID is chosen.\nIf set, the ID must not conflict with any existing sheet ID.\nIf set, it must be non-negative.", + "type": "integer" + }, + "insertSheetIndex": { + "format": "int32", + "description": "The zero-based index where the new sheet should be inserted.\nThe index of all sheets after this are incremented.", + "type": "integer" + } + }, + "id": "DuplicateSheetRequest" + }, + "ConditionValue": { + "description": "The value of the condition.", + "type": "object", + "properties": { + "userEnteredValue": { + "description": "A value the condition is based on.\nThe value will be parsed as if the user typed into a cell.\nFormulas are supported (and must begin with an `=`).", + "type": "string" + }, + "relativeDate": { + "description": "A relative date (based on the current date).\nValid only if the type is\nDATE_BEFORE,\nDATE_AFTER,\nDATE_ON_OR_BEFORE or\nDATE_ON_OR_AFTER.\n\nRelative dates are not supported in data validation.\nThey are supported only in conditional formatting and\nconditional filters.", + "type": "string", + "enumDescriptions": [ + "Default value, do not use.", + "The value is one year before today.", + "The value is one month before today.", + "The value is one week before today.", + "The value is yesterday.", + "The value is today.", + "The value is tomorrow." + ], + "enum": [ + "RELATIVE_DATE_UNSPECIFIED", + "PAST_YEAR", + "PAST_MONTH", + "PAST_WEEK", + "YESTERDAY", + "TODAY", + "TOMORROW" + ] + } + }, + "id": "ConditionValue" + }, + "ExtendedValue": { + "description": "The kinds of value that a cell in a spreadsheet can have.", + "type": "object", + "properties": { + "numberValue": { + "format": "double", + "description": "Represents a double value.\nNote: Dates, Times and DateTimes are represented as doubles in\n\"serial number\" format.", + "type": "number" + }, + "errorValue": { + "description": "Represents an error.\nThis field is read-only.", + "$ref": "ErrorValue" + }, + "formulaValue": { + "description": "Represents a formula.", + "type": "string" + }, + "boolValue": { + "description": "Represents a boolean value.", + "type": "boolean" + }, + "stringValue": { + "description": "Represents a string value.\nLeading single quotes are not included. For example, if the user typed\n`'123` into the UI, this would be represented as a `stringValue` of\n`\"123\"`.", + "type": "string" + } + }, + "id": "ExtendedValue" + }, + "AddChartRequest": { + "id": "AddChartRequest", + "description": "Adds a chart to a sheet in the spreadsheet.", + "type": "object", + "properties": { + "chart": { + "$ref": "EmbeddedChart", + "description": "The chart that should be added to the spreadsheet, including the position\nwhere it should be placed. The chartId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a chart that already exists.)" + } + } + }, + "Spreadsheet": { + "id": "Spreadsheet", + "description": "Resource that represents a spreadsheet.", + "type": "object", + "properties": { + "namedRanges": { + "description": "The named ranges defined in a spreadsheet.", + "items": { + "$ref": "NamedRange" + }, + "type": "array" + }, + "spreadsheetId": { + "description": "The ID of the spreadsheet.\nThis field is read-only.", + "type": "string" + }, + "developerMetadata": { + "description": "The developer metadata associated with a spreadsheet.", + "items": { + "$ref": "DeveloperMetadata" + }, + "type": "array" + }, + "sheets": { + "description": "The sheets that are part of a spreadsheet.", + "items": { + "$ref": "Sheet" + }, + "type": "array" + }, + "spreadsheetUrl": { + "description": "The url of the spreadsheet.\nThis field is read-only.", + "type": "string" + }, + "properties": { + "description": "Overall properties of a spreadsheet.", + "$ref": "SpreadsheetProperties" + } + } + }, + "BatchClearValuesResponse": { + "description": "The response when clearing a range of values in a spreadsheet.", + "type": "object", + "properties": { + "spreadsheetId": { + "description": "The spreadsheet the updates were applied to.", + "type": "string" + }, + "clearedRanges": { + "description": "The ranges that were cleared, in A1 notation.\n(If the requests were for an unbounded range or a ranger larger\n than the bounds of the sheet, this will be the actual ranges\n that were cleared, bounded to the sheet's limits.)", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "BatchClearValuesResponse" + }, + "HistogramSeries": { + "id": "HistogramSeries", + "description": "A histogram series containing the series color and data.", + "type": "object", + "properties": { + "barColor": { + "description": "The color of the column representing this series in each bucket.\nThis field is optional.", + "$ref": "Color" + }, + "data": { + "description": "The data for this histogram series.", + "$ref": "ChartData" + } + } + }, + "BandedRange": { + "description": "A banded (alternating colors) range in a sheet.", + "type": "object", + "properties": { + "range": { + "$ref": "GridRange", + "description": "The range over which these properties are applied." + }, + "bandedRangeId": { + "format": "int32", + "description": "The id of the banded range.", + "type": "integer" + }, + "columnProperties": { + "description": "Properties for column bands. These properties will be applied on a column-\nby-column basis throughout all the columns in the range. At least one of\nrow_properties or column_properties must be specified.", + "$ref": "BandingProperties" + }, + "rowProperties": { + "$ref": "BandingProperties", + "description": "Properties for row bands. These properties will be applied on a row-by-row\nbasis throughout all the rows in the range. At least one of\nrow_properties or column_properties must be specified." + } + }, + "id": "BandedRange" + }, + "UpdateProtectedRangeRequest": { + "id": "UpdateProtectedRangeRequest", + "description": "Updates an existing protected range with the specified\nprotectedRangeId.", + "type": "object", + "properties": { + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `protectedRange` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + }, + "protectedRange": { + "description": "The protected range to update with the new properties.", + "$ref": "ProtectedRange" + } + } + }, + "DataFilter": { + "id": "DataFilter", + "description": "Filter that describes what data should be selected or returned from a\nrequest.", + "type": "object", + "properties": { + "gridRange": { + "description": "Selects data that matches the range described by the GridRange.", + "$ref": "GridRange" + }, + "developerMetadataLookup": { + "$ref": "DeveloperMetadataLookup", + "description": "Selects data associated with the developer metadata matching the criteria\ndescribed by this DeveloperMetadataLookup." + }, + "a1Range": { + "description": "Selects data that matches the specified A1 range.", + "type": "string" + } + } + }, + "TextFormat": { + "description": "The format of a run of text in a cell.\nAbsent values indicate that the field isn't specified.", + "type": "object", + "properties": { + "underline": { + "description": "True if the text is underlined.", + "type": "boolean" + }, + "foregroundColor": { + "$ref": "Color", + "description": "The foreground color of the text." + }, + "bold": { + "description": "True if the text is bold.", + "type": "boolean" + }, + "fontFamily": { + "description": "The font family.", + "type": "string" + }, + "strikethrough": { + "description": "True if the text has a strikethrough.", + "type": "boolean" + }, + "italic": { + "description": "True if the text is italicized.", + "type": "boolean" + }, + "fontSize": { + "format": "int32", + "description": "The size of the font.", + "type": "integer" + } + }, + "id": "TextFormat" + }, + "AddSheetResponse": { + "id": "AddSheetResponse", + "description": "The result of adding a sheet.", + "type": "object", + "properties": { + "properties": { + "description": "The properties of the newly added sheet.", + "$ref": "SheetProperties" + } + } + }, + "AddFilterViewResponse": { + "id": "AddFilterViewResponse", + "description": "The result of adding a filter view.", + "type": "object", + "properties": { + "filter": { + "$ref": "FilterView", + "description": "The newly added filter view." + } + } + }, + "IterativeCalculationSettings": { + "id": "IterativeCalculationSettings", + "description": "Settings to control how circular dependencies are resolved with iterative\ncalculation.", + "type": "object", + "properties": { + "convergenceThreshold": { + "format": "double", + "description": "When iterative calculation is enabled and successive results differ by\nless than this threshold value, the calculation rounds stop.", + "type": "number" + }, + "maxIterations": { + "format": "int32", + "description": "When iterative calculation is enabled, the maximum number of calculation\nrounds to perform.", + "type": "integer" + } + } + }, + "SpreadsheetProperties": { + "id": "SpreadsheetProperties", + "description": "Properties of a spreadsheet.", + "type": "object", + "properties": { + "autoRecalc": { + "enumDescriptions": [ + "Default value. This value must not be used.", + "Volatile functions are updated on every change.", + "Volatile functions are updated on every change and every minute.", + "Volatile functions are updated on every change and hourly." + ], + "enum": [ + "RECALCULATION_INTERVAL_UNSPECIFIED", + "ON_CHANGE", + "MINUTE", + "HOUR" + ], + "description": "The amount of time to wait before volatile functions are recalculated.", + "type": "string" + }, + "defaultFormat": { + "description": "The default format of all cells in the spreadsheet.\nCellData.effectiveFormat will not be set if the\ncell's format is equal to this default format.\nThis field is read-only.", + "$ref": "CellFormat" + }, + "timeZone": { + "description": "The time zone of the spreadsheet, in CLDR format such as\n`America/New_York`. If the time zone isn't recognized, this may\nbe a custom time zone such as `GMT-07:00`.", + "type": "string" + }, + "title": { + "description": "The title of the spreadsheet.", + "type": "string" + }, + "locale": { + "description": "The locale of the spreadsheet in one of the following formats:\n\n* an ISO 639-1 language code such as `en`\n\n* an ISO 639-2 language code such as `fil`, if no 639-1 code exists\n\n* a combination of the ISO language code and country code, such as `en_US`\n\nNote: when updating this field, not all locales/languages are supported.", + "type": "string" + }, + "iterativeCalculationSettings": { + "$ref": "IterativeCalculationSettings", + "description": "Determines whether and how circular references are resolved with iterative\ncalculation. Absence of this field means that circular references will\nresult in calculation errors." + } + } + }, + "OverlayPosition": { + "description": "The location an object is overlaid on top of a grid.", + "type": "object", + "properties": { + "offsetXPixels": { + "format": "int32", + "description": "The horizontal offset, in pixels, that the object is offset\nfrom the anchor cell.", + "type": "integer" + }, + "anchorCell": { + "description": "The cell the object is anchored to.", + "$ref": "GridCoordinate" + }, + "heightPixels": { + "format": "int32", + "description": "The height of the object, in pixels. Defaults to 371.", + "type": "integer" + }, + "offsetYPixels": { + "format": "int32", + "description": "The vertical offset, in pixels, that the object is offset\nfrom the anchor cell.", + "type": "integer" + }, + "widthPixels": { + "format": "int32", + "description": "The width of the object, in pixels. Defaults to 600.", + "type": "integer" + } + }, + "id": "OverlayPosition" + }, + "RepeatCellRequest": { + "id": "RepeatCellRequest", + "description": "Updates all cells in the range to the values in the given Cell object.\nOnly the fields listed in the fields field are updated; others are\nunchanged.\n\nIf writing a cell with a formula, the formula's ranges will automatically\nincrement for each field in the range.\nFor example, if writing a cell with formula `=A1` into range B2:C4,\nB2 would be `=A1`, B3 would be `=A2`, B4 would be `=A3`,\nC2 would be `=B1`, C3 would be `=B2`, C4 would be `=B3`.\n\nTo keep the formula's ranges static, use the `$` indicator.\nFor example, use the formula `=$A$1` to prevent both the row and the\ncolumn from incrementing.", + "type": "object", + "properties": { + "cell": { + "$ref": "CellData", + "description": "The data to write." + }, + "range": { + "description": "The range to repeat the cell in.", + "$ref": "GridRange" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `cell` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + } + } + }, + "AddChartResponse": { + "description": "The result of adding a chart to a spreadsheet.", + "type": "object", + "properties": { + "chart": { + "$ref": "EmbeddedChart", + "description": "The newly added chart." + } + }, + "id": "AddChartResponse" + }, + "InsertDimensionRequest": { + "id": "InsertDimensionRequest", + "description": "Inserts rows or columns in a sheet at a particular index.", + "type": "object", + "properties": { + "inheritFromBefore": { + "description": "Whether dimension properties should be extended from the dimensions\nbefore or after the newly inserted dimensions.\nTrue to inherit from the dimensions before (in which case the start\nindex must be greater than 0), and false to inherit from the dimensions\nafter.\n\nFor example, if row index 0 has red background and row index 1\nhas a green background, then inserting 2 rows at index 1 can inherit\neither the green or red background. If `inheritFromBefore` is true,\nthe two new rows will be red (because the row before the insertion point\nwas red), whereas if `inheritFromBefore` is false, the two new rows will\nbe green (because the row after the insertion point was green).", + "type": "boolean" + }, + "range": { + "$ref": "DimensionRange", + "description": "The dimensions to insert. Both the start and end indexes must be bounded." + } + } + }, + "UpdateSpreadsheetPropertiesRequest": { + "description": "Updates properties of a spreadsheet.", + "type": "object", + "properties": { + "properties": { + "$ref": "SpreadsheetProperties", + "description": "The properties to update." + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root 'properties' is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + } + }, + "id": "UpdateSpreadsheetPropertiesRequest" + }, + "BatchUpdateValuesRequest": { + "description": "The request for updating more than one range of values in a spreadsheet.", + "type": "object", + "properties": { + "responseValueRenderOption": { + "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string", + "enumDescriptions": [ + "Values will be calculated & formatted in the reply according to the\ncell's formatting. Formatting is based on the spreadsheet's locale,\nnot the requesting user's locale.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return `\"$1.23\"`.", + "Values will be calculated, but not formatted in the reply.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen `A2` would return the number `1.23`.", + "Values will not be calculated. The reply will include the formulas.\nFor example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency,\nthen A2 would return `\"=A1\"`." + ], + "enum": [ + "FORMATTED_VALUE", + "UNFORMATTED_VALUE", + "FORMULA" + ] + }, + "includeValuesInResponse": { + "description": "Determines if the update response should include the values\nof the cells that were updated. By default, responses\ndo not include the updated values. The `updatedData` field within\neach of the BatchUpdateValuesResponse.responses will contain\nthe updated values. If the range to write was larger than than the range\nactually written, the response will include all values in the requested\nrange (excluding trailing empty rows and columns).", + "type": "boolean" + }, + "data": { + "description": "The new values to apply to the spreadsheet.", + "items": { + "$ref": "ValueRange" + }, + "type": "array" + }, + "valueInputOption": { + "enumDescriptions": [ + "Default input value. This value must not be used.", + "The values the user has entered will not be parsed and will be stored\nas-is.", + "The values will be parsed as if the user typed them into the UI.\nNumbers will stay as numbers, but strings may be converted to numbers,\ndates, etc. following the same rules that are applied when entering\ntext into a cell via the Google Sheets UI." + ], + "enum": [ + "INPUT_VALUE_OPTION_UNSPECIFIED", + "RAW", + "USER_ENTERED" + ], + "description": "How the input data should be interpreted.", + "type": "string" + }, + "responseDateTimeRenderOption": { + "enumDescriptions": [ + "Instructs date, time, datetime, and duration fields to be output\nas doubles in \"serial number\" format, as popularized by Lotus 1-2-3.\nThe whole number portion of the value (left of the decimal) counts\nthe days since December 30th 1899. The fractional portion (right of\nthe decimal) counts the time as a fraction of the day. For example,\nJanuary 1st 1900 at noon would be 2.5, 2 because it's 2 days after\nDecember 30st 1899, and .5 because noon is half a day. February 1st\n1900 at 3pm would be 33.625. This correctly treats the year 1900 as\nnot a leap year.", + "Instructs date, time, datetime, and duration fields to be output\nas strings in their given number format (which is dependent\non the spreadsheet locale)." + ], + "enum": [ + "SERIAL_NUMBER", + "FORMATTED_STRING" + ], + "description": "Determines how dates, times, and durations in the response should be\nrendered. This is ignored if response_value_render_option is\nFORMATTED_VALUE.\nThe default dateTime render option is\nDateTimeRenderOption.SERIAL_NUMBER.", + "type": "string" + } + }, + "id": "BatchUpdateValuesRequest" + }, + "ProtectedRange": { + "id": "ProtectedRange", + "description": "A protected range.", + "type": "object", + "properties": { + "unprotectedRanges": { + "description": "The list of unprotected ranges within a protected sheet.\nUnprotected ranges are only supported on protected sheets.", + "items": { + "$ref": "GridRange" + }, + "type": "array" + }, + "namedRangeId": { + "description": "The named range this protected range is backed by, if any.\n\nWhen writing, only one of range or named_range_id\nmay be set.", + "type": "string" + }, + "protectedRangeId": { + "format": "int32", + "description": "The ID of the protected range.\nThis field is read-only.", + "type": "integer" + }, + "warningOnly": { + "description": "True if this protected range will show a warning when editing.\nWarning-based protection means that every user can edit data in the\nprotected range, except editing will prompt a warning asking the user\nto confirm the edit.\n\nWhen writing: if this field is true, then editors is ignored.\nAdditionally, if this field is changed from true to false and the\n`editors` field is not set (nor included in the field mask), then\nthe editors will be set to all the editors in the document.", + "type": "boolean" + }, + "requestingUserCanEdit": { + "description": "True if the user who requested this protected range can edit the\nprotected area.\nThis field is read-only.", + "type": "boolean" + }, + "range": { + "$ref": "GridRange", + "description": "The range that is being protected.\nThe range may be fully unbounded, in which case this is considered\na protected sheet.\n\nWhen writing, only one of range or named_range_id\nmay be set." + }, + "editors": { + "$ref": "Editors", + "description": "The users and groups with edit access to the protected range.\nThis field is only visible to users with edit access to the protected\nrange and the document.\nEditors are not supported with warning_only protection." + }, + "description": { + "description": "The description of this protected range.", + "type": "string" + } + } + }, + "DimensionProperties": { + "id": "DimensionProperties", + "description": "Properties about a dimension.", + "type": "object", + "properties": { + "pixelSize": { + "format": "int32", + "description": "The height (if a row) or width (if a column) of the dimension in pixels.", + "type": "integer" + }, + "hiddenByUser": { + "description": "True if this dimension is explicitly hidden.", + "type": "boolean" + }, + "hiddenByFilter": { + "description": "True if this dimension is being filtered.\nThis field is read-only.", + "type": "boolean" + }, + "developerMetadata": { + "description": "The developer metadata associated with a single row or column.", + "items": { + "$ref": "DeveloperMetadata" + }, + "type": "array" + } + } + }, + "DimensionRange": { + "description": "A range along a single dimension on a sheet.\nAll indexes are zero-based.\nIndexes are half open: the start index is inclusive\nand the end index is exclusive.\nMissing indexes indicate the range is unbounded on that side.", + "type": "object", + "properties": { + "dimension": { + "description": "The dimension of the span.", + "type": "string", + "enumDescriptions": [ + "The default value, do not use.", + "Operates on the rows of a sheet.", + "Operates on the columns of a sheet." + ], + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ] + }, + "endIndex": { + "format": "int32", + "description": "The end (exclusive) of the span, or not set if unbounded.", + "type": "integer" + }, + "startIndex": { + "format": "int32", + "description": "The start (inclusive) of the span, or not set if unbounded.", + "type": "integer" + }, + "sheetId": { + "format": "int32", + "description": "The sheet this span is on.", + "type": "integer" + } + }, + "id": "DimensionRange" + }, + "NamedRange": { + "id": "NamedRange", + "description": "A named range.", + "type": "object", + "properties": { + "namedRangeId": { + "description": "The ID of the named range.", + "type": "string" + }, + "range": { + "description": "The range this represents.", + "$ref": "GridRange" + }, + "name": { + "description": "The name of the named range.", + "type": "string" + } + } + }, + "CutPasteRequest": { + "description": "Moves data from the source to the destination.", + "type": "object", + "properties": { + "pasteType": { + "enumDescriptions": [ + "Paste values, formulas, formats, and merges.", + "Paste the values ONLY without formats, formulas, or merges.", + "Paste the format and data validation only.", + "Like PASTE_NORMAL but without borders.", + "Paste the formulas only.", + "Paste the data validation only.", + "Paste the conditional formatting rules only." + ], + "enum": [ + "PASTE_NORMAL", + "PASTE_VALUES", + "PASTE_FORMAT", + "PASTE_NO_BORDERS", + "PASTE_FORMULA", + "PASTE_DATA_VALIDATION", + "PASTE_CONDITIONAL_FORMATTING" + ], + "description": "What kind of data to paste. All the source data will be cut, regardless\nof what is pasted.", + "type": "string" + }, + "source": { + "description": "The source data to cut.", + "$ref": "GridRange" + }, + "destination": { + "$ref": "GridCoordinate", + "description": "The top-left coordinate where the data should be pasted." + } + }, + "id": "CutPasteRequest" + }, + "Borders": { + "id": "Borders", + "description": "The borders of the cell.", + "type": "object", + "properties": { + "right": { + "description": "The right border of the cell.", + "$ref": "Border" + }, + "bottom": { + "$ref": "Border", + "description": "The bottom border of the cell." + }, + "top": { + "description": "The top border of the cell.", + "$ref": "Border" + }, + "left": { + "description": "The left border of the cell.", + "$ref": "Border" + } + } + }, + "BasicChartSeries": { + "id": "BasicChartSeries", + "description": "A single series of data in a chart.\nFor example, if charting stock prices over time, multiple series may exist,\none for the \"Open Price\", \"High Price\", \"Low Price\" and \"Close Price\".", "type": "object", "properties": { "type": { "enumDescriptions": [ - "The default error type, do not use this.", - "Corresponds to the `#ERROR!` error.", - "Corresponds to the `#NULL!` error.", - "Corresponds to the `#DIV/0` error.", - "Corresponds to the `#VALUE!` error.", - "Corresponds to the `#REF!` error.", - "Corresponds to the `#NAME?` error.", - "Corresponds to the `#NUM`! error.", - "Corresponds to the `#N/A` error.", - "Corresponds to the `Loading...` state." + "Default value, do not use.", + "A \u003ca href=\"/chart/interactive/docs/gallery/barchart\"\u003ebar chart\u003c/a\u003e.", + "A \u003ca href=\"/chart/interactive/docs/gallery/linechart\"\u003eline chart\u003c/a\u003e.", + "An \u003ca href=\"/chart/interactive/docs/gallery/areachart\"\u003earea chart\u003c/a\u003e.", + "A \u003ca href=\"/chart/interactive/docs/gallery/columnchart\"\u003ecolumn chart\u003c/a\u003e.", + "A \u003ca href=\"/chart/interactive/docs/gallery/scatterchart\"\u003escatter chart\u003c/a\u003e.", + "A \u003ca href=\"/chart/interactive/docs/gallery/combochart\"\u003ecombo chart\u003c/a\u003e.", + "A \u003ca href=\"/chart/interactive/docs/gallery/steppedareachart\"\u003estepped area chart\u003c/a\u003e." ], "enum": [ - "ERROR_TYPE_UNSPECIFIED", - "ERROR", - "NULL_VALUE", - "DIVIDE_BY_ZERO", - "VALUE", - "REF", - "NAME", - "NUM", - "N_A", - "LOADING" + "BASIC_CHART_TYPE_UNSPECIFIED", + "BAR", + "LINE", + "AREA", + "COLUMN", + "SCATTER", + "COMBO", + "STEPPED_AREA" ], - "description": "The type of error.", + "description": "The type of this series. Valid only if the\nchartType is\nCOMBO.\nDifferent types will change the way the series is visualized.\nOnly LINE, AREA,\nand COLUMN are supported.", "type": "string" }, - "message": { - "description": "A message with more information about the error\n(in the spreadsheet's locale).", + "series": { + "description": "The data being visualized in this chart series.", + "$ref": "ChartData" + }, + "targetAxis": { + "enumDescriptions": [ + "Default value, do not use.", + "The axis rendered at the bottom of a chart.\nFor most charts, this is the standard major axis.\nFor bar charts, this is a minor axis.", + "The axis rendered at the left of a chart.\nFor most charts, this is a minor axis.\nFor bar charts, this is the standard major axis.", + "The axis rendered at the right of a chart.\nFor most charts, this is a minor axis.\nFor bar charts, this is an unusual major axis." + ], + "enum": [ + "BASIC_CHART_AXIS_POSITION_UNSPECIFIED", + "BOTTOM_AXIS", + "LEFT_AXIS", + "RIGHT_AXIS" + ], + "description": "The minor axis that will specify the range of values for this series.\nFor example, if charting stocks over time, the \"Volume\" series\nmay want to be pinned to the right with the prices pinned to the left,\nbecause the scale of trading volume is different than the scale of\nprices.\nIt is an error to specify an axis that isn't a valid minor axis\nfor the chart's type.", + "type": "string" + } + } + }, + "AutoResizeDimensionsRequest": { + "id": "AutoResizeDimensionsRequest", + "description": "Automatically resizes one or more dimensions based on the contents\nof the cells in that dimension.", + "type": "object", + "properties": { + "dimensions": { + "$ref": "DimensionRange", + "description": "The dimensions to automatically resize." + } + } + }, + "UpdateBordersRequest": { + "description": "Updates the borders of a range.\nIf a field is not set in the request, that means the border remains as-is.\nFor example, with two subsequent UpdateBordersRequest:\n\n 1. range: A1:A5 `{ top: RED, bottom: WHITE }`\n 2. range: A1:A5 `{ left: BLUE }`\n\nThat would result in A1:A5 having a borders of\n`{ top: RED, bottom: WHITE, left: BLUE }`.\nIf you want to clear a border, explicitly set the style to\nNONE.", + "type": "object", + "properties": { + "right": { + "$ref": "Border", + "description": "The border to put at the right of the range." + }, + "range": { + "$ref": "GridRange", + "description": "The range whose borders should be updated." + }, + "innerHorizontal": { + "$ref": "Border", + "description": "The horizontal border to put within the range." + }, + "top": { + "$ref": "Border", + "description": "The border to put at the top of the range." + }, + "left": { + "description": "The border to put at the left of the range.", + "$ref": "Border" + }, + "bottom": { + "description": "The border to put at the bottom of the range.", + "$ref": "Border" + }, + "innerVertical": { + "description": "The vertical border to put within the range.", + "$ref": "Border" + } + }, + "id": "UpdateBordersRequest" + }, + "CellFormat": { + "id": "CellFormat", + "description": "The format of a cell.", + "type": "object", + "properties": { + "numberFormat": { + "$ref": "NumberFormat", + "description": "A format describing how number values should be represented to the user." + }, + "horizontalAlignment": { + "enumDescriptions": [ + "The horizontal alignment is not specified. Do not use this.", + "The text is explicitly aligned to the left of the cell.", + "The text is explicitly aligned to the center of the cell.", + "The text is explicitly aligned to the right of the cell." + ], + "enum": [ + "HORIZONTAL_ALIGN_UNSPECIFIED", + "LEFT", + "CENTER", + "RIGHT" + ], + "description": "The horizontal alignment of the value in the cell.", + "type": "string" + }, + "hyperlinkDisplayType": { + "enumDescriptions": [ + "The default value: the hyperlink is rendered. Do not use this.", + "A hyperlink should be explicitly rendered.", + "A hyperlink should not be rendered." + ], + "enum": [ + "HYPERLINK_DISPLAY_TYPE_UNSPECIFIED", + "LINKED", + "PLAIN_TEXT" + ], + "description": "How a hyperlink, if it exists, should be displayed in the cell.", + "type": "string" + }, + "textFormat": { + "description": "The format of the text in the cell (unless overridden by a format run).", + "$ref": "TextFormat" + }, + "backgroundColor": { + "description": "The background color of the cell.", + "$ref": "Color" + }, + "padding": { + "$ref": "Padding", + "description": "The padding of the cell." + }, + "verticalAlignment": { + "enumDescriptions": [ + "The vertical alignment is not specified. Do not use this.", + "The text is explicitly aligned to the top of the cell.", + "The text is explicitly aligned to the middle of the cell.", + "The text is explicitly aligned to the bottom of the cell." + ], + "enum": [ + "VERTICAL_ALIGN_UNSPECIFIED", + "TOP", + "MIDDLE", + "BOTTOM" + ], + "description": "The vertical alignment of the value in the cell.", + "type": "string" + }, + "textDirection": { + "enumDescriptions": [ + "The text direction is not specified. Do not use this.", + "The text direction of left-to-right was set by the user.", + "The text direction of right-to-left was set by the user." + ], + "enum": [ + "TEXT_DIRECTION_UNSPECIFIED", + "LEFT_TO_RIGHT", + "RIGHT_TO_LEFT" + ], + "description": "The direction of the text in the cell.", + "type": "string" + }, + "borders": { + "$ref": "Borders", + "description": "The borders of the cell." + }, + "textRotation": { + "description": "The rotation applied to text in a cell", + "$ref": "TextRotation" + }, + "wrapStrategy": { + "description": "The wrap strategy for the value in the cell.", + "type": "string", + "enumDescriptions": [ + "The default value, do not use.", + "Lines that are longer than the cell width will be written in the next\ncell over, so long as that cell is empty. If the next cell over is\nnon-empty, this behaves the same as CLIP. The text will never wrap\nto the next line unless the user manually inserts a new line.\nExample:\n\n | First sentence. |\n | Manual newline that is very long. \u003c- Text continues into next cell\n | Next newline. |", + "This wrap strategy represents the old Google Sheets wrap strategy where\nwords that are longer than a line are clipped rather than broken. This\nstrategy is not supported on all platforms and is being phased out.\nExample:\n\n | Cell has a |\n | loooooooooo| \u003c- Word is clipped.\n | word. |", + "Lines that are longer than the cell width will be clipped.\nThe text will never wrap to the next line unless the user manually\ninserts a new line.\nExample:\n\n | First sentence. |\n | Manual newline t| \u003c- Text is clipped\n | Next newline. |", + "Words that are longer than a line are wrapped at the character level\nrather than clipped.\nExample:\n\n | Cell has a |\n | loooooooooo| \u003c- Word is broken.\n | ong word. |" + ], + "enum": [ + "WRAP_STRATEGY_UNSPECIFIED", + "OVERFLOW_CELL", + "LEGACY_WRAP", + "CLIP", + "WRAP" + ] + } + } + }, + "ClearValuesResponse": { + "id": "ClearValuesResponse", + "description": "The response when clearing a range of values in a spreadsheet.", + "type": "object", + "properties": { + "spreadsheetId": { + "description": "The spreadsheet the updates were applied to.", + "type": "string" + }, + "clearedRange": { + "description": "The range (in A1 notation) that was cleared.\n(If the request was for an unbounded range or a ranger larger\n than the bounds of the sheet, this will be the actual range\n that was cleared, bounded to the sheet's limits.)", + "type": "string" + } + } + }, + "DeleteConditionalFormatRuleRequest": { + "description": "Deletes a conditional format rule at the given index.\nAll subsequent rules' indexes are decremented.", + "type": "object", + "properties": { + "sheetId": { + "format": "int32", + "description": "The sheet the rule is being deleted from.", + "type": "integer" + }, + "index": { + "format": "int32", + "description": "The zero-based index of the rule to be deleted.", + "type": "integer" + } + }, + "id": "DeleteConditionalFormatRuleRequest" + }, + "DeleteNamedRangeRequest": { + "id": "DeleteNamedRangeRequest", + "description": "Removes the named range with the given ID from the spreadsheet.", + "type": "object", + "properties": { + "namedRangeId": { + "description": "The ID of the named range to delete.", + "type": "string" + } + } + }, + "AddBandingResponse": { + "description": "The result of adding a banded range.", + "type": "object", + "properties": { + "bandedRange": { + "description": "The banded range that was added.", + "$ref": "BandedRange" + } + }, + "id": "AddBandingResponse" + }, + "ChartData": { + "description": "The data included in a domain or series.", + "type": "object", + "properties": { + "sourceRange": { + "$ref": "ChartSourceRange", + "description": "The source ranges of the data." + } + }, + "id": "ChartData" + }, + "BatchGetValuesResponse": { + "description": "The response when retrieving more than one range of values in a spreadsheet.", + "type": "object", + "properties": { + "valueRanges": { + "description": "The requested values. The order of the ValueRanges is the same as the\norder of the requested ranges.", + "items": { + "$ref": "ValueRange" + }, + "type": "array" + }, + "spreadsheetId": { + "description": "The ID of the spreadsheet the data was retrieved from.", "type": "string" } }, - "id": "ErrorValue" + "id": "BatchGetValuesResponse" + }, + "UpdateBandingRequest": { + "description": "Updates properties of the supplied banded range.", + "type": "object", + "properties": { + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated. At least one field must be specified.\nThe root `bandedRange` is implied and should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + }, + "bandedRange": { + "$ref": "BandedRange", + "description": "The banded range to update with the new properties." + } + }, + "id": "UpdateBandingRequest" + }, + "Color": { + "id": "Color", + "description": "Represents a color in the RGBA color space. This representation is designed\nfor simplicity of conversion to/from color representations in various\nlanguages over compactness; for example, the fields of this representation\ncan be trivially provided to the constructor of \"java.awt.Color\" in Java; it\ncan also be trivially provided to UIColor's \"+colorWithRed:green:blue:alpha\"\nmethod in iOS; and, with just a little work, it can be easily formatted into\na CSS \"rgba()\" string in JavaScript, as well. Here are some examples:\n\nExample (Java):\n\n import com.google.type.Color;\n\n // ...\n public static java.awt.Color fromProto(Color protocolor) {\n float alpha = protocolor.hasAlpha()\n ? protocolor.getAlpha().getValue()\n : 1.0;\n\n return new java.awt.Color(\n protocolor.getRed(),\n protocolor.getGreen(),\n protocolor.getBlue(),\n alpha);\n }\n\n public static Color toProto(java.awt.Color color) {\n float red = (float) color.getRed();\n float green = (float) color.getGreen();\n float blue = (float) color.getBlue();\n float denominator = 255.0;\n Color.Builder resultBuilder =\n Color\n .newBuilder()\n .setRed(red / denominator)\n .setGreen(green / denominator)\n .setBlue(blue / denominator);\n int alpha = color.getAlpha();\n if (alpha != 255) {\n result.setAlpha(\n FloatValue\n .newBuilder()\n .setValue(((float) alpha) / denominator)\n .build());\n }\n return resultBuilder.build();\n }\n // ...\n\nExample (iOS / Obj-C):\n\n // ...\n static UIColor* fromProto(Color* protocolor) {\n float red = [protocolor red];\n float green = [protocolor green];\n float blue = [protocolor blue];\n FloatValue* alpha_wrapper = [protocolor alpha];\n float alpha = 1.0;\n if (alpha_wrapper != nil) {\n alpha = [alpha_wrapper value];\n }\n return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];\n }\n\n static Color* toProto(UIColor* color) {\n CGFloat red, green, blue, alpha;\n if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {\n return nil;\n }\n Color* result = [Color alloc] init];\n [result setRed:red];\n [result setGreen:green];\n [result setBlue:blue];\n if (alpha \u003c= 0.9999) {\n [result setAlpha:floatWrapperWithValue(alpha)];\n }\n [result autorelease];\n return result;\n }\n // ...\n\n Example (JavaScript):\n\n // ...\n\n var protoToCssColor = function(rgb_color) {\n var redFrac = rgb_color.red || 0.0;\n var greenFrac = rgb_color.green || 0.0;\n var blueFrac = rgb_color.blue || 0.0;\n var red = Math.floor(redFrac * 255);\n var green = Math.floor(greenFrac * 255);\n var blue = Math.floor(blueFrac * 255);\n\n if (!('alpha' in rgb_color)) {\n return rgbToCssColor_(red, green, blue);\n }\n\n var alphaFrac = rgb_color.alpha.value || 0.0;\n var rgbParams = [red, green, blue].join(',');\n return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');\n };\n\n var rgbToCssColor_ = function(red, green, blue) {\n var rgbNumber = new Number((red \u003c\u003c 16) | (green \u003c\u003c 8) | blue);\n var hexString = rgbNumber.toString(16);\n var missingZeros = 6 - hexString.length;\n var resultBuilder = ['#'];\n for (var i = 0; i \u003c missingZeros; i++) {\n resultBuilder.push('0');\n }\n resultBuilder.push(hexString);\n return resultBuilder.join('');\n };\n\n // ...", + "type": "object", + "properties": { + "alpha": { + "format": "float", + "description": "The fraction of this color that should be applied to the pixel. That is,\nthe final pixel color is defined by the equation:\n\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n\nThis means that a value of 1.0 corresponds to a solid color, whereas\na value of 0.0 corresponds to a completely transparent color. This\nuses a wrapper message rather than a simple float scalar so that it is\npossible to distinguish between a default value and the value being unset.\nIf omitted, this color object is to be rendered as a solid color\n(as if the alpha value had been explicitly given with a value of 1.0).", + "type": "number" + }, + "blue": { + "format": "float", + "description": "The amount of blue in the color as a value in the interval [0, 1].", + "type": "number" + }, + "green": { + "format": "float", + "description": "The amount of green in the color as a value in the interval [0, 1].", + "type": "number" + }, + "red": { + "format": "float", + "description": "The amount of red in the color as a value in the interval [0, 1].", + "type": "number" + } + } + }, + "PivotGroup": { + "id": "PivotGroup", + "description": "A single grouping (either row or column) in a pivot table.", + "type": "object", + "properties": { + "valueBucket": { + "description": "The bucket of the opposite pivot group to sort by.\nIf not specified, sorting is alphabetical by this group's values.", + "$ref": "PivotGroupSortValueBucket" + }, + "valueMetadata": { + "description": "Metadata about values in the grouping.", + "items": { + "$ref": "PivotGroupValueMetadata" + }, + "type": "array" + }, + "showTotals": { + "description": "True if the pivot table should include the totals for this grouping.", + "type": "boolean" + }, + "sourceColumnOffset": { + "format": "int32", + "description": "The column offset of the source range that this grouping is based on.\n\nFor example, if the source was `C10:E15`, a `sourceColumnOffset` of `0`\nmeans this group refers to column `C`, whereas the offset `1` would refer\nto column `D`.", + "type": "integer" + }, + "sortOrder": { + "description": "The order the values in this group should be sorted.", + "type": "string", + "enumDescriptions": [ + "Default value, do not use this.", + "Sort ascending.", + "Sort descending." + ], + "enum": [ + "SORT_ORDER_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ] + } + } + }, + "PivotTable": { + "id": "PivotTable", + "description": "A pivot table.", + "type": "object", + "properties": { + "criteria": { + "additionalProperties": { + "$ref": "PivotFilterCriteria" + }, + "description": "An optional mapping of filters per source column offset.\n\nThe filters will be applied before aggregating data into the pivot table.\nThe map's key is the column offset of the source range that you want to\nfilter, and the value is the criteria for that column.\n\nFor example, if the source was `C10:E15`, a key of `0` will have the filter\nfor column `C`, whereas the key `1` is for column `D`.", + "type": "object" + }, + "rows": { + "description": "Each row grouping in the pivot table.", + "items": { + "$ref": "PivotGroup" + }, + "type": "array" + }, + "valueLayout": { + "description": "Whether values should be listed horizontally (as columns)\nor vertically (as rows).", + "type": "string", + "enumDescriptions": [ + "Values are laid out horizontally (as columns).", + "Values are laid out vertically (as rows)." + ], + "enum": [ + "HORIZONTAL", + "VERTICAL" + ] + }, + "columns": { + "description": "Each column grouping in the pivot table.", + "items": { + "$ref": "PivotGroup" + }, + "type": "array" + }, + "values": { + "description": "A list of values to include in the pivot table.", + "items": { + "$ref": "PivotValue" + }, + "type": "array" + }, + "source": { + "$ref": "GridRange", + "description": "The range the pivot table is reading data from." + } + } + }, + "ChartSourceRange": { + "id": "ChartSourceRange", + "description": "Source ranges for a chart.", + "type": "object", + "properties": { + "sources": { + "description": "The ranges of data for a series or domain.\nExactly one dimension must have a length of 1,\nand all sources in the list must have the same dimension\nwith length 1.\nThe domain (if it exists) & all series must have the same number\nof source ranges. If using more than one source range, then the source\nrange at a given offset must be contiguous across the domain and series.\n\nFor example, these are valid configurations:\n\n domain sources: A1:A5\n series1 sources: B1:B5\n series2 sources: D6:D10\n\n domain sources: A1:A5, C10:C12\n series1 sources: B1:B5, D10:D12\n series2 sources: C1:C5, E10:E12", + "items": { + "$ref": "GridRange" + }, + "type": "array" + } + } + }, + "SearchDeveloperMetadataResponse": { + "id": "SearchDeveloperMetadataResponse", + "description": "A reply to a developer metadata search request.", + "type": "object", + "properties": { + "matchedDeveloperMetadata": { + "description": "The metadata matching the criteria of the search request.", + "items": { + "$ref": "MatchedDeveloperMetadata" + }, + "type": "array" + } + } + }, + "AppendCellsRequest": { + "description": "Adds new cells after the last row with data in a sheet,\ninserting new rows into the sheet if necessary.", + "type": "object", + "properties": { + "sheetId": { + "format": "int32", + "description": "The sheet ID to append the data to.", + "type": "integer" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields of CellData that should be updated.\nAt least one field must be specified.\nThe root is the CellData; 'row.values.' should not be specified.\nA single `\"*\"` can be used as short-hand for listing every field.", + "type": "string" + }, + "rows": { + "description": "The data to append.", + "items": { + "$ref": "RowData" + }, + "type": "array" + } + }, + "id": "AppendCellsRequest" + }, + "ValueRange": { + "id": "ValueRange", + "description": "Data within a range of the spreadsheet.", + "type": "object", + "properties": { + "values": { + "description": "The data that was read or to be written. This is an array of arrays,\nthe outer array representing all the data and each inner array\nrepresenting a major dimension. Each item in the inner array\ncorresponds with one cell.\n\nFor output, empty trailing rows and columns will not be included.\n\nFor input, supported value types are: bool, string, and double.\nNull values will be skipped.\nTo set a cell to an empty value, set the string value to an empty string.", + "items": { + "items": { + "type": "any" + }, + "type": "array" + }, + "type": "array" + }, + "majorDimension": { + "enumDescriptions": [ + "The default value, do not use.", + "Operates on the rows of a sheet.", + "Operates on the columns of a sheet." + ], + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ], + "description": "The major dimension of the values.\n\nFor output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,\nthen requesting `range=A1:B2,majorDimension=ROWS` will return\n`[[1,2],[3,4]]`,\nwhereas requesting `range=A1:B2,majorDimension=COLUMNS` will return\n`[[1,3],[2,4]]`.\n\nFor input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]`\nwill set `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS`\nthen `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`.\n\nWhen writing, if this field is not set, it defaults to ROWS.", + "type": "string" + }, + "range": { + "description": "The range the values cover, in A1 notation.\nFor output, this range indicates the entire requested range,\neven though the values will exclude trailing rows and columns.\nWhen appending values, this field represents the range to search for a\ntable, after which values will be appended.", + "type": "string" + } + } + }, + "AddBandingRequest": { + "id": "AddBandingRequest", + "description": "Adds a new banded range to the spreadsheet.", + "type": "object", + "properties": { + "bandedRange": { + "$ref": "BandedRange", + "description": "The banded range to add. The bandedRangeId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a range that already exists.)" + } + } + }, + "Response": { + "description": "A single response from an update.", + "type": "object", + "properties": { + "updateEmbeddedObjectPosition": { + "description": "A reply from updating an embedded object's position.", + "$ref": "UpdateEmbeddedObjectPositionResponse" + }, + "deleteConditionalFormatRule": { + "$ref": "DeleteConditionalFormatRuleResponse", + "description": "A reply from deleting a conditional format rule." + }, + "duplicateFilterView": { + "$ref": "DuplicateFilterViewResponse", + "description": "A reply from duplicating a filter view." + }, + "addChart": { + "$ref": "AddChartResponse", + "description": "A reply from adding a chart." + }, + "updateDeveloperMetadata": { + "$ref": "UpdateDeveloperMetadataResponse", + "description": "A reply from updating a developer metadata entry." + }, + "findReplace": { + "$ref": "FindReplaceResponse", + "description": "A reply from doing a find/replace." + }, + "addSheet": { + "description": "A reply from adding a sheet.", + "$ref": "AddSheetResponse" + }, + "updateConditionalFormatRule": { + "description": "A reply from updating a conditional format rule.", + "$ref": "UpdateConditionalFormatRuleResponse" + }, + "createDeveloperMetadata": { + "description": "A reply from creating a developer metadata entry.", + "$ref": "CreateDeveloperMetadataResponse" + }, + "addNamedRange": { + "description": "A reply from adding a named range.", + "$ref": "AddNamedRangeResponse" + }, + "deleteDeveloperMetadata": { + "description": "A reply from deleting a developer metadata entry.", + "$ref": "DeleteDeveloperMetadataResponse" + }, + "addFilterView": { + "description": "A reply from adding a filter view.", + "$ref": "AddFilterViewResponse" + }, + "addBanding": { + "$ref": "AddBandingResponse", + "description": "A reply from adding a banded range." + }, + "addProtectedRange": { + "$ref": "AddProtectedRangeResponse", + "description": "A reply from adding a protected range." + }, + "duplicateSheet": { + "$ref": "DuplicateSheetResponse", + "description": "A reply from duplicating a sheet." + } + }, + "id": "Response" + }, + "EmbeddedChart": { + "id": "EmbeddedChart", + "description": "A chart embedded in a sheet.", + "type": "object", + "properties": { + "chartId": { + "format": "int32", + "description": "The ID of the chart.", + "type": "integer" + }, + "position": { + "description": "The position of the chart.", + "$ref": "EmbeddedObjectPosition" + }, + "spec": { + "description": "The specification of the chart.", + "$ref": "ChartSpec" + } + } + }, + "TextFormatRun": { + "description": "A run of a text format. The format of this run continues until the start\nindex of the next run.\nWhen updating, all fields must be set.", + "type": "object", + "properties": { + "format": { + "$ref": "TextFormat", + "description": "The format of this run. Absent values inherit the cell's format." + }, + "startIndex": { + "format": "int32", + "description": "The character index where this run starts.", + "type": "integer" + } + }, + "id": "TextFormatRun" + }, + "InsertRangeRequest": { + "id": "InsertRangeRequest", + "description": "Inserts cells into a range, shifting the existing cells over or down.", + "type": "object", + "properties": { + "shiftDimension": { + "enumDescriptions": [ + "The default value, do not use.", + "Operates on the rows of a sheet.", + "Operates on the columns of a sheet." + ], + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ], + "description": "The dimension which will be shifted when inserting cells.\nIf ROWS, existing cells will be shifted down.\nIf COLUMNS, existing cells will be shifted right.", + "type": "string" + }, + "range": { + "description": "The range to insert new cells into.", + "$ref": "GridRange" + } + } + }, + "AddNamedRangeResponse": { + "id": "AddNamedRangeResponse", + "description": "The result of adding a named range.", + "type": "object", + "properties": { + "namedRange": { + "description": "The named range to add.", + "$ref": "NamedRange" + } + } } }, - "protocol": "rest", "icons": { "x32": "http://www.google.com/images/icons/product/search-32.gif", "x16": "http://www.google.com/images/icons/product/search-16.gif" }, + "protocol": "rest", "canonicalName": "Sheets", "auth": { "oauth2": { "scopes": { - "https://www.googleapis.com/auth/drive.file": { - "description": "View and manage Google Drive files and folders that you have opened or created with this app" - }, - "https://www.googleapis.com/auth/drive": { - "description": "View and manage the files in your Google Drive" + "https://www.googleapis.com/auth/spreadsheets.readonly": { + "description": "View your Google Spreadsheets" }, "https://www.googleapis.com/auth/drive.readonly": { "description": "View the files in your Google Drive" }, - "https://www.googleapis.com/auth/spreadsheets.readonly": { - "description": "View your Google Spreadsheets" + "https://www.googleapis.com/auth/drive": { + "description": "View and manage the files in your Google Drive" }, "https://www.googleapis.com/auth/spreadsheets": { "description": "View and manage your spreadsheets in Google Drive" + }, + "https://www.googleapis.com/auth/drive.file": { + "description": "View and manage Google Drive files and folders that you have opened or created with this app" } } } @@ -4223,5 +5383,7 @@ "rootUrl": "https://sheets.googleapis.com/", "ownerDomain": "google.com", "name": "sheets", - "batchPath": "batch" + "batchPath": "batch", + "title": "Google Sheets API", + "ownerName": "Google" } diff --git a/etc/api/siteverification/v1/siteverification-api.json b/etc/api/siteverification/v1/siteverification-api.json index 15200ea1ba..566f04686c 100644 --- a/etc/api/siteverification/v1/siteverification-api.json +++ b/etc/api/siteverification/v1/siteverification-api.json @@ -20,7 +20,7 @@ "basePath": "/siteVerification/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "siteVerification/v1/", - "batchPath": "batch", + "batchPath": "batch/siteVerification/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/slides/v1/slides-api.json b/etc/api/slides/v1/slides-api.json index 34412a739b..cc737cafe2 100644 --- a/etc/api/slides/v1/slides-api.json +++ b/etc/api/slides/v1/slides-api.json @@ -1,11 +1,1063 @@ { "schemas": { - "Shape": { - "id": "Shape", - "description": "A PageElement kind representing a\ngeneric shape that does not have a more specific classification.", + "WeightedFontFamily": { + "description": "Represents a font family and weight used to style a TextRun.", "type": "object", + "properties": { + "weight": { + "format": "int32", + "description": "The rendered weight of the text. This field can have any value that is a\nmultiple of `100` between `100` and `900`, inclusive. This range\ncorresponds to the numerical values described in the CSS 2.1\nSpecification, [section 15.6](https://www.w3.org/TR/CSS21/fonts.html#font-boldness),\nwith non-numerical values disallowed. Weights greater than or equal to\n`700` are considered bold, and weights less than `700`are not bold. The\ndefault value is `400` (\"normal\").", + "type": "integer" + }, + "fontFamily": { + "description": "The font family of the text.\n\nThe font family can be any font from the Font menu in Slides or from\n[Google Fonts] (https://fonts.google.com/). If the font name is\nunrecognized, the text is rendered in `Arial`.", + "type": "string" + } + }, + "id": "WeightedFontFamily" + }, + "PageElement": { + "description": "A visual element rendered on a page.", + "type": "object", + "properties": { + "size": { + "description": "The size of the page element.", + "$ref": "Size" + }, + "sheetsChart": { + "$ref": "SheetsChart", + "description": "A linked chart embedded from Google Sheets. Unlinked charts are\nrepresented as images." + }, + "title": { + "description": "The title of the page element. Combined with description to display alt\ntext.", + "type": "string" + }, + "video": { + "description": "A video page element.", + "$ref": "Video" + }, + "wordArt": { + "$ref": "WordArt", + "description": "A word art page element." + }, + "table": { + "$ref": "Table", + "description": "A table page element." + }, + "objectId": { + "description": "The object ID for this page element. Object IDs used by\ngoogle.apps.slides.v1.Page and\ngoogle.apps.slides.v1.PageElement share the same namespace.", + "type": "string" + }, + "transform": { + "$ref": "AffineTransform", + "description": "The transform of the page element.\n\nThe visual appearance of the page element is determined by its absolute\ntransform. To compute the absolute transform, preconcatenate a page\nelement's transform with the transforms of all of its parent groups. If the\npage element is not in a group, its absolute transform is the same as the\nvalue in this field.\n\nThe initial transform for the newly created Group is always the identity transform." + }, + "shape": { + "$ref": "Shape", + "description": "A generic shape." + }, + "line": { + "$ref": "Line", + "description": "A line page element." + }, + "description": { + "description": "The description of the page element. Combined with title to display alt\ntext.", + "type": "string" + }, + "elementGroup": { + "$ref": "Group", + "description": "A collection of page elements joined as a single unit." + }, + "image": { + "$ref": "Image", + "description": "An image page element." + } + }, + "id": "PageElement" + }, + "CreateImageRequest": { + "description": "Creates an image.", + "type": "object", + "properties": { + "objectId": { + "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", + "type": "string" + }, + "elementProperties": { + "description": "The element properties for the image.\n\nWhen the aspect ratio of the provided size does not match the image aspect\nratio, the image is scaled and centered with respect to the size in order\nto maintain aspect ratio. The provided transform is applied after this\noperation.", + "$ref": "PageElementProperties" + }, + "url": { + "description": "The image URL.\n\nThe image is fetched once at insertion time and a copy is stored for\ndisplay inside the presentation. Images must be less than 50MB in size,\ncannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF\nformat.\n\nThe provided URL can be at maximum 2K bytes large.", + "type": "string" + } + }, + "id": "CreateImageRequest" + }, + "CreateParagraphBulletsRequest": { + "properties": { + "textRange": { + "description": "The range of text to apply the bullet presets to, based on TextElement indexes.", + "$ref": "Range" + }, + "objectId": { + "description": "The object ID of the shape or table containing the text to add bullets to.", + "type": "string" + }, + "bulletPreset": { + "description": "The kinds of bullet glyphs to be used. Defaults to the\n`BULLET_DISC_CIRCLE_SQUARE` preset.", + "type": "string", + "enumDescriptions": [ + "A bulleted list with a `DISC`, `CIRCLE` and `SQUARE` bullet glyph for the\nfirst 3 list nesting levels.", + "A bulleted list with a `DIAMONDX`, `ARROW3D` and `SQUARE` bullet glyph for\nthe first 3 list nesting levels.", + "A bulleted list with `CHECKBOX` bullet glyphs for all list nesting levels.", + "A bulleted list with a `ARROW`, `DIAMOND` and `DISC` bullet glyph for\nthe first 3 list nesting levels.", + "A bulleted list with a `STAR`, `CIRCLE` and `SQUARE` bullet glyph for\nthe first 3 list nesting levels.", + "A bulleted list with a `ARROW3D`, `CIRCLE` and `SQUARE` bullet glyph for\nthe first 3 list nesting levels.", + "A bulleted list with a `LEFTTRIANGLE`, `DIAMOND` and `DISC` bullet glyph\nfor the first 3 list nesting levels.", + "A bulleted list with a `DIAMONDX`, `HOLLOWDIAMOND` and `SQUARE` bullet\nglyph for the first 3 list nesting levels.", + "A bulleted list with a `DIAMOND`, `CIRCLE` and `SQUARE` bullet glyph\nfor the first 3 list nesting levels.", + "A numbered list with `DIGIT`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by periods.", + "A numbered list with `DIGIT`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by parenthesis.", + "A numbered list with `DIGIT` numeric glyphs separated by periods, where\neach nesting level uses the previous nesting level's glyph as a prefix.\nFor example: '1.', '1.1.', '2.', '2.2.'.", + "A numbered list with `UPPERALPHA`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by periods.", + "A numbered list with `UPPERROMAN`, `UPPERALPHA` and `DIGIT` numeric glyphs\nfor the first 3 list nesting levels, followed by periods.", + "A numbered list with `ZERODIGIT`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by periods." + ], + "enum": [ + "BULLET_DISC_CIRCLE_SQUARE", + "BULLET_DIAMONDX_ARROW3D_SQUARE", + "BULLET_CHECKBOX", + "BULLET_ARROW_DIAMOND_DISC", + "BULLET_STAR_CIRCLE_SQUARE", + "BULLET_ARROW3D_CIRCLE_SQUARE", + "BULLET_LEFTTRIANGLE_DIAMOND_DISC", + "BULLET_DIAMONDX_HOLLOWDIAMOND_SQUARE", + "BULLET_DIAMOND_CIRCLE_SQUARE", + "NUMBERED_DIGIT_ALPHA_ROMAN", + "NUMBERED_DIGIT_ALPHA_ROMAN_PARENS", + "NUMBERED_DIGIT_NESTED", + "NUMBERED_UPPERALPHA_ALPHA_ROMAN", + "NUMBERED_UPPERROMAN_UPPERALPHA_DIGIT", + "NUMBERED_ZERODIGIT_ALPHA_ROMAN" + ] + }, + "cellLocation": { + "$ref": "TableCellLocation", + "description": "The optional table cell location if the text to be modified is in a table\ncell. If present, the object_id must refer to a table." + } + }, + "id": "CreateParagraphBulletsRequest", + "description": "Creates bullets for all of the paragraphs that overlap with the given\ntext index range.\n\nThe nesting level of each paragraph will be determined by counting leading\ntabs in front of each paragraph. To avoid excess space between the bullet and\nthe corresponding paragraph, these leading tabs are removed by this request.\nThis may change the indices of parts of the text.\n\nIf the paragraph immediately before paragraphs being updated is in a list\nwith a matching preset, the paragraphs being updated are added to that\npreceding list.", + "type": "object" + }, + "Size": { + "properties": { + "height": { + "description": "The height of the object.", + "$ref": "Dimension" + }, + "width": { + "$ref": "Dimension", + "description": "The width of the object." + } + }, + "id": "Size", + "description": "A width and height.", + "type": "object" + }, + "TextStyle": { + "type": "object", + "properties": { + "baselineOffset": { + "enumDescriptions": [ + "The text's baseline offset is inherited from the parent.", + "The text is not vertically offset.", + "The text is vertically offset upwards (superscript).", + "The text is vertically offset downwards (subscript)." + ], + "enum": [ + "BASELINE_OFFSET_UNSPECIFIED", + "NONE", + "SUPERSCRIPT", + "SUBSCRIPT" + ], + "description": "The text's vertical offset from its normal position.\n\nText with `SUPERSCRIPT` or `SUBSCRIPT` baseline offsets is automatically\nrendered in a smaller font size, computed based on the `font_size` field.\nThe `font_size` itself is not affected by changes in this field.", + "type": "string" + }, + "weightedFontFamily": { + "$ref": "WeightedFontFamily", + "description": "The font family and rendered weight of the text.\n\nThis field is an extension of `font_family` meant to support explicit font\nweights without breaking backwards compatibility. As such, when reading the\nstyle of a range of text, the value of `weighted_font_family#font_family`\nwill always be equal to that of `font_family`. However, when writing, if\nboth fields are included in the field mask (either explicitly or through\nthe wildcard `\"*\"`), their values are reconciled as follows:\n\n* If `font_family` is set and `weighted_font_family` is not, the value of\n `font_family` is applied with weight `400` (\"normal\").\n* If both fields are set, the value of `font_family` must match that of\n `weighted_font_family#font_family`. If so, the font family and weight of\n `weighted_font_family` is applied. Otherwise, a 400 bad request error is\n returned.\n* If `weighted_font_family` is set and `font_family` is not, the font\n family and weight of `weighted_font_family` is applied.\n* If neither field is set, the font family and weight of the text inherit\n from the parent. Note that these properties cannot inherit separately\n from each other.\n\nIf an update request specifies values for both `weighted_font_family` and\n`bold`, the `weighted_font_family` is applied first, then `bold`.\n\nIf `weighted_font_family#weight` is not set, it defaults to `400`.\n\nIf `weighted_font_family` is set, then `weighted_font_family#font_family`\nmust also be set with a non-empty value. Otherwise, a 400 bad request error\nis returned." + }, + "smallCaps": { + "type": "boolean", + "description": "Whether or not the text is in small capital letters." + }, + "backgroundColor": { + "$ref": "OptionalColor", + "description": "The background color of the text. If set, the color is either opaque or\ntransparent, depending on if the `opaque_color` field in it is set." + }, + "link": { + "$ref": "Link", + "description": "The hyperlink destination of the text. If unset, there is no link. Links\nare not inherited from parent text.\n\nChanging the link in an update request causes some other changes to the\ntext style of the range:\n\n* When setting a link, the text foreground color will be set to\n ThemeColorType.HYPERLINK and the text will\n be underlined. If these fields are modified in the same\n request, those values will be used instead of the link defaults.\n* Setting a link on a text range that overlaps with an existing link will\n also update the existing link to point to the new URL.\n* Links are not settable on newline characters. As a result, setting a link\n on a text range that crosses a paragraph boundary, such as `\"ABC\\n123\"`,\n will separate the newline character(s) into their own text runs. The\n link will be applied separately to the runs before and after the newline.\n* Removing a link will update the text style of the range to match the\n style of the preceding text (or the default text styles if the preceding\n text is another link) unless different styles are being set in the same\n request." + }, + "underline": { + "description": "Whether or not the text is underlined.", + "type": "boolean" + }, + "bold": { + "description": "Whether or not the text is rendered as bold.", + "type": "boolean" + }, + "foregroundColor": { + "$ref": "OptionalColor", + "description": "The color of the text itself. If set, the color is either opaque or\ntransparent, depending on if the `opaque_color` field in it is set." + }, + "fontFamily": { + "description": "The font family of the text.\n\nThe font family can be any font from the Font menu in Slides or from\n[Google Fonts] (https://fonts.google.com/). If the font name is\nunrecognized, the text is rendered in `Arial`.\n\nSome fonts can affect the weight of the text. If an update request\nspecifies values for both `font_family` and `bold`, the explicitly-set\n`bold` value is used.", + "type": "string" + }, + "italic": { + "description": "Whether or not the text is italicized.", + "type": "boolean" + }, + "strikethrough": { + "description": "Whether or not the text is struck through.", + "type": "boolean" + }, + "fontSize": { + "description": "The size of the text's font. When read, the `font_size` will specified in\npoints.", + "$ref": "Dimension" + } + }, + "id": "TextStyle", + "description": "Represents the styling that can be applied to a TextRun.\n\nIf this text is contained in a shape with a parent placeholder, then these text styles may be\ninherited from the parent. Which text styles are inherited depend on the\nnesting level of lists:\n\n* A text run in a paragraph that is not in a list will inherit its text style\n from the the newline character in the paragraph at the 0 nesting level of\n the list inside the parent placeholder.\n* A text run in a paragraph that is in a list will inherit its text style\n from the newline character in the paragraph at its corresponding nesting\n level of the list inside the parent placeholder.\n\nInherited text styles are represented as unset fields in this message. If\ntext is contained in a shape without a parent placeholder, unsetting these\nfields will revert the style to a value matching the defaults in the Slides\neditor." + }, + "UpdateVideoPropertiesRequest": { + "properties": { + "videoProperties": { + "description": "The video properties to update.", + "$ref": "VideoProperties" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `videoProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the video outline color, set `fields` to\n`\"outline.outlineFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" + }, + "objectId": { + "description": "The object ID of the video the updates are applied to.", + "type": "string" + } + }, + "id": "UpdateVideoPropertiesRequest", + "description": "Update the properties of a Video.", + "type": "object" + }, + "Request": { + "id": "Request", + "description": "A single kind of update to apply to a presentation.", + "type": "object", + "properties": { + "updatePageElementTransform": { + "$ref": "UpdatePageElementTransformRequest", + "description": "Updates the transform of a page element." + }, + "updateTextStyle": { + "$ref": "UpdateTextStyleRequest", + "description": "Updates the styling of text within a Shape or Table." + }, + "replaceAllShapesWithImage": { + "description": "Replaces all shapes matching some criteria with an image.", + "$ref": "ReplaceAllShapesWithImageRequest" + }, + "replaceAllText": { + "$ref": "ReplaceAllTextRequest", + "description": "Replaces all instances of specified text." + }, + "updateImageProperties": { + "$ref": "UpdateImagePropertiesRequest", + "description": "Updates the properties of an Image." + }, + "createSlide": { + "description": "Creates a new slide.", + "$ref": "CreateSlideRequest" + }, + "insertTableRows": { + "$ref": "InsertTableRowsRequest", + "description": "Inserts rows into a table." + }, + "updateLineProperties": { + "$ref": "UpdateLinePropertiesRequest", + "description": "Updates the properties of a Line." + }, + "updateSlidesPosition": { + "$ref": "UpdateSlidesPositionRequest", + "description": "Updates the position of a set of slides in the presentation." + }, + "deleteTableRow": { + "$ref": "DeleteTableRowRequest", + "description": "Deletes a row from a table." + }, + "updateShapeProperties": { + "description": "Updates the properties of a Shape.", + "$ref": "UpdateShapePropertiesRequest" + }, + "insertText": { + "$ref": "InsertTextRequest", + "description": "Inserts text into a shape or table cell." + }, + "deleteText": { + "$ref": "DeleteTextRequest", + "description": "Deletes text from a shape or a table cell." + }, + "updatePageProperties": { + "description": "Updates the properties of a Page.", + "$ref": "UpdatePagePropertiesRequest" + }, + "deleteParagraphBullets": { + "$ref": "DeleteParagraphBulletsRequest", + "description": "Deletes bullets from paragraphs." + }, + "createShape": { + "$ref": "CreateShapeRequest", + "description": "Creates a new shape." + }, + "insertTableColumns": { + "$ref": "InsertTableColumnsRequest", + "description": "Inserts columns into a table." + }, + "refreshSheetsChart": { + "$ref": "RefreshSheetsChartRequest", + "description": "Refreshes a Google Sheets chart." + }, + "createTable": { + "description": "Creates a new table.", + "$ref": "CreateTableRequest" + }, + "updateTableCellProperties": { + "description": "Updates the properties of a TableCell.", + "$ref": "UpdateTableCellPropertiesRequest" + }, + "deleteObject": { + "$ref": "DeleteObjectRequest", + "description": "Deletes a page or page element from the presentation." + }, + "updateParagraphStyle": { + "description": "Updates the styling of paragraphs within a Shape or Table.", + "$ref": "UpdateParagraphStyleRequest" + }, + "deleteTableColumn": { + "$ref": "DeleteTableColumnRequest", + "description": "Deletes a column from a table." + }, + "duplicateObject": { + "$ref": "DuplicateObjectRequest", + "description": "Duplicates a slide or page element." + }, + "createLine": { + "description": "Creates a line.", + "$ref": "CreateLineRequest" + }, + "updateVideoProperties": { + "description": "Updates the properties of a Video.", + "$ref": "UpdateVideoPropertiesRequest" + }, + "createImage": { + "$ref": "CreateImageRequest", + "description": "Creates an image." + }, + "createParagraphBullets": { + "description": "Creates bullets for paragraphs.", + "$ref": "CreateParagraphBulletsRequest" + }, + "createVideo": { + "description": "Creates a video.", + "$ref": "CreateVideoRequest" + }, + "replaceAllShapesWithSheetsChart": { + "$ref": "ReplaceAllShapesWithSheetsChartRequest", + "description": "Replaces all shapes matching some criteria with a Google Sheets chart." + }, + "createSheetsChart": { + "description": "Creates an embedded Google Sheets chart.", + "$ref": "CreateSheetsChartRequest" + } + } + }, + "UpdateImagePropertiesRequest": { + "properties": { + "imageProperties": { + "$ref": "ImageProperties", + "description": "The image properties to update." + }, + "objectId": { + "description": "The object ID of the image the updates are applied to.", + "type": "string" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `imageProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the image outline color, set `fields` to\n`\"outline.outlineFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" + } + }, + "id": "UpdateImagePropertiesRequest", + "description": "Update the properties of an Image.", + "type": "object" + }, + "ParagraphStyle": { + "description": "Styles that apply to a whole paragraph.\n\nIf this text is contained in a shape with a parent placeholder, then these paragraph styles may be\ninherited from the parent. Which paragraph styles are inherited depend on the\nnesting level of lists:\n\n* A paragraph not in a list will inherit its paragraph style from the\n paragraph at the 0 nesting level of the list inside the parent placeholder.\n* A paragraph in a list will inherit its paragraph style from the paragraph\n at its corresponding nesting level of the list inside the parent\n placeholder.\n\nInherited paragraph styles are represented as unset fields in this message.", + "type": "object", + "properties": { + "indentFirstLine": { + "description": "The amount of indentation for the start of the first line of the paragraph.\nIf unset, the value is inherited from the parent.", + "$ref": "Dimension" + }, + "lineSpacing": { + "format": "float", + "description": "The amount of space between lines, as a percentage of normal, where normal\nis represented as 100.0. If unset, the value is inherited from the parent.", + "type": "number" + }, + "alignment": { + "enum": [ + "ALIGNMENT_UNSPECIFIED", + "START", + "CENTER", + "END", + "JUSTIFIED" + ], + "description": "The text alignment for this paragraph.", + "type": "string", + "enumDescriptions": [ + "The paragraph alignment is inherited from the parent.", + "The paragraph is aligned to the start of the line. Left-aligned for\nLTR text, right-aligned otherwise.", + "The paragraph is centered.", + "The paragraph is aligned to the end of the line. Right-aligned for\nLTR text, left-aligned otherwise.", + "The paragraph is justified." + ] + }, + "spaceBelow": { + "$ref": "Dimension", + "description": "The amount of extra space above the paragraph. If unset, the value is\ninherited from the parent." + }, + "direction": { + "description": "The text direction of this paragraph. If unset, the value defaults to\nLEFT_TO_RIGHT since\ntext direction is not inherited.", + "type": "string", + "enumDescriptions": [ + "The text direction is inherited from the parent.", + "The text goes from left to right.", + "The text goes from right to left." + ], + "enum": [ + "TEXT_DIRECTION_UNSPECIFIED", + "LEFT_TO_RIGHT", + "RIGHT_TO_LEFT" + ] + }, + "spacingMode": { + "enumDescriptions": [ + "The spacing mode is inherited from the parent.", + "Paragraph spacing is always rendered.", + "Paragraph spacing is skipped between list elements." + ], + "enum": [ + "SPACING_MODE_UNSPECIFIED", + "NEVER_COLLAPSE", + "COLLAPSE_LISTS" + ], + "description": "The spacing mode for the paragraph.", + "type": "string" + }, + "indentEnd": { + "$ref": "Dimension", + "description": "The amount indentation for the paragraph on the side that corresponds to\nthe end of the text, based on the current text direction. If unset, the\nvalue is inherited from the parent." + }, + "indentStart": { + "$ref": "Dimension", + "description": "The amount indentation for the paragraph on the side that corresponds to\nthe start of the text, based on the current text direction. If unset, the\nvalue is inherited from the parent." + }, + "spaceAbove": { + "$ref": "Dimension", + "description": "The amount of extra space above the paragraph. If unset, the value is\ninherited from the parent." + } + }, + "id": "ParagraphStyle" + }, + "ReplaceAllShapesWithSheetsChartResponse": { + "description": "The result of replacing shapes with a Google Sheets chart.", + "type": "object", + "properties": { + "occurrencesChanged": { + "format": "int32", + "description": "The number of shapes replaced with charts.", + "type": "integer" + } + }, + "id": "ReplaceAllShapesWithSheetsChartResponse" + }, + "TableCellProperties": { + "type": "object", + "properties": { + "tableCellBackgroundFill": { + "$ref": "TableCellBackgroundFill", + "description": "The background fill of the table cell. The default fill matches the fill\nfor newly created table cells in the Slides editor." + } + }, + "id": "TableCellProperties", + "description": "The properties of the TableCell." + }, + "Outline": { + "type": "object", + "properties": { + "outlineFill": { + "$ref": "OutlineFill", + "description": "The fill of the outline." + }, + "weight": { + "$ref": "Dimension", + "description": "The thickness of the outline." + }, + "dashStyle": { + "type": "string", + "enumDescriptions": [ + "Unspecified dash style.", + "Solid line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'solid'.\nThis is the default dash style.", + "Dotted line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dot'.", + "Dashed line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dash'.", + "Alternating dashes and dots. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'dashDot'.", + "Line with large dashes. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'lgDash'.", + "Alternating large dashes and dots. Corresponds to ECMA-376\nST_PresetLineDashVal value 'lgDashDot'." + ], + "enum": [ + "DASH_STYLE_UNSPECIFIED", + "SOLID", + "DOT", + "DASH", + "DASH_DOT", + "LONG_DASH", + "LONG_DASH_DOT" + ], + "description": "The dash style of the outline." + }, + "propertyState": { + "enumDescriptions": [ + "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", + "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", + "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." + ], + "enum": [ + "RENDERED", + "NOT_RENDERED", + "INHERIT" + ], + "description": "The outline property state.\n\nUpdating the the outline on a page element will implicitly update this\nfield to`RENDERED`, unless another value is specified in the same request.\nTo have no outline on a page element, set this field to `NOT_RENDERED`. In\nthis case, any other outline fields set in the same request will be\nignored.", + "type": "string" + } + }, + "id": "Outline", + "description": "The outline of a PageElement.\n\nIf these fields are unset, they may be inherited from a parent placeholder\nif it exists. If there is no parent, the fields will default to the value\nused for new page elements created in the Slides editor, which may depend on\nthe page element kind." + }, + "RefreshSheetsChartRequest": { + "id": "RefreshSheetsChartRequest", + "description": "Refreshes an embedded Google Sheets chart by replacing it with the latest\nversion of the chart from Google Sheets.\n\nNOTE: Refreshing charts requires at least one of the spreadsheets.readonly,\nspreadsheets, drive.readonly, or drive OAuth scopes.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the chart to refresh.", + "type": "string" + } + } + }, + "TableColumnProperties": { + "description": "Properties of each column in a table.", + "type": "object", + "properties": { + "columnWidth": { + "$ref": "Dimension", + "description": "Width of a column." + } + }, + "id": "TableColumnProperties" + }, + "ShapeProperties": { + "properties": { + "outline": { + "$ref": "Outline", + "description": "The outline of the shape. If unset, the outline is inherited from a\nparent placeholder if it exists. If the shape has no parent, then the\ndefault outline depends on the shape type, matching the defaults for\nnew shapes created in the Slides editor." + }, + "shadow": { + "description": "The shadow properties of the shape. If unset, the shadow is inherited from\na parent placeholder if it exists. If the shape has no parent, then the\ndefault shadow matches the defaults for new shapes created in the Slides\neditor. This property is read-only.", + "$ref": "Shadow" + }, + "shapeBackgroundFill": { + "$ref": "ShapeBackgroundFill", + "description": "The background fill of the shape. If unset, the background fill is\ninherited from a parent placeholder if it exists. If the shape has no\nparent, then the default background fill depends on the shape type,\nmatching the defaults for new shapes created in the Slides editor." + }, + "link": { + "description": "The hyperlink destination of the shape. If unset, there is no link. Links\nare not inherited from parent placeholders.", + "$ref": "Link" + } + }, + "id": "ShapeProperties", + "description": "The properties of a Shape.\n\nIf the shape is a placeholder shape as determined by the\nplaceholder field, then these\nproperties may be inherited from a parent placeholder shape.\nDetermining the rendered value of the property depends on the corresponding\nproperty_state field value.", + "type": "object" + }, + "NotesProperties": { + "type": "object", + "properties": { + "speakerNotesObjectId": { + "description": "The object ID of the shape on this notes page that contains the speaker\nnotes for the corresponding slide.\nThe actual shape may not always exist on the notes page. Inserting text\nusing this object ID will automatically create the shape. In this case, the\nactual shape may have different object ID. The `GetPresentation` or\n`GetPage` action will always return the latest object ID.", + "type": "string" + } + }, + "id": "NotesProperties", + "description": "The properties of Page that are only\nrelevant for pages with page_type NOTES." + }, + "TableRow": { + "description": "Properties and contents of each row in a table.", + "type": "object", + "properties": { + "tableCells": { + "description": "Properties and contents of each cell.\n\nCells that span multiple columns are represented only once with a\ncolumn_span greater\nthan 1. As a result, the length of this collection does not always match\nthe number of columns of the entire table.", + "items": { + "$ref": "TableCell" + }, + "type": "array" + }, + "rowHeight": { + "$ref": "Dimension", + "description": "Height of a row." + } + }, + "id": "TableRow" + }, + "UpdateTableCellPropertiesRequest": { + "description": "Update the properties of a TableCell.", + "type": "object", + "properties": { + "tableRange": { + "$ref": "TableRange", + "description": "The table range representing the subset of the table to which the updates\nare applied. If a table range is not specified, the updates will apply to\nthe entire table." + }, + "objectId": { + "description": "The object ID of the table.", + "type": "string" + }, + "tableCellProperties": { + "description": "The table cell properties to update.", + "$ref": "TableCellProperties" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `tableCellProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the table cell background solid fill color, set\n`fields` to `\"tableCellBackgroundFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" + } + }, + "id": "UpdateTableCellPropertiesRequest" + }, + "CreateSlideRequest": { + "description": "Creates a new slide.", + "type": "object", + "properties": { + "slideLayoutReference": { + "$ref": "LayoutReference", + "description": "Layout reference of the slide to be inserted, based on the *current\nmaster*, which is one of the following:\n\n- The master of the previous slide index.\n- The master of the first slide, if the insertion_index is zero.\n- The first master in the presentation, if there are no slides.\n\nIf the LayoutReference is not found in the current master, a 400 bad\nrequest error is returned.\n\nIf you don't specify a layout reference, then the new slide will use the\npredefined layout `BLANK`." + }, + "objectId": { + "type": "string", + "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated." + }, + "insertionIndex": { + "format": "int32", + "description": "The optional zero-based index indicating where to insert the slides.\n\nIf you don't specify an index, the new slide is created at the end.", + "type": "integer" + }, + "placeholderIdMappings": { + "description": "An optional list of object ID mappings from the placeholder(s) on the layout to the placeholder(s)\nthat will be created on the new slide from that specified layout. Can only\nbe used when `slide_layout_reference` is specified.", + "items": { + "$ref": "LayoutPlaceholderIdMapping" + }, + "type": "array" + } + }, + "id": "CreateSlideRequest" + }, + "BatchUpdatePresentationRequest": { + "description": "Request message for PresentationsService.BatchUpdatePresentation.", + "type": "object", + "properties": { + "writeControl": { + "description": "Provides control over how write requests are executed.", + "$ref": "WriteControl" + }, + "requests": { + "description": "A list of updates to apply to the presentation.", + "items": { + "$ref": "Request" + }, + "type": "array" + } + }, + "id": "BatchUpdatePresentationRequest" + }, + "TextContent": { + "description": "The general text content. The text must reside in a compatible shape (e.g.\ntext box or rectangle) or a table cell in a page.", + "type": "object", + "properties": { + "textElements": { + "description": "The text contents broken down into its component parts, including styling\ninformation. This property is read-only.", + "items": { + "$ref": "TextElement" + }, + "type": "array" + }, + "lists": { + "additionalProperties": { + "$ref": "List" + }, + "description": "The bulleted lists contained in this text, keyed by list ID.", + "type": "object" + } + }, + "id": "TextContent" + }, + "CreateSheetsChartResponse": { + "description": "The result of creating an embedded Google Sheets chart.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the created chart.", + "type": "string" + } + }, + "id": "CreateSheetsChartResponse" + }, + "WriteControl": { + "description": "Provides control over how write requests are executed.", + "type": "object", + "properties": { + "requiredRevisionId": { + "description": "The revision ID of the presentation required for the write request. If\nspecified and the `required_revision_id` doesn't exactly match the\npresentation's current `revision_id`, the request will not be processed and\nwill return a 400 bad request error.", + "type": "string" + } + }, + "id": "WriteControl" + }, + "DeleteParagraphBulletsRequest": { + "properties": { + "textRange": { + "description": "The range of text to delete bullets from, based on TextElement indexes.", + "$ref": "Range" + }, + "objectId": { + "description": "The object ID of the shape or table containing the text to delete bullets\nfrom.", + "type": "string" + }, + "cellLocation": { + "description": "The optional table cell location if the text to be modified is in a table\ncell. If present, the object_id must refer to a table.", + "$ref": "TableCellLocation" + } + }, + "id": "DeleteParagraphBulletsRequest", + "description": "Deletes bullets from all of the paragraphs that overlap with the given text\nindex range.\n\nThe nesting level of each paragraph will be visually preserved by adding\nindent to the start of the corresponding paragraph.", + "type": "object" + }, + "ParagraphMarker": { + "id": "ParagraphMarker", + "description": "A TextElement kind that represents the beginning of a new paragraph.", + "type": "object", + "properties": { + "style": { + "$ref": "ParagraphStyle", + "description": "The paragraph's style" + }, + "bullet": { + "description": "The bullet for this paragraph. If not present, the paragraph does not\nbelong to a list.", + "$ref": "Bullet" + } + } + }, + "Thumbnail": { + "description": "The thumbnail of a page.", + "type": "object", + "properties": { + "height": { + "format": "int32", + "description": "The positive height in pixels of the thumbnail image.", + "type": "integer" + }, + "contentUrl": { + "description": "The content URL of the thumbnail image.\n\nThe URL to the image has a default lifetime of 30 minutes.\nThis URL is tagged with the account of the requester. Anyone with the URL\neffectively accesses the image as the original requester. Access to the\nimage may be lost if the presentation's sharing settings change.\nThe mime type of the thumbnail image is the same as specified in the\n`GetPageThumbnailRequest`.", + "type": "string" + }, + "width": { + "format": "int32", + "description": "The positive width in pixels of the thumbnail image.", + "type": "integer" + } + }, + "id": "Thumbnail" + }, + "InsertTableColumnsRequest": { + "type": "object", + "properties": { + "number": { + "format": "int32", + "description": "The number of columns to be inserted. Maximum 20 per request.", + "type": "integer" + }, + "cellLocation": { + "$ref": "TableCellLocation", + "description": "The reference table cell location from which columns will be inserted.\n\nA new column will be inserted to the left (or right) of the column where\nthe reference cell is. If the reference cell is a merged cell, a new\ncolumn will be inserted to the left (or right) of the merged cell." + }, + "insertRight": { + "description": "Whether to insert new columns to the right of the reference cell location.\n\n- `True`: insert to the right.\n- `False`: insert to the left.", + "type": "boolean" + }, + "tableObjectId": { + "description": "The table to insert columns into.", + "type": "string" + } + }, + "id": "InsertTableColumnsRequest", + "description": "Inserts columns into a table.\n\nOther columns in the table will be resized to fit the new column." + }, + "LayoutPlaceholderIdMapping": { + "description": "The user-specified ID mapping for a placeholder that will be created on a\nslide from a specified layout.", + "type": "object", + "properties": { + "objectId": { + "description": "A user-supplied object ID for the placeholder identified above that to be\ncreated onto a slide.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", + "type": "string" + }, + "layoutPlaceholder": { + "$ref": "Placeholder", + "description": "The placeholder on a layout that will be applied to a slide. Only type and index are needed. For example, a\npredefined `TITLE_AND_BODY` layout may usually have a TITLE placeholder\nwith index 0 and a BODY placeholder with index 0." + }, + "layoutPlaceholderObjectId": { + "description": "The object ID of the placeholder on a layout that will be applied\nto a slide.", + "type": "string" + } + }, + "id": "LayoutPlaceholderIdMapping" + }, + "UpdateShapePropertiesRequest": { + "description": "Update the properties of a Shape.", + "type": "object", + "properties": { + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `shapeProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the shape background solid fill color, set `fields`\nto `\"shapeBackgroundFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" + }, + "objectId": { + "description": "The object ID of the shape the updates are applied to.", + "type": "string" + }, + "shapeProperties": { + "$ref": "ShapeProperties", + "description": "The shape properties to update." + } + }, + "id": "UpdateShapePropertiesRequest" + }, + "WordArt": { + "properties": { + "renderedText": { + "description": "The text rendered as word art.", + "type": "string" + } + }, + "id": "WordArt", + "description": "A PageElement kind representing\nword art.", + "type": "object" + }, + "Recolor": { + "description": "A recolor effect applied on an image.", + "type": "object", + "properties": { + "recolorStops": { + "description": "The recolor effect is represented by a gradient, which is a list of color\nstops.\n\nThe colors in the gradient will replace the corresponding colors at\nthe same position in the color palette and apply to the image. This\nproperty is read-only.", + "items": { + "$ref": "ColorStop" + }, + "type": "array" + }, + "name": { + "enumDescriptions": [ + "No recolor effect. The default value.", + "A recolor effect that lightens the image using the page's first available\ncolor from its color scheme.", + "A recolor effect that lightens the image using the page's second\navailable color from its color scheme.", + "A recolor effect that lightens the image using the page's third available\ncolor from its color scheme.", + "A recolor effect that lightens the image using the page's forth available\ncolor from its color scheme.", + "A recolor effect that lightens the image using the page's fifth available\ncolor from its color scheme.", + "A recolor effect that lightens the image using the page's sixth available\ncolor from its color scheme.", + "A recolor effect that lightens the image using the page's seventh\navailable color from its color scheme.e.", + "A recolor effect that lightens the image using the page's eighth\navailable color from its color scheme.", + "A recolor effect that lightens the image using the page's ninth available\ncolor from its color scheme.", + "A recolor effect that lightens the image using the page's tenth available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's first available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's second available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's third available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's fourth available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's fifth available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's sixth available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's seventh\navailable color from its color scheme.", + "A recolor effect that darkens the image using the page's eighth available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's ninth available\ncolor from its color scheme.", + "A recolor effect that darkens the image using the page's tenth available\ncolor from its color scheme.", + "A recolor effect that recolors the image to grayscale.", + "A recolor effect that recolors the image to negative grayscale.", + "A recolor effect that recolors the image using the sepia color.", + "Custom recolor effect. Refer to `recolor_stops` for the concrete\ngradient." + ], + "enum": [ + "NONE", + "LIGHT1", + "LIGHT2", + "LIGHT3", + "LIGHT4", + "LIGHT5", + "LIGHT6", + "LIGHT7", + "LIGHT8", + "LIGHT9", + "LIGHT10", + "DARK1", + "DARK2", + "DARK3", + "DARK4", + "DARK5", + "DARK6", + "DARK7", + "DARK8", + "DARK9", + "DARK10", + "GRAYSCALE", + "NEGATIVE", + "SEPIA", + "CUSTOM" + ], + "description": "The name of the recolor effect.\n\nThe name is determined from the `recolor_stops` by matching the gradient\nagainst the colors in the page's current color scheme. This property is\nread-only.", + "type": "string" + } + }, + "id": "Recolor" + }, + "Link": { + "type": "object", + "properties": { + "slideIndex": { + "format": "int32", + "description": "If set, indicates this is a link to the slide at this zero-based index\nin the presentation. There may not be a slide at this index.", + "type": "integer" + }, + "relativeLink": { + "enum": [ + "RELATIVE_SLIDE_LINK_UNSPECIFIED", + "NEXT_SLIDE", + "PREVIOUS_SLIDE", + "FIRST_SLIDE", + "LAST_SLIDE" + ], + "description": "If set, indicates this is a link to a slide in this presentation,\naddressed by its position.", + "type": "string", + "enumDescriptions": [ + "An unspecified relative slide link.", + "A link to the next slide.", + "A link to the previous slide.", + "A link to the first slide in the presentation.", + "A link to the last slide in the presentation." + ] + }, + "url": { + "description": "If set, indicates this is a link to the external web page at this URL.", + "type": "string" + }, + "pageObjectId": { + "description": "If set, indicates this is a link to the specific page in this\npresentation with this ID. A page with this ID may not exist.", + "type": "string" + } + }, + "id": "Link", + "description": "A hypertext link." + }, + "RgbColor": { + "description": "An RGB color.", + "type": "object", + "properties": { + "red": { + "format": "float", + "description": "The red component of the color, from 0.0 to 1.0.", + "type": "number" + }, + "blue": { + "format": "float", + "description": "The blue component of the color, from 0.0 to 1.0.", + "type": "number" + }, + "green": { + "format": "float", + "description": "The green component of the color, from 0.0 to 1.0.", + "type": "number" + } + }, + "id": "RgbColor" + }, + "CreateShapeResponse": { + "description": "The result of creating a shape.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the created shape.", + "type": "string" + } + }, + "id": "CreateShapeResponse" + }, + "CreateLineRequest": { + "properties": { + "objectId": { + "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", + "type": "string" + }, + "elementProperties": { + "$ref": "PageElementProperties", + "description": "The element properties for the line." + }, + "lineCategory": { + "enumDescriptions": [ + "Straight connectors, including straight connector 1. The is the default\ncategory when one is not specified.", + "Bent connectors, including bent connector 2 to 5.", + "Curved connectors, including curved connector 2 to 5." + ], + "enum": [ + "STRAIGHT", + "BENT", + "CURVED" + ], + "description": "The category of line to be created.", + "type": "string" + } + }, + "id": "CreateLineRequest", + "description": "Creates a line.", + "type": "object" + }, + "CreateSlideResponse": { + "description": "The result of creating a slide.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the created slide.", + "type": "string" + } + }, + "id": "CreateSlideResponse" + }, + "CreateShapeRequest": { "properties": { "shapeType": { + "type": "string", "enumDescriptions": [ "The shape type that is not predefined.", "Text box shape.", @@ -296,2226 +1348,964 @@ "CLOUD_CALLOUT", "CUSTOM" ], + "description": "The shape type." + }, + "objectId": { + "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\nIf empty, a unique identifier will be generated.", + "type": "string" + }, + "elementProperties": { + "$ref": "PageElementProperties", + "description": "The element properties for the shape." + } + }, + "id": "CreateShapeRequest", + "description": "Creates a new shape.", + "type": "object" + }, + "Video": { + "description": "A PageElement kind representing a\nvideo.", + "type": "object", + "properties": { + "source": { + "enumDescriptions": [ + "The video source is unspecified.", + "The video source is YouTube." + ], + "enum": [ + "SOURCE_UNSPECIFIED", + "YOUTUBE" + ], + "description": "The video source.", + "type": "string" + }, + "id": { + "description": "The video source's unique identifier for this video.", + "type": "string" + }, + "url": { + "description": "An URL to a video. The URL is valid as long as the source video\nexists and sharing settings do not change.", + "type": "string" + }, + "videoProperties": { + "$ref": "VideoProperties", + "description": "The properties of the video." + } + }, + "id": "Video" + }, + "PageProperties": { + "type": "object", + "properties": { + "colorScheme": { + "$ref": "ColorScheme", + "description": "The color scheme of the page. If unset, the color scheme is inherited from\na parent page. If the page has no parent, the color scheme uses a default\nSlides color scheme. This field is read-only." + }, + "pageBackgroundFill": { + "$ref": "PageBackgroundFill", + "description": "The background fill of the page. If unset, the background fill is inherited\nfrom a parent page if it exists. If the page has no parent, then the\nbackground fill defaults to the corresponding fill in the Slides editor." + } + }, + "id": "PageProperties", + "description": "The properties of the Page.\n\nThe page will inherit properties from the parent page. Depending on the page\ntype the hierarchy is defined in either\nSlideProperties or\nLayoutProperties." + }, + "NestingLevel": { + "properties": { + "bulletStyle": { + "$ref": "TextStyle", + "description": "The style of a bullet at this level of nesting." + } + }, + "id": "NestingLevel", + "description": "Contains properties describing the look and feel of a list bullet at a given\nlevel of nesting.", + "type": "object" + }, + "TableCell": { + "description": "Properties and contents of each table cell.", + "type": "object", + "properties": { + "columnSpan": { + "format": "int32", + "description": "Column span of the cell.", + "type": "integer" + }, + "text": { + "description": "The text content of the cell.", + "$ref": "TextContent" + }, + "tableCellProperties": { + "description": "The properties of the table cell.", + "$ref": "TableCellProperties" + }, + "rowSpan": { + "format": "int32", + "description": "Row span of the cell.", + "type": "integer" + }, + "location": { + "description": "The location of the cell within the table.", + "$ref": "TableCellLocation" + } + }, + "id": "TableCell" + }, + "UpdateLinePropertiesRequest": { + "description": "Updates the properties of a Line.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the line the update is applied to.", + "type": "string" + }, + "lineProperties": { + "description": "The line properties to update.", + "$ref": "LineProperties" + }, + "fields": { + "type": "string", + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `lineProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the line solid fill color, set `fields` to\n`\"lineFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset." + } + }, + "id": "UpdateLinePropertiesRequest" + }, + "UpdateSlidesPositionRequest": { + "description": "Updates the position of slides in the presentation.", + "type": "object", + "properties": { + "slideObjectIds": { + "description": "The IDs of the slides in the presentation that should be moved.\nThe slides in this list must be in existing presentation order, without\nduplicates.", + "items": { + "type": "string" + }, + "type": "array" + }, + "insertionIndex": { + "format": "int32", + "description": "The index where the slides should be inserted, based on the slide\narrangement before the move takes place. Must be between zero and the\nnumber of slides in the presentation, inclusive.", + "type": "integer" + } + }, + "id": "UpdateSlidesPositionRequest" + }, + "TableCellBackgroundFill": { + "description": "The table cell background fill.", + "type": "object", + "properties": { + "propertyState": { + "description": "The background fill property state.\n\nUpdating the the fill on a table cell will implicitly update this field\nto `RENDERED`, unless another value is specified in the same request. To\nhave no fill on a table cell, set this field to `NOT_RENDERED`. In this\ncase, any other fill fields set in the same request will be ignored.", + "type": "string", + "enumDescriptions": [ + "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", + "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", + "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." + ], + "enum": [ + "RENDERED", + "NOT_RENDERED", + "INHERIT" + ] + }, + "solidFill": { + "$ref": "SolidFill", + "description": "Solid color fill." + } + }, + "id": "TableCellBackgroundFill" + }, + "UpdatePagePropertiesRequest": { + "description": "Updates the properties of a Page.", + "type": "object", + "properties": { + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `pageProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the page background solid fill color, set `fields`\nto `\"pageBackgroundFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" + }, + "pageProperties": { + "description": "The page properties to update.", + "$ref": "PageProperties" + }, + "objectId": { + "description": "The object ID of the page the update is applied to.", + "type": "string" + } + }, + "id": "UpdatePagePropertiesRequest" + }, + "Group": { + "id": "Group", + "description": "A PageElement kind representing a\njoined collection of PageElements.", + "type": "object", + "properties": { + "children": { + "description": "The collection of elements in the group. The minimum size of a group is 2.", + "items": { + "$ref": "PageElement" + }, + "type": "array" + } + } + }, + "Placeholder": { + "description": "The placeholder information that uniquely identifies a placeholder shape.", + "type": "object", + "properties": { + "index": { + "format": "int32", + "description": "The index of the placeholder. If the same placeholder types are present in\nthe same page, they would have different index values.", + "type": "integer" + }, + "type": { + "enumDescriptions": [ + "Default value, signifies it is not a placeholder.", + "Body text.", + "Chart or graph.", + "Clip art image.", + "Title centered.", + "Diagram.", + "Date and time.", + "Footer text.", + "Header text.", + "Multimedia.", + "Any content type.", + "Picture.", + "Number of a slide.", + "Subtitle.", + "Table.", + "Slide title.", + "Slide image." + ], + "enum": [ + "NONE", + "BODY", + "CHART", + "CLIP_ART", + "CENTERED_TITLE", + "DIAGRAM", + "DATE_AND_TIME", + "FOOTER", + "HEADER", + "MEDIA", + "OBJECT", + "PICTURE", + "SLIDE_NUMBER", + "SUBTITLE", + "TABLE", + "TITLE", + "SLIDE_IMAGE" + ], + "description": "The type of the placeholder.", + "type": "string" + }, + "parentObjectId": { + "description": "The object ID of this shape's parent placeholder.\nIf unset, the parent placeholder shape does not exist, so the shape does\nnot inherit properties from any other shape.", + "type": "string" + } + }, + "id": "Placeholder" + }, + "DuplicateObjectRequest": { + "description": "Duplicates a slide or page element.\n\nWhen duplicating a slide, the duplicate slide will be created immediately\nfollowing the specified slide. When duplicating a page element, the duplicate\nwill be placed on the same page at the same position as the original.", + "type": "object", + "properties": { + "objectId": { + "type": "string", + "description": "The ID of the object to duplicate." + }, + "objectIds": { + "additionalProperties": { + "type": "string" + }, + "description": "The object being duplicated may contain other objects, for example when\nduplicating a slide or a group page element. This map defines how the IDs\nof duplicated objects are generated: the keys are the IDs of the original\nobjects and its values are the IDs that will be assigned to the\ncorresponding duplicate object. The ID of the source object's duplicate\nmay be specified in this map as well, using the same value of the\n`object_id` field as a key and the newly desired ID as the value.\n\nAll keys must correspond to existing IDs in the presentation. All values\nmust be unique in the presentation and must start with an alphanumeric\ncharacter or an underscore (matches regex `[a-zA-Z0-9_]`); remaining\ncharacters may include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`). The length of the new ID must not be less than 5 or\ngreater than 50.\n\nIf any IDs of source objects are omitted from the map, a new random ID will\nbe assigned. If the map is empty or unset, all duplicate objects will\nreceive a new random ID.", + "type": "object" + } + }, + "id": "DuplicateObjectRequest" + }, + "ReplaceAllTextRequest": { + "description": "Replaces all instances of text matching a criteria with replace text.", + "type": "object", + "properties": { + "containsText": { + "$ref": "SubstringMatchCriteria", + "description": "Finds text in a shape matching this substring." + }, + "pageObjectIds": { + "description": "If non-empty, limits the matches to page elements only on the given pages.\n\nReturns a 400 bad request error if given the page object ID of a\nnotes master,\nor if a page with that object ID doesn't exist in the presentation.", + "items": { + "type": "string" + }, + "type": "array" + }, + "replaceText": { + "description": "The text that will replace the matched text.", + "type": "string" + } + }, + "id": "ReplaceAllTextRequest" + }, + "Page": { + "description": "A page in a presentation.", + "type": "object", + "properties": { + "layoutProperties": { + "$ref": "LayoutProperties", + "description": "Layout specific properties. Only set if page_type = LAYOUT." + }, + "pageElements": { + "description": "The page elements rendered on the page.", + "items": { + "$ref": "PageElement" + }, + "type": "array" + }, + "pageType": { + "enum": [ + "SLIDE", + "MASTER", + "LAYOUT", + "NOTES", + "NOTES_MASTER" + ], + "description": "The type of the page.", + "type": "string", + "enumDescriptions": [ + "A slide page.", + "A master slide page.", + "A layout page.", + "A notes page.", + "A notes master page." + ] + }, + "notesProperties": { + "$ref": "NotesProperties", + "description": "Notes specific properties. Only set if page_type = NOTES." + }, + "pageProperties": { + "$ref": "PageProperties", + "description": "The properties of the page." + }, + "slideProperties": { + "description": "Slide specific properties. Only set if page_type = SLIDE.", + "$ref": "SlideProperties" + }, + "masterProperties": { + "$ref": "MasterProperties", + "description": "Master specific properties. Only set if page_type = MASTER." + }, + "objectId": { + "description": "The object ID for this page. Object IDs used by\nPage and\nPageElement share the same namespace.", + "type": "string" + }, + "revisionId": { + "description": "The revision ID of the presentation containing this page. Can be used in\nupdate requests to assert that the presentation revision hasn't changed\nsince the last read operation. Only populated if the user has edit access\nto the presentation.\n\nThe format of the revision ID may change over time, so it should be treated\nopaquely. A returned revision ID is only guaranteed to be valid for 24\nhours after it has been returned and cannot be shared across users. If the\nrevision ID is unchanged between calls, then the presentation has not\nchanged. Conversely, a changed ID (for the same presentation and user)\nusually means the presentation has been updated; however, a changed ID can\nalso be due to internal factors such as ID format changes.", + "type": "string" + } + }, + "id": "Page" + }, + "ShapeBackgroundFill": { + "description": "The shape background fill.", + "type": "object", + "properties": { + "solidFill": { + "$ref": "SolidFill", + "description": "Solid color fill." + }, + "propertyState": { + "enum": [ + "RENDERED", + "NOT_RENDERED", + "INHERIT" + ], + "description": "The background fill property state.\n\nUpdating the the fill on a shape will implicitly update this field to\n`RENDERED`, unless another value is specified in the same request. To\nhave no fill on a shape, set this field to `NOT_RENDERED`. In this case,\nany other fill fields set in the same request will be ignored.", + "type": "string", + "enumDescriptions": [ + "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", + "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", + "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." + ] + } + }, + "id": "ShapeBackgroundFill" + }, + "CropProperties": { + "description": "The crop properties of an object enclosed in a container. For example, an\nImage.\n\nThe crop properties is represented by the offsets of four edges which define\na crop rectangle. The offsets are measured in percentage from the\ncorresponding edges of the object's original bounding rectangle towards\ninside, relative to the object's original dimensions.\n\n- If the offset is in the interval (0, 1), the corresponding edge of crop\nrectangle is positioned inside of the object's original bounding rectangle.\n- If the offset is negative or greater than 1, the corresponding edge of crop\nrectangle is positioned outside of the object's original bounding rectangle.\n- If the left edge of the crop rectangle is on the right side of its right\nedge, the object will be flipped horizontally.\n- If the top edge of the crop rectangle is below its bottom edge, the object\nwill be flipped vertically.\n- If all offsets and rotation angle is 0, the object is not cropped.\n\nAfter cropping, the content in the crop rectangle will be stretched to fit\nits container.", + "type": "object", + "properties": { + "angle": { + "format": "float", + "description": "The rotation angle of the crop window around its center, in radians.\nRotation angle is applied after the offset.", + "type": "number" + }, + "topOffset": { + "type": "number", + "format": "float", + "description": "The offset specifies the top edge of the crop rectangle that is located\nbelow the original bounding rectangle top edge, relative to the object's\noriginal height." + }, + "leftOffset": { + "format": "float", + "description": "The offset specifies the left edge of the crop rectangle that is located to\nthe right of the original bounding rectangle left edge, relative to the\nobject's original width.", + "type": "number" + }, + "rightOffset": { + "format": "float", + "description": "The offset specifies the right edge of the crop rectangle that is located\nto the left of the original bounding rectangle right edge, relative to the\nobject's original width.", + "type": "number" + }, + "bottomOffset": { + "type": "number", + "format": "float", + "description": "The offset specifies the bottom edge of the crop rectangle that is located\nabove the original bounding rectangle bottom edge, relative to the object's\noriginal height." + } + }, + "id": "CropProperties" + }, + "ReplaceAllShapesWithSheetsChartRequest": { + "properties": { + "linkingMode": { + "type": "string", + "enumDescriptions": [ + "The chart is not associated with the source spreadsheet and cannot be\nupdated. A chart that is not linked will be inserted as an image.", + "Linking the chart allows it to be updated, and other collaborators will\nsee a link to the spreadsheet." + ], + "enum": [ + "NOT_LINKED_IMAGE", + "LINKED" + ], + "description": "The mode with which the chart is linked to the source spreadsheet. When\nnot specified, the chart will be an image that is not linked." + }, + "spreadsheetId": { + "description": "The ID of the Google Sheets spreadsheet that contains the chart.", + "type": "string" + }, + "pageObjectIds": { + "description": "If non-empty, limits the matches to page elements only on the given pages.\n\nReturns a 400 bad request error if given the page object ID of a\nnotes page or a\nnotes master, or if a\npage with that object ID doesn't exist in the presentation.", + "items": { + "type": "string" + }, + "type": "array" + }, + "chartId": { + "format": "int32", + "description": "The ID of the specific chart in the Google Sheets spreadsheet.", + "type": "integer" + }, + "containsText": { + "$ref": "SubstringMatchCriteria", + "description": "The criteria that the shapes must match in order to be replaced. The\nrequest will replace all of the shapes that contain the given text." + } + }, + "id": "ReplaceAllShapesWithSheetsChartRequest", + "description": "Replaces all shapes that match the given criteria with the provided Google\nSheets chart. The chart will be scaled and centered to fit within the bounds\nof the original shape.\n\nNOTE: Replacing shapes with a chart requires at least one of the\nspreadsheets.readonly, spreadsheets, drive.readonly, or drive OAuth scopes.", + "type": "object" + }, + "Range": { + "description": "Specifies a contiguous range of an indexed collection, such as characters in\ntext.", + "type": "object", + "properties": { + "endIndex": { + "format": "int32", + "description": "The optional zero-based index of the end of the collection.\nRequired for `FIXED_RANGE` ranges.", + "type": "integer" + }, + "startIndex": { + "format": "int32", + "description": "The optional zero-based index of the beginning of the collection.\nRequired for `FIXED_RANGE` and `FROM_START_INDEX` ranges.", + "type": "integer" + }, + "type": { + "description": "The type of range.", + "type": "string", + "enumDescriptions": [ + "Unspecified range type. This value must not be used.", + "A fixed range. Both the `start_index` and\n`end_index` must be specified.", + "Starts the range at `start_index` and continues until the\nend of the collection. The `end_index` must not be specified.", + "Sets the range to be the whole length of the collection. Both the\n`start_index` and the `end_index` must not be\nspecified." + ], + "enum": [ + "RANGE_TYPE_UNSPECIFIED", + "FIXED_RANGE", + "FROM_START_INDEX", + "ALL" + ] + } + }, + "id": "Range" + }, + "ColorStop": { + "id": "ColorStop", + "description": "A color and position in a gradient band.", + "type": "object", + "properties": { + "position": { + "format": "float", + "description": "The relative position of the color stop in the gradient band measured\nin percentage. The value should be in the interval [0.0, 1.0].", + "type": "number" + }, + "alpha": { + "format": "float", + "description": "The alpha value of this color in the gradient band. Defaults to 1.0,\nfully opaque.", + "type": "number" + }, + "color": { + "description": "The color of the gradient stop.", + "$ref": "OpaqueColor" + } + } + }, + "CreateVideoRequest": { + "description": "Creates a video.", + "type": "object", + "properties": { + "source": { + "type": "string", + "enumDescriptions": [ + "The video source is unspecified.", + "The video source is YouTube." + ], + "enum": [ + "SOURCE_UNSPECIFIED", + "YOUTUBE" + ], + "description": "The video source." + }, + "objectId": { + "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", + "type": "string" + }, + "elementProperties": { + "$ref": "PageElementProperties", + "description": "The element properties for the video." + }, + "id": { + "description": "The video source's unique identifier for this video.\n\ne.g. For YouTube video https://www.youtube.com/watch?v=7U3axjORYZ0,\nthe ID is 7U3axjORYZ0.", + "type": "string" + } + }, + "id": "CreateVideoRequest" + }, + "DuplicateObjectResponse": { + "type": "object", + "properties": { + "objectId": { + "description": "The ID of the new duplicate object.", + "type": "string" + } + }, + "id": "DuplicateObjectResponse", + "description": "The response of duplicating an object." + }, + "ReplaceAllShapesWithImageRequest": { + "description": "Replaces all shapes that match the given criteria with the provided image.", + "type": "object", + "properties": { + "pageObjectIds": { + "description": "If non-empty, limits the matches to page elements only on the given pages.\n\nReturns a 400 bad request error if given the page object ID of a\nnotes page or a\nnotes master, or if a\npage with that object ID doesn't exist in the presentation.", + "items": { + "type": "string" + }, + "type": "array" + }, + "containsText": { + "$ref": "SubstringMatchCriteria", + "description": "If set, this request will replace all of the shapes that contain the\ngiven text." + }, + "imageUrl": { + "description": "The image URL.\n\nThe image is fetched once at insertion time and a copy is stored for\ndisplay inside the presentation. Images must be less than 50MB in size,\ncannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF\nformat.\n\nThe provided URL can be at maximum 2K bytes large.", + "type": "string" + }, + "replaceMethod": { + "enumDescriptions": [ + "Scales and centers the image to fit within the bounds of the original\nshape and maintains the image's aspect ratio. The rendered size of the\nimage may be smaller than the size of the shape. This is the default\nmethod when one is not specified.", + "Scales and centers the image to fill the bounds of the original shape.\nThe image may be cropped in order to fill the shape. The rendered size of\nthe image will be the same as that of the original shape." + ], + "enum": [ + "CENTER_INSIDE", + "CENTER_CROP" + ], + "description": "The replace method.", + "type": "string" + } + }, + "id": "ReplaceAllShapesWithImageRequest" + }, + "Shadow": { + "description": "The shadow properties of a page element.\n\nIf these fields are unset, they may be inherited from a parent placeholder\nif it exists. If there is no parent, the fields will default to the value\nused for new page elements created in the Slides editor, which may depend on\nthe page element kind.", + "type": "object", + "properties": { + "blurRadius": { + "$ref": "Dimension", + "description": "The radius of the shadow blur. The larger the radius, the more diffuse the\nshadow becomes." + }, + "transform": { + "description": "Transform that encodes the translate, scale, and skew of the shadow,\nrelative to the alignment position.", + "$ref": "AffineTransform" + }, + "type": { + "enumDescriptions": [ + "Unspecified shadow type.", + "Outer shadow." + ], + "enum": [ + "SHADOW_TYPE_UNSPECIFIED", + "OUTER" + ], + "description": "The type of the shadow.", + "type": "string" + }, + "alignment": { + "enum": [ + "RECTANGLE_POSITION_UNSPECIFIED", + "TOP_LEFT", + "TOP_CENTER", + "TOP_RIGHT", + "LEFT_CENTER", + "CENTER", + "RIGHT_CENTER", + "BOTTOM_LEFT", + "BOTTOM_CENTER", + "BOTTOM_RIGHT" + ], + "description": "The alignment point of the shadow, that sets the origin for translate,\nscale and skew of the shadow.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Top left.", + "Top center.", + "Top right.", + "Left center.", + "Center.", + "Right center.", + "Bottom left.", + "Bottom center.", + "Bottom right." + ] + }, + "alpha": { + "format": "float", + "description": "The alpha of the shadow's color, from 0.0 to 1.0.", + "type": "number" + }, + "color": { + "$ref": "OpaqueColor", + "description": "The shadow color value." + }, + "rotateWithShape": { + "description": "Whether the shadow should rotate with the shape.", + "type": "boolean" + }, + "propertyState": { + "description": "The shadow property state.\n\nUpdating the the shadow on a page element will implicitly update this field\nto `RENDERED`, unless another value is specified in the same request. To\nhave no shadow on a page element, set this field to `NOT_RENDERED`. In this\ncase, any other shadow fields set in the same request will be ignored.", + "type": "string", + "enumDescriptions": [ + "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", + "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", + "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." + ], + "enum": [ + "RENDERED", + "NOT_RENDERED", + "INHERIT" + ] + } + }, + "id": "Shadow" + }, + "DeleteTableRowRequest": { + "id": "DeleteTableRowRequest", + "description": "Deletes a row from a table.", + "type": "object", + "properties": { + "cellLocation": { + "description": "The reference table cell location from which a row will be deleted.\n\nThe row this cell spans will be deleted. If this is a merged cell, multiple\nrows will be deleted. If no rows remain in the table after this deletion,\nthe whole table is deleted.", + "$ref": "TableCellLocation" + }, + "tableObjectId": { + "description": "The table to delete rows from.", + "type": "string" + } + } + }, + "Bullet": { + "description": "Describes the bullet of a paragraph.", + "type": "object", + "properties": { + "listId": { + "description": "The ID of the list this paragraph belongs to.", + "type": "string" + }, + "glyph": { + "description": "The rendered bullet glyph for this paragraph.", + "type": "string" + }, + "nestingLevel": { + "format": "int32", + "description": "The nesting level of this paragraph in the list.", + "type": "integer" + }, + "bulletStyle": { + "description": "The paragraph specific text style applied to this bullet.", + "$ref": "TextStyle" + } + }, + "id": "Bullet" + }, + "OutlineFill": { + "description": "The fill of the outline.", + "type": "object", + "properties": { + "solidFill": { + "description": "Solid color fill.", + "$ref": "SolidFill" + } + }, + "id": "OutlineFill" + }, + "TableCellLocation": { + "description": "A location of a single table cell within a table.", + "type": "object", + "properties": { + "columnIndex": { + "format": "int32", + "description": "The 0-based column index.", + "type": "integer" + }, + "rowIndex": { + "format": "int32", + "description": "The 0-based row index.", + "type": "integer" + } + }, + "id": "TableCellLocation" + }, + "CreateLineResponse": { + "properties": { + "objectId": { + "description": "The object ID of the created line.", + "type": "string" + } + }, + "id": "CreateLineResponse", + "description": "The result of creating a line.", + "type": "object" + }, + "ReplaceAllTextResponse": { + "description": "The result of replacing text.", + "type": "object", + "properties": { + "occurrencesChanged": { + "format": "int32", + "description": "The number of occurrences changed by replacing all text.", + "type": "integer" + } + }, + "id": "ReplaceAllTextResponse" + }, + "UpdateParagraphStyleRequest": { + "description": "Updates the styling for all of the paragraphs within a Shape or Table that\noverlap with the given text index range.", + "type": "object", + "properties": { + "textRange": { + "$ref": "Range", + "description": "The range of text containing the paragraph(s) to style." + }, + "objectId": { + "description": "The object ID of the shape or table with the text to be styled.", + "type": "string" + }, + "style": { + "$ref": "ParagraphStyle", + "description": "The paragraph's style." + }, + "cellLocation": { + "description": "The location of the cell in the table containing the paragraph(s) to\nstyle. If `object_id` refers to a table, `cell_location` must have a value.\nOtherwise, it must not.", + "$ref": "TableCellLocation" + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `style` is implied and\nshould not be specified. A single `\"*\"` can be used as short-hand for\nlisting every field.\n\nFor example, to update the paragraph alignment, set `fields` to\n`\"alignment\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" + } + }, + "id": "UpdateParagraphStyleRequest" + }, + "ColorScheme": { + "description": "The palette of predefined colors for a page.", + "type": "object", + "properties": { + "colors": { + "items": { + "$ref": "ThemeColorPair" + }, + "type": "array", + "description": "The ThemeColorType and corresponding concrete color pairs." + } + }, + "id": "ColorScheme" + }, + "Shape": { + "id": "Shape", + "description": "A PageElement kind representing a\ngeneric shape that does not have a more specific classification.", + "type": "object", + "properties": { + "placeholder": { + "description": "Placeholders are shapes that are inherit from corresponding placeholders on\nlayouts and masters.\n\nIf set, the shape is a placeholder shape and any inherited properties\ncan be resolved by looking at the parent placeholder identified by the\nPlaceholder.parent_object_id field.", + "$ref": "Placeholder" + }, + "text": { + "$ref": "TextContent", + "description": "The text content of the shape." + }, + "shapeType": { + "enum": [ + "TYPE_UNSPECIFIED", + "TEXT_BOX", + "RECTANGLE", + "ROUND_RECTANGLE", + "ELLIPSE", + "ARC", + "BENT_ARROW", + "BENT_UP_ARROW", + "BEVEL", + "BLOCK_ARC", + "BRACE_PAIR", + "BRACKET_PAIR", + "CAN", + "CHEVRON", + "CHORD", + "CLOUD", + "CORNER", + "CUBE", + "CURVED_DOWN_ARROW", + "CURVED_LEFT_ARROW", + "CURVED_RIGHT_ARROW", + "CURVED_UP_ARROW", + "DECAGON", + "DIAGONAL_STRIPE", + "DIAMOND", + "DODECAGON", + "DONUT", + "DOUBLE_WAVE", + "DOWN_ARROW", + "DOWN_ARROW_CALLOUT", + "FOLDED_CORNER", + "FRAME", + "HALF_FRAME", + "HEART", + "HEPTAGON", + "HEXAGON", + "HOME_PLATE", + "HORIZONTAL_SCROLL", + "IRREGULAR_SEAL_1", + "IRREGULAR_SEAL_2", + "LEFT_ARROW", + "LEFT_ARROW_CALLOUT", + "LEFT_BRACE", + "LEFT_BRACKET", + "LEFT_RIGHT_ARROW", + "LEFT_RIGHT_ARROW_CALLOUT", + "LEFT_RIGHT_UP_ARROW", + "LEFT_UP_ARROW", + "LIGHTNING_BOLT", + "MATH_DIVIDE", + "MATH_EQUAL", + "MATH_MINUS", + "MATH_MULTIPLY", + "MATH_NOT_EQUAL", + "MATH_PLUS", + "MOON", + "NO_SMOKING", + "NOTCHED_RIGHT_ARROW", + "OCTAGON", + "PARALLELOGRAM", + "PENTAGON", + "PIE", + "PLAQUE", + "PLUS", + "QUAD_ARROW", + "QUAD_ARROW_CALLOUT", + "RIBBON", + "RIBBON_2", + "RIGHT_ARROW", + "RIGHT_ARROW_CALLOUT", + "RIGHT_BRACE", + "RIGHT_BRACKET", + "ROUND_1_RECTANGLE", + "ROUND_2_DIAGONAL_RECTANGLE", + "ROUND_2_SAME_RECTANGLE", + "RIGHT_TRIANGLE", + "SMILEY_FACE", + "SNIP_1_RECTANGLE", + "SNIP_2_DIAGONAL_RECTANGLE", + "SNIP_2_SAME_RECTANGLE", + "SNIP_ROUND_RECTANGLE", + "STAR_10", + "STAR_12", + "STAR_16", + "STAR_24", + "STAR_32", + "STAR_4", + "STAR_5", + "STAR_6", + "STAR_7", + "STAR_8", + "STRIPED_RIGHT_ARROW", + "SUN", + "TRAPEZOID", + "TRIANGLE", + "UP_ARROW", + "UP_ARROW_CALLOUT", + "UP_DOWN_ARROW", + "UTURN_ARROW", + "VERTICAL_SCROLL", + "WAVE", + "WEDGE_ELLIPSE_CALLOUT", + "WEDGE_RECTANGLE_CALLOUT", + "WEDGE_ROUND_RECTANGLE_CALLOUT", + "FLOW_CHART_ALTERNATE_PROCESS", + "FLOW_CHART_COLLATE", + "FLOW_CHART_CONNECTOR", + "FLOW_CHART_DECISION", + "FLOW_CHART_DELAY", + "FLOW_CHART_DISPLAY", + "FLOW_CHART_DOCUMENT", + "FLOW_CHART_EXTRACT", + "FLOW_CHART_INPUT_OUTPUT", + "FLOW_CHART_INTERNAL_STORAGE", + "FLOW_CHART_MAGNETIC_DISK", + "FLOW_CHART_MAGNETIC_DRUM", + "FLOW_CHART_MAGNETIC_TAPE", + "FLOW_CHART_MANUAL_INPUT", + "FLOW_CHART_MANUAL_OPERATION", + "FLOW_CHART_MERGE", + "FLOW_CHART_MULTIDOCUMENT", + "FLOW_CHART_OFFLINE_STORAGE", + "FLOW_CHART_OFFPAGE_CONNECTOR", + "FLOW_CHART_ONLINE_STORAGE", + "FLOW_CHART_OR", + "FLOW_CHART_PREDEFINED_PROCESS", + "FLOW_CHART_PREPARATION", + "FLOW_CHART_PROCESS", + "FLOW_CHART_PUNCHED_CARD", + "FLOW_CHART_PUNCHED_TAPE", + "FLOW_CHART_SORT", + "FLOW_CHART_SUMMING_JUNCTION", + "FLOW_CHART_TERMINATOR", + "ARROW_EAST", + "ARROW_NORTH_EAST", + "ARROW_NORTH", + "SPEECH", + "STARBURST", + "TEARDROP", + "ELLIPSE_RIBBON", + "ELLIPSE_RIBBON_2", + "CLOUD_CALLOUT", + "CUSTOM" + ], "description": "The type of the shape.", - "type": "string" - }, - "text": { - "$ref": "TextContent", - "description": "The text content of the shape." - }, - "placeholder": { - "description": "Placeholders are shapes that are inherit from corresponding placeholders on\nlayouts and masters.\n\nIf set, the shape is a placeholder shape and any inherited properties\ncan be resolved by looking at the parent placeholder identified by the\nPlaceholder.parent_object_id field.", - "$ref": "Placeholder" - }, - "shapeProperties": { - "$ref": "ShapeProperties", - "description": "The properties of the shape." - } - } - }, - "Image": { - "description": "A PageElement kind representing an\nimage.", - "type": "object", - "properties": { - "imageProperties": { - "$ref": "ImageProperties", - "description": "The properties of the image." - }, - "contentUrl": { - "description": "An URL to an image with a default lifetime of 30 minutes.\nThis URL is tagged with the account of the requester. Anyone with the URL\neffectively accesses the image as the original requester. Access to the\nimage may be lost if the presentation's sharing settings change.", - "type": "string" - } - }, - "id": "Image" - }, - "InsertTextRequest": { - "description": "Inserts text into a shape or a table cell.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the shape or table where the text will be inserted.", - "type": "string" - }, - "text": { - "description": "The text to be inserted.\n\nInserting a newline character will implicitly create a new\nParagraphMarker at that index.\nThe paragraph style of the new paragraph will be copied from the paragraph\nat the current insertion index, including lists and bullets.\n\nText styles for inserted text will be determined automatically, generally\npreserving the styling of neighboring text. In most cases, the text will be\nadded to the TextRun that exists at the\ninsertion index.\n\nSome control characters (U+0000-U+0008, U+000C-U+001F) and characters\nfrom the Unicode Basic Multilingual Plane Private Use Area (U+E000-U+F8FF)\nwill be stripped out of the inserted text.", - "type": "string" - }, - "insertionIndex": { - "description": "The index where the text will be inserted, in Unicode code units, based\non TextElement indexes.\n\nThe index is zero-based and is computed from the start of the string.\nThe index may be adjusted to prevent insertions inside Unicode grapheme\nclusters. In these cases, the text will be inserted immediately after the\ngrapheme cluster.", - "format": "int32", - "type": "integer" - }, - "cellLocation": { - "description": "The optional table cell location if the text is to be inserted into a table\ncell. If present, the object_id must refer to a table.", - "$ref": "TableCellLocation" - } - }, - "id": "InsertTextRequest" - }, - "AffineTransform": { - "description": "AffineTransform uses a 3x3 matrix with an implied last row of [ 0 0 1 ]\nto transform source coordinates (x,y) into destination coordinates (x', y')\naccording to:\n\n x' x = shear_y scale_y translate_y \n 1 [ 1 ]\n\nAfter transformation,\n\n x' = scale_x * x + shear_x * y + translate_x;\n y' = scale_y * y + shear_y * x + translate_y;\n\nThis message is therefore composed of these six matrix elements.", - "type": "object", - "properties": { - "translateX": { - "type": "number", - "description": "The X coordinate translation element.", - "format": "double" - }, - "shearY": { - "description": "The Y coordinate shearing element.", - "format": "double", - "type": "number" - }, - "unit": { - "enumDescriptions": [ - "The units are unknown.", - "An English Metric Unit (EMU) is defined as 1/360,000 of a centimeter\nand thus there are 914,400 EMUs per inch, and 12,700 EMUs per point.", - "A point, 1/72 of an inch." - ], - "enum": [ - "UNIT_UNSPECIFIED", - "EMU", - "PT" - ], - "description": "The units for translate elements.", - "type": "string" - }, - "scaleX": { - "type": "number", - "description": "The X coordinate scaling element.", - "format": "double" - }, - "shearX": { - "description": "The X coordinate shearing element.", - "format": "double", - "type": "number" - }, - "scaleY": { - "description": "The Y coordinate scaling element.", - "format": "double", - "type": "number" - }, - "translateY": { - "description": "The Y coordinate translation element.", - "format": "double", - "type": "number" - } - }, - "id": "AffineTransform" - }, - "AutoText": { - "description": "A TextElement kind that represents auto text.", - "type": "object", - "properties": { - "type": { - "description": "The type of this auto text.", "type": "string", - "enumDescriptions": [ - "An unspecified autotext type.", - "Type for autotext that represents the current slide number." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "SLIDE_NUMBER" - ] - }, - "content": { - "description": "The rendered content of this auto text, if available.", - "type": "string" - }, - "style": { - "$ref": "TextStyle", - "description": "The styling applied to this auto text." - } - }, - "id": "AutoText" - }, - "CreateVideoResponse": { - "id": "CreateVideoResponse", - "description": "The result of creating a video.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the created video.", - "type": "string" - } - } - }, - "DeleteTextRequest": { - "description": "Deletes text from a shape or a table cell.", - "type": "object", - "properties": { - "objectId": { - "type": "string", - "description": "The object ID of the shape or table from which the text will be deleted." - }, - "textRange": { - "description": "The range of text to delete, based on TextElement indexes.\n\nThere is always an implicit newline character at the end of a shape's or\ntable cell's text that cannot be deleted. `Range.Type.ALL` will use the\ncorrect bounds, but care must be taken when specifying explicit bounds for\nrange types `FROM_START_INDEX` and `FIXED_RANGE`. For example, if the text\nis \"ABC\", followed by an implicit newline, then the maximum value is 2 for\n`text_range.start_index` and 3 for `text_range.end_index`.\n\nDeleting text that crosses a paragraph boundary may result in changes\nto paragraph styles and lists as the two paragraphs are merged.\n\nRanges that include only one code unit of a surrogate pair are expanded to\ninclude both code units.", - "$ref": "Range" - }, - "cellLocation": { - "description": "The optional table cell location if the text is to be deleted from a table\ncell. If present, the object_id must refer to a table.", - "$ref": "TableCellLocation" - } - }, - "id": "DeleteTextRequest" - }, - "UpdatePageElementTransformRequest": { - "properties": { - "applyMode": { - "enumDescriptions": [ - "Unspecified mode.", - "Applies the new AffineTransform matrix to the existing one, and\nreplaces the existing one with the resulting concatenation.", - "Replaces the existing AffineTransform matrix with the new one." - ], - "enum": [ - "APPLY_MODE_UNSPECIFIED", - "RELATIVE", - "ABSOLUTE" - ], - "description": "The apply mode of the transform update.", - "type": "string" - }, - "objectId": { - "description": "The object ID of the page element to update.", - "type": "string" - }, - "transform": { - "$ref": "AffineTransform", - "description": "The input transform matrix used to update the page element." - } - }, - "id": "UpdatePageElementTransformRequest", - "description": "Updates the transform of a page element.", - "type": "object" - }, - "DeleteObjectRequest": { - "description": "Deletes an object, either pages or\npage elements, from the\npresentation.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the page or page element to delete.\n\nIf after a delete operation a group contains\nonly 1 or no page elements, the group is also deleted.\n\nIf a placeholder is deleted on a layout, any empty inheriting shapes are\nalso deleted.", - "type": "string" - } - }, - "id": "DeleteObjectRequest" - }, - "TextElement": { - "type": "object", - "properties": { - "textRun": { - "$ref": "TextRun", - "description": "A TextElement representing a run of text where all of the characters\nin the run have the same TextStyle.\n\nThe `start_index` and `end_index` of TextRuns will always be fully\ncontained in the index range of a single `paragraph_marker` TextElement.\nIn other words, a TextRun will never span multiple paragraphs." - }, - "autoText": { - "description": "A TextElement representing a spot in the text that is dynamically\nreplaced with content that can change over time.", - "$ref": "AutoText" - }, - "paragraphMarker": { - "$ref": "ParagraphMarker", - "description": "A marker representing the beginning of a new paragraph.\n\nThe `start_index` and `end_index` of this TextElement represent the\nrange of the paragraph. Other TextElements with an index range contained\ninside this paragraph's range are considered to be part of this\nparagraph. The range of indices of two separate paragraphs will never\noverlap." - }, - "startIndex": { - "description": "The zero-based start index of this text element, in Unicode code units.", - "format": "int32", - "type": "integer" - }, - "endIndex": { - "description": "The zero-based end index of this text element, exclusive, in Unicode code\nunits.", - "format": "int32", - "type": "integer" - } - }, - "id": "TextElement", - "description": "A TextElement describes the content of a range of indices in the text content\nof a Shape or TableCell." - }, - "Dimension": { - "description": "A magnitude in a single direction in the specified units.", - "type": "object", - "properties": { - "unit": { - "enum": [ - "UNIT_UNSPECIFIED", - "EMU", - "PT" - ], - "description": "The units for magnitude.", - "type": "string", - "enumDescriptions": [ - "The units are unknown.", - "An English Metric Unit (EMU) is defined as 1/360,000 of a centimeter\nand thus there are 914,400 EMUs per inch, and 12,700 EMUs per point.", - "A point, 1/72 of an inch." - ] - }, - "magnitude": { - "description": "The magnitude.", - "format": "double", - "type": "number" - } - }, - "id": "Dimension" - }, - "LineFill": { - "description": "The fill of the line.", - "type": "object", - "properties": { - "solidFill": { - "description": "Solid color fill.", - "$ref": "SolidFill" - } - }, - "id": "LineFill" - }, - "VideoProperties": { - "description": "The properties of the Video.", - "type": "object", - "properties": { - "outline": { - "$ref": "Outline", - "description": "The outline of the video. The default outline matches the defaults for new\nvideos created in the Slides editor." - } - }, - "id": "VideoProperties" - }, - "InsertTableRowsRequest": { - "description": "Inserts rows into a table.", - "type": "object", - "properties": { - "tableObjectId": { - "description": "The table to insert rows into.", - "type": "string" - }, - "insertBelow": { - "description": "Whether to insert new rows below the reference cell location.\n\n- `True`: insert below the cell.\n- `False`: insert above the cell.", - "type": "boolean" - }, - "number": { - "description": "The number of rows to be inserted. Maximum 20 per request.", - "format": "int32", - "type": "integer" - }, - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The reference table cell location from which rows will be inserted.\n\nA new row will be inserted above (or below) the row where the reference\ncell is. If the reference cell is a merged cell, a new row will be\ninserted above (or below) the merged cell." - } - }, - "id": "InsertTableRowsRequest" - }, - "LayoutProperties": { - "description": "The properties of Page are only\nrelevant for pages with page_type LAYOUT.", - "type": "object", - "properties": { - "masterObjectId": { - "description": "The object ID of the master that this layout is based on.", - "type": "string" - }, - "name": { - "description": "The name of the layout.", - "type": "string" - }, - "displayName": { - "description": "The human readable name of the layout in the presentation's locale.", - "type": "string" - } - }, - "id": "LayoutProperties" - }, - "Presentation": { - "type": "object", - "properties": { - "revisionId": { - "description": "The revision ID of the presentation. Can be used in update requests\nto assert that the presentation revision hasn't changed since the last\nread operation. Only populated if the user has edit access to the\npresentation.\n\nThe format of the revision ID may change over time, so it should be treated\nopaquely. A returned revision ID is only guaranteed to be valid for 24\nhours after it has been returned and cannot be shared across users. If the\nrevision ID is unchanged between calls, then the presentation has not\nchanged. Conversely, a changed ID (for the same presentation and user)\nusually means the presentation has been updated; however, a changed ID can\nalso be due to internal factors such as ID format changes.", - "type": "string" - }, - "notesMaster": { - "$ref": "Page", - "description": "The notes master in the presentation. It serves three purposes:\n\n- Placeholder shapes on a notes master contain the default text styles and\n shape properties of all placeholder shapes on notes pages. Specifically,\n a `SLIDE_IMAGE` placeholder shape contains the slide thumbnail, and a\n `BODY` placeholder shape contains the speaker notes.\n- The notes master page properties define the common page properties\n inherited by all notes pages.\n- Any other shapes on the notes master will appear on all notes pages.\n\nThe notes master is read-only." - }, - "layouts": { - "description": "The layouts in the presentation. A layout is a template that determines\nhow content is arranged and styled on the slides that inherit from that\nlayout.", - "type": "array", - "items": { - "$ref": "Page" - } - }, - "title": { - "description": "The title of the presentation.", - "type": "string" - }, - "locale": { - "description": "The locale of the presentation, as an IETF BCP 47 language tag.", - "type": "string" - }, - "masters": { - "description": "The slide masters in the presentation. A slide master contains all common\npage elements and the common properties for a set of layouts. They serve\nthree purposes:\n\n- Placeholder shapes on a master contain the default text styles and shape\n properties of all placeholder shapes on pages that use that master.\n- The master page properties define the common page properties inherited by\n its layouts.\n- Any other shapes on the master slide will appear on all slides using that\n master, regardless of their layout.", - "type": "array", - "items": { - "$ref": "Page" - } - }, - "pageSize": { - "description": "The size of pages in the presentation.", - "$ref": "Size" - }, - "presentationId": { - "description": "The ID of the presentation.", - "type": "string" - }, - "slides": { - "description": "The slides in the presentation.\nA slide inherits properties from a slide layout.", - "type": "array", - "items": { - "$ref": "Page" - } - } - }, - "id": "Presentation", - "description": "A Google Slides presentation." - }, - "LineProperties": { - "description": "The properties of the Line.\n\nWhen unset, these fields default to values that match the appearance of\nnew lines created in the Slides editor.", - "type": "object", - "properties": { - "link": { - "$ref": "Link", - "description": "The hyperlink destination of the line. If unset, there is no link." - }, - "dashStyle": { - "description": "The dash style of the line.", - "type": "string", - "enumDescriptions": [ - "Unspecified dash style.", - "Solid line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'solid'.\nThis is the default dash style.", - "Dotted line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dot'.", - "Dashed line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dash'.", - "Alternating dashes and dots. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'dashDot'.", - "Line with large dashes. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'lgDash'.", - "Alternating large dashes and dots. Corresponds to ECMA-376\nST_PresetLineDashVal value 'lgDashDot'." - ], - "enum": [ - "DASH_STYLE_UNSPECIFIED", - "SOLID", - "DOT", - "DASH", - "DASH_DOT", - "LONG_DASH", - "LONG_DASH_DOT" - ] - }, - "startArrow": { - "enumDescriptions": [ - "An unspecified arrow style.", - "No arrow.", - "Arrow with notched back. Corresponds to ECMA-376 ST_LineEndType value\n'stealth'.", - "Filled arrow. Corresponds to ECMA-376 ST_LineEndType value 'triangle'.", - "Filled circle. Corresponds to ECMA-376 ST_LineEndType value 'oval'.", - "Filled square.", - "Filled diamond. Corresponds to ECMA-376 ST_LineEndType value 'diamond'.", - "Hollow arrow.", - "Hollow circle.", - "Hollow square.", - "Hollow diamond." - ], - "enum": [ - "ARROW_STYLE_UNSPECIFIED", - "NONE", - "STEALTH_ARROW", - "FILL_ARROW", - "FILL_CIRCLE", - "FILL_SQUARE", - "FILL_DIAMOND", - "OPEN_ARROW", - "OPEN_CIRCLE", - "OPEN_SQUARE", - "OPEN_DIAMOND" - ], - "description": "The style of the arrow at the beginning of the line.", - "type": "string" - }, - "endArrow": { - "enumDescriptions": [ - "An unspecified arrow style.", - "No arrow.", - "Arrow with notched back. Corresponds to ECMA-376 ST_LineEndType value\n'stealth'.", - "Filled arrow. Corresponds to ECMA-376 ST_LineEndType value 'triangle'.", - "Filled circle. Corresponds to ECMA-376 ST_LineEndType value 'oval'.", - "Filled square.", - "Filled diamond. Corresponds to ECMA-376 ST_LineEndType value 'diamond'.", - "Hollow arrow.", - "Hollow circle.", - "Hollow square.", - "Hollow diamond." - ], - "enum": [ - "ARROW_STYLE_UNSPECIFIED", - "NONE", - "STEALTH_ARROW", - "FILL_ARROW", - "FILL_CIRCLE", - "FILL_SQUARE", - "FILL_DIAMOND", - "OPEN_ARROW", - "OPEN_CIRCLE", - "OPEN_SQUARE", - "OPEN_DIAMOND" - ], - "description": "The style of the arrow at the end of the line.", - "type": "string" - }, - "weight": { - "description": "The thickness of the line.", - "$ref": "Dimension" - }, - "lineFill": { - "$ref": "LineFill", - "description": "The fill of the line. The default line fill matches the defaults for new\nlines created in the Slides editor." - } - }, - "id": "LineProperties" - }, - "OpaqueColor": { - "description": "A themeable solid color value.", - "type": "object", - "properties": { - "themeColor": { - "enumDescriptions": [ - "Unspecified theme color. This value should not be used.", - "Represents the first dark color.", - "Represents the first light color.", - "Represents the second dark color.", - "Represents the second light color.", - "Represents the first accent color.", - "Represents the second accent color.", - "Represents the third accent color.", - "Represents the fourth accent color.", - "Represents the fifth accent color.", - "Represents the sixth accent color.", - "Represents the color to use for hyperlinks.", - "Represents the color to use for visited hyperlinks.", - "Represents the first text color.", - "Represents the first background color.", - "Represents the second text color.", - "Represents the second background color." - ], - "enum": [ - "THEME_COLOR_TYPE_UNSPECIFIED", - "DARK1", - "LIGHT1", - "DARK2", - "LIGHT2", - "ACCENT1", - "ACCENT2", - "ACCENT3", - "ACCENT4", - "ACCENT5", - "ACCENT6", - "HYPERLINK", - "FOLLOWED_HYPERLINK", - "TEXT1", - "BACKGROUND1", - "TEXT2", - "BACKGROUND2" - ], - "description": "An opaque theme color.", - "type": "string" - }, - "rgbColor": { - "description": "An opaque RGB color.", - "$ref": "RgbColor" - } - }, - "id": "OpaqueColor" - }, - "ImageProperties": { - "properties": { - "contrast": { - "description": "The contrast effect of the image. The value should be in the interval\n[-1.0, 1.0], where 0 means no effect. This property is read-only.", - "format": "float", - "type": "number" - }, - "link": { - "$ref": "Link", - "description": "The hyperlink destination of the image. If unset, there is no link." - }, - "recolor": { - "$ref": "Recolor", - "description": "The recolor effect of the image. If not set, the image is not recolored.\nThis property is read-only." - }, - "cropProperties": { - "$ref": "CropProperties", - "description": "The crop properties of the image. If not set, the image is not cropped.\nThis property is read-only." - }, - "outline": { - "description": "The outline of the image. If not set, the the image has no outline.", - "$ref": "Outline" - }, - "brightness": { - "description": "The brightness effect of the image. The value should be in the interval\n[-1.0, 1.0], where 0 means no effect. This property is read-only.", - "format": "float", - "type": "number" - }, - "transparency": { - "description": "The transparency effect of the image. The value should be in the interval\n[0.0, 1.0], where 0 means no effect and 1 means completely transparent.\nThis property is read-only.", - "format": "float", - "type": "number" - }, - "shadow": { - "$ref": "Shadow", - "description": "The shadow of the image. If not set, the image has no shadow. This property\nis read-only." - } - }, - "id": "ImageProperties", - "description": "The properties of the Image.", - "type": "object" - }, - "ReplaceAllShapesWithImageResponse": { - "description": "The result of replacing shapes with an image.", - "type": "object", - "properties": { - "occurrencesChanged": { - "description": "The number of shapes replaced with images.", - "format": "int32", - "type": "integer" - } - }, - "id": "ReplaceAllShapesWithImageResponse" - }, - "Line": { - "properties": { - "lineType": { - "enumDescriptions": [ - "An unspecified line type.", - "Straight connector 1 form. Corresponds to ECMA-376 ST_ShapeType\n'straightConnector1'.", - "Bent connector 2 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector2'.", - "Bent connector 3 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector3'.", - "Bent connector 4 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector4'.", - "Bent connector 5 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector5'.", - "Curved connector 2 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector2'.", - "Curved connector 3 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector3'.", - "Curved connector 4 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector4'.", - "Curved connector 5 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector5'." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "STRAIGHT_CONNECTOR_1", - "BENT_CONNECTOR_2", - "BENT_CONNECTOR_3", - "BENT_CONNECTOR_4", - "BENT_CONNECTOR_5", - "CURVED_CONNECTOR_2", - "CURVED_CONNECTOR_3", - "CURVED_CONNECTOR_4", - "CURVED_CONNECTOR_5" - ], - "description": "The type of the line.", - "type": "string" - }, - "lineProperties": { - "$ref": "LineProperties", - "description": "The properties of the line." - } - }, - "id": "Line", - "description": "A PageElement kind representing a\nline, curved connector, or bent connector.", - "type": "object" - }, - "CreateSheetsChartRequest": { - "properties": { - "objectId": { - "description": "A user-supplied object ID.\n\nIf specified, the ID must be unique among all pages and page elements in\nthe presentation. The ID should start with a word character [a-zA-Z0-9_]\nand then followed by any number of the following characters [a-zA-Z0-9_-:].\nThe length of the ID should not be less than 5 or greater than 50.\nIf empty, a unique identifier will be generated.", - "type": "string" - }, - "elementProperties": { - "$ref": "PageElementProperties", - "description": "The element properties for the chart.\n\nWhen the aspect ratio of the provided size does not match the chart aspect\nratio, the chart is scaled and centered with respect to the size in order\nto maintain aspect ratio. The provided transform is applied after this\noperation." - }, - "spreadsheetId": { - "description": "The ID of the Google Sheets spreadsheet that contains the chart.", - "type": "string" - }, - "linkingMode": { - "enumDescriptions": [ - "The chart is not associated with the source spreadsheet and cannot be\nupdated. A chart that is not linked will be inserted as an image.", - "Linking the chart allows it to be updated, and other collaborators will\nsee a link to the spreadsheet." - ], - "enum": [ - "NOT_LINKED_IMAGE", - "LINKED" - ], - "description": "The mode with which the chart is linked to the source spreadsheet. When\nnot specified, the chart will be an image that is not linked.", - "type": "string" - }, - "chartId": { - "description": "The ID of the specific chart in the Google Sheets spreadsheet.", - "format": "int32", - "type": "integer" - } - }, - "id": "CreateSheetsChartRequest", - "description": "Creates an embedded Google Sheets chart.\n\nNOTE: Chart creation requires at least one of the spreadsheets.readonly,\nspreadsheets, drive.readonly, or drive OAuth scopes.", - "type": "object" - }, - "BatchUpdatePresentationResponse": { - "description": "Response message from a batch update.", - "type": "object", - "properties": { - "replies": { - "description": "The reply of the updates. This maps 1:1 with the updates, although\nreplies to some requests may be empty.", - "type": "array", - "items": { - "$ref": "Response" - } - }, - "presentationId": { - "description": "The presentation the updates were applied to.", - "type": "string" - } - }, - "id": "BatchUpdatePresentationResponse" - }, - "CreateImageResponse": { - "description": "The result of creating an image.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the created image.", - "type": "string" - } - }, - "id": "CreateImageResponse" - }, - "SlideProperties": { - "id": "SlideProperties", - "description": "The properties of Page that are only\nrelevant for pages with page_type SLIDE.", - "type": "object", - "properties": { - "layoutObjectId": { - "description": "The object ID of the layout that this slide is based on.", - "type": "string" - }, - "masterObjectId": { - "description": "The object ID of the master that this slide is based on.", - "type": "string" - }, - "notesPage": { - "description": "The notes page that this slide is associated with. It defines the visual\nappearance of a notes page when printing or exporting slides with speaker\nnotes. A notes page inherits properties from the\nnotes master.\nThe placeholder shape with type BODY on the notes page contains the speaker\nnotes for this slide. The ID of this shape is identified by the\nspeakerNotesObjectId field.\nThe notes page is read-only except for the text content and styles of the\nspeaker notes shape.", - "$ref": "Page" - } - } - }, - "Response": { - "description": "A single response from an update.", - "type": "object", - "properties": { - "duplicateObject": { - "$ref": "DuplicateObjectResponse", - "description": "The result of duplicating an object." - }, - "createShape": { - "$ref": "CreateShapeResponse", - "description": "The result of creating a shape." - }, - "createLine": { - "$ref": "CreateLineResponse", - "description": "The result of creating a line." - }, - "createImage": { - "$ref": "CreateImageResponse", - "description": "The result of creating an image." - }, - "createVideo": { - "$ref": "CreateVideoResponse", - "description": "The result of creating a video." - }, - "createSheetsChart": { - "$ref": "CreateSheetsChartResponse", - "description": "The result of creating a Google Sheets chart." - }, - "replaceAllShapesWithSheetsChart": { - "$ref": "ReplaceAllShapesWithSheetsChartResponse", - "description": "The result of replacing all shapes matching some criteria with a Google\nSheets chart." - }, - "replaceAllShapesWithImage": { - "$ref": "ReplaceAllShapesWithImageResponse", - "description": "The result of replacing all shapes matching some criteria with an\nimage." - }, - "createTable": { - "$ref": "CreateTableResponse", - "description": "The result of creating a table." - }, - "replaceAllText": { - "$ref": "ReplaceAllTextResponse", - "description": "The result of replacing text." - }, - "createSlide": { - "$ref": "CreateSlideResponse", - "description": "The result of creating a slide." - } - }, - "id": "Response" - }, - "TextRun": { - "description": "A TextElement kind that represents a run of text that all has the same\nstyling.", - "type": "object", - "properties": { - "content": { - "description": "The text of this run.", - "type": "string" - }, - "style": { - "$ref": "TextStyle", - "description": "The styling applied to this run." - } - }, - "id": "TextRun" - }, - "LayoutReference": { - "type": "object", - "properties": { - "predefinedLayout": { - "type": "string", - "enumDescriptions": [ - "Unspecified layout.", - "Blank layout, with no placeholders.", - "Layout with a caption at the bottom.", - "Layout with a title and a subtitle.", - "Layout with a title and body.", - "Layout with a title and two columns.", - "Layout with only a title.", - "Layout with a section title.", - "Layout with a title and subtitle on one side and description on the other.", - "Layout with one title and one body, arranged in a single column.", - "Layout with a main point.", - "Layout with a big number heading." - ], - "enum": [ - "PREDEFINED_LAYOUT_UNSPECIFIED", - "BLANK", - "CAPTION_ONLY", - "TITLE", - "TITLE_AND_BODY", - "TITLE_AND_TWO_COLUMNS", - "TITLE_ONLY", - "SECTION_HEADER", - "SECTION_TITLE_AND_DESCRIPTION", - "ONE_COLUMN_TEXT", - "MAIN_POINT", - "BIG_NUMBER" - ], - "description": "Predefined layout." - }, - "layoutId": { - "description": "Layout ID: the object ID of one of the layouts in the presentation.", - "type": "string" - } - }, - "id": "LayoutReference", - "description": "Slide layout reference. This may reference either:\n\n- A predefined layout\n- One of the layouts in the presentation." - }, - "SubstringMatchCriteria": { - "properties": { - "text": { - "description": "The text to search for in the shape or table.", - "type": "string" - }, - "matchCase": { - "description": "Indicates whether the search should respect case:\n\n- `True`: the search is case sensitive.\n- `False`: the search is case insensitive.", - "type": "boolean" - } - }, - "id": "SubstringMatchCriteria", - "description": "A criteria that matches a specific string of text in a shape or table.", - "type": "object" - }, - "TableRange": { - "description": "A table range represents a reference to a subset of a table.\n\nIt's important to note that the cells specified by a table range do not\nnecessarily form a rectangle. For example, let's say we have a 3 x 3 table\nwhere all the cells of the last row are merged together. The table looks\nlike this:\n\n \n [ ]\n\nA table range with location = (0, 0), row span = 3 and column span = 2\nspecifies the following cells:\n\n x x \n [ x ]", - "type": "object", - "properties": { - "location": { - "$ref": "TableCellLocation", - "description": "The starting location of the table range." - }, - "rowSpan": { - "description": "The row span of the table range.", - "format": "int32", - "type": "integer" - }, - "columnSpan": { - "type": "integer", - "description": "The column span of the table range.", - "format": "int32" - } - }, - "id": "TableRange" - }, - "CreateTableResponse": { - "description": "The result of creating a table.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the created table.", - "type": "string" - } - }, - "id": "CreateTableResponse" - }, - "CreateTableRequest": { - "description": "Creates a new table.", - "type": "object", - "properties": { - "objectId": { - "type": "string", - "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated." - }, - "columns": { - "type": "integer", - "description": "Number of columns in the table.", - "format": "int32" - }, - "elementProperties": { - "description": "The element properties for the table.\n\nThe table will be created at the provided size, subject to a minimum size.\nIf no size is provided, the table will be automatically sized.\n\nTable transforms must have a scale of 1 and no shear components. If no\ntransform is provided, the table will be centered on the page.", - "$ref": "PageElementProperties" - }, - "rows": { - "description": "Number of rows in the table.", - "format": "int32", - "type": "integer" - } - }, - "id": "CreateTableRequest" - }, - "Table": { - "description": "A PageElement kind representing a\ntable.", - "type": "object", - "properties": { - "rows": { - "description": "Number of rows in the table.", - "format": "int32", - "type": "integer" - }, - "tableColumns": { - "type": "array", - "items": { - "$ref": "TableColumnProperties" - }, - "description": "Properties of each column." - }, - "columns": { - "description": "Number of columns in the table.", - "format": "int32", - "type": "integer" - }, - "tableRows": { - "description": "Properties and contents of each row.\n\nCells that span multiple rows are contained in only one of these rows and\nhave a row_span greater\nthan 1.", - "type": "array", - "items": { - "$ref": "TableRow" - } - } - }, - "id": "Table" - }, - "PageBackgroundFill": { - "description": "The page background fill.", - "type": "object", - "properties": { - "propertyState": { - "enumDescriptions": [ - "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", - "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", - "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." - ], - "enum": [ - "RENDERED", - "NOT_RENDERED", - "INHERIT" - ], - "description": "The background fill property state.\n\nUpdating the the fill on a page will implicitly update this field to\n`RENDERED`, unless another value is specified in the same request. To\nhave no fill on a page, set this field to `NOT_RENDERED`. In this case,\nany other fill fields set in the same request will be ignored.", - "type": "string" - }, - "stretchedPictureFill": { - "$ref": "StretchedPictureFill", - "description": "Stretched picture fill." - }, - "solidFill": { - "$ref": "SolidFill", - "description": "Solid color fill." - } - }, - "id": "PageBackgroundFill" - }, - "SheetsChart": { - "description": "A PageElement kind representing\na linked chart embedded from Google Sheets.", - "type": "object", - "properties": { - "spreadsheetId": { - "description": "The ID of the Google Sheets spreadsheet that contains the source chart.", - "type": "string" - }, - "chartId": { - "description": "The ID of the specific chart in the Google Sheets spreadsheet that is\nembedded.", - "format": "int32", - "type": "integer" - }, - "sheetsChartProperties": { - "$ref": "SheetsChartProperties", - "description": "The properties of the Sheets chart." - }, - "contentUrl": { - "description": "The URL of an image of the embedded chart, with a default lifetime of 30\nminutes. This URL is tagged with the account of the requester. Anyone with\nthe URL effectively accesses the image as the original requester. Access to\nthe image may be lost if the presentation's sharing settings change.", - "type": "string" - } - }, - "id": "SheetsChart" - }, - "SolidFill": { - "description": "A solid color fill. The page or page element is filled entirely with the\nspecified color value.\n\nIf any field is unset, its value may be inherited from a parent placeholder\nif it exists.", - "type": "object", - "properties": { - "alpha": { - "type": "number", - "description": "The fraction of this `color` that should be applied to the pixel.\nThat is, the final pixel color is defined by the equation:\n\n pixel color = alpha * (color) + (1.0 - alpha) * (background color)\n\nThis means that a value of 1.0 corresponds to a solid color, whereas\na value of 0.0 corresponds to a completely transparent color.", - "format": "float" - }, - "color": { - "description": "The color value of the solid fill.", - "$ref": "OpaqueColor" - } - }, - "id": "SolidFill" - }, - "ThemeColorPair": { - "description": "A pair mapping a theme color type to the concrete color it represents.", - "type": "object", - "properties": { - "color": { - "$ref": "RgbColor", - "description": "The concrete color corresponding to the theme color type above." - }, - "type": { - "enumDescriptions": [ - "Unspecified theme color. This value should not be used.", - "Represents the first dark color.", - "Represents the first light color.", - "Represents the second dark color.", - "Represents the second light color.", - "Represents the first accent color.", - "Represents the second accent color.", - "Represents the third accent color.", - "Represents the fourth accent color.", - "Represents the fifth accent color.", - "Represents the sixth accent color.", - "Represents the color to use for hyperlinks.", - "Represents the color to use for visited hyperlinks.", - "Represents the first text color.", - "Represents the first background color.", - "Represents the second text color.", - "Represents the second background color." - ], - "enum": [ - "THEME_COLOR_TYPE_UNSPECIFIED", - "DARK1", - "LIGHT1", - "DARK2", - "LIGHT2", - "ACCENT1", - "ACCENT2", - "ACCENT3", - "ACCENT4", - "ACCENT5", - "ACCENT6", - "HYPERLINK", - "FOLLOWED_HYPERLINK", - "TEXT1", - "BACKGROUND1", - "TEXT2", - "BACKGROUND2" - ], - "description": "The type of the theme color.", - "type": "string" - } - }, - "id": "ThemeColorPair" - }, - "OptionalColor": { - "description": "A color that can either be fully opaque or fully transparent.", - "type": "object", - "properties": { - "opaqueColor": { - "$ref": "OpaqueColor", - "description": "If set, this will be used as an opaque color. If unset, this represents\na transparent color." - } - }, - "id": "OptionalColor" - }, - "PageElementProperties": { - "description": "Common properties for a page element.\n\nNote: When you initially create a\nPageElement, the API may modify\nthe values of both `size` and `transform`, but the\nvisual size will be unchanged.", - "type": "object", - "properties": { - "transform": { - "$ref": "AffineTransform", - "description": "The transform for the element." - }, - "pageObjectId": { - "description": "The object ID of the page where the element is located.", - "type": "string" - }, - "size": { - "$ref": "Size", - "description": "The size of the element." - } - }, - "id": "PageElementProperties" - }, - "SheetsChartProperties": { - "description": "The properties of the SheetsChart.", - "type": "object", - "properties": { - "chartImageProperties": { - "description": "The properties of the embedded chart image.", - "$ref": "ImageProperties" - } - }, - "id": "SheetsChartProperties" - }, - "StretchedPictureFill": { - "properties": { - "contentUrl": { - "description": "Reading the content_url:\n\nAn URL to a picture with a default lifetime of 30 minutes.\nThis URL is tagged with the account of the requester. Anyone with the URL\neffectively accesses the picture as the original requester. Access to the\npicture may be lost if the presentation's sharing settings change.\n\nWriting the content_url:\n\nThe picture is fetched once at insertion time and a copy is stored for\ndisplay inside the presentation. Pictures must be less than 50MB in size,\ncannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF\nformat.", - "type": "string" - }, - "size": { - "description": "The original size of the picture fill. This field is read-only.", - "$ref": "Size" - } - }, - "id": "StretchedPictureFill", - "description": "The stretched picture fill. The page or page element is filled entirely with\nthe specified picture. The picture is stretched to fit its container.", - "type": "object" - }, - "UpdateTextStyleRequest": { - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the shape or table with the text to be styled.", - "type": "string" - }, - "textRange": { - "$ref": "Range", - "description": "The range of text to style.\n\nThe range may be extended to include adjacent newlines.\n\nIf the range fully contains a paragraph belonging to a list, the\nparagraph's bullet is also updated with the matching text style." - }, - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The location of the cell in the table containing the text to style. If\n`object_id` refers to a table, `cell_location` must have a value.\nOtherwise, it must not." - }, - "style": { - "$ref": "TextStyle", - "description": "The style(s) to set on the text.\n\nIf the value for a particular style matches that of the parent, that style\nwill be set to inherit.\n\nCertain text style changes may cause other changes meant to mirror the\nbehavior of the Slides editor. See the documentation of\nTextStyle for more information." - }, - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `style` is implied and\nshould not be specified. A single `\"*\"` can be used as short-hand for\nlisting every field.\n\nFor example, to update the text style to bold, set `fields` to `\"bold\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" - } - }, - "id": "UpdateTextStyleRequest", - "description": "Update the styling of text in a Shape or\nTable." - }, - "DeleteTableColumnRequest": { - "id": "DeleteTableColumnRequest", - "description": "Deletes a column from a table.", - "type": "object", - "properties": { - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The reference table cell location from which a column will be deleted.\n\nThe column this cell spans will be deleted. If this is a merged cell,\nmultiple columns will be deleted. If no columns remain in the table after\nthis deletion, the whole table is deleted." - }, - "tableObjectId": { - "type": "string", - "description": "The table to delete columns from." - } - } - }, - "List": { - "description": "A List describes the look and feel of bullets belonging to paragraphs\nassociated with a list. A paragraph that is part of a list has an implicit\nreference to that list's ID.", - "type": "object", - "properties": { - "nestingLevel": { - "description": "A map of nesting levels to the properties of bullets at the associated\nlevel. A list has at most nine levels of nesting, so the possible values\nfor the keys of this map are 0 through 8, inclusive.", - "type": "object", - "additionalProperties": { - "$ref": "NestingLevel" - } - }, - "listId": { - "type": "string", - "description": "The ID of the list." - } - }, - "id": "List" - }, - "WeightedFontFamily": { - "type": "object", - "properties": { - "fontFamily": { - "description": "The font family of the text.\n\nThe font family can be any font from the Font menu in Slides or from\n[Google Fonts] (https://fonts.google.com/). If the font name is\nunrecognized, the text is rendered in `Arial`.", - "type": "string" - }, - "weight": { - "description": "The rendered weight of the text. This field can have any value that is a\nmultiple of `100` between `100` and `900`, inclusive. This range\ncorresponds to the numerical values described in the CSS 2.1\nSpecification, [section 15.6](https://www.w3.org/TR/CSS21/fonts.html#font-boldness),\nwith non-numerical values disallowed. Weights greater than or equal to\n`700` are considered bold, and weights less than `700`are not bold. The\ndefault value is `400` (\"normal\").", - "format": "int32", - "type": "integer" - } - }, - "id": "WeightedFontFamily", - "description": "Represents a font family and weight used to style a TextRun." - }, - "PageElement": { - "description": "A visual element rendered on a page.", - "type": "object", - "properties": { - "title": { - "description": "The title of the page element. Combined with description to display alt\ntext.", - "type": "string" - }, - "sheetsChart": { - "description": "A linked chart embedded from Google Sheets. Unlinked charts are\nrepresented as images.", - "$ref": "SheetsChart" - }, - "video": { - "description": "A video page element.", - "$ref": "Video" - }, - "wordArt": { - "$ref": "WordArt", - "description": "A word art page element." - }, - "table": { - "$ref": "Table", - "description": "A table page element." - }, - "objectId": { - "description": "The object ID for this page element. Object IDs used by\ngoogle.apps.slides.v1.Page and\ngoogle.apps.slides.v1.PageElement share the same namespace.", - "type": "string" - }, - "transform": { - "description": "The transform of the page element.", - "$ref": "AffineTransform" - }, - "shape": { - "$ref": "Shape", - "description": "A generic shape." - }, - "line": { - "description": "A line page element.", - "$ref": "Line" - }, - "description": { - "description": "The description of the page element. Combined with title to display alt\ntext.", - "type": "string" - }, - "elementGroup": { - "$ref": "Group", - "description": "A collection of page elements joined as a single unit." - }, - "image": { - "$ref": "Image", - "description": "An image page element." - }, - "size": { - "description": "The size of the page element.", - "$ref": "Size" - } - }, - "id": "PageElement" - }, - "CreateImageRequest": { - "description": "Creates an image.", - "type": "object", - "properties": { - "objectId": { - "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", - "type": "string" - }, - "elementProperties": { - "description": "The element properties for the image.\n\nWhen the aspect ratio of the provided size does not match the image aspect\nratio, the image is scaled and centered with respect to the size in order\nto maintain aspect ratio. The provided transform is applied after this\noperation.", - "$ref": "PageElementProperties" - }, - "url": { - "description": "The image URL.\n\nThe image is fetched once at insertion time and a copy is stored for\ndisplay inside the presentation. Images must be less than 50MB in size,\ncannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF\nformat.", - "type": "string" - } - }, - "id": "CreateImageRequest" - }, - "CreateParagraphBulletsRequest": { - "description": "Creates bullets for all of the paragraphs that overlap with the given\ntext index range.\n\nThe nesting level of each paragraph will be determined by counting leading\ntabs in front of each paragraph. To avoid excess space between the bullet and\nthe corresponding paragraph, these leading tabs are removed by this request.\nThis may change the indices of parts of the text.\n\nIf the paragraph immediately before paragraphs being updated is in a list\nwith a matching preset, the paragraphs being updated are added to that\npreceding list.", - "type": "object", - "properties": { - "bulletPreset": { - "enum": [ - "BULLET_DISC_CIRCLE_SQUARE", - "BULLET_DIAMONDX_ARROW3D_SQUARE", - "BULLET_CHECKBOX", - "BULLET_ARROW_DIAMOND_DISC", - "BULLET_STAR_CIRCLE_SQUARE", - "BULLET_ARROW3D_CIRCLE_SQUARE", - "BULLET_LEFTTRIANGLE_DIAMOND_DISC", - "BULLET_DIAMONDX_HOLLOWDIAMOND_SQUARE", - "BULLET_DIAMOND_CIRCLE_SQUARE", - "NUMBERED_DIGIT_ALPHA_ROMAN", - "NUMBERED_DIGIT_ALPHA_ROMAN_PARENS", - "NUMBERED_DIGIT_NESTED", - "NUMBERED_UPPERALPHA_ALPHA_ROMAN", - "NUMBERED_UPPERROMAN_UPPERALPHA_DIGIT", - "NUMBERED_ZERODIGIT_ALPHA_ROMAN" - ], - "description": "The kinds of bullet glyphs to be used. Defaults to the\n`BULLET_DISC_CIRCLE_SQUARE` preset.", - "type": "string", - "enumDescriptions": [ - "A bulleted list with a `DISC`, `CIRCLE` and `SQUARE` bullet glyph for the\nfirst 3 list nesting levels.", - "A bulleted list with a `DIAMONDX`, `ARROW3D` and `SQUARE` bullet glyph for\nthe first 3 list nesting levels.", - "A bulleted list with `CHECKBOX` bullet glyphs for all list nesting levels.", - "A bulleted list with a `ARROW`, `DIAMOND` and `DISC` bullet glyph for\nthe first 3 list nesting levels.", - "A bulleted list with a `STAR`, `CIRCLE` and `DISC` bullet glyph for\nthe first 3 list nesting levels.", - "A bulleted list with a `ARROW3D`, `CIRCLE` and `SQUARE` bullet glyph for\nthe first 3 list nesting levels.", - "A bulleted list with a `LEFTTRIANGLE`, `DIAMOND` and `DISC` bullet glyph\nfor the first 3 list nesting levels.", - "A bulleted list with a `DIAMONDX`, `HOLLOWDIAMOND` and `SQUARE` bullet\nglyph for the first 3 list nesting levels.", - "A bulleted list with a `DIAMOND`, `CIRCLE` and `SQUARE` bullet glyph\nfor the first 3 list nesting levels.", - "A numbered list with `DIGIT`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by periods.", - "A numbered list with `DIGIT`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by parenthesis.", - "A numbered list with `DIGIT` numeric glyphs separated by periods, where\neach nesting level uses the previous nesting level's glyph as a prefix.\nFor example: '1.', '1.1.', '2.', '2.2.'.", - "A numbered list with `UPPERALPHA`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by periods.", - "A numbered list with `UPPERROMAN`, `UPPERALPHA` and `DIGIT` numeric glyphs\nfor the first 3 list nesting levels, followed by periods.", - "A numbered list with `ZERODIGIT`, `ALPHA` and `ROMAN` numeric glyphs for\nthe first 3 list nesting levels, followed by periods." - ] - }, - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The optional table cell location if the text to be modified is in a table\ncell. If present, the object_id must refer to a table." - }, - "objectId": { - "description": "The object ID of the shape or table containing the text to add bullets to.", - "type": "string" - }, - "textRange": { - "description": "The range of text to apply the bullet presets to, based on TextElement indexes.", - "$ref": "Range" - } - }, - "id": "CreateParagraphBulletsRequest" - }, - "TextStyle": { - "id": "TextStyle", - "description": "Represents the styling that can be applied to a TextRun.\n\nIf this text is contained in a shape with a parent placeholder, then these text styles may be\ninherited from the parent. Which text styles are inherited depend on the\nnesting level of lists:\n\n* A text run in a paragraph that is not in a list will inherit its text style\n from the the newline character in the paragraph at the 0 nesting level of\n the list inside the parent placeholder.\n* A text run in a paragraph that is in a list will inherit its text style\n from the newline character in the paragraph at its corresponding nesting\n level of the list inside the parent placeholder.\n\nInherited text styles are represented as unset fields in this message. If\ntext is contained in a shape without a parent placeholder, unsetting these\nfields will revert the style to a value matching the defaults in the Slides\neditor.", - "type": "object", - "properties": { - "italic": { - "description": "Whether or not the text is italicized.", - "type": "boolean" - }, - "strikethrough": { - "description": "Whether or not the text is struck through.", - "type": "boolean" - }, - "fontSize": { - "description": "The size of the text's font. When read, the `font_size` will specified in\npoints.", - "$ref": "Dimension" - }, - "baselineOffset": { - "type": "string", - "enumDescriptions": [ - "The text's baseline offset is inherited from the parent.", - "The text is not vertically offset.", - "The text is vertically offset upwards (superscript).", - "The text is vertically offset downwards (subscript)." - ], - "enum": [ - "BASELINE_OFFSET_UNSPECIFIED", - "NONE", - "SUPERSCRIPT", - "SUBSCRIPT" - ], - "description": "The text's vertical offset from its normal position.\n\nText with `SUPERSCRIPT` or `SUBSCRIPT` baseline offsets is automatically\nrendered in a smaller font size, computed based on the `font_size` field.\nThe `font_size` itself is not affected by changes in this field." - }, - "weightedFontFamily": { - "$ref": "WeightedFontFamily", - "description": "The font family and rendered weight of the text.\n\nThis field is an extension of `font_family` meant to support explicit font\nweights without breaking backwards compatibility. As such, when reading the\nstyle of a range of text, the value of `weighted_font_family#font_family`\nwill always be equal to that of `font_family`. However, when writing, if\nboth fields are included in the field mask (either explicitly or through\nthe wildcard `\"*\"`), their values are reconciled as follows:\n\n* If `font_family` is set and `weighted_font_family` is not, the value of\n `font_family` is applied with weight `400` (\"normal\").\n* If both fields are set, the value of `font_family` must match that of\n `weighted_font_family#font_family`. If so, the font family and weight of\n `weighted_font_family` is applied. Otherwise, a 400 bad request error is\n returned.\n* If `weighted_font_family` is set and `font_family` is not, the font\n family and weight of `weighted_font_family` is applied.\n* If neither field is set, the font family and weight of the text inherit\n from the parent. Note that these properties cannot inherit separately\n from each other.\n\nIf an update request specifies values for both `weighted_font_family` and\n`bold`, the `weighted_font_family` is applied first, then `bold`.\n\nIf `weighted_font_family#weight` is not set, it defaults to `400`.\n\nIf `weighted_font_family` is set, then `weighted_font_family#font_family`\nmust also be set with a non-empty value. Otherwise, a 400 bad request error\nis returned." - }, - "smallCaps": { - "description": "Whether or not the text is in small capital letters.", - "type": "boolean" - }, - "backgroundColor": { - "$ref": "OptionalColor", - "description": "The background color of the text. If set, the color is either opaque or\ntransparent, depending on if the `opaque_color` field in it is set." - }, - "link": { - "$ref": "Link", - "description": "The hyperlink destination of the text. If unset, there is no link. Links\nare not inherited from parent text.\n\nChanging the link in an update request causes some other changes to the\ntext style of the range:\n\n* When setting a link, the text foreground color will be set to\n ThemeColorType.HYPERLINK and the text will\n be underlined. If these fields are modified in the same\n request, those values will be used instead of the link defaults.\n* Setting a link on a text range that overlaps with an existing link will\n also update the existing link to point to the new URL.\n* Links are not settable on newline characters. As a result, setting a link\n on a text range that crosses a paragraph boundary, such as `\"ABC\\n123\"`,\n will separate the newline character(s) into their own text runs. The\n link will be applied separately to the runs before and after the newline.\n* Removing a link will update the text style of the range to match the\n style of the preceding text (or the default text styles if the preceding\n text is another link) unless different styles are being set in the same\n request." - }, - "underline": { - "description": "Whether or not the text is underlined.", - "type": "boolean" - }, - "bold": { - "description": "Whether or not the text is rendered as bold.", - "type": "boolean" - }, - "foregroundColor": { - "description": "The color of the text itself. If set, the color is either opaque or\ntransparent, depending on if the `opaque_color` field in it is set.", - "$ref": "OptionalColor" - }, - "fontFamily": { - "description": "The font family of the text.\n\nThe font family can be any font from the Font menu in Slides or from\n[Google Fonts] (https://fonts.google.com/). If the font name is\nunrecognized, the text is rendered in `Arial`.\n\nSome fonts can affect the weight of the text. If an update request\nspecifies values for both `font_family` and `bold`, the explicitly-set\n`bold` value is used.", - "type": "string" - } - } - }, - "Size": { - "description": "A width and height.", - "type": "object", - "properties": { - "height": { - "description": "The height of the object.", - "$ref": "Dimension" - }, - "width": { - "$ref": "Dimension", - "description": "The width of the object." - } - }, - "id": "Size" - }, - "UpdateVideoPropertiesRequest": { - "description": "Update the properties of a Video.", - "type": "object", - "properties": { - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `videoProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the video outline color, set `fields` to\n`\"outline.outlineFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" - }, - "objectId": { - "description": "The object ID of the video the updates are applied to.", - "type": "string" - }, - "videoProperties": { - "$ref": "VideoProperties", - "description": "The video properties to update." - } - }, - "id": "UpdateVideoPropertiesRequest" - }, - "Request": { - "description": "A single kind of update to apply to a presentation.", - "type": "object", - "properties": { - "replaceAllShapesWithImage": { - "$ref": "ReplaceAllShapesWithImageRequest", - "description": "Replaces all shapes matching some criteria with an image." - }, - "replaceAllText": { - "description": "Replaces all instances of specified text.", - "$ref": "ReplaceAllTextRequest" - }, - "updateImageProperties": { - "$ref": "UpdateImagePropertiesRequest", - "description": "Updates the properties of an Image." - }, - "insertTableRows": { - "$ref": "InsertTableRowsRequest", - "description": "Inserts rows into a table." - }, - "createSlide": { - "$ref": "CreateSlideRequest", - "description": "Creates a new slide." - }, - "updateLineProperties": { - "$ref": "UpdateLinePropertiesRequest", - "description": "Updates the properties of a Line." - }, - "updateSlidesPosition": { - "$ref": "UpdateSlidesPositionRequest", - "description": "Updates the position of a set of slides in the presentation." - }, - "deleteTableRow": { - "description": "Deletes a row from a table.", - "$ref": "DeleteTableRowRequest" - }, - "updateShapeProperties": { - "$ref": "UpdateShapePropertiesRequest", - "description": "Updates the properties of a Shape." - }, - "insertText": { - "description": "Inserts text into a shape or table cell.", - "$ref": "InsertTextRequest" - }, - "deleteText": { - "$ref": "DeleteTextRequest", - "description": "Deletes text from a shape or a table cell." - }, - "updatePageProperties": { - "description": "Updates the properties of a Page.", - "$ref": "UpdatePagePropertiesRequest" - }, - "createShape": { - "$ref": "CreateShapeRequest", - "description": "Creates a new shape." - }, - "deleteParagraphBullets": { - "description": "Deletes bullets from paragraphs.", - "$ref": "DeleteParagraphBulletsRequest" - }, - "insertTableColumns": { - "$ref": "InsertTableColumnsRequest", - "description": "Inserts columns into a table." - }, - "refreshSheetsChart": { - "$ref": "RefreshSheetsChartRequest", - "description": "Refreshes a Google Sheets chart." - }, - "createTable": { - "$ref": "CreateTableRequest", - "description": "Creates a new table." - }, - "updateTableCellProperties": { - "$ref": "UpdateTableCellPropertiesRequest", - "description": "Updates the properties of a TableCell." - }, - "deleteObject": { - "$ref": "DeleteObjectRequest", - "description": "Deletes a page or page element from the presentation." - }, - "updateParagraphStyle": { - "description": "Updates the styling of paragraphs within a Shape or Table.", - "$ref": "UpdateParagraphStyleRequest" - }, - "duplicateObject": { - "description": "Duplicates a slide or page element.", - "$ref": "DuplicateObjectRequest" - }, - "deleteTableColumn": { - "$ref": "DeleteTableColumnRequest", - "description": "Deletes a column from a table." - }, - "updateVideoProperties": { - "$ref": "UpdateVideoPropertiesRequest", - "description": "Updates the properties of a Video." - }, - "createLine": { - "$ref": "CreateLineRequest", - "description": "Creates a line." - }, - "createImage": { - "description": "Creates an image.", - "$ref": "CreateImageRequest" - }, - "createParagraphBullets": { - "description": "Creates bullets for paragraphs.", - "$ref": "CreateParagraphBulletsRequest" - }, - "createVideo": { - "description": "Creates a video.", - "$ref": "CreateVideoRequest" - }, - "createSheetsChart": { - "$ref": "CreateSheetsChartRequest", - "description": "Creates an embedded Google Sheets chart." - }, - "replaceAllShapesWithSheetsChart": { - "description": "Replaces all shapes matching some criteria with a Google Sheets chart.", - "$ref": "ReplaceAllShapesWithSheetsChartRequest" - }, - "updatePageElementTransform": { - "$ref": "UpdatePageElementTransformRequest", - "description": "Updates the transform of a page element." - }, - "updateTextStyle": { - "$ref": "UpdateTextStyleRequest", - "description": "Updates the styling of text within a Shape or Table." - } - }, - "id": "Request" - }, - "UpdateImagePropertiesRequest": { - "id": "UpdateImagePropertiesRequest", - "description": "Update the properties of an Image.", - "type": "object", - "properties": { - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `imageProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the image outline color, set `fields` to\n`\"outline.outlineFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" - }, - "imageProperties": { - "description": "The image properties to update.", - "$ref": "ImageProperties" - }, - "objectId": { - "description": "The object ID of the image the updates are applied to.", - "type": "string" - } - } - }, - "ParagraphStyle": { - "description": "Styles that apply to a whole paragraph.\n\nIf this text is contained in a shape with a parent placeholder, then these paragraph styles may be\ninherited from the parent. Which paragraph styles are inherited depend on the\nnesting level of lists:\n\n* A paragraph not in a list will inherit its paragraph style from the\n paragraph at the 0 nesting level of the list inside the parent placeholder.\n* A paragraph in a list will inherit its paragraph style from the paragraph\n at its corresponding nesting level of the list inside the parent\n placeholder.\n\nInherited paragraph styles are represented as unset fields in this message.", - "type": "object", - "properties": { - "spaceAbove": { - "$ref": "Dimension", - "description": "The amount of extra space above the paragraph. If unset, the value is\ninherited from the parent." - }, - "indentFirstLine": { - "description": "The amount of indentation for the start of the first line of the paragraph.\nIf unset, the value is inherited from the parent.", - "$ref": "Dimension" - }, - "lineSpacing": { - "description": "The amount of space between lines, as a percentage of normal, where normal\nis represented as 100.0. If unset, the value is inherited from the parent.", - "format": "float", - "type": "number" - }, - "alignment": { - "enumDescriptions": [ - "The paragraph alignment is inherited from the parent.", - "The paragraph is aligned to the start of the line. Left-aligned for\nLTR text, right-aligned otherwise.", - "The paragraph is centered.", - "The paragraph is aligned to the end of the line. Right-aligned for\nLTR text, left-aligned otherwise.", - "The paragraph is justified." - ], - "enum": [ - "ALIGNMENT_UNSPECIFIED", - "START", - "CENTER", - "END", - "JUSTIFIED" - ], - "description": "The text alignment for this paragraph.", - "type": "string" - }, - "spaceBelow": { - "description": "The amount of extra space above the paragraph. If unset, the value is\ninherited from the parent.", - "$ref": "Dimension" - }, - "direction": { - "enum": [ - "TEXT_DIRECTION_UNSPECIFIED", - "LEFT_TO_RIGHT", - "RIGHT_TO_LEFT" - ], - "description": "The text direction of this paragraph. If unset, the value defaults to\nLEFT_TO_RIGHT since\ntext direction is not inherited.", - "type": "string", - "enumDescriptions": [ - "The text direction is inherited from the parent.", - "The text goes from left to right.", - "The text goes from right to left." - ] - }, - "indentEnd": { - "$ref": "Dimension", - "description": "The amount indentation for the paragraph on the side that corresponds to\nthe end of the text, based on the current text direction. If unset, the\nvalue is inherited from the parent." - }, - "spacingMode": { - "enum": [ - "SPACING_MODE_UNSPECIFIED", - "NEVER_COLLAPSE", - "COLLAPSE_LISTS" - ], - "description": "The spacing mode for the paragraph.", - "type": "string", - "enumDescriptions": [ - "The spacing mode is inherited from the parent.", - "Paragraph spacing is always rendered.", - "Paragraph spacing is skipped between list elements." - ] - }, - "indentStart": { - "$ref": "Dimension", - "description": "The amount indentation for the paragraph on the side that corresponds to\nthe start of the text, based on the current text direction. If unset, the\nvalue is inherited from the parent." - } - }, - "id": "ParagraphStyle" - }, - "ReplaceAllShapesWithSheetsChartResponse": { - "description": "The result of replacing shapes with a Google Sheets chart.", - "type": "object", - "properties": { - "occurrencesChanged": { - "description": "The number of shapes replaced with charts.", - "format": "int32", - "type": "integer" - } - }, - "id": "ReplaceAllShapesWithSheetsChartResponse" - }, - "TableCellProperties": { - "description": "The properties of the TableCell.", - "type": "object", - "properties": { - "tableCellBackgroundFill": { - "$ref": "TableCellBackgroundFill", - "description": "The background fill of the table cell. The default fill matches the fill\nfor newly created table cells in the Slides editor." - } - }, - "id": "TableCellProperties" - }, - "Outline": { - "properties": { - "weight": { - "description": "The thickness of the outline.", - "$ref": "Dimension" - }, - "dashStyle": { - "enum": [ - "DASH_STYLE_UNSPECIFIED", - "SOLID", - "DOT", - "DASH", - "DASH_DOT", - "LONG_DASH", - "LONG_DASH_DOT" - ], - "description": "The dash style of the outline.", - "type": "string", - "enumDescriptions": [ - "Unspecified dash style.", - "Solid line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'solid'.\nThis is the default dash style.", - "Dotted line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dot'.", - "Dashed line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dash'.", - "Alternating dashes and dots. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'dashDot'.", - "Line with large dashes. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'lgDash'.", - "Alternating large dashes and dots. Corresponds to ECMA-376\nST_PresetLineDashVal value 'lgDashDot'." - ] - }, - "propertyState": { - "description": "The outline property state.\n\nUpdating the the outline on a page element will implicitly update this\nfield to`RENDERED`, unless another value is specified in the same request.\nTo have no outline on a page element, set this field to `NOT_RENDERED`. In\nthis case, any other outline fields set in the same request will be\nignored.", - "type": "string", - "enumDescriptions": [ - "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", - "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", - "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." - ], - "enum": [ - "RENDERED", - "NOT_RENDERED", - "INHERIT" - ] - }, - "outlineFill": { - "$ref": "OutlineFill", - "description": "The fill of the outline." - } - }, - "id": "Outline", - "description": "The outline of a PageElement.\n\nIf these fields are unset, they may be inherited from a parent placeholder\nif it exists. If there is no parent, the fields will default to the value\nused for new page elements created in the Slides editor, which may depend on\nthe page element kind.", - "type": "object" - }, - "RefreshSheetsChartRequest": { - "description": "Refreshes an embedded Google Sheets chart by replacing it with the latest\nversion of the chart from Google Sheets.\n\nNOTE: Refreshing charts requires at least one of the spreadsheets.readonly,\nspreadsheets, drive.readonly, or drive OAuth scopes.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the chart to refresh.", - "type": "string" - } - }, - "id": "RefreshSheetsChartRequest" - }, - "TableColumnProperties": { - "description": "Properties of each column in a table.", - "type": "object", - "properties": { - "columnWidth": { - "description": "Width of a column.", - "$ref": "Dimension" - } - }, - "id": "TableColumnProperties" - }, - "ShapeProperties": { - "description": "The properties of a Shape.\n\nIf the shape is a placeholder shape as determined by the\nplaceholder field, then these\nproperties may be inherited from a parent placeholder shape.\nDetermining the rendered value of the property depends on the corresponding\nproperty_state field value.", - "type": "object", - "properties": { - "outline": { - "$ref": "Outline", - "description": "The outline of the shape. If unset, the outline is inherited from a\nparent placeholder if it exists. If the shape has no parent, then the\ndefault outline depends on the shape type, matching the defaults for\nnew shapes created in the Slides editor." - }, - "shapeBackgroundFill": { - "$ref": "ShapeBackgroundFill", - "description": "The background fill of the shape. If unset, the background fill is\ninherited from a parent placeholder if it exists. If the shape has no\nparent, then the default background fill depends on the shape type,\nmatching the defaults for new shapes created in the Slides editor." - }, - "shadow": { - "$ref": "Shadow", - "description": "The shadow properties of the shape. If unset, the shadow is inherited from\na parent placeholder if it exists. If the shape has no parent, then the\ndefault shadow matches the defaults for new shapes created in the Slides\neditor. This property is read-only." - }, - "link": { - "description": "The hyperlink destination of the shape. If unset, there is no link. Links\nare not inherited from parent placeholders.", - "$ref": "Link" - } - }, - "id": "ShapeProperties" - }, - "NotesProperties": { - "properties": { - "speakerNotesObjectId": { - "description": "The object ID of the shape on this notes page that contains the speaker\nnotes for the corresponding slide.\nThe actual shape may not always exist on the notes page. Inserting text\nusing this object ID will automatically create the shape. In this case, the\nactual shape may have different object ID. The `GetPresentation` or\n`GetPage` action will always return the latest object ID.", - "type": "string" - } - }, - "id": "NotesProperties", - "description": "The properties of Page that are only\nrelevant for pages with page_type NOTES.", - "type": "object" - }, - "TableRow": { - "description": "Properties and contents of each row in a table.", - "type": "object", - "properties": { - "rowHeight": { - "$ref": "Dimension", - "description": "Height of a row." - }, - "tableCells": { - "description": "Properties and contents of each cell.\n\nCells that span multiple columns are represented only once with a\ncolumn_span greater\nthan 1. As a result, the length of this collection does not always match\nthe number of columns of the entire table.", - "type": "array", - "items": { - "$ref": "TableCell" - } - } - }, - "id": "TableRow" - }, - "UpdateTableCellPropertiesRequest": { - "description": "Update the properties of a TableCell.", - "type": "object", - "properties": { - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `tableCellProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the table cell background solid fill color, set\n`fields` to `\"tableCellBackgroundFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" - }, - "objectId": { - "description": "The object ID of the table.", - "type": "string" - }, - "tableRange": { - "description": "The table range representing the subset of the table to which the updates\nare applied. If a table range is not specified, the updates will apply to\nthe entire table.", - "$ref": "TableRange" - }, - "tableCellProperties": { - "$ref": "TableCellProperties", - "description": "The table cell properties to update." - } - }, - "id": "UpdateTableCellPropertiesRequest" - }, - "CreateSlideRequest": { - "description": "Creates a new slide.", - "type": "object", - "properties": { - "slideLayoutReference": { - "description": "Layout reference of the slide to be inserted, based on the *current\nmaster*, which is one of the following:\n\n- The master of the previous slide index.\n- The master of the first slide, if the insertion_index is zero.\n- The first master in the presentation, if there are no slides.\n\nIf the LayoutReference is not found in the current master, a 400 bad\nrequest error is returned.\n\nIf you don't specify a layout reference, then the new slide will use the\npredefined layout `BLANK`.", - "$ref": "LayoutReference" - }, - "objectId": { - "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", - "type": "string" - }, - "insertionIndex": { - "description": "The optional zero-based index indicating where to insert the slides.\n\nIf you don't specify an index, the new slide is created at the end.", - "format": "int32", - "type": "integer" - }, - "placeholderIdMappings": { - "description": "An optional list of object ID mappings from the placeholder(s) on the layout to the placeholder(s)\nthat will be created on the new slide from that specified layout. Can only\nbe used when `slide_layout_reference` is specified.", - "type": "array", - "items": { - "$ref": "LayoutPlaceholderIdMapping" - } - } - }, - "id": "CreateSlideRequest" - }, - "BatchUpdatePresentationRequest": { - "description": "Request message for PresentationsService.BatchUpdatePresentation.", - "type": "object", - "properties": { - "requests": { - "description": "A list of updates to apply to the presentation.", - "type": "array", - "items": { - "$ref": "Request" - } - }, - "writeControl": { - "$ref": "WriteControl", - "description": "Provides control over how write requests are executed." - } - }, - "id": "BatchUpdatePresentationRequest" - }, - "TextContent": { - "properties": { - "lists": { - "additionalProperties": { - "$ref": "List" - }, - "description": "The bulleted lists contained in this text, keyed by list ID.", - "type": "object" - }, - "textElements": { - "description": "The text contents broken down into its component parts, including styling\ninformation. This property is read-only.", - "type": "array", - "items": { - "$ref": "TextElement" - } - } - }, - "id": "TextContent", - "description": "The general text content. The text must reside in a compatible shape (e.g.\ntext box or rectangle) or a table cell in a page.", - "type": "object" - }, - "CreateSheetsChartResponse": { - "description": "The result of creating an embedded Google Sheets chart.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the created chart.", - "type": "string" - } - }, - "id": "CreateSheetsChartResponse" - }, - "WriteControl": { - "description": "Provides control over how write requests are executed.", - "type": "object", - "properties": { - "requiredRevisionId": { - "description": "The revision ID of the presentation required for the write request. If\nspecified and the `required_revision_id` doesn't exactly match the\npresentation's current `revision_id`, the request will not be processed and\nwill return a 400 bad request error.", - "type": "string" - } - }, - "id": "WriteControl" - }, - "DeleteParagraphBulletsRequest": { - "description": "Deletes bullets from all of the paragraphs that overlap with the given text\nindex range.\n\nThe nesting level of each paragraph will be visually preserved by adding\nindent to the start of the corresponding paragraph.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the shape or table containing the text to delete bullets\nfrom.", - "type": "string" - }, - "textRange": { - "$ref": "Range", - "description": "The range of text to delete bullets from, based on TextElement indexes." - }, - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The optional table cell location if the text to be modified is in a table\ncell. If present, the object_id must refer to a table." - } - }, - "id": "DeleteParagraphBulletsRequest" - }, - "ParagraphMarker": { - "description": "A TextElement kind that represents the beginning of a new paragraph.", - "type": "object", - "properties": { - "bullet": { - "$ref": "Bullet", - "description": "The bullet for this paragraph. If not present, the paragraph does not\nbelong to a list." - }, - "style": { - "description": "The paragraph's style", - "$ref": "ParagraphStyle" - } - }, - "id": "ParagraphMarker" - }, - "Thumbnail": { - "properties": { - "width": { - "description": "The positive width in pixels of the thumbnail image.", - "format": "int32", - "type": "integer" - }, - "height": { - "description": "The positive height in pixels of the thumbnail image.", - "format": "int32", - "type": "integer" - }, - "contentUrl": { - "description": "The content URL of the thumbnail image.\n\nThe URL to the image has a default lifetime of 30 minutes.\nThis URL is tagged with the account of the requester. Anyone with the URL\neffectively accesses the image as the original requester. Access to the\nimage may be lost if the presentation's sharing settings change.\nThe mime type of the thumbnail image is the same as specified in the\n`GetPageThumbnailRequest`.", - "type": "string" - } - }, - "id": "Thumbnail", - "description": "The thumbnail of a page.", - "type": "object" - }, - "InsertTableColumnsRequest": { - "description": "Inserts columns into a table.\n\nOther columns in the table will be resized to fit the new column.", - "type": "object", - "properties": { - "number": { - "description": "The number of columns to be inserted. Maximum 20 per request.", - "format": "int32", - "type": "integer" - }, - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The reference table cell location from which columns will be inserted.\n\nA new column will be inserted to the left (or right) of the column where\nthe reference cell is. If the reference cell is a merged cell, a new\ncolumn will be inserted to the left (or right) of the merged cell." - }, - "insertRight": { - "type": "boolean", - "description": "Whether to insert new columns to the right of the reference cell location.\n\n- `True`: insert to the right.\n- `False`: insert to the left." - }, - "tableObjectId": { - "description": "The table to insert columns into.", - "type": "string" - } - }, - "id": "InsertTableColumnsRequest" - }, - "LayoutPlaceholderIdMapping": { - "type": "object", - "properties": { - "objectId": { - "description": "A user-supplied object ID for the placeholder identified above that to be\ncreated onto a slide.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", - "type": "string" - }, - "layoutPlaceholder": { - "$ref": "Placeholder", - "description": "The placeholder on a layout that will be applied to a slide. Only type and index are needed. For example, a\npredefined `TITLE_AND_BODY` layout may usually have a TITLE placeholder\nwith index 0 and a BODY placeholder with index 0." - }, - "layoutPlaceholderObjectId": { - "description": "The object ID of the placeholder on a layout that will be applied\nto a slide.", - "type": "string" - } - }, - "id": "LayoutPlaceholderIdMapping", - "description": "The user-specified ID mapping for a placeholder that will be created on a\nslide from a specified layout." - }, - "UpdateShapePropertiesRequest": { - "description": "Update the properties of a Shape.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the shape the updates are applied to.", - "type": "string" - }, - "shapeProperties": { - "$ref": "ShapeProperties", - "description": "The shape properties to update." - }, - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `shapeProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the shape background solid fill color, set `fields`\nto `\"shapeBackgroundFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" - } - }, - "id": "UpdateShapePropertiesRequest" - }, - "WordArt": { - "type": "object", - "properties": { - "renderedText": { - "description": "The text rendered as word art.", - "type": "string" - } - }, - "id": "WordArt", - "description": "A PageElement kind representing\nword art." - }, - "Recolor": { - "description": "A recolor effect applied on an image.", - "type": "object", - "properties": { - "recolorStops": { - "description": "The recolor effect is represented by a gradient, which is a list of color\nstops.\n\nThe colors in the gradient will replace the corresponding colors at\nthe same position in the color palette and apply to the image. This\nproperty is read-only.", - "type": "array", - "items": { - "$ref": "ColorStop" - } - }, - "name": { - "enum": [ - "NONE", - "LIGHT1", - "LIGHT2", - "LIGHT3", - "LIGHT4", - "LIGHT5", - "LIGHT6", - "LIGHT7", - "LIGHT8", - "LIGHT9", - "LIGHT10", - "DARK1", - "DARK2", - "DARK3", - "DARK4", - "DARK5", - "DARK6", - "DARK7", - "DARK8", - "DARK9", - "DARK10", - "GRAYSCALE", - "NEGATIVE", - "SEPIA", - "CUSTOM" - ], - "description": "The name of the recolor effect.\n\nThe name is determined from the `recolor_stops` by matching the gradient\nagainst the colors in the page's current color scheme. This property is\nread-only.", - "type": "string", - "enumDescriptions": [ - "No recolor effect. The default value.", - "A recolor effect that lightens the image using the page's first available\ncolor from its color scheme.", - "A recolor effect that lightens the image using the page's second\navailable color from its color scheme.", - "A recolor effect that lightens the image using the page's third available\ncolor from its color scheme.", - "A recolor effect that lightens the image using the page's forth available\ncolor from its color scheme.", - "A recolor effect that lightens the image using the page's fifth available\ncolor from its color scheme.", - "A recolor effect that lightens the image using the page's sixth available\ncolor from its color scheme.", - "A recolor effect that lightens the image using the page's seventh\navailable color from its color scheme.e.", - "A recolor effect that lightens the image using the page's eighth\navailable color from its color scheme.", - "A recolor effect that lightens the image using the page's ninth available\ncolor from its color scheme.", - "A recolor effect that lightens the image using the page's tenth available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's first available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's second available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's third available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's fourth available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's fifth available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's sixth available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's seventh\navailable color from its color scheme.", - "A recolor effect that darkens the image using the page's eighth available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's ninth available\ncolor from its color scheme.", - "A recolor effect that darkens the image using the page's tenth available\ncolor from its color scheme.", - "A recolor effect that recolors the image to grayscale.", - "A recolor effect that recolors the image to negative grayscale.", - "A recolor effect that recolors the image using the sepia color.", - "Custom recolor effect. Refer to `recolor_stops` for the concrete\ngradient." - ] - } - }, - "id": "Recolor" - }, - "Link": { - "properties": { - "url": { - "description": "If set, indicates this is a link to the external web page at this URL.", - "type": "string" - }, - "relativeLink": { - "enum": [ - "RELATIVE_SLIDE_LINK_UNSPECIFIED", - "NEXT_SLIDE", - "PREVIOUS_SLIDE", - "FIRST_SLIDE", - "LAST_SLIDE" - ], - "description": "If set, indicates this is a link to a slide in this presentation,\naddressed by its position.", - "type": "string", - "enumDescriptions": [ - "An unspecified relative slide link.", - "A link to the next slide.", - "A link to the previous slide.", - "A link to the first slide in the presentation.", - "A link to the last slide in the presentation." - ] - }, - "slideIndex": { - "description": "If set, indicates this is a link to the slide at this zero-based index\nin the presentation. There may not be a slide at this index.", - "format": "int32", - "type": "integer" - }, - "pageObjectId": { - "description": "If set, indicates this is a link to the specific page in this\npresentation with this ID. A page with this ID may not exist.", - "type": "string" - } - }, - "id": "Link", - "description": "A hypertext link.", - "type": "object" - }, - "CreateShapeResponse": { - "description": "The result of creating a shape.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the created shape.", - "type": "string" - } - }, - "id": "CreateShapeResponse" - }, - "RgbColor": { - "id": "RgbColor", - "description": "An RGB color.", - "type": "object", - "properties": { - "red": { - "description": "The red component of the color, from 0.0 to 1.0.", - "format": "float", - "type": "number" - }, - "green": { - "description": "The green component of the color, from 0.0 to 1.0.", - "format": "float", - "type": "number" - }, - "blue": { - "description": "The blue component of the color, from 0.0 to 1.0.", - "format": "float", - "type": "number" - } - } - }, - "CreateLineRequest": { - "description": "Creates a line.", - "type": "object", - "properties": { - "objectId": { - "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", - "type": "string" - }, - "elementProperties": { - "$ref": "PageElementProperties", - "description": "The element properties for the line." - }, - "lineCategory": { - "type": "string", - "enumDescriptions": [ - "Straight connectors, including straight connector 1. The is the default\ncategory when one is not specified.", - "Bent connectors, including bent connector 2 to 5.", - "Curved connectors, including curved connector 2 to 5." - ], - "enum": [ - "STRAIGHT", - "BENT", - "CURVED" - ], - "description": "The category of line to be created." - } - }, - "id": "CreateLineRequest" - }, - "CreateSlideResponse": { - "description": "The result of creating a slide.", - "type": "object", - "properties": { - "objectId": { - "description": "The object ID of the created slide.", - "type": "string" - } - }, - "id": "CreateSlideResponse" - }, - "CreateShapeRequest": { - "type": "object", - "properties": { - "objectId": { - "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\nIf empty, a unique identifier will be generated.", - "type": "string" - }, - "shapeType": { "enumDescriptions": [ "The shape type that is not predefined.", "Text box shape.", @@ -2660,495 +2450,928 @@ "Ellipse ribbon 2 shape. Corresponds to ECMA-376 ST_ShapeType\n'ellipseRibbon2'", "Callout cloud shape. Corresponds to ECMA-376 ST_ShapeType 'cloudCallout'", "Custom shape." + ] + }, + "shapeProperties": { + "$ref": "ShapeProperties", + "description": "The properties of the shape." + } + } + }, + "Image": { + "description": "A PageElement kind representing an\nimage.", + "type": "object", + "properties": { + "imageProperties": { + "$ref": "ImageProperties", + "description": "The properties of the image." + }, + "contentUrl": { + "description": "An URL to an image with a default lifetime of 30 minutes.\nThis URL is tagged with the account of the requester. Anyone with the URL\neffectively accesses the image as the original requester. Access to the\nimage may be lost if the presentation's sharing settings change.", + "type": "string" + } + }, + "id": "Image" + }, + "AffineTransform": { + "id": "AffineTransform", + "description": "AffineTransform uses a 3x3 matrix with an implied last row of [ 0 0 1 ]\nto transform source coordinates (x,y) into destination coordinates (x', y')\naccording to:\n\n x' x = shear_y scale_y translate_y \n 1 [ 1 ]\n\nAfter transformation,\n\n x' = scale_x * x + shear_x * y + translate_x;\n y' = scale_y * y + shear_y * x + translate_y;\n\nThis message is therefore composed of these six matrix elements.", + "type": "object", + "properties": { + "unit": { + "type": "string", + "enumDescriptions": [ + "The units are unknown.", + "An English Metric Unit (EMU) is defined as 1/360,000 of a centimeter\nand thus there are 914,400 EMUs per inch, and 12,700 EMUs per point.", + "A point, 1/72 of an inch." + ], + "enum": [ + "UNIT_UNSPECIFIED", + "EMU", + "PT" + ], + "description": "The units for translate elements." + }, + "scaleX": { + "format": "double", + "description": "The X coordinate scaling element.", + "type": "number" + }, + "shearX": { + "format": "double", + "description": "The X coordinate shearing element.", + "type": "number" + }, + "scaleY": { + "format": "double", + "description": "The Y coordinate scaling element.", + "type": "number" + }, + "translateY": { + "format": "double", + "description": "The Y coordinate translation element.", + "type": "number" + }, + "translateX": { + "format": "double", + "description": "The X coordinate translation element.", + "type": "number" + }, + "shearY": { + "format": "double", + "description": "The Y coordinate shearing element.", + "type": "number" + } + } + }, + "InsertTextRequest": { + "properties": { + "text": { + "description": "The text to be inserted.\n\nInserting a newline character will implicitly create a new\nParagraphMarker at that index.\nThe paragraph style of the new paragraph will be copied from the paragraph\nat the current insertion index, including lists and bullets.\n\nText styles for inserted text will be determined automatically, generally\npreserving the styling of neighboring text. In most cases, the text will be\nadded to the TextRun that exists at the\ninsertion index.\n\nSome control characters (U+0000-U+0008, U+000C-U+001F) and characters\nfrom the Unicode Basic Multilingual Plane Private Use Area (U+E000-U+F8FF)\nwill be stripped out of the inserted text.", + "type": "string" + }, + "objectId": { + "description": "The object ID of the shape or table where the text will be inserted.", + "type": "string" + }, + "insertionIndex": { + "format": "int32", + "description": "The index where the text will be inserted, in Unicode code units, based\non TextElement indexes.\n\nThe index is zero-based and is computed from the start of the string.\nThe index may be adjusted to prevent insertions inside Unicode grapheme\nclusters. In these cases, the text will be inserted immediately after the\ngrapheme cluster.", + "type": "integer" + }, + "cellLocation": { + "$ref": "TableCellLocation", + "description": "The optional table cell location if the text is to be inserted into a table\ncell. If present, the object_id must refer to a table." + } + }, + "id": "InsertTextRequest", + "description": "Inserts text into a shape or a table cell.", + "type": "object" + }, + "AutoText": { + "properties": { + "style": { + "$ref": "TextStyle", + "description": "The styling applied to this auto text." + }, + "content": { + "description": "The rendered content of this auto text, if available.", + "type": "string" + }, + "type": { + "enumDescriptions": [ + "An unspecified autotext type.", + "Type for autotext that represents the current slide number." ], "enum": [ "TYPE_UNSPECIFIED", - "TEXT_BOX", - "RECTANGLE", - "ROUND_RECTANGLE", - "ELLIPSE", - "ARC", - "BENT_ARROW", - "BENT_UP_ARROW", - "BEVEL", - "BLOCK_ARC", - "BRACE_PAIR", - "BRACKET_PAIR", - "CAN", - "CHEVRON", - "CHORD", - "CLOUD", - "CORNER", - "CUBE", - "CURVED_DOWN_ARROW", - "CURVED_LEFT_ARROW", - "CURVED_RIGHT_ARROW", - "CURVED_UP_ARROW", - "DECAGON", - "DIAGONAL_STRIPE", - "DIAMOND", - "DODECAGON", - "DONUT", - "DOUBLE_WAVE", - "DOWN_ARROW", - "DOWN_ARROW_CALLOUT", - "FOLDED_CORNER", - "FRAME", - "HALF_FRAME", - "HEART", - "HEPTAGON", - "HEXAGON", - "HOME_PLATE", - "HORIZONTAL_SCROLL", - "IRREGULAR_SEAL_1", - "IRREGULAR_SEAL_2", - "LEFT_ARROW", - "LEFT_ARROW_CALLOUT", - "LEFT_BRACE", - "LEFT_BRACKET", - "LEFT_RIGHT_ARROW", - "LEFT_RIGHT_ARROW_CALLOUT", - "LEFT_RIGHT_UP_ARROW", - "LEFT_UP_ARROW", - "LIGHTNING_BOLT", - "MATH_DIVIDE", - "MATH_EQUAL", - "MATH_MINUS", - "MATH_MULTIPLY", - "MATH_NOT_EQUAL", - "MATH_PLUS", - "MOON", - "NO_SMOKING", - "NOTCHED_RIGHT_ARROW", - "OCTAGON", - "PARALLELOGRAM", - "PENTAGON", - "PIE", - "PLAQUE", - "PLUS", - "QUAD_ARROW", - "QUAD_ARROW_CALLOUT", - "RIBBON", - "RIBBON_2", - "RIGHT_ARROW", - "RIGHT_ARROW_CALLOUT", - "RIGHT_BRACE", - "RIGHT_BRACKET", - "ROUND_1_RECTANGLE", - "ROUND_2_DIAGONAL_RECTANGLE", - "ROUND_2_SAME_RECTANGLE", - "RIGHT_TRIANGLE", - "SMILEY_FACE", - "SNIP_1_RECTANGLE", - "SNIP_2_DIAGONAL_RECTANGLE", - "SNIP_2_SAME_RECTANGLE", - "SNIP_ROUND_RECTANGLE", - "STAR_10", - "STAR_12", - "STAR_16", - "STAR_24", - "STAR_32", - "STAR_4", - "STAR_5", - "STAR_6", - "STAR_7", - "STAR_8", - "STRIPED_RIGHT_ARROW", - "SUN", - "TRAPEZOID", - "TRIANGLE", - "UP_ARROW", - "UP_ARROW_CALLOUT", - "UP_DOWN_ARROW", - "UTURN_ARROW", - "VERTICAL_SCROLL", - "WAVE", - "WEDGE_ELLIPSE_CALLOUT", - "WEDGE_RECTANGLE_CALLOUT", - "WEDGE_ROUND_RECTANGLE_CALLOUT", - "FLOW_CHART_ALTERNATE_PROCESS", - "FLOW_CHART_COLLATE", - "FLOW_CHART_CONNECTOR", - "FLOW_CHART_DECISION", - "FLOW_CHART_DELAY", - "FLOW_CHART_DISPLAY", - "FLOW_CHART_DOCUMENT", - "FLOW_CHART_EXTRACT", - "FLOW_CHART_INPUT_OUTPUT", - "FLOW_CHART_INTERNAL_STORAGE", - "FLOW_CHART_MAGNETIC_DISK", - "FLOW_CHART_MAGNETIC_DRUM", - "FLOW_CHART_MAGNETIC_TAPE", - "FLOW_CHART_MANUAL_INPUT", - "FLOW_CHART_MANUAL_OPERATION", - "FLOW_CHART_MERGE", - "FLOW_CHART_MULTIDOCUMENT", - "FLOW_CHART_OFFLINE_STORAGE", - "FLOW_CHART_OFFPAGE_CONNECTOR", - "FLOW_CHART_ONLINE_STORAGE", - "FLOW_CHART_OR", - "FLOW_CHART_PREDEFINED_PROCESS", - "FLOW_CHART_PREPARATION", - "FLOW_CHART_PROCESS", - "FLOW_CHART_PUNCHED_CARD", - "FLOW_CHART_PUNCHED_TAPE", - "FLOW_CHART_SORT", - "FLOW_CHART_SUMMING_JUNCTION", - "FLOW_CHART_TERMINATOR", - "ARROW_EAST", - "ARROW_NORTH_EAST", - "ARROW_NORTH", - "SPEECH", - "STARBURST", - "TEARDROP", - "ELLIPSE_RIBBON", - "ELLIPSE_RIBBON_2", - "CLOUD_CALLOUT", - "CUSTOM" + "SLIDE_NUMBER" ], - "description": "The shape type.", - "type": "string" - }, - "elementProperties": { - "description": "The element properties for the shape.", - "$ref": "PageElementProperties" - } - }, - "id": "CreateShapeRequest", - "description": "Creates a new shape." - }, - "Video": { - "properties": { - "url": { - "description": "An URL to a video. The URL is valid as long as the source video\nexists and sharing settings do not change.", - "type": "string" - }, - "id": { - "description": "The video source's unique identifier for this video.", - "type": "string" - }, - "videoProperties": { - "$ref": "VideoProperties", - "description": "The properties of the video." - }, - "source": { - "enumDescriptions": [ - "The video source is unspecified.", - "The video source is YouTube." - ], - "enum": [ - "SOURCE_UNSPECIFIED", - "YOUTUBE" - ], - "description": "The video source.", + "description": "The type of this auto text.", "type": "string" } }, - "id": "Video", - "description": "A PageElement kind representing a\nvideo.", + "id": "AutoText", + "description": "A TextElement kind that represents auto text.", "type": "object" }, - "PageProperties": { - "description": "The properties of the Page.\n\nThe page will inherit properties from the parent page. Depending on the page\ntype the hierarchy is defined in either\nSlideProperties or\nLayoutProperties.", + "CreateVideoResponse": { + "description": "The result of creating a video.", "type": "object", "properties": { - "colorScheme": { - "$ref": "ColorScheme", - "description": "The color scheme of the page. If unset, the color scheme is inherited from\na parent page. If the page has no parent, the color scheme uses a default\nSlides color scheme. This field is read-only." - }, - "pageBackgroundFill": { - "description": "The background fill of the page. If unset, the background fill is inherited\nfrom a parent page if it exists. If the page has no parent, then the\nbackground fill defaults to the corresponding fill in the Slides editor.", - "$ref": "PageBackgroundFill" + "objectId": { + "description": "The object ID of the created video.", + "type": "string" } }, - "id": "PageProperties" + "id": "CreateVideoResponse" }, - "NestingLevel": { - "id": "NestingLevel", - "description": "Contains properties describing the look and feel of a list bullet at a given\nlevel of nesting.", + "UpdatePageElementTransformRequest": { + "id": "UpdatePageElementTransformRequest", + "description": "Updates the transform of a page element.\n\nUpdating the transform of a group will change the absolute transform of the\npage elements in that group, which can change their visual appearance. See\nthe documentation for PageElement.transform for more details.", "type": "object", "properties": { - "bulletStyle": { - "$ref": "TextStyle", - "description": "The style of a bullet at this level of nesting." + "transform": { + "$ref": "AffineTransform", + "description": "The input transform matrix used to update the page element." + }, + "objectId": { + "description": "The object ID of the page element to update.", + "type": "string" + }, + "applyMode": { + "type": "string", + "enumDescriptions": [ + "Unspecified mode.", + "Applies the new AffineTransform matrix to the existing one, and\nreplaces the existing one with the resulting concatenation.", + "Replaces the existing AffineTransform matrix with the new one." + ], + "enum": [ + "APPLY_MODE_UNSPECIFIED", + "RELATIVE", + "ABSOLUTE" + ], + "description": "The apply mode of the transform update." } } }, - "TableCell": { + "DeleteTextRequest": { + "id": "DeleteTextRequest", + "description": "Deletes text from a shape or a table cell.", "type": "object", "properties": { - "location": { - "$ref": "TableCellLocation", - "description": "The location of the cell within the table." - }, - "rowSpan": { - "type": "integer", - "description": "Row span of the cell.", - "format": "int32" - }, - "columnSpan": { - "description": "Column span of the cell.", - "format": "int32", - "type": "integer" - }, - "text": { - "description": "The text content of the cell.", - "$ref": "TextContent" - }, - "tableCellProperties": { - "$ref": "TableCellProperties", - "description": "The properties of the table cell." - } - }, - "id": "TableCell", - "description": "Properties and contents of each table cell." - }, - "UpdateLinePropertiesRequest": { - "properties": { - "lineProperties": { - "description": "The line properties to update.", - "$ref": "LineProperties" - }, - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `lineProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the line solid fill color, set `fields` to\n`\"lineFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" + "textRange": { + "$ref": "Range", + "description": "The range of text to delete, based on TextElement indexes.\n\nThere is always an implicit newline character at the end of a shape's or\ntable cell's text that cannot be deleted. `Range.Type.ALL` will use the\ncorrect bounds, but care must be taken when specifying explicit bounds for\nrange types `FROM_START_INDEX` and `FIXED_RANGE`. For example, if the text\nis \"ABC\", followed by an implicit newline, then the maximum value is 2 for\n`text_range.start_index` and 3 for `text_range.end_index`.\n\nDeleting text that crosses a paragraph boundary may result in changes\nto paragraph styles and lists as the two paragraphs are merged.\n\nRanges that include only one code unit of a surrogate pair are expanded to\ninclude both code units." }, "objectId": { - "description": "The object ID of the line the update is applied to.", + "description": "The object ID of the shape or table from which the text will be deleted.", "type": "string" + }, + "cellLocation": { + "$ref": "TableCellLocation", + "description": "The optional table cell location if the text is to be deleted from a table\ncell. If present, the object_id must refer to a table." } - }, - "id": "UpdateLinePropertiesRequest", - "description": "Updates the properties of a Line.", - "type": "object" + } }, - "UpdateSlidesPositionRequest": { + "DeleteObjectRequest": { + "id": "DeleteObjectRequest", + "description": "Deletes an object, either pages or\npage elements, from the\npresentation.", + "type": "object", "properties": { - "insertionIndex": { - "description": "The index where the slides should be inserted, based on the slide\narrangement before the move takes place. Must be between zero and the\nnumber of slides in the presentation, inclusive.", + "objectId": { + "type": "string", + "description": "The object ID of the page or page element to delete.\n\nIf after a delete operation a group contains\nonly 1 or no page elements, the group is also deleted.\n\nIf a placeholder is deleted on a layout, any empty inheriting shapes are\nalso deleted." + } + } + }, + "TextElement": { + "id": "TextElement", + "description": "A TextElement describes the content of a range of indices in the text content\nof a Shape or TableCell.", + "type": "object", + "properties": { + "textRun": { + "$ref": "TextRun", + "description": "A TextElement representing a run of text where all of the characters\nin the run have the same TextStyle.\n\nThe `start_index` and `end_index` of TextRuns will always be fully\ncontained in the index range of a single `paragraph_marker` TextElement.\nIn other words, a TextRun will never span multiple paragraphs." + }, + "autoText": { + "$ref": "AutoText", + "description": "A TextElement representing a spot in the text that is dynamically\nreplaced with content that can change over time." + }, + "paragraphMarker": { + "$ref": "ParagraphMarker", + "description": "A marker representing the beginning of a new paragraph.\n\nThe `start_index` and `end_index` of this TextElement represent the\nrange of the paragraph. Other TextElements with an index range contained\ninside this paragraph's range are considered to be part of this\nparagraph. The range of indices of two separate paragraphs will never\noverlap." + }, + "endIndex": { "format": "int32", + "description": "The zero-based end index of this text element, exclusive, in Unicode code\nunits.", "type": "integer" }, - "slideObjectIds": { - "description": "The IDs of the slides in the presentation that should be moved.\nThe slides in this list must be in existing presentation order, without\nduplicates.", - "type": "array", - "items": { - "type": "string" - } + "startIndex": { + "format": "int32", + "description": "The zero-based start index of this text element, in Unicode code units.", + "type": "integer" + } + } + }, + "Dimension": { + "description": "A magnitude in a single direction in the specified units.", + "type": "object", + "properties": { + "magnitude": { + "format": "double", + "description": "The magnitude.", + "type": "number" + }, + "unit": { + "enum": [ + "UNIT_UNSPECIFIED", + "EMU", + "PT" + ], + "description": "The units for magnitude.", + "type": "string", + "enumDescriptions": [ + "The units are unknown.", + "An English Metric Unit (EMU) is defined as 1/360,000 of a centimeter\nand thus there are 914,400 EMUs per inch, and 12,700 EMUs per point.", + "A point, 1/72 of an inch." + ] } }, - "id": "UpdateSlidesPositionRequest", - "description": "Updates the position of slides in the presentation.", - "type": "object" + "id": "Dimension" }, - "TableCellBackgroundFill": { + "LineFill": { + "description": "The fill of the line.", "type": "object", "properties": { "solidFill": { - "description": "Solid color fill.", - "$ref": "SolidFill" - }, - "propertyState": { - "enumDescriptions": [ - "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", - "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", - "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." - ], - "enum": [ - "RENDERED", - "NOT_RENDERED", - "INHERIT" - ], - "description": "The background fill property state.\n\nUpdating the the fill on a table cell will implicitly update this field\nto `RENDERED`, unless another value is specified in the same request. To\nhave no fill on a table cell, set this field to `NOT_RENDERED`. In this\ncase, any other fill fields set in the same request will be ignored.", - "type": "string" + "$ref": "SolidFill", + "description": "Solid color fill." } }, - "id": "TableCellBackgroundFill", - "description": "The table cell background fill." + "id": "LineFill" }, - "UpdatePagePropertiesRequest": { - "properties": { - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `pageProperties` is\nimplied and should not be specified. A single `\"*\"` can be used as\nshort-hand for listing every field.\n\nFor example to update the page background solid fill color, set `fields`\nto `\"pageBackgroundFill.solidFill.color\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", - "type": "string" - }, - "objectId": { - "description": "The object ID of the page the update is applied to.", - "type": "string" - }, - "pageProperties": { - "$ref": "PageProperties", - "description": "The page properties to update." - } - }, - "id": "UpdatePagePropertiesRequest", - "description": "Updates the properties of a Page.", - "type": "object" - }, - "Group": { - "description": "A PageElement kind representing a\njoined collection of PageElements.", + "VideoProperties": { + "description": "The properties of the Video.", "type": "object", "properties": { - "children": { - "description": "The collection of elements in the group. The minimum size of a group is 2.", - "type": "array", - "items": { - "$ref": "PageElement" - } + "outline": { + "$ref": "Outline", + "description": "The outline of the video. The default outline matches the defaults for new\nvideos created in the Slides editor." } }, - "id": "Group" + "id": "VideoProperties" }, - "Placeholder": { - "description": "The placeholder information that uniquely identifies a placeholder shape.", + "InsertTableRowsRequest": { "type": "object", "properties": { - "index": { - "description": "The index of the placeholder. If the same placeholder types are present in\nthe same page, they would have different index values.", + "number": { "format": "int32", + "description": "The number of rows to be inserted. Maximum 20 per request.", "type": "integer" }, - "type": { - "description": "The type of the placeholder.", + "cellLocation": { + "description": "The reference table cell location from which rows will be inserted.\n\nA new row will be inserted above (or below) the row where the reference\ncell is. If the reference cell is a merged cell, a new row will be\ninserted above (or below) the merged cell.", + "$ref": "TableCellLocation" + }, + "tableObjectId": { + "description": "The table to insert rows into.", + "type": "string" + }, + "insertBelow": { + "description": "Whether to insert new rows below the reference cell location.\n\n- `True`: insert below the cell.\n- `False`: insert above the cell.", + "type": "boolean" + } + }, + "id": "InsertTableRowsRequest", + "description": "Inserts rows into a table." + }, + "LayoutProperties": { + "description": "The properties of Page are only\nrelevant for pages with page_type LAYOUT.", + "type": "object", + "properties": { + "masterObjectId": { + "description": "The object ID of the master that this layout is based on.", + "type": "string" + }, + "name": { + "description": "The name of the layout.", + "type": "string" + }, + "displayName": { + "description": "The human-readable name of the layout.", + "type": "string" + } + }, + "id": "LayoutProperties" + }, + "LineProperties": { + "description": "The properties of the Line.\n\nWhen unset, these fields default to values that match the appearance of\nnew lines created in the Slides editor.", + "type": "object", + "properties": { + "weight": { + "$ref": "Dimension", + "description": "The thickness of the line." + }, + "lineFill": { + "$ref": "LineFill", + "description": "The fill of the line. The default line fill matches the defaults for new\nlines created in the Slides editor." + }, + "dashStyle": { + "description": "The dash style of the line.", "type": "string", "enumDescriptions": [ - "Default value, signifies it is not a placeholder.", - "Body text.", - "Chart or graph.", - "Clip art image.", - "Title centered.", - "Diagram.", - "Date and time.", - "Footer text.", - "Header text.", - "Multimedia.", - "Any content type.", - "Picture.", - "Number of a slide.", - "Subtitle.", - "Table.", - "Slide title.", - "Slide image." + "Unspecified dash style.", + "Solid line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'solid'.\nThis is the default dash style.", + "Dotted line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dot'.", + "Dashed line. Corresponds to ECMA-376 ST_PresetLineDashVal value 'dash'.", + "Alternating dashes and dots. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'dashDot'.", + "Line with large dashes. Corresponds to ECMA-376 ST_PresetLineDashVal\nvalue 'lgDash'.", + "Alternating large dashes and dots. Corresponds to ECMA-376\nST_PresetLineDashVal value 'lgDashDot'." ], "enum": [ - "NONE", - "BODY", - "CHART", - "CLIP_ART", - "CENTERED_TITLE", - "DIAGRAM", - "DATE_AND_TIME", - "FOOTER", - "HEADER", - "MEDIA", - "OBJECT", - "PICTURE", - "SLIDE_NUMBER", - "SUBTITLE", - "TABLE", - "TITLE", - "SLIDE_IMAGE" + "DASH_STYLE_UNSPECIFIED", + "SOLID", + "DOT", + "DASH", + "DASH_DOT", + "LONG_DASH", + "LONG_DASH_DOT" ] }, - "parentObjectId": { - "description": "The object ID of this shape's parent placeholder.\nIf unset, the parent placeholder shape does not exist, so the shape does\nnot inherit properties from any other shape.", + "link": { + "$ref": "Link", + "description": "The hyperlink destination of the line. If unset, there is no link." + }, + "startArrow": { + "enumDescriptions": [ + "An unspecified arrow style.", + "No arrow.", + "Arrow with notched back. Corresponds to ECMA-376 ST_LineEndType value\n'stealth'.", + "Filled arrow. Corresponds to ECMA-376 ST_LineEndType value 'triangle'.", + "Filled circle. Corresponds to ECMA-376 ST_LineEndType value 'oval'.", + "Filled square.", + "Filled diamond. Corresponds to ECMA-376 ST_LineEndType value 'diamond'.", + "Hollow arrow.", + "Hollow circle.", + "Hollow square.", + "Hollow diamond." + ], + "enum": [ + "ARROW_STYLE_UNSPECIFIED", + "NONE", + "STEALTH_ARROW", + "FILL_ARROW", + "FILL_CIRCLE", + "FILL_SQUARE", + "FILL_DIAMOND", + "OPEN_ARROW", + "OPEN_CIRCLE", + "OPEN_SQUARE", + "OPEN_DIAMOND" + ], + "description": "The style of the arrow at the beginning of the line.", + "type": "string" + }, + "endArrow": { + "type": "string", + "enumDescriptions": [ + "An unspecified arrow style.", + "No arrow.", + "Arrow with notched back. Corresponds to ECMA-376 ST_LineEndType value\n'stealth'.", + "Filled arrow. Corresponds to ECMA-376 ST_LineEndType value 'triangle'.", + "Filled circle. Corresponds to ECMA-376 ST_LineEndType value 'oval'.", + "Filled square.", + "Filled diamond. Corresponds to ECMA-376 ST_LineEndType value 'diamond'.", + "Hollow arrow.", + "Hollow circle.", + "Hollow square.", + "Hollow diamond." + ], + "enum": [ + "ARROW_STYLE_UNSPECIFIED", + "NONE", + "STEALTH_ARROW", + "FILL_ARROW", + "FILL_CIRCLE", + "FILL_SQUARE", + "FILL_DIAMOND", + "OPEN_ARROW", + "OPEN_CIRCLE", + "OPEN_SQUARE", + "OPEN_DIAMOND" + ], + "description": "The style of the arrow at the end of the line." + } + }, + "id": "LineProperties" + }, + "Presentation": { + "description": "A Google Slides presentation.", + "type": "object", + "properties": { + "notesMaster": { + "$ref": "Page", + "description": "The notes master in the presentation. It serves three purposes:\n\n- Placeholder shapes on a notes master contain the default text styles and\n shape properties of all placeholder shapes on notes pages. Specifically,\n a `SLIDE_IMAGE` placeholder shape contains the slide thumbnail, and a\n `BODY` placeholder shape contains the speaker notes.\n- The notes master page properties define the common page properties\n inherited by all notes pages.\n- Any other shapes on the notes master will appear on all notes pages.\n\nThe notes master is read-only." + }, + "layouts": { + "description": "The layouts in the presentation. A layout is a template that determines\nhow content is arranged and styled on the slides that inherit from that\nlayout.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, + "title": { + "description": "The title of the presentation.", + "type": "string" + }, + "masters": { + "description": "The slide masters in the presentation. A slide master contains all common\npage elements and the common properties for a set of layouts. They serve\nthree purposes:\n\n- Placeholder shapes on a master contain the default text styles and shape\n properties of all placeholder shapes on pages that use that master.\n- The master page properties define the common page properties inherited by\n its layouts.\n- Any other shapes on the master slide will appear on all slides using that\n master, regardless of their layout.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, + "locale": { + "description": "The locale of the presentation, as an IETF BCP 47 language tag.", + "type": "string" + }, + "pageSize": { + "$ref": "Size", + "description": "The size of pages in the presentation." + }, + "presentationId": { + "type": "string", + "description": "The ID of the presentation." + }, + "slides": { + "description": "The slides in the presentation.\nA slide inherits properties from a slide layout.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, + "revisionId": { + "description": "The revision ID of the presentation. Can be used in update requests\nto assert that the presentation revision hasn't changed since the last\nread operation. Only populated if the user has edit access to the\npresentation.\n\nThe format of the revision ID may change over time, so it should be treated\nopaquely. A returned revision ID is only guaranteed to be valid for 24\nhours after it has been returned and cannot be shared across users. If the\nrevision ID is unchanged between calls, then the presentation has not\nchanged. Conversely, a changed ID (for the same presentation and user)\nusually means the presentation has been updated; however, a changed ID can\nalso be due to internal factors such as ID format changes.", "type": "string" } }, - "id": "Placeholder" + "id": "Presentation" }, - "DuplicateObjectRequest": { + "OpaqueColor": { + "description": "A themeable solid color value.", "type": "object", "properties": { - "objectIds": { - "description": "The object being duplicated may contain other objects, for example when\nduplicating a slide or a group page element. This map defines how the IDs\nof duplicated objects are generated: the keys are the IDs of the original\nobjects and its values are the IDs that will be assigned to the\ncorresponding duplicate object. The ID of the source object's duplicate\nmay be specified in this map as well, using the same value of the\n`object_id` field as a key and the newly desired ID as the value.\n\nAll keys must correspond to existing IDs in the presentation. All values\nmust be unique in the presentation and must start with an alphanumeric\ncharacter or an underscore (matches regex `[a-zA-Z0-9_]`); remaining\ncharacters may include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`). The length of the new ID must not be less than 5 or\ngreater than 50.\n\nIf any IDs of source objects are omitted from the map, a new random ID will\nbe assigned. If the map is empty or unset, all duplicate objects will\nreceive a new random ID.", - "type": "object", - "additionalProperties": { - "type": "string" - } + "rgbColor": { + "$ref": "RgbColor", + "description": "An opaque RGB color." + }, + "themeColor": { + "enum": [ + "THEME_COLOR_TYPE_UNSPECIFIED", + "DARK1", + "LIGHT1", + "DARK2", + "LIGHT2", + "ACCENT1", + "ACCENT2", + "ACCENT3", + "ACCENT4", + "ACCENT5", + "ACCENT6", + "HYPERLINK", + "FOLLOWED_HYPERLINK", + "TEXT1", + "BACKGROUND1", + "TEXT2", + "BACKGROUND2" + ], + "description": "An opaque theme color.", + "type": "string", + "enumDescriptions": [ + "Unspecified theme color. This value should not be used.", + "Represents the first dark color.", + "Represents the first light color.", + "Represents the second dark color.", + "Represents the second light color.", + "Represents the first accent color.", + "Represents the second accent color.", + "Represents the third accent color.", + "Represents the fourth accent color.", + "Represents the fifth accent color.", + "Represents the sixth accent color.", + "Represents the color to use for hyperlinks.", + "Represents the color to use for visited hyperlinks.", + "Represents the first text color.", + "Represents the first background color.", + "Represents the second text color.", + "Represents the second background color." + ] + } + }, + "id": "OpaqueColor" + }, + "ImageProperties": { + "description": "The properties of the Image.", + "type": "object", + "properties": { + "shadow": { + "description": "The shadow of the image. If not set, the image has no shadow. This property\nis read-only.", + "$ref": "Shadow" + }, + "contrast": { + "format": "float", + "description": "The contrast effect of the image. The value should be in the interval\n[-1.0, 1.0], where 0 means no effect. This property is read-only.", + "type": "number" + }, + "link": { + "$ref": "Link", + "description": "The hyperlink destination of the image. If unset, there is no link." + }, + "recolor": { + "description": "The recolor effect of the image. If not set, the image is not recolored.\nThis property is read-only.", + "$ref": "Recolor" + }, + "cropProperties": { + "$ref": "CropProperties", + "description": "The crop properties of the image. If not set, the image is not cropped.\nThis property is read-only." + }, + "outline": { + "$ref": "Outline", + "description": "The outline of the image. If not set, the the image has no outline." + }, + "brightness": { + "format": "float", + "description": "The brightness effect of the image. The value should be in the interval\n[-1.0, 1.0], where 0 means no effect. This property is read-only.", + "type": "number" + }, + "transparency": { + "type": "number", + "format": "float", + "description": "The transparency effect of the image. The value should be in the interval\n[0.0, 1.0], where 0 means no effect and 1 means completely transparent.\nThis property is read-only." + } + }, + "id": "ImageProperties" + }, + "ReplaceAllShapesWithImageResponse": { + "description": "The result of replacing shapes with an image.", + "type": "object", + "properties": { + "occurrencesChanged": { + "format": "int32", + "description": "The number of shapes replaced with images.", + "type": "integer" + } + }, + "id": "ReplaceAllShapesWithImageResponse" + }, + "Line": { + "description": "A PageElement kind representing a\nline, curved connector, or bent connector.", + "type": "object", + "properties": { + "lineType": { + "enumDescriptions": [ + "An unspecified line type.", + "Straight connector 1 form. Corresponds to ECMA-376 ST_ShapeType\n'straightConnector1'.", + "Bent connector 2 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector2'.", + "Bent connector 3 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector3'.", + "Bent connector 4 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector4'.", + "Bent connector 5 form. Corresponds to ECMA-376 ST_ShapeType\n'bentConnector5'.", + "Curved connector 2 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector2'.", + "Curved connector 3 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector3'.", + "Curved connector 4 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector4'.", + "Curved connector 5 form. Corresponds to ECMA-376 ST_ShapeType\n'curvedConnector5'." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "STRAIGHT_CONNECTOR_1", + "BENT_CONNECTOR_2", + "BENT_CONNECTOR_3", + "BENT_CONNECTOR_4", + "BENT_CONNECTOR_5", + "CURVED_CONNECTOR_2", + "CURVED_CONNECTOR_3", + "CURVED_CONNECTOR_4", + "CURVED_CONNECTOR_5" + ], + "description": "The type of the line.", + "type": "string" + }, + "lineProperties": { + "$ref": "LineProperties", + "description": "The properties of the line." + } + }, + "id": "Line" + }, + "BatchUpdatePresentationResponse": { + "description": "Response message from a batch update.", + "type": "object", + "properties": { + "presentationId": { + "description": "The presentation the updates were applied to.", + "type": "string" + }, + "replies": { + "description": "The reply of the updates. This maps 1:1 with the updates, although\nreplies to some requests may be empty.", + "items": { + "$ref": "Response" + }, + "type": "array" + } + }, + "id": "BatchUpdatePresentationResponse" + }, + "CreateSheetsChartRequest": { + "type": "object", + "properties": { + "elementProperties": { + "$ref": "PageElementProperties", + "description": "The element properties for the chart.\n\nWhen the aspect ratio of the provided size does not match the chart aspect\nratio, the chart is scaled and centered with respect to the size in order\nto maintain aspect ratio. The provided transform is applied after this\noperation." + }, + "linkingMode": { + "description": "The mode with which the chart is linked to the source spreadsheet. When\nnot specified, the chart will be an image that is not linked.", + "type": "string", + "enumDescriptions": [ + "The chart is not associated with the source spreadsheet and cannot be\nupdated. A chart that is not linked will be inserted as an image.", + "Linking the chart allows it to be updated, and other collaborators will\nsee a link to the spreadsheet." + ], + "enum": [ + "NOT_LINKED_IMAGE", + "LINKED" + ] + }, + "spreadsheetId": { + "description": "The ID of the Google Sheets spreadsheet that contains the chart.", + "type": "string" + }, + "chartId": { + "type": "integer", + "format": "int32", + "description": "The ID of the specific chart in the Google Sheets spreadsheet." }, "objectId": { - "type": "string", - "description": "The ID of the object to duplicate." + "description": "A user-supplied object ID.\n\nIf specified, the ID must be unique among all pages and page elements in\nthe presentation. The ID should start with a word character [a-zA-Z0-9_]\nand then followed by any number of the following characters [a-zA-Z0-9_-:].\nThe length of the ID should not be less than 5 or greater than 50.\nIf empty, a unique identifier will be generated.", + "type": "string" } }, - "id": "DuplicateObjectRequest", - "description": "Duplicates a slide or page element.\n\nWhen duplicating a slide, the duplicate slide will be created immediately\nfollowing the specified slide. When duplicating a page element, the duplicate\nwill be placed on the same page at the same position as the original." + "id": "CreateSheetsChartRequest", + "description": "Creates an embedded Google Sheets chart.\n\nNOTE: Chart creation requires at least one of the spreadsheets.readonly,\nspreadsheets, drive.readonly, or drive OAuth scopes." }, - "ReplaceAllTextRequest": { - "id": "ReplaceAllTextRequest", - "description": "Replaces all instances of text matching a criteria with replace text.", + "CreateImageResponse": { + "description": "The result of creating an image.", "type": "object", "properties": { - "replaceText": { - "description": "The text that will replace the matched text.", + "objectId": { + "description": "The object ID of the created image.", + "type": "string" + } + }, + "id": "CreateImageResponse" + }, + "SlideProperties": { + "description": "The properties of Page that are only\nrelevant for pages with page_type SLIDE.", + "type": "object", + "properties": { + "notesPage": { + "$ref": "Page", + "description": "The notes page that this slide is associated with. It defines the visual\nappearance of a notes page when printing or exporting slides with speaker\nnotes. A notes page inherits properties from the\nnotes master.\nThe placeholder shape with type BODY on the notes page contains the speaker\nnotes for this slide. The ID of this shape is identified by the\nspeakerNotesObjectId field.\nThe notes page is read-only except for the text content and styles of the\nspeaker notes shape." + }, + "masterObjectId": { + "description": "The object ID of the master that this slide is based on.", "type": "string" }, - "containsText": { - "$ref": "SubstringMatchCriteria", - "description": "Finds text in a shape matching this substring." + "layoutObjectId": { + "description": "The object ID of the layout that this slide is based on.", + "type": "string" + } + }, + "id": "SlideProperties" + }, + "Response": { + "type": "object", + "properties": { + "createImage": { + "$ref": "CreateImageResponse", + "description": "The result of creating an image." + }, + "createVideo": { + "description": "The result of creating a video.", + "$ref": "CreateVideoResponse" + }, + "replaceAllShapesWithSheetsChart": { + "$ref": "ReplaceAllShapesWithSheetsChartResponse", + "description": "The result of replacing all shapes matching some criteria with a Google\nSheets chart." + }, + "createSheetsChart": { + "$ref": "CreateSheetsChartResponse", + "description": "The result of creating a Google Sheets chart." + }, + "replaceAllShapesWithImage": { + "description": "The result of replacing all shapes matching some criteria with an\nimage.", + "$ref": "ReplaceAllShapesWithImageResponse" + }, + "createTable": { + "description": "The result of creating a table.", + "$ref": "CreateTableResponse" + }, + "replaceAllText": { + "description": "The result of replacing text.", + "$ref": "ReplaceAllTextResponse" + }, + "createSlide": { + "description": "The result of creating a slide.", + "$ref": "CreateSlideResponse" + }, + "duplicateObject": { + "description": "The result of duplicating an object.", + "$ref": "DuplicateObjectResponse" + }, + "createShape": { + "$ref": "CreateShapeResponse", + "description": "The result of creating a shape." + }, + "createLine": { + "description": "The result of creating a line.", + "$ref": "CreateLineResponse" + } + }, + "id": "Response", + "description": "A single response from an update." + }, + "MasterProperties": { + "description": "The properties of Page that are only\nrelevant for pages with page_type MASTER.", + "type": "object", + "properties": { + "displayName": { + "description": "The human-readable name of the master.", + "type": "string" + } + }, + "id": "MasterProperties" + }, + "TextRun": { + "id": "TextRun", + "description": "A TextElement kind that represents a run of text that all has the same\nstyling.", + "type": "object", + "properties": { + "content": { + "description": "The text of this run.", + "type": "string" + }, + "style": { + "$ref": "TextStyle", + "description": "The styling applied to this run." } } }, - "Page": { + "LayoutReference": { "properties": { - "objectId": { - "description": "The object ID for this page. Object IDs used by\nPage and\nPageElement share the same namespace.", + "layoutId": { + "description": "Layout ID: the object ID of one of the layouts in the presentation.", "type": "string" }, - "revisionId": { - "description": "The revision ID of the presentation containing this page. Can be used in\nupdate requests to assert that the presentation revision hasn't changed\nsince the last read operation. Only populated if the user has edit access\nto the presentation.\n\nThe format of the revision ID may change over time, so it should be treated\nopaquely. A returned revision ID is only guaranteed to be valid for 24\nhours after it has been returned and cannot be shared across users. If the\nrevision ID is unchanged between calls, then the presentation has not\nchanged. Conversely, a changed ID (for the same presentation and user)\nusually means the presentation has been updated; however, a changed ID can\nalso be due to internal factors such as ID format changes.", - "type": "string" - }, - "layoutProperties": { - "description": "Layout specific properties. Only set if page_type = LAYOUT.", - "$ref": "LayoutProperties" - }, - "pageType": { - "type": "string", + "predefinedLayout": { "enumDescriptions": [ - "A slide page.", - "A master slide page.", - "A layout page.", - "A notes page.", - "A notes master page." + "Unspecified layout.", + "Blank layout, with no placeholders.", + "Layout with a caption at the bottom.", + "Layout with a title and a subtitle.", + "Layout with a title and body.", + "Layout with a title and two columns.", + "Layout with only a title.", + "Layout with a section title.", + "Layout with a title and subtitle on one side and description on the other.", + "Layout with one title and one body, arranged in a single column.", + "Layout with a main point.", + "Layout with a big number heading." ], "enum": [ - "SLIDE", - "MASTER", - "LAYOUT", - "NOTES", - "NOTES_MASTER" + "PREDEFINED_LAYOUT_UNSPECIFIED", + "BLANK", + "CAPTION_ONLY", + "TITLE", + "TITLE_AND_BODY", + "TITLE_AND_TWO_COLUMNS", + "TITLE_ONLY", + "SECTION_HEADER", + "SECTION_TITLE_AND_DESCRIPTION", + "ONE_COLUMN_TEXT", + "MAIN_POINT", + "BIG_NUMBER" ], - "description": "The type of the page." - }, - "pageElements": { - "description": "The page elements rendered on the page.", - "type": "array", - "items": { - "$ref": "PageElement" - } - }, - "notesProperties": { - "description": "Notes specific properties. Only set if page_type = NOTES.", - "$ref": "NotesProperties" - }, - "pageProperties": { - "description": "The properties of the page.", - "$ref": "PageProperties" - }, - "slideProperties": { - "$ref": "SlideProperties", - "description": "Slide specific properties. Only set if page_type = SLIDE." + "description": "Predefined layout.", + "type": "string" } }, - "id": "Page", - "description": "A page in a presentation.", + "id": "LayoutReference", + "description": "Slide layout reference. This may reference either:\n\n- A predefined layout\n- One of the layouts in the presentation.", "type": "object" }, - "ShapeBackgroundFill": { + "SubstringMatchCriteria": { + "type": "object", + "properties": { + "matchCase": { + "type": "boolean", + "description": "Indicates whether the search should respect case:\n\n- `True`: the search is case sensitive.\n- `False`: the search is case insensitive." + }, + "text": { + "description": "The text to search for in the shape or table.", + "type": "string" + } + }, + "id": "SubstringMatchCriteria", + "description": "A criteria that matches a specific string of text in a shape or table." + }, + "TableRange": { + "properties": { + "rowSpan": { + "format": "int32", + "description": "The row span of the table range.", + "type": "integer" + }, + "location": { + "$ref": "TableCellLocation", + "description": "The starting location of the table range." + }, + "columnSpan": { + "format": "int32", + "description": "The column span of the table range.", + "type": "integer" + } + }, + "id": "TableRange", + "description": "A table range represents a reference to a subset of a table.\n\nIt's important to note that the cells specified by a table range do not\nnecessarily form a rectangle. For example, let's say we have a 3 x 3 table\nwhere all the cells of the last row are merged together. The table looks\nlike this:\n\n \n [ ]\n\nA table range with location = (0, 0), row span = 3 and column span = 2\nspecifies the following cells:\n\n x x \n [ x ]", + "type": "object" + }, + "CreateTableResponse": { + "description": "The result of creating a table.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the created table.", + "type": "string" + } + }, + "id": "CreateTableResponse" + }, + "CreateTableRequest": { + "description": "Creates a new table.", + "type": "object", + "properties": { + "columns": { + "format": "int32", + "description": "Number of columns in the table.", + "type": "integer" + }, + "objectId": { + "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", + "type": "string" + }, + "elementProperties": { + "$ref": "PageElementProperties", + "description": "The element properties for the table.\n\nThe table will be created at the provided size, subject to a minimum size.\nIf no size is provided, the table will be automatically sized.\n\nTable transforms must have a scale of 1 and no shear components. If no\ntransform is provided, the table will be centered on the page." + }, + "rows": { + "format": "int32", + "description": "Number of rows in the table.", + "type": "integer" + } + }, + "id": "CreateTableRequest" + }, + "Table": { + "description": "A PageElement kind representing a\ntable.", + "type": "object", + "properties": { + "rows": { + "type": "integer", + "format": "int32", + "description": "Number of rows in the table." + }, + "tableColumns": { + "description": "Properties of each column.", + "items": { + "$ref": "TableColumnProperties" + }, + "type": "array" + }, + "columns": { + "format": "int32", + "description": "Number of columns in the table.", + "type": "integer" + }, + "tableRows": { + "description": "Properties and contents of each row.\n\nCells that span multiple rows are contained in only one of these rows and\nhave a row_span greater\nthan 1.", + "items": { + "$ref": "TableRow" + }, + "type": "array" + } + }, + "id": "Table" + }, + "PageBackgroundFill": { "type": "object", "properties": { "propertyState": { @@ -3162,424 +3385,237 @@ "NOT_RENDERED", "INHERIT" ], - "description": "The background fill property state.\n\nUpdating the the fill on a shape will implicitly update this field to\n`RENDERED`, unless another value is specified in the same request. To\nhave no fill on a shape, set this field to `NOT_RENDERED`. In this case,\nany other fill fields set in the same request will be ignored.", + "description": "The background fill property state.\n\nUpdating the fill on a page will implicitly update this field to\n`RENDERED`, unless another value is specified in the same request. To\nhave no fill on a page, set this field to `NOT_RENDERED`. In this case,\nany other fill fields set in the same request will be ignored.", "type": "string" }, + "stretchedPictureFill": { + "$ref": "StretchedPictureFill", + "description": "Stretched picture fill." + }, "solidFill": { "$ref": "SolidFill", "description": "Solid color fill." } }, - "id": "ShapeBackgroundFill", - "description": "The shape background fill." + "id": "PageBackgroundFill", + "description": "The page background fill." }, - "CropProperties": { - "description": "The crop properties of an object enclosed in a container. For example, an\nImage.\n\nThe crop properties is represented by the offsets of four edges which define\na crop rectangle. The offsets are measured in percentage from the\ncorresponding edges of the object's original bounding rectangle towards\ninside, relative to the object's original dimensions.\n\n- If the offset is in the interval (0, 1), the corresponding edge of crop\nrectangle is positioned inside of the object's original bounding rectangle.\n- If the offset is negative or greater than 1, the corresponding edge of crop\nrectangle is positioned outside of the object's original bounding rectangle.\n- If the left edge of the crop rectangle is on the right side of its right\nedge, the object will be flipped horizontally.\n- If the top edge of the crop rectangle is below its bottom edge, the object\nwill be flipped vertically.\n- If all offsets and rotation angle is 0, the object is not cropped.\n\nAfter cropping, the content in the crop rectangle will be stretched to fit\nits container.", - "type": "object", - "properties": { - "bottomOffset": { - "description": "The offset specifies the bottom edge of the crop rectangle that is located\nabove the original bounding rectangle bottom edge, relative to the object's\noriginal height.", - "format": "float", - "type": "number" - }, - "angle": { - "description": "The rotation angle of the crop window around its center, in radians.\nRotation angle is applied after the offset.", - "format": "float", - "type": "number" - }, - "topOffset": { - "description": "The offset specifies the top edge of the crop rectangle that is located\nbelow the original bounding rectangle top edge, relative to the object's\noriginal height.", - "format": "float", - "type": "number" - }, - "leftOffset": { - "description": "The offset specifies the left edge of the crop rectangle that is located to\nthe right of the original bounding rectangle left edge, relative to the\nobject's original width.", - "format": "float", - "type": "number" - }, - "rightOffset": { - "description": "The offset specifies the right edge of the crop rectangle that is located\nto the left of the original bounding rectangle right edge, relative to the\nobject's original width.", - "format": "float", - "type": "number" - } - }, - "id": "CropProperties" - }, - "ReplaceAllShapesWithSheetsChartRequest": { - "description": "Replaces all shapes that match the given criteria with the provided Google\nSheets chart. The chart will be scaled and centered to fit within the bounds\nof the original shape.\n\nNOTE: Replacing shapes with a chart requires at least one of the\nspreadsheets.readonly, spreadsheets, drive.readonly, or drive OAuth scopes.", + "SheetsChart": { "type": "object", "properties": { "spreadsheetId": { - "type": "string", - "description": "The ID of the Google Sheets spreadsheet that contains the chart." - }, - "linkingMode": { - "enum": [ - "NOT_LINKED_IMAGE", - "LINKED" - ], - "description": "The mode with which the chart is linked to the source spreadsheet. When\nnot specified, the chart will be an image that is not linked.", - "type": "string", - "enumDescriptions": [ - "The chart is not associated with the source spreadsheet and cannot be\nupdated. A chart that is not linked will be inserted as an image.", - "Linking the chart allows it to be updated, and other collaborators will\nsee a link to the spreadsheet." - ] - }, - "containsText": { - "description": "The criteria that the shapes must match in order to be replaced. The\nrequest will replace all of the shapes that contain the given text.", - "$ref": "SubstringMatchCriteria" + "description": "The ID of the Google Sheets spreadsheet that contains the source chart.", + "type": "string" }, "chartId": { - "description": "The ID of the specific chart in the Google Sheets spreadsheet.", "format": "int32", + "description": "The ID of the specific chart in the Google Sheets spreadsheet that is\nembedded.", "type": "integer" + }, + "sheetsChartProperties": { + "$ref": "SheetsChartProperties", + "description": "The properties of the Sheets chart." + }, + "contentUrl": { + "description": "The URL of an image of the embedded chart, with a default lifetime of 30\nminutes. This URL is tagged with the account of the requester. Anyone with\nthe URL effectively accesses the image as the original requester. Access to\nthe image may be lost if the presentation's sharing settings change.", + "type": "string" } }, - "id": "ReplaceAllShapesWithSheetsChartRequest" + "id": "SheetsChart", + "description": "A PageElement kind representing\na linked chart embedded from Google Sheets." }, - "ColorStop": { - "description": "A color and position in a gradient band.", + "SolidFill": { + "id": "SolidFill", + "description": "A solid color fill. The page or page element is filled entirely with the\nspecified color value.\n\nIf any field is unset, its value may be inherited from a parent placeholder\nif it exists.", "type": "object", "properties": { "alpha": { - "description": "The alpha value of this color in the gradient band. Defaults to 1.0,\nfully opaque.", - "format": "float", - "type": "number" - }, - "position": { - "description": "The relative position of the color stop in the gradient band measured\nin percentage. The value should be in the interval [0.0, 1.0].", "format": "float", + "description": "The fraction of this `color` that should be applied to the pixel.\nThat is, the final pixel color is defined by the equation:\n\n pixel color = alpha * (color) + (1.0 - alpha) * (background color)\n\nThis means that a value of 1.0 corresponds to a solid color, whereas\na value of 0.0 corresponds to a completely transparent color.", "type": "number" }, "color": { "$ref": "OpaqueColor", - "description": "The color of the gradient stop." - } - }, - "id": "ColorStop" - }, - "Range": { - "description": "Specifies a contiguous range of an indexed collection, such as characters in\ntext.", - "type": "object", - "properties": { - "startIndex": { - "description": "The optional zero-based index of the beginning of the collection.\nRequired for `FIXED_RANGE` and `FROM_START_INDEX` ranges.", - "format": "int32", - "type": "integer" - }, - "endIndex": { - "description": "The optional zero-based index of the end of the collection.\nRequired for `FIXED_RANGE` ranges.", - "format": "int32", - "type": "integer" - }, - "type": { - "description": "The type of range.", - "type": "string", - "enumDescriptions": [ - "Unspecified range type. This value must not be used.", - "A fixed range. Both the `start_index` and\n`end_index` must be specified.", - "Starts the range at `start_index` and continues until the\nend of the collection. The `end_index` must not be specified.", - "Sets the range to be the whole length of the collection. Both the\n`start_index` and the `end_index` must not be\nspecified." - ], - "enum": [ - "RANGE_TYPE_UNSPECIFIED", - "FIXED_RANGE", - "FROM_START_INDEX", - "ALL" - ] - } - }, - "id": "Range" - }, - "CreateVideoRequest": { - "description": "Creates a video.", - "type": "object", - "properties": { - "objectId": { - "description": "A user-supplied object ID.\n\nIf you specify an ID, it must be unique among all pages and page elements\nin the presentation. The ID must start with an alphanumeric character or an\nunderscore (matches regex `[a-zA-Z0-9_]`); remaining characters\nmay include those as well as a hyphen or colon (matches regex\n`[a-zA-Z0-9_-:]`).\nThe length of the ID must not be less than 5 or greater than 50.\n\nIf you don't specify an ID, a unique one is generated.", - "type": "string" - }, - "source": { - "enum": [ - "SOURCE_UNSPECIFIED", - "YOUTUBE" - ], - "description": "The video source.", - "type": "string", - "enumDescriptions": [ - "The video source is unspecified.", - "The video source is YouTube." - ] - }, - "elementProperties": { - "description": "The element properties for the video.", - "$ref": "PageElementProperties" - }, - "id": { - "description": "The video source's unique identifier for this video.\n\ne.g. For YouTube video https://www.youtube.com/watch?v=7U3axjORYZ0,\nthe ID is 7U3axjORYZ0.", - "type": "string" - } - }, - "id": "CreateVideoRequest" - }, - "DuplicateObjectResponse": { - "type": "object", - "properties": { - "objectId": { - "type": "string", - "description": "The ID of the new duplicate object." - } - }, - "id": "DuplicateObjectResponse", - "description": "The response of duplicating an object." - }, - "ReplaceAllShapesWithImageRequest": { - "id": "ReplaceAllShapesWithImageRequest", - "description": "Replaces all shapes that match the given criteria with the provided image.", - "type": "object", - "properties": { - "containsText": { - "description": "If set, this request will replace all of the shapes that contain the\ngiven text.", - "$ref": "SubstringMatchCriteria" - }, - "imageUrl": { - "description": "The image URL.\n\nThe image is fetched once at insertion time and a copy is stored for\ndisplay inside the presentation. Images must be less than 50MB in size,\ncannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF\nformat.", - "type": "string" - }, - "replaceMethod": { - "enumDescriptions": [ - "Scales and centers the image to fit within the bounds of the original\nshape and maintains the image's aspect ratio. The rendered size of the\nimage may be smaller than the size of the shape. This is the default\nmethod when one is not specified.", - "Scales and centers the image to fill the bounds of the original shape.\nThe image may be cropped in order to fill the shape. The rendered size of\nthe image will be the same as that of the original shape." - ], - "enum": [ - "CENTER_INSIDE", - "CENTER_CROP" - ], - "description": "The replace method.", - "type": "string" + "description": "The color value of the solid fill." } } }, - "Shadow": { - "id": "Shadow", - "description": "The shadow properties of a page element.\n\nIf these fields are unset, they may be inherited from a parent placeholder\nif it exists. If there is no parent, the fields will default to the value\nused for new page elements created in the Slides editor, which may depend on\nthe page element kind.", + "ThemeColorPair": { + "description": "A pair mapping a theme color type to the concrete color it represents.", "type": "object", "properties": { - "rotateWithShape": { - "description": "Whether the shadow should rotate with the shape.", - "type": "boolean" - }, - "propertyState": { - "description": "The shadow property state.\n\nUpdating the the shadow on a page element will implicitly update this field\nto `RENDERED`, unless another value is specified in the same request. To\nhave no shadow on a page element, set this field to `NOT_RENDERED`. In this\ncase, any other shadow fields set in the same request will be ignored.", - "type": "string", - "enumDescriptions": [ - "If a property's state is RENDERED, then the element has the corresponding\nproperty when rendered on a page. If the element is a placeholder shape as\ndetermined by the placeholder\nfield, and it inherits from a placeholder shape, the corresponding field\nmay be unset, meaning that the property value is inherited from a parent\nplaceholder. If the element does not inherit, then the field will contain\nthe rendered value. This is the default value.", - "If a property's state is NOT_RENDERED, then the element does not have the\ncorresponding property when rendered on a page. However, the field may\nstill be set so it can be inherited by child shapes. To remove a property\nfrom a rendered element, set its property_state to NOT_RENDERED.", - "If a property's state is INHERIT, then the property state uses the value of\ncorresponding `property_state` field on the parent shape. Elements that do\nnot inherit will never have an INHERIT property state." - ], - "enum": [ - "RENDERED", - "NOT_RENDERED", - "INHERIT" - ] - }, - "blurRadius": { - "$ref": "Dimension", - "description": "The radius of the shadow blur. The larger the radius, the more diffuse the\nshadow becomes." + "color": { + "$ref": "RgbColor", + "description": "The concrete color corresponding to the theme color type above." }, "type": { - "enum": [ - "SHADOW_TYPE_UNSPECIFIED", - "OUTER" - ], - "description": "The type of the shadow.", "type": "string", "enumDescriptions": [ - "Unspecified shadow type.", - "Outer shadow." - ] + "Unspecified theme color. This value should not be used.", + "Represents the first dark color.", + "Represents the first light color.", + "Represents the second dark color.", + "Represents the second light color.", + "Represents the first accent color.", + "Represents the second accent color.", + "Represents the third accent color.", + "Represents the fourth accent color.", + "Represents the fifth accent color.", + "Represents the sixth accent color.", + "Represents the color to use for hyperlinks.", + "Represents the color to use for visited hyperlinks.", + "Represents the first text color.", + "Represents the first background color.", + "Represents the second text color.", + "Represents the second background color." + ], + "enum": [ + "THEME_COLOR_TYPE_UNSPECIFIED", + "DARK1", + "LIGHT1", + "DARK2", + "LIGHT2", + "ACCENT1", + "ACCENT2", + "ACCENT3", + "ACCENT4", + "ACCENT5", + "ACCENT6", + "HYPERLINK", + "FOLLOWED_HYPERLINK", + "TEXT1", + "BACKGROUND1", + "TEXT2", + "BACKGROUND2" + ], + "description": "The type of the theme color." + } + }, + "id": "ThemeColorPair" + }, + "OptionalColor": { + "description": "A color that can either be fully opaque or fully transparent.", + "type": "object", + "properties": { + "opaqueColor": { + "$ref": "OpaqueColor", + "description": "If set, this will be used as an opaque color. If unset, this represents\na transparent color." + } + }, + "id": "OptionalColor" + }, + "PageElementProperties": { + "properties": { + "pageObjectId": { + "description": "The object ID of the page where the element is located.", + "type": "string" + }, + "size": { + "description": "The size of the element.", + "$ref": "Size" }, "transform": { - "description": "Transform that encodes the translate, scale, and skew of the shadow,\nrelative to the alignment position.", - "$ref": "AffineTransform" - }, - "alignment": { - "enumDescriptions": [ - "Unspecified.", - "Top left.", - "Top center.", - "Top right.", - "Left center.", - "Center.", - "Right center.", - "Bottom left.", - "Bottom center.", - "Bottom right." - ], - "enum": [ - "RECTANGLE_POSITION_UNSPECIFIED", - "TOP_LEFT", - "TOP_CENTER", - "TOP_RIGHT", - "LEFT_CENTER", - "CENTER", - "RIGHT_CENTER", - "BOTTOM_LEFT", - "BOTTOM_CENTER", - "BOTTOM_RIGHT" - ], - "description": "The alignment point of the shadow, that sets the origin for translate,\nscale and skew of the shadow.", - "type": "string" - }, - "alpha": { - "description": "The alpha of the shadow's color, from 0.0 to 1.0.", - "format": "float", - "type": "number" - }, - "color": { - "description": "The shadow color value.", - "$ref": "OpaqueColor" - } - } - }, - "DeleteTableRowRequest": { - "description": "Deletes a row from a table.", - "type": "object", - "properties": { - "cellLocation": { - "$ref": "TableCellLocation", - "description": "The reference table cell location from which a row will be deleted.\n\nThe row this cell spans will be deleted. If this is a merged cell, multiple\nrows will be deleted. If no rows remain in the table after this deletion,\nthe whole table is deleted." - }, - "tableObjectId": { - "description": "The table to delete rows from.", - "type": "string" + "$ref": "AffineTransform", + "description": "The transform for the element." } }, - "id": "DeleteTableRowRequest" - }, - "Bullet": { - "description": "Describes the bullet of a paragraph.", - "type": "object", - "properties": { - "listId": { - "description": "The ID of the list this paragraph belongs to.", - "type": "string" - }, - "glyph": { - "description": "The rendered bullet glyph for this paragraph.", - "type": "string" - }, - "nestingLevel": { - "description": "The nesting level of this paragraph in the list.", - "format": "int32", - "type": "integer" - }, - "bulletStyle": { - "$ref": "TextStyle", - "description": "The paragraph specific text style applied to this bullet." - } - }, - "id": "Bullet" - }, - "OutlineFill": { - "description": "The fill of the outline.", - "type": "object", - "properties": { - "solidFill": { - "description": "Solid color fill.", - "$ref": "SolidFill" - } - }, - "id": "OutlineFill" - }, - "TableCellLocation": { - "properties": { - "rowIndex": { - "description": "The 0-based row index.", - "format": "int32", - "type": "integer" - }, - "columnIndex": { - "description": "The 0-based column index.", - "format": "int32", - "type": "integer" - } - }, - "id": "TableCellLocation", - "description": "A location of a single table cell within a table.", + "id": "PageElementProperties", + "description": "Common properties for a page element.\n\nNote: When you initially create a\nPageElement, the API may modify\nthe values of both `size` and `transform`, but the\nvisual size will be unchanged.", "type": "object" }, - "CreateLineResponse": { - "description": "The result of creating a line.", + "SheetsChartProperties": { "type": "object", "properties": { + "chartImageProperties": { + "$ref": "ImageProperties", + "description": "The properties of the embedded chart image." + } + }, + "id": "SheetsChartProperties", + "description": "The properties of the SheetsChart." + }, + "StretchedPictureFill": { + "description": "The stretched picture fill. The page or page element is filled entirely with\nthe specified picture. The picture is stretched to fit its container.", + "type": "object", + "properties": { + "contentUrl": { + "description": "Reading the content_url:\n\nAn URL to a picture with a default lifetime of 30 minutes.\nThis URL is tagged with the account of the requester. Anyone with the URL\neffectively accesses the picture as the original requester. Access to the\npicture may be lost if the presentation's sharing settings change.\n\nWriting the content_url:\n\nThe picture is fetched once at insertion time and a copy is stored for\ndisplay inside the presentation. Pictures must be less than 50MB in size,\ncannot exceed 25 megapixels, and must be in either in PNG, JPEG, or GIF\nformat.\n\nThe provided URL can be at maximum 2K bytes large.", + "type": "string" + }, + "size": { + "description": "The original size of the picture fill. This field is read-only.", + "$ref": "Size" + } + }, + "id": "StretchedPictureFill" + }, + "UpdateTextStyleRequest": { + "description": "Update the styling of text in a Shape or\nTable.", + "type": "object", + "properties": { + "textRange": { + "description": "The range of text to style.\n\nThe range may be extended to include adjacent newlines.\n\nIf the range fully contains a paragraph belonging to a list, the\nparagraph's bullet is also updated with the matching text style.", + "$ref": "Range" + }, "objectId": { "type": "string", - "description": "The object ID of the created line." + "description": "The object ID of the shape or table with the text to be styled." + }, + "style": { + "$ref": "TextStyle", + "description": "The style(s) to set on the text.\n\nIf the value for a particular style matches that of the parent, that style\nwill be set to inherit.\n\nCertain text style changes may cause other changes meant to mirror the\nbehavior of the Slides editor. See the documentation of\nTextStyle for more information." + }, + "cellLocation": { + "$ref": "TableCellLocation", + "description": "The location of the cell in the table containing the text to style. If\n`object_id` refers to a table, `cell_location` must have a value.\nOtherwise, it must not." + }, + "fields": { + "format": "google-fieldmask", + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `style` is implied and\nshould not be specified. A single `\"*\"` can be used as short-hand for\nlisting every field.\n\nFor example, to update the text style to bold, set `fields` to `\"bold\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", + "type": "string" } }, - "id": "CreateLineResponse" + "id": "UpdateTextStyleRequest" }, - "ReplaceAllTextResponse": { - "properties": { - "occurrencesChanged": { - "description": "The number of occurrences changed by replacing all text.", - "format": "int32", - "type": "integer" - } - }, - "id": "ReplaceAllTextResponse", - "description": "The result of replacing text.", - "type": "object" - }, - "UpdateParagraphStyleRequest": { + "DeleteTableColumnRequest": { + "description": "Deletes a column from a table.", "type": "object", "properties": { "cellLocation": { - "$ref": "TableCellLocation", - "description": "The location of the cell in the table containing the paragraph(s) to\nstyle. If `object_id` refers to a table, `cell_location` must have a value.\nOtherwise, it must not." + "description": "The reference table cell location from which a column will be deleted.\n\nThe column this cell spans will be deleted. If this is a merged cell,\nmultiple columns will be deleted. If no columns remain in the table after\nthis deletion, the whole table is deleted.", + "$ref": "TableCellLocation" }, - "style": { - "$ref": "ParagraphStyle", - "description": "The paragraph's style." - }, - "fields": { - "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `style` is implied and\nshould not be specified. A single `\"*\"` can be used as short-hand for\nlisting every field.\n\nFor example, to update the paragraph alignment, set `fields` to\n`\"alignment\"`.\n\nTo reset a property to its default value, include its field name in the\nfield mask but leave the field itself unset.", - "format": "google-fieldmask", + "tableObjectId": { + "description": "The table to delete columns from.", "type": "string" - }, - "objectId": { - "description": "The object ID of the shape or table with the text to be styled.", - "type": "string" - }, - "textRange": { - "$ref": "Range", - "description": "The range of text containing the paragraph(s) to style." } }, - "id": "UpdateParagraphStyleRequest", - "description": "Updates the styling for all of the paragraphs within a Shape or Table that\noverlap with the given text index range." + "id": "DeleteTableColumnRequest" }, - "ColorScheme": { - "id": "ColorScheme", - "description": "The palette of predefined colors for a page.", + "List": { + "description": "A List describes the look and feel of bullets belonging to paragraphs\nassociated with a list. A paragraph that is part of a list has an implicit\nreference to that list's ID.", "type": "object", "properties": { - "colors": { - "description": "The ThemeColorType and corresponding concrete color pairs.", - "type": "array", - "items": { - "$ref": "ThemeColorPair" - } + "nestingLevel": { + "additionalProperties": { + "$ref": "NestingLevel" + }, + "description": "A map of nesting levels to the properties of bullets at the associated\nlevel. A list has at most nine levels of nesting, so the possible values\nfor the keys of this map are 0 through 8, inclusive.", + "type": "object" + }, + "listId": { + "description": "The ID of the list.", + "type": "string" } - } + }, + "id": "List" } }, - "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, "canonicalName": "Slides", "auth": { "oauth2": { @@ -3615,23 +3651,23 @@ "presentations": { "methods": { "get": { - "id": "slides.presentations.get", "path": "v1/presentations/{+presentationId}", + "id": "slides.presentations.get", "description": "Gets the latest version of the specified presentation.", "httpMethod": "GET", - "parameterOrder": [ - "presentationId" - ], "response": { "$ref": "Presentation" }, + "parameterOrder": [ + "presentationId" + ], "parameters": { "presentationId": { + "location": "path", "description": "The ID of the presentation to retrieve.", - "required": true, "type": "string", - "pattern": "^[^/]+$", - "location": "path" + "required": true, + "pattern": "^[^/]+$" } }, "scopes": [ @@ -3642,25 +3678,6 @@ ], "flatPath": "v1/presentations/{presentationsId}" }, - "create": { - "response": { - "$ref": "Presentation" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/drive", - "https://www.googleapis.com/auth/presentations" - ], - "parameters": {}, - "flatPath": "v1/presentations", - "path": "v1/presentations", - "id": "slides.presentations.create", - "description": "Creates a new presentation using the title given in the request. Other\nfields in the request are ignored.\nReturns the created presentation.", - "request": { - "$ref": "Presentation" - } - }, "batchUpdate": { "response": { "$ref": "BatchUpdatePresentationResponse" @@ -3669,6 +3686,14 @@ "presentationId" ], "httpMethod": "POST", + "parameters": { + "presentationId": { + "location": "path", + "description": "The presentation to apply the updates to.", + "type": "string", + "required": true + } + }, "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.readonly", @@ -3676,30 +3701,89 @@ "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/spreadsheets.readonly" ], - "parameters": { - "presentationId": { - "location": "path", - "description": "The presentation to apply the updates to.", - "required": true, - "type": "string" - } - }, "flatPath": "v1/presentations/{presentationId}:batchUpdate", - "path": "v1/presentations/{presentationId}:batchUpdate", "id": "slides.presentations.batchUpdate", + "path": "v1/presentations/{presentationId}:batchUpdate", "description": "Applies one or more updates to the presentation.\n\nEach request is validated before\nbeing applied. If any request is not valid, then the entire request will\nfail and nothing will be applied.\n\nSome requests have replies to\ngive you some information about how they are applied. Other requests do\nnot need to return information; these each return an empty reply.\nThe order of replies matches that of the requests.\n\nFor example, suppose you call batchUpdate with four updates, and only the\nthird one returns information. The response would have two empty replies:\nthe reply to the third request, and another empty reply, in that order.\n\nBecause other users may be editing the presentation, the presentation\nmight not exactly reflect your changes: your changes may\nbe altered with respect to collaborator changes. If there are no\ncollaborators, the presentation should reflect your changes. In any case,\nthe updates in your request are guaranteed to be applied together\natomically.", "request": { "$ref": "BatchUpdatePresentationRequest" } + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Presentation" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/presentations" + ], + "flatPath": "v1/presentations", + "path": "v1/presentations", + "id": "slides.presentations.create", + "description": "Creates a new presentation using the title given in the request. Other\nfields in the request are ignored.\nReturns the created presentation.", + "request": { + "$ref": "Presentation" + } } }, "resources": { "pages": { "methods": { + "getThumbnail": { + "description": "Generates a thumbnail of the latest version of the specified page in the\npresentation and returns a URL to the thumbnail image.", + "response": { + "$ref": "Thumbnail" + }, + "parameterOrder": [ + "presentationId", + "pageObjectId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.readonly", + "https://www.googleapis.com/auth/presentations", + "https://www.googleapis.com/auth/presentations.readonly" + ], + "parameters": { + "pageObjectId": { + "location": "path", + "description": "The object ID of the page whose thumbnail to retrieve.", + "type": "string", + "required": true + }, + "thumbnailProperties.thumbnailSize": { + "description": "The optional thumbnail image size.\n\nIf you don't specify the size, the server chooses a default size of the\nimage.", + "type": "string", + "location": "query", + "enum": [ + "THUMBNAIL_SIZE_UNSPECIFIED", + "LARGE" + ] + }, + "thumbnailProperties.mimeType": { + "enum": [ + "PNG" + ], + "description": "The optional mime type of the thumbnail image.\n\nIf you don't specify the mime type, the default mime type will be PNG.", + "type": "string", + "location": "query" + }, + "presentationId": { + "location": "path", + "description": "The ID of the presentation to retrieve.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail", + "id": "slides.presentations.pages.getThumbnail", + "path": "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail" + }, "get": { - "path": "v1/presentations/{presentationId}/pages/{pageObjectId}", - "id": "slides.presentations.pages.get", - "description": "Gets the latest version of the specified page in the presentation.", "response": { "$ref": "Page" }, @@ -3708,65 +3792,17 @@ "pageObjectId" ], "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/drive", - "https://www.googleapis.com/auth/drive.readonly", - "https://www.googleapis.com/auth/presentations", - "https://www.googleapis.com/auth/presentations.readonly" - ], "parameters": { - "presentationId": { - "required": true, - "type": "string", - "location": "path", - "description": "The ID of the presentation to retrieve." - }, "pageObjectId": { + "location": "path", "description": "The object ID of the page to retrieve.", - "required": true, "type": "string", - "location": "path" - } - }, - "flatPath": "v1/presentations/{presentationId}/pages/{pageObjectId}" - }, - "getThumbnail": { - "parameterOrder": [ - "presentationId", - "pageObjectId" - ], - "response": { - "$ref": "Thumbnail" - }, - "httpMethod": "GET", - "parameters": { - "pageObjectId": { - "location": "path", - "description": "The object ID of the page whose thumbnail to retrieve.", - "required": true, - "type": "string" - }, - "thumbnailProperties.mimeType": { - "description": "The optional mime type of the thumbnail image.\n\nIf you don't specify the mime type, the default mime type will be PNG.", - "type": "string", - "location": "query", - "enum": [ - "PNG" - ] - }, - "thumbnailProperties.thumbnailSize": { - "location": "query", - "enum": [ - "THUMBNAIL_SIZE_UNSPECIFIED", - "LARGE" - ], - "description": "The optional thumbnail image size.\n\nIf you don't specify the size, the server chooses a default size of the\nimage.", - "type": "string" + "required": true }, "presentationId": { "description": "The ID of the presentation to retrieve.", - "required": true, "type": "string", + "required": true, "location": "path" } }, @@ -3776,10 +3812,10 @@ "https://www.googleapis.com/auth/presentations", "https://www.googleapis.com/auth/presentations.readonly" ], - "flatPath": "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail", - "path": "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail", - "id": "slides.presentations.pages.getThumbnail", - "description": "Generates a thumbnail of the latest version of the specified page in the\npresentation and returns a URL to the thumbnail image." + "flatPath": "v1/presentations/{presentationId}/pages/{pageObjectId}", + "id": "slides.presentations.pages.get", + "path": "v1/presentations/{presentationId}/pages/{pageObjectId}", + "description": "Gets the latest version of the specified page in the presentation." } } } @@ -3787,26 +3823,57 @@ } }, "parameters": { - "upload_protocol": { + "key": { "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "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.", "type": "string" }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", "default": "true", + "type": "boolean" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", "location": "query" }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", "location": "query" }, "fields": { - "location": "query", "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "type": "string", + "location": "query" }, "callback": { "location": "query", @@ -3814,8 +3881,6 @@ "type": "string" }, "$.xgafv": { - "description": "V1 error format.", - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -3824,11 +3889,11 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format.", + "type": "string" }, "alt": { - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -3840,49 +3905,20 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], - "location": "query" - }, - "key": { - "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.", - "type": "string", - "location": "query" - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "quotaUser": { "location": "query", - "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.", - "type": "string" - }, - "pp": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Pretty-print response." - }, - "bearer_token": { - "type": "string", - "location": "query", - "description": "OAuth bearer token." - }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" + "description": "Data format for response.", + "default": "json" } }, "version": "v1", "baseUrl": "https://slides.googleapis.com/", - "servicePath": "", - "kind": "discovery#restDescription", "description": "An API for creating and editing Google Slides presentations.", + "kind": "discovery#restDescription", + "servicePath": "", "basePath": "", - "revision": "20170509", + "revision": "20170926", "documentationLink": "https://developers.google.com/slides/", "id": "slides:v1", "discoveryVersion": "v1", - "version_module": "True" + "version_module": true } diff --git a/etc/api/sourcerepo/v1/crates/1.0.6-api+20170908 b/etc/api/sourcerepo/v1/crates/1.0.6-api+20170908 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/sourcerepo/v1/crates/1.0.6-cli+20170908 b/etc/api/sourcerepo/v1/crates/1.0.6-cli+20170908 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/sourcerepo/v1/sourcerepo-api.json b/etc/api/sourcerepo/v1/sourcerepo-api.json new file mode 100644 index 0000000000..e8f562e476 --- /dev/null +++ b/etc/api/sourcerepo/v1/sourcerepo-api.json @@ -0,0 +1,603 @@ +{ + "basePath": "", + "revision": "20170908", + "documentationLink": "https://cloud.google.com/source-repositories/docs/apis", + "id": "sourcerepo:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "AuditConfig": { + "description": "Specifies the audit configuration for a service.\nThe configuration determines which permission types are logged, and what\nidentities, if any, are exempted from logging.\nAn AuditConfig must have one or more AuditLogConfigs.\n\nIf there are AuditConfigs for both `allServices` and a specific service,\nthe union of the two AuditConfigs is used for that service: the log_types\nspecified in each AuditConfig are enabled, and the exempted_members in each\nAuditConfig are exempted.\n\nExample Policy with multiple AuditConfigs:\n\n {\n \"audit_configs\": [\n {\n \"service\": \"allServices\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n },\n {\n \"log_type\": \"ADMIN_READ\",\n }\n ]\n },\n {\n \"service\": \"fooservice.googleapis.com\"\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n },\n {\n \"log_type\": \"DATA_WRITE\",\n \"exempted_members\": [\n \"user:bar@gmail.com\"\n ]\n }\n ]\n }\n ]\n }\n\nFor fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ\nlogging. It also exempts foo@gmail.com from DATA_READ logging, and\nbar@gmail.com from DATA_WRITE logging.", + "type": "object", + "properties": { + "exemptedMembers": { + "items": { + "type": "string" + }, + "type": "array" + }, + "service": { + "description": "Specifies a service that will be enabled for audit logging.\nFor example, `storage.googleapis.com`, `cloudsql.googleapis.com`.\n`allServices` is a special value that covers all services.", + "type": "string" + }, + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.\nNext ID: 4", + "items": { + "$ref": "AuditLogConfig" + }, + "type": "array" + } + }, + "id": "AuditConfig" + }, + "SetIamPolicyRequest": { + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." + }, + "updateMask": { + "format": "google-fieldmask", + "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only\nthe fields in the mask will be modified. If no mask is provided, the\nfollowing default mask is used:\npaths: \"bindings, etag\"\nThis field is only used by Cloud IAM.", + "type": "string" + } + }, + "id": "SetIamPolicyRequest", + "description": "Request message for `SetIamPolicy` method.", + "type": "object" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently.\nThis field is GOOGLE_INTERNAL." + }, + "members": { + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" + }, + "MirrorConfig": { + "description": "Configuration to automatically mirror a repository from another\nhosting service, for example GitHub or BitBucket.", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL of the main repository at the other hosting service." + }, + "webhookId": { + "description": "ID of the webhook listening to updates to trigger mirroring.\nRemoving this webook from the other hosting service will stop\nGoogle Cloud Source Repositories from receiving notifications,\nand thereby disabling mirroring.", + "type": "string" + }, + "deployKeyId": { + "description": "ID of the SSH deploy key at the other hosting service.\nRemoving this key from the other service would deauthorize\nGoogle Cloud Source Repositories from mirroring.", + "type": "string" + } + }, + "id": "MirrorConfig" + }, + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {} + }, + "Expr": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file." + }, + "title": { + "description": "An optional title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.", + "type": "string" + }, + "description": { + "description": "An optional description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI.", + "type": "string" + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in\nCommon Expression Language syntax.\n\nThe application context of the containing message determines which\nwell-known feature set of CEL is supported." + } + }, + "id": "Expr", + "description": "Represents an expression text. Example:\n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\"" + }, + "Repo": { + "description": "A repository (or repo) is a Git repository storing versioned source content.", + "type": "object", + "properties": { + "url": { + "description": "URL to clone the repository from Google Cloud Source Repositories.", + "type": "string" + }, + "size": { + "type": "string", + "format": "int64", + "description": "The disk usage of the repo, in bytes.\nOnly returned by GetRepo." + }, + "name": { + "description": "Resource name of the repository, of the form\n`projects/\u003cproject\u003e/repos/\u003crepo\u003e`. The repo name may contain slashes.\neg, `projects/myproject/repos/name/with/slash`", + "type": "string" + }, + "mirrorConfig": { + "$ref": "MirrorConfig", + "description": "How this repository mirrors a repository managed by another service." + } + }, + "id": "Repo" + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "ListReposResponse": { + "properties": { + "nextPageToken": { + "type": "string", + "description": "If non-empty, additional repositories exist within the project. These\ncan be retrieved by including this value in the next ListReposRequest's\npage_token field." + }, + "repos": { + "items": { + "$ref": "Repo" + }, + "type": "array", + "description": "The listed repos." + } + }, + "id": "ListReposResponse", + "description": "Response for ListRepos. The size is not set in the returned repositories.", + "type": "object" + }, + "AuditLogConfig": { + "properties": { + "exemptedMembers": { + "description": "Specifies the identities that do not cause logging for this type of\npermission.\nFollows the same format of Binding.members.", + "items": { + "type": "string" + }, + "type": "array" + }, + "logType": { + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ], + "enum": [ + "LOG_TYPE_UNSPECIFIED", + "ADMIN_READ", + "DATA_WRITE", + "DATA_READ" + ], + "description": "The log type that this config enables.", + "type": "string" + } + }, + "id": "AuditLogConfig", + "description": "Provides the configuration for logging a type of permissions.\nExample:\n\n {\n \"audit_log_configs\": [\n {\n \"log_type\": \"DATA_READ\",\n \"exempted_members\": [\n \"user:foo@gmail.com\"\n ]\n },\n {\n \"log_type\": \"DATA_WRITE\",\n }\n ]\n }\n\nThis enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting\nfoo@gmail.com from DATA_READ logging.", + "type": "object" + }, + "TestIamPermissionsRequest": { + "properties": { + "permissions": { + "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestIamPermissionsRequest", + "description": "Request message for `TestIamPermissions` method.", + "type": "object" + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "etag": { + "format": "byte", + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "type": "string" + }, + "version": { + "format": "int32", + "description": "Version of the `Policy`. The default version is 0.", + "type": "integer" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "items": { + "$ref": "AuditConfig" + }, + "type": "array" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + }, + "type": "array" + }, + "iamOwned": { + "type": "boolean" + } + }, + "id": "Policy" + } + }, + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "canonicalName": "Cloud Source Repositories", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/source.read_write": { + "description": "Manage the contents of your source code repositories" + }, + "https://www.googleapis.com/auth/source.full_control": { + "description": "Manage your source code repositories" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/source.read_only": { + "description": "View the contents of your source code repositories" + } + } + } + }, + "rootUrl": "https://sourcerepo.googleapis.com/", + "ownerDomain": "google.com", + "name": "sourcerepo", + "batchPath": "batch", + "title": "Cloud Source Repositories API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "repos": { + "methods": { + "list": { + "flatPath": "v1/projects/{projectsId}/repos", + "path": "v1/{+name}/repos", + "id": "sourcerepo.projects.repos.list", + "description": "Returns all repos belonging to a project. The sizes of the repos are\nnot set by ListRepos. To get the size of a repo, use GetRepo.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListReposResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Resume listing repositories where a prior ListReposResponse\nleft off. This is an opaque token that must be obtained from\na recent, prior ListReposResponse's next_page_token field.", + "type": "string" + }, + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The project ID whose repos should be listed. Values are of the form\n`projects/\u003cproject\u003e`.", + "type": "string", + "required": true + }, + "pageSize": { + "type": "integer", + "location": "query", + "format": "int32", + "description": "Maximum number of repositories to return; between 1 and 500.\nIf not set or zero, defaults to 100 at the server." + } + } + }, + "setIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/repos/.+$" + } + }, + "flatPath": "v1/projects/{projectsId}/repos/{reposId}:setIamPolicy", + "id": "sourcerepo.projects.repos.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." + }, + "create": { + "request": { + "$ref": "Repo" + }, + "description": "Creates a repo in the given project with the given name.\n\nIf the named repository already exists, `CreateRepo` returns\n`ALREADY_EXISTS`.", + "response": { + "$ref": "Repo" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "parameters": { + "parent": { + "description": "The project in which to create the repo. Values are of the form\n`projects/\u003cproject\u003e`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/repos", + "id": "sourcerepo.projects.repos.create", + "path": "v1/{+parent}/repos" + }, + "getIamPolicy": { + "httpMethod": "GET", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/repos/.+$" + } + }, + "flatPath": "v1/projects/{projectsId}/repos/{reposId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "sourcerepo.projects.repos.getIamPolicy", + "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset." + }, + "get": { + "id": "sourcerepo.projects.repos.get", + "path": "v1/{+name}", + "description": "Returns information about a repo.", + "response": { + "$ref": "Repo" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "parameters": { + "name": { + "description": "The name of the requested repository. Values are of the form\n`projects/\u003cproject\u003e/repos/\u003crepo\u003e`.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/repos/.+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/repos/{reposId}" + }, + "testIamPermissions": { + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/repos/.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "flatPath": "v1/projects/{projectsId}/repos/{reposId}:testIamPermissions", + "id": "sourcerepo.projects.repos.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.", + "request": { + "$ref": "TestIamPermissionsRequest" + } + }, + "delete": { + "flatPath": "v1/projects/{projectsId}/repos/{reposId}", + "path": "v1/{+name}", + "id": "sourcerepo.projects.repos.delete", + "description": "Deletes a repo.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/source.full_control", + "https://www.googleapis.com/auth/source.read_only", + "https://www.googleapis.com/auth/source.read_write" + ], + "parameters": { + "name": { + "type": "string", + "required": true, + "pattern": "^projects/[^/]+/repos/.+$", + "location": "path", + "description": "The name of the repo to delete. Values are of the form\n`projects/\u003cproject\u003e/repos/\u003crepo\u003e`." + } + } + } + } + } + } + } + }, + "parameters": { + "alt": { + "type": "string", + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "version": "v1", + "baseUrl": "https://sourcerepo.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Access source code repositories hosted by Google.", + "servicePath": "" +} diff --git a/etc/api/spanner/v1/crates/1.0.6-api+20170914 b/etc/api/spanner/v1/crates/1.0.6-api+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/spanner/v1/crates/1.0.6-cli+20170914 b/etc/api/spanner/v1/crates/1.0.6-cli+20170914 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/spanner/v1/spanner-api.json b/etc/api/spanner/v1/spanner-api.json new file mode 100644 index 0000000000..7f2f503b71 --- /dev/null +++ b/etc/api/spanner/v1/spanner-api.json @@ -0,0 +1,2476 @@ +{ + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ChildLink": { + "description": "Metadata associated with a parent-child relationship appearing in a\nPlanNode.", + "type": "object", + "properties": { + "type": { + "description": "The type of the link. For example, in Hash Joins this could be used to\ndistinguish between the build child and the probe child, or in the case\nof the child being an output variable, to represent the tag associated\nwith the output variable.", + "type": "string" + }, + "childIndex": { + "description": "The node to which the link points.", + "format": "int32", + "type": "integer" + }, + "variable": { + "description": "Only present if the child node is SCALAR and corresponds\nto an output variable of the parent node. The field carries the name of\nthe output variable.\nFor example, a `TableScan` operator that reads rows from a table will\nhave child links to the `SCALAR` nodes representing the output variables\ncreated for each column that is read by the operator. The corresponding\n`variable` fields will be set to the variable names assigned to the\ncolumns.", + "type": "string" + } + }, + "id": "ChildLink" + }, + "Delete": { + "id": "Delete", + "description": "Arguments to delete operations.", + "type": "object", + "properties": { + "table": { + "type": "string", + "description": "Required. The table whose rows will be deleted." + }, + "keySet": { + "$ref": "KeySet", + "description": "Required. The primary keys of the rows within table to delete." + } + } + }, + "ListInstanceConfigsResponse": { + "description": "The response for ListInstanceConfigs.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "`next_page_token` can be sent in a subsequent\nListInstanceConfigs call to\nfetch more of the matching instance configurations.", + "type": "string" + }, + "instanceConfigs": { + "description": "The list of requested instance configurations.", + "type": "array", + "items": { + "$ref": "InstanceConfig" + } + } + }, + "id": "ListInstanceConfigsResponse" + }, + "BeginTransactionRequest": { + "type": "object", + "properties": { + "options": { + "$ref": "TransactionOptions", + "description": "Required. Options for the new transaction." + } + }, + "id": "BeginTransactionRequest", + "description": "The request for BeginTransaction." + }, + "CommitRequest": { + "description": "The request for Commit.", + "type": "object", + "properties": { + "singleUseTransaction": { + "description": "Execute mutations in a temporary transaction. Note that unlike\ncommit of a previously-started transaction, commit with a\ntemporary transaction is non-idempotent. That is, if the\n`CommitRequest` is sent to Cloud Spanner more than once (for\ninstance, due to retries in the application, or in the\ntransport library), it is possible that the mutations are\nexecuted more than once. If this is undesirable, use\nBeginTransaction and\nCommit instead.", + "$ref": "TransactionOptions" + }, + "mutations": { + "description": "The mutations to be executed when this transaction commits. All\nmutations are applied atomically, in the order they appear in\nthis list.", + "type": "array", + "items": { + "$ref": "Mutation" + } + }, + "transactionId": { + "description": "Commit a previously-started transaction.", + "format": "byte", + "type": "string" + } + }, + "id": "CommitRequest" + }, + "TestIamPermissionsResponse": { + "description": "Response message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "TestIamPermissionsResponse" + }, + "GetIamPolicyRequest": { + "id": "GetIamPolicyRequest", + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {} + }, + "CreateDatabaseMetadata": { + "description": "Metadata type for the operation returned by\nCreateDatabase.", + "type": "object", + "properties": { + "database": { + "description": "The database being created.", + "type": "string" + } + }, + "id": "CreateDatabaseMetadata" + }, + "ListSessionsResponse": { + "properties": { + "nextPageToken": { + "description": "`next_page_token` can be sent in a subsequent\nListSessions call to fetch more of the matching\nsessions.", + "type": "string" + }, + "sessions": { + "description": "The list of requested sessions.", + "type": "array", + "items": { + "$ref": "Session" + } + } + }, + "id": "ListSessionsResponse", + "description": "The response for ListSessions.", + "type": "object" + }, + "Session": { + "description": "A session in the Cloud Spanner API.", + "type": "object", + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The labels for the session.\n\n * Label keys must be between 1 and 63 characters long and must conform to\n the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.\n * Label values must be between 0 and 63 characters long and must conform\n to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.\n * No more than 20 labels can be associated with a given session.", + "type": "object" + }, + "createTime": { + "description": "Output only. The timestamp when the session is created.", + "format": "google-datetime", + "type": "string" + }, + "name": { + "description": "The name of the session.", + "type": "string" + }, + "approximateLastUseTime": { + "description": "Output only. The approximate timestamp when the session is last used. It is\ntypically earlier than the actual last use time.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Session" + }, + "KeyRange": { + "description": "KeyRange represents a range of rows in a table or index.\n\nA range has a start key and an end key. These keys can be open or\nclosed, indicating if the range includes rows with that key.\n\nKeys are represented by lists, where the ith value in the list\ncorresponds to the ith component of the table or index primary key.\nIndividual values are encoded as described here.\n\nFor example, consider the following table definition:\n\n CREATE TABLE UserEvents (\n UserName STRING(MAX),\n EventDate STRING(10)\n ) PRIMARY KEY(UserName, EventDate);\n\nThe following keys name rows in this table:\n\n \"Bob\", \"2014-09-23\"\n\nSince the `UserEvents` table's `PRIMARY KEY` clause names two\ncolumns, each `UserEvents` key has two elements; the first is the\n`UserName`, and the second is the `EventDate`.\n\nKey ranges with multiple components are interpreted\nlexicographically by component using the table or index key's declared\nsort order. For example, the following range returns all events for\nuser `\"Bob\"` that occurred in the year 2015:\n\n \"start_closed\": [\"Bob\", \"2015-01-01\"]\n \"end_closed\": [\"Bob\", \"2015-12-31\"]\n\nStart and end keys can omit trailing key components. This affects the\ninclusion and exclusion of rows that exactly match the provided key\ncomponents: if the key is closed, then rows that exactly match the\nprovided components are included; if the key is open, then rows\nthat exactly match are not included.\n\nFor example, the following range includes all events for `\"Bob\"` that\noccurred during and after the year 2000:\n\n \"start_closed\": [\"Bob\", \"2000-01-01\"]\n \"end_closed\": [\"Bob\"]\n\nThe next example retrieves all events for `\"Bob\"`:\n\n \"start_closed\": [\"Bob\"]\n \"end_closed\": [\"Bob\"]\n\nTo retrieve events before the year 2000:\n\n \"start_closed\": [\"Bob\"]\n \"end_open\": [\"Bob\", \"2000-01-01\"]\n\nThe following range includes all rows in the table:\n\n \"start_closed\": []\n \"end_closed\": []\n\nThis range returns all users whose `UserName` begins with any\ncharacter from A to C:\n\n \"start_closed\": [\"A\"]\n \"end_open\": [\"D\"]\n\nThis range returns all users whose `UserName` begins with B:\n\n \"start_closed\": [\"B\"]\n \"end_open\": [\"C\"]\n\nKey ranges honor column sort order. For example, suppose a table is\ndefined as follows:\n\n CREATE TABLE DescendingSortedTable {\n Key INT64,\n ...\n ) PRIMARY KEY(Key DESC);\n\nThe following range retrieves all rows with key values between 1\nand 100 inclusive:\n\n \"start_closed\": [\"100\"]\n \"end_closed\": [\"1\"]\n\nNote that 100 is passed as the start, and 1 is passed as the end,\nbecause `Key` is a descending column in the schema.", + "type": "object", + "properties": { + "startClosed": { + "description": "If the start is closed, then the range includes all rows whose\nfirst `len(start_closed)` key columns exactly match `start_closed`.", + "type": "array", + "items": { + "type": "any" + } + }, + "startOpen": { + "description": "If the start is open, then the range excludes rows whose first\n`len(start_open)` key columns exactly match `start_open`.", + "type": "array", + "items": { + "type": "any" + } + }, + "endOpen": { + "description": "If the end is open, then the range excludes rows whose first\n`len(end_open)` key columns exactly match `end_open`.", + "type": "array", + "items": { + "type": "any" + } + }, + "endClosed": { + "description": "If the end is closed, then the range includes all rows whose\nfirst `len(end_closed)` key columns exactly match `end_closed`.", + "type": "array", + "items": { + "type": "any" + } + } + }, + "id": "KeyRange" + }, + "ListInstancesResponse": { + "description": "The response for ListInstances.", + "type": "object", + "properties": { + "instances": { + "description": "The list of requested instances.", + "type": "array", + "items": { + "$ref": "Instance" + } + }, + "nextPageToken": { + "description": "`next_page_token` can be sent in a subsequent\nListInstances call to fetch more\nof the matching instances.", + "type": "string" + } + }, + "id": "ListInstancesResponse" + }, + "ShortRepresentation": { + "properties": { + "subqueries": { + "additionalProperties": { + "format": "int32", + "type": "integer" + }, + "description": "A mapping of (subquery variable name) -\u003e (subquery node id) for cases\nwhere the `description` string of this node references a `SCALAR`\nsubquery contained in the expression subtree rooted at this node. The\nreferenced `SCALAR` subquery may not necessarily be a direct child of\nthis node.", + "type": "object" + }, + "description": { + "description": "A string representation of the expression subtree rooted at this node.", + "type": "string" + } + }, + "id": "ShortRepresentation", + "description": "Condensed representation of a node and its subtree. Only present for\n`SCALAR` PlanNode(s).", + "type": "object" + }, + "InstanceConfig": { + "properties": { + "name": { + "description": "A unique identifier for the instance configuration. Values\nare of the form\n`projects/\u003cproject\u003e/instanceConfigs/a-z*`", + "type": "string" + }, + "displayName": { + "description": "The name of this instance configuration as it appears in UIs.", + "type": "string" + } + }, + "id": "InstanceConfig", + "description": "A possible configuration for a Cloud Spanner instance. Configurations\ndefine the geographic placement of nodes and their replication.", + "type": "object" + }, + "UpdateInstanceRequest": { + "description": "The request for UpdateInstance.", + "type": "object", + "properties": { + "instance": { + "description": "Required. The instance to update, which must always include the instance\nname. Otherwise, only fields mentioned in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included.", + "$ref": "Instance" + }, + "fieldMask": { + "description": "Required. A mask specifying which fields in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should be updated.\nThe field mask must always be specified; this prevents any future fields in\n[][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know\nabout them.", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "UpdateInstanceRequest" + }, + "Empty": { + "properties": {}, + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object" + }, + "TransactionOptions": { + "description": "# Transactions\n\n\nEach session can have at most one active transaction at a time. After the\nactive transaction is completed, the session can immediately be\nre-used for the next transaction. It is not necessary to create a\nnew session for each transaction.\n\n# Transaction Modes\n\nCloud Spanner supports two transaction modes:\n\n 1. Locking read-write. This type of transaction is the only way\n to write data into Cloud Spanner. These transactions rely on\n pessimistic locking and, if necessary, two-phase commit.\n Locking read-write transactions may abort, requiring the\n application to retry.\n\n 2. Snapshot read-only. This transaction type provides guaranteed\n consistency across several reads, but does not allow\n writes. Snapshot read-only transactions can be configured to\n read at timestamps in the past. Snapshot read-only\n transactions do not need to be committed.\n\nFor transactions that only read, snapshot read-only transactions\nprovide simpler semantics and are almost always faster. In\nparticular, read-only transactions do not take locks, so they do\nnot conflict with read-write transactions. As a consequence of not\ntaking locks, they also do not abort, so retry loops are not needed.\n\nTransactions may only read/write data in a single database. They\nmay, however, read/write data in different tables within that\ndatabase.\n\n## Locking Read-Write Transactions\n\nLocking transactions may be used to atomically read-modify-write\ndata anywhere in a database. This type of transaction is externally\nconsistent.\n\nClients should attempt to minimize the amount of time a transaction\nis active. Faster transactions commit with higher probability\nand cause less contention. Cloud Spanner attempts to keep read locks\nactive as long as the transaction continues to do reads, and the\ntransaction has not been terminated by\nCommit or\nRollback. Long periods of\ninactivity at the client may cause Cloud Spanner to release a\ntransaction's locks and abort it.\n\nReads performed within a transaction acquire locks on the data\nbeing read. Writes can only be done at commit time, after all reads\nhave been completed.\nConceptually, a read-write transaction consists of zero or more\nreads or SQL queries followed by\nCommit. At any time before\nCommit, the client can send a\nRollback request to abort the\ntransaction.\n\n### Semantics\n\nCloud Spanner can commit the transaction if all read locks it acquired\nare still valid at commit time, and it is able to acquire write\nlocks for all writes. Cloud Spanner can abort the transaction for any\nreason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees\nthat the transaction has not modified any user data in Cloud Spanner.\n\nUnless the transaction commits, Cloud Spanner makes no guarantees about\nhow long the transaction's locks were held for. It is an error to\nuse Cloud Spanner locks for any sort of mutual exclusion other than\nbetween Cloud Spanner transactions themselves.\n\n### Retrying Aborted Transactions\n\nWhen a transaction aborts, the application can choose to retry the\nwhole transaction again. To maximize the chances of successfully\ncommitting the retry, the client should execute the retry in the\nsame session as the original attempt. The original session's lock\npriority increases with each consecutive abort, meaning that each\nattempt has a slightly better chance of success than the previous.\n\nUnder some circumstances (e.g., many transactions attempting to\nmodify the same row(s)), a transaction can abort many times in a\nshort period before successfully committing. Thus, it is not a good\nidea to cap the number of retries a transaction can attempt;\ninstead, it is better to limit the total amount of wall time spent\nretrying.\n\n### Idle Transactions\n\nA transaction is considered idle if it has no outstanding reads or\nSQL queries and has not started a read or SQL query within the last 10\nseconds. Idle transactions can be aborted by Cloud Spanner so that they\ndon't hold on to locks indefinitely. In that case, the commit will\nfail with error `ABORTED`.\n\nIf this behavior is undesirable, periodically executing a simple\nSQL query in the transaction (e.g., `SELECT 1`) prevents the\ntransaction from becoming idle.\n\n## Snapshot Read-Only Transactions\n\nSnapshot read-only transactions provides a simpler method than\nlocking read-write transactions for doing several consistent\nreads. However, this type of transaction does not support writes.\n\nSnapshot transactions do not take locks. Instead, they work by\nchoosing a Cloud Spanner timestamp, then executing all reads at that\ntimestamp. Since they do not acquire locks, they do not block\nconcurrent read-write transactions.\n\nUnlike locking read-write transactions, snapshot read-only\ntransactions never abort. They can fail if the chosen read\ntimestamp is garbage collected; however, the default garbage\ncollection policy is generous enough that most applications do not\nneed to worry about this in practice.\n\nSnapshot read-only transactions do not need to call\nCommit or\nRollback (and in fact are not\npermitted to do so).\n\nTo execute a snapshot transaction, the client specifies a timestamp\nbound, which tells Cloud Spanner how to choose a read timestamp.\n\nThe types of timestamp bound are:\n\n - Strong (the default).\n - Bounded staleness.\n - Exact staleness.\n\nIf the Cloud Spanner database to be read is geographically distributed,\nstale read-only transactions can execute more quickly than strong\nor read-write transaction, because they are able to execute far\nfrom the leader replica.\n\nEach type of timestamp bound is discussed in detail below.\n\n### Strong\n\nStrong reads are guaranteed to see the effects of all transactions\nthat have committed before the start of the read. Furthermore, all\nrows yielded by a single read are consistent with each other -- if\nany part of the read observes a transaction, all parts of the read\nsee the transaction.\n\nStrong reads are not repeatable: two consecutive strong read-only\ntransactions might return inconsistent results if there are\nconcurrent writes. If consistency across reads is required, the\nreads should be executed within a transaction or at an exact read\ntimestamp.\n\nSee TransactionOptions.ReadOnly.strong.\n\n### Exact Staleness\n\nThese timestamp bounds execute reads at a user-specified\ntimestamp. Reads at a timestamp are guaranteed to see a consistent\nprefix of the global transaction history: they observe\nmodifications done by all transactions with a commit timestamp \u003c=\nthe read timestamp, and observe none of the modifications done by\ntransactions with a larger commit timestamp. They will block until\nall conflicting transactions that may be assigned commit timestamps\n\u003c= the read timestamp have finished.\n\nThe timestamp can either be expressed as an absolute Cloud Spanner commit\ntimestamp or a staleness relative to the current time.\n\nThese modes do not require a \"negotiation phase\" to pick a\ntimestamp. As a result, they execute slightly faster than the\nequivalent boundedly stale concurrency modes. On the other hand,\nboundedly stale reads usually return fresher results.\n\nSee TransactionOptions.ReadOnly.read_timestamp and\nTransactionOptions.ReadOnly.exact_staleness.\n\n### Bounded Staleness\n\nBounded staleness modes allow Cloud Spanner to pick the read timestamp,\nsubject to a user-provided staleness bound. Cloud Spanner chooses the\nnewest timestamp within the staleness bound that allows execution\nof the reads at the closest available replica without blocking.\n\nAll rows yielded are consistent with each other -- if any part of\nthe read observes a transaction, all parts of the read see the\ntransaction. Boundedly stale reads are not repeatable: two stale\nreads, even if they use the same staleness bound, can execute at\ndifferent timestamps and thus return inconsistent results.\n\nBoundedly stale reads execute in two phases: the first phase\nnegotiates a timestamp among all replicas needed to serve the\nread. In the second phase, reads are executed at the negotiated\ntimestamp.\n\nAs a result of the two phase execution, bounded staleness reads are\nusually a little slower than comparable exact staleness\nreads. However, they are typically able to return fresher\nresults, and are more likely to execute at the closest replica.\n\nBecause the timestamp negotiation requires up-front knowledge of\nwhich rows will be read, it can only be used with single-use\nread-only transactions.\n\nSee TransactionOptions.ReadOnly.max_staleness and\nTransactionOptions.ReadOnly.min_read_timestamp.\n\n### Old Read Timestamps and Garbage Collection\n\nCloud Spanner continuously garbage collects deleted and overwritten data\nin the background to reclaim storage space. This process is known\nas \"version GC\". By default, version GC reclaims versions after they\nare one hour old. Because of this, Cloud Spanner cannot perform reads\nat read timestamps more than one hour in the past. This\nrestriction also applies to in-progress reads and/or SQL queries whose\ntimestamp become too old while executing. Reads and SQL queries with\ntoo-old read timestamps fail with the error `FAILED_PRECONDITION`.", + "type": "object", + "properties": { + "readWrite": { + "$ref": "ReadWrite", + "description": "Transaction may write.\n\nAuthorization to begin a read-write transaction requires\n`spanner.databases.beginOrRollbackReadWriteTransaction` permission\non the `session` resource." + }, + "readOnly": { + "description": "Transaction will not write.\n\nAuthorization to begin a read-only transaction requires\n`spanner.databases.beginReadOnlyTransaction` permission\non the `session` resource.", + "$ref": "ReadOnly" + } + }, + "id": "TransactionOptions" + }, + "CreateDatabaseRequest": { + "id": "CreateDatabaseRequest", + "description": "The request for CreateDatabase.", + "type": "object", + "properties": { + "createStatement": { + "description": "Required. A `CREATE DATABASE` statement, which specifies the ID of the\nnew database. The database ID must conform to the regular expression\n`a-z*[a-z0-9]` and be between 2 and 30 characters in length.\nIf the database ID is a reserved word or if it contains a hyphen, the\ndatabase ID must be enclosed in backticks (`` ` ``).", + "type": "string" + }, + "extraStatements": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An optional list of DDL statements to run inside the newly created\ndatabase. Statements can create tables, indexes, etc. These\nstatements execute atomically with the creation of the database:\nif there is an error in any statement, the database is not created." + } + } + }, + "CreateInstanceRequest": { + "description": "The request for CreateInstance.", + "type": "object", + "properties": { + "instanceId": { + "description": "Required. The ID of the instance to create. Valid identifiers are of the\nform `a-z*[a-z0-9]` and must be between 6 and 30 characters in\nlength.", + "type": "string" + }, + "instance": { + "$ref": "Instance", + "description": "Required. The instance to create. The name may be omitted, but if\nspecified must be `\u003cparent\u003e/instances/\u003cinstance_id\u003e`." + } + }, + "id": "CreateInstanceRequest" + }, + "ReadOnly": { + "description": "Message type to initiate a read-only transaction.", + "type": "object", + "properties": { + "maxStaleness": { + "description": "Read data at a timestamp \u003e= `NOW - max_staleness`\nseconds. Guarantees that all writes that have committed more\nthan the specified number of seconds ago are visible. Because\nCloud Spanner chooses the exact timestamp, this mode works even if\nthe client's local clock is substantially skewed from Cloud Spanner\ncommit timestamps.\n\nUseful for reading the freshest data available at a nearby\nreplica, while bounding the possible staleness if the local\nreplica has fallen behind.\n\nNote that this option can only be used in single-use\ntransactions.", + "format": "google-duration", + "type": "string" + }, + "readTimestamp": { + "description": "Executes all reads at the given timestamp. Unlike other modes,\nreads at a specific timestamp are repeatable; the same read at\nthe same timestamp always returns the same data. If the\ntimestamp is in the future, the read will block until the\nspecified timestamp, modulo the read's deadline.\n\nUseful for large scale consistent reads such as mapreduces, or\nfor coordinating many reads against a consistent snapshot of the\ndata.", + "format": "google-datetime", + "type": "string" + }, + "returnReadTimestamp": { + "type": "boolean", + "description": "If true, the Cloud Spanner-selected read timestamp is included in\nthe Transaction message that describes the transaction." + }, + "exactStaleness": { + "description": "Executes all reads at a timestamp that is `exact_staleness`\nold. The timestamp is chosen soon after the read is started.\n\nGuarantees that all writes that have committed more than the\nspecified number of seconds ago are visible. Because Cloud Spanner\nchooses the exact timestamp, this mode works even if the client's\nlocal clock is substantially skewed from Cloud Spanner commit\ntimestamps.\n\nUseful for reading at nearby replicas without the distributed\ntimestamp negotiation overhead of `max_staleness`.", + "format": "google-duration", + "type": "string" + }, + "strong": { + "description": "Read at a timestamp where all previously committed transactions\nare visible.", + "type": "boolean" + }, + "minReadTimestamp": { + "type": "string", + "description": "Executes all reads at a timestamp \u003e= `min_read_timestamp`.\n\nThis is useful for requesting fresher data than some previous\nread, or data that is fresh enough to observe the effects of some\npreviously committed transaction whose timestamp is known.\n\nNote that this option can only be used in single-use transactions.", + "format": "google-datetime" + } + }, + "id": "ReadOnly" + }, + "ExecuteSqlRequest": { + "properties": { + "queryMode": { + "enumDescriptions": [ + "The default mode where only the query result, without any information\nabout the query plan is returned.", + "This mode returns only the query plan, without any result rows or\nexecution statistics information.", + "This mode returns both the query plan and the execution statistics along\nwith the result rows." + ], + "enum": [ + "NORMAL", + "PLAN", + "PROFILE" + ], + "description": "Used to control the amount of debugging information returned in\nResultSetStats.", + "type": "string" + }, + "transaction": { + "$ref": "TransactionSelector", + "description": "The transaction to use. If none is provided, the default is a\ntemporary read-only transaction with strong concurrency." + }, + "resumeToken": { + "description": "If this request is resuming a previously interrupted SQL query\nexecution, `resume_token` should be copied from the last\nPartialResultSet yielded before the interruption. Doing this\nenables the new SQL query execution to resume where the last one left\noff. The rest of the request parameters must exactly match the\nrequest that yielded this token.", + "format": "byte", + "type": "string" + }, + "paramTypes": { + "description": "It is not always possible for Cloud Spanner to infer the right SQL type\nfrom a JSON value. For example, values of type `BYTES` and values\nof type `STRING` both appear in params as JSON strings.\n\nIn these cases, `param_types` can be used to specify the exact\nSQL type for some or all of the SQL query parameters. See the\ndefinition of Type for more information\nabout SQL types.", + "type": "object", + "additionalProperties": { + "$ref": "Type" + } + }, + "sql": { + "description": "Required. The SQL query string.", + "type": "string" + }, + "params": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The SQL query string can contain parameter placeholders. A parameter\nplaceholder consists of `'@'` followed by the parameter\nname. Parameter names consist of any combination of letters,\nnumbers, and underscores.\n\nParameters can appear anywhere that a literal value is expected. The same\nparameter name can be used more than once, for example:\n `\"WHERE id \u003e @msg_id AND id \u003c @msg_id + 100\"`\n\nIt is an error to execute an SQL query with unbound parameters.\n\nParameter values are specified using `params`, which is a JSON\nobject whose keys are parameter names, and whose values are the\ncorresponding parameter values." + } + }, + "id": "ExecuteSqlRequest", + "description": "The request for ExecuteSql and\nExecuteStreamingSql.", + "type": "object" + }, + "Policy": { + "description": "Defines an Identity and Access Management (IAM) policy. It is used to\nspecify access control policies for Cloud Platform resources.\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of\n`members` to a `role`, where the members can be user accounts, Google groups,\nGoogle domains, and service accounts. A `role` is a named list of permissions\ndefined by IAM.\n\n**Example**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\",\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\nFor a description of IAM and its features, see the\n[IAM developer's guide](https://cloud.google.com/iam).", + "type": "object", + "properties": { + "version": { + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", + "type": "integer" + }, + "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "type": "array", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\nIf no `etag` is provided in the call to `setIamPolicy`, then the existing\npolicy is overwritten blindly.", + "format": "byte", + "type": "string" + } + }, + "id": "Policy" + }, + "ReadRequest": { + "description": "The request for Read and\nStreamingRead.", + "type": "object", + "properties": { + "limit": { + "description": "If greater than zero, only the first `limit` rows are yielded. If `limit`\nis zero, the default is no limit.\nA limit cannot be specified if partition_token is set.", + "format": "int64", + "type": "string" + }, + "index": { + "description": "If non-empty, the name of an index on table. This index is\nused instead of the table primary key when interpreting key_set\nand sorting result rows. See key_set for further information.", + "type": "string" + }, + "keySet": { + "description": "Required. `key_set` identifies the rows to be yielded. `key_set` names the\nprimary keys of the rows in table to be yielded, unless index\nis present. If index is present, then key_set instead names\nindex keys in index.\n\nRows are yielded in table primary key order (if index is empty)\nor index key order (if index is non-empty).\n\nIt is not an error for the `key_set` to name rows that do not\nexist in the database. Read yields nothing for nonexistent rows.", + "$ref": "KeySet" + }, + "columns": { + "description": "The columns of table to be returned for each row matching\nthis request.", + "type": "array", + "items": { + "type": "string" + } + }, + "transaction": { + "$ref": "TransactionSelector", + "description": "The transaction to use. If none is provided, the default is a\ntemporary read-only transaction with strong concurrency." + }, + "resumeToken": { + "description": "If this request is resuming a previously interrupted read,\n`resume_token` should be copied from the last\nPartialResultSet yielded before the interruption. Doing this\nenables the new read to resume where the last read left off. The\nrest of the request parameters must exactly match the request\nthat yielded this token.", + "format": "byte", + "type": "string" + }, + "table": { + "description": "Required. The name of the table in the database to be read.", + "type": "string" + } + }, + "id": "ReadRequest" + }, + "Write": { + "description": "Arguments to insert, update, insert_or_update, and\nreplace operations.", + "type": "object", + "properties": { + "table": { + "description": "Required. The table whose rows will be written.", + "type": "string" + }, + "columns": { + "description": "The names of the columns in table to be written.\n\nThe list of columns must contain enough columns to allow\nCloud Spanner to derive values for all primary key columns in the\nrow(s) to be modified.", + "type": "array", + "items": { + "type": "string" + } + }, + "values": { + "description": "The values to be written. `values` can contain more than one\nlist of values. If it does, then multiple rows are written, one\nfor each entry in `values`. Each list in `values` must have\nexactly as many entries as there are entries in columns\nabove. Sending multiple lists is equivalent to sending multiple\n`Mutation`s, each containing one `values` entry and repeating\ntable and columns. Individual values in each list are\nencoded as described here.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "any" + } + } + } + }, + "id": "Write" + }, + "ReadWrite": { + "description": "Message type to initiate a read-write transaction. Currently this\ntransaction type has no options.", + "type": "object", + "properties": {}, + "id": "ReadWrite" + }, + "Operation": { + "type": "object", + "properties": { + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "response": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" + } + }, + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call." + }, + "ResultSet": { + "description": "Results from Read or\nExecuteSql.", + "type": "object", + "properties": { + "metadata": { + "$ref": "ResultSetMetadata", + "description": "Metadata about the result set, such as row type information." + }, + "stats": { + "$ref": "ResultSetStats", + "description": "Query plan and execution statistics for the query that produced this\nresult set. These can be requested by setting\nExecuteSqlRequest.query_mode." + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "any" + } + }, + "description": "Each element in `rows` is a row whose format is defined by\nmetadata.row_type. The ith element\nin each row matches the ith field in\nmetadata.row_type. Elements are\nencoded based on type as described\nhere." + } + }, + "id": "ResultSet" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "type": "array", + "items": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "type": "object" + } + } + }, + "id": "Status" + }, + "CreateSessionRequest": { + "description": "The request for CreateSession.", + "type": "object", + "properties": { + "session": { + "$ref": "Session", + "description": "The session to create." + } + }, + "id": "CreateSessionRequest" + }, + "UpdateDatabaseDdlRequest": { + "description": "Enqueues the given DDL statements to be applied, in order but not\nnecessarily all at once, to the database schema at some point (or\npoints) in the future. The server checks that the statements\nare executable (syntactically valid, name tables that exist, etc.)\nbefore enqueueing them, but they may still fail upon\nlater execution (e.g., if a statement from another batch of\nstatements is applied first and it conflicts in some way, or if\nthere is some data-related problem like a `NULL` value in a column to\nwhich `NOT NULL` would be added). If a statement fails, all\nsubsequent statements in the batch are automatically cancelled.\n\nEach batch of statements is assigned a name which can be used with\nthe Operations API to monitor\nprogress. See the\noperation_id field for more\ndetails.", + "type": "object", + "properties": { + "operationId": { + "description": "If empty, the new update request is assigned an\nautomatically-generated operation ID. Otherwise, `operation_id`\nis used to construct the name of the resulting\nOperation.\n\nSpecifying an explicit operation ID simplifies determining\nwhether the statements were executed in the event that the\nUpdateDatabaseDdl call is replayed,\nor the return value is otherwise lost: the database and\n`operation_id` fields can be combined to form the\nname of the resulting\nlongrunning.Operation: `\u003cdatabase\u003e/operations/\u003coperation_id\u003e`.\n\n`operation_id` should be unique within the database, and must be\na valid identifier: `a-z*`. Note that\nautomatically-generated operation IDs always begin with an\nunderscore. If the named operation already exists,\nUpdateDatabaseDdl returns\n`ALREADY_EXISTS`.", + "type": "string" + }, + "statements": { + "description": "DDL statements to be applied to the database.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "UpdateDatabaseDdlRequest" + }, + "Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` or `joe@example.com`.\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n" + }, + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + } + }, + "id": "Binding" + }, + "PartialResultSet": { + "description": "Partial results from a streaming read or SQL query. Streaming reads and\nSQL queries better tolerate large result sets, large rows, and large\nvalues, but are a little trickier to consume.", + "type": "object", + "properties": { + "chunkedValue": { + "description": "If true, then the final value in values is chunked, and must\nbe combined with more values from subsequent `PartialResultSet`s\nto obtain a complete field value.", + "type": "boolean" + }, + "metadata": { + "$ref": "ResultSetMetadata", + "description": "Metadata about the result set, such as row type information.\nOnly present in the first response." + }, + "values": { + "description": "A streamed result set consists of a stream of values, which might\nbe split into many `PartialResultSet` messages to accommodate\nlarge rows and/or large values. Every N complete values defines a\nrow, where N is equal to the number of entries in\nmetadata.row_type.fields.\n\nMost values are encoded based on type as described\nhere.\n\nIt is possible that the last value in values is \"chunked\",\nmeaning that the rest of the value is sent in subsequent\n`PartialResultSet`(s). This is denoted by the chunked_value\nfield. Two or more chunked values can be merged to form a\ncomplete value as follows:\n\n * `bool/number/null`: cannot be chunked\n * `string`: concatenate the strings\n * `list`: concatenate the lists. If the last element in a list is a\n `string`, `list`, or `object`, merge it with the first element in\n the next list by applying these rules recursively.\n * `object`: concatenate the (field name, field value) pairs. If a\n field name is duplicated, then apply these rules recursively\n to merge the field values.\n\nSome examples of merging:\n\n # Strings are concatenated.\n \"foo\", \"bar\" =\u003e \"foobar\"\n\n # Lists of non-strings are concatenated.\n [2, 3], [4] =\u003e [2, 3, 4]\n\n # Lists are concatenated, but the last and first elements are merged\n # because they are strings.\n [\"a\", \"b\"], [\"c\", \"d\"] =\u003e [\"a\", \"bc\", \"d\"]\n\n # Lists are concatenated, but the last and first elements are merged\n # because they are lists. Recursively, the last and first elements\n # of the inner lists are merged because they are strings.\n [\"a\", [\"b\", \"c\"]], [[\"d\"], \"e\"] =\u003e [\"a\", [\"b\", \"cd\"], \"e\"]\n\n # Non-overlapping object fields are combined.\n {\"a\": \"1\"}, {\"b\": \"2\"} =\u003e {\"a\": \"1\", \"b\": 2\"}\n\n # Overlapping object fields are merged.\n {\"a\": \"1\"}, {\"a\": \"2\"} =\u003e {\"a\": \"12\"}\n\n # Examples of merging objects containing lists of strings.\n {\"a\": [\"1\"]}, {\"a\": [\"2\"]} =\u003e {\"a\": [\"12\"]}\n\nFor a more complete example, suppose a streaming SQL query is\nyielding a result set whose rows contain a single string\nfield. The following `PartialResultSet`s might be yielded:\n\n {\n \"metadata\": { ... }\n \"values\": [\"Hello\", \"W\"]\n \"chunked_value\": true\n \"resume_token\": \"Af65...\"\n }\n {\n \"values\": [\"orl\"]\n \"chunked_value\": true\n \"resume_token\": \"Bqp2...\"\n }\n {\n \"values\": [\"d\"]\n \"resume_token\": \"Zx1B...\"\n }\n\nThis sequence of `PartialResultSet`s encodes two rows, one\ncontaining the field value `\"Hello\"`, and a second containing the\nfield value `\"World\" = \"W\" + \"orl\" + \"d\"`.", + "type": "array", + "items": { + "type": "any" + } + }, + "resumeToken": { + "type": "string", + "description": "Streaming calls might be interrupted for a variety of reasons, such\nas TCP connection loss. If this occurs, the stream of results can\nbe resumed by re-sending the original request and including\n`resume_token`. Note that executing any other transaction in the\nsame session invalidates the token.", + "format": "byte" + }, + "stats": { + "$ref": "ResultSetStats", + "description": "Query plan and execution statistics for the query that produced this\nstreaming result set. These can be requested by setting\nExecuteSqlRequest.query_mode and are sent\nonly once with the last response in the stream." + } + }, + "id": "PartialResultSet" + }, + "ListOperationsResponse": { + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "Operation" + } + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations." + }, + "UpdateInstanceMetadata": { + "id": "UpdateInstanceMetadata", + "description": "Metadata type for the operation returned by\nUpdateInstance.", + "type": "object", + "properties": { + "cancelTime": { + "description": "The time at which this operation was cancelled. If set, this operation is\nin the process of undoing itself (which is guaranteed to succeed) and\ncannot be cancelled again.", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "The time at which this operation failed or was completed successfully.", + "format": "google-datetime", + "type": "string" + }, + "instance": { + "$ref": "Instance", + "description": "The desired end state of the update." + }, + "startTime": { + "description": "The time at which UpdateInstance\nrequest was received.", + "format": "google-datetime", + "type": "string" + } + } + }, + "ResultSetMetadata": { + "id": "ResultSetMetadata", + "description": "Metadata about a ResultSet or PartialResultSet.", + "type": "object", + "properties": { + "transaction": { + "description": "If the read or SQL query began a transaction as a side-effect, the\ninformation about the new transaction is yielded here.", + "$ref": "Transaction" + }, + "rowType": { + "$ref": "StructType", + "description": "Indicates the field names and types for the rows in the result\nset. For example, a SQL query like `\"SELECT UserId, UserName FROM\nUsers\"` could return a `row_type` value like:\n\n \"fields\": [\n { \"name\": \"UserId\", \"type\": { \"code\": \"INT64\" } },\n { \"name\": \"UserName\", \"type\": { \"code\": \"STRING\" } },\n ]" + } + } + }, + "TransactionSelector": { + "description": "This message is used to select the transaction in which a\nRead or\nExecuteSql call runs.\n\nSee TransactionOptions for more information about transactions.", + "type": "object", + "properties": { + "singleUse": { + "$ref": "TransactionOptions", + "description": "Execute the read or SQL query in a temporary transaction.\nThis is the most efficient way to execute a transaction that\nconsists of a single SQL query." + }, + "begin": { + "description": "Begin a new transaction and execute this read or SQL query in\nit. The transaction ID of the new transaction is returned in\nResultSetMetadata.transaction, which is a Transaction.", + "$ref": "TransactionOptions" + }, + "id": { + "description": "Execute the read or SQL query in a previously-started transaction.", + "format": "byte", + "type": "string" + } + }, + "id": "TransactionSelector" + }, + "Mutation": { + "description": "A modification to one or more Cloud Spanner rows. Mutations can be\napplied to a Cloud Spanner database by sending them in a\nCommit call.", + "type": "object", + "properties": { + "insert": { + "$ref": "Write", + "description": "Insert new rows in a table. If any of the rows already exist,\nthe write or transaction fails with error `ALREADY_EXISTS`." + }, + "insertOrUpdate": { + "$ref": "Write", + "description": "Like insert, except that if the row already exists, then\nits column values are overwritten with the ones provided. Any\ncolumn values not explicitly written are preserved." + }, + "update": { + "$ref": "Write", + "description": "Update existing rows in a table. If any of the rows does not\nalready exist, the transaction fails with error `NOT_FOUND`." + }, + "replace": { + "description": "Like insert, except that if the row already exists, it is\ndeleted, and the column values provided are inserted\ninstead. Unlike insert_or_update, this means any values not\nexplicitly written become `NULL`.", + "$ref": "Write" + }, + "delete": { + "$ref": "Delete", + "description": "Delete rows from a table. Succeeds whether or not the named\nrows were present." + } + }, + "id": "Mutation" + }, + "KeySet": { + "description": "`KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All\nthe keys are expected to be in the same table or index. The keys need\nnot be sorted in any particular way.\n\nIf the same key is specified multiple times in the set (for example\nif two ranges, two keys, or a key and a range overlap), Cloud Spanner\nbehaves as if the key were only specified once.", + "type": "object", + "properties": { + "ranges": { + "description": "A list of key ranges. See KeyRange for more information about\nkey range specifications.", + "type": "array", + "items": { + "$ref": "KeyRange" + } + }, + "keys": { + "description": "A list of specific keys. Entries in `keys` should have exactly as\nmany elements as there are columns in the primary or index key\nwith which this `KeySet` is used. Individual key values are\nencoded as described here.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "any" + } + } + }, + "all": { + "description": "For convenience `all` can be set to `true` to indicate that this\n`KeySet` matches all keys in the table or index. Note that any keys\nspecified in `keys` or `ranges` are only yielded once.", + "type": "boolean" + } + }, + "id": "KeySet" + }, + "GetDatabaseDdlResponse": { + "description": "The response for GetDatabaseDdl.", + "type": "object", + "properties": { + "statements": { + "description": "A list of formatted DDL statements defining the schema of the database\nspecified in the request.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "GetDatabaseDdlResponse" + }, + "Database": { + "id": "Database", + "description": "A Cloud Spanner database.", + "type": "object", + "properties": { + "state": { + "description": "Output only. The current database state.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "The database is still being created. Operations on the database may fail\nwith `FAILED_PRECONDITION` in this state.", + "The database is fully created and ready for use." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "READY" + ] + }, + "name": { + "description": "Required. The name of the database. Values are of the form\n`projects/\u003cproject\u003e/instances/\u003cinstance\u003e/databases/\u003cdatabase\u003e`,\nwhere `\u003cdatabase\u003e` is as specified in the `CREATE DATABASE`\nstatement. This name can be passed to other API methods to\nidentify the database.", + "type": "string" + } + } + }, + "Instance": { + "description": "An isolated set of Cloud Spanner resources on which databases can be hosted.", + "type": "object", + "properties": { + "displayName": { + "description": "Required. The descriptive name for this instance as it appears in UIs.\nMust be unique per project and between 4 and 30 characters in length.", + "type": "string" + }, + "nodeCount": { + "description": "Required. The number of nodes allocated to this instance. This may be zero\nin API responses for instances that are not yet in state `READY`.\n\nEach Spanner node can provide up to 10,000 QPS of reads or 2000 QPS of\nwrites (writing single rows at 1KB data per row), and 2 TiB storage.\n\nFor optimal performance, we recommend provisioning enough nodes to keep\noverall CPU utilization under 75%.\n\nA minimum of 3 nodes is recommended for production environments. This\nminimum is required for SLAs to apply to your instance.\n\nNote that Cloud Spanner performance is highly dependent on workload, schema\ndesign, and dataset characteristics. The performance numbers above are\nestimates, and assume [best practices](https://cloud.google.com/spanner/docs/bulk-loading)\nare followed.", + "format": "int32", + "type": "integer" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Cloud Labels are a flexible and lightweight mechanism for organizing cloud\nresources into groups that reflect a customer's organizational needs and\ndeployment strategies. Cloud Labels can be used to filter collections of\nresources. They can be used to control how resource metrics are aggregated.\nAnd they can be used as arguments to policy management rules (e.g. route,\nfirewall, load balancing, etc.).\n\n * Label keys must be between 1 and 63 characters long and must conform to\n the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.\n * Label values must be between 0 and 63 characters long and must conform\n to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.\n * No more than 64 labels can be associated with a given resource.\n\nSee https://goo.gl/xmQnxf for more information on and examples of labels.\n\nIf you plan to use labels in your own code, please note that additional\ncharacters may be allowed in the future. And so you are advised to use an\ninternal label representation, such as JSON, which doesn't rely upon\nspecific characters being disallowed. For example, representing labels\nas the string: name + \"_\" + value would prove problematic if we were to\nallow \"_\" in a future release." + }, + "config": { + "description": "Required. The name of the instance's configuration. Values are of the form\n`projects/\u003cproject\u003e/instanceConfigs/\u003cconfiguration\u003e`. See\nalso InstanceConfig and\nListInstanceConfigs.", + "type": "string" + }, + "state": { + "enumDescriptions": [ + "Not specified.", + "The instance is still being created. Resources may not be\navailable yet, and operations such as database creation may not\nwork.", + "The instance is fully created and ready to do work such as\ncreating databases." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "READY" + ], + "description": "Output only. The current instance state. For\nCreateInstance, the state must be\neither omitted or set to `CREATING`. For\nUpdateInstance, the state must be\neither omitted or set to `READY`.", + "type": "string" + }, + "name": { + "description": "Required. A unique identifier for the instance, which cannot be changed\nafter the instance is created. Values are of the form\n`projects/\u003cproject\u003e/instances/a-z*[a-z0-9]`. The final\nsegment of the name must be between 6 and 30 characters in length.", + "type": "string" + } + }, + "id": "Instance" + }, + "ListDatabasesResponse": { + "properties": { + "nextPageToken": { + "description": "`next_page_token` can be sent in a subsequent\nListDatabases call to fetch more\nof the matching databases.", + "type": "string" + }, + "databases": { + "description": "Databases that matched the request.", + "type": "array", + "items": { + "$ref": "Database" + } + } + }, + "id": "ListDatabasesResponse", + "description": "The response for ListDatabases.", + "type": "object" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them." + } + }, + "id": "SetIamPolicyRequest" + }, + "RollbackRequest": { + "properties": { + "transactionId": { + "description": "Required. The transaction to roll back.", + "format": "byte", + "type": "string" + } + }, + "id": "RollbackRequest", + "description": "The request for Rollback.", + "type": "object" + }, + "Transaction": { + "description": "A transaction.", + "type": "object", + "properties": { + "readTimestamp": { + "description": "For snapshot read-only transactions, the read timestamp chosen\nfor the transaction. Not returned by default: see\nTransactionOptions.ReadOnly.return_read_timestamp.", + "format": "google-datetime", + "type": "string" + }, + "id": { + "description": "`id` may be used to identify the transaction in subsequent\nRead,\nExecuteSql,\nCommit, or\nRollback calls.\n\nSingle-use read-only transactions do not have IDs, because\nsingle-use transactions do not support multiple requests.", + "format": "byte", + "type": "string" + } + }, + "id": "Transaction" + }, + "UpdateDatabaseDdlMetadata": { + "id": "UpdateDatabaseDdlMetadata", + "description": "Metadata type for the operation returned by\nUpdateDatabaseDdl.", + "type": "object", + "properties": { + "statements": { + "description": "For an update this list contains all the statements. For an\nindividual statement, this list contains only that statement.", + "type": "array", + "items": { + "type": "string" + } + }, + "commitTimestamps": { + "description": "Reports the commit timestamps of all statements that have\nsucceeded so far, where `commit_timestamps[i]` is the commit\ntimestamp for the statement `statements[i]`.", + "type": "array", + "items": { + "format": "google-datetime", + "type": "string" + } + }, + "database": { + "description": "The database being modified.", + "type": "string" + } + } + }, + "StructType": { + "description": "`StructType` defines the fields of a STRUCT type.", + "type": "object", + "properties": { + "fields": { + "description": "The list of fields that make up this struct. Order is\nsignificant, because values of this struct type are represented as\nlists, where the order of field values matches the order of\nfields in the StructType. In turn, the order of fields\nmatches the order of columns in a read request, or the order of\nfields in the `SELECT` clause of a query.", + "type": "array", + "items": { + "$ref": "Field" + } + } + }, + "id": "StructType" + }, + "QueryPlan": { + "id": "QueryPlan", + "description": "Contains an ordered list of nodes appearing in the query plan.", + "type": "object", + "properties": { + "planNodes": { + "description": "The nodes in the query plan. Plan nodes are returned in pre-order starting\nwith the plan root. Each PlanNode's `id` corresponds to its index in\n`plan_nodes`.", + "type": "array", + "items": { + "$ref": "PlanNode" + } + } + } + }, + "Field": { + "description": "Message representing a single field of a struct.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the field. For reads, this is the column name. For\nSQL queries, it is the column alias (e.g., `\"Word\"` in the\nquery `\"SELECT 'hello' AS Word\"`), or the column name (e.g.,\n`\"ColName\"` in the query `\"SELECT ColName FROM Table\"`). Some\ncolumns might have an empty name (e.g., !\"SELECT\nUPPER(ColName)\"`). Note that a query result can contain\nmultiple fields with the same name." + }, + "type": { + "$ref": "Type", + "description": "The type of the field." + } + }, + "id": "Field" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "description": "REQUIRED: The set of permissions to check for 'resource'.\nPermissions with wildcards (such as '*', 'spanner.*', 'spanner.instances.*') are not allowed.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "TestIamPermissionsRequest" + }, + "ResultSetStats": { + "description": "Additional statistics about a ResultSet or PartialResultSet.", + "type": "object", + "properties": { + "queryStats": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Aggregated statistics from the execution of the query. Only present when\nthe query is profiled. For example, a query could return the statistics as\nfollows:\n\n {\n \"rows_returned\": \"3\",\n \"elapsed_time\": \"1.22 secs\",\n \"cpu_time\": \"1.19 secs\"\n }", + "type": "object" + }, + "queryPlan": { + "description": "QueryPlan for the query associated with this result.", + "$ref": "QueryPlan" + } + }, + "id": "ResultSetStats" + }, + "CommitResponse": { + "description": "The response for Commit.", + "type": "object", + "properties": { + "commitTimestamp": { + "description": "The Cloud Spanner timestamp at which the transaction committed.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "CommitResponse" + }, + "Type": { + "description": "`Type` indicates the type of a Cloud Spanner value, as might be stored in a\ntable cell or returned from an SQL query.", + "type": "object", + "properties": { + "code": { + "enum": [ + "TYPE_CODE_UNSPECIFIED", + "BOOL", + "INT64", + "FLOAT64", + "TIMESTAMP", + "DATE", + "STRING", + "BYTES", + "ARRAY", + "STRUCT" + ], + "description": "Required. The TypeCode for this type.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Encoded as JSON `true` or `false`.", + "Encoded as `string`, in decimal format.", + "Encoded as `number`, or the strings `\"NaN\"`, `\"Infinity\"`, or\n`\"-Infinity\"`.", + "Encoded as `string` in RFC 3339 timestamp format. The time zone\nmust be present, and must be `\"Z\"`.", + "Encoded as `string` in RFC 3339 date format.", + "Encoded as `string`.", + "Encoded as a base64-encoded `string`, as described in RFC 4648,\nsection 4.", + "Encoded as `list`, where the list elements are represented\naccording to array_element_type.", + "Encoded as `list`, where list element `i` is represented according\nto [struct_type.fields[i]][google.spanner.v1.StructType.fields]." + ] + }, + "structType": { + "description": "If code == STRUCT, then `struct_type`\nprovides type information for the struct's fields.", + "$ref": "StructType" + }, + "arrayElementType": { + "$ref": "Type", + "description": "If code == ARRAY, then `array_element_type`\nis the type of the array elements." + } + }, + "id": "Type" + }, + "PlanNode": { + "description": "Node information for nodes appearing in a QueryPlan.plan_nodes.", + "type": "object", + "properties": { + "index": { + "description": "The `PlanNode`'s index in node list.", + "format": "int32", + "type": "integer" + }, + "kind": { + "enum": [ + "KIND_UNSPECIFIED", + "RELATIONAL", + "SCALAR" + ], + "description": "Used to determine the type of node. May be needed for visualizing\ndifferent kinds of nodes differently. For example, If the node is a\nSCALAR node, it will have a condensed representation\nwhich can be used to directly embed a description of the node in its\nparent.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Denotes a Relational operator node in the expression tree. Relational\noperators represent iterative processing of rows during query execution.\nFor example, a `TableScan` operation that reads rows from a table.", + "Denotes a Scalar node in the expression tree. Scalar nodes represent\nnon-iterable entities in the query plan. For example, constants or\narithmetic operators appearing inside predicate expressions or references\nto column names." + ] + }, + "displayName": { + "description": "The display name for the node.", + "type": "string" + }, + "childLinks": { + "description": "List of child node `index`es and their relationship to this parent.", + "type": "array", + "items": { + "$ref": "ChildLink" + } + }, + "metadata": { + "description": "Attributes relevant to the node contained in a group of key-value pairs.\nFor example, a Parameter Reference node could have the following\ninformation in its metadata:\n\n {\n \"parameter_reference\": \"param1\",\n \"parameter_type\": \"array\"\n }", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "executionStats": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The execution statistics associated with the node, contained in a group of\nkey-value pairs. Only present if the plan was returned as a result of a\nprofile query. For example, number of executions, number of rows/time per\nexecution etc.", + "type": "object" + }, + "shortRepresentation": { + "$ref": "ShortRepresentation", + "description": "Condensed representation for SCALAR nodes." + } + }, + "id": "PlanNode" + }, + "CreateInstanceMetadata": { + "type": "object", + "properties": { + "cancelTime": { + "description": "The time at which this operation was cancelled. If set, this operation is\nin the process of undoing itself (which is guaranteed to succeed) and\ncannot be cancelled again.", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "The time at which this operation failed or was completed successfully.", + "format": "google-datetime", + "type": "string" + }, + "instance": { + "description": "The instance being created.", + "$ref": "Instance" + }, + "startTime": { + "description": "The time at which the\nCreateInstance request was\nreceived.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "CreateInstanceMetadata", + "description": "Metadata type for the operation returned by\nCreateInstance." + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Spanner", + "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/spanner.admin": { + "description": "Administer your Spanner databases" + }, + "https://www.googleapis.com/auth/spanner.data": { + "description": "View and manage the contents of your Spanner databases" + } + } + } + }, + "rootUrl": "https://spanner.googleapis.com/", + "ownerDomain": "google.com", + "name": "spanner", + "batchPath": "batch", + "title": "Cloud Spanner API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "instanceConfigs": { + "methods": { + "list": { + "description": "Lists the supported instance configurations for a given project.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListInstanceConfigsResponse" + }, + "parameters": { + "pageToken": { + "description": "If non-empty, `page_token` should contain a\nnext_page_token\nfrom a previous ListInstanceConfigsResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "type": "integer", + "location": "query", + "description": "Number of instance configurations to be returned in the response. If 0 or\nless, defaults to the server's maximum allowed page size.", + "format": "int32" + }, + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The name of the project for which a list of supported instance\nconfigurations is requested. Values are of the form\n`projects/\u003cproject\u003e`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instanceConfigs", + "id": "spanner.projects.instanceConfigs.list", + "path": "v1/{+parent}/instanceConfigs" + }, + "get": { + "response": { + "$ref": "InstanceConfig" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the requested instance configuration. Values are of\nthe form `projects/\u003cproject\u003e/instanceConfigs/\u003cconfig\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instanceConfigs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instanceConfigs/{instanceConfigsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instanceConfigs.get", + "description": "Gets information about a particular instance configuration." + } + } + }, + "instances": { + "resources": { + "databases": { + "methods": { + "create": { + "request": { + "$ref": "CreateDatabaseRequest" + }, + "description": "Creates a new Cloud Spanner database and starts to prepare it for serving.\nThe returned long-running operation will\nhave a name of the format `\u003cdatabase_name\u003e/operations/\u003coperation_id\u003e` and\ncan be used to track preparation of the database. The\nmetadata field type is\nCreateDatabaseMetadata. The\nresponse field type is\nDatabase, if successful.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "parent": { + "description": "Required. The name of the instance that will serve the new database.\nValues are of the form `projects/\u003cproject\u003e/instances/\u003cinstance\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases", + "id": "spanner.projects.instances.databases.create", + "path": "v1/{+parent}/databases" + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on a database resource. Replaces any\nexisting policy.\n\nAuthorization requires `spanner.databases.setIamPolicy` permission on\nresource.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path", + "description": "REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e` for instance resources and `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e/databases/\u003cdatabase ID\u003e` for databases resources." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "spanner.projects.instances.databases.setIamPolicy" + }, + "getIamPolicy": { + "path": "v1/{+resource}:getIamPolicy", + "id": "spanner.projects.instances.databases.getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for a database resource. Returns an empty\npolicy if a database exists but does not have a policy set.\n\nAuthorization requires `spanner.databases.getIamPolicy` permission on\nresource.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path", + "description": "REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e` for instance resources and `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e/databases/\u003cdatabase ID\u003e` for database resources.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}:getIamPolicy" + }, + "get": { + "response": { + "$ref": "Database" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "name": { + "description": "Required. The name of the requested database. Values are of the form\n`projects/\u003cproject\u003e/instances/\u003cinstance\u003e/databases/\u003cdatabase\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.get", + "description": "Gets the state of a Cloud Spanner database." + }, + "dropDatabase": { + "httpMethod": "DELETE", + "parameterOrder": [ + "database" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "database": { + "description": "Required. The database to be dropped.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}", + "id": "spanner.projects.instances.databases.dropDatabase", + "path": "v1/{+database}", + "description": "Drops (aka deletes) a Cloud Spanner database." + }, + "updateDdl": { + "request": { + "$ref": "UpdateDatabaseDdlRequest" + }, + "description": "Updates the schema of a Cloud Spanner database by\ncreating/altering/dropping tables, columns, indexes, etc. The returned\nlong-running operation will have a name of\nthe format `\u003cdatabase_name\u003e/operations/\u003coperation_id\u003e` and can be used to\ntrack execution of the schema change(s). The\nmetadata field type is\nUpdateDatabaseDdlMetadata. The operation has no response.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "PATCH", + "parameters": { + "database": { + "description": "Required. The database to update.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/ddl", + "path": "v1/{+database}/ddl", + "id": "spanner.projects.instances.databases.updateDdl" + }, + "testIamPermissions": { + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e` for instance resources and `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e/databases/\u003cdatabase ID\u003e` for database resources.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "spanner.projects.instances.databases.testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that the caller has on the specified database resource.\n\nAttempting this RPC on a non-existent Cloud Spanner database will result in\na NOT_FOUND error if the user has `spanner.databases.list` permission on\nthe containing Cloud Spanner instance. Otherwise returns an empty set of\npermissions.", + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST" + }, + "getDdl": { + "description": "Returns the schema of a Cloud Spanner database as a list of formatted\nDDL statements. This method does not show pending schema updates, those may\nbe queried using the Operations API.", + "httpMethod": "GET", + "parameterOrder": [ + "database" + ], + "response": { + "$ref": "GetDatabaseDdlResponse" + }, + "parameters": { + "database": { + "location": "path", + "description": "Required. The database whose schema we wish to get.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/ddl", + "id": "spanner.projects.instances.databases.getDdl", + "path": "v1/{+database}/ddl" + }, + "list": { + "description": "Lists Cloud Spanner databases.", + "response": { + "$ref": "ListDatabasesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "If non-empty, `page_token` should contain a\nnext_page_token from a\nprevious ListDatabasesResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Number of databases to be returned in the response. If 0 or less,\ndefaults to the server's maximum allowed page size.", + "format": "int32", + "type": "integer" + }, + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$", + "location": "path", + "description": "Required. The instance whose databases should be listed.\nValues are of the form `projects/\u003cproject\u003e/instances/\u003cinstance\u003e`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases", + "path": "v1/{+parent}/databases", + "id": "spanner.projects.instances.databases.list" + } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations/{operationsId}:cancel", + "path": "v1/{+name}:cancel", + "id": "spanner.projects.instances.databases.operations.cancel", + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`." + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations/{operationsId}", + "id": "spanner.projects.instances.databases.operations.delete", + "path": "v1/{+name}", + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`." + }, + "list": { + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.operations.list", + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations$", + "location": "path" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations" + }, + "get": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.operations.get", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + } + } + }, + "sessions": { + "methods": { + "commit": { + "path": "v1/{+session}:commit", + "id": "spanner.projects.instances.databases.sessions.commit", + "request": { + "$ref": "CommitRequest" + }, + "description": "Commits a transaction. The request includes the mutations to be\napplied to rows in the database.\n\n`Commit` might return an `ABORTED` error. This can occur at any time;\ncommonly, the cause is conflicts with concurrent\ntransactions. However, it can also happen for a variety of other\nreasons. If `Commit` returns `ABORTED`, the caller should re-attempt\nthe transaction from the beginning, re-using the same session.", + "response": { + "$ref": "CommitResponse" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "parameters": { + "session": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path", + "description": "Required. The session in which the transaction to be committed is running." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:commit" + }, + "beginTransaction": { + "path": "v1/{+session}:beginTransaction", + "id": "spanner.projects.instances.databases.sessions.beginTransaction", + "request": { + "$ref": "BeginTransactionRequest" + }, + "description": "Begins a new transaction. This step can often be skipped:\nRead, ExecuteSql and\nCommit can begin a new transaction as a\nside-effect.", + "response": { + "$ref": "Transaction" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "parameters": { + "session": { + "location": "path", + "description": "Required. The session in which the transaction runs.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:beginTransaction" + }, + "executeStreamingSql": { + "httpMethod": "POST", + "parameterOrder": [ + "session" + ], + "response": { + "$ref": "PartialResultSet" + }, + "parameters": { + "session": { + "description": "Required. The session in which the SQL query should be performed.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:executeStreamingSql", + "id": "spanner.projects.instances.databases.sessions.executeStreamingSql", + "path": "v1/{+session}:executeStreamingSql", + "request": { + "$ref": "ExecuteSqlRequest" + }, + "description": "Like ExecuteSql, except returns the result\nset as a stream. Unlike ExecuteSql, there\nis no limit on the size of the returned result set. However, no\nindividual row in the result set can exceed 100 MiB, and no\ncolumn value can exceed 10 MiB." + }, + "delete": { + "description": "Ends a session, releasing server resources associated with it.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The name of the session to delete.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.sessions.delete" + }, + "executeSql": { + "response": { + "$ref": "ResultSet" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "parameters": { + "session": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path", + "description": "Required. The session in which the SQL query should be performed." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:executeSql", + "path": "v1/{+session}:executeSql", + "id": "spanner.projects.instances.databases.sessions.executeSql", + "request": { + "$ref": "ExecuteSqlRequest" + }, + "description": "Executes an SQL query, returning all rows in a single reply. This\nmethod cannot be used to return a result set larger than 10 MiB;\nif the query yields more data than that, the query fails with\na `FAILED_PRECONDITION` error.\n\nQueries inside read-write transactions might return `ABORTED`. If\nthis occurs, the application should restart the transaction from\nthe beginning. See Transaction for more details.\n\nLarger result sets can be fetched in streaming fashion by calling\nExecuteStreamingSql instead." + }, + "list": { + "description": "Lists all sessions in a given database.", + "response": { + "$ref": "ListSessionsResponse" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "If non-empty, `page_token` should contain a\nnext_page_token from a previous\nListSessionsResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Number of sessions to be returned in the response. If 0 or less, defaults\nto the server's maximum allowed page size.", + "format": "int32", + "type": "integer" + }, + "database": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path", + "description": "Required. The database in which to list sessions." + }, + "filter": { + "location": "query", + "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n * labels.key where key is the name of a label\n\nSome examples of using filters are:\n\n * labels.env:* --\u003e The session has the label \"env\".\n * labels.env:dev --\u003e The session has the label \"env\" and the value of\n the label contains the string \"dev\".", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions", + "path": "v1/{+database}/sessions", + "id": "spanner.projects.instances.databases.sessions.list" + }, + "streamingRead": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:streamingRead", + "path": "v1/{+session}:streamingRead", + "id": "spanner.projects.instances.databases.sessions.streamingRead", + "request": { + "$ref": "ReadRequest" + }, + "description": "Like Read, except returns the result set as a\nstream. Unlike Read, there is no limit on the\nsize of the returned result set. However, no individual row in\nthe result set can exceed 100 MiB, and no column value can exceed\n10 MiB.", + "response": { + "$ref": "PartialResultSet" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "parameters": { + "session": { + "location": "path", + "description": "Required. The session in which the read should be performed.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ] + }, + "rollback": { + "request": { + "$ref": "RollbackRequest" + }, + "description": "Rolls back a transaction, releasing any locks it holds. It is a good\nidea to call this for any transaction that includes one or more\nRead or ExecuteSql requests and\nultimately decides not to commit.\n\n`Rollback` returns `OK` if it successfully aborts the transaction, the\ntransaction was already aborted, or the transaction is not\nfound. `Rollback` never returns `ABORTED`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "parameters": { + "session": { + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path", + "description": "Required. The session in which the transaction to roll back is running.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:rollback", + "path": "v1/{+session}:rollback", + "id": "spanner.projects.instances.databases.sessions.rollback" + }, + "create": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions", + "path": "v1/{+database}/sessions", + "id": "spanner.projects.instances.databases.sessions.create", + "request": { + "$ref": "CreateSessionRequest" + }, + "description": "Creates a new session. A session can be used to perform\ntransactions that read and/or modify data in a Cloud Spanner database.\nSessions are meant to be reused for many consecutive\ntransactions.\n\nSessions can only execute one transaction at a time. To execute\nmultiple concurrent read-write/write-only transactions, create\nmultiple sessions. Note that standalone reads and queries use a\ntransaction internally, and count toward the one transaction\nlimit.\n\nCloud Spanner limits the number of sessions that can exist at any given\ntime; thus, it is a good idea to delete idle and/or unneeded sessions.\nAside from explicit deletes, Cloud Spanner can delete sessions for which no\noperations are sent for more than an hour. If a session is deleted,\nrequests to it return `NOT_FOUND`.\n\nIdle sessions can be kept alive by sending a trivial SQL query\nperiodically, e.g., `\"SELECT 1\"`.", + "response": { + "$ref": "Session" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "POST", + "parameters": { + "database": { + "description": "Required. The database in which the new session is created.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ] + }, + "read": { + "response": { + "$ref": "ResultSet" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "parameters": { + "session": { + "description": "Required. The session in which the read should be performed.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:read", + "path": "v1/{+session}:read", + "id": "spanner.projects.instances.databases.sessions.read", + "description": "Reads rows from the database using key lookups and scans, as a\nsimple key/value style alternative to\nExecuteSql. This method cannot be used to\nreturn a result set larger than 10 MiB; if the read matches more\ndata than that, the read fails with a `FAILED_PRECONDITION`\nerror.\n\nReads inside read-write transactions might return `ABORTED`. If\nthis occurs, the application should restart the transaction from\nthe beginning. See Transaction for more details.\n\nLarger result sets can be yielded in streaming fashion by calling\nStreamingRead instead.", + "request": { + "$ref": "ReadRequest" + } + }, + "get": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.sessions.get", + "description": "Gets a session. Returns `NOT_FOUND` if the session does not exist.\nThis is mainly useful for determining whether a session is still\nalive.", + "response": { + "$ref": "Session" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$", + "location": "path", + "description": "Required. The name of the session to retrieve.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ] + } + } + } + } + }, + "operations": { + "methods": { + "cancel": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be cancelled." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations/{operationsId}:cancel", + "id": "spanner.projects.instances.operations.cancel", + "path": "v1/{+name}:cancel", + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`." + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be deleted." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations/{operationsId}", + "id": "spanner.projects.instances.operations.delete", + "path": "v1/{+name}" + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "filter": { + "type": "string", + "location": "query", + "description": "The standard list filter." + }, + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations", + "path": "v1/{+name}", + "id": "spanner.projects.instances.operations.list" + }, + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.operations.get", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + } + } + } + }, + "methods": { + "testIamPermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/instances/[^/]+$", + "location": "path", + "description": "REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e` for instance resources and `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e/databases/\u003cdatabase ID\u003e` for database resources.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}:testIamPermissions", + "id": "spanner.projects.instances.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Returns permissions that the caller has on the specified instance resource.\n\nAttempting this RPC on a non-existent Cloud Spanner instance resource will\nresult in a NOT_FOUND error if the user has `spanner.instances.list`\npermission on the containing Google Cloud Project. Otherwise returns an\nempty set of permissions." + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "description": "Required. The name of the instance to be deleted. Values are of the form\n`projects/\u003cproject\u003e/instances/\u003cinstance\u003e`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}", + "id": "spanner.projects.instances.delete", + "path": "v1/{+name}", + "description": "Deletes an instance.\n\nImmediately upon completion of the request:\n\n * Billing ceases for all of the instance's reserved resources.\n\nSoon afterward:\n\n * The instance and *all of its databases* immediately and\n irrevocably disappear from the API. All data in the databases\n is permanently deleted." + }, + "list": { + "flatPath": "v1/projects/{projectsId}/instances", + "path": "v1/{+parent}/instances", + "id": "spanner.projects.instances.list", + "description": "Lists all instances in the given project.", + "response": { + "$ref": "ListInstancesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "If non-empty, `page_token` should contain a\nnext_page_token from a\nprevious ListInstancesResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "type": "integer", + "location": "query", + "description": "Number of instances to be returned in the response. If 0 or less, defaults\nto the server's maximum allowed page size.", + "format": "int32" + }, + "parent": { + "location": "path", + "description": "Required. The name of the project for which a list of instances is\nrequested. Values are of the form `projects/\u003cproject\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + }, + "filter": { + "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n * name\n * display_name\n * labels.key where key is the name of a label\n\nSome examples of using filters are:\n\n * name:* --\u003e The instance has a name.\n * name:Howl --\u003e The instance's name contains the string \"howl\".\n * name:HOWL --\u003e Equivalent to above.\n * NAME:howl --\u003e Equivalent to above.\n * labels.env:* --\u003e The instance has the label \"env\".\n * labels.env:dev --\u003e The instance has the label \"env\" and the value of\n the label contains the string \"dev\".\n * name:howl labels.env:dev --\u003e The instance's name contains \"howl\" and\n it has the label \"env\" with its value\n containing \"dev\".", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + }, + "setIamPolicy": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "spanner.projects.instances.setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on an instance resource. Replaces any\nexisting policy.\n\nAuthorization requires `spanner.instances.setIamPolicy` on\nresource.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "description": "REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e` for instance resources and `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e/databases/\u003cdatabase ID\u003e` for databases resources.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + }, + "create": { + "path": "v1/{+parent}/instances", + "id": "spanner.projects.instances.create", + "request": { + "$ref": "CreateInstanceRequest" + }, + "description": "Creates an instance and begins preparing it to begin serving. The\nreturned long-running operation\ncan be used to track the progress of preparing the new\ninstance. The instance name is assigned by the caller. If the\nnamed instance already exists, `CreateInstance` returns\n`ALREADY_EXISTS`.\n\nImmediately upon completion of this request:\n\n * The instance is readable via the API, with all requested attributes\n but no allocated resources. Its state is `CREATING`.\n\nUntil completion of the returned operation:\n\n * Cancelling the operation renders the instance immediately unreadable\n via the API.\n * The instance can be deleted.\n * All other attempts to modify the instance are rejected.\n\nUpon completion of the returned operation:\n\n * Billing for all successfully-allocated resources begins (some types\n may have lower than the requested levels).\n * Databases can be created in the instance.\n * The instance's allocated resource levels are readable via the API.\n * The instance's state becomes `READY`.\n\nThe returned long-running operation will\nhave a name of the format `\u003cinstance_name\u003e/operations/\u003coperation_id\u003e` and\ncan be used to track creation of the instance. The\nmetadata field type is\nCreateInstanceMetadata.\nThe response field type is\nInstance, if successful.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The name of the project in which to create the instance. Values\nare of the form `projects/\u003cproject\u003e`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances" + }, + "getIamPolicy": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}:getIamPolicy", + "id": "spanner.projects.instances.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "description": "Gets the access control policy for an instance resource. Returns an empty\npolicy if an instance exists but does not have a policy set.\n\nAuthorization requires `spanner.instances.getIamPolicy` on\nresource.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e` for instance resources and `projects/\u003cproject ID\u003e/instances/\u003cinstance ID\u003e/databases/\u003cdatabase ID\u003e` for database resources.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + }, + "patch": { + "request": { + "$ref": "UpdateInstanceRequest" + }, + "description": "Updates an instance, and begins allocating or releasing resources\nas requested. The returned long-running\noperation can be used to track the\nprogress of updating the instance. If the named instance does not\nexist, returns `NOT_FOUND`.\n\nImmediately upon completion of this request:\n\n * For resource types for which a decrease in the instance's allocation\n has been requested, billing is based on the newly-requested level.\n\nUntil completion of the returned operation:\n\n * Cancelling the operation sets its metadata's\n cancel_time, and begins\n restoring resources to their pre-request values. The operation\n is guaranteed to succeed at undoing all resource changes,\n after which point it terminates with a `CANCELLED` status.\n * All other attempts to modify the instance are rejected.\n * Reading the instance via the API continues to give the pre-request\n resource levels.\n\nUpon completion of the returned operation:\n\n * Billing begins for all successfully-allocated resources (some types\n may have lower than the requested levels).\n * All newly-reserved resources are available for serving the instance's\n tables.\n * The instance's new resource levels are readable via the API.\n\nThe returned long-running operation will\nhave a name of the format `\u003cinstance_name\u003e/operations/\u003coperation_id\u003e` and\ncan be used to track the instance modification. The\nmetadata field type is\nUpdateInstanceMetadata.\nThe response field type is\nInstance, if successful.\n\nAuthorization requires `spanner.instances.update` permission on\nresource name.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "location": "path", + "description": "Required. A unique identifier for the instance, which cannot be changed\nafter the instance is created. Values are of the form\n`projects/\u003cproject\u003e/instances/a-z*[a-z0-9]`. The final\nsegment of the name must be between 6 and 30 characters in length.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}", + "id": "spanner.projects.instances.patch", + "path": "v1/{+name}" + }, + "get": { + "path": "v1/{+name}", + "id": "spanner.projects.instances.get", + "description": "Gets information about a particular instance.", + "response": { + "$ref": "Instance" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the requested instance. Values are of the form\n`projects/\u003cproject\u003e/instances/\u003cinstance\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}" + } + } + } + } + } + }, + "parameters": { + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + } + }, + "version": "v1", + "baseUrl": "https://spanner.googleapis.com/", + "servicePath": "", + "description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170914", + "documentationLink": "https://cloud.google.com/spanner/", + "id": "spanner:v1" +} diff --git a/etc/api/spectrum/v1explorer/spectrum-api.json b/etc/api/spectrum/v1explorer/spectrum-api.json index 36919c406d..e10b41ce81 100644 --- a/etc/api/spectrum/v1explorer/spectrum-api.json +++ b/etc/api/spectrum/v1explorer/spectrum-api.json @@ -20,7 +20,7 @@ "basePath": "/spectrum/v1explorer/paws/", "rootUrl": "https://www.googleapis.com/", "servicePath": "spectrum/v1explorer/paws/", - "batchPath": "batch", + "batchPath": "batch/spectrum/v1explorer", "parameters": { "alt": { "type": "string", diff --git a/etc/api/speech/v1/speech-api.json b/etc/api/speech/v1/speech-api.json new file mode 100644 index 0000000000..f1801bbe0b --- /dev/null +++ b/etc/api/speech/v1/speech-api.json @@ -0,0 +1,569 @@ +{ + "canonicalName": "Speech", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://speech.googleapis.com/", + "ownerDomain": "google.com", + "name": "speech", + "batchPath": "batch", + "title": "Google Cloud Speech API", + "ownerName": "Google", + "resources": { + "operations": { + "methods": { + "cancel": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "type": "string", + "required": true, + "pattern": "^[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/operations/{operationsId}:cancel", + "path": "v1/operations/{+name}:cancel", + "id": "speech.operations.cancel", + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + } + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "type": "string", + "required": true, + "pattern": "^[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/operations/{operationsId}", + "id": "speech.operations.delete", + "path": "v1/operations/{+name}" + }, + "get": { + "id": "speech.operations.get", + "path": "v1/operations/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^[^/]+$" + } + }, + "flatPath": "v1/operations/{operationsId}" + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "name": { + "location": "query", + "description": "The name of the operation's parent resource.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + }, + "filter": { + "type": "string", + "location": "query", + "description": "The standard list filter." + } + }, + "flatPath": "v1/operations", + "path": "v1/operations", + "id": "speech.operations.list" + } + } + }, + "speech": { + "methods": { + "longrunningrecognize": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/speech:longrunningrecognize", + "id": "speech.speech.longrunningrecognize", + "path": "v1/speech:longrunningrecognize", + "request": { + "$ref": "LongRunningRecognizeRequest" + }, + "description": "Performs asynchronous speech recognition: receive results via the\ngoogle.longrunning.Operations interface. Returns either an\n`Operation.error` or an `Operation.response` which contains\na `LongRunningRecognizeResponse` message." + }, + "recognize": { + "request": { + "$ref": "RecognizeRequest" + }, + "description": "Performs synchronous speech recognition: receive results after all audio\nhas been sent and processed.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "RecognizeResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/speech:recognize", + "path": "v1/speech:recognize", + "id": "speech.speech.recognize" + } + } + } + }, + "parameters": { + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "type": "string", + "location": "query", + "description": "OAuth access token." + }, + "quotaUser": { + "type": "string", + "location": "query", + "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." + }, + "pp": { + "default": "true", + "type": "boolean", + "location": "query", + "description": "Pretty-print response." + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + } + }, + "version": "v1", + "baseUrl": "https://speech.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Converts audio to text by applying powerful neural network models.", + "servicePath": "", + "basePath": "", + "id": "speech:v1", + "documentationLink": "https://cloud.google.com/speech/", + "revision": "20170918", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "SpeechRecognitionAlternative": { + "description": "Alternative hypotheses (a.k.a. n-best list).", + "type": "object", + "properties": { + "confidence": { + "format": "float", + "description": "*Output-only* The confidence estimate between 0.0 and 1.0. A higher number\nindicates an estimated greater likelihood that the recognized words are\ncorrect. This field is typically provided only for the top hypothesis, and\nonly for `is_final=true` results. Clients should not rely on the\n`confidence` field as it is not guaranteed to be accurate or consistent.\nThe default of 0.0 is a sentinel value indicating `confidence` was not set.", + "type": "number" + }, + "words": { + "description": "*Output-only* A list of word-specific information for each recognized word.", + "items": { + "$ref": "WordInfo" + }, + "type": "array" + }, + "transcript": { + "type": "string", + "description": "*Output-only* Transcript text representing the words that the user spoke." + } + }, + "id": "SpeechRecognitionAlternative" + }, + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + } + }, + "id": "ListOperationsResponse" + }, + "SpeechContext": { + "description": "Provides \"hints\" to the speech recognizer to favor specific words and phrases\nin the results.", + "type": "object", + "properties": { + "phrases": { + "description": "*Optional* A list of strings containing words and phrases \"hints\" so that\nthe speech recognition is more likely to recognize them. This can be used\nto improve the accuracy for specific words and phrases, for example, if\nspecific commands are typically spoken by the user. This can also be used\nto add additional words to the vocabulary of the recognizer. See\n[usage limits](https://cloud.google.com/speech/limits#content).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "SpeechContext" + }, + "SpeechRecognitionResult": { + "properties": { + "alternatives": { + "description": "*Output-only* May contain one or more recognition hypotheses (up to the\nmaximum specified in `max_alternatives`).\nThese alternatives are ordered in terms of accuracy, with the top (first)\nalternative being the most probable, as ranked by the recognizer.", + "items": { + "$ref": "SpeechRecognitionAlternative" + }, + "type": "array" + } + }, + "id": "SpeechRecognitionResult", + "description": "A speech recognition result corresponding to a portion of the audio.", + "type": "object" + }, + "RecognitionAudio": { + "description": "Contains audio data in the encoding specified in the `RecognitionConfig`.\nEither `content` or `uri` must be supplied. Supplying both or neither\nreturns google.rpc.Code.INVALID_ARGUMENT. See\n[audio limits](https://cloud.google.com/speech/limits#content).", + "type": "object", + "properties": { + "content": { + "type": "string", + "format": "byte", + "description": "The audio data bytes encoded as specified in\n`RecognitionConfig`. Note: as with all bytes fields, protobuffers use a\npure binary representation, whereas JSON representations use base64." + }, + "uri": { + "description": "URI that points to a file that contains audio data bytes as specified in\n`RecognitionConfig`. Currently, only Google Cloud Storage URIs are\nsupported, which must be specified in the following format:\n`gs://bucket_name/object_name` (other URI formats return\ngoogle.rpc.Code.INVALID_ARGUMENT). For more information, see\n[Request URIs](https://cloud.google.com/storage/docs/reference-uris).", + "type": "string" + } + }, + "id": "RecognitionAudio" + }, + "LongRunningRecognizeRequest": { + "description": "The top-level message sent by the client for the `LongRunningRecognize`\nmethod.", + "type": "object", + "properties": { + "audio": { + "description": "*Required* The audio data to be recognized.", + "$ref": "RecognitionAudio" + }, + "config": { + "description": "*Required* Provides information to the recognizer that specifies how to\nprocess the request.", + "$ref": "RecognitionConfig" + } + }, + "id": "LongRunningRecognizeRequest" + }, + "RecognizeResponse": { + "description": "The only message returned to the client by the `Recognize` method. It\ncontains the result as zero or more sequential `SpeechRecognitionResult`\nmessages.", + "type": "object", + "properties": { + "results": { + "description": "*Output-only* Sequential list of transcription results corresponding to\nsequential portions of audio.", + "items": { + "$ref": "SpeechRecognitionResult" + }, + "type": "array" + } + }, + "id": "RecognizeResponse" + }, + "CancelOperationRequest": { + "description": "The request message for Operations.CancelOperation.", + "type": "object", + "properties": {}, + "id": "CancelOperationRequest" + }, + "Operation": { + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "response": { + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" + } + } + }, + "RecognitionConfig": { + "description": "Provides information to the recognizer that specifies how to process the\nrequest.", + "type": "object", + "properties": { + "sampleRateHertz": { + "format": "int32", + "description": "*Required* Sample rate in Hertz of the audio data sent in all\n`RecognitionAudio` messages. Valid values are: 8000-48000.\n16000 is optimal. For best results, set the sampling rate of the audio\nsource to 16000 Hz. If that's not possible, use the native sample rate of\nthe audio source (instead of re-sampling).", + "type": "integer" + }, + "enableWordTimeOffsets": { + "description": "*Optional* If `true`, the top result includes a list of words and\nthe start and end time offsets (timestamps) for those words. If\n`false`, no word-level time offset information is returned. The default is\n`false`.", + "type": "boolean" + }, + "maxAlternatives": { + "format": "int32", + "description": "*Optional* Maximum number of recognition hypotheses to be returned.\nSpecifically, the maximum number of `SpeechRecognitionAlternative` messages\nwithin each `SpeechRecognitionResult`.\nThe server may return fewer than `max_alternatives`.\nValid values are `0`-`30`. A value of `0` or `1` will return a maximum of\none. If omitted, will return a maximum of one.", + "type": "integer" + }, + "languageCode": { + "description": "*Required* The language of the supplied audio as a\n[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.\nExample: \"en-US\".\nSee [Language Support](https://cloud.google.com/speech/docs/languages)\nfor a list of the currently supported language codes.", + "type": "string" + }, + "encoding": { + "type": "string", + "enumDescriptions": [ + "Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.", + "Uncompressed 16-bit signed little-endian samples (Linear PCM).", + "[`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio\nCodec) is the recommended encoding because it is\nlossless--therefore recognition is not compromised--and\nrequires only about half the bandwidth of `LINEAR16`. `FLAC` stream\nencoding supports 16-bit and 24-bit samples, however, not all fields in\n`STREAMINFO` are supported.", + "8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.", + "Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.", + "Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.", + "Opus encoded audio frames in Ogg container\n([OggOpus](https://wiki.xiph.org/OggOpus)).\n`sample_rate_hertz` must be 16000.", + "Although the use of lossy encodings is not recommended, if a very low\nbitrate encoding is required, `OGG_OPUS` is highly preferred over\nSpeex encoding. The [Speex](https://speex.org/) encoding supported by\nCloud Speech API has a header byte in each block, as in MIME type\n`audio/x-speex-with-header-byte`.\nIt is a variant of the RTP Speex encoding defined in\n[RFC 5574](https://tools.ietf.org/html/rfc5574).\nThe stream is a sequence of blocks, one block per RTP packet. Each block\nstarts with a byte containing the length of the block, in bytes, followed\nby one or more frames of Speex data, padded to an integral number of\nbytes (octets) as specified in RFC 5574. In other words, each RTP header\nis replaced with a single byte containing the block length. Only Speex\nwideband is supported. `sample_rate_hertz` must be 16000." + ], + "enum": [ + "ENCODING_UNSPECIFIED", + "LINEAR16", + "FLAC", + "MULAW", + "AMR", + "AMR_WB", + "OGG_OPUS", + "SPEEX_WITH_HEADER_BYTE" + ], + "description": "*Required* Encoding of audio data sent in all `RecognitionAudio` messages." + }, + "speechContexts": { + "description": "*Optional* A means to provide context to assist the speech recognition.", + "items": { + "$ref": "SpeechContext" + }, + "type": "array" + }, + "profanityFilter": { + "description": "*Optional* If set to `true`, the server will attempt to filter out\nprofanities, replacing all but the initial character in each filtered word\nwith asterisks, e.g. \"f***\". If set to `false` or omitted, profanities\nwon't be filtered out.", + "type": "boolean" + } + }, + "id": "RecognitionConfig" + }, + "WordInfo": { + "description": "Word-specific information for recognized words. Word information is only\nincluded in the response when certain request parameters are set, such\nas `enable_word_time_offsets`.", + "type": "object", + "properties": { + "startTime": { + "format": "google-duration", + "description": "*Output-only* Time offset relative to the beginning of the audio,\nand corresponding to the start of the spoken word.\nThis field is only set if `enable_word_time_offsets=true` and only\nin the top hypothesis.\nThis is an experimental feature and the accuracy of the time offset can\nvary.", + "type": "string" + }, + "word": { + "type": "string", + "description": "*Output-only* The word corresponding to this set of information." + }, + "endTime": { + "format": "google-duration", + "description": "*Output-only* Time offset relative to the beginning of the audio,\nand corresponding to the end of the spoken word.\nThis field is only set if `enable_word_time_offsets=true` and only\nin the top hypothesis.\nThis is an experimental feature and the accuracy of the time offset can\nvary.", + "type": "string" + } + }, + "id": "WordInfo" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "id": "Status" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "RecognizeRequest": { + "properties": { + "audio": { + "description": "*Required* The audio data to be recognized.", + "$ref": "RecognitionAudio" + }, + "config": { + "$ref": "RecognitionConfig", + "description": "*Required* Provides information to the recognizer that specifies how to\nprocess the request." + } + }, + "id": "RecognizeRequest", + "description": "The top-level message sent by the client for the `Recognize` method.", + "type": "object" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + } +} diff --git a/etc/api/speech/v1beta1/speech-api.json b/etc/api/speech/v1beta1/speech-api.json index c4c62d69ff..26c1a97ae6 100644 --- a/etc/api/speech/v1beta1/speech-api.json +++ b/etc/api/speech/v1beta1/speech-api.json @@ -1,10 +1,27 @@ { - "id": "speech:v1beta1", - "documentationLink": "https://cloud.google.com/speech/", - "revision": "20170516", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {} + }, + "SpeechContext": { + "description": "Provides \"hints\" to the speech recognizer to favor specific words and phrases\nin the results.", + "type": "object", + "properties": { + "phrases": { + "description": "*Optional* A list of strings containing words and phrases \"hints\" so that\nthe speech recognition is more likely to recognize them. This can be used\nto improve the accuracy for specific words and phrases, for example, if\nspecific commands are typically spoken by the user. This can also be used\nto add additional words to the vocabulary of the recognizer. See\n[usage limits](https://cloud.google.com/speech/limits#content).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "SpeechContext" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "type": "object", @@ -15,43 +32,29 @@ }, "operations": { "description": "A list of operations that matches the specified filter in the request.", - "type": "array", "items": { "$ref": "Operation" - } + }, + "type": "array" } }, "id": "ListOperationsResponse" }, - "SpeechContext": { - "properties": { - "phrases": { - "description": "*Optional* A list of strings containing words and phrases \"hints\" so that\nthe speech recognition is more likely to recognize them. This can be used\nto improve the accuracy for specific words and phrases, for example, if\nspecific commands are typically spoken by the user. This can also be used\nto add additional words to the vocabulary of the recognizer. See\n[usage limits](https://cloud.google.com/speech/limits#content).", - "type": "array", - "items": { - "type": "string" - } - } - }, - "id": "SpeechContext", - "description": "Provides \"hints\" to the speech recognizer to favor specific words and phrases\nin the results.", - "type": "object" - }, "SpeechRecognitionAlternative": { - "id": "SpeechRecognitionAlternative", "description": "Alternative hypotheses (a.k.a. n-best list).", "type": "object", "properties": { "confidence": { - "type": "number", + "format": "float", "description": "*Output-only* The confidence estimate between 0.0 and 1.0. A higher number\nindicates an estimated greater likelihood that the recognized words are\ncorrect. This field is typically provided only for the top hypothesis, and\nonly for `is_final=true` results. Clients should not rely on the\n`confidence` field as it is not guaranteed to be accurate, or even set, in\nany of the results.\nThe default of 0.0 is a sentinel value indicating `confidence` was not set.", - "format": "float" + "type": "number" }, "transcript": { "description": "*Output-only* Transcript text representing the words that the user spoke.", "type": "string" } - } + }, + "id": "SpeechRecognitionAlternative" }, "SpeechRecognitionResult": { "description": "A speech recognition result corresponding to a portion of the audio.", @@ -59,10 +62,10 @@ "properties": { "alternatives": { "description": "*Output-only* May contain one or more recognition hypotheses (up to the\nmaximum specified in `max_alternatives`).", - "type": "array", "items": { "$ref": "SpeechRecognitionAlternative" - } + }, + "type": "array" } }, "id": "SpeechRecognitionResult" @@ -72,8 +75,8 @@ "type": "object", "properties": { "content": { - "description": "The audio data bytes encoded as specified in\n`RecognitionConfig`. Note: as with all bytes fields, protobuffers use a\npure binary representation, whereas JSON representations use base64.", "format": "byte", + "description": "The audio data bytes encoded as specified in\n`RecognitionConfig`. Note: as with all bytes fields, protobuffers use a\npure binary representation, whereas JSON representations use base64.", "type": "string" }, "uri": { @@ -87,13 +90,13 @@ "description": "The top-level message sent by the client for the `AsyncRecognize` method.", "type": "object", "properties": { - "config": { - "$ref": "RecognitionConfig", - "description": "*Required* Provides information to the recognizer that specifies how to\nprocess the request." - }, "audio": { "$ref": "RecognitionAudio", "description": "*Required* The audio data to be recognized." + }, + "config": { + "$ref": "RecognitionConfig", + "description": "*Required* Provides information to the recognizer that specifies how to\nprocess the request." } }, "id": "AsyncRecognizeRequest" @@ -102,24 +105,20 @@ "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { - "name": { - "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", - "type": "string" - }, "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, "metadata": { - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any." + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object" }, "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" }, "response": { @@ -129,22 +128,25 @@ }, "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" } }, "id": "Operation" }, "RecognitionConfig": { - "description": "Provides information to the recognizer that specifies how to process the\nrequest.", "type": "object", "properties": { "maxAlternatives": { - "description": "*Optional* Maximum number of recognition hypotheses to be returned.\nSpecifically, the maximum number of `SpeechRecognitionAlternative` messages\nwithin each `SpeechRecognitionResult`.\nThe server may return fewer than `max_alternatives`.\nValid values are `0`-`30`. A value of `0` or `1` will return a maximum of\none. If omitted, will return a maximum of one.", "format": "int32", + "description": "*Optional* Maximum number of recognition hypotheses to be returned.\nSpecifically, the maximum number of `SpeechRecognitionAlternative` messages\nwithin each `SpeechRecognitionResult`.\nThe server may return fewer than `max_alternatives`.\nValid values are `0`-`30`. A value of `0` or `1` will return a maximum of\none. If omitted, will return a maximum of one.", "type": "integer" }, "sampleRate": { - "description": "*Required* Sample rate in Hertz of the audio data sent in all\n`RecognitionAudio` messages. Valid values are: 8000-48000.\n16000 is optimal. For best results, set the sampling rate of the audio\nsource to 16000 Hz. If that's not possible, use the native sample rate of\nthe audio source (instead of re-sampling).", "format": "int32", + "description": "*Required* Sample rate in Hertz of the audio data sent in all\n`RecognitionAudio` messages. Valid values are: 8000-48000.\n16000 is optimal. For best results, set the sampling rate of the audio\nsource to 16000 Hz. If that's not possible, use the native sample rate of\nthe audio source (instead of re-sampling).", "type": "integer" }, "languageCode": { @@ -152,6 +154,14 @@ "type": "string" }, "encoding": { + "enumDescriptions": [ + "Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.", + "Uncompressed 16-bit signed little-endian samples (Linear PCM).\nThis is the only encoding that may be used by `AsyncRecognize`.", + "This is the recommended encoding for `SyncRecognize` and\n`StreamingRecognize` because it uses lossless compression; therefore\nrecognition accuracy is not compromised by a lossy codec.\n\nThe stream FLAC (Free Lossless Audio Codec) encoding is specified at:\nhttp://flac.sourceforge.net/documentation.html.\n16-bit and 24-bit samples are supported.\nNot all fields in STREAMINFO are supported.", + "8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.", + "Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz.", + "Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz." + ], "enum": [ "ENCODING_UNSPECIFIED", "LINEAR16", @@ -161,68 +171,61 @@ "AMR_WB" ], "description": "*Required* Encoding of audio data sent in all `RecognitionAudio` messages.", - "type": "string", - "enumDescriptions": [ - "Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.", - "Uncompressed 16-bit signed little-endian samples (Linear PCM).\nThis is the only encoding that may be used by `AsyncRecognize`.", - "This is the recommended encoding for `SyncRecognize` and\n`StreamingRecognize` because it uses lossless compression; therefore\nrecognition accuracy is not compromised by a lossy codec.\n\nThe stream FLAC (Free Lossless Audio Codec) encoding is specified at:\nhttp://flac.sourceforge.net/documentation.html.\n16-bit and 24-bit samples are supported.\nNot all fields in STREAMINFO are supported.", - "8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.", - "Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz.", - "Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz." - ] + "type": "string" }, "profanityFilter": { "description": "*Optional* If set to `true`, the server will attempt to filter out\nprofanities, replacing all but the initial character in each filtered word\nwith asterisks, e.g. \"f***\". If set to `false` or omitted, profanities\nwon't be filtered out.", "type": "boolean" }, "speechContext": { - "description": "*Optional* A means to provide context to assist the speech recognition.", - "$ref": "SpeechContext" + "$ref": "SpeechContext", + "description": "*Optional* A means to provide context to assist the speech recognition." } }, - "id": "RecognitionConfig" + "id": "RecognitionConfig", + "description": "Provides information to the recognizer that specifies how to process the\nrequest." }, "SyncRecognizeRequest": { + "id": "SyncRecognizeRequest", + "description": "The top-level message sent by the client for the `SyncRecognize` method.", + "type": "object", "properties": { + "audio": { + "description": "*Required* The audio data to be recognized.", + "$ref": "RecognitionAudio" + }, "config": { "$ref": "RecognitionConfig", "description": "*Required* Provides information to the recognizer that specifies how to\nprocess the request." - }, - "audio": { - "$ref": "RecognitionAudio", - "description": "*Required* The audio data to be recognized." } - }, - "id": "SyncRecognizeRequest", - "description": "The top-level message sent by the client for the `SyncRecognize` method.", - "type": "object" + } }, "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", "properties": { - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - } - }, "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, "message": { "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "type": "array" } }, - "id": "Status", - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object" + "id": "Status" }, "SyncRecognizeResponse": { "description": "The only message returned to the client by `SyncRecognize`. method. It\ncontains the result as zero or more sequential `SpeechRecognitionResult`\nmessages.", @@ -230,19 +233,13 @@ "properties": { "results": { "description": "*Output-only* Sequential list of transcription results corresponding to\nsequential portions of audio.", - "type": "array", "items": { "$ref": "SpeechRecognitionResult" - } + }, + "type": "array" } }, "id": "SyncRecognizeResponse" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" } }, "icons": { @@ -270,21 +267,20 @@ "operations": { "methods": { "cancel": { - "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], "response": { "$ref": "Empty" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "parameters": { "name": { - "description": "The name of the operation resource to be cancelled.", - "required": true, "type": "string", + "required": true, "pattern": "^[^/]+$", - "location": "path" + "location": "path", + "description": "The name of the operation resource to be cancelled." } }, "scopes": [ @@ -292,16 +288,25 @@ ], "flatPath": "v1beta1/operations/{operationsId}:cancel", "id": "speech.operations.cancel", - "path": "v1beta1/operations/{+name}:cancel" + "path": "v1beta1/operations/{+name}:cancel", + "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`." }, "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, "parameters": { "name": { - "pattern": "^[^/]+$", "location": "path", "description": "The name of the operation resource to be deleted.", + "type": "string", "required": true, - "type": "string" + "pattern": "^[^/]+$" } }, "scopes": [ @@ -309,108 +314,100 @@ ], "flatPath": "v1beta1/operations/{operationsId}", "path": "v1beta1/operations/{+name}", - "id": "speech.operations.delete", - "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", + "id": "speech.operations.delete" + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", "response": { - "$ref": "Empty" + "$ref": "Operation" }, + "httpMethod": "GET", "parameterOrder": [ "name" ], - "httpMethod": "DELETE" - }, - "list": { - "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding below allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`.", - "response": { - "$ref": "ListOperationsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "pageSize": { - "location": "query", - "description": "The standard list page size.", - "format": "int32", - "type": "integer" - }, - "filter": { - "description": "The standard list filter.", + "name": { + "description": "The name of the operation resource.", + "type": "string", + "required": true, + "pattern": "^[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/operations/{operationsId}", + "id": "speech.operations.get", + "path": "v1beta1/operations/{+name}" + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", + "httpMethod": "GET", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [], + "parameters": { + "pageToken": { + "description": "The standard list page token.", "type": "string", "location": "query" }, "name": { "location": "query", - "description": "The name of the operation collection.", + "description": "The name of the operation's parent resource.", "type": "string" }, - "pageToken": { + "pageSize": { "location": "query", - "description": "The standard list page token.", + "format": "int32", + "description": "The standard list page size.", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", "type": "string" } }, - "flatPath": "v1beta1/operations", - "path": "v1beta1/operations", - "id": "speech.operations.list" - }, - "get": { - "flatPath": "v1beta1/operations/{operationsId}", - "path": "v1beta1/operations/{+name}", - "id": "speech.operations.get", - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "parameters": { - "name": { - "location": "path", - "description": "The name of the operation resource.", - "required": true, - "type": "string", - "pattern": "^[^/]+$" - } - } + "flatPath": "v1beta1/operations", + "path": "v1beta1/operations", + "id": "speech.operations.list" } } }, "speech": { "methods": { "asyncrecognize": { - "id": "speech.speech.asyncrecognize", - "path": "v1beta1/speech:asyncrecognize", - "description": "Performs asynchronous speech recognition: receive results via the\n[google.longrunning.Operations]\n(/speech/reference/rest/v1beta1/operations#Operation)\ninterface. Returns either an\n`Operation.error` or an `Operation.response` which contains\nan `AsyncRecognizeResponse` message.", - "request": { - "$ref": "AsyncRecognizeRequest" - }, - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "Operation" }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": {}, - "flatPath": "v1beta1/speech:asyncrecognize" + "flatPath": "v1beta1/speech:asyncrecognize", + "id": "speech.speech.asyncrecognize", + "path": "v1beta1/speech:asyncrecognize", + "request": { + "$ref": "AsyncRecognizeRequest" + }, + "description": "Performs asynchronous speech recognition: receive results via the\n[google.longrunning.Operations]\n(/speech/reference/rest/v1beta1/operations#Operation)\ninterface. Returns either an\n`Operation.error` or an `Operation.response` which contains\nan `AsyncRecognizeResponse` message." }, "syncrecognize": { "flatPath": "v1beta1/speech:syncrecognize", - "id": "speech.speech.syncrecognize", "path": "v1beta1/speech:syncrecognize", - "description": "Performs synchronous speech recognition: receive results after all audio\nhas been sent and processed.", + "id": "speech.speech.syncrecognize", "request": { "$ref": "SyncRecognizeRequest" }, + "description": "Performs synchronous speech recognition: receive results after all audio\nhas been sent and processed.", "httpMethod": "POST", "parameterOrder": [], "response": { @@ -425,47 +422,63 @@ } }, "parameters": { - "key": { + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", - "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.", - "type": "string" + "description": "Data format for response.", + "default": "json" }, "access_token": { "description": "OAuth access token.", "type": "string", "location": "query" }, - "quotaUser": { + "key": { "location": "query", - "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.", + "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.", "type": "string" }, + "quotaUser": { + "type": "string", + "location": "query", + "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." + }, "pp": { "location": "query", "description": "Pretty-print response.", - "type": "boolean", - "default": "true" + "default": "true", + "type": "boolean" }, "oauth_token": { + "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "type": "string" }, "bearer_token": { + "location": "query", "description": "OAuth bearer token.", - "type": "string", - "location": "query" + "type": "string" }, "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", - "location": "query" + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." }, "prettyPrint": { - "type": "boolean", + "description": "Returns response with indentations and line breaks.", "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." + "type": "boolean", + "location": "query" }, "uploadType": { "location": "query", @@ -477,45 +490,32 @@ "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", "enum": [ "1", "2" ], "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" - }, - "callback": { - "location": "query", - "description": "JSONP", "type": "string" - }, - "alt": { - "type": "string", - "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", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] } }, "version": "v1beta1", "baseUrl": "https://speech.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Converts audio to text by applying powerful neural network models.", "servicePath": "", - "basePath": "" + "description": "Converts audio to text by applying powerful neural network models.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "speech:v1beta1", + "documentationLink": "https://cloud.google.com/speech/", + "revision": "20170918" } diff --git a/etc/api/sqladmin/v1beta3/sqladmin-api.json b/etc/api/sqladmin/v1beta3/sqladmin-api.json index a662282a72..0a1fa96be2 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/4l5UEDko5lyNw14LTVbzTd2NbJo\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/lsRSA9rF-4KQu4xYN0id-kYxBtA\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta3", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta3", - "revision": "20170502", + "revision": "20170807", "title": "Cloud SQL Administration API", "description": "Creates and configures Cloud SQL instances, which provide fully-managed MySQL databases.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/sql/v1beta3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "sql/v1beta3/", - "batchPath": "batch", + "batchPath": "batch/sqladmin/v1beta3", "parameters": { "alt": { "type": "string", @@ -783,7 +783,7 @@ }, "requireSsl": { "type": "boolean", - "description": "Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP." + "description": "Whether SSL connections over IP should be enforced or not." } } }, diff --git a/etc/api/sqladmin/v1beta4/crates/1.0.6-api+20170807 b/etc/api/sqladmin/v1beta4/crates/1.0.6-api+20170807 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/sqladmin/v1beta4/crates/1.0.6-cli+20170807 b/etc/api/sqladmin/v1beta4/crates/1.0.6-cli+20170807 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/sqladmin/v1beta4/sqladmin-api.json b/etc/api/sqladmin/v1beta4/sqladmin-api.json index 84d47e930b..e62435bceb 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/vS6rayCgu04tWkxAcCer7mqEHaA\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/odbYGRT1izLWfRhfVNwcTacV8sM\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta4", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta4", - "revision": "20170502", + "revision": "20170807", "title": "Cloud SQL Administration API", "description": "Creates and configures Cloud SQL instances, which provide fully-managed MySQL databases.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/sql/v1beta4/", "rootUrl": "https://www.googleapis.com/", "servicePath": "sql/v1beta4/", - "batchPath": "batch", + "batchPath": "batch/sqladmin/v1beta4", "parameters": { "alt": { "type": "string", @@ -344,7 +344,7 @@ }, "databaseVersion": { "type": "string", - "description": "The database engine type and version. The databaseVersion can not be changed after instance creation. Can be MYSQL_5_5, MYSQL_5_6 or MYSQL_5_7. Defaults to MYSQL_5_6. MYSQL_5_7 is applicable only to Second Generation instances." + "description": "The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5" }, "etag": { "type": "string", @@ -364,6 +364,10 @@ } } }, + "gceZone": { + "type": "string", + "description": "The GCE zone that the instance is serving from. In case when the instance is failed over to standby zone, this value may be different with what user specified in the settings." + }, "instanceType": { "type": "string", "description": "The instance type. This can be one of the following.\nCLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.\nON_PREMISES_INSTANCE: An instance running on the customer's premises.\nREAD_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica." @@ -647,6 +651,10 @@ "type": "string", "description": "The file type for the specified uri.\nSQL: The file contains SQL statements.\nCSV: The file contains CSV data." }, + "importUser": { + "type": "string", + "description": "The PostgreSQL user for this import operation. Defaults to cloudsqlsuperuser. Used only for PostgreSQL instances." + }, "kind": { "type": "string", "description": "This is always sql#importContext.", @@ -765,7 +773,7 @@ }, "requireSsl": { "type": "boolean", - "description": "Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP." + "description": "Whether SSL connections over IP should be enforced or not." } } }, @@ -789,21 +797,6 @@ } } }, - "Labels": { - "id": "Labels", - "type": "object", - "description": "Reserved for future use.", - "properties": { - "key": { - "type": "string", - "description": "Reserved for future use." - }, - "value": { - "type": "string", - "description": "Reserved for future use." - } - } - }, "LocationPreference": { "id": "LocationPreference", "type": "object", @@ -1154,13 +1147,6 @@ "description": "This is always sql#settings.", "default": "sql#settings" }, - "labels": { - "type": "array", - "description": "Reserved for future use.", - "items": { - "$ref": "Labels" - } - }, "locationPreference": { "$ref": "LocationPreference", "description": "The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or GCE zone for better performance. App Engine co-location is only applicable to First Generation instances." @@ -1189,7 +1175,7 @@ }, "storageAutoResize": { "type": "boolean", - "description": "Configuration to increase storage size automatically. The default value is false. Applies only to Second Generation instances." + "description": "Configuration to increase storage size automatically. The default value is true. Applies only to Second Generation instances." }, "storageAutoResizeLimit": { "type": "string", @@ -1205,6 +1191,14 @@ "sql.instances.update" ] } + }, + "userLabels": { + "type": "object", + "description": "User-provided labels, represented as a dictionary where each label is a single key value pair.", + "additionalProperties": { + "type": "string", + "description": "An individual label entry, composed of a key and a value." + } } } }, @@ -2105,7 +2099,7 @@ "parameters": { "filter": { "type": "string", - "description": "Reserved for future use.", + "description": "An expression for filtering the results of the request, such as by name or label.", "location": "query" }, "maxResults": { diff --git a/etc/api/storage/v1/crates/1.0.6-api+20170915 b/etc/api/storage/v1/crates/1.0.6-api+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/storage/v1/storage-api.json b/etc/api/storage/v1/storage-api.json index 14f3bdc048..d5eb39a445 100644 --- a/etc/api/storage/v1/storage-api.json +++ b/etc/api/storage/v1/storage-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/E9KKVdX2PbBgsyioMFSF6I1HKp8\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/aAU6-GJtzQTwC546w_DsCPIRIUA\"", "discoveryVersion": "v1", "id": "storage:v1", "name": "storage", "version": "v1", - "revision": "20170504", + "revision": "20170915", "title": "Cloud Storage JSON API", "description": "Stores and retrieves potentially large, immutable data objects.", "ownerDomain": "google.com", @@ -160,6 +160,15 @@ "$ref": "ObjectAccessControl" } }, + "encryption": { + "type": "object", + "description": "Encryption configuration used by default for newly inserted objects, when no encryption config is specified.", + "properties": { + "defaultKmsKeyName": { + "type": "string" + } + } + }, "etag": { "type": "string", "description": "HTTP 1.1 Entity tag for the bucket." @@ -678,7 +687,7 @@ }, "contentType": { "type": "string", - "description": "Content-Type of the object data. If contentType is not specified, object downloads will be served as application/octet-stream." + "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream." }, "crc32c": { "type": "string", @@ -716,6 +725,10 @@ "description": "The kind of item this is. For objects, this is always storage#object.", "default": "storage#object" }, + "kmsKeyName": { + "type": "string", + "description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key." + }, "md5Hash": { "type": "string", "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." @@ -933,6 +946,9 @@ "items": { "type": "object", "properties": { + "condition": { + "type": "any" + }, "members": { "type": "array", "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers — A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid — An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid — An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project", @@ -977,7 +993,7 @@ }, "resourceId": { "type": "string", - "description": "The ID of the resource to which this policy belongs. Will be of the form buckets/bucket for buckets, and buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input." + "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input." } } }, @@ -1074,7 +1090,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1107,7 +1123,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1137,7 +1153,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1169,7 +1185,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1204,7 +1220,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1243,7 +1259,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1292,7 +1308,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1344,7 +1360,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1376,7 +1392,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1458,6 +1474,11 @@ "Omit owner, acl and defaultObjectAcl properties." ], "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request, for Requester Pays buckets.", + "location": "query" } }, "parameterOrder": [ @@ -1517,6 +1538,11 @@ "Omit owner, acl and defaultObjectAcl properties." ], "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request, for Requester Pays buckets.", + "location": "query" } }, "parameterOrder": [ @@ -1612,7 +1638,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1644,7 +1670,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1684,7 +1710,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1782,7 +1808,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1845,7 +1871,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1878,7 +1904,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1908,7 +1934,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1952,7 +1978,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -1987,7 +2013,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2026,7 +2052,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2069,7 +2095,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2103,7 +2129,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2136,7 +2162,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2163,13 +2189,13 @@ "parameters": { "bucket": { "type": "string", - "description": "Name of a GCS bucket.", + "description": "Name of a Google Cloud Storage bucket.", "required": true, "location": "path" }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2223,7 +2249,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2269,7 +2295,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2312,7 +2338,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2357,7 +2383,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2405,7 +2431,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2457,7 +2483,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2522,7 +2548,7 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, @@ -2532,9 +2558,14 @@ "format": "int64", "location": "query" }, + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2597,13 +2628,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.", + "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -2621,13 +2652,13 @@ }, "ifSourceGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", "format": "int64", "location": "query" }, "ifSourceGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", "format": "int64", "location": "query" }, @@ -2676,7 +2707,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2720,13 +2751,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -2750,7 +2781,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2784,13 +2815,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's generation does not match the given value.", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -2827,7 +2858,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2874,7 +2905,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -2912,13 +2943,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -2934,6 +2965,11 @@ "format": "int64", "location": "query" }, + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, "name": { "type": "string", "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", @@ -2975,7 +3011,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -3062,7 +3098,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" }, "versions": { @@ -3106,13 +3142,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -3170,7 +3206,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -3201,6 +3237,11 @@ "required": true, "location": "path" }, + "destinationKmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, "destinationObject": { "type": "string", "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", @@ -3230,13 +3271,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -3254,13 +3295,13 @@ }, "ifSourceGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", "format": "int64", "location": "query" }, "ifSourceGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", "format": "int64", "location": "query" }, @@ -3320,7 +3361,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -3368,7 +3409,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -3421,7 +3462,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -3461,13 +3502,13 @@ }, "ifGenerationMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", "location": "query" }, "ifGenerationNotMatch": { "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", "format": "int64", "location": "query" }, @@ -3525,7 +3566,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" } }, @@ -3596,7 +3637,7 @@ }, "userProject": { "type": "string", - "description": "The project number to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request, for Requester Pays buckets.", "location": "query" }, "versions": { @@ -3634,13 +3675,18 @@ "id": "storage.projects.serviceAccount.get", "path": "projects/{projectId}/serviceAccount", "httpMethod": "GET", - "description": "Get the email address of this project's GCS service account.", + "description": "Get the email address of this project's Google Cloud Storage service account.", "parameters": { "projectId": { "type": "string", "description": "Project ID", "required": true, "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request, for Requester Pays buckets.", + "location": "query" } }, "parameterOrder": [ diff --git a/etc/api/storage/v1beta1/storage-api.json b/etc/api/storage/v1beta1/storage-api.json index 2aaa30eaf6..9825027701 100644 --- a/etc/api/storage/v1beta1/storage-api.json +++ b/etc/api/storage/v1beta1/storage-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/jikgYIg7WHi_WqPxt3uQ44ROkr0\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/K2ssca6PgUk66RRox2gYX0iyv40\"", "discoveryVersion": "v1", "id": "storage:v1beta1", "name": "storage", "version": "v1beta1", - "revision": "20170504", + "revision": "20170915", "title": "Cloud Storage JSON API", "description": "Lets you store and retrieve potentially-large, immutable data objects.", "ownerDomain": "google.com", diff --git a/etc/api/storage/v1beta2/storage-api.json b/etc/api/storage/v1beta2/storage-api.json index 1c52a6b70b..39f8f5f403 100644 --- a/etc/api/storage/v1beta2/storage-api.json +++ b/etc/api/storage/v1beta2/storage-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/0kIaWvHqlQET4TuEh_GC4_E_fow\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/qILnY2_dR8engCHgEi0wa_OTh14\"", "discoveryVersion": "v1", "id": "storage:v1beta2", "name": "storage", "version": "v1beta2", - "revision": "20170504", + "revision": "20170915", "title": "Cloud Storage JSON API", "description": "Lets you store and retrieve potentially-large, immutable data objects.", "ownerDomain": "google.com", diff --git a/etc/api/storagetransfer/v1/crates/1.0.6-api+20170921 b/etc/api/storagetransfer/v1/crates/1.0.6-api+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/storagetransfer/v1/crates/1.0.6-cli+20170921 b/etc/api/storagetransfer/v1/crates/1.0.6-cli+20170921 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/storagetransfer/v1/storagetransfer-api.json b/etc/api/storagetransfer/v1/storagetransfer-api.json index b1c189621a..68d027dc1b 100644 --- a/etc/api/storagetransfer/v1/storagetransfer-api.json +++ b/etc/api/storagetransfer/v1/storagetransfer-api.json @@ -1,143 +1,42 @@ { - "version_module": "True", + "rootUrl": "https://storagetransfer.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "storagetransfer", + "batchPath": "batch", + "id": "storagetransfer:v1", + "revision": "20170921", + "documentationLink": "https://cloud.google.com/storage/transfer", + "title": "Google Storage Transfer API", + "ownerName": "Google", + "discoveryVersion": "v1", + "version_module": true, "resources": { "googleServiceAccounts": { "methods": { "get": { - "path": "v1/googleServiceAccounts/{projectId}", - "id": "storagetransfer.googleServiceAccounts.get", "description": "Returns the Google service account that is used by Storage Transfer\nService to access buckets in the project where transfers\nrun or in other projects. Each Google service account is associated\nwith one Google Cloud Platform Console project. Users\nshould add this service account to the Google Cloud Storage bucket\nACLs to grant access to Storage Transfer Service. This service\naccount is created and owned by Storage Transfer Service and can\nonly be used by Storage Transfer Service.", - "response": { - "$ref": "GoogleServiceAccount" - }, "httpMethod": "GET", "parameterOrder": [ "projectId" ], + "response": { + "$ref": "GoogleServiceAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { "projectId": { "description": "The ID of the Google Cloud Platform Console project that the Google service\naccount is associated with.\nRequired.", - "required": true, "type": "string", + "required": true, "location": "path" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/googleServiceAccounts/{projectId}" - } - } - }, - "transferJobs": { - "methods": { - "patch": { - "request": { - "$ref": "UpdateTransferJobRequest" - }, - "description": "Updates a transfer job. Updating a job's transfer spec does not affect\ntransfer operations that are running already. Updating the scheduling\nof a job is not allowed.", - "httpMethod": "PATCH", - "parameterOrder": [ - "jobName" - ], - "response": { - "$ref": "TransferJob" - }, - "parameters": { - "jobName": { - "description": "The name of job to update.\nRequired.", - "required": true, - "type": "string", - "pattern": "^transferJobs/.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/transferJobs/{transferJobsId}", - "id": "storagetransfer.transferJobs.patch", - "path": "v1/{+jobName}" - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "TransferJob" - }, - "parameterOrder": [ - "jobName" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "jobName": { - "description": "The job to get.\nRequired.", - "required": true, - "type": "string", - "pattern": "^transferJobs/.+$", - "location": "path" - }, - "projectId": { - "location": "query", - "description": "The ID of the Google Cloud Platform Console project that owns the job.\nRequired.", - "type": "string" - } - }, - "flatPath": "v1/transferJobs/{transferJobsId}", - "id": "storagetransfer.transferJobs.get", - "path": "v1/{+jobName}", - "description": "Gets a transfer job." - }, - "list": { - "description": "Lists transfer jobs.", - "response": { - "$ref": "ListTransferJobsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [], - "parameters": { - "filter": { - "location": "query", - "description": "A list of query parameters specified as JSON text in the form of\n{\"project_id\":\"my_project_id\",\n\"job_names\":[\"jobid1\",\"jobid2\",...],\n\"job_statuses\":[\"status1\",\"status2\",...]}.\nSince `job_names` and `job_statuses` support multiple values, their values\nmust be specified with array notation. `project_id` is required. `job_names`\nand `job_statuses` are optional. The valid values for `job_statuses` are\ncase-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.", - "type": "string" - }, - "pageToken": { - "description": "The list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "description": "The list page size. The max allowed value is 256.", - "format": "int32", - "type": "integer", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/transferJobs", - "path": "v1/transferJobs", - "id": "storagetransfer.transferJobs.list" - }, - "create": { - "path": "v1/transferJobs", - "id": "storagetransfer.transferJobs.create", - "description": "Creates a transfer job that runs periodically.", - "request": { - "$ref": "TransferJob" - }, - "response": { - "$ref": "TransferJob" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {}, - "flatPath": "v1/transferJobs" + "flatPath": "v1/googleServiceAccounts/{projectId}", + "path": "v1/googleServiceAccounts/{projectId}", + "id": "storagetransfer.googleServiceAccounts.get" } } }, @@ -151,27 +50,29 @@ "name" ], "httpMethod": "POST", - "parameters": { - "name": { - "pattern": "^transferOperations/.+$", - "location": "path", - "description": "The name of the transfer operation.\nRequired.", - "required": true, - "type": "string" - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], + "parameters": { + "name": { + "description": "The name of the transfer operation.\nRequired.", + "type": "string", + "required": true, + "pattern": "^transferOperations/.+$", + "location": "path" + } + }, "flatPath": "v1/transferOperations/{transferOperationsId}:pause", - "path": "v1/{+name}:pause", "id": "storagetransfer.transferOperations.pause", + "path": "v1/{+name}:pause", "request": { "$ref": "PauseTransferOperationRequest" }, "description": "Pauses a transfer operation." }, "delete": { + "path": "v1/{+name}", + "id": "storagetransfer.transferOperations.delete", "description": "This method is not supported and the server returns `UNIMPLEMENTED`.", "httpMethod": "DELETE", "parameterOrder": [ @@ -180,70 +81,66 @@ "response": { "$ref": "Empty" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { "name": { "description": "The name of the operation resource to be deleted.", - "required": true, "type": "string", + "required": true, "pattern": "^transferOperations/.+$", "location": "path" } }, - "flatPath": "v1/transferOperations/{transferOperationsId}", - "id": "storagetransfer.transferOperations.delete", - "path": "v1/{+name}" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferOperations/{transferOperationsId}" }, "list": { - "httpMethod": "GET", + "id": "storagetransfer.transferOperations.list", + "path": "v1/{+name}", + "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", "response": { "$ref": "ListOperationsResponse" }, + "httpMethod": "GET", "parameterOrder": [ "name" ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { - "name": { - "pattern": "^transferOperations$", - "location": "path", - "description": "The value `transferOperations`.", - "required": true, - "type": "string" - }, - "pageToken": { - "description": "The list page token.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "The list page size. The max allowed value is 256.", - "format": "int32", - "type": "integer" - }, "filter": { "description": "A list of query parameters specified as JSON text in the form of {\\\"project_id\\\" : \\\"my_project_id\\\", \\\"job_names\\\" : [\\\"jobid1\\\", \\\"jobid2\\\",...], \\\"operation_names\\\" : [\\\"opid1\\\", \\\"opid2\\\",...], \\\"transfer_statuses\\\":[\\\"status1\\\", \\\"status2\\\",...]}. Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `job_names`, `operation_names`, and `transfer_statuses` are optional.", "type": "string", "location": "query" + }, + "pageToken": { + "location": "query", + "description": "The list page token.", + "type": "string" + }, + "name": { + "pattern": "^transferOperations$", + "location": "path", + "description": "The value `transferOperations`.", + "type": "string", + "required": true + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The list page size. The max allowed value is 256.", + "type": "integer" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/transferOperations", - "id": "storagetransfer.transferOperations.list", - "path": "v1/{+name}", - "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding below allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`." + "flatPath": "v1/transferOperations" }, "resume": { - "id": "storagetransfer.transferOperations.resume", - "path": "v1/{+name}:resume", + "description": "Resumes a transfer operation that is paused.", "request": { "$ref": "ResumeTransferOperationRequest" }, - "description": "Resumes a transfer operation that is paused.", "httpMethod": "POST", "parameterOrder": [ "name" @@ -253,26 +150,28 @@ }, "parameters": { "name": { - "description": "The name of the transfer operation.\nRequired.", - "required": true, - "type": "string", "pattern": "^transferOperations/.+$", - "location": "path" + "location": "path", + "description": "The name of the transfer operation.\nRequired.", + "type": "string", + "required": true } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/transferOperations/{transferOperationsId}:resume" + "flatPath": "v1/transferOperations/{transferOperationsId}:resume", + "path": "v1/{+name}:resume", + "id": "storagetransfer.transferOperations.resume" }, "cancel": { "httpMethod": "POST", - "parameterOrder": [ - "name" - ], "response": { "$ref": "Empty" }, + "parameterOrder": [ + "name" + ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], @@ -281,64 +180,187 @@ "pattern": "^transferOperations/.+$", "location": "path", "description": "The name of the operation resource to be cancelled.", - "required": true, - "type": "string" + "type": "string", + "required": true } }, "flatPath": "v1/transferOperations/{transferOperationsId}:cancel", - "id": "storagetransfer.transferOperations.cancel", "path": "v1/{+name}:cancel", + "id": "storagetransfer.transferOperations.cancel", "description": "Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation." }, "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], "response": { "$ref": "Operation" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "name": { - "pattern": "^transferOperations/.+$", - "location": "path", "description": "The name of the operation resource.", + "type": "string", "required": true, - "type": "string" + "pattern": "^transferOperations/.+$", + "location": "path" } }, "flatPath": "v1/transferOperations/{transferOperationsId}", "id": "storagetransfer.transferOperations.get", - "path": "v1/{+name}" + "path": "v1/{+name}", + "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice." + } + } + }, + "transferJobs": { + "methods": { + "list": { + "response": { + "$ref": "ListTransferJobsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The list page token.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The list page size. The max allowed value is 256.", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "A list of query parameters specified as JSON text in the form of\n{\"project_id\":\"my_project_id\",\n\"job_names\":[\"jobid1\",\"jobid2\",...],\n\"job_statuses\":[\"status1\",\"status2\",...]}.\nSince `job_names` and `job_statuses` support multiple values, their values\nmust be specified with array notation. `project_id` is required. `job_names`\nand `job_statuses` are optional. The valid values for `job_statuses` are\ncase-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.", + "type": "string" + } + }, + "flatPath": "v1/transferJobs", + "id": "storagetransfer.transferJobs.list", + "path": "v1/transferJobs", + "description": "Lists transfer jobs." + }, + "get": { + "id": "storagetransfer.transferJobs.get", + "path": "v1/{+jobName}", + "description": "Gets a transfer job.", + "response": { + "$ref": "TransferJob" + }, + "parameterOrder": [ + "jobName" + ], + "httpMethod": "GET", + "parameters": { + "projectId": { + "description": "The ID of the Google Cloud Platform Console project that owns the job.\nRequired.", + "type": "string", + "location": "query" + }, + "jobName": { + "description": "The job to get.\nRequired.", + "type": "string", + "required": true, + "pattern": "^transferJobs/.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferJobs/{transferJobsId}" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "jobName" + ], + "response": { + "$ref": "TransferJob" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "jobName": { + "description": "The name of job to update.\nRequired.", + "type": "string", + "required": true, + "pattern": "^transferJobs/.+$", + "location": "path" + } + }, + "flatPath": "v1/transferJobs/{transferJobsId}", + "path": "v1/{+jobName}", + "id": "storagetransfer.transferJobs.patch", + "request": { + "$ref": "UpdateTransferJobRequest" + }, + "description": "Updates a transfer job. Updating a job's transfer spec does not affect\ntransfer operations that are running already. Updating the scheduling\nof a job is not allowed." + }, + "create": { + "description": "Creates a transfer job that runs periodically.", + "request": { + "$ref": "TransferJob" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "TransferJob" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferJobs", + "path": "v1/transferJobs", + "id": "storagetransfer.transferJobs.create" } } } }, "parameters": { + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, "bearer_token": { "description": "OAuth bearer token.", "type": "string", "location": "query" }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", "location": "query" }, "prettyPrint": { - "location": "query", "description": "Returns response with indentations and line breaks.", + "default": "true", "type": "boolean", - "default": "true" + "location": "query" }, "fields": { "location": "query", @@ -346,9 +368,9 @@ "type": "string" }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, "callback": { "description": "JSONP", @@ -356,8 +378,6 @@ "location": "query" }, "$.xgafv": { - "description": "V1 error format.", - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -366,9 +386,17 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format.", + "type": "string" }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -376,13 +404,7 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string" + "default": "json" }, "access_token": { "description": "OAuth access token.", @@ -390,296 +412,12 @@ "location": "query" }, "key": { - "location": "query", "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.", - "type": "string" - }, - "quotaUser": { - "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.", "type": "string", "location": "query" - }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "type": "boolean", - "default": "true" } }, "schemas": { - "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", - "properties": { - "operations": { - "description": "A list of operations that matches the specified filter in the request.", - "type": "array", - "items": { - "$ref": "Operation" - } - }, - "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" - } - }, - "id": "ListOperationsResponse" - }, - "GoogleServiceAccount": { - "description": "Google service account", - "type": "object", - "properties": { - "accountEmail": { - "description": "Required.", - "type": "string" - } - }, - "id": "GoogleServiceAccount" - }, - "TimeOfDay": { - "id": "TimeOfDay", - "description": "Represents a time of day. The date and time zone are either not significant\nor are specified elsewhere. An API may choose to allow leap seconds. Related\ntypes are google.type.Date and `google.protobuf.Timestamp`.", - "type": "object", - "properties": { - "minutes": { - "description": "Minutes of hour of day. Must be from 0 to 59.", - "format": "int32", - "type": "integer" - }, - "hours": { - "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose\nto allow the value \"24:00:00\" for scenarios like business closing time.", - "format": "int32", - "type": "integer" - }, - "nanos": { - "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", - "format": "int32", - "type": "integer" - }, - "seconds": { - "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may\nallow the value 60 if it allows leap-seconds.", - "format": "int32", - "type": "integer" - } - } - }, - "ErrorLogEntry": { - "id": "ErrorLogEntry", - "description": "An entry describing an error that has occurred.", - "type": "object", - "properties": { - "url": { - "description": "A URL that refers to the target (a data source, a data sink,\nor an object) with which the error is associated.\nRequired.", - "type": "string" - }, - "errorDetails": { - "description": "A list of messages that carry the error details.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "TransferJob": { - "id": "TransferJob", - "description": "This resource represents the configuration of a transfer job that runs\nperiodically.", - "type": "object", - "properties": { - "name": { - "description": "A globally unique name assigned by Storage Transfer Service when the\njob is created. This field should be left empty in requests to create a new\ntransfer job; otherwise, the requests result in an `INVALID_ARGUMENT`\nerror.", - "type": "string" - }, - "deletionTime": { - "description": "This field cannot be changed by user requests.", - "format": "google-datetime", - "type": "string" - }, - "lastModificationTime": { - "description": "This field cannot be changed by user requests.", - "format": "google-datetime", - "type": "string" - }, - "projectId": { - "description": "The ID of the Google Cloud Platform Console project that owns the job.\nRequired.", - "type": "string" - }, - "description": { - "description": "A description provided by the user for the job. Its max length is 1024\nbytes when Unicode-encoded.", - "type": "string" - }, - "creationTime": { - "description": "This field cannot be changed by user requests.", - "format": "google-datetime", - "type": "string" - }, - "transferSpec": { - "$ref": "TransferSpec", - "description": "Transfer specification.\nRequired." - }, - "status": { - "enumDescriptions": [ - "Zero is an illegal value.", - "New transfers will be performed based on the schedule.", - "New transfers will not be scheduled.", - "This is a soft delete state. After a transfer job is set to this\nstate, the job and all the transfer executions are subject to\ngarbage collection." - ], - "enum": [ - "STATUS_UNSPECIFIED", - "ENABLED", - "DISABLED", - "DELETED" - ], - "description": "Status of the job. This value MUST be specified for\n`CreateTransferJobRequests`.\n\nNOTE: The effect of the new job status takes place during a subsequent job\nrun. For example, if you change the job status from `ENABLED` to\n`DISABLED`, and an operation spawned by the transfer is running, the status\nchange would not affect the current operation.", - "type": "string" - }, - "schedule": { - "description": "Schedule specification.\nRequired.", - "$ref": "Schedule" - } - } - }, - "Schedule": { - "description": "Transfers can be scheduled to recur or to run just once.", - "type": "object", - "properties": { - "scheduleEndDate": { - "$ref": "Date", - "description": "The last day the recurring transfer will be run. If `scheduleEndDate`\nis the same as `scheduleStartDate`, the transfer will be executed only\nonce." - }, - "startTimeOfDay": { - "description": "The time in UTC at which the transfer will be scheduled to start in a day.\nTransfers may start later than this time. If not specified, recurring and\none-time transfers that are scheduled to run today will run immediately;\nrecurring transfers that are scheduled to run on a future date will start\nat approximately midnight UTC on that date. Note that when configuring a\ntransfer with the Cloud Platform Console, the transfer's start time in a\nday is specified in your local timezone.", - "$ref": "TimeOfDay" - }, - "scheduleStartDate": { - "$ref": "Date", - "description": "The first day the recurring transfer is scheduled to run. If\n`scheduleStartDate` is in the past, the transfer will run for the first\ntime on the following day.\nRequired." - } - }, - "id": "Schedule" - }, - "Date": { - "id": "Date", - "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", - "type": "object", - "properties": { - "year": { - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", - "format": "int32", - "type": "integer" - }, - "day": { - "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", - "format": "int32", - "type": "integer" - }, - "month": { - "description": "Month of year. Must be from 1 to 12.", - "format": "int32", - "type": "integer" - } - } - }, - "TransferOperation": { - "description": "A description of the execution of a transfer.", - "type": "object", - "properties": { - "startTime": { - "description": "Start time of this transfer execution.", - "format": "google-datetime", - "type": "string" - }, - "transferJobName": { - "description": "The name of the transfer job that triggers this transfer operation.", - "type": "string" - }, - "transferSpec": { - "description": "Transfer specification.\nRequired.", - "$ref": "TransferSpec" - }, - "counters": { - "$ref": "TransferCounters", - "description": "Information about the progress of the transfer operation." - }, - "status": { - "enumDescriptions": [ - "Zero is an illegal value.", - "In progress.", - "Paused.", - "Completed successfully.", - "Terminated due to an unrecoverable failure.", - "Aborted by the user." - ], - "enum": [ - "STATUS_UNSPECIFIED", - "IN_PROGRESS", - "PAUSED", - "SUCCESS", - "FAILED", - "ABORTED" - ], - "description": "Status of the transfer operation.", - "type": "string" - }, - "errorBreakdowns": { - "description": "Summarizes errors encountered with sample error log entries.", - "type": "array", - "items": { - "$ref": "ErrorSummary" - } - }, - "name": { - "description": "A globally unique ID assigned by the system.", - "type": "string" - }, - "projectId": { - "description": "The ID of the Google Cloud Platform Console project that owns the operation.\nRequired.", - "type": "string" - }, - "endTime": { - "description": "End time of this transfer execution.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "TransferOperation" - }, - "AwsS3Data": { - "description": "An AwsS3Data can be a data source, but not a data sink.\nIn an AwsS3Data, an object's name is the S3 object's key name.", - "type": "object", - "properties": { - "bucketName": { - "description": "S3 Bucket name (see\n[Creating a bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)).\nRequired.", - "type": "string" - }, - "awsAccessKey": { - "description": "AWS access key used to sign the API requests to the AWS S3 bucket.\nPermissions on the bucket must be granted to the access ID of the\nAWS access key.\nRequired.", - "$ref": "AwsAccessKey" - } - }, - "id": "AwsS3Data" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - }, - "AwsAccessKey": { - "description": "AWS access key (see\n[AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)).", - "type": "object", - "properties": { - "secretAccessKey": { - "description": "AWS secret access key. This field is not returned in RPC responses.\nRequired.", - "type": "string" - }, - "accessKeyId": { - "description": "AWS access key ID.\nRequired.", - "type": "string" - } - }, - "id": "AwsAccessKey" - }, "PauseTransferOperationRequest": { "description": "Request passed to PauseTransferOperation.", "type": "object", @@ -687,99 +425,95 @@ "id": "PauseTransferOperationRequest" }, "TransferCounters": { - "id": "TransferCounters", "description": "A collection of counters that report the progress of a transfer operation.", "type": "object", "properties": { - "bytesFoundOnlyFromSink": { - "description": "Bytes found only in the data sink that are scheduled to be deleted.", - "format": "int64", - "type": "string" - }, "objectsDeletedFromSource": { - "description": "Objects that are deleted from the data source.", "format": "int64", + "description": "Objects that are deleted from the data source.", "type": "string" }, "bytesCopiedToSink": { + "format": "int64", "description": "Bytes that are copied to the data sink.", - "format": "int64", - "type": "string" - }, - "bytesFoundFromSource": { - "description": "Bytes found in the data source that are scheduled to be transferred,\nwhich will be copied, excluded based on conditions, or skipped due to\nfailures.", - "format": "int64", "type": "string" }, "objectsFromSourceSkippedBySync": { - "description": "Objects in the data source that are not transferred because they already\nexist in the data sink.", "format": "int64", + "description": "Objects in the data source that are not transferred because they already\nexist in the data sink.", "type": "string" }, - "bytesDeletedFromSource": { - "description": "Bytes that are deleted from the data source.", + "bytesFoundFromSource": { "format": "int64", + "description": "Bytes found in the data source that are scheduled to be transferred,\nwhich will be copied, excluded based on conditions, or skipped due to\nfailures.", "type": "string" }, "objectsFoundFromSource": { - "description": "Objects found in the data source that are scheduled to be transferred,\nwhich will be copied, excluded based on conditions, or skipped due to\nfailures.", "format": "int64", + "description": "Objects found in the data source that are scheduled to be transferred,\nwhich will be copied, excluded based on conditions, or skipped due to\nfailures.", + "type": "string" + }, + "bytesDeletedFromSource": { + "format": "int64", + "description": "Bytes that are deleted from the data source.", "type": "string" }, "objectsFailedToDeleteFromSink": { - "description": "Objects that failed to be deleted from the data sink.", "format": "int64", + "description": "Objects that failed to be deleted from the data sink.", "type": "string" }, "objectsFoundOnlyFromSink": { - "description": "Objects found only in the data sink that are scheduled to be deleted.", "format": "int64", + "description": "Objects found only in the data sink that are scheduled to be deleted.", "type": "string" }, "objectsDeletedFromSink": { - "description": "Objects that are deleted from the data sink.", "format": "int64", + "description": "Objects that are deleted from the data sink.", "type": "string" }, "bytesFromSourceSkippedBySync": { - "description": "Bytes in the data source that are not transferred because they already\nexist in the data sink.", "format": "int64", + "description": "Bytes in the data source that are not transferred because they already\nexist in the data sink.", "type": "string" }, "bytesFailedToDeleteFromSink": { - "description": "Bytes that failed to be deleted from the data sink.", "format": "int64", + "description": "Bytes that failed to be deleted from the data sink.", "type": "string" }, "bytesDeletedFromSink": { - "description": "Bytes that are deleted from the data sink.", "format": "int64", + "description": "Bytes that are deleted from the data sink.", "type": "string" }, "bytesFromSourceFailed": { + "format": "int64", "description": "Bytes in the data source that failed during the transfer.", - "format": "int64", - "type": "string" - }, - "objectsCopiedToSink": { - "description": "Objects that are copied to the data sink.", - "format": "int64", "type": "string" }, "objectsFromSourceFailed": { - "description": "Objects in the data source that failed during the transfer.", "format": "int64", + "description": "Objects in the data source that failed during the transfer.", + "type": "string" + }, + "objectsCopiedToSink": { + "format": "int64", + "description": "Objects that are copied to the data sink.", + "type": "string" + }, + "bytesFoundOnlyFromSink": { + "format": "int64", + "description": "Bytes found only in the data sink that are scheduled to be deleted.", "type": "string" } - } + }, + "id": "TransferCounters" }, "ErrorSummary": { - "description": "A summary of errors by error code, plus a count and sample error log\nentries.", - "type": "object", "properties": { "errorCode": { - "description": "Required.", - "type": "string", "enumDescriptions": [ "Not an error; returned on success\n\nHTTP Mapping: 200 OK", "The operation was cancelled, typically by the caller.\n\nHTTP Mapping: 499 Client Closed Request", @@ -817,33 +551,37 @@ "INTERNAL", "UNAVAILABLE", "DATA_LOSS" - ] + ], + "description": "Required.", + "type": "string" }, "errorCount": { - "description": "Count of this type of error.\nRequired.", "format": "int64", + "description": "Count of this type of error.\nRequired.", "type": "string" }, "errorLogEntries": { "description": "Error samples.", - "type": "array", "items": { "$ref": "ErrorLogEntry" - } + }, + "type": "array" } }, - "id": "ErrorSummary" + "id": "ErrorSummary", + "description": "A summary of errors by error code, plus a count and sample error log\nentries.", + "type": "object" }, "HttpData": { - "id": "HttpData", - "description": "An HttpData specifies a list of objects on the web to be transferred over\nHTTP. The information of the objects to be transferred is contained in a\nfile referenced by a URL. The first line in the file must be\n\"TsvHttpData-1.0\", which specifies the format of the file. Subsequent lines\nspecify the information of the list of objects, one object per list entry.\nEach entry has the following tab-delimited fields:\n\n* HTTP URL - The location of the object.\n\n* Length - The size of the object in bytes.\n\n* MD5 - The base64-encoded MD5 hash of the object.\n\nFor an example of a valid TSV file, see\n[Transferring data from URLs](https://cloud.google.com/storage/transfer/#urls)\n\nWhen transferring data based on a URL list, keep the following in mind:\n\n* When an object located at `http(s)://hostname:port/\u003cURL-path\u003e` is transferred\nto a data sink, the name of the object at the data sink is\n`\u003chostname\u003e/\u003cURL-path\u003e`.\n\n* If the specified size of an object does not match the actual size of the\nobject fetched, the object will not be transferred.\n\n* If the specified MD5 does not match the MD5 computed from the transferred\nbytes, the object transfer will fail. For more information, see\n[Generating MD5 hashes](https://cloud.google.com/storage/transfer/#md5)\n\n* Ensure that each URL you specify is publicly accessible. For\nexample, in Google Cloud Storage you can\n[share an object publicly]\n(https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get\na link to it.\n\n* Storage Transfer Service obeys `robots.txt` rules and requires the source\nHTTP server to support `Range` requests and to return a `Content-Length`\nheader in each response.\n\n* [ObjectConditions](#ObjectConditions) have no effect when filtering objects\nto transfer.", + "description": "An HttpData specifies a list of objects on the web to be transferred over\nHTTP. The information of the objects to be transferred is contained in a\nfile referenced by a URL. The first line in the file must be\n\"TsvHttpData-1.0\", which specifies the format of the file. Subsequent lines\nspecify the information of the list of objects, one object per list entry.\nEach entry has the following tab-delimited fields:\n\n* HTTP URL - The location of the object.\n\n* Length - The size of the object in bytes.\n\n* MD5 - The base64-encoded MD5 hash of the object.\n\nFor an example of a valid TSV file, see\n[Transferring data from URLs](https://cloud.google.com/storage/transfer/create-url-list).\n\nWhen transferring data based on a URL list, keep the following in mind:\n\n* When an object located at `http(s)://hostname:port/\u003cURL-path\u003e` is transferred\nto a data sink, the name of the object at the data sink is\n`\u003chostname\u003e/\u003cURL-path\u003e`.\n\n* If the specified size of an object does not match the actual size of the\nobject fetched, the object will not be transferred.\n\n* If the specified MD5 does not match the MD5 computed from the transferred\nbytes, the object transfer will fail. For more information, see\n[Generating MD5 hashes](https://cloud.google.com/storage/transfer/#md5)\n\n* Ensure that each URL you specify is publicly accessible. For\nexample, in Google Cloud Storage you can\n[share an object publicly]\n(https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get\na link to it.\n\n* Storage Transfer Service obeys `robots.txt` rules and requires the source\nHTTP server to support `Range` requests and to return a `Content-Length`\nheader in each response.\n\n* [ObjectConditions](#ObjectConditions) have no effect when filtering objects\nto transfer.", "type": "object", "properties": { "listUrl": { "description": "The URL that points to the file that stores the object list entries.\nThis file must allow public access. Currently, only URLs with HTTP and\nHTTPS schemes are supported.\nRequired.", "type": "string" } - } + }, + "id": "HttpData" }, "GcsData": { "description": "In a GcsData, an object's name is the Google Cloud Storage object's name and\nits `lastModificationTime` refers to the object's updated time, which changes\nwhen the content or the metadata of the object is updated.", @@ -866,87 +604,69 @@ }, "transferJobs": { "description": "A list of transfer jobs.", - "type": "array", "items": { "$ref": "TransferJob" - } + }, + "type": "array" } }, "id": "ListTransferJobsResponse" }, "UpdateTransferJobRequest": { - "id": "UpdateTransferJobRequest", "description": "Request passed to UpdateTransferJob.", "type": "object", "properties": { + "updateTransferJobFieldMask": { + "format": "google-fieldmask", + "description": "The field mask of the fields in `transferJob` that are to be updated in\nthis request. Fields in `transferJob` that can be updated are:\n`description`, `transferSpec`, and `status`. To update the `transferSpec`\nof the job, a complete transfer specification has to be provided. An\nincomplete specification which misses any required fields will be rejected\nwith the error `INVALID_ARGUMENT`.", + "type": "string" + }, "transferJob": { - "description": "The job to update.\nRequired.", - "$ref": "TransferJob" + "$ref": "TransferJob", + "description": "The job to update. `transferJob` is expected to specify only three fields:\n`description`, `transferSpec`, and `status`. An UpdateTransferJobRequest\nthat specifies other fields will be rejected with an error\n`INVALID_ARGUMENT`.\nRequired." }, "projectId": { "description": "The ID of the Google Cloud Platform Console project that owns the job.\nRequired.", "type": "string" - }, - "updateTransferJobFieldMask": { - "description": "The field mask of the fields in `transferJob` that are to be updated in\nthis request. Fields in `transferJob` that can be updated are:\n`description`, `transferSpec`, and `status`. To update the `transferSpec`\nof the job, a complete transfer specification has to be provided. An\nincomplete specification which misses any required fields will be rejected\nwith the error `INVALID_ARGUMENT`.", - "format": "google-fieldmask", - "type": "string" } - } + }, + "id": "UpdateTransferJobRequest" }, "ObjectConditions": { "description": "Conditions that determine which objects will be transferred.", "type": "object", "properties": { - "minTimeElapsedSinceLastModification": { - "description": "If unspecified, `minTimeElapsedSinceLastModification` takes a zero value\nand `maxTimeElapsedSinceLastModification` takes the maximum possible\nvalue of Duration. Objects that satisfy the object conditions\nmust either have a `lastModificationTime` greater or equal to\n`NOW` - `maxTimeElapsedSinceLastModification` and less than\n`NOW` - `minTimeElapsedSinceLastModification`, or not have a\n`lastModificationTime`.", - "format": "google-duration", - "type": "string" + "includePrefixes": { + "description": "If `includePrefixes` is specified, objects that satisfy the object\nconditions must have names that start with one of the `includePrefixes`\nand that do not start with any of the `excludePrefixes`. If `includePrefixes`\nis not specified, all objects except those that have names starting with\none of the `excludePrefixes` must satisfy the object conditions.\n\nRequirements:\n\n * Each include-prefix and exclude-prefix can contain any sequence of\n Unicode characters, of max length 1024 bytes when UTF8-encoded, and\n must not contain Carriage Return or Line Feed characters. Wildcard\n matching and regular expression matching are not supported.\n\n * Each include-prefix and exclude-prefix must omit the leading slash.\n For example, to include the `requests.gz` object in a transfer from\n `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the include\n prefix as `logs/y=2015/requests.gz`.\n\n * None of the include-prefix or the exclude-prefix values can be empty,\n if specified.\n\n * Each include-prefix must include a distinct portion of the object\n namespace, i.e., no include-prefix may be a prefix of another\n include-prefix.\n\n * Each exclude-prefix must exclude a distinct portion of the object\n namespace, i.e., no exclude-prefix may be a prefix of another\n exclude-prefix.\n\n * If `includePrefixes` is specified, then each exclude-prefix must start\n with the value of a path explicitly included by `includePrefixes`.\n\nThe max size of `includePrefixes` is 1000.", + "items": { + "type": "string" + }, + "type": "array" }, "excludePrefixes": { "description": "`excludePrefixes` must follow the requirements described for\n`includePrefixes`.\n\nThe max size of `excludePrefixes` is 1000.", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, - "maxTimeElapsedSinceLastModification": { - "description": "`maxTimeElapsedSinceLastModification` is the complement to\n`minTimeElapsedSinceLastModification`.", + "minTimeElapsedSinceLastModification": { "format": "google-duration", + "description": "If unspecified, `minTimeElapsedSinceLastModification` takes a zero value\nand `maxTimeElapsedSinceLastModification` takes the maximum possible\nvalue of Duration. Objects that satisfy the object conditions\nmust either have a `lastModificationTime` greater or equal to\n`NOW` - `maxTimeElapsedSinceLastModification` and less than\n`NOW` - `minTimeElapsedSinceLastModification`, or not have a\n`lastModificationTime`.", "type": "string" }, - "includePrefixes": { - "description": "If `includePrefixes` is specified, objects that satisfy the object\nconditions must have names that start with one of the `includePrefixes`\nand that do not start with any of the `excludePrefixes`. If `includePrefixes`\nis not specified, all objects except those that have names starting with\none of the `excludePrefixes` must satisfy the object conditions.\n\nRequirements:\n\n * Each include-prefix and exclude-prefix can contain any sequence of\n Unicode characters, of max length 1024 bytes when UTF8-encoded, and\n must not contain Carriage Return or Line Feed characters. Wildcard\n matching and regular expression matching are not supported.\n\n * Each include-prefix and exclude-prefix must omit the leading slash.\n For example, to include the `requests.gz` object in a transfer from\n `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the include\n prefix as `logs/y=2015/requests.gz`.\n\n * None of the include-prefix or the exclude-prefix values can be empty,\n if specified.\n\n * Each include-prefix must include a distinct portion of the object\n namespace, i.e., no include-prefix may be a prefix of another\n include-prefix.\n\n * Each exclude-prefix must exclude a distinct portion of the object\n namespace, i.e., no exclude-prefix may be a prefix of another\n exclude-prefix.\n\n * If `includePrefixes` is specified, then each exclude-prefix must start\n with the value of a path explicitly included by `includePrefixes`.\n\nThe max size of `includePrefixes` is 1000.", - "type": "array", - "items": { - "type": "string" - } + "maxTimeElapsedSinceLastModification": { + "format": "google-duration", + "description": "`maxTimeElapsedSinceLastModification` is the complement to\n`minTimeElapsedSinceLastModification`.", + "type": "string" } }, "id": "ObjectConditions" }, "Operation": { - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", - "type": "object", "properties": { - "name": { - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should have the format of `transferOperations/some/unique/name`.", - "type": "string" - }, - "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "$ref": "Status" - }, - "metadata": { - "description": "Represents the transfer operation object.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, "done": { - "description": "If the value is `false`, it means the operation is still in progress.\nIf true, the operation is completed, and either `error` or `response` is\navailable.", + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", "type": "boolean" }, "response": { @@ -956,16 +676,65 @@ }, "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should have the format of `transferOperations/some/unique/name`.", + "type": "string" + }, + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Represents the transfer operation object.", + "type": "object" } }, - "id": "Operation" + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object" + }, + "TransferSpec": { + "properties": { + "objectConditions": { + "description": "Only objects that satisfy these object conditions are included in the set\nof data source and data sink objects. Object conditions based on\nobjects' `lastModificationTime` do not exclude objects in a data sink.", + "$ref": "ObjectConditions" + }, + "gcsDataSink": { + "description": "A Google Cloud Storage data sink.", + "$ref": "GcsData" + }, + "gcsDataSource": { + "$ref": "GcsData", + "description": "A Google Cloud Storage data source." + }, + "transferOptions": { + "$ref": "TransferOptions", + "description": "If the option `deleteObjectsUniqueInSink` is `true`, object conditions\nbased on objects' `lastModificationTime` are ignored and do not exclude\nobjects in a data source or a data sink." + }, + "awsS3DataSource": { + "$ref": "AwsS3Data", + "description": "An AWS S3 data source." + }, + "httpDataSource": { + "$ref": "HttpData", + "description": "An HTTP URL data source." + } + }, + "id": "TransferSpec", + "description": "Configuration for running a transfer.", + "type": "object" }, "TransferOptions": { "description": "TransferOptions uses three boolean parameters to define the actions\nto be performed on objects in a transfer.", "type": "object", "properties": { "deleteObjectsUniqueInSink": { - "description": "Whether objects that exist only in the sink should be deleted.", + "description": "Whether objects that exist only in the sink should be deleted. Note that\nthis option and `deleteObjectsFromSourceAfterTransfer` are mutually\nexclusive.", "type": "boolean" }, "overwriteObjectsAlreadyExistingInSink": { @@ -973,82 +742,324 @@ "type": "boolean" }, "deleteObjectsFromSourceAfterTransfer": { - "description": "Whether objects should be deleted from the source after they are\ntransferred to the sink.", + "description": "Whether objects should be deleted from the source after they are\ntransferred to the sink. Note that this option and\n`deleteObjectsUniqueInSink` are mutually exclusive.", "type": "boolean" } }, "id": "TransferOptions" }, - "TransferSpec": { - "id": "TransferSpec", - "description": "Configuration for running a transfer.", - "type": "object", - "properties": { - "transferOptions": { - "description": "If the option `deleteObjectsUniqueInSink` is `true`, object conditions\nbased on objects' `lastModificationTime` are ignored and do not exclude\nobjects in a data source or a data sink.", - "$ref": "TransferOptions" - }, - "awsS3DataSource": { - "description": "An AWS S3 data source.", - "$ref": "AwsS3Data" - }, - "httpDataSource": { - "description": "An HTTP URL data source.", - "$ref": "HttpData" - }, - "objectConditions": { - "$ref": "ObjectConditions", - "description": "Only objects that satisfy these object conditions are included in the set\nof data source and data sink objects. Object conditions based on\nobjects' `lastModificationTime` do not exclude objects in a data sink." - }, - "gcsDataSink": { - "$ref": "GcsData", - "description": "A Google Cloud Storage data sink." - }, - "gcsDataSource": { - "description": "A Google Cloud Storage data source.", - "$ref": "GcsData" - } - } + "ResumeTransferOperationRequest": { + "properties": {}, + "id": "ResumeTransferOperationRequest", + "description": "Request passed to ResumeTransferOperation.", + "type": "object" }, "Status": { - "id": "Status", "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", "type": "object", "properties": { + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", "type": "integer" }, "message": { "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", "type": "string" - }, - "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - } } - } + }, + "id": "Status" }, - "ResumeTransferOperationRequest": { - "id": "ResumeTransferOperationRequest", - "description": "Request passed to ResumeTransferOperation.", + "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", "type": "object", - "properties": {} + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + }, + "type": "array" + } + }, + "id": "ListOperationsResponse" + }, + "GoogleServiceAccount": { + "description": "Google service account", + "type": "object", + "properties": { + "accountEmail": { + "description": "Required.", + "type": "string" + } + }, + "id": "GoogleServiceAccount" + }, + "TimeOfDay": { + "description": "Represents a time of day. The date and time zone are either not significant\nor are specified elsewhere. An API may choose to allow leap seconds. Related\ntypes are google.type.Date and `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "minutes": { + "format": "int32", + "description": "Minutes of hour of day. Must be from 0 to 59.", + "type": "integer" + }, + "hours": { + "format": "int32", + "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose\nto allow the value \"24:00:00\" for scenarios like business closing time.", + "type": "integer" + }, + "nanos": { + "format": "int32", + "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", + "type": "integer" + }, + "seconds": { + "format": "int32", + "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may\nallow the value 60 if it allows leap-seconds.", + "type": "integer" + } + }, + "id": "TimeOfDay" + }, + "ErrorLogEntry": { + "description": "An entry describing an error that has occurred.", + "type": "object", + "properties": { + "errorDetails": { + "description": "A list of messages that carry the error details.", + "items": { + "type": "string" + }, + "type": "array" + }, + "url": { + "description": "A URL that refers to the target (a data source, a data sink,\nor an object) with which the error is associated.\nRequired.", + "type": "string" + } + }, + "id": "ErrorLogEntry" + }, + "TransferJob": { + "properties": { + "description": { + "description": "A description provided by the user for the job. Its max length is 1024\nbytes when Unicode-encoded.", + "type": "string" + }, + "creationTime": { + "format": "google-datetime", + "description": "This field cannot be changed by user requests.", + "type": "string" + }, + "transferSpec": { + "$ref": "TransferSpec", + "description": "Transfer specification." + }, + "status": { + "enum": [ + "STATUS_UNSPECIFIED", + "ENABLED", + "DISABLED", + "DELETED" + ], + "description": "Status of the job. This value MUST be specified for\n`CreateTransferJobRequests`.\n\nNOTE: The effect of the new job status takes place during a subsequent job\nrun. For example, if you change the job status from `ENABLED` to\n`DISABLED`, and an operation spawned by the transfer is running, the status\nchange would not affect the current operation.", + "type": "string", + "enumDescriptions": [ + "Zero is an illegal value.", + "New transfers will be performed based on the schedule.", + "New transfers will not be scheduled.", + "This is a soft delete state. After a transfer job is set to this\nstate, the job and all the transfer executions are subject to\ngarbage collection." + ] + }, + "schedule": { + "description": "Schedule specification.", + "$ref": "Schedule" + }, + "deletionTime": { + "format": "google-datetime", + "description": "This field cannot be changed by user requests.", + "type": "string" + }, + "name": { + "description": "A globally unique name assigned by Storage Transfer Service when the\njob is created. This field should be left empty in requests to create a new\ntransfer job; otherwise, the requests result in an `INVALID_ARGUMENT`\nerror.", + "type": "string" + }, + "projectId": { + "description": "The ID of the Google Cloud Platform Console project that owns the job.", + "type": "string" + }, + "lastModificationTime": { + "format": "google-datetime", + "description": "This field cannot be changed by user requests.", + "type": "string" + } + }, + "id": "TransferJob", + "description": "This resource represents the configuration of a transfer job that runs\nperiodically.", + "type": "object" + }, + "Schedule": { + "properties": { + "scheduleEndDate": { + "description": "The last day the recurring transfer will be run. If `scheduleEndDate`\nis the same as `scheduleStartDate`, the transfer will be executed only\nonce.", + "$ref": "Date" + }, + "startTimeOfDay": { + "description": "The time in UTC at which the transfer will be scheduled to start in a day.\nTransfers may start later than this time. If not specified, recurring and\none-time transfers that are scheduled to run today will run immediately;\nrecurring transfers that are scheduled to run on a future date will start\nat approximately midnight UTC on that date. Note that when configuring a\ntransfer with the Cloud Platform Console, the transfer's start time in a\nday is specified in your local timezone.", + "$ref": "TimeOfDay" + }, + "scheduleStartDate": { + "description": "The first day the recurring transfer is scheduled to run. If\n`scheduleStartDate` is in the past, the transfer will run for the first\ntime on the following day.\nRequired.", + "$ref": "Date" + } + }, + "id": "Schedule", + "description": "Transfers can be scheduled to recur or to run just once.", + "type": "object" + }, + "Date": { + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "day": { + "format": "int32", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", + "type": "integer" + }, + "year": { + "format": "int32", + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "type": "integer" + }, + "month": { + "format": "int32", + "description": "Month of year. Must be from 1 to 12.", + "type": "integer" + } + }, + "id": "Date" + }, + "TransferOperation": { + "properties": { + "transferSpec": { + "description": "Transfer specification.\nRequired.", + "$ref": "TransferSpec" + }, + "counters": { + "$ref": "TransferCounters", + "description": "Information about the progress of the transfer operation." + }, + "status": { + "enum": [ + "STATUS_UNSPECIFIED", + "IN_PROGRESS", + "PAUSED", + "SUCCESS", + "FAILED", + "ABORTED" + ], + "description": "Status of the transfer operation.", + "type": "string", + "enumDescriptions": [ + "Zero is an illegal value.", + "In progress.", + "Paused.", + "Completed successfully.", + "Terminated due to an unrecoverable failure.", + "Aborted by the user." + ] + }, + "errorBreakdowns": { + "description": "Summarizes errors encountered with sample error log entries.", + "items": { + "$ref": "ErrorSummary" + }, + "type": "array" + }, + "name": { + "description": "A globally unique ID assigned by the system.", + "type": "string" + }, + "projectId": { + "description": "The ID of the Google Cloud Platform Console project that owns the operation.\nRequired.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "End time of this transfer execution.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Start time of this transfer execution.", + "type": "string" + }, + "transferJobName": { + "description": "The name of the transfer job that triggers this transfer operation.", + "type": "string" + } + }, + "id": "TransferOperation", + "description": "A description of the execution of a transfer.", + "type": "object" + }, + "AwsS3Data": { + "description": "An AwsS3Data can be a data source, but not a data sink.\nIn an AwsS3Data, an object's name is the S3 object's key name.", + "type": "object", + "properties": { + "bucketName": { + "description": "S3 Bucket name (see\n[Creating a bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)).\nRequired.", + "type": "string" + }, + "awsAccessKey": { + "description": "AWS access key used to sign the API requests to the AWS S3 bucket.\nPermissions on the bucket must be granted to the access ID of the\nAWS access key.\nRequired.", + "$ref": "AwsAccessKey" + } + }, + "id": "AwsS3Data" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "AwsAccessKey": { + "properties": { + "accessKeyId": { + "description": "AWS access key ID.\nRequired.", + "type": "string" + }, + "secretAccessKey": { + "description": "AWS secret access key. This field is not returned in RPC responses.\nRequired.", + "type": "string" + } + }, + "id": "AwsAccessKey", + "description": "AWS access key (see\n[AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)).", + "type": "object" } }, - "protocol": "rest", "icons": { - "x32": "http://www.google.com/images/icons/product/search-32.gif", - "x16": "http://www.google.com/images/icons/product/search-16.gif" + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" }, + "protocol": "rest", "version": "v1", "baseUrl": "https://storagetransfer.googleapis.com/", "auth": { @@ -1060,18 +1071,7 @@ } } }, - "kind": "discovery#restDescription", - "description": "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.", "servicePath": "", - "rootUrl": "https://storagetransfer.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "storagetransfer", - "batchPath": "batch", - "revision": "20170515", - "documentationLink": "https://cloud.google.com/storage/transfer", - "id": "storagetransfer:v1", - "title": "Google Storage Transfer API", - "discoveryVersion": "v1", - "ownerName": "Google" + "description": "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.", + "kind": "discovery#restDescription" } diff --git a/etc/api/streetviewpublish/v1/streetviewpublish-api.json b/etc/api/streetviewpublish/v1/streetviewpublish-api.json new file mode 100644 index 0000000000..52d9eed4a8 --- /dev/null +++ b/etc/api/streetviewpublish/v1/streetviewpublish-api.json @@ -0,0 +1,688 @@ +{ + "basePath": "", + "id": "streetviewpublish:v1", + "documentationLink": "https://developers.google.com/streetview/publish/", + "revision": "20170925", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "UpdatePhotoRequest": { + "description": "Request to update the metadata of a\nPhoto. Updating the pixels of a photo\nis not supported.", + "type": "object", + "properties": { + "photo": { + "description": "Required. Photo object containing the\nnew metadata.", + "$ref": "Photo" + }, + "updateMask": { + "description": "Mask that identifies fields on the photo metadata to update.\nIf not present, the old Photo\nmetadata will be entirely replaced with the\nnew Photo metadata in this request.\nThe update fails if invalid fields are specified. Multiple fields can be\nspecified in a comma-delimited list.\n\nThe following fields are valid:\n\n* `pose.heading`\n* `pose.latLngPair`\n* `pose.pitch`\n* `pose.roll`\n* `pose.level`\n* `pose.altitude`\n* `connections`\n* `places`\n\n\n\u003caside class=\"note\"\u003e\u003cb\u003eNote:\u003c/b\u003e Repeated fields in\nupdateMask\nmean the entire set of repeated values will be replaced with the new\ncontents. For example, if\nupdateMask\ncontains `connections` and `UpdatePhotoRequest.photo.connections` is empty,\nall connections will be removed.\u003c/aside\u003e", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "UpdatePhotoRequest" + }, + "PhotoId": { + "description": "Identifier for a Photo.", + "type": "object", + "properties": { + "id": { + "description": "Required. A unique identifier for a photo.", + "type": "string" + } + }, + "id": "PhotoId" + }, + "Pose": { + "id": "Pose", + "description": "Raw pose measurement for an entity.", + "type": "object", + "properties": { + "pitch": { + "description": "Pitch, measured at the center of the photo in degrees. Value must be \u003e=-90\nand \u003c= 90. A value of -90 means looking directly down, and a value of 90\nmeans looking directly up.\nNaN indicates an unmeasured quantity.", + "format": "double", + "type": "number" + }, + "latLngPair": { + "$ref": "LatLng", + "description": "Latitude and longitude pair of the pose, as explained here:\nhttps://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng\nWhen creating a Photo, if the\nlatitude and longitude pair are not provided here, the geolocation from the\nexif header will be used. If the latitude and longitude pair is not\nprovided and cannot be found in the exif header, the create photo process\nwill fail." + }, + "roll": { + "description": "Roll, measured in degrees. Value must be \u003e= 0 and \u003c360. A value of 0\nmeans level with the horizon.\nNaN indicates an unmeasured quantity.", + "format": "double", + "type": "number" + }, + "level": { + "description": "Level (the floor in a building) used to configure vertical navigation.", + "$ref": "Level" + }, + "heading": { + "description": "Compass heading, measured at the center of the photo in degrees clockwise\nfrom North. Value must be \u003e=0 and \u003c360.\nNaN indicates an unmeasured quantity.", + "format": "double", + "type": "number" + }, + "altitude": { + "description": "Altitude of the pose in meters above ground level (as defined by WGS84).\nNaN indicates an unmeasured quantity.", + "format": "double", + "type": "number" + } + } + }, + "BatchUpdatePhotosRequest": { + "id": "BatchUpdatePhotosRequest", + "description": "Request to update the metadata of photos.\nUpdating the pixels of photos is not supported.", + "type": "object", + "properties": { + "updatePhotoRequests": { + "description": "Required. List of\nUpdatePhotoRequests.", + "type": "array", + "items": { + "$ref": "UpdatePhotoRequest" + } + } + } + }, + "ListPhotosResponse": { + "id": "ListPhotosResponse", + "description": "Response to list all photos that belong to a user.", + "type": "object", + "properties": { + "photos": { + "description": "List of photos. The maximum number of items returned is based on the\npageSize field\nin the request.", + "type": "array", + "items": { + "$ref": "Photo" + } + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no more\nresults in the list.", + "type": "string" + } + } + }, + "Photo": { + "description": "Photo is used to store 360 photos along with photo metadata.", + "type": "object", + "properties": { + "viewCount": { + "description": "Output only. View count of the photo.", + "format": "int64", + "type": "string" + }, + "downloadUrl": { + "description": "Output only. The download URL for the photo bytes. This field is set only\nwhen\nGetPhotoRequest.view\nis set to\nPhotoView.INCLUDE_DOWNLOAD_URL.", + "type": "string" + }, + "connections": { + "description": "Connections to other photos. A connection represents the link from this\nphoto to another photo.", + "type": "array", + "items": { + "$ref": "Connection" + } + }, + "places": { + "description": "Places where this photo belongs.", + "type": "array", + "items": { + "$ref": "Place" + } + }, + "pose": { + "description": "Pose of the photo.", + "$ref": "Pose" + }, + "photoId": { + "$ref": "PhotoId", + "description": "Required when updating a photo. Output only when creating a photo.\nIdentifier for the photo, which is unique among all photos in\nGoogle." + }, + "uploadReference": { + "$ref": "UploadRef", + "description": "Required when creating a photo. Input only. The resource URL where the\nphoto bytes are uploaded to." + }, + "shareLink": { + "description": "Output only. The share link for the photo.", + "type": "string" + }, + "thumbnailUrl": { + "description": "Output only. The thumbnail URL for showing a preview of the given photo.", + "type": "string" + }, + "captureTime": { + "description": "Absolute time when the photo was captured.\nWhen the photo has no exif timestamp, this is used to set a timestamp in\nthe photo metadata.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Photo" + }, + "PhotoResponse": { + "id": "PhotoResponse", + "description": "Response payload for a single\nPhoto\nin batch operations including\nBatchGetPhotos\nand\nBatchUpdatePhotos.", + "type": "object", + "properties": { + "photo": { + "description": "The Photo resource, if the request\nwas successful.", + "$ref": "Photo" + }, + "status": { + "$ref": "Status", + "description": "The status for the operation to get or update a single photo in the batch\nrequest." + } + } + }, + "Connection": { + "description": "A connection is the link from a source photo to a destination photo.", + "type": "object", + "properties": { + "target": { + "$ref": "PhotoId", + "description": "Required. The destination of the connection from the containing photo to\nanother photo." + } + }, + "id": "Connection" + }, + "BatchUpdatePhotosResponse": { + "description": "Response to batch update of metadata of one or more\nPhotos.", + "type": "object", + "properties": { + "results": { + "description": "List of results for each individual\nPhoto updated, in the same order as\nthe request.", + "type": "array", + "items": { + "$ref": "PhotoResponse" + } + } + }, + "id": "BatchUpdatePhotosResponse" + }, + "BatchDeletePhotosResponse": { + "description": "Response to batch delete of one or more\nPhotos.", + "type": "object", + "properties": { + "status": { + "description": "The status for the operation to delete a single\nPhoto in the batch request.", + "type": "array", + "items": { + "$ref": "Status" + } + } + }, + "id": "BatchDeletePhotosResponse" + }, + "Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "type": "array", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + } + }, + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + } + }, + "id": "Status" + }, + "Level": { + "id": "Level", + "description": "Level information containing level number and its corresponding name.", + "type": "object", + "properties": { + "number": { + "description": "Floor number, used for ordering. 0 indicates the ground level, 1 indicates\nthe first level above ground level, -1 indicates the first level under\nground level. Non-integer values are OK.", + "format": "double", + "type": "number" + }, + "name": { + "description": "Required. A name assigned to this Level, restricted to 3 characters.\nConsider how the elevator buttons would be labeled for this level if there\nwas an elevator.", + "type": "string" + } + } + }, + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {} + }, + "BatchGetPhotosResponse": { + "description": "Response to batch get of Photos.", + "type": "object", + "properties": { + "results": { + "description": "List of results for each individual\nPhoto requested, in the same order as\nthe requests in\nBatchGetPhotos.", + "type": "array", + "items": { + "$ref": "PhotoResponse" + } + } + }, + "id": "BatchGetPhotosResponse" + }, + "Place": { + "id": "Place", + "description": "Place metadata for an entity.", + "type": "object", + "properties": { + "placeId": { + "description": "Place identifier, as described in\nhttps://developers.google.com/places/place-id.", + "type": "string" + } + } + }, + "UploadRef": { + "id": "UploadRef", + "description": "Upload reference for media files.", + "type": "object", + "properties": { + "uploadUrl": { + "description": "Required. An upload reference should be unique for each user. It follows\nthe form:\n\"https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{upload_reference}\"", + "type": "string" + } + } + }, + "LatLng": { + "id": "LatLng", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "type": "object", + "properties": { + "longitude": { + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double", + "type": "number" + }, + "latitude": { + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double", + "type": "number" + } + } + }, + "BatchDeletePhotosRequest": { + "description": "Request to delete multiple Photos.", + "type": "object", + "properties": { + "photoIds": { + "description": "Required. IDs of the Photos. For HTTP\nGET requests, the URL query parameter should be\n`photoIds=\u003cid1\u003e&photoIds=\u003cid2\u003e&...`.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "BatchDeletePhotosRequest" + } + }, + "protocol": "rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "canonicalName": "Street View Publish", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/streetviewpublish": { + "description": "Publish and manage your 360 photos on Google Street View" + } + } + } + }, + "rootUrl": "https://streetviewpublish.googleapis.com/", + "ownerDomain": "google.com", + "name": "streetviewpublish", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Street View Publish API", + "ownerName": "Google", + "resources": { + "photo": { + "methods": { + "create": { + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photo", + "path": "v1/photo", + "id": "streetviewpublish.photo.create", + "request": { + "$ref": "Photo" + }, + "description": "After the client finishes uploading the photo with the returned\nUploadRef,\nCreatePhoto\npublishes the uploaded Photo to\nStreet View on Google Maps.\n\nThis method returns the following error codes:\n\n* google.rpc.Code.INVALID_ARGUMENT if the request is malformed.\n* google.rpc.Code.NOT_FOUND if the upload reference does not exist.\n* google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the\nstorage limit.", + "response": { + "$ref": "Photo" + }, + "parameterOrder": [], + "httpMethod": "POST" + }, + "startUpload": { + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photo:startUpload", + "path": "v1/photo:startUpload", + "id": "streetviewpublish.photo.startUpload", + "request": { + "$ref": "Empty" + }, + "description": "Creates an upload session to start uploading photo bytes. The upload URL of\nthe returned UploadRef is used to\nupload the bytes for the Photo.\n\nIn addition to the photo requirements shown in\nhttps://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604,\nthe photo must also meet the following requirements:\n\n* Photo Sphere XMP metadata must be included in the photo medadata. See\nhttps://developers.google.com/streetview/spherical-metadata for the\nrequired fields.\n* The pixel size of the photo must meet the size requirements listed in\nhttps://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and\nthe photo must be a full 360 horizontally.\n\nAfter the upload is complete, the\nUploadRef is used with\nCreatePhoto\nto create the Photo object entry.", + "response": { + "$ref": "UploadRef" + }, + "parameterOrder": [], + "httpMethod": "POST" + }, + "delete": { + "id": "streetviewpublish.photo.delete", + "path": "v1/photo/{photoId}", + "description": "Deletes a Photo and its metadata.\n\nThis method returns the following error codes:\n\n* google.rpc.Code.PERMISSION_DENIED if the requesting user did not\ncreate the requested photo.\n* google.rpc.Code.NOT_FOUND if the photo ID does not exist.", + "httpMethod": "DELETE", + "parameterOrder": [ + "photoId" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "photoId": { + "location": "path", + "description": "Required. ID of the Photo.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photo/{photoId}" + }, + "get": { + "parameters": { + "photoId": { + "description": "Required. ID of the Photo.", + "required": true, + "type": "string", + "location": "path" + }, + "view": { + "description": "Specifies if a download URL for the photo bytes should be returned in the\nPhoto response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "INCLUDE_DOWNLOAD_URL" + ] + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photo/{photoId}", + "path": "v1/photo/{photoId}", + "id": "streetviewpublish.photo.get", + "description": "Gets the metadata of the specified\nPhoto.\n\nThis method returns the following error codes:\n\n* google.rpc.Code.PERMISSION_DENIED if the requesting user did not\ncreate the requested Photo.\n* google.rpc.Code.NOT_FOUND if the requested\nPhoto does not exist.", + "response": { + "$ref": "Photo" + }, + "parameterOrder": [ + "photoId" + ], + "httpMethod": "GET" + }, + "update": { + "path": "v1/photo/{id}", + "id": "streetviewpublish.photo.update", + "description": "Updates the metadata of a Photo, such\nas pose, place association, connections, etc. Changing the pixels of a\nphoto is not supported.\n\nOnly the fields specified in the\nupdateMask\nfield are used. If `updateMask` is not present, the update applies to all\nfields.\n\n\u003caside class=\"note\"\u003e\u003cb\u003eNote:\u003c/b\u003e To update\nPose.altitude,\nPose.latLngPair has to be\nfilled as well. Otherwise, the request will fail.\u003c/aside\u003e\n\nThis method returns the following error codes:\n\n* google.rpc.Code.PERMISSION_DENIED if the requesting user did not\ncreate the requested photo.\n* google.rpc.Code.INVALID_ARGUMENT if the request is malformed.\n* google.rpc.Code.NOT_FOUND if the requested photo does not exist.", + "request": { + "$ref": "Photo" + }, + "response": { + "$ref": "Photo" + }, + "parameterOrder": [ + "id" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "parameters": { + "id": { + "location": "path", + "description": "Required. A unique identifier for a photo.", + "required": true, + "type": "string" + }, + "updateMask": { + "location": "query", + "description": "Mask that identifies fields on the photo metadata to update.\nIf not present, the old Photo\nmetadata will be entirely replaced with the\nnew Photo metadata in this request.\nThe update fails if invalid fields are specified. Multiple fields can be\nspecified in a comma-delimited list.\n\nThe following fields are valid:\n\n* `pose.heading`\n* `pose.latLngPair`\n* `pose.pitch`\n* `pose.roll`\n* `pose.level`\n* `pose.altitude`\n* `connections`\n* `places`\n\n\n\u003caside class=\"note\"\u003e\u003cb\u003eNote:\u003c/b\u003e Repeated fields in\nupdateMask\nmean the entire set of repeated values will be replaced with the new\ncontents. For example, if\nupdateMask\ncontains `connections` and `UpdatePhotoRequest.photo.connections` is empty,\nall connections will be removed.\u003c/aside\u003e", + "format": "google-fieldmask", + "type": "string" + } + }, + "flatPath": "v1/photo/{id}" + } + } + }, + "photos": { + "methods": { + "batchUpdate": { + "request": { + "$ref": "BatchUpdatePhotosRequest" + }, + "description": "Updates the metadata of Photos, such\nas pose, place association, connections, etc. Changing the pixels of photos\nis not supported.\n\nNote that if\nBatchUpdatePhotos\nfails, either critical fields are missing or there was an authentication\nerror. Even if\nBatchUpdatePhotos\nsucceeds, there may have been failures for single photos in the batch.\nThese failures will be specified in each\nPhotoResponse.status\nin\nBatchUpdatePhotosResponse.results.\nSee\nUpdatePhoto\nfor specific failures that can occur per photo.\n\nOnly the fields specified in\nupdateMask\nfield are used. If `updateMask` is not present, the update applies to all\nfields.\n\n\u003caside class=\"note\"\u003e\u003cb\u003eNote:\u003c/b\u003e To update\nPose.altitude,\nPose.latLngPair has to be\nfilled as well. Otherwise, the request will fail.\u003c/aside\u003e", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "BatchUpdatePhotosResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photos:batchUpdate", + "id": "streetviewpublish.photos.batchUpdate", + "path": "v1/photos:batchUpdate" + }, + "batchDelete": { + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photos:batchDelete", + "path": "v1/photos:batchDelete", + "id": "streetviewpublish.photos.batchDelete", + "request": { + "$ref": "BatchDeletePhotosRequest" + }, + "description": "Deletes a list of Photos and their\nmetadata.\n\nNote that if\nBatchDeletePhotos\nfails, either critical fields are missing or there was an authentication\nerror. Even if\nBatchDeletePhotos\nsucceeds, there may have been failures for single photos in the batch.\nThese failures will be specified in each\nPhotoResponse.status\nin\nBatchDeletePhotosResponse.results.\nSee\nDeletePhoto\nfor specific failures that can occur per photo.", + "response": { + "$ref": "BatchDeletePhotosResponse" + }, + "parameterOrder": [], + "httpMethod": "POST" + }, + "batchGet": { + "parameters": { + "view": { + "description": "Specifies if a download URL for the photo bytes should be returned in the\nPhoto response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "INCLUDE_DOWNLOAD_URL" + ] + }, + "photoIds": { + "description": "Required. IDs of the Photos. For HTTP\nGET requests, the URL query parameter should be\n`photoIds=\u003cid1\u003e&photoIds=\u003cid2\u003e&...`.", + "type": "string", + "repeated": true, + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photos:batchGet", + "id": "streetviewpublish.photos.batchGet", + "path": "v1/photos:batchGet", + "description": "Gets the metadata of the specified\nPhoto batch.\n\nNote that if\nBatchGetPhotos\nfails, either critical fields are missing or there was an authentication\nerror. Even if\nBatchGetPhotos\nsucceeds, there may have been failures for single photos in the batch.\nThese failures will be specified in each\nPhotoResponse.status\nin\nBatchGetPhotosResponse.results.\nSee\nGetPhoto\nfor specific failures that can occur per photo.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "BatchGetPhotosResponse" + } + }, + "list": { + "parameters": { + "pageToken": { + "location": "query", + "description": "The\nnextPageToken\nvalue returned from a previous\nListPhotos\nrequest, if any.", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of photos to return.\n`pageSize` must be non-negative. If `pageSize` is zero or is not provided,\nthe default page size of 100 will be used.\nThe number of photos returned in the response may be less than `pageSize`\nif the number of photos that belong to the user is less than `pageSize`.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "INCLUDE_DOWNLOAD_URL" + ], + "description": "Specifies if a download URL for the photos bytes should be returned in the\nPhotos response.", + "type": "string" + }, + "filter": { + "description": "The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photos", + "id": "streetviewpublish.photos.list", + "path": "v1/photos", + "description": "Lists all the Photos that belong to\nthe user.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListPhotosResponse" + } + } + } + } + }, + "parameters": { + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + } + }, + "version": "v1", + "baseUrl": "https://streetviewpublish.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Publishes 360 photos to Google Maps, along with position, orientation, and connectivity metadata. Apps can offer an interface for positioning, connecting, and uploading user-generated Street View images.\n", + "servicePath": "" +} diff --git a/etc/api/surveys/v2/surveys-api.json b/etc/api/surveys/v2/surveys-api.json index 73bc53192b..e540b831ff 100644 --- a/etc/api/surveys/v2/surveys-api.json +++ b/etc/api/surveys/v2/surveys-api.json @@ -20,7 +20,7 @@ "basePath": "/surveys/v2/", "rootUrl": "https://www.googleapis.com/", "servicePath": "surveys/v2/", - "batchPath": "batch", + "batchPath": "batch/surveys/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/tagmanager/v1/tagmanager-api.json b/etc/api/tagmanager/v1/tagmanager-api.json index 8741e67d0c..90ae102b78 100644 --- a/etc/api/tagmanager/v1/tagmanager-api.json +++ b/etc/api/tagmanager/v1/tagmanager-api.json @@ -21,7 +21,7 @@ "basePath": "/tagmanager/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "tagmanager/v1/", - "batchPath": "batch", + "batchPath": "batch/tagmanager/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/tagmanager/v2/crates/1.0.6-api+20170915 b/etc/api/tagmanager/v2/crates/1.0.6-api+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/tagmanager/v2/crates/1.0.6-cli+20170915 b/etc/api/tagmanager/v2/crates/1.0.6-cli+20170915 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/tagmanager/v2/tagmanager-api.json b/etc/api/tagmanager/v2/tagmanager-api.json new file mode 100644 index 0000000000..f27315e6a5 --- /dev/null +++ b/etc/api/tagmanager/v2/tagmanager-api.json @@ -0,0 +1,4858 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/COGKad2GbFNLxJtu8jKqwelYxZ0\"", + "discoveryVersion": "v1", + "id": "tagmanager:v2", + "name": "tagmanager", + "canonicalName": "Tag Manager", + "version": "v2", + "revision": "20170915", + "title": "Tag Manager API", + "description": "Accesses Tag Manager accounts and containers.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://developers.google.com/tag-manager/api/v2/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/tagmanager/v2/", + "basePath": "/tagmanager/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "tagmanager/v2/", + "batchPath": "batch/tagmanager/v2", + "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/tagmanager.delete.containers": { + "description": "Delete your Google Tag Manager containers" + }, + "https://www.googleapis.com/auth/tagmanager.edit.containers": { + "description": "Manage your Google Tag Manager container and its subcomponents, excluding versioning and publishing" + }, + "https://www.googleapis.com/auth/tagmanager.edit.containerversions": { + "description": "Manage your Google Tag Manager container versions" + }, + "https://www.googleapis.com/auth/tagmanager.manage.accounts": { + "description": "View and manage your Google Tag Manager accounts" + }, + "https://www.googleapis.com/auth/tagmanager.manage.users": { + "description": "Manage user permissions of your Google Tag Manager account and container" + }, + "https://www.googleapis.com/auth/tagmanager.publish": { + "description": "Publish your Google Tag Manager container versions" + }, + "https://www.googleapis.com/auth/tagmanager.readonly": { + "description": "View your Google Tag Manager container and its subcomponents" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Represents a Google Tag Manager Account.", + "properties": { + "accountId": { + "type": "string", + "description": "The Account ID uniquely identifies the GTM Account." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Account as computed at storage time. This value is recomputed whenever the account is modified." + }, + "name": { + "type": "string", + "description": "Account display name." + }, + "path": { + "type": "string", + "description": "GTM Account's API relative path." + }, + "shareData": { + "type": "boolean", + "description": "Whether the account shares data anonymously with Google and others. This flag enables benchmarking by sharing your data in an anonymous form. Google will remove all identifiable information about your website, combine the data with hundreds of other anonymous sites and report aggregate trends in the benchmarking service." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + } + } + }, + "AccountAccess": { + "id": "AccountAccess", + "type": "object", + "description": "Defines the Google Tag Manager Account access permissions.", + "properties": { + "permission": { + "type": "string", + "description": "Whether the user has no access, user access, or admin access to an account.", + "enum": [ + "accountPermissionUnspecified", + "admin", + "noAccess", + "user" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "BuiltInVariable": { + "id": "BuiltInVariable", + "type": "object", + "description": "Built-in variables are a special category of variables that are pre-created and non-customizable. They provide common functionality like accessing propeties of the gtm data layer, monitoring clicks, or accessing elements of a page URL.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "name": { + "type": "string", + "description": "Name of the built-in variable to be used to refer to the built-in variable." + }, + "path": { + "type": "string", + "description": "GTM BuiltInVariable's API relative path." + }, + "type": { + "type": "string", + "description": "Type of built-in variable.", + "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "ampBrowserLanguage", + "ampCanonicalHost", + "ampCanonicalPath", + "ampCanonicalUrl", + "ampClientId", + "ampClientMaxScrollX", + "ampClientMaxScrollY", + "ampClientScreenHeight", + "ampClientScreenWidth", + "ampClientScrollX", + "ampClientScrollY", + "ampClientTimestamp", + "ampClientTimezone", + "ampGtmEvent", + "ampPageDownloadTime", + "ampPageLoadTime", + "ampPageViewId", + "ampReferrer", + "ampTitle", + "ampTotalEngagedTime", + "appId", + "appName", + "appVersionCode", + "appVersionName", + "builtInVariableTypeUnspecified", + "clickClasses", + "clickElement", + "clickId", + "clickTarget", + "clickText", + "clickUrl", + "containerId", + "containerVersion", + "debugMode", + "deviceName", + "environmentName", + "errorLine", + "errorMessage", + "errorUrl", + "event", + "eventName", + "firebaseEventParameterCampaign", + "firebaseEventParameterCampaignAclid", + "firebaseEventParameterCampaignAnid", + "firebaseEventParameterCampaignClickTimestamp", + "firebaseEventParameterCampaignContent", + "firebaseEventParameterCampaignCp1", + "firebaseEventParameterCampaignGclid", + "firebaseEventParameterCampaignSource", + "firebaseEventParameterCampaignTerm", + "firebaseEventParameterCurrency", + "firebaseEventParameterDynamicLinkAcceptTime", + "firebaseEventParameterDynamicLinkLinkid", + "firebaseEventParameterNotificationMessageDeviceTime", + "firebaseEventParameterNotificationMessageId", + "firebaseEventParameterNotificationMessageName", + "firebaseEventParameterNotificationMessageTime", + "firebaseEventParameterNotificationTopic", + "firebaseEventParameterPreviousAppVersion", + "firebaseEventParameterPreviousOsVersion", + "firebaseEventParameterPrice", + "firebaseEventParameterProductId", + "firebaseEventParameterQuantity", + "firebaseEventParameterValue", + "formClasses", + "formElement", + "formId", + "formTarget", + "formText", + "formUrl", + "historySource", + "htmlId", + "language", + "newHistoryFragment", + "newHistoryState", + "oldHistoryFragment", + "oldHistoryState", + "osVersion", + "pageHostname", + "pagePath", + "pageUrl", + "platform", + "randomNumber", + "referrer", + "resolution", + "sdkVersion", + "videoCurrentTime", + "videoDuration", + "videoElapsedTime", + "videoPercent", + "videoProvider", + "videoStatus", + "videoTitle", + "videoUrl", + "videoVisible" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "workspaceId": { + "type": "string", + "description": "GTM Workspace ID." + } + } + }, + "Condition": { + "id": "Condition", + "type": "object", + "description": "Represents a predicate.", + "properties": { + "parameter": { + "type": "array", + "description": "A list of named parameters (key/value), depending on the condition's type. Notes: \n- For binary operators, include parameters named arg0 and arg1 for specifying the left and right operands, respectively. \n- At this time, the left operand (arg0) must be a reference to a variable. \n- For case-insensitive Regex matching, include a boolean parameter named ignore_case that is set to true. If not specified or set to any other value, the matching will be case sensitive. \n- To negate an operator, include a boolean parameter named negate boolean parameter that is set to true.", + "items": { + "$ref": "Parameter" + }, + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.triggers.create", + "tagmanager.accounts.containers.workspaces.triggers.update" + ] + } + }, + "type": { + "type": "string", + "description": "The type of operator for this condition.", + "enum": [ + "conditionTypeUnspecified", + "contains", + "cssSelector", + "endsWith", + "equals", + "greater", + "greaterOrEquals", + "less", + "lessOrEquals", + "matchRegex", + "startsWith", + "urlMatches" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.triggers.create", + "tagmanager.accounts.containers.workspaces.triggers.update" + ] + } + } + } + }, + "Container": { + "id": "Container", + "type": "object", + "description": "Represents a Google Tag Manager Container, which specifies the platform tags will run on, manages workspaces, and retains container versions.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "The Container ID uniquely identifies the GTM Container." + }, + "domainName": { + "type": "array", + "description": "List of domain names associated with the Container.", + "items": { + "type": "string" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified." + }, + "name": { + "type": "string", + "description": "Container display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "notes": { + "type": "string", + "description": "Container Notes." + }, + "path": { + "type": "string", + "description": "GTM Container's API relative path." + }, + "publicId": { + "type": "string", + "description": "Container Public ID." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "usageContext": { + "type": "array", + "description": "List of Usage Contexts for the Container. Valid values include: web, android, or ios.", + "items": { + "type": "string", + "enum": [ + "amp", + "android", + "androidSdk5", + "ios", + "iosSdk5", + "usageContextUnspecified", + "web" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + } + } + }, + "ContainerAccess": { + "id": "ContainerAccess", + "type": "object", + "description": "Defines the Google Tag Manager Container access permissions.", + "properties": { + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "permission": { + "type": "string", + "description": "List of Container permissions.", + "enum": [ + "approve", + "containerPermissionUnspecified", + "edit", + "noAccess", + "publish", + "read" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "ContainerVersion": { + "id": "ContainerVersion", + "type": "object", + "description": "Represents a Google Tag Manager Container Version.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "builtInVariable": { + "type": "array", + "description": "The built-in variables in the container that this version was taken from.", + "items": { + "$ref": "BuiltInVariable" + } + }, + "container": { + "$ref": "Container", + "description": "The container that this version was taken from." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "containerVersionId": { + "type": "string", + "description": "The Container Version ID uniquely identifies the GTM Container Version." + }, + "deleted": { + "type": "boolean", + "description": "A value of true indicates this container version has been deleted." + }, + "description": { + "type": "string", + "description": "Container version description." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Container Version as computed at storage time. This value is recomputed whenever the container version is modified." + }, + "folder": { + "type": "array", + "description": "The folders in the container that this version was taken from.", + "items": { + "$ref": "Folder" + } + }, + "name": { + "type": "string", + "description": "Container version display name." + }, + "path": { + "type": "string", + "description": "GTM ContainerVersions's API relative path." + }, + "tag": { + "type": "array", + "description": "The tags in the container that this version was taken from.", + "items": { + "$ref": "Tag" + } + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "trigger": { + "type": "array", + "description": "The triggers in the container that this version was taken from.", + "items": { + "$ref": "Trigger" + } + }, + "variable": { + "type": "array", + "description": "The variables in the container that this version was taken from.", + "items": { + "$ref": "Variable" + } + }, + "zone": { + "type": "array", + "description": "The zones in the container that this version was taken from.", + "items": { + "$ref": "Zone" + } + } + } + }, + "ContainerVersionHeader": { + "id": "ContainerVersionHeader", + "type": "object", + "description": "Represents a Google Tag Manager Container Version Header.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "containerVersionId": { + "type": "string", + "description": "The Container Version ID uniquely identifies the GTM Container Version." + }, + "deleted": { + "type": "boolean", + "description": "A value of true indicates this container version has been deleted." + }, + "name": { + "type": "string", + "description": "Container version display name." + }, + "numMacros": { + "type": "string", + "description": "Number of macros in the container version." + }, + "numRules": { + "type": "string", + "description": "Number of rules in the container version." + }, + "numTags": { + "type": "string", + "description": "Number of tags in the container version." + }, + "numTriggers": { + "type": "string", + "description": "Number of triggers in the container version." + }, + "numVariables": { + "type": "string", + "description": "Number of variables in the container version." + }, + "numZones": { + "type": "string", + "description": "Number of zones in the container version." + }, + "path": { + "type": "string", + "description": "GTM Container Versions's API relative path." + } + } + }, + "CreateBuiltInVariableResponse": { + "id": "CreateBuiltInVariableResponse", + "type": "object", + "properties": { + "builtInVariable": { + "type": "array", + "description": "List of created built-in variables.", + "items": { + "$ref": "BuiltInVariable" + } + } + } + }, + "CreateContainerVersionRequestVersionOptions": { + "id": "CreateContainerVersionRequestVersionOptions", + "type": "object", + "description": "Options for new container versions.", + "properties": { + "name": { + "type": "string", + "description": "The name of the container version to be created." + }, + "notes": { + "type": "string", + "description": "The notes of the container version to be created." + } + } + }, + "CreateContainerVersionResponse": { + "id": "CreateContainerVersionResponse", + "type": "object", + "description": "Create container versions response.", + "properties": { + "compilerError": { + "type": "boolean", + "description": "Compiler errors or not." + }, + "containerVersion": { + "$ref": "ContainerVersion", + "description": "The container version created." + }, + "newWorkspacePath": { + "type": "string", + "description": "Auto generated workspace path created as a result of version creation. This field should only be populated if the created version was not a quick preview." + }, + "syncStatus": { + "$ref": "SyncStatus", + "description": "Whether version creation failed when syncing the workspace to the latest container version." + } + } + }, + "CreateWorkspaceProposalRequest": { + "id": "CreateWorkspaceProposalRequest", + "type": "object", + "description": "Creates a workspace proposal to start a review of a workspace.", + "properties": { + "initialComment": { + "$ref": "WorkspaceProposalHistoryComment", + "description": "If present, an initial comment to associate with the workspace proposal." + }, + "reviewers": { + "type": "array", + "description": "List of users to review the workspace proposal.", + "items": { + "$ref": "WorkspaceProposalUser" + } + } + } + }, + "Entity": { + "id": "Entity", + "type": "object", + "description": "A workspace entity that may represent a tag, trigger, variable, or folder in addition to its status in the workspace.", + "properties": { + "changeStatus": { + "type": "string", + "description": "Represents how the entity has been changed in the workspace.", + "enum": [ + "added", + "changeStatusUnspecified", + "deleted", + "none", + "updated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "folder": { + "$ref": "Folder", + "description": "The Folder being represented by the entity." + }, + "tag": { + "$ref": "Tag", + "description": "The tag being represented by the entity." + }, + "trigger": { + "$ref": "Trigger", + "description": "The trigger being represented by the entity." + }, + "variable": { + "$ref": "Variable", + "description": "The variable being represented by the entity." + } + } + }, + "Environment": { + "id": "Environment", + "type": "object", + "description": "Represents a Google Tag Manager Environment. Note that a user can create, delete and update environments of type USER, but can only update the enable_debug and url fields of environments of other types.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "authorizationCode": { + "type": "string", + "description": "The environment authorization code." + }, + "authorizationTimestamp": { + "$ref": "Timestamp", + "description": "The last update time-stamp for the authorization code." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "containerVersionId": { + "type": "string", + "description": "Represents a link to a container version." + }, + "description": { + "type": "string", + "description": "The environment description. Can be set or changed only on USER type environments." + }, + "enableDebug": { + "type": "boolean", + "description": "Whether or not to enable debug by default for the environment." + }, + "environmentId": { + "type": "string", + "description": "GTM Environment ID uniquely identifies the GTM Environment." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM environment as computed at storage time. This value is recomputed whenever the environment is modified." + }, + "name": { + "type": "string", + "description": "The environment display name. Can be set or changed only on USER type environments.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.environments.create", + "tagmanager.accounts.containers.environments.update" + ] + } + }, + "path": { + "type": "string", + "description": "GTM Environment's API relative path." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "type": { + "type": "string", + "description": "The type of this environment.", + "enum": [ + "latest", + "live", + "user", + "workspace" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "Default preview page url for the environment." + }, + "workspaceId": { + "type": "string", + "description": "Represents a link to a quick preview of a workspace." + } + } + }, + "Folder": { + "id": "Folder", + "type": "object", + "description": "Represents a Google Tag Manager Folder.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Folder as computed at storage time. This value is recomputed whenever the folder is modified." + }, + "folderId": { + "type": "string", + "description": "The Folder ID uniquely identifies the GTM Folder." + }, + "name": { + "type": "string", + "description": "Folder display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.folders.create", + "tagmanager.accounts.containers.workspaces.folders.update" + ] + } + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this folder in the container." + }, + "path": { + "type": "string", + "description": "GTM Folder's API relative path." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "workspaceId": { + "type": "string", + "description": "GTM Workspace ID." + } + } + }, + "FolderEntities": { + "id": "FolderEntities", + "type": "object", + "description": "Represents a Google Tag Manager Folder's contents.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + }, + "tag": { + "type": "array", + "description": "The list of tags inside the folder.", + "items": { + "$ref": "Tag" + } + }, + "trigger": { + "type": "array", + "description": "The list of triggers inside the folder.", + "items": { + "$ref": "Trigger" + } + }, + "variable": { + "type": "array", + "description": "The list of variables inside the folder.", + "items": { + "$ref": "Variable" + } + } + } + }, + "GetWorkspaceStatusResponse": { + "id": "GetWorkspaceStatusResponse", + "type": "object", + "description": "The changes that have occurred in the workspace since the base container version.", + "properties": { + "mergeConflict": { + "type": "array", + "description": "The merge conflict after sync.", + "items": { + "$ref": "MergeConflict" + } + }, + "workspaceChange": { + "type": "array", + "description": "Entities that have been changed in the workspace.", + "items": { + "$ref": "Entity" + } + } + } + }, + "ListAccountsResponse": { + "id": "ListAccountsResponse", + "type": "object", + "description": "List Accounts Response.", + "properties": { + "account": { + "type": "array", + "description": "List of GTM Accounts that a user has access to.", + "items": { + "$ref": "Account" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListContainerVersionsResponse": { + "id": "ListContainerVersionsResponse", + "type": "object", + "description": "List container versions response.", + "properties": { + "containerVersionHeader": { + "type": "array", + "description": "All container version headers of a GTM Container.", + "items": { + "$ref": "ContainerVersionHeader" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListContainersResponse": { + "id": "ListContainersResponse", + "type": "object", + "description": "List Containers Response.", + "properties": { + "container": { + "type": "array", + "description": "All Containers of a GTM Account.", + "items": { + "$ref": "Container" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListEnabledBuiltInVariablesResponse": { + "id": "ListEnabledBuiltInVariablesResponse", + "type": "object", + "description": "A list of enabled built-in variables.", + "properties": { + "builtInVariable": { + "type": "array", + "description": "All GTM BuiltInVariables of a GTM container.", + "items": { + "$ref": "BuiltInVariable" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListEnvironmentsResponse": { + "id": "ListEnvironmentsResponse", + "type": "object", + "description": "List Environments Response.", + "properties": { + "environment": { + "type": "array", + "description": "All Environments of a GTM Container.", + "items": { + "$ref": "Environment" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListFoldersResponse": { + "id": "ListFoldersResponse", + "type": "object", + "description": "List Folders Response.", + "properties": { + "folder": { + "type": "array", + "description": "All GTM Folders of a GTM Container.", + "items": { + "$ref": "Folder" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListTagsResponse": { + "id": "ListTagsResponse", + "type": "object", + "description": "List Tags Response.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + }, + "tag": { + "type": "array", + "description": "All GTM Tags of a GTM Container.", + "items": { + "$ref": "Tag" + } + } + } + }, + "ListTriggersResponse": { + "id": "ListTriggersResponse", + "type": "object", + "description": "List triggers response.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + }, + "trigger": { + "type": "array", + "description": "All GTM Triggers of a GTM Container.", + "items": { + "$ref": "Trigger" + } + } + } + }, + "ListUserPermissionsResponse": { + "id": "ListUserPermissionsResponse", + "type": "object", + "description": "List user permissions response.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + }, + "userPermission": { + "type": "array", + "description": "All GTM UserPermissions of a GTM Account.", + "items": { + "$ref": "UserPermission" + } + } + } + }, + "ListVariablesResponse": { + "id": "ListVariablesResponse", + "type": "object", + "description": "List Variables Response.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + }, + "variable": { + "type": "array", + "description": "All GTM Variables of a GTM Container.", + "items": { + "$ref": "Variable" + } + } + } + }, + "ListWorkspacesResponse": { + "id": "ListWorkspacesResponse", + "type": "object", + "description": "A list of workspaces in a container.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + }, + "workspace": { + "type": "array", + "description": "All Workspaces of a GTM Container.", + "items": { + "$ref": "Workspace" + } + } + } + }, + "MergeConflict": { + "id": "MergeConflict", + "type": "object", + "description": "Represents a merge conflict.", + "properties": { + "entityInBaseVersion": { + "$ref": "Entity", + "description": "The base version entity (since the latest sync operation) that has conflicting changes compared to the workspace. If this field is missing, it means the workspace entity is deleted from the base version." + }, + "entityInWorkspace": { + "$ref": "Entity", + "description": "The workspace entity that has conflicting changes compared to the base version. If an entity is deleted in a workspace, it will still appear with a deleted change status." + } + } + }, + "Parameter": { + "id": "Parameter", + "type": "object", + "description": "Represents a Google Tag Manager Parameter.", + "properties": { + "key": { + "type": "string", + "description": "The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values." + }, + "list": { + "type": "array", + "description": "This list parameter's parameters (keys will be ignored).", + "items": { + "$ref": "Parameter" + } + }, + "map": { + "type": "array", + "description": "This map parameter's parameters (must have keys; keys must be unique).", + "items": { + "$ref": "Parameter" + } + }, + "type": { + "type": "string", + "description": "The parameter type. Valid values are: \n- boolean: The value represents a boolean, represented as 'true' or 'false' \n- integer: The value represents a 64-bit signed integer value, in base 10 \n- list: A list of parameters should be specified \n- map: A map of parameters should be specified \n- template: The value represents any text; this can include variable references (even variable references that might return non-string types)", + "enum": [ + "boolean", + "integer", + "list", + "map", + "template", + "typeUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.tags.create", + "tagmanager.accounts.containers.workspaces.tags.update", + "tagmanager.accounts.containers.workspaces.triggers.create", + "tagmanager.accounts.containers.workspaces.triggers.update", + "tagmanager.accounts.containers.workspaces.variables.create", + "tagmanager.accounts.containers.workspaces.variables.update" + ] + } + }, + "value": { + "type": "string", + "description": "A parameter's value (may contain variable references such as \"{{myVariable}}\") as appropriate to the specified type." + } + } + }, + "PublishContainerVersionResponse": { + "id": "PublishContainerVersionResponse", + "type": "object", + "description": "Publish container version response.", + "properties": { + "compilerError": { + "type": "boolean", + "description": "Compiler errors or not." + }, + "containerVersion": { + "$ref": "ContainerVersion", + "description": "The container version created." + } + } + }, + "QuickPreviewResponse": { + "id": "QuickPreviewResponse", + "type": "object", + "description": "Response to quick previewing a workspace.", + "properties": { + "compilerError": { + "type": "boolean", + "description": "Were there compiler errors or not." + }, + "containerVersion": { + "$ref": "ContainerVersion", + "description": "The quick previewed container version." + }, + "syncStatus": { + "$ref": "SyncStatus", + "description": "Whether quick previewing failed when syncing the workspace to the latest container version." + } + } + }, + "RevertBuiltInVariableResponse": { + "id": "RevertBuiltInVariableResponse", + "type": "object", + "description": "The result of reverting a built-in variable in a workspace.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether the built-in variable is enabled after reversion." + } + } + }, + "RevertFolderResponse": { + "id": "RevertFolderResponse", + "type": "object", + "description": "The result of reverting folder changes in a workspace.", + "properties": { + "folder": { + "$ref": "Folder", + "description": "Folder as it appears in the latest container version since the last workspace synchronization operation. If no folder is present, that means the folder was deleted in the latest container version." + } + } + }, + "RevertTagResponse": { + "id": "RevertTagResponse", + "type": "object", + "description": "The result of reverting a tag in a workspace.", + "properties": { + "tag": { + "$ref": "Tag", + "description": "Tag as it appears in the latest container version since the last workspace synchronization operation. If no tag is present, that means the tag was deleted in the latest container version." + } + } + }, + "RevertTriggerResponse": { + "id": "RevertTriggerResponse", + "type": "object", + "description": "The result of reverting a trigger in a workspace.", + "properties": { + "trigger": { + "$ref": "Trigger", + "description": "Trigger as it appears in the latest container version since the last workspace synchronization operation. If no trigger is present, that means the trigger was deleted in the latest container version." + } + } + }, + "RevertVariableResponse": { + "id": "RevertVariableResponse", + "type": "object", + "description": "The result of reverting a variable in a workspace.", + "properties": { + "variable": { + "$ref": "Variable", + "description": "Variable as it appears in the latest container version since the last workspace synchronization operation. If no variable is present, that means the variable was deleted in the latest container version." + } + } + }, + "SetupTag": { + "id": "SetupTag", + "type": "object", + "description": "Represents a reference to atag that fires before another tag in order to set up dependencies.", + "properties": { + "stopOnSetupFailure": { + "type": "boolean", + "description": "If true, fire the main tag if and only if the setup tag fires successfully. If false, fire the main tag regardless of setup tag firing status." + }, + "tagName": { + "type": "string", + "description": "The name of the setup tag." + } + } + }, + "SyncStatus": { + "id": "SyncStatus", + "type": "object", + "description": "The status of a workspace after synchronization.", + "properties": { + "mergeConflict": { + "type": "boolean", + "description": "Synchornization operation detected a merge conflict." + }, + "syncError": { + "type": "boolean", + "description": "An error occurred during the synchronization operation." + } + } + }, + "SyncWorkspaceResponse": { + "id": "SyncWorkspaceResponse", + "type": "object", + "description": "A response after synchronizing the workspace to the latest container version.", + "properties": { + "mergeConflict": { + "type": "array", + "description": "The merge conflict after sync. If this field is not empty, the sync is still treated as successful. But a version cannot be created until all conflicts are resolved.", + "items": { + "$ref": "MergeConflict" + } + }, + "syncStatus": { + "$ref": "SyncStatus", + "description": "Indicates whether synchronization caused a merge conflict or sync error." + } + } + }, + "Tag": { + "id": "Tag", + "type": "object", + "description": "Represents a Google Tag Manager Tag.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "blockingRuleId": { + "type": "array", + "description": "Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire.", + "items": { + "type": "string" + } + }, + "blockingTriggerId": { + "type": "array", + "description": "Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire.", + "items": { + "type": "string" + } + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified." + }, + "firingRuleId": { + "type": "array", + "description": "Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false.", + "items": { + "type": "string" + } + }, + "firingTriggerId": { + "type": "array", + "description": "Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false.", + "items": { + "type": "string" + } + }, + "liveOnly": { + "type": "boolean", + "description": "If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode)." + }, + "name": { + "type": "string", + "description": "Tag display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.tags.create", + "tagmanager.accounts.containers.workspaces.tags.update" + ] + } + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this tag in the container." + }, + "parameter": { + "type": "array", + "description": "The tag's parameters.", + "items": { + "$ref": "Parameter" + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "path": { + "type": "string", + "description": "GTM Tag's API relative path." + }, + "priority": { + "$ref": "Parameter", + "description": "User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0." + }, + "scheduleEndMs": { + "type": "string", + "description": "The end timestamp in milliseconds to schedule a tag.", + "format": "int64" + }, + "scheduleStartMs": { + "type": "string", + "description": "The start timestamp in milliseconds to schedule a tag.", + "format": "int64" + }, + "setupTag": { + "type": "array", + "description": "The list of setup tags. Currently we only allow one.", + "items": { + "$ref": "SetupTag" + } + }, + "tagFiringOption": { + "type": "string", + "description": "Option to fire this tag.", + "enum": [ + "oncePerEvent", + "oncePerLoad", + "tagFiringOptionUnspecified", + "unlimited" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "tagId": { + "type": "string", + "description": "The Tag ID uniquely identifies the GTM Tag." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "teardownTag": { + "type": "array", + "description": "The list of teardown tags. Currently we only allow one.", + "items": { + "$ref": "TeardownTag" + } + }, + "type": { + "type": "string", + "description": "GTM Tag Type.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.tags.create", + "tagmanager.accounts.containers.workspaces.tags.update" + ] + } + }, + "workspaceId": { + "type": "string", + "description": "GTM Workspace ID." + } + } + }, + "TeardownTag": { + "id": "TeardownTag", + "type": "object", + "description": "Represents a tag that fires after another tag in order to tear down dependencies.", + "properties": { + "stopTeardownOnFailure": { + "type": "boolean", + "description": "If true, fire the teardown tag if and only if the main tag fires successfully. If false, fire the teardown tag regardless of main tag firing status." + }, + "tagName": { + "type": "string", + "description": "The name of the teardown tag." + } + } + }, + "Timestamp": { + "id": "Timestamp", + "type": "object", + "description": "A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings. See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).\n\n# Examples\n\nExample 1: Compute Timestamp from POSIX `time()`.\n\nTimestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0);\n\nExample 2: Compute Timestamp from POSIX `gettimeofday()`.\n\nstruct timeval tv; gettimeofday(&tv, NULL);\n\nTimestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000);\n\nExample 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\nFILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) \u003c\u003c 32) | ft.dwLowDateTime;\n\n// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\nExample 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\nlong millis = System.currentTimeMillis();\n\nTimestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n\n\nExample 5: Compute Timestamp from current time in Python.\n\ntimestamp = Timestamp() timestamp.GetCurrentTime()\n\n# JSON Mapping\n\nIn JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required, though only UTC (as indicated by \"Z\") is presently supported.\n\nFor example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017.\n\nIn JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) to obtain a formatter capable of generating timestamps in this format.", + "properties": { + "nanos": { + "type": "integer", + "description": "Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive.", + "format": "int32" + }, + "seconds": { + "type": "string", + "description": "Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.", + "format": "int64" + } + } + }, + "Trigger": { + "id": "Trigger", + "type": "object", + "description": "Represents a Google Tag Manager Trigger", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "autoEventFilter": { + "type": "array", + "description": "Used in the case of auto event tracking.", + "items": { + "$ref": "Condition" + } + }, + "checkValidation": { + "$ref": "Parameter", + "description": "Whether or not we should only fire tags if the form submit or link click event is not cancelled by some other event handler (e.g. because of validation). Only valid for Form Submission and Link Click triggers." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "continuousTimeMinMilliseconds": { + "$ref": "Parameter", + "description": "A visibility trigger minimum continuous visible time (in milliseconds). Only valid for AMP Visibility trigger." + }, + "customEventFilter": { + "type": "array", + "description": "Used in the case of custom event, which is fired iff all Conditions are true.", + "items": { + "$ref": "Condition" + } + }, + "eventName": { + "$ref": "Parameter", + "description": "Name of the GTM event that is fired. Only valid for Timer triggers." + }, + "filter": { + "type": "array", + "description": "The trigger will only fire iff all Conditions are true.", + "items": { + "$ref": "Condition" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified." + }, + "horizontalScrollPercentageList": { + "$ref": "Parameter", + "description": "List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled horizontally. Only valid for AMP scroll triggers." + }, + "interval": { + "$ref": "Parameter", + "description": "Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers." + }, + "intervalSeconds": { + "$ref": "Parameter", + "description": "Time between Timer Events to fire (in seconds). Only valid for AMP Timer trigger." + }, + "limit": { + "$ref": "Parameter", + "description": "Limit of the number of GTM events this Timer Trigger will fire. If no limit is set, we will continue to fire GTM events until the user leaves the page. Only valid for Timer triggers." + }, + "maxTimerLengthSeconds": { + "$ref": "Parameter", + "description": "Max time to fire Timer Events (in seconds). Only valid for AMP Timer trigger." + }, + "name": { + "type": "string", + "description": "Trigger display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.triggers.create", + "tagmanager.accounts.containers.workspaces.triggers.update" + ] + } + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this trigger in the container." + }, + "parameter": { + "type": "array", + "description": "Additional parameters.", + "items": { + "$ref": "Parameter" + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "path": { + "type": "string", + "description": "GTM Trigger's API relative path." + }, + "selector": { + "$ref": "Parameter", + "description": "A click trigger CSS selector (i.e. \"a\", \"button\" etc.). Only valid for AMP Click trigger." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "totalTimeMinMilliseconds": { + "$ref": "Parameter", + "description": "A visibility trigger minimum total visible time (in milliseconds). Only valid for AMP Visibility trigger." + }, + "triggerId": { + "type": "string", + "description": "The Trigger ID uniquely identifies the GTM Trigger." + }, + "type": { + "type": "string", + "description": "Defines the data layer event that causes this trigger.", + "enum": [ + "always", + "ampClick", + "ampScroll", + "ampTimer", + "ampVisibility", + "click", + "customEvent", + "domReady", + "eventTypeUnspecified", + "firebaseAppException", + "firebaseAppUpdate", + "firebaseCampaign", + "firebaseFirstOpen", + "firebaseInAppPurchase", + "firebaseNotificationDismiss", + "firebaseNotificationForeground", + "firebaseNotificationOpen", + "firebaseNotificationReceive", + "firebaseOsUpdate", + "firebaseSessionStart", + "firebaseUserEngagement", + "formSubmission", + "historyChange", + "jsError", + "linkClick", + "pageview", + "timer", + "windowLoaded", + "youTubeVideo" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.triggers.create" + ] + } + }, + "uniqueTriggerId": { + "$ref": "Parameter", + "description": "Globally unique id of the trigger that auto-generates this (a Form Submit, Link Click or Timer listener) if any. Used to make incompatible auto-events work together with trigger filtering based on trigger ids. This value is populated during output generation since the tags implied by triggers don't exist until then. Only valid for Form Submit, Link Click and Timer triggers." + }, + "verticalScrollPercentageList": { + "$ref": "Parameter", + "description": "List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled vertically. Only valid for AMP scroll triggers." + }, + "visibilitySelector": { + "$ref": "Parameter", + "description": "A visibility trigger CSS selector (i.e. \"#id\"). Only valid for AMP Visibility trigger." + }, + "visiblePercentageMax": { + "$ref": "Parameter", + "description": "A visibility trigger maximum percent visibility. Only valid for AMP Visibility trigger." + }, + "visiblePercentageMin": { + "$ref": "Parameter", + "description": "A visibility trigger minimum percent visibility. Only valid for AMP Visibility trigger." + }, + "waitForTags": { + "$ref": "Parameter", + "description": "Whether or not we should delay the form submissions or link opening until all of the tags have fired (by preventing the default action and later simulating the default action). Only valid for Form Submission and Link Click triggers." + }, + "waitForTagsTimeout": { + "$ref": "Parameter", + "description": "How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' above evaluates to true. Only valid for Form Submission and Link Click triggers." + }, + "workspaceId": { + "type": "string", + "description": "GTM Workspace ID." + } + } + }, + "UpdateWorkspaceProposalRequest": { + "id": "UpdateWorkspaceProposalRequest", + "type": "object", + "description": "Updates a workspace proposal with patch-like semantics.", + "properties": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the proposal in storage." + }, + "newComment": { + "$ref": "WorkspaceProposalHistoryComment", + "description": "If present, a new comment is added to the workspace proposal history." + }, + "reviewers": { + "type": "array", + "description": "If present, the list of reviewers of the workspace proposal is updated.", + "items": { + "$ref": "WorkspaceProposalUser" + } + }, + "status": { + "type": "string", + "description": "If present, the status of the workspace proposal is updated.", + "enum": [ + "approved", + "cancelled", + "completed", + "requested", + "reviewed", + "statusUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "UserPermission": { + "id": "UserPermission", + "type": "object", + "description": "Represents a user's permissions to an account and its container.", + "properties": { + "accountAccess": { + "$ref": "AccountAccess", + "description": "GTM Account access permissions." + }, + "accountId": { + "type": "string", + "description": "The Account ID uniquely identifies the GTM Account." + }, + "containerAccess": { + "type": "array", + "description": "GTM Container access permissions.", + "items": { + "$ref": "ContainerAccess" + } + }, + "emailAddress": { + "type": "string", + "description": "User's email address." + }, + "path": { + "type": "string", + "description": "GTM UserPermission's API relative path." + } + } + }, + "Variable": { + "id": "Variable", + "type": "object", + "description": "Represents a Google Tag Manager Variable.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "disablingTriggerId": { + "type": "array", + "description": "For mobile containers only: A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set.", + "items": { + "type": "string" + } + }, + "enablingTriggerId": { + "type": "array", + "description": "For mobile containers only: A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set.", + "items": { + "type": "string" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified." + }, + "name": { + "type": "string", + "description": "Variable display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.variables.create", + "tagmanager.accounts.containers.workspaces.variables.update" + ] + } + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this variable in the container." + }, + "parameter": { + "type": "array", + "description": "The variable's parameters.", + "items": { + "$ref": "Parameter" + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "path": { + "type": "string", + "description": "GTM Variable's API relative path." + }, + "scheduleEndMs": { + "type": "string", + "description": "The end timestamp in milliseconds to schedule a variable.", + "format": "int64" + }, + "scheduleStartMs": { + "type": "string", + "description": "The start timestamp in milliseconds to schedule a variable.", + "format": "int64" + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "type": { + "type": "string", + "description": "GTM Variable Type.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.variables.create", + "tagmanager.accounts.containers.workspaces.variables.update" + ] + } + }, + "variableId": { + "type": "string", + "description": "The Variable ID uniquely identifies the GTM Variable." + }, + "workspaceId": { + "type": "string", + "description": "GTM Workspace ID." + } + } + }, + "Workspace": { + "id": "Workspace", + "type": "object", + "description": "Represents a Google Tag Manager Container Workspace.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "description": { + "type": "string", + "description": "Workspace description." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Workspace as computed at storage time. This value is recomputed whenever the workspace is modified." + }, + "name": { + "type": "string", + "description": "Workspace display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.workspaces.create", + "tagmanager.accounts.containers.workspaces.update" + ] + } + }, + "path": { + "type": "string", + "description": "GTM Workspace's API relative path." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "workspaceId": { + "type": "string", + "description": "The Workspace ID uniquely identifies the GTM Workspace." + } + } + }, + "WorkspaceProposal": { + "id": "WorkspaceProposal", + "type": "object", + "description": "A workspace proposal represents an ongoing review of workspace changes in an effort to gain approval for container version creation.", + "properties": { + "authors": { + "type": "array", + "description": "List of authors for the workspace proposal.", + "items": { + "$ref": "WorkspaceProposalUser" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM workspace proposal as computed at storage time. This value is recomputed whenever the proposal is modified." + }, + "history": { + "type": "array", + "description": "Records the history of comments and status changes.", + "items": { + "$ref": "WorkspaceProposalHistory" + } + }, + "path": { + "type": "string", + "description": "GTM workspace proposal's relative path." + }, + "reviewers": { + "type": "array", + "description": "Lists of reviewers for the workspace proposal.", + "items": { + "$ref": "WorkspaceProposalUser" + } + }, + "status": { + "type": "string", + "description": "The status of the workspace proposal as it goes through review.", + "enum": [ + "approved", + "cancelled", + "completed", + "requested", + "reviewed", + "statusUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "WorkspaceProposalHistory": { + "id": "WorkspaceProposalHistory", + "type": "object", + "description": "A history event that represents a comment or status change in the proposal.", + "properties": { + "comment": { + "$ref": "WorkspaceProposalHistoryComment", + "description": "A user or reviewer comment." + }, + "createdBy": { + "$ref": "WorkspaceProposalUser", + "description": "The party responsible for the change in history." + }, + "createdTimestamp": { + "$ref": "Timestamp", + "description": "When this history event was added to the workspace proposal." + }, + "statusChange": { + "$ref": "WorkspaceProposalHistoryStatusChange", + "description": "A change in the proposal's status." + }, + "type": { + "type": "string", + "description": "The history type distinguishing between comments and status changes.", + "enum": [ + "comment", + "statusChange", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "WorkspaceProposalHistoryComment": { + "id": "WorkspaceProposalHistoryComment", + "type": "object", + "description": "A comment from the reviewer or author.", + "properties": { + "content": { + "type": "string", + "description": "The contents of the reviewer or author comment." + } + } + }, + "WorkspaceProposalHistoryStatusChange": { + "id": "WorkspaceProposalHistoryStatusChange", + "type": "object", + "description": "A change in the proposal's status.", + "properties": { + "newStatus": { + "type": "string", + "description": "The new proposal status after that status change.", + "enum": [ + "approved", + "cancelled", + "completed", + "requested", + "reviewed", + "statusUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "oldStatus": { + "type": "string", + "description": "The old proposal status before the status change.", + "enum": [ + "approved", + "cancelled", + "completed", + "requested", + "reviewed", + "statusUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "WorkspaceProposalUser": { + "id": "WorkspaceProposalUser", + "type": "object", + "description": "Represents an external user or internal Google Tag Manager system.", + "properties": { + "gaiaId": { + "type": "string", + "description": "Gaia id associated with a user, absent for the Google Tag Manager system.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "User type distinguishes between a user and the Google Tag Manager system.", + "enum": [ + "gaiaId", + "system" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "Represents a Google Tag Manager Zone's contents.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "boundary": { + "$ref": "ZoneBoundary", + "description": "This Zone's boundary." + }, + "childContainer": { + "type": "array", + "description": "Containers that are children of this Zone.", + "items": { + "$ref": "ZoneChildContainer" + } + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Zone as computed at storage time. This value is recomputed whenever the zone is modified." + }, + "name": { + "type": "string", + "description": "Zone display name." + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this zone in the container." + }, + "path": { + "type": "string", + "description": "GTM Zone's API relative path." + }, + "tagManagerUrl": { + "type": "string", + "description": "Auto generated link to the tag manager UI" + }, + "typeRestriction": { + "$ref": "ZoneTypeRestriction", + "description": "This Zone's type restrictions." + }, + "workspaceId": { + "type": "string", + "description": "GTM Workspace ID." + }, + "zoneId": { + "type": "string", + "description": "The Zone ID uniquely identifies the GTM Zone." + } + } + }, + "ZoneBoundary": { + "id": "ZoneBoundary", + "type": "object", + "description": "Represents a Zone's boundaries.", + "properties": { + "condition": { + "type": "array", + "description": "The conditions that, when conjoined, make up the boundary.", + "items": { + "$ref": "Condition" + } + }, + "customEvaluationTriggerId": { + "type": "array", + "description": "Custom evaluation trigger IDs. A zone will evaluate its boundary conditions when any of the listed triggers are true.", + "items": { + "type": "string" + } + } + } + }, + "ZoneChildContainer": { + "id": "ZoneChildContainer", + "type": "object", + "description": "Represents a child container of a Zone.", + "properties": { + "nickname": { + "type": "string", + "description": "The zone's nickname for the child container." + }, + "publicId": { + "type": "string", + "description": "The child container's public id." + } + } + }, + "ZoneTypeRestriction": { + "id": "ZoneTypeRestriction", + "type": "object", + "description": "Represents a Zone's type restrictions.", + "properties": { + "enable": { + "type": "boolean", + "description": "True if type restrictions have been enabled for this Zone." + }, + "whitelistedTypeId": { + "type": "array", + "description": "List of type public ids that have been whitelisted for use in this Zone.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "accounts": { + "methods": { + "get": { + "id": "tagmanager.accounts.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Account.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Accounts's API relative path. Example: accounts/{account_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.manage.accounts", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "Lists all GTM Accounts that a user has access to.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + } + }, + "response": { + "$ref": "ListAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.manage.accounts", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Account.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the account in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Accounts's API relative path. Example: accounts/{account_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.accounts" + ] + } + }, + "resources": { + "containers": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.create", + "path": "{+parent}/containers", + "httpMethod": "POST", + "description": "Creates a Container.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Account's API relative path. Example: accounts/{account_id}.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Container" + }, + "response": { + "$ref": "Container" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a Container.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.delete.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a Container.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Container" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.list", + "path": "{+parent}/containers", + "httpMethod": "GET", + "description": "Lists all Containers that belongs to a GTM Account.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Accounts's API relative path. Example: accounts/{account_id}.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListContainersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a Container.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the container in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Container" + }, + "response": { + "$ref": "Container" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + }, + "resources": { + "environments": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.environments.create", + "path": "{+parent}/environments", + "httpMethod": "POST", + "description": "Creates a GTM Environment.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Environment" + }, + "response": { + "$ref": "Environment" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.environments.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Environment.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.environments.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Environment.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Environment" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.environments.list", + "path": "{+parent}/environments", + "httpMethod": "GET", + "description": "Lists all GTM Environments of a GTM Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListEnvironmentsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "patch": { + "id": "tagmanager.accounts.containers.environments.patch", + "path": "{+path}", + "httpMethod": "PATCH", + "description": "Updates a GTM Environment. This method supports patch semantics.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the environment in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Environment" + }, + "response": { + "$ref": "Environment" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "reauthorize": { + "id": "tagmanager.accounts.containers.environments.reauthorize", + "path": "{+path}:reauthorize", + "httpMethod": "POST", + "description": "Re-generates the authorization code for a GTM Environment.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Environment" + }, + "response": { + "$ref": "Environment" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.publish" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.environments.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Environment.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the environment in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Environment" + }, + "response": { + "$ref": "Environment" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "version_headers": { + "methods": { + "latest": { + "id": "tagmanager.accounts.containers.version_headers.latest", + "path": "{+parent}/version_headers:latest", + "httpMethod": "GET", + "description": "Gets the latest container version header", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ContainerVersionHeader" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.version_headers.list", + "path": "{+parent}/version_headers", + "httpMethod": "GET", + "description": "Lists all Container Versions of a GTM Container.", + "parameters": { + "includeDeleted": { + "type": "boolean", + "description": "Also retrieve deleted (archived) versions when true.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListContainerVersionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + } + } + }, + "versions": { + "methods": { + "delete": { + "id": "tagmanager.accounts.containers.versions.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a Container Version.", + "parameters": { + "path": { + "type": "string", + "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.versions.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a Container Version.", + "parameters": { + "containerVersionId": { + "type": "string", + "description": "The GTM ContainerVersion ID. Specify published to retrieve the currently published version.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "live": { + "id": "tagmanager.accounts.containers.versions.live", + "path": "{+parent}/versions:live", + "httpMethod": "GET", + "description": "Gets the live (i.e. published) container version", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "publish": { + "id": "tagmanager.accounts.containers.versions.publish", + "path": "{+path}:publish", + "httpMethod": "POST", + "description": "Publishes a Container Version.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "PublishContainerVersionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.publish" + ] + }, + "set_latest": { + "id": "tagmanager.accounts.containers.versions.set_latest", + "path": "{+path}:set_latest", + "httpMethod": "POST", + "description": "Sets the latest version used for synchronization of workspaces when detecting conflicts and errors.", + "parameters": { + "path": { + "type": "string", + "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "undelete": { + "id": "tagmanager.accounts.containers.versions.undelete", + "path": "{+path}:undelete", + "httpMethod": "POST", + "description": "Undeletes a Container Version.", + "parameters": { + "path": { + "type": "string", + "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.versions.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a Container Version.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "ContainerVersion" + }, + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + } + } + }, + "workspaces": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.create", + "path": "{+parent}/workspaces", + "httpMethod": "POST", + "description": "Creates a Workspace.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Workspace" + }, + "response": { + "$ref": "Workspace" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "create_version": { + "id": "tagmanager.accounts.containers.workspaces.create_version", + "path": "{+path}:create_version", + "httpMethod": "POST", + "description": "Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "CreateContainerVersionRequestVersionOptions" + }, + "response": { + "$ref": "CreateContainerVersionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a Workspace.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.delete.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.workspaces.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a Workspace.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Workspace" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "getProposal": { + "id": "tagmanager.accounts.containers.workspaces.getProposal", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Workspace Proposal.", + "parameters": { + "path": { + "type": "string", + "description": "GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "WorkspaceProposal" + } + }, + "getStatus": { + "id": "tagmanager.accounts.containers.workspaces.getStatus", + "path": "{+path}/status", + "httpMethod": "GET", + "description": "Finds conflicting and modified entities in the workspace.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "GetWorkspaceStatusResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.workspaces.list", + "path": "{+parent}/workspaces", + "httpMethod": "GET", + "description": "Lists all Workspaces that belong to a GTM Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListWorkspacesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "quick_preview": { + "id": "tagmanager.accounts.containers.workspaces.quick_preview", + "path": "{+path}:quick_preview", + "httpMethod": "POST", + "description": "Quick previews a workspace by creating a fake container version from all entities in the provided workspace.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "QuickPreviewResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "resolve_conflict": { + "id": "tagmanager.accounts.containers.workspaces.resolve_conflict", + "path": "{+path}:resolve_conflict", + "httpMethod": "POST", + "description": "Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Entity" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "sync": { + "id": "tagmanager.accounts.containers.workspaces.sync", + "path": "{+path}:sync", + "httpMethod": "POST", + "description": "Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "SyncWorkspaceResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.workspaces.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a Workspace.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the workspace in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Workspace" + }, + "response": { + "$ref": "Workspace" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "updateProposal": { + "id": "tagmanager.accounts.containers.workspaces.updateProposal", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Workspace Proposal.", + "parameters": { + "path": { + "type": "string", + "description": "GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "UpdateWorkspaceProposalRequest" + }, + "response": { + "$ref": "WorkspaceProposal" + } + } + }, + "resources": { + "built_in_variables": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.built_in_variables.create", + "path": "{+parent}/built_in_variables", + "httpMethod": "POST", + "description": "Creates one or more GTM Built-In Variables.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + }, + "type": { + "type": "string", + "description": "The types of built-in variables to enable.", + "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "ampBrowserLanguage", + "ampCanonicalHost", + "ampCanonicalPath", + "ampCanonicalUrl", + "ampClientId", + "ampClientMaxScrollX", + "ampClientMaxScrollY", + "ampClientScreenHeight", + "ampClientScreenWidth", + "ampClientScrollX", + "ampClientScrollY", + "ampClientTimestamp", + "ampClientTimezone", + "ampGtmEvent", + "ampPageDownloadTime", + "ampPageLoadTime", + "ampPageViewId", + "ampReferrer", + "ampTitle", + "ampTotalEngagedTime", + "appId", + "appName", + "appVersionCode", + "appVersionName", + "builtInVariableTypeUnspecified", + "clickClasses", + "clickElement", + "clickId", + "clickTarget", + "clickText", + "clickUrl", + "containerId", + "containerVersion", + "debugMode", + "deviceName", + "environmentName", + "errorLine", + "errorMessage", + "errorUrl", + "event", + "eventName", + "firebaseEventParameterCampaign", + "firebaseEventParameterCampaignAclid", + "firebaseEventParameterCampaignAnid", + "firebaseEventParameterCampaignClickTimestamp", + "firebaseEventParameterCampaignContent", + "firebaseEventParameterCampaignCp1", + "firebaseEventParameterCampaignGclid", + "firebaseEventParameterCampaignSource", + "firebaseEventParameterCampaignTerm", + "firebaseEventParameterCurrency", + "firebaseEventParameterDynamicLinkAcceptTime", + "firebaseEventParameterDynamicLinkLinkid", + "firebaseEventParameterNotificationMessageDeviceTime", + "firebaseEventParameterNotificationMessageId", + "firebaseEventParameterNotificationMessageName", + "firebaseEventParameterNotificationMessageTime", + "firebaseEventParameterNotificationTopic", + "firebaseEventParameterPreviousAppVersion", + "firebaseEventParameterPreviousOsVersion", + "firebaseEventParameterPrice", + "firebaseEventParameterProductId", + "firebaseEventParameterQuantity", + "firebaseEventParameterValue", + "formClasses", + "formElement", + "formId", + "formTarget", + "formText", + "formUrl", + "historySource", + "htmlId", + "language", + "newHistoryFragment", + "newHistoryState", + "oldHistoryFragment", + "oldHistoryState", + "osVersion", + "pageHostname", + "pagePath", + "pageUrl", + "platform", + "randomNumber", + "referrer", + "resolution", + "sdkVersion", + "videoCurrentTime", + "videoDuration", + "videoElapsedTime", + "videoPercent", + "videoProvider", + "videoStatus", + "videoTitle", + "videoUrl", + "videoVisible" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "CreateBuiltInVariableResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.built_in_variables.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes one or more GTM Built-In Variables.", + "parameters": { + "path": { + "type": "string", + "description": "GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables", + "required": true, + "location": "path" + }, + "type": { + "type": "string", + "description": "The types of built-in variables to delete.", + "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "ampBrowserLanguage", + "ampCanonicalHost", + "ampCanonicalPath", + "ampCanonicalUrl", + "ampClientId", + "ampClientMaxScrollX", + "ampClientMaxScrollY", + "ampClientScreenHeight", + "ampClientScreenWidth", + "ampClientScrollX", + "ampClientScrollY", + "ampClientTimestamp", + "ampClientTimezone", + "ampGtmEvent", + "ampPageDownloadTime", + "ampPageLoadTime", + "ampPageViewId", + "ampReferrer", + "ampTitle", + "ampTotalEngagedTime", + "appId", + "appName", + "appVersionCode", + "appVersionName", + "builtInVariableTypeUnspecified", + "clickClasses", + "clickElement", + "clickId", + "clickTarget", + "clickText", + "clickUrl", + "containerId", + "containerVersion", + "debugMode", + "deviceName", + "environmentName", + "errorLine", + "errorMessage", + "errorUrl", + "event", + "eventName", + "firebaseEventParameterCampaign", + "firebaseEventParameterCampaignAclid", + "firebaseEventParameterCampaignAnid", + "firebaseEventParameterCampaignClickTimestamp", + "firebaseEventParameterCampaignContent", + "firebaseEventParameterCampaignCp1", + "firebaseEventParameterCampaignGclid", + "firebaseEventParameterCampaignSource", + "firebaseEventParameterCampaignTerm", + "firebaseEventParameterCurrency", + "firebaseEventParameterDynamicLinkAcceptTime", + "firebaseEventParameterDynamicLinkLinkid", + "firebaseEventParameterNotificationMessageDeviceTime", + "firebaseEventParameterNotificationMessageId", + "firebaseEventParameterNotificationMessageName", + "firebaseEventParameterNotificationMessageTime", + "firebaseEventParameterNotificationTopic", + "firebaseEventParameterPreviousAppVersion", + "firebaseEventParameterPreviousOsVersion", + "firebaseEventParameterPrice", + "firebaseEventParameterProductId", + "firebaseEventParameterQuantity", + "firebaseEventParameterValue", + "formClasses", + "formElement", + "formId", + "formTarget", + "formText", + "formUrl", + "historySource", + "htmlId", + "language", + "newHistoryFragment", + "newHistoryState", + "oldHistoryFragment", + "oldHistoryState", + "osVersion", + "pageHostname", + "pagePath", + "pageUrl", + "platform", + "randomNumber", + "referrer", + "resolution", + "sdkVersion", + "videoCurrentTime", + "videoDuration", + "videoElapsedTime", + "videoPercent", + "videoProvider", + "videoStatus", + "videoTitle", + "videoUrl", + "videoVisible" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.workspaces.built_in_variables.list", + "path": "{+parent}/built_in_variables", + "httpMethod": "GET", + "description": "Lists all the enabled Built-In Variables of a GTM Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListEnabledBuiltInVariablesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "revert": { + "id": "tagmanager.accounts.containers.workspaces.built_in_variables.revert", + "path": "{+path}/built_in_variables:revert", + "httpMethod": "POST", + "description": "Reverts changes to a GTM Built-In Variables in a GTM Workspace.", + "parameters": { + "path": { + "type": "string", + "description": "GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables", + "required": true, + "location": "path" + }, + "type": { + "type": "string", + "description": "The type of built-in variable to revert.", + "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "ampBrowserLanguage", + "ampCanonicalHost", + "ampCanonicalPath", + "ampCanonicalUrl", + "ampClientId", + "ampClientMaxScrollX", + "ampClientMaxScrollY", + "ampClientScreenHeight", + "ampClientScreenWidth", + "ampClientScrollX", + "ampClientScrollY", + "ampClientTimestamp", + "ampClientTimezone", + "ampGtmEvent", + "ampPageDownloadTime", + "ampPageLoadTime", + "ampPageViewId", + "ampReferrer", + "ampTitle", + "ampTotalEngagedTime", + "appId", + "appName", + "appVersionCode", + "appVersionName", + "builtInVariableTypeUnspecified", + "clickClasses", + "clickElement", + "clickId", + "clickTarget", + "clickText", + "clickUrl", + "containerId", + "containerVersion", + "debugMode", + "deviceName", + "environmentName", + "errorLine", + "errorMessage", + "errorUrl", + "event", + "eventName", + "firebaseEventParameterCampaign", + "firebaseEventParameterCampaignAclid", + "firebaseEventParameterCampaignAnid", + "firebaseEventParameterCampaignClickTimestamp", + "firebaseEventParameterCampaignContent", + "firebaseEventParameterCampaignCp1", + "firebaseEventParameterCampaignGclid", + "firebaseEventParameterCampaignSource", + "firebaseEventParameterCampaignTerm", + "firebaseEventParameterCurrency", + "firebaseEventParameterDynamicLinkAcceptTime", + "firebaseEventParameterDynamicLinkLinkid", + "firebaseEventParameterNotificationMessageDeviceTime", + "firebaseEventParameterNotificationMessageId", + "firebaseEventParameterNotificationMessageName", + "firebaseEventParameterNotificationMessageTime", + "firebaseEventParameterNotificationTopic", + "firebaseEventParameterPreviousAppVersion", + "firebaseEventParameterPreviousOsVersion", + "firebaseEventParameterPrice", + "firebaseEventParameterProductId", + "firebaseEventParameterQuantity", + "firebaseEventParameterValue", + "formClasses", + "formElement", + "formId", + "formTarget", + "formText", + "formUrl", + "historySource", + "htmlId", + "language", + "newHistoryFragment", + "newHistoryState", + "oldHistoryFragment", + "oldHistoryState", + "osVersion", + "pageHostname", + "pagePath", + "pageUrl", + "platform", + "randomNumber", + "referrer", + "resolution", + "sdkVersion", + "videoCurrentTime", + "videoDuration", + "videoElapsedTime", + "videoPercent", + "videoProvider", + "videoStatus", + "videoTitle", + "videoUrl", + "videoVisible" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "RevertBuiltInVariableResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "folders": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.folders.create", + "path": "{+parent}/folders", + "httpMethod": "POST", + "description": "Creates a GTM Folder.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Folder" + }, + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.folders.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Folder.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "entities": { + "id": "tagmanager.accounts.containers.workspaces.folders.entities", + "path": "{+path}:entities", + "httpMethod": "POST", + "description": "List all entities in a GTM Folder.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "FolderEntities" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.workspaces.folders.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Folder.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.workspaces.folders.list", + "path": "{+parent}/folders", + "httpMethod": "GET", + "description": "Lists all GTM Folders of a Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListFoldersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "move_entities_to_folder": { + "id": "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder", + "path": "{+path}:move_entities_to_folder", + "httpMethod": "POST", + "description": "Moves entities to a GTM Folder.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}", + "required": true, + "location": "path" + }, + "tagId": { + "type": "string", + "description": "The tags to be moved to the folder.", + "repeated": true, + "location": "query" + }, + "triggerId": { + "type": "string", + "description": "The triggers to be moved to the folder.", + "repeated": true, + "location": "query" + }, + "variableId": { + "type": "string", + "description": "The variables to be moved to the folder.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "revert": { + "id": "tagmanager.accounts.containers.workspaces.folders.revert", + "path": "{+path}:revert", + "httpMethod": "POST", + "description": "Reverts changes to a GTM Folder in a GTM Workspace.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "RevertFolderResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.workspaces.folders.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Folder.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the folder in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Folder" + }, + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "proposal": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.proposal.create", + "path": "{+parent}/proposal", + "httpMethod": "POST", + "description": "Creates a GTM Workspace Proposal.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "CreateWorkspaceProposalRequest" + }, + "response": { + "$ref": "WorkspaceProposal" + } + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.proposal.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Workspace Proposal.", + "parameters": { + "path": { + "type": "string", + "description": "GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ] + } + } + }, + "tags": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.tags.create", + "path": "{+parent}/tags", + "httpMethod": "POST", + "description": "Creates a GTM Tag.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Tag" + }, + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.tags.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Tag.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.workspaces.tags.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Tag.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.workspaces.tags.list", + "path": "{+parent}/tags", + "httpMethod": "GET", + "description": "Lists all GTM Tags of a Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListTagsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "revert": { + "id": "tagmanager.accounts.containers.workspaces.tags.revert", + "path": "{+path}:revert", + "httpMethod": "POST", + "description": "Reverts changes to a GTM Tag in a GTM Workspace.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of thetag in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "RevertTagResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.workspaces.tags.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Tag.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Tag" + }, + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "triggers": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.triggers.create", + "path": "{+parent}/triggers", + "httpMethod": "POST", + "description": "Creates a GTM Trigger.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Trigger" + }, + "response": { + "$ref": "Trigger" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.triggers.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Trigger.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.workspaces.triggers.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Trigger.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Trigger" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.workspaces.triggers.list", + "path": "{+parent}/triggers", + "httpMethod": "GET", + "description": "Lists all GTM Triggers of a Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListTriggersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "revert": { + "id": "tagmanager.accounts.containers.workspaces.triggers.revert", + "path": "{+path}:revert", + "httpMethod": "POST", + "description": "Reverts changes to a GTM Trigger in a GTM Workspace.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "RevertTriggerResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.workspaces.triggers.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Trigger.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Trigger" + }, + "response": { + "$ref": "Trigger" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "variables": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.workspaces.variables.create", + "path": "{+parent}/variables", + "httpMethod": "POST", + "description": "Creates a GTM Variable.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Variable" + }, + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.workspaces.variables.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Variable.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.workspaces.variables.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a GTM Variable.", + "parameters": { + "path": { + "type": "string", + "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.workspaces.variables.list", + "path": "{+parent}/variables", + "httpMethod": "GET", + "description": "Lists all GTM Variables of a Container.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListVariablesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "revert": { + "id": "tagmanager.accounts.containers.workspaces.variables.revert", + "path": "{+path}:revert", + "httpMethod": "POST", + "description": "Reverts changes to a GTM Variable in a GTM Workspace.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "RevertVariableResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.workspaces.variables.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a GTM Variable.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.", + "location": "query" + }, + "path": { + "type": "string", + "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "Variable" + }, + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + } + } + } + } + }, + "user_permissions": { + "methods": { + "create": { + "id": "tagmanager.accounts.user_permissions.create", + "path": "{+parent}/user_permissions", + "httpMethod": "POST", + "description": "Creates a user's Account & Container access.", + "parameters": { + "parent": { + "type": "string", + "description": "GTM Account's API relative path. Example: accounts/{account_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "UserPermission" + }, + "response": { + "$ref": "UserPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "delete": { + "id": "tagmanager.accounts.user_permissions.delete", + "path": "{+path}", + "httpMethod": "DELETE", + "description": "Removes a user from the account, revoking access to it and all of its containers.", + "parameters": { + "path": { + "type": "string", + "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "get": { + "id": "tagmanager.accounts.user_permissions.get", + "path": "{+path}", + "httpMethod": "GET", + "description": "Gets a user's Account & Container access.", + "parameters": { + "path": { + "type": "string", + "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "response": { + "$ref": "UserPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "list": { + "id": "tagmanager.accounts.user_permissions.list", + "path": "{+parent}/user_permissions", + "httpMethod": "GET", + "description": "List all users that have access to the account along with Account and Container user access granted to each of them.", + "parameters": { + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + }, + "parent": { + "type": "string", + "description": "GTM Accounts's API relative path. Example: accounts/{account_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListUserPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "update": { + "id": "tagmanager.accounts.user_permissions.update", + "path": "{+path}", + "httpMethod": "PUT", + "description": "Updates a user's Account & Container access.", + "parameters": { + "path": { + "type": "string", + "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "path" + ], + "request": { + "$ref": "UserPermission" + }, + "response": { + "$ref": "UserPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + } + } + } + } + } + } +} diff --git a/etc/api/taskqueue/v1beta1/taskqueue-api.json b/etc/api/taskqueue/v1beta1/taskqueue-api.json index bbe9b1badb..ec9b901003 100644 --- a/etc/api/taskqueue/v1beta1/taskqueue-api.json +++ b/etc/api/taskqueue/v1beta1/taskqueue-api.json @@ -20,7 +20,7 @@ "basePath": "/taskqueue/v1beta1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "taskqueue/v1beta1/projects/", - "batchPath": "batch", + "batchPath": "batch/taskqueue/v1beta1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/tasks/v1/tasks-api.json b/etc/api/tasks/v1/tasks-api.json index c00b4ab844..0d16db31b9 100644 --- a/etc/api/tasks/v1/tasks-api.json +++ b/etc/api/tasks/v1/tasks-api.json @@ -20,7 +20,7 @@ "basePath": "/tasks/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "tasks/v1/", - "batchPath": "batch", + "batchPath": "batch/tasks/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/testing/v1/crates/1.0.6-api+20170922 b/etc/api/testing/v1/crates/1.0.6-api+20170922 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/testing/v1/crates/1.0.6-cli+20170922 b/etc/api/testing/v1/crates/1.0.6-cli+20170922 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/testing/v1/testing-api.json b/etc/api/testing/v1/testing-api.json new file mode 100644 index 0000000000..4d3dc8b6e9 --- /dev/null +++ b/etc/api/testing/v1/testing-api.json @@ -0,0 +1,1347 @@ +{ + "discoveryVersion": "v1", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "testMatrices": { + "methods": { + "cancel": { + "flatPath": "v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel", + "id": "testing.projects.testMatrices.cancel", + "path": "v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel", + "description": "Cancels unfinished test executions in a test matrix.\nThis call returns immediately and cancellation proceeds asychronously.\nIf the matrix is already final, this operation will have no effect.\n\nMay return any of the following canonical error codes:\n\n- PERMISSION_DENIED - if the user is not authorized to read project\n- INVALID_ARGUMENT - if the request is malformed\n- NOT_FOUND - if the Test Matrix does not exist", + "response": { + "$ref": "CancelTestMatrixResponse" + }, + "parameterOrder": [ + "projectId", + "testMatrixId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "testMatrixId": { + "description": "Test matrix that will be canceled.", + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "description": "Cloud project that owns the test.", + "type": "string", + "required": true, + "location": "path" + } + } + }, + "get": { + "description": "Check the status of a test matrix.\n\nMay return any of the following canonical error codes:\n\n- PERMISSION_DENIED - if the user is not authorized to read project\n- INVALID_ARGUMENT - if the request is malformed\n- NOT_FOUND - if the Test Matrix does not exist", + "response": { + "$ref": "TestMatrix" + }, + "parameterOrder": [ + "projectId", + "testMatrixId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "projectId": { + "description": "Cloud project that owns the test matrix.", + "type": "string", + "required": true, + "location": "path" + }, + "testMatrixId": { + "location": "path", + "description": "Unique test matrix id which was assigned by the service.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/projects/{projectId}/testMatrices/{testMatrixId}", + "id": "testing.projects.testMatrices.get", + "path": "v1/projects/{projectId}/testMatrices/{testMatrixId}" + }, + "create": { + "request": { + "$ref": "TestMatrix" + }, + "description": "Request to run a matrix of tests according to the given specifications.\nUnsupported environments will be returned in the state UNSUPPORTED.\nMatrices are limited to at most 200 supported executions.\n\nMay return any of the following canonical error codes:\n\n- PERMISSION_DENIED - if the user is not authorized to write to project\n- INVALID_ARGUMENT - if the request is malformed or if the matrix expands\n to more than 200 supported executions", + "response": { + "$ref": "TestMatrix" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The GCE project under which this job will run.", + "type": "string", + "required": true, + "location": "path" + }, + "requestId": { + "description": "A string id used to detect duplicated requests.\nIds are automatically scoped to a project, so\nusers should ensure the ID is unique per-project.\nA UUID is recommended.\n\nOptional, but strongly recommended.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectId}/testMatrices", + "id": "testing.projects.testMatrices.create", + "path": "v1/projects/{projectId}/testMatrices" + } + } + } + } + }, + "testEnvironmentCatalog": { + "methods": { + "get": { + "flatPath": "v1/testEnvironmentCatalog/{environmentType}", + "id": "testing.testEnvironmentCatalog.get", + "path": "v1/testEnvironmentCatalog/{environmentType}", + "description": "Get the catalog of supported test environments.\n\nMay return any of the following canonical error codes:\n\n- INVALID_ARGUMENT - if the request is malformed\n- NOT_FOUND - if the environment type does not exist\n- INTERNAL - if an internal error occurred", + "response": { + "$ref": "TestEnvironmentCatalog" + }, + "parameterOrder": [ + "environmentType" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "projectId": { + "description": "For authorization, the cloud project requesting the TestEnvironmentCatalog.\nOptional", + "type": "string", + "location": "query" + }, + "environmentType": { + "enum": [ + "ENVIRONMENT_TYPE_UNSPECIFIED", + "ANDROID", + "NETWORK_CONFIGURATION" + ], + "description": "The type of environment that should be listed.\nRequired", + "type": "string", + "required": true, + "location": "path" + } + } + } + } + } + }, + "parameters": { + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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", + "description": "Data format for response.", + "default": "json" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + } + }, + "schemas": { + "AndroidDeviceCatalog": { + "description": "The currently supported Android devices.", + "type": "object", + "properties": { + "runtimeConfiguration": { + "description": "The set of supported runtime configurations.\n@OutputOnly", + "$ref": "AndroidRuntimeConfiguration" + }, + "versions": { + "description": "The set of supported Android OS versions.\n@OutputOnly", + "items": { + "$ref": "AndroidVersion" + }, + "type": "array" + }, + "models": { + "description": "The set of supported Android device models.\n@OutputOnly", + "items": { + "$ref": "AndroidModel" + }, + "type": "array" + } + }, + "id": "AndroidDeviceCatalog" + }, + "GoogleAuto": { + "description": "Enables automatic Google account login.\nIf set, the service will automatically generate a Google test account and add\nit to the device, before executing the test. Note that test accounts might be\nreused.\nMany applications show their full set of functionalities when an account is\npresent on the device. Logging into the device with these generated accounts\nallows testing more functionalities.", + "type": "object", + "properties": {}, + "id": "GoogleAuto" + }, + "AndroidDeviceList": { + "description": "A list of Android device configurations in which the test is to be executed.", + "type": "object", + "properties": { + "androidDevices": { + "description": "A list of Android devices\nRequired", + "items": { + "$ref": "AndroidDevice" + }, + "type": "array" + } + }, + "id": "AndroidDeviceList" + }, + "ClientInfo": { + "description": "Information about the client which invoked the test.", + "type": "object", + "properties": { + "clientInfoDetails": { + "description": "The list of detailed information about client.", + "items": { + "$ref": "ClientInfoDetail" + }, + "type": "array" + }, + "name": { + "description": "Client name, such as gcloud.\nRequired", + "type": "string" + } + }, + "id": "ClientInfo" + }, + "EnvironmentMatrix": { + "description": "The matrix of environments in which the test is to be executed.", + "type": "object", + "properties": { + "androidDeviceList": { + "$ref": "AndroidDeviceList", + "description": "A list of Android devices; the test will be run only on the specified\ndevices." + }, + "androidMatrix": { + "description": "A matrix of Android devices.", + "$ref": "AndroidMatrix" + } + }, + "id": "EnvironmentMatrix" + }, + "CancelTestMatrixResponse": { + "description": "Response containing the current state of the specified test matrix.", + "type": "object", + "properties": { + "testState": { + "enumDescriptions": [ + "Do not use. For proto versioning only.", + "The execution or matrix is being validated.", + "The execution or matrix is waiting for resources to become available.", + "The execution is currently being processed.\n\nCan only be set on an execution.", + "The execution or matrix has terminated normally.\n\nOn a matrix this means that the matrix level processing completed normally,\nbut individual executions may be in an ERROR state.", + "The execution or matrix has stopped because it encountered an\ninfrastructure failure.", + "The execution was not run because it corresponds to a unsupported\nenvironment.\n\nCan only be set on an execution.", + "The execution was not run because the provided inputs are incompatible with\nthe requested environment.\n\nExample: requested AndroidVersion is lower than APK's minSdkVersion\n\nCan only be set on an execution.", + "The execution was not run because the provided inputs are incompatible with\nthe requested architecture.\n\nExample: requested device does not support running the native code in\nthe supplied APK\n\nCan only be set on an execution.", + "The user cancelled the execution.\n\nCan only be set on an execution.", + "The execution or matrix was not run because the provided inputs are not\nvalid.\n\nExamples: input file is not of the expected type, is malformed/corrupt, or\nwas flagged as malware" + ], + "enum": [ + "TEST_STATE_UNSPECIFIED", + "VALIDATING", + "PENDING", + "RUNNING", + "FINISHED", + "ERROR", + "UNSUPPORTED_ENVIRONMENT", + "INCOMPATIBLE_ENVIRONMENT", + "INCOMPATIBLE_ARCHITECTURE", + "CANCELLED", + "INVALID" + ], + "description": "The current rolled-up state of the test matrix.\nIf this state is already final, then the cancelation request will\nhave no effect.", + "type": "string" + } + }, + "id": "CancelTestMatrixResponse" + }, + "Date": { + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and\ntime zone are either specified elsewhere or are not significant. The date\nis relative to the Proleptic Gregorian Calendar. The day may be 0 to\nrepresent a year and month where the day is not significant, e.g. credit card\nexpiration date. The year may be 0 to represent a month and day independent\nof year, e.g. anniversary date. Related types are google.type.TimeOfDay\nand `google.protobuf.Timestamp`.", + "type": "object", + "properties": { + "month": { + "format": "int32", + "description": "Month of year. Must be from 1 to 12.", + "type": "integer" + }, + "day": { + "format": "int32", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0\nif specifying a year/month where the day is not significant.", + "type": "integer" + }, + "year": { + "format": "int32", + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", + "type": "integer" + } + }, + "id": "Date" + }, + "Account": { + "description": "Identifies an account and how to log into it", + "type": "object", + "properties": { + "googleAuto": { + "description": "An automatic google login account", + "$ref": "GoogleAuto" + } + }, + "id": "Account" + }, + "TestEnvironmentCatalog": { + "description": "A description of a test environment.", + "type": "object", + "properties": { + "androidDeviceCatalog": { + "$ref": "AndroidDeviceCatalog", + "description": "Android devices suitable for running Android Instrumentation Tests." + }, + "networkConfigurationCatalog": { + "$ref": "NetworkConfigurationCatalog", + "description": "Supported network configurations" + } + }, + "id": "TestEnvironmentCatalog" + }, + "Locale": { + "description": "A location/region designation for language.", + "type": "object", + "properties": { + "tags": { + "description": "Tags for this dimension.\nExamples: \"default\"", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "The id for this locale.\nExample: \"en_US\"\n@OutputOnly", + "type": "string" + }, + "region": { + "description": "A human-friendy string representing the region for this locale.\nExample: \"United States\"\nNot present for every locale.\n@OutputOnly", + "type": "string" + }, + "name": { + "description": "A human-friendly name for this language/locale.\nExample: \"English\"\n@OutputOnly", + "type": "string" + } + }, + "id": "Locale" + }, + "ObbFile": { + "description": "An opaque binary blob file to install on the device before the test starts", + "type": "object", + "properties": { + "obb": { + "description": "Opaque Binary Blob (OBB) file(s) to install on the device\nRequired", + "$ref": "FileReference" + }, + "obbFileName": { + "description": "OBB file name which must conform to the format as specified by\nAndroid\ne.g. [main|patch].0300110.com.example.android.obb\nwhich will be installed into\n \u003cshared-storage\u003e/Android/obb/\u003cpackage-name\u003e/\non the device\nRequired", + "type": "string" + } + }, + "id": "ObbFile" + }, + "AndroidRuntimeConfiguration": { + "description": "Configuration that can be selected at the time a test is run.", + "type": "object", + "properties": { + "orientations": { + "description": "The set of available orientations.\n@OutputOnly", + "items": { + "$ref": "Orientation" + }, + "type": "array" + }, + "locales": { + "description": "The set of available locales.\n@OutputOnly", + "items": { + "$ref": "Locale" + }, + "type": "array" + } + }, + "id": "AndroidRuntimeConfiguration" + }, + "AndroidDevice": { + "description": "A single Android device.", + "type": "object", + "properties": { + "androidVersionId": { + "description": "The id of the Android OS version to be used.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "type": "string" + }, + "androidModelId": { + "description": "The id of the Android device to be used.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "type": "string" + }, + "orientation": { + "description": "How the device is oriented during the test.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "type": "string" + }, + "locale": { + "description": "The locale the test device used for testing.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "type": "string" + } + }, + "id": "AndroidDevice" + }, + "NetworkConfiguration": { + "type": "object", + "properties": { + "downRule": { + "description": "The emulation rule applying to the download traffic", + "$ref": "TrafficRule" + }, + "id": { + "description": "The unique opaque id for this network traffic configuration\n@OutputOnly", + "type": "string" + }, + "upRule": { + "$ref": "TrafficRule", + "description": "The emulation rule applying to the upload traffic" + } + }, + "id": "NetworkConfiguration" + }, + "ToolResultsStep": { + "description": "Represents a tool results step resource.\n\nThis has the results of a TestExecution.", + "type": "object", + "properties": { + "stepId": { + "description": "A tool results step ID.\n@OutputOnly", + "type": "string" + }, + "historyId": { + "description": "A tool results history ID.\n@OutputOnly", + "type": "string" + }, + "projectId": { + "description": "The cloud project that owns the tool results step.\n@OutputOnly", + "type": "string" + }, + "executionId": { + "description": "A tool results execution ID.\n@OutputOnly", + "type": "string" + } + }, + "id": "ToolResultsStep" + }, + "TrafficRule": { + "properties": { + "delay": { + "format": "google-duration", + "description": "Packet delay, must be \u003e= 0", + "type": "string" + }, + "packetLossRatio": { + "format": "float", + "description": "Packet loss ratio (0.0 - 1.0)", + "type": "number" + }, + "burst": { + "format": "float", + "description": "Burst size in kbits", + "type": "number" + }, + "bandwidth": { + "format": "float", + "description": "Bandwidth in kbits/second", + "type": "number" + }, + "packetDuplicationRatio": { + "format": "float", + "description": "Packet duplication ratio (0.0 - 1.0)", + "type": "number" + } + }, + "id": "TrafficRule", + "description": "Network emulation parameters", + "type": "object" + }, + "AndroidInstrumentationTest": { + "description": "A test of an Android application that can control an Android component\nindependently of its normal lifecycle.\nAndroid instrumentation tests run an application APK and test APK inside the\nsame process on a virtual or physical AndroidDevice. They also specify\na test runner class, such as com.google.GoogleTestRunner, which can vary\non the specific instrumentation framework chosen.\n\nSee \u003chttp://developer.android.com/tools/testing/testing_android.html\u003e for\nmore information on types of Android tests.", + "type": "object", + "properties": { + "testTargets": { + "description": "Each target must be fully qualified with the package name or class name,\nin one of these formats:\n - \"package package_name\"\n - \"class package_name.class_name\"\n - \"class package_name.class_name#method_name\"\n\nOptional, if empty, all targets in the module will be run.", + "items": { + "type": "string" + }, + "type": "array" + }, + "testApk": { + "$ref": "FileReference", + "description": "The APK containing the test code to be executed.\nRequired" + }, + "testRunnerClass": { + "description": "The InstrumentationTestRunner class.\nOptional, default is determined by examining the application's manifest.", + "type": "string" + }, + "testPackageId": { + "description": "The java package for the test to be executed.\nOptional, default is determined by examining the application's manifest.", + "type": "string" + }, + "appApk": { + "description": "The APK for the application under test.\nRequired", + "$ref": "FileReference" + }, + "appPackageId": { + "description": "The java package for the application under test.\nOptional, default is determined by examining the application's manifest.", + "type": "string" + }, + "orchestratorOption": { + "enumDescriptions": [ + "This means that the server should choose the mode. And test will be run\nwithout orchestrator.\nUsing orchestrator is highly encouraged because of all the benefits it\noffers. And in the future, all instrumentation tests will be run with\norchestrator by default if preference unspecified.", + "Run test using orchestrator.\n** Only compatible with AndroidJUnitRunner version 1.0 or higher! **\nRecommended.", + "Run test without using orchestrator." + ], + "enum": [ + "ORCHESTRATOR_OPTION_UNSPECIFIED", + "USE_ORCHESTRATOR", + "DO_NOT_USE_ORCHESTRATOR" + ], + "description": "The option of whether running each test within its own invocation of\ninstrumentation with Android Test Orchestrator or not.\n** Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or\nhigher! **\nOrchestrator offers the following benefits:\n - No shared state\n - Crashes are isolated\n - Logs are scoped per test\n\nSee\n\u003chttps://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator\u003e\nfor more information about Android Test Orchestrator.\n\nOptional, if empty, test will be run without orchestrator.", + "type": "string" + } + }, + "id": "AndroidInstrumentationTest" + }, + "DeviceFile": { + "description": "A single device file description.", + "type": "object", + "properties": { + "obbFile": { + "$ref": "ObbFile", + "description": "A reference to an opaque binary blob file" + } + }, + "id": "DeviceFile" + }, + "ClientInfoDetail": { + "description": "Key-value pair of detailed information about the client which invoked the\ntest. For example {'Version', '1.0'}, {'Release Track', 'BETA'}", + "type": "object", + "properties": { + "key": { + "description": "The key of detailed client information.\nRequired", + "type": "string" + }, + "value": { + "description": "The value of detailed client information.\nRequired", + "type": "string" + } + }, + "id": "ClientInfoDetail" + }, + "EnvironmentVariable": { + "description": "A key-value pair passed as an environment variable to the test", + "type": "object", + "properties": { + "value": { + "description": "Value for the environment variable", + "type": "string" + }, + "key": { + "description": "Key for the environment variable", + "type": "string" + } + }, + "id": "EnvironmentVariable" + }, + "Environment": { + "description": "The environment in which the test is run.", + "type": "object", + "properties": { + "androidDevice": { + "$ref": "AndroidDevice", + "description": "An Android device which must be used with an Android test." + } + }, + "id": "Environment" + }, + "TestExecution": { + "description": "Specifies a single test to be executed in a single environment.", + "type": "object", + "properties": { + "id": { + "description": "Unique id set by the backend.\n@OutputOnly", + "type": "string" + }, + "timestamp": { + "format": "google-datetime", + "description": "The time this test execution was initially created.\n@OutputOnly", + "type": "string" + }, + "testDetails": { + "$ref": "TestDetails", + "description": "Additional details about the running test.\n@OutputOnly" + }, + "matrixId": { + "description": "Id of the containing TestMatrix.\n@OutputOnly", + "type": "string" + }, + "environment": { + "description": "How the host machine(s) are configured.\n@OutputOnly", + "$ref": "Environment" + }, + "state": { + "description": "Indicates the current progress of the test execution (e.g., FINISHED).\n@OutputOnly", + "type": "string", + "enumDescriptions": [ + "Do not use. For proto versioning only.", + "The execution or matrix is being validated.", + "The execution or matrix is waiting for resources to become available.", + "The execution is currently being processed.\n\nCan only be set on an execution.", + "The execution or matrix has terminated normally.\n\nOn a matrix this means that the matrix level processing completed normally,\nbut individual executions may be in an ERROR state.", + "The execution or matrix has stopped because it encountered an\ninfrastructure failure.", + "The execution was not run because it corresponds to a unsupported\nenvironment.\n\nCan only be set on an execution.", + "The execution was not run because the provided inputs are incompatible with\nthe requested environment.\n\nExample: requested AndroidVersion is lower than APK's minSdkVersion\n\nCan only be set on an execution.", + "The execution was not run because the provided inputs are incompatible with\nthe requested architecture.\n\nExample: requested device does not support running the native code in\nthe supplied APK\n\nCan only be set on an execution.", + "The user cancelled the execution.\n\nCan only be set on an execution.", + "The execution or matrix was not run because the provided inputs are not\nvalid.\n\nExamples: input file is not of the expected type, is malformed/corrupt, or\nwas flagged as malware" + ], + "enum": [ + "TEST_STATE_UNSPECIFIED", + "VALIDATING", + "PENDING", + "RUNNING", + "FINISHED", + "ERROR", + "UNSUPPORTED_ENVIRONMENT", + "INCOMPATIBLE_ENVIRONMENT", + "INCOMPATIBLE_ARCHITECTURE", + "CANCELLED", + "INVALID" + ] + }, + "toolResultsStep": { + "description": "Where the results for this execution are written.\n@OutputOnly", + "$ref": "ToolResultsStep" + }, + "projectId": { + "description": "The cloud project that owns the test execution.\n@OutputOnly", + "type": "string" + }, + "testSpecification": { + "description": "How to run the test.\n@OutputOnly", + "$ref": "TestSpecification" + } + }, + "id": "TestExecution" + }, + "GoogleCloudStorage": { + "description": "A storage location within Google cloud storage (GCS).", + "type": "object", + "properties": { + "gcsPath": { + "description": "The path to a directory in GCS that will\neventually contain the results for this test.\nThe requesting user must have write access on the bucket in the supplied\npath.\nRequired", + "type": "string" + } + }, + "id": "GoogleCloudStorage" + }, + "RoboDirective": { + "description": "Directs Robo to interact with a specific UI element if it is encountered\nduring the crawl. Currently, Robo can perform text entry or element click.", + "type": "object", + "properties": { + "actionType": { + "enum": [ + "ACTION_TYPE_UNSPECIFIED", + "SINGLE_CLICK", + "ENTER_TEXT" + ], + "description": "The type of action that Robo should perform on the specified element.\nRequired.", + "type": "string", + "enumDescriptions": [ + "DO NOT USE. For proto versioning only.", + "Direct Robo to click on the specified element. No-op if specified element\nis not clickable.", + "Direct Robo to enter text on the specified element. No-op if specified\nelement is not enabled or does not allow text entry." + ] + }, + "inputText": { + "description": "The text that Robo is directed to set. If left empty, the directive will be\ntreated as a CLICK on the element matching the resource_name.\nOptional", + "type": "string" + }, + "resourceName": { + "description": "The android resource name of the target UI element\nFor example,\n in Java: R.string.foo\n in xml: @string/foo\nOnly the “foo” part is needed.\nReference doc:\nhttps://developer.android.com/guide/topics/resources/accessing-resources.html\nRequired", + "type": "string" + } + }, + "id": "RoboDirective" + }, + "AndroidMatrix": { + "description": "A set of Android device configuration permutations is defined by the\nthe cross-product of the given axes. Internally, the given AndroidMatrix\nwill be expanded into a set of AndroidDevices.\n\nOnly supported permutations will be instantiated. Invalid permutations\n(e.g., incompatible models/versions) are ignored.", + "type": "object", + "properties": { + "locales": { + "description": "The set of locales the test device will enable for testing.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "items": { + "type": "string" + }, + "type": "array" + }, + "androidVersionIds": { + "description": "The ids of the set of Android OS version to be used.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "items": { + "type": "string" + }, + "type": "array" + }, + "androidModelIds": { + "description": "The ids of the set of Android device to be used.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "items": { + "type": "string" + }, + "type": "array" + }, + "orientations": { + "description": "The set of orientations to test with.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "AndroidMatrix" + }, + "AndroidModel": { + "properties": { + "brand": { + "description": "The company that this device is branded with.\nExample: \"Google\", \"Samsung\"\n@OutputOnly", + "type": "string" + }, + "screenX": { + "format": "int32", + "description": "Screen size in the horizontal (X) dimension measured in pixels.\n@OutputOnly", + "type": "integer" + }, + "codename": { + "description": "The name of the industrial design.\nThis corresponds to android.os.Build.DEVICE\n@OutputOnly", + "type": "string" + }, + "screenY": { + "format": "int32", + "description": "Screen size in the vertical (Y) dimension measured in pixels.\n@OutputOnly", + "type": "integer" + }, + "form": { + "description": "Whether this device is virtual or physical.\n@OutputOnly", + "type": "string", + "enumDescriptions": [ + "Do not use. For proto versioning only.", + "A software stack that simulates the device", + "Actual hardware" + ], + "enum": [ + "DEVICE_FORM_UNSPECIFIED", + "VIRTUAL", + "PHYSICAL" + ] + }, + "screenDensity": { + "format": "int32", + "description": "Screen density in DPI.\nThis corresponds to ro.sf.lcd_density\n@OutputOnly", + "type": "integer" + }, + "supportedVersionIds": { + "description": "The set of Android versions this device supports.\n@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "supportedAbis": { + "description": "The list of supported ABIs for this device.\nThis corresponds to either android.os.Build.SUPPORTED_ABIS (for API level\n21 and above) or android.os.Build.CPU_ABI/CPU_ABI2.\nThe most preferred ABI is the first element in the list.\n\nElements are optionally prefixed by \"version_id:\" (where version_id is\nthe id of an AndroidVersion), denoting an ABI that is supported only on\na particular version.\n@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "The human-readable marketing name for this device model.\nExamples: \"Nexus 5\", \"Galaxy S5\"\n@OutputOnly", + "type": "string" + }, + "id": { + "description": "The unique opaque id for this model.\nUse this for invoking the TestExecutionService.\n@OutputOnly", + "type": "string" + }, + "tags": { + "description": "Tags for this dimension.\nExamples: \"default\", \"preview\", \"deprecated\"", + "items": { + "type": "string" + }, + "type": "array" + }, + "manufacturer": { + "description": "The manufacturer of this device.\n@OutputOnly", + "type": "string" + } + }, + "id": "AndroidModel", + "description": "A description of an Android device tests may be run on.", + "type": "object" + }, + "TestSetup": { + "description": "A description of how to set up the device prior to running the test", + "type": "object", + "properties": { + "account": { + "description": "The device will be logged in on this account for the duration of the test.\nOptional", + "$ref": "Account" + }, + "directoriesToPull": { + "description": "The directories on the device to upload to GCS at the end of the test;\nthey must be absolute, whitelisted paths.\nRefer to RegularFile for whitelisted paths.\nOptional", + "items": { + "type": "string" + }, + "type": "array" + }, + "filesToPush": { + "description": "Optional", + "items": { + "$ref": "DeviceFile" + }, + "type": "array" + }, + "networkProfile": { + "description": "The network traffic profile used for running the test.\nOptional", + "type": "string" + }, + "environmentVariables": { + "description": "Environment variables to set for the test (only applicable for\ninstrumentation tests).", + "items": { + "$ref": "EnvironmentVariable" + }, + "type": "array" + } + }, + "id": "TestSetup" + }, + "TestSpecification": { + "properties": { + "testTimeout": { + "format": "google-duration", + "description": "Max time a test execution is allowed to run before it is\nautomatically cancelled.\nOptional, default is 5 min.", + "type": "string" + }, + "autoGoogleLogin": { + "description": "Enables automatic Google account login.\nIf set, the service will automatically generate a Google test account and\nadd it to the device, before executing the test. Note that test accounts\nmight be reused.\nMany applications show their full set of functionalities when an account is\npresent on the device. Logging into the device with these generated\naccounts allows testing more functionalities.\nDefault is false.\nOptional", + "type": "boolean" + }, + "androidTestLoop": { + "$ref": "AndroidTestLoop", + "description": "An Android Application with a Test Loop" + }, + "androidRoboTest": { + "description": "An Android robo test.", + "$ref": "AndroidRoboTest" + }, + "testSetup": { + "description": "Test setup requirements e.g. files to install, bootstrap scripts\nOptional", + "$ref": "TestSetup" + }, + "androidInstrumentationTest": { + "description": "An Android instrumentation test.", + "$ref": "AndroidInstrumentationTest" + }, + "disablePerformanceMetrics": { + "description": "Disables performance metrics recording; may reduce test latency.", + "type": "boolean" + }, + "disableVideoRecording": { + "description": "Disables video recording; may reduce test latency.", + "type": "boolean" + } + }, + "id": "TestSpecification", + "description": "A description of how to run the test.", + "type": "object" + }, + "ResultStorage": { + "properties": { + "toolResultsExecution": { + "description": "The tool results execution that results are written to.\n@OutputOnly", + "$ref": "ToolResultsExecution" + }, + "toolResultsHistory": { + "description": "The tool results history that contains the tool results execution that\nresults are written to.\n\nOptional, if not provided the service will choose an appropriate value.", + "$ref": "ToolResultsHistory" + }, + "googleCloudStorage": { + "$ref": "GoogleCloudStorage", + "description": "Required." + } + }, + "id": "ResultStorage", + "description": "Locations where the results of running the test are stored.", + "type": "object" + }, + "TestMatrix": { + "description": "A group of one or more TestExecutions, built by taking a\nproduct of values over a pre-defined set of axes.", + "type": "object", + "properties": { + "environmentMatrix": { + "description": "How the host machine(s) are configured.\nRequired", + "$ref": "EnvironmentMatrix" + }, + "resultStorage": { + "description": "Where the results for the matrix are written.\nRequired", + "$ref": "ResultStorage" + }, + "testMatrixId": { + "description": "Unique id set by the service.\n@OutputOnly", + "type": "string" + }, + "invalidMatrixDetails": { + "enum": [ + "INVALID_MATRIX_DETAILS_UNSPECIFIED", + "DETAILS_UNAVAILABLE", + "MALFORMED_APK", + "MALFORMED_TEST_APK", + "NO_MANIFEST", + "NO_PACKAGE_NAME", + "TEST_SAME_AS_APP", + "NO_INSTRUMENTATION", + "NO_SIGNATURE", + "INSTRUMENTATION_ORCHESTRATOR_INCOMPATIBLE", + "NO_TEST_RUNNER_CLASS", + "NO_LAUNCHER_ACTIVITY", + "FORBIDDEN_PERMISSIONS", + "INVALID_ROBO_DIRECTIVES", + "TEST_LOOP_INTENT_FILTER_NOT_FOUND", + "SCENARIO_LABEL_NOT_DECLARED", + "SCENARIO_LABEL_MALFORMED", + "SCENARIO_NOT_DECLARED", + "DEVICE_ADMIN_RECEIVER", + "TEST_ONLY_APK" + ], + "description": "Describes why the matrix is considered invalid.\nOnly useful for matrices in the INVALID state.\n@OutputOnly", + "type": "string", + "enumDescriptions": [ + "Do not use. For proto versioning only.", + "The matrix is INVALID, but there are no further details available.", + "The input app APK could not be parsed.", + "The input test APK could not be parsed.", + "The AndroidManifest.xml could not be found.", + "The APK manifest does not declare a package name.", + "The test package and app package are the same.", + "The test apk does not declare an instrumentation.", + "The input app apk does not have a signature.", + "The test runner class specified by user or in the test APK's manifest file\nis not compatible with Android Test Orchestrator.\nOrchestrator is only compatible with AndroidJUnitRunner version 1.0 or\nhigher.\nOrchestrator can be disabled by using DO_NOT_USE_ORCHESTRATOR\nOrchestratorOption.", + "The test APK does not contain the test runner class specified by user or in\nthe manifest file.\nThis can be caused by either of the following reasons:\n- the user provided a runner class name that's incorrect, or\n- the test runner isn't built into the test APK (might be in the app APK\ninstead).", + "A main launcher activity could not be found.", + "The app declares one or more permissions that are not allowed.", + "There is a conflict in the provided robo_directives.", + "There there is no test loop intent filter, or the one that is given is\nnot formatted correctly.", + "The request contains a scenario label that was not declared in the\nmanifest.", + "There was an error when parsing a label's value.", + "The request contains a scenario number that was not declared in the\nmanifest.", + "Device administrator applications are not allowed.", + "The APK is marked as \"testOnly\"." + ] + }, + "state": { + "enumDescriptions": [ + "Do not use. For proto versioning only.", + "The execution or matrix is being validated.", + "The execution or matrix is waiting for resources to become available.", + "The execution is currently being processed.\n\nCan only be set on an execution.", + "The execution or matrix has terminated normally.\n\nOn a matrix this means that the matrix level processing completed normally,\nbut individual executions may be in an ERROR state.", + "The execution or matrix has stopped because it encountered an\ninfrastructure failure.", + "The execution was not run because it corresponds to a unsupported\nenvironment.\n\nCan only be set on an execution.", + "The execution was not run because the provided inputs are incompatible with\nthe requested environment.\n\nExample: requested AndroidVersion is lower than APK's minSdkVersion\n\nCan only be set on an execution.", + "The execution was not run because the provided inputs are incompatible with\nthe requested architecture.\n\nExample: requested device does not support running the native code in\nthe supplied APK\n\nCan only be set on an execution.", + "The user cancelled the execution.\n\nCan only be set on an execution.", + "The execution or matrix was not run because the provided inputs are not\nvalid.\n\nExamples: input file is not of the expected type, is malformed/corrupt, or\nwas flagged as malware" + ], + "enum": [ + "TEST_STATE_UNSPECIFIED", + "VALIDATING", + "PENDING", + "RUNNING", + "FINISHED", + "ERROR", + "UNSUPPORTED_ENVIRONMENT", + "INCOMPATIBLE_ENVIRONMENT", + "INCOMPATIBLE_ARCHITECTURE", + "CANCELLED", + "INVALID" + ], + "description": "Indicates the current progress of the test matrix (e.g., FINISHED)\n@OutputOnly", + "type": "string" + }, + "projectId": { + "description": "The cloud project that owns the test matrix.\n@OutputOnly", + "type": "string" + }, + "testSpecification": { + "description": "How to run the test.\nRequired", + "$ref": "TestSpecification" + }, + "clientInfo": { + "description": "Information about the client which invoked the test.\nOptional", + "$ref": "ClientInfo" + }, + "testExecutions": { + "description": "The list of test executions that the service creates for this matrix.\n@OutputOnly", + "items": { + "$ref": "TestExecution" + }, + "type": "array" + }, + "timestamp": { + "format": "google-datetime", + "description": "The time this test matrix was initially created.\n@OutputOnly", + "type": "string" + } + }, + "id": "TestMatrix" + }, + "AndroidVersion": { + "description": "A version of the Android OS", + "type": "object", + "properties": { + "releaseDate": { + "$ref": "Date", + "description": "The date this Android version became available in the market.\n@OutputOnly" + }, + "id": { + "description": "An opaque id for this Android version.\nUse this id to invoke the TestExecutionService.\n@OutputOnly", + "type": "string" + }, + "tags": { + "description": "Tags for this dimension.\nExamples: \"default\", \"preview\", \"deprecated\"", + "items": { + "type": "string" + }, + "type": "array" + }, + "versionString": { + "description": "A string representing this version of the Android OS.\nExamples: \"4.3\", \"4.4\"\n@OutputOnly", + "type": "string" + }, + "codeName": { + "description": "The code name for this Android version.\nExamples: \"JellyBean\", \"KitKat\"\n@OutputOnly", + "type": "string" + }, + "apiLevel": { + "format": "int32", + "description": "The API level for this Android version.\nExamples: 18, 19\n@OutputOnly", + "type": "integer" + }, + "distribution": { + "$ref": "Distribution", + "description": "Market share for this version.\n@OutputOnly" + } + }, + "id": "AndroidVersion" + }, + "FileReference": { + "description": "A reference to a file, used for user inputs.", + "type": "object", + "properties": { + "gcsPath": { + "description": "A path to a file in Google Cloud Storage.\nExample: gs://build-app-1414623860166/app-debug-unaligned.apk", + "type": "string" + } + }, + "id": "FileReference" + }, + "TestDetails": { + "description": "Additional details about the progress of the running test.", + "type": "object", + "properties": { + "errorMessage": { + "description": "If the TestState is ERROR, then this string will contain human-readable\ndetails about the error.\n@OutputOnly", + "type": "string" + }, + "progressMessages": { + "description": "Human-readable, detailed descriptions of the test's progress.\nFor example: \"Provisioning a device\", \"Starting Test\".\n\nDuring the course of execution new data may be appended\nto the end of progress_messages.\n@OutputOnly", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "TestDetails" + }, + "ToolResultsExecution": { + "description": "Represents a tool results execution resource.\n\nThis has the results of a TestMatrix.", + "type": "object", + "properties": { + "historyId": { + "description": "A tool results history ID.\n@OutputOnly", + "type": "string" + }, + "projectId": { + "description": "The cloud project that owns the tool results execution.\n@OutputOnly", + "type": "string" + }, + "executionId": { + "description": "A tool results execution ID.\n@OutputOnly", + "type": "string" + } + }, + "id": "ToolResultsExecution" + }, + "Distribution": { + "description": "Data about the relative number of devices running a\ngiven configuration of the Android platform.", + "type": "object", + "properties": { + "marketShare": { + "format": "double", + "description": "The estimated fraction (0-1) of the total market with this configuration.\n@OutputOnly", + "type": "number" + }, + "measurementTime": { + "format": "google-datetime", + "description": "The time this distribution was measured.\n@OutputOnly", + "type": "string" + } + }, + "id": "Distribution" + }, + "AndroidRoboTest": { + "description": "A test of an android application that explores the application on a virtual\nor physical Android Device, finding culprits and crashes as it goes.", + "type": "object", + "properties": { + "maxDepth": { + "format": "int32", + "description": "The max depth of the traversal stack Robo can explore. Needs to be at least\n2 to make Robo explore the app beyond the first activity.\nDefault is 50.\nOptional", + "type": "integer" + }, + "appApk": { + "$ref": "FileReference", + "description": "The APK for the application under test.\nRequired" + }, + "appPackageId": { + "description": "The java package for the application under test.\nOptional, default is determined by examining the application's manifest.", + "type": "string" + }, + "appInitialActivity": { + "description": "The initial activity that should be used to start the app.\nOptional", + "type": "string" + }, + "maxSteps": { + "format": "int32", + "description": "The max number of steps Robo can execute.\nDefault is no limit.\nOptional", + "type": "integer" + }, + "roboDirectives": { + "description": "A set of directives Robo should apply during the crawl.\nThis allows users to customize the crawl. For example, the username and\npassword for a test account can be provided.\nOptional", + "items": { + "$ref": "RoboDirective" + }, + "type": "array" + } + }, + "id": "AndroidRoboTest" + }, + "ToolResultsHistory": { + "description": "Represents a tool results history resource.", + "type": "object", + "properties": { + "historyId": { + "description": "A tool results history ID.\nRequired", + "type": "string" + }, + "projectId": { + "description": "The cloud project that owns the tool results history.\nRequired", + "type": "string" + } + }, + "id": "ToolResultsHistory" + }, + "Orientation": { + "description": "Screen orientation of the device.", + "type": "object", + "properties": { + "tags": { + "description": "Tags for this dimension.\nExamples: \"default\"", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "The id for this orientation.\nExample: \"portrait\"\n@OutputOnly", + "type": "string" + }, + "name": { + "description": "A human-friendly name for this orientation.\nExample: \"portrait\"\n@OutputOnly", + "type": "string" + } + }, + "id": "Orientation" + }, + "AndroidTestLoop": { + "properties": { + "appPackageId": { + "description": "The java package for the application under test.\nOptional, default is determined by examining the application's manifest.", + "type": "string" + }, + "appApk": { + "description": "The APK for the application under test.\nRequired", + "$ref": "FileReference" + }, + "scenarioLabels": { + "description": "The list of scenario labels that should be run during the test.\nThe scenario labels should map to labels defined in the application's\nmanifest. For example, player_experience and\ncom.google.test.loops.player_experience add all of the loops labeled in the\nmanifest with the com.google.test.loops.player_experience name to the\nexecution.\nOptional. Scenarios can also be specified in the scenarios field.", + "items": { + "type": "string" + }, + "type": "array" + }, + "scenarios": { + "description": "The list of scenarios that should be run during the test.\nOptional, default is all test loops, derived from the application's\nmanifest.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + } + }, + "id": "AndroidTestLoop", + "description": "A test of an Android Application with a Test Loop.\nThe intent \u003cintent-name\u003e will be implicitly added, since Games is the only\nuser of this api, for the time being.", + "type": "object" + }, + "NetworkConfigurationCatalog": { + "type": "object", + "properties": { + "configurations": { + "items": { + "$ref": "NetworkConfiguration" + }, + "type": "array" + } + }, + "id": "NetworkConfigurationCatalog" + } + }, + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "protocol": "rest", + "version": "v1", + "baseUrl": "https://testing.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "servicePath": "", + "description": "Allows developers to run automated tests for their mobile applications on Google infrastructure.", + "kind": "discovery#restDescription", + "rootUrl": "https://testing.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "testing", + "batchPath": "batch", + "revision": "20170922", + "documentationLink": "https://developers.google.com/cloud-test-lab/", + "id": "testing:v1", + "title": "Google Cloud Testing API" +} diff --git a/etc/api/toolresults/v1beta3/toolresults-api.json b/etc/api/toolresults/v1beta3/toolresults-api.json index a46cd608e1..f4160d5062 100644 --- a/etc/api/toolresults/v1beta3/toolresults-api.json +++ b/etc/api/toolresults/v1beta3/toolresults-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/NluUu220nJwrFOBpPn0huE2Wpig\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/LjX4DQyEaiPzYt4A5I3k4P7otfY\"", "discoveryVersion": "v1", "id": "toolresults:v1beta3", "name": "toolresults", "canonicalName": "Tool Results", "version": "v1beta3", - "revision": "20170519", + "revision": "20170926", "title": "Cloud Tool Results API", "description": "Reads and publishes results from Firebase Test Lab.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/toolresults/v1beta3/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "toolresults/v1beta3/projects/", - "batchPath": "batch", + "batchPath": "batch/toolresults/v1beta3", "parameters": { "alt": { "type": "string", @@ -77,6 +77,107 @@ } }, "schemas": { + "AndroidAppInfo": { + "id": "AndroidAppInfo", + "type": "object", + "description": "Android app information.", + "properties": { + "name": { + "type": "string", + "description": "The name of the app. Optional" + }, + "packageName": { + "type": "string", + "description": "The package name of the app. Required." + }, + "versionCode": { + "type": "string", + "description": "The internal version code of the app. Optional." + }, + "versionName": { + "type": "string", + "description": "The version name of the app. Optional." + } + } + }, + "AndroidInstrumentationTest": { + "id": "AndroidInstrumentationTest", + "type": "object", + "description": "A test of an Android application that can control an Android component independently of its normal lifecycle.\n\nSee for more information on types of Android tests.", + "properties": { + "testPackageId": { + "type": "string", + "description": "The java package for the test to be executed. Required" + }, + "testRunnerClass": { + "type": "string", + "description": "The InstrumentationTestRunner class. Required" + }, + "testTargets": { + "type": "array", + "description": "Each target must be fully qualified with the package name or class name, in one of these formats: - \"package package_name\" - \"class package_name.class_name\" - \"class package_name.class_name#method_name\"\n\nIf empty, all targets in the module will be run.", + "items": { + "type": "string" + } + }, + "useOrchestrator": { + "type": "boolean", + "description": "The flag indicates whether Android Test Orchestrator will be used to run test or not. Test orchestrator is used if either: - orchestrator_option field is USE_ORCHESTRATOR, and test runner is compatible with orchestrator. Or - orchestrator_option field is unspecified or ORCHESTRATOR_OPTION_UNSPECIFIED, and test runner is compatible with orchestrator." + } + } + }, + "AndroidRoboTest": { + "id": "AndroidRoboTest", + "type": "object", + "description": "A test of an android application that explores the application on a virtual or physical Android device, finding culprits and crashes as it goes.", + "properties": { + "appInitialActivity": { + "type": "string", + "description": "The initial activity that should be used to start the app. Optional" + }, + "bootstrapPackageId": { + "type": "string", + "description": "The java package for the bootstrap. Optional" + }, + "bootstrapRunnerClass": { + "type": "string", + "description": "The runner class for the bootstrap. Optional" + }, + "maxDepth": { + "type": "integer", + "description": "The max depth of the traversal stack Robo can explore. Optional", + "format": "int32" + }, + "maxSteps": { + "type": "integer", + "description": "The max number of steps/actions Robo can execute. Default is no limit (0). Optional", + "format": "int32" + } + } + }, + "AndroidTest": { + "id": "AndroidTest", + "type": "object", + "description": "An Android mobile test specification.", + "properties": { + "androidAppInfo": { + "$ref": "AndroidAppInfo", + "description": "Infomation about the application under test." + }, + "androidInstrumentationTest": { + "$ref": "AndroidInstrumentationTest", + "description": "An Android instrumentation test." + }, + "androidRoboTest": { + "$ref": "AndroidRoboTest", + "description": "An Android robo test." + }, + "testTimeout": { + "$ref": "Duration", + "description": "Max time a test is allowed to run before it is automatically cancelled." + } + } + }, "Any": { "id": "Any", "type": "object", @@ -93,6 +194,20 @@ } } }, + "AppStartTime": { + "id": "AppStartTime", + "type": "object", + "properties": { + "fullyDrawnTime": { + "$ref": "Duration", + "description": "Optional. The time from app start to reaching the developer-reported \"fully drawn\" time. This is only stored if the app includes a call to Activity.reportFullyDrawn(). See https://developer.android.com/topic/performance/launch-time.html#time-full" + }, + "initialDisplayTime": { + "$ref": "Duration", + "description": "The time from app start to the first displayed activity being drawn, as reported in Logcat. See https://developer.android.com/topic/performance/launch-time.html#time-initial" + } + } + }, "BasicPerfSampleSeries": { "id": "BasicPerfSampleSeries", "type": "object", @@ -118,6 +233,7 @@ "perfUnit": { "type": "string", "enum": [ + "byte", "bytesPerSecond", "framesPerSecond", "kibibyte", @@ -129,6 +245,7 @@ "", "", "", + "", "" ] }, @@ -251,6 +368,10 @@ "$ref": "Outcome", "description": "Classify the result, for example into SUCCESS or FAILURE\n\n- In response: present if set by create/update request - In create/update request: optional" }, + "specification": { + "$ref": "Specification", + "description": "Lightweight information about execution request.\n\n- In response: present if set by create - In create: optional - In update: optional" + }, "state": { "type": "string", "description": "The initial state is IN_PROGRESS.\n\nThe only legal state transitions is from IN_PROGRESS to COMPLETE.\n\nA PRECONDITION_FAILED will be returned if an invalid transition is requested.\n\nThe state can only be set to COMPLETE once. A FAILED_PRECONDITION will be returned if the state is set to COMPLETE multiple times.\n\nIf the state is set to COMPLETE, all the in-progress steps within the execution will be set as COMPLETE. If the outcome of the step is not set, the outcome will be set to INCONCLUSIVE.\n\n- In response always set - In create/update request: optional", @@ -269,7 +390,7 @@ }, "testExecutionMatrixId": { "type": "string", - "description": "TestExecution Matrix ID that the Test Service uses.\n\n- In response: present if set by create - In create: optional - In update: never set" + "description": "TestExecution Matrix ID that the TestExecutionService uses.\n\n- In response: present if set by create - In create: optional - In update: never set" } } }, @@ -279,7 +400,7 @@ "properties": { "crashed": { "type": "boolean", - "description": "If the failure was severe because the system under test crashed." + "description": "If the failure was severe because the system (app) under test crashed." }, "notInstalled": { "type": "boolean", @@ -287,7 +408,7 @@ }, "otherNativeCrash": { "type": "boolean", - "description": "If a native process other than the app crashed." + "description": "If a native process (including any other than the app) crashed." }, "timedOut": { "type": "boolean", @@ -430,6 +551,19 @@ } } }, + "ListScreenshotClustersResponse": { + "id": "ListScreenshotClustersResponse", + "type": "object", + "properties": { + "clusters": { + "type": "array", + "description": "The set of clustres associated with an execution Always set", + "items": { + "$ref": "ScreenshotCluster" + } + } + } + }, "ListStepThumbnailsResponse": { "id": "ListStepThumbnailsResponse", "type": "object", @@ -543,6 +677,9 @@ "type": "object", "description": "A summary of perf metrics collected and performance environment info", "properties": { + "appStartTime": { + "$ref": "AppStartTime" + }, "executionId": { "type": "string", "description": "A tool results execution ID." @@ -662,6 +799,53 @@ } } }, + "Screen": { + "id": "Screen", + "type": "object", + "properties": { + "fileReference": { + "type": "string", + "description": "File reference of the png file. Required." + }, + "locale": { + "type": "string", + "description": "Locale of the device that the screenshot was taken on. Required." + }, + "model": { + "type": "string", + "description": "Model of the device that the screenshot was taken on. Required." + }, + "version": { + "type": "string", + "description": "OS version of the device that the screenshot was taken on. Required." + } + } + }, + "ScreenshotCluster": { + "id": "ScreenshotCluster", + "type": "object", + "properties": { + "activity": { + "type": "string", + "description": "A string that describes the activity of every screen in the cluster." + }, + "clusterId": { + "type": "string", + "description": "A unique identifier for the cluster." + }, + "keyScreen": { + "$ref": "Screen", + "description": "A singular screen that represents the cluster as a whole. This screen will act as the \"cover\" of the entire cluster. When users look at the clusters, only the key screen from each cluster will be shown. Which screen is the key screen is determined by the ClusteringAlgorithm" + }, + "screens": { + "type": "array", + "description": "Full list of screens.", + "items": { + "$ref": "Screen" + } + } + } + }, "SkippedDetail": { "id": "SkippedDetail", "type": "object", @@ -680,14 +864,33 @@ } } }, + "Specification": { + "id": "Specification", + "type": "object", + "description": "The details about how to run the execution.", + "properties": { + "androidTest": { + "$ref": "AndroidTest", + "description": "An Android mobile test execution specification." + } + } + }, "StackTrace": { "id": "StackTrace", "type": "object", "description": "A stacktrace.", "properties": { + "clusterId": { + "type": "string", + "description": "Exception cluster ID" + }, "exception": { "type": "string", "description": "The stack trace message.\n\nRequired" + }, + "reportId": { + "type": "string", + "description": "Exception report ID" } } }, @@ -703,7 +906,7 @@ }, "details": { "type": "array", - "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", "items": { "$ref": "Any" } @@ -880,15 +1083,51 @@ "TestIssue": { "id": "TestIssue", "type": "object", - "description": "An abnormal event observed during the test execution.", + "description": "An issue detected occurring during a test execution.", "properties": { "errorMessage": { "type": "string", - "description": "A brief human-readable message describing the abnormal event.\n\nRequired." + "description": "A brief human-readable message describing the issue. Required." + }, + "severity": { + "type": "string", + "description": "Severity of issue. Required.", + "enum": [ + "info", + "severe", + "unspecifiedSeverity", + "warning" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] }, "stackTrace": { "$ref": "StackTrace", - "description": "Optional." + "description": "Deprecated in favor of stack trace fields inside specific warnings." + }, + "type": { + "type": "string", + "description": "Type of issue. Required.", + "enum": [ + "anr", + "fatalException", + "nativeCrash", + "unspecifiedType" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "warning": { + "$ref": "Any", + "description": "Warning message with additional details of the issue. Should always be a message from com.google.devtools.toolresults.v1.warnings Required." } } }, @@ -1376,6 +1615,85 @@ } }, "resources": { + "clusters": { + "methods": { + "get": { + "id": "toolresults.projects.histories.executions.clusters.get", + "path": "{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId}", + "httpMethod": "GET", + "description": "Retrieves a single screenshot cluster by its ID", + "parameters": { + "clusterId": { + "type": "string", + "description": "A Cluster id\n\nRequired.", + "required": true, + "location": "path" + }, + "executionId": { + "type": "string", + "description": "An Execution id.\n\nRequired.", + "required": true, + "location": "path" + }, + "historyId": { + "type": "string", + "description": "A History id.\n\nRequired.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "A Project id.\n\nRequired.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "historyId", + "executionId", + "clusterId" + ], + "response": { + "$ref": "ScreenshotCluster" + } + }, + "list": { + "id": "toolresults.projects.histories.executions.clusters.list", + "path": "{projectId}/histories/{historyId}/executions/{executionId}/clusters", + "httpMethod": "GET", + "description": "Lists Screenshot Clusters\n\nReturns the list of screenshot clusters corresponding to an execution. Screenshot clusters are created after the execution is finished. Clusters are created from a set of screenshots. Between any two screenshots, a matching score is calculated based off their metadata that determines how similar they are. Screenshots are placed in the cluster that has screens which have the highest matching scores.", + "parameters": { + "executionId": { + "type": "string", + "description": "An Execution id.\n\nRequired.", + "required": true, + "location": "path" + }, + "historyId": { + "type": "string", + "description": "A History id.\n\nRequired.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "A Project id.\n\nRequired.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "historyId", + "executionId" + ], + "response": { + "$ref": "ListScreenshotClustersResponse" + } + } + } + }, "steps": { "methods": { "create": { @@ -1666,7 +1984,7 @@ "id": "toolresults.projects.histories.executions.steps.perfMetricsSummary.create", "path": "{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary", "httpMethod": "POST", - "description": "Creates a PerfMetricsSummary resource.\n\nMay return any of the following error code(s): - ALREADY_EXISTS - A PerfMetricSummary already exists for the given Step - NOT_FOUND - The containing Step does not exist", + "description": "Creates a PerfMetricsSummary resource. Returns the existing one if it has already been created.\n\nMay return any of the following error code(s): - NOT_FOUND - The containing Step does not exist", "parameters": { "executionId": { "type": "string", diff --git a/etc/api/translate/v2/crates/1.0.6-api+20170525 b/etc/api/translate/v2/crates/1.0.6-api+20170525 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/translate/v2/translate-api.json b/etc/api/translate/v2/translate-api.json index 4b4d2be974..74c5863688 100644 --- a/etc/api/translate/v2/translate-api.json +++ b/etc/api/translate/v2/translate-api.json @@ -1,267 +1,440 @@ { - "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/6s__cFeA5l1i01rONlu3TmUQEHs\"", - "discoveryVersion": "v1", - "id": "translate:v2", - "name": "translate", - "version": "v2", - "revision": "20160627", - "title": "Translate API", - "description": "Translates text from one language to another.", - "ownerDomain": "google.com", - "ownerName": "Google", - "icons": { - "x16": "https://www.google.com/images/icons/product/translate-16.png", - "x32": "https://www.google.com/images/icons/product/translate-32.png" - }, - "documentationLink": "https://developers.google.com/translate/v2/using_rest", - "protocol": "rest", - "baseUrl": "https://www.googleapis.com/language/translate/", - "basePath": "/language/translate/", - "rootUrl": "https://www.googleapis.com/", - "servicePath": "language/translate/", - "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" + "discoveryVersion": "v1", + "schemas": { + "LanguagesResource": { + "type": "object", + "properties": { + "name": { + "description": "Human readable name of the language localized to the target language.", + "type": "string" + }, + "language": { + "description": "Supported language code, generally consisting of its ISO 639-1\nidentifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 codes including\nlanguage + region identifiers are returned (e.g. 'zh-TW' and 'zh-CH')", + "type": "string" + } + }, + "id": "LanguagesResource" + }, + "DetectionsListResponse": { + "properties": { + "detections": { + "description": "A detections contains detection results of several text", + "items": { + "$ref": "DetectionsResource" + }, + "type": "array" + } + }, + "id": "DetectionsListResponse", + "type": "object" + }, + "GetSupportedLanguagesRequest": { + "description": "The request message for discovering supported languages.", + "type": "object", + "properties": { + "target": { + "description": "The language to use to return localized, human readable names of supported\nlanguages.", + "type": "string" + } + }, + "id": "GetSupportedLanguagesRequest" + }, + "LanguagesListResponse": { + "properties": { + "languages": { + "description": "List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.", + "items": { + "$ref": "LanguagesResource" + }, + "type": "array" + } + }, + "id": "LanguagesListResponse", + "type": "object" + }, + "TranslationsResource": { + "properties": { + "detectedSourceLanguage": { + "description": "The source language of the initial request, detected automatically, if\nno source language was passed within the initial request. If the\nsource language was passed, auto-detection of the language will not\noccur and this field will be empty.", + "type": "string" + }, + "model": { + "description": "The `model` type used for this translation. Valid values are\nlisted in public documentation. Can be different from requested `model`.\nPresent only if specific model type was explicitly requested.", + "type": "string" + }, + "translatedText": { + "description": "Text translated into the target language.", + "type": "string" + } + }, + "id": "TranslationsResource", + "type": "object" + }, + "DetectionsResource": { + "description": "An array of languages which we detect for the given text The most likely language list first.", + "items": { + "type": "object", + "properties": { + "confidence": { + "format": "float", + "description": "The confidence of the detection result of this language.", + "type": "number" + }, + "language": { + "description": "The language we detected.", + "type": "string" + }, + "isReliable": { + "description": "A boolean to indicate is the language detection result reliable.", + "type": "boolean" + } + } + }, + "type": "array", + "id": "DetectionsResource" + }, + "TranslationsListResponse": { + "properties": { + "translations": { + "description": "Translations contains list of translation results of given text", + "items": { + "$ref": "TranslationsResource" + }, + "type": "array" + } + }, + "id": "TranslationsListResponse", + "description": "The main language translation response message.", + "type": "object" + }, + "TranslateTextRequest": { + "description": "The main translation request message for the Cloud Translation API.", + "type": "object", + "properties": { + "model": { + "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation.", + "type": "string" + }, + "target": { + "description": "The language to use for translation of the input text, set to one of the\nlanguage codes listed in Language Support.", + "type": "string" + }, + "format": { + "description": "The format of the source text, in either HTML (default) or plain-text. A\nvalue of \"html\" indicates HTML and a value of \"text\" indicates plain-text.", + "type": "string" + }, + "q": { + "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "source": { + "description": "The language of the source text, set to one of the language codes listed in\nLanguage Support. If the source language is not specified, the API will\nattempt to identify the source language automatically and return it within\nthe response.", + "type": "string" + } + }, + "id": "TranslateTextRequest" + }, + "DetectLanguageRequest": { + "properties": { + "q": { + "description": "The input text upon which to perform language detection. Repeat this\nparameter to perform language detection on multiple text inputs.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "id": "DetectLanguageRequest", + "description": "The request message for language detection.", + "type": "object" + } }, - "fields": { - "type": "string", - "description": "Selector specifying which fields to include in a partial response.", - "location": "query" + "icons": { + "x16": "https://www.google.com/images/icons/product/translate-16.png", + "x32": "https://www.google.com/images/icons/product/translate-32.png" }, - "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" + "protocol": "rest", + "canonicalName": "Translate", + "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-translation": { + "description": "Translate text from one language to another using Google Translate" + } + } + } }, - "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" - } - }, - "features": [ - "dataWrapper" - ], - "schemas": { - "DetectionsListResponse": { - "id": "DetectionsListResponse", - "type": "object", - "properties": { + "rootUrl": "https://translation.googleapis.com/", + "ownerDomain": "google.com", + "name": "translate", + "batchPath": "batch/translate", + "title": "Google Cloud Translation API", + "features": [ + "dataWrapper" + ], + "ownerName": "Google", + "resources": { "detections": { - "type": "array", - "description": "A detections contains detection results of several text", - "items": { - "$ref": "DetectionsResource" - } - } - } - }, - "DetectionsResource": { - "id": "DetectionsResource", - "type": "array", - "description": "An array of languages which we detect for the given text The most likely language list first.", - "items": { - "type": "object", - "properties": { - "confidence": { - "type": "number", - "description": "The confidence of the detection resul of this language.", - "format": "float" - }, - "isReliable": { - "type": "boolean", - "description": "A boolean to indicate is the language detection result reliable." - }, - "language": { - "type": "string", - "description": "The language we detect" - } - } - } - }, - "LanguagesListResponse": { - "id": "LanguagesListResponse", - "type": "object", - "properties": { + "methods": { + "detect": { + "id": "language.detections.detect", + "path": "v2/detect", + "request": { + "$ref": "DetectLanguageRequest" + }, + "description": "Detects the language of text within a request.", + "response": { + "$ref": "DetectionsListResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "DetectionsListResponse" + }, + "parameterOrder": [ + "q" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "q": { + "description": "The input text upon which to perform language detection. Repeat this\nparameter to perform language detection on multiple text inputs.", + "required": true, + "type": "string", + "repeated": true, + "location": "query" + } + }, + "path": "v2/detect", + "id": "language.detections.list", + "description": "Detects the language of text within a request." + } + } + }, "languages": { - "type": "array", - "description": "List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.", - "items": { - "$ref": "LanguagesResource" - } - } - } - }, - "LanguagesResource": { - "id": "LanguagesResource", - "type": "object", - "properties": { - "language": { - "type": "string", - "description": "The language code." + "methods": { + "list": { + "response": { + "$ref": "LanguagesListResponse" + }, + "httpMethod": "GET", + "parameters": { + "target": { + "description": "The language to use to return localized, human readable names of supported\nlanguages.", + "type": "string", + "location": "query" + }, + "model": { + "description": "The model type for which supported languages should be returned.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ], + "id": "language.languages.list", + "path": "v2/languages", + "description": "Returns a list of supported languages for translation." + } + } }, - "name": { - "type": "string", - "description": "The localized name of the language if target parameter is given." - } - } - }, - "TranslationsListResponse": { - "id": "TranslationsListResponse", - "type": "object", - "properties": { "translations": { - "type": "array", - "description": "Translations contains list of translation results of given text", - "items": { - "$ref": "TranslationsResource" - } + "methods": { + "list": { + "response": { + "$ref": "TranslationsListResponse" + }, + "parameterOrder": [ + "q", + "target" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "model": { + "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation.", + "type": "string", + "location": "query" + }, + "q": { + "repeated": true, + "location": "query", + "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.", + "required": true, + "type": "string" + }, + "source": { + "description": "The language of the source text, set to one of the language codes listed in\nLanguage Support. If the source language is not specified, the API will\nattempt to identify the source language automatically and return it within\nthe response.", + "type": "string", + "location": "query" + }, + "cid": { + "description": "The customization id for translate", + "type": "string", + "repeated": true, + "location": "query" + }, + "target": { + "description": "The language to use for translation of the input text, set to one of the\nlanguage codes listed in Language Support.", + "required": true, + "type": "string", + "location": "query" + }, + "format": { + "enumDescriptions": [ + "Specifies the input is in HTML", + "Specifies the input is in plain textual format" + ], + "location": "query", + "enum": [ + "html", + "text" + ], + "description": "The format of the source text, in either HTML (default) or plain-text. A\nvalue of \"html\" indicates HTML and a value of \"text\" indicates plain-text.", + "type": "string" + } + }, + "id": "language.translations.list", + "path": "v2", + "description": "Translates input text, returning translated text." + }, + "translate": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "TranslationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "path": "v2", + "id": "language.translations.translate", + "description": "Translates input text, returning translated text.", + "request": { + "$ref": "TranslateTextRequest" + } + } + } } - } }, - "TranslationsResource": { - "id": "TranslationsResource", - "type": "object", - "properties": { - "detectedSourceLanguage": { - "type": "string", - "description": "Detected source language if source parameter is unspecified." + "parameters": { + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" }, - "translatedText": { - "type": "string", - "description": "The translation." + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" } - } - } - }, - "resources": { - "detections": { - "methods": { - "list": { - "id": "language.detections.list", - "path": "v2/detect", - "httpMethod": "GET", - "description": "Detect the language of text.", - "parameters": { - "q": { - "type": "string", - "description": "The text to detect", - "required": true, - "repeated": true, - "location": "query" - } - }, - "parameterOrder": [ - "q" - ], - "response": { - "$ref": "DetectionsListResponse" - } - } - } }, - "languages": { - "methods": { - "list": { - "id": "language.languages.list", - "path": "v2/languages", - "httpMethod": "GET", - "description": "List the source/target languages supported by the API", - "parameters": { - "target": { - "type": "string", - "description": "the language and collation in which the localized results should be returned", - "location": "query" - } - }, - "response": { - "$ref": "LanguagesListResponse" - } - } - } - }, - "translations": { - "methods": { - "list": { - "id": "language.translations.list", - "path": "v2", - "httpMethod": "GET", - "description": "Returns text translations from one language to another.", - "parameters": { - "cid": { - "type": "string", - "description": "The customization id for translate", - "repeated": true, - "location": "query" - }, - "format": { - "type": "string", - "description": "The format of the text", - "enum": [ - "html", - "text" - ], - "enumDescriptions": [ - "Specifies the input is in HTML", - "Specifies the input is in plain textual format" - ], - "location": "query" - }, - "q": { - "type": "string", - "description": "The text to translate", - "required": true, - "repeated": true, - "location": "query" - }, - "source": { - "type": "string", - "description": "The source language of the text", - "location": "query" - }, - "target": { - "type": "string", - "description": "The target language into which the text should be translated", - "required": true, - "location": "query" - } - }, - "parameterOrder": [ - "q", - "target" - ], - "response": { - "$ref": "TranslationsListResponse" - } - } - } - } - } + "version": "v2", + "baseUrl": "https://translation.googleapis.com/language/translate/", + "servicePath": "language/translate/", + "description": "The Google Cloud Translation API lets websites and programs integrate with\n Google Translate programmatically.", + "kind": "discovery#restDescription", + "basePath": "/language/translate/", + "documentationLink": "https://code.google.com/apis/language/translate/v2/getting_started.html", + "revision": "20170525", + "id": "translate:v2" } diff --git a/etc/api/vault/v1/crates/1.0.6-api+20170812 b/etc/api/vault/v1/crates/1.0.6-api+20170812 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/vault/v1/crates/1.0.6-cli+20170812 b/etc/api/vault/v1/crates/1.0.6-cli+20170812 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/vault/v1/vault-api.json b/etc/api/vault/v1/vault-api.json new file mode 100644 index 0000000000..b6f7f537f5 --- /dev/null +++ b/etc/api/vault/v1/vault-api.json @@ -0,0 +1,1046 @@ +{ + "servicePath": "", + "description": "Archiving and eDiscovery for G Suite.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20170812", + "documentationLink": "https://developers.google.com/vault", + "id": "vault:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ReopenMatterResponse": { + "properties": { + "matter": { + "$ref": "Matter", + "description": "The updated matter, with state OPEN." + } + }, + "id": "ReopenMatterResponse", + "description": "Response to a ReopenMatterRequest.", + "type": "object" + }, + "CorpusQuery": { + "description": "Corpus specific queries.", + "type": "object", + "properties": { + "groupsQuery": { + "description": "Details pertaining to Groups holds. If set, corpus must be Groups.", + "$ref": "HeldGroupsQuery" + }, + "mailQuery": { + "description": "Details pertaining to mail holds. If set, corpus must be mail.", + "$ref": "HeldMailQuery" + }, + "driveQuery": { + "description": "Details pertaining to Drive holds. If set, corpus must be Drive.", + "$ref": "HeldDriveQuery" + } + }, + "id": "CorpusQuery" + }, + "Hold": { + "description": "Represents a hold within Vault. A hold restricts purging of\nartifacts based on the combination of the query and accounts restrictions.\nA hold can be configured to either apply to an explicitly configured set\nof accounts, or can be applied to all members of an organizational unit.", + "type": "object", + "properties": { + "holdId": { + "description": "The unique immutable ID of the hold. Assigned during creation.", + "type": "string" + }, + "name": { + "description": "The name of the hold.", + "type": "string" + }, + "accounts": { + "description": "If set, the hold applies to the enumerated accounts and org_unit must be\nempty.", + "items": { + "$ref": "HeldAccount" + }, + "type": "array" + }, + "query": { + "description": "The corpus-specific query. If set, the corpusQuery must match corpus\ntype.", + "$ref": "CorpusQuery" + }, + "orgUnit": { + "description": "If set, the hold applies to all members of the organizational unit and\naccounts must be empty. This property is mutable. For groups holds,\nset the accounts field.", + "$ref": "HeldOrgUnit" + }, + "corpus": { + "enumDescriptions": [ + "No corpus specified.", + "Drive.", + "Mail.", + "Groups." + ], + "enum": [ + "CORPUS_TYPE_UNSPECIFIED", + "DRIVE", + "MAIL", + "GROUPS" + ], + "description": "The corpus to be searched.", + "type": "string" + }, + "updateTime": { + "format": "google-datetime", + "description": "The last time this hold was modified.", + "type": "string" + } + }, + "id": "Hold" + }, + "ListHoldsResponse": { + "description": "The holds for a matter.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Page token to retrieve the next page of results in the list.\nIf this is empty, then there are no more holds to list.", + "type": "string" + }, + "holds": { + "description": "The list of holds.", + "items": { + "$ref": "Hold" + }, + "type": "array" + } + }, + "id": "ListHoldsResponse" + }, + "ListHeldAccountsResponse": { + "properties": { + "accounts": { + "description": "The held accounts on a hold.", + "items": { + "$ref": "HeldAccount" + }, + "type": "array" + } + }, + "id": "ListHeldAccountsResponse", + "description": "Returns a list of held accounts for a hold.", + "type": "object" + }, + "UndeleteMatterRequest": { + "description": "Undelete a matter by ID.", + "type": "object", + "properties": {}, + "id": "UndeleteMatterRequest" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "ReopenMatterRequest": { + "description": "Reopen a matter by ID.", + "type": "object", + "properties": {}, + "id": "ReopenMatterRequest" + }, + "CloseMatterRequest": { + "description": "Close a matter by ID.", + "type": "object", + "properties": {}, + "id": "CloseMatterRequest" + }, + "RemoveMatterPermissionsRequest": { + "description": "Remove an account as a matter collaborator.", + "type": "object", + "properties": { + "accountId": { + "description": "The account ID.", + "type": "string" + } + }, + "id": "RemoveMatterPermissionsRequest" + }, + "MatterPermission": { + "id": "MatterPermission", + "description": "Currently each matter only has one owner, and all others are collaborators.\nWhen an account is purged, its corresponding MatterPermission resources\ncease to exist.", + "type": "object", + "properties": { + "accountId": { + "description": "The account id, as provided by \u003ca href=\"https://developers.google.com/admin-sdk/\"\u003eAdmin SDK\u003c/a\u003e.", + "type": "string" + }, + "role": { + "enumDescriptions": [ + "No role assigned.", + "A collaborator to the matter.", + "The owner of the matter." + ], + "enum": [ + "ROLE_UNSPECIFIED", + "COLLABORATOR", + "OWNER" + ], + "description": "The user's role in this matter.", + "type": "string" + } + } + }, + "ListMattersResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "Page token to retrieve the next page of results in the list.", + "type": "string" + }, + "matters": { + "items": { + "$ref": "Matter" + }, + "type": "array", + "description": "List of matters." + } + }, + "id": "ListMattersResponse", + "description": "Provides the list of matters." + }, + "HeldMailQuery": { + "description": "Query options for mail holds.", + "type": "object", + "properties": { + "terms": { + "description": "The search terms for the hold.", + "type": "string" + }, + "endTime": { + "type": "string", + "format": "google-datetime", + "description": "The end date range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date." + }, + "startTime": { + "format": "google-datetime", + "description": "The start date range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", + "type": "string" + } + }, + "id": "HeldMailQuery" + }, + "CloseMatterResponse": { + "type": "object", + "properties": { + "matter": { + "$ref": "Matter", + "description": "The updated matter, with state CLOSED." + } + }, + "id": "CloseMatterResponse", + "description": "Response to a CloseMatterRequest." + }, + "HeldDriveQuery": { + "type": "object", + "properties": { + "includeTeamDriveFiles": { + "description": "If true, include files in Team Drives in the hold.", + "type": "boolean" + } + }, + "id": "HeldDriveQuery", + "description": "Query options for drive holds." + }, + "HeldGroupsQuery": { + "type": "object", + "properties": { + "startTime": { + "format": "google-datetime", + "description": "The start date range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", + "type": "string" + }, + "terms": { + "description": "The search terms for the hold.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "The end date range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", + "type": "string" + } + }, + "id": "HeldGroupsQuery", + "description": "Query options for group holds." + }, + "HeldOrgUnit": { + "id": "HeldOrgUnit", + "description": "A organizational unit being held in a particular hold.\nThis structure is immutable.", + "type": "object", + "properties": { + "orgUnitId": { + "description": "The org unit's immutable ID as provided by the admin SDK.", + "type": "string" + }, + "holdTime": { + "format": "google-datetime", + "description": "When the org unit was put on hold. This property is immutable.", + "type": "string" + } + } + }, + "AddMatterPermissionsRequest": { + "description": "Add an account with the permission specified. The role cannot be owner.\nIf an account already has a role in the matter, it will be\noverwritten.", + "type": "object", + "properties": { + "ccMe": { + "description": "Only relevant if send_emails is true.\nTrue to CC requestor in the email message.\nFalse to not CC requestor.", + "type": "boolean" + }, + "sendEmails": { + "description": "True to send notification email to the added account.\nFalse to not send notification email.", + "type": "boolean" + }, + "matterPermission": { + "description": "The MatterPermission to add.", + "$ref": "MatterPermission" + } + }, + "id": "AddMatterPermissionsRequest" + }, + "Matter": { + "id": "Matter", + "description": "Represents a matter.", + "type": "object", + "properties": { + "state": { + "enumDescriptions": [ + "The matter has no specified state.", + "This matter is open.", + "This matter is closed.", + "This matter is deleted." + ], + "enum": [ + "STATE_UNSPECIFIED", + "OPEN", + "CLOSED", + "DELETED" + ], + "description": "The state of the matter.", + "type": "string" + }, + "matterPermissions": { + "description": "List of users and access to the matter. Currently there is no programmer\ndefined limit on the number of permissions a matter can have.", + "items": { + "$ref": "MatterPermission" + }, + "type": "array" + }, + "name": { + "description": "The name of the matter.", + "type": "string" + }, + "description": { + "description": "The description of the matter.", + "type": "string" + }, + "matterId": { + "type": "string", + "description": "The matter ID which is generated by the server.\nShould be blank when creating a new matter." + } + } + }, + "HeldAccount": { + "description": "An account being held in a particular hold. This structure is immutable.\nThis can be either a single user or a google group, depending on the corpus.", + "type": "object", + "properties": { + "accountId": { + "type": "string", + "description": "The account's ID as provided by the\n\u003ca href=\"https://developers.google.com/admin-sdk/\"\u003eAdmin SDK\u003c/a\u003e." + }, + "holdTime": { + "format": "google-datetime", + "description": "When the account was put on hold.", + "type": "string" + } + }, + "id": "HeldAccount" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "canonicalName": "Vault", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/ediscovery.readonly": { + "description": "View your eDiscovery data" + }, + "https://www.googleapis.com/auth/ediscovery": { + "description": "Manage your eDiscovery data" + } + } + } + }, + "rootUrl": "https://vault.googleapis.com/", + "ownerDomain": "google.com", + "name": "vault", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Vault API", + "ownerName": "Google", + "resources": { + "matters": { + "methods": { + "delete": { + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID", + "type": "string", + "required": true + } + }, + "flatPath": "v1/matters/{matterId}", + "id": "vault.matters.delete", + "path": "v1/matters/{matterId}", + "description": "Deletes the specified matter. Returns matter with updated state.", + "response": { + "$ref": "Matter" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "DELETE" + }, + "addPermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "matterId" + ], + "response": { + "$ref": "MatterPermission" + }, + "parameters": { + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}:addPermissions", + "path": "v1/matters/{matterId}:addPermissions", + "id": "vault.matters.addPermissions", + "description": "Adds an account as a matter collaborator.", + "request": { + "$ref": "AddMatterPermissionsRequest" + } + }, + "list": { + "id": "vault.matters.list", + "path": "v1/matters", + "description": "Lists matters the user has access to.", + "response": { + "$ref": "ListMattersResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "parameters": { + "state": { + "location": "query", + "enum": [ + "STATE_UNSPECIFIED", + "OPEN", + "CLOSED", + "DELETED" + ], + "description": "If set, list only matters with that specific state. The default is listing\nmatters of all states.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The pagination token as returned in the response.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The number of matters to return in the response.\nDefault and maximum are 100.", + "type": "integer" + }, + "view": { + "description": "Specifies which parts of the matter to return in response.", + "type": "string", + "location": "query", + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + } + }, + "flatPath": "v1/matters" + }, + "create": { + "response": { + "$ref": "Matter" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": {}, + "flatPath": "v1/matters", + "id": "vault.matters.create", + "path": "v1/matters", + "request": { + "$ref": "Matter" + }, + "description": "Creates a new matter with the given name and description. The initial state\nis open, and the owner is the method caller. Returns the created matter\nwith default view." + }, + "removePermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "matterId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/matters/{matterId}:removePermissions", + "path": "v1/matters/{matterId}:removePermissions", + "id": "vault.matters.removePermissions", + "request": { + "$ref": "RemoveMatterPermissionsRequest" + }, + "description": "Removes an account as a matter collaborator." + }, + "reopen": { + "description": "Reopens the specified matter. Returns matter with updated state.", + "request": { + "$ref": "ReopenMatterRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "matterId" + ], + "response": { + "$ref": "ReopenMatterResponse" + }, + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}:reopen", + "path": "v1/matters/{matterId}:reopen", + "id": "vault.matters.reopen" + }, + "undelete": { + "id": "vault.matters.undelete", + "path": "v1/matters/{matterId}:undelete", + "description": "Undeletes the specified matter. Returns matter with updated state.", + "request": { + "$ref": "UndeleteMatterRequest" + }, + "response": { + "$ref": "Matter" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "POST", + "parameters": { + "matterId": { + "type": "string", + "required": true, + "location": "path", + "description": "The matter ID." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}:undelete" + }, + "close": { + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}:close", + "id": "vault.matters.close", + "path": "v1/matters/{matterId}:close", + "description": "Closes the specified matter. Returns matter with updated state.", + "request": { + "$ref": "CloseMatterRequest" + }, + "response": { + "$ref": "CloseMatterResponse" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "POST" + }, + "get": { + "response": { + "$ref": "Matter" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "parameters": { + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + }, + "view": { + "description": "Specifies which parts of the Matter to return in the response.", + "type": "string", + "location": "query", + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + } + }, + "flatPath": "v1/matters/{matterId}", + "id": "vault.matters.get", + "path": "v1/matters/{matterId}", + "description": "Gets the specified matter." + }, + "update": { + "flatPath": "v1/matters/{matterId}", + "path": "v1/matters/{matterId}", + "id": "vault.matters.update", + "description": "Updates the specified matter.\nThis updates only the name and description of the matter, identified by\nmatter id. Changes to any other fields are ignored.\nReturns the default view of the matter.", + "request": { + "$ref": "Matter" + }, + "httpMethod": "PUT", + "parameterOrder": [ + "matterId" + ], + "response": { + "$ref": "Matter" + }, + "parameters": { + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ] + } + }, + "resources": { + "holds": { + "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "matterId", + "holdId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "type": "string", + "required": true + }, + "holdId": { + "location": "path", + "description": "The hold ID.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/matters/{matterId}/holds/{holdId}", + "id": "vault.matters.holds.delete", + "path": "v1/matters/{matterId}/holds/{holdId}", + "description": "Removes a hold by ID. This will release any HeldAccounts on this Hold." + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListHoldsResponse" + }, + "parameterOrder": [ + "matterId" + ], + "parameters": { + "pageToken": { + "description": "The pagination token as returned in the response.\nAn empty token means start from the beginning.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "The number of holds to return in the response, between 0 and 100 inclusive.\nLeaving this empty, or as 0, is the same as page_size = 100.", + "type": "integer" + }, + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "flatPath": "v1/matters/{matterId}/holds", + "path": "v1/matters/{matterId}/holds", + "id": "vault.matters.holds.list", + "description": "Lists holds within a matter. An empty page token in ListHoldsResponse\ndenotes no more holds to list." + }, + "get": { + "flatPath": "v1/matters/{matterId}/holds/{holdId}", + "path": "v1/matters/{matterId}/holds/{holdId}", + "id": "vault.matters.holds.get", + "description": "Gets a hold by ID.", + "httpMethod": "GET", + "response": { + "$ref": "Hold" + }, + "parameterOrder": [ + "matterId", + "holdId" + ], + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "type": "string", + "required": true + }, + "holdId": { + "location": "path", + "description": "The hold ID.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ] + }, + "update": { + "parameters": { + "holdId": { + "location": "path", + "description": "The ID of the hold.", + "type": "string", + "required": true + }, + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}/holds/{holdId}", + "id": "vault.matters.holds.update", + "path": "v1/matters/{matterId}/holds/{holdId}", + "description": "Updates the OU and/or query parameters of a hold. You cannot add accounts\nto a hold that covers an OU, nor can you add OUs to a hold that covers\nindividual accounts. Accounts listed in the hold will be ignored.", + "request": { + "$ref": "Hold" + }, + "response": { + "$ref": "Hold" + }, + "parameterOrder": [ + "matterId", + "holdId" + ], + "httpMethod": "PUT" + }, + "create": { + "id": "vault.matters.holds.create", + "path": "v1/matters/{matterId}/holds", + "request": { + "$ref": "Hold" + }, + "description": "Creates a hold in the given matter.", + "response": { + "$ref": "Hold" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "matterId": { + "type": "string", + "required": true, + "location": "path", + "description": "The matter ID." + } + }, + "flatPath": "v1/matters/{matterId}/holds" + } + }, + "resources": { + "accounts": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "matterId", + "holdId", + "accountId" + ], + "parameters": { + "accountId": { + "location": "path", + "description": "The ID of the account to remove from the hold.", + "type": "string", + "required": true + }, + "matterId": { + "location": "path", + "description": "The matter ID.", + "type": "string", + "required": true + }, + "holdId": { + "description": "The hold ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}", + "path": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}", + "id": "vault.matters.holds.accounts.delete", + "description": "Removes a HeldAccount from a hold. If this request leaves the hold with\nno held accounts, the hold will not apply to any accounts." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "matterId", + "holdId" + ], + "response": { + "$ref": "ListHeldAccountsResponse" + }, + "parameters": { + "holdId": { + "location": "path", + "description": "The hold ID.", + "type": "string", + "required": true + }, + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts", + "path": "v1/matters/{matterId}/holds/{holdId}/accounts", + "id": "vault.matters.holds.accounts.list", + "description": "Lists HeldAccounts for a hold. This will only list individually specified\nheld accounts. If the hold is on an OU, then use\n\u003ca href=\"https://developers.google.com/admin-sdk/\"\u003eAdmin SDK\u003c/a\u003e\nto enumerate its members." + }, + "create": { + "id": "vault.matters.holds.accounts.create", + "path": "v1/matters/{matterId}/holds/{holdId}/accounts", + "request": { + "$ref": "HeldAccount" + }, + "description": "Adds a HeldAccount to a hold. Accounts can only be added to a hold that\nhas no held_org_unit set. Attempting to add an account to an OU-based\nhold will result in an error.", + "response": { + "$ref": "HeldAccount" + }, + "parameterOrder": [ + "matterId", + "holdId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "holdId": { + "location": "path", + "description": "The hold ID.", + "type": "string", + "required": true + }, + "matterId": { + "description": "The matter ID.", + "type": "string", + "required": true, + "location": "path" + } + }, + "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts" + } + } + } + } + } + } + } + }, + "parameters": { + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "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.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "location": "query", + "description": "Pretty-print response.", + "default": "true", + "type": "boolean" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "alt": { + "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", + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" + } + }, + "version": "v1", + "baseUrl": "https://vault.googleapis.com/" +} diff --git a/etc/api/videointelligence/v1beta1/crates/1.0.6-api+20170923 b/etc/api/videointelligence/v1beta1/crates/1.0.6-api+20170923 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/videointelligence/v1beta1/crates/1.0.6-cli+20170923 b/etc/api/videointelligence/v1beta1/crates/1.0.6-cli+20170923 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/videointelligence/v1beta1/videointelligence-api.json b/etc/api/videointelligence/v1beta1/videointelligence-api.json new file mode 100644 index 0000000000..b9bd8e0b10 --- /dev/null +++ b/etc/api/videointelligence/v1beta1/videointelligence-api.json @@ -0,0 +1,1020 @@ +{ + "ownerName": "Google", + "resources": { + "videos": { + "methods": { + "annotate": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GoogleLongrunning_Operation" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/videos:annotate", + "path": "v1beta1/videos:annotate", + "id": "videointelligence.videos.annotate", + "description": "Performs asynchronous video annotation. Progress and results can be\nretrieved through the `google.longrunning.Operations` interface.\n`Operation.metadata` contains `AnnotateVideoProgress` (progress).\n`Operation.response` contains `AnnotateVideoResponse` (results).", + "request": { + "$ref": "GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest" + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" + }, + "quotaUser": { + "location": "query", + "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.", + "type": "string" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + } + }, + "version": "v1beta1", + "baseUrl": "https://videointelligence.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Cloud Video Intelligence API.", + "servicePath": "", + "basePath": "", + "id": "videointelligence:v1beta1", + "revision": "20170923", + "documentationLink": "https://cloud.google.com/video-intelligence/docs/", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "GoogleCloudVideointelligenceV1_SafeSearchAnnotation": { + "properties": { + "time": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the video frame for this annotation.", + "type": "string" + }, + "adult": { + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Likelihood of adult content.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ] + } + }, + "id": "GoogleCloudVideointelligenceV1_SafeSearchAnnotation", + "description": "Safe search annotation (based on per-frame visual signals only).\nIf no unsafe content has been detected in a frame, no annotations\nare present for that frame.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1beta2_LabelAnnotation": { + "description": "Label annotation.", + "type": "object", + "properties": { + "frames": { + "description": "All video frames where a label was detected.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_LabelFrame" + }, + "type": "array" + }, + "segments": { + "description": "All video segments where a label was detected.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_LabelSegment" + }, + "type": "array" + }, + "categoryEntities": { + "description": "Common categories for the detected entity.\nE.g. when the label is `Terrier` the category is likely `dog`. And in some\ncases there might be more than one categories e.g. `Terrier` could also be\na `pet`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_Entity" + }, + "type": "array" + }, + "entity": { + "description": "Detected entity.", + "$ref": "GoogleCloudVideointelligenceV1beta2_Entity" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" + }, + "GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation": { + "description": "Safe search annotation (based on per-frame visual signals only).\nIf no unsafe content has been detected in a frame, no annotations\nare present for that frame. If only some types of unsafe content\nhave been detected in a frame, the likelihood is set to `UNKNOWN`\nfor all other types of unsafe content.", + "type": "object", + "properties": { + "racy": { + "description": "Likelihood of racy content.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ] + }, + "timeOffset": { + "format": "int64", + "description": "Video time offset in microseconds.", + "type": "string" + }, + "spoof": { + "description": "Likelihood that an obvious modification was made to the original\nversion to make it appear funny or offensive.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ] + }, + "violent": { + "description": "Likelihood of violent content.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ] + }, + "medical": { + "enumDescriptions": [ + "Unknown likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Likelihood of medical content.", + "type": "string" + }, + "adult": { + "description": "Likelihood of adult content.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ] + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation" + }, + "GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress": { + "description": "Video annotation progress. Included in the `metadata`\nfield of the `Operation` returned by the `GetOperation`\ncall of the `google::longrunning::Operations` service.", + "type": "object", + "properties": { + "annotationProgress": { + "description": "Progress metadata for all videos specified in `AnnotateVideoRequest`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress" + }, + "GoogleCloudVideointelligenceV1beta2_Entity": { + "description": "Detected entity from video analysis.", + "type": "object", + "properties": { + "description": { + "description": "Textual description, e.g. `Fixed-gear bicycle`.", + "type": "string" + }, + "languageCode": { + "description": "Language code for `description` in BCP-47 format.", + "type": "string" + }, + "entityId": { + "description": "Opaque entity ID. Some IDs may be available in\n[Google Knowledge Graph Search\nAPI](https://developers.google.com/knowledge-graph/).", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_Entity" + }, + "GoogleCloudVideointelligenceV1beta2_VideoSegment": { + "properties": { + "endTimeOffset": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the end of the segment (inclusive).", + "type": "string" + }, + "startTimeOffset": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the start of the segment (inclusive).", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_VideoSegment", + "description": "Video segment.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1_VideoAnnotationResults": { + "description": "Annotation results for a single video.", + "type": "object", + "properties": { + "error": { + "$ref": "GoogleRpc_Status", + "description": "If set, indicates an error. Note that for a single `AnnotateVideoRequest`\nsome videos may succeed and some may fail." + }, + "shotAnnotations": { + "description": "Shot annotations. Each shot is represented as a video segment.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_VideoSegment" + }, + "type": "array" + }, + "safeSearchAnnotations": { + "description": "Safe search annotations.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_SafeSearchAnnotation" + }, + "type": "array" + }, + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "labelAnnotations": { + "description": "Label annotations. There is exactly one element for each unique label.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_LabelAnnotation" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1_VideoAnnotationResults" + }, + "GoogleCloudVideointelligenceV1_LabelLocation": { + "description": "Label location.", + "type": "object", + "properties": { + "level": { + "enum": [ + "LABEL_LEVEL_UNSPECIFIED", + "VIDEO_LEVEL", + "SEGMENT_LEVEL", + "SHOT_LEVEL", + "FRAME_LEVEL" + ], + "description": "Label level.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Video-level. Corresponds to the whole video.", + "Segment-level. Corresponds to one of `AnnotateSpec.segments`.", + "Shot-level. Corresponds to a single shot (i.e. a series of frames\nwithout a major camera position or background change).", + "Frame-level. Corresponds to a single video frame." + ] + }, + "confidence": { + "format": "float", + "description": "Confidence that the label is accurate. Range: [0, 1].", + "type": "number" + }, + "segment": { + "description": "Video segment. Unset for video-level labels.\nSet to a frame timestamp for frame-level labels.\nOtherwise, corresponds to one of `AnnotateSpec.segments`\n(if specified) or to shot boundaries (if requested).", + "$ref": "GoogleCloudVideointelligenceV1_VideoSegment" + } + }, + "id": "GoogleCloudVideointelligenceV1_LabelLocation" + }, + "GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse": { + "properties": { + "annotationResults": { + "description": "Annotation results for all videos specified in `AnnotateVideoRequest`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse", + "description": "Video annotation response. Included in the `response`\nfield of the `Operation` returned by the `GetOperation`\ncall of the `google::longrunning::Operations` service.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1beta1_LabelAnnotation": { + "description": "Label annotation.", + "type": "object", + "properties": { + "description": { + "description": "Textual description, e.g. `Fixed-gear bicycle`.", + "type": "string" + }, + "locations": { + "description": "Where the label was detected and with what confidence.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_LabelLocation" + }, + "type": "array" + }, + "languageCode": { + "description": "Language code for `description` in BCP-47 format.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_LabelAnnotation" + }, + "GoogleCloudVideointelligenceV1beta1_VideoContext": { + "description": "Video context and/or feature-specific parameters.", + "type": "object", + "properties": { + "shotChangeDetectionModel": { + "description": "Model to use for shot change detection.\nSupported values: \"latest\" and \"stable\" (the default).", + "type": "string" + }, + "labelDetectionMode": { + "enum": [ + "LABEL_DETECTION_MODE_UNSPECIFIED", + "SHOT_MODE", + "FRAME_MODE", + "SHOT_AND_FRAME_MODE" + ], + "description": "If label detection has been requested, what labels should be detected\nin addition to video-level labels or segment-level labels. If unspecified,\ndefaults to `SHOT_MODE`.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Detect shot-level labels.", + "Detect frame-level labels.", + "Detect both shot-level and frame-level labels." + ] + }, + "stationaryCamera": { + "description": "Whether the video has been shot from a stationary (i.e. non-moving) camera.\nWhen set to true, might improve detection accuracy for moving objects.", + "type": "boolean" + }, + "safeSearchDetectionModel": { + "description": "Model to use for safe search detection.\nSupported values: \"latest\" and \"stable\" (the default).", + "type": "string" + }, + "segments": { + "description": "Video segments to annotate. The segments may overlap and are not required\nto be contiguous or span the whole video. If unspecified, each video\nis treated as a single segment.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + }, + "type": "array" + }, + "labelDetectionModel": { + "description": "Model to use for label detection.\nSupported values: \"latest\" and \"stable\" (the default).", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoContext" + }, + "GoogleCloudVideointelligenceV1_LabelAnnotation": { + "properties": { + "languageCode": { + "description": "Language code for `description` in BCP-47 format.", + "type": "string" + }, + "description": { + "description": "Textual description, e.g. `Fixed-gear bicycle`.", + "type": "string" + }, + "locations": { + "description": "Where the label was detected and with what confidence.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_LabelLocation" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1_LabelAnnotation", + "description": "Label annotation.", + "type": "object" + }, + "GoogleRpc_Status": { + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object", + "properties": { + "message": { + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", + "type": "string" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + } + }, + "id": "GoogleRpc_Status" + }, + "GoogleCloudVideointelligenceV1_VideoSegment": { + "properties": { + "startTime": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the start of the segment (inclusive).", + "type": "string" + }, + "endTime": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the end of the segment (inclusive).", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1_VideoSegment", + "description": "Video segment.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults": { + "properties": { + "error": { + "$ref": "GoogleRpc_Status", + "description": "If set, indicates an error. Note that for a single `AnnotateVideoRequest`\nsome videos may succeed and some may fail." + }, + "frameLabelAnnotations": { + "description": "Label annotations on frame level.\nThere is exactly one element for each unique label.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" + }, + "type": "array" + }, + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "explicitAnnotation": { + "description": "Explicit content annotation.", + "$ref": "GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation" + }, + "segmentLabelAnnotations": { + "description": "Label annotations on video level or user specified segment level.\nThere is exactly one element for each unique label.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" + }, + "type": "array" + }, + "shotAnnotations": { + "description": "Shot annotations. Each shot is represented as a video segment.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_VideoSegment" + }, + "type": "array" + }, + "shotLabelAnnotations": { + "description": "Label annotations on shot level.\nThere is exactly one element for each unique label.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults", + "description": "Annotation results for a single video.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1beta1_LabelLocation": { + "properties": { + "segment": { + "description": "Video segment. Set to [-1, -1] for video-level labels.\nSet to [timestamp, timestamp] for frame-level labels.\nOtherwise, corresponds to one of `AnnotateSpec.segments`\n(if specified) or to shot boundaries (if requested).", + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + }, + "level": { + "enum": [ + "LABEL_LEVEL_UNSPECIFIED", + "VIDEO_LEVEL", + "SEGMENT_LEVEL", + "SHOT_LEVEL", + "FRAME_LEVEL" + ], + "description": "Label level.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Video-level. Corresponds to the whole video.", + "Segment-level. Corresponds to one of `AnnotateSpec.segments`.", + "Shot-level. Corresponds to a single shot (i.e. a series of frames\nwithout a major camera position or background change).", + "Frame-level. Corresponds to a single video frame." + ] + }, + "confidence": { + "format": "float", + "description": "Confidence that the label is accurate. Range: [0, 1].", + "type": "number" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_LabelLocation", + "description": "Label location.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation": { + "description": "Explicit content annotation (based on per-frame visual signals only).\nIf no explicit content has been detected in a frame, no annotations are\npresent for that frame.", + "type": "object", + "properties": { + "frames": { + "description": "All video frames where explicit content was detected.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation" + }, + "GoogleCloudVideointelligenceV1beta2_LabelFrame": { + "description": "Video frame level annotation results for label detection.", + "type": "object", + "properties": { + "confidence": { + "format": "float", + "description": "Confidence that the label is accurate. Range: [0, 1].", + "type": "number" + }, + "timeOffset": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video, corresponding to the\nvideo frame for this location.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_LabelFrame" + }, + "GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress": { + "properties": { + "annotationProgress": { + "description": "Progress metadata for all videos specified in `AnnotateVideoRequest`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress", + "description": "Video annotation progress. Included in the `metadata`\nfield of the `Operation` returned by the `GetOperation`\ncall of the `google::longrunning::Operations` service.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1_VideoAnnotationProgress": { + "description": "Annotation progress for a single video.", + "type": "object", + "properties": { + "updateTime": { + "format": "google-datetime", + "description": "Time of the most recent update.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time when the request was received.", + "type": "string" + }, + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "progressPercent": { + "format": "int32", + "description": "Approximate percentage processed thus far.\nGuaranteed to be 100 when fully processed.", + "type": "integer" + } + }, + "id": "GoogleCloudVideointelligenceV1_VideoAnnotationProgress" + }, + "GoogleCloudVideointelligenceV1_AnnotateVideoProgress": { + "description": "Video annotation progress. Included in the `metadata`\nfield of the `Operation` returned by the `GetOperation`\ncall of the `google::longrunning::Operations` service.", + "type": "object", + "properties": { + "annotationProgress": { + "description": "Progress metadata for all videos specified in `AnnotateVideoRequest`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_VideoAnnotationProgress" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1_AnnotateVideoProgress" + }, + "GoogleLongrunning_Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "done": { + "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable.", + "type": "boolean" + }, + "response": { + "description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "GoogleRpc_Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, + "id": "GoogleLongrunning_Operation" + }, + "GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress": { + "description": "Annotation progress for a single video.", + "type": "object", + "properties": { + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "progressPercent": { + "format": "int32", + "description": "Approximate percentage processed thus far.\nGuaranteed to be 100 when fully processed.", + "type": "integer" + }, + "updateTime": { + "format": "google-datetime", + "description": "Time of the most recent update.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time when the request was received.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress" + }, + "GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults": { + "properties": { + "error": { + "$ref": "GoogleRpc_Status", + "description": "If set, indicates an error. Note that for a single `AnnotateVideoRequest`\nsome videos may succeed and some may fail." + }, + "shotAnnotations": { + "description": "Shot annotations. Each shot is represented as a video segment.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + }, + "type": "array" + }, + "safeSearchAnnotations": { + "description": "Safe search annotations.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation" + }, + "type": "array" + }, + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "labelAnnotations": { + "description": "Label annotations. There is exactly one element for each unique label.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_LabelAnnotation" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults", + "description": "Annotation results for a single video.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1_AnnotateVideoResponse": { + "description": "Video annotation response. Included in the `response`\nfield of the `Operation` returned by the `GetOperation`\ncall of the `google::longrunning::Operations` service.", + "type": "object", + "properties": { + "annotationResults": { + "description": "Annotation results for all videos specified in `AnnotateVideoRequest`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_VideoAnnotationResults" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1_AnnotateVideoResponse" + }, + "GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse": { + "properties": { + "annotationResults": { + "description": "Annotation results for all videos specified in `AnnotateVideoRequest`.", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults" + }, + "type": "array" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse", + "description": "Video annotation response. Included in the `response`\nfield of the `Operation` returned by the `GetOperation`\ncall of the `google::longrunning::Operations` service.", + "type": "object" + }, + "GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress": { + "description": "Annotation progress for a single video.", + "type": "object", + "properties": { + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "progressPercent": { + "format": "int32", + "description": "Approximate percentage processed thus far.\nGuaranteed to be 100 when fully processed.", + "type": "integer" + }, + "updateTime": { + "format": "google-datetime", + "description": "Time of the most recent update.", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "Time when the request was received.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress" + }, + "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame": { + "description": "Video frame level annotation results for explicit content.", + "type": "object", + "properties": { + "pornographyLikelihood": { + "description": "Likelihood of the pornography content..", + "type": "string", + "enumDescriptions": [ + "Unspecified likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], + "enum": [ + "LIKELIHOOD_UNSPECIFIED", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ] + }, + "timeOffset": { + "format": "google-duration", + "description": "Time-offset, relative to the beginning of the video, corresponding to the\nvideo frame for this location.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame" + }, + "GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest": { + "description": "Video annotation request.", + "type": "object", + "properties": { + "features": { + "description": "Requested video annotation features.", + "items": { + "enum": [ + "FEATURE_UNSPECIFIED", + "LABEL_DETECTION", + "SHOT_CHANGE_DETECTION", + "SAFE_SEARCH_DETECTION" + ], + "type": "string" + }, + "type": "array", + "enumDescriptions": [ + "Unspecified.", + "Label detection. Detect objects, such as dog or flower.", + "Shot change detection.", + "Safe search detection." + ] + }, + "outputUri": { + "description": "Optional location where the output (in JSON format) should be stored.\nCurrently, only [Google Cloud Storage](https://cloud.google.com/storage/)\nURIs are supported, which must be specified in the following format:\n`gs://bucket-id/object-id` (other URI formats return\ngoogle.rpc.Code.INVALID_ARGUMENT). For more information, see\n[Request URIs](/storage/docs/reference-uris).", + "type": "string" + }, + "videoContext": { + "description": "Additional video context and/or feature-specific parameters.", + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoContext" + }, + "locationId": { + "description": "Optional cloud region where annotation should take place. Supported cloud\nregions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region\nis specified, a region will be determined based on video file location.", + "type": "string" + }, + "inputUri": { + "description": "Input video location. Currently, only\n[Google Cloud Storage](https://cloud.google.com/storage/) URIs are\nsupported, which must be specified in the following format:\n`gs://bucket-id/object-id` (other URI formats return\ngoogle.rpc.Code.INVALID_ARGUMENT). For more information, see\n[Request URIs](/storage/docs/reference-uris).\nA video URI may include wildcards in `object-id`, and thus identify\nmultiple videos. Supported wildcards: '*' to match 0 or more characters;\n'?' to match 1 character. If unset, the input video should be embedded\nin the request as `input_content`. If set, `input_content` should be unset.", + "type": "string" + }, + "inputContent": { + "description": "The video data bytes. Encoding: base64. If unset, the input video(s)\nshould be specified via `input_uri`. If set, `input_uri` should be unset.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest" + }, + "GoogleCloudVideointelligenceV1beta1_VideoSegment": { + "description": "Video segment.", + "type": "object", + "properties": { + "endTimeOffset": { + "format": "int64", + "description": "End offset in microseconds (inclusive). Unset means 0.", + "type": "string" + }, + "startTimeOffset": { + "format": "int64", + "description": "Start offset in microseconds (inclusive). Unset means 0.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + }, + "GoogleCloudVideointelligenceV1beta2_LabelSegment": { + "description": "Video segment level annotation results for label detection.", + "type": "object", + "properties": { + "segment": { + "description": "Video segment where a label was detected.", + "$ref": "GoogleCloudVideointelligenceV1beta2_VideoSegment" + }, + "confidence": { + "format": "float", + "description": "Confidence that the label is accurate. Range: [0, 1].", + "type": "number" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_LabelSegment" + } + }, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "protocol": "rest", + "canonicalName": "Cloud Video Intelligence", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://videointelligence.googleapis.com/", + "ownerDomain": "google.com", + "name": "videointelligence", + "batchPath": "batch", + "title": "Cloud Video Intelligence API" +} diff --git a/etc/api/vision/v1/vision-api.json b/etc/api/vision/v1/vision-api.json index 4d7e3a0805..44f1a38320 100644 --- a/etc/api/vision/v1/vision-api.json +++ b/etc/api/vision/v1/vision-api.json @@ -1,59 +1,61 @@ { + "canonicalName": "Vision", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-vision": { + "description": "Apply machine learning models to understand and label images" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://vision.googleapis.com/", + "ownerDomain": "google.com", + "name": "vision", + "batchPath": "batch", "title": "Google Cloud Vision API", "ownerName": "Google", "resources": { "images": { "methods": { "annotate": { - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/images:annotate", - "path": "v1/images:annotate", - "id": "vision.images.annotate", - "request": { - "$ref": "BatchAnnotateImagesRequest" - }, - "description": "Run image detection and annotation for a batch of images.", "response": { "$ref": "BatchAnnotateImagesResponse" }, "parameterOrder": [], - "httpMethod": "POST" + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-vision" + ], + "parameters": {}, + "flatPath": "v1/images:annotate", + "id": "vision.images.annotate", + "path": "v1/images:annotate", + "request": { + "$ref": "BatchAnnotateImagesRequest" + }, + "description": "Run image detection and annotation for a batch of images." } } } }, "parameters": { - "prettyPrint": { - "location": "query", - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", "enum": [ "1", "2" ], "description": "V1 error format.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" }, "callback": { "location": "query", @@ -61,6 +63,11 @@ "type": "string" }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -69,22 +76,17 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", - "type": "string" + "default": "json" }, "key": { - "location": "query", "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.", - "type": "string" + "type": "string", + "location": "query" + }, + "access_token": { + "description": "OAuth access token.", + "type": "string", + "location": "query" }, "quotaUser": { "location": "query", @@ -93,38 +95,403 @@ }, "pp": { "description": "Pretty-print response.", - "type": "boolean", "default": "true", + "type": "boolean", "location": "query" }, + "bearer_token": { + "type": "string", + "location": "query", + "description": "OAuth bearer token." + }, "oauth_token": { "description": "OAuth 2.0 token for the current user.", "type": "string", "location": "query" }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "type": "string", + "location": "query", + "description": "Selector specifying which fields to include in a partial response." + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" } }, "version": "v1", "baseUrl": "https://vision.googleapis.com/", "kind": "discovery#restDescription", - "servicePath": "", "description": "Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.", + "servicePath": "", "basePath": "", - "id": "vision:v1", + "revision": "20170922", "documentationLink": "https://cloud.google.com/vision/", - "revision": "20170516", + "id": "vision:v1", "discoveryVersion": "v1", - "version_module": "True", + "version_module": true, "schemas": { + "LatLongRect": { + "description": "Rectangle determined by min and max `LatLng` pairs.", + "type": "object", + "properties": { + "minLatLng": { + "$ref": "LatLng", + "description": "Min lat/long pair." + }, + "maxLatLng": { + "$ref": "LatLng", + "description": "Max lat/long pair." + } + }, + "id": "LatLongRect" + }, + "Symbol": { + "type": "object", + "properties": { + "text": { + "description": "The actual UTF-8 representation of the symbol.", + "type": "string" + }, + "property": { + "$ref": "TextProperty", + "description": "Additional information detected for the symbol." + }, + "boundingBox": { + "description": "The bounding box for the symbol.\nThe vertices are in the order of top-left, top-right, bottom-right,\nbottom-left. When a rotation of the bounding box is detected the rotation\nis represented as around the top-left corner as defined when the text is\nread in the 'natural' orientation.\nFor example:\n * when the text is horizontal it might look like:\n 0----1\n | |\n 3----2\n * when it's rotated 180 degrees around the top-left corner it becomes:\n 2----3\n | |\n 1----0\n and the vertice order will still be (0, 1, 2, 3).", + "$ref": "BoundingPoly" + } + }, + "id": "Symbol", + "description": "A single symbol representation." + }, + "CropHintsAnnotation": { + "properties": { + "cropHints": { + "description": "Crop hint results.", + "items": { + "$ref": "CropHint" + }, + "type": "array" + } + }, + "id": "CropHintsAnnotation", + "description": "Set of crop hints that are used to generate new crops when serving images.", + "type": "object" + }, + "LatLng": { + "properties": { + "latitude": { + "format": "double", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "type": "number" + }, + "longitude": { + "format": "double", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "type": "number" + } + }, + "id": "LatLng", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "type": "object" + }, + "Color": { + "type": "object", + "properties": { + "red": { + "format": "float", + "description": "The amount of red in the color as a value in the interval [0, 1].", + "type": "number" + }, + "alpha": { + "format": "float", + "description": "The fraction of this color that should be applied to the pixel. That is,\nthe final pixel color is defined by the equation:\n\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n\nThis means that a value of 1.0 corresponds to a solid color, whereas\na value of 0.0 corresponds to a completely transparent color. This\nuses a wrapper message rather than a simple float scalar so that it is\npossible to distinguish between a default value and the value being unset.\nIf omitted, this color object is to be rendered as a solid color\n(as if the alpha value had been explicitly given with a value of 1.0).", + "type": "number" + }, + "blue": { + "format": "float", + "description": "The amount of blue in the color as a value in the interval [0, 1].", + "type": "number" + }, + "green": { + "type": "number", + "format": "float", + "description": "The amount of green in the color as a value in the interval [0, 1]." + } + }, + "id": "Color", + "description": "Represents a color in the RGBA color space. This representation is designed\nfor simplicity of conversion to/from color representations in various\nlanguages over compactness; for example, the fields of this representation\ncan be trivially provided to the constructor of \"java.awt.Color\" in Java; it\ncan also be trivially provided to UIColor's \"+colorWithRed:green:blue:alpha\"\nmethod in iOS; and, with just a little work, it can be easily formatted into\na CSS \"rgba()\" string in JavaScript, as well. Here are some examples:\n\nExample (Java):\n\n import com.google.type.Color;\n\n // ...\n public static java.awt.Color fromProto(Color protocolor) {\n float alpha = protocolor.hasAlpha()\n ? protocolor.getAlpha().getValue()\n : 1.0;\n\n return new java.awt.Color(\n protocolor.getRed(),\n protocolor.getGreen(),\n protocolor.getBlue(),\n alpha);\n }\n\n public static Color toProto(java.awt.Color color) {\n float red = (float) color.getRed();\n float green = (float) color.getGreen();\n float blue = (float) color.getBlue();\n float denominator = 255.0;\n Color.Builder resultBuilder =\n Color\n .newBuilder()\n .setRed(red / denominator)\n .setGreen(green / denominator)\n .setBlue(blue / denominator);\n int alpha = color.getAlpha();\n if (alpha != 255) {\n result.setAlpha(\n FloatValue\n .newBuilder()\n .setValue(((float) alpha) / denominator)\n .build());\n }\n return resultBuilder.build();\n }\n // ...\n\nExample (iOS / Obj-C):\n\n // ...\n static UIColor* fromProto(Color* protocolor) {\n float red = [protocolor red];\n float green = [protocolor green];\n float blue = [protocolor blue];\n FloatValue* alpha_wrapper = [protocolor alpha];\n float alpha = 1.0;\n if (alpha_wrapper != nil) {\n alpha = [alpha_wrapper value];\n }\n return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];\n }\n\n static Color* toProto(UIColor* color) {\n CGFloat red, green, blue, alpha;\n if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {\n return nil;\n }\n Color* result = [Color alloc] init];\n [result setRed:red];\n [result setGreen:green];\n [result setBlue:blue];\n if (alpha \u003c= 0.9999) {\n [result setAlpha:floatWrapperWithValue(alpha)];\n }\n [result autorelease];\n return result;\n }\n // ...\n\n Example (JavaScript):\n\n // ...\n\n var protoToCssColor = function(rgb_color) {\n var redFrac = rgb_color.red || 0.0;\n var greenFrac = rgb_color.green || 0.0;\n var blueFrac = rgb_color.blue || 0.0;\n var red = Math.floor(redFrac * 255);\n var green = Math.floor(greenFrac * 255);\n var blue = Math.floor(blueFrac * 255);\n\n if (!('alpha' in rgb_color)) {\n return rgbToCssColor_(red, green, blue);\n }\n\n var alphaFrac = rgb_color.alpha.value || 0.0;\n var rgbParams = [red, green, blue].join(',');\n return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');\n };\n\n var rgbToCssColor_ = function(red, green, blue) {\n var rgbNumber = new Number((red \u003c\u003c 16) | (green \u003c\u003c 8) | blue);\n var hexString = rgbNumber.toString(16);\n var missingZeros = 6 - hexString.length;\n var resultBuilder = ['#'];\n for (var i = 0; i \u003c missingZeros; i++) {\n resultBuilder.push('0');\n }\n resultBuilder.push(hexString);\n return resultBuilder.join('');\n };\n\n // ..." + }, + "ImageProperties": { + "description": "Stores image properties, such as dominant colors.", + "type": "object", + "properties": { + "dominantColors": { + "$ref": "DominantColorsAnnotation", + "description": "If present, dominant colors completed successfully." + } + }, + "id": "ImageProperties" + }, + "Feature": { + "description": "Users describe the type of Google Cloud Vision API tasks to perform over\nimages by using *Feature*s. Each Feature indicates a type of image\ndetection task to perform. Features encode the Cloud Vision API\nvertical to operate on and the number of top-scoring results to return.", + "type": "object", + "properties": { + "maxResults": { + "type": "integer", + "format": "int32", + "description": "Maximum number of results of this type." + }, + "type": { + "description": "The feature type.", + "type": "string", + "enumDescriptions": [ + "Unspecified feature type.", + "Run face detection.", + "Run landmark detection.", + "Run logo detection.", + "Run label detection.", + "Run OCR.", + "Run dense text document OCR. Takes precedence when both\nDOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present.", + "Run computer vision models to compute image safe-search properties.", + "Compute a set of image properties, such as the image's dominant colors.", + "Run crop hints.", + "Run web detection." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "FACE_DETECTION", + "LANDMARK_DETECTION", + "LOGO_DETECTION", + "LABEL_DETECTION", + "TEXT_DETECTION", + "DOCUMENT_TEXT_DETECTION", + "SAFE_SEARCH_DETECTION", + "IMAGE_PROPERTIES", + "CROP_HINTS", + "WEB_DETECTION" + ] + } + }, + "id": "Feature" + }, + "SafeSearchAnnotation": { + "id": "SafeSearchAnnotation", + "description": "Set of features pertaining to the image, computed by computer vision\nmethods over safe-search verticals (for example, adult, spoof, medical,\nviolence).", + "type": "object", + "properties": { + "medical": { + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Likelihood that this is a medical image." + }, + "violence": { + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Violence likelihood.", + "type": "string" + }, + "adult": { + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Represents the adult content likelihood for the image.", + "type": "string" + }, + "spoof": { + "description": "Spoof likelihood. The likelihood that an modification\nwas made to the image's canonical version to make it appear\nfunny or offensive.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ] + } + } + }, + "DominantColorsAnnotation": { + "description": "Set of dominant colors and their corresponding scores.", + "type": "object", + "properties": { + "colors": { + "description": "RGB color values with their score and pixel fraction.", + "items": { + "$ref": "ColorInfo" + }, + "type": "array" + } + }, + "id": "DominantColorsAnnotation" + }, + "TextAnnotation": { + "properties": { + "pages": { + "description": "List of pages detected by OCR.", + "items": { + "$ref": "Page" + }, + "type": "array" + }, + "text": { + "description": "UTF-8 text detected on the pages.", + "type": "string" + } + }, + "id": "TextAnnotation", + "description": "TextAnnotation contains a structured representation of OCR extracted text.\nThe hierarchy of an OCR extracted text structure is like this:\n TextAnnotation -\u003e Page -\u003e Block -\u003e Paragraph -\u003e Word -\u003e Symbol\nEach structural component, starting from Page, may further have their own\nproperties. Properties describe detected languages, breaks etc.. Please\nrefer to the google.cloud.vision.v1.TextAnnotation.TextProperty message\ndefinition below for more detail.", + "type": "object" + }, + "Vertex": { + "description": "A vertex represents a 2D point in the image.\nNOTE: the vertex coordinates are in the same scale as the original image.", + "type": "object", + "properties": { + "x": { + "format": "int32", + "description": "X coordinate.", + "type": "integer" + }, + "y": { + "format": "int32", + "description": "Y coordinate.", + "type": "integer" + } + }, + "id": "Vertex" + }, + "DetectedLanguage": { + "properties": { + "languageCode": { + "type": "string", + "description": "The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more\ninformation, see\nhttp://www.unicode.org/reports/tr35/#Unicode_locale_identifier." + }, + "confidence": { + "format": "float", + "description": "Confidence of detected language. Range [0, 1].", + "type": "number" + } + }, + "id": "DetectedLanguage", + "description": "Detected language for a structural component.", + "type": "object" + }, + "WebEntity": { + "description": "Entity deduced from similar images on the Internet.", + "type": "object", + "properties": { + "entityId": { + "description": "Opaque entity ID.", + "type": "string" + }, + "description": { + "description": "Canonical description of the entity, in English.", + "type": "string" + }, + "score": { + "format": "float", + "description": "Overall relevancy score for the entity.\nNot normalized and not comparable across different image queries.", + "type": "number" + } + }, + "id": "WebEntity" + }, + "BoundingPoly": { + "description": "A bounding polygon for the detected image annotation.", + "type": "object", + "properties": { + "vertices": { + "description": "The bounding polygon vertices.", + "items": { + "$ref": "Vertex" + }, + "type": "array" + } + }, + "id": "BoundingPoly" + }, + "TextProperty": { + "type": "object", + "properties": { + "detectedLanguages": { + "description": "A list of detected languages together with confidence.", + "items": { + "$ref": "DetectedLanguage" + }, + "type": "array" + }, + "detectedBreak": { + "$ref": "DetectedBreak", + "description": "Detected start or end of a text segment." + } + }, + "id": "TextProperty", + "description": "Additional information detected on the structural component." + }, "AnnotateImageResponse": { "id": "AnnotateImageResponse", "description": "Response to an image annotation request.", @@ -132,35 +499,35 @@ "properties": { "landmarkAnnotations": { "description": "If present, landmark detection has completed successfully.", - "type": "array", "items": { "$ref": "EntityAnnotation" - } + }, + "type": "array" }, "textAnnotations": { "description": "If present, text (OCR) detection has completed successfully.", - "type": "array", "items": { "$ref": "EntityAnnotation" - } - }, - "faceAnnotations": { - "description": "If present, face detection has completed successfully.", - "type": "array", - "items": { - "$ref": "FaceAnnotation" - } + }, + "type": "array" }, "imagePropertiesAnnotation": { "description": "If present, image properties were extracted successfully.", "$ref": "ImageProperties" }, + "faceAnnotations": { + "description": "If present, face detection has completed successfully.", + "items": { + "$ref": "FaceAnnotation" + }, + "type": "array" + }, "logoAnnotations": { "description": "If present, logo detection has completed successfully.", - "type": "array", "items": { "$ref": "EntityAnnotation" - } + }, + "type": "array" }, "webDetection": { "$ref": "WebDetection", @@ -171,15 +538,15 @@ "$ref": "CropHintsAnnotation" }, "safeSearchAnnotation": { - "description": "If present, safe-search annotation has completed successfully.", - "$ref": "SafeSearchAnnotation" + "$ref": "SafeSearchAnnotation", + "description": "If present, safe-search annotation has completed successfully." }, "labelAnnotations": { - "description": "If present, label detection has completed successfully.", - "type": "array", "items": { "$ref": "EntityAnnotation" - } + }, + "type": "array", + "description": "If present, label detection has completed successfully." }, "error": { "$ref": "Status", @@ -192,37 +559,30 @@ } }, "CropHintsParams": { - "description": "Parameters for crop hints annotation request.", "type": "object", "properties": { "aspectRatios": { "description": "Aspect ratios in floats, representing the ratio of the width to the height\nof the image. For example, if the desired aspect ratio is 4/3, the\ncorresponding float value should be 1.33333. If not specified, the\nbest possible crop is returned. The number of provided aspect ratios is\nlimited to a maximum of 16; any aspect ratios provided after the 16th are\nignored.", - "type": "array", "items": { "format": "float", "type": "number" - } + }, + "type": "array" } }, - "id": "CropHintsParams" + "id": "CropHintsParams", + "description": "Parameters for crop hints annotation request." }, "Block": { + "id": "Block", "description": "Logical element on the page.", "type": "object", "properties": { - "paragraphs": { - "description": "List of paragraphs in this block (if this blocks is of type text).", - "type": "array", - "items": { - "$ref": "Paragraph" - } - }, "property": { "$ref": "TextProperty", "description": "Additional information detected for the block." }, "blockType": { - "description": "Detected block type (text, image etc) for this block.", "type": "string", "enumDescriptions": [ "Unknown block type.", @@ -239,26 +599,33 @@ "PICTURE", "RULER", "BARCODE" - ] + ], + "description": "Detected block type (text, image etc) for this block." }, "boundingBox": { - "$ref": "BoundingPoly", - "description": "The bounding box for the block.\nThe vertices are in the order of top-left, top-right, bottom-right,\nbottom-left. When a rotation of the bounding box is detected the rotation\nis represented as around the top-left corner as defined when the text is\nread in the 'natural' orientation.\nFor example:\n * when the text is horizontal it might look like:\n 0----1\n | |\n 3----2\n * when it's rotated 180 degrees around the top-left corner it becomes:\n 2----3\n | |\n 1----0\n and the vertice order will still be (0, 1, 2, 3)." + "description": "The bounding box for the block.\nThe vertices are in the order of top-left, top-right, bottom-right,\nbottom-left. When a rotation of the bounding box is detected the rotation\nis represented as around the top-left corner as defined when the text is\nread in the 'natural' orientation.\nFor example:\n * when the text is horizontal it might look like:\n 0----1\n | |\n 3----2\n * when it's rotated 180 degrees around the top-left corner it becomes:\n 2----3\n | |\n 1----0\n and the vertice order will still be (0, 1, 2, 3).", + "$ref": "BoundingPoly" + }, + "paragraphs": { + "description": "List of paragraphs in this block (if this blocks is of type text).", + "items": { + "$ref": "Paragraph" + }, + "type": "array" } - }, - "id": "Block" + } }, "Property": { "description": "A `Property` consists of a user-supplied name/value pair.", "type": "object", "properties": { "value": { - "description": "Value of the property.", - "type": "string" + "type": "string", + "description": "Value of the property." }, "uint64Value": { - "description": "Value of numeric properties.", "format": "uint64", + "description": "Value of numeric properties.", "type": "string" }, "name": { @@ -269,71 +636,15 @@ "id": "Property" }, "LocationInfo": { - "id": "LocationInfo", - "description": "Detected entity location information.", "type": "object", "properties": { "latLng": { - "description": "lat/long location coordinates.", - "$ref": "LatLng" - } - } - }, - "WebDetection": { - "description": "Relevant information for the image from the Internet.", - "type": "object", - "properties": { - "webEntities": { - "description": "Deduced entities from similar images on the Internet.", - "type": "array", - "items": { - "$ref": "WebEntity" - } - }, - "pagesWithMatchingImages": { - "description": "Web pages containing the matching images from the Internet.", - "type": "array", - "items": { - "$ref": "WebPage" - } - }, - "partialMatchingImages": { - "description": "Partial matching images from the Internet.\nThose images are similar enough to share some key-point features. For\nexample an original image will likely have partial matching for its crops.", - "type": "array", - "items": { - "$ref": "WebImage" - } - }, - "visuallySimilarImages": { - "description": "The visually similar image results.", - "type": "array", - "items": { - "$ref": "WebImage" - } - }, - "fullMatchingImages": { - "description": "Fully matching images from the Internet.\nCan include resized copies of the query image.", - "type": "array", - "items": { - "$ref": "WebImage" - } + "$ref": "LatLng", + "description": "lat/long location coordinates." } }, - "id": "WebDetection" - }, - "BatchAnnotateImagesResponse": { - "id": "BatchAnnotateImagesResponse", - "description": "Response to a batch image annotation request.", - "type": "object", - "properties": { - "responses": { - "description": "Individual responses to image annotation requests within the batch.", - "type": "array", - "items": { - "$ref": "AnnotateImageResponse" - } - } - } + "id": "LocationInfo", + "description": "Detected entity location information." }, "ImageSource": { "id": "ImageSource", @@ -350,24 +661,101 @@ } } }, + "BatchAnnotateImagesResponse": { + "description": "Response to a batch image annotation request.", + "type": "object", + "properties": { + "responses": { + "description": "Individual responses to image annotation requests within the batch.", + "items": { + "$ref": "AnnotateImageResponse" + }, + "type": "array" + } + }, + "id": "BatchAnnotateImagesResponse" + }, + "WebDetection": { + "description": "Relevant information for the image from the Internet.", + "type": "object", + "properties": { + "webEntities": { + "description": "Deduced entities from similar images on the Internet.", + "items": { + "$ref": "WebEntity" + }, + "type": "array" + }, + "pagesWithMatchingImages": { + "description": "Web pages containing the matching images from the Internet.", + "items": { + "$ref": "WebPage" + }, + "type": "array" + }, + "visuallySimilarImages": { + "description": "The visually similar image results.", + "items": { + "$ref": "WebImage" + }, + "type": "array" + }, + "partialMatchingImages": { + "description": "Partial matching images from the Internet.\nThose images are similar enough to share some key-point features. For\nexample an original image will likely have partial matching for its crops.", + "items": { + "$ref": "WebImage" + }, + "type": "array" + }, + "fullMatchingImages": { + "items": { + "$ref": "WebImage" + }, + "type": "array", + "description": "Fully matching images from the Internet.\nCan include resized copies of the query image." + } + }, + "id": "WebDetection" + }, "Position": { - "id": "Position", "description": "A 3D position in the image, used primarily for Face detection landmarks.\nA valid Position must have both x and y coordinates.\nThe position coordinates are in the same scale as the original image.", "type": "object", "properties": { - "y": { - "description": "Y coordinate.", + "z": { "format": "float", + "description": "Z coordinate (or depth).", "type": "number" }, "x": { - "description": "X coordinate.", "format": "float", + "description": "X coordinate.", "type": "number" }, - "z": { - "description": "Z coordinate (or depth).", + "y": { "format": "float", + "description": "Y coordinate.", + "type": "number" + } + }, + "id": "Position" + }, + "ColorInfo": { + "id": "ColorInfo", + "description": "Color information consists of RGB channels, score, and the fraction of\nthe image that the color occupies in the image.", + "type": "object", + "properties": { + "pixelFraction": { + "type": "number", + "format": "float", + "description": "The fraction of pixels the color occupies in the image.\nValue in range [0, 1]." + }, + "color": { + "description": "RGB components of the color.", + "$ref": "Color" + }, + "score": { + "format": "float", + "description": "Image-specific score for this color. Value in range [0, 1].", "type": "number" } } @@ -382,97 +770,76 @@ "type": "string" }, "score": { - "description": "Overall relevancy score for the web page.\nNot normalized and not comparable across different image queries.", "format": "float", + "description": "(Deprecated) Overall relevancy score for the web page.", "type": "number" } } }, - "ColorInfo": { - "description": "Color information consists of RGB channels, score, and the fraction of\nthe image that the color occupies in the image.", - "type": "object", - "properties": { - "pixelFraction": { - "description": "The fraction of pixels the color occupies in the image.\nValue in range [0, 1].", - "format": "float", - "type": "number" - }, - "color": { - "$ref": "Color", - "description": "RGB components of the color." - }, - "score": { - "description": "Image-specific score for this color. Value in range [0, 1].", - "format": "float", - "type": "number" - } - }, - "id": "ColorInfo" - }, "EntityAnnotation": { + "id": "EntityAnnotation", "description": "Set of detected entity features.", "type": "object", "properties": { + "properties": { + "description": "Some entities may have optional user-supplied `Property` (name/value)\nfields, such a score or string that qualifies the entity.", + "items": { + "$ref": "Property" + }, + "type": "array" + }, "score": { - "description": "Overall score of the result. Range [0, 1].", "format": "float", + "description": "Overall score of the result. Range [0, 1].", "type": "number" }, "locations": { "description": "The location information for the detected entity. Multiple\n`LocationInfo` elements can be present because one location may\nindicate the location of the scene in the image, and another location\nmay indicate the location of the place where the image was taken.\nLocation information is usually present for landmarks.", - "type": "array", "items": { "$ref": "LocationInfo" - } + }, + "type": "array" }, "mid": { "description": "Opaque entity ID. Some IDs may be available in\n[Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).", "type": "string" }, "confidence": { - "description": "The accuracy of the entity detection in an image.\nFor example, for an image in which the \"Eiffel Tower\" entity is detected,\nthis field represents the confidence that there is a tower in the query\nimage. Range [0, 1].", "format": "float", + "description": "The accuracy of the entity detection in an image.\nFor example, for an image in which the \"Eiffel Tower\" entity is detected,\nthis field represents the confidence that there is a tower in the query\nimage. Range [0, 1].", "type": "number" }, - "boundingPoly": { - "description": "Image region to which this entity belongs. Currently not produced\nfor `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s\nare produced for the entire text detected in an image region, followed by\n`boundingPoly`s for each word within the detected text.", - "$ref": "BoundingPoly" - }, "locale": { "description": "The language code for the locale in which the entity textual\n`description` is expressed.", "type": "string" }, + "boundingPoly": { + "description": "Image region to which this entity belongs. Not produced\nfor `LABEL_DETECTION` features.", + "$ref": "BoundingPoly" + }, + "topicality": { + "format": "float", + "description": "The relevancy of the ICA (Image Content Annotation) label to the\nimage. For example, the relevancy of \"tower\" is likely higher to an image\ncontaining the detected \"Eiffel Tower\" than to an image containing a\ndetected distant towering building, even though the confidence that\nthere is a tower in each image may be the same. Range [0, 1].", + "type": "number" + }, "description": { "description": "Entity textual description, expressed in its `locale` language.", "type": "string" - }, - "topicality": { - "description": "The relevancy of the ICA (Image Content Annotation) label to the\nimage. For example, the relevancy of \"tower\" is likely higher to an image\ncontaining the detected \"Eiffel Tower\" than to an image containing a\ndetected distant towering building, even though the confidence that\nthere is a tower in each image may be the same. Range [0, 1].", - "format": "float", - "type": "number" - }, - "properties": { - "description": "Some entities may have optional user-supplied `Property` (name/value)\nfields, such a score or string that qualifies the entity.", - "type": "array", - "items": { - "$ref": "Property" - } } - }, - "id": "EntityAnnotation" + } }, "CropHint": { "description": "Single crop hint that is used to generate a new crop when serving an image.", "type": "object", "properties": { - "confidence": { - "description": "Confidence of this being a salient region. Range [0, 1].", + "importanceFraction": { "format": "float", + "description": "Fraction of importance of this salient region with respect to the original\nimage.", "type": "number" }, - "importanceFraction": { - "description": "Fraction of importance of this salient region with respect to the original\nimage.", + "confidence": { "format": "float", + "description": "Confidence of this being a salient region. Range [0, 1].", "type": "number" }, "boundingPoly": { @@ -483,47 +850,15 @@ "id": "CropHint" }, "Landmark": { + "id": "Landmark", "description": "A face-specific landmark (for example, a face feature).\nLandmark positions may fall outside the bounds of the image\nif the face is near one or more edges of the image.\nTherefore it is NOT guaranteed that `0 \u003c= x \u003c width` or\n`0 \u003c= y \u003c height`.", "type": "object", "properties": { + "position": { + "description": "Face landmark position.", + "$ref": "Position" + }, "type": { - "enumDescriptions": [ - "Unknown face landmark detected. Should not be filled.", - "Left eye.", - "Right eye.", - "Left of left eyebrow.", - "Right of left eyebrow.", - "Left of right eyebrow.", - "Right of right eyebrow.", - "Midpoint between eyes.", - "Nose tip.", - "Upper lip.", - "Lower lip.", - "Mouth left.", - "Mouth right.", - "Mouth center.", - "Nose, bottom right.", - "Nose, bottom left.", - "Nose, bottom center.", - "Left eye, top boundary.", - "Left eye, right corner.", - "Left eye, bottom boundary.", - "Left eye, left corner.", - "Right eye, top boundary.", - "Right eye, right corner.", - "Right eye, bottom boundary.", - "Right eye, left corner.", - "Left eyebrow, upper midpoint.", - "Right eyebrow, upper midpoint.", - "Left ear tragion.", - "Right ear tragion.", - "Left eye pupil.", - "Right eye pupil.", - "Forehead glabella.", - "Chin gnathion.", - "Chin left gonion.", - "Chin right gonion." - ], "enum": [ "UNKNOWN_LANDMARK", "LEFT_EYE", @@ -562,65 +897,97 @@ "CHIN_RIGHT_GONION" ], "description": "Face landmark type.", - "type": "string" - }, - "position": { - "description": "Face landmark position.", - "$ref": "Position" + "type": "string", + "enumDescriptions": [ + "Unknown face landmark detected. Should not be filled.", + "Left eye.", + "Right eye.", + "Left of left eyebrow.", + "Right of left eyebrow.", + "Left of right eyebrow.", + "Right of right eyebrow.", + "Midpoint between eyes.", + "Nose tip.", + "Upper lip.", + "Lower lip.", + "Mouth left.", + "Mouth right.", + "Mouth center.", + "Nose, bottom right.", + "Nose, bottom left.", + "Nose, bottom center.", + "Left eye, top boundary.", + "Left eye, right corner.", + "Left eye, bottom boundary.", + "Left eye, left corner.", + "Right eye, top boundary.", + "Right eye, right corner.", + "Right eye, bottom boundary.", + "Right eye, left corner.", + "Left eyebrow, upper midpoint.", + "Right eyebrow, upper midpoint.", + "Left ear tragion.", + "Right ear tragion.", + "Left eye pupil.", + "Right eye pupil.", + "Forehead glabella.", + "Chin gnathion.", + "Chin left gonion.", + "Chin right gonion." + ] } - }, - "id": "Landmark" + } }, "WebImage": { - "id": "WebImage", "description": "Metadata for online images.", "type": "object", "properties": { + "score": { + "format": "float", + "description": "(Deprecated) Overall relevancy score for the image.", + "type": "number" + }, "url": { "description": "The result image URL.", "type": "string" - }, - "score": { - "description": "Overall relevancy score for the image.\nNot normalized and not comparable across different image queries.", - "format": "float", - "type": "number" } - } + }, + "id": "WebImage" }, "Word": { - "id": "Word", "description": "A word representation.", "type": "object", "properties": { - "symbols": { - "description": "List of symbols in the word.\nThe order of the symbols follows the natural reading order.", - "type": "array", - "items": { - "$ref": "Symbol" - } - }, - "property": { - "$ref": "TextProperty", - "description": "Additional information detected for the word." - }, "boundingBox": { "$ref": "BoundingPoly", "description": "The bounding box for the word.\nThe vertices are in the order of top-left, top-right, bottom-right,\nbottom-left. When a rotation of the bounding box is detected the rotation\nis represented as around the top-left corner as defined when the text is\nread in the 'natural' orientation.\nFor example:\n * when the text is horizontal it might look like:\n 0----1\n | |\n 3----2\n * when it's rotated 180 degrees around the top-left corner it becomes:\n 2----3\n | |\n 1----0\n and the vertice order will still be (0, 1, 2, 3)." + }, + "symbols": { + "description": "List of symbols in the word.\nThe order of the symbols follows the natural reading order.", + "items": { + "$ref": "Symbol" + }, + "type": "array" + }, + "property": { + "description": "Additional information detected for the word.", + "$ref": "TextProperty" } - } + }, + "id": "Word" }, "Image": { "description": "Client image to perform Google Cloud Vision API tasks over.", "type": "object", "properties": { - "content": { - "description": "Image content, represented as a stream of bytes.\nNote: as with all `bytes` fields, protobuffers use a pure binary\nrepresentation, whereas JSON representations use base64.", - "format": "byte", - "type": "string" - }, "source": { - "$ref": "ImageSource", - "description": "Google Cloud Storage image location. If both `content` and `source`\nare provided for an image, `content` takes precedence and is\nused to perform the image annotation request." + "description": "Google Cloud Storage image location. If both `content` and `source`\nare provided for an image, `content` takes precedence and is\nused to perform the image annotation request.", + "$ref": "ImageSource" + }, + "content": { + "format": "byte", + "description": "Image content, represented as a stream of bytes.\nNote: as with all `bytes` fields, protobuffers use a pure binary\nrepresentation, whereas JSON representations use base64.", + "type": "string" } }, "id": "Image" @@ -631,8 +998,8 @@ "type": "object", "properties": { "property": { - "$ref": "TextProperty", - "description": "Additional information detected for the paragraph." + "description": "Additional information detected for the paragraph.", + "$ref": "TextProperty" }, "boundingBox": { "$ref": "BoundingPoly", @@ -640,10 +1007,10 @@ }, "words": { "description": "List of words in this paragraph.", - "type": "array", "items": { "$ref": "Word" - } + }, + "type": "array" } } }, @@ -651,58 +1018,7 @@ "description": "A face annotation object contains the results of face detection.", "type": "object", "properties": { - "underExposedLikelihood": { - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ], - "description": "Under-exposed likelihood.", - "type": "string" - }, - "panAngle": { - "description": "Yaw angle, which indicates the leftward/rightward angle that the face is\npointing relative to the vertical plane perpendicular to the image. Range\n[-180,180].", - "format": "float", - "type": "number" - }, - "detectionConfidence": { - "description": "Detection confidence. Range [0, 1].", - "format": "float", - "type": "number" - }, - "blurredLikelihood": { - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ], - "description": "Blurred likelihood.", - "type": "string" - }, "headwearLikelihood": { - "description": "Headwear likelihood.", "type": "string", "enumDescriptions": [ "Unknown likelihood.", @@ -719,55 +1035,19 @@ "POSSIBLE", "LIKELY", "VERY_LIKELY" - ] + ], + "description": "Headwear likelihood." }, "boundingPoly": { - "description": "The bounding polygon around the face. The coordinates of the bounding box\nare in the original image's scale, as returned in `ImageParams`.\nThe bounding box is computed to \"frame\" the face in accordance with human\nexpectations. It is based on the landmarker results.\nNote that one or more x and/or y coordinates may not be generated in the\n`BoundingPoly` (the polygon will be unbounded) if only a partial face\nappears in the image to be annotated.", - "$ref": "BoundingPoly" + "$ref": "BoundingPoly", + "description": "The bounding polygon around the face. The coordinates of the bounding box\nare in the original image's scale, as returned in `ImageParams`.\nThe bounding box is computed to \"frame\" the face in accordance with human\nexpectations. It is based on the landmarker results.\nNote that one or more x and/or y coordinates may not be generated in the\n`BoundingPoly` (the polygon will be unbounded) if only a partial face\nappears in the image to be annotated." }, "rollAngle": { - "description": "Roll angle, which indicates the amount of clockwise/anti-clockwise rotation\nof the face relative to the image vertical about the axis perpendicular to\nthe face. Range [-180,180].", "format": "float", + "description": "Roll angle, which indicates the amount of clockwise/anti-clockwise rotation\nof the face relative to the image vertical about the axis perpendicular to\nthe face. Range [-180,180].", "type": "number" }, "sorrowLikelihood": { - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ], - "description": "Sorrow likelihood.", - "type": "string" - }, - "tiltAngle": { - "description": "Pitch angle, which indicates the upwards/downwards angle that the face is\npointing relative to the image's horizontal plane. Range [-180,180].", - "format": "float", - "type": "number" - }, - "fdBoundingPoly": { - "$ref": "BoundingPoly", - "description": "The `fd_bounding_poly` bounding polygon is tighter than the\n`boundingPoly`, and encloses only the skin part of the face. Typically, it\nis used to eliminate the face from any image analysis that detects the\n\"amount of skin\" visible in an image. It is not based on the\nlandmarker results, only on the initial face detection, hence\nthe \u003ccode\u003efd\u003c/code\u003e (face detection) prefix." - }, - "landmarks": { - "description": "Detected face landmarks.", - "type": "array", - "items": { - "$ref": "Landmark" - } - }, - "surpriseLikelihood": { - "description": "Surprise likelihood.", "type": "string", "enumDescriptions": [ "Unknown likelihood.", @@ -784,7 +1064,17 @@ "POSSIBLE", "LIKELY", "VERY_LIKELY" - ] + ], + "description": "Sorrow likelihood." + }, + "tiltAngle": { + "format": "float", + "description": "Pitch angle, which indicates the upwards/downwards angle that the face is\npointing relative to the image's horizontal plane. Range [-180,180].", + "type": "number" + }, + "fdBoundingPoly": { + "description": "The `fd_bounding_poly` bounding polygon is tighter than the\n`boundingPoly`, and encloses only the skin part of the face. Typically, it\nis used to eliminate the face from any image analysis that detects the\n\"amount of skin\" visible in an image. It is not based on the\nlandmarker results, only on the initial face detection, hence\nthe \u003ccode\u003efd\u003c/code\u003e (face detection) prefix.", + "$ref": "BoundingPoly" }, "angerLikelihood": { "enumDescriptions": [ @@ -806,8 +1096,90 @@ "description": "Anger likelihood.", "type": "string" }, + "landmarks": { + "description": "Detected face landmarks.", + "items": { + "$ref": "Landmark" + }, + "type": "array" + }, + "surpriseLikelihood": { + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Surprise likelihood.", + "type": "string" + }, + "landmarkingConfidence": { + "format": "float", + "description": "Face landmarking confidence. Range [0, 1].", + "type": "number" + }, "joyLikelihood": { - "description": "Joy likelihood.", + "type": "string", + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Joy likelihood." + }, + "underExposedLikelihood": { + "enumDescriptions": [ + "Unknown likelihood.", + "It is very unlikely that the image belongs to the specified vertical.", + "It is unlikely that the image belongs to the specified vertical.", + "It is possible that the image belongs to the specified vertical.", + "It is likely that the image belongs to the specified vertical.", + "It is very likely that the image belongs to the specified vertical." + ], + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Under-exposed likelihood.", + "type": "string" + }, + "panAngle": { + "format": "float", + "description": "Yaw angle, which indicates the leftward/rightward angle that the face is\npointing relative to the vertical plane perpendicular to the image. Range\n[-180,180].", + "type": "number" + }, + "detectionConfidence": { + "type": "number", + "format": "float", + "description": "Detection confidence. Range [0, 1]." + }, + "blurredLikelihood": { + "description": "Blurred likelihood.", "type": "string", "enumDescriptions": [ "Unknown likelihood.", @@ -825,42 +1197,29 @@ "LIKELY", "VERY_LIKELY" ] - }, - "landmarkingConfidence": { - "description": "Face landmarking confidence. Range [0, 1].", - "format": "float", - "type": "number" } }, "id": "FaceAnnotation" }, "BatchAnnotateImagesRequest": { - "id": "BatchAnnotateImagesRequest", - "description": "Multiple image annotation requests are batched into a single service call.", "type": "object", "properties": { "requests": { "description": "Individual image annotation requests for this batch.", - "type": "array", "items": { "$ref": "AnnotateImageRequest" - } + }, + "type": "array" } - } + }, + "id": "BatchAnnotateImagesRequest", + "description": "Multiple image annotation requests are batched into a single service call." }, "DetectedBreak": { "description": "Detected start or end of a structural component.", "type": "object", "properties": { "type": { - "enumDescriptions": [ - "Unknown break label type.", - "Regular space.", - "Sure space (very wide).", - "Line-wrapping break.", - "End-line hyphen that is not present in text; does not co-occur with\n`SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.", - "Line break that ends a paragraph." - ], "enum": [ "UNKNOWN", "SPACE", @@ -870,7 +1229,15 @@ "LINE_BREAK" ], "description": "Detected break type.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Unknown break label type.", + "Regular space.", + "Sure space (very wide).", + "Line-wrapping break.", + "End-line hyphen that is not present in text; does not co-occur with\n`SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.", + "Line break that ends a paragraph." + ] }, "isPrefix": { "description": "True if break prepends the element.", @@ -880,471 +1247,108 @@ "id": "DetectedBreak" }, "ImageContext": { - "id": "ImageContext", "description": "Image context and/or feature-specific parameters.", "type": "object", "properties": { "languageHints": { "description": "List of languages to use for TEXT_DETECTION. In most cases, an empty value\nyields the best results since it enables automatic language detection. For\nlanguages based on the Latin alphabet, setting `language_hints` is not\nneeded. In rare cases, when the language of the text in the image is known,\nsetting a hint will help get better results (although it will be a\nsignificant hindrance if the hint is wrong). Text detection returns an\nerror if one or more of the specified languages is not one of the\n[supported languages](/vision/docs/languages).", - "type": "array", "items": { "type": "string" - } + }, + "type": "array" }, "latLongRect": { "description": "lat/long rectangle that specifies the location of the image.", "$ref": "LatLongRect" }, "cropHintsParams": { - "$ref": "CropHintsParams", - "description": "Parameters for crop hints annotation request." + "description": "Parameters for crop hints annotation request.", + "$ref": "CropHintsParams" } - } + }, + "id": "ImageContext" }, "Page": { - "id": "Page", "description": "Detected page from OCR.", "type": "object", "properties": { + "width": { + "format": "int32", + "description": "Page width in pixels.", + "type": "integer" + }, "blocks": { - "description": "List of blocks of text, images etc on this page.", - "type": "array", "items": { "$ref": "Block" - } + }, + "type": "array", + "description": "List of blocks of text, images etc on this page." }, "property": { - "$ref": "TextProperty", - "description": "Additional information detected on the page." + "description": "Additional information detected on the page.", + "$ref": "TextProperty" }, "height": { - "description": "Page height in pixels.", + "type": "integer", "format": "int32", - "type": "integer" - }, - "width": { - "description": "Page width in pixels.", - "format": "int32", - "type": "integer" + "description": "Page height in pixels." } - } + }, + "id": "Page" }, "AnnotateImageRequest": { "description": "Request for performing Google Cloud Vision API tasks over a user-provided\nimage, with user-requested features.", "type": "object", "properties": { + "features": { + "description": "Requested features.", + "items": { + "$ref": "Feature" + }, + "type": "array" + }, "image": { "description": "The image to be processed.", "$ref": "Image" }, - "features": { - "description": "Requested features.", - "type": "array", - "items": { - "$ref": "Feature" - } - }, "imageContext": { - "description": "Additional context that may accompany the image.", - "$ref": "ImageContext" + "$ref": "ImageContext", + "description": "Additional context that may accompany the image." } }, "id": "AnnotateImageRequest" }, "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", - "type": "object", "properties": { + "code": { + "format": "int32", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer" + }, "message": { "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.", "type": "string" }, "details": { - "description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.", - "type": "array", + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.", "items": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, "type": "object" - } - }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" + }, + "type": "array" } }, - "id": "Status" - }, - "Symbol": { - "id": "Symbol", - "description": "A single symbol representation.", - "type": "object", - "properties": { - "text": { - "description": "The actual UTF-8 representation of the symbol.", - "type": "string" - }, - "property": { - "$ref": "TextProperty", - "description": "Additional information detected for the symbol." - }, - "boundingBox": { - "description": "The bounding box for the symbol.\nThe vertices are in the order of top-left, top-right, bottom-right,\nbottom-left. When a rotation of the bounding box is detected the rotation\nis represented as around the top-left corner as defined when the text is\nread in the 'natural' orientation.\nFor example:\n * when the text is horizontal it might look like:\n 0----1\n | |\n 3----2\n * when it's rotated 180 degrees around the top-left corner it becomes:\n 2----3\n | |\n 1----0\n and the vertice order will still be (0, 1, 2, 3).", - "$ref": "BoundingPoly" - } - } - }, - "LatLongRect": { - "id": "LatLongRect", - "description": "Rectangle determined by min and max `LatLng` pairs.", - "type": "object", - "properties": { - "minLatLng": { - "$ref": "LatLng", - "description": "Min lat/long pair." - }, - "maxLatLng": { - "$ref": "LatLng", - "description": "Max lat/long pair." - } - } - }, - "CropHintsAnnotation": { - "id": "CropHintsAnnotation", - "description": "Set of crop hints that are used to generate new crops when serving images.", - "type": "object", - "properties": { - "cropHints": { - "description": "Crop hint results.", - "type": "array", - "items": { - "$ref": "CropHint" - } - } - } - }, - "LatLng": { - "id": "LatLng", - "description": "An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges.\n\nExample of normalization code in Python:\n\n def NormalizeLongitude(longitude):\n \"\"\"Wraps decimal degrees longitude to [-180.0, 180.0].\"\"\"\n q, r = divmod(longitude, 360.0)\n if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0):\n return r - 360.0\n return r\n\n def NormalizeLatLng(latitude, longitude):\n \"\"\"Wraps decimal degrees latitude and longitude to\n [-90.0, 90.0] and [-180.0, 180.0], respectively.\"\"\"\n r = latitude % 360.0\n if r \u003c= 90.0:\n return r, NormalizeLongitude(longitude)\n elif r \u003e= 270.0:\n return r - 360, NormalizeLongitude(longitude)\n else:\n return 180 - r, NormalizeLongitude(longitude + 180.0)\n\n assert 180.0 == NormalizeLongitude(180.0)\n assert -180.0 == NormalizeLongitude(-180.0)\n assert -179.0 == NormalizeLongitude(181.0)\n assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)\n assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)\n assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)\n assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)\n assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)\n assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)\n assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)\n assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)\n assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", - "type": "object", - "properties": { - "longitude": { - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "format": "double", - "type": "number" - }, - "latitude": { - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "format": "double", - "type": "number" - } - } - }, - "Color": { - "id": "Color", - "description": "Represents a color in the RGBA color space. This representation is designed\nfor simplicity of conversion to/from color representations in various\nlanguages over compactness; for example, the fields of this representation\ncan be trivially provided to the constructor of \"java.awt.Color\" in Java; it\ncan also be trivially provided to UIColor's \"+colorWithRed:green:blue:alpha\"\nmethod in iOS; and, with just a little work, it can be easily formatted into\na CSS \"rgba()\" string in JavaScript, as well. Here are some examples:\n\nExample (Java):\n\n import com.google.type.Color;\n\n // ...\n public static java.awt.Color fromProto(Color protocolor) {\n float alpha = protocolor.hasAlpha()\n ? protocolor.getAlpha().getValue()\n : 1.0;\n\n return new java.awt.Color(\n protocolor.getRed(),\n protocolor.getGreen(),\n protocolor.getBlue(),\n alpha);\n }\n\n public static Color toProto(java.awt.Color color) {\n float red = (float) color.getRed();\n float green = (float) color.getGreen();\n float blue = (float) color.getBlue();\n float denominator = 255.0;\n Color.Builder resultBuilder =\n Color\n .newBuilder()\n .setRed(red / denominator)\n .setGreen(green / denominator)\n .setBlue(blue / denominator);\n int alpha = color.getAlpha();\n if (alpha != 255) {\n result.setAlpha(\n FloatValue\n .newBuilder()\n .setValue(((float) alpha) / denominator)\n .build());\n }\n return resultBuilder.build();\n }\n // ...\n\nExample (iOS / Obj-C):\n\n // ...\n static UIColor* fromProto(Color* protocolor) {\n float red = [protocolor red];\n float green = [protocolor green];\n float blue = [protocolor blue];\n FloatValue* alpha_wrapper = [protocolor alpha];\n float alpha = 1.0;\n if (alpha_wrapper != nil) {\n alpha = [alpha_wrapper value];\n }\n return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];\n }\n\n static Color* toProto(UIColor* color) {\n CGFloat red, green, blue, alpha;\n if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {\n return nil;\n }\n Color* result = [Color alloc] init];\n [result setRed:red];\n [result setGreen:green];\n [result setBlue:blue];\n if (alpha \u003c= 0.9999) {\n [result setAlpha:floatWrapperWithValue(alpha)];\n }\n [result autorelease];\n return result;\n }\n // ...\n\n Example (JavaScript):\n\n // ...\n\n var protoToCssColor = function(rgb_color) {\n var redFrac = rgb_color.red || 0.0;\n var greenFrac = rgb_color.green || 0.0;\n var blueFrac = rgb_color.blue || 0.0;\n var red = Math.floor(redFrac * 255);\n var green = Math.floor(greenFrac * 255);\n var blue = Math.floor(blueFrac * 255);\n\n if (!('alpha' in rgb_color)) {\n return rgbToCssColor_(red, green, blue);\n }\n\n var alphaFrac = rgb_color.alpha.value || 0.0;\n var rgbParams = [red, green, blue].join(',');\n return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');\n };\n\n var rgbToCssColor_ = function(red, green, blue) {\n var rgbNumber = new Number((red \u003c\u003c 16) | (green \u003c\u003c 8) | blue);\n var hexString = rgbNumber.toString(16);\n var missingZeros = 6 - hexString.length;\n var resultBuilder = ['#'];\n for (var i = 0; i \u003c missingZeros; i++) {\n resultBuilder.push('0');\n }\n resultBuilder.push(hexString);\n return resultBuilder.join('');\n };\n\n // ...", - "type": "object", - "properties": { - "red": { - "description": "The amount of red in the color as a value in the interval [0, 1].", - "format": "float", - "type": "number" - }, - "green": { - "description": "The amount of green in the color as a value in the interval [0, 1].", - "format": "float", - "type": "number" - }, - "blue": { - "description": "The amount of blue in the color as a value in the interval [0, 1].", - "format": "float", - "type": "number" - }, - "alpha": { - "description": "The fraction of this color that should be applied to the pixel. That is,\nthe final pixel color is defined by the equation:\n\n pixel color = alpha * (this color) + (1.0 - alpha) * (background color)\n\nThis means that a value of 1.0 corresponds to a solid color, whereas\na value of 0.0 corresponds to a completely transparent color. This\nuses a wrapper message rather than a simple float scalar so that it is\npossible to distinguish between a default value and the value being unset.\nIf omitted, this color object is to be rendered as a solid color\n(as if the alpha value had been explicitly given with a value of 1.0).", - "format": "float", - "type": "number" - } - } - }, - "ImageProperties": { - "description": "Stores image properties, such as dominant colors.", - "type": "object", - "properties": { - "dominantColors": { - "description": "If present, dominant colors completed successfully.", - "$ref": "DominantColorsAnnotation" - } - }, - "id": "ImageProperties" - }, - "Feature": { - "description": "Users describe the type of Google Cloud Vision API tasks to perform over\nimages by using *Feature*s. Each Feature indicates a type of image\ndetection task to perform. Features encode the Cloud Vision API\nvertical to operate on and the number of top-scoring results to return.", - "type": "object", - "properties": { - "type": { - "description": "The feature type.", - "type": "string", - "enumDescriptions": [ - "Unspecified feature type.", - "Run face detection.", - "Run landmark detection.", - "Run logo detection.", - "Run label detection.", - "Run OCR.", - "Run dense text document OCR. Takes precedence when both\nDOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present.", - "Run computer vision models to compute image safe-search properties.", - "Compute a set of image properties, such as the image's dominant colors.", - "Run crop hints.", - "Run web detection." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "FACE_DETECTION", - "LANDMARK_DETECTION", - "LOGO_DETECTION", - "LABEL_DETECTION", - "TEXT_DETECTION", - "DOCUMENT_TEXT_DETECTION", - "SAFE_SEARCH_DETECTION", - "IMAGE_PROPERTIES", - "CROP_HINTS", - "WEB_DETECTION" - ] - }, - "maxResults": { - "description": "Maximum number of results of this type.", - "format": "int32", - "type": "integer" - } - }, - "id": "Feature" - }, - "SafeSearchAnnotation": { - "id": "SafeSearchAnnotation", - "description": "Set of features pertaining to the image, computed by computer vision\nmethods over safe-search verticals (for example, adult, spoof, medical,\nviolence).", - "type": "object", - "properties": { - "medical": { - "description": "Likelihood that this is a medical image.", - "type": "string", - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ] - }, - "violence": { - "description": "Violence likelihood.", - "type": "string", - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ] - }, - "adult": { - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ], - "description": "Represents the adult content likelihood for the image.", - "type": "string" - }, - "spoof": { - "enumDescriptions": [ - "Unknown likelihood.", - "It is very unlikely that the image belongs to the specified vertical.", - "It is unlikely that the image belongs to the specified vertical.", - "It is possible that the image belongs to the specified vertical.", - "It is likely that the image belongs to the specified vertical.", - "It is very likely that the image belongs to the specified vertical." - ], - "enum": [ - "UNKNOWN", - "VERY_UNLIKELY", - "UNLIKELY", - "POSSIBLE", - "LIKELY", - "VERY_LIKELY" - ], - "description": "Spoof likelihood. The likelihood that an modification\nwas made to the image's canonical version to make it appear\nfunny or offensive.", - "type": "string" - } - } - }, - "DominantColorsAnnotation": { - "id": "DominantColorsAnnotation", - "description": "Set of dominant colors and their corresponding scores.", - "type": "object", - "properties": { - "colors": { - "description": "RGB color values with their score and pixel fraction.", - "type": "array", - "items": { - "$ref": "ColorInfo" - } - } - } - }, - "TextAnnotation": { - "id": "TextAnnotation", - "description": "TextAnnotation contains a structured representation of OCR extracted text.\nThe hierarchy of an OCR extracted text structure is like this:\n TextAnnotation -\u003e Page -\u003e Block -\u003e Paragraph -\u003e Word -\u003e Symbol\nEach structural component, starting from Page, may further have their own\nproperties. Properties describe detected languages, breaks etc.. Please\nrefer to the google.cloud.vision.v1.TextAnnotation.TextProperty message\ndefinition below for more detail.", - "type": "object", - "properties": { - "pages": { - "description": "List of pages detected by OCR.", - "type": "array", - "items": { - "$ref": "Page" - } - }, - "text": { - "description": "UTF-8 text detected on the pages.", - "type": "string" - } - } - }, - "DetectedLanguage": { - "id": "DetectedLanguage", - "description": "Detected language for a structural component.", - "type": "object", - "properties": { - "languageCode": { - "description": "The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more\ninformation, see\nhttp://www.unicode.org/reports/tr35/#Unicode_locale_identifier.", - "type": "string" - }, - "confidence": { - "description": "Confidence of detected language. Range [0, 1].", - "format": "float", - "type": "number" - } - } - }, - "Vertex": { - "description": "A vertex represents a 2D point in the image.\nNOTE: the vertex coordinates are in the same scale as the original image.", - "type": "object", - "properties": { - "x": { - "description": "X coordinate.", - "format": "int32", - "type": "integer" - }, - "y": { - "description": "Y coordinate.", - "format": "int32", - "type": "integer" - } - }, - "id": "Vertex" - }, - "TextProperty": { - "id": "TextProperty", - "description": "Additional information detected on the structural component.", - "type": "object", - "properties": { - "detectedLanguages": { - "description": "A list of detected languages together with confidence.", - "type": "array", - "items": { - "$ref": "DetectedLanguage" - } - }, - "detectedBreak": { - "$ref": "DetectedBreak", - "description": "Detected start or end of a text segment." - } - } - }, - "BoundingPoly": { - "id": "BoundingPoly", - "description": "A bounding polygon for the detected image annotation.", - "type": "object", - "properties": { - "vertices": { - "description": "The bounding polygon vertices.", - "type": "array", - "items": { - "$ref": "Vertex" - } - } - } - }, - "WebEntity": { - "id": "WebEntity", - "description": "Entity deduced from similar images on the Internet.", - "type": "object", - "properties": { - "entityId": { - "description": "Opaque entity ID.", - "type": "string" - }, - "description": { - "description": "Canonical description of the entity, in English.", - "type": "string" - }, - "score": { - "description": "Overall relevancy score for the entity.\nNot normalized and not comparable across different image queries.", - "format": "float", - "type": "number" - } - } + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.", + "type": "object" } }, - "protocol": "rest", "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" }, - "canonicalName": "Vision", - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - } - } - } - }, - "rootUrl": "https://vision.googleapis.com/", - "ownerDomain": "google.com", - "name": "vision", - "batchPath": "batch" + "protocol": "rest" } diff --git a/etc/api/webfonts/v1/webfonts-api.json b/etc/api/webfonts/v1/webfonts-api.json index 747d2375dc..d91688b983 100644 --- a/etc/api/webfonts/v1/webfonts-api.json +++ b/etc/api/webfonts/v1/webfonts-api.json @@ -20,7 +20,7 @@ "basePath": "/webfonts/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "webfonts/v1/", - "batchPath": "batch", + "batchPath": "batch/webfonts/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/webmasters/v3/crates/1.0.6-api+20170528 b/etc/api/webmasters/v3/crates/1.0.6-api+20170528 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/webmasters/v3/crates/1.0.6-cli+20170528 b/etc/api/webmasters/v3/crates/1.0.6-cli+20170528 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/webmasters/v3/webmasters-api.json b/etc/api/webmasters/v3/webmasters-api.json index 1e76c34103..83f03e98b9 100644 --- a/etc/api/webmasters/v3/webmasters-api.json +++ b/etc/api/webmasters/v3/webmasters-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/zUsMzrFTrcpSdcH8HPrJyBnjfUY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/FoVh6eGZkMB0Z1f3X5375o8tLXY\"", "discoveryVersion": "v1", "id": "webmasters:v3", "name": "webmasters", "version": "v3", - "revision": "20170517", + "revision": "20170528", "title": "Search Console API", "description": "View Google Search Console data for your verified sites.", "ownerDomain": "google.com", diff --git a/etc/api/youtube/v3/crates/1.0.6-api+20170918 b/etc/api/youtube/v3/crates/1.0.6-api+20170918 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/youtube/v3/youtube-api.json b/etc/api/youtube/v3/youtube-api.json index cbe78ed191..65146c6c3a 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": "\"YWOzh2SDasdU84ArJnpYek-OMdg/f81k8b4sv9uLeywfoj2KpL2xcPg\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/AIWw-yWxHTNchYNbx8LfngbqcZ8\"", "discoveryVersion": "v1", "id": "youtube:v3", "name": "youtube", "canonicalName": "YouTube", "version": "v3", - "revision": "20170130", + "revision": "20170918", "title": "YouTube Data API", "description": "Supports core YouTube features, such as uploading videos, creating and managing playlists, searching for content, and much more.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/youtube/v3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "youtube/v3/", - "batchPath": "batch", + "batchPath": "batch/youtube/v3", "parameters": { "alt": { "type": "string", @@ -1771,7 +1771,7 @@ "ContentRating": { "id": "ContentRating", "type": "object", - "description": "Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 69", + "description": "Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 71", "properties": { "acbRating": { "type": "string", @@ -2807,6 +2807,24 @@ "" ] }, + "menaMpaaRating": { + "type": "string", + "description": "The rating system for MENA countries, a clone of MPAA. It is needed to", + "enum": [ + "menaMpaaG", + "menaMpaaPg", + "menaMpaaPg13", + "menaMpaaR", + "menaMpaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, "mibacRating": { "type": "string", "description": "The video's rating from the Ministero dei Beni e delle Attività Culturali e del Turismo (Italy).", @@ -2895,6 +2913,18 @@ "" ] }, + "mpaatRating": { + "type": "string", + "description": "The rating system for trailer, DVD, and Ad in the US. See http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html.", + "enum": [ + "mpaatGb", + "mpaatRb" + ], + "enumDescriptions": [ + "", + "" + ] + }, "mtrcbRating": { "type": "string", "description": "The video's rating from the Movie and Television Review and Classification Board (Philippines).", @@ -3879,9 +3909,6 @@ "status": { "$ref": "LiveBroadcastStatus", "description": "The status object contains information about the event's status." - }, - "topicDetails": { - "$ref": "LiveBroadcastTopicDetails" } } }, @@ -3947,6 +3974,24 @@ "type": "boolean", "description": "Indicates whether this broadcast has low latency enabled." }, + "latencyPreference": { + "type": "string", + "description": "If both this and enable_low_latency are set, they must match. LATENCY_NORMAL should match enable_low_latency=false LATENCY_LOW should match enable_low_latency=true LATENCY_ULTRA_LOW should have enable_low_latency omitted.", + "enum": [ + "low", + "normal", + "ultraLow" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "mesh": { + "type": "string", + "format": "byte" + }, "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." @@ -3956,9 +4001,11 @@ "description": "The projection format of this broadcast. This defaults to rectangular.", "enum": [ "360", + "mesh", "rectangular" ], "enumDescriptions": [ + "", "", "" ] @@ -4194,56 +4241,6 @@ } } }, - "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" - } - } - }, "LiveChatBan": { "id": "LiveChatBan", "type": "object", @@ -7307,6 +7304,7 @@ "items": { "type": "string", "enum": [ + "hdrVideo", "nonStreamableMov", "sendBestQualityVideo", "spatialAudio", @@ -7318,6 +7316,7 @@ "", "", "", + "", "" ] } @@ -7331,10 +7330,13 @@ "hasEditlist", "inconsistentResolution", "problematicAudioCodec", + "problematicHdrLookupTable", "problematicVideoCodec", "unknownAudioCodec", "unknownContainer", "unknownVideoCodec", + "unsupportedHdrColorMetadata", + "unsupportedHdrPixelFormat", "unsupportedSphericalProjectionType", "unsupportedVrStereoMode" ], @@ -7347,6 +7349,9 @@ "", "", "", + "", + "", + "", "" ] } @@ -7796,6 +7801,11 @@ "httpMethod": "POST", "description": "Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n- Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels.\n- Extract the url property's value from the response that the API returns for step 1.\n- Call the channels.update method to update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl property's value to the URL obtained in step 2.", "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter identifies the YouTube channel to which the banner is uploaded. The channelId parameter was introduced as a required parameter in May 2017. As this was a backward-incompatible change, channelBanners.insert requests that do not specify this parameter will not return an error until six months have passed from the time that the parameter was introduced. Please see the API Terms of Service for the official policy regarding backward incompatible changes and the API revision history for the exact date that the parameter was introduced.", + "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.", @@ -10291,7 +10301,7 @@ "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", "default": "5", "format": "uint32", - "minimum": "0", + "minimum": "1", "maximum": "50", "location": "query" }, diff --git a/etc/api/youtubeanalytics/v1/crates/1.0.6-api+20170925 b/etc/api/youtubeanalytics/v1/crates/1.0.6-api+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/youtubeanalytics/v1/crates/1.0.6-cli+20170925 b/etc/api/youtubeanalytics/v1/crates/1.0.6-cli+20170925 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json b/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json index 6276c153b3..67824c43d0 100644 --- a/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json +++ b/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/tsPMnqp6qkeRW283IiZ3j0pIVgE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Wwas2fOb4cRmT-_jQ0LHI2aJh5Y\"", "discoveryVersion": "v1", "id": "youtubeAnalytics:v1", "name": "youtubeAnalytics", "canonicalName": "YouTube Analytics", "version": "v1", - "revision": "20170517", + "revision": "20170925", "title": "YouTube Analytics API", "description": "Retrieves your YouTube Analytics data.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/youtube/analytics/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "youtube/analytics/v1/", - "batchPath": "batch", + "batchPath": "batch/youtubeAnalytics/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json b/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json index 00ab952b17..2ccd1852c2 100644 --- a/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json +++ b/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Uftqe1sqjmX_hue0SDm3s9nlqZk\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/5Tq-2PG0h9A81sunD_QAIeC7AjQ\"", "discoveryVersion": "v1", "id": "youtubeAnalytics:v1beta1", "name": "youtubeAnalytics", "canonicalName": "YouTube Analytics", "version": "v1beta1", - "revision": "20170517", + "revision": "20170925", "title": "YouTube Analytics API", "description": "Retrieves your YouTube Analytics data.", "ownerDomain": "google.com", @@ -24,7 +24,7 @@ "basePath": "/youtube/analytics/v1beta1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "youtube/analytics/v1beta1/", - "batchPath": "batch", + "batchPath": "batch/youtubeAnalytics/v1beta1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/youtubereporting/v1/crates/1.0.6-api+20170926 b/etc/api/youtubereporting/v1/crates/1.0.6-api+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/youtubereporting/v1/crates/1.0.6-cli+20170926 b/etc/api/youtubereporting/v1/crates/1.0.6-cli+20170926 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/api/youtubereporting/v1/youtubereporting-api.json b/etc/api/youtubereporting/v1/youtubereporting-api.json index f4122e8165..b474632ed1 100644 --- a/etc/api/youtubereporting/v1/youtubereporting-api.json +++ b/etc/api/youtubereporting/v1/youtubereporting-api.json @@ -1,4 +1,577 @@ { + "revision": "20170926", + "documentationLink": "https://developers.google.com/youtube/reporting/v1/reports/", + "id": "youtubereporting:v1", + "title": "YouTube Reporting API", + "ownerName": "Google", + "discoveryVersion": "v1", + "resources": { + "media": { + "methods": { + "download": { + "path": "v1/media/{+resourceName}", + "id": "youtubereporting.media.download", + "description": "Method for media download. Download is supported\non the URI `/v1/media/{+name}?alt=media`.", + "supportsMediaDownload": true, + "httpMethod": "GET", + "parameterOrder": [ + "resourceName" + ], + "response": { + "$ref": "Media" + }, + "parameters": { + "resourceName": { + "pattern": "^.+$", + "location": "path", + "description": "Name of the media that is being downloaded. See\nReadRequest.resource_name.", + "type": "string", + "required": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "flatPath": "v1/media/{mediaId}" + } + } + }, + "jobs": { + "methods": { + "delete": { + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "parameters": { + "onBehalfOfContentOwner": { + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string", + "location": "query" + }, + "jobId": { + "location": "path", + "description": "The ID of the job to delete.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/jobs/{jobId}", + "path": "v1/jobs/{jobId}", + "id": "youtubereporting.jobs.delete", + "description": "Deletes a job.", + "httpMethod": "DELETE", + "parameterOrder": [ + "jobId" + ], + "response": { + "$ref": "Empty" + } + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "jobId" + ], + "response": { + "$ref": "Job" + }, + "parameters": { + "jobId": { + "description": "The ID of the job to retrieve.", + "type": "string", + "required": true, + "location": "path" + }, + "onBehalfOfContentOwner": { + "location": "query", + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "flatPath": "v1/jobs/{jobId}", + "path": "v1/jobs/{jobId}", + "id": "youtubereporting.jobs.get", + "description": "Gets a job." + }, + "list": { + "parameters": { + "includeSystemManaged": { + "description": "If set to true, also system-managed jobs will be returned; otherwise only\nuser-created jobs will be returned. System-managed jobs can neither be\nmodified nor deleted.", + "type": "boolean", + "location": "query" + }, + "pageToken": { + "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportTypesResponse.next_page_token\nreturned in response to the previous call to the `ListJobs` method.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. Server may return fewer jobs than requested.\nIf unspecified, server will pick an appropriate default.", + "type": "integer" + }, + "onBehalfOfContentOwner": { + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "flatPath": "v1/jobs", + "id": "youtubereporting.jobs.list", + "path": "v1/jobs", + "description": "Lists jobs.", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET" + }, + "create": { + "path": "v1/jobs", + "id": "youtubereporting.jobs.create", + "description": "Creates a job and returns it.", + "request": { + "$ref": "Job" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Job" + }, + "parameters": { + "onBehalfOfContentOwner": { + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "flatPath": "v1/jobs" + } + }, + "resources": { + "reports": { + "methods": { + "get": { + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "parameters": { + "onBehalfOfContentOwner": { + "location": "query", + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string" + }, + "reportId": { + "description": "The ID of the report to retrieve.", + "type": "string", + "required": true, + "location": "path" + }, + "jobId": { + "location": "path", + "description": "The ID of the job.", + "type": "string", + "required": true + } + }, + "flatPath": "v1/jobs/{jobId}/reports/{reportId}", + "path": "v1/jobs/{jobId}/reports/{reportId}", + "id": "youtubereporting.jobs.reports.get", + "description": "Gets the metadata of a specific report.", + "httpMethod": "GET", + "parameterOrder": [ + "jobId", + "reportId" + ], + "response": { + "$ref": "Report" + } + }, + "list": { + "description": "Lists reports created by a specific job.\nReturns NOT_FOUND if the job does not exist.", + "response": { + "$ref": "ListReportsResponse" + }, + "parameterOrder": [ + "jobId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "parameters": { + "jobId": { + "description": "The ID of the job.", + "type": "string", + "required": true, + "location": "path" + }, + "createdAfter": { + "location": "query", + "format": "google-datetime", + "description": "If set, only reports created after the specified date/time are returned.", + "type": "string" + }, + "startTimeAtOrAfter": { + "location": "query", + "format": "google-datetime", + "description": "If set, only reports whose start time is greater than or equal the\nspecified date/time are returned.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportsResponse.next_page_token\nreturned in response to the previous call to the `ListReports` method.", + "type": "string" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. Server may return fewer report types than requested.\nIf unspecified, server will pick an appropriate default.", + "type": "integer" + }, + "onBehalfOfContentOwner": { + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string", + "location": "query" + }, + "startTimeBefore": { + "format": "google-datetime", + "description": "If set, only reports whose start time is smaller than the specified\ndate/time are returned.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/jobs/{jobId}/reports", + "id": "youtubereporting.jobs.reports.list", + "path": "v1/jobs/{jobId}/reports" + } + } + } + } + }, + "reportTypes": { + "methods": { + "list": { + "path": "v1/reportTypes", + "id": "youtubereporting.reportTypes.list", + "description": "Lists report types.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListReportTypesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "parameters": { + "onBehalfOfContentOwner": { + "location": "query", + "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", + "type": "string" + }, + "includeSystemManaged": { + "location": "query", + "description": "If set to true, also system-managed report types will be returned;\notherwise only the report types that can be used to create new reporting\njobs will be returned.", + "type": "boolean" + }, + "pageToken": { + "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportTypesResponse.next_page_token\nreturned in response to the previous call to the `ListReportTypes` method.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "format": "int32", + "description": "Requested page size. Server may return fewer report types than requested.\nIf unspecified, server will pick an appropriate default.", + "type": "integer" + } + }, + "flatPath": "v1/reportTypes" + } + } + } + }, + "parameters": { + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "key": { + "location": "query", + "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.", + "type": "string" + }, + "quotaUser": { + "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.", + "type": "string", + "location": "query" + }, + "pp": { + "description": "Pretty-print response.", + "default": "true", + "type": "boolean", + "location": "query" + }, + "bearer_token": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "type": "boolean" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" + }, + "uploadType": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "$.xgafv": { + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, + "alt": { + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", + "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" + } + }, + "schemas": { + "ReportType": { + "description": "A report type.", + "type": "object", + "properties": { + "systemManaged": { + "description": "True if this a system-managed report type; otherwise false. Reporting jobs\nfor system-managed report types are created automatically and can thus not\nbe used in the `CreateJob` method.", + "type": "boolean" + }, + "id": { + "description": "The ID of the report type (max. 100 characters).", + "type": "string" + }, + "deprecateTime": { + "format": "google-datetime", + "description": "The date/time when this report type was/will be deprecated.", + "type": "string" + }, + "name": { + "description": "The name of the report type (max. 100 characters).", + "type": "string" + } + }, + "id": "ReportType" + }, + "ListReportTypesResponse": { + "id": "ListReportTypesResponse", + "description": "Response message for ReportingService.ListReportTypes.", + "type": "object", + "properties": { + "reportTypes": { + "description": "The list of report types.", + "items": { + "$ref": "ReportType" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results.\nPass this value in the\nListReportTypesRequest.page_token\nfield in the subsequent call to `ListReportTypes` method to retrieve the next\npage of results.", + "type": "string" + } + } + }, + "Report": { + "description": "A report's metadata including the URL from which the report itself can be\ndownloaded.", + "type": "object", + "properties": { + "id": { + "description": "The server-generated ID of the report.", + "type": "string" + }, + "jobExpireTime": { + "format": "google-datetime", + "description": "The date/time when the job this report belongs to will expire/expired.", + "type": "string" + }, + "endTime": { + "format": "google-datetime", + "description": "The end of the time period that the report instance covers. The value is\nexclusive.", + "type": "string" + }, + "downloadUrl": { + "description": "The URL from which the report can be downloaded (max. 1000 characters).", + "type": "string" + }, + "startTime": { + "format": "google-datetime", + "description": "The start of the time period that the report instance covers. The value is\ninclusive.", + "type": "string" + }, + "createTime": { + "format": "google-datetime", + "description": "The date/time when this report was created.", + "type": "string" + }, + "jobId": { + "description": "The ID of the job that created this report.", + "type": "string" + } + }, + "id": "Report" + }, + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "type": "object", + "properties": {} + }, + "ListJobsResponse": { + "id": "ListJobsResponse", + "description": "Response message for ReportingService.ListJobs.", + "type": "object", + "properties": { + "jobs": { + "description": "The list of jobs.", + "items": { + "$ref": "Job" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results.\nPass this value in the\nListJobsRequest.page_token\nfield in the subsequent call to `ListJobs` method to retrieve the next\npage of results.", + "type": "string" + } + } + }, + "Job": { + "description": "A job creating reports of a specific type.", + "type": "object", + "properties": { + "id": { + "description": "The server-generated ID of the job (max. 40 characters).", + "type": "string" + }, + "systemManaged": { + "description": "True if this a system-managed job that cannot be modified by the user;\notherwise false.", + "type": "boolean" + }, + "createTime": { + "format": "google-datetime", + "description": "The creation date/time of the job.", + "type": "string" + }, + "reportTypeId": { + "description": "The type of reports this job creates. Corresponds to the ID of a\nReportType.", + "type": "string" + }, + "expireTime": { + "format": "google-datetime", + "description": "The date/time when this job will expire/expired. After a job expired, no\nnew reports are generated.", + "type": "string" + }, + "name": { + "description": "The name of the job (max. 100 characters).", + "type": "string" + } + }, + "id": "Job" + }, + "ListReportsResponse": { + "id": "ListReportsResponse", + "description": "Response message for ReportingService.ListReports.", + "type": "object", + "properties": { + "reports": { + "description": "The list of report types.", + "items": { + "$ref": "Report" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results.\nPass this value in the\nListReportsRequest.page_token\nfield in the subsequent call to `ListReports` method to retrieve the next\npage of results.", + "type": "string" + } + } + }, + "Media": { + "description": "Media resource.", + "type": "object", + "properties": { + "resourceName": { + "description": "Name of the media resource.", + "type": "string" + } + }, + "id": "Media" + } + }, + "protocol": "rest", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, + "version": "v1", "baseUrl": "https://youtubereporting.googleapis.com/", "canonicalName": "YouTube Reporting", "auth": { @@ -13,585 +586,12 @@ } } }, - "servicePath": "", "kind": "discovery#restDescription", "description": "Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.", + "servicePath": "", "rootUrl": "https://youtubereporting.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "youtubereporting", - "batchPath": "batch", - "id": "youtubereporting:v1", - "documentationLink": "https://developers.google.com/youtube/reporting/v1/reports/", - "revision": "20170520", - "title": "YouTube Reporting API", - "discoveryVersion": "v1", - "ownerName": "Google", - "resources": { - "jobs": { - "methods": { - "delete": { - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "parameters": { - "jobId": { - "location": "path", - "description": "The ID of the job to delete.", - "required": true, - "type": "string" - }, - "onBehalfOfContentOwner": { - "type": "string", - "location": "query", - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel)." - } - }, - "flatPath": "v1/jobs/{jobId}", - "id": "youtubereporting.jobs.delete", - "path": "v1/jobs/{jobId}", - "description": "Deletes a job.", - "httpMethod": "DELETE", - "parameterOrder": [ - "jobId" - ], - "response": { - "$ref": "Empty" - } - }, - "list": { - "flatPath": "v1/jobs", - "path": "v1/jobs", - "id": "youtubereporting.jobs.list", - "description": "Lists jobs.", - "response": { - "$ref": "ListJobsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "parameters": { - "pageToken": { - "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportTypesResponse.next_page_token\nreturned in response to the previous call to the `ListJobs` method.", - "type": "string", - "location": "query" - }, - "includeSystemManaged": { - "description": "If set to true, also system-managed jobs will be returned; otherwise only\nuser-created jobs will be returned. System-managed jobs can neither be\nmodified nor deleted.", - "type": "boolean", - "location": "query" - }, - "pageSize": { - "type": "integer", - "location": "query", - "description": "Requested page size. Server may return fewer jobs than requested.\nIf unspecified, server will pick an appropriate default.", - "format": "int32" - }, - "onBehalfOfContentOwner": { - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", - "type": "string", - "location": "query" - } - } - }, - "get": { - "id": "youtubereporting.jobs.get", - "path": "v1/jobs/{jobId}", - "description": "Gets a job.", - "httpMethod": "GET", - "parameterOrder": [ - "jobId" - ], - "response": { - "$ref": "Job" - }, - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "parameters": { - "onBehalfOfContentOwner": { - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", - "type": "string", - "location": "query" - }, - "jobId": { - "location": "path", - "description": "The ID of the job to retrieve.", - "required": true, - "type": "string" - } - }, - "flatPath": "v1/jobs/{jobId}" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [], - "response": { - "$ref": "Job" - }, - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "parameters": { - "onBehalfOfContentOwner": { - "type": "string", - "location": "query", - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel)." - } - }, - "flatPath": "v1/jobs", - "id": "youtubereporting.jobs.create", - "path": "v1/jobs", - "description": "Creates a job and returns it.", - "request": { - "$ref": "Job" - } - } - }, - "resources": { - "reports": { - "methods": { - "list": { - "response": { - "$ref": "ListReportsResponse" - }, - "parameterOrder": [ - "jobId" - ], - "httpMethod": "GET", - "parameters": { - "pageSize": { - "description": "Requested page size. Server may return fewer report types than requested.\nIf unspecified, server will pick an appropriate default.", - "format": "int32", - "type": "integer", - "location": "query" - }, - "onBehalfOfContentOwner": { - "location": "query", - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", - "type": "string" - }, - "startTimeBefore": { - "description": "If set, only reports whose start time is smaller than the specified\ndate/time are returned.", - "format": "google-datetime", - "type": "string", - "location": "query" - }, - "jobId": { - "location": "path", - "description": "The ID of the job.", - "required": true, - "type": "string" - }, - "createdAfter": { - "location": "query", - "description": "If set, only reports created after the specified date/time are returned.", - "format": "google-datetime", - "type": "string" - }, - "startTimeAtOrAfter": { - "description": "If set, only reports whose start time is greater than or equal the\nspecified date/time are returned.", - "format": "google-datetime", - "type": "string", - "location": "query" - }, - "pageToken": { - "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportsResponse.next_page_token\nreturned in response to the previous call to the `ListReports` method.", - "type": "string", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "flatPath": "v1/jobs/{jobId}/reports", - "path": "v1/jobs/{jobId}/reports", - "id": "youtubereporting.jobs.reports.list", - "description": "Lists reports created by a specific job.\nReturns NOT_FOUND if the job does not exist." - }, - "get": { - "description": "Gets the metadata of a specific report.", - "httpMethod": "GET", - "parameterOrder": [ - "jobId", - "reportId" - ], - "response": { - "$ref": "Report" - }, - "parameters": { - "reportId": { - "required": true, - "type": "string", - "location": "path", - "description": "The ID of the report to retrieve." - }, - "jobId": { - "description": "The ID of the job.", - "required": true, - "type": "string", - "location": "path" - }, - "onBehalfOfContentOwner": { - "location": "query", - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "flatPath": "v1/jobs/{jobId}/reports/{reportId}", - "id": "youtubereporting.jobs.reports.get", - "path": "v1/jobs/{jobId}/reports/{reportId}" - } - } - } - } - }, - "reportTypes": { - "methods": { - "list": { - "httpMethod": "GET", - "parameterOrder": [], - "response": { - "$ref": "ListReportTypesResponse" - }, - "parameters": { - "pageToken": { - "location": "query", - "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportTypesResponse.next_page_token\nreturned in response to the previous call to the `ListReportTypes` method.", - "type": "string" - }, - "includeSystemManaged": { - "description": "If set to true, also system-managed report types will be returned;\notherwise only the report types that can be used to create new reporting\njobs will be returned.", - "type": "boolean", - "location": "query" - }, - "pageSize": { - "location": "query", - "description": "Requested page size. Server may return fewer report types than requested.\nIf unspecified, server will pick an appropriate default.", - "format": "int32", - "type": "integer" - }, - "onBehalfOfContentOwner": { - "location": "query", - "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "flatPath": "v1/reportTypes", - "id": "youtubereporting.reportTypes.list", - "path": "v1/reportTypes", - "description": "Lists report types." - } - } - }, - "media": { - "methods": { - "download": { - "parameters": { - "resourceName": { - "description": "Name of the media that is being downloaded. See\nReadRequest.resource_name.", - "required": true, - "type": "string", - "pattern": "^.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", - "https://www.googleapis.com/auth/yt-analytics.readonly" - ], - "flatPath": "v1/media/{mediaId}", - "id": "youtubereporting.media.download", - "path": "v1/media/{+resourceName}", - "description": "Method for media download. Download is supported\non the URI `/v1/media/{+name}?alt=media`.", - "supportsMediaDownload": true, - "httpMethod": "GET", - "parameterOrder": [ - "resourceName" - ], - "response": { - "$ref": "Media" - } - } - } - } - }, - "parameters": { - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" - }, - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" - }, - "prettyPrint": { - "description": "Returns response with indentations and line breaks.", - "type": "boolean", - "default": "true", - "location": "query" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "$.xgafv": { - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ] - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, - "alt": { - "location": "query", - "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", - "enumDescriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ] - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" - }, - "key": { - "location": "query", - "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.", - "type": "string" - }, - "quotaUser": { - "location": "query", - "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.", - "type": "string" - }, - "pp": { - "description": "Pretty-print response.", - "type": "boolean", - "default": "true", - "location": "query" - } - }, - "schemas": { - "ListJobsResponse": { - "properties": { - "nextPageToken": { - "type": "string", - "description": "A token to retrieve next page of results.\nPass this value in the\nListJobsRequest.page_token\nfield in the subsequent call to `ListJobs` method to retrieve the next\npage of results." - }, - "jobs": { - "description": "The list of jobs.", - "type": "array", - "items": { - "$ref": "Job" - } - } - }, - "id": "ListJobsResponse", - "description": "Response message for ReportingService.ListJobs.", - "type": "object" - }, - "Job": { - "description": "A job creating reports of a specific type.", - "type": "object", - "properties": { - "createTime": { - "type": "string", - "description": "The creation date/time of the job.", - "format": "google-datetime" - }, - "reportTypeId": { - "description": "The type of reports this job creates. Corresponds to the ID of a\nReportType.", - "type": "string" - }, - "expireTime": { - "description": "The date/time when this job will expire/expired. After a job expired, no\nnew reports are generated.", - "format": "google-datetime", - "type": "string" - }, - "name": { - "description": "The name of the job (max. 100 characters).", - "type": "string" - }, - "systemManaged": { - "description": "True if this a system-managed job that cannot be modified by the user;\notherwise false.", - "type": "boolean" - }, - "id": { - "description": "The server-generated ID of the job (max. 40 characters).", - "type": "string" - } - }, - "id": "Job" - }, - "ListReportsResponse": { - "description": "Response message for ReportingService.ListReports.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "A token to retrieve next page of results.\nPass this value in the\nListReportsRequest.page_token\nfield in the subsequent call to `ListReports` method to retrieve the next\npage of results.", - "type": "string" - }, - "reports": { - "description": "The list of report types.", - "type": "array", - "items": { - "$ref": "Report" - } - } - }, - "id": "ListReportsResponse" - }, - "Media": { - "description": "Media resource.", - "type": "object", - "properties": { - "resourceName": { - "description": "Name of the media resource.", - "type": "string" - } - }, - "id": "Media" - }, - "ReportType": { - "description": "A report type.", - "type": "object", - "properties": { - "name": { - "description": "The name of the report type (max. 100 characters).", - "type": "string" - }, - "id": { - "description": "The ID of the report type (max. 100 characters).", - "type": "string" - }, - "systemManaged": { - "type": "boolean", - "description": "True if this a system-managed report type; otherwise false. Reporting jobs\nfor system-managed report types are created automatically and can thus not\nbe used in the `CreateJob` method." - }, - "deprecateTime": { - "description": "The date/time when this report type was/will be deprecated.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "ReportType" - }, - "ListReportTypesResponse": { - "type": "object", - "properties": { - "reportTypes": { - "description": "The list of report types.", - "type": "array", - "items": { - "$ref": "ReportType" - } - }, - "nextPageToken": { - "description": "A token to retrieve next page of results.\nPass this value in the\nListReportTypesRequest.page_token\nfield in the subsequent call to `ListReportTypes` method to retrieve the next\npage of results.", - "type": "string" - } - }, - "id": "ListReportTypesResponse", - "description": "Response message for ReportingService.ListReportTypes." - }, - "Report": { - "description": "A report's metadata including the URL from which the report itself can be\ndownloaded.", - "type": "object", - "properties": { - "createTime": { - "description": "The date/time when this report was created.", - "format": "google-datetime", - "type": "string" - }, - "jobId": { - "description": "The ID of the job that created this report.", - "type": "string" - }, - "id": { - "description": "The server-generated ID of the report.", - "type": "string" - }, - "jobExpireTime": { - "description": "The date/time when the job this report belongs to will expire/expired.", - "format": "google-datetime", - "type": "string" - }, - "endTime": { - "type": "string", - "description": "The end of the time period that the report instance covers. The value is\nexclusive.", - "format": "google-datetime" - }, - "downloadUrl": { - "description": "The URL from which the report can be downloaded (max. 1000 characters).", - "type": "string" - }, - "startTime": { - "description": "The start of the time period that the report instance covers. The value is\ninclusive.", - "format": "google-datetime", - "type": "string" - } - }, - "id": "Report" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "type": "object", - "properties": {}, - "id": "Empty" - } - }, - "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, - "protocol": "rest", - "version": "v1" + "batchPath": "batch" } diff --git a/gen/adexchangebuyer1d3-cli/Cargo.toml b/gen/adexchangebuyer1d3-cli/Cargo.toml index 9d8209d61d..a46c3d0682 100644 --- a/gen/adexchangebuyer1d3-cli/Cargo.toml +++ b/gen/adexchangebuyer1d3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3-cli" -version = "1.0.6+20170504" +version = "1.0.6+20170810" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-adexchangebuyer1d3] path = "../adexchangebuyer1d3" -version = "1.0.6+20170504" +version = "1.0.6+20170810" diff --git a/gen/adexchangebuyer1d3-cli/README.md b/gen/adexchangebuyer1d3-cli/README.md index 5fdd4f1603..efb1ba35f1 100644 --- a/gen/adexchangebuyer1d3-cli/README.md +++ b/gen/adexchangebuyer1d3-cli/README.md @@ -25,7 +25,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 *20170504*. The CLI is at version *1.0.6*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20170810*. The CLI is at version *1.0.6*. ```bash adexchangebuyer1d3 [options] diff --git a/gen/adexchangebuyer1d3-cli/mkdocs.yml b/gen/adexchangebuyer1d3-cli/mkdocs.yml index 8b4f066b22..125ae41ec2 100644 --- a/gen/adexchangebuyer1d3-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v1.0.6+20170504 +site_name: Ad Exchange Buyer v1.0.6+20170810 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d3-cli site_description: A complete library to interact with Ad Exchange Buyer (protocol v1.3) diff --git a/gen/adexchangebuyer1d3-cli/src/main.rs b/gen/adexchangebuyer1d3-cli/src/main.rs index 6fb6af4f9b..7680faed22 100644 --- a/gen/adexchangebuyer1d3-cli/src/main.rs +++ b/gen/adexchangebuyer1d3-cli/src/main.rs @@ -2304,7 +2304,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d3") .author("Sebastian Thiel ") - .version("1.0.6+20170504") + .version("1.0.6+20170810") .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 3818372c48..b0c5fbaaa0 100644 --- a/gen/adexchangebuyer1d3/Cargo.toml +++ b/gen/adexchangebuyer1d3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer1d3" -version = "1.0.6+20170504" +version = "1.0.6+20170810" 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" homepage = "https://developers.google.com/ad-exchange/buyer-rest" -documentation = "https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504" +documentation = "https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810" license = "MIT" keywords = ["adexchangebuyer", "google", "protocol", "web", "api"] diff --git a/gen/adexchangebuyer1d3/README.md b/gen/adexchangebuyer1d3/README.md index 2ba2083ac9..1989dba4b4 100644 --- a/gen/adexchangebuyer1d3/README.md +++ b/gen/adexchangebuyer1d3/README.md @@ -5,28 +5,28 @@ 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 *1.0.6+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Ad Exchange Buyer* crate version *1.0.6+20170810*, where *20170810* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. 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). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html) ... -* [accounts](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.Account.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.AccountUpdateCall.html) -* [billing info](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.BillingInfo.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.BillingInfoListCall.html) -* [budget](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.Budget.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.BudgetUpdateCall.html) -* [creatives](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.Creative.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.CreativeInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.CreativeListCall.html) -* [direct deals](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.DirectDeal.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.DirectDealGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.DirectDealListCall.html) -* [performance report](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PerformanceReport.html) - * [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PerformanceReportListCall.html) -* [pretargeting config](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfig.html) - * [*delete*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigUpdateCall.html) +* [accounts](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.Account.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.AccountUpdateCall.html) +* [billing info](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.BillingInfo.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.BillingInfoListCall.html) +* [budget](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.Budget.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.BudgetUpdateCall.html) +* [creatives](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.Creative.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.CreativeInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.CreativeListCall.html) +* [direct deals](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.DirectDeal.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.DirectDealGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.DirectDealListCall.html) +* [performance report](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PerformanceReport.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PerformanceReportListCall.html) +* [pretargeting config](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfig.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.PretargetingConfigUpdateCall.html) @@ -35,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/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")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/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](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/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](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/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](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/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](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170504/google_adexchangebuyer1d3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer1d3/1.0.6+20170810/google_adexchangebuyer1d3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index 11fc3a7631..cbe093254e 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 *1.0.6+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.6+20170810*, where *20170810* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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/adexchangebuyer1d4-cli/Cargo.toml b/gen/adexchangebuyer1d4-cli/Cargo.toml index e81dd65b05..d1741714b6 100644 --- a/gen/adexchangebuyer1d4-cli/Cargo.toml +++ b/gen/adexchangebuyer1d4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d4-cli" -version = "1.0.6+20170504" +version = "1.0.6+20170810" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d4-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-adexchangebuyer1d4] path = "../adexchangebuyer1d4" -version = "1.0.6+20170504" +version = "1.0.6+20170810" diff --git a/gen/adexchangebuyer1d4-cli/README.md b/gen/adexchangebuyer1d4-cli/README.md index 30ac7f2aa0..7ee5482d0c 100644 --- a/gen/adexchangebuyer1d4-cli/README.md +++ b/gen/adexchangebuyer1d4-cli/README.md @@ -25,7 +25,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 *20170504*. The CLI is at version *1.0.6*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20170810*. The CLI is at version *1.0.6*. ```bash adexchangebuyer1d4 [options] diff --git a/gen/adexchangebuyer1d4-cli/mkdocs.yml b/gen/adexchangebuyer1d4-cli/mkdocs.yml index 8e8e96f7b0..7377244399 100644 --- a/gen/adexchangebuyer1d4-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v1.0.6+20170504 +site_name: Ad Exchange Buyer v1.0.6+20170810 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d4-cli site_description: A complete library to interact with Ad Exchange Buyer (protocol v1.4) diff --git a/gen/adexchangebuyer1d4-cli/src/main.rs b/gen/adexchangebuyer1d4-cli/src/main.rs index 7cf84f9087..4fe06f2913 100644 --- a/gen/adexchangebuyer1d4-cli/src/main.rs +++ b/gen/adexchangebuyer1d4-cli/src/main.rs @@ -4086,7 +4086,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d4") .author("Sebastian Thiel ") - .version("1.0.6+20170504") + .version("1.0.6+20170810") .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_adexchangebuyer1d4_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer1d4/Cargo.toml b/gen/adexchangebuyer1d4/Cargo.toml index a402ee2173..d0354d265c 100644 --- a/gen/adexchangebuyer1d4/Cargo.toml +++ b/gen/adexchangebuyer1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer1d4" -version = "1.0.6+20170504" +version = "1.0.6+20170810" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d4" homepage = "https://developers.google.com/ad-exchange/buyer-rest" -documentation = "https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504" +documentation = "https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810" license = "MIT" keywords = ["adexchangebuyer", "google", "protocol", "web", "api"] diff --git a/gen/adexchangebuyer1d4/README.md b/gen/adexchangebuyer1d4/README.md index 9c194358e4..18af5db904 100644 --- a/gen/adexchangebuyer1d4/README.md +++ b/gen/adexchangebuyer1d4/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d4` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *1.0.6+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Ad Exchange Buyer* crate version *1.0.6+20170810*, where *20170810* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Ad Exchange Buyer* *v1d4* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html) ... -* [accounts](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.Account.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.AccountUpdateCall.html) -* [billing info](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.BillingInfo.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.BillingInfoListCall.html) -* [budget](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.Budget.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.BudgetUpdateCall.html) -* [creatives](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.Creative.html) - * [*add deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.CreativeAddDealCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.CreativeListCall.html), [*list deals*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.CreativeListDealCall.html) and [*remove deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.CreativeRemoveDealCall.html) +* [accounts](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.Account.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.AccountUpdateCall.html) +* [billing info](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.BillingInfo.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.BillingInfoListCall.html) +* [budget](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.Budget.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.BudgetUpdateCall.html) +* [creatives](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.Creative.html) + * [*add deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.CreativeAddDealCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.CreativeListCall.html), [*list deals*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.CreativeListDealCall.html) and [*remove deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.CreativeRemoveDealCall.html) * marketplacedeals - * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplacedealDeleteCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplacedealInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplacedealListCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplacedealUpdateCall.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplacedealDeleteCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplacedealInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplacedealListCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplacedealUpdateCall.html) * marketplacenotes - * [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplacenoteInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplacenoteListCall.html) + * [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplacenoteInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplacenoteListCall.html) * marketplaceprivateauction - * [*updateproposal*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.MarketplaceprivateauctionUpdateproposalCall.html) -* [performance report](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PerformanceReport.html) - * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PerformanceReportListCall.html) -* [pretargeting config](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfig.html) - * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigUpdateCall.html) -* [products](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.Product.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProductGetCall.html) and [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProductSearchCall.html) -* [proposals](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.Proposal.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProposalGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProposalInsertCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProposalPatchCall.html), [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProposalSearchCall.html), [*setupcomplete*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProposalSetupcompleteCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.ProposalUpdateCall.html) + * [*updateproposal*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.MarketplaceprivateauctionUpdateproposalCall.html) +* [performance report](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PerformanceReport.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PerformanceReportListCall.html) +* [pretargeting config](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfig.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PretargetingConfigUpdateCall.html) +* [products](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.Product.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProductGetCall.html) and [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProductSearchCall.html) +* [proposals](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.Proposal.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProposalGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProposalInsertCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProposalPatchCall.html), [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProposalSearchCall.html), [*setupcomplete*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProposalSetupcompleteCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.ProposalUpdateCall.html) * pubprofiles - * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.PubprofileListCall.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.PubprofileListCall.html) @@ -45,17 +45,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -149,17 +149,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/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")`. @@ -169,29 +169,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/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](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/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](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/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](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/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](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170504/google_adexchangebuyer1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer1d4/1.0.6+20170810/google_adexchangebuyer1d4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer1d4/src/lib.rs b/gen/adexchangebuyer1d4/src/lib.rs index d369b65dc9..fd34ea9423 100644 --- a/gen/adexchangebuyer1d4/src/lib.rs +++ b/gen/adexchangebuyer1d4/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 *1.0.6+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.6+20170810*, where *20170810* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Ad Exchange Buyer* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). @@ -1739,7 +1739,7 @@ pub struct PublisherProfileApiProto { /// Unique Id for publisher profile. #[serde(rename="publisherProfileId")] pub publisher_profile_id: Option, - /// The account id of the seller. + /// Deprecated: use the seller.account_id. The account id of the seller. #[serde(rename="accountId")] pub account_id: Option, /// Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#publisherProfileApiProto". diff --git a/gen/adexperiencereport1-cli/Cargo.toml b/gen/adexperiencereport1-cli/Cargo.toml new file mode 100644 index 0000000000..d4820f3ce6 --- /dev/null +++ b/gen/adexperiencereport1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-adexperiencereport1-cli" +version = "1.0.6+20170918" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Ad Experience Report (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1-cli" +homepage = "https://developers.google.com/ad-experience-report/" +documentation = "http://byron.github.io/google-apis-rs/google_adexperiencereport1_cli" +license = "MIT" +keywords = ["adexperiencereport", "google", "cli"] + +[[bin]] +name = "adexperiencereport1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-adexperiencereport1] +path = "../adexperiencereport1" +version = "1.0.6+20170918" diff --git a/gen/adexperiencereport1-cli/LICENSE.md b/gen/adexperiencereport1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/adexperiencereport1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/adexperiencereport1-cli/README.md b/gen/adexperiencereport1-cli/README.md new file mode 100644 index 0000000000..32f428b845 --- /dev/null +++ b/gen/adexperiencereport1-cli/README.md @@ -0,0 +1,116 @@ + +The `adexperiencereport1` command-line interface *(CLI)* allows to use most features of the *Google Ad Experience Report* 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 *Ad Experience Report* API can be found at the +[official documentation site](https://developers.google.com/ad-experience-report/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-adexperiencereport1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1-cli). + +# Usage + +This documentation was generated from the *Ad Experience Report* API at revision *20170918*. The CLI is at version *1.0.6*. + +```bash +adexperiencereport1 [options] + sites + get [-p ]... [-o ] + violating-sites + list [-p ]... [-o ] + adexperiencereport1 --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 `adexperiencereport1-`. 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/adexperiencereport1-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/adexperiencereport1-secret.json`, assuming that the required *adexperiencereport* 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. `adexperiencereport1 --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/adexperiencereport1-cli/mkdocs.yml b/gen/adexperiencereport1-cli/mkdocs.yml new file mode 100644 index 0000000000..c2f38a3025 --- /dev/null +++ b/gen/adexperiencereport1-cli/mkdocs.yml @@ -0,0 +1,18 @@ +site_name: Ad Experience Report v1.0.6+20170918 +site_url: http://byron.github.io/google-apis-rs/google-adexperiencereport1-cli +site_description: A complete library to interact with Ad Experience Report (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['sites_get.md', 'Sites', 'Get'] +- ['violating-sites_list.md', 'Violating Sites', 'List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/adexperiencereport1-cli/src/cmn.rs b/gen/adexperiencereport1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/adexperiencereport1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/adexperiencereport1-cli/src/main.rs b/gen/adexperiencereport1-cli/src/main.rs new file mode 100644 index 0000000000..5129cbdd2f --- /dev/null +++ b/gen/adexperiencereport1-cli/src/main.rs @@ -0,0 +1,413 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_adexperiencereport1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::AdExperienceReport>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _sites_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sites().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _violating_sites_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.violating_sites().list(); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("sites", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._sites_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("sites".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("violating-sites", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._violating_sites_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("violating-sites".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<'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, "adexperiencereport1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "adexperiencereport1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::AdExperienceReport::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 = [ + ("sites", "methods: 'get'", vec![ + ("get", + Some(r##"Gets a summary of the ad experience rating of a site."##), + "Details at http://byron.github.io/google-apis-rs/google_adexperiencereport1_cli/sites_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The required site name. It should be the site property whose ad experiences + may have been reviewed, and it should be URL-encoded. For example, + sites/https%3A%2F%2Fwww.google.com. The server will return an error of + BAD_REQUEST if this field is not filled in. Note that if the site property + is not yet verified in Search Console, the reportUrl field returned by the + API will lead to the verification page, prompting the user to go through + that process before they can gain access to the Ad Experience Report."##), + 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)), + ]), + ]), + + ("violating-sites", "methods: 'list'", vec![ + ("list", + Some(r##"Lists sites with Ad Experience Report statuses of "Failing" or "Warning"."##), + "Details at http://byron.github.io/google-apis-rs/google_adexperiencereport1_cli/violating-sites_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)), + ]), + ]), + + ]; + + let mut app = App::new("adexperiencereport1") + .author("Sebastian Thiel ") + .version("1.0.6+20170918") + .about("View Ad Experience Report data, and get a list of sites that have a significant number of annoying ads.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexperiencereport1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/adexperiencereport1/Cargo.toml b/gen/adexperiencereport1/Cargo.toml new file mode 100644 index 0000000000..d2e820ee71 --- /dev/null +++ b/gen/adexperiencereport1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-adexperiencereport1" +version = "1.0.6+20170918" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Ad Experience Report (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1" +homepage = "https://developers.google.com/ad-experience-report/" +documentation = "https://docs.rs/google-adexperiencereport1/1.0.6+20170918" +license = "MIT" +keywords = ["adexperiencereport", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/adexperiencereport1/LICENSE.md b/gen/adexperiencereport1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/adexperiencereport1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/adexperiencereport1/README.md b/gen/adexperiencereport1/README.md new file mode 100644 index 0000000000..b3f6981a56 --- /dev/null +++ b/gen/adexperiencereport1/README.md @@ -0,0 +1,176 @@ + +The `google-adexperiencereport1` library allows access to all features of the *Google Ad Experience Report* service. + +This documentation was generated from *Ad Experience Report* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *adexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Ad Experience Report* *v1* API can be found at the +[official documentation site](https://developers.google.com/ad-experience-report/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.AdExperienceReport.html) ... + +* sites + * [*get*](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.SiteGetCall.html) +* violating sites + * [*list*](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.ViolatingSiteListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.AdExperienceReport.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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.sites().get(...).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-adexperiencereport1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_adexperiencereport1 as adexperiencereport1; +use adexperiencereport1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use adexperiencereport1::AdExperienceReport; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sites().get("name") + .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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/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 **adexperiencereport1** 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-rsblob/master/LICENSE.md diff --git a/gen/adexperiencereport1/src/cmn.rs b/gen/adexperiencereport1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/adexperiencereport1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/adexperiencereport1/src/lib.rs b/gen/adexperiencereport1/src/lib.rs new file mode 100644 index 0000000000..d6e764bc09 --- /dev/null +++ b/gen/adexperiencereport1/src/lib.rs @@ -0,0 +1,1037 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Ad Experience Report* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *adexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Ad Experience Report* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/ad-experience-report/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.AdExperienceReport.html) ... +//! +//! * sites +//! * [*get*](struct.SiteGetCall.html) +//! * violating sites +//! * [*list*](struct.ViolatingSiteListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.AdExperienceReport.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.sites().get(...).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-adexperiencereport1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_adexperiencereport1 as adexperiencereport1; +//! use adexperiencereport1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use adexperiencereport1::AdExperienceReport; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sites().get("name") +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Test scope for access to the Zoo service + XapiZoo, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::XapiZoo => "https://www.googleapis.com/auth/xapi.zoo", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::XapiZoo + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all AdExperienceReport related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_adexperiencereport1 as adexperiencereport1; +/// use adexperiencereport1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use adexperiencereport1::AdExperienceReport; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sites().get("name") +/// .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 AdExperienceReport { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for AdExperienceReport {} + +impl<'a, C, A> AdExperienceReport + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> AdExperienceReport { + AdExperienceReport { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://adexperiencereport.googleapis.com/".to_string(), + _root_url: "https://adexperiencereport.googleapis.com/".to_string(), + } + } + + pub fn sites(&'a self) -> SiteMethods<'a, C, A> { + SiteMethods { hub: &self } + } + pub fn violating_sites(&'a self) -> ViolatingSiteMethods<'a, C, A> { + ViolatingSiteMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://adexperiencereport.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://adexperiencereport.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Summary of the ad experience rating of a site for a specific platform. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlatformSummary { + /// Whether the site is currently under review. + #[serde(rename="underReview")] + pub under_review: Option, + /// The date on which ad filtering begins. + #[serde(rename="enforcementTime")] + pub enforcement_time: Option, + /// The last time that the site changed status. + #[serde(rename="lastChangeTime")] + pub last_change_time: Option, + /// The ad filtering status of the site. + #[serde(rename="filterStatus")] + pub filter_status: Option, + /// The assigned regions for the site and platform. + pub region: Option>, + /// A link that leads to a full ad experience report. + #[serde(rename="reportUrl")] + pub report_url: Option, + /// The status of the site reviewed for the Better Ads Standards. + #[serde(rename="betterAdsStatus")] + pub better_ads_status: Option, +} + +impl Part for PlatformSummary {} + + +/// Response message for GetSiteSummary. +/// +/// # 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 sites](struct.SiteGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SiteSummaryResponse { + /// The name of the site reviewed. + #[serde(rename="reviewedSite")] + pub reviewed_site: Option, + /// Summary for the desktop review of the site. + #[serde(rename="desktopSummary")] + pub desktop_summary: Option, + /// Summary for the mobile review of the site. + #[serde(rename="mobileSummary")] + pub mobile_summary: Option, +} + +impl ResponseResult for SiteSummaryResponse {} + + +/// Response message for ListViolatingSites. +/// +/// # 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 violating sites](struct.ViolatingSiteListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ViolatingSitesResponse { + /// A list of summaries of violating sites. + #[serde(rename="violatingSites")] + pub violating_sites: Option>, +} + +impl ResponseResult for ViolatingSitesResponse {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *site* resources. +/// It is not used directly, but through the `AdExperienceReport` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_adexperiencereport1 as adexperiencereport1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use adexperiencereport1::AdExperienceReport; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` +/// // to build up your call. +/// let rb = hub.sites(); +/// # } +/// ``` +pub struct SiteMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AdExperienceReport, +} + +impl<'a, C, A> MethodsBuilder for SiteMethods<'a, C, A> {} + +impl<'a, C, A> SiteMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a summary of the ad experience rating of a site. + /// + /// # Arguments + /// + /// * `name` - The required site name. It should be the site property whose ad experiences + /// may have been reviewed, and it should be URL-encoded. For example, + /// sites/https%3A%2F%2Fwww.google.com. The server will return an error of + /// BAD_REQUEST if this field is not filled in. Note that if the site property + /// is not yet verified in Search Console, the reportUrl field returned by the + /// API will lead to the verification page, prompting the user to go through + /// that process before they can gain access to the Ad Experience Report. + pub fn get(&self, name: &str) -> SiteGetCall<'a, C, A> { + SiteGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *violatingSite* resources. +/// It is not used directly, but through the `AdExperienceReport` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_adexperiencereport1 as adexperiencereport1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use adexperiencereport1::AdExperienceReport; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.violating_sites(); +/// # } +/// ``` +pub struct ViolatingSiteMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AdExperienceReport, +} + +impl<'a, C, A> MethodsBuilder for ViolatingSiteMethods<'a, C, A> {} + +impl<'a, C, A> ViolatingSiteMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists sites with Ad Experience Report statuses of "Failing" or "Warning". + pub fn list(&self) -> ViolatingSiteListCall<'a, C, A> { + ViolatingSiteListCall { + hub: self.hub, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Gets a summary of the ad experience rating of a site. +/// +/// A builder for the *get* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_adexperiencereport1 as adexperiencereport1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use adexperiencereport1::AdExperienceReport; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sites().get("name") +/// .doit(); +/// # } +/// ``` +pub struct SiteGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AdExperienceReport, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteGetCall<'a, C, A> {} + +impl<'a, C, A> SiteGetCall<'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, SiteSummaryResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "adexperiencereport.sites.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::XapiZoo.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 required site name. It should be the site property whose ad experiences + /// may have been reviewed, and it should be URL-encoded. For example, + /// sites/https%3A%2F%2Fwww.google.com. The server will return an error of + /// BAD_REQUEST if this field is not filled in. Note that if the site property + /// is not yet verified in Search Console, the reportUrl field returned by the + /// API will lead to the verification page, prompting the user to go through + /// that process before they can gain access to the Ad Experience Report. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> SiteGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> SiteGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteGetCall<'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::XapiZoo`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SiteGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists sites with Ad Experience Report statuses of "Failing" or "Warning". +/// +/// A builder for the *list* method supported by a *violatingSite* resource. +/// It is not used directly, but through a `ViolatingSiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_adexperiencereport1 as adexperiencereport1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use adexperiencereport1::AdExperienceReport; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AdExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.violating_sites().list() +/// .doit(); +/// # } +/// ``` +pub struct ViolatingSiteListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AdExperienceReport, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ViolatingSiteListCall<'a, C, A> {} + +impl<'a, C, A> ViolatingSiteListCall<'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, ViolatingSitesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "adexperiencereport.violatingSites.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + 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 = self.hub._base_url.clone() + "v1/violatingSites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::XapiZoo.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(Bearer { 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(d); + 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(d); + 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 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) -> ViolatingSiteListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ViolatingSiteListCall<'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::XapiZoo`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ViolatingSiteListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/admin1_directory-cli/Cargo.toml b/gen/admin1_directory-cli/Cargo.toml index 8aa404da4a..73009c7d6b 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 = "1.0.6+20170419" +version = "1.0.6+20170830" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-admin1_directory] path = "../admin1_directory" -version = "1.0.6+20170419" +version = "1.0.6+20170830" diff --git a/gen/admin1_directory-cli/README.md b/gen/admin1_directory-cli/README.md index 4038c0d35f..e688baa26b 100644 --- a/gen/admin1_directory-cli/README.md +++ b/gen/admin1_directory-cli/README.md @@ -25,7 +25,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 *20170419*. The CLI is at version *1.0.6*. +This documentation was generated from the *directory* API at revision *20170830*. The CLI is at version *1.0.6*. ```bash admin1-directory [options] @@ -39,6 +39,7 @@ admin1-directory [options] action (-r )... [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] + move-devices-to-ou (-r )... [-p ]... patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] customers diff --git a/gen/admin1_directory-cli/mkdocs.yml b/gen/admin1_directory-cli/mkdocs.yml index 17a1e16720..d5e5083752 100644 --- a/gen/admin1_directory-cli/mkdocs.yml +++ b/gen/admin1_directory-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: directory v1.0.6+20170419 +site_name: directory v1.0.6+20170830 site_url: http://byron.github.io/google-apis-rs/google-admin1_directory-cli site_description: A complete library to interact with directory (protocol directory_v1) @@ -16,6 +16,7 @@ pages: - ['chromeosdevices_action.md', 'Chromeosdevices', 'Action'] - ['chromeosdevices_get.md', 'Chromeosdevices', 'Get'] - ['chromeosdevices_list.md', 'Chromeosdevices', 'List'] +- ['chromeosdevices_move-devices-to-ou.md', 'Chromeosdevices', 'Move Devices To Ou'] - ['chromeosdevices_patch.md', 'Chromeosdevices', 'Patch'] - ['chromeosdevices_update.md', 'Chromeosdevices', 'Update'] - ['customers_get.md', 'Customers', 'Get'] diff --git a/gen/admin1_directory-cli/src/main.rs b/gen/admin1_directory-cli/src/main.rs index e4877ab75f..ca711c07ef 100644 --- a/gen/admin1_directory-cli/src/main.rs +++ b/gen/admin1_directory-cli/src/main.rs @@ -434,6 +434,9 @@ impl<'n> Engine<'n> { "page-token" => { call = call.page_token(value.unwrap_or("")); }, + "org-unit-path" => { + call = call.org_unit_path(value.unwrap_or("")); + }, "order-by" => { call = call.order_by(value.unwrap_or("")); }, @@ -453,7 +456,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "projection", "max-results", "page-token", "sort-order", "query"].iter().map(|v|*v)); + v.extend(["order-by", "projection", "max-results", "page-token", "sort-order", "query", "org-unit-path"].iter().map(|v|*v)); v } )); } } @@ -487,6 +490,83 @@ impl<'n> Engine<'n> { } } + fn _chromeosdevices_move_devices_to_ou(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "device-ids" => Some(("deviceIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["device-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ChromeOsMoveDevicesToOu = json::value::from_value(object).unwrap(); + let mut call = self.hub.chromeosdevices().move_devices_to_ou(request, opt.value_of("customer-id").unwrap_or(""), opt.value_of("org-unit-path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _chromeosdevices_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3703,12 +3783,13 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-type" => Some(("resourceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-description" => Some(("resourceDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generated-resource-name" => Some(("generatedResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etags" => Some(("etags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "resource-email" => Some(("resourceEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-name" => Some(("resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-email" => Some(("resourceEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "generated-resource-name", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3853,12 +3934,13 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-type" => Some(("resourceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-description" => Some(("resourceDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generated-resource-name" => Some(("generatedResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etags" => Some(("etags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "resource-email" => Some(("resourceEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-name" => Some(("resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-email" => Some(("resourceEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "generated-resource-name", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3944,12 +4026,13 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-type" => Some(("resourceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-description" => Some(("resourceDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generated-resource-name" => Some(("generatedResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etags" => Some(("etags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "resource-email" => Some(("resourceEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-name" => Some(("resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-email" => Some(("resourceEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "generated-resource-name", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6819,6 +6902,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._chromeosdevices_list(opt, dry_run, &mut err); }, + ("move-devices-to-ou", Some(opt)) => { + call_result = self._chromeosdevices_move_devices_to_ou(opt, dry_run, &mut err); + }, ("patch", Some(opt)) => { call_result = self._chromeosdevices_patch(opt, dry_run, &mut err); }, @@ -7396,7 +7482,7 @@ fn main() { ]), ]), - ("chromeosdevices", "methods: 'action', 'get', 'list', 'patch' and 'update'", vec![ + ("chromeosdevices", "methods: 'action', 'get', 'list', 'move-devices-to-ou', 'patch' and 'update'", vec![ ("action", Some(r##"Take action on Chrome OS Device"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/chromeosdevices_action", @@ -7475,6 +7561,34 @@ fn main() { Some(false), Some(false)), ]), + ("move-devices-to-ou", + Some(r##"Move or insert multiple Chrome OS Devices to Organization Unit"##), + "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/chromeosdevices_move-devices-to-ou", + vec![ + (Some(r##"customer-id"##), + None, + Some(r##"Immutable ID of the G Suite account"##), + Some(true), + Some(false)), + + (Some(r##"org-unit-path"##), + None, + Some(r##"Full path of the target organization unit or its Id"##), + 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)), + ]), ("patch", Some(r##"Update Chrome OS Device. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/chromeosdevices_patch", @@ -9799,7 +9913,7 @@ fn main() { let mut app = App::new("admin1-directory") .author("Sebastian Thiel ") - .version("1.0.6+20170419") + .version("1.0.6+20170830") .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 41c3fc9994..5189f40860 100644 --- a/gen/admin1_directory/Cargo.toml +++ b/gen/admin1_directory/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-admin1_directory" -version = "1.0.6+20170419" +version = "1.0.6+20170830" 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" homepage = "https://developers.google.com/admin-sdk/directory/" -documentation = "https://docs.rs/google-admin1_directory/1.0.6+20170419" +documentation = "https://docs.rs/google-admin1_directory/1.0.6+20170830" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index 516f8afe60..a6d1639e72 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,61 +5,61 @@ 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 *1.0.6+20170419*, where *20170419* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *directory* crate version *1.0.6+20170830*, where *20170830* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *directory* *v1_directory* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/directory/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Directory.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Directory.html) ... -* [asps](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Asp.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.AspListCall.html) -* [channels](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Channel.html) - * [*stop*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ChannelStopCall.html) +* [asps](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Asp.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.AspListCall.html) +* [channels](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChannelStopCall.html) * chromeosdevices - * [*action*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) -* [customers](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Customer.html) - * [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.CustomerUpdateCall.html) + * [*action*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*move devices to ou*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChromeosdeviceMoveDevicesToOuCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) +* [customers](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Customer.html) + * [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.CustomerUpdateCall.html) * domain aliases - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainAliaseListCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainAliaseListCall.html) * domains - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.DomainListCall.html) -* [groups](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Group.html) - * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupUpdateCall.html) -* [members](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Member.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MemberGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MemberUpdateCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.DomainListCall.html) +* [groups](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Group.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupUpdateCall.html) +* [members](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Member.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MemberGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MemberUpdateCall.html) * mobiledevices - * [*action*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.MobiledeviceListCall.html) -* [notifications](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Notification.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.NotificationUpdateCall.html) + * [*action*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.MobiledeviceListCall.html) +* [notifications](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Notification.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.NotificationUpdateCall.html) * orgunits - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.OrgunitUpdateCall.html) -* [privileges](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Privilege.html) - * [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.PrivilegeListCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.OrgunitUpdateCall.html) +* [privileges](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Privilege.html) + * [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.PrivilegeListCall.html) * resources - * [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ResourceCalendarPatchCall.html) and [*calendars update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.ResourceCalendarUpdateCall.html) -* [role assignments](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleAssignment.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleAssignmentListCall.html) -* [roles](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Role.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.RoleUpdateCall.html) -* [schemas](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Schema.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.SchemaUpdateCall.html) -* [tokens](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Token.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.TokenListCall.html) -* [users](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.User.html) - * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserWatchCall.html) -* [verification codes](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.VerificationCode.html) - * [*generate*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.VerificationCodeListCall.html) + * [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ResourceCalendarPatchCall.html) and [*calendars update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.ResourceCalendarUpdateCall.html) +* [role assignments](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleAssignment.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleAssignmentListCall.html) +* [roles](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Role.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.RoleUpdateCall.html) +* [schemas](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Schema.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.SchemaUpdateCall.html) +* [tokens](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Token.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.TokenListCall.html) +* [users](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.User.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserWatchCall.html) +* [verification codes](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.VerificationCode.html) + * [*generate*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.VerificationCodeListCall.html) Subscription supported by ... -* [*list users*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserListCall.html) -* [*watch users*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserWatchCall.html) -* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserAliaseWatchCall.html) -* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.UserAliaseListCall.html) -* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.GroupAliaseListCall.html) +* [*list users*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserListCall.html) +* [*watch users*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserWatchCall.html) +* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserAliaseWatchCall.html) +* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.UserAliaseListCall.html) +* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.GroupAliaseListCall.html) @@ -67,17 +67,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/struct.Directory.html)** +* **[Hub](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Directory.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -194,17 +194,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/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")`. @@ -214,29 +214,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/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](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/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](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.RequestValue.html) and -[decodable](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/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](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/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](https://docs.rs/google-admin1_directory/1.0.6+20170419/google_admin1_directory/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/admin1_directory/src/lib.rs b/gen/admin1_directory/src/lib.rs index 019d2e4d46..cf0d42dcba 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 *1.0.6+20170419*, where *20170419* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *directory* crate version *1.0.6+20170830*, where *20170830* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *directory* *v1_directory* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/directory/). @@ -16,7 +16,7 @@ //! * [channels](struct.Channel.html) //! * [*stop*](struct.ChannelStopCall.html) //! * chromeosdevices -//! * [*action*](struct.ChromeosdeviceActionCall.html), [*get*](struct.ChromeosdeviceGetCall.html), [*list*](struct.ChromeosdeviceListCall.html), [*patch*](struct.ChromeosdevicePatchCall.html) and [*update*](struct.ChromeosdeviceUpdateCall.html) +//! * [*action*](struct.ChromeosdeviceActionCall.html), [*get*](struct.ChromeosdeviceGetCall.html), [*list*](struct.ChromeosdeviceListCall.html), [*move devices to ou*](struct.ChromeosdeviceMoveDevicesToOuCall.html), [*patch*](struct.ChromeosdevicePatchCall.html) and [*update*](struct.ChromeosdeviceUpdateCall.html) //! * [customers](struct.Customer.html) //! * [*get*](struct.CustomerGetCall.html), [*patch*](struct.CustomerPatchCall.html) and [*update*](struct.CustomerUpdateCall.html) //! * domain aliases @@ -818,42 +818,6 @@ impl Resource for Member {} impl ResponseResult for Member {} -/// JSON template for Domain object in Directory API. -/// -/// # 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 domains](struct.DomainInsertCall.html) (request|response) -/// * [get domains](struct.DomainGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Domains { - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// Indicates the verification state of a domain. (Read-only). - pub verified: Option, - /// The domain name of the customer. - #[serde(rename="domainName")] - pub domain_name: Option, - /// List of domain alias objects. (Read-only) - #[serde(rename="domainAliases")] - pub domain_aliases: Option>, - /// Indicates if the domain is a primary domain (Read-only). - #[serde(rename="isPrimary")] - pub is_primary: Option, - /// Creation time of the domain. (Read-only). - #[serde(rename="creationTime")] - pub creation_time: Option, -} - -impl RequestValue for Domains {} -impl ResponseResult for Domains {} - - /// JSON response template for List Organization Units operation in Directory API. /// /// # Activities @@ -995,23 +959,26 @@ impl Resource for Privilege {} pub struct CalendarResource { /// The type of the resource. For calendar resources, the value is admin#directory#resources#calendars#CalendarResource. pub kind: Option, - /// ETag of the resource. - pub etags: Option, - /// The name of the calendar resource. For example, Training Room 1A - #[serde(rename="resourceName")] - pub resource_name: Option, - /// The read-only email ID for the calendar resource. Generated as part of creating a new calendar resource. - #[serde(rename="resourceEmail")] - pub resource_email: Option, /// The type of the calendar resource. Used for grouping resources in the calendar user interface. #[serde(rename="resourceType")] pub resource_type: Option, /// The brief description of the calendar resource. #[serde(rename="resourceDescription")] pub resource_description: Option, + /// The auto-generated name of the calendar resource which includes metadata about the resource such as building name, floor, capacity, etc. For example, NYC-2-Training Room 1A (16) + #[serde(rename="generatedResourceName")] + pub generated_resource_name: Option, + /// The read-only email ID for the calendar resource. Generated as part of creating a new calendar resource. + #[serde(rename="resourceEmail")] + pub resource_email: Option, + /// ETag of the resource. + pub etags: Option, /// The unique ID for the calendar resource. #[serde(rename="resourceId")] pub resource_id: Option, + /// The name of the calendar resource. For example, Training Room 1A + #[serde(rename="resourceName")] + pub resource_name: Option, } impl RequestValue for CalendarResource {} @@ -1452,6 +1419,8 @@ pub struct User { pub thumbnail_photo_etag: Option, /// Indicates if user is suspended pub suspended: Option, + /// no description provided + pub keywords: Option, /// Unique identifier of User (Read-only) pub id: Option, /// List of aliases (Read-only) @@ -1479,6 +1448,8 @@ pub struct User { pub include_in_global_address_list: Option, /// no description provided pub relations: Option, + /// no description provided + pub languages: Option, /// Boolean indicating if the user is admin (Read-only) #[serde(rename="isAdmin")] pub is_admin: Option, @@ -1525,6 +1496,8 @@ pub struct User { /// User's name pub name: Option, /// no description provided + pub gender: Option, + /// no description provided pub notes: Option, /// User's G Suite account creation time. (Read-only) #[serde(rename="creationTime")] @@ -1588,32 +1561,6 @@ impl NestedType for ChromeOsDeviceRecentUsers {} impl Part for ChromeOsDeviceRecentUsers {} -/// List of applications installed on Mobile Device -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MobileDeviceApplications { - /// Version code of application - #[serde(rename="versionCode")] - pub version_code: Option, - /// Package name of application - #[serde(rename="packageName")] - pub package_name: Option, - /// Display name of application - #[serde(rename="displayName")] - pub display_name: Option, - /// Version name of application - #[serde(rename="versionName")] - pub version_name: Option, - /// List of Permissions for application - pub permission: Option>, -} - -impl NestedType for MobileDeviceApplications {} -impl Part for MobileDeviceApplications {} - - /// JSON response template to list aliases in Directory API. /// /// # Activities @@ -1915,6 +1862,25 @@ pub struct Domains2 { impl ResponseResult for Domains2 {} +/// JSON request template for moving ChromeOs Device to given OU in Directory Devices API. +/// +/// # 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*). +/// +/// * [move devices to ou chromeosdevices](struct.ChromeosdeviceMoveDevicesToOuCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChromeOsMoveDevicesToOu { + /// ChromeOs Devices to be moved to OU + #[serde(rename="deviceIds")] + pub device_ids: Option>, +} + +impl RequestValue for ChromeOsMoveDevicesToOu {} + + /// JSON template for Photo object in Directory API. /// /// # Activities @@ -1953,6 +1919,32 @@ impl RequestValue for UserPhoto {} impl ResponseResult for UserPhoto {} +/// List of applications installed on Mobile Device +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MobileDeviceApplications { + /// Version code of application + #[serde(rename="versionCode")] + pub version_code: Option, + /// Package name of application + #[serde(rename="packageName")] + pub package_name: Option, + /// Display name of application + #[serde(rename="displayName")] + pub display_name: Option, + /// Version name of application + #[serde(rename="versionName")] + pub version_name: Option, + /// List of Permissions for application + pub permission: Option>, +} + +impl NestedType for MobileDeviceApplications {} +impl Part for MobileDeviceApplications {} + + /// JSON request template for firing commands on Mobile Device in Directory Devices API. /// /// # Activities @@ -2016,6 +2008,42 @@ pub struct Users { impl ResponseResult for Users {} +/// JSON template for Domain object in Directory API. +/// +/// # 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 domains](struct.DomainInsertCall.html) (request|response) +/// * [get domains](struct.DomainGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Domains { + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// Indicates the verification state of a domain. (Read-only). + pub verified: Option, + /// The domain name of the customer. + #[serde(rename="domainName")] + pub domain_name: Option, + /// List of domain alias objects. (Read-only) + #[serde(rename="domainAliases")] + pub domain_aliases: Option>, + /// Indicates if the domain is a primary domain (Read-only). + #[serde(rename="isPrimary")] + pub is_primary: Option, + /// Creation time of the domain. (Read-only). + #[serde(rename="creationTime")] + pub creation_time: Option, +} + +impl RequestValue for Domains {} +impl ResponseResult for Domains {} + + /// JSON template for Mobile Device resource in Directory API. /// /// # Activities @@ -2222,6 +2250,28 @@ impl Resource for OrgUnit {} impl ResponseResult for OrgUnit {} +/// JSON response template for List Schema operation in Directory API. +/// +/// # 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 schemas](struct.SchemaListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Schemas { + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// List of UserSchema objects. + pub schemas: Option>, +} + +impl ResponseResult for Schemas {} + + /// List of active time ranges (Read-only) /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2306,28 +2356,6 @@ impl NestedType for SchemaFieldSpecNumericIndexingSpec {} impl Part for SchemaFieldSpecNumericIndexingSpec {} -/// JSON response template for List Schema operation in Directory API. -/// -/// # 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 schemas](struct.SchemaListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Schemas { - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// List of UserSchema objects. - pub schemas: Option>, -} - -impl ResponseResult for Schemas {} - - /// JSON template for Calendar Resource List Response object in Directory API. /// /// # Activities @@ -3655,7 +3683,7 @@ impl<'a, C, A> RoleAssignmentMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `action(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `action(...)`, `get(...)`, `list(...)`, `move_devices_to_ou(...)`, `patch(...)` and `update(...)` /// // to build up your call. /// let rb = hub.chromeosdevices(); /// # } @@ -3685,6 +3713,7 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { _query: Default::default(), _projection: Default::default(), _page_token: Default::default(), + _org_unit_path: Default::default(), _order_by: Default::default(), _max_results: Default::default(), _delegate: Default::default(), @@ -3777,6 +3806,27 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Move or insert multiple Chrome OS Devices to Organization Unit + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `customerId` - Immutable ID of the G Suite account + /// * `orgUnitPath` - Full path of the target organization unit or its Id + pub fn move_devices_to_ou(&self, request: ChromeOsMoveDevicesToOu, customer_id: &str, org_unit_path: &str) -> ChromeosdeviceMoveDevicesToOuCall<'a, C, A> { + ChromeosdeviceMoveDevicesToOuCall { + hub: self.hub, + _request: request, + _customer_id: customer_id.to_string(), + _org_unit_path: org_unit_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -16139,8 +16189,9 @@ impl<'a, C, A> RoleAssignmentListCall<'a, C, A> where C: BorrowMut _query: Option, _projection: Option, _page_token: Option, + _org_unit_path: Option, _order_by: Option, _max_results: Option, _delegate: Option<&'a mut Delegate>, @@ -16176,7 +16228,7 @@ impl<'a, C, A> ChromeosdeviceListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); params.push(("customerId", self._customer_id.to_string())); if let Some(value) = self._sort_order { params.push(("sortOrder", value.to_string())); @@ -16190,13 +16242,16 @@ impl<'a, C, A> ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> { + self._org_unit_path = Some(new_value.to_string()); + self + } /// Column to use for sorting results /// /// Sets the *order by* query property to the given value. @@ -16456,7 +16518,7 @@ impl<'a, C, A> ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdevicePatchCall<'a, C, A> where C: BorrowMut ChromeosdeviceUpdateCall<'a, C, A> where C: BorrowMut ChromeosdeviceActionCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ChromeOsMoveDevicesToOu::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.chromeosdevices().move_devices_to_ou(req, "customerId", "orgUnitPath") +/// .doit(); +/// # } +/// ``` +pub struct ChromeosdeviceMoveDevicesToOuCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: ChromeOsMoveDevicesToOu, + _customer_id: String, + _org_unit_path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ChromeosdeviceMoveDevicesToOuCall<'a, C, A> {} + +impl<'a, C, A> ChromeosdeviceMoveDevicesToOuCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "directory.chromeosdevices.moveDevicesToOu", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("customerId", self._customer_id.to_string())); + params.push(("orgUnitPath", self._org_unit_path.to_string())); + for &field in ["customerId", "orgUnitPath"].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 = self.hub._base_url.clone() + "customer/{customerId}/devices/chromeos/moveDevicesToOu"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryDeviceChromeo.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{customerId}", "customerId")].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 ["customerId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ChromeOsMoveDevicesToOu) -> ChromeosdeviceMoveDevicesToOuCall<'a, C, A> { + self._request = new_value; + self + } + /// Immutable ID of the G Suite account + /// + /// Sets the *customer 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 customer_id(mut self, new_value: &str) -> ChromeosdeviceMoveDevicesToOuCall<'a, C, A> { + self._customer_id = new_value.to_string(); + self + } + /// Full path of the target organization unit or its Id + /// + /// Sets the *org unit path* 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. + pub fn org_unit_path(mut self, new_value: &str) -> ChromeosdeviceMoveDevicesToOuCall<'a, C, A> { + self._org_unit_path = 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) -> ChromeosdeviceMoveDevicesToOuCall<'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) -> ChromeosdeviceMoveDevicesToOuCall<'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::DirectoryDeviceChromeo`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ChromeosdeviceMoveDevicesToOuCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Delete Group /// /// A builder for the *delete* method supported by a *group* resource. @@ -17820,11 +18157,11 @@ impl<'a, C, A> GroupDeleteCall<'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.groups().list() -/// .user_key("et") -/// .page_token("dolor") -/// .max_results(-41) -/// .domain("kasd") -/// .customer("invidunt") +/// .user_key("kasd") +/// .page_token("invidunt") +/// .max_results(-15) +/// .domain("Lorem") +/// .customer("clita") /// .doit(); /// # } /// ``` @@ -19882,7 +20219,7 @@ impl<'a, C, A> GroupAliaseDeleteCall<'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.asps().get("userKey", -80) +/// let result = hub.asps().get("userKey", -43) /// .doit(); /// # } /// ``` @@ -20137,7 +20474,7 @@ impl<'a, C, A> AspGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// // 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.asps().delete("userKey", -8) +/// let result = hub.asps().delete("userKey", -15) /// .doit(); /// # } /// ``` @@ -22170,7 +22507,7 @@ impl<'a, C, A> DomainAliaseGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.domain_aliases().list("customer") -/// .parent_domain_name("dolor") +/// .parent_domain_name("eirmod") /// .doit(); /// # } /// ``` @@ -24257,8 +24594,8 @@ impl<'a, C, A> SchemaInsertCall<'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.resources().calendars_list("customer") -/// .page_token("justo") -/// .max_results(-34) +/// .page_token("dolor") +/// .max_results(-58) /// .doit(); /// # } /// ``` @@ -26885,7 +27222,7 @@ impl<'a, C, A> UserInsertCall<'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.users().aliases_watch(req, "userKey") -/// .event("consetetur") +/// .event("At") /// .doit(); /// # } /// ``` @@ -27445,18 +27782,18 @@ impl<'a, C, A> UserPhotoUpdateCall<'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().watch(req) -/// .view_type("elitr") -/// .sort_order("At") -/// .show_deleted("sea") -/// .query("consetetur") -/// .projection("diam") -/// .page_token("accusam") -/// .order_by("dolores") -/// .max_results(-46) -/// .event("dolor") -/// .domain("aliquyam") -/// .customer("elitr") -/// .custom_field_mask("ea") +/// .view_type("consetetur") +/// .sort_order("diam") +/// .show_deleted("accusam") +/// .query("dolores") +/// .projection("consetetur") +/// .page_token("dolor") +/// .order_by("aliquyam") +/// .max_results(-94) +/// .event("ea") +/// .domain("et") +/// .customer("Stet") +/// .custom_field_mask("sed") /// .doit(); /// # } /// ``` @@ -28341,18 +28678,18 @@ impl<'a, C, A> UserPhotoGetCall<'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().list() -/// .view_type("sed") -/// .sort_order("dolor") -/// .show_deleted("sanctus") -/// .query("dolore") -/// .projection("Lorem") -/// .page_token("consetetur") -/// .order_by("consetetur") -/// .max_results(-90) -/// .event("labore") -/// .domain("gubergren") -/// .customer("et") -/// .custom_field_mask("sadipscing") +/// .view_type("dolore") +/// .sort_order("Lorem") +/// .show_deleted("consetetur") +/// .query("consetetur") +/// .projection("eirmod") +/// .page_token("labore") +/// .order_by("gubergren") +/// .max_results(-73) +/// .event("sadipscing") +/// .domain("accusam") +/// .customer("magna") +/// .custom_field_mask("Lorem") /// .doit(); /// # } /// ``` @@ -28695,9 +29032,9 @@ impl<'a, C, A> UserListCall<'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.users().get("userKey") -/// .view_type("magna") -/// .projection("Lorem") -/// .custom_field_mask("rebum.") +/// .view_type("et") +/// .projection("clita") +/// .custom_field_mask("eos") /// .doit(); /// # } /// ``` @@ -29248,7 +29585,7 @@ impl<'a, C, A> UserAliaseInsertCall<'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().aliases_list("userKey") -/// .event("eos") +/// .event("consetetur") /// .doit(); /// # } /// ``` diff --git a/gen/admin1_reports-cli/Cargo.toml b/gen/admin1_reports-cli/Cargo.toml index d00d720337..80506bd538 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 = "1.0.6+20170320" +version = "1.0.6+20170622" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-admin1_reports] path = "../admin1_reports" -version = "1.0.6+20170320" +version = "1.0.6+20170622" diff --git a/gen/admin1_reports-cli/README.md b/gen/admin1_reports-cli/README.md index e96320608f..5657a41e5b 100644 --- a/gen/admin1_reports-cli/README.md +++ b/gen/admin1_reports-cli/README.md @@ -25,7 +25,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 *20170320*. The CLI is at version *1.0.6*. +This documentation was generated from the *reports* API at revision *20170622*. The CLI is at version *1.0.6*. ```bash admin1-reports [options] diff --git a/gen/admin1_reports-cli/mkdocs.yml b/gen/admin1_reports-cli/mkdocs.yml index 4c3f6e89dc..a09181ec5b 100644 --- a/gen/admin1_reports-cli/mkdocs.yml +++ b/gen/admin1_reports-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reports v1.0.6+20170320 +site_name: reports v1.0.6+20170622 site_url: http://byron.github.io/google-apis-rs/google-admin1_reports-cli site_description: A complete library to interact with reports (protocol reports_v1) diff --git a/gen/admin1_reports-cli/src/main.rs b/gen/admin1_reports-cli/src/main.rs index 6837696403..342bc4d87b 100644 --- a/gen/admin1_reports-cli/src/main.rs +++ b/gen/admin1_reports-cli/src/main.rs @@ -736,7 +736,7 @@ fn main() { let mut app = App::new("admin1-reports") .author("Sebastian Thiel ") - .version("1.0.6+20170320") + .version("1.0.6+20170622") .about("Fetches reports for the administrators of G Suite customers 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 8ec55d76d1..efe16cbbfa 100644 --- a/gen/admin1_reports/Cargo.toml +++ b/gen/admin1_reports/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-admin1_reports" -version = "1.0.6+20170320" +version = "1.0.6+20170622" 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" homepage = "https://developers.google.com/admin-sdk/reports/" -documentation = "https://docs.rs/google-admin1_reports/1.0.6+20170320" +documentation = "https://docs.rs/google-admin1_reports/1.0.6+20170622" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index 5804027228..a8833c3d22 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,28 +5,28 @@ 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 *1.0.6+20170320*, where *20170320* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *reports* crate version *1.0.6+20170622*, where *20170622* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *reports* *v1_reports* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/reports/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.Reports.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.Reports.html) ... -* [activities](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.Activity.html) - * [*list*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.ActivityWatchCall.html) -* [channels](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.Channel.html) - * [*stop*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.ChannelStopCall.html) +* [activities](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.Activity.html) + * [*list*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.ActivityWatchCall.html) +* [channels](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.ChannelStopCall.html) * customer usage reports - * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.CustomerUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.CustomerUsageReportGetCall.html) * user usage report - * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.UserUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.UserUsageReportGetCall.html) Subscription supported by ... -* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.ActivityWatchCall.html) -* [*list activities*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.ActivityListCall.html) +* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.ActivityWatchCall.html) +* [*list activities*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.ActivityListCall.html) @@ -34,17 +34,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/struct.Reports.html)** +* **[Hub](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.Reports.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -142,17 +142,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/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")`. @@ -162,29 +162,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/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](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/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](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.RequestValue.html) and -[decodable](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/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](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/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](https://docs.rs/google-admin1_reports/1.0.6+20170320/google_admin1_reports/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/admin1_reports/src/lib.rs b/gen/admin1_reports/src/lib.rs index 68dc717038..49beb6b238 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 *1.0.6+20170320*, where *20170320* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *reports* crate version *1.0.6+20170622*, where *20170622* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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/adsense1d4-cli/Cargo.toml b/gen/adsense1d4-cli/Cargo.toml index ef59e0de44..a693ca54e5 100644 --- a/gen/adsense1d4-cli/Cargo.toml +++ b/gen/adsense1d4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170925" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-adsense1d4] path = "../adsense1d4" -version = "1.0.6+20170517" +version = "1.0.6+20170925" diff --git a/gen/adsense1d4-cli/README.md b/gen/adsense1d4-cli/README.md index f8bb738945..0a47b377bd 100644 --- a/gen/adsense1d4-cli/README.md +++ b/gen/adsense1d4-cli/README.md @@ -25,7 +25,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 *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *AdSense* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash adsense1d4 [options] diff --git a/gen/adsense1d4-cli/mkdocs.yml b/gen/adsense1d4-cli/mkdocs.yml index d41e124a60..de4e7e5fed 100644 --- a/gen/adsense1d4-cli/mkdocs.yml +++ b/gen/adsense1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense v1.0.6+20170517 +site_name: AdSense v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-adsense1d4-cli site_description: A complete library to interact with AdSense (protocol v1.4) diff --git a/gen/adsense1d4-cli/src/main.rs b/gen/adsense1d4-cli/src/main.rs index 4f9c0c7c12..87b38ac86a 100644 --- a/gen/adsense1d4-cli/src/main.rs +++ b/gen/adsense1d4-cli/src/main.rs @@ -3481,7 +3481,7 @@ fn main() { let mut app = App::new("adsense1d4") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170925") .about("Accesses AdSense publishers' inventory and generates performance 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 751cb4d84e..d39c51bec3 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsense1d4" -version = "1.0.6+20170517" +version = "1.0.6+20170925" 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" homepage = "https://developers.google.com/adsense/management/" -documentation = "https://docs.rs/google-adsense1d4/1.0.6+20170517" +documentation = "https://docs.rs/google-adsense1d4/1.0.6+20170925" license = "MIT" keywords = ["adsense", "google", "protocol", "web", "api"] diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index f4781e9035..4a58c185e3 100644 --- a/gen/adsense1d4/README.md +++ b/gen/adsense1d4/README.md @@ -5,40 +5,40 @@ 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 *1.0.6+20170517*, where *20170517* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *AdSense* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *AdSense* *v1d4* API can be found at the [official documentation site](https://developers.google.com/adsense/management/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdSense.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdSense.html) ... -* [accounts](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.Account.html) - * [*adclients list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountUrlchannelListCall.html) +* [accounts](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.Account.html) + * [*adclients list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountUrlchannelListCall.html) * adclients - * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdclientListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdclientListCall.html) * adunits - * [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdunitListCall.html) -* [alerts](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.Alert.html) - * [*delete*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AlertListCall.html) + * [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdunitListCall.html) +* [alerts](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.Alert.html) + * [*delete*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AlertListCall.html) * customchannels - * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.CustomchannelListCall.html) -* [metadata](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.Metadata.html) - * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.MetadataMetricListCall.html) -* [payments](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.Payment.html) - * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.PaymentListCall.html) + * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.CustomchannelListCall.html) +* [metadata](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.Metadata.html) + * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.MetadataMetricListCall.html) +* [payments](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.Payment.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.PaymentListCall.html) * reports - * [*generate*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.ReportSavedListCall.html) + * [*generate*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.ReportSavedListCall.html) * savedadstyles - * [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.SavedadstyleListCall.html) + * [*get*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.SavedadstyleListCall.html) * urlchannels - * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.UrlchannelListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.UrlchannelListCall.html) Download supported by ... -* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.ReportGenerateCall.html) -* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AccountReportGenerateCall.html) +* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.ReportGenerateCall.html) +* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AccountReportGenerateCall.html) @@ -46,17 +46,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/struct.AdSense.html)** +* **[Hub](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdSense.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -166,17 +166,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/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")`. @@ -186,29 +186,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/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](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/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](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/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](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/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](https://docs.rs/google-adsense1d4/1.0.6+20170517/google_adsense1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adsense1d4/src/lib.rs b/gen/adsense1d4/src/lib.rs index 3708477361..1ffeaeccf0 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 *1.0.6+20170517*, where *20170517* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *AdSense* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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 355c943173..19bb2f776e 100644 --- a/gen/adsensehost4d1-cli/Cargo.toml +++ b/gen/adsensehost4d1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170925" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-adsensehost4d1] path = "../adsensehost4d1" -version = "1.0.6+20170517" +version = "1.0.6+20170925" diff --git a/gen/adsensehost4d1-cli/README.md b/gen/adsensehost4d1-cli/README.md index a5e8e94cac..419a414076 100644 --- a/gen/adsensehost4d1-cli/README.md +++ b/gen/adsensehost4d1-cli/README.md @@ -25,7 +25,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 *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *AdSense Host* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash adsensehost4d1 [options] diff --git a/gen/adsensehost4d1-cli/mkdocs.yml b/gen/adsensehost4d1-cli/mkdocs.yml index 0c52912517..3185eb80e1 100644 --- a/gen/adsensehost4d1-cli/mkdocs.yml +++ b/gen/adsensehost4d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense Host v1.0.6+20170517 +site_name: AdSense Host v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-adsensehost4d1-cli site_description: A complete library to interact with AdSense Host (protocol v4.1) diff --git a/gen/adsensehost4d1-cli/src/main.rs b/gen/adsensehost4d1-cli/src/main.rs index b30e18b503..416664ca09 100644 --- a/gen/adsensehost4d1-cli/src/main.rs +++ b/gen/adsensehost4d1-cli/src/main.rs @@ -2762,7 +2762,7 @@ fn main() { let mut app = App::new("adsensehost4d1") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170925") .about("Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.") .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 ac0d2da11d..8c394f9ebb 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsensehost4d1" -version = "1.0.6+20170517" +version = "1.0.6+20170925" 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" homepage = "https://developers.google.com/adsense/host/" -documentation = "https://docs.rs/google-adsensehost4d1/1.0.6+20170517" +documentation = "https://docs.rs/google-adsensehost4d1/1.0.6+20170925" license = "MIT" keywords = ["adsensehost", "google", "protocol", "web", "api"] diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index d05a732156..3c23f7e246 100644 --- a/gen/adsensehost4d1/README.md +++ b/gen/adsensehost4d1/README.md @@ -5,26 +5,26 @@ 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 *1.0.6+20170517*, where *20170517* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *AdSense Host* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *AdSense Host* *v4d1* API can be found at the [official documentation site](https://developers.google.com/adsense/host/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AdSenseHost.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AdSenseHost.html) ... -* [accounts](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.Account.html) - * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AccountReportGenerateCall.html) +* [accounts](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.Account.html) + * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AccountReportGenerateCall.html) * adclients - * [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AdclientListCall.html) + * [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AdclientListCall.html) * associationsessions - * [*start*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) + * [*start*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) * customchannels - * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) -* [reports](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.Report.html) - * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.ReportGenerateCall.html) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) +* [reports](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.Report.html) + * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.ReportGenerateCall.html) * urlchannels - * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.UrlchannelListCall.html) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.UrlchannelListCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/struct.AdSenseHost.html)** +* **[Hub](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/struct.AdSenseHost.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -144,17 +144,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/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")`. @@ -164,29 +164,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/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](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/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](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/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](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/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](https://docs.rs/google-adsensehost4d1/1.0.6+20170517/google_adsensehost4d1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adsensehost4d1/src/lib.rs b/gen/adsensehost4d1/src/lib.rs index f7da075098..7afafe7e5a 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 *1.0.6+20170517*, where *20170517* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *AdSense Host* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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 283399d8ca..7171242a8f 100644 --- a/gen/analytics3-cli/Cargo.toml +++ b/gen/analytics3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3-cli" -version = "1.0.6+20170321" +version = "1.0.6+20170807" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-analytics3] path = "../analytics3" -version = "1.0.6+20170321" +version = "1.0.6+20170807" diff --git a/gen/analytics3-cli/README.md b/gen/analytics3-cli/README.md index ab8effe83c..c2aea7bba4 100644 --- a/gen/analytics3-cli/README.md +++ b/gen/analytics3-cli/README.md @@ -25,7 +25,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 *20170321*. The CLI is at version *1.0.6*. +This documentation was generated from the *analytics* API at revision *20170807*. The CLI is at version *1.0.6*. ```bash analytics3 [options] diff --git a/gen/analytics3-cli/mkdocs.yml b/gen/analytics3-cli/mkdocs.yml index d8abc1dee1..76714be71b 100644 --- a/gen/analytics3-cli/mkdocs.yml +++ b/gen/analytics3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: analytics v1.0.6+20170321 +site_name: analytics v1.0.6+20170807 site_url: http://byron.github.io/google-apis-rs/google-analytics3-cli site_description: A complete library to interact with analytics (protocol v3) diff --git a/gen/analytics3-cli/src/main.rs b/gen/analytics3-cli/src/main.rs index 9dc68823ab..52c5bf0d41 100644 --- a/gen/analytics3-cli/src/main.rs +++ b/gen/analytics3-cli/src/main.rs @@ -10022,7 +10022,7 @@ fn main() { let mut app = App::new("analytics3") .author("Sebastian Thiel ") - .version("1.0.6+20170321") + .version("1.0.6+20170807") .about("Views and manages 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 6061abb568..db8a19b316 100644 --- a/gen/analytics3/Cargo.toml +++ b/gen/analytics3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-analytics3" -version = "1.0.6+20170321" +version = "1.0.6+20170807" 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" homepage = "https://developers.google.com/analytics/" -documentation = "https://docs.rs/google-analytics3/1.0.6+20170321" +documentation = "https://docs.rs/google-analytics3/1.0.6+20170807" license = "MIT" keywords = ["analytics", "google", "protocol", "web", "api"] diff --git a/gen/analytics3/README.md b/gen/analytics3/README.md index 293c8ddd30..e859a068cb 100644 --- a/gen/analytics3/README.md +++ b/gen/analytics3/README.md @@ -5,27 +5,27 @@ 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 *1.0.6+20170321*, where *20170321* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *analytics* crate version *1.0.6+20170807*, where *20170807* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *analytics* *v3* API can be found at the [official documentation site](https://developers.google.com/analytics/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.Analytics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.Analytics.html) ... * data - * [*ga get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.DataGaGetCall.html), [*mcf get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.DataMcfGetCall.html) and [*realtime get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.DataRealtimeGetCall.html) + * [*ga get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.DataGaGetCall.html), [*mcf get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.DataMcfGetCall.html) and [*realtime get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.DataRealtimeGetCall.html) * management - * [*account summaries list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementAccountSummaryListCall.html), [*account user links delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementAccountUserLinkListCall.html), [*account user links update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementAccountListCall.html), [*custom data sources list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementExperimentDeleteCall.html), [*experiments get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementExperimentGetCall.html), [*experiments insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementExperimentInsertCall.html), [*experiments list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementExperimentListCall.html), [*experiments patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementExperimentPatchCall.html), [*experiments update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementExperimentUpdateCall.html), [*filters delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementFilterDeleteCall.html), [*filters get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementFilterGetCall.html), [*filters insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementFilterInsertCall.html), [*filters list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementFilterListCall.html), [*filters patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementFilterPatchCall.html), [*filters update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementFilterUpdateCall.html), [*goals get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementGoalGetCall.html), [*goals insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementGoalInsertCall.html), [*goals list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementGoalListCall.html), [*goals patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementGoalPatchCall.html), [*goals update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileDeleteCall.html), [*profiles get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileGetCall.html), [*profiles insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileInsertCall.html), [*profiles list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileListCall.html), [*profiles patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfilePatchCall.html), [*profiles update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementProfileUpdateCall.html), [*remarketing audience delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementRemarketingAudienceDeleteCall.html), [*remarketing audience get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementSegmentListCall.html), [*unsampled reports delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUploadGetCall.html), [*uploads list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUploadListCall.html), [*uploads upload data*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyListCall.html), [*webproperties patch*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkUpdateCall.html) + * [*account summaries list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementAccountSummaryListCall.html), [*account user links delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementAccountUserLinkListCall.html), [*account user links update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementAccountListCall.html), [*custom data sources list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementExperimentDeleteCall.html), [*experiments get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementExperimentGetCall.html), [*experiments insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementExperimentInsertCall.html), [*experiments list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementExperimentListCall.html), [*experiments patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementExperimentPatchCall.html), [*experiments update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementExperimentUpdateCall.html), [*filters delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementFilterDeleteCall.html), [*filters get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementFilterGetCall.html), [*filters insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementFilterInsertCall.html), [*filters list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementFilterListCall.html), [*filters patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementFilterPatchCall.html), [*filters update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementFilterUpdateCall.html), [*goals get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementGoalGetCall.html), [*goals insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementGoalInsertCall.html), [*goals list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementGoalListCall.html), [*goals patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementGoalPatchCall.html), [*goals update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileDeleteCall.html), [*profiles get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileGetCall.html), [*profiles insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileInsertCall.html), [*profiles list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileListCall.html), [*profiles patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfilePatchCall.html), [*profiles update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementProfileUpdateCall.html), [*remarketing audience delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementRemarketingAudienceDeleteCall.html), [*remarketing audience get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementSegmentListCall.html), [*unsampled reports delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUploadGetCall.html), [*uploads list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUploadListCall.html), [*uploads upload data*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyListCall.html), [*webproperties patch*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementWebpropertyUserLinkUpdateCall.html) * metadata - * [*columns list*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.MetadataColumnListCall.html) + * [*columns list*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.MetadataColumnListCall.html) * provisioning - * [*create account ticket*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ProvisioningCreateAccountTicketCall.html) + * [*create account ticket*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ProvisioningCreateAccountTicketCall.html) Upload supported by ... -* [*uploads upload data management*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.ManagementUploadUploadDataCall.html) +* [*uploads upload data management*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.ManagementUploadUploadDataCall.html) @@ -33,17 +33,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/struct.Analytics.html)** +* **[Hub](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/struct.Analytics.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.Part.html)** + * **[Parts](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/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")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/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](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/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](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/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](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/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](https://docs.rs/google-analytics3/1.0.6+20170321/google_analytics3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-analytics3/1.0.6+20170807/google_analytics3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/analytics3/src/lib.rs b/gen/analytics3/src/lib.rs index e0bd0ecedd..9534c44ebd 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 *1.0.6+20170321*, where *20170321* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *analytics* crate version *1.0.6+20170807*, where *20170807* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *analytics* *v3* API can be found at the //! [official documentation site](https://developers.google.com/analytics/). @@ -1635,11 +1635,14 @@ pub struct Upload { /// Custom data source Id to which this data import belongs. #[serde(rename="customDataSourceId")] pub custom_data_source_id: Option, - /// A unique ID for this upload. - pub id: Option, /// Account Id to which this upload belongs. #[serde(rename="accountId")] pub account_id: Option, + /// Time this file is uploaded. + #[serde(rename="uploadTime")] + pub upload_time: Option, + /// A unique ID for this upload. + pub id: Option, } impl ResponseResult for Upload {} @@ -1981,7 +1984,7 @@ pub struct LinkedForeignAccount { /// Web property ID of the form UA-XXXXX-YY to which this linked foreign account belongs. #[serde(rename="webPropertyId")] pub web_property_id: Option, - /// The type of the foreign account. For example `ADWORDS_LINKS`. + /// The type of the foreign account. For example, `ADWORDS_LINKS`, `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`. #[serde(rename="type")] pub type_: Option, /// Boolean indicating whether this is eligible for search. @@ -3356,45 +3359,47 @@ impl Part for CustomDataSourceParentLink {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CustomDataSource { - /// Resource type for Analytics custom data source. - pub kind: Option, - /// Description of custom data source. - pub description: Option, - /// IDs of views (profiles) linked to the custom data source. - #[serde(rename="profilesLinked")] - pub profiles_linked: Option>, - /// no description provided - #[serde(rename="uploadType")] - pub upload_type: Option, - /// Time this custom data source was created. - pub created: Option, /// Time this custom data source was last modified. pub updated: Option, - /// Account ID to which this custom data source belongs. - #[serde(rename="accountId")] - pub account_id: Option, + /// Description of custom data source. + pub description: Option, + /// Upload type of the custom data source. + #[serde(rename="uploadType")] + pub upload_type: Option, /// no description provided #[serde(rename="childLink")] pub child_link: Option, /// Web property ID of the form UA-XXXXX-YY to which this custom data source belongs. #[serde(rename="webPropertyId")] pub web_property_id: Option, - /// Parent link for this custom data source. Points to the web property to which this custom data source belongs. - #[serde(rename="parentLink")] - pub parent_link: Option, /// no description provided #[serde(rename="importBehavior")] pub import_behavior: Option, + /// Custom data source ID. + pub id: Option, + /// Account ID to which this custom data source belongs. + #[serde(rename="accountId")] + pub account_id: Option, + /// Resource type for Analytics custom data source. + pub kind: Option, + /// Name of this custom data source. + pub name: Option, + /// Time this custom data source was created. + pub created: Option, + /// IDs of views (profiles) linked to the custom data source. + #[serde(rename="profilesLinked")] + pub profiles_linked: Option>, + /// Parent link for this custom data source. Points to the web property to which this custom data source belongs. + #[serde(rename="parentLink")] + pub parent_link: Option, /// Type of the custom data source. #[serde(rename="type")] pub type_: Option, - /// Custom data source ID. - pub id: Option, /// Link for this Analytics custom data source. #[serde(rename="selfLink")] pub self_link: Option, - /// Name of this custom data source. - pub name: Option, + /// Collection of schema headers of the custom data source. + pub schema: Option>, } impl Part for CustomDataSource {} diff --git a/gen/androiddeviceprovisioning1-cli/Cargo.toml b/gen/androiddeviceprovisioning1-cli/Cargo.toml new file mode 100644 index 0000000000..9c5a94b912 --- /dev/null +++ b/gen/androiddeviceprovisioning1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-androiddeviceprovisioning1-cli" +version = "1.0.6+20170923" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Android Provisioning Partner (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1-cli" +homepage = "https://developers.google.com/zero-touch/" +documentation = "http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli" +license = "MIT" +keywords = ["androiddeviceprovisi", "google", "cli"] + +[[bin]] +name = "androiddeviceprovisioning1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-androiddeviceprovisioning1] +path = "../androiddeviceprovisioning1" +version = "1.0.6+20170923" diff --git a/gen/androiddeviceprovisioning1-cli/LICENSE.md b/gen/androiddeviceprovisioning1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/androiddeviceprovisioning1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/androiddeviceprovisioning1-cli/README.md b/gen/androiddeviceprovisioning1-cli/README.md new file mode 100644 index 0000000000..c6ec3eeb18 --- /dev/null +++ b/gen/androiddeviceprovisioning1-cli/README.md @@ -0,0 +1,122 @@ + +The `androiddeviceprovisioning1` command-line interface *(CLI)* allows to use most features of the *Google Android Provisioning Partner* 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 *Android Provisioning Partner* API can be found at the +[official documentation site](https://developers.google.com/zero-touch/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-androiddeviceprovisioning1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1-cli). + +# Usage + +This documentation was generated from the *Android Provisioning Partner* API at revision *20170923*. The CLI is at version *1.0.6*. + +```bash +androiddeviceprovisioning1 [options] + operations + get [-p ]... [-o ] + partners + customers-create (-r )... [-p ]... [-o ] + customers-list [-p ]... [-o ] + devices-claim (-r )... [-p ]... [-o ] + devices-claim-async (-r )... [-p ]... [-o ] + devices-find-by-identifier (-r )... [-p ]... [-o ] + devices-find-by-owner (-r )... [-p ]... [-o ] + devices-get [-p ]... [-o ] + devices-metadata (-r )... [-p ]... [-o ] + devices-unclaim (-r )... [-p ]... [-o ] + devices-unclaim-async (-r )... [-p ]... [-o ] + devices-update-metadata-async (-r )... [-p ]... [-o ] + androiddeviceprovisioning1 --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 `androiddeviceprovisioning1-`. 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/androiddeviceprovisioning1-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/androiddeviceprovisioning1-secret.json`, assuming that the required *androiddeviceprovisioning* 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. `androiddeviceprovisioning1 --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/androiddeviceprovisioning1-cli/mkdocs.yml b/gen/androiddeviceprovisioning1-cli/mkdocs.yml new file mode 100644 index 0000000000..07cccc483b --- /dev/null +++ b/gen/androiddeviceprovisioning1-cli/mkdocs.yml @@ -0,0 +1,28 @@ +site_name: Android Provisioning Partner v1.0.6+20170923 +site_url: http://byron.github.io/google-apis-rs/google-androiddeviceprovisioning1-cli +site_description: A complete library to interact with Android Provisioning Partner (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['operations_get.md', 'Operations', 'Get'] +- ['partners_customers-create.md', 'Partners', 'Customers Create'] +- ['partners_customers-list.md', 'Partners', 'Customers List'] +- ['partners_devices-claim.md', 'Partners', 'Devices Claim'] +- ['partners_devices-claim-async.md', 'Partners', 'Devices Claim Async'] +- ['partners_devices-find-by-identifier.md', 'Partners', 'Devices Find By Identifier'] +- ['partners_devices-find-by-owner.md', 'Partners', 'Devices Find By Owner'] +- ['partners_devices-get.md', 'Partners', 'Devices Get'] +- ['partners_devices-metadata.md', 'Partners', 'Devices Metadata'] +- ['partners_devices-unclaim.md', 'Partners', 'Devices Unclaim'] +- ['partners_devices-unclaim-async.md', 'Partners', 'Devices Unclaim Async'] +- ['partners_devices-update-metadata-async.md', 'Partners', 'Devices Update Metadata Async'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/androiddeviceprovisioning1-cli/src/cmn.rs b/gen/androiddeviceprovisioning1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/androiddeviceprovisioning1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/androiddeviceprovisioning1-cli/src/main.rs b/gen/androiddeviceprovisioning1-cli/src/main.rs new file mode 100644 index 0000000000..4efc3484d7 --- /dev/null +++ b/gen/androiddeviceprovisioning1-cli/src/main.rs @@ -0,0 +1,1526 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_androiddeviceprovisioning1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::AndroidProvisioningPartner>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_customers_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "customer.owner-emails" => Some(("customer.ownerEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "customer.company-id" => Some(("customer.companyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "customer.admin-emails" => Some(("customer.adminEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "customer.name" => Some(("customer.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "customer.company-name" => Some(("customer.companyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["admin-emails", "company-id", "company-name", "customer", "name", "owner-emails"]); + 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::CreateCustomerRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().customers_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_customers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.partners().customers_list(opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_claim(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "device-identifier.imei" => Some(("deviceIdentifier.imei", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.serial-number" => Some(("deviceIdentifier.serialNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.meid" => Some(("deviceIdentifier.meid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.manufacturer" => Some(("deviceIdentifier.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "section-type" => Some(("sectionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["customer-id", "device-identifier", "imei", "manufacturer", "meid", "section-type", "serial-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::ClaimDeviceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_claim(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_claim_async(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ClaimDevicesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_claim_async(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_find_by_identifier(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.imei" => Some(("deviceIdentifier.imei", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.serial-number" => Some(("deviceIdentifier.serialNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.meid" => Some(("deviceIdentifier.meid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.manufacturer" => Some(("deviceIdentifier.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit" => Some(("limit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["device-identifier", "imei", "limit", "manufacturer", "meid", "page-token", "serial-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::FindDevicesByDeviceIdentifierRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_find_by_identifier(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_find_by_owner(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit" => Some(("limit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "section-type" => Some(("sectionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["customer-id", "limit", "page-token", "section-type"]); + 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::FindDevicesByOwnerRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_find_by_owner(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.partners().devices_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_metadata(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "device-metadata.entries" => Some(("deviceMetadata.entries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["device-metadata", "entries"]); + 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::UpdateDeviceMetadataRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_metadata(request, opt.value_of("metadata-owner-id").unwrap_or(""), opt.value_of("device-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_unclaim(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "device-identifier.imei" => Some(("deviceIdentifier.imei", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.serial-number" => Some(("deviceIdentifier.serialNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.meid" => Some(("deviceIdentifier.meid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-identifier.manufacturer" => Some(("deviceIdentifier.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device-id" => Some(("deviceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "section-type" => Some(("sectionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["device-id", "device-identifier", "imei", "manufacturer", "meid", "section-type", "serial-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::UnclaimDeviceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_unclaim(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_unclaim_async(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UnclaimDevicesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_unclaim_async(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _partners_devices_update_metadata_async(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateDeviceMetadataInBatchRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.partners().devices_update_metadata_async(request, opt.value_of("partner-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("operations", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._operations_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("operations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("partners", Some(opt)) => { + match opt.subcommand() { + ("customers-create", Some(opt)) => { + call_result = self._partners_customers_create(opt, dry_run, &mut err); + }, + ("customers-list", Some(opt)) => { + call_result = self._partners_customers_list(opt, dry_run, &mut err); + }, + ("devices-claim", Some(opt)) => { + call_result = self._partners_devices_claim(opt, dry_run, &mut err); + }, + ("devices-claim-async", Some(opt)) => { + call_result = self._partners_devices_claim_async(opt, dry_run, &mut err); + }, + ("devices-find-by-identifier", Some(opt)) => { + call_result = self._partners_devices_find_by_identifier(opt, dry_run, &mut err); + }, + ("devices-find-by-owner", Some(opt)) => { + call_result = self._partners_devices_find_by_owner(opt, dry_run, &mut err); + }, + ("devices-get", Some(opt)) => { + call_result = self._partners_devices_get(opt, dry_run, &mut err); + }, + ("devices-metadata", Some(opt)) => { + call_result = self._partners_devices_metadata(opt, dry_run, &mut err); + }, + ("devices-unclaim", Some(opt)) => { + call_result = self._partners_devices_unclaim(opt, dry_run, &mut err); + }, + ("devices-unclaim-async", Some(opt)) => { + call_result = self._partners_devices_unclaim_async(opt, dry_run, &mut err); + }, + ("devices-update-metadata-async", Some(opt)) => { + call_result = self._partners_devices_update_metadata_async(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("partners".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<'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, "androiddeviceprovisioning1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "androiddeviceprovisioning1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::AndroidProvisioningPartner::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 = [ + ("operations", "methods: 'get'", vec![ + ("get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/operations_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("partners", "methods: 'customers-create', 'customers-list', 'devices-claim', 'devices-claim-async', 'devices-find-by-identifier', 'devices-find-by-owner', 'devices-get', 'devices-metadata', 'devices-unclaim', 'devices-unclaim-async' and 'devices-update-metadata-async'", vec![ + ("customers-create", + Some(r##"Creates a customer for zero-touch enrollment. After the method returns + successfully, admin and owner roles can manage devices and EMM configs + by calling API methods or using their zero-touch enrollment portal. The API + doesn't notify the customer that they have access."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_customers-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource ID in format `partners/[PARTNER_ID]` that + identifies the reseller."##), + 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)), + ]), + ("customers-list", + Some(r##"Lists the customers that are enrolled to the reseller identified by the + `partnerId` argument. This list includes customers that the reseller + created and customers that enrolled themselves using the portal."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_customers-list", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"The ID of the partner."##), + 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)), + ]), + ("devices-claim", + Some(r##"Claim the device identified by device identifier."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-claim", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"ID of the partner."##), + 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)), + ]), + ("devices-claim-async", + Some(r##"Claim devices asynchronously."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-claim-async", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"Partner ID."##), + 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)), + ]), + ("devices-find-by-identifier", + Some(r##"Find devices by device identifier."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-find-by-identifier", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"ID of the partner."##), + 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)), + ]), + ("devices-find-by-owner", + Some(r##"Find devices by ownership."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-find-by-owner", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"ID of the partner."##), + 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)), + ]), + ("devices-get", + Some(r##"Get a device."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`."##), + 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)), + ]), + ("devices-metadata", + Some(r##"Update the metadata."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-metadata", + vec![ + (Some(r##"metadata-owner-id"##), + None, + Some(r##"The owner of the newly set metadata. Set this to the partner ID."##), + Some(true), + Some(false)), + + (Some(r##"device-id"##), + None, + Some(r##"ID of the partner."##), + 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)), + ]), + ("devices-unclaim", + Some(r##"Unclaim the device identified by the `device_id` or the `deviceIdentifier`."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-unclaim", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"ID of the partner."##), + 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)), + ]), + ("devices-unclaim-async", + Some(r##"Unclaim devices asynchronously."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-unclaim-async", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"Partner ID."##), + 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)), + ]), + ("devices-update-metadata-async", + Some(r##"Set metadata in batch asynchronously."##), + "Details at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli/partners_devices-update-metadata-async", + vec![ + (Some(r##"partner-id"##), + None, + Some(r##"Partner ID."##), + 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("androiddeviceprovisioning1") + .author("Sebastian Thiel ") + .version("1.0.6+20170923") + .about("Automates reseller integration into zero-touch enrollment by assigning devices to customers and creating device reports.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/androiddeviceprovisioning1/Cargo.toml b/gen/androiddeviceprovisioning1/Cargo.toml new file mode 100644 index 0000000000..d1baf78948 --- /dev/null +++ b/gen/androiddeviceprovisioning1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-androiddeviceprovisioning1" +version = "1.0.6+20170923" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Android Provisioning Partner (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1" +homepage = "https://developers.google.com/zero-touch/" +documentation = "https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923" +license = "MIT" +keywords = ["androiddeviceprovisi", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/androiddeviceprovisioning1/LICENSE.md b/gen/androiddeviceprovisioning1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/androiddeviceprovisioning1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/androiddeviceprovisioning1/README.md b/gen/androiddeviceprovisioning1/README.md new file mode 100644 index 0000000000..667b50aba0 --- /dev/null +++ b/gen/androiddeviceprovisioning1/README.md @@ -0,0 +1,185 @@ + +The `google-androiddeviceprovisioning1` library allows access to all features of the *Google Android Provisioning Partner* service. + +This documentation was generated from *Android Provisioning Partner* crate version *1.0.6+20170923*, where *20170923* is the exact revision of the *androiddeviceprovisioning:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Android Provisioning Partner* *v1* API can be found at the +[official documentation site](https://developers.google.com/zero-touch/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html) ... + +* [operations](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.Operation.html) + * [*get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.OperationGetCall.html) +* partners + * [*customers create*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerCustomerCreateCall.html), [*customers list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerCustomerListCall.html), [*devices claim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimCall.html), [*devices claim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimAsyncCall.html), [*devices find by identifier*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByIdentifierCall.html), [*devices find by owner*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByOwnerCall.html), [*devices get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceGetCall.html), [*devices metadata*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceMetadataCall.html), [*devices unclaim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimCall.html), [*devices unclaim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimAsyncCall.html) and [*devices update metadata async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.PartnerDeviceUpdateMetadataAsyncCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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.partners().devices_update_metadata_async(...).doit() +let r = hub.partners().devices_unclaim_async(...).doit() +let r = hub.operations().get(...).doit() +let r = hub.partners().devices_claim_async(...).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-androiddeviceprovisioning1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +use androiddeviceprovisioning1::UpdateDeviceMetadataInBatchRequest; +use androiddeviceprovisioning1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use androiddeviceprovisioning1::AndroidProvisioningPartner; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateDeviceMetadataInBatchRequest::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.partners().devices_update_metadata_async(req, "partnerId") + .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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/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 **androiddeviceprovisioning1** 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-rsblob/master/LICENSE.md diff --git a/gen/androiddeviceprovisioning1/src/cmn.rs b/gen/androiddeviceprovisioning1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/androiddeviceprovisioning1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/androiddeviceprovisioning1/src/lib.rs b/gen/androiddeviceprovisioning1/src/lib.rs new file mode 100644 index 0000000000..a05e06a092 --- /dev/null +++ b/gen/androiddeviceprovisioning1/src/lib.rs @@ -0,0 +1,4247 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Android Provisioning Partner* crate version *1.0.6+20170923*, where *20170923* is the exact revision of the *androiddeviceprovisioning:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Android Provisioning Partner* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/zero-touch/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.AndroidProvisioningPartner.html) ... +//! +//! * [operations](struct.Operation.html) +//! * [*get*](struct.OperationGetCall.html) +//! * partners +//! * [*customers create*](struct.PartnerCustomerCreateCall.html), [*customers list*](struct.PartnerCustomerListCall.html), [*devices claim*](struct.PartnerDeviceClaimCall.html), [*devices claim async*](struct.PartnerDeviceClaimAsyncCall.html), [*devices find by identifier*](struct.PartnerDeviceFindByIdentifierCall.html), [*devices find by owner*](struct.PartnerDeviceFindByOwnerCall.html), [*devices get*](struct.PartnerDeviceGetCall.html), [*devices metadata*](struct.PartnerDeviceMetadataCall.html), [*devices unclaim*](struct.PartnerDeviceUnclaimCall.html), [*devices unclaim async*](struct.PartnerDeviceUnclaimAsyncCall.html) and [*devices update metadata async*](struct.PartnerDeviceUpdateMetadataAsyncCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.AndroidProvisioningPartner.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.partners().devices_update_metadata_async(...).doit() +//! let r = hub.partners().devices_unclaim_async(...).doit() +//! let r = hub.operations().get(...).doit() +//! let r = hub.partners().devices_claim_async(...).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-androiddeviceprovisioning1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +//! use androiddeviceprovisioning1::UpdateDeviceMetadataInBatchRequest; +//! use androiddeviceprovisioning1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use androiddeviceprovisioning1::AndroidProvisioningPartner; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateDeviceMetadataInBatchRequest::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.partners().devices_update_metadata_async(req, "partnerId") +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 AndroidProvisioningPartner related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::UpdateDeviceMetadataInBatchRequest; +/// use androiddeviceprovisioning1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateDeviceMetadataInBatchRequest::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.partners().devices_update_metadata_async(req, "partnerId") +/// .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 AndroidProvisioningPartner { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for AndroidProvisioningPartner {} + +impl<'a, C, A> AndroidProvisioningPartner + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> AndroidProvisioningPartner { + AndroidProvisioningPartner { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://androiddeviceprovisioning.googleapis.com/".to_string(), + _root_url: "https://androiddeviceprovisioning.googleapis.com/".to_string(), + } + } + + pub fn operations(&'a self) -> OperationMethods<'a, C, A> { + OperationMethods { hub: &self } + } + pub fn partners(&'a self) -> PartnerMethods<'a, C, A> { + PartnerMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://androiddeviceprovisioning.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://androiddeviceprovisioning.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Response message containing device id of the claim. +/// +/// # 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*). +/// +/// * [devices claim partners](struct.PartnerDeviceClaimCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClaimDeviceResponse { + /// The resource name of the device in the format + /// `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + #[serde(rename="deviceName")] + pub device_name: Option, + /// The device ID of the claimed device. + #[serde(rename="deviceId")] + pub device_id: Option, +} + +impl ResponseResult for ClaimDeviceResponse {} + + +/// Identifies one claim request. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartnerClaim { + /// Device identifier of the device. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// Metadata to set at claim. + #[serde(rename="deviceMetadata")] + pub device_metadata: Option, + /// Section type to claim. + #[serde(rename="sectionType")] + pub section_type: Option, + /// Customer ID to claim for. + #[serde(rename="customerId")] + pub customer_id: Option, +} + +impl Part for PartnerClaim {} + + +/// Response containing found devices. +/// +/// # 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*). +/// +/// * [devices find by owner partners](struct.PartnerDeviceFindByOwnerCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FindDevicesByOwnerResponse { + /// Page token of the next page. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Devices found. + pub devices: Option>, +} + +impl ResponseResult for FindDevicesByOwnerResponse {} + + +/// Identifies one unclaim request. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartnerUnclaim { + /// Device identifier of the device. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// Device ID of the device. + #[serde(rename="deviceId")] + pub device_id: Option, + /// Section type to unclaim. + #[serde(rename="sectionType")] + pub section_type: Option, +} + +impl Part for PartnerUnclaim {} + + +/// Request message to unclaim a device. +/// +/// # 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*). +/// +/// * [devices unclaim partners](struct.PartnerDeviceUnclaimCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UnclaimDeviceRequest { + /// The device identifier you used when you claimed this device. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// The device ID returned by `ClaimDevice`. + #[serde(rename="deviceId")] + pub device_id: Option, + /// The section type to unclaim for. + #[serde(rename="sectionType")] + pub section_type: Option, +} + +impl RequestValue for UnclaimDeviceRequest {} + + +/// Response containing found devices. +/// +/// # 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*). +/// +/// * [devices find by identifier partners](struct.PartnerDeviceFindByIdentifierCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FindDevicesByDeviceIdentifierResponse { + /// Page token of the next page. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Found devices. + pub devices: Option>, +} + +impl ResponseResult for FindDevicesByDeviceIdentifierResponse {} + + +/// Identifies a unique device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceIdentifier { + /// IMEI number. + pub imei: Option, + /// Serial number (optional). + #[serde(rename="serialNumber")] + pub serial_number: Option, + /// MEID number. + pub meid: Option, + /// Manufacturer name to match `android.os.Build.MANUFACTURER` (required). + /// Allowed values listed in + /// [manufacturer names](/zero-touch/resources/manufacturer-names). + pub manufacturer: Option, +} + +impl Part for DeviceIdentifier {} + + +/// Request to find devices by 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*). +/// +/// * [devices find by owner partners](struct.PartnerDeviceFindByOwnerCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FindDevicesByOwnerRequest { + /// Page token. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The number of devices to show in the result. + pub limit: Option, + /// List of customer IDs to search for. + #[serde(rename="customerId")] + pub customer_id: Option>, + /// The section type. + #[serde(rename="sectionType")] + pub section_type: Option, +} + +impl RequestValue for FindDevicesByOwnerRequest {} + + +/// Request to unclaim devices asynchronously in batch. +/// +/// # 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*). +/// +/// * [devices unclaim async partners](struct.PartnerDeviceUnclaimAsyncCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UnclaimDevicesRequest { + /// List of devices to unclaim. + pub unclaims: Option>, +} + +impl RequestValue for UnclaimDevicesRequest {} + + +/// Identifies metdata updates to one device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateMetadataArguments { + /// Device identifier. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// The metadata to update. + #[serde(rename="deviceMetadata")] + pub device_metadata: Option, + /// Device ID of the device. + #[serde(rename="deviceId")] + pub device_id: Option, +} + +impl Part for UpdateMetadataArguments {} + + +/// Request message to create a customer. +/// +/// # 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*). +/// +/// * [customers create partners](struct.PartnerCustomerCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateCustomerRequest { + /// Required. The company data to populate the new customer. Must contain a + /// value for `companyName` and at least one `owner_email` that's associated + /// with a Google Account. The values for `companyId` and `name` must be empty. + pub customer: Option, +} + +impl RequestValue for CreateCustomerRequest {} + + +/// Request message to claim a device on behalf of a customer. +/// +/// # 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*). +/// +/// * [devices claim partners](struct.PartnerDeviceClaimCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClaimDeviceRequest { + /// The device identifier of the device to claim. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// The customer to claim for. + #[serde(rename="customerId")] + pub customer_id: Option, + /// The section to claim. + #[serde(rename="sectionType")] + pub section_type: Option, +} + +impl RequestValue for ClaimDeviceRequest {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [devices unclaim partners](struct.PartnerDeviceUnclaimCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// A key-value pair of the device metadata. +/// +/// # 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*). +/// +/// * [devices metadata partners](struct.PartnerDeviceMetadataCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceMetadata { + /// Metadata entries + pub entries: Option>, +} + +impl ResponseResult for DeviceMetadata {} + + +/// A customer resource in the zero-touch enrollment API. +/// +/// # 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*). +/// +/// * [customers create partners](struct.PartnerCustomerCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Company { + /// Required. The name of the company. For example _XYZ Corp_. Characters + /// allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to the + /// customer's employees in the zero-touch enrollment portal. + #[serde(rename="companyName")] + pub company_name: Option, + /// Input only. Optional. Email address of customer's users in the admin role. + /// Each email address must be associated with a Google Account. + #[serde(rename="adminEmails")] + pub admin_emails: Option>, + /// Input only. Email address of customer's users in the owner role. At least + /// one `owner_email` is required. Each email address must be associated with a + /// Google Account. Owners share the same access as admins but can also add, + /// delete, and edit your organization's portal users. + #[serde(rename="ownerEmails")] + pub owner_emails: Option>, + /// Output only. The API resource name of the company in the format + /// `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server. + pub name: Option, + /// Output only. The ID of the company. Assigned by the server. + #[serde(rename="companyId")] + pub company_id: Option, +} + +impl ResponseResult for Company {} + + +/// Response message of all customers related to this partner. +/// +/// # 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*). +/// +/// * [customers list partners](struct.PartnerCustomerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCustomersResponse { + /// List of customers related to this partner. + pub customers: Option>, +} + +impl ResponseResult for ListCustomersResponse {} + + +/// Request to claim devices asynchronously in batch. +/// +/// # 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*). +/// +/// * [devices claim async partners](struct.PartnerDeviceClaimAsyncCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClaimDevicesRequest { + /// List of claims. + pub claims: Option>, +} + +impl RequestValue for ClaimDevicesRequest {} + + +/// Request to update device metadata in batch. +/// +/// # 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*). +/// +/// * [devices update metadata async partners](struct.PartnerDeviceUpdateMetadataAsyncCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateDeviceMetadataInBatchRequest { + /// List of metadata updates. + pub updates: Option>, +} + +impl RequestValue for UpdateDeviceMetadataInBatchRequest {} + + +/// Request to find devices. +/// +/// # 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*). +/// +/// * [devices find by identifier partners](struct.PartnerDeviceFindByIdentifierCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FindDevicesByDeviceIdentifierRequest { + /// Page token. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The device identifier to search. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// Number of devices to show. + pub limit: Option, +} + +impl RequestValue for FindDevicesByDeviceIdentifierRequest {} + + +/// An Android device. +/// +/// # 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*). +/// +/// * [devices get partners](struct.PartnerDeviceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Device { + /// Device identifier. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, + /// Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + pub name: Option, + /// Claims. + pub claims: Option>, + /// Device metadata. + #[serde(rename="deviceMetadata")] + pub device_metadata: Option, + /// The resource name of the configuration. + /// Only set for customers. + pub configuration: Option, + /// Device ID. + #[serde(rename="deviceId")] + pub device_id: Option, +} + +impl ResponseResult for Device {} + + +/// Information about a device claimed for a partner. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceClaim { + /// Section type of the device claim. + #[serde(rename="sectionType")] + pub section_type: Option, + /// Owner ID. + #[serde(rename="ownerCompanyId")] + pub owner_company_id: Option, +} + +impl Part for DeviceClaim {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [devices update metadata async partners](struct.PartnerDeviceUpdateMetadataAsyncCall.html) (response) +/// * [devices unclaim async partners](struct.PartnerDeviceUnclaimAsyncCall.html) (response) +/// * [get operations](struct.OperationGetCall.html) (response) +/// * [devices claim async partners](struct.PartnerDeviceClaimAsyncCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// This field will always be not set if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error information for each device is set in `response.perDeviceStatus.result.status`. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// This field will contain a `DevicesLongRunningOperationResponse` object if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should have the format of `operations/some/unique/name`. + pub name: Option, + /// This field will contain a `DevicesLongRunningOperationMetadata` object if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. + pub metadata: Option>, +} + +impl Resource for Operation {} +impl ResponseResult for Operation {} + + +/// Request to set metadata for a device. +/// +/// # 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*). +/// +/// * [devices metadata partners](struct.PartnerDeviceMetadataCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateDeviceMetadataRequest { + /// The metdata to set. + #[serde(rename="deviceMetadata")] + pub device_metadata: Option, +} + +impl RequestValue for UpdateDeviceMetadataRequest {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *operation* resources. +/// It is not used directly, but through the `AndroidProvisioningPartner` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` +/// // to build up your call. +/// let rb = hub.operations(); +/// # } +/// ``` +pub struct OperationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, +} + +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 the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn get(&self, name: &str) -> OperationGetCall<'a, C, A> { + OperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *partner* resources. +/// It is not used directly, but through the `AndroidProvisioningPartner` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `customers_create(...)`, `customers_list(...)`, `devices_claim(...)`, `devices_claim_async(...)`, `devices_find_by_identifier(...)`, `devices_find_by_owner(...)`, `devices_get(...)`, `devices_metadata(...)`, `devices_unclaim(...)`, `devices_unclaim_async(...)` and `devices_update_metadata_async(...)` +/// // to build up your call. +/// let rb = hub.partners(); +/// # } +/// ``` +pub struct PartnerMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, +} + +impl<'a, C, A> MethodsBuilder for PartnerMethods<'a, C, A> {} + +impl<'a, C, A> PartnerMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Get a device. + /// + /// # Arguments + /// + /// * `name` - Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + pub fn devices_get(&self, name: &str) -> PartnerDeviceGetCall<'a, C, A> { + PartnerDeviceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Find devices by device identifier. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - ID of the partner. + pub fn devices_find_by_identifier(&self, request: FindDevicesByDeviceIdentifierRequest, partner_id: &str) -> PartnerDeviceFindByIdentifierCall<'a, C, A> { + PartnerDeviceFindByIdentifierCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Find devices by ownership. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - ID of the partner. + pub fn devices_find_by_owner(&self, request: FindDevicesByOwnerRequest, partner_id: &str) -> PartnerDeviceFindByOwnerCall<'a, C, A> { + PartnerDeviceFindByOwnerCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Claim the device identified by device identifier. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - ID of the partner. + pub fn devices_claim(&self, request: ClaimDeviceRequest, partner_id: &str) -> PartnerDeviceClaimCall<'a, C, A> { + PartnerDeviceClaimCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Unclaim devices asynchronously. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - Partner ID. + pub fn devices_unclaim_async(&self, request: UnclaimDevicesRequest, partner_id: &str) -> PartnerDeviceUnclaimAsyncCall<'a, C, A> { + PartnerDeviceUnclaimAsyncCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Claim devices asynchronously. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - Partner ID. + pub fn devices_claim_async(&self, request: ClaimDevicesRequest, partner_id: &str) -> PartnerDeviceClaimAsyncCall<'a, C, A> { + PartnerDeviceClaimAsyncCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Set metadata in batch asynchronously. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - Partner ID. + pub fn devices_update_metadata_async(&self, request: UpdateDeviceMetadataInBatchRequest, partner_id: &str) -> PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> { + PartnerDeviceUpdateMetadataAsyncCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update the metadata. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `metadataOwnerId` - The owner of the newly set metadata. Set this to the partner ID. + /// * `deviceId` - ID of the partner. + pub fn devices_metadata(&self, request: UpdateDeviceMetadataRequest, metadata_owner_id: &str, device_id: &str) -> PartnerDeviceMetadataCall<'a, C, A> { + PartnerDeviceMetadataCall { + hub: self.hub, + _request: request, + _metadata_owner_id: metadata_owner_id.to_string(), + _device_id: device_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a customer for zero-touch enrollment. After the method returns + /// successfully, admin and owner roles can manage devices and EMM configs + /// by calling API methods or using their zero-touch enrollment portal. The API + /// doesn't notify the customer that they have access. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource ID in format `partners/[PARTNER_ID]` that + /// identifies the reseller. + pub fn customers_create(&self, request: CreateCustomerRequest, parent: &str) -> PartnerCustomerCreateCall<'a, C, A> { + PartnerCustomerCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the customers that are enrolled to the reseller identified by the + /// `partnerId` argument. This list includes customers that the reseller + /// created and customers that enrolled themselves using the portal. + /// + /// # Arguments + /// + /// * `partnerId` - The ID of the partner. + pub fn customers_list(&self, partner_id: &str) -> PartnerCustomerListCall<'a, C, A> { + PartnerCustomerListCall { + hub: self.hub, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Unclaim the device identified by the `device_id` or the `deviceIdentifier`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `partnerId` - ID of the partner. + pub fn devices_unclaim(&self, request: UnclaimDeviceRequest, partner_id: &str) -> PartnerDeviceUnclaimCall<'a, C, A> { + PartnerDeviceUnclaimCall { + hub: self.hub, + _request: request, + _partner_id: partner_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *get* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().get("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} + +impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + + 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 [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Get a device. +/// +/// A builder for the *devices.get* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.partners().devices_get("name") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceGetCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceGetCall<'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, Device)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + + 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 [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let 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(d); + 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(d); + 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) + } + } + } + } + + + /// Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> PartnerDeviceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> PartnerDeviceGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Find devices by device identifier. +/// +/// A builder for the *devices.findByIdentifier* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::FindDevicesByDeviceIdentifierRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FindDevicesByDeviceIdentifierRequest::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.partners().devices_find_by_identifier(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceFindByIdentifierCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: FindDevicesByDeviceIdentifierRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceFindByIdentifierCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceFindByIdentifierCall<'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, FindDevicesByDeviceIdentifierResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.findByIdentifier", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:findByIdentifier"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: FindDevicesByDeviceIdentifierRequest) -> PartnerDeviceFindByIdentifierCall<'a, C, A> { + self._request = new_value; + self + } + /// ID of the partner. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceFindByIdentifierCall<'a, C, A> { + self._partner_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) -> PartnerDeviceFindByIdentifierCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceFindByIdentifierCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Find devices by ownership. +/// +/// A builder for the *devices.findByOwner* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::FindDevicesByOwnerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FindDevicesByOwnerRequest::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.partners().devices_find_by_owner(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceFindByOwnerCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: FindDevicesByOwnerRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceFindByOwnerCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceFindByOwnerCall<'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, FindDevicesByOwnerResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.findByOwner", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:findByOwner"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: FindDevicesByOwnerRequest) -> PartnerDeviceFindByOwnerCall<'a, C, A> { + self._request = new_value; + self + } + /// ID of the partner. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceFindByOwnerCall<'a, C, A> { + self._partner_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) -> PartnerDeviceFindByOwnerCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceFindByOwnerCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Claim the device identified by device identifier. +/// +/// A builder for the *devices.claim* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::ClaimDeviceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ClaimDeviceRequest::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.partners().devices_claim(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceClaimCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: ClaimDeviceRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceClaimCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceClaimCall<'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, ClaimDeviceResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.claim", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:claim"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: ClaimDeviceRequest) -> PartnerDeviceClaimCall<'a, C, A> { + self._request = new_value; + self + } + /// ID of the partner. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceClaimCall<'a, C, A> { + self._partner_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) -> PartnerDeviceClaimCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceClaimCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Unclaim devices asynchronously. +/// +/// A builder for the *devices.unclaimAsync* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::UnclaimDevicesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UnclaimDevicesRequest::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.partners().devices_unclaim_async(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceUnclaimAsyncCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: UnclaimDevicesRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceUnclaimAsyncCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceUnclaimAsyncCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.unclaimAsync", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:unclaimAsync"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: UnclaimDevicesRequest) -> PartnerDeviceUnclaimAsyncCall<'a, C, A> { + self._request = new_value; + self + } + /// Partner ID. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceUnclaimAsyncCall<'a, C, A> { + self._partner_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) -> PartnerDeviceUnclaimAsyncCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceUnclaimAsyncCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Claim devices asynchronously. +/// +/// A builder for the *devices.claimAsync* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::ClaimDevicesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ClaimDevicesRequest::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.partners().devices_claim_async(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceClaimAsyncCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: ClaimDevicesRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceClaimAsyncCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceClaimAsyncCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.claimAsync", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:claimAsync"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: ClaimDevicesRequest) -> PartnerDeviceClaimAsyncCall<'a, C, A> { + self._request = new_value; + self + } + /// Partner ID. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceClaimAsyncCall<'a, C, A> { + self._partner_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) -> PartnerDeviceClaimAsyncCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceClaimAsyncCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Set metadata in batch asynchronously. +/// +/// A builder for the *devices.updateMetadataAsync* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::UpdateDeviceMetadataInBatchRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateDeviceMetadataInBatchRequest::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.partners().devices_update_metadata_async(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: UpdateDeviceMetadataInBatchRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.updateMetadataAsync", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:updateMetadataAsync"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: UpdateDeviceMetadataInBatchRequest) -> PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> { + self._request = new_value; + self + } + /// Partner ID. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> { + self._partner_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) -> PartnerDeviceUpdateMetadataAsyncCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Update the metadata. +/// +/// A builder for the *devices.metadata* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::UpdateDeviceMetadataRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateDeviceMetadataRequest::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.partners().devices_metadata(req, "metadataOwnerId", "deviceId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceMetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: UpdateDeviceMetadataRequest, + _metadata_owner_id: String, + _device_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceMetadataCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceMetadataCall<'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, DeviceMetadata)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.metadata", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("metadataOwnerId", self._metadata_owner_id.to_string())); + params.push(("deviceId", self._device_id.to_string())); + for &field in ["alt", "metadataOwnerId", "deviceId"].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 = self.hub._base_url.clone() + "v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata"; + + 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 [("{+metadataOwnerId}", "metadataOwnerId"), ("{+deviceId}", "deviceId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["deviceId", "metadataOwnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: UpdateDeviceMetadataRequest) -> PartnerDeviceMetadataCall<'a, C, A> { + self._request = new_value; + self + } + /// The owner of the newly set metadata. Set this to the partner ID. + /// + /// Sets the *metadata owner 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 metadata_owner_id(mut self, new_value: &str) -> PartnerDeviceMetadataCall<'a, C, A> { + self._metadata_owner_id = new_value.to_string(); + self + } + /// ID of the partner. + /// + /// Sets the *device 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 device_id(mut self, new_value: &str) -> PartnerDeviceMetadataCall<'a, C, A> { + self._device_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) -> PartnerDeviceMetadataCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceMetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Creates a customer for zero-touch enrollment. After the method returns +/// successfully, admin and owner roles can manage devices and EMM configs +/// by calling API methods or using their zero-touch enrollment portal. The API +/// doesn't notify the customer that they have access. +/// +/// A builder for the *customers.create* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::CreateCustomerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateCustomerRequest::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.partners().customers_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct PartnerCustomerCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: CreateCustomerRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerCustomerCreateCall<'a, C, A> {} + +impl<'a, C, A> PartnerCustomerCreateCall<'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, Company)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.customers.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/customers"; + + 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 [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(d); + 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(d); + 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: CreateCustomerRequest) -> PartnerCustomerCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource ID in format `partners/[PARTNER_ID]` that + /// identifies the reseller. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> PartnerCustomerCreateCall<'a, C, A> { + self._parent = 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) -> PartnerCustomerCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerCustomerCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists the customers that are enrolled to the reseller identified by the +/// `partnerId` argument. This list includes customers that the reseller +/// created and customers that enrolled themselves using the portal. +/// +/// A builder for the *customers.list* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.partners().customers_list("partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerCustomerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerCustomerListCall<'a, C, A> {} + +impl<'a, C, A> PartnerCustomerListCall<'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, ListCustomersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.customers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/customers"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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(d); + 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(d); + 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 partner. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerCustomerListCall<'a, C, A> { + self._partner_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) -> PartnerCustomerListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerCustomerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Unclaim the device identified by the `device_id` or the `deviceIdentifier`. +/// +/// A builder for the *devices.unclaim* method supported by a *partner* resource. +/// It is not used directly, but through a `PartnerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1; +/// use androiddeviceprovisioning1::UnclaimDeviceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androiddeviceprovisioning1::AndroidProvisioningPartner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidProvisioningPartner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UnclaimDeviceRequest::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.partners().devices_unclaim(req, "partnerId") +/// .doit(); +/// # } +/// ``` +pub struct PartnerDeviceUnclaimCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidProvisioningPartner, + _request: UnclaimDeviceRequest, + _partner_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for PartnerDeviceUnclaimCall<'a, C, A> {} + +impl<'a, C, A> PartnerDeviceUnclaimCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androiddeviceprovisioning.partners.devices.unclaim", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("partnerId", self._partner_id.to_string())); + for &field in ["alt", "partnerId"].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 = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:unclaim"; + + 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 [("{+partnerId}", "partnerId")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["partnerId"].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).expect("serde to work"); + 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(d); + 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(d); + 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: UnclaimDeviceRequest) -> PartnerDeviceUnclaimCall<'a, C, A> { + self._request = new_value; + self + } + /// ID of the partner. + /// + /// Sets the *partner 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 partner_id(mut self, new_value: &str) -> PartnerDeviceUnclaimCall<'a, C, A> { + self._partner_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) -> PartnerDeviceUnclaimCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PartnerDeviceUnclaimCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + diff --git a/gen/androidenterprise1-cli/Cargo.toml b/gen/androidenterprise1-cli/Cargo.toml index eefd19c320..391a089eaa 100644 --- a/gen/androidenterprise1-cli/Cargo.toml +++ b/gen/androidenterprise1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidenterprise1-cli" -version = "1.0.6+20170516" +version = "1.0.6+20170922" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-androidenterprise1] path = "../androidenterprise1" -version = "1.0.6+20170516" +version = "1.0.6+20170922" diff --git a/gen/androidenterprise1-cli/README.md b/gen/androidenterprise1-cli/README.md index 0304dd2c85..30437d475b 100644 --- a/gen/androidenterprise1-cli/README.md +++ b/gen/androidenterprise1-cli/README.md @@ -25,7 +25,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 *20170516*. The CLI is at version *1.0.6*. +This documentation was generated from the *Android Enterprise* API at revision *20170922*. The CLI is at version *1.0.6*. ```bash androidenterprise1 [options] @@ -42,6 +42,7 @@ androidenterprise1 [options] enroll (-r )... [-p ]... [-o ] generate-signup-url [-p ]... [-o ] get [-p ]... [-o ] + get-android-device-policy-config [-p ]... [-o ] get-service-account [-p ]... [-o ] get-store-layout [-p ]... [-o ] insert (-r )... [-p ]... [-o ] @@ -49,6 +50,7 @@ androidenterprise1 [options] pull-notification-set [-p ]... [-o ] send-test-push-notification [-p ]... [-o ] set-account (-r )... [-p ]... [-o ] + set-android-device-policy-config (-r )... [-p ]... [-o ] set-store-layout (-r )... [-p ]... [-o ] unenroll [-p ]... entitlements diff --git a/gen/androidenterprise1-cli/mkdocs.yml b/gen/androidenterprise1-cli/mkdocs.yml index fa71eec977..49542384e2 100644 --- a/gen/androidenterprise1-cli/mkdocs.yml +++ b/gen/androidenterprise1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Enterprise v1.0.6+20170516 +site_name: Android Enterprise v1.0.6+20170922 site_url: http://byron.github.io/google-apis-rs/google-androidenterprise1-cli site_description: A complete library to interact with Android Enterprise (protocol v1) @@ -20,6 +20,7 @@ pages: - ['enterprises_enroll.md', 'Enterprises', 'Enroll'] - ['enterprises_generate-signup-url.md', 'Enterprises', 'Generate Signup Url'] - ['enterprises_get.md', 'Enterprises', 'Get'] +- ['enterprises_get-android-device-policy-config.md', 'Enterprises', 'Get Android Device Policy Config'] - ['enterprises_get-service-account.md', 'Enterprises', 'Get Service Account'] - ['enterprises_get-store-layout.md', 'Enterprises', 'Get Store Layout'] - ['enterprises_insert.md', 'Enterprises', 'Insert'] @@ -27,6 +28,7 @@ pages: - ['enterprises_pull-notification-set.md', 'Enterprises', 'Pull Notification Set'] - ['enterprises_send-test-push-notification.md', 'Enterprises', 'Send Test Push Notification'] - ['enterprises_set-account.md', 'Enterprises', 'Set Account'] +- ['enterprises_set-android-device-policy-config.md', 'Enterprises', 'Set Android Device Policy Config'] - ['enterprises_set-store-layout.md', 'Enterprises', 'Set Store Layout'] - ['enterprises_unenroll.md', 'Enterprises', 'Unenroll'] - ['entitlements_delete.md', 'Entitlements', 'Delete'] diff --git a/gen/androidenterprise1-cli/src/main.rs b/gen/androidenterprise1-cli/src/main.rs index c74d36e3df..4269f6b23e 100644 --- a/gen/androidenterprise1-cli/src/main.rs +++ b/gen/androidenterprise1-cli/src/main.rs @@ -722,6 +722,58 @@ impl<'n> Engine<'n> { } } + fn _enterprises_get_android_device_policy_config(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().get_android_device_policy_config(opt.value_of("enterprise-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _enterprises_get_service_account(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.enterprises().get_service_account(opt.value_of("enterprise-id").unwrap_or("")); @@ -1164,6 +1216,92 @@ impl<'n> Engine<'n> { } } + fn _enterprises_set_android_device_policy_config(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "state"]); + 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::AndroidDevicePolicyConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().set_android_device_policy_config(request, opt.value_of("enterprise-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _enterprises_set_store_layout(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4974,6 +5112,9 @@ impl<'n> Engine<'n> { ("get", Some(opt)) => { call_result = self._enterprises_get(opt, dry_run, &mut err); }, + ("get-android-device-policy-config", Some(opt)) => { + call_result = self._enterprises_get_android_device_policy_config(opt, dry_run, &mut err); + }, ("get-service-account", Some(opt)) => { call_result = self._enterprises_get_service_account(opt, dry_run, &mut err); }, @@ -4995,6 +5136,9 @@ impl<'n> Engine<'n> { ("set-account", Some(opt)) => { call_result = self._enterprises_set_account(opt, dry_run, &mut err); }, + ("set-android-device-policy-config", Some(opt)) => { + call_result = self._enterprises_set_android_device_policy_config(opt, dry_run, &mut err); + }, ("set-store-layout", Some(opt)) => { call_result = self._enterprises_set_store_layout(opt, dry_run, &mut err); }, @@ -5495,7 +5639,7 @@ fn main() { ]), ]), - ("enterprises", "methods: 'acknowledge-notification-set', 'complete-signup', 'create-web-token', 'delete', 'enroll', 'generate-signup-url', 'get', 'get-service-account', 'get-store-layout', 'insert', 'list', 'pull-notification-set', 'send-test-push-notification', 'set-account', 'set-store-layout' and 'unenroll'", vec![ + ("enterprises", "methods: 'acknowledge-notification-set', 'complete-signup', 'create-web-token', 'delete', 'enroll', 'generate-signup-url', 'get', 'get-android-device-policy-config', 'get-service-account', 'get-store-layout', 'insert', 'list', 'pull-notification-set', 'send-test-push-notification', 'set-account', 'set-android-device-policy-config', 'set-store-layout' and 'unenroll'", vec![ ("acknowledge-notification-set", Some(r##"Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_acknowledge-notification-set", @@ -5626,6 +5770,28 @@ 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)), + ]), + ("get-android-device-policy-config", + Some(r##"Returns the Android Device Policy config resource."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_get-android-device-policy-config", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + 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"##), @@ -5753,7 +5919,7 @@ fn main() { Some(false)), ]), ("send-test-push-notification", - Some(r##"Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise."##), + Some(r##"Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_send-test-push-notification", vec![ (Some(r##"enterprise-id"##), @@ -5796,6 +5962,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)), + ]), + ("set-android-device-policy-config", + Some(r##"Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_set-android-device-policy-config", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + 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"##), @@ -7687,7 +7881,7 @@ fn main() { let mut app = App::new("androidenterprise1") .author("Sebastian Thiel ") - .version("1.0.6+20170516") + .version("1.0.6+20170922") .about("Manages 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 47bdb67820..ccf49866e6 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidenterprise1" -version = "1.0.6+20170516" +version = "1.0.6+20170922" 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" homepage = "https://developers.google.com/android/work/play/emm-api" -documentation = "https://docs.rs/google-androidenterprise1/1.0.6+20170516" +documentation = "https://docs.rs/google-androidenterprise1/1.0.6+20170922" license = "MIT" keywords = ["androidenterprise", "google", "protocol", "web", "api"] diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index 93e078ee1b..5035967855 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,42 +5,42 @@ 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 *1.0.6+20170516*, where *20170516* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Android Enterprise* crate version *1.0.6+20170922*, where *20170922* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Android Enterprise* *v1* API can be found at the [official documentation site](https://developers.google.com/android/work/play/emm-api). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.AndroidEnterprise.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.AndroidEnterprise.html) ... -* [devices](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.Device.html) - * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.DeviceListCall.html) and [*set state*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.DeviceSetStateCall.html) -* [enterprises](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.Enterprise.html) - * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseDeleteCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) -* [entitlements](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.Entitlement.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EntitlementListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EntitlementPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.EntitlementUpdateCall.html) +* [devices](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.Device.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.DeviceListCall.html) and [*set state*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.DeviceSetStateCall.html) +* [enterprises](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.Enterprise.html) + * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseDeleteCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get android device policy config*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseGetAndroidDevicePolicyConfigCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set android device policy config*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseSetAndroidDevicePolicyConfigCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) +* [entitlements](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.Entitlement.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EntitlementListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EntitlementPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.EntitlementUpdateCall.html) * grouplicenses - * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.GrouplicenseListCall.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.GrouplicenseListCall.html) * grouplicenseusers - * [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.GrouplicenseuserListCall.html) -* [installs](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.Install.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.InstallListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.InstallPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.InstallUpdateCall.html) + * [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.GrouplicenseuserListCall.html) +* [installs](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.Install.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.InstallListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.InstallPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.InstallUpdateCall.html) * managedconfigurationsfordevice - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) * managedconfigurationsforuser - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) -* [permissions](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.Permission.html) - * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.PermissionGetCall.html) -* [products](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.Product.html) - * [*approve*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductListCall.html) and [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ProductUnapproveCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) +* [permissions](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.Permission.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.PermissionGetCall.html) +* [products](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.Product.html) + * [*approve*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductListCall.html) and [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ProductUnapproveCall.html) * serviceaccountkeys - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) * storelayoutclusters - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutclusterListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutclusterPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutclusterListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutclusterPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) * storelayoutpages - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutpageListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutpagePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) -* [users](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.User.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserPatchCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.UserUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutpageListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutpagePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) +* [users](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.User.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserPatchCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.UserUpdateCall.html) @@ -49,17 +49,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/struct.AndroidEnterprise.html)** +* **[Hub](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.AndroidEnterprise.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -75,9 +75,10 @@ Or specifically ... ```ignore let r = hub.enterprises().send_test_push_notification(...).doit() let r = hub.enterprises().generate_signup_url(...).doit() -let r = hub.enterprises().get_service_account(...).doit() +let r = hub.enterprises().get_android_device_policy_config(...).doit() let r = hub.enterprises().acknowledge_notification_set(...).doit() let r = hub.enterprises().set_store_layout(...).doit() +let r = hub.enterprises().set_android_device_policy_config(...).doit() let r = hub.enterprises().get_store_layout(...).doit() let r = hub.enterprises().pull_notification_set(...).doit() let r = hub.enterprises().list(...).doit() @@ -89,6 +90,7 @@ let r = hub.enterprises().create_web_token(...).doit() let r = hub.enterprises().insert(...).doit() let r = hub.enterprises().get(...).doit() let r = hub.enterprises().unenroll(...).doit() +let r = hub.enterprises().get_service_account(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -114,6 +116,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_androidenterprise1 as androidenterprise1; +use androidenterprise1::StoreLayout; use androidenterprise1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -131,11 +134,15 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = StoreLayout::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.enterprises().get_service_account("enterpriseId") - .key_type("sit") +let result = hub.enterprises().set_store_layout(req, "enterpriseId") .doit(); match result { @@ -158,17 +165,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/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")`. @@ -178,29 +185,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/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](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/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](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/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](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/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](https://docs.rs/google-androidenterprise1/1.0.6+20170516/google_androidenterprise1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androidenterprise1/src/lib.rs b/gen/androidenterprise1/src/lib.rs index 7079c3ca5e..b3579f4caf 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 *1.0.6+20170516*, where *20170516* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Android Enterprise* crate version *1.0.6+20170922*, where *20170922* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Android Enterprise* *v1* API can be found at the //! [official documentation site](https://developers.google.com/android/work/play/emm-api). @@ -14,7 +14,7 @@ //! * [devices](struct.Device.html) //! * [*get*](struct.DeviceGetCall.html), [*get state*](struct.DeviceGetStateCall.html), [*list*](struct.DeviceListCall.html) and [*set state*](struct.DeviceSetStateCall.html) //! * [enterprises](struct.Enterprise.html) -//! * [*acknowledge notification set*](struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](struct.EnterpriseCompleteSignupCall.html), [*create web token*](struct.EnterpriseCreateWebTokenCall.html), [*delete*](struct.EnterpriseDeleteCall.html), [*enroll*](struct.EnterpriseEnrollCall.html), [*generate signup url*](struct.EnterpriseGenerateSignupUrlCall.html), [*get*](struct.EnterpriseGetCall.html), [*get service account*](struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](struct.EnterpriseGetStoreLayoutCall.html), [*insert*](struct.EnterpriseInsertCall.html), [*list*](struct.EnterpriseListCall.html), [*pull notification set*](struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](struct.EnterpriseSetAccountCall.html), [*set store layout*](struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](struct.EnterpriseUnenrollCall.html) +//! * [*acknowledge notification set*](struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](struct.EnterpriseCompleteSignupCall.html), [*create web token*](struct.EnterpriseCreateWebTokenCall.html), [*delete*](struct.EnterpriseDeleteCall.html), [*enroll*](struct.EnterpriseEnrollCall.html), [*generate signup url*](struct.EnterpriseGenerateSignupUrlCall.html), [*get*](struct.EnterpriseGetCall.html), [*get android device policy config*](struct.EnterpriseGetAndroidDevicePolicyConfigCall.html), [*get service account*](struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](struct.EnterpriseGetStoreLayoutCall.html), [*insert*](struct.EnterpriseInsertCall.html), [*list*](struct.EnterpriseListCall.html), [*pull notification set*](struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](struct.EnterpriseSetAccountCall.html), [*set android device policy config*](struct.EnterpriseSetAndroidDevicePolicyConfigCall.html), [*set store layout*](struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](struct.EnterpriseUnenrollCall.html) //! * [entitlements](struct.Entitlement.html) //! * [*delete*](struct.EntitlementDeleteCall.html), [*get*](struct.EntitlementGetCall.html), [*list*](struct.EntitlementListCall.html), [*patch*](struct.EntitlementPatchCall.html) and [*update*](struct.EntitlementUpdateCall.html) //! * grouplicenses @@ -75,9 +75,10 @@ //! ```ignore //! let r = hub.enterprises().send_test_push_notification(...).doit() //! let r = hub.enterprises().generate_signup_url(...).doit() -//! let r = hub.enterprises().get_service_account(...).doit() +//! let r = hub.enterprises().get_android_device_policy_config(...).doit() //! let r = hub.enterprises().acknowledge_notification_set(...).doit() //! let r = hub.enterprises().set_store_layout(...).doit() +//! let r = hub.enterprises().set_android_device_policy_config(...).doit() //! let r = hub.enterprises().get_store_layout(...).doit() //! let r = hub.enterprises().pull_notification_set(...).doit() //! let r = hub.enterprises().list(...).doit() @@ -89,6 +90,7 @@ //! let r = hub.enterprises().insert(...).doit() //! let r = hub.enterprises().get(...).doit() //! let r = hub.enterprises().unenroll(...).doit() +//! let r = hub.enterprises().get_service_account(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -114,6 +116,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_androidenterprise1 as androidenterprise1; +//! use androidenterprise1::StoreLayout; //! use androidenterprise1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -132,11 +135,15 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = StoreLayout::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.enterprises().get_service_account("enterpriseId") -//! .key_type("sed") +//! let result = hub.enterprises().set_store_layout(req, "enterpriseId") //! .doit(); //! //! match result { @@ -294,6 +301,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::StoreLayout; /// use androidenterprise1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -312,11 +320,15 @@ impl Default for Scope { /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = StoreLayout::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.enterprises().get_service_account("enterpriseId") -/// .key_type("dolores") +/// let result = hub.enterprises().set_store_layout(req, "enterpriseId") /// .doit(); /// /// match result { @@ -587,7 +599,7 @@ pub struct ProductSet { /// The list of product IDs making up the set of products. #[serde(rename="productId")] pub product_id: Option>, - /// The interpretation of this product set. "unknown" should never be sent and is ignored if received. "whitelist" means that the user is entitled to access the product set. "includeAll" means that all products are accessible, including products that are approved, products with revoked approval, and products that have never been approved. "allApproved" means that the user is entitled to access all products that are approved for the enterprise. If the value is "allApproved" or "includeAll", the productId field is ignored. If no value is provided, it is interpreted as "whitelist" for backwards compatibility. + /// The interpretation of this product set. "unknown" should never be sent and is ignored if received. "whitelist" means that the user is entitled to access the product set. "includeAll" means that all products are accessible, including products that are approved, products with revoked approval, and products that have never been approved. "allApproved" means that the user is entitled to access all products that are approved for the enterprise. If the value is "allApproved" or "includeAll", the productId field is ignored. If no value is provided, it is interpreted as "whitelist" for backwards compatibility. Further "allApproved" or "includeAll" does not enable automatic visibility of "alpha" or "beta" tracks for Android app. Use ProductVisibility to enable "alpha" or "beta" tracks per user. #[serde(rename="productSetBehavior")] pub product_set_behavior: Option, } @@ -650,27 +662,26 @@ impl RequestValue for StorePage {} impl ResponseResult for StorePage {} -/// The state of a user's device, as accessed by the getState and setState methods on device resources. +/// The Android Device Policy configuration of an 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*). /// -/// * [get state devices](struct.DeviceGetStateCall.html) (response) -/// * [set state devices](struct.DeviceSetStateCall.html) (request|response) +/// * [set android device policy config enterprises](struct.EnterpriseSetAndroidDevicePolicyConfigCall.html) (request|response) +/// * [get android device policy config enterprises](struct.EnterpriseGetAndroidDevicePolicyConfigCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeviceState { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#deviceState". +pub struct AndroidDevicePolicyConfig { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#androidDevicePolicyConfig". pub kind: Option, - /// The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state. - #[serde(rename="accountState")] - pub account_state: Option, + /// The state of Android Device Policy. "enabled" indicates that Android Device Policy is enabled for the enterprise and the EMM is allowed to manage devices with Android Device Policy, while "disabled" means that it cannot. + pub state: Option, } -impl RequestValue for DeviceState {} -impl ResponseResult for DeviceState {} +impl RequestValue for AndroidDevicePolicyConfig {} +impl ResponseResult for AndroidDevicePolicyConfig {} /// A product permissions resource represents the set of permissions required by a specific app and whether or not they have been accepted by an enterprise admin. @@ -854,6 +865,23 @@ pub struct ProductAvailabilityChangeEvent { impl Part for ProductAvailabilityChangeEvent {} +/// 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 ProductSigningCertificate { + /// The base64 urlsafe encoded SHA1 hash of the certificate. (This field is deprecated in favor of SHA2-256. It should not be used and may be removed at any time.) + #[serde(rename="certificateHashSha1")] + pub certificate_hash_sha1: Option, + /// The base64 urlsafe encoded SHA2-256 hash of the certificate. + #[serde(rename="certificateHashSha256")] + pub certificate_hash_sha256: Option, +} + +impl Part for ProductSigningCertificate {} + + /// A managed configuration resource contains the set of managed properties that have been configured for an Android app. The app's developer would have defined configurable properties in the managed configurations schema. /// /// # Activities @@ -884,26 +912,27 @@ impl RequestValue for ManagedConfiguration {} impl ResponseResult for ManagedConfiguration {} -/// There is no detailed description. +/// The state of a user's device, as accessed by the getState and setState methods on device resources. /// /// # 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*). /// -/// * [send test push notification enterprises](struct.EnterpriseSendTestPushNotificationCall.html) (response) +/// * [get state devices](struct.DeviceGetStateCall.html) (response) +/// * [set state devices](struct.DeviceSetStateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EnterprisesSendTestPushNotificationResponse { - /// The name of the Cloud Pub/Sub topic to which notifications for this enterprise's enrolled account will be sent. - #[serde(rename="topicName")] - pub topic_name: Option, - /// The message ID of the test push notification that was sent. - #[serde(rename="messageId")] - pub message_id: Option, +pub struct DeviceState { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#deviceState". + pub kind: Option, + /// The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state. + #[serde(rename="accountState")] + pub account_state: Option, } -impl ResponseResult for EnterprisesSendTestPushNotificationResponse {} +impl RequestValue for DeviceState {} +impl ResponseResult for DeviceState {} /// The user resources for the group license. @@ -1347,9 +1376,10 @@ impl ResponseResult for Install {} /// /// * [send test push notification enterprises](struct.EnterpriseSendTestPushNotificationCall.html) (none) /// * [generate signup url enterprises](struct.EnterpriseGenerateSignupUrlCall.html) (none) -/// * [get service account enterprises](struct.EnterpriseGetServiceAccountCall.html) (none) +/// * [get android device policy config enterprises](struct.EnterpriseGetAndroidDevicePolicyConfigCall.html) (none) /// * [acknowledge notification set enterprises](struct.EnterpriseAcknowledgeNotificationSetCall.html) (none) /// * [set store layout enterprises](struct.EnterpriseSetStoreLayoutCall.html) (none) +/// * [set android device policy config enterprises](struct.EnterpriseSetAndroidDevicePolicyConfigCall.html) (none) /// * [get store layout enterprises](struct.EnterpriseGetStoreLayoutCall.html) (none) /// * [pull notification set enterprises](struct.EnterprisePullNotificationSetCall.html) (none) /// * [list enterprises](struct.EnterpriseListCall.html) (none) @@ -1361,6 +1391,7 @@ impl ResponseResult for Install {} /// * [insert enterprises](struct.EnterpriseInsertCall.html) (request|response) /// * [get enterprises](struct.EnterpriseGetCall.html) (response) /// * [unenroll enterprises](struct.EnterpriseUnenrollCall.html) (none) +/// * [get service account enterprises](struct.EnterpriseGetServiceAccountCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Enterprise { @@ -1487,6 +1518,28 @@ pub struct AdministratorWebToken { impl ResponseResult for AdministratorWebToken {} +/// 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*). +/// +/// * [send test push notification enterprises](struct.EnterpriseSendTestPushNotificationCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnterprisesSendTestPushNotificationResponse { + /// The name of the Cloud Pub/Sub topic to which notifications for this enterprise's enrolled account will be sent. + #[serde(rename="topicName")] + pub topic_name: Option, + /// The message ID of the test push notification that was sent. + #[serde(rename="messageId")] + pub message_id: Option, +} + +impl ResponseResult for EnterprisesSendTestPushNotificationResponse {} + + /// The grouplicense resources for the enterprise. /// /// # Activities @@ -1652,7 +1705,7 @@ pub struct Product { /// A link to the managed Google Play details page for the product, for use by an Enterprise admin. #[serde(rename="workDetailsUrl")] pub work_details_url: Option, - /// App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included. + /// App versions currently available for this product. #[serde(rename="appVersion")] pub app_version: Option>, /// Whether this product is free, free with in-app purchases, or paid. If the pricing is unknown, this means the product is not generally available anymore (even though it might still be available to people who own it). @@ -1670,6 +1723,9 @@ pub struct Product { /// A link to the (consumer) Google Play details page for the product. #[serde(rename="detailsUrl")] pub details_url: Option, + /// The certificate used to sign this product. + #[serde(rename="signingCertificate")] + pub signing_certificate: Option, /// A string of the form app:. For example, app:com.google.android.gm represents the Gmail app. #[serde(rename="productId")] pub product_id: Option, @@ -1834,11 +1890,11 @@ pub struct ManagedPropertyBundle { impl Part for ManagedPropertyBundle {} -/// A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play by the enterprise admin. +/// Group license objects allow you to keep track of licenses (called entitlements) for both free and paid apps. For a free app, a group license is created when an enterprise admin first approves the product in Google Play or when the first entitlement for the product is created for a user via the API. For a paid app, a group license object is only created when an enterprise admin purchases the product in Google Play for the first time. /// -/// The API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, that is, the total number of user entitlements in existence for the product. +/// Use the API to query group licenses. A Grouplicenses resource includes the total number of licenses purchased (paid apps only) and the total number of licenses currently in use. Iyn other words, the total number of Entitlements that exist for the product. /// -/// Group license objects are never deleted. If, for example, a free app is added to a collection and then removed, the group license will remain, allowing the enterprise admin to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play. +/// Only one group license object is created per product and group license objects are never deleted. If a product is unapproved, its group license remains. This allows enterprise admins to keep track of any remaining entitlements for the product. /// /// # Activities /// @@ -2888,7 +2944,7 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `acknowledge_notification_set(...)`, `complete_signup(...)`, `create_web_token(...)`, `delete(...)`, `enroll(...)`, `generate_signup_url(...)`, `get(...)`, `get_service_account(...)`, `get_store_layout(...)`, `insert(...)`, `list(...)`, `pull_notification_set(...)`, `send_test_push_notification(...)`, `set_account(...)`, `set_store_layout(...)` and `unenroll(...)` +/// // like `acknowledge_notification_set(...)`, `complete_signup(...)`, `create_web_token(...)`, `delete(...)`, `enroll(...)`, `generate_signup_url(...)`, `get(...)`, `get_android_device_policy_config(...)`, `get_service_account(...)`, `get_store_layout(...)`, `insert(...)`, `list(...)`, `pull_notification_set(...)`, `send_test_push_notification(...)`, `set_account(...)`, `set_android_device_policy_config(...)`, `set_store_layout(...)` and `unenroll(...)` /// // to build up your call. /// let rb = hub.enterprises(); /// # } @@ -2954,7 +3010,7 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. + /// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. /// /// # Arguments /// @@ -3003,6 +3059,23 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns the Android Device Policy config resource. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn get_android_device_policy_config(&self, enterprise_id: &str) -> EnterpriseGetAndroidDevicePolicyConfigCall<'a, C, A> { + EnterpriseGetAndroidDevicePolicyConfigCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. @@ -3036,6 +3109,25 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + pub fn set_android_device_policy_config(&self, request: AndroidDevicePolicyConfig, enterprise_id: &str) -> EnterpriseSetAndroidDevicePolicyConfigCall<'a, C, A> { + EnterpriseSetAndroidDevicePolicyConfigCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. @@ -3431,28 +3523,6 @@ impl<'a, C, A> ProductMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. - /// - /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. - /// - /// # 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(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves details of a product for display to an enterprise admin. @@ -3537,6 +3607,28 @@ 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 rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + /// + /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. + /// + /// # 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(), + } + } } @@ -3811,6 +3903,25 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all entitlements for the specified user. Only the ID is set. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn list(&self, enterprise_id: &str, user_id: &str) -> EntitlementListCall<'a, C, A> { + EntitlementListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _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: /// /// Adds or updates an entitlement to an app for a user. @@ -3856,25 +3967,6 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists all entitlements for the specified user. Only the ID is set. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn list(&self, enterprise_id: &str, user_id: &str) -> EntitlementListCall<'a, C, A> { - EntitlementListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _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: /// /// Adds or updates an entitlement to an app for a user. This method supports patch semantics. @@ -13042,7 +13134,7 @@ impl<'a, C, A> DeviceGetCall<'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.enterprises().acknowledge_notification_set() -/// .notification_set_id("nonumy") +/// .notification_set_id("clita") /// .doit(); /// # } /// ``` @@ -13710,7 +13802,7 @@ impl<'a, C, A> EnterpriseInsertCall<'a, C, A> where C: BorrowMut, } -/// Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. +/// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. /// /// A builder for the *sendTestPushNotification* method supported by a *enterprise* resource. /// It is not used directly, but through a `EnterpriseMethods` instance. @@ -14418,6 +14510,249 @@ impl<'a, C, A> EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().get_android_device_policy_config("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseGetAndroidDevicePolicyConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseGetAndroidDevicePolicyConfigCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseGetAndroidDevicePolicyConfigCall<'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, AndroidDevicePolicyConfig)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.enterprises.getAndroidDevicePolicyConfig", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].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 = self.hub._base_url.clone() + "enterprises/{enterpriseId}/androidDevicePolicyConfig"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].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 ["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(Bearer { 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(d); + 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(d); + 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) -> EnterpriseGetAndroidDevicePolicyConfigCall<'a, C, A> { + self._enterprise_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) -> EnterpriseGetAndroidDevicePolicyConfigCall<'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) -> EnterpriseGetAndroidDevicePolicyConfigCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseGetAndroidDevicePolicyConfigCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. /// /// A builder for the *setStoreLayout* method supported by a *enterprise* resource. @@ -14720,8 +15055,8 @@ impl<'a, C, A> EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AndroidDevicePolicyConfig::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.enterprises().set_android_device_policy_config(req, "enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseSetAndroidDevicePolicyConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: AndroidDevicePolicyConfig, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseSetAndroidDevicePolicyConfigCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseSetAndroidDevicePolicyConfigCall<'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, AndroidDevicePolicyConfig)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.enterprises.setAndroidDevicePolicyConfig", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].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 = self.hub._base_url.clone() + "enterprises/{enterpriseId}/androidDevicePolicyConfig"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].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 ["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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AndroidDevicePolicyConfig) -> EnterpriseSetAndroidDevicePolicyConfigCall<'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) -> EnterpriseSetAndroidDevicePolicyConfigCall<'a, C, A> { + self._enterprise_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) -> EnterpriseSetAndroidDevicePolicyConfigCall<'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) -> EnterpriseSetAndroidDevicePolicyConfigCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseSetAndroidDevicePolicyConfigCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. /// A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. /// Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. @@ -14958,7 +15567,7 @@ impl<'a, C, A> EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut EnterpriseGetCall<'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.enterprises().get_service_account("enterpriseId") -/// .key_type("aliquyam") +/// .key_type("sed") /// .doit(); /// # } /// ``` @@ -16446,7 +17055,7 @@ impl<'a, C, A> EnterpriseDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.enterprises().generate_signup_url() -/// .callback_url("consetetur") +/// .callback_url("eirmod") /// .doit(); /// # } /// ``` @@ -19074,275 +19683,6 @@ impl<'a, C, A> ProductUnapproveCall<'a, C, A> where C: BorrowMut, } -/// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. -/// -/// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. -/// -/// A builder for the *generateApprovalUrl* 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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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("clita") -/// .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, Bearer, 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 = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl"; - 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(Bearer { 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(d); - 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(d); - 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 BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". - /// - /// 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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves details of a product for display to an enterprise admin. /// /// A builder for the *get* method supported by a *product* resource. @@ -19371,7 +19711,7 @@ impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut ProductApproveCall<'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.products().get_app_restrictions_schema("enterpriseId", "productId") -/// .language("aliquyam") +/// .language("eos") /// .doit(); /// # } /// ``` @@ -20182,11 +20522,11 @@ impl<'a, C, A> ProductGetAppRestrictionsSchemaCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.products().list("enterpriseId") -/// .token("ea") -/// .query("et") -/// .max_results(53) -/// .language("diam") -/// .approved(false) +/// .token("duo") +/// .query("sed") +/// .max_results(70) +/// .language("ea") +/// .approved(true) /// .doit(); /// # } /// ``` @@ -20457,6 +20797,275 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o } +/// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. +/// +/// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. +/// +/// A builder for the *generateApprovalUrl* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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("diam") +/// .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, Bearer, 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 = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl"; + 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(Bearer { 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(d); + 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(d); + 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 BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". + /// + /// 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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *managedconfigurationsforuser* resource. @@ -22342,6 +22951,261 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut } +/// Lists all entitlements for the specified user. Only the ID is set. +/// +/// 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct EntitlementListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +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, Bearer, 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.entitlements.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "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 = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{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(2); + for param_name in ["userId", "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(Bearer { 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(d); + 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(d); + 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) -> EntitlementListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the 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) -> EntitlementListCall<'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) -> 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 + } + + /// 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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EntitlementListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Adds or updates an entitlement to an app for a user. /// /// A builder for the *update* method supported by a *entitlement* resource. @@ -22376,7 +23240,7 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.entitlements().update(req, "enterpriseId", "userId", "entitlementId") -/// .install(false) +/// .install(true) /// .doit(); /// # } /// ``` @@ -22919,261 +23783,6 @@ impl<'a, C, A> EntitlementGetCall<'a, C, A> where C: BorrowMut, A } -/// Lists all entitlements for the specified user. Only the ID is set. -/// -/// 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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct EntitlementListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -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, Bearer, 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.entitlements.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "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 = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{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(2); - for param_name in ["userId", "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(Bearer { 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(d); - 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(d); - 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) -> EntitlementListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the 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) -> EntitlementListCall<'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) -> 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 - } - - /// 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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> EntitlementListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Adds or updates an entitlement to an app for a user. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *entitlement* resource. @@ -23208,7 +23817,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.entitlements().patch(req, "enterpriseId", "userId", "entitlementId") -/// .install(false) +/// .install(true) /// .doit(); /// # } /// ``` @@ -24275,7 +24884,7 @@ impl<'a, C, A> ServiceaccountkeyDeleteCall<'a, C, A> where C: BorrowMut"] +description = "A complete library to interact with Android Management (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1-cli" +homepage = "https://developers.google.com/android/management" +documentation = "http://byron.github.io/google-apis-rs/google_androidmanagement1_cli" +license = "MIT" +keywords = ["androidmanagement", "google", "cli"] + +[[bin]] +name = "androidmanagement1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-androidmanagement1] +path = "../androidmanagement1" +version = "1.0.6+20170918" diff --git a/gen/androidmanagement1-cli/LICENSE.md b/gen/androidmanagement1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/androidmanagement1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/androidmanagement1-cli/README.md b/gen/androidmanagement1-cli/README.md new file mode 100644 index 0000000000..079f8b1081 --- /dev/null +++ b/gen/androidmanagement1-cli/README.md @@ -0,0 +1,135 @@ + +The `androidmanagement1` command-line interface *(CLI)* allows to use most features of the *Google Android Management* 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 *Android Management* API can be found at the +[official documentation site](https://developers.google.com/android/management). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-androidmanagement1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1-cli). + +# Usage + +This documentation was generated from the *Android Management* API at revision *20170918*. The CLI is at version *1.0.6*. + +```bash +androidmanagement1 [options] + enterprises + applications-get [-p ]... [-o ] + create (-r )... [-p ]... [-o ] + devices-delete [-p ]... [-o ] + devices-get [-p ]... [-o ] + devices-issue-command (-r )... [-p ]... [-o ] + devices-list [-p ]... [-o ] + devices-operations-cancel [-p ]... [-o ] + devices-operations-delete [-p ]... [-o ] + devices-operations-get [-p ]... [-o ] + devices-operations-list [-p ]... [-o ] + devices-patch (-r )... [-p ]... [-o ] + enrollment-tokens-create (-r )... [-p ]... [-o ] + enrollment-tokens-delete [-p ]... [-o ] + get [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + policies-delete [-p ]... [-o ] + policies-get [-p ]... [-o ] + policies-list [-p ]... [-o ] + policies-patch (-r )... [-p ]... [-o ] + web-tokens-create (-r )... [-p ]... [-o ] + signup-urls + create [-p ]... [-o ] + androidmanagement1 --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 `androidmanagement1-`. 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/androidmanagement1-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/androidmanagement1-secret.json`, assuming that the required *androidmanagement* 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. `androidmanagement1 --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/androidmanagement1-cli/mkdocs.yml b/gen/androidmanagement1-cli/mkdocs.yml new file mode 100644 index 0000000000..29b413b78b --- /dev/null +++ b/gen/androidmanagement1-cli/mkdocs.yml @@ -0,0 +1,37 @@ +site_name: Android Management v1.0.6+20170918 +site_url: http://byron.github.io/google-apis-rs/google-androidmanagement1-cli +site_description: A complete library to interact with Android Management (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['enterprises_applications-get.md', 'Enterprises', 'Applications Get'] +- ['enterprises_create.md', 'Enterprises', 'Create'] +- ['enterprises_devices-delete.md', 'Enterprises', 'Devices Delete'] +- ['enterprises_devices-get.md', 'Enterprises', 'Devices Get'] +- ['enterprises_devices-issue-command.md', 'Enterprises', 'Devices Issue Command'] +- ['enterprises_devices-list.md', 'Enterprises', 'Devices List'] +- ['enterprises_devices-operations-cancel.md', 'Enterprises', 'Devices Operations Cancel'] +- ['enterprises_devices-operations-delete.md', 'Enterprises', 'Devices Operations Delete'] +- ['enterprises_devices-operations-get.md', 'Enterprises', 'Devices Operations Get'] +- ['enterprises_devices-operations-list.md', 'Enterprises', 'Devices Operations List'] +- ['enterprises_devices-patch.md', 'Enterprises', 'Devices Patch'] +- ['enterprises_enrollment-tokens-create.md', 'Enterprises', 'Enrollment Tokens Create'] +- ['enterprises_enrollment-tokens-delete.md', 'Enterprises', 'Enrollment Tokens Delete'] +- ['enterprises_get.md', 'Enterprises', 'Get'] +- ['enterprises_patch.md', 'Enterprises', 'Patch'] +- ['enterprises_policies-delete.md', 'Enterprises', 'Policies Delete'] +- ['enterprises_policies-get.md', 'Enterprises', 'Policies Get'] +- ['enterprises_policies-list.md', 'Enterprises', 'Policies List'] +- ['enterprises_policies-patch.md', 'Enterprises', 'Policies Patch'] +- ['enterprises_web-tokens-create.md', 'Enterprises', 'Web Tokens Create'] +- ['signup-urls_create.md', 'Signup Urls', 'Create'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/androidmanagement1-cli/src/cmn.rs b/gen/androidmanagement1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/androidmanagement1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/androidmanagement1-cli/src/main.rs b/gen/androidmanagement1-cli/src/main.rs new file mode 100644 index 0000000000..979975be1d --- /dev/null +++ b/gen/androidmanagement1-cli/src/main.rs @@ -0,0 +1,2307 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_androidmanagement1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::AndroidManagement>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _enterprises_applications_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().applications_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "enterprise-display-name" => Some(("enterpriseDisplayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabled-notification-types" => Some(("enabledNotificationTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pubsub-topic" => Some(("pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-color" => Some(("primaryColor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "logo.url" => Some(("logo.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "logo.sha256-hash" => Some(("logo.sha256Hash", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-auto-approval-enabled" => Some(("appAutoApprovalEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-auto-approval-enabled", "enabled-notification-types", "enterprise-display-name", "logo", "name", "primary-color", "pubsub-topic", "sha256-hash", "url"]); + 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::Enterprise = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().create(request); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "signup-url-name" => { + call = call.signup_url_name(value.unwrap_or("")); + }, + "project-id" => { + call = call.project_id(value.unwrap_or("")); + }, + "enterprise-token" => { + call = call.enterprise_token(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(["project-id", "enterprise-token", "signup-url-name"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_issue_command(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "duration" => Some(("duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reset-password-flags" => Some(("resetPasswordFlags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "new-password" => Some(("newPassword", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", 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", "duration", "new-password", "reset-password-flags", "type"]); + 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::Command = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().devices_issue_command(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().devices_operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_devices_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "hardware-info.skin-shutdown-temperatures" => Some(("hardwareInfo.skinShutdownTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.cpu-shutdown-temperatures" => Some(("hardwareInfo.cpuShutdownTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.cpu-throttling-temperatures" => Some(("hardwareInfo.cpuThrottlingTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.brand" => Some(("hardwareInfo.brand", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hardware-info.serial-number" => Some(("hardwareInfo.serialNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hardware-info.gpu-shutdown-temperatures" => Some(("hardwareInfo.gpuShutdownTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.gpu-throttling-temperatures" => Some(("hardwareInfo.gpuThrottlingTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.hardware" => Some(("hardwareInfo.hardware", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hardware-info.skin-throttling-temperatures" => Some(("hardwareInfo.skinThrottlingTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.battery-shutdown-temperatures" => Some(("hardwareInfo.batteryShutdownTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.device-baseband-version" => Some(("hardwareInfo.deviceBasebandVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hardware-info.model" => Some(("hardwareInfo.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hardware-info.battery-throttling-temperatures" => Some(("hardwareInfo.batteryThrottlingTemperatures", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "hardware-info.manufacturer" => Some(("hardwareInfo.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-name" => Some(("userName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled-reason.default-message" => Some(("disabledReason.defaultMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled-reason.localized-messages" => Some(("disabledReason.localizedMessages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "enrollment-token-data" => Some(("enrollmentTokenData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "applied-policy-name" => Some(("appliedPolicyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy-name" => Some(("policyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "previous-device-names" => Some(("previousDeviceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network-info.imei" => Some(("networkInfo.imei", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network-info.meid" => Some(("networkInfo.meid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network-info.wifi-mac-address" => Some(("networkInfo.wifiMacAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-policy-sync-time" => Some(("lastPolicySyncTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "software-info.android-build-time" => Some(("softwareInfo.androidBuildTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "software-info.android-build-number" => Some(("softwareInfo.androidBuildNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "software-info.security-patch-level" => Some(("softwareInfo.securityPatchLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "software-info.device-kernel-version" => Some(("softwareInfo.deviceKernelVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "software-info.android-version" => Some(("softwareInfo.androidVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "software-info.bootloader-version" => Some(("softwareInfo.bootloaderVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "applied-state" => Some(("appliedState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enrollment-token-name" => Some(("enrollmentTokenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy-compliant" => Some(("policyCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "memory-info.total-internal-storage" => Some(("memoryInfo.totalInternalStorage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "memory-info.total-ram" => Some(("memoryInfo.totalRam", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-policy-compliance-report-time" => Some(("lastPolicyComplianceReportTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-level" => Some(("apiLevel", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "last-status-report-time" => Some(("lastStatusReportTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enrollment-time" => Some(("enrollmentTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "applied-policy-version" => Some(("appliedPolicyVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["android-build-number", "android-build-time", "android-version", "api-level", "applied-policy-name", "applied-policy-version", "applied-state", "battery-shutdown-temperatures", "battery-throttling-temperatures", "bootloader-version", "brand", "cpu-shutdown-temperatures", "cpu-throttling-temperatures", "default-message", "device-baseband-version", "device-kernel-version", "disabled-reason", "enrollment-time", "enrollment-token-data", "enrollment-token-name", "gpu-shutdown-temperatures", "gpu-throttling-temperatures", "hardware", "hardware-info", "imei", "last-policy-compliance-report-time", "last-policy-sync-time", "last-status-report-time", "localized-messages", "manufacturer", "meid", "memory-info", "model", "name", "network-info", "policy-compliant", "policy-name", "previous-device-names", "security-patch-level", "serial-number", "skin-shutdown-temperatures", "skin-throttling-temperatures", "software-info", "state", "total-internal-storage", "total-ram", "user-name", "wifi-mac-address"]); + 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::Device = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().devices_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_enrollment_tokens_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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-name" => Some(("policyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "additional-data" => Some(("additionalData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "duration" => Some(("duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "qr-code" => Some(("qrCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration-timestamp" => Some(("expirationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-data", "duration", "expiration-timestamp", "name", "policy-name", "qr-code", "value"]); + 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::EnrollmentToken = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().enrollment_tokens_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_enrollment_tokens_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().enrollment_tokens_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "enterprise-display-name" => Some(("enterpriseDisplayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabled-notification-types" => Some(("enabledNotificationTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pubsub-topic" => Some(("pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-color" => Some(("primaryColor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "logo.url" => Some(("logo.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "logo.sha256-hash" => Some(("logo.sha256Hash", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-auto-approval-enabled" => Some(("appAutoApprovalEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-auto-approval-enabled", "enabled-notification-types", "enterprise-display-name", "logo", "name", "primary-color", "pubsub-topic", "sha256-hash", "url"]); + 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::Enterprise = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_policies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().policies_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_policies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().policies_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_policies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.enterprises().policies_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_policies_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "camera-disabled" => Some(("cameraDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "wifi-configs-lockdown-enabled" => Some(("wifiConfigsLockdownEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "add-user-disabled" => Some(("addUserDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.network-info-enabled" => Some(("statusReportingSettings.networkInfoEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.memory-info-enabled" => Some(("statusReportingSettings.memoryInfoEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.hardware-status-enabled" => Some(("statusReportingSettings.hardwareStatusEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.power-management-events-enabled" => Some(("statusReportingSettings.powerManagementEventsEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.software-info-enabled" => Some(("statusReportingSettings.softwareInfoEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.display-info-enabled" => Some(("statusReportingSettings.displayInfoEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "remove-user-disabled" => Some(("removeUserDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "install-unknown-sources-allowed" => Some(("installUnknownSourcesAllowed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "block-applications-enabled" => Some(("blockApplicationsEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "frp-admin-emails" => Some(("frpAdminEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "password-requirements.password-expiration-timeout" => Some(("passwordRequirements.passwordExpirationTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "password-requirements.maximum-failed-passwords-for-wipe" => Some(("passwordRequirements.maximumFailedPasswordsForWipe", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-symbols" => Some(("passwordRequirements.passwordMinimumSymbols", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-quality" => Some(("passwordRequirements.passwordQuality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-length" => Some(("passwordRequirements.passwordMinimumLength", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-numeric" => Some(("passwordRequirements.passwordMinimumNumeric", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-history-length" => Some(("passwordRequirements.passwordHistoryLength", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-non-letter" => Some(("passwordRequirements.passwordMinimumNonLetter", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-upper-case" => Some(("passwordRequirements.passwordMinimumUpperCase", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-lower-case" => Some(("passwordRequirements.passwordMinimumLowerCase", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.password-minimum-letters" => Some(("passwordRequirements.passwordMinimumLetters", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "maximum-time-to-lock" => Some(("maximumTimeToLock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-permission-policy" => Some(("defaultPermissionPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "safe-boot-disabled" => Some(("safeBootDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "modify-accounts-disabled" => Some(("modifyAccountsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-bar-disabled" => Some(("statusBarDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "adjust-volume-disabled" => Some(("adjustVolumeDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "fun-disabled" => Some(("funDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "unmute-microphone-disabled" => Some(("unmuteMicrophoneDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "debugging-features-allowed" => Some(("debuggingFeaturesAllowed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "keyguard-disabled" => Some(("keyguardDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "factory-reset-disabled" => Some(("factoryResetDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-escape-hatch-enabled" => Some(("networkEscapeHatchEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "auto-time-required" => Some(("autoTimeRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "system-update.end-minutes" => Some(("systemUpdate.endMinutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "system-update.start-minutes" => Some(("systemUpdate.startMinutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "system-update.type" => Some(("systemUpdate.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "stay-on-plugged-modes" => Some(("stayOnPluggedModes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "screen-capture-disabled" => Some(("screenCaptureDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "wifi-config-disabled" => Some(("wifiConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["add-user-disabled", "adjust-volume-disabled", "auto-time-required", "block-applications-enabled", "camera-disabled", "debugging-features-allowed", "default-permission-policy", "display-info-enabled", "end-minutes", "factory-reset-disabled", "frp-admin-emails", "fun-disabled", "hardware-status-enabled", "install-unknown-sources-allowed", "keyguard-disabled", "maximum-failed-passwords-for-wipe", "maximum-time-to-lock", "memory-info-enabled", "modify-accounts-disabled", "name", "network-escape-hatch-enabled", "network-info-enabled", "password-expiration-timeout", "password-history-length", "password-minimum-length", "password-minimum-letters", "password-minimum-lower-case", "password-minimum-non-letter", "password-minimum-numeric", "password-minimum-symbols", "password-minimum-upper-case", "password-quality", "password-requirements", "power-management-events-enabled", "remove-user-disabled", "safe-boot-disabled", "screen-capture-disabled", "software-info-enabled", "start-minutes", "status-bar-disabled", "status-reporting-settings", "stay-on-plugged-modes", "system-update", "type", "unmute-microphone-disabled", "version", "wifi-config-disabled", "wifi-configs-lockdown-enabled"]); + 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::Policy = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().policies_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _enterprises_web_tokens_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "parent-frame-url" => Some(("parentFrameUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "parent-frame-url", "permissions", "value"]); + 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::WebToken = json::value::from_value(object).unwrap(); + let mut call = self.hub.enterprises().web_tokens_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _signup_urls_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.signup_urls().create(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "project-id" => { + call = call.project_id(value.unwrap_or("")); + }, + "callback-url" => { + call = call.callback_url(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(["project-id", "callback-url"].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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("enterprises", Some(opt)) => { + match opt.subcommand() { + ("applications-get", Some(opt)) => { + call_result = self._enterprises_applications_get(opt, dry_run, &mut err); + }, + ("create", Some(opt)) => { + call_result = self._enterprises_create(opt, dry_run, &mut err); + }, + ("devices-delete", Some(opt)) => { + call_result = self._enterprises_devices_delete(opt, dry_run, &mut err); + }, + ("devices-get", Some(opt)) => { + call_result = self._enterprises_devices_get(opt, dry_run, &mut err); + }, + ("devices-issue-command", Some(opt)) => { + call_result = self._enterprises_devices_issue_command(opt, dry_run, &mut err); + }, + ("devices-list", Some(opt)) => { + call_result = self._enterprises_devices_list(opt, dry_run, &mut err); + }, + ("devices-operations-cancel", Some(opt)) => { + call_result = self._enterprises_devices_operations_cancel(opt, dry_run, &mut err); + }, + ("devices-operations-delete", Some(opt)) => { + call_result = self._enterprises_devices_operations_delete(opt, dry_run, &mut err); + }, + ("devices-operations-get", Some(opt)) => { + call_result = self._enterprises_devices_operations_get(opt, dry_run, &mut err); + }, + ("devices-operations-list", Some(opt)) => { + call_result = self._enterprises_devices_operations_list(opt, dry_run, &mut err); + }, + ("devices-patch", Some(opt)) => { + call_result = self._enterprises_devices_patch(opt, dry_run, &mut err); + }, + ("enrollment-tokens-create", Some(opt)) => { + call_result = self._enterprises_enrollment_tokens_create(opt, dry_run, &mut err); + }, + ("enrollment-tokens-delete", Some(opt)) => { + call_result = self._enterprises_enrollment_tokens_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._enterprises_get(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._enterprises_patch(opt, dry_run, &mut err); + }, + ("policies-delete", Some(opt)) => { + call_result = self._enterprises_policies_delete(opt, dry_run, &mut err); + }, + ("policies-get", Some(opt)) => { + call_result = self._enterprises_policies_get(opt, dry_run, &mut err); + }, + ("policies-list", Some(opt)) => { + call_result = self._enterprises_policies_list(opt, dry_run, &mut err); + }, + ("policies-patch", Some(opt)) => { + call_result = self._enterprises_policies_patch(opt, dry_run, &mut err); + }, + ("web-tokens-create", Some(opt)) => { + call_result = self._enterprises_web_tokens_create(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("enterprises".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("signup-urls", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._signup_urls_create(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("signup-urls".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<'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, "androidmanagement1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "androidmanagement1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::AndroidManagement::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 = [ + ("enterprises", "methods: 'applications-get', 'create', 'devices-delete', 'devices-get', 'devices-issue-command', 'devices-list', 'devices-operations-cancel', 'devices-operations-delete', 'devices-operations-get', 'devices-operations-list', 'devices-patch', 'enrollment-tokens-create', 'enrollment-tokens-delete', 'get', 'patch', 'policies-delete', 'policies-get', 'policies-list', 'policies-patch' and 'web-tokens-create'", vec![ + ("applications-get", + Some(r##"Gets info about an application."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_applications-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}"##), + 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)), + ]), + ("create", + Some(r##"Creates an enterprise by completing the enterprise signup flow."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_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)), + ]), + ("devices-delete", + Some(r##"Deletes a device, which causes the device to be wiped."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}"##), + 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)), + ]), + ("devices-get", + Some(r##"Gets a device."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}"##), + 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)), + ]), + ("devices-issue-command", + Some(r##"Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-issue-command", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}"##), + 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)), + ]), + ("devices-list", + Some(r##"Lists devices for a given enterprise."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the enterprise in the form enterprises/{enterpriseId}"##), + 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)), + ]), + ("devices-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + 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)), + ]), + ("devices-operations-delete", + Some(r##"Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("devices-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("devices-operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("devices-patch", + Some(r##"Updates a device."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_devices-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}"##), + 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)), + ]), + ("enrollment-tokens-create", + Some(r##"Creates an enrollment token for a given enterprise."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_enrollment-tokens-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the enterprise in the form enterprises/{enterpriseId}"##), + 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)), + ]), + ("enrollment-tokens-delete", + Some(r##"Deletes an enrollment token, which prevents future use of the token."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_enrollment-tokens-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}"##), + 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 an enterprise."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the enterprise in the form enterprises/{enterpriseId}"##), + 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 an enterprise."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the enterprise in the form enterprises/{enterpriseId}"##), + 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)), + ]), + ("policies-delete", + Some(r##"Deletes a policy. This operation is only permitted if no devices are currently referencing the policy."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_policies-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}"##), + 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)), + ]), + ("policies-get", + Some(r##"Gets a policy."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_policies-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}"##), + 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)), + ]), + ("policies-list", + Some(r##"Lists policies for a given enterprise."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_policies-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the enterprise in the form enterprises/{enterpriseId}"##), + 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)), + ]), + ("policies-patch", + Some(r##"Updates or creates a policy."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_policies-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}"##), + 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)), + ]), + ("web-tokens-create", + Some(r##"Creates a web token to access an embeddable managed Google Play web UI for a given enterprise."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/enterprises_web-tokens-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the enterprise in the form enterprises/{enterpriseId}"##), + 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)), + ]), + ]), + + ("signup-urls", "methods: 'create'", vec![ + ("create", + Some(r##"Creates an enterprise signup URL."##), + "Details at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli/signup-urls_create", + 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)), + ]), + ]), + + ]; + + let mut app = App::new("androidmanagement1") + .author("Sebastian Thiel ") + .version("1.0.6+20170918") + .about("The Android Management API provides remote enterprise management of Android devices and apps.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidmanagement1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/androidmanagement1/Cargo.toml b/gen/androidmanagement1/Cargo.toml new file mode 100644 index 0000000000..c0ea34fcd4 --- /dev/null +++ b/gen/androidmanagement1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-androidmanagement1" +version = "1.0.6+20170918" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Android Management (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1" +homepage = "https://developers.google.com/android/management" +documentation = "https://docs.rs/google-androidmanagement1/1.0.6+20170918" +license = "MIT" +keywords = ["androidmanagement", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/androidmanagement1/LICENSE.md b/gen/androidmanagement1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/androidmanagement1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/androidmanagement1/README.md b/gen/androidmanagement1/README.md new file mode 100644 index 0000000000..53d8cef8f2 --- /dev/null +++ b/gen/androidmanagement1/README.md @@ -0,0 +1,204 @@ + +The `google-androidmanagement1` library allows access to all features of the *Google Android Management* service. + +This documentation was generated from *Android Management* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Android Management* *v1* API can be found at the +[official documentation site](https://developers.google.com/android/management). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.AndroidManagement.html) ... + +* [enterprises](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.Enterprise.html) + * [*applications get*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseApplicationGetCall.html), [*create*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseCreateCall.html), [*devices delete*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceDeleteCall.html), [*devices get*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceGetCall.html), [*devices issue command*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceIssueCommandCall.html), [*devices list*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceListCall.html), [*devices operations cancel*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceOperationCancelCall.html), [*devices operations delete*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceOperationDeleteCall.html), [*devices operations get*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceOperationGetCall.html), [*devices operations list*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDeviceOperationListCall.html), [*devices patch*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseDevicePatchCall.html), [*enrollment tokens create*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseEnrollmentTokenCreateCall.html), [*enrollment tokens delete*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseEnrollmentTokenDeleteCall.html), [*get*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseGetCall.html), [*patch*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterprisePatchCall.html), [*policies delete*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterprisePolicyDeleteCall.html), [*policies get*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterprisePolicyGetCall.html), [*policies list*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterprisePolicyListCall.html), [*policies patch*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterprisePolicyPatchCall.html) and [*web tokens create*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.EnterpriseWebTokenCreateCall.html) +* [signup urls](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.SignupUrl.html) + * [*create*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.SignupUrlCreateCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.AndroidManagement.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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.enterprises().devices_operations_delete(...).doit() +let r = hub.enterprises().web_tokens_create(...).doit() +let r = hub.enterprises().policies_list(...).doit() +let r = hub.enterprises().devices_get(...).doit() +let r = hub.enterprises().policies_patch(...).doit() +let r = hub.enterprises().create(...).doit() +let r = hub.enterprises().patch(...).doit() +let r = hub.enterprises().policies_get(...).doit() +let r = hub.enterprises().get(...).doit() +let r = hub.enterprises().devices_operations_cancel(...).doit() +let r = hub.enterprises().enrollment_tokens_create(...).doit() +let r = hub.enterprises().devices_list(...).doit() +let r = hub.enterprises().policies_delete(...).doit() +let r = hub.enterprises().applications_get(...).doit() +let r = hub.enterprises().devices_operations_get(...).doit() +let r = hub.enterprises().enrollment_tokens_delete(...).doit() +let r = hub.enterprises().devices_issue_command(...).doit() +let r = hub.enterprises().devices_delete(...).doit() +let r = hub.enterprises().devices_operations_list(...).doit() +let r = hub.enterprises().devices_patch(...).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-androidmanagement1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_androidmanagement1 as androidmanagement1; +use androidmanagement1::Enterprise; +use androidmanagement1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use androidmanagement1::AndroidManagement; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Enterprise::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.enterprises().create(req) + .signup_url_name("eirmod") + .project_id("sit") + .enterprise_token("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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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](https://docs.rs/google-androidmanagement1/1.0.6+20170918/google_androidmanagement1/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 **androidmanagement1** 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-rsblob/master/LICENSE.md diff --git a/gen/androidmanagement1/src/cmn.rs b/gen/androidmanagement1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/androidmanagement1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/androidmanagement1/src/lib.rs b/gen/androidmanagement1/src/lib.rs new file mode 100644 index 0000000000..9a62c30b59 --- /dev/null +++ b/gen/androidmanagement1/src/lib.rs @@ -0,0 +1,7595 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Android Management* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Android Management* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/android/management). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.AndroidManagement.html) ... +//! +//! * [enterprises](struct.Enterprise.html) +//! * [*applications get*](struct.EnterpriseApplicationGetCall.html), [*create*](struct.EnterpriseCreateCall.html), [*devices delete*](struct.EnterpriseDeviceDeleteCall.html), [*devices get*](struct.EnterpriseDeviceGetCall.html), [*devices issue command*](struct.EnterpriseDeviceIssueCommandCall.html), [*devices list*](struct.EnterpriseDeviceListCall.html), [*devices operations cancel*](struct.EnterpriseDeviceOperationCancelCall.html), [*devices operations delete*](struct.EnterpriseDeviceOperationDeleteCall.html), [*devices operations get*](struct.EnterpriseDeviceOperationGetCall.html), [*devices operations list*](struct.EnterpriseDeviceOperationListCall.html), [*devices patch*](struct.EnterpriseDevicePatchCall.html), [*enrollment tokens create*](struct.EnterpriseEnrollmentTokenCreateCall.html), [*enrollment tokens delete*](struct.EnterpriseEnrollmentTokenDeleteCall.html), [*get*](struct.EnterpriseGetCall.html), [*patch*](struct.EnterprisePatchCall.html), [*policies delete*](struct.EnterprisePolicyDeleteCall.html), [*policies get*](struct.EnterprisePolicyGetCall.html), [*policies list*](struct.EnterprisePolicyListCall.html), [*policies patch*](struct.EnterprisePolicyPatchCall.html) and [*web tokens create*](struct.EnterpriseWebTokenCreateCall.html) +//! * [signup urls](struct.SignupUrl.html) +//! * [*create*](struct.SignupUrlCreateCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.AndroidManagement.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.enterprises().devices_operations_delete(...).doit() +//! let r = hub.enterprises().web_tokens_create(...).doit() +//! let r = hub.enterprises().policies_list(...).doit() +//! let r = hub.enterprises().devices_get(...).doit() +//! let r = hub.enterprises().policies_patch(...).doit() +//! let r = hub.enterprises().create(...).doit() +//! let r = hub.enterprises().patch(...).doit() +//! let r = hub.enterprises().policies_get(...).doit() +//! let r = hub.enterprises().get(...).doit() +//! let r = hub.enterprises().devices_operations_cancel(...).doit() +//! let r = hub.enterprises().enrollment_tokens_create(...).doit() +//! let r = hub.enterprises().devices_list(...).doit() +//! let r = hub.enterprises().policies_delete(...).doit() +//! let r = hub.enterprises().applications_get(...).doit() +//! let r = hub.enterprises().devices_operations_get(...).doit() +//! let r = hub.enterprises().enrollment_tokens_delete(...).doit() +//! let r = hub.enterprises().devices_issue_command(...).doit() +//! let r = hub.enterprises().devices_delete(...).doit() +//! let r = hub.enterprises().devices_operations_list(...).doit() +//! let r = hub.enterprises().devices_patch(...).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-androidmanagement1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_androidmanagement1 as androidmanagement1; +//! use androidmanagement1::Enterprise; +//! use androidmanagement1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use androidmanagement1::AndroidManagement; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Enterprise::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.enterprises().create(req) +//! .signup_url_name("sed") +//! .project_id("et") +//! .enterprise_token("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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Manage Android devices and apps for your customers + Full, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Full => "https://www.googleapis.com/auth/androidmanagement", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Full + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all AndroidManagement related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::Enterprise; +/// use androidmanagement1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androidmanagement1::AndroidManagement; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Enterprise::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.enterprises().create(req) +/// .signup_url_name("kasd") +/// .project_id("accusam") +/// .enterprise_token("takimata") +/// .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 AndroidManagement { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for AndroidManagement {} + +impl<'a, C, A> AndroidManagement + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> AndroidManagement { + AndroidManagement { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://androidmanagement.googleapis.com/".to_string(), + _root_url: "https://androidmanagement.googleapis.com/".to_string(), + } + } + + pub fn enterprises(&'a self) -> EnterpriseMethods<'a, C, A> { + EnterpriseMethods { hub: &self } + } + pub fn signup_urls(&'a self) -> SignupUrlMethods<'a, C, A> { + SignupUrlMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://androidmanagement.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://androidmanagement.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Response to a request to list policies for a given 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*). +/// +/// * [policies list enterprises](struct.EnterprisePolicyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListPoliciesResponse { + /// If there are more results, a token to retrieve next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of policies. + pub policies: Option>, +} + +impl ResponseResult for ListPoliciesResponse {} + + +/// Provides detail about non-compliance with a policy setting. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NonComplianceDetail { + /// For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url + #[serde(rename="fieldPath")] + pub field_path: Option, + /// If the policy setting could not be applied, the current value of the setting on the device. + #[serde(rename="currentValue")] + pub current_value: Option, + /// If package_name is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app cannot be installed or updated. + #[serde(rename="installationFailureReason")] + pub installation_failure_reason: Option, + /// The name of the policy setting. This is the JSON field name of a top-level Policy field. + #[serde(rename="settingName")] + pub setting_name: Option, + /// The reason the device is not in compliance with the setting. + #[serde(rename="nonComplianceReason")] + pub non_compliance_reason: Option, + /// The package name indicating which application is out of compliance, if applicable. + #[serde(rename="packageName")] + pub package_name: Option, +} + +impl Part for NonComplianceDetail {} + + +/// A compliance rule condition which is satisfied if there exists any matching NonComplianceDetail for the device. A NonComplianceDetail matches a NonComplianceDetailCondition if all the fields which are set within the NonComplianceDetailCondition match the corresponding NonComplianceDetail fields. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NonComplianceDetailCondition { + /// The package name indicating which application is out of compliance. If not set, then this condition matches any package name. + #[serde(rename="packageName")] + pub package_name: Option, + /// The name of the policy setting. This is the JSON field name of a top-level Policy field. If not set, then this condition matches any setting name. + #[serde(rename="settingName")] + pub setting_name: Option, + /// The reason the device is not in compliance with the setting. If not set, then this condition matches any reason. + #[serde(rename="nonComplianceReason")] + pub non_compliance_reason: Option, +} + +impl Part for NonComplianceDetailCondition {} + + +/// Configuration for managing system updates +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemUpdate { + /// If the type is WINDOWED, the end of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be between 0 and 1439, inclusive. If this value is less than start_minutes, then the maintenance window spans midnight. If the maintenance window specified is smaller than 30 minutes, the actual window is extended to 30 minutes beyond the start time. + #[serde(rename="endMinutes")] + pub end_minutes: Option, + /// If the type is WINDOWED, the start of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be between 0 and 1439, inclusive. + #[serde(rename="startMinutes")] + pub start_minutes: Option, + /// The type of system update to configure. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for SystemUpdate {} + + +/// An event related to memory and storage measurements. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MemoryEvent { + /// Event type. + #[serde(rename="eventType")] + pub event_type: Option, + /// The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium. + #[serde(rename="byteCount")] + pub byte_count: Option, + /// The creation time of the event. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl Part for MemoryEvent {} + + +/// Application information. +/// +/// # 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*). +/// +/// * [applications get enterprises](struct.EnterpriseApplicationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Application { + /// The set of managed properties available to be pre-configured for the application. + #[serde(rename="managedProperties")] + pub managed_properties: Option>, + /// The title of the application. Localized. + pub title: Option, + /// The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} + pub name: Option, + /// The permissions required by the app. + pub permissions: Option>, +} + +impl ResponseResult for Application {} + + +/// Information about device memory and storage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MemoryInfo { + /// Total internal storage on device in bytes. + #[serde(rename="totalInternalStorage")] + pub total_internal_storage: Option, + /// Total RAM on device in bytes. + #[serde(rename="totalRam")] + pub total_ram: Option, +} + +impl Part for MemoryInfo {} + + +/// An enrollment token. +/// +/// # 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*). +/// +/// * [enrollment tokens create enterprises](struct.EnterpriseEnrollmentTokenCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnrollmentToken { + /// The name of the policy that will be initially applied to the enrolled device in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy with id default is applied. It is permissible to only specify the policyId when updating this field as long as the policyId contains no slashes since the rest of the policy name can be inferred from context. + #[serde(rename="policyName")] + pub policy_name: Option, + /// A JSON string whose UTF-8 representation can be used to generate a QR code to enroll a device with this enrollment token. To enroll a device using NFC, the NFC record must contain a serialized java.util.Properties representation of the properties in the JSON. + #[serde(rename="qrCode")] + pub qr_code: Option, + /// The name of the enrollment token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} + pub name: Option, + /// Optional, arbitrary data associated with the enrollment token. This could contain, for example, the id of an org unit to which the device is assigned after enrollment. After a device enrolls with the token, this data will be exposed in the enrollment_token_data field of the Device resource. The data must be 1024 characters or less; otherwise, the creation request will fail. + #[serde(rename="additionalData")] + pub additional_data: Option, + /// The duration of the token. If not specified, the duration will be 1 hour. The allowed range is 1 minute to 30 days. + pub duration: Option, + /// The expiration time of the token. This is a read-only field generated by the server. + #[serde(rename="expirationTimestamp")] + pub expiration_timestamp: Option, + /// The token value which is passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. + pub value: Option, +} + +impl RequestValue for EnrollmentToken {} +impl ResponseResult for EnrollmentToken {} + + +/// Configuration for an Android permission and its grant state. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PermissionGrant { + /// The policy for granting the permission. + pub policy: Option, + /// The android permission, e.g. android.permission.READ_CALENDAR. + pub permission: Option, +} + +impl Part for PermissionGrant {} + + +/// An entry of a managed property. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedPropertyEntry { + /// The human-readable name of the value. Localized. + pub name: Option, + /// The machine-readable value of the entry, which should be used in the configuration. Not localized. + pub value: Option, +} + +impl Part for ManagedPropertyEntry {} + + +/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// The JSON representation for Empty is empty JSON object {}. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [enrollment tokens delete enterprises](struct.EnterpriseEnrollmentTokenDeleteCall.html) (response) +/// * [devices delete enterprises](struct.EnterpriseDeviceDeleteCall.html) (response) +/// * [policies delete enterprises](struct.EnterprisePolicyDeleteCall.html) (response) +/// * [devices operations cancel enterprises](struct.EnterpriseDeviceOperationCancelCall.html) (response) +/// * [devices operations delete enterprises](struct.EnterpriseDeviceOperationDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be: +/// Simple to use and understand for most users +/// Flexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include: +/// Partial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors. +/// Workflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting. +/// Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response. +/// Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message. +/// Logging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// A policy, which governs behavior for a device. +/// +/// # 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*). +/// +/// * [policies patch enterprises](struct.EnterprisePolicyPatchCall.html) (request|response) +/// * [policies get enterprises](struct.EnterprisePolicyGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Rules declaring which mitigating actions to take when a device is not compliant with its policy. When the conditions for multiple rules are satisfied, all of the mitigating actions for the rules are taken. There is a maximum limit of 100 rules. + #[serde(rename="complianceRules")] + pub compliance_rules: Option>, + /// Whether all cameras on the device are disabled. + #[serde(rename="cameraDisabled")] + pub camera_disabled: Option, + /// Default intent handler activities. + #[serde(rename="persistentPreferredActivities")] + pub persistent_preferred_activities: Option>, + /// Whether WiFi networks defined in Open Network Configuration are locked so they cannot be edited by the user. + #[serde(rename="wifiConfigsLockdownEnabled")] + pub wifi_configs_lockdown_enabled: Option, + /// Whether adding new users and profiles is disabled. + #[serde(rename="addUserDisabled")] + pub add_user_disabled: Option, + /// Status reporting settings + #[serde(rename="statusReportingSettings")] + pub status_reporting_settings: Option, + /// Whether removing other users is disabled. + #[serde(rename="removeUserDisabled")] + pub remove_user_disabled: Option, + /// Whether rebooting the device into safe boot is disabled. + #[serde(rename="safeBootDisabled")] + pub safe_boot_disabled: Option, + /// Whether applications other than the ones configured in applications are blocked from being installed. When set, applications that were installed under a previous policy but no longer appear in the policy are automatically uninstalled. + #[serde(rename="blockApplicationsEnabled")] + pub block_applications_enabled: Option, + /// Network configuration for the device. See configure networks for more information. + #[serde(rename="openNetworkConfiguration")] + pub open_network_configuration: Option>, + /// Email addresses of device administrators for factory reset protection. When the device is factory reset, it will require one of these admins to log in with the Google account email and password to unlock the device. If no admins are specified, the device will not provide factory reset protection. + #[serde(rename="frpAdminEmails")] + pub frp_admin_emails: Option>, + /// Password requirements. + #[serde(rename="passwordRequirements")] + pub password_requirements: Option, + /// Maximum time in milliseconds for user activity until the device will lock. A value of 0 means there is no restriction. + #[serde(rename="maximumTimeToLock")] + pub maximum_time_to_lock: Option, + /// The version of the policy. This is a read-only field. The version is incremented each time the policy is updated. + pub version: Option, + /// Whether the user is allowed to enable the "Unknown Sources" setting, which allows installation of apps from unknown sources. + #[serde(rename="installUnknownSourcesAllowed")] + pub install_unknown_sources_allowed: Option, + /// Whether adding or removing accounts is disabled. + #[serde(rename="modifyAccountsDisabled")] + pub modify_accounts_disabled: Option, + /// Whether the status bar is disabled. This disables notifications, quick settings and other screen overlays that allow escape from full-screen mode. + #[serde(rename="statusBarDisabled")] + pub status_bar_disabled: Option, + /// Whether configuring WiFi access points is disabled. + #[serde(rename="wifiConfigDisabled")] + pub wifi_config_disabled: Option, + /// Whether auto time is required, which prevents the user from manually setting the date and time. + #[serde(rename="autoTimeRequired")] + pub auto_time_required: Option, + /// Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled. + #[serde(rename="funDisabled")] + pub fun_disabled: Option, + /// Policy applied to apps. + pub applications: Option>, + /// Whether the microphone is muted and adjusting microphone volume is disabled. + #[serde(rename="unmuteMicrophoneDisabled")] + pub unmute_microphone_disabled: Option, + /// Whether the user is allowed to enable debugging features. + #[serde(rename="debuggingFeaturesAllowed")] + pub debugging_features_allowed: Option, + /// Whether the keyguard is disabled. + #[serde(rename="keyguardDisabled")] + pub keyguard_disabled: Option, + /// The default permission policy for requests for runtime permissions. + #[serde(rename="defaultPermissionPolicy")] + pub default_permission_policy: Option, + /// Whether factory resetting from settings is disabled. + #[serde(rename="factoryResetDisabled")] + pub factory_reset_disabled: Option, + /// Whether the network escape hatch is enabled. If a network connection can't be made at boot time, the escape hatch prompts the user to temporarily connect to a network in order to refresh the device policy. After applying policy, the temporary network will be forgotten and the device will continue booting. This prevents being unable to connect to a network if there is no suitable network in the last policy and the device boots into an app in lock task mode, or the user is otherwise unable to reach device settings. + #[serde(rename="networkEscapeHatchEnabled")] + pub network_escape_hatch_enabled: Option, + /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + pub name: Option, + /// The system update policy, which controls how OS updates are applied. If the update type is WINDOWED and the device has a device account, the update window will automatically apply to Play app updates as well. + #[serde(rename="systemUpdate")] + pub system_update: Option, + /// The battery plugged in modes for which the device stays on. When using this setting, it is recommended to clear maximum_time_to_lock so that the device doesn't lock itself while it stays on. + #[serde(rename="stayOnPluggedModes")] + pub stay_on_plugged_modes: Option>, + /// Whether screen capture is disabled. + #[serde(rename="screenCaptureDisabled")] + pub screen_capture_disabled: Option, + /// Whether adjusting the master volume is disabled. + #[serde(rename="adjustVolumeDisabled")] + pub adjust_volume_disabled: Option, +} + +impl RequestValue for Policy {} +impl ResponseResult for Policy {} + + +/// A compliance rule condition which is satisfied if the Android Framework API level on the device does not meet a minimum requirement. There can only be one rule with this type of condition per 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 ApiLevelCondition { + /// The minimum desired Android Framework API level. If the device does not meet the minimum requirement, this condition is satisfied. Must be greater than zero. + #[serde(rename="minApiLevel")] + pub min_api_level: Option, +} + +impl Part for ApiLevelCondition {} + + +/// A device owned by an enterprise. Unless otherwise noted, all fields are read-only and cannot be modified by an update device request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [devices patch enterprises](struct.EnterpriseDevicePatchCall.html) (request|response) +/// * [devices get enterprises](struct.EnterpriseDeviceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Device { + /// Detailed information about the device hardware. + #[serde(rename="hardwareInfo")] + pub hardware_info: Option, + /// The name of the policy that is currently applied by the device. + #[serde(rename="appliedPolicyName")] + pub applied_policy_name: Option, + /// Device network information. This information is only available when networkInfoEnabled is true in the device's policy. + #[serde(rename="networkInfo")] + pub network_info: Option, + /// Events related to memory and storage measurements in chronological order. This information is only available when memoryInfoEnabled is true in the device's policy. + #[serde(rename="memoryEvents")] + pub memory_events: Option>, + /// Power management events on the device in chronological order. This information is only available when powerManagementEventsEnabled is true in the device's policy. + #[serde(rename="powerManagementEvents")] + pub power_management_events: Option>, + /// If this device was enrolled with an enrollment token, this field contains the name of the token. + #[serde(rename="enrollmentTokenName")] + pub enrollment_token_name: Option, + /// Displays on the device. This information is only available when displayInfoEnabled is true in the device's policy. + pub displays: Option>, + /// Details about policy settings for which the device is not in compliance. + #[serde(rename="nonComplianceDetails")] + pub non_compliance_details: Option>, + /// Hardware status samples in chronological order. This information is only available when hardwareStatusEnabled is true in the device's policy. + #[serde(rename="hardwareStatusSamples")] + pub hardware_status_samples: Option>, + /// The API level of the Android platform version running on the device. + #[serde(rename="apiLevel")] + pub api_level: Option, + /// The version of the policy that is currently applied by the device. + #[serde(rename="appliedPolicyVersion")] + pub applied_policy_version: Option, + /// The resource name of the user of the device in the form enterprises/{enterpriseId}/users/{userId}. This is the name of the device account automatically created for this device. + #[serde(rename="userName")] + pub user_name: Option, + /// The name of the policy that is intended to be applied to the device. If empty, the policy with id default is applied. This field may be modified by an update request. The name of the policy is in the form enterprises/{enterpriseId}/policies/{policyId}. It is also permissible to only specify the policyId when updating this field as long as the policyId contains no slashes since the rest of the policy name can be inferred from context. + #[serde(rename="policyName")] + pub policy_name: Option, + /// If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field may be modified by an update request. + #[serde(rename="disabledReason")] + pub disabled_reason: Option, + /// If this device was enrolled with an enrollment token with additional data provided, this field contains that data. + #[serde(rename="enrollmentTokenData")] + pub enrollment_token_data: Option, + /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + pub name: Option, + /// The previous device names used for the same physical device when it has been enrolled multiple times. The serial number is used as the unique identifier to determine if the same physical device has enrolled previously. The names are in chronological order. + #[serde(rename="previousDeviceNames")] + pub previous_device_names: Option>, + /// The last time the device fetched its policy. + #[serde(rename="lastPolicySyncTime")] + pub last_policy_sync_time: Option, + /// Detailed information about the device software. This information is only available when softwareInfoEnabled is true in the device's policy. + #[serde(rename="softwareInfo")] + pub software_info: Option, + /// The state that is currently applied by the device. + #[serde(rename="appliedState")] + pub applied_state: Option, + /// Whether the device is compliant with its policy. + #[serde(rename="policyCompliant")] + pub policy_compliant: Option, + /// The state that is intended to be applied to the device. This field may be modified by an update request. Note that UpdateDevice only handles toggling between ACTIVE and DISABLED states. Use the delete device method to cause the device to enter the DELETED state. + pub state: Option, + /// Memory information. This information is only available when memoryInfoEnabled is true in the device's policy. + #[serde(rename="memoryInfo")] + pub memory_info: Option, + /// The last time the device sent a policy compliance report. + #[serde(rename="lastPolicyComplianceReportTime")] + pub last_policy_compliance_report_time: Option, + /// The time of device enrollment. + #[serde(rename="enrollmentTime")] + pub enrollment_time: Option, + /// The last time the device sent a status report. + #[serde(rename="lastStatusReportTime")] + pub last_status_report_time: Option, +} + +impl RequestValue for Device {} +impl ResponseResult for Device {} + + +/// Application permission. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApplicationPermission { + /// An opaque string uniquely identifying the permission. Not localized. + #[serde(rename="permissionId")] + pub permission_id: Option, + /// A longer description of the permission, giving more details of what it affects. Localized. + pub description: Option, + /// The name of the permission. Localized. + pub name: Option, +} + +impl Part for ApplicationPermission {} + + +/// Requirements for the password used to unlock a device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PasswordRequirements { + /// Password expiration timeout. + #[serde(rename="passwordExpirationTimeout")] + pub password_expiration_timeout: Option, + /// A device will be wiped after too many incorrect device-unlock passwords have been entered. A value of 0 means there is no restriction. + #[serde(rename="maximumFailedPasswordsForWipe")] + pub maximum_failed_passwords_for_wipe: Option, + /// The length of the password history. After setting this, the user will not be able to enter a new password that is the same as any password in the history. A value of 0 means there is no restriction. + #[serde(rename="passwordHistoryLength")] + pub password_history_length: Option, + /// Minimum number of symbols required in the password. Only enforced when password_quality is COMPLEX. + #[serde(rename="passwordMinimumSymbols")] + pub password_minimum_symbols: Option, + /// The required password quality. + #[serde(rename="passwordQuality")] + pub password_quality: Option, + /// The minimum allowed password length. A value of 0 means there is no restriction. Only enforced when password_quality is NUMERIC, NUMERIC_COMPLEX, ALPHABETIC, ALPHANUMERIC, or COMPLEX. + #[serde(rename="passwordMinimumLength")] + pub password_minimum_length: Option, + /// Minimum number of numerical digits required in the password. Only enforced when password_quality is COMPLEX. + #[serde(rename="passwordMinimumNumeric")] + pub password_minimum_numeric: Option, + /// Minimum number of non-letter characters (numerical digits or symbols) required in the password. Only enforced when password_quality is COMPLEX. + #[serde(rename="passwordMinimumNonLetter")] + pub password_minimum_non_letter: Option, + /// Minimum number of upper case letters required in the password. Only enforced when password_quality is COMPLEX. + #[serde(rename="passwordMinimumUpperCase")] + pub password_minimum_upper_case: Option, + /// Minimum number of lower case letters required in the password. Only enforced when password_quality is COMPLEX. + #[serde(rename="passwordMinimumLowerCase")] + pub password_minimum_lower_case: Option, + /// Minimum number of letters required in the password. Only enforced when password_quality is COMPLEX. + #[serde(rename="passwordMinimumLetters")] + pub password_minimum_letters: Option, +} + +impl Part for PasswordRequirements {} + + +/// Information about device software. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SoftwareInfo { + /// Build time. + #[serde(rename="androidBuildTime")] + pub android_build_time: Option, + /// Security patch level, e.g. 2016-05-01. + #[serde(rename="securityPatchLevel")] + pub security_patch_level: Option, + /// Android build Id string meant for displaying to the user, e.g. shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. + #[serde(rename="androidBuildNumber")] + pub android_build_number: Option, + /// Kernel version, e.g. 2.6.32.9-g103d848. + #[serde(rename="deviceKernelVersion")] + pub device_kernel_version: Option, + /// The user visible Android version string, e.g. 6.0.1. + #[serde(rename="androidVersion")] + pub android_version: Option, + /// The system bootloader version number, e.g. 0.6.7. + #[serde(rename="bootloaderVersion")] + pub bootloader_version: Option, +} + +impl Part for SoftwareInfo {} + + +/// A rule declaring which mitigating actions to take when a device is not compliant with its policy. For every rule, there is always an implicit mitigating action to set policy_compliant to false for the Device resource, and display a message on the device indicating that the device is not compliant with its policy. Other mitigating actions may optionally be taken as well, depending on the field values in the rule. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ComplianceRule { + /// A condition which is satisfied if the Android Framework API level on the device does not meet a minimum requirement. + #[serde(rename="apiLevelCondition")] + pub api_level_condition: Option, + /// A condition which is satisfied if there exists any matching NonComplianceDetail for the device. + #[serde(rename="nonComplianceDetailCondition")] + pub non_compliance_detail_condition: Option, + /// If set to true, the rule includes a mitigating action to disable applications so that the device is effectively disabled, but application data is preserved. If the device is running an app in locked task mode, the app will be closed and a UI showing the reason for non-compliance will be displayed. + #[serde(rename="disableApps")] + pub disable_apps: Option, +} + +impl Part for ComplianceRule {} + + +/// Response to a request to list devices for a given 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*). +/// +/// * [devices list enterprises](struct.EnterpriseDeviceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDevicesResponse { + /// If there are more results, a token to retrieve next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of devices. + pub devices: Option>, +} + +impl ResponseResult for ListDevicesResponse {} + + +/// A command. +/// +/// # 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*). +/// +/// * [devices issue command enterprises](struct.EnterpriseDeviceIssueCommandCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Command { + /// The duration for which the command is valid. The command will expire if not executed by the device during this time. The default duration if unspecified is ten minutes. There is no maximum duration. + pub duration: Option, + /// For commands of type RESET_PASSWORD, optionally specifies flags. + #[serde(rename="resetPasswordFlags")] + pub reset_password_flags: Option>, + /// For commands of type RESET_PASSWORD, optionally specifies the new password. + #[serde(rename="newPassword")] + pub new_password: Option, + /// The type of the command. + #[serde(rename="type")] + pub type_: Option, + /// The timestamp at which the command was created. The timestamp is automatically generated by the server. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl RequestValue for Command {} + + +/// Provides user facing message with locale info. The maximum message length is 4096 characters. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserFacingMessage { + /// The default message that gets displayed if no localized message is specified, or the user's locale does not match with any of the localized messages. A default message must be provided if any localized messages are provided. + #[serde(rename="defaultMessage")] + pub default_message: Option, + /// A map which contains pairs. The locale is a BCP 47 language code, e.g. en-US, es-ES, fr. + #[serde(rename="localizedMessages")] + pub localized_messages: Option>, +} + +impl Part for UserFacingMessage {} + + +/// The configuration applied to an 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*). +/// +/// * [devices operations delete enterprises](struct.EnterpriseDeviceOperationDeleteCall.html) (none) +/// * [web tokens create enterprises](struct.EnterpriseWebTokenCreateCall.html) (none) +/// * [policies list enterprises](struct.EnterprisePolicyListCall.html) (none) +/// * [devices get enterprises](struct.EnterpriseDeviceGetCall.html) (none) +/// * [policies patch enterprises](struct.EnterprisePolicyPatchCall.html) (none) +/// * [create enterprises](struct.EnterpriseCreateCall.html) (request|response) +/// * [patch enterprises](struct.EnterprisePatchCall.html) (request|response) +/// * [policies get enterprises](struct.EnterprisePolicyGetCall.html) (none) +/// * [get enterprises](struct.EnterpriseGetCall.html) (response) +/// * [devices operations cancel enterprises](struct.EnterpriseDeviceOperationCancelCall.html) (none) +/// * [enrollment tokens create enterprises](struct.EnterpriseEnrollmentTokenCreateCall.html) (none) +/// * [devices list enterprises](struct.EnterpriseDeviceListCall.html) (none) +/// * [policies delete enterprises](struct.EnterprisePolicyDeleteCall.html) (none) +/// * [applications get enterprises](struct.EnterpriseApplicationGetCall.html) (none) +/// * [devices operations get enterprises](struct.EnterpriseDeviceOperationGetCall.html) (none) +/// * [enrollment tokens delete enterprises](struct.EnterpriseEnrollmentTokenDeleteCall.html) (none) +/// * [devices issue command enterprises](struct.EnterpriseDeviceIssueCommandCall.html) (none) +/// * [devices delete enterprises](struct.EnterpriseDeviceDeleteCall.html) (none) +/// * [devices operations list enterprises](struct.EnterpriseDeviceOperationListCall.html) (none) +/// * [devices patch enterprises](struct.EnterpriseDevicePatchCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Enterprise { + /// The notification types to enable via Google Cloud Pub/Sub. + #[serde(rename="enabledNotificationTypes")] + pub enabled_notification_types: Option>, + /// The name of the enterprise which is generated by the server during creation, in the form enterprises/{enterpriseId} + pub name: Option, + /// The name of the enterprise as it will appear to users. + #[serde(rename="enterpriseDisplayName")] + pub enterprise_display_name: Option, + /// An image displayed as a logo during device provisioning. Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, image/vnd.wap.wbmp, image/x-adobe-dng. + pub logo: Option, + /// When Cloud Pub/Sub notifications are enabled, this field is required to indicate the topic to which the notifications will be published. The format of this field is projects/{project}/topics/{topic}. You must have granted the publish permission on this topic to android-cloud-policy@system.gserviceaccount.com + #[serde(rename="pubsubTopic")] + pub pubsub_topic: Option, + /// A color in RGB format indicating the predominant color to display in the device management app UI. The color components are stored as follows: (red << 16) | (green << 8) | blue, where each component may take a value between 0 and 255 inclusive. + #[serde(rename="primaryColor")] + pub primary_color: Option, + /// Whether app auto-approval is enabled. When enabled, apps installed via policy for this enterprise have all permissions automatically approved. When enabled, it is the caller's responsibility to display the permissions required by an app to the enterprise admin before setting the app to be installed in a policy. + #[serde(rename="appAutoApprovalEnabled")] + pub app_auto_approval_enabled: Option, +} + +impl RequestValue for Enterprise {} +impl Resource for Enterprise {} +impl ResponseResult for Enterprise {} + + +/// A default activity for handling intents that match a particular intent filter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PersistentPreferredActivity { + /// The activity that should be the default intent handler. This should be an Android component name, e.g. com.android.enterprise.app/.MainActivity. Alternatively, the value may be the package name of an app, which causes Android Device Policy to choose an appropriate activity from the app to handle the intent. + #[serde(rename="receiverActivity")] + pub receiver_activity: Option, + /// The intent actions to match in the filter. If any actions are included in the filter, then an intent's action must be one of those values for it to match. If no actions are included, the intent action is ignored. + pub actions: Option>, + /// The intent categories to match in the filter. An intent includes the categories that it requires, all of which must be included in the filter in order to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent. + pub categories: Option>, +} + +impl Part for PersistentPreferredActivity {} + + +/// Device display information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Display { + /// Refresh rate of the display in frames per second. + #[serde(rename="refreshRate")] + pub refresh_rate: Option, + /// Display width in pixels. + pub width: Option, + /// State of the display. + pub state: Option, + /// Name of the display. + pub name: Option, + /// Display density expressed as dots-per-inch. + pub density: Option, + /// Unique display id. + #[serde(rename="displayId")] + pub display_id: Option, + /// Display height in pixels. + pub height: Option, +} + +impl Part for Display {} + + +/// Information about device hardware. The fields related to temperature thresholds are only available when hardwareStatusEnabled is true in the device's 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 HardwareInfo { + /// Name of the hardware, e.g. Angler. + pub hardware: Option, + /// CPU shutdown temperature thresholds in Celsius for each CPU on the device. + #[serde(rename="cpuShutdownTemperatures")] + pub cpu_shutdown_temperatures: Option>, + /// CPU throttling temperature thresholds in Celsius for each CPU on the device. + #[serde(rename="cpuThrottlingTemperatures")] + pub cpu_throttling_temperatures: Option>, + /// Brand of the device, e.g. Google. + pub brand: Option, + /// The device serial number. + #[serde(rename="serialNumber")] + pub serial_number: Option, + /// GPU shutdown temperature thresholds in Celsius for each GPU on the device. + #[serde(rename="gpuShutdownTemperatures")] + pub gpu_shutdown_temperatures: Option>, + /// GPU throttling temperature thresholds in Celsius for each GPU on the device. + #[serde(rename="gpuThrottlingTemperatures")] + pub gpu_throttling_temperatures: Option>, + /// Device skin shutdown temperature thresholds in Celsius. + #[serde(rename="skinShutdownTemperatures")] + pub skin_shutdown_temperatures: Option>, + /// Device skin throttling temperature thresholds in Celsius. + #[serde(rename="skinThrottlingTemperatures")] + pub skin_throttling_temperatures: Option>, + /// Battery shutdown temperature thresholds in Celsius for each battery on the device. + #[serde(rename="batteryShutdownTemperatures")] + pub battery_shutdown_temperatures: Option>, + /// Baseband version, e.g. MDM9625_104662.22.05.34p. + #[serde(rename="deviceBasebandVersion")] + pub device_baseband_version: Option, + /// The model of the device, e.g. Asus Nexus 7. + pub model: Option, + /// Battery throttling temperature thresholds in Celsius for each battery on the device. + #[serde(rename="batteryThrottlingTemperatures")] + pub battery_throttling_temperatures: Option>, + /// Manufacturer, e.g. Motorola. + pub manufacturer: Option, +} + +impl Part for HardwareInfo {} + + +/// Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HardwareStatus { + /// Current battery temperatures in Celsius for each battery on the device. + #[serde(rename="batteryTemperatures")] + pub battery_temperatures: Option>, + /// Current device skin temperatures in Celsius. + #[serde(rename="skinTemperatures")] + pub skin_temperatures: Option>, + /// Current GPU temperatures in Celsius for each GPU on the device. + #[serde(rename="gpuTemperatures")] + pub gpu_temperatures: Option>, + /// Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system. + #[serde(rename="fanSpeeds")] + pub fan_speeds: Option>, + /// Current CPU temperatures in Celsius for each CPU on the device. + #[serde(rename="cpuTemperatures")] + pub cpu_temperatures: Option>, + /// The time the measurements were taken. + #[serde(rename="createTime")] + pub create_time: Option, + /// CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported in the system. + #[serde(rename="cpuUsages")] + pub cpu_usages: Option>, +} + +impl Part for HardwareStatus {} + + +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [devices operations list enterprises](struct.EnterpriseDeviceOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, +} + +impl ResponseResult for ListOperationsResponse {} + + +/// An enterprise signup URL. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create signup urls](struct.SignupUrlCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SignupUrl { + /// A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe. + pub url: Option, + /// The name of the resource. This must be included in the create enterprise request at the end of the signup flow. + pub name: Option, +} + +impl Resource for SignupUrl {} +impl ResponseResult for SignupUrl {} + + +/// A web token used to access an embeddable managed Google Play web UI. +/// +/// # 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*). +/// +/// * [web tokens create enterprises](struct.EnterpriseWebTokenCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WebToken { + /// The URL of the parent frame hosting the iframe with the embedded UI. To prevent XSS, the iframe may not be hosted at other URLs. The URL must use the https scheme. + #[serde(rename="parentFrameUrl")] + pub parent_frame_url: Option, + /// The name of the web token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. + pub name: Option, + /// The token value which is used in the hosting page to generate the iframe with the embedded UI. This is a read-only field generated by the server. + pub value: Option, + /// Permissions the admin may exercise in the embedded UI. The admin must have all of these permissions in order to view the UI. + pub permissions: Option>, +} + +impl RequestValue for WebToken {} +impl ResponseResult for WebToken {} + + +/// Policy for an individual app. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApplicationPolicy { + /// The type of installation to perform. + #[serde(rename="installType")] + pub install_type: Option, + /// Managed configuration applied to the app. The format for the configuration is dictated by the ManagedProperty values supported by the app. Each field name in the managed configuration must match the key field of the ManagedProperty. The field value must be compatible with the type of the ManagedProperty:
typeJSON value
BOOLtrue or false
STRINGstring
INTEGERnumber
CHOICEstring
MULTISELECTarray of strings
HIDDENstring
BUNDLE_ARRAYarray of objects
+ #[serde(rename="managedConfiguration")] + pub managed_configuration: Option>, + /// Whether the application is allowed to lock itself in full-screen mode. + #[serde(rename="lockTaskAllowed")] + pub lock_task_allowed: Option, + /// The package name of the app, e.g. com.google.android.youtube for the YouTube app. + #[serde(rename="packageName")] + pub package_name: Option, + /// Explicit permission grants or denials for the app. These values override the default_permission_policy. + #[serde(rename="permissionGrants")] + pub permission_grants: Option>, + /// The default policy for all permissions requested by the app. If specified, this overrides the policy-level default_permission_policy which applies to all apps. + #[serde(rename="defaultPermissionPolicy")] + pub default_permission_policy: Option, +} + +impl Part for ApplicationPolicy {} + + +/// Managed property. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedProperty { + /// For BUNDLE_ARRAY properties, the list of nested properties. A BUNDLE_ARRAY property is at most two levels deep. + #[serde(rename="nestedProperties")] + pub nested_properties: Option>, + /// A longer description of the property, giving more detail of what it affects. Localized. + pub description: Option, + /// The unique key that the application uses to identify the property, e.g. "com.google.android.gm.fieldname". + pub key: Option, + /// The name of the property. Localized. + pub title: Option, + /// The default value of the properties. BUNDLE_ARRAY properties never have a default value. + #[serde(rename="defaultValue")] + pub default_value: Option, + /// For CHOICE or MULTISELECT properties, the list of possible entries. + pub entries: Option>, + /// The type of the property. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for ManagedProperty {} + + +/// Device network info. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkInfo { + /// IMEI number of the GSM device, e.g. A1000031212. + pub imei: Option, + /// MEID number of the CDMA device, e.g. A00000292788E1. + pub meid: Option, + /// WiFi MAC address of the device, e.g. 7c:11:11:11:11:11. + #[serde(rename="wifiMacAddress")] + pub wifi_mac_address: Option, +} + +impl Part for NetworkInfo {} + + +/// Settings controlling the behavior of status reports. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StatusReportingSettings { + /// Whether power management event reporting is enabled. + #[serde(rename="powerManagementEventsEnabled")] + pub power_management_events_enabled: Option, + /// Whether network info reporting is enabled. + #[serde(rename="networkInfoEnabled")] + pub network_info_enabled: Option, + /// Whether memory info reporting is enabled. + #[serde(rename="memoryInfoEnabled")] + pub memory_info_enabled: Option, + /// Whether hardware status reporting is enabled. + #[serde(rename="hardwareStatusEnabled")] + pub hardware_status_enabled: Option, + /// Whether software info reporting is enabled. + #[serde(rename="softwareInfoEnabled")] + pub software_info_enabled: Option, + /// Whether displays reporting is enabled. + #[serde(rename="displayInfoEnabled")] + pub display_info_enabled: Option, +} + +impl Part for StatusReportingSettings {} + + +/// Data hosted at an external location. The data is to be downloaded by Android Device Policy and verified against the hash. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExternalData { + /// The absolute URL to the data, which must use either the http or https scheme. Android Device Policy does not provide any credentials in the GET request, so the URL must be publicly accessible. Including a long, random component in the URL may be used to prevent attackers from discovering the URL. + pub url: Option, + /// The base-64 encoded SHA-256 hash of the content hosted at url. If the content does not match this hash, Android Device Policy will not use the data. + #[serde(rename="sha256Hash")] + pub sha256_hash: Option, +} + +impl Part for ExternalData {} + + +/// This resource represents a long-running operation that is the result of a network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [devices operations get enterprises](struct.EnterpriseDeviceOperationGetCall.html) (response) +/// * [devices issue command enterprises](struct.EnterpriseDeviceIssueCommandCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. + pub done: Option, + /// The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should have the format of operations/some/unique/name. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for Operation {} + + +/// A power management event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PowerManagementEvent { + /// Event type. + #[serde(rename="eventType")] + pub event_type: Option, + /// For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage. + #[serde(rename="batteryLevel")] + pub battery_level: Option, + /// The creation time of the event. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl Part for PowerManagementEvent {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *signupUrl* resources. +/// It is not used directly, but through the `AndroidManagement` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androidmanagement1 as androidmanagement1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androidmanagement1::AndroidManagement; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)` +/// // to build up your call. +/// let rb = hub.signup_urls(); +/// # } +/// ``` +pub struct SignupUrlMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, +} + +impl<'a, C, A> MethodsBuilder for SignupUrlMethods<'a, C, A> {} + +impl<'a, C, A> SignupUrlMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates an enterprise signup URL. + pub fn create(&self) -> SignupUrlCreateCall<'a, C, A> { + SignupUrlCreateCall { + hub: self.hub, + _project_id: Default::default(), + _callback_url: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *enterprise* resources. +/// It is not used directly, but through the `AndroidManagement` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androidmanagement1 as androidmanagement1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androidmanagement1::AndroidManagement; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `applications_get(...)`, `create(...)`, `devices_delete(...)`, `devices_get(...)`, `devices_issue_command(...)`, `devices_list(...)`, `devices_operations_cancel(...)`, `devices_operations_delete(...)`, `devices_operations_get(...)`, `devices_operations_list(...)`, `devices_patch(...)`, `enrollment_tokens_create(...)`, `enrollment_tokens_delete(...)`, `get(...)`, `patch(...)`, `policies_delete(...)`, `policies_get(...)`, `policies_list(...)`, `policies_patch(...)` and `web_tokens_create(...)` +/// // to build up your call. +/// let rb = hub.enterprises(); +/// # } +/// ``` +pub struct EnterpriseMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, +} + +impl<'a, C, A> MethodsBuilder for EnterpriseMethods<'a, C, A> {} + +impl<'a, C, A> EnterpriseMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn devices_operations_delete(&self, name: &str) -> EnterpriseDeviceOperationDeleteCall<'a, C, A> { + EnterpriseDeviceOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a web token to access an embeddable managed Google Play web UI for a given enterprise. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId} + pub fn web_tokens_create(&self, request: WebToken, parent: &str) -> EnterpriseWebTokenCreateCall<'a, C, A> { + EnterpriseWebTokenCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a device. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + pub fn devices_patch(&self, request: Device, name: &str) -> EnterpriseDevicePatchCall<'a, C, A> { + EnterpriseDevicePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists policies for a given enterprise. + /// + /// # Arguments + /// + /// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId} + pub fn policies_list(&self, parent: &str) -> EnterprisePolicyListCall<'a, C, A> { + EnterprisePolicyListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a device. + /// + /// # Arguments + /// + /// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + pub fn devices_get(&self, name: &str) -> EnterpriseDeviceGetCall<'a, C, A> { + EnterpriseDeviceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates or creates a policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + pub fn policies_patch(&self, request: Policy, name: &str) -> EnterprisePolicyPatchCall<'a, C, A> { + EnterprisePolicyPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an enterprise by completing the enterprise signup flow. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Enterprise) -> EnterpriseCreateCall<'a, C, A> { + EnterpriseCreateCall { + hub: self.hub, + _request: request, + _signup_url_name: Default::default(), + _project_id: Default::default(), + _enterprise_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an enterprise. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the enterprise in the form enterprises/{enterpriseId} + pub fn patch(&self, request: Enterprise, name: &str) -> EnterprisePatchCall<'a, C, A> { + EnterprisePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a policy. + /// + /// # Arguments + /// + /// * `name` - The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + pub fn policies_get(&self, name: &str) -> EnterprisePolicyGetCall<'a, C, A> { + EnterprisePolicyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets an enterprise. + /// + /// # Arguments + /// + /// * `name` - The name of the enterprise in the form enterprises/{enterpriseId} + pub fn get(&self, name: &str) -> EnterpriseGetCall<'a, C, A> { + EnterpriseGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn devices_operations_cancel(&self, name: &str) -> EnterpriseDeviceOperationCancelCall<'a, C, A> { + EnterpriseDeviceOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an enrollment token for a given enterprise. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId} + pub fn enrollment_tokens_create(&self, request: EnrollmentToken, parent: &str) -> EnterpriseEnrollmentTokenCreateCall<'a, C, A> { + EnterpriseEnrollmentTokenCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists devices for a given enterprise. + /// + /// # Arguments + /// + /// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId} + pub fn devices_list(&self, parent: &str) -> EnterpriseDeviceListCall<'a, C, A> { + EnterpriseDeviceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a policy. This operation is only permitted if no devices are currently referencing the policy. + /// + /// # Arguments + /// + /// * `name` - The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + pub fn policies_delete(&self, name: &str) -> EnterprisePolicyDeleteCall<'a, C, A> { + EnterprisePolicyDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn devices_operations_get(&self, name: &str) -> EnterpriseDeviceOperationGetCall<'a, C, A> { + EnterpriseDeviceOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an enrollment token, which prevents future use of the token. + /// + /// # Arguments + /// + /// * `name` - The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} + pub fn enrollment_tokens_delete(&self, name: &str) -> EnterpriseEnrollmentTokenDeleteCall<'a, C, A> { + EnterpriseEnrollmentTokenDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + pub fn devices_issue_command(&self, request: Command, name: &str) -> EnterpriseDeviceIssueCommandCall<'a, C, A> { + EnterpriseDeviceIssueCommandCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a device, which causes the device to be wiped. + /// + /// # Arguments + /// + /// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + pub fn devices_delete(&self, name: &str) -> EnterpriseDeviceDeleteCall<'a, C, A> { + EnterpriseDeviceDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn devices_operations_list(&self, name: &str) -> EnterpriseDeviceOperationListCall<'a, C, A> { + EnterpriseDeviceOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets info about an application. + /// + /// # Arguments + /// + /// * `name` - The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} + pub fn applications_get(&self, name: &str) -> EnterpriseApplicationGetCall<'a, C, A> { + EnterpriseApplicationGetCall { + hub: self.hub, + _name: name.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Creates an enterprise signup URL. +/// +/// A builder for the *create* method supported by a *signupUrl* resource. +/// It is not used directly, but through a `SignupUrlMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.signup_urls().create() +/// .project_id("justo") +/// .callback_url("amet.") +/// .doit(); +/// # } +/// ``` +pub struct SignupUrlCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _project_id: Option, + _callback_url: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SignupUrlCreateCall<'a, C, A> {} + +impl<'a, C, A> SignupUrlCreateCall<'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, SignupUrl)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.signupUrls.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + if let Some(value) = self._callback_url { + params.push(("callbackUrl", value.to_string())); + } + for &field in ["alt", "projectId", "callbackUrl"].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 = self.hub._base_url.clone() + "v1/signupUrls"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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(Bearer { 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(d); + 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(d); + 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 Google Cloud Platform project which will own the enterprise. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> SignupUrlCreateCall<'a, C, A> { + self._project_id = Some(new_value.to_string()); + self + } + /// The callback URL to which the admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes. + /// + /// Sets the *callback url* query property to the given value. + pub fn callback_url(mut self, new_value: &str) -> SignupUrlCreateCall<'a, C, A> { + self._callback_url = 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) -> SignupUrlCreateCall<'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) -> SignupUrlCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SignupUrlCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. +/// +/// A builder for the *devices.operations.delete* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceOperationDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceOperationDeleteCall<'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) -> EnterpriseDeviceOperationDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a web token to access an embeddable managed Google Play web UI for a given enterprise. +/// +/// A builder for the *webTokens.create* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::WebToken; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = WebToken::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.enterprises().web_tokens_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseWebTokenCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: WebToken, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseWebTokenCreateCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseWebTokenCreateCall<'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, WebToken)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.webTokens.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/webTokens"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: WebToken) -> EnterpriseWebTokenCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the enterprise in the form enterprises/{enterpriseId} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> EnterpriseWebTokenCreateCall<'a, C, A> { + self._parent = 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) -> EnterpriseWebTokenCreateCall<'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) -> EnterpriseWebTokenCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseWebTokenCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a device. +/// +/// A builder for the *devices.patch* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::Device; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Device::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.enterprises().devices_patch(req, "name") +/// .update_mask("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDevicePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: Device, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDevicePatchCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDevicePatchCall<'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, Device)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Device) -> EnterpriseDevicePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDevicePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> EnterpriseDevicePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDevicePatchCall<'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) -> EnterpriseDevicePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDevicePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists policies for a given enterprise. +/// +/// A builder for the *policies.list* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().policies_list("parent") +/// .page_token("gubergren") +/// .page_size(-95) +/// .doit(); +/// # } +/// ``` +pub struct EnterprisePolicyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterprisePolicyListCall<'a, C, A> {} + +impl<'a, C, A> EnterprisePolicyListCall<'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, ListPoliciesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.policies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/policies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the enterprise in the form enterprises/{enterpriseId} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> EnterprisePolicyListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// A token identifying a page of results the server should return. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> EnterprisePolicyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The requested page size. The actual page size may be fixed to a min or max value. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> EnterprisePolicyListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterprisePolicyListCall<'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) -> EnterprisePolicyListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterprisePolicyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a device. +/// +/// A builder for the *devices.get* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_get("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceGetCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceGetCall<'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, Device)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceGetCall<'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) -> EnterpriseDeviceGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates or creates a policy. +/// +/// A builder for the *policies.patch* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::Policy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Policy::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.enterprises().policies_patch(req, "name") +/// .update_mask("no") +/// .doit(); +/// # } +/// ``` +pub struct EnterprisePolicyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: Policy, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterprisePolicyPatchCall<'a, C, A> {} + +impl<'a, C, A> EnterprisePolicyPatchCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.policies.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Policy) -> EnterprisePolicyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterprisePolicyPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> EnterprisePolicyPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterprisePolicyPatchCall<'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) -> EnterprisePolicyPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterprisePolicyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an enterprise by completing the enterprise signup flow. +/// +/// A builder for the *create* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::Enterprise; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Enterprise::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.enterprises().create(req) +/// .signup_url_name("justo") +/// .project_id("justo") +/// .enterprise_token("et") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: Enterprise, + _signup_url_name: Option, + _project_id: Option, + _enterprise_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseCreateCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseCreateCall<'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, Enterprise)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + if let Some(value) = self._signup_url_name { + params.push(("signupUrlName", value.to_string())); + } + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + if let Some(value) = self._enterprise_token { + params.push(("enterpriseToken", value.to_string())); + } + for &field in ["alt", "signupUrlName", "projectId", "enterpriseToken"].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 = self.hub._base_url.clone() + "v1/enterprises"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Enterprise) -> EnterpriseCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the SignupUrl used to sign up for the enterprise. + /// + /// Sets the *signup url name* query property to the given value. + pub fn signup_url_name(mut self, new_value: &str) -> EnterpriseCreateCall<'a, C, A> { + self._signup_url_name = Some(new_value.to_string()); + self + } + /// The id of the Google Cloud Platform project which will own the enterprise. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> EnterpriseCreateCall<'a, C, A> { + self._project_id = Some(new_value.to_string()); + self + } + /// The enterprise token appended to the callback URL. + /// + /// Sets the *enterprise token* query property to the given value. + pub fn enterprise_token(mut self, new_value: &str) -> EnterpriseCreateCall<'a, C, A> { + self._enterprise_token = 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) -> EnterpriseCreateCall<'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) -> EnterpriseCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an enterprise. +/// +/// A builder for the *patch* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::Enterprise; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Enterprise::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.enterprises().patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct EnterprisePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: Enterprise, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterprisePatchCall<'a, C, A> {} + +impl<'a, C, A> EnterprisePatchCall<'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, Enterprise)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Enterprise) -> EnterprisePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the enterprise in the form enterprises/{enterpriseId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterprisePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> EnterprisePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterprisePatchCall<'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) -> EnterprisePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterprisePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a policy. +/// +/// A builder for the *policies.get* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().policies_get("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterprisePolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterprisePolicyGetCall<'a, C, A> {} + +impl<'a, C, A> EnterprisePolicyGetCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.policies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterprisePolicyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterprisePolicyGetCall<'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) -> EnterprisePolicyGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterprisePolicyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets an enterprise. +/// +/// A builder for the *get* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().get("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseGetCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseGetCall<'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, Enterprise)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the enterprise in the form enterprises/{enterpriseId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseGetCall<'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) -> EnterpriseGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. +/// +/// A builder for the *devices.operations.cancel* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceOperationCancelCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceOperationCancelCall<'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) -> EnterpriseDeviceOperationCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an enrollment token for a given enterprise. +/// +/// A builder for the *enrollmentTokens.create* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::EnrollmentToken; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EnrollmentToken::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.enterprises().enrollment_tokens_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseEnrollmentTokenCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: EnrollmentToken, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseEnrollmentTokenCreateCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseEnrollmentTokenCreateCall<'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, EnrollmentToken)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.enrollmentTokens.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/enrollmentTokens"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: EnrollmentToken) -> EnterpriseEnrollmentTokenCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the enterprise in the form enterprises/{enterpriseId} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> EnterpriseEnrollmentTokenCreateCall<'a, C, A> { + self._parent = 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) -> EnterpriseEnrollmentTokenCreateCall<'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) -> EnterpriseEnrollmentTokenCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseEnrollmentTokenCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists devices for a given enterprise. +/// +/// A builder for the *devices.list* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_list("parent") +/// .page_token("sea") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceListCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceListCall<'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, ListDevicesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/devices"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the enterprise in the form enterprises/{enterpriseId} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> EnterpriseDeviceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// A token identifying a page of results the server should return. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> EnterpriseDeviceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The requested page size. The actual page size may be fixed to a min or max value. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> EnterpriseDeviceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceListCall<'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) -> EnterpriseDeviceListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a policy. This operation is only permitted if no devices are currently referencing the policy. +/// +/// A builder for the *policies.delete* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().policies_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterprisePolicyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterprisePolicyDeleteCall<'a, C, A> {} + +impl<'a, C, A> EnterprisePolicyDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.policies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterprisePolicyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterprisePolicyDeleteCall<'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) -> EnterprisePolicyDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterprisePolicyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. +/// +/// A builder for the *devices.operations.get* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceOperationGetCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceOperationGetCall<'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) -> EnterpriseDeviceOperationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an enrollment token, which prevents future use of the token. +/// +/// A builder for the *enrollmentTokens.delete* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().enrollment_tokens_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseEnrollmentTokenDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseEnrollmentTokenDeleteCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseEnrollmentTokenDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.enrollmentTokens.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseEnrollmentTokenDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseEnrollmentTokenDeleteCall<'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) -> EnterpriseEnrollmentTokenDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseEnrollmentTokenDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command. +/// +/// A builder for the *devices.issueCommand* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// use androidmanagement1::Command; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Command::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.enterprises().devices_issue_command(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceIssueCommandCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _request: Command, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceIssueCommandCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceIssueCommandCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.issueCommand", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:issueCommand"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Command) -> EnterpriseDeviceIssueCommandCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceIssueCommandCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceIssueCommandCall<'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) -> EnterpriseDeviceIssueCommandCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceIssueCommandCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a device, which causes the device to be wiped. +/// +/// A builder for the *devices.delete* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceDeleteCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseDeviceDeleteCall<'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) -> EnterpriseDeviceDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. +/// +/// A builder for the *devices.operations.list* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().devices_operations_list("name") +/// .page_token("amet") +/// .page_size(-60) +/// .filter("labore") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeviceOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeviceOperationListCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeviceOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.devices.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseDeviceOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> EnterpriseDeviceOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> EnterpriseDeviceOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> EnterpriseDeviceOperationListCall<'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) -> EnterpriseDeviceOperationListCall<'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) -> EnterpriseDeviceOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseDeviceOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets info about an application. +/// +/// A builder for the *applications.get* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidmanagement1 as androidmanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidmanagement1::AndroidManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.enterprises().applications_get("name") +/// .language_code("dolore") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseApplicationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidManagement, + _name: String, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseApplicationGetCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseApplicationGetCall<'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, Application)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidmanagement.enterprises.applications.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "name", "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 = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> EnterpriseApplicationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The preferred language for localized application info, as a BCP47 tag (e.g. "en-US", "de"). If not specified the default language of the application will be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> EnterpriseApplicationGetCall<'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) -> EnterpriseApplicationGetCall<'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) -> EnterpriseApplicationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EnterpriseApplicationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/androidpublisher2-cli/Cargo.toml b/gen/androidpublisher2-cli/Cargo.toml index 5df07a26fc..4ed072fe1b 100644 --- a/gen/androidpublisher2-cli/Cargo.toml +++ b/gen/androidpublisher2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2-cli" -version = "1.0.6+20170425" +version = "1.0.6+20170913" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-androidpublisher2] path = "../androidpublisher2" -version = "1.0.6+20170425" +version = "1.0.6+20170913" diff --git a/gen/androidpublisher2-cli/README.md b/gen/androidpublisher2-cli/README.md index a314ce8d57..6e75377fc7 100644 --- a/gen/androidpublisher2-cli/README.md +++ b/gen/androidpublisher2-cli/README.md @@ -25,7 +25,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 *20170425*. The CLI is at version *1.0.6*. +This documentation was generated from the *Android Publisher* API at revision *20170913*. The CLI is at version *1.0.6*. ```bash androidpublisher2 [options] diff --git a/gen/androidpublisher2-cli/mkdocs.yml b/gen/androidpublisher2-cli/mkdocs.yml index ce2a4d41c1..4b3d0d6932 100644 --- a/gen/androidpublisher2-cli/mkdocs.yml +++ b/gen/androidpublisher2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v1.0.6+20170425 +site_name: Android Publisher v1.0.6+20170913 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher2-cli site_description: A complete library to interact with Android Publisher (protocol v2) diff --git a/gen/androidpublisher2-cli/src/main.rs b/gen/androidpublisher2-cli/src/main.rs index e34ac3a65d..bfd0ad60b3 100644 --- a/gen/androidpublisher2-cli/src/main.rs +++ b/gen/androidpublisher2-cli/src/main.rs @@ -5976,7 +5976,7 @@ fn main() { let mut app = App::new("androidpublisher2") .author("Sebastian Thiel ") - .version("1.0.6+20170425") + .version("1.0.6+20170913") .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 875d680974..24db78f4cf 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidpublisher2" -version = "1.0.6+20170425" +version = "1.0.6+20170913" 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" homepage = "https://developers.google.com/android-publisher" -documentation = "https://docs.rs/google-androidpublisher2/1.0.6+20170425" +documentation = "https://docs.rs/google-androidpublisher2/1.0.6+20170913" license = "MIT" keywords = ["androidpublisher", "google", "protocol", "web", "api"] diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index 432285521c..777720680e 100644 --- a/gen/androidpublisher2/README.md +++ b/gen/androidpublisher2/README.md @@ -5,32 +5,32 @@ 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 *1.0.6+20170425*, where *20170425* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Android Publisher* crate version *1.0.6+20170913*, where *20170913* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Android Publisher* *v2* API can be found at the [official documentation site](https://developers.google.com/android-publisher). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.AndroidPublisher.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.AndroidPublisher.html) ... * edits - * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApkUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditValidateCall.html) -* [entitlements](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.Entitlement.html) - * [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EntitlementListCall.html) + * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApkUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditValidateCall.html) +* [entitlements](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.Entitlement.html) + * [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EntitlementListCall.html) * inappproducts - * [*batch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductBatchCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.InappproductUpdateCall.html) + * [*batch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductBatchCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.InappproductUpdateCall.html) * purchases - * [*products get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) -* [reviews](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.Review.html) - * [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.ReviewReplyCall.html) + * [*products get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) +* [reviews](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.Review.html) + * [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.ReviewReplyCall.html) Upload supported by ... -* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) -* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditImageUploadCall.html) -* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditExpansionfileUploadCall.html) -* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.EditApkUploadCall.html) +* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) +* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditImageUploadCall.html) +* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditExpansionfileUploadCall.html) +* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.EditApkUploadCall.html) @@ -38,17 +38,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/struct.AndroidPublisher.html)** +* **[Hub](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/struct.AndroidPublisher.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -141,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/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")`. @@ -161,29 +161,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/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](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/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](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/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](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/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](https://docs.rs/google-androidpublisher2/1.0.6+20170425/google_androidpublisher2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androidpublisher2/src/lib.rs b/gen/androidpublisher2/src/lib.rs index 68e369c4d9..f34ea684ce 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 *1.0.6+20170425*, where *20170425* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Android Publisher* crate version *1.0.6+20170913*, where *20170913* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Android Publisher* *v2* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). @@ -746,19 +746,22 @@ impl Part for MonthDay {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductPurchase { + /// The order id associated with the purchase of the inapp product. + #[serde(rename="orderId")] + pub order_id: Option, /// The consumption state of the inapp product. Possible values are: /// - Yet to be consumed /// - Consumed #[serde(rename="consumptionState")] pub consumption_state: Option, - /// A developer-specified string that contains supplemental information about an order. - #[serde(rename="developerPayload")] - pub developer_payload: Option, /// This kind represents an inappPurchase object in the androidpublisher service. pub kind: Option, /// The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="purchaseTimeMillis")] pub purchase_time_millis: Option, + /// A developer-specified string that contains supplemental information about an order. + #[serde(rename="developerPayload")] + pub developer_payload: Option, /// The purchase state of the order. Possible values are: /// - Purchased /// - Cancelled @@ -1416,6 +1419,9 @@ impl ResponseResult for EntitlementsListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SubscriptionPurchase { + /// The order id of the latest recurring order associated with the purchase of the subscription. + #[serde(rename="orderId")] + pub order_id: Option, /// This kind represents a subscriptionPurchase object in the androidpublisher service. pub kind: Option, /// ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. @@ -1429,7 +1435,8 @@ pub struct SubscriptionPurchase { pub auto_renewing: Option, /// The payment state of the subscription. Possible values are: /// - Payment pending - /// - Payment received + /// - Payment received + /// - Free trial #[serde(rename="paymentState")] pub payment_state: Option, /// ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". @@ -1440,7 +1447,8 @@ pub struct SubscriptionPurchase { pub expiry_time_millis: Option, /// The reason why a subscription was cancelled or is not auto-renewing. Possible values are: /// - User cancelled the subscription - /// - Subscription was cancelled by the system, for example because of a billing problem + /// - Subscription was cancelled by the system, for example because of a billing problem + /// - Subscription was replaced with a new subscription #[serde(rename="cancelReason")] pub cancel_reason: Option, /// Time at which the subscription was granted, in milliseconds since the Epoch. @@ -1687,6 +1695,8 @@ impl RequestValue for ApksAddExternallyHostedRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ApkBinary { + /// A sha256 hash of the APK payload, encoded as a hex string and matching the output of the sha256sum command. + pub sha256: Option, /// A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command. pub sha1: Option, } @@ -4413,7 +4423,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { @@ -4432,7 +4442,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { diff --git a/gen/appengine1-cli/Cargo.toml b/gen/appengine1-cli/Cargo.toml index 6205e73977..c0c72645bb 100644 --- a/gen/appengine1-cli/Cargo.toml +++ b/gen/appengine1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appengine1-cli" -version = "1.0.6+20170522" +version = "1.0.6+20170914" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-appengine1] path = "../appengine1" -version = "1.0.6+20170522" +version = "1.0.6+20170914" diff --git a/gen/appengine1-cli/README.md b/gen/appengine1-cli/README.md index 3d706ded47..729b7fd540 100644 --- a/gen/appengine1-cli/README.md +++ b/gen/appengine1-cli/README.md @@ -25,12 +25,23 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appengine* API at revision *20170522*. The CLI is at version *1.0.6*. +This documentation was generated from the *appengine* API at revision *20170914*. The CLI is at version *1.0.6*. ```bash appengine1 [options] apps + authorized-certificates-create (-r )... [-p ]... [-o ] + authorized-certificates-delete [-p ]... [-o ] + authorized-certificates-get [-p ]... [-o ] + authorized-certificates-list [-p ]... [-o ] + authorized-certificates-patch (-r )... [-p ]... [-o ] + authorized-domains-list [-p ]... [-o ] create (-r )... [-p ]... [-o ] + domain-mappings-create (-r )... [-p ]... [-o ] + domain-mappings-delete [-p ]... [-o ] + domain-mappings-get [-p ]... [-o ] + domain-mappings-list [-p ]... [-o ] + domain-mappings-patch (-r )... [-p ]... [-o ] get [-p ]... [-o ] locations-get [-p ]... [-o ] locations-list [-p ]... [-o ] diff --git a/gen/appengine1-cli/mkdocs.yml b/gen/appengine1-cli/mkdocs.yml index d62679c054..53acb57ecc 100644 --- a/gen/appengine1-cli/mkdocs.yml +++ b/gen/appengine1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.6+20170522 +site_name: appengine v1.0.6+20170914 site_url: http://byron.github.io/google-apis-rs/google-appengine1-cli site_description: A complete library to interact with appengine (protocol v1) @@ -9,7 +9,18 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['apps_authorized-certificates-create.md', 'Apps', 'Authorized Certificates Create'] +- ['apps_authorized-certificates-delete.md', 'Apps', 'Authorized Certificates Delete'] +- ['apps_authorized-certificates-get.md', 'Apps', 'Authorized Certificates Get'] +- ['apps_authorized-certificates-list.md', 'Apps', 'Authorized Certificates List'] +- ['apps_authorized-certificates-patch.md', 'Apps', 'Authorized Certificates Patch'] +- ['apps_authorized-domains-list.md', 'Apps', 'Authorized Domains List'] - ['apps_create.md', 'Apps', 'Create'] +- ['apps_domain-mappings-create.md', 'Apps', 'Domain Mappings Create'] +- ['apps_domain-mappings-delete.md', 'Apps', 'Domain Mappings Delete'] +- ['apps_domain-mappings-get.md', 'Apps', 'Domain Mappings Get'] +- ['apps_domain-mappings-list.md', 'Apps', 'Domain Mappings List'] +- ['apps_domain-mappings-patch.md', 'Apps', 'Domain Mappings Patch'] - ['apps_get.md', 'Apps', 'Get'] - ['apps_locations-get.md', 'Apps', 'Locations Get'] - ['apps_locations-list.md', 'Apps', 'Locations List'] diff --git a/gen/appengine1-cli/src/main.rs b/gen/appengine1-cli/src/main.rs index 9fda567b76..d3e3ddb444 100644 --- a/gen/appengine1-cli/src/main.rs +++ b/gen/appengine1-cli/src/main.rs @@ -46,6 +46,425 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _apps_authorized_certificates_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "domain-mappings-count" => Some(("domainMappingsCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "visible-domain-mappings" => Some(("visibleDomainMappings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "expire-time" => Some(("expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "certificate-raw-data.private-key" => Some(("certificateRawData.privateKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "certificate-raw-data.public-certificate" => Some(("certificateRawData.publicCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "domain-names" => Some(("domainNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["certificate-raw-data", "display-name", "domain-mappings-count", "domain-names", "expire-time", "id", "name", "private-key", "public-certificate", "visible-domain-mappings"]); + 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::AuthorizedCertificate = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().authorized_certificates_create(request, opt.value_of("apps-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_authorized_certificates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().authorized_certificates_delete(opt.value_of("apps-id").unwrap_or(""), opt.value_of("authorized-certificates-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_authorized_certificates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().authorized_certificates_get(opt.value_of("apps-id").unwrap_or(""), opt.value_of("authorized-certificates-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(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(["view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_authorized_certificates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().authorized_certificates_list(opt.value_of("apps-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_authorized_certificates_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "domain-mappings-count" => Some(("domainMappingsCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "visible-domain-mappings" => Some(("visibleDomainMappings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "expire-time" => Some(("expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "certificate-raw-data.private-key" => Some(("certificateRawData.privateKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "certificate-raw-data.public-certificate" => Some(("certificateRawData.publicCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "domain-names" => Some(("domainNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["certificate-raw-data", "display-name", "domain-mappings-count", "domain-names", "expire-time", "id", "name", "private-key", "public-certificate", "visible-domain-mappings"]); + 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::AuthorizedCertificate = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().authorized_certificates_patch(request, opt.value_of("apps-id").unwrap_or(""), opt.value_of("authorized-certificates-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_authorized_domains_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().authorized_domains_list(opt.value_of("apps-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _apps_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -74,17 +493,18 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feature-settings.split-health-checks" => Some(("featureSettings.splitHealthChecks", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "gcr-domain" => Some(("gcrDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "gcr-domain", "iap", "id", "location-id", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "serving-status"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "feature-settings", "gcr-domain", "iap", "id", "location-id", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "serving-status", "split-health-checks"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -144,6 +564,347 @@ impl<'n> Engine<'n> { } } + fn _apps_domain_mappings_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "ssl-settings.certificate-id" => Some(("sslSettings.certificateId", 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!["certificate-id", "id", "name", "ssl-settings"]); + 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::DomainMapping = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().domain_mappings_create(request, opt.value_of("apps-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_domain_mappings_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().domain_mappings_delete(opt.value_of("apps-id").unwrap_or(""), opt.value_of("domain-mappings-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_domain_mappings_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().domain_mappings_get(opt.value_of("apps-id").unwrap_or(""), opt.value_of("domain-mappings-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_domain_mappings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().domain_mappings_list(opt.value_of("apps-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _apps_domain_mappings_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "ssl-settings.certificate-id" => Some(("sslSettings.certificateId", 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!["certificate-id", "id", "name", "ssl-settings"]); + 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::DomainMapping = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().domain_mappings_patch(request, opt.value_of("apps-id").unwrap_or(""), opt.value_of("domain-mappings-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _apps_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.apps().get(opt.value_of("apps-id").unwrap_or("")); @@ -452,17 +1213,18 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feature-settings.split-health-checks" => Some(("featureSettings.splitHealthChecks", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "gcr-domain" => Some(("gcrDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "gcr-domain", "iap", "id", "location-id", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "serving-status"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "feature-settings", "gcr-domain", "iap", "id", "location-id", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "serving-status", "split-health-checks"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -901,6 +1663,7 @@ impl<'n> Engine<'n> { "version-url" => Some(("versionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.check-interval" => Some(("readinessCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.host" => Some(("readinessCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.app-start-timeout" => Some(("readinessCheck.appStartTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.timeout" => Some(("readinessCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.path" => Some(("readinessCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.success-threshold" => Some(("readinessCheck.successThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -910,10 +1673,7 @@ impl<'n> Engine<'n> { "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "health-check.restart-threshold" => Some(("healthCheck.restartThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "health-check.check-interval" => Some(("healthCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.unhealthy-threshold" => Some(("healthCheck.unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -963,13 +1723,17 @@ impl<'n> Engine<'n> { "liveness-check.success-threshold" => Some(("livenessCheck.successThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "liveness-check.failure-threshold" => Some(("livenessCheck.failureThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "runtime-api-version" => Some(("runtimeApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "failure-threshold", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "initial-delay", "instance-class", "instance-tag", "instances", "liveness-check", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "path", "readiness-check", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-read-bytes-per-second", "target-read-ops-per-second", "target-received-bytes-per-second", "target-received-packets-per-second", "target-request-count-per-second", "target-sent-bytes-per-second", "target-sent-packets-per-second", "target-utilization", "target-write-bytes-per-second", "target-write-ops-per-second", "threadsafe", "timeout", "unhealthy-threshold", "url", "version-url", "vm", "zip"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "app-start-timeout", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "failure-threshold", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "initial-delay", "instance-class", "instance-tag", "instances", "liveness-check", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "path", "readiness-check", "request-utilization", "resources", "restart-threshold", "runtime", "runtime-api-version", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-read-bytes-per-second", "target-read-ops-per-second", "target-received-bytes-per-second", "target-received-packets-per-second", "target-request-count-per-second", "target-sent-bytes-per-second", "target-sent-packets-per-second", "target-utilization", "target-write-bytes-per-second", "target-write-ops-per-second", "threadsafe", "timeout", "unhealthy-threshold", "url", "version-url", "vm", "zip"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1480,6 +2244,7 @@ impl<'n> Engine<'n> { "version-url" => Some(("versionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.check-interval" => Some(("readinessCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.host" => Some(("readinessCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.app-start-timeout" => Some(("readinessCheck.appStartTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.timeout" => Some(("readinessCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.path" => Some(("readinessCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "readiness-check.success-threshold" => Some(("readinessCheck.successThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1489,10 +2254,7 @@ impl<'n> Engine<'n> { "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "health-check.restart-threshold" => Some(("healthCheck.restartThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "health-check.check-interval" => Some(("healthCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.unhealthy-threshold" => Some(("healthCheck.unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1542,13 +2304,17 @@ impl<'n> Engine<'n> { "liveness-check.success-threshold" => Some(("livenessCheck.successThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "liveness-check.failure-threshold" => Some(("livenessCheck.failureThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "runtime-api-version" => Some(("runtimeApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "failure-threshold", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "initial-delay", "instance-class", "instance-tag", "instances", "liveness-check", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "path", "readiness-check", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-read-bytes-per-second", "target-read-ops-per-second", "target-received-bytes-per-second", "target-received-packets-per-second", "target-request-count-per-second", "target-sent-bytes-per-second", "target-sent-packets-per-second", "target-utilization", "target-write-bytes-per-second", "target-write-ops-per-second", "threadsafe", "timeout", "unhealthy-threshold", "url", "version-url", "vm", "zip"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "app-start-timeout", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "failure-threshold", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "initial-delay", "instance-class", "instance-tag", "instances", "liveness-check", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "path", "readiness-check", "request-utilization", "resources", "restart-threshold", "runtime", "runtime-api-version", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-read-bytes-per-second", "target-read-ops-per-second", "target-received-bytes-per-second", "target-received-packets-per-second", "target-request-count-per-second", "target-sent-bytes-per-second", "target-sent-packets-per-second", "target-utilization", "target-write-bytes-per-second", "target-write-ops-per-second", "threadsafe", "timeout", "unhealthy-threshold", "url", "version-url", "vm", "zip"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1619,9 +2385,42 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("apps", Some(opt)) => { match opt.subcommand() { + ("authorized-certificates-create", Some(opt)) => { + call_result = self._apps_authorized_certificates_create(opt, dry_run, &mut err); + }, + ("authorized-certificates-delete", Some(opt)) => { + call_result = self._apps_authorized_certificates_delete(opt, dry_run, &mut err); + }, + ("authorized-certificates-get", Some(opt)) => { + call_result = self._apps_authorized_certificates_get(opt, dry_run, &mut err); + }, + ("authorized-certificates-list", Some(opt)) => { + call_result = self._apps_authorized_certificates_list(opt, dry_run, &mut err); + }, + ("authorized-certificates-patch", Some(opt)) => { + call_result = self._apps_authorized_certificates_patch(opt, dry_run, &mut err); + }, + ("authorized-domains-list", Some(opt)) => { + call_result = self._apps_authorized_domains_list(opt, dry_run, &mut err); + }, ("create", Some(opt)) => { call_result = self._apps_create(opt, dry_run, &mut err); }, + ("domain-mappings-create", Some(opt)) => { + call_result = self._apps_domain_mappings_create(opt, dry_run, &mut err); + }, + ("domain-mappings-delete", Some(opt)) => { + call_result = self._apps_domain_mappings_delete(opt, dry_run, &mut err); + }, + ("domain-mappings-get", Some(opt)) => { + call_result = self._apps_domain_mappings_get(opt, dry_run, &mut err); + }, + ("domain-mappings-list", Some(opt)) => { + call_result = self._apps_domain_mappings_list(opt, dry_run, &mut err); + }, + ("domain-mappings-patch", Some(opt)) => { + call_result = self._apps_domain_mappings_patch(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._apps_get(opt, dry_run, &mut err); }, @@ -1774,7 +2573,169 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("apps", "methods: 'create', 'get', 'locations-get', 'locations-list', 'operations-get', 'operations-list', 'patch', 'repair', 'services-delete', 'services-get', 'services-list', 'services-patch', 'services-versions-create', 'services-versions-delete', 'services-versions-get', 'services-versions-instances-debug', 'services-versions-instances-delete', 'services-versions-instances-get', 'services-versions-instances-list', 'services-versions-list' and 'services-versions-patch'", vec![ + ("apps", "methods: 'authorized-certificates-create', 'authorized-certificates-delete', 'authorized-certificates-get', 'authorized-certificates-list', 'authorized-certificates-patch', 'authorized-domains-list', 'create', 'domain-mappings-create', 'domain-mappings-delete', 'domain-mappings-get', 'domain-mappings-list', 'domain-mappings-patch', 'get', 'locations-get', 'locations-list', 'operations-get', 'operations-list', 'patch', 'repair', 'services-delete', 'services-get', 'services-list', 'services-patch', 'services-versions-create', 'services-versions-delete', 'services-versions-get', 'services-versions-instances-debug', 'services-versions-instances-delete', 'services-versions-instances-get', 'services-versions-instances-list', 'services-versions-list' and 'services-versions-patch'", vec![ + ("authorized-certificates-create", + Some(r##"Uploads the specified SSL certificate."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_authorized-certificates-create", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the parent Application resource. Example: apps/myapp."##), + 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)), + ]), + ("authorized-certificates-delete", + Some(r##"Deletes the specified SSL certificate."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_authorized-certificates-delete", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345."##), + Some(true), + Some(false)), + + (Some(r##"authorized-certificates-id"##), + None, + Some(r##"Part of `name`. See documentation of `appsId`."##), + 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)), + ]), + ("authorized-certificates-get", + Some(r##"Gets the specified SSL certificate."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_authorized-certificates-get", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345."##), + Some(true), + Some(false)), + + (Some(r##"authorized-certificates-id"##), + None, + Some(r##"Part of `name`. See documentation of `appsId`."##), + 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)), + ]), + ("authorized-certificates-list", + Some(r##"Lists all SSL certificates the user is authorized to administer."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_authorized-certificates-list", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the parent Application resource. Example: apps/myapp."##), + 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)), + ]), + ("authorized-certificates-patch", + Some(r##"Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_authorized-certificates-patch", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345."##), + Some(true), + Some(false)), + + (Some(r##"authorized-certificates-id"##), + None, + Some(r##"Part of `name`. See documentation of `appsId`."##), + 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)), + ]), + ("authorized-domains-list", + Some(r##"Lists all domains the user is authorized to administer."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_authorized-domains-list", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the parent Application resource. Example: apps/myapp."##), + 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)), + ]), ("create", Some(r##"Creates an App Engine application for a Google Cloud Platform project. Required fields: id - The ID of the target Cloud Platform project. @@ -1793,6 +2754,146 @@ 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)), + ]), + ("domain-mappings-create", + Some(r##"Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_domain-mappings-create", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the parent Application resource. Example: apps/myapp."##), + 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)), + ]), + ("domain-mappings-delete", + Some(r##"Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_domain-mappings-delete", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com."##), + Some(true), + Some(false)), + + (Some(r##"domain-mappings-id"##), + None, + Some(r##"Part of `name`. See documentation of `appsId`."##), + 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)), + ]), + ("domain-mappings-get", + Some(r##"Gets the specified domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_domain-mappings-get", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com."##), + Some(true), + Some(false)), + + (Some(r##"domain-mappings-id"##), + None, + Some(r##"Part of `name`. See documentation of `appsId`."##), + 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)), + ]), + ("domain-mappings-list", + Some(r##"Lists the domain mappings on an application."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_domain-mappings-list", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the parent Application resource. Example: apps/myapp."##), + 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)), + ]), + ("domain-mappings-patch", + Some(r##"Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_domain-mappings-patch", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com."##), + Some(true), + Some(false)), + + (Some(r##"domain-mappings-id"##), + None, + Some(r##"Part of `name`. See documentation of `appsId`."##), + 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"##), @@ -1900,12 +3001,12 @@ fn main() { Some(false)), ]), ("operations-list", - Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations."##), + Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_operations-list", vec![ (Some(r##"apps-id"##), None, - Some(r##"Part of `name`. The name of the operation collection."##), + Some(r##"Part of `name`. The name of the operation's parent resource."##), Some(true), Some(false)), @@ -2386,7 +3487,11 @@ fn main() { serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. - automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment."##), + automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + automatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + automatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + automatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + automatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_services-versions-patch", vec![ (Some(r##"apps-id"##), @@ -2431,7 +3536,7 @@ fn main() { let mut app = App::new("appengine1") .author("Sebastian Thiel ") - .version("1.0.6+20170522") + .version("1.0.6+20170914") .about("The App Engine Admin API enables developers to provision and manage their App Engine applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appengine1_cli") .arg(Arg::with_name("url") diff --git a/gen/appengine1/Cargo.toml b/gen/appengine1/Cargo.toml index 9b0655731c..f3c76795e9 100644 --- a/gen/appengine1/Cargo.toml +++ b/gen/appengine1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1" -version = "1.0.6+20170522" +version = "1.0.6+20170914" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1" homepage = "https://cloud.google.com/appengine/docs/admin-api/" -documentation = "https://docs.rs/google-appengine1/1.0.6+20170522" +documentation = "https://docs.rs/google-appengine1/1.0.6+20170914" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1/README.md b/gen/appengine1/README.md index 610b458c19..6bc1b579af 100644 --- a/gen/appengine1/README.md +++ b/gen/appengine1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appengine1` library allows access to all features of the *Google appengine* service. -This documentation was generated from *appengine* crate version *1.0.6+20170522*, where *20170522* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *appengine* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *appengine* *v1* API can be found at the [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.AppServiceVersionPatchCall.html) + * [*authorized certificates create*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppAuthorizedCertificateCreateCall.html), [*authorized certificates delete*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppAuthorizedCertificateDeleteCall.html), [*authorized certificates get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppAuthorizedCertificateGetCall.html), [*authorized certificates list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppAuthorizedCertificateListCall.html), [*authorized certificates patch*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppAuthorizedCertificatePatchCall.html), [*authorized domains list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppAuthorizedDomainListCall.html), [*create*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppCreateCall.html), [*domain mappings create*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppDomainMappingCreateCall.html), [*domain mappings delete*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppDomainMappingDeleteCall.html), [*domain mappings get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppDomainMappingGetCall.html), [*domain mappings list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppDomainMappingListCall.html), [*domain mappings patch*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppDomainMappingPatchCall.html), [*get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.AppServiceVersionPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/struct.Appengine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -53,7 +53,10 @@ let r = hub.apps().services_versions_instances_debug(...).doit() let r = hub.apps().create(...).doit() let r = hub.apps().services_versions_instances_delete(...).doit() let r = hub.apps().services_versions_patch(...).doit() +let r = hub.apps().domain_mappings_create(...).doit() +let r = hub.apps().domain_mappings_patch(...).doit() let r = hub.apps().operations_get(...).doit() +let r = hub.apps().domain_mappings_delete(...).doit() let r = hub.apps().repair(...).doit() let r = hub.apps().services_versions_delete(...).doit() let r = hub.apps().services_patch(...).doit() @@ -132,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/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")`. @@ -152,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/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](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/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](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/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](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/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](https://docs.rs/google-appengine1/1.0.6+20170522/google_appengine1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appengine1/src/lib.rs b/gen/appengine1/src/lib.rs index 491f6d80e4..14fb90c527 100644 --- a/gen/appengine1/src/lib.rs +++ b/gen/appengine1/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 *appengine* crate version *1.0.6+20170522*, where *20170522* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *appengine* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *appengine* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Appengine.html) ... //! //! * apps -//! * [*create*](struct.AppCreateCall.html), [*get*](struct.AppGetCall.html), [*locations get*](struct.AppLocationGetCall.html), [*locations list*](struct.AppLocationListCall.html), [*operations get*](struct.AppOperationGetCall.html), [*operations list*](struct.AppOperationListCall.html), [*patch*](struct.AppPatchCall.html), [*repair*](struct.AppRepairCall.html), [*services delete*](struct.AppServiceDeleteCall.html), [*services get*](struct.AppServiceGetCall.html), [*services list*](struct.AppServiceListCall.html), [*services patch*](struct.AppServicePatchCall.html), [*services versions create*](struct.AppServiceVersionCreateCall.html), [*services versions delete*](struct.AppServiceVersionDeleteCall.html), [*services versions get*](struct.AppServiceVersionGetCall.html), [*services versions instances debug*](struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](struct.AppServiceVersionInstanceListCall.html), [*services versions list*](struct.AppServiceVersionListCall.html) and [*services versions patch*](struct.AppServiceVersionPatchCall.html) +//! * [*authorized certificates create*](struct.AppAuthorizedCertificateCreateCall.html), [*authorized certificates delete*](struct.AppAuthorizedCertificateDeleteCall.html), [*authorized certificates get*](struct.AppAuthorizedCertificateGetCall.html), [*authorized certificates list*](struct.AppAuthorizedCertificateListCall.html), [*authorized certificates patch*](struct.AppAuthorizedCertificatePatchCall.html), [*authorized domains list*](struct.AppAuthorizedDomainListCall.html), [*create*](struct.AppCreateCall.html), [*domain mappings create*](struct.AppDomainMappingCreateCall.html), [*domain mappings delete*](struct.AppDomainMappingDeleteCall.html), [*domain mappings get*](struct.AppDomainMappingGetCall.html), [*domain mappings list*](struct.AppDomainMappingListCall.html), [*domain mappings patch*](struct.AppDomainMappingPatchCall.html), [*get*](struct.AppGetCall.html), [*locations get*](struct.AppLocationGetCall.html), [*locations list*](struct.AppLocationListCall.html), [*operations get*](struct.AppOperationGetCall.html), [*operations list*](struct.AppOperationListCall.html), [*patch*](struct.AppPatchCall.html), [*repair*](struct.AppRepairCall.html), [*services delete*](struct.AppServiceDeleteCall.html), [*services get*](struct.AppServiceGetCall.html), [*services list*](struct.AppServiceListCall.html), [*services patch*](struct.AppServicePatchCall.html), [*services versions create*](struct.AppServiceVersionCreateCall.html), [*services versions delete*](struct.AppServiceVersionDeleteCall.html), [*services versions get*](struct.AppServiceVersionGetCall.html), [*services versions instances debug*](struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](struct.AppServiceVersionInstanceListCall.html), [*services versions list*](struct.AppServiceVersionListCall.html) and [*services versions patch*](struct.AppServiceVersionPatchCall.html) //! //! //! @@ -53,7 +53,10 @@ //! let r = hub.apps().create(...).doit() //! let r = hub.apps().services_versions_instances_delete(...).doit() //! let r = hub.apps().services_versions_patch(...).doit() +//! let r = hub.apps().domain_mappings_create(...).doit() +//! let r = hub.apps().domain_mappings_patch(...).doit() //! let r = hub.apps().operations_get(...).doit() +//! let r = hub.apps().domain_mappings_delete(...).doit() //! let r = hub.apps().repair(...).doit() //! let r = hub.apps().services_versions_delete(...).doit() //! let r = hub.apps().services_patch(...).doit() @@ -430,24 +433,24 @@ pub struct LivenessCheck { impl Part for LivenessCheck {} -/// Extra network settings. Only applicable for VM runtimes. +/// Extra network settings. Only applicable for App Engine flexible environment versions /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Network { - /// Tag to apply to the VM instance during creation. + /// Tag to apply to the VM instance during creation. Only applicable for for App Engine flexible environment versions. #[serde(rename="instanceTag")] pub instance_tag: Option, - /// List of ports, or port pairs, to forward from the virtual machine to the application container. + /// List of ports, or port pairs, to forward from the virtual machine to the application container. Only applicable for App Engine flexible environment versions. #[serde(rename="forwardedPorts")] pub forwarded_ports: Option>, - /// Google Cloud Platform network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default. + /// Google Compute Engine network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default. pub name: Option, /// Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network. /// If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. /// If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. - /// If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app. + /// If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the App Engine flexible environment application. #[serde(rename="subnetworkName")] pub subnetwork_name: Option, } @@ -462,8 +465,8 @@ impl Part for Network {} /// 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*). /// -/// * [services get apps](struct.AppServiceGetCall.html) (response) /// * [services patch apps](struct.AppServicePatchCall.html) (request) +/// * [services get apps](struct.AppServiceGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Service { @@ -494,159 +497,77 @@ pub struct RepairApplicationRequest { _never_set: Option } impl RequestValue for RepairApplicationRequest {} -/// An Application resource contains the top-level configuration of an App Engine application. +/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [create apps](struct.AppCreateCall.html) (request) -/// * [patch apps](struct.AppPatchCall.html) (request) -/// * [get apps](struct.AppGetCall.html) (response) +/// * [services versions instances get apps](struct.AppServiceVersionInstanceGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Application { - /// Hostname used to reach this application, as resolved by App Engine.@OutputOnly - #[serde(rename="defaultHostname")] - pub default_hostname: Option, - /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly - pub name: Option, - /// The Google Container Registry domain used for storing managed build docker images for this application. - #[serde(rename="gcrDomain")] - pub gcr_domain: Option, - /// Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly - #[serde(rename="codeBucket")] - pub code_bucket: Option, - /// Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly - #[serde(rename="defaultBucket")] - pub default_bucket: Option, - /// HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 dispatch rules can be supported.@OutputOnly - #[serde(rename="dispatchRules")] - pub dispatch_rules: Option>, - /// Cookie expiration policy for this application. - #[serde(rename="defaultCookieExpiration")] - pub default_cookie_expiration: Option, - /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. +pub struct Instance { + /// App Engine release this instance is running on.@OutputOnly + #[serde(rename="appEngineRelease")] + pub app_engine_release: Option, + /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmId")] + pub vm_id: Option, + /// Total memory in use (bytes).@OutputOnly + #[serde(rename="memoryUsage")] + pub memory_usage: Option, + /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmDebugEnabled")] + pub vm_debug_enabled: Option, + /// Time that this instance was started.@OutputOnly + #[serde(rename="startTime")] + pub start_time: Option, + /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmIp")] + pub vm_ip: Option, + /// Average queries per second (QPS) over the last minute.@OutputOnly + pub qps: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly pub id: Option, - /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US - #[serde(rename="locationId")] - pub location_id: Option, - /// Serving status of this application. - #[serde(rename="servingStatus")] - pub serving_status: Option, - /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. - #[serde(rename="authDomain")] - pub auth_domain: Option, - /// no description provided - pub iap: Option, + /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly + pub name: Option, + /// Number of errors since this instance was started.@OutputOnly + pub errors: Option, + /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmStatus")] + pub vm_status: Option, + /// Availability of the instance.@OutputOnly + pub availability: Option, + /// Average latency (ms) over the last minute.@OutputOnly + #[serde(rename="averageLatency")] + pub average_latency: Option, + /// Number of requests since this instance was started.@OutputOnly + pub requests: Option, + /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmName")] + pub vm_name: Option, + /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmZoneName")] + pub vm_zone_name: Option, } -impl RequestValue for Application {} -impl ResponseResult for Application {} +impl ResponseResult for Instance {} -/// A Version resource is a specific set of source code and configuration files that are deployed into a service. +/// A domain that a user has been authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (https://www.google.com/webmasters/verification/home). /// -/// # 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*). -/// -/// * [services versions create apps](struct.AppServiceVersionCreateCall.html) (request) -/// * [services versions get apps](struct.AppServiceVersionGetCall.html) (response) -/// * [services versions patch apps](struct.AppServiceVersionPatchCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Version { - /// Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app. - #[serde(rename="endpointsApiService")] - pub endpoints_api_service: Option, - /// Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set. - #[serde(rename="defaultExpiration")] - pub default_expiration: Option, - /// Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly +pub struct AuthorizedDomain { + /// Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly pub name: Option, - /// A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity. - #[serde(rename="basicScaling")] - pub basic_scaling: Option, - /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. - #[serde(rename="manualScaling")] - pub manual_scaling: Option, - /// Whether to deploy this version in a container on a virtual machine. - pub vm: Option, - /// Time that this version was created.@OutputOnly - #[serde(rename="createTime")] - pub create_time: Option, - /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. - #[serde(rename="inboundServices")] - pub inbound_services: Option>, - /// Instance class that is used to run this version. Valid values are: - /// AutomaticScaling: F1, F2, F4, F4_1G - /// ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. - #[serde(rename="instanceClass")] - pub instance_class: Option, - /// Metadata settings that are supplied to this version to enable beta runtime features. - #[serde(rename="betaSettings")] - pub beta_settings: Option>, - /// Email address of the user who created this version.@OutputOnly - #[serde(rename="createdBy")] - pub created_by: Option, - /// Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set. - pub deployment: Option, - /// Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. - #[serde(rename="errorHandlers")] - pub error_handlers: Option>, - /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. - #[serde(rename="nobuildFilesRegex")] - pub nobuild_files_regex: Option, - /// Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING. - #[serde(rename="servingStatus")] - pub serving_status: Option, - /// Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: "default", "latest", and any name with the prefix "ah-". + /// Fully qualified domain name of the domain authorized for use. Example: example.com. pub id: Option, - /// Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests if view=FULL is set. - #[serde(rename="readinessCheck")] - pub readiness_check: Option, - /// Whether multiple requests can be dispatched to this version at once. - pub threadsafe: Option, - /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. - #[serde(rename="apiConfig")] - pub api_config: Option, - /// Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if view=FULL is set. - #[serde(rename="livenessCheck")] - pub liveness_check: Option, - /// Extra network settings. Only applicable for VM runtimes. - pub network: Option, - /// An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set. - pub handlers: Option>, - /// Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set. - #[serde(rename="healthCheck")] - pub health_check: Option, - /// Serving URL for this version. Example: "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly - #[serde(rename="versionUrl")] - pub version_url: Option, - /// Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set. - pub libraries: Option>, - /// App Engine execution environment for this version.Defaults to standard. - pub env: Option, - /// Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly - #[serde(rename="diskUsageBytes")] - pub disk_usage_bytes: Option, - /// Automatic scaling is based on request rate, response latencies, and other application metrics. - #[serde(rename="automaticScaling")] - pub automatic_scaling: Option, - /// Desired runtime. Example: python27. - pub runtime: Option, - /// Environment variables available to the application.Only returned in GET requests if view=FULL is set. - #[serde(rename="envVariables")] - pub env_variables: Option>, - /// Machine resources for this version. Only applicable for VM runtimes. - pub resources: Option, } -impl RequestValue for Version {} -impl ResponseResult for Version {} +impl Part for AuthorizedDomain {} /// The response message for Locations.ListLocations. @@ -773,7 +694,7 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. pub details: Option>>, } @@ -808,14 +729,14 @@ pub struct StaticFilesHandler { pub mime_type: Option, /// Time a static file served by this handler should be cached by web proxies and browsers. pub expiration: Option, - /// Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern. - pub path: Option, - /// Regular expression that matches the file paths for all files that should be referenced by this handler. - #[serde(rename="uploadPathRegex")] - pub upload_path_regex: Option, /// Whether this handler should match the request if the file referenced by the handler does not exist. #[serde(rename="requireMatchingFile")] pub require_matching_file: Option, + /// Regular expression that matches the file paths for all files that should be referenced by this handler. + #[serde(rename="uploadPathRegex")] + pub upload_path_regex: Option, + /// Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern. + pub path: Option, /// HTTP headers to use for all responses from these URLs. #[serde(rename="httpHeaders")] pub http_headers: Option>, @@ -890,6 +811,89 @@ pub struct Volume { impl Part for Volume {} +/// A domain serving an App Engine application. +/// +/// # 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*). +/// +/// * [domain mappings create apps](struct.AppDomainMappingCreateCall.html) (request) +/// * [domain mappings patch apps](struct.AppDomainMappingPatchCall.html) (request) +/// * [domain mappings get apps](struct.AppDomainMappingGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DomainMapping { + /// SSL configuration for this domain. If unconfigured, this domain will not serve with SSL. + #[serde(rename="sslSettings")] + pub ssl_settings: Option, + /// Relative name of the domain serving the application. Example: example.com. + pub id: Option, + /// The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the application via this domain mapping.@OutputOnly + #[serde(rename="resourceRecords")] + pub resource_records: Option>, + /// Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly + pub name: Option, +} + +impl RequestValue for DomainMapping {} +impl ResponseResult for DomainMapping {} + + +/// Response message for AuthorizedCertificates.ListAuthorizedCertificates. +/// +/// # 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*). +/// +/// * [authorized certificates list apps](struct.AppAuthorizedCertificateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAuthorizedCertificatesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The SSL certificates the user is authorized to administer. + pub certificates: Option>, +} + +impl ResponseResult for ListAuthorizedCertificatesResponse {} + + +/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// The JSON representation for Empty is empty JSON object {}. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [authorized certificates delete apps](struct.AppAuthorizedCertificateDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The feature specific settings to be used in the application. These define behaviors that are user configurable. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FeatureSettings { + /// Boolean value indicating if split health checks should be used instead of the legacy health checks. At an app.yaml level, this means defaulting to 'readiness_check' and 'liveness_check' values instead of 'health_check' ones. Once the legacy 'health_check' behavior is deprecated, and this value is always true, this setting can be removed. + #[serde(rename="splitHealthChecks")] + pub split_health_checks: Option, +} + +impl Part for FeatureSettings {} + + /// Code and application artifacts used to deploy a version to App Engine. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -934,6 +938,57 @@ pub struct ContainerInfo { impl Part for ContainerInfo {} +/// Response message for DomainMappings.ListDomainMappings. +/// +/// # 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*). +/// +/// * [domain mappings list apps](struct.AppDomainMappingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDomainMappingsResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The domain mappings for the application. + #[serde(rename="domainMappings")] + pub domain_mappings: Option>, +} + +impl ResponseResult for ListDomainMappingsResponse {} + + +/// Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadinessCheck { + /// Host header to send when performing a HTTP Readiness check. Example: "myapp.appspot.com" + pub host: Option, + /// A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to serve traffic. + #[serde(rename="appStartTimeout")] + pub app_start_timeout: Option, + /// Time before the check is considered failed. + pub timeout: Option, + /// Interval between health checks. + #[serde(rename="checkInterval")] + pub check_interval: Option, + /// The request path. + pub path: Option, + /// Number of consecutive successful checks required before receiving traffic. + #[serde(rename="successThreshold")] + pub success_threshold: Option, + /// Number of consecutive failed checks required before removing traffic. + #[serde(rename="failureThreshold")] + pub failure_threshold: Option, +} + +impl Part for ReadinessCheck {} + + /// Uses Google Cloud Endpoints to handle requests. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -948,6 +1003,112 @@ pub struct ApiEndpointHandler { impl Part for ApiEndpointHandler {} +/// A Version resource is a specific set of source code and configuration files that are deployed into a service. +/// +/// # 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*). +/// +/// * [services versions get apps](struct.AppServiceVersionGetCall.html) (response) +/// * [services versions create apps](struct.AppServiceVersionCreateCall.html) (request) +/// * [services versions patch apps](struct.AppServiceVersionPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Version { + /// Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app. + #[serde(rename="endpointsApiService")] + pub endpoints_api_service: Option, + /// Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set. + #[serde(rename="defaultExpiration")] + pub default_expiration: Option, + /// A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity. + #[serde(rename="basicScaling")] + pub basic_scaling: Option, + /// Whether to deploy this version in a container on a virtual machine. + pub vm: Option, + /// Instance class that is used to run this version. Valid values are: + /// AutomaticScaling: F1, F2, F4, F4_1G + /// ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. + #[serde(rename="instanceClass")] + pub instance_class: Option, + /// Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. + #[serde(rename="errorHandlers")] + pub error_handlers: Option>, + /// Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: "default", "latest", and any name with the prefix "ah-". + pub id: Option, + /// Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests if view=FULL is set. + #[serde(rename="readinessCheck")] + pub readiness_check: Option, + /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. + #[serde(rename="apiConfig")] + pub api_config: Option, + /// Whether multiple requests can be dispatched to this version at once. + pub threadsafe: Option, + /// Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set. + #[serde(rename="healthCheck")] + pub health_check: Option, + /// Serving URL for this version. Example: "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly + #[serde(rename="versionUrl")] + pub version_url: Option, + /// Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set. + pub libraries: Option>, + /// App Engine execution environment for this version.Defaults to standard. + pub env: Option, + /// Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly + #[serde(rename="diskUsageBytes")] + pub disk_usage_bytes: Option, + /// Automatic scaling is based on request rate, response latencies, and other application metrics. + #[serde(rename="automaticScaling")] + pub automatic_scaling: Option, + /// Environment variables available to the application.Only returned in GET requests if view=FULL is set. + #[serde(rename="envVariables")] + pub env_variables: Option>, + /// Machine resources for this version. Only applicable for VM runtimes. + pub resources: Option, + /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. + #[serde(rename="manualScaling")] + pub manual_scaling: Option, + /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. + #[serde(rename="inboundServices")] + pub inbound_services: Option>, + /// Metadata settings that are supplied to this version to enable beta runtime features. + #[serde(rename="betaSettings")] + pub beta_settings: Option>, + /// Email address of the user who created this version.@OutputOnly + #[serde(rename="createdBy")] + pub created_by: Option, + /// Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set. + pub deployment: Option, + /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. + #[serde(rename="nobuildFilesRegex")] + pub nobuild_files_regex: Option, + /// Time that this version was created.@OutputOnly + #[serde(rename="createTime")] + pub create_time: Option, + /// Extra network settings. Only applicable for App Engine flexible environment versions. + pub network: Option, + /// The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard//config/appref + #[serde(rename="runtimeApiVersion")] + pub runtime_api_version: Option, + /// Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if view=FULL is set. + #[serde(rename="livenessCheck")] + pub liveness_check: Option, + /// Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly + pub name: Option, + /// An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set. + pub handlers: Option>, + /// Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING. + #[serde(rename="servingStatus")] + pub serving_status: Option, + /// Desired runtime. Example: python27. + pub runtime: Option, +} + +impl RequestValue for Version {} +impl ResponseResult for Version {} + + /// Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -978,6 +1139,57 @@ pub struct HealthCheck { impl Part for HealthCheck {} +/// SSL configuration for a DomainMapping resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslSettings { + /// ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support. Example: 12345. + #[serde(rename="certificateId")] + pub certificate_id: Option, +} + +impl Part for SslSettings {} + + +/// An SSL certificate obtained from a certificate authority. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CertificateRawData { + /// Unencrypted PEM encoded RSA private key. This field is set once on certificate creation and then encrypted. The key size must be 2048 bits or fewer. Must include the header and footer. Example:
 -----BEGIN RSA PRIVATE KEY-----  -----END RSA PRIVATE KEY----- 
@InputOnly + #[serde(rename="privateKey")] + pub private_key: Option, + /// PEM encoded x.509 public key certificate. This field is set once on certificate creation. Must include the header and footer. Example:
 -----BEGIN CERTIFICATE-----  -----END CERTIFICATE----- 
+ #[serde(rename="publicCertificate")] + pub public_certificate: Option, +} + +impl Part for CertificateRawData {} + + +/// Custom static error page to be served when an error occurs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ErrorHandler { + /// MIME type of file. Defaults to text/html. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// Error condition this handler applies to. + #[serde(rename="errorCode")] + pub error_code: Option, + /// Static file content to be served for this error. + #[serde(rename="staticFile")] + pub static_file: Option, +} + +impl Part for ErrorHandler {} + + /// Identity-Aware Proxy /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1000,26 +1212,6 @@ pub struct IdentityAwareProxy { impl Part for IdentityAwareProxy {} -/// Custom static error page to be served when an error occurs. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ErrorHandler { - /// Error condition this handler applies to. - #[serde(rename="errorCode")] - pub error_code: Option, - /// MIME type of file. Defaults to text/html. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// Static file content to be served for this error. - #[serde(rename="staticFile")] - pub static_file: Option, -} - -impl Part for ErrorHandler {} - - /// Automatic scaling is based on request rate, response latencies, and other application metrics. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1090,11 +1282,11 @@ pub struct UrlMap { /// Uses API Endpoints to handle requests. #[serde(rename="apiEndpoint")] pub api_endpoint: Option, - /// Level of login required to access this resource. - pub login: Option, /// 30x code to use when performing redirects for the secure field. Defaults to 302. #[serde(rename="redirectHttpResponseCode")] pub redirect_http_response_code: Option, + /// Level of login required to access this resource. + pub login: Option, } impl Part for UrlMap {} @@ -1120,6 +1312,47 @@ pub struct FileInfo { impl Part for FileInfo {} +/// An SSL certificate that a user has been authorized to administer. A user is authorized to administer any certificate that applies to one of their authorized domains. +/// +/// # 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*). +/// +/// * [authorized certificates get apps](struct.AppAuthorizedCertificateGetCall.html) (response) +/// * [authorized certificates patch apps](struct.AppAuthorizedCertificatePatchCall.html) (request|response) +/// * [authorized certificates create apps](struct.AppAuthorizedCertificateCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthorizedCertificate { + /// The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate. + #[serde(rename="displayName")] + pub display_name: Option, + /// Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly + pub name: Option, + /// Aggregate count of the domain mappings with this certificate mapped. This count includes domain mappings on applications for which the user does not have VIEWER permissions.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + #[serde(rename="domainMappingsCount")] + pub domain_mappings_count: Option, + /// The full paths to user visible Domain Mapping resources that have this certificate mapped. Example: apps/myapp/domainMappings/example.com.This may not represent the full list of mapped domain mappings if the user does not have VIEWER permissions on all of the applications that have this certificate mapped. See domain_mappings_count for a complete count.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + #[serde(rename="visibleDomainMappings")] + pub visible_domain_mappings: Option>, + /// The time when this certificate expires. To update the renewal time on this certificate, upload an SSL certificate with a different expiration time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly + #[serde(rename="expireTime")] + pub expire_time: Option, + /// The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority. + #[serde(rename="certificateRawData")] + pub certificate_raw_data: Option, + /// Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 12345.@OutputOnly + pub id: Option, + /// Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly + #[serde(rename="domainNames")] + pub domain_names: Option>, +} + +impl RequestValue for AuthorizedCertificate {} +impl ResponseResult for AuthorizedCertificate {} + + /// The zip file information for a zip deployment. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1174,62 +1407,80 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. +/// Response message for AuthorizedDomains.ListAuthorizedDomains. /// /// # 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*). /// -/// * [services versions instances get apps](struct.AppServiceVersionInstanceGetCall.html) (response) +/// * [authorized domains list apps](struct.AppAuthorizedDomainListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Instance { - /// App Engine release this instance is running on.@OutputOnly - #[serde(rename="appEngineRelease")] - pub app_engine_release: Option, - /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmId")] - pub vm_id: Option, - /// Total memory in use (bytes).@OutputOnly - #[serde(rename="memoryUsage")] - pub memory_usage: Option, - /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmDebugEnabled")] - pub vm_debug_enabled: Option, - /// Time that this instance was started.@OutputOnly - #[serde(rename="startTime")] - pub start_time: Option, - /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmIp")] - pub vm_ip: Option, - /// Average queries per second (QPS) over the last minute.@OutputOnly - pub qps: Option, - /// Relative name of the instance within the version. Example: instance-1.@OutputOnly - pub id: Option, - /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly - pub name: Option, - /// Number of errors since this instance was started.@OutputOnly - pub errors: Option, - /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmStatus")] - pub vm_status: Option, - /// Availability of the instance.@OutputOnly - pub availability: Option, - /// Average latency (ms) over the last minute.@OutputOnly - #[serde(rename="averageLatency")] - pub average_latency: Option, - /// Number of requests since this instance was started.@OutputOnly - pub requests: Option, - /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmName")] - pub vm_name: Option, - /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmZoneName")] - pub vm_zone_name: Option, +pub struct ListAuthorizedDomainsResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The authorized domains belonging to the user. + pub domains: Option>, } -impl ResponseResult for Instance {} +impl ResponseResult for ListAuthorizedDomainsResponse {} + + +/// An Application resource contains the top-level configuration of an App Engine application. Next tag: 20 +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create apps](struct.AppCreateCall.html) (request) +/// * [get apps](struct.AppGetCall.html) (response) +/// * [patch apps](struct.AppPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Application { + /// Hostname used to reach this application, as resolved by App Engine.@OutputOnly + #[serde(rename="defaultHostname")] + pub default_hostname: Option, + /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly + pub name: Option, + /// The Google Container Registry domain used for storing managed build docker images for this application. + #[serde(rename="gcrDomain")] + pub gcr_domain: Option, + /// Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly + #[serde(rename="codeBucket")] + pub code_bucket: Option, + /// Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly + #[serde(rename="defaultBucket")] + pub default_bucket: Option, + /// HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 dispatch rules can be supported.@OutputOnly + #[serde(rename="dispatchRules")] + pub dispatch_rules: Option>, + /// Cookie expiration policy for this application. + #[serde(rename="defaultCookieExpiration")] + pub default_cookie_expiration: Option, + /// no description provided + pub iap: Option, + /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US + #[serde(rename="locationId")] + pub location_id: Option, + /// The feature specific settings to be used in the application. + #[serde(rename="featureSettings")] + pub feature_settings: Option, + /// Serving status of this application. + #[serde(rename="servingStatus")] + pub serving_status: Option, + /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. + #[serde(rename="authDomain")] + pub auth_domain: Option, + /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. + pub id: Option, +} + +impl RequestValue for Application {} +impl ResponseResult for Application {} /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. @@ -1245,20 +1496,21 @@ pub struct ManualScaling { impl Part for ManualScaling {} -/// Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions. +/// Rules to match an HTTP request and dispatch that request to a service. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TrafficSplit { - /// Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed. - #[serde(rename="shardBy")] - pub shard_by: Option, - /// Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits. - pub allocations: Option>, +pub struct UrlDispatchRule { + /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path.The sum of the lengths of the domain and path may not exceed 100 characters. + pub path: Option, + /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". + pub domain: Option, + /// Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default. + pub service: Option, } -impl Part for TrafficSplit {} +impl Part for UrlDispatchRule {} /// Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers. @@ -1339,32 +1591,6 @@ pub struct RequestUtilization { impl Part for RequestUtilization {} -/// Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReadinessCheck { - /// Host header to send when performing a HTTP Readiness check. Example: "myapp.appspot.com" - pub host: Option, - /// Time before the check is considered failed. - pub timeout: Option, - /// Interval between health checks. - #[serde(rename="checkInterval")] - pub check_interval: Option, - /// The request path. - pub path: Option, - /// Number of consecutive successful checks required before receiving traffic. - #[serde(rename="successThreshold")] - pub success_threshold: Option, - /// Number of consecutive failed checks required before removing traffic. - #[serde(rename="failureThreshold")] - pub failure_threshold: Option, -} - -impl Part for ReadinessCheck {} - - /// Response message for Services.ListServices. /// /// # Activities @@ -1376,31 +1602,30 @@ impl Part for ReadinessCheck {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListServicesResponse { - /// The services belonging to the requested application. - pub services: Option>, /// Continuation token for fetching the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The services belonging to the requested application. + pub services: Option>, } impl ResponseResult for ListServicesResponse {} -/// Rules to match an HTTP request and dispatch that request to a service. +/// Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlDispatchRule { - /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path.The sum of the lengths of the domain and path may not exceed 100 characters. - pub path: Option, - /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". - pub domain: Option, - /// Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default. - pub service: Option, +pub struct TrafficSplit { + /// Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed. + #[serde(rename="shardBy")] + pub shard_by: Option, + /// Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits. + pub allocations: Option>, } -impl Part for UrlDispatchRule {} +impl Part for TrafficSplit {} /// This resource represents a long-running operation that is the result of a network API call. @@ -1416,7 +1641,10 @@ impl Part for UrlDispatchRule {} /// * [create apps](struct.AppCreateCall.html) (response) /// * [services versions instances delete apps](struct.AppServiceVersionInstanceDeleteCall.html) (response) /// * [services versions patch apps](struct.AppServiceVersionPatchCall.html) (response) +/// * [domain mappings create apps](struct.AppDomainMappingCreateCall.html) (response) +/// * [domain mappings patch apps](struct.AppDomainMappingPatchCall.html) (response) /// * [operations get apps](struct.AppOperationGetCall.html) (response) +/// * [domain mappings delete apps](struct.AppDomainMappingDeleteCall.html) (response) /// * [repair apps](struct.AppRepairCall.html) (response) /// * [services versions delete apps](struct.AppServiceVersionDeleteCall.html) (response) /// * [services patch apps](struct.AppServicePatchCall.html) (response) @@ -1439,6 +1667,24 @@ pub struct Operation { impl ResponseResult for Operation {} +/// A DNS resource record. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceRecord { + /// Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). + pub rrdata: Option, + /// Resource record type. Example: AAAA. + #[serde(rename="type")] + pub type_: Option, + /// Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'. + pub name: Option, +} + +impl Part for ResourceRecord {} + + // ################### // MethodBuilders ### @@ -1468,7 +1714,7 @@ impl ResponseResult for Operation {} /// ::default(), None); /// let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `create(...)`, `get(...)`, `locations_get(...)`, `locations_list(...)`, `operations_get(...)`, `operations_list(...)`, `patch(...)`, `repair(...)`, `services_delete(...)`, `services_get(...)`, `services_list(...)`, `services_patch(...)`, `services_versions_create(...)`, `services_versions_delete(...)`, `services_versions_get(...)`, `services_versions_instances_debug(...)`, `services_versions_instances_delete(...)`, `services_versions_instances_get(...)`, `services_versions_instances_list(...)`, `services_versions_list(...)` and `services_versions_patch(...)` +/// // like `authorized_certificates_create(...)`, `authorized_certificates_delete(...)`, `authorized_certificates_get(...)`, `authorized_certificates_list(...)`, `authorized_certificates_patch(...)`, `authorized_domains_list(...)`, `create(...)`, `domain_mappings_create(...)`, `domain_mappings_delete(...)`, `domain_mappings_get(...)`, `domain_mappings_list(...)`, `domain_mappings_patch(...)`, `get(...)`, `locations_get(...)`, `locations_list(...)`, `operations_get(...)`, `operations_list(...)`, `patch(...)`, `repair(...)`, `services_delete(...)`, `services_get(...)`, `services_list(...)`, `services_patch(...)`, `services_versions_create(...)`, `services_versions_delete(...)`, `services_versions_get(...)`, `services_versions_instances_debug(...)`, `services_versions_instances_delete(...)`, `services_versions_instances_get(...)`, `services_versions_instances_list(...)`, `services_versions_list(...)` and `services_versions_patch(...)` /// // to build up your call. /// let rb = hub.apps(); /// # } @@ -1506,6 +1752,205 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets instance information. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + /// * `servicesId` - Part of `name`. See documentation of `appsId`. + /// * `versionsId` - Part of `name`. See documentation of `appsId`. + /// * `instancesId` - Part of `name`. See documentation of `appsId`. + pub fn services_versions_instances_get(&self, apps_id: &str, services_id: &str, versions_id: &str, instances_id: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { + AppServiceVersionInstanceGetCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _services_id: services_id.to_string(), + _versions_id: versions_id.to_string(), + _instances_id: instances_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 specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + /// * `authorizedCertificatesId` - Part of `name`. See documentation of `appsId`. + pub fn authorized_certificates_patch(&self, request: AuthorizedCertificate, apps_id: &str, authorized_certificates_id: &str) -> AppAuthorizedCertificatePatchCall<'a, C, A> { + AppAuthorizedCertificatePatchCall { + hub: self.hub, + _request: request, + _apps_id: apps_id.to_string(), + _authorized_certificates_id: authorized_certificates_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the domain mappings on an application. + /// + /// # Arguments + /// + /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + pub fn domain_mappings_list(&self, apps_id: &str) -> AppDomainMappingListCall<'a, C, A> { + AppDomainMappingListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a location. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Resource name for the location. + /// * `locationsId` - Part of `name`. See documentation of `appsId`. + pub fn locations_get(&self, apps_id: &str, locations_id: &str) -> AppLocationGetCall<'a, C, A> { + AppLocationGetCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _locations_id: locations_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all domains the user is authorized to administer. + /// + /// # Arguments + /// + /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + pub fn authorized_domains_list(&self, apps_id: &str) -> AppAuthorizedDomainListCall<'a, C, A> { + AppAuthorizedDomainListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. The name of the operation's parent resource. + pub fn operations_list(&self, apps_id: &str) -> AppOperationListCall<'a, C, A> { + AppOperationListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about an application. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the Application resource to get. Example: apps/myapp. + pub fn get(&self, apps_id: &str) -> AppGetCall<'a, C, A> { + AppGetCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified domain mapping. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + /// * `domainMappingsId` - Part of `name`. See documentation of `appsId`. + pub fn domain_mappings_get(&self, apps_id: &str, domain_mappings_id: &str) -> AppDomainMappingGetCall<'a, C, A> { + AppDomainMappingGetCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _domain_mappings_id: domain_mappings_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + /// * `servicesId` - Part of `name`. See documentation of `appsId`. + /// * `versionsId` - Part of `name`. See documentation of `appsId`. + pub fn services_versions_get(&self, apps_id: &str, services_id: &str, versions_id: &str) -> AppServiceVersionGetCall<'a, C, A> { + AppServiceVersionGetCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _services_id: services_id.to_string(), + _versions_id: versions_id.to_string(), + _view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the services in the application. + /// + /// # Arguments + /// + /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + pub fn services_list(&self, apps_id: &str) -> AppServiceListCall<'a, C, A> { + AppServiceListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deploys code and resource files to a new version. @@ -1527,6 +1972,125 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates the specified Application resource. You can update the following fields: + /// auth_domain - Google authentication domain for controlling user access to the application. + /// default_cookie_expiration - Cookie expiration policy for the application. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `name`. Name of the Application resource to update. Example: apps/myapp. + pub fn patch(&self, request: Application, apps_id: &str) -> AppPatchCall<'a, C, A> { + AppPatchCall { + hub: self.hub, + _request: request, + _apps_id: apps_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all SSL certificates the user is authorized to administer. + /// + /// # Arguments + /// + /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + pub fn authorized_certificates_list(&self, apps_id: &str) -> AppAuthorizedCertificateListCall<'a, C, A> { + AppAuthorizedCertificateListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _view: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Stops a running instance. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + /// * `servicesId` - Part of `name`. See documentation of `appsId`. + /// * `versionsId` - Part of `name`. See documentation of `appsId`. + /// * `instancesId` - Part of `name`. See documentation of `appsId`. + pub fn services_versions_instances_delete(&self, apps_id: &str, services_id: &str, versions_id: &str, instances_id: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + AppServiceVersionInstanceDeleteCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _services_id: services_id.to_string(), + _versions_id: versions_id.to_string(), + _instances_id: instances_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 specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + /// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. + /// instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. + /// automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + /// automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + /// automatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + /// automatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + /// automatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + /// automatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + /// * `servicesId` - Part of `name`. See documentation of `appsId`. + /// * `versionsId` - Part of `name`. See documentation of `appsId`. + pub fn services_versions_patch(&self, request: Version, apps_id: &str, services_id: &str, versions_id: &str) -> AppServiceVersionPatchCall<'a, C, A> { + AppServiceVersionPatchCall { + hub: self.hub, + _request: request, + _apps_id: apps_id.to_string(), + _services_id: services_id.to_string(), + _versions_id: versions_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the versions of a service. + /// + /// # Arguments + /// + /// * `appsId` - Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. + /// * `servicesId` - Part of `parent`. See documentation of `appsId`. + pub fn services_versions_list(&self, apps_id: &str, services_id: &str) -> AppServiceVersionListCall<'a, C, A> { + AppServiceVersionListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _services_id: services_id.to_string(), + _view: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. @@ -1546,6 +2110,46 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes an existing Version resource. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + /// * `servicesId` - Part of `name`. See documentation of `appsId`. + /// * `versionsId` - Part of `name`. See documentation of `appsId`. + pub fn services_versions_delete(&self, apps_id: &str, services_id: &str, versions_id: &str) -> AppServiceVersionDeleteCall<'a, C, A> { + AppServiceVersionDeleteCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _services_id: services_id.to_string(), + _versions_id: versions_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Uploads the specified SSL certificate. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + pub fn authorized_certificates_create(&self, request: AuthorizedCertificate, apps_id: &str) -> AppAuthorizedCertificateCreateCall<'a, C, A> { + AppAuthorizedCertificateCreateCall { + hub: self.hub, + _request: request, + _apps_id: apps_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment. @@ -1592,20 +2196,36 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Application resource. You can update the following fields: - /// auth_domain - Google authentication domain for controlling user access to the application. - /// default_cookie_expiration - Cookie expiration policy for the application. + /// Deletes the specified SSL certificate. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + /// * `authorizedCertificatesId` - Part of `name`. See documentation of `appsId`. + pub fn authorized_certificates_delete(&self, apps_id: &str, authorized_certificates_id: &str) -> AppAuthorizedCertificateDeleteCall<'a, C, A> { + AppAuthorizedCertificateDeleteCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _authorized_certificates_id: authorized_certificates_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. /// /// # Arguments /// /// * `request` - No description provided. - /// * `appsId` - Part of `name`. Name of the Application resource to update. Example: apps/myapp. - pub fn patch(&self, request: Application, apps_id: &str) -> AppPatchCall<'a, C, A> { - AppPatchCall { + /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + pub fn domain_mappings_create(&self, request: DomainMapping, apps_id: &str) -> AppDomainMappingCreateCall<'a, C, A> { + AppDomainMappingCreateCall { hub: self.hub, _request: request, _apps_id: apps_id.to_string(), - _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1614,48 +2234,19 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Stops a running instance. - /// - /// # Arguments - /// - /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - /// * `servicesId` - Part of `name`. See documentation of `appsId`. - /// * `versionsId` - Part of `name`. See documentation of `appsId`. - /// * `instancesId` - Part of `name`. See documentation of `appsId`. - pub fn services_versions_instances_delete(&self, apps_id: &str, services_id: &str, versions_id: &str, instances_id: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { - AppServiceVersionInstanceDeleteCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _services_id: services_id.to_string(), - _versions_id: versions_id.to_string(), - _instances_id: instances_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 specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: - /// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. - /// instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. - /// automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. - /// automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + /// Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. /// /// # Arguments /// /// * `request` - No description provided. - /// * `appsId` - Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. - /// * `servicesId` - Part of `name`. See documentation of `appsId`. - /// * `versionsId` - Part of `name`. See documentation of `appsId`. - pub fn services_versions_patch(&self, request: Version, apps_id: &str, services_id: &str, versions_id: &str) -> AppServiceVersionPatchCall<'a, C, A> { - AppServiceVersionPatchCall { + /// * `appsId` - Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + /// * `domainMappingsId` - Part of `name`. See documentation of `appsId`. + pub fn domain_mappings_patch(&self, request: DomainMapping, apps_id: &str, domain_mappings_id: &str) -> AppDomainMappingPatchCall<'a, C, A> { + AppDomainMappingPatchCall { hub: self.hub, _request: request, _apps_id: apps_id.to_string(), - _services_id: services_id.to_string(), - _versions_id: versions_id.to_string(), + _domain_mappings_id: domain_mappings_id.to_string(), _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1663,28 +2254,6 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists the versions of a service. - /// - /// # Arguments - /// - /// * `appsId` - Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. - /// * `servicesId` - Part of `parent`. See documentation of `appsId`. - pub fn services_versions_list(&self, apps_id: &str, services_id: &str) -> AppServiceVersionListCall<'a, C, A> { - AppServiceVersionListCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _services_id: services_id.to_string(), - _view: Default::default(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. @@ -1704,25 +2273,6 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists all the services in the application. - /// - /// # Arguments - /// - /// * `appsId` - Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - pub fn services_list(&self, apps_id: &str) -> AppServiceListCall<'a, C, A> { - AppServiceListCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists information about the supported locations for this service. @@ -1745,81 +2295,17 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets instance information. + /// Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. /// /// # Arguments /// - /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - /// * `servicesId` - Part of `name`. See documentation of `appsId`. - /// * `versionsId` - Part of `name`. See documentation of `appsId`. - /// * `instancesId` - Part of `name`. See documentation of `appsId`. - pub fn services_versions_instances_get(&self, apps_id: &str, services_id: &str, versions_id: &str, instances_id: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { - AppServiceVersionInstanceGetCall { + /// * `appsId` - Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + /// * `domainMappingsId` - Part of `name`. See documentation of `appsId`. + pub fn domain_mappings_delete(&self, apps_id: &str, domain_mappings_id: &str) -> AppDomainMappingDeleteCall<'a, C, A> { + AppDomainMappingDeleteCall { hub: self.hub, _apps_id: apps_id.to_string(), - _services_id: services_id.to_string(), - _versions_id: versions_id.to_string(), - _instances_id: instances_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations. - /// - /// # Arguments - /// - /// * `appsId` - Part of `name`. The name of the operation collection. - pub fn operations_list(&self, apps_id: &str) -> AppOperationListCall<'a, C, A> { - AppOperationListCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes an existing Version resource. - /// - /// # Arguments - /// - /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - /// * `servicesId` - Part of `name`. See documentation of `appsId`. - /// * `versionsId` - Part of `name`. See documentation of `appsId`. - pub fn services_versions_delete(&self, apps_id: &str, services_id: &str, versions_id: &str) -> AppServiceVersionDeleteCall<'a, C, A> { - AppServiceVersionDeleteCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _services_id: services_id.to_string(), - _versions_id: versions_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Get information about a location. - /// - /// # Arguments - /// - /// * `appsId` - Part of `name`. Resource name for the location. - /// * `locationsId` - Part of `name`. See documentation of `appsId`. - pub fn locations_get(&self, apps_id: &str, locations_id: &str) -> AppLocationGetCall<'a, C, A> { - AppLocationGetCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _locations_id: locations_id.to_string(), + _domain_mappings_id: domain_mappings_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1849,23 +2335,6 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets information about an application. - /// - /// # Arguments - /// - /// * `appsId` - Part of `name`. Name of the Application resource to get. Example: apps/myapp. - pub fn get(&self, apps_id: &str) -> AppGetCall<'a, C, A> { - AppGetCall { - hub: self.hub, - _apps_id: apps_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the specified service and all enclosed versions. @@ -1906,19 +2375,17 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. + /// Gets the specified SSL certificate. /// /// # Arguments /// - /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - /// * `servicesId` - Part of `name`. See documentation of `appsId`. - /// * `versionsId` - Part of `name`. See documentation of `appsId`. - pub fn services_versions_get(&self, apps_id: &str, services_id: &str, versions_id: &str) -> AppServiceVersionGetCall<'a, C, A> { - AppServiceVersionGetCall { + /// * `appsId` - Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + /// * `authorizedCertificatesId` - Part of `name`. See documentation of `appsId`. + pub fn authorized_certificates_get(&self, apps_id: &str, authorized_certificates_id: &str) -> AppAuthorizedCertificateGetCall<'a, C, A> { + AppAuthorizedCertificateGetCall { hub: self.hub, _apps_id: apps_id.to_string(), - _services_id: services_id.to_string(), - _versions_id: versions_id.to_string(), + _authorized_certificates_id: authorized_certificates_id.to_string(), _view: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2192,12 +2659,12 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceListCall<'a, C, A> @@ -2232,6 +2699,2755 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_instances_get("appsId", "servicesId", "versionsId", "instancesId") +/// .doit(); +/// # } +/// ``` +pub struct AppServiceVersionInstanceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _services_id: String, + _versions_id: String, + _instances_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceVersionInstanceGetCall<'a, C, A> {} + +impl<'a, C, A> AppServiceVersionInstanceGetCall<'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, Instance)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.versions.instances.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("servicesId", self._services_id.to_string())); + params.push(("versionsId", self._versions_id.to_string())); + params.push(("instancesId", self._instances_id.to_string())); + for &field in ["alt", "appsId", "servicesId", "versionsId", "instancesId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId"), ("{instancesId}", "instancesId")].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 ["instancesId", "versionsId", "servicesId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { + self._services_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { + self._versions_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *instances 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 instances_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { + self._instances_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) -> AppServiceVersionInstanceGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceVersionInstanceGetCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceVersionInstanceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. +/// +/// A builder for the *authorizedCertificates.patch* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// use appengine1::AuthorizedCertificate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AuthorizedCertificate::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.apps().authorized_certificates_patch(req, "appsId", "authorizedCertificatesId") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct AppAuthorizedCertificatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: AuthorizedCertificate, + _apps_id: String, + _authorized_certificates_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppAuthorizedCertificatePatchCall<'a, C, A> {} + +impl<'a, C, A> AppAuthorizedCertificatePatchCall<'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, AuthorizedCertificate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.authorizedCertificates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("authorizedCertificatesId", self._authorized_certificates_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "appsId", "authorizedCertificatesId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{authorizedCertificatesId}", "authorizedCertificatesId")].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 ["authorizedCertificatesId", "appsId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AuthorizedCertificate) -> AppAuthorizedCertificatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppAuthorizedCertificatePatchCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *authorized certificates 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 authorized_certificates_id(mut self, new_value: &str) -> AppAuthorizedCertificatePatchCall<'a, C, A> { + self._authorized_certificates_id = new_value.to_string(); + self + } + /// Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> AppAuthorizedCertificatePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppAuthorizedCertificatePatchCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppAuthorizedCertificatePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppAuthorizedCertificatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the domain mappings on an application. +/// +/// A builder for the *domainMappings.list* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().domain_mappings_list("appsId") +/// .page_token("diam") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct AppDomainMappingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppDomainMappingListCall<'a, C, A> {} + +impl<'a, C, A> AppDomainMappingListCall<'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, ListDomainMappingsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.domainMappings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "appsId", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/domainMappings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppDomainMappingListCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AppDomainMappingListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AppDomainMappingListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppDomainMappingListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppDomainMappingListCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppDomainMappingListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a location. +/// +/// A builder for the *locations.get* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().locations_get("appsId", "locationsId") +/// .doit(); +/// # } +/// ``` +pub struct AppLocationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _locations_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppLocationGetCall<'a, C, A> {} + +impl<'a, C, A> AppLocationGetCall<'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, Location)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.locations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("locationsId", self._locations_id.to_string())); + for &field in ["alt", "appsId", "locationsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/locations/{locationsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{locationsId}", "locationsId")].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 ["locationsId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Resource name for the location. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppLocationGetCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *locations 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 locations_id(mut self, new_value: &str) -> AppLocationGetCall<'a, C, A> { + self._locations_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) -> AppLocationGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppLocationGetCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppLocationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all domains the user is authorized to administer. +/// +/// A builder for the *authorizedDomains.list* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().authorized_domains_list("appsId") +/// .page_token("aliquyam") +/// .page_size(-9) +/// .doit(); +/// # } +/// ``` +pub struct AppAuthorizedDomainListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppAuthorizedDomainListCall<'a, C, A> {} + +impl<'a, C, A> AppAuthorizedDomainListCall<'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, ListAuthorizedDomainsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.authorizedDomains.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "appsId", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/authorizedDomains"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppAuthorizedDomainListCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AppAuthorizedDomainListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AppAuthorizedDomainListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppAuthorizedDomainListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppAuthorizedDomainListCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppAuthorizedDomainListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. +/// +/// A builder for the *operations.list* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().operations_list("appsId") +/// .page_token("eos") +/// .page_size(-81) +/// .filter("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct AppOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppOperationListCall<'a, C, A> {} + +impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "appsId", "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 = self.hub._base_url.clone() + "v1/apps/{appsId}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. The name of the operation's parent resource. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppOperationListCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AppOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AppOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> AppOperationListCall<'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) -> AppOperationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppOperationListCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information about an application. +/// +/// A builder for the *get* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().get("appsId") +/// .doit(); +/// # } +/// ``` +pub struct AppGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppGetCall<'a, C, A> {} + +impl<'a, C, A> AppGetCall<'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, Application)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + for &field in ["alt", "appsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Name of the Application resource to get. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppGetCall<'a, C, A> { + self._apps_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) -> AppGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppGetCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the specified domain mapping. +/// +/// A builder for the *domainMappings.get* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().domain_mappings_get("appsId", "domainMappingsId") +/// .doit(); +/// # } +/// ``` +pub struct AppDomainMappingGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _domain_mappings_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppDomainMappingGetCall<'a, C, A> {} + +impl<'a, C, A> AppDomainMappingGetCall<'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, DomainMapping)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.domainMappings.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("domainMappingsId", self._domain_mappings_id.to_string())); + for &field in ["alt", "appsId", "domainMappingsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/domainMappings/{domainMappingsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{domainMappingsId}", "domainMappingsId")].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 ["domainMappingsId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppDomainMappingGetCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *domain mappings 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 domain_mappings_id(mut self, new_value: &str) -> AppDomainMappingGetCall<'a, C, A> { + self._domain_mappings_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) -> AppDomainMappingGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppDomainMappingGetCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppDomainMappingGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. +/// +/// A builder for the *services.versions.get* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_get("appsId", "servicesId", "versionsId") +/// .view("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct AppServiceVersionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _services_id: String, + _versions_id: String, + _view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceVersionGetCall<'a, C, A> {} + +impl<'a, C, A> AppServiceVersionGetCall<'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, Version)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.versions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("servicesId", self._services_id.to_string())); + params.push(("versionsId", self._versions_id.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + for &field in ["alt", "appsId", "servicesId", "versionsId", "view"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId")].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 ["versionsId", "servicesId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { + self._services_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { + self._versions_id = new_value.to_string(); + self + } + /// Controls the set of fields returned in the Get response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { + self._view = 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) -> AppServiceVersionGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceVersionGetCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceVersionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the services in the application. +/// +/// A builder for the *services.list* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_list("appsId") +/// .page_token("invidunt") +/// .page_size(-82) +/// .doit(); +/// # } +/// ``` +pub struct AppServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceListCall<'a, C, A> {} + +impl<'a, C, A> AppServiceListCall<'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, ListServicesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "appsId", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceListCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AppServiceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AppServiceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppServiceListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceListCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deploys code and resource files to a new version. /// /// A builder for the *services.versions.create* method supported by a *app* resource. @@ -2484,12 +5700,12 @@ impl<'a, C, A> AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionCreateCall<'a, C, A> @@ -2524,6 +5740,1491 @@ impl<'a, C, A> AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Application::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.apps().patch(req, "appsId") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct AppPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: Application, + _apps_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppPatchCall<'a, C, A> {} + +impl<'a, C, A> AppPatchCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "appsId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Application) -> AppPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `name`. Name of the Application resource to update. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppPatchCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Standard field mask for the set of fields to be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> AppPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppPatchCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all SSL certificates the user is authorized to administer. +/// +/// A builder for the *authorizedCertificates.list* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().authorized_certificates_list("appsId") +/// .view("et") +/// .page_token("eirmod") +/// .page_size(-58) +/// .doit(); +/// # } +/// ``` +pub struct AppAuthorizedCertificateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _view: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppAuthorizedCertificateListCall<'a, C, A> {} + +impl<'a, C, A> AppAuthorizedCertificateListCall<'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, ListAuthorizedCertificatesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.authorizedCertificates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "appsId", "view", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/authorizedCertificates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppAuthorizedCertificateListCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Controls the set of fields returned in the LIST response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> AppAuthorizedCertificateListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AppAuthorizedCertificateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AppAuthorizedCertificateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppAuthorizedCertificateListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppAuthorizedCertificateListCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppAuthorizedCertificateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Stops a running instance. +/// +/// A builder for the *services.versions.instances.delete* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_instances_delete("appsId", "servicesId", "versionsId", "instancesId") +/// .doit(); +/// # } +/// ``` +pub struct AppServiceVersionInstanceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _services_id: String, + _versions_id: String, + _instances_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceVersionInstanceDeleteCall<'a, C, A> {} + +impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.versions.instances.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("servicesId", self._services_id.to_string())); + params.push(("versionsId", self._versions_id.to_string())); + params.push(("instancesId", self._instances_id.to_string())); + for &field in ["alt", "appsId", "servicesId", "versionsId", "instancesId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId"), ("{instancesId}", "instancesId")].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 ["instancesId", "versionsId", "servicesId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + self._services_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + self._versions_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *instances 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 instances_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + self._instances_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) -> AppServiceVersionInstanceDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceVersionInstanceDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceVersionInstanceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: +/// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. +/// instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. +/// automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. +/// automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. +/// automatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. +/// automatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. +/// automatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. +/// automatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine Flexible environment. +/// +/// A builder for the *services.versions.patch* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// use appengine1::Version; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Version::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.apps().services_versions_patch(req, "appsId", "servicesId", "versionsId") +/// .update_mask("dolor") +/// .doit(); +/// # } +/// ``` +pub struct AppServiceVersionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: Version, + _apps_id: String, + _services_id: String, + _versions_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceVersionPatchCall<'a, C, A> {} + +impl<'a, C, A> AppServiceVersionPatchCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.versions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("servicesId", self._services_id.to_string())); + params.push(("versionsId", self._versions_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "appsId", "servicesId", "versionsId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId")].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 ["versionsId", "servicesId", "appsId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Version) -> AppServiceVersionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { + self._services_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { + self._versions_id = new_value.to_string(); + self + } + /// Standard field mask for the set of fields to be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppServiceVersionPatchCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceVersionPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceVersionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the versions of a service. +/// +/// A builder for the *services.versions.list* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_list("appsId", "servicesId") +/// .view("et") +/// .page_token("consetetur") +/// .page_size(-52) +/// .doit(); +/// # } +/// ``` +pub struct AppServiceVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _services_id: String, + _view: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceVersionListCall<'a, C, A> {} + +impl<'a, C, A> AppServiceVersionListCall<'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, ListVersionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.versions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("servicesId", self._services_id.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "appsId", "servicesId", "view", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId")].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 ["servicesId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `parent`. See documentation of `appsId`. + /// + /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { + self._services_id = new_value.to_string(); + self + } + /// Controls the set of fields returned in the List response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AppServiceVersionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppServiceVersionListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceVersionListCall<'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::Admin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceVersionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. /// /// A builder for the *repair* method supported by a *app* resource. @@ -2764,12 +7465,12 @@ impl<'a, C, A> AppRepairCall<'a, C, A> where C: BorrowMut, A: oau /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppRepairCall<'a, C, A> @@ -2804,6 +7505,559 @@ impl<'a, C, A> AppRepairCall<'a, C, A> where C: BorrowMut, A: oau } +/// Deletes an existing Version resource. +/// +/// A builder for the *services.versions.delete* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_delete("appsId", "servicesId", "versionsId") +/// .doit(); +/// # } +/// ``` +pub struct AppServiceVersionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _services_id: String, + _versions_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppServiceVersionDeleteCall<'a, C, A> {} + +impl<'a, C, A> AppServiceVersionDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.services.versions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("servicesId", self._services_id.to_string())); + params.push(("versionsId", self._versions_id.to_string())); + for &field in ["alt", "appsId", "servicesId", "versionsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId")].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 ["versionsId", "servicesId", "appsId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionDeleteCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionDeleteCall<'a, C, A> { + self._services_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionDeleteCall<'a, C, A> { + self._versions_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) -> AppServiceVersionDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppServiceVersionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppServiceVersionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Uploads the specified SSL certificate. +/// +/// A builder for the *authorizedCertificates.create* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// use appengine1::AuthorizedCertificate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AuthorizedCertificate::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.apps().authorized_certificates_create(req, "appsId") +/// .doit(); +/// # } +/// ``` +pub struct AppAuthorizedCertificateCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: AuthorizedCertificate, + _apps_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppAuthorizedCertificateCreateCall<'a, C, A> {} + +impl<'a, C, A> AppAuthorizedCertificateCreateCall<'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, AuthorizedCertificate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.authorizedCertificates.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + for &field in ["alt", "appsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/authorizedCertificates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AuthorizedCertificate) -> AppAuthorizedCertificateCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppAuthorizedCertificateCreateCall<'a, C, A> { + self._apps_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) -> AppAuthorizedCertificateCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppAuthorizedCertificateCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppAuthorizedCertificateCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment. /// /// A builder for the *services.versions.instances.debug* method supported by a *app* resource. @@ -3080,12 +8334,12 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceDebugCall<'a, C, A> @@ -3341,12 +8595,12 @@ impl<'a, C, A> AppServiceGetCall<'a, C, A> where C: BorrowMut, A: /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppServiceGetCall<'a, C, A> @@ -3381,303 +8635,9 @@ impl<'a, C, A> AppServiceGetCall<'a, C, A> where C: BorrowMut, A: } -/// Updates the specified Application resource. You can update the following fields: -/// auth_domain - Google authentication domain for controlling user access to the application. -/// default_cookie_expiration - Cookie expiration policy for the application. +/// Deletes the specified SSL certificate. /// -/// A builder for the *patch* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// use appengine1::Application; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Application::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.apps().patch(req, "appsId") -/// .update_mask("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct AppPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _request: Application, - _apps_id: String, - _update_mask: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppPatchCall<'a, C, A> {} - -impl<'a, C, A> AppPatchCall<'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, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "appsId", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: Application) -> AppPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Part of `name`. Name of the Application resource to update. Example: apps/myapp. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppPatchCall<'a, C, A> { - self._apps_id = new_value.to_string(); - self - } - /// Standard field mask for the set of fields to be updated. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> AppPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppPatchCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppPatchCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Stops a running instance. -/// -/// A builder for the *services.versions.instances.delete* method supported by a *app* resource. +/// A builder for the *authorizedCertificates.delete* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. /// /// # Example @@ -3702,30 +8662,28 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut /// // 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.apps().services_versions_instances_delete("appsId", "servicesId", "versionsId", "instancesId") +/// let result = hub.apps().authorized_certificates_delete("appsId", "authorizedCertificatesId") /// .doit(); /// # } /// ``` -pub struct AppServiceVersionInstanceDeleteCall<'a, C, A> +pub struct AppAuthorizedCertificateDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Appengine, _apps_id: String, - _services_id: String, - _versions_id: String, - _instances_id: String, + _authorized_certificates_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AppServiceVersionInstanceDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AppAuthorizedCertificateDeleteCall<'a, C, A> {} -impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AppAuthorizedCertificateDeleteCall<'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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -3733,14 +8691,12 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "appengine.apps.services.versions.instances.delete", + dlg.begin(MethodInfo { id: "appengine.apps.authorizedCertificates.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("appsId", self._apps_id.to_string())); - params.push(("servicesId", self._services_id.to_string())); - params.push(("versionsId", self._versions_id.to_string())); - params.push(("instancesId", self._instances_id.to_string())); - for &field in ["alt", "appsId", "servicesId", "versionsId", "instancesId"].iter() { + params.push(("authorizedCertificatesId", self._authorized_certificates_id.to_string())); + for &field in ["alt", "appsId", "authorizedCertificatesId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3752,12 +8708,12 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId"), ("{instancesId}", "instancesId")].iter() { + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{authorizedCertificatesId}", "authorizedCertificatesId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -3768,8 +8724,8 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< 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 ["instancesId", "versionsId", "servicesId", "appsId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["authorizedCertificatesId", "appsId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -3855,44 +8811,24 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< } - /// Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + /// Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. /// /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + pub fn apps_id(mut self, new_value: &str) -> AppAuthorizedCertificateDeleteCall<'a, C, A> { self._apps_id = new_value.to_string(); self } /// Part of `name`. See documentation of `appsId`. /// - /// Sets the *services id* path property to the given value. + /// Sets the *authorized certificates 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 services_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { - self._services_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { - self._versions_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *instances 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 instances_id(mut self, new_value: &str) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { - self._instances_id = new_value.to_string(); + pub fn authorized_certificates_id(mut self, new_value: &str) -> AppAuthorizedCertificateDeleteCall<'a, C, A> { + self._authorized_certificates_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -3901,7 +8837,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// 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) -> AppServiceVersionInstanceDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppAuthorizedCertificateDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3920,15 +8856,15 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AppServiceVersionInstanceDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AppAuthorizedCertificateDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3948,7 +8884,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// 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) -> AppServiceVersionInstanceDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AppAuthorizedCertificateDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3960,13 +8896,9 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< } -/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: -/// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. -/// instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. -/// automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. -/// automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. +/// Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. /// -/// A builder for the *services.versions.patch* method supported by a *app* resource. +/// A builder for the *domainMappings.create* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. /// /// # Example @@ -3978,7 +8910,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_appengine1 as appengine1; -/// use appengine1::Version; +/// use appengine1::DomainMapping; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -3992,33 +8924,29 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// // 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 = Version::default(); +/// let mut req = DomainMapping::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.apps().services_versions_patch(req, "appsId", "servicesId", "versionsId") -/// .update_mask("sadipscing") +/// let result = hub.apps().domain_mappings_create(req, "appsId") /// .doit(); /// # } /// ``` -pub struct AppServiceVersionPatchCall<'a, C, A> +pub struct AppDomainMappingCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Appengine, - _request: Version, + _request: DomainMapping, _apps_id: String, - _services_id: String, - _versions_id: String, - _update_mask: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AppServiceVersionPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AppDomainMappingCreateCall<'a, C, A> {} -impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AppDomainMappingCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -4030,16 +8958,11 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "appengine.apps.services.versions.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "appengine.apps.domainMappings.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("appsId", self._apps_id.to_string())); - params.push(("servicesId", self._services_id.to_string())); - params.push(("versionsId", self._versions_id.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "appsId", "servicesId", "versionsId", "updateMask"].iter() { + for &field in ["alt", "appsId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4051,12 +8974,12 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -4067,8 +8990,295 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["versionsId", "servicesId", "appsId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["appsId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DomainMapping) -> AppDomainMappingCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + /// + /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppDomainMappingCreateCall<'a, C, A> { + self._apps_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) -> AppDomainMappingCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AppDomainMappingCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AppDomainMappingCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. +/// +/// A builder for the *domainMappings.patch* method supported by a *app* resource. +/// It is not used directly, but through a `AppMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_appengine1 as appengine1; +/// use appengine1::DomainMapping; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use appengine1::Appengine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DomainMapping::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.apps().domain_mappings_patch(req, "appsId", "domainMappingsId") +/// .update_mask("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct AppDomainMappingPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: DomainMapping, + _apps_id: String, + _domain_mappings_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppDomainMappingPatchCall<'a, C, A> {} + +impl<'a, C, A> AppDomainMappingPatchCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "appengine.apps.domainMappings.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("domainMappingsId", self._domain_mappings_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "appsId", "domainMappingsId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/domainMappings/{domainMappingsId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{domainMappingsId}", "domainMappingsId")].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 ["domainMappingsId", "appsId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -4174,44 +9384,34 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionPatchCall<'a, C, A> { + pub fn request(mut self, new_value: DomainMapping) -> AppDomainMappingPatchCall<'a, C, A> { self._request = new_value; self } - /// Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + /// Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. /// /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { + pub fn apps_id(mut self, new_value: &str) -> AppDomainMappingPatchCall<'a, C, A> { self._apps_id = new_value.to_string(); self } /// Part of `name`. See documentation of `appsId`. /// - /// Sets the *services id* path property to the given value. + /// Sets the *domain mappings 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 services_id(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { - self._services_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { - self._versions_id = new_value.to_string(); + pub fn domain_mappings_id(mut self, new_value: &str) -> AppDomainMappingPatchCall<'a, C, A> { + self._domain_mappings_id = new_value.to_string(); self } /// Standard field mask for the set of fields to be updated. /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> AppServiceVersionPatchCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> AppDomainMappingPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -4221,7 +9421,7 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppDomainMappingPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4240,15 +9440,15 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AppDomainMappingPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4268,304 +9468,7 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AppServiceVersionPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the versions of a service. -/// -/// A builder for the *services.versions.list* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_list("appsId", "servicesId") -/// .view("elitr") -/// .page_token("amet") -/// .page_size(-60) -/// .doit(); -/// # } -/// ``` -pub struct AppServiceVersionListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _apps_id: String, - _services_id: String, - _view: Option, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppServiceVersionListCall<'a, C, A> {} - -impl<'a, C, A> AppServiceVersionListCall<'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, ListVersionsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.services.versions.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - params.push(("servicesId", self._services_id.to_string())); - if let Some(value) = self._view { - params.push(("view", value.to_string())); - } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "appsId", "servicesId", "view", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId")].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 ["servicesId", "appsId"].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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { - self._apps_id = new_value.to_string(); - self - } - /// Part of `parent`. See documentation of `appsId`. - /// - /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { - self._services_id = new_value.to_string(); - self - } - /// Controls the set of fields returned in the List response. - /// - /// Sets the *view* query property to the given value. - pub fn view(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { - self._view = Some(new_value.to_string()); - self - } - /// Continuation token for fetching the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AppServiceVersionListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum results to return per page. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AppServiceVersionListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppServiceVersionListCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppServiceVersionListCall<'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::Admin`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppServiceVersionListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AppDomainMappingPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4798,12 +9701,12 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppOperationGetCall<'a, C, A> @@ -4838,279 +9741,6 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, } -/// Lists all the services in the application. -/// -/// A builder for the *services.list* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_list("appsId") -/// .page_token("invidunt") -/// .page_size(-82) -/// .doit(); -/// # } -/// ``` -pub struct AppServiceListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _apps_id: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppServiceListCall<'a, C, A> {} - -impl<'a, C, A> AppServiceListCall<'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, ListServicesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.services.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "appsId", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceListCall<'a, C, A> { - self._apps_id = new_value.to_string(); - self - } - /// Continuation token for fetching the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AppServiceListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum results to return per page. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AppServiceListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppServiceListCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppServiceListCall<'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::Admin`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppServiceListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists information about the supported locations for this service. /// /// A builder for the *locations.list* method supported by a *app* resource. @@ -5139,9 +9769,9 @@ impl<'a, C, A> AppServiceListCall<'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.apps().locations_list("appsId") -/// .page_token("Lorem") -/// .page_size(-9) -/// .filter("et") +/// .page_token("consetetur") +/// .page_size(-58) +/// .filter("nonumy") /// .doit(); /// # } /// ``` @@ -5356,12 +9986,12 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppLocationListCall<'a, C, A> @@ -5396,9 +10026,9 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, } -/// Gets instance information. +/// Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. /// -/// A builder for the *services.versions.instances.get* method supported by a *app* resource. +/// A builder for the *domainMappings.delete* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. /// /// # Example @@ -5423,595 +10053,24 @@ impl<'a, C, A> AppLocationListCall<'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.apps().services_versions_instances_get("appsId", "servicesId", "versionsId", "instancesId") +/// let result = hub.apps().domain_mappings_delete("appsId", "domainMappingsId") /// .doit(); /// # } /// ``` -pub struct AppServiceVersionInstanceGetCall<'a, C, A> +pub struct AppDomainMappingDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Appengine, _apps_id: String, - _services_id: String, - _versions_id: String, - _instances_id: String, + _domain_mappings_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AppServiceVersionInstanceGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AppDomainMappingDeleteCall<'a, C, A> {} -impl<'a, C, A> AppServiceVersionInstanceGetCall<'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, Instance)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.services.versions.instances.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - params.push(("servicesId", self._services_id.to_string())); - params.push(("versionsId", self._versions_id.to_string())); - params.push(("instancesId", self._instances_id.to_string())); - for &field in ["alt", "appsId", "servicesId", "versionsId", "instancesId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId"), ("{servicesId}", "servicesId"), ("{versionsId}", "versionsId"), ("{instancesId}", "instancesId")].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 ["instancesId", "versionsId", "servicesId", "appsId"].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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { - self._apps_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *services 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 services_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { - self._services_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { - self._versions_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *instances 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 instances_id(mut self, new_value: &str) -> AppServiceVersionInstanceGetCall<'a, C, A> { - self._instances_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) -> AppServiceVersionInstanceGetCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppServiceVersionInstanceGetCall<'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::Admin`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppServiceVersionInstanceGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations. -/// -/// A builder for the *operations.list* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().operations_list("appsId") -/// .page_token("amet") -/// .page_size(-23) -/// .filter("consetetur") -/// .doit(); -/// # } -/// ``` -pub struct AppOperationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _apps_id: String, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppOperationListCall<'a, C, A> {} - -impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.operations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "appsId", "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 = self.hub._base_url.clone() + "v1/apps/{appsId}/operations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Part of `name`. The name of the operation collection. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppOperationListCall<'a, C, A> { - self._apps_id = new_value.to_string(); - self - } - /// The standard list page token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AppOperationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The standard list page size. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AppOperationListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The standard list filter. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> AppOperationListCall<'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) -> AppOperationListCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppOperationListCall<'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::Admin`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppOperationListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes an existing Version resource. -/// -/// A builder for the *services.versions.delete* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().services_versions_delete("appsId", "servicesId", "versionsId") -/// .doit(); -/// # } -/// ``` -pub struct AppServiceVersionDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _apps_id: String, - _services_id: String, - _versions_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppServiceVersionDeleteCall<'a, C, A> {} - -impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AppDomainMappingDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -6023,13 +10082,12 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "appengine.apps.services.versions.delete", + dlg.begin(MethodInfo { id: "appengine.apps.domainMappings.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("appsId", self._apps_id.to_string())); - params.push(("servicesId", self._services_id.to_string())); - params.push(("versionsId", self._versions_id.to_string())); - for &field in ["alt", "appsId", "servicesId", "versionsId"].iter() { + params.push(("domainMappingsId", self._domain_mappings_id.to_string())); + for &field in ["alt", "appsId", "domainMappingsId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6041,12 +10099,12 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -6057,8 +10115,8 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["versionsId", "servicesId", "appsId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["domainMappingsId", "appsId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -6144,34 +10202,24 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppServiceVersionDeleteCall<'a, C, A> { + pub fn apps_id(mut self, new_value: &str) -> AppDomainMappingDeleteCall<'a, C, A> { self._apps_id = new_value.to_string(); self } /// Part of `name`. See documentation of `appsId`. /// - /// Sets the *services id* path property to the given value. + /// Sets the *domain mappings 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 services_id(mut self, new_value: &str) -> AppServiceVersionDeleteCall<'a, C, A> { - self._services_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionDeleteCall<'a, C, A> { - self._versions_id = new_value.to_string(); + pub fn domain_mappings_id(mut self, new_value: &str) -> AppDomainMappingDeleteCall<'a, C, A> { + self._domain_mappings_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -6180,7 +10228,7 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppServiceVersionDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppDomainMappingDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6199,15 +10247,15 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AppDomainMappingDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6227,268 +10275,7 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AppServiceVersionDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Get information about a location. -/// -/// A builder for the *locations.get* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().locations_get("appsId", "locationsId") -/// .doit(); -/// # } -/// ``` -pub struct AppLocationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _apps_id: String, - _locations_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppLocationGetCall<'a, C, A> {} - -impl<'a, C, A> AppLocationGetCall<'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, Location)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.locations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - params.push(("locationsId", self._locations_id.to_string())); - for &field in ["alt", "appsId", "locationsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}/locations/{locationsId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId"), ("{locationsId}", "locationsId")].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 ["locationsId", "appsId"].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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Part of `name`. Resource name for the location. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppLocationGetCall<'a, C, A> { - self._apps_id = new_value.to_string(); - self - } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *locations 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 locations_id(mut self, new_value: &str) -> AppLocationGetCall<'a, C, A> { - self._locations_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) -> AppLocationGetCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppLocationGetCall<'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::Admin`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppLocationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AppDomainMappingDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6534,8 +10321,8 @@ impl<'a, C, A> AppLocationGetCall<'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.apps().services_patch(req, "appsId", "servicesId") -/// .update_mask("consetetur") -/// .migrate_traffic(false) +/// .update_mask("labore") +/// .migrate_traffic(true) /// .doit(); /// # } /// ``` @@ -6776,12 +10563,12 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppServicePatchCall<'a, C, A> @@ -6816,255 +10603,6 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, } -/// Gets information about an application. -/// -/// A builder for the *get* method supported by a *app* resource. -/// It is not used directly, but through a `AppMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_appengine1 as appengine1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use appengine1::Appengine; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Appengine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.apps().get("appsId") -/// .doit(); -/// # } -/// ``` -pub struct AppGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Appengine, - _apps_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AppGetCall<'a, C, A> {} - -impl<'a, C, A> AppGetCall<'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, Application)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "appengine.apps.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("appsId", self._apps_id.to_string())); - for &field in ["alt", "appsId"].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 = self.hub._base_url.clone() + "v1/apps/{appsId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{appsId}", "appsId")].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 ["appsId"].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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Part of `name`. Name of the Application resource to get. Example: apps/myapp. - /// - /// Sets the *apps 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 apps_id(mut self, new_value: &str) -> AppGetCall<'a, C, A> { - self._apps_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) -> AppGetCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> AppGetCall<'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::Admin`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> AppGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes the specified service and all enclosed versions. /// /// A builder for the *services.delete* method supported by a *app* resource. @@ -7286,12 +10824,12 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppServiceDeleteCall<'a, C, A> @@ -7535,12 +11073,12 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppCreateCall<'a, C, A> @@ -7575,9 +11113,9 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau } -/// Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. +/// Gets the specified SSL certificate. /// -/// A builder for the *services.versions.get* method supported by a *app* resource. +/// A builder for the *authorizedCertificates.get* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. /// /// # Example @@ -7602,31 +11140,30 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau /// // 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.apps().services_versions_get("appsId", "servicesId", "versionsId") -/// .view("diam") +/// let result = hub.apps().authorized_certificates_get("appsId", "authorizedCertificatesId") +/// .view("nonumy") /// .doit(); /// # } /// ``` -pub struct AppServiceVersionGetCall<'a, C, A> +pub struct AppAuthorizedCertificateGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Appengine, _apps_id: String, - _services_id: String, - _versions_id: String, + _authorized_certificates_id: String, _view: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AppServiceVersionGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AppAuthorizedCertificateGetCall<'a, C, A> {} -impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AppAuthorizedCertificateGetCall<'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, Version)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, AuthorizedCertificate)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -7634,16 +11171,15 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "appengine.apps.services.versions.get", + dlg.begin(MethodInfo { id: "appengine.apps.authorizedCertificates.get", 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((5 + self._additional_params.len())); params.push(("appsId", self._apps_id.to_string())); - params.push(("servicesId", self._services_id.to_string())); - params.push(("versionsId", self._versions_id.to_string())); + params.push(("authorizedCertificatesId", self._authorized_certificates_id.to_string())); if let Some(value) = self._view { params.push(("view", value.to_string())); } - for &field in ["alt", "appsId", "servicesId", "versionsId", "view"].iter() { + for &field in ["alt", "appsId", "authorizedCertificatesId", "view"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7655,12 +11191,12 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -7671,8 +11207,8 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["versionsId", "servicesId", "appsId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["authorizedCertificatesId", "appsId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7758,40 +11294,30 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> { + pub fn apps_id(mut self, new_value: &str) -> AppAuthorizedCertificateGetCall<'a, C, A> { self._apps_id = new_value.to_string(); self } /// Part of `name`. See documentation of `appsId`. /// - /// Sets the *services id* path property to the given value. + /// Sets the *authorized certificates 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 services_id(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { - self._services_id = new_value.to_string(); + pub fn authorized_certificates_id(mut self, new_value: &str) -> AppAuthorizedCertificateGetCall<'a, C, A> { + self._authorized_certificates_id = new_value.to_string(); self } - /// Part of `name`. See documentation of `appsId`. - /// - /// Sets the *versions 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 versions_id(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { - self._versions_id = new_value.to_string(); - self - } - /// Controls the set of fields returned in the Get response. + /// Controls the set of fields returned in the GET response. /// /// Sets the *view* query property to the given value. - pub fn view(mut self, new_value: &str) -> AppServiceVersionGetCall<'a, C, A> { + pub fn view(mut self, new_value: &str) -> AppAuthorizedCertificateGetCall<'a, C, A> { self._view = Some(new_value.to_string()); self } @@ -7801,7 +11327,7 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppAuthorizedCertificateGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7820,15 +11346,15 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AppAuthorizedCertificateGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7848,7 +11374,7 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AppServiceVersionGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AppAuthorizedCertificateGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/appengine1_beta4-cli/Cargo.toml b/gen/appengine1_beta4-cli/Cargo.toml index afa0ddf60d..c8f288ac20 100644 --- a/gen/appengine1_beta4-cli/Cargo.toml +++ b/gen/appengine1_beta4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appengine1_beta4-cli" -version = "1.0.6+20170522" +version = "1.0.6+20170914" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta4-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-appengine1_beta4] path = "../appengine1_beta4" -version = "1.0.6+20170522" +version = "1.0.6+20170914" diff --git a/gen/appengine1_beta4-cli/README.md b/gen/appengine1_beta4-cli/README.md index e0383f24ae..47e3ca14df 100644 --- a/gen/appengine1_beta4-cli/README.md +++ b/gen/appengine1_beta4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appengine* API at revision *20170522*. The CLI is at version *1.0.6*. +This documentation was generated from the *appengine* API at revision *20170914*. The CLI is at version *1.0.6*. ```bash appengine1-beta4 [options] diff --git a/gen/appengine1_beta4-cli/mkdocs.yml b/gen/appengine1_beta4-cli/mkdocs.yml index 344c16b6ec..aa03a2e071 100644 --- a/gen/appengine1_beta4-cli/mkdocs.yml +++ b/gen/appengine1_beta4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.6+20170522 +site_name: appengine v1.0.6+20170914 site_url: http://byron.github.io/google-apis-rs/google-appengine1_beta4-cli site_description: A complete library to interact with appengine (protocol v1beta4) diff --git a/gen/appengine1_beta4-cli/src/main.rs b/gen/appengine1_beta4-cli/src/main.rs index 679ee8fb4e..b7247f73bf 100644 --- a/gen/appengine1_beta4-cli/src/main.rs +++ b/gen/appengine1_beta4-cli/src/main.rs @@ -74,13 +74,13 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auth-domain" => Some(("authDomain", 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!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "iap", "id", "location", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -500,8 +500,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "split.shard-by" => Some(("split.shardBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "split.allocations" => Some(("split.allocations", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Map })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", 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!["allocations", "id", "name", "shard-by", "split"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -601,8 +601,8 @@ impl<'n> Engine<'n> { "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.url" => Some(("apiConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.security-level" => Some(("apiConfig.securityLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -614,44 +614,45 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-concurrent-requests" => Some(("automaticScaling.requestUtilization.targetConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-request-count-per-sec" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.max-total-instances" => Some(("automaticScaling.maxTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.max-concurrent-requests" => Some(("automaticScaling.maxConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.min-total-instances" => Some(("automaticScaling.minTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env-variables" => Some(("envVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "runtime-api-version" => Some(("runtimeApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-utilization", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-utilization", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "runtime-api-version", "script", "security-level", "serving-status", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1160,8 +1161,8 @@ impl<'n> Engine<'n> { "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.url" => Some(("apiConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.security-level" => Some(("apiConfig.securityLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1173,44 +1174,45 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-concurrent-requests" => Some(("automaticScaling.requestUtilization.targetConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-request-count-per-sec" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.max-total-instances" => Some(("automaticScaling.maxTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.max-concurrent-requests" => Some(("automaticScaling.maxConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.min-total-instances" => Some(("automaticScaling.minTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env-variables" => Some(("envVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "runtime-api-version" => Some(("runtimeApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-utilization", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-utilization", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "runtime-api-version", "script", "security-level", "serving-status", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1416,13 +1418,13 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auth-domain" => Some(("authDomain", 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!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "iap", "id", "location", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2219,12 +2221,12 @@ fn main() { Some(false)), ]), ("operations-list", - Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations."##), + Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli/apps_operations-list", vec![ (Some(r##"apps-id"##), None, - Some(r##"Part of `name`. The name of the operation collection."##), + Some(r##"Part of `name`. The name of the operation's parent resource."##), Some(true), Some(false)), @@ -2276,7 +2278,7 @@ fn main() { let mut app = App::new("appengine1-beta4") .author("Sebastian Thiel ") - .version("1.0.6+20170522") + .version("1.0.6+20170914") .about("The App Engine Admin API enables developers to provision and manage their App Engine applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli") .arg(Arg::with_name("url") diff --git a/gen/appengine1_beta4/Cargo.toml b/gen/appengine1_beta4/Cargo.toml index 36a2775c16..97764e9d01 100644 --- a/gen/appengine1_beta4/Cargo.toml +++ b/gen/appengine1_beta4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1_beta4" -version = "1.0.6+20170522" +version = "1.0.6+20170914" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta4" homepage = "https://cloud.google.com/appengine/docs/admin-api/" -documentation = "https://docs.rs/google-appengine1_beta4/1.0.6+20170522" +documentation = "https://docs.rs/google-appengine1_beta4/1.0.6+20170914" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1_beta4/README.md b/gen/appengine1_beta4/README.md index 1280055d35..3c88ac6a1f 100644 --- a/gen/appengine1_beta4/README.md +++ b/gen/appengine1_beta4/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appengine1_beta4` library allows access to all features of the *Google appengine* service. -This documentation was generated from *appengine* crate version *1.0.6+20170522*, where *20170522* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *appengine* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *appengine* *v1_beta4* API can be found at the [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.AppPatchCall.html) + * [*create*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.AppPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/struct.Appengine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/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")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/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](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/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](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/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](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/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](https://docs.rs/google-appengine1_beta4/1.0.6+20170522/google_appengine1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta4/1.0.6+20170914/google_appengine1_beta4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appengine1_beta4/src/lib.rs b/gen/appengine1_beta4/src/lib.rs index d169649058..74102029f9 100644 --- a/gen/appengine1_beta4/src/lib.rs +++ b/gen/appengine1_beta4/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 *appengine* crate version *1.0.6+20170522*, where *20170522* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *appengine* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *appengine* *v1_beta4* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -423,62 +423,49 @@ pub struct Network { impl Part for Network {} -/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. +/// An Application resource contains the top-level configuration of an App Engine application. /// /// # 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*). /// -/// * [modules versions instances get apps](struct.AppModuleVersionInstanceGetCall.html) (response) +/// * [create apps](struct.AppCreateCall.html) (request) +/// * [get apps](struct.AppGetCall.html) (response) +/// * [patch apps](struct.AppPatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Instance { - /// Time that this instance was started.@OutputOnly - #[serde(rename="startTimestamp")] - pub start_timestamp: Option, - /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmId")] - pub vm_id: Option, - /// Total memory in use (bytes).@OutputOnly - #[serde(rename="memoryUsage")] - pub memory_usage: Option, - /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmIp")] - pub vm_ip: Option, - /// Average queries per second (QPS) over the last minute.@OutputOnly - pub qps: Option, - /// Availability of the instance.@OutputOnly - pub availability: Option, - /// Full path to the Instance resource in the API. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly +pub struct Application { + /// Hostname used to reach the application, as resolved by App Engine.@OutputOnly + #[serde(rename="defaultHostname")] + pub default_hostname: Option, + /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly pub name: Option, - /// Number of errors since this instance was started.@OutputOnly - pub errors: Option, - /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmStatus")] - pub vm_status: Option, - /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmUnlocked")] - pub vm_unlocked: Option, - /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + /// Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly + #[serde(rename="codeBucket")] + pub code_bucket: Option, + /// Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly + #[serde(rename="defaultBucket")] + pub default_bucket: Option, + /// HTTP path dispatch rules for requests to the application that do not explicitly target a module or version. Rules are order-dependent.@OutputOnly + #[serde(rename="dispatchRules")] + pub dispatch_rules: Option>, + /// Cookie expiration policy for this application. + #[serde(rename="defaultCookieExpiration")] + pub default_cookie_expiration: Option, + /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. pub id: Option, - /// Average latency (ms) over the last minute.@OutputOnly - #[serde(rename="averageLatency")] - pub average_latency: Option, - /// Number of requests since this instance was started.@OutputOnly - pub requests: Option, - /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmName")] - pub vm_name: Option, - /// App Engine release this instance is running on.@OutputOnly - #[serde(rename="appEngineRelease")] - pub app_engine_release: Option, - /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmZoneName")] - pub vm_zone_name: Option, + /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US + pub location: Option, + /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. + #[serde(rename="authDomain")] + pub auth_domain: Option, + /// no description provided + pub iap: Option, } -impl ResponseResult for Instance {} +impl RequestValue for Application {} +impl ResponseResult for Application {} /// A Version resource is a specific set of source code and configuration files that are deployed into a module. @@ -500,8 +487,9 @@ pub struct Version { /// A module with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity. #[serde(rename="basicScaling")] pub basic_scaling: Option, - /// Email address of the user who created this version.@OutputOnly - pub deployer: Option, + /// A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. + #[serde(rename="manualScaling")] + pub manual_scaling: Option, /// Whether to deploy this version in a container on a virtual machine. pub vm: Option, /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. @@ -527,6 +515,9 @@ pub struct Version { pub id: Option, /// Extra network settings. Only applicable for VM runtimes. pub network: Option, + /// The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard//config/appref + #[serde(rename="runtimeApiVersion")] + pub runtime_api_version: Option, /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. #[serde(rename="apiConfig")] pub api_config: Option, @@ -547,9 +538,8 @@ pub struct Version { pub name: Option, /// Configuration for third-party Python runtime libraries required by the application.Only returned in GET requests if view=FULL is set. pub libraries: Option>, - /// A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. - #[serde(rename="manualScaling")] - pub manual_scaling: Option, + /// Email address of the user who created this version.@OutputOnly + pub deployer: Option, /// App Engine execution environment to use for this version.Defaults to 1. pub env: Option, /// Automatic scaling is based on request rate, response latencies, and other application metrics. @@ -660,16 +650,16 @@ impl Part for CpuUtilization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Resources { - /// User specified volumes. - pub volumes: Option>, /// Disk size (GB) needed. #[serde(rename="diskGb")] pub disk_gb: Option, - /// Number of CPU cores needed. - pub cpu: Option, + /// User specified volumes. + pub volumes: Option>, /// Memory (GB) needed. #[serde(rename="memoryGb")] pub memory_gb: Option, + /// Number of CPU cores needed. + pub cpu: Option, } impl Part for Resources {} @@ -713,7 +703,7 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. pub details: Option>>, } @@ -862,17 +852,21 @@ pub struct ScriptHandler { impl Part for ScriptHandler {} -/// Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment. +/// Rules to match an HTTP request and dispatch that request to a module. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ContainerInfo { - /// URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" - pub image: Option, +pub struct UrlDispatchRule { + /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters. + pub path: Option, + /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". + pub domain: Option, + /// Resource ID of a module in this application that should serve the matched request. The module must already exist. Example: default. + pub module: Option, } -impl Part for ContainerInfo {} +impl Part for UrlDispatchRule {} /// Uses Google Cloud Endpoints to handle requests. @@ -925,12 +919,12 @@ impl Part for HealthCheck {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ErrorHandler { - /// Error condition this handler applies to. - #[serde(rename="errorCode")] - pub error_code: Option, /// MIME type of file. Defaults to text/html. #[serde(rename="mimeType")] pub mime_type: Option, + /// Error condition this handler applies to. + #[serde(rename="errorCode")] + pub error_code: Option, /// Static file content to be served for this error. #[serde(rename="staticFile")] pub static_file: Option, @@ -955,12 +949,12 @@ pub struct StaticDirectoryHandler { /// Whether this handler should match the request if the file referenced by the handler does not exist. #[serde(rename="requireMatchingFile")] pub require_matching_file: Option, - /// HTTP headers to use for all responses from these URLs. - #[serde(rename="httpHeaders")] - pub http_headers: Option>, /// Whether files should also be uploaded as code data. By default, files declared in static directory handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas. #[serde(rename="applicationReadable")] pub application_readable: Option, + /// HTTP headers to use for all responses from these URLs. + #[serde(rename="httpHeaders")] + pub http_headers: Option>, } impl Part for StaticDirectoryHandler {} @@ -994,24 +988,24 @@ impl Part for IdentityAwareProxy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AutomaticScaling { - /// Target scaling by CPU usage. - #[serde(rename="cpuUtilization")] - pub cpu_utilization: Option, + /// Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it. + #[serde(rename="minPendingLatency")] + pub min_pending_latency: Option, /// Target scaling by network usage. #[serde(rename="networkUtilization")] pub network_utilization: Option, - /// Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module. - #[serde(rename="minIdleInstances")] - pub min_idle_instances: Option, + /// Target scaling by disk usage. + #[serde(rename="diskUtilization")] + pub disk_utilization: Option, /// Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it. #[serde(rename="maxPendingLatency")] pub max_pending_latency: Option, /// Maximum number of idle instances that should be maintained for this version. #[serde(rename="maxIdleInstances")] pub max_idle_instances: Option, - /// Target scaling by disk usage. - #[serde(rename="diskUtilization")] - pub disk_utilization: Option, + /// Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module. + #[serde(rename="minIdleInstances")] + pub min_idle_instances: Option, /// Target scaling by request utilization. #[serde(rename="requestUtilization")] pub request_utilization: Option, @@ -1027,9 +1021,9 @@ pub struct AutomaticScaling { /// Minimum number of instances that should be maintained for this version. #[serde(rename="minTotalInstances")] pub min_total_instances: Option, - /// Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it. - #[serde(rename="minPendingLatency")] - pub min_pending_latency: Option, + /// Target scaling by CPU usage. + #[serde(rename="cpuUtilization")] + pub cpu_utilization: Option, } impl Part for AutomaticScaling {} @@ -1112,49 +1106,62 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// An Application resource contains the top-level configuration of an App Engine application. +/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [create apps](struct.AppCreateCall.html) (request) -/// * [patch apps](struct.AppPatchCall.html) (request) -/// * [get apps](struct.AppGetCall.html) (response) +/// * [modules versions instances get apps](struct.AppModuleVersionInstanceGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Application { - /// Hostname used to reach the application, as resolved by App Engine.@OutputOnly - #[serde(rename="defaultHostname")] - pub default_hostname: Option, - /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly - pub name: Option, - /// Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly - #[serde(rename="codeBucket")] - pub code_bucket: Option, - /// Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly - #[serde(rename="defaultBucket")] - pub default_bucket: Option, - /// HTTP path dispatch rules for requests to the application that do not explicitly target a module or version. Rules are order-dependent.@OutputOnly - #[serde(rename="dispatchRules")] - pub dispatch_rules: Option>, - /// Cookie expiration policy for this application. - #[serde(rename="defaultCookieExpiration")] - pub default_cookie_expiration: Option, - /// no description provided - pub iap: Option, - /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US - pub location: Option, - /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. - #[serde(rename="authDomain")] - pub auth_domain: Option, - /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. +pub struct Instance { + /// App Engine release this instance is running on.@OutputOnly + #[serde(rename="appEngineRelease")] + pub app_engine_release: Option, + /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmId")] + pub vm_id: Option, + /// Total memory in use (bytes).@OutputOnly + #[serde(rename="memoryUsage")] + pub memory_usage: Option, + /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmIp")] + pub vm_ip: Option, + /// Average queries per second (QPS) over the last minute.@OutputOnly + pub qps: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly pub id: Option, + /// Full path to the Instance resource in the API. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly + pub name: Option, + /// Number of errors since this instance was started.@OutputOnly + pub errors: Option, + /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmStatus")] + pub vm_status: Option, + /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmUnlocked")] + pub vm_unlocked: Option, + /// Availability of the instance.@OutputOnly + pub availability: Option, + /// Average latency (ms) over the last minute.@OutputOnly + #[serde(rename="averageLatency")] + pub average_latency: Option, + /// Number of requests since this instance was started.@OutputOnly + pub requests: Option, + /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmName")] + pub vm_name: Option, + /// Time that this instance was started.@OutputOnly + #[serde(rename="startTimestamp")] + pub start_timestamp: Option, + /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmZoneName")] + pub vm_zone_name: Option, } -impl RequestValue for Application {} -impl ResponseResult for Application {} +impl ResponseResult for Instance {} /// A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. @@ -1170,21 +1177,17 @@ pub struct ManualScaling { impl Part for ManualScaling {} -/// Rules to match an HTTP request and dispatch that request to a module. +/// Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlDispatchRule { - /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters. - pub path: Option, - /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". - pub domain: Option, - /// Resource ID of a module in this application that should serve the matched request. The module must already exist. Example: default. - pub module: Option, +pub struct ContainerInfo { + /// URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + pub image: Option, } -impl Part for UrlDispatchRule {} +impl Part for ContainerInfo {} /// Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers. @@ -1198,11 +1201,11 @@ pub struct ApiConfigHandler { /// Security (HTTPS) enforcement for this URL. #[serde(rename="securityLevel")] pub security_level: Option, - /// Level of login required to access this resource. Defaults to optional. - pub login: Option, /// Action to take when users access resources that require authentication. Defaults to redirect. #[serde(rename="authFailAction")] pub auth_fail_action: Option, + /// Level of login required to access this resource. Defaults to optional. + pub login: Option, /// Path to the script from the application root directory. pub script: Option, } @@ -1304,17 +1307,17 @@ impl Part for TrafficSplit {} /// 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*). /// -/// * [modules get apps](struct.AppModuleGetCall.html) (response) /// * [modules patch apps](struct.AppModulePatchCall.html) (request) +/// * [modules get apps](struct.AppModuleGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Module { + /// Mapping that defines fractional HTTP traffic diversion to different versions within the module. + pub split: Option, /// Relative name of the module within the application. Example: default.@OutputOnly pub id: Option, /// Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly pub name: Option, - /// Mapping that defines fractional HTTP traffic diversion to different versions within the module. - pub split: Option, } impl RequestValue for Module {} @@ -1721,11 +1724,11 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations. + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. /// /// # Arguments /// - /// * `appsId` - Part of `name`. The name of the operation collection. + /// * `appsId` - Part of `name`. The name of the operation's parent resource. pub fn operations_list(&self, apps_id: &str) -> AppOperationListCall<'a, C, A> { AppOperationListCall { hub: self.hub, @@ -2105,17 +2108,17 @@ impl<'a, C, A> AppModulePatchCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppModulePatchCall<'a, C, A> @@ -2366,17 +2369,17 @@ impl<'a, C, A> AppModuleGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppModuleGetCall<'a, C, A> @@ -2651,17 +2654,17 @@ impl<'a, C, A> AppModuleVersionInstanceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionInstanceGetCall<'a, C, A> @@ -2924,17 +2927,17 @@ impl<'a, C, A> AppModuleListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppModuleListCall<'a, C, A> @@ -3173,17 +3176,17 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppCreateCall<'a, C, A> @@ -3470,17 +3473,17 @@ impl<'a, C, A> AppModuleVersionInstanceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionInstanceListCall<'a, C, A> @@ -3755,17 +3758,17 @@ impl<'a, C, A> AppModuleVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionInstanceDeleteCall<'a, C, A> @@ -4071,17 +4074,17 @@ impl<'a, C, A> AppModuleVersionInstanceDebugCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionInstanceDebugCall<'a, C, A> @@ -4332,17 +4335,17 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppGetCall<'a, C, A> @@ -4593,17 +4596,17 @@ impl<'a, C, A> AppModuleDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppModuleDeleteCall<'a, C, A> @@ -4887,17 +4890,17 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppPatchCall<'a, C, A> @@ -5148,17 +5151,17 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppOperationGetCall<'a, C, A> @@ -5409,17 +5412,17 @@ impl<'a, C, A> AppLocationGetCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppLocationGetCall<'a, C, A> @@ -5694,17 +5697,17 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppLocationListCall<'a, C, A> @@ -6014,17 +6017,17 @@ impl<'a, C, A> AppModuleVersionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionPatchCall<'a, C, A> @@ -6059,7 +6062,7 @@ impl<'a, C, A> AppModuleVersionPatchCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, } - /// Part of `name`. The name of the operation collection. + /// Part of `name`. The name of the operation's parent resource. /// /// Sets the *apps id* path property to the given value. /// @@ -6299,17 +6302,17 @@ impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppOperationListCall<'a, C, A> @@ -6572,17 +6575,17 @@ impl<'a, C, A> AppModuleVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionDeleteCall<'a, C, A> @@ -6864,17 +6867,17 @@ impl<'a, C, A> AppModuleVersionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionCreateCall<'a, C, A> @@ -7149,17 +7152,17 @@ impl<'a, C, A> AppModuleVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionGetCall<'a, C, A> @@ -7446,17 +7449,17 @@ impl<'a, C, A> AppModuleVersionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppModuleVersionListCall<'a, C, A> diff --git a/gen/appengine1_beta5-cli/Cargo.toml b/gen/appengine1_beta5-cli/Cargo.toml index a2983fa735..9995037e75 100644 --- a/gen/appengine1_beta5-cli/Cargo.toml +++ b/gen/appengine1_beta5-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appengine1_beta5-cli" -version = "1.0.6+20170522" +version = "1.0.6+20170914" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta5-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-appengine1_beta5] path = "../appengine1_beta5" -version = "1.0.6+20170522" +version = "1.0.6+20170914" diff --git a/gen/appengine1_beta5-cli/README.md b/gen/appengine1_beta5-cli/README.md index 3a08b3ae59..5439ac4777 100644 --- a/gen/appengine1_beta5-cli/README.md +++ b/gen/appengine1_beta5-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appengine* API at revision *20170522*. The CLI is at version *1.0.6*. +This documentation was generated from the *appengine* API at revision *20170914*. The CLI is at version *1.0.6*. ```bash appengine1-beta5 [options] diff --git a/gen/appengine1_beta5-cli/mkdocs.yml b/gen/appengine1_beta5-cli/mkdocs.yml index e0a64443f6..88dd94b96b 100644 --- a/gen/appengine1_beta5-cli/mkdocs.yml +++ b/gen/appengine1_beta5-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.6+20170522 +site_name: appengine v1.0.6+20170914 site_url: http://byron.github.io/google-apis-rs/google-appengine1_beta5-cli site_description: A complete library to interact with appengine (protocol v1beta5) diff --git a/gen/appengine1_beta5-cli/src/main.rs b/gen/appengine1_beta5-cli/src/main.rs index e73353e8da..4f13106da7 100644 --- a/gen/appengine1_beta5-cli/src/main.rs +++ b/gen/appengine1_beta5-cli/src/main.rs @@ -74,13 +74,13 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-domain" => Some(("authDomain", 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!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "iap", "id", "location", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -454,13 +454,13 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-domain" => Some(("authDomain", 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!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "iap", "id", "location", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -714,8 +714,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "split.shard-by" => Some(("split.shardBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "split.allocations" => Some(("split.allocations", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Map })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", 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!["allocations", "id", "name", "shard-by", "split"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -809,21 +809,18 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "endpoints-api-service.config-id" => Some(("endpointsApiService.configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "endpoints-api-service.name" => Some(("endpointsApiService.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "basic-scaling.idle-timeout" => Some(("basicScaling.idleTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "basic-scaling.max-instances" => Some(("basicScaling.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "vm" => Some(("vm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "instance-class" => Some(("instanceClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.url" => Some(("apiConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.security-level" => Some(("apiConfig.securityLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "health-check.restart-threshold" => Some(("healthCheck.restartThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "health-check.check-interval" => Some(("healthCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.unhealthy-threshold" => Some(("healthCheck.unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -831,45 +828,49 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-usage-bytes" => Some(("diskUsageBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-concurrent-requests" => Some(("automaticScaling.requestUtilization.targetConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-request-count-per-sec" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.max-total-instances" => Some(("automaticScaling.maxTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.max-concurrent-requests" => Some(("automaticScaling.maxConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.min-total-instances" => Some(("automaticScaling.minTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env-variables" => Some(("envVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "runtime-api-version" => Some(("runtimeApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "subnetwork-name", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "runtime-api-version", "script", "security-level", "serving-status", "subnetwork-name", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1372,21 +1373,18 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "endpoints-api-service.config-id" => Some(("endpointsApiService.configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "endpoints-api-service.name" => Some(("endpointsApiService.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "basic-scaling.idle-timeout" => Some(("basicScaling.idleTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "basic-scaling.max-instances" => Some(("basicScaling.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "vm" => Some(("vm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "instance-class" => Some(("instanceClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.url" => Some(("apiConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.security-level" => Some(("apiConfig.securityLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "health-check.restart-threshold" => Some(("healthCheck.restartThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "health-check.check-interval" => Some(("healthCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.unhealthy-threshold" => Some(("healthCheck.unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1394,45 +1392,49 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-usage-bytes" => Some(("diskUsageBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-concurrent-requests" => Some(("automaticScaling.requestUtilization.targetConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-request-count-per-sec" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.max-total-instances" => Some(("automaticScaling.maxTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.max-concurrent-requests" => Some(("automaticScaling.maxConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.min-total-instances" => Some(("automaticScaling.minTotalInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.target-utilization" => Some(("automaticScaling.cpuUtilization.targetUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "automatic-scaling.cpu-utilization.aggregation-window-length" => Some(("automaticScaling.cpuUtilization.aggregationWindowLength", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "env-variables" => Some(("envVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network.instance-tag" => Some(("network.instanceTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.forwarded-ports" => Some(("network.forwardedPorts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network.name" => Some(("network.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.subnetwork-name" => Some(("network.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "runtime-api-version" => Some(("runtimeApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "subnetwork-name", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "creation-time", "default-expiration", "deployer", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "runtime-api-version", "script", "security-level", "serving-status", "subnetwork-name", "target-concurrent-requests", "target-read-bytes-per-sec", "target-read-ops-per-sec", "target-received-bytes-per-sec", "target-received-packets-per-sec", "target-request-count-per-sec", "target-sent-bytes-per-sec", "target-sent-packets-per-sec", "target-utilization", "target-write-bytes-per-sec", "target-write-ops-per-sec", "threadsafe", "timeout", "unhealthy-threshold", "url", "vm"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1781,12 +1783,12 @@ fn main() { Some(false)), ]), ("operations-list", - Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations."##), + Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli/apps_operations-list", vec![ (Some(r##"apps-id"##), None, - Some(r##"Part of `name`. The name of the operation collection."##), + Some(r##"Part of `name`. The name of the operation's parent resource."##), Some(true), Some(false)), @@ -2284,7 +2286,7 @@ fn main() { let mut app = App::new("appengine1-beta5") .author("Sebastian Thiel ") - .version("1.0.6+20170522") + .version("1.0.6+20170914") .about("The App Engine Admin API enables developers to provision and manage their App Engine applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli") .arg(Arg::with_name("url") diff --git a/gen/appengine1_beta5/Cargo.toml b/gen/appengine1_beta5/Cargo.toml index b9191def93..919c6fa7c0 100644 --- a/gen/appengine1_beta5/Cargo.toml +++ b/gen/appengine1_beta5/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1_beta5" -version = "1.0.6+20170522" +version = "1.0.6+20170914" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta5" homepage = "https://cloud.google.com/appengine/docs/admin-api/" -documentation = "https://docs.rs/google-appengine1_beta5/1.0.6+20170522" +documentation = "https://docs.rs/google-appengine1_beta5/1.0.6+20170914" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1_beta5/README.md b/gen/appengine1_beta5/README.md index 07b51ff2de..c465d2defd 100644 --- a/gen/appengine1_beta5/README.md +++ b/gen/appengine1_beta5/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appengine1_beta5` library allows access to all features of the *Google appengine* service. -This documentation was generated from *appengine* crate version *1.0.6+20170522*, where *20170522* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *appengine* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *appengine* *v1_beta5* API can be found at the [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.AppServiceVersionPatchCall.html) + * [*create*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.AppServiceVersionPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/struct.Appengine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/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")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/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](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/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](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/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](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/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](https://docs.rs/google-appengine1_beta5/1.0.6+20170522/google_appengine1_beta5/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta5/1.0.6+20170914/google_appengine1_beta5/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appengine1_beta5/src/lib.rs b/gen/appengine1_beta5/src/lib.rs index cb19228546..d5c1bb2031 100644 --- a/gen/appengine1_beta5/src/lib.rs +++ b/gen/appengine1_beta5/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 *appengine* crate version *1.0.6+20170522*, where *20170522* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *appengine* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *appengine* *v1_beta5* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -432,17 +432,17 @@ impl Part for Network {} /// 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*). /// -/// * [services get apps](struct.AppServiceGetCall.html) (response) /// * [services patch apps](struct.AppServicePatchCall.html) (request) +/// * [services get apps](struct.AppServiceGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Service { + /// Mapping that defines fractional HTTP traffic diversion to different versions within the service. + pub split: Option, /// Relative name of the service within the application. Example: default.@OutputOnly pub id: Option, /// Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly pub name: Option, - /// Mapping that defines fractional HTTP traffic diversion to different versions within the service. - pub split: Option, } impl RequestValue for Service {} @@ -460,9 +460,9 @@ impl ResponseResult for Service {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Instance { - /// Time that this instance was started.@OutputOnly - #[serde(rename="startTimestamp")] - pub start_timestamp: Option, + /// App Engine release this instance is running on.@OutputOnly + #[serde(rename="appEngineRelease")] + pub app_engine_release: Option, /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly #[serde(rename="vmId")] pub vm_id: Option, @@ -474,8 +474,8 @@ pub struct Instance { pub vm_ip: Option, /// Average queries per second (QPS) over the last minute.@OutputOnly pub qps: Option, - /// Availability of the instance.@OutputOnly - pub availability: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + pub id: Option, /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly pub name: Option, /// Number of errors since this instance was started.@OutputOnly @@ -486,8 +486,8 @@ pub struct Instance { /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly #[serde(rename="vmUnlocked")] pub vm_unlocked: Option, - /// Relative name of the instance within the version. Example: instance-1.@OutputOnly - pub id: Option, + /// Availability of the instance.@OutputOnly + pub availability: Option, /// Average latency (ms) over the last minute.@OutputOnly #[serde(rename="averageLatency")] pub average_latency: Option, @@ -496,9 +496,9 @@ pub struct Instance { /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly #[serde(rename="vmName")] pub vm_name: Option, - /// App Engine release this instance is running on.@OutputOnly - #[serde(rename="appEngineRelease")] - pub app_engine_release: Option, + /// Time that this instance was started.@OutputOnly + #[serde(rename="startTimestamp")] + pub start_timestamp: Option, /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly #[serde(rename="vmZoneName")] pub vm_zone_name: Option, @@ -523,14 +523,15 @@ pub struct Version { /// Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app. #[serde(rename="endpointsApiService")] pub endpoints_api_service: Option, - /// Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set. - #[serde(rename="defaultExpiration")] - pub default_expiration: Option, /// A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity. #[serde(rename="basicScaling")] pub basic_scaling: Option, - /// Email address of the user who created this version.@OutputOnly - pub deployer: Option, + /// Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set. + #[serde(rename="defaultExpiration")] + pub default_expiration: Option, + /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. + #[serde(rename="manualScaling")] + pub manual_scaling: Option, /// Whether to deploy this version in a container on a virtual machine. pub vm: Option, /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. @@ -554,16 +555,19 @@ pub struct Version { pub serving_status: Option, /// Relative name of the version within the module. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: "default", "latest", and any name with the prefix "ah-". pub id: Option, - /// Extra network settings. Only applicable for VM runtimes. - pub network: Option, + /// Whether multiple requests can be dispatched to this version at once. + pub threadsafe: Option, + /// The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at https://cloud.google.com/appengine/docs/standard//config/appref + #[serde(rename="runtimeApiVersion")] + pub runtime_api_version: Option, /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. #[serde(rename="apiConfig")] pub api_config: Option, /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. #[serde(rename="nobuildFilesRegex")] pub nobuild_files_regex: Option, - /// Whether multiple requests can be dispatched to this version at once. - pub threadsafe: Option, + /// Extra network settings. Only applicable for VM runtimes. + pub network: Option, /// An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set. pub handlers: Option>, /// Configures health checking for VM instances. Unhealthy instances are be stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set. @@ -576,9 +580,8 @@ pub struct Version { pub name: Option, /// Configuration for third-party Python runtime libraries required by the application.Only returned in GET requests if view=FULL is set. pub libraries: Option>, - /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. - #[serde(rename="manualScaling")] - pub manual_scaling: Option, + /// Email address of the user who created this version.@OutputOnly + pub deployer: Option, /// App Engine execution environment to use for this version.Defaults to 1. pub env: Option, /// Total size of version files hosted on App Engine disk in bytes.@OutputOnly @@ -692,16 +695,16 @@ impl Part for CpuUtilization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Resources { - /// Volumes mounted within the app container. - pub volumes: Option>, + /// Memory (GB) needed. + #[serde(rename="memoryGb")] + pub memory_gb: Option, /// Disk size (GB) needed. #[serde(rename="diskGb")] pub disk_gb: Option, /// Number of CPU cores needed. pub cpu: Option, - /// Memory (GB) needed. - #[serde(rename="memoryGb")] - pub memory_gb: Option, + /// Volumes mounted within the app container. + pub volumes: Option>, } impl Part for Resources {} @@ -724,7 +727,7 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. pub details: Option>>, } @@ -767,12 +770,12 @@ pub struct StaticFilesHandler { /// Whether this handler should match the request if the file referenced by the handler does not exist. #[serde(rename="requireMatchingFile")] pub require_matching_file: Option, - /// HTTP headers to use for all responses from these URLs. - #[serde(rename="httpHeaders")] - pub http_headers: Option>, /// Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas. #[serde(rename="applicationReadable")] pub application_readable: Option, + /// HTTP headers to use for all responses from these URLs. + #[serde(rename="httpHeaders")] + pub http_headers: Option>, } impl Part for StaticFilesHandler {} @@ -787,15 +790,15 @@ pub struct NetworkUtilization { /// Target bytes received per second. #[serde(rename="targetReceivedBytesPerSec")] pub target_received_bytes_per_sec: Option, - /// Target bytes sent per second. - #[serde(rename="targetSentBytesPerSec")] - pub target_sent_bytes_per_sec: Option, - /// Target packets received per second. - #[serde(rename="targetReceivedPacketsPerSec")] - pub target_received_packets_per_sec: Option, /// Target packets sent per second. #[serde(rename="targetSentPacketsPerSec")] pub target_sent_packets_per_sec: Option, + /// Target packets received per second. + #[serde(rename="targetReceivedPacketsPerSec")] + pub target_received_packets_per_sec: Option, + /// Target bytes sent per second. + #[serde(rename="targetSentBytesPerSec")] + pub target_sent_bytes_per_sec: Option, } impl Part for NetworkUtilization {} @@ -934,6 +937,26 @@ pub struct HealthCheck { impl Part for HealthCheck {} +/// Custom static error page to be served when an error occurs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ErrorHandler { + /// MIME type of file. Defaults to text/html. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// Error condition this handler applies to. + #[serde(rename="errorCode")] + pub error_code: Option, + /// Static file content to be served for this error. + #[serde(rename="staticFile")] + pub static_file: Option, +} + +impl Part for ErrorHandler {} + + /// Identity-Aware Proxy /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -956,50 +979,30 @@ pub struct IdentityAwareProxy { impl Part for IdentityAwareProxy {} -/// Custom static error page to be served when an error occurs. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ErrorHandler { - /// Error condition this handler applies to. - #[serde(rename="errorCode")] - pub error_code: Option, - /// MIME type of file. Defaults to text/html. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// Static file content to be served for this error. - #[serde(rename="staticFile")] - pub static_file: Option, -} - -impl Part for ErrorHandler {} - - /// Automatic scaling is based on request rate, response latencies, and other application metrics. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AutomaticScaling { - /// Target scaling by CPU usage. - #[serde(rename="cpuUtilization")] - pub cpu_utilization: Option, + /// Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it. + #[serde(rename="minPendingLatency")] + pub min_pending_latency: Option, /// Target scaling by network usage. #[serde(rename="networkUtilization")] pub network_utilization: Option, - /// Target scaling by disk usage. - #[serde(rename="diskUtilization")] - pub disk_utilization: Option, + /// Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module. + #[serde(rename="minIdleInstances")] + pub min_idle_instances: Option, /// Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it. #[serde(rename="maxPendingLatency")] pub max_pending_latency: Option, /// Maximum number of idle instances that should be maintained for this version. #[serde(rename="maxIdleInstances")] pub max_idle_instances: Option, - /// Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a module. - #[serde(rename="minIdleInstances")] - pub min_idle_instances: Option, + /// Target scaling by disk usage. + #[serde(rename="diskUtilization")] + pub disk_utilization: Option, /// Target scaling by request utilization. #[serde(rename="requestUtilization")] pub request_utilization: Option, @@ -1015,9 +1018,9 @@ pub struct AutomaticScaling { /// Minimum number of instances that should be maintained for this version. #[serde(rename="minTotalInstances")] pub min_total_instances: Option, - /// Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it. - #[serde(rename="minPendingLatency")] - pub min_pending_latency: Option, + /// Target scaling by CPU usage. + #[serde(rename="cpuUtilization")] + pub cpu_utilization: Option, } impl Part for AutomaticScaling {} @@ -1121,8 +1124,8 @@ impl ResponseResult for ListOperationsResponse {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [create apps](struct.AppCreateCall.html) (request) -/// * [patch apps](struct.AppPatchCall.html) (request) /// * [get apps](struct.AppGetCall.html) (response) +/// * [patch apps](struct.AppPatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Application { @@ -1143,15 +1146,15 @@ pub struct Application { /// Cookie expiration policy for this application. #[serde(rename="defaultCookieExpiration")] pub default_cookie_expiration: Option, - /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. - pub id: Option, + /// no description provided + pub iap: Option, /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US pub location: Option, /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. #[serde(rename="authDomain")] pub auth_domain: Option, - /// no description provided - pub iap: Option, + /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. + pub id: Option, } impl RequestValue for Application {} @@ -1195,11 +1198,11 @@ pub struct ApiConfigHandler { /// Security (HTTPS) enforcement for this URL. #[serde(rename="securityLevel")] pub security_level: Option, + /// Level of login required to access this resource. Defaults to optional. + pub login: Option, /// Action to take when users access resources that require authentication. Defaults to redirect. #[serde(rename="authFailAction")] pub auth_fail_action: Option, - /// Level of login required to access this resource. Defaults to optional. - pub login: Option, /// Path to the script from the application root directory. pub script: Option, } @@ -1289,11 +1292,11 @@ impl Part for RequestUtilization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListServicesResponse { - /// The services belonging to the requested application. - pub services: Option>, /// Continuation token for fetching the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The services belonging to the requested application. + pub services: Option>, } impl ResponseResult for ListServicesResponse {} @@ -1660,11 +1663,11 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations. + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. /// /// # Arguments /// - /// * `appsId` - Part of `name`. The name of the operation collection. + /// * `appsId` - Part of `name`. The name of the operation's parent resource. pub fn operations_list(&self, apps_id: &str) -> AppOperationListCall<'a, C, A> { AppOperationListCall { hub: self.hub, @@ -2080,10 +2083,10 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -2982,10 +2985,10 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -3528,10 +3531,10 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -3848,10 +3851,10 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionListCall<'a, C, A> where C: BorrowMut AppOperationGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -4679,10 +4682,10 @@ impl<'a, C, A> AppServiceListCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -4964,10 +4967,10 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -5249,10 +5252,10 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, } - /// Part of `name`. The name of the operation collection. + /// Part of `name`. The name of the operation's parent resource. /// /// Sets the *apps id* path property to the given value. /// @@ -5534,10 +5537,10 @@ impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -5807,10 +5810,10 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppLocationGetCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -6384,10 +6387,10 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -6645,10 +6648,10 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -6906,10 +6909,10 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -7155,10 +7158,10 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. @@ -7440,10 +7443,10 @@ impl<'a, C, A> AppServiceVersionGetCall<'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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-appsactivity1] path = "../appsactivity1" -version = "1.0.6+20170215" +version = "1.0.6+20170921" diff --git a/gen/appsactivity1-cli/README.md b/gen/appsactivity1-cli/README.md index a2eab43507..332cc3233d 100644 --- a/gen/appsactivity1-cli/README.md +++ b/gen/appsactivity1-cli/README.md @@ -25,7 +25,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 *20170215*. The CLI is at version *1.0.6*. +This documentation was generated from the *appsactivity* API at revision *20170921*. The CLI is at version *1.0.6*. ```bash appsactivity1 [options] diff --git a/gen/appsactivity1-cli/mkdocs.yml b/gen/appsactivity1-cli/mkdocs.yml index a677b1d2e0..da53271cf2 100644 --- a/gen/appsactivity1-cli/mkdocs.yml +++ b/gen/appsactivity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appsactivity v1.0.6+20170215 +site_name: appsactivity v1.0.6+20170921 site_url: http://byron.github.io/google-apis-rs/google-appsactivity1-cli site_description: A complete library to interact with appsactivity (protocol v1) diff --git a/gen/appsactivity1-cli/src/main.rs b/gen/appsactivity1-cli/src/main.rs index 75bf79eaa4..6da9f76ab4 100644 --- a/gen/appsactivity1-cli/src/main.rs +++ b/gen/appsactivity1-cli/src/main.rs @@ -241,7 +241,7 @@ fn main() { let mut app = App::new("appsactivity1") .author("Sebastian Thiel ") - .version("1.0.6+20170215") + .version("1.0.6+20170921") .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 28fbfad9b6..74ae8824f9 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appsactivity1" -version = "1.0.6+20170215" +version = "1.0.6+20170921" 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" homepage = "https://developers.google.com/google-apps/activity/" -documentation = "https://docs.rs/google-appsactivity1/1.0.6+20170215" +documentation = "https://docs.rs/google-appsactivity1/1.0.6+20170921" license = "MIT" keywords = ["appsactivity", "google", "protocol", "web", "api"] diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index deab1a04d3..6c22ce75d3 100644 --- a/gen/appsactivity1/README.md +++ b/gen/appsactivity1/README.md @@ -5,16 +5,16 @@ 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 *1.0.6+20170215*, where *20170215* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *appsactivity* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *appsactivity* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/activity/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/struct.Appsactivity.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/struct.Appsactivity.html) ... -* [activities](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/struct.Activity.html) - * [*list*](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/struct.ActivityListCall.html) +* [activities](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/struct.Activity.html) + * [*list*](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/struct.ActivityListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/struct.Appsactivity.html)** +* **[Hub](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/struct.Appsactivity.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -123,17 +123,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/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")`. @@ -143,29 +143,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/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](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/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](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/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](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/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](https://docs.rs/google-appsactivity1/1.0.6+20170215/google_appsactivity1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appsactivity1/src/lib.rs b/gen/appsactivity1/src/lib.rs index 0771fd0bac..dc5477c18a 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 *1.0.6+20170215*, where *20170215* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *appsactivity* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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/appstate1-cli/Cargo.toml b/gen/appstate1-cli/Cargo.toml index 38d7d9cf78..4f7a0c8c6d 100644 --- a/gen/appstate1-cli/Cargo.toml +++ b/gen/appstate1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1-cli" -version = "1.0.6+20170511" +version = "1.0.6+20170925" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-appstate1] path = "../appstate1" -version = "1.0.6+20170511" +version = "1.0.6+20170925" diff --git a/gen/appstate1-cli/README.md b/gen/appstate1-cli/README.md index 52a641e5a5..d92e299c6d 100644 --- a/gen/appstate1-cli/README.md +++ b/gen/appstate1-cli/README.md @@ -25,7 +25,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 *20170511*. The CLI is at version *1.0.6*. +This documentation was generated from the *App State* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash appstate1 [options] diff --git a/gen/appstate1-cli/mkdocs.yml b/gen/appstate1-cli/mkdocs.yml index 40bfdd897b..93055086aa 100644 --- a/gen/appstate1-cli/mkdocs.yml +++ b/gen/appstate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: App State v1.0.6+20170511 +site_name: App State v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-appstate1-cli site_description: A complete library to interact with App State (protocol v1) diff --git a/gen/appstate1-cli/src/main.rs b/gen/appstate1-cli/src/main.rs index 155458b44a..8cd12b1467 100644 --- a/gen/appstate1-cli/src/main.rs +++ b/gen/appstate1-cli/src/main.rs @@ -569,7 +569,7 @@ fn main() { let mut app = App::new("appstate1") .author("Sebastian Thiel ") - .version("1.0.6+20170511") + .version("1.0.6+20170925") .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 ac28ea4801..952dfb31cd 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appstate1" -version = "1.0.6+20170511" +version = "1.0.6+20170925" 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" homepage = "https://developers.google.com/games/services/web/api/states" -documentation = "https://docs.rs/google-appstate1/1.0.6+20170511" +documentation = "https://docs.rs/google-appstate1/1.0.6+20170925" license = "MIT" keywords = ["appstate", "google", "protocol", "web", "api"] diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index 819e165279..19c53a8aaf 100644 --- a/gen/appstate1/README.md +++ b/gen/appstate1/README.md @@ -5,16 +5,16 @@ 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *App State* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. 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). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.AppState.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.AppState.html) ... * states - * [*clear*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.StateUpdateCall.html) + * [*clear*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.StateUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/struct.AppState.html)** +* **[Hub](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/struct.AppState.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/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")`. @@ -144,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/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](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/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](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/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](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/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](https://docs.rs/google-appstate1/1.0.6+20170511/google_appstate1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appstate1/src/lib.rs b/gen/appstate1/src/lib.rs index 4d8ba8dd2e..7b65c32787 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *App State* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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/bigquery2-cli/Cargo.toml b/gen/bigquery2-cli/Cargo.toml index f190ba5143..1cb9530946 100644 --- a/gen/bigquery2-cli/Cargo.toml +++ b/gen/bigquery2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2-cli" -version = "1.0.6+20170511" +version = "1.0.6+20170917" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-bigquery2] path = "../bigquery2" -version = "1.0.6+20170511" +version = "1.0.6+20170917" diff --git a/gen/bigquery2-cli/README.md b/gen/bigquery2-cli/README.md index 93f3dea420..51d1ea25e1 100644 --- a/gen/bigquery2-cli/README.md +++ b/gen/bigquery2-cli/README.md @@ -25,7 +25,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 *20170511*. The CLI is at version *1.0.6*. +This documentation was generated from the *bigquery* API at revision *20170917*. The CLI is at version *1.0.6*. ```bash bigquery2 [options] @@ -44,6 +44,7 @@ bigquery2 [options] list [-p ]... [-o ] query (-r )... [-p ]... [-o ] projects + get-service-account [-p ]... [-o ] list [-p ]... [-o ] tabledata insert-all (-r )... [-p ]... [-o ] diff --git a/gen/bigquery2-cli/mkdocs.yml b/gen/bigquery2-cli/mkdocs.yml index a2c73c3ff8..e500a9d3ae 100644 --- a/gen/bigquery2-cli/mkdocs.yml +++ b/gen/bigquery2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: bigquery v1.0.6+20170511 +site_name: bigquery v1.0.6+20170917 site_url: http://byron.github.io/google-apis-rs/google-bigquery2-cli site_description: A complete library to interact with bigquery (protocol v2) @@ -21,6 +21,7 @@ pages: - ['jobs_insert.md', 'Jobs', 'Insert'] - ['jobs_list.md', 'Jobs', 'List'] - ['jobs_query.md', 'Jobs', 'Query'] +- ['projects_get-service-account.md', 'Projects', 'Get Service Account'] - ['projects_list.md', 'Projects', 'List'] - ['tabledata_insert-all.md', 'Tabledata', 'Insert All'] - ['tabledata_list.md', 'Tabledata', 'List'] diff --git a/gen/bigquery2-cli/src/main.rs b/gen/bigquery2-cli/src/main.rs index 210bdda012..7c259e2114 100644 --- a/gen/bigquery2-cli/src/main.rs +++ b/gen/bigquery2-cli/src/main.rs @@ -701,12 +701,14 @@ impl<'n> Engine<'n> { "status.error-result.location" => Some(("status.errorResult.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.load.output-rows" => Some(("statistics.load.outputRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.load.bad-records" => Some(("statistics.load.badRecords", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.load.input-files" => Some(("statistics.load.inputFiles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.load.input-file-bytes" => Some(("statistics.load.inputFileBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.load.output-bytes" => Some(("statistics.load.outputBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.creation-time" => Some(("statistics.creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.total-bytes-processed" => Some(("statistics.totalBytesProcessed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.start-time" => Some(("statistics.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.total-slot-ms" => Some(("statistics.query.totalSlotMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.statement-type" => Some(("statistics.query.statementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.total-bytes-billed" => Some(("statistics.query.totalBytesBilled", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.total-bytes-processed" => Some(("statistics.query.totalBytesProcessed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -720,9 +722,12 @@ impl<'n> Engine<'n> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-email" => Some(("user_email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.schema-update-options" => Some(("configuration.load.schemaUpdateOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "configuration.load.skip-leading-rows" => Some(("configuration.load.skipLeadingRows", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "configuration.load.schema-inline-format" => Some(("configuration.load.schemaInlineFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.load.destination-encryption-configuration.kms-key-name" => Some(("configuration.load.destinationEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.encoding" => Some(("configuration.load.encoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.ignore-unknown-values" => Some(("configuration.load.ignoreUnknownValues", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "configuration.load.skip-leading-rows" => Some(("configuration.load.skipLeadingRows", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "configuration.load.quote" => Some(("configuration.load.quote", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.autodetect" => Some(("configuration.load.autodetect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.load.destination-table.project-id" => Some(("configuration.load.destinationTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.destination-table.table-id" => Some(("configuration.load.destinationTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -732,10 +737,11 @@ impl<'n> Engine<'n> { "configuration.load.allow-jagged-rows" => Some(("configuration.load.allowJaggedRows", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.load.write-disposition" => Some(("configuration.load.writeDisposition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.source-uris" => Some(("configuration.load.sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "configuration.load.quote" => Some(("configuration.load.quote", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.field-delimiter" => Some(("configuration.load.fieldDelimiter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.create-disposition" => Some(("configuration.load.createDisposition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration.load.schema-inline-format" => Some(("configuration.load.schemaInlineFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.load.time-partitioning.field" => Some(("configuration.load.timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.load.time-partitioning.type" => Some(("configuration.load.timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.load.time-partitioning.expiration-ms" => Some(("configuration.load.timePartitioning.expirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.schema-inline" => Some(("configuration.load.schemaInline", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.load.allow-quoted-newlines" => Some(("configuration.load.allowQuotedNewlines", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.load.projection-fields" => Some(("configuration.load.projectionFields", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -743,28 +749,33 @@ impl<'n> Engine<'n> { "configuration.dry-run" => Some(("configuration.dryRun", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.labels" => Some(("configuration.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "configuration.query.flatten-results" => Some(("configuration.query.flattenResults", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "configuration.query.maximum-billing-tier" => Some(("configuration.query.maximumBillingTier", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "configuration.query.destination-encryption-configuration.kms-key-name" => Some(("configuration.query.destinationEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.use-query-cache" => Some(("configuration.query.useQueryCache", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.query.default-dataset.project-id" => Some(("configuration.query.defaultDataset.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.default-dataset.dataset-id" => Some(("configuration.query.defaultDataset.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration.query.use-legacy-sql" => Some(("configuration.query.useLegacySql", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "configuration.query.parameter-mode" => Some(("configuration.query.parameterMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.destination-table.project-id" => Some(("configuration.query.destinationTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.destination-table.table-id" => Some(("configuration.query.destinationTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.destination-table.dataset-id" => Some(("configuration.query.destinationTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.schema-update-options" => Some(("configuration.query.schemaUpdateOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "configuration.query.priority" => Some(("configuration.query.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.query.use-legacy-sql" => Some(("configuration.query.useLegacySql", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.query.write-disposition" => Some(("configuration.query.writeDisposition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.allow-large-results" => Some(("configuration.query.allowLargeResults", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "configuration.query.time-partitioning.field" => Some(("configuration.query.timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.query.time-partitioning.type" => Some(("configuration.query.timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.query.time-partitioning.expiration-ms" => Some(("configuration.query.timePartitioning.expirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.create-disposition" => Some(("configuration.query.createDisposition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.query" => Some(("configuration.query.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.query.preserve-nulls" => Some(("configuration.query.preserveNulls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.query.maximum-bytes-billed" => Some(("configuration.query.maximumBytesBilled", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration.query.parameter-mode" => Some(("configuration.query.parameterMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.query.maximum-billing-tier" => Some(("configuration.query.maximumBillingTier", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "configuration.copy.create-disposition" => Some(("configuration.copy.createDisposition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.write-disposition" => Some(("configuration.copy.writeDisposition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.destination-table.project-id" => Some(("configuration.copy.destinationTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.destination-table.table-id" => Some(("configuration.copy.destinationTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.destination-table.dataset-id" => Some(("configuration.copy.destinationTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.copy.destination-encryption-configuration.kms-key-name" => Some(("configuration.copy.destinationEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.source-table.project-id" => Some(("configuration.copy.sourceTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.source-table.table-id" => Some(("configuration.copy.sourceTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.source-table.dataset-id" => Some(("configuration.copy.sourceTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -780,7 +791,7 @@ impl<'n> Engine<'n> { "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!["allow-jagged-rows", "allow-large-results", "allow-quoted-newlines", "autodetect", "billing-tier", "cache-hit", "compression", "configuration", "copy", "create-disposition", "creation-time", "dataset-id", "debug-info", "default-dataset", "destination-format", "destination-table", "destination-uri", "destination-uri-file-counts", "destination-uris", "dry-run", "encoding", "end-time", "error-result", "etag", "extract", "field-delimiter", "flatten-results", "id", "ignore-unknown-values", "input-file-bytes", "input-files", "job-id", "job-reference", "kind", "labels", "load", "location", "max-bad-records", "maximum-billing-tier", "maximum-bytes-billed", "message", "null-marker", "num-dml-affected-rows", "output-bytes", "output-rows", "parameter-mode", "preserve-nulls", "print-header", "priority", "project-id", "projection-fields", "query", "quote", "reason", "schema-inline", "schema-inline-format", "schema-update-options", "self-link", "skip-leading-rows", "source-format", "source-table", "source-uris", "start-time", "state", "statement-type", "statistics", "status", "table-id", "total-bytes-billed", "total-bytes-processed", "use-legacy-sql", "use-query-cache", "user-email", "write-disposition"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-large-results", "allow-quoted-newlines", "autodetect", "bad-records", "billing-tier", "cache-hit", "compression", "configuration", "copy", "create-disposition", "creation-time", "dataset-id", "debug-info", "default-dataset", "destination-encryption-configuration", "destination-format", "destination-table", "destination-uri", "destination-uri-file-counts", "destination-uris", "dry-run", "encoding", "end-time", "error-result", "etag", "expiration-ms", "extract", "field", "field-delimiter", "flatten-results", "id", "ignore-unknown-values", "input-file-bytes", "input-files", "job-id", "job-reference", "kind", "kms-key-name", "labels", "load", "location", "max-bad-records", "maximum-billing-tier", "maximum-bytes-billed", "message", "null-marker", "num-dml-affected-rows", "output-bytes", "output-rows", "parameter-mode", "preserve-nulls", "print-header", "priority", "project-id", "projection-fields", "query", "quote", "reason", "schema-inline", "schema-inline-format", "schema-update-options", "self-link", "skip-leading-rows", "source-format", "source-table", "source-uris", "start-time", "state", "statement-type", "statistics", "status", "table-id", "time-partitioning", "total-bytes-billed", "total-bytes-processed", "total-slot-ms", "type", "use-legacy-sql", "use-query-cache", "user-email", "write-disposition"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1007,6 +1018,58 @@ impl<'n> Engine<'n> { } } + fn _projects_get_service_account(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get_service_account(opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().list(); @@ -1342,6 +1405,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1353,7 +1417,7 @@ impl<'n> Engine<'n> { "table-reference.project-id" => Some(("tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.table-id" => Some(("tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.dataset-id" => Some(("tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-configuration.kms-key-name" => Some(("encryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "num-bytes" => Some(("numBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "external-data-configuration.compression" => Some(("externalDataConfiguration.compression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1371,8 +1435,9 @@ impl<'n> Engine<'n> { "external-data-configuration.bigtable-options.ignore-unspecified-column-families" => Some(("externalDataConfiguration.bigtableOptions.ignoreUnspecifiedColumnFamilies", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "external-data-configuration.source-format" => Some(("externalDataConfiguration.sourceFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "external-data-configuration.google-sheets-options.skip-leading-rows" => Some(("externalDataConfiguration.googleSheetsOptions.skipLeadingRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "num-long-term-bytes" => Some(("numLongTermBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time-partitioning.field" => Some(("timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.type" => Some(("timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.expiration-ms" => Some(("timePartitioning.expirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1381,9 +1446,9 @@ impl<'n> Engine<'n> { "type" => Some(("type", 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 })), - "num-long-term-bytes" => Some(("numLongTermBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field-delimiter", "friendly-name", "google-sheets-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "kind", "labels", "last-modified-time", "location", "max-bad-records", "num-bytes", "num-long-term-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "read-rowkey-as-string", "self-link", "skip-leading-rows", "source-format", "source-uris", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "encryption-configuration", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "friendly-name", "google-sheets-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "kind", "kms-key-name", "labels", "last-modified-time", "location", "max-bad-records", "num-bytes", "num-long-term-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "read-rowkey-as-string", "self-link", "skip-leading-rows", "source-format", "source-uris", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1525,6 +1590,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1536,7 +1602,7 @@ impl<'n> Engine<'n> { "table-reference.project-id" => Some(("tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.table-id" => Some(("tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.dataset-id" => Some(("tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-configuration.kms-key-name" => Some(("encryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "num-bytes" => Some(("numBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "external-data-configuration.compression" => Some(("externalDataConfiguration.compression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1554,8 +1620,9 @@ impl<'n> Engine<'n> { "external-data-configuration.bigtable-options.ignore-unspecified-column-families" => Some(("externalDataConfiguration.bigtableOptions.ignoreUnspecifiedColumnFamilies", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "external-data-configuration.source-format" => Some(("externalDataConfiguration.sourceFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "external-data-configuration.google-sheets-options.skip-leading-rows" => Some(("externalDataConfiguration.googleSheetsOptions.skipLeadingRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "num-long-term-bytes" => Some(("numLongTermBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time-partitioning.field" => Some(("timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.type" => Some(("timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.expiration-ms" => Some(("timePartitioning.expirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1564,9 +1631,9 @@ impl<'n> Engine<'n> { "type" => Some(("type", 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 })), - "num-long-term-bytes" => Some(("numLongTermBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field-delimiter", "friendly-name", "google-sheets-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "kind", "labels", "last-modified-time", "location", "max-bad-records", "num-bytes", "num-long-term-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "read-rowkey-as-string", "self-link", "skip-leading-rows", "source-format", "source-uris", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "encryption-configuration", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "friendly-name", "google-sheets-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "kind", "kms-key-name", "labels", "last-modified-time", "location", "max-bad-records", "num-bytes", "num-long-term-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "read-rowkey-as-string", "self-link", "skip-leading-rows", "source-format", "source-uris", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1649,6 +1716,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1660,7 +1728,7 @@ impl<'n> Engine<'n> { "table-reference.project-id" => Some(("tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.table-id" => Some(("tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.dataset-id" => Some(("tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-configuration.kms-key-name" => Some(("encryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "num-bytes" => Some(("numBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "external-data-configuration.compression" => Some(("externalDataConfiguration.compression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1678,8 +1746,9 @@ impl<'n> Engine<'n> { "external-data-configuration.bigtable-options.ignore-unspecified-column-families" => Some(("externalDataConfiguration.bigtableOptions.ignoreUnspecifiedColumnFamilies", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "external-data-configuration.source-format" => Some(("externalDataConfiguration.sourceFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "external-data-configuration.google-sheets-options.skip-leading-rows" => Some(("externalDataConfiguration.googleSheetsOptions.skipLeadingRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "num-long-term-bytes" => Some(("numLongTermBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time-partitioning.field" => Some(("timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.type" => Some(("timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.expiration-ms" => Some(("timePartitioning.expirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1688,9 +1757,9 @@ impl<'n> Engine<'n> { "type" => Some(("type", 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 })), - "num-long-term-bytes" => Some(("numLongTermBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field-delimiter", "friendly-name", "google-sheets-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "kind", "labels", "last-modified-time", "location", "max-bad-records", "num-bytes", "num-long-term-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "read-rowkey-as-string", "self-link", "skip-leading-rows", "source-format", "source-uris", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "encryption-configuration", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "friendly-name", "google-sheets-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "kind", "kms-key-name", "labels", "last-modified-time", "location", "max-bad-records", "num-bytes", "num-long-term-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "read-rowkey-as-string", "self-link", "skip-leading-rows", "source-format", "source-uris", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1809,6 +1878,9 @@ impl<'n> Engine<'n> { }, ("projects", Some(opt)) => { match opt.subcommand() { + ("get-service-account", Some(opt)) => { + call_result = self._projects_get_service_account(opt, dry_run, &mut err); + }, ("list", Some(opt)) => { call_result = self._projects_list(opt, dry_run, &mut err); }, @@ -2283,7 +2355,29 @@ fn main() { ]), ]), - ("projects", "methods: 'list'", vec![ + ("projects", "methods: 'get-service-account' and 'list'", vec![ + ("get-service-account", + Some(r##"Returns the email address of the service account for your project used for interactions with Google Cloud KMS."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquery2_cli/projects_get-service-account", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Project ID for which the service account is requested."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("list", Some(r##"Lists all projects to which you have been granted any project role."##), "Details at http://byron.github.io/google-apis-rs/google_bigquery2_cli/projects_list", @@ -2590,7 +2684,7 @@ fn main() { let mut app = App::new("bigquery2") .author("Sebastian Thiel ") - .version("1.0.6+20170511") + .version("1.0.6+20170917") .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 712e96e6e5..b238072f33 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigquery2" -version = "1.0.6+20170511" +version = "1.0.6+20170917" 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" homepage = "https://cloud.google.com/bigquery/" -documentation = "https://docs.rs/google-bigquery2/1.0.6+20170511" +documentation = "https://docs.rs/google-bigquery2/1.0.6+20170917" license = "MIT" keywords = ["bigquery", "google", "protocol", "web", "api"] diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 29dbf5d300..19cfbdb2c2 100644 --- a/gen/bigquery2/README.md +++ b/gen/bigquery2/README.md @@ -5,29 +5,29 @@ 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *bigquery* crate version *1.0.6+20170917*, where *20170917* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *bigquery* *v2* API can be found at the [official documentation site](https://cloud.google.com/bigquery/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.Bigquery.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.Bigquery.html) ... -* [datasets](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.Dataset.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.DatasetUpdateCall.html) -* [jobs](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.Job.html) - * [*cancel*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobQueryCall.html) +* [datasets](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.Dataset.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.DatasetUpdateCall.html) +* [jobs](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.Job.html) + * [*cancel*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobQueryCall.html) * projects - * [*list*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.ProjectListCall.html) + * [*get service account*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.ProjectGetServiceAccountCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.ProjectListCall.html) * tabledata - * [*insert all*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TabledataListCall.html) -* [tables](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.Table.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.TableUpdateCall.html) + * [*insert all*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TabledataListCall.html) +* [tables](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.Table.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.TableUpdateCall.html) Upload supported by ... -* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.JobInsertCall.html) +* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobInsertCall.html) @@ -35,17 +35,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/struct.Bigquery.html)** +* **[Hub](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.Bigquery.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.Part.html)** + * **[Parts](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/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")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/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](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/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](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/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](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/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](https://docs.rs/google-bigquery2/1.0.6+20170511/google_bigquery2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/bigquery2/src/lib.rs b/gen/bigquery2/src/lib.rs index d7c6efcad0..0a3bcccb2e 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *bigquery* crate version *1.0.6+20170917*, where *20170917* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *bigquery* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/bigquery/). @@ -16,7 +16,7 @@ //! * [jobs](struct.Job.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) +//! * [*get service account*](struct.ProjectGetServiceAccountCall.html) and [*list*](struct.ProjectListCall.html) //! * tabledata //! * [*insert all*](struct.TabledataInsertAllCall.html) and [*list*](struct.TabledataListCall.html) //! * [tables](struct.Table.html) @@ -474,7 +474,7 @@ pub struct QueryRequest { /// [Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'. #[serde(rename="defaultDataset")] pub default_dataset: Option, - /// Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false. + /// Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false. #[serde(rename="useLegacySql")] pub use_legacy_sql: Option, /// [Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies. @@ -499,6 +499,9 @@ impl RequestValue for QueryRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobStatistics2 { + /// [Output-only] Slot-milliseconds for the job. + #[serde(rename="totalSlotMs")] + pub total_slot_ms: Option, /// [Output-only] Describes execution plan for the query. #[serde(rename="queryPlan")] pub query_plan: Option>, @@ -542,15 +545,18 @@ pub struct JobStatistics3 { /// [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change. #[serde(rename="outputRows")] pub output_rows: Option, + /// [Output-only] The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed in the load job configuration, then this number can be less than the total number of bad records present in the input data. + #[serde(rename="badRecords")] + pub bad_records: Option, /// [Output-only] Number of source files in a load job. #[serde(rename="inputFiles")] pub input_files: Option, - /// [Output-only] Number of bytes of source data in a load job. - #[serde(rename="inputFileBytes")] - pub input_file_bytes: Option, /// [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change. #[serde(rename="outputBytes")] pub output_bytes: Option, + /// [Output-only] Number of bytes of source data in a load job. + #[serde(rename="inputFileBytes")] + pub input_file_bytes: Option, } impl Part for JobStatistics3 {} @@ -583,30 +589,16 @@ impl Part for JsonObject {} /// 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 projects](struct.ProjectListCall.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 ProjectList { - /// A token to request the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The total number of projects in the list. - #[serde(rename="totalItems")] - pub total_items: Option, - /// The type of list. - pub kind: Option, - /// A hash of the page of results - pub etag: Option, - /// Projects to which you have at least READ access. - pub projects: Option>, +pub struct EncryptionConfiguration { + /// [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key. + #[serde(rename="kmsKeyName")] + pub kms_key_name: Option, } -impl ResponseResult for ProjectList {} +impl Part for EncryptionConfiguration {} /// There is no detailed description. @@ -617,7 +609,7 @@ impl ResponseResult for ProjectList {} pub struct TableFieldSchema { /// [Optional] Describes the nested schema fields if the type property is set to RECORD. pub fields: Option>, - /// [Optional] The field description. The maximum length is 512 characters. + /// [Optional] The field description. The maximum length is 1,024 characters. pub description: Option, /// [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD). #[serde(rename="type")] @@ -796,11 +788,43 @@ impl Part for JobReference {} pub struct ExplainQueryStage { /// Current status for the stage. pub status: Option, + /// Total number of bytes written to shuffle. + #[serde(rename="shuffleOutputBytes")] + pub shuffle_output_bytes: Option, + /// Milliseconds the slowest shard spent on CPU-bound tasks. + #[serde(rename="computeMsMax")] + pub compute_ms_max: Option, + /// Milliseconds the average shard spent on CPU-bound tasks. + #[serde(rename="computeMsAvg")] + pub compute_ms_avg: Option, + /// Total number of bytes written to shuffle and spilled to disk. + #[serde(rename="shuffleOutputBytesSpilled")] + pub shuffle_output_bytes_spilled: Option, + /// Milliseconds the average shard spent waiting to be scheduled. + #[serde(rename="waitMsAvg")] + pub wait_ms_avg: Option, + /// Milliseconds the average shard spent on writing output. + #[serde(rename="writeMsAvg")] + pub write_ms_avg: Option, + /// Milliseconds the average shard spent reading input. + #[serde(rename="readMsAvg")] + pub read_ms_avg: Option, + /// Relative amount of time the average shard spent waiting to be scheduled. + #[serde(rename="waitRatioAvg")] + pub wait_ratio_avg: Option, + /// Unique ID for stage within plan. + pub id: Option, + /// Human-readable name for stage. + pub name: Option, /// Relative amount of time the slowest shard spent on CPU-bound tasks. #[serde(rename="computeRatioMax")] pub compute_ratio_max: Option, - /// Human-readable name for stage. - pub name: Option, + /// Milliseconds the slowest shard spent waiting to be scheduled. + #[serde(rename="waitMsMax")] + pub wait_ms_max: Option, + /// Milliseconds the slowest shard spent reading input. + #[serde(rename="readMsMax")] + pub read_ms_max: Option, /// Number of records written by the stage. #[serde(rename="recordsWritten")] pub records_written: Option, @@ -824,11 +848,9 @@ pub struct ExplainQueryStage { /// Relative amount of time the slowest shard spent on writing output. #[serde(rename="writeRatioMax")] pub write_ratio_max: Option, - /// Relative amount of time the average shard spent waiting to be scheduled. - #[serde(rename="waitRatioAvg")] - pub wait_ratio_avg: Option, - /// Unique ID for stage within plan. - pub id: Option, + /// Milliseconds the slowest shard spent on writing output. + #[serde(rename="writeMsMax")] + pub write_ms_max: Option, /// Relative amount of time the average shard spent on writing output. #[serde(rename="writeRatioAvg")] pub write_ratio_avg: Option, @@ -906,21 +928,24 @@ impl Part for UserDefinedFunctionResource {} pub struct TableListTables { /// The resource type. pub kind: Option, - /// Additional details for a view. - pub view: Option, + /// [Experimental] The labels associated with this table. You can use these to organize and group your tables. + pub labels: Option>, + /// An opaque ID of the table + pub id: Option, /// The user-friendly name for this table. #[serde(rename="friendlyName")] pub friendly_name: Option, - /// [Experimental] The labels associated with this table. You can use these to organize and group your tables. - pub labels: Option>, + /// [Experimental] The time-based partitioning for this table. + #[serde(rename="timePartitioning")] + pub time_partitioning: Option, /// The type of table. Possible values are: TABLE, VIEW. #[serde(rename="type")] pub type_: Option, /// A reference uniquely identifying the table. #[serde(rename="tableReference")] pub table_reference: Option, - /// An opaque ID of the table - pub id: Option, + /// Additional details for a view. + pub view: Option, } impl NestedType for TableListTables {} @@ -1040,45 +1065,15 @@ impl Resource for Job {} impl ResponseResult for Job {} -/// List of jobs that were requested. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobListJobs { - /// [Full-projection-only] Describes the state of the job. - pub status: Option, - /// The resource type. - pub kind: Option, - /// [Output-only] Information about the job, including starting time and ending time of the job. - pub statistics: Option, - /// Job reference uniquely identifying the job. - #[serde(rename="jobReference")] - pub job_reference: Option, - /// Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed. - pub state: Option, - /// A result object that will be present only if the job has failed. - #[serde(rename="errorResult")] - pub error_result: Option, - /// [Full-projection-only] Specifies the job configuration. - pub configuration: Option, - /// Unique opaque ID of the job. - pub id: Option, - /// [Full-projection-only] Email address of the user who ran the job. - pub user_email: Option, -} - -impl NestedType for JobListJobs {} -impl Part for JobListJobs {} - - /// 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 TimePartitioning { - /// [Required] The only type supported is DAY, which will generate one partition per day based on data loading time. + /// [Experimental] [Optional] If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if set, the table is partitioned by this field. The field must be a top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED. + pub field: Option, + /// [Required] The only type supported is DAY, which will generate one partition per day. #[serde(rename="type")] pub type_: Option, /// [Optional] Number of milliseconds for which to keep the storage for a partition. @@ -1095,28 +1090,33 @@ impl Part for TimePartitioning {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobConfigurationLoad { + /// [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). + #[serde(rename="destinationEncryptionConfiguration")] + pub destination_encryption_configuration: Option, /// [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. pub encoding: 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. - #[serde(rename="skipLeadingRows")] - pub skip_leading_rows: Option, + /// [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. + pub quote: Option, /// Indicates if we should automatically infer the options and schema for CSV and JSON sources. pub autodetect: Option, /// [Required] The destination table to load the data into. #[serde(rename="destinationTable")] pub destination_table: Option, - /// [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. + /// [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one URI can be specified. Also, the '*' wildcard character is not allowed. #[serde(rename="sourceUris")] pub source_uris: Option>, /// [Optional] Specifies a string that represents a null value in a CSV file. For example, if you specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default value is the empty string. If you set this property to a custom value, BigQuery throws an error if an empty string is present for all data types except for STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the empty string as an empty value. #[serde(rename="nullMarker")] pub null_marker: Option, - /// If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result. - #[serde(rename="projectionFields")] - pub projection_fields: Option>, + /// [Experimental] If specified, configures time-based partitioning for the destination table. + #[serde(rename="timePartitioning")] + pub time_partitioning: Option, /// Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false. #[serde(rename="allowQuotedNewlines")] pub allow_quoted_newlines: Option, + /// If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result. + #[serde(rename="projectionFields")] + pub projection_fields: Option>, /// [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing 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. Only applicable to CSV, ignored for other formats. #[serde(rename="allowJaggedRows")] pub allow_jagged_rows: Option, @@ -1129,7 +1129,7 @@ pub struct JobConfigurationLoad { /// [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. #[serde(rename="maxBadRecords")] pub max_bad_records: Option, - /// [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable. + /// [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job if a schema is autodetected or supplied in the job configuration. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable. #[serde(rename="schemaUpdateOptions")] pub schema_update_options: Option>, /// [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 @@ -1138,8 +1138,9 @@ pub struct JobConfigurationLoad { /// [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 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. - pub quote: 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. + #[serde(rename="skipLeadingRows")] + pub skip_leading_rows: Option, /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. #[serde(rename="createDisposition")] pub create_disposition: Option, @@ -1225,7 +1226,7 @@ impl Part for JobConfigurationExtract {} pub struct GetQueryResultsResponse { /// The resource type of the response. pub kind: Option, - /// [Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful. + /// [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. pub errors: Option>, /// Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults). #[serde(rename="jobReference")] @@ -1325,7 +1326,7 @@ pub struct ExternalDataConfiguration { /// [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 Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored. #[serde(rename="ignoreUnknownValues")] pub ignore_unknown_values: Option, - /// [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed. + /// [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed. #[serde(rename="sourceUris")] pub source_uris: Option>, /// [Optional] Additional options if sourceFormat is set to BIGTABLE. @@ -1425,6 +1426,31 @@ impl NestedType for DatasetAccess {} impl Part for DatasetAccess {} +/// Projects to which you have at least READ access. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProjectListProjects { + /// A descriptive name for this project. + #[serde(rename="friendlyName")] + pub friendly_name: Option, + /// The resource type. + pub kind: Option, + /// The numeric ID of this project. + #[serde(rename="numericId")] + pub numeric_id: Option, + /// An opaque ID of this project. + pub id: Option, + /// A unique reference to this project. + #[serde(rename="projectReference")] + pub project_reference: Option, +} + +impl NestedType for ProjectListProjects {} +impl Part for ProjectListProjects {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1433,7 +1459,7 @@ impl Part for DatasetAccess {} pub struct JobStatus { /// [Output-only] Running state of the job. pub state: Option, - /// [Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful. + /// [Output-only] The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. pub errors: Option>, /// [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful. #[serde(rename="errorResult")] @@ -1474,6 +1500,34 @@ impl Default for JsonValue { impl Part for JsonValue {} +/// 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 projects](struct.ProjectListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProjectList { + /// A token to request the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of projects in the list. + #[serde(rename="totalItems")] + pub total_items: Option, + /// The type of list. + pub kind: Option, + /// A hash of the page of results + pub etag: Option, + /// Projects to which you have at least READ access. + pub projects: Option>, +} + +impl ResponseResult for ProjectList {} + + /// There is no detailed description. /// /// # Activities @@ -1585,10 +1639,13 @@ pub struct JobConfigurationQuery { /// [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For standard SQL queries, this flag is ignored and results are never flattened. #[serde(rename="flattenResults")] pub flatten_results: Option, + /// [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). + #[serde(rename="destinationEncryptionConfiguration")] + pub destination_encryption_configuration: 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. The default value is true. #[serde(rename="useQueryCache")] pub use_query_cache: Option, - /// [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. + /// [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This property must be set for large results that exceed the maximum response size. #[serde(rename="destinationTable")] pub destination_table: Option, /// Query parameters for standard SQL queries. @@ -1611,7 +1668,7 @@ pub struct JobConfigurationQuery { /// [Optional] Specifies the default dataset to use for unqualified table names in the query. #[serde(rename="defaultDataset")] pub default_dataset: Option, - /// Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false. + /// Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false. #[serde(rename="useLegacySql")] pub use_legacy_sql: Option, /// [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable. @@ -1619,12 +1676,15 @@ pub struct JobConfigurationQuery { pub schema_update_options: Option>, /// [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. pub priority: 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 and uses the schema from the query result. 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. #[serde(rename="writeDisposition")] pub write_disposition: Option, - /// [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. + /// [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size. #[serde(rename="allowLargeResults")] pub allow_large_results: Option, + /// [Experimental] If specified, configures time-based partitioning for the destination table. + #[serde(rename="timePartitioning")] + pub time_partitioning: Option, /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. #[serde(rename="createDisposition")] pub create_disposition: Option, @@ -1693,29 +1753,36 @@ pub struct JobConfiguration { impl Part for JobConfiguration {} -/// Projects to which you have at least READ access. +/// List of jobs that were requested. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProjectListProjects { - /// A descriptive name for this project. - #[serde(rename="friendlyName")] - pub friendly_name: Option, +pub struct JobListJobs { + /// [Full-projection-only] Describes the state of the job. + pub status: Option, /// The resource type. pub kind: Option, - /// The numeric ID of this project. - #[serde(rename="numericId")] - pub numeric_id: Option, - /// An opaque ID of this project. + /// [Output-only] Information about the job, including starting time and ending time of the job. + pub statistics: Option, + /// Job reference uniquely identifying the job. + #[serde(rename="jobReference")] + pub job_reference: Option, + /// Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed. + pub state: Option, + /// A result object that will be present only if the job has failed. + #[serde(rename="errorResult")] + pub error_result: Option, + /// [Full-projection-only] Specifies the job configuration. + pub configuration: Option, + /// Unique opaque ID of the job. pub id: Option, - /// A unique reference to this project. - #[serde(rename="projectReference")] - pub project_reference: Option, + /// [Full-projection-only] Email address of the user who ran the job. + pub user_email: Option, } -impl NestedType for ProjectListProjects {} -impl Part for ProjectListProjects {} +impl NestedType for JobListJobs {} +impl Part for JobListJobs {} /// There is no detailed description. @@ -1812,6 +1879,26 @@ pub struct QueryParameterValue { impl Part for QueryParameterValue {} +/// 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*). +/// +/// * [get service account projects](struct.ProjectGetServiceAccountCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetServiceAccountResponse { + /// The resource type of the response. + pub kind: Option, + /// The service account email address. + pub email: Option, +} + +impl ResponseResult for GetServiceAccountResponse {} + + /// There is no detailed description. /// /// # Activities @@ -1844,8 +1931,14 @@ pub struct Table { /// [Output-only] The time when this table was last modified, in milliseconds since the epoch. #[serde(rename="lastModifiedTime")] pub last_modified_time: Option, + /// [Output-only] The number of bytes in the table that are considered "long-term storage". + #[serde(rename="numLongTermBytes")] + pub num_long_term_bytes: Option, /// [Output-only] An opaque ID uniquely identifying the table. pub id: Option, + /// [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). + #[serde(rename="encryptionConfiguration")] + pub encryption_configuration: Option, /// [Output-only] The type of the resource. pub kind: Option, /// [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer. @@ -1854,8 +1947,6 @@ pub struct Table { /// [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. #[serde(rename="externalDataConfiguration")] pub external_data_configuration: Option, - /// [Output-only] The geographic location where the table resides. This value is inherited from the dataset. - pub location: Option, /// [Required] Reference describing the ID of this table. #[serde(rename="tableReference")] pub table_reference: Option, @@ -1864,9 +1955,8 @@ pub struct Table { pub num_rows: Option, /// [Output-only] A hash of this resource. pub etag: Option, - /// [Output-only] The number of bytes in the table that are considered "long-term storage". - #[serde(rename="numLongTermBytes")] - pub num_long_term_bytes: Option, + /// [Output-only] The geographic location where the table resides. This value is inherited from the dataset. + pub location: Option, /// [Optional] A descriptive name for this table. #[serde(rename="friendlyName")] pub friendly_name: Option, @@ -1924,7 +2014,7 @@ impl ResponseResult for TableDataInsertAllResponse {} pub struct QueryResponse { /// The resource type. pub kind: Option, - /// [Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful. + /// [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. pub errors: Option>, /// Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults). #[serde(rename="jobReference")] @@ -1962,15 +2052,18 @@ impl ResponseResult for QueryResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobConfigurationTableCopy { - /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. - #[serde(rename="createDisposition")] - pub create_disposition: Option, /// [Pick one] Source tables to copy. #[serde(rename="sourceTables")] pub source_tables: 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. #[serde(rename="writeDisposition")] pub write_disposition: Option, + /// [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). + #[serde(rename="destinationEncryptionConfiguration")] + pub destination_encryption_configuration: Option, + /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + #[serde(rename="createDisposition")] + pub create_disposition: Option, /// [Required] The destination table #[serde(rename="destinationTable")] pub destination_table: Option, @@ -2040,92 +2133,6 @@ impl<'a, C, A> MethodsBuilder for TableMethods<'a, C, A> {} impl<'a, C, A> TableMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - Project ID of the table to update - /// * `datasetId` - Dataset ID of the table to update - /// * `tableId` - Table ID of the table to update - pub fn update(&self, request: Table, project_id: &str, dataset_id: &str, table_id: &str) -> TableUpdateCall<'a, C, A> { - TableUpdateCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _dataset_id: dataset_id.to_string(), - _table_id: table_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 new, empty table in the dataset. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - Project ID of the new table - /// * `datasetId` - Dataset ID of the new table - pub fn insert(&self, request: Table, project_id: &str, dataset_id: &str) -> TableInsertCall<'a, C, A> { - TableInsertCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _dataset_id: dataset_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists all tables in the specified dataset. Requires the READER dataset role. - /// - /// # Arguments - /// - /// * `projectId` - Project ID of the tables to list - /// * `datasetId` - Dataset ID of the tables to list - pub fn list(&self, project_id: &str, dataset_id: &str) -> TableListCall<'a, C, A> { - TableListCall { - hub: self.hub, - _project_id: project_id.to_string(), - _dataset_id: dataset_id.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. - /// - /// # Arguments - /// - /// * `projectId` - Project ID of the table to delete - /// * `datasetId` - Dataset ID of the table to delete - /// * `tableId` - Table ID of the table to delete - pub fn delete(&self, project_id: &str, dataset_id: &str, table_id: &str) -> TableDeleteCall<'a, C, A> { - TableDeleteCall { - hub: self.hub, - _project_id: project_id.to_string(), - _dataset_id: dataset_id.to_string(), - _table_id: table_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table. @@ -2170,6 +2177,92 @@ impl<'a, C, A> TableMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Project ID of the table to update + /// * `datasetId` - Dataset ID of the table to update + /// * `tableId` - Table ID of the table to update + pub fn update(&self, request: Table, project_id: &str, dataset_id: &str, table_id: &str) -> TableUpdateCall<'a, C, A> { + TableUpdateCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _dataset_id: dataset_id.to_string(), + _table_id: table_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all tables in the specified dataset. Requires the READER dataset role. + /// + /// # Arguments + /// + /// * `projectId` - Project ID of the tables to list + /// * `datasetId` - Dataset ID of the tables to list + pub fn list(&self, project_id: &str, dataset_id: &str) -> TableListCall<'a, C, A> { + TableListCall { + hub: self.hub, + _project_id: project_id.to_string(), + _dataset_id: dataset_id.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new, empty table in the dataset. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Project ID of the new table + /// * `datasetId` - Dataset ID of the new table + pub fn insert(&self, request: Table, project_id: &str, dataset_id: &str) -> TableInsertCall<'a, C, A> { + TableInsertCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _dataset_id: dataset_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. + /// + /// # Arguments + /// + /// * `projectId` - Project ID of the table to delete + /// * `datasetId` - Dataset ID of the table to delete + /// * `tableId` - Table ID of the table to delete + pub fn delete(&self, project_id: &str, dataset_id: &str, table_id: &str) -> TableDeleteCall<'a, C, A> { + TableDeleteCall { + hub: self.hub, + _project_id: project_id.to_string(), + _dataset_id: dataset_id.to_string(), + _table_id: table_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2215,19 +2308,19 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics. + /// Lists all datasets in the specified project to which you have been granted the READER dataset role. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `projectId` - Project ID of the dataset being updated - /// * `datasetId` - Dataset ID of the dataset being updated - pub fn patch(&self, request: Dataset, project_id: &str, dataset_id: &str) -> DatasetPatchCall<'a, C, A> { - DatasetPatchCall { + /// * `projectId` - Project ID of the datasets to be listed + pub fn list(&self, project_id: &str) -> DatasetListCall<'a, C, A> { + DatasetListCall { hub: self.hub, - _request: request, _project_id: project_id.to_string(), - _dataset_id: dataset_id.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _all: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2255,36 +2348,15 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all datasets in the specified project to which you have been granted the READER dataset role. - /// - /// # Arguments - /// - /// * `projectId` - Project ID of the datasets to be listed - pub fn list(&self, project_id: &str) -> DatasetListCall<'a, C, A> { - DatasetListCall { - hub: self.hub, - _project_id: project_id.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _all: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. + /// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - Project ID of the dataset being updated /// * `datasetId` - Dataset ID of the dataset being updated - pub fn update(&self, request: Dataset, project_id: &str, dataset_id: &str) -> DatasetUpdateCall<'a, C, A> { - DatasetUpdateCall { + pub fn patch(&self, request: Dataset, project_id: &str, dataset_id: &str) -> DatasetPatchCall<'a, C, A> { + DatasetPatchCall { hub: self.hub, _request: request, _project_id: project_id.to_string(), @@ -2315,6 +2387,27 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Project ID of the dataset being updated + /// * `datasetId` - Dataset ID of the dataset being updated + pub fn update(&self, request: Dataset, project_id: &str, dataset_id: &str) -> DatasetUpdateCall<'a, C, A> { + DatasetUpdateCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _dataset_id: dataset_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a new empty dataset. @@ -2376,6 +2469,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: + /// + /// 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. + /// + /// # Arguments + /// + /// * `projectId` - [Required] Project ID of the requested job + /// * `jobId` - [Required] Job ID of the requested job + pub fn get(&self, project_id: &str, job_id: &str) -> JobGetCall<'a, C, A> { + JobGetCall { + 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: /// /// 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. Cancelled jobs may still incur costs. @@ -2416,21 +2528,17 @@ impl<'a, C, A> JobMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the results of a query job. + /// Starts a new asynchronous job. Requires the Can View project role. /// /// # Arguments /// - /// * `projectId` - [Required] Project ID of the query job - /// * `jobId` - [Required] Job ID of the query job - pub fn get_query_results(&self, project_id: &str, job_id: &str) -> JobGetQueryResultCall<'a, C, A> { - JobGetQueryResultCall { + /// * `request` - No description provided. + /// * `projectId` - Project ID of the project that will be billed for the job + pub fn insert(&self, request: Job, project_id: &str) -> JobInsertCall<'a, C, A> { + JobInsertCall { hub: self.hub, + _request: request, _project_id: project_id.to_string(), - _job_id: job_id.to_string(), - _timeout_ms: Default::default(), - _start_index: Default::default(), - _page_token: Default::default(), - _max_results: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2461,36 +2569,21 @@ impl<'a, C, A> JobMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// 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. + /// Retrieves the results of a query job. /// /// # Arguments /// - /// * `projectId` - [Required] Project ID of the requested job - /// * `jobId` - [Required] Job ID of the requested job - pub fn get(&self, project_id: &str, job_id: &str) -> JobGetCall<'a, C, A> { - JobGetCall { + /// * `projectId` - [Required] Project ID of the query job + /// * `jobId` - [Required] Job ID of the query job + pub fn get_query_results(&self, project_id: &str, job_id: &str) -> JobGetQueryResultCall<'a, C, A> { + JobGetQueryResultCall { 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: - /// - /// Starts a new asynchronous job. Requires the Can View project role. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - Project ID of the project that will be billed for the job - pub fn insert(&self, request: Job, project_id: &str) -> JobInsertCall<'a, C, A> { - JobInsertCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), + _timeout_ms: Default::default(), + _start_index: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2539,29 +2632,6 @@ impl<'a, C, A> MethodsBuilder for TabledataMethods<'a, C, A> {} impl<'a, C, A> TabledataMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - Project ID of the destination table. - /// * `datasetId` - Dataset ID of the destination table. - /// * `tableId` - Table ID of the destination table. - pub fn insert_all(&self, request: TableDataInsertAllRequest, project_id: &str, dataset_id: &str, table_id: &str) -> TabledataInsertAllCall<'a, C, A> { - TabledataInsertAllCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _dataset_id: dataset_id.to_string(), - _table_id: table_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves table data from a specified set of rows. Requires the READER dataset role. @@ -2586,6 +2656,29 @@ impl<'a, C, A> TabledataMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Project ID of the destination table. + /// * `datasetId` - Dataset ID of the destination table. + /// * `tableId` - Table ID of the destination table. + pub fn insert_all(&self, request: TableDataInsertAllRequest, project_id: &str, dataset_id: &str, table_id: &str) -> TabledataInsertAllCall<'a, C, A> { + TabledataInsertAllCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _dataset_id: dataset_id.to_string(), + _table_id: table_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2614,7 +2707,7 @@ impl<'a, C, A> TabledataMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `list(...)` +/// // like `get_service_account(...)` and `list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2629,6 +2722,23 @@ 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: + /// + /// Returns the email address of the service account for your project used for interactions with Google Cloud KMS. + /// + /// # Arguments + /// + /// * `projectId` - Project ID for which the service account is requested. + pub fn get_service_account(&self, project_id: &str) -> ProjectGetServiceAccountCall<'a, C, A> { + ProjectGetServiceAccountCall { + 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: /// /// Lists all projects to which you have been granted any project role. @@ -2652,1125 +2762,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. -/// -/// A builder for the *update* method supported by a *table* resource. -/// It is not used directly, but through a `TableMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_bigquery2 as bigquery2; -/// use bigquery2::Table; -/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Table::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.tables().update(req, "projectId", "datasetId", "tableId") -/// .doit(); -/// # } -/// ``` -pub struct TableUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _request: Table, - _project_id: String, - _dataset_id: String, - _table_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TableUpdateCall<'a, C, A> {} - -impl<'a, C, A> TableUpdateCall<'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, Table)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tables.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("datasetId", self._dataset_id.to_string())); - params.push(("tableId", self._table_id.to_string())); - for &field in ["alt", "projectId", "datasetId", "tableId"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].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 ["tableId", "datasetId", "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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: Table) -> TableUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID of the table to update - /// - /// 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) -> TableUpdateCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Dataset ID of the table to update - /// - /// Sets the *dataset id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> TableUpdateCall<'a, C, A> { - self._dataset_id = new_value.to_string(); - self - } - /// Table ID of the table to update - /// - /// Sets the *table 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 table_id(mut self, new_value: &str) -> TableUpdateCall<'a, C, A> { - self._table_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) -> TableUpdateCall<'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) -> TableUpdateCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> TableUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new, empty table in the dataset. -/// -/// A builder for the *insert* method supported by a *table* resource. -/// It is not used directly, but through a `TableMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_bigquery2 as bigquery2; -/// use bigquery2::Table; -/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Table::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.tables().insert(req, "projectId", "datasetId") -/// .doit(); -/// # } -/// ``` -pub struct TableInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _request: Table, - _project_id: String, - _dataset_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TableInsertCall<'a, C, A> {} - -impl<'a, C, A> TableInsertCall<'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, Table)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tables.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("datasetId", self._dataset_id.to_string())); - for &field in ["alt", "projectId", "datasetId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["datasetId", "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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: Table) -> TableInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID of the new table - /// - /// 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) -> TableInsertCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Dataset ID of the new table - /// - /// Sets the *dataset id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> TableInsertCall<'a, C, A> { - self._dataset_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> TableInsertCall<'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) -> TableInsertCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> TableInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all tables in the specified dataset. Requires the READER dataset role. -/// -/// A builder for the *list* method supported by a *table* resource. -/// It is not used directly, but through a `TableMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.tables().list("projectId", "datasetId") -/// .page_token("gubergren") -/// .max_results(6) -/// .doit(); -/// # } -/// ``` -pub struct TableListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _project_id: String, - _dataset_id: String, - _page_token: Option, - _max_results: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TableListCall<'a, C, A> {} - -impl<'a, C, A> TableListCall<'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, TableList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tables.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("datasetId", self._dataset_id.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())); - } - for &field in ["alt", "projectId", "datasetId", "pageToken", "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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["datasetId", "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(Bearer { 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(d); - 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(d); - 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 tables to list - /// - /// 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) -> TableListCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Dataset ID of the tables to list - /// - /// Sets the *dataset id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> TableListCall<'a, C, A> { - self._dataset_id = new_value.to_string(); - self - } - /// Page token, returned by a previous call, to request the next page of results - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> TableListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of results to return - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> TableListCall<'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) -> TableListCall<'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) -> TableListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> TableListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. -/// -/// A builder for the *delete* method supported by a *table* resource. -/// It is not used directly, but through a `TableMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.tables().delete("projectId", "datasetId", "tableId") -/// .doit(); -/// # } -/// ``` -pub struct TableDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _project_id: String, - _dataset_id: String, - _table_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TableDeleteCall<'a, C, A> {} - -impl<'a, C, A> TableDeleteCall<'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, Bearer, 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.tables.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("datasetId", self._dataset_id.to_string())); - params.push(("tableId", self._table_id.to_string())); - for &field in ["projectId", "datasetId", "tableId"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].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 ["tableId", "datasetId", "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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Project ID of the table to delete - /// - /// 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) -> TableDeleteCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Dataset ID of the table to delete - /// - /// Sets the *dataset id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> TableDeleteCall<'a, C, A> { - self._dataset_id = new_value.to_string(); - self - } - /// Table ID of the table to delete - /// - /// Sets the *table 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 table_id(mut self, new_value: &str) -> TableDeleteCall<'a, C, A> { - self._table_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) -> TableDeleteCall<'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) -> TableDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> TableDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table. /// /// A builder for the *get* method supported by a *table* resource. @@ -3799,7 +2790,7 @@ impl<'a, C, A> TableDeleteCall<'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.tables().get("projectId", "datasetId", "tableId") -/// .selected_fields("et") +/// .selected_fields("labore") /// .doit(); /// # } /// ``` @@ -4348,6 +3339,1671 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa } +/// Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. +/// +/// A builder for the *update* method supported by a *table* resource. +/// It is not used directly, but through a `TableMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquery2 as bigquery2; +/// use bigquery2::Table; +/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Table::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.tables().update(req, "projectId", "datasetId", "tableId") +/// .doit(); +/// # } +/// ``` +pub struct TableUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _request: Table, + _project_id: String, + _dataset_id: String, + _table_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TableUpdateCall<'a, C, A> {} + +impl<'a, C, A> TableUpdateCall<'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, Table)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tables.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("datasetId", self._dataset_id.to_string())); + params.push(("tableId", self._table_id.to_string())); + for &field in ["alt", "projectId", "datasetId", "tableId"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].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 ["tableId", "datasetId", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Table) -> TableUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID of the table to update + /// + /// 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) -> TableUpdateCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Dataset ID of the table to update + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> TableUpdateCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// Table ID of the table to update + /// + /// Sets the *table 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 table_id(mut self, new_value: &str) -> TableUpdateCall<'a, C, A> { + self._table_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) -> TableUpdateCall<'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) -> TableUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TableUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all tables in the specified dataset. Requires the READER dataset role. +/// +/// A builder for the *list* method supported by a *table* resource. +/// It is not used directly, but through a `TableMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.tables().list("projectId", "datasetId") +/// .page_token("justo") +/// .max_results(80) +/// .doit(); +/// # } +/// ``` +pub struct TableListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _dataset_id: String, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TableListCall<'a, C, A> {} + +impl<'a, C, A> TableListCall<'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, TableList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tables.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("datasetId", self._dataset_id.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())); + } + for &field in ["alt", "projectId", "datasetId", "pageToken", "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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["datasetId", "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(Bearer { 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(d); + 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(d); + 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 tables to list + /// + /// 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) -> TableListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Dataset ID of the tables to list + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> TableListCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// Page token, returned by a previous call, to request the next page of results + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TableListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TableListCall<'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) -> TableListCall<'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) -> TableListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TableListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new, empty table in the dataset. +/// +/// A builder for the *insert* method supported by a *table* resource. +/// It is not used directly, but through a `TableMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquery2 as bigquery2; +/// use bigquery2::Table; +/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Table::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.tables().insert(req, "projectId", "datasetId") +/// .doit(); +/// # } +/// ``` +pub struct TableInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _request: Table, + _project_id: String, + _dataset_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TableInsertCall<'a, C, A> {} + +impl<'a, C, A> TableInsertCall<'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, Table)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tables.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("datasetId", self._dataset_id.to_string())); + for &field in ["alt", "projectId", "datasetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["datasetId", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Table) -> TableInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID of the new table + /// + /// 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) -> TableInsertCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Dataset ID of the new table + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> TableInsertCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TableInsertCall<'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) -> TableInsertCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TableInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. +/// +/// A builder for the *delete* method supported by a *table* resource. +/// It is not used directly, but through a `TableMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.tables().delete("projectId", "datasetId", "tableId") +/// .doit(); +/// # } +/// ``` +pub struct TableDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _dataset_id: String, + _table_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TableDeleteCall<'a, C, A> {} + +impl<'a, C, A> TableDeleteCall<'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, Bearer, 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.tables.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("datasetId", self._dataset_id.to_string())); + params.push(("tableId", self._table_id.to_string())); + for &field in ["projectId", "datasetId", "tableId"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].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 ["tableId", "datasetId", "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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Project ID of the table to delete + /// + /// 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) -> TableDeleteCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Dataset ID of the table to delete + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> TableDeleteCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// Table ID of the table to delete + /// + /// Sets the *table 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 table_id(mut self, new_value: &str) -> TableDeleteCall<'a, C, A> { + self._table_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) -> TableDeleteCall<'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) -> TableDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TableDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all datasets in the specified project to which you have been granted the READER dataset role. +/// +/// A builder for the *list* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().list("projectId") +/// .page_token("duo") +/// .max_results(69) +/// .filter("sea") +/// .all(false) +/// .doit(); +/// # } +/// ``` +pub struct DatasetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _all: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetListCall<'a, C, A> {} + +impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DatasetList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datasets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("projectId", self._project_id.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())); + } + if let Some(value) = self._all { + params.push(("all", value.to_string())); + } + for &field in ["alt", "projectId", "pageToken", "maxResults", "filter", "all"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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(Bearer { 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(d); + 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(d); + 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 datasets to be listed + /// + /// 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) -> DatasetListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Page token, returned by a previous call, to request the next page of results + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> DatasetListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// Whether to list all datasets, including hidden ones + /// + /// Sets the *all* query property to the given value. + pub fn all(mut self, new_value: bool) -> DatasetListCall<'a, C, A> { + self._all = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *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) -> DatasetListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the dataset specified by datasetID. +/// +/// A builder for the *get* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().get("projectId", "datasetId") +/// .doit(); +/// # } +/// ``` +pub struct DatasetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _dataset_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetGetCall<'a, C, A> {} + +impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datasets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("datasetId", self._dataset_id.to_string())); + for &field in ["alt", "projectId", "datasetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["datasetId", "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(Bearer { 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(d); + 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(d); + 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 requested dataset + /// + /// 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) -> DatasetGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Dataset ID of the requested dataset + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> DatasetGetCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *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) -> DatasetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *dataset* resource. @@ -4634,9 +5290,9 @@ impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Returns the dataset specified by datasetID. +/// Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name. /// -/// A builder for the *get* method supported by a *dataset* resource. +/// A builder for the *delete* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. /// /// # Example @@ -4661,28 +5317,30 @@ impl<'a, C, A> DatasetPatchCall<'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.datasets().get("projectId", "datasetId") +/// let result = hub.datasets().delete("projectId", "datasetId") +/// .delete_contents(false) /// .doit(); /// # } /// ``` -pub struct DatasetGetCall<'a, C, A> +pub struct DatasetDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Bigquery, _project_id: String, _dataset_id: String, + _delete_contents: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DatasetGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for DatasetDeleteCall<'a, C, A> {} -impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -4690,12 +5348,15 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "bigquery.datasets.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "bigquery.datasets.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("datasetId", self._dataset_id.to_string())); - for &field in ["alt", "projectId", "datasetId"].iter() { + if let Some(value) = self._delete_contents { + params.push(("deleteContents", value.to_string())); + } + for &field in ["projectId", "datasetId", "deleteContents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4705,7 +5366,6 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push((&name, value.clone())); } - params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; if self._scopes.len() == 0 { @@ -4757,7 +5417,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa let auth_header = Authorization(Bearer { 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) + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -4790,17 +5450,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa 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)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -4810,33 +5460,40 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// Project ID of the requested dataset + /// Project ID of the dataset being deleted /// /// 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) -> DatasetGetCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> DatasetDeleteCall<'a, C, A> { self._project_id = new_value.to_string(); self } - /// Dataset ID of the requested dataset + /// Dataset ID of dataset being deleted /// /// Sets the *dataset id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> DatasetGetCall<'a, C, A> { + pub fn dataset_id(mut self, new_value: &str) -> DatasetDeleteCall<'a, C, A> { self._dataset_id = new_value.to_string(); self } + /// If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False + /// + /// Sets the *delete contents* query property to the given value. + pub fn delete_contents(mut self, new_value: bool) -> DatasetDeleteCall<'a, C, A> { + self._delete_contents = 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) -> DatasetGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4857,7 +5514,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa /// * *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) -> DatasetGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> DatasetDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4877,298 +5534,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatasetGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all datasets in the specified project to which you have been granted the READER dataset role. -/// -/// A builder for the *list* method supported by a *dataset* resource. -/// It is not used directly, but through a `DatasetMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.datasets().list("projectId") -/// .page_token("eos") -/// .max_results(20) -/// .filter("sadipscing") -/// .all(true) -/// .doit(); -/// # } -/// ``` -pub struct DatasetListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _project_id: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _all: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatasetListCall<'a, C, A> {} - -impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DatasetList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datasets.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("projectId", self._project_id.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())); - } - if let Some(value) = self._all { - params.push(("all", value.to_string())); - } - for &field in ["alt", "projectId", "pageToken", "maxResults", "filter", "all"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.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(Bearer { 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(d); - 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(d); - 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 datasets to be listed - /// - /// 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) -> DatasetListCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Page token, returned by a previous call, to request the next page of results - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of results to return - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> DatasetListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// Whether to list all datasets, including hidden ones - /// - /// Sets the *all* query property to the given value. - pub fn all(mut self, new_value: bool) -> DatasetListCall<'a, C, A> { - self._all = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *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) -> DatasetListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatasetListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> DatasetDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5466,262 +5832,6 @@ impl<'a, C, A> DatasetUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name. -/// -/// A builder for the *delete* method supported by a *dataset* resource. -/// It is not used directly, but through a `DatasetMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.datasets().delete("projectId", "datasetId") -/// .delete_contents(true) -/// .doit(); -/// # } -/// ``` -pub struct DatasetDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _project_id: String, - _dataset_id: String, - _delete_contents: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatasetDeleteCall<'a, C, A> {} - -impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datasets.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("datasetId", self._dataset_id.to_string())); - if let Some(value) = self._delete_contents { - params.push(("deleteContents", value.to_string())); - } - for &field in ["projectId", "datasetId", "deleteContents"].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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["datasetId", "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(Bearer { 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(d); - 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(d); - 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) - } - } - } - } - - - /// Project ID of the dataset being deleted - /// - /// 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) -> DatasetDeleteCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Dataset ID of dataset being deleted - /// - /// Sets the *dataset id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> DatasetDeleteCall<'a, C, A> { - self._dataset_id = new_value.to_string(); - self - } - /// If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False - /// - /// Sets the *delete contents* query property to the given value. - pub fn delete_contents(mut self, new_value: bool) -> DatasetDeleteCall<'a, C, A> { - self._delete_contents = 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) -> DatasetDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *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) -> DatasetDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatasetDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates a new empty dataset. /// /// A builder for the *insert* method supported by a *dataset* resource. @@ -5996,6 +6106,261 @@ impl<'a, C, A> DatasetInsertCall<'a, C, A> where C: BorrowMut, A: } +/// 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. +/// +/// A builder for the *get* 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 hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().get("projectId", "jobId") +/// .doit(); +/// # } +/// ``` +pub struct JobGetCall<'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 JobGetCall<'a, C, A> {} + +impl<'a, C, A> JobGetCall<'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, Job)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.get", + http_method: hyper::method::Method::Get }); + 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 = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}"; + 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(Bearer { 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(d); + 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(d); + 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] Project ID of the requested job + /// + /// 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) -> JobGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// [Required] Job ID of the requested job + /// + /// 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) -> JobGetCall<'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) -> JobGetCall<'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) -> JobGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> JobGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// 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. Cancelled jobs may still incur costs. /// /// A builder for the *cancel* method supported by a *job* resource. @@ -6525,870 +6890,6 @@ impl<'a, C, A> JobQueryCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Retrieves the results of a query job. -/// -/// A builder for the *getQueryResults* 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 hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().get_query_results("projectId", "jobId") -/// .timeout_ms(92) -/// .start_index("et") -/// .page_token("duo") -/// .max_results(80) -/// .doit(); -/// # } -/// ``` -pub struct JobGetQueryResultCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _project_id: String, - _job_id: String, - _timeout_ms: Option, - _start_index: Option, - _page_token: Option, - _max_results: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for JobGetQueryResultCall<'a, C, A> {} - -impl<'a, C, A> JobGetQueryResultCall<'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, GetQueryResultsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getQueryResults", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("jobId", self._job_id.to_string())); - if let Some(value) = self._timeout_ms { - params.push(("timeoutMs", value.to_string())); - } - if let Some(value) = self._start_index { - params.push(("startIndex", value.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())); - } - for &field in ["alt", "projectId", "jobId", "timeoutMs", "startIndex", "pageToken", "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 = self.hub._base_url.clone() + "projects/{projectId}/queries/{jobId}"; - 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(Bearer { 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(d); - 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(d); - 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] Project ID of the query job - /// - /// 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) -> JobGetQueryResultCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// [Required] Job ID of the query job - /// - /// 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) -> JobGetQueryResultCall<'a, C, A> { - self._job_id = new_value.to_string(); - self - } - /// How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false - /// - /// Sets the *timeout ms* query property to the given value. - pub fn timeout_ms(mut self, new_value: u32) -> JobGetQueryResultCall<'a, C, A> { - self._timeout_ms = Some(new_value); - self - } - /// Zero-based index of the starting row - /// - /// Sets the *start index* query property to the given value. - pub fn start_index(mut self, new_value: &str) -> JobGetQueryResultCall<'a, C, A> { - self._start_index = Some(new_value.to_string()); - self - } - /// Page token, returned by a previous call, to request the next page of results - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> JobGetQueryResultCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of results to read - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> JobGetQueryResultCall<'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) -> JobGetQueryResultCall<'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) -> JobGetQueryResultCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> JobGetQueryResultCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. -/// -/// A builder for the *list* 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 hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().list("projectId") -/// .add_state_filter("sanctus") -/// .projection("et") -/// .page_token("amet") -/// .max_results(78) -/// .all_users(true) -/// .doit(); -/// # } -/// ``` -pub struct JobListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Bigquery, - _project_id: String, - _state_filter: Vec, - _projection: Option, - _page_token: Option, - _max_results: Option, - _all_users: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for JobListCall<'a, C, A> {} - -impl<'a, C, A> JobListCall<'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, JobList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - if self._state_filter.len() > 0 { - for f in self._state_filter.iter() { - params.push(("stateFilter", f.to_string())); - } - } - if let Some(value) = self._projection { - params.push(("projection", value.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._all_users { - params.push(("allUsers", value.to_string())); - } - for &field in ["alt", "projectId", "stateFilter", "projection", "pageToken", "maxResults", "allUsers"].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 = self.hub._base_url.clone() + "projects/{projectId}/jobs"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.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(Bearer { 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(d); - 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(d); - 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 jobs to list - /// - /// 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) -> JobListCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// Filter for job state - /// - /// Append the given value to the *state filter* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_state_filter(mut self, new_value: &str) -> JobListCall<'a, C, A> { - self._state_filter.push(new_value.to_string()); - self - } - /// Restrict information returned to a set of selected fields - /// - /// Sets the *projection* query property to the given value. - pub fn projection(mut self, new_value: &str) -> JobListCall<'a, C, A> { - self._projection = Some(new_value.to_string()); - self - } - /// Page token, returned by a previous call, to request the next page of results - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> JobListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of results to return - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> JobListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Whether to display jobs owned by all users in the project. Default false - /// - /// Sets the *all users* query property to the given value. - pub fn all_users(mut self, new_value: bool) -> JobListCall<'a, C, A> { - self._all_users = 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) -> JobListCall<'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) -> JobListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> JobListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// 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. -/// -/// A builder for the *get* 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 hyper_rustls; -/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().get("projectId", "jobId") -/// .doit(); -/// # } -/// ``` -pub struct JobGetCall<'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 JobGetCall<'a, C, A> {} - -impl<'a, C, A> JobGetCall<'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, Job)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.get", - http_method: hyper::method::Method::Get }); - 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 = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}"; - 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(Bearer { 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(d); - 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(d); - 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] Project ID of the requested job - /// - /// 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) -> JobGetCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// [Required] Job ID of the requested job - /// - /// 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) -> JobGetCall<'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) -> JobGetCall<'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) -> JobGetCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> JobGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Starts a new asynchronous job. Requires the Can View project role. /// /// A builder for the *insert* method supported by a *job* resource. @@ -7773,6 +7274,930 @@ impl<'a, C, A> JobInsertCall<'a, C, A> where C: BorrowMut, A: oau } +/// Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. +/// +/// A builder for the *list* 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 hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().list("projectId") +/// .add_state_filter("duo") +/// .projection("et") +/// .page_token("eirmod") +/// .max_results(43) +/// .all_users(true) +/// .doit(); +/// # } +/// ``` +pub struct JobListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _state_filter: Vec, + _projection: Option, + _page_token: Option, + _max_results: Option, + _all_users: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for JobListCall<'a, C, A> {} + +impl<'a, C, A> JobListCall<'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, JobList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + if self._state_filter.len() > 0 { + for f in self._state_filter.iter() { + params.push(("stateFilter", f.to_string())); + } + } + if let Some(value) = self._projection { + params.push(("projection", value.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._all_users { + params.push(("allUsers", value.to_string())); + } + for &field in ["alt", "projectId", "stateFilter", "projection", "pageToken", "maxResults", "allUsers"].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 = self.hub._base_url.clone() + "projects/{projectId}/jobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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(Bearer { 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(d); + 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(d); + 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 jobs to list + /// + /// 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) -> JobListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Filter for job state + /// + /// Append the given value to the *state filter* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_state_filter(mut self, new_value: &str) -> JobListCall<'a, C, A> { + self._state_filter.push(new_value.to_string()); + self + } + /// Restrict information returned to a set of selected fields + /// + /// Sets the *projection* query property to the given value. + pub fn projection(mut self, new_value: &str) -> JobListCall<'a, C, A> { + self._projection = Some(new_value.to_string()); + self + } + /// Page token, returned by a previous call, to request the next page of results + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> JobListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> JobListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Whether to display jobs owned by all users in the project. Default false + /// + /// Sets the *all users* query property to the given value. + pub fn all_users(mut self, new_value: bool) -> JobListCall<'a, C, A> { + self._all_users = 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) -> JobListCall<'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) -> JobListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> JobListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the results of a query job. +/// +/// A builder for the *getQueryResults* 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 hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().get_query_results("projectId", "jobId") +/// .timeout_ms(56) +/// .start_index("ut") +/// .page_token("ea") +/// .max_results(21) +/// .doit(); +/// # } +/// ``` +pub struct JobGetQueryResultCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _job_id: String, + _timeout_ms: Option, + _start_index: Option, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for JobGetQueryResultCall<'a, C, A> {} + +impl<'a, C, A> JobGetQueryResultCall<'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, GetQueryResultsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getQueryResults", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("jobId", self._job_id.to_string())); + if let Some(value) = self._timeout_ms { + params.push(("timeoutMs", value.to_string())); + } + if let Some(value) = self._start_index { + params.push(("startIndex", value.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())); + } + for &field in ["alt", "projectId", "jobId", "timeoutMs", "startIndex", "pageToken", "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 = self.hub._base_url.clone() + "projects/{projectId}/queries/{jobId}"; + 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(Bearer { 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(d); + 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(d); + 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] Project ID of the query job + /// + /// 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) -> JobGetQueryResultCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// [Required] Job ID of the query job + /// + /// 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) -> JobGetQueryResultCall<'a, C, A> { + self._job_id = new_value.to_string(); + self + } + /// How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false + /// + /// Sets the *timeout ms* query property to the given value. + pub fn timeout_ms(mut self, new_value: u32) -> JobGetQueryResultCall<'a, C, A> { + self._timeout_ms = Some(new_value); + self + } + /// Zero-based index of the starting row + /// + /// Sets the *start index* query property to the given value. + pub fn start_index(mut self, new_value: &str) -> JobGetQueryResultCall<'a, C, A> { + self._start_index = Some(new_value.to_string()); + self + } + /// Page token, returned by a previous call, to request the next page of results + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> JobGetQueryResultCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to read + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> JobGetQueryResultCall<'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) -> JobGetQueryResultCall<'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) -> JobGetQueryResultCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> JobGetQueryResultCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves table data from a specified set of rows. Requires the READER dataset role. +/// +/// A builder for the *list* method supported by a *tabledata* resource. +/// It is not used directly, but through a `TabledataMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Bigquery::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.tabledata().list("projectId", "datasetId", "tableId") +/// .start_index("et") +/// .selected_fields("consetetur") +/// .page_token("amet.") +/// .max_results(74) +/// .doit(); +/// # } +/// ``` +pub struct TabledataListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _dataset_id: String, + _table_id: String, + _start_index: Option, + _selected_fields: Option, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TabledataListCall<'a, C, A> {} + +impl<'a, C, A> TabledataListCall<'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, TableDataList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.tabledata.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("datasetId", self._dataset_id.to_string())); + params.push(("tableId", self._table_id.to_string())); + if let Some(value) = self._start_index { + params.push(("startIndex", value.to_string())); + } + if let Some(value) = self._selected_fields { + params.push(("selectedFields", value.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())); + } + for &field in ["alt", "projectId", "datasetId", "tableId", "startIndex", "selectedFields", "pageToken", "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 = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].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 ["tableId", "datasetId", "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(Bearer { 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(d); + 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(d); + 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 table to read + /// + /// 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) -> TabledataListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Dataset ID of the table to read + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// Table ID of the table to read + /// + /// Sets the *table 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 table_id(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { + self._table_id = new_value.to_string(); + self + } + /// Zero-based index of the starting row to read + /// + /// Sets the *start index* query property to the given value. + pub fn start_index(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { + self._start_index = Some(new_value.to_string()); + self + } + /// List of fields to return (comma-separated). If unspecified, all fields are returned + /// + /// Sets the *selected fields* query property to the given value. + pub fn selected_fields(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { + self._selected_fields = Some(new_value.to_string()); + self + } + /// Page token, returned by a previous call, identifying the result set + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TabledataListCall<'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) -> TabledataListCall<'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) -> TabledataListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TabledataListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. /// /// A builder for the *insertAll* method supported by a *tabledata* resource. @@ -8071,10 +8496,10 @@ impl<'a, C, A> TabledataInsertAllCall<'a, C, A> where C: BorrowMut TabledataInsertAllCall<'a, C, A> where C: BorrowMut +pub struct ProjectGetServiceAccountCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Bigquery, _project_id: String, - _dataset_id: String, - _table_id: String, - _start_index: Option, - _selected_fields: Option, - _page_token: Option, - _max_results: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for TabledataListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectGetServiceAccountCall<'a, C, A> {} -impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectGetServiceAccountCall<'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, TableDataList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GetServiceAccountResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -8136,25 +8551,11 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "bigquery.tabledata.list", + dlg.begin(MethodInfo { id: "bigquery.projects.getServiceAccount", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); - params.push(("datasetId", self._dataset_id.to_string())); - params.push(("tableId", self._table_id.to_string())); - if let Some(value) = self._start_index { - params.push(("startIndex", value.to_string())); - } - if let Some(value) = self._selected_fields { - params.push(("selectedFields", value.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())); - } - for &field in ["alt", "projectId", "datasetId", "tableId", "startIndex", "selectedFields", "pageToken", "maxResults"].iter() { + for &field in ["alt", "projectId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8166,12 +8567,12 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data"; + let mut url = self.hub._base_url.clone() + "projects/{projectId}/serviceAccount"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].iter() { + 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 { @@ -8182,8 +8583,8 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: 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 ["tableId", "datasetId", "projectId"].iter() { + 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); } @@ -8269,71 +8670,23 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: } - /// Project ID of the table to read + /// Project ID for which the service account is requested. /// /// 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) -> TabledataListCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectGetServiceAccountCall<'a, C, A> { self._project_id = new_value.to_string(); self } - /// Dataset ID of the table to read - /// - /// Sets the *dataset id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dataset_id(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { - self._dataset_id = new_value.to_string(); - self - } - /// Table ID of the table to read - /// - /// Sets the *table 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 table_id(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { - self._table_id = new_value.to_string(); - self - } - /// Zero-based index of the starting row to read - /// - /// Sets the *start index* query property to the given value. - pub fn start_index(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { - self._start_index = Some(new_value.to_string()); - self - } - /// List of fields to return (comma-separated). If unspecified, all fields are returned - /// - /// Sets the *selected fields* query property to the given value. - pub fn selected_fields(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { - self._selected_fields = Some(new_value.to_string()); - self - } - /// Page token, returned by a previous call, identifying the result set - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of results to return - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> TabledataListCall<'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) -> TabledataListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetServiceAccountCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8354,7 +8707,7 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: /// * *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) -> TabledataListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectGetServiceAccountCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8374,7 +8727,7 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: /// 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) -> TabledataListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectGetServiceAccountCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8414,8 +8767,8 @@ impl<'a, C, A> 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("sit") -/// .max_results(75) +/// .page_token("vero") +/// .max_results(73) /// .doit(); /// # } /// ``` diff --git a/gen/bigquerydatatransfer1-cli/Cargo.toml b/gen/bigquerydatatransfer1-cli/Cargo.toml new file mode 100644 index 0000000000..ef61d68a4c --- /dev/null +++ b/gen/bigquerydatatransfer1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-bigquerydatatransfer1-cli" +version = "1.0.6+20170921" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with BigQuery Data Transfer (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1-cli" +homepage = "https://cloud.google.com/bigquery/" +documentation = "http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli" +license = "MIT" +keywords = ["bigquerydatatransfer", "google", "cli"] + +[[bin]] +name = "bigquerydatatransfer1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-bigquerydatatransfer1] +path = "../bigquerydatatransfer1" +version = "1.0.6+20170921" diff --git a/gen/bigquerydatatransfer1-cli/LICENSE.md b/gen/bigquerydatatransfer1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/bigquerydatatransfer1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/bigquerydatatransfer1-cli/README.md b/gen/bigquerydatatransfer1-cli/README.md new file mode 100644 index 0000000000..54ddfe7365 --- /dev/null +++ b/gen/bigquerydatatransfer1-cli/README.md @@ -0,0 +1,141 @@ + +The `bigquerydatatransfer1` command-line interface *(CLI)* allows to use most features of the *Google BigQuery Data Transfer* 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 *BigQuery Data Transfer* API can be found at the +[official documentation site](https://cloud.google.com/bigquery/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-bigquerydatatransfer1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1-cli). + +# Usage + +This documentation was generated from the *BigQuery Data Transfer* API at revision *20170921*. The CLI is at version *1.0.6*. + +```bash +bigquerydatatransfer1 [options] + projects + data-sources-check-valid-creds (-r )... [-p ]... [-o ] + data-sources-get [-p ]... [-o ] + data-sources-list [-p ]... [-o ] + locations-data-sources-check-valid-creds (-r )... [-p ]... [-o ] + locations-data-sources-get [-p ]... [-o ] + locations-data-sources-list [-p ]... [-o ] + locations-get [-p ]... [-o ] + locations-list [-p ]... [-o ] + locations-transfer-configs-create (-r )... [-p ]... [-o ] + locations-transfer-configs-delete [-p ]... [-o ] + locations-transfer-configs-get [-p ]... [-o ] + locations-transfer-configs-list [-p ]... [-o ] + locations-transfer-configs-patch (-r )... [-p ]... [-o ] + locations-transfer-configs-runs-delete [-p ]... [-o ] + locations-transfer-configs-runs-get [-p ]... [-o ] + locations-transfer-configs-runs-list [-p ]... [-o ] + locations-transfer-configs-runs-transfer-logs-list [-p ]... [-o ] + locations-transfer-configs-schedule-runs (-r )... [-p ]... [-o ] + transfer-configs-create (-r )... [-p ]... [-o ] + transfer-configs-delete [-p ]... [-o ] + transfer-configs-get [-p ]... [-o ] + transfer-configs-list [-p ]... [-o ] + transfer-configs-patch (-r )... [-p ]... [-o ] + transfer-configs-runs-delete [-p ]... [-o ] + transfer-configs-runs-get [-p ]... [-o ] + transfer-configs-runs-list [-p ]... [-o ] + transfer-configs-runs-transfer-logs-list [-p ]... [-o ] + transfer-configs-schedule-runs (-r )... [-p ]... [-o ] + bigquerydatatransfer1 --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 `bigquerydatatransfer1-`. 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/bigquerydatatransfer1-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/bigquerydatatransfer1-secret.json`, assuming that the required *bigquerydatatransfer* 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. `bigquerydatatransfer1 --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/bigquerydatatransfer1-cli/mkdocs.yml b/gen/bigquerydatatransfer1-cli/mkdocs.yml new file mode 100644 index 0000000000..c80d0b255c --- /dev/null +++ b/gen/bigquerydatatransfer1-cli/mkdocs.yml @@ -0,0 +1,44 @@ +site_name: BigQuery Data Transfer v1.0.6+20170921 +site_url: http://byron.github.io/google-apis-rs/google-bigquerydatatransfer1-cli +site_description: A complete library to interact with BigQuery Data Transfer (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_data-sources-check-valid-creds.md', 'Projects', 'Data Sources Check Valid Creds'] +- ['projects_data-sources-get.md', 'Projects', 'Data Sources Get'] +- ['projects_data-sources-list.md', 'Projects', 'Data Sources List'] +- ['projects_locations-data-sources-check-valid-creds.md', 'Projects', 'Locations Data Sources Check Valid Creds'] +- ['projects_locations-data-sources-get.md', 'Projects', 'Locations Data Sources Get'] +- ['projects_locations-data-sources-list.md', 'Projects', 'Locations Data Sources List'] +- ['projects_locations-get.md', 'Projects', 'Locations Get'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] +- ['projects_locations-transfer-configs-create.md', 'Projects', 'Locations Transfer Configs Create'] +- ['projects_locations-transfer-configs-delete.md', 'Projects', 'Locations Transfer Configs Delete'] +- ['projects_locations-transfer-configs-get.md', 'Projects', 'Locations Transfer Configs Get'] +- ['projects_locations-transfer-configs-list.md', 'Projects', 'Locations Transfer Configs List'] +- ['projects_locations-transfer-configs-patch.md', 'Projects', 'Locations Transfer Configs Patch'] +- ['projects_locations-transfer-configs-runs-delete.md', 'Projects', 'Locations Transfer Configs Runs Delete'] +- ['projects_locations-transfer-configs-runs-get.md', 'Projects', 'Locations Transfer Configs Runs Get'] +- ['projects_locations-transfer-configs-runs-list.md', 'Projects', 'Locations Transfer Configs Runs List'] +- ['projects_locations-transfer-configs-runs-transfer-logs-list.md', 'Projects', 'Locations Transfer Configs Runs Transfer Logs List'] +- ['projects_locations-transfer-configs-schedule-runs.md', 'Projects', 'Locations Transfer Configs Schedule Runs'] +- ['projects_transfer-configs-create.md', 'Projects', 'Transfer Configs Create'] +- ['projects_transfer-configs-delete.md', 'Projects', 'Transfer Configs Delete'] +- ['projects_transfer-configs-get.md', 'Projects', 'Transfer Configs Get'] +- ['projects_transfer-configs-list.md', 'Projects', 'Transfer Configs List'] +- ['projects_transfer-configs-patch.md', 'Projects', 'Transfer Configs Patch'] +- ['projects_transfer-configs-runs-delete.md', 'Projects', 'Transfer Configs Runs Delete'] +- ['projects_transfer-configs-runs-get.md', 'Projects', 'Transfer Configs Runs Get'] +- ['projects_transfer-configs-runs-list.md', 'Projects', 'Transfer Configs Runs List'] +- ['projects_transfer-configs-runs-transfer-logs-list.md', 'Projects', 'Transfer Configs Runs Transfer Logs List'] +- ['projects_transfer-configs-schedule-runs.md', 'Projects', 'Transfer Configs Schedule Runs'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/bigquerydatatransfer1-cli/src/cmn.rs b/gen/bigquerydatatransfer1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/bigquerydatatransfer1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/bigquerydatatransfer1-cli/src/main.rs b/gen/bigquerydatatransfer1-cli/src/main.rs new file mode 100644 index 0000000000..cf18b6ac0a --- /dev/null +++ b/gen/bigquerydatatransfer1-cli/src/main.rs @@ -0,0 +1,2940 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_bigquerydatatransfer1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::BigQueryDataTransfer>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_data_sources_check_valid_creds(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CheckValidCredsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().data_sources_check_valid_creds(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_data_sources_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().data_sources_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_data_sources_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().data_sources_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_data_sources_check_valid_creds(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CheckValidCredsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_data_sources_check_valid_creds(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_data_sources_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_data_sources_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_data_sources_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_data_sources_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "data-refresh-window-days" => Some(("dataRefreshWindowDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disabled", "display-name", "name", "next-run-time", "schedule", "state", "update-time", "user-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TransferConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_transfer_configs_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "authorization-code" => { + call = call.authorization_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(["authorization-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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + "data-source-ids" => { + call = call.add_data_source_ids(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(["page-token", "data-source-ids", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "data-refresh-window-days" => Some(("dataRefreshWindowDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disabled", "display-name", "name", "next-run-time", "schedule", "state", "update-time", "user-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TransferConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_transfer_configs_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "authorization-code" => { + call = call.authorization_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(["authorization-code", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_runs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_runs_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_runs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_runs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_runs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_runs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "states" => { + call = call.add_states(value.unwrap_or("")); + }, + "run-attempt" => { + call = call.run_attempt(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["states", "run-attempt", "page-size", "page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_runs_transfer_logs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_transfer_configs_runs_transfer_logs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + "message-types" => { + call = call.add_message_types(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(["message-types", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_transfer_configs_schedule_runs(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["end-time", "start-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::ScheduleTransferRunsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_transfer_configs_schedule_runs(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "data-refresh-window-days" => Some(("dataRefreshWindowDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disabled", "display-name", "name", "next-run-time", "schedule", "state", "update-time", "user-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TransferConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().transfer_configs_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "authorization-code" => { + call = call.authorization_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(["authorization-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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + "data-source-ids" => { + call = call.add_data_source_ids(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(["page-token", "data-source-ids", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "data-refresh-window-days" => Some(("dataRefreshWindowDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disabled", "display-name", "name", "next-run-time", "schedule", "state", "update-time", "user-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TransferConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().transfer_configs_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "authorization-code" => { + call = call.authorization_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(["authorization-code", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_runs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_runs_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_runs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_runs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_runs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_runs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "states" => { + call = call.add_states(value.unwrap_or("")); + }, + "run-attempt" => { + call = call.run_attempt(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["states", "run-attempt", "page-size", "page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_runs_transfer_logs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().transfer_configs_runs_transfer_logs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + "message-types" => { + call = call.add_message_types(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(["message-types", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_transfer_configs_schedule_runs(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["end-time", "start-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::ScheduleTransferRunsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().transfer_configs_schedule_runs(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("data-sources-check-valid-creds", Some(opt)) => { + call_result = self._projects_data_sources_check_valid_creds(opt, dry_run, &mut err); + }, + ("data-sources-get", Some(opt)) => { + call_result = self._projects_data_sources_get(opt, dry_run, &mut err); + }, + ("data-sources-list", Some(opt)) => { + call_result = self._projects_data_sources_list(opt, dry_run, &mut err); + }, + ("locations-data-sources-check-valid-creds", Some(opt)) => { + call_result = self._projects_locations_data_sources_check_valid_creds(opt, dry_run, &mut err); + }, + ("locations-data-sources-get", Some(opt)) => { + call_result = self._projects_locations_data_sources_get(opt, dry_run, &mut err); + }, + ("locations-data-sources-list", Some(opt)) => { + call_result = self._projects_locations_data_sources_list(opt, dry_run, &mut err); + }, + ("locations-get", Some(opt)) => { + call_result = self._projects_locations_get(opt, dry_run, &mut err); + }, + ("locations-list", Some(opt)) => { + call_result = self._projects_locations_list(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-create", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_create(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-delete", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_delete(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-get", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_get(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-list", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_list(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-patch", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_patch(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-runs-delete", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_runs_delete(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-runs-get", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_runs_get(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-runs-list", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_runs_list(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-runs-transfer-logs-list", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_runs_transfer_logs_list(opt, dry_run, &mut err); + }, + ("locations-transfer-configs-schedule-runs", Some(opt)) => { + call_result = self._projects_locations_transfer_configs_schedule_runs(opt, dry_run, &mut err); + }, + ("transfer-configs-create", Some(opt)) => { + call_result = self._projects_transfer_configs_create(opt, dry_run, &mut err); + }, + ("transfer-configs-delete", Some(opt)) => { + call_result = self._projects_transfer_configs_delete(opt, dry_run, &mut err); + }, + ("transfer-configs-get", Some(opt)) => { + call_result = self._projects_transfer_configs_get(opt, dry_run, &mut err); + }, + ("transfer-configs-list", Some(opt)) => { + call_result = self._projects_transfer_configs_list(opt, dry_run, &mut err); + }, + ("transfer-configs-patch", Some(opt)) => { + call_result = self._projects_transfer_configs_patch(opt, dry_run, &mut err); + }, + ("transfer-configs-runs-delete", Some(opt)) => { + call_result = self._projects_transfer_configs_runs_delete(opt, dry_run, &mut err); + }, + ("transfer-configs-runs-get", Some(opt)) => { + call_result = self._projects_transfer_configs_runs_get(opt, dry_run, &mut err); + }, + ("transfer-configs-runs-list", Some(opt)) => { + call_result = self._projects_transfer_configs_runs_list(opt, dry_run, &mut err); + }, + ("transfer-configs-runs-transfer-logs-list", Some(opt)) => { + call_result = self._projects_transfer_configs_runs_transfer_logs_list(opt, dry_run, &mut err); + }, + ("transfer-configs-schedule-runs", Some(opt)) => { + call_result = self._projects_transfer_configs_schedule_runs(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<'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, "bigquerydatatransfer1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "bigquerydatatransfer1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::BigQueryDataTransfer::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: 'data-sources-check-valid-creds', 'data-sources-get', 'data-sources-list', 'locations-data-sources-check-valid-creds', 'locations-data-sources-get', 'locations-data-sources-list', 'locations-get', 'locations-list', 'locations-transfer-configs-create', 'locations-transfer-configs-delete', 'locations-transfer-configs-get', 'locations-transfer-configs-list', 'locations-transfer-configs-patch', 'locations-transfer-configs-runs-delete', 'locations-transfer-configs-runs-get', 'locations-transfer-configs-runs-list', 'locations-transfer-configs-runs-transfer-logs-list', 'locations-transfer-configs-schedule-runs', 'transfer-configs-create', 'transfer-configs-delete', 'transfer-configs-get', 'transfer-configs-list', 'transfer-configs-patch', 'transfer-configs-runs-delete', 'transfer-configs-runs-get', 'transfer-configs-runs-list', 'transfer-configs-runs-transfer-logs-list' and 'transfer-configs-schedule-runs'", vec![ + ("data-sources-check-valid-creds", + Some(r##"Returns true if valid credentials exist for the given data source and + requesting user. + Some data sources doesn't support service account, so we need to talk to + them on behalf of the end user. This API just checks whether we have OAuth + token for the particular user, which is a pre-requisite before user can + create a transfer config."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_data-sources-check-valid-creds", + vec![ + (Some(r##"name"##), + None, + Some(r##"The data source in the form: + `projects/{project_id}/dataSources/{data_source_id}`"##), + 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)), + ]), + ("data-sources-get", + Some(r##"Retrieves a supported data source and returns its settings, + which can be used for UI rendering."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_data-sources-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/dataSources/{data_source_id}`"##), + 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)), + ]), + ("data-sources-list", + Some(r##"Lists supported data sources and returns their settings, + which can be used for UI rendering."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_data-sources-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The BigQuery project id for which data sources should be returned. + Must be in the form: `projects/{project_id}`"##), + 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)), + ]), + ("locations-data-sources-check-valid-creds", + Some(r##"Returns true if valid credentials exist for the given data source and + requesting user. + Some data sources doesn't support service account, so we need to talk to + them on behalf of the end user. This API just checks whether we have OAuth + token for the particular user, which is a pre-requisite before user can + create a transfer config."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-data-sources-check-valid-creds", + vec![ + (Some(r##"name"##), + None, + Some(r##"The data source in the form: + `projects/{project_id}/dataSources/{data_source_id}`"##), + 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)), + ]), + ("locations-data-sources-get", + Some(r##"Retrieves a supported data source and returns its settings, + which can be used for UI rendering."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-data-sources-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/dataSources/{data_source_id}`"##), + 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)), + ]), + ("locations-data-sources-list", + Some(r##"Lists supported data sources and returns their settings, + which can be used for UI rendering."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-data-sources-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The BigQuery project id for which data sources should be returned. + Must be in the form: `projects/{project_id}`"##), + 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)), + ]), + ("locations-get", + Some(r##"Get information about a location."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name for the location."##), + 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)), + ]), + ("locations-list", + Some(r##"Lists information about the supported locations for this service."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource that owns the locations collection, if applicable."##), + 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)), + ]), + ("locations-transfer-configs-create", + Some(r##"Creates a new data transfer configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The BigQuery project id where the transfer configuration should be created. + Must be in the format /projects/{project_id}/locations/{location_id} + or + /projects/{project_id}/locations/- + In case when '-' is specified as location_id, location is infered from + the destination dataset region."##), + 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)), + ]), + ("locations-transfer-configs-delete", + Some(r##"Deletes a data transfer configuration, + including any associated transfer runs and logs."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}`"##), + 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)), + ]), + ("locations-transfer-configs-get", + Some(r##"Returns information about a data transfer config."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}`"##), + 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)), + ]), + ("locations-transfer-configs-list", + Some(r##"Returns information about all data transfers in the project."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The BigQuery project id for which data sources + should be returned: `projects/{project_id}`."##), + 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)), + ]), + ("locations-transfer-configs-patch", + Some(r##"Updates a data transfer configuration. + All fields must be set, even if they are not updated."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the transfer config. + Transfer config names have the form + `projects/{project_id}/transferConfigs/{config_id}`. + Where `config_id` is usually a uuid, even though it is not + guaranteed or required. The name is ignored when creating a transfer + config."##), + 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)), + ]), + ("locations-transfer-configs-runs-delete", + Some(r##"Deletes the specified transfer run."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-runs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + 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)), + ]), + ("locations-transfer-configs-runs-get", + Some(r##"Returns information about the particular transfer run."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-runs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + 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)), + ]), + ("locations-transfer-configs-runs-list", + Some(r##"Returns information about running and completed jobs."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-runs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Name of transfer configuration for which transfer runs should be retrieved. + Format of transfer configuration resource name is: + `projects/{project_id}/transferConfigs/{config_id}`."##), + 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)), + ]), + ("locations-transfer-configs-runs-transfer-logs-list", + Some(r##"Returns user facing log messages for the data transfer run."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-runs-transfer-logs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Transfer run name in the form: + `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`."##), + 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)), + ]), + ("locations-transfer-configs-schedule-runs", + Some(r##"Creates transfer runs for a time range [range_start_time, range_end_time]. + For each date - or whatever granularity the data source supports - in the + range, one transfer run is created. + Note that runs are created per UTC time in the time range."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_locations-transfer-configs-schedule-runs", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Transfer configuration name in the form: + `projects/{project_id}/transferConfigs/{config_id}`."##), + 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)), + ]), + ("transfer-configs-create", + Some(r##"Creates a new data transfer configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The BigQuery project id where the transfer configuration should be created. + Must be in the format /projects/{project_id}/locations/{location_id} + or + /projects/{project_id}/locations/- + In case when '-' is specified as location_id, location is infered from + the destination dataset region."##), + 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)), + ]), + ("transfer-configs-delete", + Some(r##"Deletes a data transfer configuration, + including any associated transfer runs and logs."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}`"##), + 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)), + ]), + ("transfer-configs-get", + Some(r##"Returns information about a data transfer config."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}`"##), + 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)), + ]), + ("transfer-configs-list", + Some(r##"Returns information about all data transfers in the project."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The BigQuery project id for which data sources + should be returned: `projects/{project_id}`."##), + 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)), + ]), + ("transfer-configs-patch", + Some(r##"Updates a data transfer configuration. + All fields must be set, even if they are not updated."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the transfer config. + Transfer config names have the form + `projects/{project_id}/transferConfigs/{config_id}`. + Where `config_id` is usually a uuid, even though it is not + guaranteed or required. The name is ignored when creating a transfer + config."##), + 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)), + ]), + ("transfer-configs-runs-delete", + Some(r##"Deletes the specified transfer run."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-runs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + 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)), + ]), + ("transfer-configs-runs-get", + Some(r##"Returns information about the particular transfer run."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-runs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + 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)), + ]), + ("transfer-configs-runs-list", + Some(r##"Returns information about running and completed jobs."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-runs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Name of transfer configuration for which transfer runs should be retrieved. + Format of transfer configuration resource name is: + `projects/{project_id}/transferConfigs/{config_id}`."##), + 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)), + ]), + ("transfer-configs-runs-transfer-logs-list", + Some(r##"Returns user facing log messages for the data transfer run."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-runs-transfer-logs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Transfer run name in the form: + `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`."##), + 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)), + ]), + ("transfer-configs-schedule-runs", + Some(r##"Creates transfer runs for a time range [range_start_time, range_end_time]. + For each date - or whatever granularity the data source supports - in the + range, one transfer run is created. + Note that runs are created per UTC time in the time range."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli/projects_transfer-configs-schedule-runs", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Transfer configuration name in the form: + `projects/{project_id}/transferConfigs/{config_id}`."##), + 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("bigquerydatatransfer1") + .author("Sebastian Thiel ") + .version("1.0.6+20170921") + .about("Transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/bigquerydatatransfer1/Cargo.toml b/gen/bigquerydatatransfer1/Cargo.toml new file mode 100644 index 0000000000..be65a646e4 --- /dev/null +++ b/gen/bigquerydatatransfer1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-bigquerydatatransfer1" +version = "1.0.6+20170921" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with BigQuery Data Transfer (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1" +homepage = "https://cloud.google.com/bigquery/" +documentation = "https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921" +license = "MIT" +keywords = ["bigquerydatatransfer", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/bigquerydatatransfer1/LICENSE.md b/gen/bigquerydatatransfer1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/bigquerydatatransfer1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/bigquerydatatransfer1/README.md b/gen/bigquerydatatransfer1/README.md new file mode 100644 index 0000000000..e3446744fc --- /dev/null +++ b/gen/bigquerydatatransfer1/README.md @@ -0,0 +1,187 @@ + +The `google-bigquerydatatransfer1` library allows access to all features of the *Google BigQuery Data Transfer* service. + +This documentation was generated from *BigQuery Data Transfer* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *bigquerydatatransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *BigQuery Data Transfer* *v1* API can be found at the +[official documentation site](https://cloud.google.com/bigquery/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html) ... + +* projects + * [*data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectDataSourceCheckValidCredCall.html), [*data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectDataSourceListCall.html), [*locations data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceCheckValidCredCall.html), [*locations data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceGetCall.html), [*locations data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceListCall.html), [*locations get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationListCall.html), [*locations transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigCreateCall.html), [*locations transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigDeleteCall.html), [*locations transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigGetCall.html), [*locations transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigListCall.html), [*locations transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigPatchCall.html), [*locations transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunDeleteCall.html), [*locations transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunGetCall.html), [*locations transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunListCall.html), [*locations transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunTransferLogListCall.html), [*locations transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigScheduleRunCall.html), [*transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigCreateCall.html), [*transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigDeleteCall.html), [*transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigGetCall.html), [*transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigListCall.html), [*transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigPatchCall.html), [*transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunDeleteCall.html), [*transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunGetCall.html), [*transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunListCall.html), [*transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunTransferLogListCall.html) and [*transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.ProjectTransferConfigScheduleRunCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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().transfer_configs_patch(...).doit() +let r = hub.projects().locations_transfer_configs_patch(...).doit() +let r = hub.projects().transfer_configs_create(...).doit() +let r = hub.projects().locations_transfer_configs_create(...).doit() +let r = hub.projects().transfer_configs_get(...).doit() +let r = hub.projects().locations_transfer_configs_get(...).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-bigquerydatatransfer1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +use bigquerydatatransfer1::TransferConfig; +use bigquerydatatransfer1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use bigquerydatatransfer1::BigQueryDataTransfer; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().transfer_configs_patch(req, "name") + .update_mask("sit") + .authorization_code("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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/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 **bigquerydatatransfer1** 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-rsblob/master/LICENSE.md diff --git a/gen/bigquerydatatransfer1/src/cmn.rs b/gen/bigquerydatatransfer1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/bigquerydatatransfer1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/bigquerydatatransfer1/src/lib.rs b/gen/bigquerydatatransfer1/src/lib.rs new file mode 100644 index 0000000000..4e49f17acd --- /dev/null +++ b/gen/bigquerydatatransfer1/src/lib.rs @@ -0,0 +1,9534 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *BigQuery Data Transfer* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *bigquerydatatransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *BigQuery Data Transfer* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/bigquery/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.BigQueryDataTransfer.html) ... +//! +//! * projects +//! * [*data sources check valid creds*](struct.ProjectDataSourceCheckValidCredCall.html), [*data sources get*](struct.ProjectDataSourceGetCall.html), [*data sources list*](struct.ProjectDataSourceListCall.html), [*locations data sources check valid creds*](struct.ProjectLocationDataSourceCheckValidCredCall.html), [*locations data sources get*](struct.ProjectLocationDataSourceGetCall.html), [*locations data sources list*](struct.ProjectLocationDataSourceListCall.html), [*locations get*](struct.ProjectLocationGetCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations transfer configs create*](struct.ProjectLocationTransferConfigCreateCall.html), [*locations transfer configs delete*](struct.ProjectLocationTransferConfigDeleteCall.html), [*locations transfer configs get*](struct.ProjectLocationTransferConfigGetCall.html), [*locations transfer configs list*](struct.ProjectLocationTransferConfigListCall.html), [*locations transfer configs patch*](struct.ProjectLocationTransferConfigPatchCall.html), [*locations transfer configs runs delete*](struct.ProjectLocationTransferConfigRunDeleteCall.html), [*locations transfer configs runs get*](struct.ProjectLocationTransferConfigRunGetCall.html), [*locations transfer configs runs list*](struct.ProjectLocationTransferConfigRunListCall.html), [*locations transfer configs runs transfer logs list*](struct.ProjectLocationTransferConfigRunTransferLogListCall.html), [*locations transfer configs schedule runs*](struct.ProjectLocationTransferConfigScheduleRunCall.html), [*transfer configs create*](struct.ProjectTransferConfigCreateCall.html), [*transfer configs delete*](struct.ProjectTransferConfigDeleteCall.html), [*transfer configs get*](struct.ProjectTransferConfigGetCall.html), [*transfer configs list*](struct.ProjectTransferConfigListCall.html), [*transfer configs patch*](struct.ProjectTransferConfigPatchCall.html), [*transfer configs runs delete*](struct.ProjectTransferConfigRunDeleteCall.html), [*transfer configs runs get*](struct.ProjectTransferConfigRunGetCall.html), [*transfer configs runs list*](struct.ProjectTransferConfigRunListCall.html), [*transfer configs runs transfer logs list*](struct.ProjectTransferConfigRunTransferLogListCall.html) and [*transfer configs schedule runs*](struct.ProjectTransferConfigScheduleRunCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.BigQueryDataTransfer.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().transfer_configs_patch(...).doit() +//! let r = hub.projects().locations_transfer_configs_patch(...).doit() +//! let r = hub.projects().transfer_configs_create(...).doit() +//! let r = hub.projects().locations_transfer_configs_create(...).doit() +//! let r = hub.projects().transfer_configs_get(...).doit() +//! let r = hub.projects().locations_transfer_configs_get(...).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-bigquerydatatransfer1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +//! use bigquerydatatransfer1::TransferConfig; +//! use bigquerydatatransfer1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use bigquerydatatransfer1::BigQueryDataTransfer; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().transfer_configs_patch(req, "name") +//! .update_mask("et") +//! .authorization_code("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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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, + + /// View and manage your data in Google BigQuery + Bigquery, + + /// View your data across Google Cloud Platform services + CloudPlatformReadOnly, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::Bigquery => "https://www.googleapis.com/auth/bigquery", + Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Bigquery + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all BigQueryDataTransfer related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::TransferConfig; +/// use bigquerydatatransfer1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().transfer_configs_patch(req, "name") +/// .update_mask("accusam") +/// .authorization_code("takimata") +/// .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 BigQueryDataTransfer { + client: RefCell, + auth: RefCell
, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for BigQueryDataTransfer {} + +impl<'a, C, A> BigQueryDataTransfer + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> BigQueryDataTransfer { + BigQueryDataTransfer { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://bigquerydatatransfer.googleapis.com/".to_string(), + _root_url: "https://bigquerydatatransfer.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://bigquerydatatransfer.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://bigquerydatatransfer.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// A response to schedule transfer runs for a time range. +/// +/// # 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*). +/// +/// * [transfer configs schedule runs projects](struct.ProjectTransferConfigScheduleRunCall.html) (response) +/// * [locations transfer configs schedule runs projects](struct.ProjectLocationTransferConfigScheduleRunCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ScheduleTransferRunsResponse { + /// The transfer runs that were scheduled. + pub runs: Option>, +} + +impl ResponseResult for ScheduleTransferRunsResponse {} + + +/// Returns list of supported data sources and their metadata. +/// +/// # 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*). +/// +/// * [locations data sources list projects](struct.ProjectLocationDataSourceListCall.html) (response) +/// * [data sources list projects](struct.ProjectDataSourceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDataSourcesResponse { + /// The next-pagination token. For multiple-page list results, + /// this token can be used as the + /// `ListDataSourcesRequest.page_token` + /// to request the next page of list results. + /// Output only. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of supported data sources and their transfer settings. + #[serde(rename="dataSources")] + pub data_sources: Option>, +} + +impl ResponseResult for ListDataSourcesResponse {} + + +/// Represents a user facing message for a particular data transfer run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransferMessage { + /// Time when message was logged. + #[serde(rename="messageTime")] + pub message_time: Option, + /// Message text. + #[serde(rename="messageText")] + pub message_text: Option, + /// Message severity. + pub severity: Option, +} + +impl Part for TransferMessage {} + + +/// The response message for Locations.ListLocations. +/// +/// # 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*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLocationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of locations that matches the specified filter in the request. + pub locations: Option>, +} + +impl ResponseResult for ListLocationsResponse {} + + +/// A resource that represents Google Cloud Platform location. +/// +/// # 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*). +/// +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Location { + /// Cross-service attributes for the location. For example + /// + /// {"cloud.googleapis.com/region": "us-east1"} + pub labels: Option>, + /// The canonical id for this location. For example: `"us-east1"`. + #[serde(rename="locationId")] + pub location_id: Option, + /// Resource name for the location, which may vary between implementations. + /// For example: `"projects/example-project/locations/us-east1"` + pub name: Option, + /// Service-specific metadata. For example the available capacity at the given + /// location. + pub metadata: Option>, +} + +impl ResponseResult for Location {} + + +/// A request to determine whether the user has valid credentials. This method +/// is used to limit the number of OAuth popups in the user interface. The +/// user id is inferred from the API call context. +/// If the data source has the Google+ authorization type, this method +/// returns false, as it cannot be determined whether the credentials are +/// already valid merely based on the user id. +/// +/// # 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*). +/// +/// * [locations data sources check valid creds projects](struct.ProjectLocationDataSourceCheckValidCredCall.html) (request) +/// * [data sources check valid creds projects](struct.ProjectDataSourceCheckValidCredCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CheckValidCredsRequest { _never_set: Option } + +impl RequestValue for CheckValidCredsRequest {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations transfer configs runs delete projects](struct.ProjectLocationTransferConfigRunDeleteCall.html) (response) +/// * [transfer configs runs delete projects](struct.ProjectTransferConfigRunDeleteCall.html) (response) +/// * [transfer configs delete projects](struct.ProjectTransferConfigDeleteCall.html) (response) +/// * [locations transfer configs delete projects](struct.ProjectLocationTransferConfigDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The returned list transfer run messages. +/// +/// # 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*). +/// +/// * [locations transfer configs runs transfer logs list projects](struct.ProjectLocationTransferConfigRunTransferLogListCall.html) (response) +/// * [transfer configs runs transfer logs list projects](struct.ProjectTransferConfigRunTransferLogListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTransferLogsResponse { + /// The next-pagination token. For multiple-page list results, + /// this token can be used as the + /// `GetTransferRunLogRequest.page_token` + /// to request the next page of list results. + /// Output only. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The stored pipeline transfer messages. + /// Output only. + #[serde(rename="transferMessages")] + pub transfer_messages: Option>, +} + +impl ResponseResult for ListTransferLogsResponse {} + + +/// Represents a data transfer configuration. A transfer configuration +/// contains all metadata needed to perform a data transfer. For example, +/// `destination_dataset_id` specifies where data should be stored. +/// When a new transfer configuration is created, the specified +/// `destination_dataset_id` is created when needed and shared with the +/// appropriate data source service account. +/// +/// # 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*). +/// +/// * [transfer configs patch projects](struct.ProjectTransferConfigPatchCall.html) (request|response) +/// * [locations transfer configs patch projects](struct.ProjectLocationTransferConfigPatchCall.html) (request|response) +/// * [transfer configs create projects](struct.ProjectTransferConfigCreateCall.html) (request|response) +/// * [locations transfer configs create projects](struct.ProjectLocationTransferConfigCreateCall.html) (request|response) +/// * [transfer configs get projects](struct.ProjectTransferConfigGetCall.html) (response) +/// * [locations transfer configs get projects](struct.ProjectLocationTransferConfigGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransferConfig { + /// The number of days to look back to automatically refresh the data. + /// For example, if `data_refresh_window_days = 10`, then every day + /// BigQuery reingests data for [today-10, today-1], rather than ingesting data + /// for just [today-1]. + /// Only valid if the data source supports the feature. Set the value to 0 + /// to use the default value. + #[serde(rename="dataRefreshWindowDays")] + pub data_refresh_window_days: Option, + /// Data transfer modification time. Ignored by server on input. + /// Output only. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The BigQuery target dataset id. + #[serde(rename="destinationDatasetId")] + pub destination_dataset_id: Option, + /// User specified display name for the data transfer. + #[serde(rename="displayName")] + pub display_name: Option, + /// The resource name of the transfer config. + /// Transfer config names have the form + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Where `config_id` is usually a uuid, even though it is not + /// guaranteed or required. The name is ignored when creating a transfer + /// config. + pub name: Option, + /// Data transfer schedule. + /// If the data source does not support a custom schedule, this should be + /// empty. If it is empty, the default value for the data source will be + /// used. + /// The specified times are in UTC. + /// Examples of valid format: + /// `1st,3rd monday of month 15:30`, + /// `every wed,fri of jan,jun 13:15`, and + /// `first sunday of quarter 00:00`. + /// See more explanation about the format here: + /// https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + /// NOTE: the granularity should be at least 8 hours, or less frequent. + pub schedule: Option, + /// Region in which BigQuery dataset is located. Currently possible values are: + /// "US" and "EU". + /// Output only. + #[serde(rename="datasetRegion")] + pub dataset_region: Option, + /// Unique ID of the user on whose behalf transfer is done. Applicable only + /// to data sources that do not support service accounts. When set to 0, + /// the data source service account credentials are used. + /// Output only. + #[serde(rename="userId")] + pub user_id: Option, + /// Is this config disabled. When set to true, no runs are scheduled + /// for a given transfer. + pub disabled: Option, + /// State of the most recently updated transfer run. + /// Output only. + pub state: Option, + /// Data transfer specific parameters. + pub params: Option>, + /// Next time when data transfer will run. + /// Output only. + #[serde(rename="nextRunTime")] + pub next_run_time: Option, + /// Data source id. Cannot be changed once data transfer is created. + #[serde(rename="dataSourceId")] + pub data_source_id: Option, +} + +impl RequestValue for TransferConfig {} +impl ResponseResult for TransferConfig {} + + +/// Represents a data source parameter with validation rules, so that +/// parameters can be rendered in the UI. These parameters are given to us by +/// supported data sources, and include all needed information for rendering +/// and validation. +/// Thus, whoever uses this api can decide to generate either generic ui, +/// or custom data source specific forms. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataSourceParameter { + /// Parameter display name in the user interface. + #[serde(rename="displayName")] + pub display_name: Option, + /// Parameter description. + pub description: Option, + /// Description of the requirements for this field, in case the user input does + /// not fulfill the regex pattern or min/max values. + #[serde(rename="validationDescription")] + pub validation_description: Option, + /// When parameter is a record, describes child fields. + pub fields: Option>, + /// For integer and double values specifies minimum allowed value. + #[serde(rename="minValue")] + pub min_value: Option, + /// Is parameter required. + pub required: Option, + /// If set to true, schema should be taken from the parent with the same + /// parameter_id. Only applicable when parameter type is RECORD. + pub recurse: Option, + /// For integer and double values specifies maxminum allowed value. + #[serde(rename="maxValue")] + pub max_value: Option, + /// All possible values for the parameter. + #[serde(rename="allowedValues")] + pub allowed_values: Option>, + /// Can parameter have multiple values. + pub repeated: Option, + /// Regular expression which can be used for parameter validation. + #[serde(rename="validationRegex")] + pub validation_regex: Option, + /// URL to a help document to further explain the naming requirements. + #[serde(rename="validationHelpUrl")] + pub validation_help_url: Option, + /// Parameter identifier. + #[serde(rename="paramId")] + pub param_id: Option, + /// Parameter type. + #[serde(rename="type")] + pub type_: Option, + /// Cannot be changed after initial creation. + pub immutable: Option, +} + +impl Part for DataSourceParameter {} + + +/// The returned list of pipelines in the project. +/// +/// # 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*). +/// +/// * [locations transfer configs list projects](struct.ProjectLocationTransferConfigListCall.html) (response) +/// * [transfer configs list projects](struct.ProjectTransferConfigListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTransferConfigsResponse { + /// The next-pagination token. For multiple-page list results, + /// this token can be used as the + /// `ListTransferConfigsRequest.page_token` + /// to request the next page of list results. + /// Output only. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The stored pipeline transfer configurations. + /// Output only. + #[serde(rename="transferConfigs")] + pub transfer_configs: Option>, +} + +impl ResponseResult for ListTransferConfigsResponse {} + + +/// Represents data source metadata. Metadata is sufficient to +/// render UI and request proper OAuth tokens. +/// +/// # 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 get projects](struct.ProjectDataSourceGetCall.html) (response) +/// * [locations data sources get projects](struct.ProjectLocationDataSourceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataSource { + /// Api auth scopes for which refresh token needs to be obtained. Only valid + /// when `client_id` is specified. Ignored otherwise. These are scopes needed + /// by a data source to prepare data and ingest them into BigQuery, + /// e.g., https://www.googleapis.com/auth/bigquery + pub scopes: Option>, + /// The minimum interval between two consecutive scheduled runs. + #[serde(rename="minimumScheduleInterval")] + pub minimum_schedule_interval: Option, + /// Specifies whether the data source supports a user defined schedule, or + /// operates on the default schedule. + /// When set to `true`, user can override default schedule. + #[serde(rename="supportsCustomSchedule")] + pub supports_custom_schedule: Option, + /// User friendly data source description string. + pub description: Option, + /// Indicates the type of authorization. + #[serde(rename="authorizationType")] + pub authorization_type: Option, + /// The number of seconds to wait for an update from the data source + /// before BigQuery marks the transfer as failed. + #[serde(rename="updateDeadlineSeconds")] + pub update_deadline_seconds: Option, + /// Default data transfer schedule. + /// Examples of valid schedules include: + /// `1st,3rd monday of month 15:30`, + /// `every wed,fri of jan,jun 13:15`, and + /// `first sunday of quarter 00:00`. + #[serde(rename="defaultSchedule")] + pub default_schedule: Option, + /// Data source id. + #[serde(rename="dataSourceId")] + pub data_source_id: Option, + /// Disables backfilling and manual run scheduling + /// for the data source. + #[serde(rename="manualRunsDisabled")] + pub manual_runs_disabled: Option, + /// Transfer type. Currently supports only batch transfers, + /// which are transfers that use the BigQuery batch APIs (load or + /// query) to ingest the data. + #[serde(rename="transferType")] + pub transfer_type: Option, + /// User friendly data source name. + #[serde(rename="displayName")] + pub display_name: Option, + /// Specifies whether the data source supports automatic data refresh for the + /// past few days, and how it's supported. + /// For some data sources, data might not be complete until a few days later, + /// so it's useful to refresh data automatically. + #[serde(rename="dataRefreshType")] + pub data_refresh_type: Option, + /// Data source parameters. + pub parameters: Option>, + /// Data source client id which should be used to receive refresh token. + /// When not supplied, no offline credentials are populated for data transfer. + #[serde(rename="clientId")] + pub client_id: Option, + /// Data source resource name. + pub name: Option, + /// Indicates whether the data source supports multiple transfers + /// to different BigQuery targets. + #[serde(rename="supportsMultipleTransfers")] + pub supports_multiple_transfers: Option, + /// Url for the help document for this data source. + #[serde(rename="helpUrl")] + pub help_url: Option, + /// Default data refresh window on days. + /// Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + #[serde(rename="defaultDataRefreshWindowDays")] + pub default_data_refresh_window_days: Option, +} + +impl ResponseResult for DataSource {} + + +/// Represents a data transfer run. +/// +/// # 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*). +/// +/// * [locations transfer configs runs get projects](struct.ProjectLocationTransferConfigRunGetCall.html) (response) +/// * [transfer configs runs get projects](struct.ProjectTransferConfigRunGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransferRun { + /// Last time the data transfer run state was updated. + /// Output only. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The BigQuery target dataset id. + #[serde(rename="destinationDatasetId")] + pub destination_dataset_id: Option, + /// The resource name of the transfer run. + /// Transfer run names have the form + /// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + /// The name is ignored when creating a transfer run. + pub name: Option, + /// Describes the schedule of this transfer run if it was created as part of + /// a regular schedule. For batch transfer runs that are directly created, + /// this is empty. + /// NOTE: the system might choose to delay the schedule depending on the + /// current load, so `schedule_time` doesn't always matches this. + /// Output only. + pub schedule: Option, + /// Minimum time after which a transfer run can be started. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, + /// Region in which BigQuery dataset is located. Currently possible values are: + /// "US" and "EU". + /// Output only. + #[serde(rename="datasetRegion")] + pub dataset_region: Option, + /// Unique ID of the user on whose behalf transfer is done. Applicable only + /// to data sources that do not support service accounts. When set to 0, + /// the data source service account credentials are used. + /// Output only. + #[serde(rename="userId")] + pub user_id: Option, + /// Data transfer run state. Ignored for input requests. + /// Output only. + pub state: Option, + /// Data source id. + /// Output only. + #[serde(rename="dataSourceId")] + pub data_source_id: Option, + /// Time when transfer run was started. Parameter ignored by server for input + /// requests. + /// Output only. + #[serde(rename="startTime")] + pub start_time: Option, + /// Data transfer specific parameters. + pub params: Option>, + /// For batch transfer runs, specifies the date and time that + /// data should be ingested. + #[serde(rename="runTime")] + pub run_time: Option, + /// Time when transfer run ended. Parameter ignored by server for input + /// requests. + /// Output only. + #[serde(rename="endTime")] + pub end_time: Option, +} + +impl ResponseResult for TransferRun {} + + +/// The returned list of pipelines in the project. +/// +/// # 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*). +/// +/// * [transfer configs runs list projects](struct.ProjectTransferConfigRunListCall.html) (response) +/// * [locations transfer configs runs list projects](struct.ProjectLocationTransferConfigRunListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTransferRunsResponse { + /// The next-pagination token. For multiple-page list results, + /// this token can be used as the + /// `ListTransferRunsRequest.page_token` + /// to request the next page of list results. + /// Output only. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The stored pipeline transfer runs. + /// Output only. + #[serde(rename="transferRuns")] + pub transfer_runs: Option>, +} + +impl ResponseResult for ListTransferRunsResponse {} + + +/// A request to schedule transfer runs for a time range. +/// +/// # 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*). +/// +/// * [transfer configs schedule runs projects](struct.ProjectTransferConfigScheduleRunCall.html) (request) +/// * [locations transfer configs schedule runs projects](struct.ProjectLocationTransferConfigScheduleRunCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ScheduleTransferRunsRequest { + /// End time of the range of transfer runs. For example, + /// `"2017-05-30T00:00:00+00:00"`. + #[serde(rename="endTime")] + pub end_time: Option, + /// Start time of the range of transfer runs. For example, + /// `"2017-05-25T00:00:00+00:00"`. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl RequestValue for ScheduleTransferRunsRequest {} + + +/// A response indicating whether the credentials exist and are valid. +/// +/// # 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*). +/// +/// * [locations data sources check valid creds projects](struct.ProjectLocationDataSourceCheckValidCredCall.html) (response) +/// * [data sources check valid creds projects](struct.ProjectDataSourceCheckValidCredCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CheckValidCredsResponse { + /// If set to `true`, the credentials exist and are valid. + #[serde(rename="hasValidCreds")] + pub has_valid_creds: Option, +} + +impl ResponseResult for CheckValidCredsResponse {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `BigQueryDataTransfer` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `data_sources_check_valid_creds(...)`, `data_sources_get(...)`, `data_sources_list(...)`, `locations_data_sources_check_valid_creds(...)`, `locations_data_sources_get(...)`, `locations_data_sources_list(...)`, `locations_get(...)`, `locations_list(...)`, `locations_transfer_configs_create(...)`, `locations_transfer_configs_delete(...)`, `locations_transfer_configs_get(...)`, `locations_transfer_configs_list(...)`, `locations_transfer_configs_patch(...)`, `locations_transfer_configs_runs_delete(...)`, `locations_transfer_configs_runs_get(...)`, `locations_transfer_configs_runs_list(...)`, `locations_transfer_configs_runs_transfer_logs_list(...)`, `locations_transfer_configs_schedule_runs(...)`, `transfer_configs_create(...)`, `transfer_configs_delete(...)`, `transfer_configs_get(...)`, `transfer_configs_list(...)`, `transfer_configs_patch(...)`, `transfer_configs_runs_delete(...)`, `transfer_configs_runs_get(...)`, `transfer_configs_runs_list(...)`, `transfer_configs_runs_transfer_logs_list(...)` and `transfer_configs_schedule_runs(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, +} + +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: + /// + /// Retrieves a supported data source and returns its settings, + /// which can be used for UI rendering. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/dataSources/{data_source_id}` + pub fn data_sources_get(&self, name: &str) -> ProjectDataSourceGetCall<'a, C, A> { + ProjectDataSourceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a data transfer configuration, + /// including any associated transfer runs and logs. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + pub fn locations_transfer_configs_delete(&self, name: &str) -> ProjectLocationTransferConfigDeleteCall<'a, C, A> { + ProjectLocationTransferConfigDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new data transfer configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The BigQuery project id where the transfer configuration should be created. + /// Must be in the format /projects/{project_id}/locations/{location_id} + /// or + /// /projects/{project_id}/locations/- + /// In case when '-' is specified as location_id, location is infered from + /// the destination dataset region. + pub fn transfer_configs_create(&self, request: TransferConfig, parent: &str) -> ProjectTransferConfigCreateCall<'a, C, A> { + ProjectTransferConfigCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _authorization_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new data transfer configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The BigQuery project id where the transfer configuration should be created. + /// Must be in the format /projects/{project_id}/locations/{location_id} + /// or + /// /projects/{project_id}/locations/- + /// In case when '-' is specified as location_id, location is infered from + /// the destination dataset region. + pub fn locations_transfer_configs_create(&self, request: TransferConfig, parent: &str) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { + ProjectLocationTransferConfigCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _authorization_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about the particular transfer run. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + pub fn transfer_configs_runs_get(&self, name: &str) -> ProjectTransferConfigRunGetCall<'a, C, A> { + ProjectTransferConfigRunGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about running and completed jobs. + /// + /// # Arguments + /// + /// * `parent` - Name of transfer configuration for which transfer runs should be retrieved. + /// Format of transfer configuration resource name is: + /// `projects/{project_id}/transferConfigs/{config_id}`. + pub fn locations_transfer_configs_runs_list(&self, parent: &str) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { + ProjectLocationTransferConfigRunListCall { + hub: self.hub, + _parent: parent.to_string(), + _states: Default::default(), + _run_attempt: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a supported data source and returns its settings, + /// which can be used for UI rendering. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/dataSources/{data_source_id}` + pub fn locations_data_sources_get(&self, name: &str) -> ProjectLocationDataSourceGetCall<'a, C, A> { + ProjectLocationDataSourceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about the particular transfer run. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + pub fn locations_transfer_configs_runs_get(&self, name: &str) -> ProjectLocationTransferConfigRunGetCall<'a, C, A> { + ProjectLocationTransferConfigRunGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified transfer run. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + pub fn locations_transfer_configs_runs_delete(&self, name: &str) -> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> { + ProjectLocationTransferConfigRunDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates transfer runs for a time range [range_start_time, range_end_time]. + /// For each date - or whatever granularity the data source supports - in the + /// range, one transfer run is created. + /// Note that runs are created per UTC time in the time range. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}`. + pub fn locations_transfer_configs_schedule_runs(&self, request: ScheduleTransferRunsRequest, parent: &str) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> { + ProjectLocationTransferConfigScheduleRunCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified transfer run. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + pub fn transfer_configs_runs_delete(&self, name: &str) -> ProjectTransferConfigRunDeleteCall<'a, C, A> { + ProjectTransferConfigRunDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists supported data sources and returns their settings, + /// which can be used for UI rendering. + /// + /// # Arguments + /// + /// * `parent` - The BigQuery project id for which data sources should be returned. + /// Must be in the form: `projects/{project_id}` + pub fn data_sources_list(&self, parent: &str) -> ProjectDataSourceListCall<'a, C, A> { + ProjectDataSourceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a data transfer configuration. + /// All fields must be set, even if they are not updated. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the transfer config. + /// Transfer config names have the form + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Where `config_id` is usually a uuid, even though it is not + /// guaranteed or required. The name is ignored when creating a transfer + /// config. + pub fn locations_transfer_configs_patch(&self, request: TransferConfig, name: &str) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { + ProjectLocationTransferConfigPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _authorization_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a location. + /// + /// # Arguments + /// + /// * `name` - Resource name for the location. + pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { + ProjectLocationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns true if valid credentials exist for the given data source and + /// requesting user. + /// Some data sources doesn't support service account, so we need to talk to + /// them on behalf of the end user. This API just checks whether we have OAuth + /// token for the particular user, which is a pre-requisite before user can + /// create a transfer config. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` + pub fn locations_data_sources_check_valid_creds(&self, request: CheckValidCredsRequest, name: &str) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> { + ProjectLocationDataSourceCheckValidCredCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about a data transfer config. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + pub fn transfer_configs_get(&self, name: &str) -> ProjectTransferConfigGetCall<'a, C, A> { + ProjectTransferConfigGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists supported data sources and returns their settings, + /// which can be used for UI rendering. + /// + /// # Arguments + /// + /// * `parent` - The BigQuery project id for which data sources should be returned. + /// Must be in the form: `projects/{project_id}` + pub fn locations_data_sources_list(&self, parent: &str) -> ProjectLocationDataSourceListCall<'a, C, A> { + ProjectLocationDataSourceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about a data transfer config. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + pub fn locations_transfer_configs_get(&self, name: &str) -> ProjectLocationTransferConfigGetCall<'a, C, A> { + ProjectLocationTransferConfigGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns user facing log messages for the data transfer run. + /// + /// # Arguments + /// + /// * `parent` - Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + pub fn transfer_configs_runs_transfer_logs_list(&self, parent: &str) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> { + ProjectTransferConfigRunTransferLogListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _message_types: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about all data transfers in the project. + /// + /// # Arguments + /// + /// * `parent` - The BigQuery project id for which data sources + /// should be returned: `projects/{project_id}`. + pub fn transfer_configs_list(&self, parent: &str) -> ProjectTransferConfigListCall<'a, C, A> { + ProjectTransferConfigListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _data_source_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a data transfer configuration. + /// All fields must be set, even if they are not updated. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the transfer config. + /// Transfer config names have the form + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Where `config_id` is usually a uuid, even though it is not + /// guaranteed or required. The name is ignored when creating a transfer + /// config. + pub fn transfer_configs_patch(&self, request: TransferConfig, name: &str) -> ProjectTransferConfigPatchCall<'a, C, A> { + ProjectTransferConfigPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _authorization_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns true if valid credentials exist for the given data source and + /// requesting user. + /// Some data sources doesn't support service account, so we need to talk to + /// them on behalf of the end user. This API just checks whether we have OAuth + /// token for the particular user, which is a pre-requisite before user can + /// create a transfer config. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` + pub fn data_sources_check_valid_creds(&self, request: CheckValidCredsRequest, name: &str) -> ProjectDataSourceCheckValidCredCall<'a, C, A> { + ProjectDataSourceCheckValidCredCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates transfer runs for a time range [range_start_time, range_end_time]. + /// For each date - or whatever granularity the data source supports - in the + /// range, one transfer run is created. + /// Note that runs are created per UTC time in the time range. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}`. + pub fn transfer_configs_schedule_runs(&self, request: ScheduleTransferRunsRequest, parent: &str) -> ProjectTransferConfigScheduleRunCall<'a, C, A> { + ProjectTransferConfigScheduleRunCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists information about the supported locations for this service. + /// + /// # Arguments + /// + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about running and completed jobs. + /// + /// # Arguments + /// + /// * `parent` - Name of transfer configuration for which transfer runs should be retrieved. + /// Format of transfer configuration resource name is: + /// `projects/{project_id}/transferConfigs/{config_id}`. + pub fn transfer_configs_runs_list(&self, parent: &str) -> ProjectTransferConfigRunListCall<'a, C, A> { + ProjectTransferConfigRunListCall { + hub: self.hub, + _parent: parent.to_string(), + _states: Default::default(), + _run_attempt: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about all data transfers in the project. + /// + /// # Arguments + /// + /// * `parent` - The BigQuery project id for which data sources + /// should be returned: `projects/{project_id}`. + pub fn locations_transfer_configs_list(&self, parent: &str) -> ProjectLocationTransferConfigListCall<'a, C, A> { + ProjectLocationTransferConfigListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _data_source_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns user facing log messages for the data transfer run. + /// + /// # Arguments + /// + /// * `parent` - Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + pub fn locations_transfer_configs_runs_transfer_logs_list(&self, parent: &str) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> { + ProjectLocationTransferConfigRunTransferLogListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _message_types: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a data transfer configuration, + /// including any associated transfer runs and logs. + /// + /// # Arguments + /// + /// * `name` - The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + pub fn transfer_configs_delete(&self, name: &str) -> ProjectTransferConfigDeleteCall<'a, C, A> { + ProjectTransferConfigDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Retrieves a supported data source and returns its settings, +/// which can be used for UI rendering. +/// +/// A builder for the *dataSources.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().data_sources_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDataSourceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDataSourceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectDataSourceGetCall<'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, DataSource)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.dataSources.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/dataSources/{data_source_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDataSourceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectDataSourceGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDataSourceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectDataSourceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a data transfer configuration, +/// including any associated transfer runs and logs. +/// +/// A builder for the *locations.transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationTransferConfigDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationTransferConfigDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new data transfer configuration. +/// +/// A builder for the *transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::TransferConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().transfer_configs_create(req, "parent") +/// .authorization_code("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: TransferConfig, + _parent: String, + _authorization_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigCreateCall<'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, TransferConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._authorization_code { + params.push(("authorizationCode", value.to_string())); + } + for &field in ["alt", "parent", "authorizationCode"].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 = self.hub._base_url.clone() + "v1/{+parent}/transferConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TransferConfig) -> ProjectTransferConfigCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The BigQuery project id where the transfer configuration should be created. + /// Must be in the format /projects/{project_id}/locations/{location_id} + /// or + /// /projects/{project_id}/locations/- + /// In case when '-' is specified as location_id, location is infered from + /// the destination dataset region. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectTransferConfigCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional OAuth2 authorization code to use with this transfer configuration. + /// This is required if new credentials are needed, as indicated by + /// `CheckValidCreds`. + /// In order to obtain authorization_code, please make a + /// request to + /// https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + /// + /// * client_id should be OAuth client_id of BigQuery DTS API for the given + /// data source returned by ListDataSources method. + /// * data_source_scopes are the scopes returned by ListDataSources method. + /// * redirect_uri is an optional parameter. If not specified, then + /// authorization code is posted to the opener of authorization flow window. + /// Otherwise it will be sent to the redirect uri. A special value of + /// urn:ietf:wg:oauth:2.0:oob means that authorization code should be + /// returned in the title bar of the browser, with the page text prompting + /// the user to copy the code and paste it in the application. + /// + /// Sets the *authorization code* query property to the given value. + pub fn authorization_code(mut self, new_value: &str) -> ProjectTransferConfigCreateCall<'a, C, A> { + self._authorization_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) -> ProjectTransferConfigCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new data transfer configuration. +/// +/// A builder for the *locations.transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::TransferConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().locations_transfer_configs_create(req, "parent") +/// .authorization_code("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: TransferConfig, + _parent: String, + _authorization_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigCreateCall<'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, TransferConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._authorization_code { + params.push(("authorizationCode", value.to_string())); + } + for &field in ["alt", "parent", "authorizationCode"].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 = self.hub._base_url.clone() + "v1/{+parent}/transferConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TransferConfig) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The BigQuery project id where the transfer configuration should be created. + /// Must be in the format /projects/{project_id}/locations/{location_id} + /// or + /// /projects/{project_id}/locations/- + /// In case when '-' is specified as location_id, location is infered from + /// the destination dataset region. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional OAuth2 authorization code to use with this transfer configuration. + /// This is required if new credentials are needed, as indicated by + /// `CheckValidCreds`. + /// In order to obtain authorization_code, please make a + /// request to + /// https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + /// + /// * client_id should be OAuth client_id of BigQuery DTS API for the given + /// data source returned by ListDataSources method. + /// * data_source_scopes are the scopes returned by ListDataSources method. + /// * redirect_uri is an optional parameter. If not specified, then + /// authorization code is posted to the opener of authorization flow window. + /// Otherwise it will be sent to the redirect uri. A special value of + /// urn:ietf:wg:oauth:2.0:oob means that authorization code should be + /// returned in the title bar of the browser, with the page text prompting + /// the user to copy the code and paste it in the application. + /// + /// Sets the *authorization code* query property to the given value. + pub fn authorization_code(mut self, new_value: &str) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { + self._authorization_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) -> ProjectLocationTransferConfigCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about the particular transfer run. +/// +/// A builder for the *transferConfigs.runs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_runs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigRunGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigRunGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigRunGetCall<'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, TransferRun)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.runs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectTransferConfigRunGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTransferConfigRunGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigRunGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigRunGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about running and completed jobs. +/// +/// A builder for the *locations.transferConfigs.runs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_runs_list("parent") +/// .add_states("sadipscing") +/// .run_attempt("aliquyam") +/// .page_token("ea") +/// .page_size(-61) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigRunListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _states: Vec, + _run_attempt: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigRunListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigRunListCall<'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, ListTransferRunsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.runs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if self._states.len() > 0 { + for f in self._states.iter() { + params.push(("states", f.to_string())); + } + } + if let Some(value) = self._run_attempt { + params.push(("runAttempt", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "states", "runAttempt", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/runs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 transfer configuration for which transfer runs should be retrieved. + /// Format of transfer configuration resource name is: + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// When specified, only transfer runs with requested states are returned. + /// + /// Append the given value to the *states* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_states(mut self, new_value: &str) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { + self._states.push(new_value.to_string()); + self + } + /// Indicates how run attempts are to be pulled. + /// + /// Sets the *run attempt* query property to the given value. + pub fn run_attempt(mut self, new_value: &str) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { + self._run_attempt = Some(new_value.to_string()); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListTransferRunsRequest` list results. For multiple-page + /// results, `ListTransferRunsResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationTransferConfigRunListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigRunListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigRunListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a supported data source and returns its settings, +/// which can be used for UI rendering. +/// +/// A builder for the *locations.dataSources.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_data_sources_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDataSourceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDataSourceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDataSourceGetCall<'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, DataSource)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.dataSources.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/dataSources/{data_source_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDataSourceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationDataSourceGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDataSourceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationDataSourceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about the particular transfer run. +/// +/// A builder for the *locations.transferConfigs.runs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_runs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigRunGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigRunGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigRunGetCall<'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, TransferRun)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.runs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationTransferConfigRunGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationTransferConfigRunGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigRunGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigRunGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified transfer run. +/// +/// A builder for the *locations.transferConfigs.runs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_runs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigRunDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigRunDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigRunDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.runs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationTransferConfigRunDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates transfer runs for a time range [range_start_time, range_end_time]. +/// For each date - or whatever granularity the data source supports - in the +/// range, one transfer run is created. +/// Note that runs are created per UTC time in the time range. +/// +/// A builder for the *locations.transferConfigs.scheduleRuns* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::ScheduleTransferRunsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ScheduleTransferRunsRequest::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().locations_transfer_configs_schedule_runs(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigScheduleRunCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: ScheduleTransferRunsRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigScheduleRunCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigScheduleRunCall<'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, ScheduleTransferRunsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}:scheduleRuns"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ScheduleTransferRunsRequest) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> { + self._request = new_value; + self + } + /// Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> { + self._parent = 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) -> ProjectLocationTransferConfigScheduleRunCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified transfer run. +/// +/// A builder for the *transferConfigs.runs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_runs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigRunDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigRunDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigRunDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.runs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectTransferConfigRunDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTransferConfigRunDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigRunDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigRunDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists supported data sources and returns their settings, +/// which can be used for UI rendering. +/// +/// A builder for the *dataSources.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().data_sources_list("parent") +/// .page_token("Lorem") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct ProjectDataSourceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDataSourceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectDataSourceListCall<'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, ListDataSourcesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.dataSources.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/dataSources"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 BigQuery project id for which data sources should be returned. + /// Must be in the form: `projects/{project_id}` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectDataSourceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListDataSourcesRequest` list results. For multiple-page + /// results, `ListDataSourcesResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectDataSourceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectDataSourceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectDataSourceListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDataSourceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectDataSourceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a data transfer configuration. +/// All fields must be set, even if they are not updated. +/// +/// A builder for the *locations.transferConfigs.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::TransferConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().locations_transfer_configs_patch(req, "name") +/// .update_mask("aliquyam") +/// .authorization_code("sea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: TransferConfig, + _name: String, + _update_mask: Option, + _authorization_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'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, TransferConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._authorization_code { + params.push(("authorizationCode", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "authorizationCode"].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 = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TransferConfig) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the transfer config. + /// Transfer config names have the form + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Where `config_id` is usually a uuid, even though it is not + /// guaranteed or required. The name is ignored when creating a transfer + /// config. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required list of fields to be updated in this request. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional OAuth2 authorization code to use with this transfer configuration. + /// If it is provided, the transfer configuration will be associated with the + /// gaia id of the authorizing user. + /// In order to obtain authorization_code, please make a + /// request to + /// https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + /// + /// * client_id should be OAuth client_id of BigQuery DTS API for the given + /// data source returned by ListDataSources method. + /// * data_source_scopes are the scopes returned by ListDataSources method. + /// * redirect_uri is an optional parameter. If not specified, then + /// authorization code is posted to the opener of authorization flow window. + /// Otherwise it will be sent to the redirect uri. A special value of + /// urn:ietf:wg:oauth:2.0:oob means that authorization code should be + /// returned in the title bar of the browser, with the page text prompting + /// the user to copy the code and paste it in the application. + /// + /// Sets the *authorization code* query property to the given value. + pub fn authorization_code(mut self, new_value: &str) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { + self._authorization_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) -> ProjectLocationTransferConfigPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a location. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationGetCall<'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, Location)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Resource name for the location. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns true if valid credentials exist for the given data source and +/// requesting user. +/// Some data sources doesn't support service account, so we need to talk to +/// them on behalf of the end user. This API just checks whether we have OAuth +/// token for the particular user, which is a pre-requisite before user can +/// create a transfer config. +/// +/// A builder for the *locations.dataSources.checkValidCreds* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::CheckValidCredsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CheckValidCredsRequest::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().locations_data_sources_check_valid_creds(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDataSourceCheckValidCredCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: CheckValidCredsRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDataSourceCheckValidCredCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDataSourceCheckValidCredCall<'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, CheckValidCredsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.dataSources.checkValidCreds", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:checkValidCreds"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CheckValidCredsRequest) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> { + self._request = new_value; + self + } + /// The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationDataSourceCheckValidCredCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about a data transfer config. +/// +/// A builder for the *transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigGetCall<'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, TransferConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectTransferConfigGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTransferConfigGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists supported data sources and returns their settings, +/// which can be used for UI rendering. +/// +/// A builder for the *locations.dataSources.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_data_sources_list("parent") +/// .page_token("dolor") +/// .page_size(-39) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDataSourceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDataSourceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDataSourceListCall<'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, ListDataSourcesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.dataSources.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/dataSources"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 BigQuery project id for which data sources should be returned. + /// Must be in the form: `projects/{project_id}` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationDataSourceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListDataSourcesRequest` list results. For multiple-page + /// results, `ListDataSourcesResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDataSourceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDataSourceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationDataSourceListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDataSourceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationDataSourceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about a data transfer config. +/// +/// A builder for the *locations.transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigGetCall<'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, TransferConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationTransferConfigGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationTransferConfigGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns user facing log messages for the data transfer run. +/// +/// A builder for the *transferConfigs.runs.transferLogs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_runs_transfer_logs_list("parent") +/// .page_token("no") +/// .page_size(-36) +/// .add_message_types("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigRunTransferLogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _page_token: Option, + _page_size: Option, + _message_types: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigRunTransferLogListCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigRunTransferLogListCall<'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, ListTransferLogsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if self._message_types.len() > 0 { + for f in self._message_types.iter() { + params.push(("messageTypes", f.to_string())); + } + } + for &field in ["alt", "parent", "pageToken", "pageSize", "messageTypes"].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 = self.hub._base_url.clone() + "v1/{+parent}/transferLogs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListTransferLogsRequest` list results. For multiple-page + /// results, `ListTransferLogsResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Message types to return. If not populated - INFO, WARNING and ERROR + /// messages are returned. + /// + /// Append the given value to the *message types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_message_types(mut self, new_value: &str) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> { + self._message_types.push(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) -> ProjectTransferConfigRunTransferLogListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about all data transfers in the project. +/// +/// A builder for the *transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_list("parent") +/// .page_token("invidunt") +/// .page_size(-82) +/// .add_data_source_ids("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _page_token: Option, + _page_size: Option, + _data_source_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigListCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigListCall<'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, ListTransferConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if self._data_source_ids.len() > 0 { + for f in self._data_source_ids.iter() { + params.push(("dataSourceIds", f.to_string())); + } + } + for &field in ["alt", "parent", "pageToken", "pageSize", "dataSourceIds"].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 = self.hub._base_url.clone() + "v1/{+parent}/transferConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 BigQuery project id for which data sources + /// should be returned: `projects/{project_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectTransferConfigListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListTransfersRequest` list results. For multiple-page + /// results, `ListTransfersResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectTransferConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectTransferConfigListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// When specified, only configurations of requested data sources are returned. + /// + /// Append the given value to the *data source ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_data_source_ids(mut self, new_value: &str) -> ProjectTransferConfigListCall<'a, C, A> { + self._data_source_ids.push(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) -> ProjectTransferConfigListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a data transfer configuration. +/// All fields must be set, even if they are not updated. +/// +/// A builder for the *transferConfigs.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::TransferConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TransferConfig::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().transfer_configs_patch(req, "name") +/// .update_mask("sea") +/// .authorization_code("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: TransferConfig, + _name: String, + _update_mask: Option, + _authorization_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigPatchCall<'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, TransferConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._authorization_code { + params.push(("authorizationCode", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "authorizationCode"].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 = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TransferConfig) -> ProjectTransferConfigPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the transfer config. + /// Transfer config names have the form + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Where `config_id` is usually a uuid, even though it is not + /// guaranteed or required. The name is ignored when creating a transfer + /// config. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectTransferConfigPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required list of fields to be updated in this request. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectTransferConfigPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional OAuth2 authorization code to use with this transfer configuration. + /// If it is provided, the transfer configuration will be associated with the + /// gaia id of the authorizing user. + /// In order to obtain authorization_code, please make a + /// request to + /// https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + /// + /// * client_id should be OAuth client_id of BigQuery DTS API for the given + /// data source returned by ListDataSources method. + /// * data_source_scopes are the scopes returned by ListDataSources method. + /// * redirect_uri is an optional parameter. If not specified, then + /// authorization code is posted to the opener of authorization flow window. + /// Otherwise it will be sent to the redirect uri. A special value of + /// urn:ietf:wg:oauth:2.0:oob means that authorization code should be + /// returned in the title bar of the browser, with the page text prompting + /// the user to copy the code and paste it in the application. + /// + /// Sets the *authorization code* query property to the given value. + pub fn authorization_code(mut self, new_value: &str) -> ProjectTransferConfigPatchCall<'a, C, A> { + self._authorization_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) -> ProjectTransferConfigPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns true if valid credentials exist for the given data source and +/// requesting user. +/// Some data sources doesn't support service account, so we need to talk to +/// them on behalf of the end user. This API just checks whether we have OAuth +/// token for the particular user, which is a pre-requisite before user can +/// create a transfer config. +/// +/// A builder for the *dataSources.checkValidCreds* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::CheckValidCredsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CheckValidCredsRequest::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().data_sources_check_valid_creds(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDataSourceCheckValidCredCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: CheckValidCredsRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDataSourceCheckValidCredCall<'a, C, A> {} + +impl<'a, C, A> ProjectDataSourceCheckValidCredCall<'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, CheckValidCredsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.dataSources.checkValidCreds", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:checkValidCreds"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CheckValidCredsRequest) -> ProjectDataSourceCheckValidCredCall<'a, C, A> { + self._request = new_value; + self + } + /// The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDataSourceCheckValidCredCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectDataSourceCheckValidCredCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDataSourceCheckValidCredCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectDataSourceCheckValidCredCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates transfer runs for a time range [range_start_time, range_end_time]. +/// For each date - or whatever granularity the data source supports - in the +/// range, one transfer run is created. +/// Note that runs are created per UTC time in the time range. +/// +/// A builder for the *transferConfigs.scheduleRuns* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// use bigquerydatatransfer1::ScheduleTransferRunsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ScheduleTransferRunsRequest::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().transfer_configs_schedule_runs(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigScheduleRunCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _request: ScheduleTransferRunsRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigScheduleRunCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigScheduleRunCall<'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, ScheduleTransferRunsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.scheduleRuns", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}:scheduleRuns"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ScheduleTransferRunsRequest) -> ProjectTransferConfigScheduleRunCall<'a, C, A> { + self._request = new_value; + self + } + /// Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectTransferConfigScheduleRunCall<'a, C, A> { + self._parent = 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) -> ProjectTransferConfigScheduleRunCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigScheduleRunCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigScheduleRunCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists information about the supported locations for this service. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_list("name") +/// .page_token("sanctus") +/// .page_size(-22) +/// .filter("amet") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'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, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource that owns the locations collection, if applicable. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'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) -> ProjectLocationListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about running and completed jobs. +/// +/// A builder for the *transferConfigs.runs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_runs_list("parent") +/// .add_states("consetetur") +/// .run_attempt("ut") +/// .page_token("ea") +/// .page_size(-80) +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigRunListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _states: Vec, + _run_attempt: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigRunListCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigRunListCall<'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, ListTransferRunsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.runs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if self._states.len() > 0 { + for f in self._states.iter() { + params.push(("states", f.to_string())); + } + } + if let Some(value) = self._run_attempt { + params.push(("runAttempt", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "states", "runAttempt", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/runs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 transfer configuration for which transfer runs should be retrieved. + /// Format of transfer configuration resource name is: + /// `projects/{project_id}/transferConfigs/{config_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectTransferConfigRunListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// When specified, only transfer runs with requested states are returned. + /// + /// Append the given value to the *states* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_states(mut self, new_value: &str) -> ProjectTransferConfigRunListCall<'a, C, A> { + self._states.push(new_value.to_string()); + self + } + /// Indicates how run attempts are to be pulled. + /// + /// Sets the *run attempt* query property to the given value. + pub fn run_attempt(mut self, new_value: &str) -> ProjectTransferConfigRunListCall<'a, C, A> { + self._run_attempt = Some(new_value.to_string()); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListTransferRunsRequest` list results. For multiple-page + /// results, `ListTransferRunsResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectTransferConfigRunListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectTransferConfigRunListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTransferConfigRunListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigRunListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigRunListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about all data transfers in the project. +/// +/// A builder for the *locations.transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_list("parent") +/// .page_token("dolor") +/// .page_size(-48) +/// .add_data_source_ids("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _page_token: Option, + _page_size: Option, + _data_source_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigListCall<'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, ListTransferConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if self._data_source_ids.len() > 0 { + for f in self._data_source_ids.iter() { + params.push(("dataSourceIds", f.to_string())); + } + } + for &field in ["alt", "parent", "pageToken", "pageSize", "dataSourceIds"].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 = self.hub._base_url.clone() + "v1/{+parent}/transferConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 BigQuery project id for which data sources + /// should be returned: `projects/{project_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationTransferConfigListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListTransfersRequest` list results. For multiple-page + /// results, `ListTransfersResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationTransferConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationTransferConfigListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// When specified, only configurations of requested data sources are returned. + /// + /// Append the given value to the *data source ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_data_source_ids(mut self, new_value: &str) -> ProjectLocationTransferConfigListCall<'a, C, A> { + self._data_source_ids.push(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) -> ProjectLocationTransferConfigListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns user facing log messages for the data transfer run. +/// +/// A builder for the *locations.transferConfigs.runs.transferLogs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_transfer_configs_runs_transfer_logs_list("parent") +/// .page_token("amet.") +/// .page_size(-27) +/// .add_message_types("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _parent: String, + _page_token: Option, + _page_size: Option, + _message_types: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationTransferConfigRunTransferLogListCall<'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, ListTransferLogsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if self._message_types.len() > 0 { + for f in self._message_types.iter() { + params.push(("messageTypes", f.to_string())); + } + } + for &field in ["alt", "parent", "pageToken", "pageSize", "messageTypes"].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 = self.hub._base_url.clone() + "v1/{+parent}/transferLogs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Pagination token, which can be used to request a specific page + /// of `ListTransferLogsRequest` list results. For multiple-page + /// results, `ListTransferLogsResponse` outputs + /// a `next_page` token, which can be used as the + /// `page_token` value to request the next page of list results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Page size. The default page size is the maximum value of 1000 results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Message types to return. If not populated - INFO, WARNING and ERROR + /// messages are returned. + /// + /// Append the given value to the *message types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_message_types(mut self, new_value: &str) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> { + self._message_types.push(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) -> ProjectLocationTransferConfigRunTransferLogListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a data transfer configuration, +/// including any associated transfer runs and logs. +/// +/// A builder for the *transferConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquerydatatransfer1 as bigquerydatatransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquerydatatransfer1::BigQueryDataTransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigQueryDataTransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().transfer_configs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTransferConfigDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigQueryDataTransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTransferConfigDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectTransferConfigDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.transferConfigs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectTransferConfigDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTransferConfigDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTransferConfigDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTransferConfigDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/calendar3-cli/Cargo.toml b/gen/calendar3-cli/Cargo.toml index 657714dad6..0d197edd85 100644 --- a/gen/calendar3-cli/Cargo.toml +++ b/gen/calendar3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-calendar3-cli" -version = "1.0.6+20170514" +version = "1.0.6+20170919" 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-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-calendar3] path = "../calendar3" -version = "1.0.6+20170514" +version = "1.0.6+20170919" diff --git a/gen/calendar3-cli/README.md b/gen/calendar3-cli/README.md index fb080dfee6..b3e2c0d3fa 100644 --- a/gen/calendar3-cli/README.md +++ b/gen/calendar3-cli/README.md @@ -25,7 +25,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 *20170514*. The CLI is at version *1.0.6*. +This documentation was generated from the *calendar* API at revision *20170919*. The CLI is at version *1.0.6*. ```bash calendar3 [options] diff --git a/gen/calendar3-cli/mkdocs.yml b/gen/calendar3-cli/mkdocs.yml index 0f43aa4d92..bb803811e0 100644 --- a/gen/calendar3-cli/mkdocs.yml +++ b/gen/calendar3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: calendar v1.0.6+20170514 +site_name: calendar v1.0.6+20170919 site_url: http://byron.github.io/google-apis-rs/google-calendar3-cli site_description: A complete library to interact with calendar (protocol v3) diff --git a/gen/calendar3-cli/src/main.rs b/gen/calendar3-cli/src/main.rs index 2d42e70925..f2691eb035 100644 --- a/gen/calendar3-cli/src/main.rs +++ b/gen/calendar3-cli/src/main.rs @@ -4386,7 +4386,7 @@ fn main() { let mut app = App::new("calendar3") .author("Sebastian Thiel ") - .version("1.0.6+20170514") + .version("1.0.6+20170919") .about("Manipulates 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 57d937ed23..e06c8096a1 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-calendar3" -version = "1.0.6+20170514" +version = "1.0.6+20170919" 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" homepage = "https://developers.google.com/google-apps/calendar/firstapp" -documentation = "https://docs.rs/google-calendar3/1.0.6+20170514" +documentation = "https://docs.rs/google-calendar3/1.0.6+20170919" license = "MIT" keywords = ["calendar", "google", "protocol", "web", "api"] diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index fa017c1afd..dad4f6b1de 100644 --- a/gen/calendar3/README.md +++ b/gen/calendar3/README.md @@ -5,43 +5,43 @@ 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 *1.0.6+20170514*, where *20170514* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *calendar* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *calendar* *v3* API can be found at the [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarHub.html) ... -* [acl](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.Acl.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclWatchCall.html) -* [calendar list](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarList.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListWatchCall.html) -* [calendars](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.Calendar.html) - * [*clear*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarUpdateCall.html) -* [channels](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.Channel.html) - * [*stop*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.ChannelStopCall.html) +* [acl](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.Acl.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclWatchCall.html) +* [calendar list](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarList.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListWatchCall.html) +* [calendars](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.Calendar.html) + * [*clear*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarUpdateCall.html) +* [channels](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.Channel.html) + * [*stop*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.ChannelStopCall.html) * colors - * [*get*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.ColorGetCall.html) -* [events](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.Event.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventWatchCall.html) + * [*get*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.ColorGetCall.html) +* [events](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.Event.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventWatchCall.html) * freebusy - * [*query*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.FreebusyQueryCall.html) -* [settings](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.Setting.html) - * [*get*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.SettingWatchCall.html) + * [*query*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.FreebusyQueryCall.html) +* [settings](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.Setting.html) + * [*get*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.SettingWatchCall.html) Subscription supported by ... -* [*list settings*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.SettingListCall.html) -* [*list events*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventListCall.html) -* [*list calendar list*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListListCall.html) -* [*watch events*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventWatchCall.html) -* [*instances events*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.EventInstanceCall.html) -* [*watch settings*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.SettingWatchCall.html) -* [*watch acl*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclWatchCall.html) -* [*list acl*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.AclListCall.html) -* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarListWatchCall.html) +* [*list settings*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.SettingListCall.html) +* [*list events*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventListCall.html) +* [*list calendar list*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListListCall.html) +* [*watch events*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventWatchCall.html) +* [*instances events*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.EventInstanceCall.html) +* [*watch settings*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.SettingWatchCall.html) +* [*watch acl*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclWatchCall.html) +* [*list acl*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.AclListCall.html) +* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarListWatchCall.html) @@ -49,17 +49,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/struct.CalendarHub.html)** +* **[Hub](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/struct.CalendarHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.Part.html)** + * **[Parts](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -175,17 +175,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/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")`. @@ -195,29 +195,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/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](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/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](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/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](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/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](https://docs.rs/google-calendar3/1.0.6+20170514/google_calendar3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/calendar3/src/lib.rs b/gen/calendar3/src/lib.rs index eeacb1cdaf..5c63951ec4 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 *1.0.6+20170514*, where *20170514* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *calendar* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *calendar* *v3* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). @@ -489,6 +489,21 @@ impl NestedType for EventGadget {} impl Part for EventGadget {} +/// 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 FreeBusyCalendar { + /// List of time ranges during which this calendar should be regarded as busy. + pub busy: Option>, + /// Optional error(s) (if computation for the calendar failed). + pub errors: Option>, +} + +impl Part for FreeBusyCalendar {} + + /// The scope of the rule. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -510,6 +525,34 @@ impl NestedType for AclRuleScope {} impl Part for AclRuleScope {} +/// 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 settings](struct.SettingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Settings { + /// Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of user settings. + pub items: Option>, + /// Type of the collection ("calendar#settings"). + pub kind: Option, + /// Etag of the collection. + pub etag: Option, + /// Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. + #[serde(rename="nextSyncToken")] + pub next_sync_token: Option, +} + +impl ResponseResult for Settings {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -575,28 +618,6 @@ impl Resource for Calendar {} impl ResponseResult for Calendar {} -/// The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventOrganizer { - /// Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. - #[serde(rename="self")] - pub self_: Option, - /// The organizer's name, if available. - #[serde(rename="displayName")] - pub display_name: Option, - /// The organizer's email address, if available. It must be a valid email address as per RFC5322. - pub email: Option, - /// The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API - pub id: Option, -} - -impl NestedType for EventOrganizer {} -impl Part for EventOrganizer {} - - /// There is no detailed description. /// /// # Activities @@ -893,6 +914,51 @@ pub struct Events { impl ResponseResult for Events {} +/// 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*). +/// +/// * [stop channels](struct.ChannelStopCall.html) (request) +/// * [watch settings](struct.SettingWatchCall.html) (request|response) +/// * [watch acl](struct.AclWatchCall.html) (request|response) +/// * [watch calendar list](struct.CalendarListWatchCall.html) (request|response) +/// * [watch events](struct.EventWatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Channel { + /// A version-specific identifier for the watched resource. + #[serde(rename="resourceUri")] + pub resource_uri: Option, + /// Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". + pub kind: Option, + /// An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. + #[serde(rename="resourceId")] + pub resource_id: Option, + /// A UUID or similar unique string that identifies this channel. + pub id: Option, + /// An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. + pub token: Option, + /// Additional parameters controlling delivery channel behavior. Optional. + pub params: Option>, + /// Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. + pub expiration: Option, + /// The address where notifications are delivered for this channel. + pub address: Option, + /// The type of delivery mechanism used for this channel. + #[serde(rename="type")] + pub type_: Option, + /// A Boolean value to indicate whether payload is wanted. Optional. + pub payload: Option, +} + +impl RequestValue for Channel {} +impl Resource for Channel {} +impl ResponseResult for Channel {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -932,22 +998,6 @@ pub struct EventAttendee { impl Part for EventAttendee {} -/// Extended properties of the event. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventExtendedProperties { - /// Properties that are shared between copies of the event on other attendees' calendars. - pub shared: Option>, - /// Properties that are private to the copy of the event that appears on this calendar. - pub private: Option>, -} - -impl NestedType for EventExtendedProperties {} -impl Part for EventExtendedProperties {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -980,21 +1030,6 @@ impl NestedType for EventReminders {} impl Part for EventReminders {} -/// 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 FreeBusyCalendar { - /// List of time ranges during which this calendar should be regarded as busy. - pub busy: Option>, - /// Optional error(s) (if computation for the calendar failed). - pub errors: Option>, -} - -impl Part for FreeBusyCalendar {} - - /// There is no detailed description. /// /// # Activities @@ -1023,32 +1058,20 @@ pub struct CalendarList { impl ResponseResult for CalendarList {} -/// There is no detailed description. +/// Extended properties of the event. /// -/// # 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 settings](struct.SettingListCall.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 Settings { - /// Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of user settings. - pub items: Option>, - /// Type of the collection ("calendar#settings"). - pub kind: Option, - /// Etag of the collection. - pub etag: Option, - /// Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. - #[serde(rename="nextSyncToken")] - pub next_sync_token: Option, +pub struct EventExtendedProperties { + /// Properties that are shared between copies of the event on other attendees' calendars. + pub shared: Option>, + /// Properties that are private to the copy of the event that appears on this calendar. + pub private: Option>, } -impl ResponseResult for Settings {} +impl NestedType for EventExtendedProperties {} +impl Part for EventExtendedProperties {} /// There is no detailed description. @@ -1149,49 +1172,42 @@ pub struct FreeBusyRequest { impl RequestValue for FreeBusyRequest {} -/// There is no detailed description. +/// Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. Can only be seen or modified by the creator of the event. /// -/// # 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*). -/// -/// * [stop channels](struct.ChannelStopCall.html) (request) -/// * [watch settings](struct.SettingWatchCall.html) (request|response) -/// * [watch acl](struct.AclWatchCall.html) (request|response) -/// * [watch calendar list](struct.CalendarListWatchCall.html) (request|response) -/// * [watch events](struct.EventWatchCall.html) (request|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 Channel { - /// A version-specific identifier for the watched resource. - #[serde(rename="resourceUri")] - pub resource_uri: Option, - /// Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". - pub kind: Option, - /// An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. - #[serde(rename="resourceId")] - pub resource_id: Option, - /// A UUID or similar unique string that identifies this channel. - pub id: Option, - /// An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. - pub token: Option, - /// Additional parameters controlling delivery channel behavior. Optional. - pub params: Option>, - /// Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. - pub expiration: Option, - /// The address where notifications are delivered for this channel. - pub address: Option, - /// The type of delivery mechanism used for this channel. - #[serde(rename="type")] - pub type_: Option, - /// A Boolean value to indicate whether payload is wanted. Optional. - pub payload: Option, +pub struct EventSource { + /// URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS. + pub url: Option, + /// Title of the source; for example a title of a web page or an email subject. + pub title: Option, } -impl RequestValue for Channel {} -impl Resource for Channel {} -impl ResponseResult for Channel {} +impl NestedType for EventSource {} +impl Part for EventSource {} + + +/// The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventOrganizer { + /// Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + #[serde(rename="self")] + pub self_: Option, + /// The organizer's name, if available. + #[serde(rename="displayName")] + pub display_name: Option, + /// The organizer's email address, if available. It must be a valid email address as per RFC5322. + pub email: Option, + /// The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API + pub id: Option, +} + +impl NestedType for EventOrganizer {} +impl Part for EventOrganizer {} /// There is no detailed description. @@ -1212,22 +1228,6 @@ pub struct EventReminder { impl Part for EventReminder {} -/// Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. Can only be seen or modified by the creator of the event. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventSource { - /// URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS. - pub url: Option, - /// Title of the source; for example a title of a web page or an email subject. - pub title: Option, -} - -impl NestedType for EventSource {} -impl Part for EventSource {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1386,8 +1386,8 @@ pub struct Event { #[serde(rename="extendedProperties")] pub extended_properties: Option, /// Whether the event blocks time on the calendar. Optional. Possible values are: - /// - "opaque" - The event blocks time on the calendar. This is the default value. - /// - "transparent" - The event does not block time on the calendar. + /// - "opaque" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI. + /// - "transparent" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI. pub transparency: Option, /// Whether this is a private event copy where changes are not shared with other copies on other calendars. Optional. Immutable. The default is False. #[serde(rename="privateCopy")] @@ -11109,14 +11109,14 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau self._time_zone = Some(new_value.to_string()); self } - /// Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. + /// Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. /// /// Sets the *time min* query property to the given value. pub fn time_min(mut self, new_value: &str) -> EventListCall<'a, C, A> { self._time_min = Some(new_value.to_string()); self } - /// Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. + /// Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. /// /// Sets the *time max* query property to the given value. pub fn time_max(mut self, new_value: &str) -> EventListCall<'a, C, A> { @@ -11201,7 +11201,7 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau self._order_by = Some(new_value.to_string()); self } - /// Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + /// Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> EventListCall<'a, C, A> { @@ -12553,14 +12553,14 @@ impl<'a, C, A> EventWatchCall<'a, C, A> where C: BorrowMut, A: oa self._time_zone = Some(new_value.to_string()); self } - /// Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. + /// Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. /// /// Sets the *time min* query property to the given value. pub fn time_min(mut self, new_value: &str) -> EventWatchCall<'a, C, A> { self._time_min = Some(new_value.to_string()); self } - /// Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. + /// Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. /// /// Sets the *time max* query property to the given value. pub fn time_max(mut self, new_value: &str) -> EventWatchCall<'a, C, A> { @@ -12645,7 +12645,7 @@ impl<'a, C, A> EventWatchCall<'a, C, A> where C: BorrowMut, A: oa self._order_by = Some(new_value.to_string()); self } - /// Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + /// Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> EventWatchCall<'a, C, A> { diff --git a/gen/classroom1-cli/Cargo.toml b/gen/classroom1-cli/Cargo.toml index a9e39e5695..b8134eaf5f 100644 --- a/gen/classroom1-cli/Cargo.toml +++ b/gen/classroom1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-classroom1-cli" -version = "1.0.6+20170510" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with classroom (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/classroom1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-classroom1] path = "../classroom1" -version = "1.0.6+20170510" +version = "1.0.6+20170926" diff --git a/gen/classroom1-cli/README.md b/gen/classroom1-cli/README.md index ec1b62481e..beb6cf8e26 100644 --- a/gen/classroom1-cli/README.md +++ b/gen/classroom1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *classroom* API at revision *20170510*. The CLI is at version *1.0.6*. +This documentation was generated from the *classroom* API at revision *20170926*. The CLI is at version *1.0.6*. ```bash classroom1 [options] @@ -33,10 +33,17 @@ classroom1 [options] aliases-create (-r )... [-p ]... [-o ] aliases-delete [-p ]... [-o ] aliases-list [-p ]... [-o ] + announcements-create (-r )... [-p ]... [-o ] + announcements-delete [-p ]... [-o ] + announcements-get [-p ]... [-o ] + announcements-list [-p ]... [-o ] + announcements-modify-assignees (-r )... [-p ]... [-o ] + announcements-patch (-r )... [-p ]... [-o ] course-work-create (-r )... [-p ]... [-o ] course-work-delete [-p ]... [-o ] course-work-get [-p ]... [-o ] course-work-list [-p ]... [-o ] + course-work-modify-assignees (-r )... [-p ]... [-o ] course-work-patch (-r )... [-p ]... [-o ] course-work-student-submissions-get [-p ]... [-o ] course-work-student-submissions-list [-p ]... [-o ] @@ -65,6 +72,9 @@ classroom1 [options] delete [-p ]... [-o ] get [-p ]... [-o ] list [-p ]... [-o ] + registrations + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] user-profiles get [-p ]... [-o ] guardian-invitations-create (-r )... [-p ]... [-o ] diff --git a/gen/classroom1-cli/mkdocs.yml b/gen/classroom1-cli/mkdocs.yml index 36e86e2f0f..a046cfc8d7 100644 --- a/gen/classroom1-cli/mkdocs.yml +++ b/gen/classroom1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: classroom v1.0.6+20170510 +site_name: classroom v1.0.6+20170926 site_url: http://byron.github.io/google-apis-rs/google-classroom1-cli site_description: A complete library to interact with classroom (protocol v1) @@ -12,10 +12,17 @@ pages: - ['courses_aliases-create.md', 'Courses', 'Aliases Create'] - ['courses_aliases-delete.md', 'Courses', 'Aliases Delete'] - ['courses_aliases-list.md', 'Courses', 'Aliases List'] +- ['courses_announcements-create.md', 'Courses', 'Announcements Create'] +- ['courses_announcements-delete.md', 'Courses', 'Announcements Delete'] +- ['courses_announcements-get.md', 'Courses', 'Announcements Get'] +- ['courses_announcements-list.md', 'Courses', 'Announcements List'] +- ['courses_announcements-modify-assignees.md', 'Courses', 'Announcements Modify Assignees'] +- ['courses_announcements-patch.md', 'Courses', 'Announcements Patch'] - ['courses_course-work-create.md', 'Courses', 'Course Work Create'] - ['courses_course-work-delete.md', 'Courses', 'Course Work Delete'] - ['courses_course-work-get.md', 'Courses', 'Course Work Get'] - ['courses_course-work-list.md', 'Courses', 'Course Work List'] +- ['courses_course-work-modify-assignees.md', 'Courses', 'Course Work Modify Assignees'] - ['courses_course-work-patch.md', 'Courses', 'Course Work Patch'] - ['courses_course-work-student-submissions-get.md', 'Courses', 'Course Work Student Submissions Get'] - ['courses_course-work-student-submissions-list.md', 'Courses', 'Course Work Student Submissions List'] @@ -43,6 +50,8 @@ pages: - ['invitations_delete.md', 'Invitations', 'Delete'] - ['invitations_get.md', 'Invitations', 'Get'] - ['invitations_list.md', 'Invitations', 'List'] +- ['registrations_create.md', 'Registrations', 'Create'] +- ['registrations_delete.md', 'Registrations', 'Delete'] - ['user-profiles_get.md', 'User Profiles', 'Get'] - ['user-profiles_guardian-invitations-create.md', 'User Profiles', 'Guardian Invitations Create'] - ['user-profiles_guardian-invitations-get.md', 'User Profiles', 'Guardian Invitations Get'] diff --git a/gen/classroom1-cli/src/main.rs b/gen/classroom1-cli/src/main.rs index fe05437596..1bb73b5f73 100644 --- a/gen/classroom1-cli/src/main.rs +++ b/gen/classroom1-cli/src/main.rs @@ -242,6 +242,456 @@ impl<'n> Engine<'n> { } } + fn _courses_announcements_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "creator-user-id" => Some(("creatorUserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "course-id" => Some(("courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "text" => Some(("text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-time" => Some(("scheduledTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "assignee-mode" => Some(("assigneeMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "individual-students-options.student-ids" => Some(("individualStudentsOptions.studentIds", 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!["alternate-link", "assignee-mode", "course-id", "creation-time", "creator-user-id", "id", "individual-students-options", "scheduled-time", "state", "student-ids", "text", "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::Announcement = json::value::from_value(object).unwrap(); + let mut call = self.hub.courses().announcements_create(request, opt.value_of("course-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _courses_announcements_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.courses().announcements_delete(opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _courses_announcements_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.courses().announcements_get(opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _courses_announcements_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.courses().announcements_list(opt.value_of("course-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "announcement-states" => { + call = call.add_announcement_states(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(["order-by", "page-token", "page-size", "announcement-states"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _courses_announcements_modify_assignees(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "modify-individual-students-options.add-student-ids" => Some(("modifyIndividualStudentsOptions.addStudentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "modify-individual-students-options.remove-student-ids" => Some(("modifyIndividualStudentsOptions.removeStudentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "assignee-mode" => Some(("assigneeMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["add-student-ids", "assignee-mode", "modify-individual-students-options", "remove-student-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ModifyAnnouncementAssigneesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.courses().announcements_modify_assignees(request, opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _courses_announcements_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "creator-user-id" => Some(("creatorUserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "course-id" => Some(("courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "text" => Some(("text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-time" => Some(("scheduledTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "assignee-mode" => Some(("assigneeMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "individual-students-options.student-ids" => Some(("individualStudentsOptions.studentIds", 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!["alternate-link", "assignee-mode", "course-id", "creation-time", "creator-user-id", "id", "individual-students-options", "scheduled-time", "state", "student-ids", "text", "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::Announcement = json::value::from_value(object).unwrap(); + let mut call = self.hub.courses().announcements_patch(request, opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _courses_course_work_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -273,23 +723,27 @@ impl<'n> Engine<'n> { "assignment.student-work-folder.alternate-link" => Some(("assignment.studentWorkFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "assignment.student-work-folder.id" => Some(("assignment.studentWorkFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "assignment.student-work-folder.title" => Some(("assignment.studentWorkFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-time" => Some(("scheduledTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "associated-with-developer" => Some(("associatedWithDeveloper", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "assignee-mode" => Some(("assigneeMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creator-user-id" => Some(("creatorUserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "max-points" => Some(("maxPoints", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "multiple-choice-question.choices" => Some(("multipleChoiceQuestion.choices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "due-date.month" => Some(("dueDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "due-date.day" => Some(("dueDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "individual-students-options.student-ids" => Some(("individualStudentsOptions.studentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "due-date.year" => Some(("dueDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-date.day" => Some(("dueDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-date.month" => Some(("dueDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.hours" => Some(("dueTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.nanos" => Some(("dueTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.seconds" => Some(("dueTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.minutes" => Some(("dueTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "work-type" => Some(("workType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "assignment", "associated-with-developer", "choices", "course-id", "creation-time", "day", "description", "due-date", "due-time", "hours", "id", "max-points", "minutes", "month", "multiple-choice-question", "nanos", "seconds", "state", "student-work-folder", "submission-modification-mode", "title", "update-time", "work-type", "year"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "assignee-mode", "assignment", "associated-with-developer", "choices", "course-id", "creation-time", "creator-user-id", "day", "description", "due-date", "due-time", "hours", "id", "individual-students-options", "max-points", "minutes", "month", "multiple-choice-question", "nanos", "scheduled-time", "seconds", "state", "student-ids", "student-work-folder", "submission-modification-mode", "title", "update-time", "work-type", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -518,6 +972,93 @@ impl<'n> Engine<'n> { } } + fn _courses_course_work_modify_assignees(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "assignee-mode" => Some(("assigneeMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "modify-individual-students-options.add-student-ids" => Some(("modifyIndividualStudentsOptions.addStudentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "modify-individual-students-options.remove-student-ids" => Some(("modifyIndividualStudentsOptions.removeStudentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["add-student-ids", "assignee-mode", "modify-individual-students-options", "remove-student-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ModifyCourseWorkAssigneesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.courses().course_work_modify_assignees(request, opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _courses_course_work_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -549,23 +1090,27 @@ impl<'n> Engine<'n> { "assignment.student-work-folder.alternate-link" => Some(("assignment.studentWorkFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "assignment.student-work-folder.id" => Some(("assignment.studentWorkFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "assignment.student-work-folder.title" => Some(("assignment.studentWorkFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-time" => Some(("scheduledTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "associated-with-developer" => Some(("associatedWithDeveloper", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "assignee-mode" => Some(("assigneeMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creator-user-id" => Some(("creatorUserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "max-points" => Some(("maxPoints", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "multiple-choice-question.choices" => Some(("multipleChoiceQuestion.choices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "due-date.month" => Some(("dueDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "due-date.day" => Some(("dueDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "individual-students-options.student-ids" => Some(("individualStudentsOptions.studentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "due-date.year" => Some(("dueDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-date.day" => Some(("dueDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-date.month" => Some(("dueDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.hours" => Some(("dueTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.nanos" => Some(("dueTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.seconds" => Some(("dueTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-time.minutes" => Some(("dueTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "work-type" => Some(("workType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "assignment", "associated-with-developer", "choices", "course-id", "creation-time", "day", "description", "due-date", "due-time", "hours", "id", "max-points", "minutes", "month", "multiple-choice-question", "nanos", "seconds", "state", "student-work-folder", "submission-modification-mode", "title", "update-time", "work-type", "year"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "assignee-mode", "assignment", "associated-with-developer", "choices", "course-id", "creation-time", "creator-user-id", "day", "description", "due-date", "due-time", "hours", "id", "individual-students-options", "max-points", "minutes", "month", "multiple-choice-question", "nanos", "scheduled-time", "seconds", "state", "student-ids", "student-work-folder", "submission-modification-mode", "title", "update-time", "work-type", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1221,6 +1766,7 @@ impl<'n> Engine<'n> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-group-email" => Some(("teacherGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-id" => Some(("ownerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "calendar-id" => Some(("calendarId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.alternate-link" => Some(("teacherFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.id" => Some(("teacherFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.title" => Some(("teacherFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1230,7 +1776,7 @@ impl<'n> Engine<'n> { "description-heading" => Some(("descriptionHeading", 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!["alternate-link", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "calendar-id", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1495,6 +2041,7 @@ impl<'n> Engine<'n> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-group-email" => Some(("teacherGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-id" => Some(("ownerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "calendar-id" => Some(("calendarId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.alternate-link" => Some(("teacherFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.id" => Some(("teacherFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.title" => Some(("teacherFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1504,7 +2051,7 @@ impl<'n> Engine<'n> { "description-heading" => Some(("descriptionHeading", 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!["alternate-link", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "calendar-id", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1592,8 +2139,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "course-id" => Some(("courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "profile.email-address" => Some(("profile.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.id" => Some(("profile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "profile.verified-teacher" => Some(("profile.verifiedTeacher", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "profile.email-address" => Some(("profile.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.name.full-name" => Some(("profile.name.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.name.given-name" => Some(("profile.name.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.name.family-name" => Some(("profile.name.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1603,7 +2151,7 @@ impl<'n> Engine<'n> { "student-work-folder.title" => Some(("studentWorkFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "course-id", "email-address", "family-name", "full-name", "given-name", "id", "name", "photo-url", "profile", "student-work-folder", "title", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "course-id", "email-address", "family-name", "full-name", "given-name", "id", "name", "photo-url", "profile", "student-work-folder", "title", "user-id", "verified-teacher"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1854,15 +2402,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "course-id" => Some(("courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "profile.email-address" => Some(("profile.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.id" => Some(("profile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "profile.verified-teacher" => Some(("profile.verifiedTeacher", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "profile.email-address" => Some(("profile.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.name.full-name" => Some(("profile.name.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.name.given-name" => Some(("profile.name.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.name.family-name" => Some(("profile.name.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile.photo-url" => Some(("profile.photoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["course-id", "email-address", "family-name", "full-name", "given-name", "id", "name", "photo-url", "profile", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["course-id", "email-address", "family-name", "full-name", "given-name", "id", "name", "photo-url", "profile", "user-id", "verified-teacher"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2118,6 +2667,7 @@ impl<'n> Engine<'n> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-group-email" => Some(("teacherGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-id" => Some(("ownerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "calendar-id" => Some(("calendarId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.alternate-link" => Some(("teacherFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.id" => Some(("teacherFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.title" => Some(("teacherFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2127,7 +2677,7 @@ impl<'n> Engine<'n> { "description-heading" => Some(("descriptionHeading", 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!["alternate-link", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "calendar-id", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2263,8 +2813,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "course-id" => Some(("courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-id" => Some(("userId", 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!["course-id", "id", "role", "user-id"]); @@ -2496,6 +3046,147 @@ impl<'n> Engine<'n> { } } + fn _registrations_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "feed.feed-type" => Some(("feed.feedType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feed.course-roster-changes-info.course-id" => Some(("feed.courseRosterChangesInfo.courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "registration-id" => Some(("registrationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiry-time" => Some(("expiryTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cloud-pubsub-topic.topic-name" => Some(("cloudPubsubTopic.topicName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["cloud-pubsub-topic", "course-id", "course-roster-changes-info", "expiry-time", "feed", "feed-type", "registration-id", "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::Registration = json::value::from_value(object).unwrap(); + let mut call = self.hub.registrations().create(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _registrations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.registrations().delete(opt.value_of("registration-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _user_profiles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.user_profiles().get(opt.value_of("user-id").unwrap_or("")); @@ -2571,11 +3262,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-id" => Some(("studentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "invitation-id" => Some(("invitationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "invitation-id", "invited-email-address", "state", "student-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2614,6 +3305,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -2663,6 +3357,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -2725,6 +3422,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -2768,11 +3468,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-id" => Some(("studentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "invitation-id" => Some(("invitationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "invitation-id", "invited-email-address", "state", "student-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2815,6 +3515,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -2864,6 +3567,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -2913,6 +3619,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -2972,6 +3681,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -3008,6 +3720,24 @@ impl<'n> Engine<'n> { ("aliases-list", Some(opt)) => { call_result = self._courses_aliases_list(opt, dry_run, &mut err); }, + ("announcements-create", Some(opt)) => { + call_result = self._courses_announcements_create(opt, dry_run, &mut err); + }, + ("announcements-delete", Some(opt)) => { + call_result = self._courses_announcements_delete(opt, dry_run, &mut err); + }, + ("announcements-get", Some(opt)) => { + call_result = self._courses_announcements_get(opt, dry_run, &mut err); + }, + ("announcements-list", Some(opt)) => { + call_result = self._courses_announcements_list(opt, dry_run, &mut err); + }, + ("announcements-modify-assignees", Some(opt)) => { + call_result = self._courses_announcements_modify_assignees(opt, dry_run, &mut err); + }, + ("announcements-patch", Some(opt)) => { + call_result = self._courses_announcements_patch(opt, dry_run, &mut err); + }, ("course-work-create", Some(opt)) => { call_result = self._courses_course_work_create(opt, dry_run, &mut err); }, @@ -3020,6 +3750,9 @@ impl<'n> Engine<'n> { ("course-work-list", Some(opt)) => { call_result = self._courses_course_work_list(opt, dry_run, &mut err); }, + ("course-work-modify-assignees", Some(opt)) => { + call_result = self._courses_course_work_modify_assignees(opt, dry_run, &mut err); + }, ("course-work-patch", Some(opt)) => { call_result = self._courses_course_work_patch(opt, dry_run, &mut err); }, @@ -3115,6 +3848,20 @@ impl<'n> Engine<'n> { } } }, + ("registrations", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._registrations_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._registrations_delete(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("registrations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("user-profiles", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -3233,7 +3980,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("courses", "methods: 'aliases-create', 'aliases-delete', 'aliases-list', 'course-work-create', 'course-work-delete', 'course-work-get', 'course-work-list', 'course-work-patch', 'course-work-student-submissions-get', 'course-work-student-submissions-list', 'course-work-student-submissions-modify-attachments', 'course-work-student-submissions-patch', 'course-work-student-submissions-reclaim', 'course-work-student-submissions-return', 'course-work-student-submissions-turn-in', 'create', 'delete', 'get', 'list', 'patch', 'students-create', 'students-delete', 'students-get', 'students-list', 'teachers-create', 'teachers-delete', 'teachers-get', 'teachers-list' and 'update'", vec![ + ("courses", "methods: 'aliases-create', 'aliases-delete', 'aliases-list', 'announcements-create', 'announcements-delete', 'announcements-get', 'announcements-list', 'announcements-modify-assignees', 'announcements-patch', 'course-work-create', 'course-work-delete', 'course-work-get', 'course-work-list', 'course-work-modify-assignees', 'course-work-patch', 'course-work-student-submissions-get', 'course-work-student-submissions-list', 'course-work-student-submissions-modify-attachments', 'course-work-student-submissions-patch', 'course-work-student-submissions-reclaim', 'course-work-student-submissions-return', 'course-work-student-submissions-turn-in', 'create', 'delete', 'get', 'list', 'patch', 'students-create', 'students-delete', 'students-get', 'students-list', 'teachers-create', 'teachers-delete', 'teachers-get', 'teachers-list' and 'update'", vec![ ("aliases-create", Some(r##"Creates an alias for a course. @@ -3338,6 +4085,252 @@ 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)), + ]), + ("announcements-create", + Some(r##"Creates an announcement. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course, create announcements in the requested course, share a + Drive attachment, or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course does not exist. + * `FAILED_PRECONDITION` for the following request error: + * AttachmentNotVisible"##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_announcements-create", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + 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)), + ]), + ("announcements-delete", + Some(r##"Deletes an announcement. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding announcement item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting developer project did not create + the corresponding announcement, if the requesting user is not permitted + to delete the requested course or for access errors. + * `FAILED_PRECONDITION` if the requested announcement has already been + deleted. + * `NOT_FOUND` if no course exists with the requested ID."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_announcements-delete", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the announcement to delete. + This identifier is a Classroom-assigned identifier."##), + 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)), + ]), + ("announcements-get", + Some(r##"Returns an announcement. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or announcement, or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course or announcement does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_announcements-get", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the announcement."##), + 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)), + ]), + ("announcements-list", + Some(r##"Returns a list of announcements that the requester is permitted to view. + + Course students may only view `PUBLISHED` announcements. Course teachers + and domain administrators may view all announcements. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access + the requested course or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_announcements-list", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + 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)), + ]), + ("announcements-modify-assignees", + Some(r##"Modifies assignee mode and options of an announcement. + + Only a teacher of the course that contains the announcement may + call this method. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course or course work does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_announcements-modify-assignees", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the announcement."##), + 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)), + ]), + ("announcements-patch", + Some(r##"Updates one or more fields of an announcement. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting developer project did not create + the corresponding announcement or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `FAILED_PRECONDITION` if the requested announcement has already been + deleted. + * `NOT_FOUND` if the requested course or announcement does not exist"##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_announcements-patch", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the announcement."##), + 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"##), @@ -3500,6 +4493,52 @@ 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)), + ]), + ("course-work-modify-assignees", + Some(r##"Modifies assignee mode and options of a coursework. + + Only a teacher of the course that contains the coursework may + call this method. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course or course work does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-modify-assignees", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the coursework."##), + 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"##), @@ -3631,7 +4670,7 @@ fn main() { (Some(r##"course-work-id"##), None, - Some(r##"Identifer of the student work to request. + Some(r##"Identifier of the student work to request. This may be set to the string literal `"-"` to request student work for all course work in the specified course."##), Some(true), @@ -4051,7 +5090,8 @@ fn main() { ]), ("list", Some(r##"Returns a list of courses that the requesting user is permitted to view, - restricted to those that match the request. + restricted to those that match the request. Returned courses are ordered by + creation time, with the most recently created coming first. This method returns the following error codes: @@ -4620,6 +5660,84 @@ fn main() { ]), ]), + ("registrations", "methods: 'create' and 'delete'", vec![ + ("create", + Some(r##"Creates a `Registration`, causing Classroom to start sending notifications + from the provided `feed` to the provided `destination`. + + Returns the created `Registration`. Currently, this will be the same as + the argument, but with server-assigned fields such as `expiry_time` and + `id` filled in. + + Note that any value specified for the `expiry_time` or `id` fields will be + ignored. + + While Classroom may validate the `destination` and return errors on a best + effort basis, it is the caller's responsibility to ensure that it exists + and that Classroom has permission to publish to it. + + This method may return the following error codes: + + * `PERMISSION_DENIED` if: + * the authenticated user does not have permission to receive + notifications from the requested field; or + * the credential provided does not include the appropriate scope for the + requested feed. + * another access error is encountered. + * `INVALID_ARGUMENT` if: + * no `destination` is specified, or the specified `destination` is not + valid; or + * no `feed` is specified, or the specified `feed` is not valid. + * `NOT_FOUND` if: + * the specified `feed` cannot be located, or the requesting user does not + have permission to determine whether or not it exists; or + * the specified `destination` cannot be located, or Classroom has not + been granted permission to publish to it."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/registrations_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a `Registration`, causing Classroom to stop sending notifications + for that `Registration`."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/registrations_delete", + vec![ + (Some(r##"registration-id"##), + None, + Some(r##"The `registration_id` of the `Registration` to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("user-profiles", "methods: 'get', 'guardian-invitations-create', 'guardian-invitations-get', 'guardian-invitations-list', 'guardian-invitations-patch', 'guardians-delete', 'guardians-get' and 'guardians-list'", vec![ ("get", Some(r##"Returns a user profile. @@ -4997,7 +6115,7 @@ fn main() { let mut app = App::new("classroom1") .author("Sebastian Thiel ") - .version("1.0.6+20170510") + .version("1.0.6+20170926") .about("Manages classes, rosters, and invitations in Google Classroom.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_classroom1_cli") .arg(Arg::with_name("url") diff --git a/gen/classroom1/Cargo.toml b/gen/classroom1/Cargo.toml index 0453b61fee..eb33cb2d6c 100644 --- a/gen/classroom1/Cargo.toml +++ b/gen/classroom1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-classroom1" -version = "1.0.6+20170510" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with classroom (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/classroom1" homepage = "https://developers.google.com/classroom/" -documentation = "https://docs.rs/google-classroom1/1.0.6+20170510" +documentation = "https://docs.rs/google-classroom1/1.0.6+20170926" license = "MIT" keywords = ["classroom", "google", "protocol", "web", "api"] diff --git a/gen/classroom1/README.md b/gen/classroom1/README.md index beb166a4de..44a6c4f91d 100644 --- a/gen/classroom1/README.md +++ b/gen/classroom1/README.md @@ -5,20 +5,22 @@ DO NOT EDIT ! --> The `google-classroom1` library allows access to all features of the *Google classroom* service. -This documentation was generated from *classroom* crate version *1.0.6+20170510*, where *20170510* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *classroom* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *classroom* *v1* API can be found at the [official documentation site](https://developers.google.com/classroom/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.Classroom.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.Classroom.html) ... -* [courses](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.Course.html) - * [*aliases create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseAliaseListCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkDeleteCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work patch*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseTeacherListCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.CourseUpdateCall.html) -* [invitations](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.Invitation.html) - * [*accept*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.InvitationListCall.html) -* [user profiles](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfile.html) - * [*get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.UserProfileGuardianListCall.html) +* [courses](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.Course.html) + * [*aliases create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAliaseListCall.html), [*announcements create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAnnouncementCreateCall.html), [*announcements delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAnnouncementDeleteCall.html), [*announcements get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAnnouncementGetCall.html), [*announcements list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAnnouncementListCall.html), [*announcements modify assignees*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAnnouncementModifyAssigneeCall.html), [*announcements patch*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseAnnouncementPatchCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkDeleteCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work modify assignees*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkModifyAssigneeCall.html), [*course work patch*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseTeacherListCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.CourseUpdateCall.html) +* [invitations](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.Invitation.html) + * [*accept*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.InvitationListCall.html) +* [registrations](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.Registration.html) + * [*create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.RegistrationCreateCall.html) and [*delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.RegistrationDeleteCall.html) +* [user profiles](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfile.html) + * [*get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.UserProfileGuardianListCall.html) @@ -27,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/struct.Classroom.html)** +* **[Hub](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/struct.Classroom.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.Part.html)** + * **[Parts](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -51,24 +53,30 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.courses().announcements_modify_assignees(...).doit() let r = hub.courses().course_work_student_submissions_patch(...).doit() -let r = hub.courses().course_work_student_submissions_list(...).doit() +let r = hub.courses().announcements_list(...).doit() +let r = hub.courses().course_work_student_submissions_reclaim(...).doit() let r = hub.courses().get(...).doit() let r = hub.courses().update(...).doit() let r = hub.courses().students_get(...).doit() let r = hub.courses().teachers_get(...).doit() let r = hub.courses().course_work_list(...).doit() let r = hub.courses().course_work_get(...).doit() +let r = hub.courses().course_work_student_submissions_list(...).doit() let r = hub.courses().course_work_student_submissions_turn_in(...).doit() let r = hub.courses().course_work_student_submissions_modify_attachments(...).doit() +let r = hub.courses().announcements_get(...).doit() let r = hub.courses().teachers_list(...).doit() let r = hub.courses().course_work_student_submissions_return(...).doit() let r = hub.courses().aliases_list(...).doit() let r = hub.courses().course_work_create(...).doit() let r = hub.courses().list(...).doit() -let r = hub.courses().course_work_student_submissions_reclaim(...).doit() +let r = hub.courses().announcements_create(...).doit() +let r = hub.courses().announcements_patch(...).doit() let r = hub.courses().aliases_create(...).doit() let r = hub.courses().students_create(...).doit() +let r = hub.courses().course_work_modify_assignees(...).doit() let r = hub.courses().aliases_delete(...).doit() let r = hub.courses().course_work_delete(...).doit() let r = hub.courses().create(...).doit() @@ -80,6 +88,7 @@ let r = hub.courses().students_delete(...).doit() let r = hub.courses().teachers_delete(...).doit() let r = hub.courses().teachers_create(...).doit() let r = hub.courses().course_work_student_submissions_get(...).doit() +let r = hub.courses().announcements_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -153,17 +162,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/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")`. @@ -173,29 +182,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/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](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/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](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/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](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/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](https://docs.rs/google-classroom1/1.0.6+20170510/google_classroom1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/classroom1/src/lib.rs b/gen/classroom1/src/lib.rs index ee85511906..e0bcc4e8d5 100644 --- a/gen/classroom1/src/lib.rs +++ b/gen/classroom1/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 *classroom* crate version *1.0.6+20170510*, where *20170510* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *classroom* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *classroom* *v1* API can be found at the //! [official documentation site](https://developers.google.com/classroom/). @@ -12,9 +12,11 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Classroom.html) ... //! //! * [courses](struct.Course.html) -//! * [*aliases create*](struct.CourseAliaseCreateCall.html), [*aliases delete*](struct.CourseAliaseDeleteCall.html), [*aliases list*](struct.CourseAliaseListCall.html), [*course work create*](struct.CourseCourseWorkCreateCall.html), [*course work delete*](struct.CourseCourseWorkDeleteCall.html), [*course work get*](struct.CourseCourseWorkGetCall.html), [*course work list*](struct.CourseCourseWorkListCall.html), [*course work patch*](struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](struct.CourseCreateCall.html), [*delete*](struct.CourseDeleteCall.html), [*get*](struct.CourseGetCall.html), [*list*](struct.CourseListCall.html), [*patch*](struct.CoursePatchCall.html), [*students create*](struct.CourseStudentCreateCall.html), [*students delete*](struct.CourseStudentDeleteCall.html), [*students get*](struct.CourseStudentGetCall.html), [*students list*](struct.CourseStudentListCall.html), [*teachers create*](struct.CourseTeacherCreateCall.html), [*teachers delete*](struct.CourseTeacherDeleteCall.html), [*teachers get*](struct.CourseTeacherGetCall.html), [*teachers list*](struct.CourseTeacherListCall.html) and [*update*](struct.CourseUpdateCall.html) +//! * [*aliases create*](struct.CourseAliaseCreateCall.html), [*aliases delete*](struct.CourseAliaseDeleteCall.html), [*aliases list*](struct.CourseAliaseListCall.html), [*announcements create*](struct.CourseAnnouncementCreateCall.html), [*announcements delete*](struct.CourseAnnouncementDeleteCall.html), [*announcements get*](struct.CourseAnnouncementGetCall.html), [*announcements list*](struct.CourseAnnouncementListCall.html), [*announcements modify assignees*](struct.CourseAnnouncementModifyAssigneeCall.html), [*announcements patch*](struct.CourseAnnouncementPatchCall.html), [*course work create*](struct.CourseCourseWorkCreateCall.html), [*course work delete*](struct.CourseCourseWorkDeleteCall.html), [*course work get*](struct.CourseCourseWorkGetCall.html), [*course work list*](struct.CourseCourseWorkListCall.html), [*course work modify assignees*](struct.CourseCourseWorkModifyAssigneeCall.html), [*course work patch*](struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](struct.CourseCreateCall.html), [*delete*](struct.CourseDeleteCall.html), [*get*](struct.CourseGetCall.html), [*list*](struct.CourseListCall.html), [*patch*](struct.CoursePatchCall.html), [*students create*](struct.CourseStudentCreateCall.html), [*students delete*](struct.CourseStudentDeleteCall.html), [*students get*](struct.CourseStudentGetCall.html), [*students list*](struct.CourseStudentListCall.html), [*teachers create*](struct.CourseTeacherCreateCall.html), [*teachers delete*](struct.CourseTeacherDeleteCall.html), [*teachers get*](struct.CourseTeacherGetCall.html), [*teachers list*](struct.CourseTeacherListCall.html) and [*update*](struct.CourseUpdateCall.html) //! * [invitations](struct.Invitation.html) //! * [*accept*](struct.InvitationAcceptCall.html), [*create*](struct.InvitationCreateCall.html), [*delete*](struct.InvitationDeleteCall.html), [*get*](struct.InvitationGetCall.html) and [*list*](struct.InvitationListCall.html) +//! * [registrations](struct.Registration.html) +//! * [*create*](struct.RegistrationCreateCall.html) and [*delete*](struct.RegistrationDeleteCall.html) //! * [user profiles](struct.UserProfile.html) //! * [*get*](struct.UserProfileGetCall.html), [*guardian invitations create*](struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](struct.UserProfileGuardianDeleteCall.html), [*guardians get*](struct.UserProfileGuardianGetCall.html) and [*guardians list*](struct.UserProfileGuardianListCall.html) //! @@ -51,24 +53,30 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.courses().announcements_modify_assignees(...).doit() //! let r = hub.courses().course_work_student_submissions_patch(...).doit() -//! let r = hub.courses().course_work_student_submissions_list(...).doit() +//! let r = hub.courses().announcements_list(...).doit() +//! let r = hub.courses().course_work_student_submissions_reclaim(...).doit() //! let r = hub.courses().get(...).doit() //! let r = hub.courses().update(...).doit() //! let r = hub.courses().students_get(...).doit() //! let r = hub.courses().teachers_get(...).doit() //! let r = hub.courses().course_work_list(...).doit() //! let r = hub.courses().course_work_get(...).doit() +//! let r = hub.courses().course_work_student_submissions_list(...).doit() //! let r = hub.courses().course_work_student_submissions_turn_in(...).doit() //! let r = hub.courses().course_work_student_submissions_modify_attachments(...).doit() +//! let r = hub.courses().announcements_get(...).doit() //! let r = hub.courses().teachers_list(...).doit() //! let r = hub.courses().course_work_student_submissions_return(...).doit() //! let r = hub.courses().aliases_list(...).doit() //! let r = hub.courses().course_work_create(...).doit() //! let r = hub.courses().list(...).doit() -//! let r = hub.courses().course_work_student_submissions_reclaim(...).doit() +//! let r = hub.courses().announcements_create(...).doit() +//! let r = hub.courses().announcements_patch(...).doit() //! let r = hub.courses().aliases_create(...).doit() //! let r = hub.courses().students_create(...).doit() +//! let r = hub.courses().course_work_modify_assignees(...).doit() //! let r = hub.courses().aliases_delete(...).doit() //! let r = hub.courses().course_work_delete(...).doit() //! let r = hub.courses().create(...).doit() @@ -80,6 +88,7 @@ //! let r = hub.courses().teachers_delete(...).doit() //! let r = hub.courses().teachers_create(...).doit() //! let r = hub.courses().course_work_student_submissions_get(...).doit() +//! let r = hub.courses().announcements_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -254,65 +263,85 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { + /// View the email addresses of people in your classes + ProfileEmail, + + /// View and manage guardians for students in your Google Classroom classes + GuardianlinkStudent, + + /// View and manage announcements in Google Classroom + Announcement, + + /// View the profile photos of people in your classes + ProfilePhoto, + + /// View guardians for students in your Google Classroom classes + GuardianlinkStudentReadonly, + + /// View course work and grades for students in the Google Classroom classes you teach or administer + StudentSubmissionStudentReadonly, + + /// Manage your Google Classroom class rosters + Roster, + + /// View your Google Classroom guardians + GuardianlinkMeReadonly, + + /// Manage your Google Classroom classes + Course, + /// View your course work and grades in Google Classroom StudentSubmissionMeReadonly, /// View your Google Classroom class rosters RosterReadonly, - /// View your course work and grades in Google Classroom - CourseworkMeReadonly, - /// View course work and grades for students in the Google Classroom classes you teach or administer CourseworkStudentReadonly, - /// View the email addresses of people in your classes - ProfileEmail, + /// View your course work and grades in Google Classroom + CourseworkMeReadonly, - /// View the profile photos of people in your classes - ProfilePhoto, + /// View announcements in Google Classroom + AnnouncementReadonly, /// Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer CourseworkStudent, - /// View course work and grades for students in the Google Classroom classes you teach or administer - StudentSubmissionStudentReadonly, - /// View your Google Classroom classes CourseReadonly, - /// Manage your Google Classroom class rosters - Roster, - /// Manage your course work and view your grades in Google Classroom CourseworkMe, - - /// Manage your Google Classroom classes - Course, } impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { + Scope::ProfileEmail => "https://www.googleapis.com/auth/classroom.profile.emails", + Scope::GuardianlinkStudent => "https://www.googleapis.com/auth/classroom.guardianlinks.students", + Scope::Announcement => "https://www.googleapis.com/auth/classroom.announcements", + Scope::ProfilePhoto => "https://www.googleapis.com/auth/classroom.profile.photos", + Scope::GuardianlinkStudentReadonly => "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly", + Scope::StudentSubmissionStudentReadonly => "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly", + Scope::Roster => "https://www.googleapis.com/auth/classroom.rosters", + Scope::GuardianlinkMeReadonly => "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly", + Scope::Course => "https://www.googleapis.com/auth/classroom.courses", Scope::StudentSubmissionMeReadonly => "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", Scope::RosterReadonly => "https://www.googleapis.com/auth/classroom.rosters.readonly", - Scope::CourseworkMeReadonly => "https://www.googleapis.com/auth/classroom.coursework.me.readonly", Scope::CourseworkStudentReadonly => "https://www.googleapis.com/auth/classroom.coursework.students.readonly", - Scope::ProfileEmail => "https://www.googleapis.com/auth/classroom.profile.emails", - Scope::ProfilePhoto => "https://www.googleapis.com/auth/classroom.profile.photos", + Scope::CourseworkMeReadonly => "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + Scope::AnnouncementReadonly => "https://www.googleapis.com/auth/classroom.announcements.readonly", Scope::CourseworkStudent => "https://www.googleapis.com/auth/classroom.coursework.students", - Scope::StudentSubmissionStudentReadonly => "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly", Scope::CourseReadonly => "https://www.googleapis.com/auth/classroom.courses.readonly", - Scope::Roster => "https://www.googleapis.com/auth/classroom.rosters", Scope::CourseworkMe => "https://www.googleapis.com/auth/classroom.coursework.me", - Scope::Course => "https://www.googleapis.com/auth/classroom.courses", } } } impl Default for Scope { fn default() -> Scope { - Scope::StudentSubmissionMeReadonly + Scope::GuardianlinkStudentReadonly } } @@ -409,6 +438,9 @@ impl<'a, C, A> Classroom pub fn invitations(&'a self) -> InvitationMethods<'a, C, A> { InvitationMethods { hub: &self } } + pub fn registrations(&'a self) -> RegistrationMethods<'a, C, A> { + RegistrationMethods { hub: &self } + } pub fn user_profiles(&'a self) -> UserProfileMethods<'a, C, A> { UserProfileMethods { hub: &self } } @@ -442,27 +474,117 @@ impl<'a, C, A> Classroom // ############ // SCHEMAS ### // ########## -/// Response when listing guardians. +/// Announcement created by a teacher for students of the course /// /// # 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*). /// -/// * [guardians list user profiles](struct.UserProfileGuardianListCall.html) (response) +/// * [announcements modify assignees courses](struct.CourseAnnouncementModifyAssigneeCall.html) (response) +/// * [announcements get courses](struct.CourseAnnouncementGetCall.html) (response) +/// * [announcements patch courses](struct.CourseAnnouncementPatchCall.html) (request|response) +/// * [announcements create courses](struct.CourseAnnouncementCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListGuardiansResponse { - /// Token identifying the next page of results to return. If empty, no further - /// results are available. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Guardians on this page of results that met the criteria specified in - /// the request. - pub guardians: Option>, +pub struct Announcement { + /// Timestamp of the most recent change to this announcement. + /// + /// Read-only. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Identifier for the user that created the announcement. + /// + /// Read-only. + #[serde(rename="creatorUserId")] + pub creator_user_id: Option, + /// Identifier of the course. + /// + /// Read-only. + #[serde(rename="courseId")] + pub course_id: Option, + /// Description of this announcement. + /// The text must be a valid UTF-8 string containing no more + /// than 30,000 characters. + pub text: Option, + /// Optional timestamp when this announcement is scheduled to be published. + #[serde(rename="scheduledTime")] + pub scheduled_time: Option, + /// Timestamp when this announcement was created. + /// + /// Read-only. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// Assignee mode of the announcement. + /// If unspecified, the default value is `ALL_STUDENTS`. + #[serde(rename="assigneeMode")] + pub assignee_mode: Option, + /// Status of this announcement. + /// If unspecified, the default state is `DRAFT`. + pub state: Option, + /// Additional materials. + /// + /// Announcements must have no more than 20 material items. + pub materials: Option>, + /// Absolute link to this announcement in the Classroom web UI. + /// This is only populated if `state` is `PUBLISHED`. + /// + /// Read-only. + #[serde(rename="alternateLink")] + pub alternate_link: Option, + /// Identifiers of students with access to the announcement. + /// This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. + /// If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this + /// field will be able to see the announcement. + #[serde(rename="individualStudentsOptions")] + pub individual_students_options: Option, + /// Classroom-assigned identifier of this announcement, unique per course. + /// + /// Read-only. + pub id: Option, } -impl ResponseResult for ListGuardiansResponse {} +impl RequestValue for Announcement {} +impl ResponseResult for Announcement {} + + +/// A reference to a Cloud Pub/Sub topic. +/// +/// To register for notifications, the owner of the topic must grant +/// `classroom-notifications@system.gserviceaccount.com` the +/// `projects.topics.publish` permission. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloudPubsubTopic { + /// The `name` field of a Cloud Pub/Sub + /// [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). + #[serde(rename="topicName")] + pub topic_name: Option, +} + +impl Part for CloudPubsubTopic {} + + +/// Contains fields to add or remove students from a course work or announcement +/// where the `assigneeMode` is set to `INDIVIDUAL_STUDENTS`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModifyIndividualStudentsOptions { + /// Ids of students to be added as having access to this + /// coursework/announcement. + #[serde(rename="addStudentIds")] + pub add_student_ids: Option>, + /// Ids of students to be removed from having access to this + /// coursework/announcement. + #[serde(rename="removeStudentIds")] + pub remove_student_ids: Option>, +} + +impl Part for ModifyIndividualStudentsOptions {} /// Student work for a multiple-choice question. @@ -521,14 +643,14 @@ impl Part for ShortAnswerSubmission {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Attachment { - /// Youtube video attachment. - #[serde(rename="youTubeVideo")] - pub you_tube_video: Option, + /// Link attachment. + pub link: Option, /// Google Drive file attachment. #[serde(rename="driveFile")] pub drive_file: Option, - /// Link attachment. - pub link: Option, + /// Youtube video attachment. + #[serde(rename="youTubeVideo")] + pub you_tube_video: Option, /// Google Forms attachment. pub form: Option
, } @@ -536,27 +658,24 @@ pub struct Attachment { impl Part for Attachment {} -/// Represents a time of day. The date and time zone are either not significant -/// or are specified elsewhere. An API may choose to allow leap seconds. Related -/// types are google.type.Date and `google.protobuf.Timestamp`. +/// Student work for an assignment. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TimeOfDay { - /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - /// to allow the value "24:00:00" for scenarios like business closing time. - pub hours: Option, - /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - pub nanos: Option, - /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may - /// allow the value 60 if it allows leap-seconds. - pub seconds: Option, - /// Minutes of hour of day. Must be from 0 to 59. - pub minutes: Option, +pub struct AssignmentSubmission { + /// Attachments added by the student. + /// Drive files that correspond to materials with a share mode of + /// STUDENT_COPY may not exist yet if the student has not accessed the + /// assignment in Classroom. + /// + /// Some attachment metadata is only populated if the requesting user has + /// permission to access it. Identifier and alternate_link fields are always + /// available, but others (e.g. title) may not be. + pub attachments: Option>, } -impl Part for TimeOfDay {} +impl Part for AssignmentSubmission {} /// Request to return a student submission. @@ -592,13 +711,15 @@ impl RequestValue for ReturnStudentSubmissionRequest {} /// * [delete invitations](struct.InvitationDeleteCall.html) (response) /// * [course work delete courses](struct.CourseCourseWorkDeleteCall.html) (response) /// * [course work student submissions reclaim courses](struct.CourseCourseWorkStudentSubmissionReclaimCall.html) (response) +/// * [delete courses](struct.CourseDeleteCall.html) (response) /// * [teachers delete courses](struct.CourseTeacherDeleteCall.html) (response) /// * [guardians delete user profiles](struct.UserProfileGuardianDeleteCall.html) (response) /// * [students delete courses](struct.CourseStudentDeleteCall.html) (response) /// * [aliases delete courses](struct.CourseAliaseDeleteCall.html) (response) /// * [course work student submissions turn in courses](struct.CourseCourseWorkStudentSubmissionTurnInCall.html) (response) /// * [course work student submissions return courses](struct.CourseCourseWorkStudentSubmissionReturnCall.html) (response) -/// * [delete courses](struct.CourseDeleteCall.html) (response) +/// * [delete registrations](struct.RegistrationDeleteCall.html) (response) +/// * [announcements delete courses](struct.CourseAnnouncementDeleteCall.html) (response) /// * [accept invitations](struct.InvitationAcceptCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -625,24 +746,31 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UserProfile { - /// URL of user's profile photo. - /// - /// Read-only. - #[serde(rename="photoUrl")] - pub photo_url: Option, /// Email address of the user. /// /// Read-only. #[serde(rename="emailAddress")] pub email_address: Option, - /// Identifier of the user. - /// - /// Read-only. - pub id: Option, /// Name of the user. /// /// Read-only. pub name: Option, + /// URL of user's profile photo. + /// + /// Read-only. + #[serde(rename="photoUrl")] + pub photo_url: Option, + /// Represents whether a G Suite for Education user's domain administrator has + /// explicitly verified them as being a teacher. If the user is not a member of + /// a G Suite for Education domain, than this field will always be false. + /// + /// Read-only + #[serde(rename="verifiedTeacher")] + pub verified_teacher: Option, + /// Identifier of the user. + /// + /// Read-only. + pub id: Option, /// Global permissions of the user. /// /// Read-only. @@ -670,24 +798,27 @@ pub struct CourseMaterialSet { impl Part for CourseMaterialSet {} -/// Student work for an assignment. +/// Represents a time of day. The date and time zone are either not significant +/// or are specified elsewhere. An API may choose to allow leap seconds. Related +/// types are google.type.Date and `google.protobuf.Timestamp`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AssignmentSubmission { - /// Attachments added by the student. - /// Drive files that correspond to materials with a share mode of - /// STUDENT_COPY may not exist yet if the student has not accessed the - /// assignment in Classroom. - /// - /// Some attachment metadata is only populated if the requesting user has - /// permission to access it. Identifier and alternate_link fields are always - /// available, but others (e.g. title) may not be. - pub attachments: Option>, +pub struct TimeOfDay { + /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + /// to allow the value "24:00:00" for scenarios like business closing time. + pub hours: Option, + /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + pub nanos: Option, + /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may + /// allow the value 60 if it allows leap-seconds. + pub seconds: Option, + /// Minutes of hour of day. Must be from 0 to 59. + pub minutes: Option, } -impl Part for AssignmentSubmission {} +impl Part for TimeOfDay {} /// Google Forms item. @@ -720,34 +851,190 @@ pub struct Form { impl Part for Form {} -/// Association between a student and a guardian of that student. The guardian -/// may receive information about the student's course work. +/// A Course in Classroom. /// /// # 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*). /// -/// * [guardians get user profiles](struct.UserProfileGuardianGetCall.html) (response) +/// * [announcements modify assignees courses](struct.CourseAnnouncementModifyAssigneeCall.html) (none) +/// * [course work student submissions patch courses](struct.CourseCourseWorkStudentSubmissionPatchCall.html) (none) +/// * [announcements list courses](struct.CourseAnnouncementListCall.html) (none) +/// * [course work student submissions reclaim courses](struct.CourseCourseWorkStudentSubmissionReclaimCall.html) (none) +/// * [get courses](struct.CourseGetCall.html) (response) +/// * [update courses](struct.CourseUpdateCall.html) (request|response) +/// * [students get courses](struct.CourseStudentGetCall.html) (none) +/// * [teachers get courses](struct.CourseTeacherGetCall.html) (none) +/// * [course work list courses](struct.CourseCourseWorkListCall.html) (none) +/// * [course work get courses](struct.CourseCourseWorkGetCall.html) (none) +/// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.html) (none) +/// * [course work student submissions turn in courses](struct.CourseCourseWorkStudentSubmissionTurnInCall.html) (none) +/// * [course work student submissions modify attachments courses](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html) (none) +/// * [announcements get courses](struct.CourseAnnouncementGetCall.html) (none) +/// * [teachers list courses](struct.CourseTeacherListCall.html) (none) +/// * [course work student submissions return courses](struct.CourseCourseWorkStudentSubmissionReturnCall.html) (none) +/// * [aliases list courses](struct.CourseAliaseListCall.html) (none) +/// * [course work create courses](struct.CourseCourseWorkCreateCall.html) (none) +/// * [list courses](struct.CourseListCall.html) (none) +/// * [announcements create courses](struct.CourseAnnouncementCreateCall.html) (none) +/// * [announcements patch courses](struct.CourseAnnouncementPatchCall.html) (none) +/// * [aliases create courses](struct.CourseAliaseCreateCall.html) (none) +/// * [students create courses](struct.CourseStudentCreateCall.html) (none) +/// * [course work modify assignees courses](struct.CourseCourseWorkModifyAssigneeCall.html) (none) +/// * [aliases delete courses](struct.CourseAliaseDeleteCall.html) (none) +/// * [course work delete courses](struct.CourseCourseWorkDeleteCall.html) (none) +/// * [create courses](struct.CourseCreateCall.html) (request|response) +/// * [students list courses](struct.CourseStudentListCall.html) (none) +/// * [delete courses](struct.CourseDeleteCall.html) (none) +/// * [course work patch courses](struct.CourseCourseWorkPatchCall.html) (none) +/// * [patch courses](struct.CoursePatchCall.html) (request|response) +/// * [students delete courses](struct.CourseStudentDeleteCall.html) (none) +/// * [teachers delete courses](struct.CourseTeacherDeleteCall.html) (none) +/// * [teachers create courses](struct.CourseTeacherCreateCall.html) (none) +/// * [course work student submissions get courses](struct.CourseCourseWorkStudentSubmissionGetCall.html) (none) +/// * [announcements delete courses](struct.CourseAnnouncementDeleteCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Guardian { - /// Identifier for the guardian. - #[serde(rename="guardianId")] - pub guardian_id: Option, - /// The email address to which the initial guardian invitation was sent. - /// This field is only visible to domain administrators. - #[serde(rename="invitedEmailAddress")] - pub invited_email_address: Option, - /// Identifier for the student to whom the guardian relationship applies. - #[serde(rename="studentId")] - pub student_id: Option, - /// User profile for the guardian. - #[serde(rename="guardianProfile")] - pub guardian_profile: Option, +pub struct Course { + /// Time of the most recent update to this course. + /// Specifying this field in a course update mask results in an error. + /// + /// Read-only. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Optional description. + /// For example, "We'll be learning about the structure of living + /// creatures from a combination of textbooks, guest lectures, and lab work. + /// Expect to be excited!" + /// If set, this field must be a valid UTF-8 string and no longer than 30,000 + /// characters. + pub description: Option, + /// Enrollment code to use when joining this course. + /// Specifying this field in a course update mask results in an error. + /// + /// Read-only. + #[serde(rename="enrollmentCode")] + pub enrollment_code: Option, + /// Whether or not guardian notifications are enabled for this course. + /// + /// Read-only. + #[serde(rename="guardiansEnabled")] + pub guardians_enabled: Option, + /// The email address of a Google group containing all members of the course. + /// This group does not accept email and can only be used for permissions. + /// + /// Read-only. + #[serde(rename="courseGroupEmail")] + pub course_group_email: Option, + /// Sets of materials that appear on the "about" page of this course. + /// + /// Read-only. + #[serde(rename="courseMaterialSets")] + pub course_material_sets: Option>, + /// The Calendar ID for a calendar that all course members can see, to which + /// Classroom adds events for course work and announcements in the course. + /// + /// Read-only. + #[serde(rename="calendarId")] + pub calendar_id: Option, + /// State of the course. + /// If unspecified, the default state is `PROVISIONED`. + #[serde(rename="courseState")] + pub course_state: Option, + /// Identifier for this course assigned by Classroom. + /// + /// When + /// creating a course, + /// you may optionally set this identifier to an + /// alias string in the + /// request to create a corresponding alias. The `id` is still assigned by + /// Classroom and cannot be updated after the course is created. + /// + /// Specifying this field in a course update mask results in an error. + pub id: Option, + /// Name of the course. + /// For example, "10th Grade Biology". + /// The name is required. It must be between 1 and 750 characters and a valid + /// UTF-8 string. + pub name: Option, + /// Optional room location. + /// For example, "301". + /// If set, this field must be a valid UTF-8 string and no longer than 650 + /// characters. + pub room: Option, + /// Absolute link to this course in the Classroom web UI. + /// + /// Read-only. + #[serde(rename="alternateLink")] + pub alternate_link: Option, + /// Section of the course. + /// For example, "Period 2". + /// If set, this field must be a valid UTF-8 string and no longer than 2800 + /// characters. + pub section: Option, + /// Creation time of the course. + /// Specifying this field in a course update mask results in an error. + /// + /// Read-only. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// The email address of a Google group containing all teachers of the course. + /// This group does not accept email and can only be used for permissions. + /// + /// Read-only. + #[serde(rename="teacherGroupEmail")] + pub teacher_group_email: Option, + /// Information about a Drive Folder that is shared with all teachers of the + /// course. + /// + /// This field will only be set for teachers of the course and domain administrators. + /// + /// Read-only. + #[serde(rename="teacherFolder")] + pub teacher_folder: Option, + /// The identifier of the owner of a course. + /// + /// When specified as a parameter of a + /// create course request, this + /// field is required. + /// The identifier can be one of the following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// + /// This must be set in a create request. Admins can also specify this field + /// in a patch course request to + /// transfer ownership. In other contexts, it is read-only. + #[serde(rename="ownerId")] + pub owner_id: Option, + /// Optional heading for the description. + /// For example, "Welcome to 10th Grade Biology." + /// If set, this field must be a valid UTF-8 string and no longer than 3600 + /// characters. + #[serde(rename="descriptionHeading")] + pub description_heading: Option, } -impl ResponseResult for Guardian {} +impl RequestValue for Course {} +impl Resource for Course {} +impl ResponseResult for Course {} + + +/// Additional details for assignments. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Assignment { + /// Drive folder where attachments from student submissions are placed. + /// This is only populated for course teachers and administrators. + #[serde(rename="studentWorkFolder")] + pub student_work_folder: Option, +} + +impl Part for Assignment {} /// Request to turn in a student submission. @@ -795,11 +1082,10 @@ impl Part for Material {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct YouTubeVideo { - /// URL that can be used to view the YouTube video. + /// Title of the YouTube video. /// /// Read-only. - #[serde(rename="alternateLink")] - pub alternate_link: Option, + pub title: Option, /// URL of a thumbnail image of the YouTube video. /// /// Read-only. @@ -807,10 +1093,11 @@ pub struct YouTubeVideo { pub thumbnail_url: Option, /// YouTube API resource ID. pub id: Option, - /// Title of the YouTube video. + /// URL that can be used to view the YouTube video. /// /// Read-only. - pub title: Option, + #[serde(rename="alternateLink")] + pub alternate_link: Option, } impl Part for YouTubeVideo {} @@ -838,16 +1125,40 @@ pub struct ListTeachersResponse { impl ResponseResult for ListTeachersResponse {} +/// Response when listing guardians. +/// +/// # 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*). +/// +/// * [guardians list user profiles](struct.UserProfileGuardianListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListGuardiansResponse { + /// Token identifying the next page of results to return. If empty, no further + /// results are available. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Guardians on this page of results that met the criteria specified in + /// the request. + pub guardians: Option>, +} + +impl ResponseResult for ListGuardiansResponse {} + + /// Representation of a Google Drive file. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DriveFile { - /// Title of the Drive item. + /// URL that can be used to access the Drive item. /// /// Read-only. - pub title: Option, + #[serde(rename="alternateLink")] + pub alternate_link: Option, /// URL of a thumbnail image of the Drive item. /// /// Read-only. @@ -855,11 +1166,10 @@ pub struct DriveFile { pub thumbnail_url: Option, /// Drive API resource ID. pub id: Option, - /// URL that can be used to access the Drive item. + /// Title of the Drive item. /// /// Read-only. - #[serde(rename="alternateLink")] - pub alternate_link: Option, + pub title: Option, } impl Part for DriveFile {} @@ -931,29 +1241,26 @@ impl RequestValue for Student {} impl ResponseResult for Student {} -/// Represents a whole calendar date, e.g. date of birth. The time of day and -/// time zone are either specified elsewhere or are not significant. The date -/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to -/// represent a year and month where the day is not significant, e.g. credit card -/// expiration date. The year may be 0 to represent a month and day independent -/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay -/// and `google.protobuf.Timestamp`. +/// Response when listing course work. /// -/// 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*). +/// +/// * [announcements list courses](struct.CourseAnnouncementListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Date { - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without - /// a year. - pub year: Option, - /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - /// if specifying a year/month where the day is not significant. - pub day: Option, - /// Month of year. Must be from 1 to 12. - pub month: Option, +pub struct ListAnnouncementsResponse { + /// Token identifying the next page of results to return. If empty, no further + /// results are available. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Announcement items that match the request. + pub announcements: Option>, } -impl Part for Date {} +impl ResponseResult for ListAnnouncementsResponse {} /// Drive file that is used as material for course work. @@ -973,27 +1280,17 @@ pub struct SharedDriveFile { impl Part for SharedDriveFile {} -/// Response when listing student submissions. +/// Additional details for multiple-choice questions. /// -/// # 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*). -/// -/// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.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 ListStudentSubmissionsResponse { - /// Token identifying the next page of results to return. If empty, no further - /// results are available. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Student work that matches the request. - #[serde(rename="studentSubmissions")] - pub student_submissions: Option>, +pub struct MultipleChoiceQuestion { + /// Possible choices. + pub choices: Option>, } -impl ResponseResult for ListStudentSubmissionsResponse {} +impl Part for MultipleChoiceQuestion {} /// Response when listing courses. @@ -1018,41 +1315,27 @@ pub struct ListCoursesResponse { impl ResponseResult for ListCoursesResponse {} -/// Teacher of a course. +/// Response when listing guardian invitations. /// /// # 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*). /// -/// * [teachers create courses](struct.CourseTeacherCreateCall.html) (request|response) -/// * [teachers get courses](struct.CourseTeacherGetCall.html) (response) +/// * [guardian invitations list user profiles](struct.UserProfileGuardianInvitationListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Teacher { - /// Identifier of the course. - /// - /// Read-only. - #[serde(rename="courseId")] - pub course_id: Option, - /// Global user information for the teacher. - /// - /// Read-only. - pub profile: Option, - /// Identifier of the user. - /// - /// When specified as a parameter of a request, this identifier can be one of - /// the following: - /// - /// * the numeric identifier for the user - /// * the email address of the user - /// * the string literal `"me"`, indicating the requesting user - #[serde(rename="userId")] - pub user_id: Option, +pub struct ListGuardianInvitationsResponse { + /// Token identifying the next page of results to return. If empty, no further + /// results are available. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Guardian invitations that matched the list request. + #[serde(rename="guardianInvitations")] + pub guardian_invitations: Option>, } -impl RequestValue for Teacher {} -impl ResponseResult for Teacher {} +impl ResponseResult for ListGuardianInvitationsResponse {} /// A material attached to a course as part of a material set. @@ -1076,6 +1359,33 @@ pub struct CourseMaterial { impl Part for CourseMaterial {} +/// The history of each grade on this submission. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GradeHistory { + /// When the grade of the submission was changed. + #[serde(rename="gradeTimestamp")] + pub grade_timestamp: Option, + /// The teacher who made the grade change. + #[serde(rename="actorUserId")] + pub actor_user_id: Option, + /// The numerator of the grade at this time in the submission grade history. + #[serde(rename="pointsEarned")] + pub points_earned: Option, + /// The denominator of the grade at this time in the submission grade + /// history. + #[serde(rename="maxPoints")] + pub max_points: Option, + /// The type of grade change at this time in the submission grade history. + #[serde(rename="gradeChangeType")] + pub grade_change_type: Option, +} + +impl Part for GradeHistory {} + + /// Details of the user's name. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1125,6 +1435,60 @@ pub struct ListInvitationsResponse { impl ResponseResult for ListInvitationsResponse {} +/// An instruction to Classroom to send notifications from the `feed` to the +/// provided `destination`. +/// +/// # 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 registrations](struct.RegistrationDeleteCall.html) (none) +/// * [create registrations](struct.RegistrationCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Registration { + /// Specification for the class of notifications that Classroom should deliver + /// to the `destination`. + pub feed: Option, + /// A server-generated unique identifier for this `Registration`. + /// + /// Read-only. + #[serde(rename="registrationId")] + pub registration_id: Option, + /// The time until which the `Registration` is effective. + /// + /// This is a read-only field assigned by the server. + #[serde(rename="expiryTime")] + pub expiry_time: Option, + /// The Cloud Pub/Sub topic that notifications are to be sent to. + #[serde(rename="cloudPubsubTopic")] + pub cloud_pubsub_topic: Option, +} + +impl RequestValue for Registration {} +impl Resource for Registration {} +impl ResponseResult for Registration {} + + +/// The history of the submission. This currently includes state and grade +/// histories. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubmissionHistory { + /// The state history information of the submission, if present. + #[serde(rename="stateHistory")] + pub state_history: Option, + /// The grade history information of the submission, if present. + #[serde(rename="gradeHistory")] + pub grade_history: Option, +} + +impl Part for SubmissionHistory {} + + /// Representation of a Google Drive folder. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1147,6 +1511,31 @@ pub struct DriveFolder { impl Part for DriveFolder {} +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Date { + /// Month of year. Must be from 1 to 12. + pub month: Option, + /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + /// if specifying a year/month where the day is not significant. + pub day: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, +} + +impl Part for Date {} + + /// An invitation to join a course. /// /// # Activities @@ -1165,9 +1554,6 @@ pub struct Invitation { /// Identifier of the course to invite the user to. #[serde(rename="courseId")] pub course_id: Option, - /// Role to invite the user to have. - /// Must not be `COURSE_ROLE_UNSPECIFIED`. - pub role: Option, /// Identifier of the invited user. /// /// When specified as a parameter of a request, this identifier can be set to @@ -1178,6 +1564,9 @@ pub struct Invitation { /// * the string literal `"me"`, indicating the requesting user #[serde(rename="userId")] pub user_id: Option, + /// Role to invite the user to have. + /// Must not be `COURSE_ROLE_UNSPECIFIED`. + pub role: Option, /// Identifier assigned by Classroom. /// /// Read-only. @@ -1200,28 +1589,97 @@ impl ResponseResult for Invitation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListStudentsResponse { - /// Students who match the list request. - pub students: Option>, /// Token identifying the next page of results to return. If empty, no further /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// Students who match the list request. + pub students: Option>, } impl ResponseResult for ListStudentsResponse {} -/// Additional details for multiple-choice questions. +/// Assignee details about a coursework/announcement. +/// This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MultipleChoiceQuestion { - /// Possible choices. - pub choices: Option>, +pub struct IndividualStudentsOptions { + /// Identifiers for the students that have access to the + /// coursework/announcement. + #[serde(rename="studentIds")] + pub student_ids: Option>, } -impl Part for MultipleChoiceQuestion {} +impl Part for IndividualStudentsOptions {} + + +/// Request to modify assignee mode and options of an announcement. +/// +/// # 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*). +/// +/// * [announcements modify assignees courses](struct.CourseAnnouncementModifyAssigneeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModifyAnnouncementAssigneesRequest { + /// Set which students can view or cannot view the announcement. + /// Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + #[serde(rename="modifyIndividualStudentsOptions")] + pub modify_individual_students_options: Option, + /// Mode of the announcement describing whether it will be accessible by all + /// students or specified individual students. + #[serde(rename="assigneeMode")] + pub assignee_mode: Option, +} + +impl RequestValue for ModifyAnnouncementAssigneesRequest {} + + +/// Response when listing student submissions. +/// +/// # 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*). +/// +/// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListStudentSubmissionsResponse { + /// Token identifying the next page of results to return. If empty, no further + /// results are available. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Student work that matches the request. + #[serde(rename="studentSubmissions")] + pub student_submissions: Option>, +} + +impl ResponseResult for ListStudentSubmissionsResponse {} + + +/// A class of notifications that an application can register to receive. +/// For example: "all roster changes for a domain". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Feed { + /// The type of feed. + #[serde(rename="feedType")] + pub feed_type: Option, + /// Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. + /// This field must be specified if `feed_type` is `COURSE_ROSTER_CHANGES`. + #[serde(rename="courseRosterChangesInfo")] + pub course_roster_changes_info: Option, +} + +impl Part for Feed {} /// Response when listing course aliases. @@ -1268,9 +1726,10 @@ impl RequestValue for ReclaimStudentSubmissionRequest {} /// 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*). /// +/// * [course work modify assignees courses](struct.CourseCourseWorkModifyAssigneeCall.html) (response) /// * [course work create courses](struct.CourseCourseWorkCreateCall.html) (request|response) -/// * [course work get courses](struct.CourseCourseWorkGetCall.html) (response) /// * [course work patch courses](struct.CourseCourseWorkPatchCall.html) (request|response) +/// * [course work get courses](struct.CourseCourseWorkGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CourseWork { @@ -1293,6 +1752,9 @@ pub struct CourseWork { /// /// Read-only. pub assignment: Option, + /// Optional timestamp when this course work is scheduled to be published. + #[serde(rename="scheduledTime")] + pub scheduled_time: Option, /// Whether this course work item is associated with the Developer Console /// project making the request. /// @@ -1302,6 +1764,10 @@ pub struct CourseWork { /// Read-only. #[serde(rename="associatedWithDeveloper")] pub associated_with_developer: Option, + /// Assignee mode of the coursework. + /// If unspecified, the default value is `ALL_STUDENTS`. + #[serde(rename="assigneeMode")] + pub assignee_mode: Option, /// Maximum grade for this course work. /// If zero or unspecified, this assignment is considered ungraded. /// This must be a non-negative integer value. @@ -1326,10 +1792,11 @@ pub struct CourseWork { /// Read-only. #[serde(rename="alternateLink")] pub alternate_link: Option, - /// Title of this course work. - /// The title must be a valid UTF-8 string containing between 1 and 3000 - /// characters. - pub title: Option, + /// Identifier for the user that created the coursework. + /// + /// Read-only. + #[serde(rename="creatorUserId")] + pub creator_user_id: Option, /// Timestamp when this course work was created. /// /// Read-only. @@ -1346,6 +1813,16 @@ pub struct CourseWork { /// /// CourseWork must have no more than 20 material items. pub materials: Option>, + /// Title of this course work. + /// The title must be a valid UTF-8 string containing between 1 and 3000 + /// characters. + pub title: Option, + /// Identifiers of students with access to the coursework. + /// This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. + /// If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students + /// specified in this field will be assigned the coursework. + #[serde(rename="individualStudentsOptions")] + pub individual_students_options: Option, /// Optional time of day, in UTC, that submissions for this this course work /// are due. /// This must be specified if `due_date` is specified. @@ -1399,6 +1876,21 @@ pub struct StudentSubmission { /// Read-only. #[serde(rename="userId")] pub user_id: Option, + /// Submission content when course_work_type is SHORT_ANSWER_QUESTION. + #[serde(rename="shortAnswerSubmission")] + pub short_answer_submission: Option, + /// Type of course work this submission is for. + /// + /// Read-only. + #[serde(rename="courseWorkType")] + pub course_work_type: Option, + /// Optional grade. If unset, no grade was set. + /// This value must be non-negative. Decimal (i.e. non-integer) values are + /// allowed, but will be rounded to two decimal places. + /// + /// This may be modified only by course teachers. + #[serde(rename="assignedGrade")] + pub assigned_grade: Option, /// Whether this student submission is associated with the Developer Console /// project making the request. /// @@ -1408,24 +1900,14 @@ pub struct StudentSubmission { /// Read-only. #[serde(rename="associatedWithDeveloper")] pub associated_with_developer: Option, - /// Type of course work this submission is for. - /// - /// Read-only. - #[serde(rename="courseWorkType")] - pub course_work_type: Option, - /// Optional grade. If unset, no grade was set. - /// This must be a non-negative integer value. - /// - /// This may be modified only by course teachers. - #[serde(rename="assignedGrade")] - pub assigned_grade: Option, /// Classroom-assigned Identifier for the student submission. /// This is unique among submissions for the relevant course work. /// /// Read-only. pub id: Option, /// Optional pending grade. If unset, no grade was set. - /// This must be a non-negative integer value. + /// This value must be non-negative. Decimal (i.e. non-integer) values are + /// allowed, but will be rounded to two decimal places. /// /// This is only visible to and modifiable by course teachers. #[serde(rename="draftGrade")] @@ -1444,9 +1926,11 @@ pub struct StudentSubmission { /// Read-only. #[serde(rename="creationTime")] pub creation_time: Option, - /// Submission content when course_work_type is SHORT_ANSWER_QUESTION. - #[serde(rename="shortAnswerSubmission")] - pub short_answer_submission: Option, + /// The history of the submission (includes state and grade histories). + /// + /// Read-only. + #[serde(rename="submissionHistory")] + pub submission_history: Option>, /// Whether this submission is late. /// /// Read-only. @@ -1460,7 +1944,10 @@ pub struct StudentSubmission { /// Read-only. #[serde(rename="courseWorkId")] pub course_work_id: Option, - /// Submission content when course_work_type is ASSIGNMENT . + /// Submission content when course_work_type is ASSIGNMENT. + /// + /// Students can modify this content using + /// google.classroom.Work.ModifyAttachments. #[serde(rename="assignmentSubmission")] pub assignment_submission: Option, } @@ -1469,184 +1956,79 @@ impl RequestValue for StudentSubmission {} impl ResponseResult for StudentSubmission {} -/// Response when listing guardian invitations. +/// Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. /// -/// # 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*). -/// -/// * [guardian invitations list user profiles](struct.UserProfileGuardianInvitationListCall.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 ListGuardianInvitationsResponse { - /// Token identifying the next page of results to return. If empty, no further - /// results are available. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Guardian invitations that matched the list request. - #[serde(rename="guardianInvitations")] - pub guardian_invitations: Option>, +pub struct CourseRosterChangesInfo { + /// The `course_id` of the course to subscribe to roster changes for. + #[serde(rename="courseId")] + pub course_id: Option, } -impl ResponseResult for ListGuardianInvitationsResponse {} +impl Part for CourseRosterChangesInfo {} -/// A Course in Classroom. +/// Teacher of a course. /// /// # 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*). /// -/// * [course work student submissions patch courses](struct.CourseCourseWorkStudentSubmissionPatchCall.html) (none) -/// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.html) (none) -/// * [get courses](struct.CourseGetCall.html) (response) -/// * [update courses](struct.CourseUpdateCall.html) (request|response) -/// * [students get courses](struct.CourseStudentGetCall.html) (none) -/// * [teachers get courses](struct.CourseTeacherGetCall.html) (none) -/// * [course work list courses](struct.CourseCourseWorkListCall.html) (none) -/// * [course work get courses](struct.CourseCourseWorkGetCall.html) (none) -/// * [course work student submissions turn in courses](struct.CourseCourseWorkStudentSubmissionTurnInCall.html) (none) -/// * [course work student submissions modify attachments courses](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html) (none) -/// * [teachers list courses](struct.CourseTeacherListCall.html) (none) -/// * [course work student submissions return courses](struct.CourseCourseWorkStudentSubmissionReturnCall.html) (none) -/// * [aliases list courses](struct.CourseAliaseListCall.html) (none) -/// * [course work create courses](struct.CourseCourseWorkCreateCall.html) (none) -/// * [list courses](struct.CourseListCall.html) (none) -/// * [course work student submissions reclaim courses](struct.CourseCourseWorkStudentSubmissionReclaimCall.html) (none) -/// * [aliases create courses](struct.CourseAliaseCreateCall.html) (none) -/// * [students create courses](struct.CourseStudentCreateCall.html) (none) -/// * [aliases delete courses](struct.CourseAliaseDeleteCall.html) (none) -/// * [course work delete courses](struct.CourseCourseWorkDeleteCall.html) (none) -/// * [create courses](struct.CourseCreateCall.html) (request|response) -/// * [students list courses](struct.CourseStudentListCall.html) (none) -/// * [delete courses](struct.CourseDeleteCall.html) (none) -/// * [course work patch courses](struct.CourseCourseWorkPatchCall.html) (none) -/// * [patch courses](struct.CoursePatchCall.html) (request|response) -/// * [students delete courses](struct.CourseStudentDeleteCall.html) (none) -/// * [teachers delete courses](struct.CourseTeacherDeleteCall.html) (none) -/// * [teachers create courses](struct.CourseTeacherCreateCall.html) (none) -/// * [course work student submissions get courses](struct.CourseCourseWorkStudentSubmissionGetCall.html) (none) +/// * [teachers create courses](struct.CourseTeacherCreateCall.html) (request|response) +/// * [teachers get courses](struct.CourseTeacherGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Course { - /// Time of the most recent update to this course. - /// Specifying this field in a course update mask results in an error. +pub struct Teacher { + /// Identifier of the course. /// /// Read-only. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Optional description. - /// For example, "We'll be learning about the structure of living - /// creatures from a combination of textbooks, guest lectures, and lab work. - /// Expect to be excited!" - /// If set, this field must be a valid UTF-8 string and no longer than 30,000 - /// characters. - pub description: Option, - /// Enrollment code to use when joining this course. - /// Specifying this field in a course update mask results in an error. + #[serde(rename="courseId")] + pub course_id: Option, + /// Global user information for the teacher. /// /// Read-only. - #[serde(rename="enrollmentCode")] - pub enrollment_code: Option, - /// Whether or not guardian notifications are enabled for this course. + pub profile: Option, + /// Identifier of the user. /// - /// Read-only. - #[serde(rename="guardiansEnabled")] - pub guardians_enabled: Option, - /// The email address of a Google group containing all members of the course. - /// This group does not accept email and can only be used for permissions. - /// - /// Read-only. - #[serde(rename="courseGroupEmail")] - pub course_group_email: Option, - /// Sets of materials that appear on the "about" page of this course. - /// - /// Read-only. - #[serde(rename="courseMaterialSets")] - pub course_material_sets: Option>, - /// State of the course. - /// If unspecified, the default state is `PROVISIONED`. - #[serde(rename="courseState")] - pub course_state: Option, - /// Identifier for this course assigned by Classroom. - /// - /// When - /// creating a course, - /// you may optionally set this identifier to an - /// alias string in the - /// request to create a corresponding alias. The `id` is still assigned by - /// Classroom and cannot be updated after the course is created. - /// - /// Specifying this field in a course update mask results in an error. - pub id: Option, - /// Name of the course. - /// For example, "10th Grade Biology". - /// The name is required. It must be between 1 and 750 characters and a valid - /// UTF-8 string. - pub name: Option, - /// Optional room location. - /// For example, "301". - /// If set, this field must be a valid UTF-8 string and no longer than 650 - /// characters. - pub room: Option, - /// Absolute link to this course in the Classroom web UI. - /// - /// Read-only. - #[serde(rename="alternateLink")] - pub alternate_link: Option, - /// Section of the course. - /// For example, "Period 2". - /// If set, this field must be a valid UTF-8 string and no longer than 2800 - /// characters. - pub section: Option, - /// Creation time of the course. - /// Specifying this field in a course update mask results in an error. - /// - /// Read-only. - #[serde(rename="creationTime")] - pub creation_time: Option, - /// The email address of a Google group containing all teachers of the course. - /// This group does not accept email and can only be used for permissions. - /// - /// Read-only. - #[serde(rename="teacherGroupEmail")] - pub teacher_group_email: Option, - /// Information about a Drive Folder that is shared with all teachers of the - /// course. - /// - /// This field will only be set for teachers of the course and domain administrators. - /// - /// Read-only. - #[serde(rename="teacherFolder")] - pub teacher_folder: Option, - /// The identifier of the owner of a course. - /// - /// When specified as a parameter of a - /// create course request, this - /// field is required. - /// The identifier can be one of the following: + /// When specified as a parameter of a request, this identifier can be one of + /// the following: /// /// * the numeric identifier for the user /// * the email address of the user /// * the string literal `"me"`, indicating the requesting user - /// - /// This must be set in a create request. Specifying this field in a course - /// update mask results in an `INVALID_ARGUMENT` error. - #[serde(rename="ownerId")] - pub owner_id: Option, - /// Optional heading for the description. - /// For example, "Welcome to 10th Grade Biology." - /// If set, this field must be a valid UTF-8 string and no longer than 3600 - /// characters. - #[serde(rename="descriptionHeading")] - pub description_heading: Option, + #[serde(rename="userId")] + pub user_id: Option, } -impl RequestValue for Course {} -impl Resource for Course {} -impl ResponseResult for Course {} +impl RequestValue for Teacher {} +impl ResponseResult for Teacher {} + + +/// Request to modify assignee mode and options of a coursework. +/// +/// # 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*). +/// +/// * [course work modify assignees courses](struct.CourseCourseWorkModifyAssigneeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModifyCourseWorkAssigneesRequest { + /// Mode of the coursework describing whether it will be assigned to all + /// students or specified individual students. + #[serde(rename="assigneeMode")] + pub assignee_mode: Option, + /// Set which students are assigned or not assigned to the coursework. + /// Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + #[serde(rename="modifyIndividualStudentsOptions")] + pub modify_individual_students_options: Option, +} + +impl RequestValue for ModifyCourseWorkAssigneesRequest {} /// Alternative identifier for a course. @@ -1689,19 +2071,34 @@ impl RequestValue for CourseAlias {} impl ResponseResult for CourseAlias {} -/// Additional details for assignments. +/// Association between a student and a guardian of that student. The guardian +/// may receive information about the student's course work. /// -/// 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*). +/// +/// * [guardians get user profiles](struct.UserProfileGuardianGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Assignment { - /// Drive folder where attachments from student submissions are placed. - /// This is only populated for course teachers. - #[serde(rename="studentWorkFolder")] - pub student_work_folder: Option, +pub struct Guardian { + /// Identifier for the guardian. + #[serde(rename="guardianId")] + pub guardian_id: Option, + /// The email address to which the initial guardian invitation was sent. + /// This field is only visible to domain administrators. + #[serde(rename="invitedEmailAddress")] + pub invited_email_address: Option, + /// Identifier for the student to whom the guardian relationship applies. + #[serde(rename="studentId")] + pub student_id: Option, + /// User profile for the guardian. + #[serde(rename="guardianProfile")] + pub guardian_profile: Option, } -impl Part for Assignment {} +impl ResponseResult for Guardian {} /// Global user permission description. @@ -1717,6 +2114,25 @@ pub struct GlobalPermission { impl Part for GlobalPermission {} +/// The history of each state this submission has been in. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StateHistory { + /// The workflow pipeline stage. + pub state: Option, + /// The teacher or student who made the change + #[serde(rename="actorUserId")] + pub actor_user_id: Option, + /// When the submission entered this state. + #[serde(rename="stateTimestamp")] + pub state_timestamp: Option, +} + +impl Part for StateHistory {} + + /// Response when listing course work. /// /// # Activities @@ -1749,13 +2165,15 @@ impl ResponseResult for ListCourseWorkResponse {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [guardian invitations create user profiles](struct.UserProfileGuardianInvitationCreateCall.html) (request|response) -/// * [guardian invitations patch user profiles](struct.UserProfileGuardianInvitationPatchCall.html) (request|response) /// * [guardian invitations get user profiles](struct.UserProfileGuardianInvitationGetCall.html) (response) +/// * [guardian invitations patch user profiles](struct.UserProfileGuardianInvitationPatchCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GuardianInvitation { - /// The state that this invitation is in. - pub state: Option, + /// Email address that the invitation was sent to. + /// This field is only visible to domain administrators. + #[serde(rename="invitedEmailAddress")] + pub invited_email_address: Option, /// ID of the student (in standard format) #[serde(rename="studentId")] pub student_id: Option, @@ -1764,15 +2182,13 @@ pub struct GuardianInvitation { /// Read-only. #[serde(rename="creationTime")] pub creation_time: Option, - /// Email address that the invitation was sent to. - /// This field is only visible to domain administrators. - #[serde(rename="invitedEmailAddress")] - pub invited_email_address: Option, /// Unique identifier for this invitation. /// /// Read-only. #[serde(rename="invitationId")] pub invitation_id: Option, + /// The state that this invitation is in. + pub state: Option, } impl RequestValue for GuardianInvitation {} @@ -1808,7 +2224,7 @@ impl ResponseResult for GuardianInvitation {} /// ::default(), None); /// let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aliases_create(...)`, `aliases_delete(...)`, `aliases_list(...)`, `course_work_create(...)`, `course_work_delete(...)`, `course_work_get(...)`, `course_work_list(...)`, `course_work_patch(...)`, `course_work_student_submissions_get(...)`, `course_work_student_submissions_list(...)`, `course_work_student_submissions_modify_attachments(...)`, `course_work_student_submissions_patch(...)`, `course_work_student_submissions_reclaim(...)`, `course_work_student_submissions_return(...)`, `course_work_student_submissions_turn_in(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `students_create(...)`, `students_delete(...)`, `students_get(...)`, `students_list(...)`, `teachers_create(...)`, `teachers_delete(...)`, `teachers_get(...)`, `teachers_list(...)` and `update(...)` +/// // like `aliases_create(...)`, `aliases_delete(...)`, `aliases_list(...)`, `announcements_create(...)`, `announcements_delete(...)`, `announcements_get(...)`, `announcements_list(...)`, `announcements_modify_assignees(...)`, `announcements_patch(...)`, `course_work_create(...)`, `course_work_delete(...)`, `course_work_get(...)`, `course_work_list(...)`, `course_work_modify_assignees(...)`, `course_work_patch(...)`, `course_work_student_submissions_get(...)`, `course_work_student_submissions_list(...)`, `course_work_student_submissions_modify_attachments(...)`, `course_work_student_submissions_patch(...)`, `course_work_student_submissions_reclaim(...)`, `course_work_student_submissions_return(...)`, `course_work_student_submissions_turn_in(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `students_create(...)`, `students_delete(...)`, `students_get(...)`, `students_list(...)`, `teachers_create(...)`, `teachers_delete(...)`, `teachers_get(...)`, `teachers_list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.courses(); /// # } @@ -1823,6 +2239,39 @@ impl<'a, C, A> MethodsBuilder for CourseMethods<'a, C, A> {} impl<'a, C, A> CourseMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Modifies assignee mode and options of an announcement. + /// + /// Only a teacher of the course that contains the announcement may + /// call this method. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course or course work does not exist. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the announcement. + pub fn announcements_modify_assignees(&self, request: ModifyAnnouncementAssigneesRequest, course_id: &str, id: &str) -> CourseAnnouncementModifyAssigneeCall<'a, C, A> { + CourseAnnouncementModifyAssigneeCall { + hub: self.hub, + _request: request, + _course_id: course_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates one or more fields of a student submission. @@ -1868,18 +2317,15 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of student submissions that the requester is permitted to - /// view, factoring in the OAuth scopes of the request. - /// `-` may be specified as the `course_work_id` to include student - /// submissions for multiple course work items. + /// Returns a list of announcements that the requester is permitted to view. /// - /// Course students may only view their own work. Course teachers - /// and domain administrators may view all student submissions. + /// Course students may only view `PUBLISHED` announcements. Course teachers + /// and domain administrators may view all announcements. /// /// This method returns the following error codes: /// - /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the - /// requested course or course work, or for access errors. + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access + /// the requested course or for access errors. /// * `INVALID_ARGUMENT` if the request is malformed. /// * `NOT_FOUND` if the requested course does not exist. /// @@ -1888,19 +2334,59 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// * `courseId` - Identifier of the course. /// This identifier can be either the Classroom-assigned identifier or an /// alias. - /// * `courseWorkId` - Identifer of the student work to request. - /// This may be set to the string literal `"-"` to request student work for - /// all course work in the specified course. - pub fn course_work_student_submissions_list(&self, course_id: &str, course_work_id: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { - CourseCourseWorkStudentSubmissionListCall { + pub fn announcements_list(&self, course_id: &str) -> CourseAnnouncementListCall<'a, C, A> { + CourseAnnouncementListCall { hub: self.hub, _course_id: course_id.to_string(), - _course_work_id: course_work_id.to_string(), - _user_id: Default::default(), - _states: Default::default(), _page_token: Default::default(), _page_size: Default::default(), - _late: Default::default(), + _order_by: Default::default(), + _announcement_states: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reclaims a student submission on behalf of the student that owns it. + /// + /// Reclaiming a student submission transfers ownership of attached Drive + /// files to the student and update the submission state. + /// + /// Only the student that owns the requested student submission may call this + /// method, and only for a student submission that has been turned in. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, unsubmit the requested student submission, + /// or for access errors. + /// * `FAILED_PRECONDITION` if the student submission has not been turned in. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `courseWorkId` - Identifier of the course work. + /// * `id` - Identifier of the student submission. + pub fn course_work_student_submissions_reclaim(&self, request: ReclaimStudentSubmissionRequest, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + CourseCourseWorkStudentSubmissionReclaimCall { + hub: self.hub, + _request: request, + _course_id: course_id.to_string(), + _course_work_id: course_work_id.to_string(), + _id: id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2086,6 +2572,47 @@ impl<'a, C, A> CourseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns a list of student submissions that the requester is permitted to + /// view, factoring in the OAuth scopes of the request. + /// `-` may be specified as the `course_work_id` to include student + /// submissions for multiple course work items. + /// + /// Course students may only view their own work. Course teachers + /// and domain administrators may view all student submissions. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course does not exist. + /// + /// # Arguments + /// + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `courseWorkId` - Identifier of the student work to request. + /// This may be set to the string literal `"-"` to request student work for + /// all course work in the specified course. + pub fn course_work_student_submissions_list(&self, course_id: &str, course_work_id: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + CourseCourseWorkStudentSubmissionListCall { + hub: self.hub, + _course_id: course_id.to_string(), + _course_work_id: course_work_id.to_string(), + _user_id: Default::default(), + _states: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _late: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Turns in a student submission. @@ -2172,6 +2699,34 @@ impl<'a, C, A> CourseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns an announcement. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or announcement, or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course or announcement does not exist. + /// + /// # Arguments + /// + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the announcement. + pub fn announcements_get(&self, course_id: &str, id: &str) -> CourseAnnouncementGetCall<'a, C, A> { + CourseAnnouncementGetCall { + hub: self.hub, + _course_id: course_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns a list of teachers of this course that the requester @@ -2313,7 +2868,8 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of courses that the requesting user is permitted to view, - /// restricted to those that match the request. + /// restricted to those that match the request. Returned courses are ordered by + /// creation time, with the most recently created coming first. /// /// This method returns the following error codes: /// @@ -2336,27 +2892,17 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Reclaims a student submission on behalf of the student that owns it. - /// - /// Reclaiming a student submission transfers ownership of attached Drive - /// files to the student and update the submission state. - /// - /// Only the student that owns the requested student submission may call this - /// method, and only for a student submission that has been turned in. - /// - /// This request must be made by the Developer Console project of the - /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to - /// create the corresponding course work item. + /// Creates an announcement. /// /// This method returns the following error codes: /// /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the - /// requested course or course work, unsubmit the requested student submission, - /// or for access errors. - /// * `FAILED_PRECONDITION` if the student submission has not been turned in. + /// requested course, create announcements in the requested course, share a + /// Drive attachment, or for access errors. /// * `INVALID_ARGUMENT` if the request is malformed. - /// * `NOT_FOUND` if the requested course, course work, or student submission - /// does not exist. + /// * `NOT_FOUND` if the requested course does not exist. + /// * `FAILED_PRECONDITION` for the following request error: + /// * AttachmentNotVisible /// /// # Arguments /// @@ -2364,15 +2910,44 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// * `courseId` - Identifier of the course. /// This identifier can be either the Classroom-assigned identifier or an /// alias. - /// * `courseWorkId` - Identifier of the course work. - /// * `id` - Identifier of the student submission. - pub fn course_work_student_submissions_reclaim(&self, request: ReclaimStudentSubmissionRequest, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { - CourseCourseWorkStudentSubmissionReclaimCall { + pub fn announcements_create(&self, request: Announcement, course_id: &str) -> CourseAnnouncementCreateCall<'a, C, A> { + CourseAnnouncementCreateCall { + hub: self.hub, + _request: request, + _course_id: course_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates one or more fields of an announcement. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting developer project did not create + /// the corresponding announcement or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `FAILED_PRECONDITION` if the requested announcement has already been + /// deleted. + /// * `NOT_FOUND` if the requested course or announcement does not exist + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the announcement. + pub fn announcements_patch(&self, request: Announcement, course_id: &str, id: &str) -> CourseAnnouncementPatchCall<'a, C, A> { + CourseAnnouncementPatchCall { hub: self.hub, _request: request, _course_id: course_id.to_string(), - _course_work_id: course_work_id.to_string(), _id: id.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2445,6 +3020,39 @@ impl<'a, C, A> CourseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Modifies assignee mode and options of a coursework. + /// + /// Only a teacher of the course that contains the coursework may + /// call this method. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course or course work does not exist. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the coursework. + pub fn course_work_modify_assignees(&self, request: ModifyCourseWorkAssigneesRequest, course_id: &str, id: &str) -> CourseCourseWorkModifyAssigneeCall<'a, C, A> { + CourseCourseWorkModifyAssigneeCall { + hub: self.hub, + _request: request, + _course_id: course_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes an alias of a course. @@ -2799,6 +3407,41 @@ impl<'a, C, A> CourseMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an announcement. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding announcement item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting developer project did not create + /// the corresponding announcement, if the requesting user is not permitted + /// to delete the requested course or for access errors. + /// * `FAILED_PRECONDITION` if the requested announcement has already been + /// deleted. + /// * `NOT_FOUND` if no course exists with the requested ID. + /// + /// # Arguments + /// + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the announcement to delete. + /// This identifier is a Classroom-assigned identifier. + pub fn announcements_delete(&self, course_id: &str, id: &str) -> CourseAnnouncementDeleteCall<'a, C, A> { + CourseAnnouncementDeleteCall { + hub: self.hub, + _course_id: course_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2873,6 +3516,7 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _student_id: student_id.to_string(), _guardian_id: guardian_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -2920,6 +3564,46 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _request: request, _student_id: student_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a guardian. + /// + /// The guardian will no longer receive guardian notifications and the guardian + /// will no longer be accessible via the API. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if no user that matches the provided `student_id` + /// is visible to the requesting user, if the requesting user is not + /// permitted to manage guardians for the student identified by the + /// `student_id`, if guardians are not enabled for the domain in question, + /// or for other access errors. + /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + /// be recognized (it is not an email address, nor a `student_id` from the + /// API). + /// * `NOT_FOUND` if the requesting user is permitted to modify guardians for + /// the requested `student_id`, but no `Guardian` record exists for that + /// student with the provided `guardian_id`. + /// + /// # Arguments + /// + /// * `studentId` - The student whose guardian is to be deleted. One of the following: + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// * `guardianId` - The `id` field from a `Guardian`. + pub fn guardians_delete(&self, student_id: &str, guardian_id: &str) -> UserProfileGuardianDeleteCall<'a, C, A> { + UserProfileGuardianDeleteCall { + hub: self.hub, + _student_id: student_id.to_string(), + _guardian_id: guardian_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -2985,6 +3669,7 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _invitation_id: invitation_id.to_string(), _update_mask: Default::default(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -3016,6 +3701,7 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _student_id: student_id.to_string(), _invitation_id: invitation_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -3060,6 +3746,7 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _page_size: Default::default(), _invited_email_address: Default::default(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -3102,44 +3789,114 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _page_size: Default::default(), _invited_email_address: Default::default(), _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *registration* resources. +/// It is not used directly, but through the `Classroom` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_classroom1 as classroom1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use classroom1::Classroom; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)` and `delete(...)` +/// // to build up your call. +/// let rb = hub.registrations(); +/// # } +/// ``` +pub struct RegistrationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, +} + +impl<'a, C, A> MethodsBuilder for RegistrationMethods<'a, C, A> {} + +impl<'a, C, A> RegistrationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a `Registration`, causing Classroom to start sending notifications + /// from the provided `feed` to the provided `destination`. + /// + /// Returns the created `Registration`. Currently, this will be the same as + /// the argument, but with server-assigned fields such as `expiry_time` and + /// `id` filled in. + /// + /// Note that any value specified for the `expiry_time` or `id` fields will be + /// ignored. + /// + /// While Classroom may validate the `destination` and return errors on a best + /// effort basis, it is the caller's responsibility to ensure that it exists + /// and that Classroom has permission to publish to it. + /// + /// This method may return the following error codes: + /// + /// * `PERMISSION_DENIED` if: + /// * the authenticated user does not have permission to receive + /// notifications from the requested field; or + /// * the credential provided does not include the appropriate scope for the + /// requested feed. + /// * another access error is encountered. + /// * `INVALID_ARGUMENT` if: + /// * no `destination` is specified, or the specified `destination` is not + /// valid; or + /// * no `feed` is specified, or the specified `feed` is not valid. + /// * `NOT_FOUND` if: + /// * the specified `feed` cannot be located, or the requesting user does not + /// have permission to determine whether or not it exists; or + /// * the specified `destination` cannot be located, or Classroom has not + /// been granted permission to publish to it. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Registration) -> RegistrationCreateCall<'a, C, A> { + RegistrationCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } /// Create a builder to help you perform the following task: /// - /// Deletes a guardian. - /// - /// The guardian will no longer receive guardian notifications and the guardian - /// will no longer be accessible via the API. - /// - /// This method returns the following error codes: - /// - /// * `PERMISSION_DENIED` if no user that matches the provided `student_id` - /// is visible to the requesting user, if the requesting user is not - /// permitted to manage guardians for the student identified by the - /// `student_id`, if guardians are not enabled for the domain in question, - /// or for other access errors. - /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot - /// be recognized (it is not an email address, nor a `student_id` from the - /// API). - /// * `NOT_FOUND` if the requesting user is permitted to modify guardians for - /// the requested `student_id`, but no `Guardian` record exists for that - /// student with the provided `guardian_id`. + /// Deletes a `Registration`, causing Classroom to stop sending notifications + /// for that `Registration`. /// /// # Arguments /// - /// * `studentId` - The student whose guardian is to be deleted. One of the following: - /// * the numeric identifier for the user - /// * the email address of the user - /// * the string literal `"me"`, indicating the requesting user - /// * `guardianId` - The `id` field from a `Guardian`. - pub fn guardians_delete(&self, student_id: &str, guardian_id: &str) -> UserProfileGuardianDeleteCall<'a, C, A> { - UserProfileGuardianDeleteCall { + /// * `registrationId` - The `registration_id` of the `Registration` to be deleted. + pub fn delete(&self, registration_id: &str) -> RegistrationDeleteCall<'a, C, A> { + RegistrationDeleteCall { hub: self.hub, - _student_id: student_id.to_string(), - _guardian_id: guardian_id.to_string(), + _registration_id: registration_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -3323,6 +4080,310 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { // CallBuilders ### // ################# +/// Modifies assignee mode and options of an announcement. +/// +/// Only a teacher of the course that contains the announcement may +/// call this method. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course or course work does not exist. +/// +/// A builder for the *announcements.modifyAssignees* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// use classroom1::ModifyAnnouncementAssigneesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ModifyAnnouncementAssigneesRequest::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.courses().announcements_modify_assignees(req, "courseId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CourseAnnouncementModifyAssigneeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _request: ModifyAnnouncementAssigneesRequest, + _course_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseAnnouncementModifyAssigneeCall<'a, C, A> {} + +impl<'a, C, A> CourseAnnouncementModifyAssigneeCall<'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, Announcement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.announcements.modifyAssignees", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "id"].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 = self.hub._base_url.clone() + "v1/courses/{courseId}/announcements/{id}:modifyAssignees"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Announcement.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].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 ["id", "courseId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ModifyAnnouncementAssigneesRequest) -> CourseAnnouncementModifyAssigneeCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseAnnouncementModifyAssigneeCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the announcement. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CourseAnnouncementModifyAssigneeCall<'a, C, A> { + self._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) -> CourseAnnouncementModifyAssigneeCall<'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) -> CourseAnnouncementModifyAssigneeCall<'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::Announcement`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseAnnouncementModifyAssigneeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates one or more fields of a student submission. /// /// See google.classroom.v1.StudentSubmission for details @@ -3374,7 +4435,7 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.courses().course_work_student_submissions_patch(req, "courseId", "courseWorkId", "id") -/// .update_mask("et") +/// .update_mask("ipsum") /// .doit(); /// # } /// ``` @@ -3591,6 +4652,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor /// fields are specified. /// /// The following fields may be specified by teachers: + /// /// * `draft_grade` /// * `assigned_grade` /// @@ -3619,17 +4681,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> @@ -3664,22 +4726,19 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor } -/// Returns a list of student submissions that the requester is permitted to -/// view, factoring in the OAuth scopes of the request. -/// `-` may be specified as the `course_work_id` to include student -/// submissions for multiple course work items. +/// Returns a list of announcements that the requester is permitted to view. /// -/// Course students may only view their own work. Course teachers -/// and domain administrators may view all student submissions. +/// Course students may only view `PUBLISHED` announcements. Course teachers +/// and domain administrators may view all announcements. /// /// This method returns the following error codes: /// -/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the -/// requested course or course work, or for access errors. +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access +/// the requested course or for access errors. /// * `INVALID_ARGUMENT` if the request is malformed. /// * `NOT_FOUND` if the requested course does not exist. /// -/// A builder for the *courseWork.studentSubmissions.list* method supported by a *course* resource. +/// A builder for the *announcements.list* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. /// /// # Example @@ -3704,38 +4763,35 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor /// // 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.courses().course_work_student_submissions_list("courseId", "courseWorkId") -/// .user_id("Lorem") -/// .add_states("et") -/// .page_token("duo") -/// .page_size(-32) -/// .late("sea") +/// let result = hub.courses().announcements_list("courseId") +/// .page_token("et") +/// .page_size(-70) +/// .order_by("aliquyam") +/// .add_announcement_states("sea") /// .doit(); /// # } /// ``` -pub struct CourseCourseWorkStudentSubmissionListCall<'a, C, A> +pub struct CourseAnnouncementListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, _course_id: String, - _course_work_id: String, - _user_id: Option, - _states: Vec, _page_token: Option, _page_size: Option, - _late: Option, + _order_by: Option, + _announcement_states: Vec, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CourseCourseWorkStudentSubmissionListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for CourseAnnouncementListCall<'a, C, A> {} -impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> CourseAnnouncementListCall<'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, ListStudentSubmissionsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAnnouncementsResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -3743,29 +4799,25 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.courses.courseWork.studentSubmissions.list", + dlg.begin(MethodInfo { id: "classroom.courses.announcements.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("courseId", self._course_id.to_string())); - params.push(("courseWorkId", self._course_work_id.to_string())); - if let Some(value) = self._user_id { - params.push(("userId", value.to_string())); - } - if self._states.len() > 0 { - for f in self._states.iter() { - params.push(("states", f.to_string())); - } - } if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } if let Some(value) = self._page_size { params.push(("pageSize", value.to_string())); } - if let Some(value) = self._late { - params.push(("late", value.to_string())); + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); } - for &field in ["alt", "courseId", "courseWorkId", "userId", "states", "pageToken", "pageSize", "late"].iter() { + if self._announcement_states.len() > 0 { + for f in self._announcement_states.iter() { + params.push(("announcementStates", f.to_string())); + } + } + for &field in ["alt", "courseId", "pageToken", "pageSize", "orderBy", "announcementStates"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3777,12 +4829,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions"; + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/announcements"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::AnnouncementReadonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{courseId}", "courseId"), ("{courseWorkId}", "courseWorkId")].iter() { + for &(find_this, param_name) in [("{courseId}", "courseId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -3793,8 +4845,8 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr 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 ["courseWorkId", "courseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["courseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -3888,44 +4940,10 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn course_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + pub fn course_id(mut self, new_value: &str) -> CourseAnnouncementListCall<'a, C, A> { self._course_id = new_value.to_string(); self } - /// Identifer of the student work to request. - /// This may be set to the string literal `"-"` to request student work for - /// all course work in the specified course. - /// - /// Sets the *course work 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 course_work_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { - self._course_work_id = new_value.to_string(); - self - } - /// Optional argument to restrict returned student work to those owned by the - /// student with the specified identifier. The identifier can be one of the - /// following: - /// - /// * the numeric identifier for the user - /// * the email address of the user - /// * the string literal `"me"`, indicating the requesting user - /// - /// Sets the *user id* query property to the given value. - pub fn user_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { - self._user_id = Some(new_value.to_string()); - self - } - /// Requested submission states. If specified, returned student submissions - /// match one of the specified submission states. - /// - /// Append the given value to the *states* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_states(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { - self._states.push(new_value.to_string()); - self - } /// nextPageToken /// value returned from a previous /// list call, @@ -3935,7 +4953,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// must be otherwise identical to the one that resulted in this token. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> CourseAnnouncementListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } @@ -3945,17 +4963,28 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> CourseAnnouncementListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Requested lateness value. If specified, returned student submissions are - /// restricted by the requested value. - /// If unspecified, submissions are returned regardless of `late` value. + /// Optional sort ordering for results. A comma-separated list of fields with + /// an optional sort direction keyword. Supported field is `updateTime`. + /// Supported direction keywords are `asc` and `desc`. + /// If not specified, `updateTime desc` is the default behavior. + /// Examples: `updateTime asc`, `updateTime` /// - /// Sets the *late* query property to the given value. - pub fn late(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { - self._late = Some(new_value.to_string()); + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> CourseAnnouncementListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Restriction on the `state` of announcements returned. + /// If this argument is left unspecified, the default value is `PUBLISHED`. + /// + /// Append the given value to the *announcement states* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_announcement_states(mut self, new_value: &str) -> CourseAnnouncementListCall<'a, C, A> { + self._announcement_states.push(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -3964,7 +4993,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// 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) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CourseAnnouncementListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3978,20 +5007,20 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> CourseAnnouncementListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4000,7 +5029,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// 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::CourseworkMeReadonly`. + /// `Scope::AnnouncementReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -4011,7 +5040,333 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// 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) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> CourseAnnouncementListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reclaims a student submission on behalf of the student that owns it. +/// +/// Reclaiming a student submission transfers ownership of attached Drive +/// files to the student and update the submission state. +/// +/// Only the student that owns the requested student submission may call this +/// method, and only for a student submission that has been turned in. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work, unsubmit the requested student submission, +/// or for access errors. +/// * `FAILED_PRECONDITION` if the student submission has not been turned in. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. +/// +/// A builder for the *courseWork.studentSubmissions.reclaim* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// use classroom1::ReclaimStudentSubmissionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ReclaimStudentSubmissionRequest::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.courses().course_work_student_submissions_reclaim(req, "courseId", "courseWorkId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _request: ReclaimStudentSubmissionRequest, + _course_id: String, + _course_work_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> {} + +impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.courseWork.studentSubmissions.reclaim", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("courseWorkId", self._course_work_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "courseWorkId", "id"].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 = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{courseWorkId}", "courseWorkId"), ("{id}", "id")].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 ["id", "courseWorkId", "courseId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ReclaimStudentSubmissionRequest) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the course work. + /// + /// Sets the *course work 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 course_work_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + self._course_work_id = new_value.to_string(); + self + } + /// Identifier of the student submission. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + self._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) -> CourseCourseWorkStudentSubmissionReclaimCall<'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) -> CourseCourseWorkStudentSubmissionReclaimCall<'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::CourseworkMe`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4235,17 +5590,17 @@ impl<'a, C, A> CourseGetCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseGetCall<'a, C, A> @@ -4525,17 +5880,17 @@ impl<'a, C, A> CourseUpdateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseUpdateCall<'a, C, A> @@ -4800,17 +6155,17 @@ impl<'a, C, A> CourseStudentGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseStudentGetCall<'a, C, A> @@ -5075,17 +6430,17 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseTeacherGetCall<'a, C, A> @@ -5158,10 +6513,10 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.courses().course_work_list("courseId") -/// .page_token("amet") -/// .page_size(-60) -/// .order_by("labore") -/// .add_course_work_states("eirmod") +/// .page_token("eirmod") +/// .page_size(-33) +/// .order_by("invidunt") +/// .add_course_work_states("aliquyam") /// .doit(); /// # } /// ``` @@ -5402,17 +6757,17 @@ impl<'a, C, A> CourseCourseWorkListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkListCall<'a, C, A> @@ -5672,17 +7027,17 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkGetCall<'a, C, A> @@ -5717,6 +7072,365 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.courses().course_work_student_submissions_list("courseId", "courseWorkId") +/// .user_id("duo") +/// .add_states("et") +/// .page_token("eirmod") +/// .page_size(-58) +/// .late("et") +/// .doit(); +/// # } +/// ``` +pub struct CourseCourseWorkStudentSubmissionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _course_work_id: String, + _user_id: Option, + _states: Vec, + _page_token: Option, + _page_size: Option, + _late: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseCourseWorkStudentSubmissionListCall<'a, C, A> {} + +impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'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, ListStudentSubmissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.courseWork.studentSubmissions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("courseWorkId", self._course_work_id.to_string())); + if let Some(value) = self._user_id { + params.push(("userId", value.to_string())); + } + if self._states.len() > 0 { + for f in self._states.iter() { + params.push(("states", f.to_string())); + } + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._late { + params.push(("late", value.to_string())); + } + for &field in ["alt", "courseId", "courseWorkId", "userId", "states", "pageToken", "pageSize", "late"].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 = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{courseWorkId}", "courseWorkId")].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 ["courseWorkId", "courseId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the student work to request. + /// This may be set to the string literal `"-"` to request student work for + /// all course work in the specified course. + /// + /// Sets the *course work 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 course_work_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._course_work_id = new_value.to_string(); + self + } + /// Optional argument to restrict returned student work to those owned by the + /// student with the specified identifier. The identifier can be one of the + /// following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// + /// Sets the *user id* query property to the given value. + pub fn user_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._user_id = Some(new_value.to_string()); + self + } + /// Requested submission states. If specified, returned student submissions + /// match one of the specified submission states. + /// + /// Append the given value to the *states* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_states(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._states.push(new_value.to_string()); + self + } + /// nextPageToken + /// value returned from a previous + /// list call, + /// indicating that the subsequent page of results should be returned. + /// + /// The list request + /// must be otherwise identical to the one that resulted in this token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Requested lateness value. If specified, returned student submissions are + /// restricted by the requested value. + /// If unspecified, submissions are returned regardless of `late` value. + /// + /// Sets the *late* query property to the given value. + pub fn late(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { + self._late = 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) -> CourseCourseWorkStudentSubmissionListCall<'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) -> CourseCourseWorkStudentSubmissionListCall<'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::CourseworkMeReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Turns in a student submission. /// /// Turning in a student submission transfers ownership of attached Drive @@ -5997,17 +7711,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> @@ -6320,17 +8034,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> @@ -6365,6 +8079,276 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w } +/// Returns an announcement. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or announcement, or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course or announcement does not exist. +/// +/// A builder for the *announcements.get* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.courses().announcements_get("courseId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CourseAnnouncementGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseAnnouncementGetCall<'a, C, A> {} + +impl<'a, C, A> CourseAnnouncementGetCall<'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, Announcement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.announcements.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "id"].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 = self.hub._base_url.clone() + "v1/courses/{courseId}/announcements/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::AnnouncementReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].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 ["id", "courseId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseAnnouncementGetCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the announcement. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CourseAnnouncementGetCall<'a, C, A> { + self._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) -> CourseAnnouncementGetCall<'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) -> CourseAnnouncementGetCall<'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::AnnouncementReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseAnnouncementGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns a list of teachers of this course that the requester /// is permitted to view. /// @@ -6399,8 +8383,8 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.courses().teachers_list("courseId") -/// .page_token("eirmod") -/// .page_size(-58) +/// .page_token("et") +/// .page_size(-96) /// .doit(); /// # } /// ``` @@ -6609,17 +8593,17 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseTeacherListCall<'a, C, A> @@ -6936,17 +8920,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> @@ -7015,8 +8999,8 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.courses().aliases_list("courseId") -/// .page_token("ut") -/// .page_size(-16) +/// .page_token("justo") +/// .page_size(-52) /// .doit(); /// # } /// ``` @@ -7226,17 +9210,17 @@ impl<'a, C, A> CourseAliaseListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseAliaseListCall<'a, C, A> @@ -7525,17 +9509,17 @@ impl<'a, C, A> CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkCreateCall<'a, C, A> @@ -7571,7 +9555,8 @@ impl<'a, C, A> CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseListCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseListCall<'a, C, A> @@ -7876,29 +9861,19 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Reclaims a student submission on behalf of the student that owns it. -/// -/// Reclaiming a student submission transfers ownership of attached Drive -/// files to the student and update the submission state. -/// -/// Only the student that owns the requested student submission may call this -/// method, and only for a student submission that has been turned in. -/// -/// This request must be made by the Developer Console project of the -/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to -/// create the corresponding course work item. +/// Creates an announcement. /// /// This method returns the following error codes: /// /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the -/// requested course or course work, unsubmit the requested student submission, -/// or for access errors. -/// * `FAILED_PRECONDITION` if the student submission has not been turned in. +/// requested course, create announcements in the requested course, share a +/// Drive attachment, or for access errors. /// * `INVALID_ARGUMENT` if the request is malformed. -/// * `NOT_FOUND` if the requested course, course work, or student submission -/// does not exist. +/// * `NOT_FOUND` if the requested course does not exist. +/// * `FAILED_PRECONDITION` for the following request error: +/// * AttachmentNotVisible /// -/// A builder for the *courseWork.studentSubmissions.reclaim* method supported by a *course* resource. +/// A builder for the *announcements.create* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. /// /// # Example @@ -7910,7 +9885,7 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_classroom1 as classroom1; -/// use classroom1::ReclaimStudentSubmissionRequest; +/// use classroom1::Announcement; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -7924,35 +9899,33 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa /// // 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 = ReclaimStudentSubmissionRequest::default(); +/// let mut req = Announcement::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.courses().course_work_student_submissions_reclaim(req, "courseId", "courseWorkId", "id") +/// let result = hub.courses().announcements_create(req, "courseId") /// .doit(); /// # } /// ``` -pub struct CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> +pub struct CourseAnnouncementCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, - _request: ReclaimStudentSubmissionRequest, + _request: Announcement, _course_id: String, - _course_work_id: String, - _id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for CourseAnnouncementCreateCall<'a, C, A> {} -impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> CourseAnnouncementCreateCall<'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, Announcement)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -7960,13 +9933,11 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.courses.courseWork.studentSubmissions.reclaim", + dlg.begin(MethodInfo { id: "classroom.courses.announcements.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("courseId", self._course_id.to_string())); - params.push(("courseWorkId", self._course_work_id.to_string())); - params.push(("id", self._id.to_string())); - for &field in ["alt", "courseId", "courseWorkId", "id"].iter() { + for &field in ["alt", "courseId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7978,12 +9949,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim"; + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/announcements"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); + self._scopes.insert(Scope::Announcement.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{courseId}", "courseId"), ("{courseWorkId}", "courseWorkId"), ("{id}", "id")].iter() { + for &(find_this, param_name) in [("{courseId}", "courseId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -7994,8 +9965,8 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B 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 ["id", "courseWorkId", "courseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["courseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8101,7 +10072,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B /// /// 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: ReclaimStudentSubmissionRequest) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + pub fn request(mut self, new_value: Announcement) -> CourseAnnouncementCreateCall<'a, C, A> { self._request = new_value; self } @@ -8113,37 +10084,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn course_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + pub fn course_id(mut self, new_value: &str) -> CourseAnnouncementCreateCall<'a, C, A> { self._course_id = new_value.to_string(); self } - /// Identifier of the course work. - /// - /// Sets the *course work 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 course_work_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { - self._course_work_id = new_value.to_string(); - self - } - /// Identifier of the student submission. - /// - /// Sets the *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 id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { - self._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) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CourseAnnouncementCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8157,20 +10108,20 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> CourseAnnouncementCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8179,7 +10130,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B /// 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::CourseworkMe`. + /// `Scope::Announcement`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -8190,7 +10141,334 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B /// 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) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> CourseAnnouncementCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates one or more fields of an announcement. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting developer project did not create +/// the corresponding announcement or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `FAILED_PRECONDITION` if the requested announcement has already been +/// deleted. +/// * `NOT_FOUND` if the requested course or announcement does not exist +/// +/// A builder for the *announcements.patch* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// use classroom1::Announcement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Announcement::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.courses().announcements_patch(req, "courseId", "id") +/// .update_mask("dolore") +/// .doit(); +/// # } +/// ``` +pub struct CourseAnnouncementPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _request: Announcement, + _course_id: String, + _id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseAnnouncementPatchCall<'a, C, A> {} + +impl<'a, C, A> CourseAnnouncementPatchCall<'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, Announcement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.announcements.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "courseId", "id", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/announcements/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Announcement.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].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 ["id", "courseId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Announcement) -> CourseAnnouncementPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseAnnouncementPatchCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the announcement. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CourseAnnouncementPatchCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// Mask that identifies which fields on the announcement to update. + /// This field is required to do an update. The update fails if invalid + /// fields are specified. If a field supports empty values, it can be cleared + /// by specifying it in the update mask and not in the Announcement object. If + /// a field that does not support empty values is included in the update mask + /// and not set in the Announcement object, an `INVALID_ARGUMENT` error will be + /// returned. + /// + /// The following fields may be specified by teachers: + /// + /// * `text` + /// * `state` + /// * `scheduled_time` + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> CourseAnnouncementPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CourseAnnouncementPatchCall<'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) -> CourseAnnouncementPatchCall<'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::Announcement`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseAnnouncementPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8449,17 +10727,17 @@ impl<'a, C, A> CourseAliaseCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAliaseCreateCall<'a, C, A> @@ -8541,7 +10819,7 @@ impl<'a, C, A> CourseAliaseCreateCall<'a, C, A> where C: BorrowMut CourseStudentCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseStudentCreateCall<'a, C, A> @@ -8804,6 +11082,310 @@ impl<'a, C, A> CourseStudentCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ModifyCourseWorkAssigneesRequest::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.courses().course_work_modify_assignees(req, "courseId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CourseCourseWorkModifyAssigneeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _request: ModifyCourseWorkAssigneesRequest, + _course_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseCourseWorkModifyAssigneeCall<'a, C, A> {} + +impl<'a, C, A> CourseCourseWorkModifyAssigneeCall<'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, CourseWork)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.courseWork.modifyAssignees", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "id"].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 = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{id}:modifyAssignees"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CourseworkStudent.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].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 ["id", "courseId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ModifyCourseWorkAssigneesRequest) -> CourseCourseWorkModifyAssigneeCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseCourseWorkModifyAssigneeCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the coursework. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CourseCourseWorkModifyAssigneeCall<'a, C, A> { + self._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) -> CourseCourseWorkModifyAssigneeCall<'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) -> CourseCourseWorkModifyAssigneeCall<'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::CourseworkStudent`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseCourseWorkModifyAssigneeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes an alias of a course. /// /// This method returns the following error codes: @@ -9032,17 +11614,17 @@ impl<'a, C, A> CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAliaseDeleteCall<'a, C, A> @@ -9309,17 +11891,17 @@ impl<'a, C, A> CourseCourseWorkDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkDeleteCall<'a, C, A> @@ -9570,17 +12152,17 @@ impl<'a, C, A> CourseCreateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCreateCall<'a, C, A> @@ -9649,8 +12231,8 @@ impl<'a, C, A> CourseCreateCall<'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.courses().students_list("courseId") -/// .page_token("vero") -/// .page_size(-95) +/// .page_token("takimata") +/// .page_size(-27) /// .doit(); /// # } /// ``` @@ -9859,17 +12441,17 @@ impl<'a, C, A> CourseStudentListCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseStudentListCall<'a, C, A> @@ -10116,17 +12698,17 @@ impl<'a, C, A> CourseDeleteCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseDeleteCall<'a, C, A> @@ -10214,7 +12796,7 @@ impl<'a, C, A> CourseDeleteCall<'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.courses().course_work_patch(req, "courseId", "id") -/// .update_mask("duo") +/// .update_mask("sadipscing") /// .doit(); /// # } /// ``` @@ -10423,12 +13005,14 @@ impl<'a, C, A> CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkPatchCall<'a, C, A> @@ -10545,7 +13129,7 @@ impl<'a, C, A> CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut CoursePatchCall<'a, C, A> where C: BorrowMut, A: o /// * `description` /// * `room` /// * `courseState` + /// * `ownerId` + /// + /// Note: patches to ownerId are treated as being effective immediately, but in + /// practice it may take some time for the ownership transfer of all affected + /// resources to complete. /// /// When set in a query parameter, this field should be specified as /// @@ -10773,17 +13362,17 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CoursePatchCall<'a, C, A> @@ -11048,17 +13637,17 @@ impl<'a, C, A> CourseStudentDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseStudentDeleteCall<'a, C, A> @@ -11325,17 +13914,17 @@ impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseTeacherDeleteCall<'a, C, A> @@ -11621,17 +14210,17 @@ impl<'a, C, A> CourseTeacherCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseTeacherCreateCall<'a, C, A> @@ -11903,17 +14492,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> where C: Borro /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> @@ -11948,6 +14537,283 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> where C: Borro } +/// Deletes an announcement. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding announcement item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting developer project did not create +/// the corresponding announcement, if the requesting user is not permitted +/// to delete the requested course or for access errors. +/// * `FAILED_PRECONDITION` if the requested announcement has already been +/// deleted. +/// * `NOT_FOUND` if no course exists with the requested ID. +/// +/// A builder for the *announcements.delete* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.courses().announcements_delete("courseId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CourseAnnouncementDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseAnnouncementDeleteCall<'a, C, A> {} + +impl<'a, C, A> CourseAnnouncementDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.announcements.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "id"].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 = self.hub._base_url.clone() + "v1/courses/{courseId}/announcements/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Announcement.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].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 ["id", "courseId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course 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 course_id(mut self, new_value: &str) -> CourseAnnouncementDeleteCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the announcement to delete. + /// This identifier is a Classroom-assigned identifier. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CourseAnnouncementDeleteCall<'a, C, A> { + self._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) -> CourseAnnouncementDeleteCall<'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) -> CourseAnnouncementDeleteCall<'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::Announcement`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CourseAnnouncementDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns a specific guardian. /// /// This method returns the following error codes: @@ -12001,6 +14867,7 @@ pub struct UserProfileGuardianGetCall<'a, C, A> _guardian_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserProfileGuardianGetCall<'a, C, A> {} @@ -12035,17 +14902,8 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkMeReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{studentId}", "studentId"), ("{guardianId}", "guardianId")].iter() { @@ -12078,10 +14936,24 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -12176,17 +15048,17 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianGetCall<'a, C, A> @@ -12195,6 +15067,29 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> UserProfileGuardianGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -12272,6 +15167,7 @@ pub struct UserProfileGuardianInvitationCreateCall<'a, C, A> _student_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserProfileGuardianInvitationCreateCall<'a, C, A> {} @@ -12305,17 +15201,8 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkStudent.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{studentId}", "studentId")].iter() { @@ -12359,11 +15246,25 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow 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(Bearer { 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); @@ -12456,17 +15357,17 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> UserProfileGuardianInvitationCreateCall<'a, C, A> @@ -12475,6 +15376,311 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow 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::GuardianlinkStudent`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileGuardianInvitationCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a guardian. +/// +/// The guardian will no longer receive guardian notifications and the guardian +/// will no longer be accessible via the API. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if no user that matches the provided `student_id` +/// is visible to the requesting user, if the requesting user is not +/// permitted to manage guardians for the student identified by the +/// `student_id`, if guardians are not enabled for the domain in question, +/// or for other access errors. +/// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot +/// be recognized (it is not an email address, nor a `student_id` from the +/// API). +/// * `NOT_FOUND` if the requesting user is permitted to modify guardians for +/// the requested `student_id`, but no `Guardian` record exists for that +/// student with the provided `guardian_id`. +/// +/// A builder for the *guardians.delete* method supported by a *userProfile* resource. +/// It is not used directly, but through a `UserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_profiles().guardians_delete("studentId", "guardianId") +/// .doit(); +/// # } +/// ``` +pub struct UserProfileGuardianDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _student_id: String, + _guardian_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserProfileGuardianDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserProfileGuardianDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.userProfiles.guardians.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("studentId", self._student_id.to_string())); + params.push(("guardianId", self._guardian_id.to_string())); + for &field in ["alt", "studentId", "guardianId"].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 = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardians/{guardianId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkStudent.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{studentId}", "studentId"), ("{guardianId}", "guardianId")].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 ["guardianId", "studentId"].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(Bearer { 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(d); + 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(d); + 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 student whose guardian is to be deleted. One of the following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// + /// Sets the *student 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 student_id(mut self, new_value: &str) -> UserProfileGuardianDeleteCall<'a, C, A> { + self._student_id = new_value.to_string(); + self + } + /// The `id` field from a `Guardian`. + /// + /// Sets the *guardian 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 guardian_id(mut self, new_value: &str) -> UserProfileGuardianDeleteCall<'a, C, A> { + self._guardian_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) -> UserProfileGuardianDeleteCall<'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) -> UserProfileGuardianDeleteCall<'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::GuardianlinkStudent`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileGuardianDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -12693,17 +15899,17 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> UserProfileGetCall<'a, C, A> @@ -12789,7 +15995,7 @@ impl<'a, C, A> UserProfileGetCall<'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.user_profiles().guardian_invitations_patch(req, "studentId", "invitationId") -/// .update_mask("dolore") +/// .update_mask("sit") /// .doit(); /// # } /// ``` @@ -12803,6 +16009,7 @@ pub struct UserProfileGuardianInvitationPatchCall<'a, C, A> _update_mask: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserProfileGuardianInvitationPatchCall<'a, C, A> {} @@ -12840,17 +16047,8 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkStudent.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{studentId}", "studentId"), ("{invitationId}", "invitationId")].iter() { @@ -12894,11 +16092,25 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM 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(Bearer { 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); @@ -13016,17 +16228,17 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> UserProfileGuardianInvitationPatchCall<'a, C, A> @@ -13035,6 +16247,29 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM 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::GuardianlinkStudent`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileGuardianInvitationPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -13090,6 +16325,7 @@ pub struct UserProfileGuardianInvitationGetCall<'a, C, A> _invitation_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserProfileGuardianInvitationGetCall<'a, C, A> {} @@ -13124,17 +16360,8 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkStudentReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{studentId}", "studentId"), ("{invitationId}", "invitationId")].iter() { @@ -13167,10 +16394,24 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut 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(Bearer { 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(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -13261,17 +16502,17 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> UserProfileGuardianInvitationGetCall<'a, C, A> @@ -13280,6 +16521,29 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut 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::GuardianlinkStudentReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileGuardianInvitationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -13330,9 +16594,9 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.user_profiles().guardians_list("studentId") -/// .page_token("sit") -/// .page_size(-40) -/// .invited_email_address("consetetur") +/// .page_token("est") +/// .page_size(-46) +/// .invited_email_address("accusam") /// .doit(); /// # } /// ``` @@ -13346,6 +16610,7 @@ pub struct UserProfileGuardianListCall<'a, C, A> _invited_email_address: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserProfileGuardianListCall<'a, C, A> {} @@ -13388,17 +16653,8 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkMeReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{studentId}", "studentId")].iter() { @@ -13431,10 +16687,24 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -13554,17 +16824,17 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianListCall<'a, C, A> @@ -13573,6 +16843,29 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> UserProfileGuardianListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -13619,10 +16912,10 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut _invited_email_address: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserProfileGuardianInvitationListCall<'a, C, A> {} @@ -13684,17 +16978,8 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::GuardianlinkStudentReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{studentId}", "studentId")].iter() { @@ -13727,10 +17012,24 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu 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(Bearer { 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(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -13859,17 +17158,17 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> UserProfileGuardianInvitationListCall<'a, C, A> @@ -13878,30 +17177,66 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu 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::GuardianlinkStudentReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileGuardianInvitationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } -/// Deletes a guardian. +/// Creates a `Registration`, causing Classroom to start sending notifications +/// from the provided `feed` to the provided `destination`. /// -/// The guardian will no longer receive guardian notifications and the guardian -/// will no longer be accessible via the API. +/// Returns the created `Registration`. Currently, this will be the same as +/// the argument, but with server-assigned fields such as `expiry_time` and +/// `id` filled in. /// -/// This method returns the following error codes: +/// Note that any value specified for the `expiry_time` or `id` fields will be +/// ignored. /// -/// * `PERMISSION_DENIED` if no user that matches the provided `student_id` -/// is visible to the requesting user, if the requesting user is not -/// permitted to manage guardians for the student identified by the -/// `student_id`, if guardians are not enabled for the domain in question, -/// or for other access errors. -/// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot -/// be recognized (it is not an email address, nor a `student_id` from the -/// API). -/// * `NOT_FOUND` if the requesting user is permitted to modify guardians for -/// the requested `student_id`, but no `Guardian` record exists for that -/// student with the provided `guardian_id`. +/// While Classroom may validate the `destination` and return errors on a best +/// effort basis, it is the caller's responsibility to ensure that it exists +/// and that Classroom has permission to publish to it. +/// +/// This method may return the following error codes: +/// +/// * `PERMISSION_DENIED` if: +/// * the authenticated user does not have permission to receive +/// notifications from the requested field; or +/// * the credential provided does not include the appropriate scope for the +/// requested feed. +/// * another access error is encountered. +/// * `INVALID_ARGUMENT` if: +/// * no `destination` is specified, or the specified `destination` is not +/// valid; or +/// * no `feed` is specified, or the specified `feed` is not valid. +/// * `NOT_FOUND` if: +/// * the specified `feed` cannot be located, or the requesting user does not +/// have permission to determine whether or not it exists; or +/// * the specified `destination` cannot be located, or Classroom has not +/// been granted permission to publish to it. /// -/// A builder for the *guardians.delete* method supported by a *userProfile* resource. -/// It is not used directly, but through a `UserProfileMethods` instance. +/// A builder for the *create* method supported by a *registration* resource. +/// It is not used directly, but through a `RegistrationMethods` instance. /// /// # Example /// @@ -13912,6 +17247,7 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_classroom1 as classroom1; +/// use classroom1::Registration; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -13922,30 +17258,35 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Registration::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.user_profiles().guardians_delete("studentId", "guardianId") +/// let result = hub.registrations().create(req) /// .doit(); /// # } /// ``` -pub struct UserProfileGuardianDeleteCall<'a, C, A> +pub struct RegistrationCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, - _student_id: String, - _guardian_id: String, + _request: Registration, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserProfileGuardianDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegistrationCreateCall<'a, C, A> {} -impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegistrationCreateCall<'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, Registration)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -13953,12 +17294,10 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.userProfiles.guardians.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("studentId", self._student_id.to_string())); - params.push(("guardianId", self._guardian_id.to_string())); - for &field in ["alt", "studentId", "guardianId"].iter() { + dlg.begin(MethodInfo { id: "classroom.registrations.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)); @@ -13970,54 +17309,53 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + let mut url = self.hub._base_url.clone() + "v1/registrations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{studentId}", "studentId"), ("{guardianId}", "guardianId")].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 ["guardianId", "studentId"].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).expect("serde to work"); + 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(Bearer { 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::Delete, &url) - .header(UserAgent(self.hub._user_agent.clone())); + 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() @@ -14068,28 +17406,13 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut UserProfileGuardianDeleteCall<'a, C, A> { - self._student_id = new_value.to_string(); - self - } - /// The `id` field from a `Guardian`. - /// - /// Sets the *guardian 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 guardian_id(mut self, new_value: &str) -> UserProfileGuardianDeleteCall<'a, C, A> { - self._guardian_id = new_value.to_string(); + pub fn request(mut self, new_value: Registration) -> RegistrationCreateCall<'a, C, A> { + self._request = new_value; self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -14098,7 +17421,7 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut UserProfileGuardianDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RegistrationCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14112,25 +17435,298 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegistrationCreateCall<'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::Roster`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RegistrationCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a `Registration`, causing Classroom to stop sending notifications +/// for that `Registration`. +/// +/// A builder for the *delete* method supported by a *registration* resource. +/// It is not used directly, but through a `RegistrationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use classroom1::Classroom; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.registrations().delete("registrationId") +/// .doit(); +/// # } +/// ``` +pub struct RegistrationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _registration_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegistrationDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegistrationDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.registrations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("registrationId", self._registration_id.to_string())); + for &field in ["alt", "registrationId"].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 = self.hub._base_url.clone() + "v1/registrations/{registrationId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{registrationId}", "registrationId")].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 ["registrationId"].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(Bearer { 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(d); + 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(d); + 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 `registration_id` of the `Registration` to be deleted. + /// + /// Sets the *registration 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 registration_id(mut self, new_value: &str) -> RegistrationDeleteCall<'a, C, A> { + self._registration_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) -> RegistrationDeleteCall<'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) -> RegistrationDeleteCall<'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::Roster`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RegistrationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -14344,17 +17940,17 @@ impl<'a, C, A> InvitationDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> InvitationDeleteCall<'a, C, A> @@ -14602,17 +18198,17 @@ impl<'a, C, A> InvitationCreateCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> InvitationCreateCall<'a, C, A> @@ -14683,10 +18279,10 @@ impl<'a, C, A> InvitationCreateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.invitations().list() -/// .user_id("labore") -/// .page_token("ipsum") -/// .page_size(-31) -/// .course_id("dolores") +/// .user_id("dolores") +/// .page_token("eos") +/// .page_size(-78) +/// .course_id("duo") /// .doit(); /// # } /// ``` @@ -14888,17 +18484,17 @@ impl<'a, C, A> InvitationListCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> InvitationListCall<'a, C, A> @@ -15143,17 +18739,17 @@ impl<'a, C, A> InvitationGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> InvitationGetCall<'a, C, A> @@ -15405,17 +19001,17 @@ impl<'a, C, A> InvitationAcceptCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> InvitationAcceptCall<'a, C, A> diff --git a/gen/cloudbilling1-cli/Cargo.toml b/gen/cloudbilling1-cli/Cargo.toml index f891776d63..98ad6c108d 100644 --- a/gen/cloudbilling1-cli/Cargo.toml +++ b/gen/cloudbilling1-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-cloudbilling1-cli" -version = "1.0.6+20170504" +version = "1.0.6+20170813" authors = ["Sebastian Thiel "] -description = "A complete library to interact with cloudbilling (protocol v1)" +description = "A complete library to interact with Cloudbilling (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1-cli" homepage = "https://cloud.google.com/billing/" documentation = "http://byron.github.io/google-apis-rs/google_cloudbilling1_cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-cloudbilling1] path = "../cloudbilling1" -version = "1.0.6+20170504" +version = "1.0.6+20170813" diff --git a/gen/cloudbilling1-cli/README.md b/gen/cloudbilling1-cli/README.md index fa2e229c0f..0dac45ef3b 100644 --- a/gen/cloudbilling1-cli/README.md +++ b/gen/cloudbilling1-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `cloudbilling1` command-line interface *(CLI)* allows to use most features of the *Google cloudbilling* service from the comfort of your terminal. +The `cloudbilling1` command-line interface *(CLI)* allows to use most features of the *Google Cloudbilling* 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 *cloudbilling* API can be found at the +Everything else about the *Cloudbilling* API can be found at the [official documentation site](https://cloud.google.com/billing/). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *cloudbilling* API at revision *20170504*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloudbilling* API at revision *20170813*. The CLI is at version *1.0.6*. ```bash cloudbilling1 [options] @@ -36,6 +36,9 @@ cloudbilling1 [options] projects get-billing-info [-p ]... [-o ] update-billing-info (-r )... [-p ]... [-o ] + services + list [-p ]... [-o ] + skus-list [-p ]... [-o ] cloudbilling1 --help Configuration: diff --git a/gen/cloudbilling1-cli/mkdocs.yml b/gen/cloudbilling1-cli/mkdocs.yml index c51a493b23..8d5f0c108c 100644 --- a/gen/cloudbilling1-cli/mkdocs.yml +++ b/gen/cloudbilling1-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: cloudbilling v1.0.6+20170504 +site_name: Cloudbilling v1.0.6+20170813 site_url: http://byron.github.io/google-apis-rs/google-cloudbilling1-cli -site_description: A complete library to interact with cloudbilling (protocol v1) +site_description: A complete library to interact with Cloudbilling (protocol v1) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1-cli @@ -14,6 +14,8 @@ pages: - ['billing-accounts_projects-list.md', 'Billing Accounts', 'Projects List'] - ['projects_get-billing-info.md', 'Projects', 'Get Billing Info'] - ['projects_update-billing-info.md', 'Projects', 'Update Billing Info'] +- ['services_list.md', 'Services', 'List'] +- ['services_skus-list.md', 'Services', 'Skus List'] theme: readthedocs diff --git a/gen/cloudbilling1-cli/src/main.rs b/gen/cloudbilling1-cli/src/main.rs index 52ff996edd..2d486c94d6 100644 --- a/gen/cloudbilling1-cli/src/main.rs +++ b/gen/cloudbilling1-cli/src/main.rs @@ -356,6 +356,127 @@ impl<'n> Engine<'n> { } } + fn _services_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().list(); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["page-token", "page-size"].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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_skus_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().skus_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "start-time" => { + call = call.start_time(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "end-time" => { + call = call.end_time(value.unwrap_or("")); + }, + "currency-code" => { + call = call.currency_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(["page-token", "currency-code", "end-time", "page-size", "start-time"].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).expect("serde to work"); + 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(()); @@ -392,6 +513,20 @@ impl<'n> Engine<'n> { } } }, + ("services", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._services_list(opt, dry_run, &mut err); + }, + ("skus-list", Some(opt)) => { + call_result = self._services_skus_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("services".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -636,11 +771,53 @@ fn main() { ]), ]), + ("services", "methods: 'list' and 'skus-list'", vec![ + ("list", + Some(r##"Lists all public cloud services."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/services_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)), + ]), + ("skus-list", + Some(r##"Lists all publicly available SKUs for a given cloud service."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/services_skus-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the service. + Example: "services/DA34-426B-A397""##), + 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("cloudbilling1") .author("Sebastian Thiel ") - .version("1.0.6+20170504") + .version("1.0.6+20170813") .about("Allows developers to manage billing for their Google Cloud Platform projects programmatically.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli") diff --git a/gen/cloudbilling1/Cargo.toml b/gen/cloudbilling1/Cargo.toml index 677e2e76b9..1a723c4d1c 100644 --- a/gen/cloudbilling1/Cargo.toml +++ b/gen/cloudbilling1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudbilling1" -version = "1.0.6+20170504" +version = "1.0.6+20170813" authors = ["Sebastian Thiel "] -description = "A complete library to interact with cloudbilling (protocol v1)" +description = "A complete library to interact with Cloudbilling (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1" homepage = "https://cloud.google.com/billing/" -documentation = "https://docs.rs/google-cloudbilling1/1.0.6+20170504" +documentation = "https://docs.rs/google-cloudbilling1/1.0.6+20170813" license = "MIT" keywords = ["cloudbilling", "google", "protocol", "web", "api"] diff --git a/gen/cloudbilling1/README.md b/gen/cloudbilling1/README.md index 0a77749b70..9d7169907d 100644 --- a/gen/cloudbilling1/README.md +++ b/gen/cloudbilling1/README.md @@ -3,20 +3,22 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-cloudbilling1` library allows access to all features of the *Google cloudbilling* service. +The `google-cloudbilling1` library allows access to all features of the *Google Cloudbilling* service. -This documentation was generated from *cloudbilling* crate version *1.0.6+20170504*, where *20170504* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Cloudbilling* crate version *1.0.6+20170813*, where *20170813* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. -Everything else about the *cloudbilling* *v1* API can be found at the +Everything else about the *Cloudbilling* *v1* API can be found at the [official documentation site](https://cloud.google.com/billing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.Cloudbilling.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.Cloudbilling.html) ... -* [billing accounts](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.BillingAccount.html) - * [*get*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.BillingAccountGetCall.html), [*list*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.BillingAccountListCall.html) and [*projects list*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.BillingAccountProjectListCall.html) +* [billing accounts](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.BillingAccount.html) + * [*get*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.BillingAccountGetCall.html), [*list*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.BillingAccountListCall.html) and [*projects list*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.BillingAccountProjectListCall.html) * projects - * [*get billing info*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.ProjectGetBillingInfoCall.html) and [*update billing info*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.ProjectUpdateBillingInfoCall.html) + * [*get billing info*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.ProjectGetBillingInfoCall.html) and [*update billing info*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.ProjectUpdateBillingInfoCall.html) +* [services](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.Service.html) + * [*list*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.ServiceListCall.html) and [*skus list*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.ServiceSkuListCall.html) @@ -25,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/struct.Cloudbilling.html)** +* **[Hub](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/struct.Cloudbilling.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -122,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/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")`. @@ -142,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/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](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/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](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/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](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/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](https://docs.rs/google-cloudbilling1/1.0.6+20170504/google_cloudbilling1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudbilling1/1.0.6+20170813/google_cloudbilling1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudbilling1/src/lib.rs b/gen/cloudbilling1/src/lib.rs index 5ec73dbec8..476095278b 100644 --- a/gen/cloudbilling1/src/lib.rs +++ b/gen/cloudbilling1/src/lib.rs @@ -2,9 +2,9 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *cloudbilling* crate version *1.0.6+20170504*, where *20170504* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Cloudbilling* crate version *1.0.6+20170813*, where *20170813* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! -//! Everything else about the *cloudbilling* *v1* API can be found at the +//! Everything else about the *Cloudbilling* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/billing/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1). //! # Features @@ -15,6 +15,8 @@ //! * [*get*](struct.BillingAccountGetCall.html), [*list*](struct.BillingAccountListCall.html) and [*projects list*](struct.BillingAccountProjectListCall.html) //! * projects //! * [*get billing info*](struct.ProjectGetBillingInfoCall.html) and [*update billing info*](struct.ProjectUpdateBillingInfoCall.html) +//! * [services](struct.Service.html) +//! * [*list*](struct.ServiceListCall.html) and [*skus list*](struct.ServiceSkuListCall.html) //! //! //! @@ -331,6 +333,9 @@ impl<'a, C, A> Cloudbilling pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } + pub fn services(&'a self) -> ServiceMethods<'a, C, A> { + ServiceMethods { hub: &self } + } /// Set the user-agent header field to use in all requests to the server. /// It defaults to `google-api-rust-client/1.0.6`. @@ -361,6 +366,299 @@ impl<'a, C, A> Cloudbilling // ############ // SCHEMAS ### // ########## +/// Encapsulates a single SKU in Google Cloud Platform +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Sku { + /// Identifies the service provider. + /// This is 'Google' for first party services in Google Cloud Platform. + #[serde(rename="serviceProviderName")] + pub service_provider_name: Option, + /// The identifier for the SKU. + /// Example: "AA95-CD31-42FE" + #[serde(rename="skuId")] + pub sku_id: Option, + /// The resource name for the SKU. + /// Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE" + pub name: Option, + /// List of service regions this SKU is offered at. + /// Example: "asia-east1" + /// Service regions can be found at https://cloud.google.com/about/locations/ + #[serde(rename="serviceRegions")] + pub service_regions: Option>, + /// A timeline of pricing info for this SKU in chronological order. + #[serde(rename="pricingInfo")] + pub pricing_info: Option>, + /// The category hierarchy of this SKU, purely for organizational purpose. + pub category: Option, + /// A human readable description of the SKU, has a maximum length of 256 + /// characters. + pub description: Option, +} + +impl Part for Sku {} + + +/// Represents the category hierarchy of a SKU. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Category { + /// A group classification for related SKUs. + /// Example: "RAM", "GPU", "Prediction", "Ops", "GoogleEgress" etc. + #[serde(rename="resourceGroup")] + pub resource_group: Option, + /// The type of product the SKU refers to. + /// Example: "Compute", "Storage", "Network", "ApplicationServices" etc. + #[serde(rename="resourceFamily")] + pub resource_family: Option, + /// Represents how the SKU is consumed. + /// Example: "OnDemand", "Preemptible", "Commit1Mo", "Commit1Yr" etc. + #[serde(rename="usageType")] + pub usage_type: Option, + /// The display name of the service this SKU belongs to. + #[serde(rename="serviceDisplayName")] + pub service_display_name: Option, +} + +impl Part for Category {} + + +/// Response message for `ListSkus`. +/// +/// # 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*). +/// +/// * [skus list services](struct.ServiceSkuListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSkusResponse { + /// A token to retrieve the next page of results. To retrieve the next page, + /// call `ListSkus` again with the `page_token` field set to this + /// value. This field is empty if there are no more results to retrieve. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of public SKUs of the given service. + pub skus: Option>, +} + +impl ResponseResult for ListSkusResponse {} + + +/// Encapsulates a single service in Google Cloud Platform. +/// +/// # 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 services](struct.ServiceListCall.html) (none) +/// * [skus list services](struct.ServiceSkuListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Service { + /// The identifier for the service. + /// Example: "DA34-426B-A397" + #[serde(rename="serviceId")] + pub service_id: Option, + /// A human readable display name for this service. + #[serde(rename="displayName")] + pub display_name: Option, + /// The resource name for the service. + /// Example: "services/DA34-426B-A397" + pub name: Option, +} + +impl Resource for Service {} + + +/// Represents an amount of money with its currency 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 Money { + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + pub units: Option, + /// Number of nano (10^-9) units of the amount. + /// The value must be between -999,999,999 and +999,999,999 inclusive. + /// If `units` is positive, `nanos` must be positive or zero. + /// If `units` is zero, `nanos` can be positive, zero, or negative. + /// If `units` is negative, `nanos` must be negative or zero. + /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + pub nanos: Option, + /// The 3-letter currency code defined in ISO 4217. + #[serde(rename="currencyCode")] + pub currency_code: Option, +} + +impl Part for Money {} + + +/// The price rate indicating starting usage and its corresponding price. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TierRate { + /// The price per unit of usage. + /// Example: unit_price of amount $10 indicates that each unit will cost $10. + #[serde(rename="unitPrice")] + pub unit_price: Option, + /// Usage is priced at this rate only after this amount. + /// Example: start_usage_amount of 10 indicates that the usage will be priced + /// at the unit_price after the first 10 usage_units. + #[serde(rename="startUsageAmount")] + pub start_usage_amount: Option, +} + +impl Part for TierRate {} + + +/// Response message for `ListBillingAccounts`. +/// +/// # 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 billing accounts](struct.BillingAccountListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListBillingAccountsResponse { + /// A token to retrieve the next page of results. To retrieve the next page, + /// call `ListBillingAccounts` again with the `page_token` field set to this + /// value. This field is empty if there are no more results to retrieve. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of billing accounts. + #[serde(rename="billingAccounts")] + pub billing_accounts: Option>, +} + +impl ResponseResult for ListBillingAccountsResponse {} + + +/// A billing account in [Google Cloud +/// Console](https://console.cloud.google.com/). You can assign a billing account +/// to one or more projects. +/// +/// # 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 billing accounts](struct.BillingAccountGetCall.html) (response) +/// * [list billing accounts](struct.BillingAccountListCall.html) (none) +/// * [projects list billing accounts](struct.BillingAccountProjectListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BillingAccount { + /// The display name given to the billing account, such as `My Billing + /// Account`. This name is displayed in the Google Cloud Console. + #[serde(rename="displayName")] + pub display_name: Option, + /// True if the billing account is open, and will therefore be charged for any + /// usage on associated projects. False if the billing account is closed, and + /// therefore projects associated with it will be unable to use paid services. + pub open: Option, + /// The resource name of the billing account. The resource name has the form + /// `billingAccounts/{billing_account_id}`. For example, + /// `billingAccounts/012345-567890-ABCDEF` would be the resource name for + /// billing account `012345-567890-ABCDEF`. + pub name: Option, +} + +impl Resource for BillingAccount {} +impl ResponseResult for BillingAccount {} + + +/// Expresses a mathematical pricing formula. For Example:- +/// +/// `usage_unit: GBy` +/// `tiered_rates:` +/// `[start_usage_amount: 20, unit_price: $10]` +/// `[start_usage_amount: 100, unit_price: $5]` +/// +/// The above expresses a pricing formula where the first 20GB is free, the +/// next 80GB is priced at $10 per GB followed by $5 per GB for additional +/// usage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PricingExpression { + /// Conversion factor for converting from price per usage_unit to price per + /// base_unit, and start_usage_amount to start_usage_amount in base_unit. + /// unit_price / base_unit_conversion_factor = price per base_unit. + /// start_usage_amount * base_unit_conversion_factor = start_usage_amount in + /// base_unit. + #[serde(rename="baseUnitConversionFactor")] + pub base_unit_conversion_factor: Option, + /// The recommended quantity of units for displaying pricing info. When + /// displaying pricing info it is recommended to display: + /// (unit_price * display_quantity) per display_quantity usage_unit. + /// This field does not affect the pricing formula and is for display purposes + /// only. + /// Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and + /// the display_quantity is "1000" then the recommended way of displaying the + /// pricing info is "0.10 USD per 1000 GB" + #[serde(rename="displayQuantity")] + pub display_quantity: Option, + /// The base unit for the SKU which is the unit used in usage exports. + /// Example: "By" + #[serde(rename="baseUnit")] + pub base_unit: Option, + /// The unit of usage in human readable form. + /// Example: "gibi byte". + #[serde(rename="usageUnitDescription")] + pub usage_unit_description: Option, + /// The base unit in human readable form. + /// Example: "byte". + #[serde(rename="baseUnitDescription")] + pub base_unit_description: Option, + /// The short hand for unit of usage this pricing is specified in. + /// Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". + #[serde(rename="usageUnit")] + pub usage_unit: Option, + /// The list of tiered rates for this pricing. The total cost is computed by + /// applying each of the tiered rates on usage. This repeated list is sorted + /// by ascending order of start_usage_amount. + #[serde(rename="tieredRates")] + pub tiered_rates: Option>, +} + +impl Part for PricingExpression {} + + +/// Represents the aggregation level and interval for pricing of a single SKU. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AggregationInfo { + /// no description provided + #[serde(rename="aggregationLevel")] + pub aggregation_level: Option, + /// The number of intervals to aggregate over. + /// Example: If aggregation_level is "DAILY" and aggregation_count is 14, + /// aggregation will be over 14 days. + #[serde(rename="aggregationCount")] + pub aggregation_count: Option, + /// no description provided + #[serde(rename="aggregationInterval")] + pub aggregation_interval: Option, +} + +impl Part for AggregationInfo {} + + /// Encapsulation of billing information for a Cloud Console project. A project /// has at most one associated billing account at a time (but a billing account /// can be assigned to multiple projects). @@ -426,62 +724,56 @@ pub struct ListProjectBillingInfoResponse { impl ResponseResult for ListProjectBillingInfoResponse {} -/// A billing account in [Google Cloud -/// Console](https://console.cloud.google.com/). You can assign a billing account -/// to one or more projects. +/// Response message for `ListServices`. /// /// # 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 billing accounts](struct.BillingAccountGetCall.html) (response) -/// * [list billing accounts](struct.BillingAccountListCall.html) (none) -/// * [projects list billing accounts](struct.BillingAccountProjectListCall.html) (none) +/// * [list services](struct.ServiceListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BillingAccount { - /// The display name given to the billing account, such as `My Billing - /// Account`. This name is displayed in the Google Cloud Console. - #[serde(rename="displayName")] - pub display_name: Option, - /// True if the billing account is open, and will therefore be charged for any - /// usage on associated projects. False if the billing account is closed, and - /// therefore projects associated with it will be unable to use paid services. - pub open: Option, - /// The resource name of the billing account. The resource name has the form - /// `billingAccounts/{billing_account_id}`. For example, - /// `billingAccounts/012345-567890-ABCDEF` would be the resource name for - /// billing account `012345-567890-ABCDEF`. - pub name: Option, -} - -impl Resource for BillingAccount {} -impl ResponseResult for BillingAccount {} - - -/// Response message for `ListBillingAccounts`. -/// -/// # 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 billing accounts](struct.BillingAccountListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListBillingAccountsResponse { +pub struct ListServicesResponse { /// A token to retrieve the next page of results. To retrieve the next page, - /// call `ListBillingAccounts` again with the `page_token` field set to this + /// call `ListServices` again with the `page_token` field set to this /// value. This field is empty if there are no more results to retrieve. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A list of billing accounts. - #[serde(rename="billingAccounts")] - pub billing_accounts: Option>, + /// A list of services. + pub services: Option>, } -impl ResponseResult for ListBillingAccountsResponse {} +impl ResponseResult for ListServicesResponse {} + + +/// Represents the pricing information for a SKU at a single point of time. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PricingInfo { + /// Conversion rate for currency conversion, from USD to the currency specified + /// in the request. If the currency is not specified this defaults to 1.0. + /// Example: USD * currency_conversion_rate = JPY + #[serde(rename="currencyConversionRate")] + pub currency_conversion_rate: Option, + /// The timestamp from which this pricing was effective. + #[serde(rename="effectiveTime")] + pub effective_time: Option, + /// Aggregation Info. This can be left unspecified if the pricing expression + /// doesn't require aggregation. + #[serde(rename="aggregationInfo")] + pub aggregation_info: Option, + /// Expresses the pricing formula. See `PricingExpression` for an example. + #[serde(rename="pricingExpression")] + pub pricing_expression: Option, + /// An optional human readable summary of the pricing information, has a + /// maximum length of 256 characters. + pub summary: Option, +} + +impl Part for PricingInfo {} @@ -489,6 +781,83 @@ impl ResponseResult for ListBillingAccountsResponse {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *service* resources. +/// It is not used directly, but through the `Cloudbilling` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudbilling1 as cloudbilling1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudbilling1::Cloudbilling; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` and `skus_list(...)` +/// // to build up your call. +/// let rb = hub.services(); +/// # } +/// ``` +pub struct ServiceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudbilling, +} + +impl<'a, C, A> MethodsBuilder for ServiceMethods<'a, C, A> {} + +impl<'a, C, A> ServiceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all public cloud services. + pub fn list(&self) -> ServiceListCall<'a, C, A> { + ServiceListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all publicly available SKUs for a given cloud service. + /// + /// # Arguments + /// + /// * `parent` - The name of the service. + /// Example: "services/DA34-426B-A397" + pub fn skus_list(&self, parent: &str) -> ServiceSkuListCall<'a, C, A> { + ServiceSkuListCall { + hub: self.hub, + _parent: parent.to_string(), + _start_time: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _end_time: Default::default(), + _currency_code: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *billingAccount* resources. /// It is not used directly, but through the `Cloudbilling` hub. /// @@ -528,6 +897,21 @@ impl<'a, C, A> MethodsBuilder for BillingAccountMethods<'a, C, A> {} impl<'a, C, A> BillingAccountMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Lists the billing accounts that the current authenticated user + /// [owns](https://support.google.com/cloud/answer/4430947). + pub fn list(&self) -> BillingAccountListCall<'a, C, A> { + BillingAccountListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: 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 billing account. The current authenticated user @@ -548,21 +932,6 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists the billing accounts that the current authenticated user - /// [owns](https://support.google.com/cloud/answer/4430947). - pub fn list(&self) -> BillingAccountListCall<'a, C, A> { - BillingAccountListCall { - hub: self.hub, - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the projects associated with a billing account. The current @@ -627,27 +996,6 @@ 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: - /// - /// Gets the billing information for a project. The current authenticated user - /// must have [permission to view the - /// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo - /// ). - /// - /// # Arguments - /// - /// * `name` - The resource name of the project for which billing information is - /// retrieved. For example, `projects/tokyo-rain-123`. - pub fn get_billing_info(&self, name: &str) -> ProjectGetBillingInfoCall<'a, C, A> { - ProjectGetBillingInfoCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Sets or updates the billing account associated with a project. You specify @@ -697,6 +1045,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Gets the billing information for a project. The current authenticated user + /// must have [permission to view the + /// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + /// ). + /// + /// # Arguments + /// + /// * `name` - The resource name of the project for which billing information is + /// retrieved. For example, `projects/tokyo-rain-123`. + pub fn get_billing_info(&self, name: &str) -> ProjectGetBillingInfoCall<'a, C, A> { + ProjectGetBillingInfoCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -707,6 +1076,760 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# +/// Lists all public cloud services. +/// +/// A builder for the *list* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudbilling1 as cloudbilling1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudbilling1::Cloudbilling; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.services().list() +/// .page_token("justo") +/// .page_size(-1) +/// .doit(); +/// # } +/// ``` +pub struct ServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudbilling, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ServiceListCall<'a, C, A> {} + +impl<'a, C, A> ServiceListCall<'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, ListServicesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudbilling.services.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + 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())); + } + for &field in ["alt", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/services"; + + 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) + } + } + + + 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(d); + 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(d); + 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 token identifying a page of results to return. This should be a + /// `next_page_token` value returned from a previous `ListServices` + /// call. If unspecified, the first page of results is returned. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ServiceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. Defaults to 5000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ServiceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ServiceListCall<'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) -> ServiceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists all publicly available SKUs for a given cloud service. +/// +/// A builder for the *skus.list* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudbilling1 as cloudbilling1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudbilling1::Cloudbilling; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.services().skus_list("parent") +/// .start_time("labore") +/// .page_token("sea") +/// .page_size(-90) +/// .end_time("dolores") +/// .currency_code("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ServiceSkuListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudbilling, + _parent: String, + _start_time: Option, + _page_token: Option, + _page_size: Option, + _end_time: Option, + _currency_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ServiceSkuListCall<'a, C, A> {} + +impl<'a, C, A> ServiceSkuListCall<'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, ListSkusResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudbilling.services.skus.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._start_time { + params.push(("startTime", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._end_time { + params.push(("endTime", value.to_string())); + } + if let Some(value) = self._currency_code { + params.push(("currencyCode", value.to_string())); + } + for &field in ["alt", "parent", "startTime", "pageToken", "pageSize", "endTime", "currencyCode"].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 = self.hub._base_url.clone() + "v1/{+parent}/skus"; + + 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 [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the service. + /// Example: "services/DA34-426B-A397" + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ServiceSkuListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional inclusive start time of the time range for which the pricing + /// versions will be returned. Timestamps in the future are not allowed. + /// Maximum allowable time range is 1 month (31 days). Time range as a whole + /// is optional. If not specified, the latest pricing will be returned (up to + /// 12 hours old at most). + /// + /// Sets the *start time* query property to the given value. + pub fn start_time(mut self, new_value: &str) -> ServiceSkuListCall<'a, C, A> { + self._start_time = Some(new_value.to_string()); + self + } + /// A token identifying a page of results to return. This should be a + /// `next_page_token` value returned from a previous `ListSkus` + /// call. If unspecified, the first page of results is returned. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ServiceSkuListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. Defaults to 5000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ServiceSkuListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional exclusive end time of the time range for which the pricing + /// versions will be returned. Timestamps in the future are not allowed. + /// Maximum allowable time range is 1 month (31 days). Time range as a whole + /// is optional. If not specified, the latest pricing will be returned (up to + /// 12 hours old at most). + /// + /// Sets the *end time* query property to the given value. + pub fn end_time(mut self, new_value: &str) -> ServiceSkuListCall<'a, C, A> { + self._end_time = Some(new_value.to_string()); + self + } + /// The ISO 4217 currency code for the pricing info in the response proto. + /// Will use the conversion rate as of start_time. + /// Optional. If not specified USD will be used. + /// + /// Sets the *currency code* query property to the given value. + pub fn currency_code(mut self, new_value: &str) -> ServiceSkuListCall<'a, C, A> { + self._currency_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) -> ServiceSkuListCall<'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) -> ServiceSkuListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists the billing accounts that the current authenticated user +/// [owns](https://support.google.com/cloud/answer/4430947). +/// +/// A builder for the *list* method supported by a *billingAccount* resource. +/// It is not used directly, but through a `BillingAccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudbilling1 as cloudbilling1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudbilling1::Cloudbilling; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.billing_accounts().list() +/// .page_token("sadipscing") +/// .page_size(-31) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudbilling, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountListCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountListCall<'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, ListBillingAccountsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudbilling.billingAccounts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + 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())); + } + for &field in ["alt", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/billingAccounts"; + 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(Bearer { 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(d); + 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(d); + 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 token identifying a page of results to return. This should be a + /// `next_page_token` value returned from a previous `ListBillingAccounts` + /// call. If unspecified, the first page of results is returned. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> BillingAccountListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. The maximum page size is 100; this is also the + /// default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> BillingAccountListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BillingAccountListCall<'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) -> BillingAccountListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets information about a billing account. The current authenticated user /// must be an [owner of the billing /// account](https://support.google.com/cloud/answer/4430947). @@ -963,250 +2086,6 @@ impl<'a, C, A> BillingAccountGetCall<'a, C, A> where C: BorrowMut } -/// Lists the billing accounts that the current authenticated user -/// [owns](https://support.google.com/cloud/answer/4430947). -/// -/// A builder for the *list* method supported by a *billingAccount* resource. -/// It is not used directly, but through a `BillingAccountMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_cloudbilling1 as cloudbilling1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use cloudbilling1::Cloudbilling; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.billing_accounts().list() -/// .page_token("amet.") -/// .page_size(-81) -/// .doit(); -/// # } -/// ``` -pub struct BillingAccountListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Cloudbilling, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for BillingAccountListCall<'a, C, A> {} - -impl<'a, C, A> BillingAccountListCall<'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, ListBillingAccountsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "cloudbilling.billingAccounts.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + 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())); - } - for &field in ["alt", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/billingAccounts"; - 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(Bearer { 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(d); - 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(d); - 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 token identifying a page of results to return. This should be a - /// `next_page_token` value returned from a previous `ListBillingAccounts` - /// call. If unspecified, the first page of results is returned. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> BillingAccountListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Requested page size. The maximum page size is 100; this is also the - /// default. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> BillingAccountListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> BillingAccountListCall<'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) -> BillingAccountListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> BillingAccountListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the projects associated with a billing account. The current /// authenticated user must be an [owner of the billing /// account](https://support.google.com/cloud/answer/4430947). @@ -1237,8 +2116,8 @@ impl<'a, C, A> BillingAccountListCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_billing_info("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGetBillingInfoCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Cloudbilling, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGetBillingInfoCall<'a, C, A> {} - -impl<'a, C, A> ProjectGetBillingInfoCall<'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, ProjectBillingInfo)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "cloudbilling.projects.getBillingInfo", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}/billingInfo"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 resource name of the project for which billing information is - /// retrieved. For example, `projects/tokyo-rain-123`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectGetBillingInfoCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetBillingInfoCall<'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) -> ProjectGetBillingInfoCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectGetBillingInfoCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets or updates the billing account associated with a project. You specify /// the new billing account by setting the `billing_account_name` in the /// `ProjectBillingInfo` resource to the resource name of a billing account. @@ -2062,3 +2684,260 @@ impl<'a, C, A> ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Cloudbilling::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_billing_info("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetBillingInfoCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudbilling, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetBillingInfoCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetBillingInfoCall<'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, ProjectBillingInfo)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudbilling.projects.getBillingInfo", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/billingInfo"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the project for which billing information is + /// retrieved. For example, `projects/tokyo-rain-123`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectGetBillingInfoCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetBillingInfoCall<'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) -> ProjectGetBillingInfoCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectGetBillingInfoCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/clouddebugger2-cli/Cargo.toml b/gen/clouddebugger2-cli/Cargo.toml index 4065954449..4928a9c6fa 100644 --- a/gen/clouddebugger2-cli/Cargo.toml +++ b/gen/clouddebugger2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-clouddebugger2-cli" -version = "1.0.6+20170413" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Debugger (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouddebugger2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-clouddebugger2] path = "../clouddebugger2" -version = "1.0.6+20170413" +version = "1.0.6+20170919" diff --git a/gen/clouddebugger2-cli/README.md b/gen/clouddebugger2-cli/README.md index 034c7e95d7..57ccd52f01 100644 --- a/gen/clouddebugger2-cli/README.md +++ b/gen/clouddebugger2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Debugger* API at revision *20170413*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Debugger* API at revision *20170919*. The CLI is at version *1.0.6*. ```bash clouddebugger2 [options] diff --git a/gen/clouddebugger2-cli/mkdocs.yml b/gen/clouddebugger2-cli/mkdocs.yml index 5d6e0dbe07..4324b19321 100644 --- a/gen/clouddebugger2-cli/mkdocs.yml +++ b/gen/clouddebugger2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Debugger v1.0.6+20170413 +site_name: Cloud Debugger v1.0.6+20170919 site_url: http://byron.github.io/google-apis-rs/google-clouddebugger2-cli site_description: A complete library to interact with Cloud Debugger (protocol v2) diff --git a/gen/clouddebugger2-cli/src/main.rs b/gen/clouddebugger2-cli/src/main.rs index b7b8a22a90..ae391374fd 100644 --- a/gen/clouddebugger2-cli/src/main.rs +++ b/gen/clouddebugger2-cli/src/main.rs @@ -128,10 +128,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "breakpoint.status.is-error" => Some(("breakpoint.status.isError", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "breakpoint.status.refers-to" => Some(("breakpoint.status.refersTo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.status.description.parameters" => Some(("breakpoint.status.description.parameters", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "breakpoint.status.description.format" => Some(("breakpoint.status.description.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "breakpoint.status.refers-to" => Some(("breakpoint.status.refersTo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "breakpoint.status.is-error" => Some(("breakpoint.status.isError", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "breakpoint.user-email" => Some(("breakpoint.userEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.log-message-format" => Some(("breakpoint.logMessageFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.log-level" => Some(("breakpoint.logLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -229,10 +229,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "debuggee.status.is-error" => Some(("debuggee.status.isError", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "debuggee.status.refers-to" => Some(("debuggee.status.refersTo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "debuggee.status.description.parameters" => Some(("debuggee.status.description.parameters", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "debuggee.status.description.format" => Some(("debuggee.status.description.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "debuggee.status.refers-to" => Some(("debuggee.status.refersTo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "debuggee.status.is-error" => Some(("debuggee.status.isError", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "debuggee.description" => Some(("debuggee.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "debuggee.is-disabled" => Some(("debuggee.isDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "debuggee.labels" => Some(("debuggee.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -508,10 +508,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "status.is-error" => Some(("status.isError", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.refers-to" => Some(("status.refersTo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.description.parameters" => Some(("status.description.parameters", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.description.format" => Some(("status.description.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.refers-to" => Some(("status.refersTo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.is-error" => Some(("status.isError", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-email" => Some(("userEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "log-message-format" => Some(("logMessageFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "log-level" => Some(("logLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -787,7 +787,7 @@ fn main() { ("debuggees-breakpoints-list", Some(r##"Returns the list of all active breakpoints for the debuggee. - The breakpoint specification (location, condition, and expression + The breakpoint specification (`location`, `condition`, and `expressions` fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line where the breakpoint was set, but this @@ -820,12 +820,11 @@ fn main() { ]), ("debuggees-breakpoints-update", Some(r##"Updates the breakpoint state or mutable fields. - The entire Breakpoint message must be sent back to the controller - service. + The entire Breakpoint message must be sent back to the controller service. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the `location`, - `condition` and `expression` fields should not alter the breakpoint + `condition` and `expressions` fields should not alter the breakpoint semantics. These may only make changes such as canonicalizing a value or snapping the location to the correct line of code."##), "Details at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli/controller_debuggees-breakpoints-update", @@ -863,14 +862,14 @@ fn main() { ("debuggees-register", Some(r##"Registers the debuggee with the controller service. - All agents attached to the same application should call this method with - the same request content to get back the same stable `debuggee_id`. Agents - should call this method again whenever `google.rpc.Code.NOT_FOUND` is - returned from any controller method. + All agents attached to the same application must call this method with + exactly the same request content to get back the same stable `debuggee_id`. + Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` + is returned from any controller method. - This allows the controller service to disable the agent or recover from any - data loss. If the debuggee is disabled by the server, the response will - have `is_disabled` set to `true`."##), + This protocol allows the controller service to disable debuggees, recover + from data loss, or change the `debuggee_id` format. Agents must handle + `debuggee_id` value changing upon re-registration."##), "Details at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli/controller_debuggees-register", vec![ (Some(r##"kv"##), @@ -1001,7 +1000,7 @@ fn main() { Some(false)), ]), ("debuggees-list", - Some(r##"Lists all the debuggees that the user can set breakpoints to."##), + Some(r##"Lists all the debuggees that the user has access to."##), "Details at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli/debugger_debuggees-list", vec![ (Some(r##"v"##), @@ -1022,7 +1021,7 @@ fn main() { let mut app = App::new("clouddebugger2") .author("Sebastian Thiel ") - .version("1.0.6+20170413") + .version("1.0.6+20170919") .about("Examines the call stack and variables of a running application without stopping or slowing it down. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli") diff --git a/gen/clouddebugger2/Cargo.toml b/gen/clouddebugger2/Cargo.toml index 876adf62cf..5dd64e4ff8 100644 --- a/gen/clouddebugger2/Cargo.toml +++ b/gen/clouddebugger2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-clouddebugger2" -version = "1.0.6+20170413" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Debugger (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouddebugger2" homepage = "http://cloud.google.com/debugger" -documentation = "https://docs.rs/google-clouddebugger2/1.0.6+20170413" +documentation = "https://docs.rs/google-clouddebugger2/1.0.6+20170919" license = "MIT" keywords = ["clouddebugger", "google", "protocol", "web", "api"] diff --git a/gen/clouddebugger2/README.md b/gen/clouddebugger2/README.md index 4ae8bd7576..6f8495c95c 100644 --- a/gen/clouddebugger2/README.md +++ b/gen/clouddebugger2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-clouddebugger2` library allows access to all features of the *Google Cloud Debugger* service. -This documentation was generated from *Cloud Debugger* crate version *1.0.6+20170413*, where *20170413* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Cloud Debugger* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Cloud Debugger* *v2* API can be found at the [official documentation site](http://cloud.google.com/debugger). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.CloudDebugger.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.CloudDebugger.html) ... * controller - * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) + * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) * debugger - * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.DebuggerDebuggeeListCall.html) + * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.DebuggerDebuggeeListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/struct.CloudDebugger.html)** +* **[Hub](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/struct.CloudDebugger.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.Part.html)** + * **[Parts](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -125,17 +125,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/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")`. @@ -145,29 +145,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/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](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/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](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/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](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/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](https://docs.rs/google-clouddebugger2/1.0.6+20170413/google_clouddebugger2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/clouddebugger2/src/lib.rs b/gen/clouddebugger2/src/lib.rs index aa384657ff..42192429bc 100644 --- a/gen/clouddebugger2/src/lib.rs +++ b/gen/clouddebugger2/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 Debugger* crate version *1.0.6+20170413*, where *20170413* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Cloud Debugger* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Cloud Debugger* *v2* API can be found at the //! [official documentation site](http://cloud.google.com/debugger). @@ -407,7 +407,7 @@ pub struct ListBreakpointsResponse { /// List of breakpoints matching the request. /// The fields `id` and `location` are guaranteed to be set on each breakpoint. /// The fields: `stack_frames`, `evaluated_expressions` and `variable_table` - /// are cleared on each breakpoint regardless of it's status. + /// are cleared on each breakpoint regardless of its status. pub breakpoints: Option>, } @@ -440,14 +440,14 @@ impl Part for CloudWorkspaceSourceContext {} pub struct StackFrame { /// Demangled function name at the call site. pub function: Option, - /// Set of arguments passed to this function. - /// Note that this might not be populated for all stack frames. - pub arguments: Option>, + /// Source location of the call site. + pub location: Option, /// Set of local variables at the stack frame location. /// Note that this might not be populated for all stack frames. pub locals: Option>, - /// Source location of the call site. - pub location: Option, + /// Set of arguments passed to this function. + /// Note that this might not be populated for all stack frames. + pub arguments: Option>, } impl Part for StackFrame {} @@ -465,10 +465,9 @@ impl Part for StackFrame {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListDebuggeesResponse { /// List of debuggees accessible to the calling user. - /// Note that the `description` field is the only human readable field - /// that should be displayed to the user. - /// The fields `debuggee.id` and `description` fields are guaranteed to be - /// set on each debuggee. + /// The fields `debuggee.id` and `description` are guaranteed to be set. + /// The `description` field is a human readable field provided by agents and + /// can be displayed to users. pub debuggees: Option>, } @@ -555,11 +554,12 @@ impl Part for AliasContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListActiveBreakpointsResponse { - /// The `wait_expired` field is set to true by the server when the - /// request times out and the field `success_on_timeout` is set to true. + /// If set to `true`, indicates that there is no change to the + /// list of active breakpoints and the server-selected timeout has expired. + /// The `breakpoints` field would be empty and should be ignored. #[serde(rename="waitExpired")] pub wait_expired: Option, - /// A wait token that can be used in the next method call to block until + /// A token that can be used in the next method call to block until /// the list of breakpoints changes. #[serde(rename="nextWaitToken")] pub next_wait_token: Option, @@ -675,6 +675,9 @@ impl Part for GerritSourceContext {} pub struct RegisterDebuggeeResponse { /// Debuggee resource. /// The field `id` is guranteed to be set (in addition to the echoed fields). + /// If the field `is_disabled` is set to `true`, the agent should disable + /// itself by removing all breakpoints and detaching from the application. + /// It should however continue to poll `RegisterDebuggee` until reenabled. pub debuggee: Option, } @@ -715,7 +718,8 @@ impl Part for SourceContext {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateActiveBreakpointRequest { /// Updated breakpoint information. - /// The field 'id' must be set. + /// The field `id` must be set. + /// The agent must echo all Breakpoint specification fields in the update. pub breakpoint: Option, } @@ -737,11 +741,11 @@ pub struct SourceLocation { impl Part for SourceLocation {} -/// Represents the application to debug. The application may include one or more +/// Represents the debugged application. The application may include one or more /// replicated processes executing the same code. Each of these processes is /// attached with a debugger agent, carrying out the debugging commands. -/// The agents attached to the same debuggee are identified by using exactly the -/// same field values when registering. +/// Agents attached to the same debuggee identify themselves as such by using +/// exactly the same Debuggee message value when registering. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -762,36 +766,33 @@ pub struct Debuggee { /// A set of custom debuggee properties, populated by the agent, to be /// displayed to the user. pub labels: Option>, - /// Debuggee uniquifier within the project. - /// Any string that identifies the application within the project can be used. - /// Including environment and version or build IDs is recommended. + /// Uniquifier to further distiguish the application. + /// It is possible that different applications might have identical values in + /// the debuggee message, thus, incorrectly identified as a single application + /// by the Controller service. This field adds salt to further distiguish the + /// application. Agents should consider seeding this field with value that + /// identifies the code, binary, configuration and environment. pub uniquifier: Option, /// Project the debuggee is associated with. - /// Use the project number when registering a Google Cloud Platform project. + /// Use project number or id when registering a Google Cloud Platform project. pub project: Option, /// References to the locations and revisions of the source code used in the /// deployed application. - /// - /// NOTE: This field is deprecated. Consumers should use - /// `ext_source_contexts` if it is not empty. Debug agents should populate - /// both this field and `ext_source_contexts`. #[serde(rename="sourceContexts")] pub source_contexts: Option>, /// References to the locations and revisions of the source code used in the /// deployed application. /// - /// Contexts describing a remote repo related to the source code - /// have a `category` label of `remote_repo`. Source snapshot source - /// contexts have a `category` of `snapshot`. + /// NOTE: this field is experimental and can be ignored. #[serde(rename="extSourceContexts")] pub ext_source_contexts: Option>, - /// Version ID of the agent release. The version ID is structured as - /// following: `domain/type/vmajor.minor` (for example - /// `google.com/gcp-java/v1.1`). + /// Version ID of the agent. + /// Schema: `domain/language-platform/vmajor.minor` (for example + /// `google.com/java-gcp/v1.1`). #[serde(rename="agentVersion")] pub agent_version: Option, - /// If set to `true`, indicates that the debuggee is considered as inactive by - /// the Controller service. + /// If set to `true`, indicates that Controller service does not detect any + /// activity from the debuggee agents and the application is possibly stopped. #[serde(rename="isInactive")] pub is_inactive: Option, /// Unique identifier for the debuggee generated by the controller service. @@ -1150,14 +1151,14 @@ impl ResponseResult for SetBreakpointResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StatusMessage { - /// Distinguishes errors from informational messages. - #[serde(rename="isError")] - pub is_error: Option, + /// Status message text. + pub description: Option, /// Reference to which the message applies. #[serde(rename="refersTo")] pub refers_to: Option, - /// Status message text. - pub description: Option, + /// Distinguishes errors from informational messages. + #[serde(rename="isError")] + pub is_error: Option, } impl Part for StatusMessage {} @@ -1229,12 +1230,11 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Updates the breakpoint state or mutable fields. - /// The entire Breakpoint message must be sent back to the controller - /// service. + /// The entire Breakpoint message must be sent back to the controller service. /// /// Updates to active breakpoint fields are only allowed if the new value /// does not change the breakpoint specification. Updates to the `location`, - /// `condition` and `expression` fields should not alter the breakpoint + /// `condition` and `expressions` fields should not alter the breakpoint /// semantics. These may only make changes such as canonicalizing a value /// or snapping the location to the correct line of code. /// @@ -1259,14 +1259,14 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// /// Registers the debuggee with the controller service. /// - /// All agents attached to the same application should call this method with - /// the same request content to get back the same stable `debuggee_id`. Agents - /// should call this method again whenever `google.rpc.Code.NOT_FOUND` is - /// returned from any controller method. + /// All agents attached to the same application must call this method with + /// exactly the same request content to get back the same stable `debuggee_id`. + /// Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` + /// is returned from any controller method. /// - /// This allows the controller service to disable the agent or recover from any - /// data loss. If the debuggee is disabled by the server, the response will - /// have `is_disabled` set to `true`. + /// This protocol allows the controller service to disable debuggees, recover + /// from data loss, or change the `debuggee_id` format. Agents must handle + /// `debuggee_id` value changing upon re-registration. /// /// # Arguments /// @@ -1285,7 +1285,7 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// /// Returns the list of all active breakpoints for the debuggee. /// - /// The breakpoint specification (location, condition, and expression + /// The breakpoint specification (`location`, `condition`, and `expressions` /// fields) is semantically immutable, although the field values may /// change. For example, an agent may update the location line number /// to reflect the actual line where the breakpoint was set, but this @@ -1396,7 +1396,7 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all the debuggees that the user can set breakpoints to. + /// Lists all the debuggees that the user has access to. pub fn debuggees_list(&self) -> DebuggerDebuggeeListCall<'a, C, A> { DebuggerDebuggeeListCall { hub: self.hub, @@ -1462,12 +1462,11 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { // ################# /// Updates the breakpoint state or mutable fields. -/// The entire Breakpoint message must be sent back to the controller -/// service. +/// The entire Breakpoint message must be sent back to the controller service. /// /// Updates to active breakpoint fields are only allowed if the new value /// does not change the breakpoint specification. Updates to the `location`, -/// `condition` and `expression` fields should not alter the breakpoint +/// `condition` and `expressions` fields should not alter the breakpoint /// semantics. These may only make changes such as canonicalizing a value /// or snapping the location to the correct line of code. /// @@ -1721,12 +1720,12 @@ impl<'a, C, A> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> where C: BorrowM /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> @@ -1763,14 +1762,14 @@ impl<'a, C, A> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> where C: BorrowM /// Registers the debuggee with the controller service. /// -/// All agents attached to the same application should call this method with -/// the same request content to get back the same stable `debuggee_id`. Agents -/// should call this method again whenever `google.rpc.Code.NOT_FOUND` is -/// returned from any controller method. +/// All agents attached to the same application must call this method with +/// exactly the same request content to get back the same stable `debuggee_id`. +/// Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` +/// is returned from any controller method. /// -/// This allows the controller service to disable the agent or recover from any -/// data loss. If the debuggee is disabled by the server, the response will -/// have `is_disabled` set to `true`. +/// This protocol allows the controller service to disable debuggees, recover +/// from data loss, or change the `debuggee_id` format. Agents must handle +/// `debuggee_id` value changing upon re-registration. /// /// A builder for the *debuggees.register* method supported by a *controller* resource. /// It is not used directly, but through a `ControllerMethods` instance. @@ -1977,12 +1976,12 @@ impl<'a, C, A> ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ControllerDebuggeeRegisterCall<'a, C, A> @@ -2019,7 +2018,7 @@ impl<'a, C, A> ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut ControllerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut self._debuggee_id = new_value.to_string(); self } - /// A wait token that, if specified, blocks the method call until the list - /// of active breakpoints has changed, or a server selected timeout has - /// expired. The value should be set from the last returned response. + /// A token that, if specified, blocks the method call until the list + /// of active breakpoints has changed, or a server-selected timeout has + /// expired. The value should be set from the `next_wait_token` field in + /// the last response. The initial value should be set to `"init"`. /// /// Sets the *wait token* query property to the given value. pub fn wait_token(mut self, new_value: &str) -> ControllerDebuggeeBreakpointListCall<'a, C, A> { self._wait_token = Some(new_value.to_string()); self } - /// If set to `true`, returns `google.rpc.Code.OK` status and sets the - /// `wait_expired` response field to `true` when the server-selected timeout - /// has expired (recommended). + /// If set to `true` (recommended), returns `google.rpc.Code.OK` status and + /// sets the `wait_expired` response field to `true` when the server-selected + /// timeout has expired. /// - /// If set to `false`, returns `google.rpc.Code.ABORTED` status when the - /// server-selected timeout has expired (deprecated). + /// If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status + /// when the server-selected timeout has expired. /// /// Sets the *success on timeout* query property to the given value. pub fn success_on_timeout(mut self, new_value: bool) -> ControllerDebuggeeBreakpointListCall<'a, C, A> { @@ -2269,12 +2269,12 @@ impl<'a, C, A> ControllerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ControllerDebuggeeBreakpointListCall<'a, C, A> @@ -2511,7 +2511,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointGetCall<'a, C, A> { @@ -2543,12 +2543,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeBreakpointGetCall<'a, C, A> @@ -2785,7 +2785,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut self } /// The client version making the call. - /// Following: `domain/type/version` (e.g., `google.com/intellij/v1`). + /// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). /// /// Sets the *client version* query property to the given value. pub fn client_version(mut self, new_value: &str) -> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> { @@ -2817,12 +2817,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> @@ -2857,7 +2857,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut } -/// Lists all the debuggees that the user can set breakpoints to. +/// Lists all the debuggees that the user has access to. /// /// A builder for the *debuggees.list* method supported by a *debugger* resource. /// It is not used directly, but through a `DebuggerMethods` instance. @@ -3039,7 +3039,7 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeListCall<'a, C, A> { @@ -3071,12 +3071,12 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeListCall<'a, C, A> @@ -3332,7 +3332,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointSetCall<'a, C, A> { @@ -3364,12 +3364,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeBreakpointSetCall<'a, C, A> @@ -3654,7 +3654,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> { @@ -3693,12 +3693,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> diff --git a/gen/cloudfunctions1-cli/Cargo.toml b/gen/cloudfunctions1-cli/Cargo.toml new file mode 100644 index 0000000000..50603edc5a --- /dev/null +++ b/gen/cloudfunctions1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudfunctions1-cli" +version = "1.0.6+20170920" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Functions (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1-cli" +homepage = "https://cloud.google.com/functions" +documentation = "http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli" +license = "MIT" +keywords = ["cloudfunctions", "google", "cli"] + +[[bin]] +name = "cloudfunctions1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-cloudfunctions1] +path = "../cloudfunctions1" +version = "1.0.6+20170920" diff --git a/gen/cloudfunctions1-cli/LICENSE.md b/gen/cloudfunctions1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudfunctions1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/cloudfunctions1-cli/README.md b/gen/cloudfunctions1-cli/README.md new file mode 100644 index 0000000000..5d3271c25b --- /dev/null +++ b/gen/cloudfunctions1-cli/README.md @@ -0,0 +1,117 @@ + +The `cloudfunctions1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Functions* 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 *Cloud Functions* API can be found at the +[official documentation site](https://cloud.google.com/functions). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-cloudfunctions1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1-cli). + +# Usage + +This documentation was generated from the *Cloud Functions* API at revision *20170920*. The CLI is at version *1.0.6*. + +```bash +cloudfunctions1 [options] + operations + get [-p ]... [-o ] + list [-p ]... [-o ] + projects + locations-list [-p ]... [-o ] + cloudfunctions1 --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 `cloudfunctions1-`. 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/cloudfunctions1-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/cloudfunctions1-secret.json`, assuming that the required *cloudfunctions* 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. `cloudfunctions1 --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/cloudfunctions1-cli/mkdocs.yml b/gen/cloudfunctions1-cli/mkdocs.yml new file mode 100644 index 0000000000..d549b13693 --- /dev/null +++ b/gen/cloudfunctions1-cli/mkdocs.yml @@ -0,0 +1,19 @@ +site_name: Cloud Functions v1.0.6+20170920 +site_url: http://byron.github.io/google-apis-rs/google-cloudfunctions1-cli +site_description: A complete library to interact with Cloud Functions (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['operations_get.md', 'Operations', 'Get'] +- ['operations_list.md', 'Operations', 'List'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/cloudfunctions1-cli/src/cmn.rs b/gen/cloudfunctions1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/cloudfunctions1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/cloudfunctions1-cli/src/main.rs b/gen/cloudfunctions1-cli/src/main.rs new file mode 100644 index 0000000000..e24d3d35a0 --- /dev/null +++ b/gen/cloudfunctions1-cli/src/main.rs @@ -0,0 +1,518 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_cloudfunctions1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudFunctions>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().list(); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + "name" => { + call = call.name(value.unwrap_or("")); + }, + "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", "name", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("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(); + } + } + }, + ("projects", Some(opt)) => { + match opt.subcommand() { + ("locations-list", Some(opt)) => { + call_result = self._projects_locations_list(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<'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, "cloudfunctions1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "cloudfunctions1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudFunctions::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 = [ + ("operations", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/operations_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/operations_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)), + ]), + ]), + + ("projects", "methods: 'locations-list'", vec![ + ("locations-list", + Some(r##"Lists information about the supported locations for this service."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource that owns the locations collection, if applicable."##), + 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("cloudfunctions1") + .author("Sebastian Thiel ") + .version("1.0.6+20170920") + .about("API for managing lightweight user-provided functions executed in response to events.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudfunctions1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/cloudfunctions1/Cargo.toml b/gen/cloudfunctions1/Cargo.toml new file mode 100644 index 0000000000..ef3f7b0135 --- /dev/null +++ b/gen/cloudfunctions1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudfunctions1" +version = "1.0.6+20170920" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Functions (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1" +homepage = "https://cloud.google.com/functions" +documentation = "https://docs.rs/google-cloudfunctions1/1.0.6+20170920" +license = "MIT" +keywords = ["cloudfunctions", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/cloudfunctions1/LICENSE.md b/gen/cloudfunctions1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudfunctions1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/cloudfunctions1/README.md b/gen/cloudfunctions1/README.md new file mode 100644 index 0000000000..8527bacadf --- /dev/null +++ b/gen/cloudfunctions1/README.md @@ -0,0 +1,181 @@ + +The `google-cloudfunctions1` library allows access to all features of the *Google Cloud Functions* service. + +This documentation was generated from *Cloud Functions* crate version *1.0.6+20170920*, where *20170920* is the exact revision of the *cloudfunctions:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud Functions* *v1* API can be found at the +[official documentation site](https://cloud.google.com/functions). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.CloudFunctions.html) ... + +* [operations](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.OperationListCall.html) +* projects + * [*locations list*](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.ProjectLocationListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.CloudFunctions.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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.operations().list(...).doit() +let r = hub.operations().get(...).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-cloudfunctions1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_cloudfunctions1 as cloudfunctions1; +use cloudfunctions1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use cloudfunctions1::CloudFunctions; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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() + .page_token("eirmod") + .page_size(-48) + .name("Stet") + .filter("sed") + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} + +``` +## Handling Errors + +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/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 **cloudfunctions1** 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-rsblob/master/LICENSE.md diff --git a/gen/cloudfunctions1/src/cmn.rs b/gen/cloudfunctions1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/cloudfunctions1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/cloudfunctions1/src/lib.rs b/gen/cloudfunctions1/src/lib.rs new file mode 100644 index 0000000000..a2ee115fb4 --- /dev/null +++ b/gen/cloudfunctions1/src/lib.rs @@ -0,0 +1,1522 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud Functions* crate version *1.0.6+20170920*, where *20170920* is the exact revision of the *cloudfunctions:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud Functions* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/functions). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudFunctions.html) ... +//! +//! * [operations](struct.Operation.html) +//! * [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) +//! * projects +//! * [*locations list*](struct.ProjectLocationListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudFunctions.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.operations().list(...).doit() +//! let r = hub.operations().get(...).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-cloudfunctions1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_cloudfunctions1 as cloudfunctions1; +//! use cloudfunctions1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use cloudfunctions1::CloudFunctions; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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() +//! .page_token("et") +//! .page_size(-18) +//! .name("kasd") +//! .filter("accusam") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## 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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 CloudFunctions related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudfunctions1 as cloudfunctions1; +/// use cloudfunctions1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudfunctions1::CloudFunctions; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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() +/// .page_token("takimata") +/// .page_size(-70) +/// .name("amet.") +/// .filter("erat") +/// .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 CloudFunctions { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudFunctions {} + +impl<'a, C, A> CloudFunctions + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudFunctions { + CloudFunctions { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://cloudfunctions.googleapis.com/".to_string(), + _root_url: "https://cloudfunctions.googleapis.com/".to_string(), + } + } + + pub fn operations(&'a self) -> OperationMethods<'a, C, A> { + OperationMethods { hub: &self } + } + 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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudfunctions.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudfunctions.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// The response message for Locations.ListLocations. +/// +/// # 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*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLocationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of locations that matches the specified filter in the request. + pub locations: Option>, +} + +impl ResponseResult for ListLocationsResponse {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list operations](struct.OperationListCall.html) (none) +/// * [get operations](struct.OperationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should have the format of `operations/some/unique/name`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl Resource for Operation {} +impl ResponseResult for Operation {} + + +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list operations](struct.OperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListOperationsResponse {} + + +/// A resource that represents Google Cloud Platform location. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Location { + /// Cross-service attributes for the location. For example + /// + /// {"cloud.googleapis.com/region": "us-east1"} + pub labels: Option>, + /// The canonical id for this location. For example: `"us-east1"`. + #[serde(rename="locationId")] + pub location_id: Option, + /// Resource name for the location, which may vary between implementations. + /// For example: `"projects/example-project/locations/us-east1"` + pub name: Option, + /// Service-specific metadata. For example the available capacity at the given + /// location. + pub metadata: Option>, +} + +impl Part for Location {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *operation* resources. +/// It is not used directly, but through the `CloudFunctions` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudfunctions1 as cloudfunctions1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudfunctions1::CloudFunctions; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 CloudFunctions, +} + +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: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + pub fn list(&self) -> OperationListCall<'a, C, A> { + OperationListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _name: 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 the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn get(&self, name: &str) -> OperationGetCall<'a, C, A> { + OperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudFunctions` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudfunctions1 as cloudfunctions1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudfunctions1::CloudFunctions; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `locations_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, +} + +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: + /// + /// Lists information about the supported locations for this service. + /// + /// # Arguments + /// + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudfunctions1 as cloudfunctions1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudfunctions1::CloudFunctions; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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() +/// .page_token("labore") +/// .page_size(-9) +/// .name("nonumy") +/// .filter("dolores") +/// .doit(); +/// # } +/// ``` +pub struct OperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _page_token: Option, + _page_size: Option, + _name: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationListCall<'a, C, A> {} + +impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudfunctions.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + 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._name { + params.push(("name", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "pageToken", "pageSize", "name", "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 = self.hub._base_url.clone() + "v1/operations"; + 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(Bearer { 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(d); + 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(d); + 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 standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The name of the operation's parent resource. + /// + /// Sets the *name* query property to the given value. + pub fn name(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._name = Some(new_value.to_string()); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *get* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudfunctions1 as cloudfunctions1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudfunctions1::CloudFunctions; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().get("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} + +impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudfunctions.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists information about the supported locations for this service. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudfunctions1 as cloudfunctions1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudfunctions1::CloudFunctions; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudFunctions::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_list("name") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .filter("no") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'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, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudfunctions.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource that owns the locations collection, if applicable. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'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) -> ProjectLocationListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/cloudkms1-cli/Cargo.toml b/gen/cloudkms1-cli/Cargo.toml new file mode 100644 index 0000000000..c8d46f384a --- /dev/null +++ b/gen/cloudkms1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudkms1-cli" +version = "1.0.6+20170919" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud KMS (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1-cli" +homepage = "https://cloud.google.com/kms/" +documentation = "http://byron.github.io/google-apis-rs/google_cloudkms1_cli" +license = "MIT" +keywords = ["cloudkms", "google", "cli"] + +[[bin]] +name = "cloudkms1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-cloudkms1] +path = "../cloudkms1" +version = "1.0.6+20170919" diff --git a/gen/cloudkms1-cli/LICENSE.md b/gen/cloudkms1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudkms1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/cloudkms1-cli/README.md b/gen/cloudkms1-cli/README.md new file mode 100644 index 0000000000..eede77a603 --- /dev/null +++ b/gen/cloudkms1-cli/README.md @@ -0,0 +1,137 @@ + +The `cloudkms1` command-line interface *(CLI)* allows to use most features of the *Google Cloud KMS* 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 *Cloud KMS* API can be found at the +[official documentation site](https://cloud.google.com/kms/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-cloudkms1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1-cli). + +# Usage + +This documentation was generated from the *Cloud KMS* API at revision *20170919*. The CLI is at version *1.0.6*. + +```bash +cloudkms1 [options] + projects + locations-get [-p ]... [-o ] + locations-key-rings-create (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-create (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-create (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-destroy (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-get [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-list [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-patch (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-restore (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-decrypt (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-encrypt (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-get [-p ]... [-o ] + locations-key-rings-crypto-keys-get-iam-policy [-p ]... [-o ] + locations-key-rings-crypto-keys-list [-p ]... [-o ] + locations-key-rings-crypto-keys-patch (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-set-iam-policy (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-test-iam-permissions (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-update-primary-version (-r )... [-p ]... [-o ] + locations-key-rings-get [-p ]... [-o ] + locations-key-rings-get-iam-policy [-p ]... [-o ] + locations-key-rings-list [-p ]... [-o ] + locations-key-rings-set-iam-policy (-r )... [-p ]... [-o ] + locations-key-rings-test-iam-permissions (-r )... [-p ]... [-o ] + locations-list [-p ]... [-o ] + cloudkms1 --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 `cloudkms1-`. 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/cloudkms1-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/cloudkms1-secret.json`, assuming that the required *cloudkms* 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. `cloudkms1 --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/cloudkms1-cli/mkdocs.yml b/gen/cloudkms1-cli/mkdocs.yml new file mode 100644 index 0000000000..1c96382d1d --- /dev/null +++ b/gen/cloudkms1-cli/mkdocs.yml @@ -0,0 +1,40 @@ +site_name: Cloud KMS v1.0.6+20170919 +site_url: http://byron.github.io/google-apis-rs/google-cloudkms1-cli +site_description: A complete library to interact with Cloud KMS (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_locations-get.md', 'Projects', 'Locations Get'] +- ['projects_locations-key-rings-create.md', 'Projects', 'Locations Key Rings Create'] +- ['projects_locations-key-rings-crypto-keys-create.md', 'Projects', 'Locations Key Rings Crypto Keys Create'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-create.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Create'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-destroy.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Destroy'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-get.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Get'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-list.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions List'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-patch.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Patch'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-restore.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Restore'] +- ['projects_locations-key-rings-crypto-keys-decrypt.md', 'Projects', 'Locations Key Rings Crypto Keys Decrypt'] +- ['projects_locations-key-rings-crypto-keys-encrypt.md', 'Projects', 'Locations Key Rings Crypto Keys Encrypt'] +- ['projects_locations-key-rings-crypto-keys-get.md', 'Projects', 'Locations Key Rings Crypto Keys Get'] +- ['projects_locations-key-rings-crypto-keys-get-iam-policy.md', 'Projects', 'Locations Key Rings Crypto Keys Get Iam Policy'] +- ['projects_locations-key-rings-crypto-keys-list.md', 'Projects', 'Locations Key Rings Crypto Keys List'] +- ['projects_locations-key-rings-crypto-keys-patch.md', 'Projects', 'Locations Key Rings Crypto Keys Patch'] +- ['projects_locations-key-rings-crypto-keys-set-iam-policy.md', 'Projects', 'Locations Key Rings Crypto Keys Set Iam Policy'] +- ['projects_locations-key-rings-crypto-keys-test-iam-permissions.md', 'Projects', 'Locations Key Rings Crypto Keys Test Iam Permissions'] +- ['projects_locations-key-rings-crypto-keys-update-primary-version.md', 'Projects', 'Locations Key Rings Crypto Keys Update Primary Version'] +- ['projects_locations-key-rings-get.md', 'Projects', 'Locations Key Rings Get'] +- ['projects_locations-key-rings-get-iam-policy.md', 'Projects', 'Locations Key Rings Get Iam Policy'] +- ['projects_locations-key-rings-list.md', 'Projects', 'Locations Key Rings List'] +- ['projects_locations-key-rings-set-iam-policy.md', 'Projects', 'Locations Key Rings Set Iam Policy'] +- ['projects_locations-key-rings-test-iam-permissions.md', 'Projects', 'Locations Key Rings Test Iam Permissions'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/cloudkms1-cli/src/cmn.rs b/gen/cloudkms1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/cloudkms1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/cloudkms1-cli/src/main.rs b/gen/cloudkms1-cli/src/main.rs new file mode 100644 index 0000000000..ab49da2a99 --- /dev/null +++ b/gen/cloudkms1-cli/src/main.rs @@ -0,0 +1,2791 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_cloudkms1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudKMS>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_locations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "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::KeyRing = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "key-ring-id" => { + call = call.key_ring_id(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(["key-ring-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "rotation-period" => Some(("rotationPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "primary.destroy-event-time" => Some(("primary.destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.state" => Some(("primary.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.destroy-time" => Some(("primary.destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purpose" => Some(("purpose", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-rotation-time" => Some(("nextRotationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destroy-event-time", "destroy-time", "labels", "name", "next-rotation-time", "primary", "purpose", "rotation-period", "state"]); + 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::CryptoKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "crypto-key-id" => { + call = call.crypto_key_id(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(["crypto-key-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "destroy-event-time" => Some(("destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destroy-time" => Some(("destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destroy-event-time", "destroy-time", "name", "state"]); + 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::CryptoKeyVersion = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_destroy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DestroyCryptoKeyVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_destroy(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "destroy-event-time" => Some(("destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destroy-time" => Some(("destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destroy-event-time", "destroy-time", "name", "state"]); + 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::CryptoKeyVersion = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_restore(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RestoreCryptoKeyVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_decrypt(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "ciphertext" => Some(("ciphertext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "additional-authenticated-data" => Some(("additionalAuthenticatedData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-authenticated-data", "ciphertext"]); + 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::DecryptRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_decrypt(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_encrypt(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "plaintext" => Some(("plaintext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "additional-authenticated-data" => Some(("additionalAuthenticatedData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-authenticated-data", "plaintext"]); + 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::EncryptRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_encrypt(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "rotation-period" => Some(("rotationPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "primary.destroy-event-time" => Some(("primary.destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.state" => Some(("primary.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.destroy-time" => Some(("primary.destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purpose" => Some(("purpose", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-rotation-time" => Some(("nextRotationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destroy-event-time", "destroy-time", "labels", "name", "next-rotation-time", "primary", "purpose", "rotation-period", "state"]); + 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::CryptoKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "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().locations_key_rings_crypto_keys_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().locations_key_rings_crypto_keys_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_update_primary_version(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "crypto-key-version-id" => Some(("cryptoKeyVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["crypto-key-version-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateCryptoKeyPrimaryVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_update_primary_version(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "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().locations_key_rings_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().locations_key_rings_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("locations-get", Some(opt)) => { + call_result = self._projects_locations_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-create", Some(opt)) => { + call_result = self._projects_locations_key_rings_create(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-create", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_create(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-create", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_create(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-destroy", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_destroy(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-get", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-list", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_list(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-patch", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_patch(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-restore", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_restore(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-decrypt", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_decrypt(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-encrypt", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_encrypt(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-get", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-list", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_list(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-patch", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_patch(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_test_iam_permissions(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-update-primary-version", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_update_primary_version(opt, dry_run, &mut err); + }, + ("locations-key-rings-get", Some(opt)) => { + call_result = self._projects_locations_key_rings_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-list", Some(opt)) => { + call_result = self._projects_locations_key_rings_list(opt, dry_run, &mut err); + }, + ("locations-key-rings-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_key_rings_test_iam_permissions(opt, dry_run, &mut err); + }, + ("locations-list", Some(opt)) => { + call_result = self._projects_locations_list(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<'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, "cloudkms1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "cloudkms1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudKMS::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: 'locations-get', 'locations-key-rings-create', 'locations-key-rings-crypto-keys-create', 'locations-key-rings-crypto-keys-crypto-key-versions-create', 'locations-key-rings-crypto-keys-crypto-key-versions-destroy', 'locations-key-rings-crypto-keys-crypto-key-versions-get', 'locations-key-rings-crypto-keys-crypto-key-versions-list', 'locations-key-rings-crypto-keys-crypto-key-versions-patch', 'locations-key-rings-crypto-keys-crypto-key-versions-restore', 'locations-key-rings-crypto-keys-decrypt', 'locations-key-rings-crypto-keys-encrypt', 'locations-key-rings-crypto-keys-get', 'locations-key-rings-crypto-keys-get-iam-policy', 'locations-key-rings-crypto-keys-list', 'locations-key-rings-crypto-keys-patch', 'locations-key-rings-crypto-keys-set-iam-policy', 'locations-key-rings-crypto-keys-test-iam-permissions', 'locations-key-rings-crypto-keys-update-primary-version', 'locations-key-rings-get', 'locations-key-rings-get-iam-policy', 'locations-key-rings-list', 'locations-key-rings-set-iam-policy', 'locations-key-rings-test-iam-permissions' and 'locations-list'", vec![ + ("locations-get", + Some(r##"Get information about a location."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name for the location."##), + 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)), + ]), + ("locations-key-rings-create", + Some(r##"Create a new KeyRing in a given Project and Location."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the location associated with the + KeyRings, in the format `projects/*/locations/*`."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-create", + Some(r##"Create a new CryptoKey within a KeyRing. + + CryptoKey.purpose is required."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the KeyRing associated with the + CryptoKeys."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-create", + Some(r##"Create a new CryptoKeyVersion in a CryptoKey. + + The server will assign the next sequential id. If unset, + state will be set to + ENABLED."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the CryptoKey associated with + the CryptoKeyVersions."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-destroy", + Some(r##"Schedule a CryptoKeyVersion for destruction. + + Upon calling this method, CryptoKeyVersion.state will be set to + DESTROY_SCHEDULED + and destroy_time will be set to a time 24 + hours in the future, at which point the state + will be changed to + DESTROYED, and the key + material will be irrevocably destroyed. + + Before the destroy_time is reached, + RestoreCryptoKeyVersion may be called to reverse the process."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-destroy", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the CryptoKeyVersion to destroy."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-get", + Some(r##"Returns metadata for a given CryptoKeyVersion."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the CryptoKeyVersion 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)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-list", + Some(r##"Lists CryptoKeyVersions."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the CryptoKey to list, in the format + `projects/*/locations/*/keyRings/*/cryptoKeys/*`."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-patch", + Some(r##"Update a CryptoKeyVersion's metadata. + + state may be changed between + ENABLED and + DISABLED using this + method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to + move between other states."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only. The resource name for this CryptoKeyVersion in the format + `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-restore", + Some(r##"Restore a CryptoKeyVersion in the + DESTROY_SCHEDULED, + state. + + Upon restoration of the CryptoKeyVersion, state + will be set to DISABLED, + and destroy_time will be cleared."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-restore", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the CryptoKeyVersion to restore."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-decrypt", + Some(r##"Decrypts data that was protected by Encrypt."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-decrypt", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the CryptoKey to use for decryption. + The server will choose the appropriate version."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-encrypt", + Some(r##"Encrypts data, so that it can only be recovered by a call to Decrypt."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-encrypt", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the CryptoKey or CryptoKeyVersion + to use for encryption. + + If a CryptoKey is specified, the server will use its + primary version."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-get", + Some(r##"Returns metadata for a given CryptoKey, as well as its + primary CryptoKeyVersion."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the CryptoKey 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)), + ]), + ("locations-key-rings-crypto-keys-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-list", + Some(r##"Lists CryptoKeys."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the KeyRing to list, in the format + `projects/*/locations/*/keyRings/*`."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-patch", + Some(r##"Update a CryptoKey."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only. The resource name for this CryptoKey in the format + `projects/*/locations/*/keyRings/*/cryptoKeys/*`."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-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_cloudkms1_cli/projects_locations-key-rings-crypto-keys-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-key-rings-crypto-keys-update-primary-version", + Some(r##"Update the version of a CryptoKey that will be used in Encrypt"##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-update-primary-version", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the CryptoKey to update."##), + 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)), + ]), + ("locations-key-rings-get", + Some(r##"Returns metadata for a given KeyRing."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the KeyRing 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)), + ]), + ("locations-key-rings-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-key-rings-list", + Some(r##"Lists KeyRings."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the location associated with the + KeyRings, in the format `projects/*/locations/*`."##), + 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)), + ]), + ("locations-key-rings-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_cloudkms1_cli/projects_locations-key-rings-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-key-rings-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-list", + Some(r##"Lists information about the supported locations for this service."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource that owns the locations collection, if applicable."##), + 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("cloudkms1") + .author("Sebastian Thiel ") + .version("1.0.6+20170919") + .about("Manages encryption for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256 encryption keys.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudkms1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/cloudkms1/Cargo.toml b/gen/cloudkms1/Cargo.toml new file mode 100644 index 0000000000..14768f7939 --- /dev/null +++ b/gen/cloudkms1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudkms1" +version = "1.0.6+20170919" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud KMS (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1" +homepage = "https://cloud.google.com/kms/" +documentation = "https://docs.rs/google-cloudkms1/1.0.6+20170919" +license = "MIT" +keywords = ["cloudkms", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/cloudkms1/LICENSE.md b/gen/cloudkms1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudkms1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/cloudkms1/README.md b/gen/cloudkms1/README.md new file mode 100644 index 0000000000..61e1b588f3 --- /dev/null +++ b/gen/cloudkms1/README.md @@ -0,0 +1,185 @@ + +The `google-cloudkms1` library allows access to all features of the *Google Cloud KMS* service. + +This documentation was generated from *Cloud KMS* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *cloudkms:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud KMS* *v1* API can be found at the +[official documentation site](https://cloud.google.com/kms/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.CloudKMS.html) ... + +* projects + * [*locations get*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.ProjectLocationListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.CloudKMS.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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().locations_key_rings_crypto_keys_crypto_key_versions_destroy(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(...).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-cloudkms1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_cloudkms1 as cloudkms1; +use cloudkms1::CryptoKeyVersion; +use cloudkms1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use cloudkms1::CloudKMS; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKeyVersion::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().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") + .update_mask("sit") + .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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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](https://docs.rs/google-cloudkms1/1.0.6+20170919/google_cloudkms1/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 **cloudkms1** 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-rsblob/master/LICENSE.md diff --git a/gen/cloudkms1/src/cmn.rs b/gen/cloudkms1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/cloudkms1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/cloudkms1/src/lib.rs b/gen/cloudkms1/src/lib.rs new file mode 100644 index 0000000000..66adfc22df --- /dev/null +++ b/gen/cloudkms1/src/lib.rs @@ -0,0 +1,8405 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud KMS* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *cloudkms:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud KMS* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/kms/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudKMS.html) ... +//! +//! * projects +//! * [*locations get*](struct.ProjectLocationGetCall.html), [*locations key rings create*](struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](struct.ProjectLocationListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudKMS.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().locations_key_rings_crypto_keys_crypto_key_versions_destroy(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(...).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-cloudkms1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_cloudkms1 as cloudkms1; +//! use cloudkms1::CryptoKeyVersion; +//! use cloudkms1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use cloudkms1::CloudKMS; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKeyVersion::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().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") +//! .update_mask("sed") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 CloudKMS related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::CryptoKeyVersion; +/// use cloudkms1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudkms1::CloudKMS; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKeyVersion::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().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") +/// .update_mask("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 CloudKMS { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudKMS {} + +impl<'a, C, A> CloudKMS + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudKMS { + CloudKMS { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://cloudkms.googleapis.com/".to_string(), + _root_url: "https://cloudkms.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudkms.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudkms.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Response message for KeyManagementService.ListCryptoKeys. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys list projects](struct.ProjectLocationKeyRingCryptoKeyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCryptoKeysResponse { + /// A token to retrieve next page of results. Pass this value in + /// ListCryptoKeysRequest.page_token to retrieve the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of CryptoKeys that matched the query. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The list of CryptoKeys. + #[serde(rename="cryptoKeys")] + pub crypto_keys: Option>, +} + +impl ResponseResult for ListCryptoKeysResponse {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// foo@gmail.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// Request message for KeyManagementService.Encrypt. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys encrypt projects](struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EncryptRequest { + /// Required. The data to encrypt. Must be no larger than 64KiB. + pub plaintext: Option, + /// Optional data that, if specified, must also be provided during decryption + /// through DecryptRequest.additional_authenticated_data. Must be no + /// larger than 64KiB. + #[serde(rename="additionalAuthenticatedData")] + pub additional_authenticated_data: Option, +} + +impl RequestValue for EncryptRequest {} + + +/// 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*). +/// +/// * [locations key rings test iam permissions projects](struct.ProjectLocationKeyRingTestIamPermissionCall.html) (request) +/// * [locations key rings crypto keys test iam permissions projects](struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.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. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// 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*). +/// +/// * [locations key rings crypto keys set iam policy projects](struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html) (request) +/// * [locations key rings set iam policy projects](struct.ProjectLocationKeyRingSetIamPolicyCall.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 a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + /// the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: + /// paths: "bindings, etag" + /// This field is only used by Cloud IAM. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// A KeyRing is a toplevel logical grouping of CryptoKeys. +/// +/// # 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*). +/// +/// * [locations key rings create projects](struct.ProjectLocationKeyRingCreateCall.html) (request|response) +/// * [locations key rings get projects](struct.ProjectLocationKeyRingGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyRing { + /// Output only. The time at which this KeyRing was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The resource name for the KeyRing in the format + /// `projects/*/locations/*/keyRings/*`. + pub name: Option, +} + +impl RequestValue for KeyRing {} +impl ResponseResult for KeyRing {} + + +/// A CryptoKeyVersion represents an individual cryptographic key, and the +/// associated key material. +/// +/// It can be used for cryptographic operations either directly, or via its +/// parent CryptoKey, in which case the server will choose the appropriate +/// version for the operation. +/// +/// For security reasons, the raw cryptographic key material represented by a +/// CryptoKeyVersion can never be viewed or exported. It can only be used to +/// encrypt or decrypt data when an authorized user or application invokes Cloud +/// KMS. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys crypto key versions destroy projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html) (response) +/// * [locations key rings crypto keys crypto key versions get projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html) (response) +/// * [locations key rings crypto keys crypto key versions patch projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html) (request|response) +/// * [locations key rings crypto keys crypto key versions restore projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html) (response) +/// * [locations key rings crypto keys crypto key versions create projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CryptoKeyVersion { + /// The current state of the CryptoKeyVersion. + pub state: Option, + /// Output only. The time at which this CryptoKeyVersion was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + pub name: Option, + /// Output only. The time this CryptoKeyVersion's key material is scheduled + /// for destruction. Only present if state is + /// DESTROY_SCHEDULED. + #[serde(rename="destroyTime")] + pub destroy_time: Option, + /// Output only. The time this CryptoKeyVersion's key material was + /// destroyed. Only present if state is + /// DESTROYED. + #[serde(rename="destroyEventTime")] + pub destroy_event_time: Option, +} + +impl RequestValue for CryptoKeyVersion {} +impl ResponseResult for CryptoKeyVersion {} + + +/// Response message for KeyManagementService.ListKeyRings. +/// +/// # 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*). +/// +/// * [locations key rings list projects](struct.ProjectLocationKeyRingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListKeyRingsResponse { + /// A token to retrieve next page of results. Pass this value in + /// ListKeyRingsRequest.page_token to retrieve the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of KeyRings that matched the query. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The list of KeyRings. + #[serde(rename="keyRings")] + pub key_rings: Option>, +} + +impl ResponseResult for ListKeyRingsResponse {} + + +/// The response message for Locations.ListLocations. +/// +/// # 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*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLocationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of locations that matches the specified filter in the request. + pub locations: Option>, +} + +impl ResponseResult for ListLocationsResponse {} + + +/// A resource that represents Google Cloud Platform location. +/// +/// # 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*). +/// +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Location { + /// Cross-service attributes for the location. For example + /// + /// {"cloud.googleapis.com/region": "us-east1"} + pub labels: Option>, + /// The canonical id for this location. For example: `"us-east1"`. + #[serde(rename="locationId")] + pub location_id: Option, + /// Resource name for the location, which may vary between implementations. + /// For example: `"projects/example-project/locations/us-east1"` + pub name: Option, + /// Service-specific metadata. For example the available capacity at the given + /// location. + pub metadata: Option>, +} + +impl ResponseResult for Location {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +/// `members` to a `role`, where the members can be user accounts, Google groups, +/// Google domains, and service accounts. A `role` is a named list of permissions +/// defined by IAM. +/// +/// **Example** +/// +/// { +/// "bindings": [ +/// { +/// "role": "roles/owner", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +/// ] +/// }, +/// { +/// "role": "roles/viewer", +/// "members": ["user:sean@example.com"] +/// } +/// ] +/// } +/// +/// For a description of IAM and its features, see the +/// [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # 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*). +/// +/// * [locations key rings crypto keys get iam policy projects](struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html) (response) +/// * [locations key rings get iam policy projects](struct.ProjectLocationKeyRingGetIamPolicyCall.html) (response) +/// * [locations key rings crypto keys set iam policy projects](struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html) (response) +/// * [locations key rings set iam policy projects](struct.ProjectLocationKeyRingSetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, + /// no description provided + #[serde(rename="iamOwned")] + pub iam_owned: Option, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, +} + +impl ResponseResult for Policy {} + + +/// Response message for KeyManagementService.Decrypt. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys decrypt projects](struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DecryptResponse { + /// The decrypted data originally supplied in EncryptRequest.plaintext. + pub plaintext: Option, +} + +impl ResponseResult for DecryptResponse {} + + +/// Response message for KeyManagementService.ListCryptoKeyVersions. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys crypto key versions list projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCryptoKeyVersionsResponse { + /// A token to retrieve next page of results. Pass this value in + /// ListCryptoKeyVersionsRequest.page_token to retrieve the next page of + /// results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of CryptoKeyVersions that matched the + /// query. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The list of CryptoKeyVersions. + #[serde(rename="cryptoKeyVersions")] + pub crypto_key_versions: Option>, +} + +impl ResponseResult for ListCryptoKeyVersionsResponse {} + + +/// A CryptoKey represents a logical key that can be used for cryptographic +/// operations. +/// +/// A CryptoKey is made up of one or more versions, which +/// represent the actual key material used in cryptographic operations. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys get projects](struct.ProjectLocationKeyRingCryptoKeyGetCall.html) (response) +/// * [locations key rings crypto keys update primary version projects](struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html) (response) +/// * [locations key rings crypto keys create projects](struct.ProjectLocationKeyRingCryptoKeyCreateCall.html) (request|response) +/// * [locations key rings crypto keys patch projects](struct.ProjectLocationKeyRingCryptoKeyPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CryptoKey { + /// Labels with user defined metadata. + pub labels: Option>, + /// Output only. The resource name for this CryptoKey in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + pub name: Option, + /// At next_rotation_time, the Key Management Service will automatically: + /// + /// 1. Create a new version of this CryptoKey. + /// 2. Mark the new version as primary. + /// + /// Key rotations performed manually via + /// CreateCryptoKeyVersion and + /// UpdateCryptoKeyPrimaryVersion + /// do not affect next_rotation_time. + #[serde(rename="nextRotationTime")] + pub next_rotation_time: Option, + /// next_rotation_time will be advanced by this period when the service + /// automatically rotates a key. Must be at least one day. + /// + /// If rotation_period is set, next_rotation_time must also be set. + #[serde(rename="rotationPeriod")] + pub rotation_period: Option, + /// Output only. A copy of the "primary" CryptoKeyVersion that will be used + /// by Encrypt when this CryptoKey is given + /// in EncryptRequest.name. + /// + /// The CryptoKey's primary version can be updated via + /// UpdateCryptoKeyPrimaryVersion. + pub primary: Option, + /// Output only. The time at which this CryptoKey was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// The immutable purpose of this CryptoKey. Currently, the only acceptable + /// purpose is ENCRYPT_DECRYPT. + pub purpose: Option, +} + +impl RequestValue for CryptoKey {} +impl ResponseResult for CryptoKey {} + + +/// 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*). +/// +/// * [locations key rings test iam permissions projects](struct.ProjectLocationKeyRingTestIamPermissionCall.html) (response) +/// * [locations key rings crypto keys test iam permissions projects](struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.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 message for KeyManagementService.RestoreCryptoKeyVersion. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys crypto key versions restore projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RestoreCryptoKeyVersionRequest { _never_set: Option } + +impl RequestValue for RestoreCryptoKeyVersionRequest {} + + +/// Response message for KeyManagementService.Encrypt. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys encrypt projects](struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EncryptResponse { + /// The encrypted data. + pub ciphertext: Option, + /// The resource name of the CryptoKeyVersion used in encryption. + pub name: Option, +} + +impl ResponseResult for EncryptResponse {} + + +/// Request message for KeyManagementService.DestroyCryptoKeyVersion. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys crypto key versions destroy projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DestroyCryptoKeyVersionRequest { _never_set: Option } + +impl RequestValue for DestroyCryptoKeyVersionRequest {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: an unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + /// This field is GOOGLE_INTERNAL. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys update primary version projects](struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateCryptoKeyPrimaryVersionRequest { + /// The id of the child CryptoKeyVersion to use as primary. + #[serde(rename="cryptoKeyVersionId")] + pub crypto_key_version_id: Option, +} + +impl RequestValue for UpdateCryptoKeyPrimaryVersionRequest {} + + +/// Request message for KeyManagementService.Decrypt. +/// +/// # 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*). +/// +/// * [locations key rings crypto keys decrypt projects](struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DecryptRequest { + /// Required. The encrypted data originally returned in + /// EncryptResponse.ciphertext. + pub ciphertext: Option, + /// Optional data that must match the data originally supplied in + /// EncryptRequest.additional_authenticated_data. + #[serde(rename="additionalAuthenticatedData")] + pub additional_authenticated_data: Option, +} + +impl RequestValue for DecryptRequest {} + + +/// Represents an expression text. Example: +/// +/// title: "User account presence" +/// description: "Determines whether the request has a user account" +/// expression: "size(request.user) > 0" +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// An optional description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in + /// Common Expression Language syntax. + /// + /// The application context of the containing message determines which + /// well-known feature set of CEL is supported. + pub expression: Option, + /// An optional string indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// An optional title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for Expr {} + + +/// Specifies the audit configuration for a service. +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. +/// An AuditConfig must have one or more AuditLogConfigs. +/// +/// If there are AuditConfigs for both `allServices` and a specific service, +/// the union of the two AuditConfigs is used for that service: the log_types +/// specified in each AuditConfig are enabled, and the exempted_members in each +/// AuditConfig are exempted. +/// +/// Example Policy with multiple AuditConfigs: +/// +/// { +/// "audit_configs": [ +/// { +/// "service": "allServices" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// }, +/// { +/// "log_type": "ADMIN_READ", +/// } +/// ] +/// }, +/// { +/// "service": "fooservice.googleapis.com" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// "exempted_members": [ +/// "user:bar@gmail.com" +/// ] +/// } +/// ] +/// } +/// ] +/// } +/// +/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts foo@gmail.com from DATA_READ logging, and +/// bar@gmail.com from DATA_WRITE logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditConfig { + /// no description provided + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The configuration for logging of each type of permission. + /// Next ID: 4 + #[serde(rename="auditLogConfigs")] + pub audit_log_configs: Option>, + /// Specifies a service that will be enabled for audit logging. + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + pub service: Option, +} + +impl Part for AuditConfig {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudKMS` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudkms1 as cloudkms1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudkms1::CloudKMS; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `locations_get(...)`, `locations_key_rings_create(...)`, `locations_key_rings_crypto_keys_create(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_create(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_destroy(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_get(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_list(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_patch(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_restore(...)`, `locations_key_rings_crypto_keys_decrypt(...)`, `locations_key_rings_crypto_keys_encrypt(...)`, `locations_key_rings_crypto_keys_get(...)`, `locations_key_rings_crypto_keys_get_iam_policy(...)`, `locations_key_rings_crypto_keys_list(...)`, `locations_key_rings_crypto_keys_patch(...)`, `locations_key_rings_crypto_keys_set_iam_policy(...)`, `locations_key_rings_crypto_keys_test_iam_permissions(...)`, `locations_key_rings_crypto_keys_update_primary_version(...)`, `locations_key_rings_get(...)`, `locations_key_rings_get_iam_policy(...)`, `locations_key_rings_list(...)`, `locations_key_rings_set_iam_policy(...)`, `locations_key_rings_test_iam_permissions(...)` and `locations_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, +} + +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: + /// + /// Update a CryptoKeyVersion's metadata. + /// + /// state may be changed between + /// ENABLED and + /// DISABLED using this + /// method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to + /// move between other states. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_patch(&self, request: CryptoKeyVersion, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new KeyRing in a given Project and Location. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + pub fn locations_key_rings_create(&self, request: KeyRing, parent: &str) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + ProjectLocationKeyRingCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _key_ring_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists KeyRings. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + pub fn locations_key_rings_list(&self, parent: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { + ProjectLocationKeyRingListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Schedule a CryptoKeyVersion for destruction. + /// + /// Upon calling this method, CryptoKeyVersion.state will be set to + /// DESTROY_SCHEDULED + /// and destroy_time will be set to a time 24 + /// hours in the future, at which point the state + /// will be changed to + /// DESTROYED, and the key + /// material will be irrevocably destroyed. + /// + /// Before the destroy_time is reached, + /// RestoreCryptoKeyVersion may be called to reverse the process. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the CryptoKeyVersion to destroy. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_destroy(&self, request: DestroyCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Encrypts data, so that it can only be recovered by a call to Decrypt. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the CryptoKey or CryptoKeyVersion + /// to use for encryption. + /// If a CryptoKey is specified, the server will use its + /// primary version. + pub fn locations_key_rings_crypto_keys_encrypt(&self, request: EncryptRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyEncryptCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns metadata for a given KeyRing. + /// + /// # Arguments + /// + /// * `name` - The name of the KeyRing to get. + pub fn locations_key_rings_get(&self, name: &str) -> ProjectLocationKeyRingGetCall<'a, C, A> { + ProjectLocationKeyRingGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns metadata for a given CryptoKey, as well as its + /// primary CryptoKeyVersion. + /// + /// # Arguments + /// + /// * `name` - The name of the CryptoKey to get. + pub fn locations_key_rings_crypto_keys_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists information about the supported locations for this service. + /// + /// # Arguments + /// + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> { + ProjectLocationKeyRingTestIamPermissionCall { + 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: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_crypto_keys_get_iam_policy(&self, resource: &str) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyGetIamPolicyCall { + 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: + /// + /// Update the version of a CryptoKey that will be used in Encrypt + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the CryptoKey to update. + pub fn locations_key_rings_crypto_keys_update_primary_version(&self, request: UpdateCryptoKeyPrimaryVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update a CryptoKey. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. The resource name for this CryptoKey in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + pub fn locations_key_rings_crypto_keys_patch(&self, request: CryptoKey, name: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Decrypts data that was protected by Encrypt. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the CryptoKey to use for decryption. + /// The server will choose the appropriate version. + pub fn locations_key_rings_crypto_keys_decrypt(&self, request: DecryptRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyDecryptCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_get_iam_policy(&self, resource: &str) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingGetIamPolicyCall { + 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: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingSetIamPolicyCall { + 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: + /// + /// Get information about a location. + /// + /// # Arguments + /// + /// * `name` - Resource name for the location. + pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { + ProjectLocationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_crypto_keys_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyTestIamPermissionCall { + 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: + /// + /// Lists CryptoKeyVersions. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name of the CryptoKey to list, in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_list(&self, parent: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists CryptoKeys. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name of the KeyRing to list, in the format + /// `projects/*/locations/*/keyRings/*`. + pub fn locations_key_rings_crypto_keys_list(&self, parent: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new CryptoKeyVersion in a CryptoKey. + /// + /// The server will assign the next sequential id. If unset, + /// state will be set to + /// ENABLED. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the CryptoKey associated with + /// the CryptoKeyVersions. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_create(&self, request: CryptoKeyVersion, parent: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns metadata for a given CryptoKeyVersion. + /// + /// # Arguments + /// + /// * `name` - The name of the CryptoKeyVersion to get. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_crypto_keys_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeySetIamPolicyCall { + 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: + /// + /// Restore a CryptoKeyVersion in the + /// DESTROY_SCHEDULED, + /// state. + /// + /// Upon restoration of the CryptoKeyVersion, state + /// will be set to DISABLED, + /// and destroy_time will be cleared. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the CryptoKeyVersion to restore. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_restore(&self, request: RestoreCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new CryptoKey within a KeyRing. + /// + /// CryptoKey.purpose is required. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the KeyRing associated with the + /// CryptoKeys. + pub fn locations_key_rings_crypto_keys_create(&self, request: CryptoKey, parent: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _crypto_key_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Update a CryptoKeyVersion's metadata. +/// +/// state may be changed between +/// ENABLED and +/// DISABLED using this +/// method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to +/// move between other states. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::CryptoKeyVersion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKeyVersion::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().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") +/// .update_mask("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKeyVersion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'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, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CryptoKeyVersion) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required list of fields to be updated in this request. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new KeyRing in a given Project and Location. +/// +/// A builder for the *locations.keyRings.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::KeyRing; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = KeyRing::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().locations_key_rings_create(req, "parent") +/// .key_ring_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: KeyRing, + _parent: String, + _key_ring_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCreateCall<'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, KeyRing)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._key_ring_id { + params.push(("keyRingId", value.to_string())); + } + for &field in ["alt", "parent", "keyRingId"].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 = self.hub._base_url.clone() + "v1/{+parent}/keyRings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: KeyRing) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Required. It must be unique within a location and match the regular + /// expression `[a-zA-Z0-9_-]{1,63}` + /// + /// Sets the *key ring id* query property to the given value. + pub fn key_ring_id(mut self, new_value: &str) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._key_ring_id = 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) -> ProjectLocationKeyRingCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists KeyRings. +/// +/// A builder for the *locations.keyRings.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_list("parent") +/// .page_token("erat") +/// .page_size(-35) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingListCall<'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, ListKeyRingsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/keyRings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional pagination token, returned earlier via + /// ListKeyRingsResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of KeyRings to include in the + /// response. Further KeyRings can subsequently be obtained by + /// including the ListKeyRingsResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Schedule a CryptoKeyVersion for destruction. +/// +/// Upon calling this method, CryptoKeyVersion.state will be set to +/// DESTROY_SCHEDULED +/// and destroy_time will be set to a time 24 +/// hours in the future, at which point the state +/// will be changed to +/// DESTROYED, and the key +/// material will be irrevocably destroyed. +/// +/// Before the destroy_time is reached, +/// RestoreCryptoKeyVersion may be called to reverse the process. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::DestroyCryptoKeyVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DestroyCryptoKeyVersionRequest::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().locations_key_rings_crypto_keys_crypto_key_versions_destroy(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: DestroyCryptoKeyVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'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, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:destroy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DestroyCryptoKeyVersionRequest) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the CryptoKeyVersion to destroy. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Encrypts data, so that it can only be recovered by a call to Decrypt. +/// +/// A builder for the *locations.keyRings.cryptoKeys.encrypt* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::EncryptRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EncryptRequest::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().locations_key_rings_crypto_keys_encrypt(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: EncryptRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyEncryptCall<'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, EncryptResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.encrypt", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:encrypt"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: EncryptRequest) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the CryptoKey or CryptoKeyVersion + /// to use for encryption. + /// + /// If a CryptoKey is specified, the server will use its + /// primary version. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns metadata for a given KeyRing. +/// +/// A builder for the *locations.keyRings.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingGetCall<'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, KeyRing)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the KeyRing to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns metadata for a given CryptoKey, as well as its +/// primary CryptoKeyVersion. +/// +/// A builder for the *locations.keyRings.cryptoKeys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetCall<'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, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the CryptoKey to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists information about the supported locations for this service. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_list("name") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .filter("no") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'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, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource that owns the locations collection, if applicable. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'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) -> ProjectLocationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *locations.keyRings.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationKeyRingTestIamPermissionCall<'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) -> ProjectLocationKeyRingTestIamPermissionCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.keyRings.cryptoKeys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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(Bearer { 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(d); + 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(d); + 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 the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'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) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update the version of a CryptoKey that will be used in Encrypt +/// +/// A builder for the *locations.keyRings.cryptoKeys.updatePrimaryVersion* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::UpdateCryptoKeyPrimaryVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateCryptoKeyPrimaryVersionRequest::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().locations_key_rings_crypto_keys_update_primary_version(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: UpdateCryptoKeyPrimaryVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'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, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:updatePrimaryVersion"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UpdateCryptoKeyPrimaryVersionRequest) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the CryptoKey to update. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update a CryptoKey. +/// +/// A builder for the *locations.keyRings.cryptoKeys.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::CryptoKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKey::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().locations_key_rings_crypto_keys_patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKey, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyPatchCall<'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, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CryptoKey) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The resource name for this CryptoKey in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required list of fields to be updated in this request. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyPatchCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Decrypts data that was protected by Encrypt. +/// +/// A builder for the *locations.keyRings.cryptoKeys.decrypt* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::DecryptRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DecryptRequest::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().locations_key_rings_crypto_keys_decrypt(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: DecryptRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyDecryptCall<'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, DecryptResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.decrypt", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:decrypt"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DecryptRequest) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the CryptoKey to use for decryption. + /// The server will choose the appropriate version. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.keyRings.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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(Bearer { 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(d); + 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(d); + 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 the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationKeyRingGetIamPolicyCall<'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) -> ProjectLocationKeyRingGetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *locations.keyRings.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingSetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationKeyRingSetIamPolicyCall<'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) -> ProjectLocationKeyRingSetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a location. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationGetCall<'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, Location)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Resource name for the location. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *locations.keyRings.cryptoKeys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'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) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists CryptoKeyVersions. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_crypto_key_versions_list("parent") +/// .page_token("Lorem") +/// .page_size(-75) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'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, ListCryptoKeyVersionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/cryptoKeyVersions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the CryptoKey to list, in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional pagination token, returned earlier via + /// ListCryptoKeyVersionsResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of CryptoKeyVersions to + /// include in the response. Further CryptoKeyVersions can + /// subsequently be obtained by including the + /// ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. + /// If unspecified, the server will pick an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists CryptoKeys. +/// +/// A builder for the *locations.keyRings.cryptoKeys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_list("parent") +/// .page_token("sadipscing") +/// .page_size(-48) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'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, ListCryptoKeysResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/cryptoKeys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the KeyRing to list, in the format + /// `projects/*/locations/*/keyRings/*`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional pagination token, returned earlier via + /// ListCryptoKeysResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of CryptoKeys to include in the + /// response. Further CryptoKeys can subsequently be obtained by + /// including the ListCryptoKeysResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new CryptoKeyVersion in a CryptoKey. +/// +/// The server will assign the next sequential id. If unset, +/// state will be set to +/// ENABLED. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::CryptoKeyVersion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKeyVersion::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().locations_key_rings_crypto_keys_crypto_key_versions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKeyVersion, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'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, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/cryptoKeyVersions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CryptoKeyVersion) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the CryptoKey associated with + /// the CryptoKeyVersions. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + self._parent = 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns metadata for a given CryptoKeyVersion. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_crypto_key_versions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'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, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the CryptoKeyVersion to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *locations.keyRings.cryptoKeys.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_key_rings_crypto_keys_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'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) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Restore a CryptoKeyVersion in the +/// DESTROY_SCHEDULED, +/// state. +/// +/// Upon restoration of the CryptoKeyVersion, state +/// will be set to DISABLED, +/// and destroy_time will be cleared. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.restore* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::RestoreCryptoKeyVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RestoreCryptoKeyVersionRequest::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().locations_key_rings_crypto_keys_crypto_key_versions_restore(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: RestoreCryptoKeyVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'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, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:restore"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RestoreCryptoKeyVersionRequest) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the CryptoKeyVersion to restore. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new CryptoKey within a KeyRing. +/// +/// CryptoKey.purpose is required. +/// +/// A builder for the *locations.keyRings.cryptoKeys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1 as cloudkms1; +/// use cloudkms1::CryptoKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CryptoKey::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().locations_key_rings_crypto_keys_create(req, "parent") +/// .crypto_key_id("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKey, + _parent: String, + _crypto_key_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCreateCall<'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, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._crypto_key_id { + params.push(("cryptoKeyId", value.to_string())); + } + for &field in ["alt", "parent", "cryptoKeyId"].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 = self.hub._base_url.clone() + "v1/{+parent}/cryptoKeys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CryptoKey) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the KeyRing associated with the + /// CryptoKeys. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Required. It must be unique within a KeyRing and match the regular + /// expression `[a-zA-Z0-9_-]{1,63}` + /// + /// Sets the *crypto key id* query property to the given value. + pub fn crypto_key_id(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._crypto_key_id = 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) -> ProjectLocationKeyRingCryptoKeyCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/cloudresourcemanager1-cli/Cargo.toml b/gen/cloudresourcemanager1-cli/Cargo.toml index 9cbdbf2bb4..d7776a946c 100644 --- a/gen/cloudresourcemanager1-cli/Cargo.toml +++ b/gen/cloudresourcemanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudresourcemanager1-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170920" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-cloudresourcemanager1] path = "../cloudresourcemanager1" -version = "1.0.6+20170517" +version = "1.0.6+20170920" diff --git a/gen/cloudresourcemanager1-cli/README.md b/gen/cloudresourcemanager1-cli/README.md index f8b0e90ecb..a6839aa5d4 100644 --- a/gen/cloudresourcemanager1-cli/README.md +++ b/gen/cloudresourcemanager1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Resource Manager* API at revision *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20170920*. The CLI is at version *1.0.6*. ```bash cloudresourcemanager1 [options] diff --git a/gen/cloudresourcemanager1-cli/mkdocs.yml b/gen/cloudresourcemanager1-cli/mkdocs.yml index 7a77e64f19..5ee27d1f36 100644 --- a/gen/cloudresourcemanager1-cli/mkdocs.yml +++ b/gen/cloudresourcemanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Resource Manager v1.0.6+20170517 +site_name: Cloud Resource Manager v1.0.6+20170920 site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager1-cli site_description: A complete library to interact with Cloud Resource Manager (protocol v1) diff --git a/gen/cloudresourcemanager1-cli/src/main.rs b/gen/cloudresourcemanager1-cli/src/main.rs index adb3e67f1d..f1c393e54f 100644 --- a/gen/cloudresourcemanager1-cli/src/main.rs +++ b/gen/cloudresourcemanager1-cli/src/main.rs @@ -1855,9 +1855,9 @@ impl<'n> Engine<'n> { "parent.id" => Some(("parent.id", 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 })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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", "id", "labels", "lifecycle-state", "name", "parent", "project-id", "project-number", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2973,9 +2973,9 @@ impl<'n> Engine<'n> { "parent.id" => Some(("parent.id", 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 })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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", "id", "labels", "lifecycle-state", "name", "parent", "project-id", "project-number", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3649,7 +3649,10 @@ fn main() { ("get-iam-policy", Some(r##"Gets the access control policy for an Organization resource. May be empty if no such policy or resource exists. The `resource` field should be the - organization's resource name, e.g. "organizations/123"."##), + organization's resource name, e.g. "organizations/123". + + Authorization requires the Google IAM permission + `resourcemanager.organizations.getIamPolicy` on the specified organization"##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_get-iam-policy", vec![ (Some(r##"resource"##), @@ -3770,7 +3773,10 @@ fn main() { Some(r##"Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the - results."##), + results. + + Search will only return organizations on which the user has the permission + `resourcemanager.organizations.get`"##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_search", vec![ (Some(r##"kv"##), @@ -3794,7 +3800,10 @@ fn main() { ("set-iam-policy", Some(r##"Sets the access control policy on an Organization resource. Replaces any existing policy. The `resource` field should be the organization's resource - name, e.g. "organizations/123"."##), + name, e.g. "organizations/123". + + Authorization requires the Google IAM permission + `resourcemanager.organizations.setIamPolicy` on the specified organization"##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_set-iam-policy", vec![ (Some(r##"resource"##), @@ -3857,7 +3866,9 @@ fn main() { ("test-iam-permissions", Some(r##"Returns permissions that a caller has on the specified Organization. The `resource` field should be the organization's resource name, - e.g. "organizations/123"."##), + e.g. "organizations/123". + + There are no permissions required for making this API call."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_test-iam-permissions", vec![ (Some(r##"resource"##), @@ -3924,7 +3935,11 @@ fn main() { Our SLO permits Project creation to take up to 30 seconds at the 90th percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile latency. 95th percentile latency is around 11 seconds. We recommend - polling at the 5th second with an exponential backoff."##), + polling at the 5th second with an exponential backoff. + + Authorization requires the Google IAM permission + `resourcemanager.projects.create` on the specified parent for the new + project."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_create", vec![ (Some(r##"kv"##), @@ -4084,7 +4099,10 @@ fn main() { ]), ("get-iam-policy", Some(r##"Returns the IAM access control policy for the specified Project. - Permission is denied if the policy or the resource does not exist."##), + Permission is denied if the policy or the resource does not exist. + + Authorization requires the Google IAM permission + `resourcemanager.projects.getIamPolicy` on the project"##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_get-iam-policy", vec![ (Some(r##"resource"##), @@ -4245,19 +4263,23 @@ fn main() { + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. - + There must be at least one owner who has accepted the Terms of - Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - remove the last ToS-accepted owner from the policy will fail. This - restriction also applies to legacy projects that no longer have owners - who have accepted the ToS. Edits to IAM policies will be rejected until - the lack of a ToS-accepting owner is rectified. + + If the project is not part of an organization, there must be at least + one owner who has accepted the Terms of Service (ToS) agreement in the + policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + from the policy will fail. This restriction also applies to legacy + projects that no longer have owners who have accepted the ToS. Edits to + IAM policies will be rejected until the lack of a ToS-accepting owner is + rectified. + Calling this method requires enabling the App Engine Admin API. Note: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its - roles."##), + roles. + + Authorization requires the Google IAM permission + `resourcemanager.projects.setIamPolicy` on the project"##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_set-iam-policy", vec![ (Some(r##"resource"##), @@ -4318,7 +4340,9 @@ fn main() { Some(false)), ]), ("test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified Project."##), + Some(r##"Returns permissions that a caller has on the specified Project. + + There are no permissions required for making this API call."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_test-iam-permissions", vec![ (Some(r##"resource"##), @@ -4421,7 +4445,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170920") .about("The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudresourcemanager1/Cargo.toml b/gen/cloudresourcemanager1/Cargo.toml index 26c28527ab..4cbb6f071c 100644 --- a/gen/cloudresourcemanager1/Cargo.toml +++ b/gen/cloudresourcemanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager1" -version = "1.0.6+20170517" +version = "1.0.6+20170920" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1" homepage = "https://cloud.google.com/resource-manager" -documentation = "https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517" +documentation = "https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] diff --git a/gen/cloudresourcemanager1/README.md b/gen/cloudresourcemanager1/README.md index a15ac01654..ab73e1f7a7 100644 --- a/gen/cloudresourcemanager1/README.md +++ b/gen/cloudresourcemanager1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-cloudresourcemanager1` library allows access to all features of the *Google Cloud Resource Manager* service. -This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20170920*, where *20170920* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Cloud Resource Manager* *v1* 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](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... * folders - * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.FolderListOrgPolicyCall.html) and [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.FolderSetOrgPolicyCall.html) -* [liens](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.Lien.html) - * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.LienCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.LienDeleteCall.html) and [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.LienListCall.html) -* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.Operation.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OperationGetCall.html) -* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.Organization.html) - * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationClearOrgPolicyCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationListOrgPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) -* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.Project.html) - * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectClearOrgPolicyCall.html), [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectGetOrgPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectListCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectListOrgPolicyCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.ProjectUpdateCall.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.FolderListOrgPolicyCall.html) and [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.FolderSetOrgPolicyCall.html) +* [liens](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.Lien.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.LienCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.LienDeleteCall.html) and [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.LienListCall.html) +* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OperationGetCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.Organization.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationClearOrgPolicyCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationListOrgPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.Project.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectClearOrgPolicyCall.html), [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectGetOrgPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectListCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectListOrgPolicyCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.ProjectUpdateCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/struct.CloudResourceManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -142,17 +142,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/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")`. @@ -162,29 +162,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/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](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/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](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/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](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/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](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170517/google_cloudresourcemanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudresourcemanager1/src/lib.rs b/gen/cloudresourcemanager1/src/lib.rs index 929c98be51..3afa31a8e5 100644 --- a/gen/cloudresourcemanager1/src/lib.rs +++ b/gen/cloudresourcemanager1/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 Resource Manager* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20170920*, where *20170920* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Cloud Resource Manager* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -450,44 +450,56 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Associates `members` with a `role`. +/// A Lien represents an encumbrance on the actions that can be performed on a +/// resource. /// -/// 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*). +/// +/// * [create liens](struct.LienCreateCall.html) (request|response) +/// * [delete liens](struct.LienDeleteCall.html) (none) +/// * [list liens](struct.LienListCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to `members`. - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - /// Required - pub role: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. - /// `members` can have the following values: +pub struct Lien { + /// A stable, user-visible/meaningful string identifying the origin of the + /// Lien, intended to be inspected programmatically. Maximum length of 200 + /// characters. /// - /// * `allUsers`: A special identifier that represents anyone who is - /// on the internet; with or without a Google account. + /// Example: 'compute.googleapis.com' + pub origin: Option, + /// The types of operations which should be blocked as a result of this Lien. + /// Each value should correspond to an IAM permission. The server will + /// validate the permissions against those for which Liens are supported. /// - /// * `allAuthenticatedUsers`: A special identifier that represents anyone - /// who is authenticated with a Google account or a service account. + /// An empty list is meaningless and will be rejected. /// - /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// Example: ['resourcemanager.projects.delete'] + pub restrictions: Option>, + /// Concise user-visible strings indicating why an action cannot be performed + /// on a resource. Maximum lenth of 200 characters. /// + /// Example: 'Holds production API key' + pub reason: Option, + /// A system-generated unique identifier for this Lien. /// - /// * `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// Example: `liens/1234abcd` + pub name: Option, + /// A reference to the resource this Lien is attached to. The server will + /// validate the parent against those for which Liens are supported. /// - /// * `group:{emailid}`: An email address that represents a Google group. - /// For example, `admins@example.com`. - /// - /// - /// * `domain:{domain}`: A Google Apps domain name that represents all the - /// users of that domain. For example, `google.com` or `example.com`. - /// - /// - pub members: Option>, + /// Example: `projects/1234` + pub parent: Option, + /// The creation time of this Lien. + #[serde(rename="createTime")] + pub create_time: Option, } -impl Part for Binding {} +impl RequestValue for Lien {} +impl Resource for Lien {} +impl ResponseResult for Lien {} /// Ignores policies set above this resource and restores the @@ -555,10 +567,9 @@ impl Part for RestoreDefault {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// Multiple `bindings` must not be specified for the same `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// It is strongly suggested that systems make use of the `etag` in the @@ -570,9 +581,9 @@ pub struct Policy { /// If no `etag` is provided in the call to `setIamPolicy`, then the existing /// policy is overwritten blindly. pub etag: Option, - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, /// Version of the `Policy`. The default version is 0. pub version: Option, } @@ -685,8 +696,8 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a - /// common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. pub details: Option>>, } @@ -713,42 +724,20 @@ pub struct TestIamPermissionsResponse { impl ResponseResult for TestIamPermissionsResponse {} -/// A page of the response received from the -/// ListProjects -/// method. +/// A `Constraint` that allows or disallows a list of string values, which are +/// configured by an Organization's policy administrator with a `Policy`. /// -/// 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) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[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. - #[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>, +pub struct ListConstraint { + /// Optional. The Google Cloud Console will try to default to a configuration + /// that matches the value specified in this `Constraint`. + #[serde(rename="suggestedValue")] + pub suggested_value: Option, } -impl ResponseResult for ListProjectsResponse {} +impl Part for ListConstraint {} /// The response returned from the ListAvailableOrgPolicyConstraints method. @@ -777,28 +766,6 @@ pub struct ListAvailableOrgPolicyConstraintsResponse { impl ResponseResult for ListAvailableOrgPolicyConstraintsResponse {} -/// The response message for Liens.ListLiens. -/// -/// # 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 liens](struct.LienListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListLiensResponse { - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of Liens. - pub liens: Option>, -} - -impl ResponseResult for ListLiensResponse {} - - /// A container to reference an id for any resource type. A `resource` in Google /// Cloud Platform is a generic term for something you (a developer) may want to /// interact with through one of our API's. Some examples are an App Engine app, @@ -838,8 +805,8 @@ pub struct ListPolicy { /// The policy all_values state. #[serde(rename="allValues")] pub all_values: Option, - /// List of values allowed at this resource. an only be set if no values are - /// set for `denied_values` and `all_values` is set to + /// List of values allowed at this resource. Can only be set if no values + /// are set for `denied_values` and `all_values` is set to /// `ALL_VALUES_UNSPECIFIED`. #[serde(rename="allowedValues")] pub allowed_values: Option>, @@ -999,68 +966,24 @@ pub struct BooleanPolicy { impl Part for BooleanPolicy {} -/// Defines a Cloud Organization `Policy` which is used to specify `Constraints` -/// for configurations of Cloud Platform resources. +/// Response from the GetAncestry 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*). /// -/// * [set org policy folders](struct.FolderSetOrgPolicyCall.html) (response) -/// * [get org policy organizations](struct.OrganizationGetOrgPolicyCall.html) (response) -/// * [get effective org policy projects](struct.ProjectGetEffectiveOrgPolicyCall.html) (response) -/// * [set org policy organizations](struct.OrganizationSetOrgPolicyCall.html) (response) -/// * [get effective org policy folders](struct.FolderGetEffectiveOrgPolicyCall.html) (response) -/// * [get org policy folders](struct.FolderGetOrgPolicyCall.html) (response) -/// * [get effective org policy organizations](struct.OrganizationGetEffectiveOrgPolicyCall.html) (response) -/// * [get org policy projects](struct.ProjectGetOrgPolicyCall.html) (response) -/// * [set org policy projects](struct.ProjectSetOrgPolicyCall.html) (response) +/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrgPolicy { - /// The time stamp the `Policy` was previously updated. This is set by the - /// server, not specified by the caller, and represents the last time a call to - /// `SetOrgPolicy` was made for that `Policy`. Any value set by the client will - /// be ignored. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Version of the `Policy`. Default version is 0; - pub version: Option, - /// An opaque tag indicating the current version of the `Policy`, used for - /// concurrency control. - /// - /// When the `Policy` is returned from either a `GetPolicy` or a - /// `ListOrgPolicy` request, this `etag` indicates the version of the current - /// `Policy` to use when executing a read-modify-write loop. - /// - /// When the `Policy` is returned from a `GetEffectivePolicy` request, the - /// `etag` will be unset. - /// - /// When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value - /// that was returned from a `GetOrgPolicy` request as part of a - /// read-modify-write loop for concurrency control. Not setting the `etag`in a - /// `SetOrgPolicy` request will result in an unconditional write of the - /// `Policy`. - pub etag: Option, - /// The name of the `Constraint` the `Policy` is configuring, for example, - /// `constraints/serviceuser.services`. - /// - /// Immutable after creation. - pub constraint: Option, - /// Restores the default behavior of the constraint; independent of - /// `Constraint` type. - #[serde(rename="restoreDefault")] - pub restore_default: Option, - /// List of values either allowed or disallowed. - #[serde(rename="listPolicy")] - pub list_policy: Option, - /// For boolean `Constraints`, whether to enforce the `Constraint` or not. - #[serde(rename="booleanPolicy")] - pub boolean_policy: Option, +pub struct GetAncestryResponse { + /// Ancestors are ordered from bottom to top of the resource hierarchy. The + /// first ancestor is the project itself, followed by the project's parent, + /// etc. + pub ancestor: Option>, } -impl ResponseResult for OrgPolicy {} +impl ResponseResult for GetAncestryResponse {} /// The request sent to the SetOrgPolicyRequest method. @@ -1187,20 +1110,20 @@ pub struct Constraint { /// Mutable. #[serde(rename="displayName")] pub display_name: Option, - /// Detailed description of what this `Constraint` controls as well as how and - /// where it is enforced. - /// - /// Mutable. - pub description: Option, + /// Immutable value, required to globally be unique. For example, + /// `constraints/serviceuser.services` + pub name: Option, /// Defines this constraint as being a BooleanConstraint. #[serde(rename="booleanConstraint")] pub boolean_constraint: Option, /// Defines this constraint as being a ListConstraint. #[serde(rename="listConstraint")] pub list_constraint: Option, - /// Immutable value, required to globally be unique. For example, - /// `constraints/serviceuser.services` - pub name: Option, + /// Detailed description of what this `Constraint` controls as well as how and + /// where it is enforced. + /// + /// Mutable. + pub description: Option, } impl Part for Constraint {} @@ -1220,24 +1143,27 @@ pub struct BooleanConstraint { _never_set: Option } impl Part for BooleanConstraint {} -/// Response from the GetAncestry method. +/// The request sent to the ClearOrgPolicy 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*). /// -/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (response) +/// * [clear org policy folders](struct.FolderClearOrgPolicyCall.html) (request) +/// * [clear org policy organizations](struct.OrganizationClearOrgPolicyCall.html) (request) +/// * [clear org policy projects](struct.ProjectClearOrgPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetAncestryResponse { - /// Ancestors are ordered from bottom to top of the resource hierarchy. The - /// first ancestor is the project itself, followed by the project's parent, - /// etc. - pub ancestor: Option>, +pub struct ClearOrgPolicyRequest { + /// The current version, for concurrency control. Not sending an `etag` + /// will cause the `Policy` to be cleared blindly. + pub etag: Option, + /// Name of the `Constraint` of the `Policy` to clear. + pub constraint: Option, } -impl ResponseResult for GetAncestryResponse {} +impl RequestValue for ClearOrgPolicyRequest {} /// A Project is a high-level Google Cloud Platform entity. It is a @@ -1310,17 +1236,17 @@ pub struct Project { /// Example: "environment" : "dev" /// Read-write. pub labels: Option>, - /// Creation time. - /// - /// Read-only. - #[serde(rename="createTime")] - pub create_time: 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. @@ -1333,22 +1259,6 @@ impl Resource for Project {} impl ResponseResult for Project {} -/// The request sent to the UndeleteProject -/// 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*). -/// -/// * [undelete projects](struct.ProjectUndeleteCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UndeleteProjectRequest { _never_set: Option } - -impl RequestValue for UndeleteProjectRequest {} - - /// The request sent to the /// GetAncestry /// method. @@ -1366,29 +1276,6 @@ pub struct GetAncestryRequest { _never_set: Option } impl RequestValue for GetAncestryRequest {} -/// The request sent to the ClearOrgPolicy 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*). -/// -/// * [clear org policy folders](struct.FolderClearOrgPolicyCall.html) (request) -/// * [clear org policy organizations](struct.OrganizationClearOrgPolicyCall.html) (request) -/// * [clear org policy projects](struct.ProjectClearOrgPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ClearOrgPolicyRequest { - /// The current version, for concurrency control. Not sending an `etag` - /// will cause the `Policy` to be cleared blindly. - pub etag: Option, - /// Name of the `Constraint` of the `Policy` to clear. - pub constraint: Option, -} - -impl RequestValue for ClearOrgPolicyRequest {} - - /// The root node in the resource hierarchy to which a particular entity's /// (e.g., company) resources belong. /// @@ -1439,20 +1326,42 @@ impl Resource for Organization {} impl ResponseResult for Organization {} -/// A `Constraint` that allows or disallows a list of string values, which are -/// configured by an Organization's policy administrator with a `Policy`. +/// A page of the response received from the +/// ListProjects +/// method. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// 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 ListConstraint { - /// Optional. The Google Cloud Console will try to default to a configuration - /// that matches the value specified in this `Constraint`. - #[serde(rename="suggestedValue")] - pub suggested_value: Option, +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. + #[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 Part for ListConstraint {} +impl ResponseResult for ListProjectsResponse {} /// The request sent to the GetOrgPolicy method. @@ -1503,6 +1412,22 @@ pub struct ListAvailableOrgPolicyConstraintsRequest { impl RequestValue for ListAvailableOrgPolicyConstraintsRequest {} +/// The request sent to the UndeleteProject +/// 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*). +/// +/// * [undelete projects](struct.ProjectUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UndeleteProjectRequest { _never_set: Option } + +impl RequestValue for UndeleteProjectRequest {} + + /// The request sent to the ListOrgPolicies method. /// /// # Activities @@ -1530,56 +1455,66 @@ pub struct ListOrgPoliciesRequest { impl RequestValue for ListOrgPoliciesRequest {} -/// A Lien represents an encumbrance on the actions that can be performed on a -/// resource. +/// The response message for Liens.ListLiens. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [create liens](struct.LienCreateCall.html) (request|response) -/// * [delete liens](struct.LienDeleteCall.html) (none) -/// * [list liens](struct.LienListCall.html) (none) +/// * [list liens](struct.LienListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Lien { - /// A stable, user-visible/meaningful string identifying the origin of the - /// Lien, intended to be inspected programmatically. Maximum length of 200 - /// characters. - /// - /// Example: 'compute.googleapis.com' - pub origin: Option, - /// The types of operations which should be blocked as a result of this Lien. - /// Each value should correspond to an IAM permission. The server will - /// validate the permissions against those for which Liens are supported. - /// - /// An empty list is meaningless and will be rejected. - /// - /// Example: ['resourcemanager.projects.delete'] - pub restrictions: Option>, - /// Concise user-visible strings indicating why an action cannot be performed - /// on a resource. Maximum lenth of 200 characters. - /// - /// Example: 'Holds production API key' - pub reason: Option, - /// A system-generated unique identifier for this Lien. - /// - /// Example: `liens/1234abcd` - pub name: Option, - /// A reference to the resource this Lien is attached to. The server will - /// validate the parent against those for which Liens are supported. - /// - /// Example: `projects/1234` - pub parent: Option, - /// The creation time of this Lien. - #[serde(rename="createTime")] - pub create_time: Option, +pub struct ListLiensResponse { + /// Token to retrieve the next page of results, or empty if there are no more + /// results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of Liens. + pub liens: Option>, } -impl RequestValue for Lien {} -impl Resource for Lien {} -impl ResponseResult for Lien {} +impl ResponseResult for ListLiensResponse {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} /// Specifies the audit configuration for a service. @@ -1651,6 +1586,32 @@ pub struct AuditConfig { impl Part for AuditConfig {} +/// The response returned from the ListOrgPolicies method. It will be empty +/// if no `Policies` are set on the resource. +/// +/// # 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 org policies organizations](struct.OrganizationListOrgPolicyCall.html) (response) +/// * [list org policies projects](struct.ProjectListOrgPolicyCall.html) (response) +/// * [list org policies folders](struct.FolderListOrgPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOrgPoliciesResponse { + /// Page token used to retrieve the next page. This is currently not used, but + /// the server may at any point start supplying a valid token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The `Policies` that are set on the resource. It will be empty if no + /// `Policies` are set. + pub policies: Option>, +} + +impl ResponseResult for ListOrgPoliciesResponse {} + + /// The request sent to the `SearchOrganizations` method. /// /// # Activities @@ -1707,7 +1668,7 @@ pub struct Operation { /// The error result of the operation in case of failure or cancellation. pub error: Option, /// If the value is `false`, it means the operation is still in progress. - /// If true, the operation is completed, and either `error` or `response` is + /// If `true`, the operation is completed, and either `error` or `response` is /// available. pub done: Option, /// The normal response of the operation in case of success. If the original @@ -1754,30 +1715,68 @@ pub struct GetEffectiveOrgPolicyRequest { impl RequestValue for GetEffectiveOrgPolicyRequest {} -/// The response returned from the ListOrgPolicies method. It will be empty -/// if no `Policies` are set on the resource. +/// Defines a Cloud Organization `Policy` which is used to specify `Constraints` +/// for configurations of Cloud Platform resources. /// /// # 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 org policies organizations](struct.OrganizationListOrgPolicyCall.html) (response) -/// * [list org policies projects](struct.ProjectListOrgPolicyCall.html) (response) -/// * [list org policies folders](struct.FolderListOrgPolicyCall.html) (response) +/// * [set org policy folders](struct.FolderSetOrgPolicyCall.html) (response) +/// * [get org policy organizations](struct.OrganizationGetOrgPolicyCall.html) (response) +/// * [get effective org policy organizations](struct.OrganizationGetEffectiveOrgPolicyCall.html) (response) +/// * [set org policy organizations](struct.OrganizationSetOrgPolicyCall.html) (response) +/// * [get effective org policy folders](struct.FolderGetEffectiveOrgPolicyCall.html) (response) +/// * [get org policy folders](struct.FolderGetOrgPolicyCall.html) (response) +/// * [get org policy projects](struct.ProjectGetOrgPolicyCall.html) (response) +/// * [get effective org policy projects](struct.ProjectGetEffectiveOrgPolicyCall.html) (response) +/// * [set org policy projects](struct.ProjectSetOrgPolicyCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListOrgPoliciesResponse { - /// Page token used to retrieve the next page. This is currently not used, but - /// the server may at any point start supplying a valid token. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The `Policies` that are set on the resource. It will be empty if no - /// `Policies` are set. - pub policies: Option>, +pub struct OrgPolicy { + /// The time stamp the `Policy` was previously updated. This is set by the + /// server, not specified by the caller, and represents the last time a call to + /// `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + /// be ignored. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Version of the `Policy`. Default version is 0; + pub version: Option, + /// An opaque tag indicating the current version of the `Policy`, used for + /// concurrency control. + /// + /// When the `Policy` is returned from either a `GetPolicy` or a + /// `ListOrgPolicy` request, this `etag` indicates the version of the current + /// `Policy` to use when executing a read-modify-write loop. + /// + /// When the `Policy` is returned from a `GetEffectivePolicy` request, the + /// `etag` will be unset. + /// + /// When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + /// that was returned from a `GetOrgPolicy` request as part of a + /// read-modify-write loop for concurrency control. Not setting the `etag`in a + /// `SetOrgPolicy` request will result in an unconditional write of the + /// `Policy`. + pub etag: Option, + /// The name of the `Constraint` the `Policy` is configuring, for example, + /// `constraints/serviceuser.services`. + /// + /// Immutable after creation. + pub constraint: Option, + /// Restores the default behavior of the constraint; independent of + /// `Constraint` type. + #[serde(rename="restoreDefault")] + pub restore_default: Option, + /// List of values either allowed or disallowed. + #[serde(rename="listPolicy")] + pub list_policy: Option, + /// For boolean `Constraints`, whether to enforce the `Constraint` or not. + #[serde(rename="booleanPolicy")] + pub boolean_policy: Option, } -impl ResponseResult for ListOrgPoliciesResponse {} +impl ResponseResult for OrgPolicy {} /// The entity that owns an Organization. The lifetime of the Organization and @@ -1843,16 +1842,14 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the effective `Policy` on a resource. This is the result of merging - /// `Policies` in the resource hierarchy. The returned `Policy` will not have - /// an `etag`set because it is a computed `Policy` across multiple resources. + /// Clears a `Policy` from a resource. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - The name of the resource to start computing the effective `Policy`. - pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> { - FolderGetEffectiveOrgPolicyCall { + /// * `resource` - Name of the resource for the `Policy` to clear. + pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> FolderClearOrgPolicyCall<'a, C, A> { + FolderClearOrgPolicyCall { hub: self.hub, _request: request, _resource: resource.to_string(), @@ -1864,14 +1861,16 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Clears a `Policy` from a resource. + /// Gets the effective `Policy` on a resource. This is the result of merging + /// `Policies` in the resource hierarchy. The returned `Policy` will not have + /// an `etag`set because it is a computed `Policy` across multiple resources. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - Name of the resource for the `Policy` to clear. - pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> FolderClearOrgPolicyCall<'a, C, A> { - FolderClearOrgPolicyCall { + /// * `resource` - The name of the resource to start computing the effective `Policy`. + pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> { + FolderGetEffectiveOrgPolicyCall { hub: self.hub, _request: request, _resource: resource.to_string(), @@ -2008,25 +2007,6 @@ impl<'a, C, A> MethodsBuilder for OrganizationMethods<'a, C, A> {} impl<'a, C, A> OrganizationMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Clears a `Policy` from a resource. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - Name of the resource for the `Policy` to clear. - pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> OrganizationClearOrgPolicyCall<'a, C, A> { - OrganizationClearOrgPolicyCall { - 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: /// /// Gets a `Policy` on a resource. @@ -2095,6 +2075,9 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// existing policy. The `resource` field should be the organization's resource /// name, e.g. "organizations/123". /// + /// Authorization requires the Google IAM permission + /// `resourcemanager.organizations.setIamPolicy` on the specified organization + /// /// # Arguments /// /// * `request` - No description provided. @@ -2156,6 +2139,9 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// order. New Organizations do not necessarily appear at the end of the /// results. /// + /// Search will only return organizations on which the user has the permission + /// `resourcemanager.organizations.get` + /// /// # Arguments /// /// * `request` - No description provided. @@ -2175,6 +2161,9 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// if no such policy or resource exists. The `resource` field should be the /// organization's resource name, e.g. "organizations/123". /// + /// Authorization requires the Google IAM permission + /// `resourcemanager.organizations.getIamPolicy` on the specified organization + /// /// # Arguments /// /// * `request` - No description provided. @@ -2197,6 +2186,8 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// The `resource` field should be the organization's resource name, /// e.g. "organizations/123". /// + /// There are no permissions required for making this API call. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2235,6 +2226,25 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Clears a `Policy` from a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource for the `Policy` to clear. + pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> OrganizationClearOrgPolicyCall<'a, C, A> { + OrganizationClearOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2429,6 +2439,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Returns the IAM access control policy for the specified Project. /// Permission is denied if the policy or the resource does not exist. /// + /// Authorization requires the Google IAM permission + /// `resourcemanager.projects.getIamPolicy` on the project + /// /// # Arguments /// /// * `request` - No description provided. @@ -2456,6 +2469,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// latency. 95th percentile latency is around 11 seconds. We recommend /// polling at the 5th second with an exponential backoff. /// + /// Authorization requires the Google IAM permission + /// `resourcemanager.projects.create` on the specified parent for the new + /// project. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2584,6 +2601,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Returns permissions that a caller has on the specified Project. /// + /// There are no permissions required for making this API call. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2659,52 +2678,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the IAM access control policy for the specified Project. Replaces - /// any existing policy. - /// - /// The following constraints apply when using `setIamPolicy()`: - /// - /// + Project does not support `allUsers` and `allAuthenticatedUsers` as - /// `members` in a `Binding` of a `Policy`. - /// - /// + The owner role can be granted only to `user` and `serviceAccount`. - /// - /// + Service accounts can be made owners of a project directly - /// without any restrictions. However, to be added as an owner, a user must be - /// invited via Cloud Platform console and must accept the invitation. - /// - /// + A user cannot be granted the owner role using `setIamPolicy()`. The user - /// must be granted the owner role using the Cloud Platform Console and must - /// explicitly accept the invitation. - /// - /// + Invitations to grant the owner role cannot be sent using - /// `setIamPolicy()`; - /// they must be sent only using the Cloud Platform Console. - /// - /// + Membership changes that leave the project without any owners that have - /// accepted the Terms of Service (ToS) will be rejected. - /// - /// + There must be at least one owner who has accepted the Terms of - /// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - /// remove the last ToS-accepted owner from the policy will fail. This - /// restriction also applies to legacy projects that no longer have owners - /// who have accepted the ToS. Edits to IAM policies will be rejected until - /// the lack of a ToS-accepting owner is rectified. - /// - /// + Calling this method requires enabling the App Engine Admin API. - /// - /// Note: Removing service accounts from policies or changing their roles - /// can render services completely inoperable. It is important to understand - /// how the service account is being used before removing or updating its - /// roles. + /// Gets the effective `Policy` on a resource. This is the result of merging + /// `Policies` in the resource hierarchy. The returned `Policy` will not have + /// an `etag`set because it is a computed `Policy` across multiple resources. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSetIamPolicyCall<'a, C, A> { - ProjectSetIamPolicyCall { + /// * `resource` - The name of the resource to start computing the effective `Policy`. + pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { + ProjectGetEffectiveOrgPolicyCall { hub: self.hub, _request: request, _resource: resource.to_string(), @@ -2762,16 +2745,56 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the effective `Policy` on a resource. This is the result of merging - /// `Policies` in the resource hierarchy. The returned `Policy` will not have - /// an `etag`set because it is a computed `Policy` across multiple resources. + /// Sets the IAM access control policy for the specified Project. Replaces + /// any existing policy. + /// + /// The following constraints apply when using `setIamPolicy()`: + /// + /// + Project does not support `allUsers` and `allAuthenticatedUsers` as + /// `members` in a `Binding` of a `Policy`. + /// + /// + The owner role can be granted only to `user` and `serviceAccount`. + /// + /// + Service accounts can be made owners of a project directly + /// without any restrictions. However, to be added as an owner, a user must be + /// invited via Cloud Platform console and must accept the invitation. + /// + /// + A user cannot be granted the owner role using `setIamPolicy()`. The user + /// must be granted the owner role using the Cloud Platform Console and must + /// explicitly accept the invitation. + /// + /// + Invitations to grant the owner role cannot be sent using + /// `setIamPolicy()`; + /// they must be sent only using the Cloud Platform Console. + /// + /// + Membership changes that leave the project without any owners that have + /// accepted the Terms of Service (ToS) will be rejected. + /// + /// + If the project is not part of an organization, there must be at least + /// one owner who has accepted the Terms of Service (ToS) agreement in the + /// policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + /// from the policy will fail. This restriction also applies to legacy + /// projects that no longer have owners who have accepted the ToS. Edits to + /// IAM policies will be rejected until the lack of a ToS-accepting owner is + /// rectified. + /// + /// + Calling this method requires enabling the App Engine Admin API. + /// + /// Note: Removing service accounts from policies or changing their roles + /// can render services completely inoperable. It is important to understand + /// how the service account is being used before removing or updating its + /// roles. + /// + /// Authorization requires the Google IAM permission + /// `resourcemanager.projects.setIamPolicy` on the project /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - The name of the resource to start computing the effective `Policy`. - pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { - ProjectGetEffectiveOrgPolicyCall { + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSetIamPolicyCall<'a, C, A> { + ProjectSetIamPolicyCall { hub: self.hub, _request: request, _resource: resource.to_string(), @@ -2851,6 +2874,290 @@ impl<'a, C, A> OperationMethods<'a, C, A> { // CallBuilders ### // ################# +/// Clears a `Policy` from a resource. +/// +/// A builder for the *clearOrgPolicy* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ClearOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ClearOrgPolicyRequest::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.folders().clear_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct FolderClearOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ClearOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderClearOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> FolderClearOrgPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.folders.clearOrgPolicy", + 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 = self.hub._base_url.clone() + "v1/{+resource}:clearOrgPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ClearOrgPolicyRequest) -> FolderClearOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource for the `Policy` to clear. + /// + /// 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) -> FolderClearOrgPolicyCall<'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) -> FolderClearOrgPolicyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderClearOrgPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderClearOrgPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the effective `Policy` on a resource. This is the result of merging /// `Policies` in the resource hierarchy. The returned `Policy` will not have /// an `etag`set because it is a computed `Policy` across multiple resources. @@ -3137,290 +3444,6 @@ impl<'a, C, A> FolderGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudResourceManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ClearOrgPolicyRequest::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.folders().clear_org_policy(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct FolderClearOrgPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, - _request: ClearOrgPolicyRequest, - _resource: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderClearOrgPolicyCall<'a, C, A> {} - -impl<'a, C, A> FolderClearOrgPolicyCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.folders.clearOrgPolicy", - 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 = self.hub._base_url.clone() + "v1/{+resource}:clearOrgPolicy"; - 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(), DEFAULT_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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: ClearOrgPolicyRequest) -> FolderClearOrgPolicyCall<'a, C, A> { - self._request = new_value; - self - } - /// Name of the resource for the `Policy` to clear. - /// - /// 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) -> FolderClearOrgPolicyCall<'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) -> FolderClearOrgPolicyCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderClearOrgPolicyCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> FolderClearOrgPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists `Constraints` that could be applied on the specified resource. /// /// A builder for the *listAvailableOrgPolicyConstraints* method supported by a *folder* resource. @@ -4566,290 +4589,6 @@ impl<'a, C, A> FolderListOrgPolicyCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudResourceManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ClearOrgPolicyRequest::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.organizations().clear_org_policy(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationClearOrgPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, - _request: ClearOrgPolicyRequest, - _resource: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationClearOrgPolicyCall<'a, C, A> {} - -impl<'a, C, A> OrganizationClearOrgPolicyCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.organizations.clearOrgPolicy", - 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 = self.hub._base_url.clone() + "v1/{+resource}:clearOrgPolicy"; - 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(), DEFAULT_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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: ClearOrgPolicyRequest) -> OrganizationClearOrgPolicyCall<'a, C, A> { - self._request = new_value; - self - } - /// Name of the resource for the `Policy` to clear. - /// - /// 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) -> OrganizationClearOrgPolicyCall<'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) -> OrganizationClearOrgPolicyCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationClearOrgPolicyCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> OrganizationClearOrgPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets a `Policy` on a resource. /// /// If no `Policy` is set on the resource, a `Policy` is returned with default @@ -5710,6 +5449,9 @@ impl<'a, C, A> OrganizationListOrgPolicyCall<'a, C, A> where C: BorrowMut OrganizationGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMu /// the specified filter. This method returns Organizations in an unspecified /// order. New Organizations do not necessarily appear at the end of the /// results. +/// +/// Search will only return organizations on which the user has the permission +/// `resourcemanager.organizations.get` /// /// A builder for the *search* method supported by a *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. @@ -6786,6 +6531,9 @@ impl<'a, C, A> OrganizationSearchCall<'a, C, A> where C: BorrowMut OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationSetOrgPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ClearOrgPolicyRequest::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.organizations().clear_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationClearOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ClearOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationClearOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationClearOrgPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.organizations.clearOrgPolicy", + 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 = self.hub._base_url.clone() + "v1/{+resource}:clearOrgPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ClearOrgPolicyRequest) -> OrganizationClearOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource for the `Policy` to clear. + /// + /// 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) -> OrganizationClearOrgPolicyCall<'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) -> OrganizationClearOrgPolicyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationClearOrgPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationClearOrgPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Create a Lien which applies to the resource denoted by the `parent` field. /// /// Callers of this method will require permission on the `parent` resource. @@ -8688,6 +8722,9 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: /// Returns the IAM access control policy for the specified Project. /// Permission is denied if the policy or the resource does not exist. +/// +/// Authorization requires the Google IAM permission +/// `resourcemanager.projects.getIamPolicy` on the project /// /// A builder for the *getIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -8976,6 +9013,10 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectListOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// |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 labels.size:big|The project's label `color` has the - /// value `red` and its label `size` has the value `big`. + /// |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. + /// + /// If you specify a filter that has both `parent.type` and `parent.id`, then + /// the `resourcemanager.projects.list` permission is checked on the parent. + /// If the user has this permission, all projects under the parent will be + /// returned after remaining filters have been applied. If the user lacks this + /// permission, then all projects for which the user has the + /// `resourcemanager.projects.get` permission will be returned after remaining + /// filters have been applied. If no filter is specified, the call will return + /// projects for which the user has `resourcemanager.projects.get` permissions. /// /// Optional. /// @@ -11755,46 +11806,11 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } -/// Sets the IAM access control policy for the specified Project. Replaces -/// any existing policy. -/// -/// The following constraints apply when using `setIamPolicy()`: -/// -/// + Project does not support `allUsers` and `allAuthenticatedUsers` as -/// `members` in a `Binding` of a `Policy`. -/// -/// + The owner role can be granted only to `user` and `serviceAccount`. -/// -/// + Service accounts can be made owners of a project directly -/// without any restrictions. However, to be added as an owner, a user must be -/// invited via Cloud Platform console and must accept the invitation. -/// -/// + A user cannot be granted the owner role using `setIamPolicy()`. The user -/// must be granted the owner role using the Cloud Platform Console and must -/// explicitly accept the invitation. -/// -/// + Invitations to grant the owner role cannot be sent using -/// `setIamPolicy()`; -/// they must be sent only using the Cloud Platform Console. -/// -/// + Membership changes that leave the project without any owners that have -/// accepted the Terms of Service (ToS) will be rejected. -/// -/// + There must be at least one owner who has accepted the Terms of -/// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to -/// remove the last ToS-accepted owner from the policy will fail. This -/// restriction also applies to legacy projects that no longer have owners -/// who have accepted the ToS. Edits to IAM policies will be rejected until -/// the lack of a ToS-accepting owner is rectified. -/// -/// + Calling this method requires enabling the App Engine Admin API. -/// -/// Note: Removing service accounts from policies or changing their roles -/// can render services completely inoperable. It is important to understand -/// how the service account is being used before removing or updating its -/// roles. +/// Gets the effective `Policy` on a resource. This is the result of merging +/// `Policies` in the resource hierarchy. The returned `Policy` will not have +/// an `etag`set because it is a computed `Policy` across multiple resources. /// -/// A builder for the *setIamPolicy* method supported by a *project* resource. +/// A builder for the *getEffectiveOrgPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -11806,7 +11822,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// use cloudresourcemanager1::SetIamPolicyRequest; +/// use cloudresourcemanager1::GetEffectiveOrgPolicyRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -11820,33 +11836,34 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// // 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(); +/// let mut req = GetEffectiveOrgPolicyRequest::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().set_iam_policy(req, "resource") +/// let result = hub.projects().get_effective_org_policy(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectSetIamPolicyCall<'a, C, A> +pub struct ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, - _request: SetIamPolicyRequest, + _request: GetEffectiveOrgPolicyRequest, _resource: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectSetIamPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectGetEffectiveOrgPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -11854,7 +11871,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.setIamPolicy", + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.getEffectiveOrgPolicy", 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())); @@ -11870,20 +11887,23 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut = None; + 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 = Some(value); + replace_with = value.to_string(); break; } } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); } { let mut indices_for_removal: Vec = Vec::with_capacity(1); @@ -11993,18 +12013,17 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSetIamPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: GetEffectiveOrgPolicyRequest) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. + /// The name of the resource to start computing the effective `Policy`. /// /// 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) -> ProjectSetIamPolicyCall<'a, C, A> { + pub fn resource(mut self, new_value: &str) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { self._resource = new_value.to_string(); self } @@ -12014,7 +12033,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSetIamPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12041,7 +12060,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSetIamPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12061,7 +12080,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectSetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -12643,11 +12662,50 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Gets the effective `Policy` on a resource. This is the result of merging -/// `Policies` in the resource hierarchy. The returned `Policy` will not have -/// an `etag`set because it is a computed `Policy` across multiple resources. +/// Sets the IAM access control policy for the specified Project. Replaces +/// any existing policy. +/// +/// The following constraints apply when using `setIamPolicy()`: +/// +/// + Project does not support `allUsers` and `allAuthenticatedUsers` as +/// `members` in a `Binding` of a `Policy`. +/// +/// + The owner role can be granted only to `user` and `serviceAccount`. +/// +/// + Service accounts can be made owners of a project directly +/// without any restrictions. However, to be added as an owner, a user must be +/// invited via Cloud Platform console and must accept the invitation. +/// +/// + A user cannot be granted the owner role using `setIamPolicy()`. The user +/// must be granted the owner role using the Cloud Platform Console and must +/// explicitly accept the invitation. +/// +/// + Invitations to grant the owner role cannot be sent using +/// `setIamPolicy()`; +/// they must be sent only using the Cloud Platform Console. +/// +/// + Membership changes that leave the project without any owners that have +/// accepted the Terms of Service (ToS) will be rejected. +/// +/// + If the project is not part of an organization, there must be at least +/// one owner who has accepted the Terms of Service (ToS) agreement in the +/// policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner +/// from the policy will fail. This restriction also applies to legacy +/// projects that no longer have owners who have accepted the ToS. Edits to +/// IAM policies will be rejected until the lack of a ToS-accepting owner is +/// rectified. +/// +/// + Calling this method requires enabling the App Engine Admin API. +/// +/// Note: Removing service accounts from policies or changing their roles +/// can render services completely inoperable. It is important to understand +/// how the service account is being used before removing or updating its +/// roles. +/// +/// Authorization requires the Google IAM permission +/// `resourcemanager.projects.setIamPolicy` on the project /// -/// A builder for the *getEffectiveOrgPolicy* method supported by a *project* resource. +/// A builder for the *setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -12659,7 +12717,7 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// use cloudresourcemanager1::GetEffectiveOrgPolicyRequest; +/// use cloudresourcemanager1::SetIamPolicyRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -12673,34 +12731,33 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// // 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 = GetEffectiveOrgPolicyRequest::default(); +/// 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().get_effective_org_policy(req, "resource") +/// let result = hub.projects().set_iam_policy(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectGetEffectiveOrgPolicyCall<'a, C, A> +pub struct ProjectSetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, - _request: GetEffectiveOrgPolicyRequest, + _request: SetIamPolicyRequest, _resource: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectGetEffectiveOrgPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectSetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectSetIamPolicyCall<'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, OrgPolicy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -12708,7 +12765,7 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.getEffectiveOrgPolicy", + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.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())); @@ -12724,23 +12781,20 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { - replace_with = value.to_string(); + replace_with = Some(value); break; } } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { let mut indices_for_removal: Vec = Vec::with_capacity(1); @@ -12850,17 +12904,18 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectGetEffectiveOrgPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectSetIamPolicyCall<'a, C, A> { self._request = new_value; self } - /// The name of the resource to start computing the effective `Policy`. + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. /// /// 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) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { + pub fn resource(mut self, new_value: &str) -> ProjectSetIamPolicyCall<'a, C, A> { self._resource = new_value.to_string(); self } @@ -12870,7 +12925,7 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut ProjectGetEffectiveOrgPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12897,7 +12952,7 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectSetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12917,7 +12972,7 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectSetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml index a1e70a67bd..c8a7b6cf3d 100644 --- a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml +++ b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudresourcemanager1_beta1-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170920" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-cloudresourcemanager1_beta1] path = "../cloudresourcemanager1_beta1" -version = "1.0.6+20170517" +version = "1.0.6+20170920" diff --git a/gen/cloudresourcemanager1_beta1-cli/README.md b/gen/cloudresourcemanager1_beta1-cli/README.md index ad6153b301..75803e9b6e 100644 --- a/gen/cloudresourcemanager1_beta1-cli/README.md +++ b/gen/cloudresourcemanager1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Resource Manager* API at revision *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20170920*. The CLI is at version *1.0.6*. ```bash cloudresourcemanager1-beta1 [options] diff --git a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml index aee1f6ecb0..1425a88ce4 100644 --- a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml +++ b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Resource Manager v1.0.6+20170517 +site_name: Cloud Resource Manager v1.0.6+20170920 site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager1_beta1-cli site_description: A complete library to interact with Cloud Resource Manager (protocol v1beta1) diff --git a/gen/cloudresourcemanager1_beta1-cli/src/main.rs b/gen/cloudresourcemanager1_beta1-cli/src/main.rs index 81520ea574..885a6b0bf7 100644 --- a/gen/cloudresourcemanager1_beta1-cli/src/main.rs +++ b/gen/cloudresourcemanager1_beta1-cli/src/main.rs @@ -1819,12 +1819,13 @@ fn main() { + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. - + There must be at least one owner who has accepted the Terms of - Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - remove the last ToS-accepted owner from the policy will fail. This - restriction also applies to legacy projects that no longer have owners - who have accepted the ToS. Edits to IAM policies will be rejected until - the lack of a ToS-accepting owner is rectified. + + If the project is not part of an organization, there must be at least + one owner who has accepted the Terms of Service (ToS) agreement in the + policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + from the policy will fail. This restriction also applies to legacy + projects that no longer have owners who have accepted the ToS. Edits to + IAM policies will be rejected until the lack of a ToS-accepting owner is + rectified. + Calling this method requires enabling the App Engine Admin API. @@ -1963,7 +1964,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170920") .about("The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata.") .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") diff --git a/gen/cloudresourcemanager1_beta1/Cargo.toml b/gen/cloudresourcemanager1_beta1/Cargo.toml index 37a9dbd05a..d33641303a 100644 --- a/gen/cloudresourcemanager1_beta1/Cargo.toml +++ b/gen/cloudresourcemanager1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager1_beta1" -version = "1.0.6+20170517" +version = "1.0.6+20170920" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1" homepage = "https://cloud.google.com/resource-manager" -documentation = "https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517" +documentation = "https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] diff --git a/gen/cloudresourcemanager1_beta1/README.md b/gen/cloudresourcemanager1_beta1/README.md index b639f833c9..51e26ffdc2 100644 --- a/gen/cloudresourcemanager1_beta1/README.md +++ b/gen/cloudresourcemanager1_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudresourcemanager1_beta1` library allows access to all features of the *Google Cloud Resource Manager* service. -This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20170920*, where *20170920* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Cloud Resource Manager* *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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html) ... -* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.Organization.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) -* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.Project.html) - * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.ProjectUpdateCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.Organization.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.Project.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.ProjectUpdateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170517/google_cloudresourcemanager1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20170920/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. diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs b/gen/cloudresourcemanager1_beta1/src/lib.rs index cc83d1a405..9459f9b4cd 100644 --- a/gen/cloudresourcemanager1_beta1/src/lib.rs +++ b/gen/cloudresourcemanager1_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 *Cloud Resource Manager* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20170920*, where *20170920* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Cloud Resource Manager* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -498,91 +498,29 @@ pub struct GetAncestryResponse { impl ResponseResult for GetAncestryResponse {} -/// A Project is a high-level Google Cloud Platform entity. It is a -/// container for ACLs, APIs, App Engine Apps, VMs, and other -/// Google Cloud Platform resources. +/// The response returned from the `ListOrganizations` 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*). /// -/// * [test iam permissions projects](struct.ProjectTestIamPermissionCall.html) (none) -/// * [undelete projects](struct.ProjectUndeleteCall.html) (none) -/// * [set iam policy projects](struct.ProjectSetIamPolicyCall.html) (none) -/// * [get projects](struct.ProjectGetCall.html) (response) -/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (none) -/// * [update projects](struct.ProjectUpdateCall.html) (request|response) -/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (none) -/// * [delete projects](struct.ProjectDeleteCall.html) (none) -/// * [create projects](struct.ProjectCreateCall.html) (request|response) -/// * [list projects](struct.ProjectListCall.html) (none) +/// * [list organizations](struct.OrganizationListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Project { - /// The user-assigned display name of the Project. - /// It must be 4 to 30 characters. - /// Allowed characters are: lowercase and uppercase letters, numbers, - /// hyphen, single-quote, double-quote, space, and exclamation point. - /// - /// Example: My Project - /// Read-write. - pub name: Option, - /// An optional reference to a parent Resource. - /// - /// The only supported parent type is "organization". Once set, the parent - /// cannot be modified. The `parent` can be set on creation or using the - /// `UpdateProject` method; the end user must have the - /// `resourcemanager.projects.create` permission on the parent. - /// - /// Read-write. - pub parent: 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. - /// - /// 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, +pub struct ListOrganizationsResponse { + /// A pagination token to be used to retrieve the next page of results. If the + /// result is too large to fit within the page size specified in the request, + /// this field will be set with a token that can be used to fetch the next page + /// of results. If this field is empty, it indicates that this response + /// contains the last page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of Organizations that matched the list query, possibly paginated. + pub organizations: Option>, } -impl RequestValue for Project {} -impl Resource for Project {} -impl ResponseResult for Project {} +impl ResponseResult for ListOrganizationsResponse {} /// The request sent to the @@ -646,10 +584,9 @@ impl RequestValue for GetAncestryRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// Multiple `bindings` must not be specified for the same `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// It is strongly suggested that systems make use of the `etag` in the @@ -661,9 +598,9 @@ pub struct Policy { /// If no `etag` is provided in the call to `setIamPolicy`, then the existing /// policy is overwritten blindly. pub etag: Option, - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, /// Version of the `Policy`. The default version is 0. pub version: Option, } @@ -777,29 +714,91 @@ pub struct UndeleteProjectRequest { _never_set: Option } impl RequestValue for UndeleteProjectRequest {} -/// The response returned from the `ListOrganizations` method. +/// A Project is a high-level Google Cloud Platform entity. It is a +/// container for ACLs, APIs, App Engine Apps, VMs, and other +/// Google Cloud Platform resources. /// /// # 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 organizations](struct.OrganizationListCall.html) (response) +/// * [test iam permissions projects](struct.ProjectTestIamPermissionCall.html) (none) +/// * [undelete projects](struct.ProjectUndeleteCall.html) (none) +/// * [set iam policy projects](struct.ProjectSetIamPolicyCall.html) (none) +/// * [get projects](struct.ProjectGetCall.html) (response) +/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (none) +/// * [update projects](struct.ProjectUpdateCall.html) (request|response) +/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (none) +/// * [delete projects](struct.ProjectDeleteCall.html) (none) +/// * [create projects](struct.ProjectCreateCall.html) (request|response) +/// * [list projects](struct.ProjectListCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListOrganizationsResponse { - /// A pagination token to be used to retrieve the next page of results. If the - /// result is too large to fit within the page size specified in the request, - /// this field will be set with a token that can be used to fetch the next page - /// of results. If this field is empty, it indicates that this response - /// contains the last page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of Organizations that matched the list query, possibly paginated. - pub organizations: Option>, +pub struct Project { + /// The user-assigned display name of the Project. + /// It must be 4 to 30 characters. + /// Allowed characters are: lowercase and uppercase letters, numbers, + /// hyphen, single-quote, double-quote, space, and exclamation point. + /// + /// Example: My Project + /// Read-write. + pub name: Option, + /// An optional reference to a parent Resource. + /// + /// The only supported parent type is "organization". Once set, the parent + /// cannot be modified. The `parent` can be set on creation or using the + /// `UpdateProject` method; the end user must have the + /// `resourcemanager.projects.create` permission on the parent. + /// + /// Read-write. + pub parent: 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. + /// + /// 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 ResponseResult for ListOrganizationsResponse {} +impl RequestValue for Project {} +impl Resource for Project {} +impl ResponseResult for Project {} /// Response message for `TestIamPermissions` method. @@ -870,7 +869,7 @@ impl ResponseResult for ListProjectsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ResourceId { /// Required field representing the resource type this id is for. - /// At present, the valid types are "project" and "organization". + /// At present, the valid types are "project", "folder", and "organization". #[serde(rename="type")] pub type_: Option, /// Required field for the type-specific id. This should correspond to the id @@ -1312,12 +1311,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// + Membership changes that leave the project without any owners that have /// accepted the Terms of Service (ToS) will be rejected. /// - /// + There must be at least one owner who has accepted the Terms of - /// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - /// remove the last ToS-accepted owner from the policy will fail. This - /// restriction also applies to legacy projects that no longer have owners - /// who have accepted the ToS. Edits to IAM policies will be rejected until - /// the lack of a ToS-accepting owner is rectified. + /// + If the project is not part of an organization, there must be at least + /// one owner who has accepted the Terms of Service (ToS) agreement in the + /// policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + /// from the policy will fail. This restriction also applies to legacy + /// projects that no longer have owners who have accepted the ToS. Edits to + /// IAM policies will be rejected until the lack of a ToS-accepting owner is + /// rectified. /// /// + Calling this method requires enabling the App Engine Admin API. /// @@ -1744,12 +1744,12 @@ impl<'a, C, A> OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSetIamPolicyCall<'a, C, A> @@ -2031,12 +2031,12 @@ impl<'a, C, A> OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationGetIamPolicyCall<'a, C, A> @@ -2318,12 +2318,12 @@ impl<'a, C, A> OrganizationTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationTestIamPermissionCall<'a, C, A> @@ -2584,12 +2584,12 @@ impl<'a, C, A> OrganizationGetCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> OrganizationGetCall<'a, C, A> @@ -2870,12 +2870,12 @@ impl<'a, C, A> OrganizationUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationUpdateCall<'a, C, A> @@ -3139,12 +3139,12 @@ impl<'a, C, A> OrganizationListCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> OrganizationListCall<'a, C, A> @@ -3420,12 +3420,12 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTestIamPermissionCall<'a, C, A> @@ -3708,12 +3708,12 @@ impl<'a, C, A> ProjectUndeleteCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -3974,12 +3974,12 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -4038,12 +4038,13 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: /// + Membership changes that leave the project without any owners that have /// accepted the Terms of Service (ToS) will be rejected. /// -/// + There must be at least one owner who has accepted the Terms of -/// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to -/// remove the last ToS-accepted owner from the policy will fail. This -/// restriction also applies to legacy projects that no longer have owners -/// who have accepted the ToS. Edits to IAM policies will be rejected until -/// the lack of a ToS-accepting owner is rectified. +/// + If the project is not part of an organization, there must be at least +/// one owner who has accepted the Terms of Service (ToS) agreement in the +/// policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner +/// from the policy will fail. This restriction also applies to legacy +/// projects that no longer have owners who have accepted the ToS. Edits to +/// IAM policies will be rejected until the lack of a ToS-accepting owner is +/// rectified. /// /// + Calling this method requires enabling the App Engine Admin API. /// @@ -4291,12 +4292,12 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSetIamPolicyCall<'a, C, A> @@ -4545,12 +4546,12 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -4830,12 +4831,12 @@ impl<'a, C, A> ProjectGetAncestryCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetAncestryCall<'a, C, A> @@ -5115,12 +5116,12 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -5397,12 +5398,12 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetIamPolicyCall<'a, C, A> @@ -5671,12 +5672,12 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -5917,8 +5918,16 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// |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 labels.size:big|The project's label `color` has the - /// value `red` and its label `size` has the value `big`. + /// |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. + /// + /// If you specify a filter that has both `parent.type` and `parent.id`, then + /// the `resourcemanager.projects.list` permission is checked on the parent. + /// If the user has this permission, all projects under the parent will be + /// returned after remaining filters have been applied. If the user lacks this + /// permission, then all projects for which the user has the + /// `resourcemanager.projects.get` permission will be returned after remaining + /// filters have been applied. If no filter is specified, the call will return + /// projects for which the user has `resourcemanager.projects.get` permissions. /// /// Optional. /// @@ -5952,12 +5961,12 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> diff --git a/gen/cloudtasks2_beta2-cli/Cargo.toml b/gen/cloudtasks2_beta2-cli/Cargo.toml new file mode 100644 index 0000000000..0f9f7c5e30 --- /dev/null +++ b/gen/cloudtasks2_beta2-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudtasks2_beta2-cli" +version = "1.0.6+20170926" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Tasks (protocol v2beta2)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2-cli" +homepage = "https://cloud.google.com/cloud-tasks/" +documentation = "http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli" +license = "MIT" +keywords = ["cloudtasks", "google", "cli"] + +[[bin]] +name = "cloudtasks2-beta2" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-cloudtasks2_beta2] +path = "../cloudtasks2_beta2" +version = "1.0.6+20170926" diff --git a/gen/cloudtasks2_beta2-cli/LICENSE.md b/gen/cloudtasks2_beta2-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudtasks2_beta2-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/cloudtasks2_beta2-cli/README.md b/gen/cloudtasks2_beta2-cli/README.md new file mode 100644 index 0000000000..1529623b25 --- /dev/null +++ b/gen/cloudtasks2_beta2-cli/README.md @@ -0,0 +1,135 @@ + +The `cloudtasks2-beta2` command-line interface *(CLI)* allows to use most features of the *Google Cloud Tasks* 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 *Cloud Tasks* API can be found at the +[official documentation site](https://cloud.google.com/cloud-tasks/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-cloudtasks2_beta2-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2-cli). + +# Usage + +This documentation was generated from the *Cloud Tasks* API at revision *20170926*. The CLI is at version *1.0.6*. + +```bash +cloudtasks2-beta2 [options] + projects + locations-get [-p ]... [-o ] + locations-list [-p ]... [-o ] + locations-queues-create (-r )... [-p ]... [-o ] + locations-queues-delete [-p ]... [-o ] + locations-queues-get [-p ]... [-o ] + locations-queues-get-iam-policy (-r )... [-p ]... [-o ] + locations-queues-list [-p ]... [-o ] + locations-queues-patch (-r )... [-p ]... [-o ] + locations-queues-pause (-r )... [-p ]... [-o ] + locations-queues-purge (-r )... [-p ]... [-o ] + locations-queues-resume (-r )... [-p ]... [-o ] + locations-queues-set-iam-policy (-r )... [-p ]... [-o ] + locations-queues-tasks-acknowledge (-r )... [-p ]... [-o ] + locations-queues-tasks-cancel-lease (-r )... [-p ]... [-o ] + locations-queues-tasks-create (-r )... [-p ]... [-o ] + locations-queues-tasks-delete [-p ]... [-o ] + locations-queues-tasks-get [-p ]... [-o ] + locations-queues-tasks-list [-p ]... [-o ] + locations-queues-tasks-pull (-r )... [-p ]... [-o ] + locations-queues-tasks-renew-lease (-r )... [-p ]... [-o ] + locations-queues-tasks-run (-r )... [-p ]... [-o ] + locations-queues-test-iam-permissions (-r )... [-p ]... [-o ] + cloudtasks2-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 `cloudtasks2-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/cloudtasks2-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/cloudtasks2-beta2-secret.json`, assuming that the required *cloudtasks* 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. `cloudtasks2-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/cloudtasks2_beta2-cli/mkdocs.yml b/gen/cloudtasks2_beta2-cli/mkdocs.yml new file mode 100644 index 0000000000..1a027b2cd8 --- /dev/null +++ b/gen/cloudtasks2_beta2-cli/mkdocs.yml @@ -0,0 +1,38 @@ +site_name: Cloud Tasks v1.0.6+20170926 +site_url: http://byron.github.io/google-apis-rs/google-cloudtasks2_beta2-cli +site_description: A complete library to interact with Cloud Tasks (protocol v2beta2) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_locations-get.md', 'Projects', 'Locations Get'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] +- ['projects_locations-queues-create.md', 'Projects', 'Locations Queues Create'] +- ['projects_locations-queues-delete.md', 'Projects', 'Locations Queues Delete'] +- ['projects_locations-queues-get.md', 'Projects', 'Locations Queues Get'] +- ['projects_locations-queues-get-iam-policy.md', 'Projects', 'Locations Queues Get Iam Policy'] +- ['projects_locations-queues-list.md', 'Projects', 'Locations Queues List'] +- ['projects_locations-queues-patch.md', 'Projects', 'Locations Queues Patch'] +- ['projects_locations-queues-pause.md', 'Projects', 'Locations Queues Pause'] +- ['projects_locations-queues-purge.md', 'Projects', 'Locations Queues Purge'] +- ['projects_locations-queues-resume.md', 'Projects', 'Locations Queues Resume'] +- ['projects_locations-queues-set-iam-policy.md', 'Projects', 'Locations Queues Set Iam Policy'] +- ['projects_locations-queues-tasks-acknowledge.md', 'Projects', 'Locations Queues Tasks Acknowledge'] +- ['projects_locations-queues-tasks-cancel-lease.md', 'Projects', 'Locations Queues Tasks Cancel Lease'] +- ['projects_locations-queues-tasks-create.md', 'Projects', 'Locations Queues Tasks Create'] +- ['projects_locations-queues-tasks-delete.md', 'Projects', 'Locations Queues Tasks Delete'] +- ['projects_locations-queues-tasks-get.md', 'Projects', 'Locations Queues Tasks Get'] +- ['projects_locations-queues-tasks-list.md', 'Projects', 'Locations Queues Tasks List'] +- ['projects_locations-queues-tasks-pull.md', 'Projects', 'Locations Queues Tasks Pull'] +- ['projects_locations-queues-tasks-renew-lease.md', 'Projects', 'Locations Queues Tasks Renew Lease'] +- ['projects_locations-queues-tasks-run.md', 'Projects', 'Locations Queues Tasks Run'] +- ['projects_locations-queues-test-iam-permissions.md', 'Projects', 'Locations Queues Test Iam Permissions'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/cloudtasks2_beta2-cli/src/cmn.rs b/gen/cloudtasks2_beta2-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/cloudtasks2_beta2-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/cloudtasks2_beta2-cli/src/main.rs b/gen/cloudtasks2_beta2-cli/src/main.rs new file mode 100644 index 0000000000..781e471d2e --- /dev/null +++ b/gen/cloudtasks2_beta2-cli/src/main.rs @@ -0,0 +1,2831 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_cloudtasks2_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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudTasks>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_locations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "app-engine-queue-config.app-engine-routing-override.instance" => Some(("appEngineQueueConfig.appEngineRoutingOverride.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-queue-config.app-engine-routing-override.host" => Some(("appEngineQueueConfig.appEngineRoutingOverride.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-queue-config.app-engine-routing-override.version" => Some(("appEngineQueueConfig.appEngineRoutingOverride.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-queue-config.app-engine-routing-override.service" => Some(("appEngineQueueConfig.appEngineRoutingOverride.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.instance" => Some(("appEngineHttpTarget.appEngineRoutingOverride.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.host" => Some(("appEngineHttpTarget.appEngineRoutingOverride.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.version" => Some(("appEngineHttpTarget.appEngineRoutingOverride.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.service" => Some(("appEngineHttpTarget.appEngineRoutingOverride.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purge-time" => Some(("purgeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "throttle-config.max-tasks-dispatched-per-second" => Some(("throttleConfig.maxTasksDispatchedPerSecond", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "throttle-config.max-burst-size" => Some(("throttleConfig.maxBurstSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "throttle-config.max-outstanding-tasks" => Some(("throttleConfig.maxOutstandingTasks", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "queue-state" => Some(("queueState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retry-config.task-age-limit" => Some(("retryConfig.taskAgeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retry-config.max-doublings" => Some(("retryConfig.maxDoublings", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "retry-config.unlimited-attempts" => Some(("retryConfig.unlimitedAttempts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "retry-config.max-attempts" => Some(("retryConfig.maxAttempts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "retry-config.min-backoff" => Some(("retryConfig.minBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retry-config.max-backoff" => Some(("retryConfig.maxBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-target", "app-engine-queue-config", "app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-doublings", "max-outstanding-tasks", "max-tasks-dispatched-per-second", "min-backoff", "name", "purge-time", "queue-state", "retry-config", "service", "task-age-limit", "throttle-config", "unlimited-attempts", "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::Queue = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_queues_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_queues_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_get_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_get_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_queues_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "app-engine-queue-config.app-engine-routing-override.instance" => Some(("appEngineQueueConfig.appEngineRoutingOverride.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-queue-config.app-engine-routing-override.host" => Some(("appEngineQueueConfig.appEngineRoutingOverride.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-queue-config.app-engine-routing-override.version" => Some(("appEngineQueueConfig.appEngineRoutingOverride.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-queue-config.app-engine-routing-override.service" => Some(("appEngineQueueConfig.appEngineRoutingOverride.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.instance" => Some(("appEngineHttpTarget.appEngineRoutingOverride.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.host" => Some(("appEngineHttpTarget.appEngineRoutingOverride.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.version" => Some(("appEngineHttpTarget.appEngineRoutingOverride.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine-http-target.app-engine-routing-override.service" => Some(("appEngineHttpTarget.appEngineRoutingOverride.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purge-time" => Some(("purgeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "throttle-config.max-tasks-dispatched-per-second" => Some(("throttleConfig.maxTasksDispatchedPerSecond", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "throttle-config.max-burst-size" => Some(("throttleConfig.maxBurstSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "throttle-config.max-outstanding-tasks" => Some(("throttleConfig.maxOutstandingTasks", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "queue-state" => Some(("queueState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retry-config.task-age-limit" => Some(("retryConfig.taskAgeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retry-config.max-doublings" => Some(("retryConfig.maxDoublings", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "retry-config.unlimited-attempts" => Some(("retryConfig.unlimitedAttempts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "retry-config.max-attempts" => Some(("retryConfig.maxAttempts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "retry-config.min-backoff" => Some(("retryConfig.minBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retry-config.max-backoff" => Some(("retryConfig.maxBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-target", "app-engine-queue-config", "app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-doublings", "max-outstanding-tasks", "max-tasks-dispatched-per-second", "min-backoff", "name", "purge-time", "queue-state", "retry-config", "service", "task-age-limit", "throttle-config", "unlimited-attempts", "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::Queue = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_pause(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::PauseQueueRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_pause(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_purge(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::PurgeQueueRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_purge(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_resume(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ResumeQueueRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_resume(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, 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().locations_queues_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_acknowledge(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-time" => Some(("scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["schedule-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::AcknowledgeTaskRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_tasks_acknowledge(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_cancel_lease(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-time" => Some(("scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "response-view" => Some(("responseView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["response-view", "schedule-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::CancelLeaseRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_tasks_cancel_lease(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "response-view" => Some(("responseView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.pull-message.tag" => Some(("task.pullMessage.tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.pull-message.payload" => Some(("task.pullMessage.payload", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.relative-url" => Some(("task.appEngineHttpRequest.relativeUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.headers" => Some(("task.appEngineHttpRequest.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "task.app-engine-http-request.app-engine-routing.instance" => Some(("task.appEngineHttpRequest.appEngineRouting.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.app-engine-routing.host" => Some(("task.appEngineHttpRequest.appEngineRouting.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.app-engine-routing.version" => Some(("task.appEngineHttpRequest.appEngineRouting.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.app-engine-routing.service" => Some(("task.appEngineHttpRequest.appEngineRouting.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.payload" => Some(("task.appEngineHttpRequest.payload", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-http-request.http-method" => Some(("task.appEngineHttpRequest.httpMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.name" => Some(("task.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.schedule-time" => Some(("task.scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.last-attempt-status.schedule-time" => Some(("task.taskStatus.lastAttemptStatus.scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.last-attempt-status.response-status.message" => Some(("task.taskStatus.lastAttemptStatus.responseStatus.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.last-attempt-status.response-status.code" => Some(("task.taskStatus.lastAttemptStatus.responseStatus.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "task.task-status.last-attempt-status.response-time" => Some(("task.taskStatus.lastAttemptStatus.responseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.last-attempt-status.dispatch-time" => Some(("task.taskStatus.lastAttemptStatus.dispatchTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.first-attempt-status.schedule-time" => Some(("task.taskStatus.firstAttemptStatus.scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.first-attempt-status.response-status.message" => Some(("task.taskStatus.firstAttemptStatus.responseStatus.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.first-attempt-status.response-status.code" => Some(("task.taskStatus.firstAttemptStatus.responseStatus.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "task.task-status.first-attempt-status.response-time" => Some(("task.taskStatus.firstAttemptStatus.responseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.first-attempt-status.dispatch-time" => Some(("task.taskStatus.firstAttemptStatus.dispatchTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.task-status.attempt-dispatch-count" => Some(("task.taskStatus.attemptDispatchCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "task.task-status.attempt-response-count" => Some(("task.taskStatus.attemptResponseCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "task.pull-task-target.tag" => Some(("task.pullTaskTarget.tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.pull-task-target.payload" => Some(("task.pullTaskTarget.payload", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.relative-url" => Some(("task.appEngineTaskTarget.relativeUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.headers" => Some(("task.appEngineTaskTarget.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "task.app-engine-task-target.app-engine-routing.instance" => Some(("task.appEngineTaskTarget.appEngineRouting.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.app-engine-routing.host" => Some(("task.appEngineTaskTarget.appEngineRouting.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.app-engine-routing.version" => Some(("task.appEngineTaskTarget.appEngineRouting.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.app-engine-routing.service" => Some(("task.appEngineTaskTarget.appEngineRouting.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.payload" => Some(("task.appEngineTaskTarget.payload", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.app-engine-task-target.http-method" => Some(("task.appEngineTaskTarget.httpMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.create-time" => Some(("task.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.view" => Some(("task.view", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-request", "app-engine-routing", "app-engine-task-target", "attempt-dispatch-count", "attempt-response-count", "code", "create-time", "dispatch-time", "first-attempt-status", "headers", "host", "http-method", "instance", "last-attempt-status", "message", "name", "payload", "pull-message", "pull-task-target", "relative-url", "response-status", "response-time", "response-view", "schedule-time", "service", "tag", "task", "task-status", "version", "view"]); + 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::CreateTaskRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_tasks_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_queues_tasks_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_queues_tasks_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "response-view" => { + call = call.response_view(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(["response-view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_queues_tasks_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "response-view" => { + call = call.response_view(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(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(["order-by", "page-token", "response-view", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_pull(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-tasks" => Some(("maxTasks", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "response-view" => Some(("responseView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lease-duration" => Some(("leaseDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["filter", "lease-duration", "max-tasks", "response-view"]); + 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::PullTasksRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_tasks_pull(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_renew_lease(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-time" => Some(("scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "response-view" => Some(("responseView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "new-lease-duration" => Some(("newLeaseDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["new-lease-duration", "response-view", "schedule-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::RenewLeaseRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_tasks_renew_lease(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_tasks_run(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "response-view" => Some(("responseView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["response-view"]); + 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::RunTaskRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_queues_tasks_run(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_queues_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().locations_queues_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("locations-get", Some(opt)) => { + call_result = self._projects_locations_get(opt, dry_run, &mut err); + }, + ("locations-list", Some(opt)) => { + call_result = self._projects_locations_list(opt, dry_run, &mut err); + }, + ("locations-queues-create", Some(opt)) => { + call_result = self._projects_locations_queues_create(opt, dry_run, &mut err); + }, + ("locations-queues-delete", Some(opt)) => { + call_result = self._projects_locations_queues_delete(opt, dry_run, &mut err); + }, + ("locations-queues-get", Some(opt)) => { + call_result = self._projects_locations_queues_get(opt, dry_run, &mut err); + }, + ("locations-queues-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_queues_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-queues-list", Some(opt)) => { + call_result = self._projects_locations_queues_list(opt, dry_run, &mut err); + }, + ("locations-queues-patch", Some(opt)) => { + call_result = self._projects_locations_queues_patch(opt, dry_run, &mut err); + }, + ("locations-queues-pause", Some(opt)) => { + call_result = self._projects_locations_queues_pause(opt, dry_run, &mut err); + }, + ("locations-queues-purge", Some(opt)) => { + call_result = self._projects_locations_queues_purge(opt, dry_run, &mut err); + }, + ("locations-queues-resume", Some(opt)) => { + call_result = self._projects_locations_queues_resume(opt, dry_run, &mut err); + }, + ("locations-queues-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_queues_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-acknowledge", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_acknowledge(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-cancel-lease", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_cancel_lease(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-create", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_create(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-delete", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_delete(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-get", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_get(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-list", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_list(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-pull", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_pull(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-renew-lease", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_renew_lease(opt, dry_run, &mut err); + }, + ("locations-queues-tasks-run", Some(opt)) => { + call_result = self._projects_locations_queues_tasks_run(opt, dry_run, &mut err); + }, + ("locations-queues-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_queues_test_iam_permissions(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<'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, "cloudtasks2-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "cloudtasks2-beta2", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudTasks::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: 'locations-get', 'locations-list', 'locations-queues-create', 'locations-queues-delete', 'locations-queues-get', 'locations-queues-get-iam-policy', 'locations-queues-list', 'locations-queues-patch', 'locations-queues-pause', 'locations-queues-purge', 'locations-queues-resume', 'locations-queues-set-iam-policy', 'locations-queues-tasks-acknowledge', 'locations-queues-tasks-cancel-lease', 'locations-queues-tasks-create', 'locations-queues-tasks-delete', 'locations-queues-tasks-get', 'locations-queues-tasks-list', 'locations-queues-tasks-pull', 'locations-queues-tasks-renew-lease', 'locations-queues-tasks-run' and 'locations-queues-test-iam-permissions'", vec![ + ("locations-get", + Some(r##"Get information about a location."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name for the location."##), + 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)), + ]), + ("locations-list", + Some(r##"Lists information about the supported locations for this service."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource that owns the locations collection, if applicable."##), + 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)), + ]), + ("locations-queues-create", + Some(r##"Creates a queue. + + WARNING: This method is only available to whitelisted + users. Using this method carries some risk. Read + [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + carefully and then sign up for + [whitelist access to this method](https://goo.gl/Fe5mUy)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. + + The location name in which the queue will be created. + For example: `projects/PROJECT_ID/locations/LOCATION_ID` + + The list of allowed locations can be obtained by calling Cloud + Tasks' implementation of + google.cloud.location.Locations.ListLocations."##), + 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)), + ]), + ("locations-queues-delete", + Some(r##"Deletes a queue. + + This command will delete the queue even if it has tasks in it. + + Note: If you delete a queue, a queue with the same name can't be created + for 7 days. + + WARNING: This method is only available to whitelisted + users. Using this method carries some risk. Read + [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + carefully and then sign up for + [whitelist access to this method](https://goo.gl/Fe5mUy)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-get", + Some(r##"Gets a queue."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The resource name of the queue. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-get-iam-policy", + Some(r##"Gets the access control policy for a Queue. + Returns an empty policy if the resource exists and does not have a policy + set. + + Authorization requires the following [Google IAM](/iam) permission on the + specified resource parent: + + * `cloudtasks.queues.getIamPolicy` + "##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-queues-list", + Some(r##"Lists queues. + + Queues are returned in lexicographical order."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. + + The location name. + For example: `projects/PROJECT_ID/locations/LOCATION_ID`"##), + 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)), + ]), + ("locations-queues-patch", + Some(r##"Updates a queue. + + This method creates the queue if it does not exist and updates + the queue if it does exist. + + WARNING: This method is only available to whitelisted + users. Using this method carries some risk. Read + [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + carefully and then sign up for + [whitelist access to this method](https://goo.gl/Fe5mUy)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The queue name. + + The queue name must have the following format: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + + * `PROJECT_ID` can contain uppercase and lowercase letters, + numbers, hyphens, colons, and periods; that is, it must match + the regular expression: `[a-zA-Z\\d-:\\.]+`. + * `QUEUE_ID` can contain uppercase and lowercase letters, + numbers, and hyphens; that is, it must match the regular + expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + characters. + + Caller-specified and required in CreateQueueRequest, after which + it becomes output only."##), + 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)), + ]), + ("locations-queues-pause", + Some(r##"Pauses the queue. + + If a queue is paused then the system will stop executing the + tasks in the queue until it is resumed via + CloudTasks.ResumeQueue. Tasks can still be added when the + queue is paused. The state of the queue is stored in + Queue.queue_state; if paused it will be set to + Queue.QueueState.PAUSED. + + WARNING: This method is only available to whitelisted + users. Using this method carries some risk. Read + [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + carefully and then sign up for + [whitelist access to this method](https://goo.gl/Fe5mUy)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-pause", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-purge", + Some(r##"Purges a queue by deleting all of its tasks. + + All tasks created before this method is called are permanently deleted. + + Purge operations can take up to one minute to take effect. Tasks + might be dispatched before the purge takes effect. A purge is irreversible."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-purge", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-resume", + Some(r##"Resume a queue. + + This method resumes a queue after it has been + Queue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of + a queue is stored in Queue.queue_state; after calling this method it + will be set to Queue.QueueState.RUNNING. + + WARNING: This method is only available to whitelisted + users. Using this method carries some risk. Read + [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + carefully and then sign up for + [whitelist access to this method](https://goo.gl/Fe5mUy). + + WARNING: Resuming many high-QPS queues at the same time can + lead to target overloading. If you are resuming high-QPS + queues, follow the 500/50/5 pattern described in + [Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-resume", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-set-iam-policy", + Some(r##"Sets the access control policy for a Queue. Replaces any existing + policy. + + Authorization requires the following [Google IAM](/iam) permission on the + specified resource parent: + + * `cloudtasks.queues.setIamPolicy` + "##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("locations-queues-tasks-acknowledge", + Some(r##"Acknowledges a pull task. + + The lease holder, that is, the entity that received this task in + a PullTasksResponse, must call this method to indicate that + the work associated with the task has finished. + + The lease holder must acknowledge a task within the + PullTasksRequest.lease_duration or the lease will expire and + the task will become ready to be returned in a different + PullTasksResponse. After the task is acknowledged, it will + not be returned by a later CloudTasks.PullTasks, + CloudTasks.GetTask, or CloudTasks.ListTasks."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-acknowledge", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The task name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), + 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)), + ]), + ("locations-queues-tasks-cancel-lease", + Some(r##"Cancel a pull task's lease. + + The lease holder can use this method to cancel a task's lease + by setting Task.schedule_time to now. This will make the task + available to be leased to the next caller of CloudTasks.PullTasks."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-cancel-lease", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The task name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), + 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)), + ]), + ("locations-queues-tasks-create", + Some(r##"Creates a task and adds it to a queue. + + To add multiple tasks at the same time, use + [HTTP batching](/storage/docs/json_api/v1/how-tos/batch) + or the batching documentation for your client library, for example + https://developers.google.com/api-client-library/python/guide/batch. + + Tasks cannot be updated after creation; there is no UpdateTask command."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + + The queue must already exist."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-queues-tasks-delete", + Some(r##"Deletes a task. + + A task can be deleted if it is scheduled or dispatched. A task + cannot be deleted if it has completed successfully or permanently + failed."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The task name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), + 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)), + ]), + ("locations-queues-tasks-get", + Some(r##"Gets a task."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The task name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), + 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)), + ]), + ("locations-queues-tasks-list", + Some(r##"Lists the tasks in a queue. + + By default response_view is Task.View.BASIC; not all + information is retrieved by default due to performance + considerations; ListTasksRequest.response_view controls the + subset of information which is returned."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-tasks-pull", + Some(r##"Pulls tasks from a pull queue and acquires a lease on them for a + specified PullTasksRequest.lease_duration. + + This method is invoked by the lease holder to obtain the + lease. The lease holder must acknowledge the task via + CloudTasks.AcknowledgeTask after they have performed the work + associated with the task. + + The payload is intended to store data that the lease holder needs + to perform the work associated with the task. To return the + payloads in the PullTasksResponse, set + PullTasksRequest.response_view to Task.View.FULL."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-pull", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The queue name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), + 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)), + ]), + ("locations-queues-tasks-renew-lease", + Some(r##"Renew the current lease of a pull task. + + The lease holder can use this method to extend the lease by a new + duration, starting from now. The new task lease will be + returned in Task.schedule_time."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-renew-lease", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The task name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), + 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)), + ]), + ("locations-queues-tasks-run", + Some(r##"Forces a task to run now. + + This command is meant to be used for manual debugging. For + example, CloudTasks.RunTask can be used to retry a failed + task after a fix has been made or to manually force a task to be + dispatched now. + + When this method is called, Cloud Tasks will dispatch the task to its + target, even if the queue is Queue.QueueState.PAUSED. + + The dispatched task is returned. That is, the task that is returned + contains the Task.task_status after the task is dispatched but + before the task is received by its target. + + If Cloud Tasks receives a successful response from the task's + handler, then the task will be deleted; otherwise the task's + Task.schedule_time will be reset to the time that + CloudTasks.RunTask was called plus the retry delay specified + in the queue and task's RetryConfig. + + CloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when + it is called on a task that has already succeeded or permanently + failed. google.rpc.Code.FAILED_PRECONDITION is returned when + CloudTasks.RunTask is called on task that is dispatched or + already running."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-run", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. + + The task name. For example: + `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), + 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)), + ]), + ("locations-queues-test-iam-permissions", + Some(r##"Returns permissions that a caller has on a Queue. + If the resource does not exist, this will return an empty set of + permissions, not a google.rpc.Code.NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning. + "##), + "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + 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("cloudtasks2-beta2") + .author("Sebastian Thiel ") + .version("1.0.6+20170926") + .about("Manages the execution of large numbers of distributed requests. Cloud Tasks is in Alpha.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudtasks2_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/cloudtasks2_beta2/Cargo.toml b/gen/cloudtasks2_beta2/Cargo.toml new file mode 100644 index 0000000000..037468b766 --- /dev/null +++ b/gen/cloudtasks2_beta2/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudtasks2_beta2" +version = "1.0.6+20170926" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Tasks (protocol v2beta2)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2" +homepage = "https://cloud.google.com/cloud-tasks/" +documentation = "https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926" +license = "MIT" +keywords = ["cloudtasks", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/cloudtasks2_beta2/LICENSE.md b/gen/cloudtasks2_beta2/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudtasks2_beta2/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/cloudtasks2_beta2/README.md b/gen/cloudtasks2_beta2/README.md new file mode 100644 index 0000000000..d0c6ce65e8 --- /dev/null +++ b/gen/cloudtasks2_beta2/README.md @@ -0,0 +1,186 @@ + +The `google-cloudtasks2_beta2` library allows access to all features of the *Google Cloud Tasks* service. + +This documentation was generated from *Cloud Tasks* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *cloudtasks:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud Tasks* *v2_beta2* API can be found at the +[official documentation site](https://cloud.google.com/cloud-tasks/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.CloudTasks.html) ... + +* projects + * [*locations get*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks acknowledge*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskAcknowledgeCall.html), [*locations queues tasks cancel lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCancelLeaseCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks pull*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskPullCall.html), [*locations queues tasks renew lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRenewLeaseCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.ProjectLocationQueueTestIamPermissionCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.CloudTasks.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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.projects().locations_queues_pause(...).doit() +let r = hub.projects().locations_queues_resume(...).doit() +let r = hub.projects().locations_queues_patch(...).doit() +let r = hub.projects().locations_queues_create(...).doit() +let r = hub.projects().locations_queues_get(...).doit() +let r = hub.projects().locations_queues_purge(...).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-cloudtasks2_beta2 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +use cloudtasks2_beta2::Queue; +use cloudtasks2_beta2::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use cloudtasks2_beta2::CloudTasks; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Queue::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().locations_queues_patch(req, "name") + .update_mask("sit") + .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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_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 **cloudtasks2_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-rsblob/master/LICENSE.md diff --git a/gen/cloudtasks2_beta2/src/cmn.rs b/gen/cloudtasks2_beta2/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/cloudtasks2_beta2/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/cloudtasks2_beta2/src/lib.rs b/gen/cloudtasks2_beta2/src/lib.rs new file mode 100644 index 0000000000..ddf3c739c6 --- /dev/null +++ b/gen/cloudtasks2_beta2/src/lib.rs @@ -0,0 +1,8967 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud Tasks* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *cloudtasks:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud Tasks* *v2_beta2* API can be found at the +//! [official documentation site](https://cloud.google.com/cloud-tasks/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudTasks.html) ... +//! +//! * projects +//! * [*locations get*](struct.ProjectLocationGetCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations queues create*](struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](struct.ProjectLocationQueueListCall.html), [*locations queues patch*](struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks acknowledge*](struct.ProjectLocationQueueTaskAcknowledgeCall.html), [*locations queues tasks cancel lease*](struct.ProjectLocationQueueTaskCancelLeaseCall.html), [*locations queues tasks create*](struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks pull*](struct.ProjectLocationQueueTaskPullCall.html), [*locations queues tasks renew lease*](struct.ProjectLocationQueueTaskRenewLeaseCall.html), [*locations queues tasks run*](struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](struct.ProjectLocationQueueTestIamPermissionCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudTasks.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().locations_queues_pause(...).doit() +//! let r = hub.projects().locations_queues_resume(...).doit() +//! let r = hub.projects().locations_queues_patch(...).doit() +//! let r = hub.projects().locations_queues_create(...).doit() +//! let r = hub.projects().locations_queues_get(...).doit() +//! let r = hub.projects().locations_queues_purge(...).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-cloudtasks2_beta2 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +//! use cloudtasks2_beta2::Queue; +//! use cloudtasks2_beta2::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use cloudtasks2_beta2::CloudTasks; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Queue::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().locations_queues_patch(req, "name") +//! .update_mask("sed") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 CloudTasks related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::Queue; +/// use cloudtasks2_beta2::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudtasks2_beta2::CloudTasks; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Queue::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().locations_queues_patch(req, "name") +/// .update_mask("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 CloudTasks { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudTasks {} + +impl<'a, C, A> CloudTasks + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudTasks { + CloudTasks { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://cloudtasks.googleapis.com/".to_string(), + _root_url: "https://cloudtasks.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://cloudtasks.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://cloudtasks.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Request message for pulling tasks using CloudTasks.PullTasks. +/// +/// # 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*). +/// +/// * [locations queues tasks pull projects](struct.ProjectLocationQueueTaskPullCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PullTasksRequest { + /// `filter` can be used to specify a subset of tasks to lease. + /// + /// When `filter` is set to `tag=` then the + /// PullTasksResponse will contain only tasks whose + /// PullMessage.tag is equal to ``. `` can be + /// a bytes encoded as a string and must be less than 500 bytes. + /// If `` includes whitespace or special characters (characters which + /// aren't letters, numbers, or underscores), then it must be double-quoted. + /// Double quotes and backslashes in quoted strings must be escaped by + /// preceding it with a backslash (`\`). + /// + /// When `filter` is set to `tag=oldest_tag()`, only tasks which have the same + /// tag as the task with the oldest schedule_time will be returned. + /// + /// Grammar Syntax: + /// + /// * `filter = "tag=" comparable` + /// + /// * `comparable = tag | function` + /// + /// * `tag = string | bytes` + /// + /// * `function = "oldest_tag()"` + /// + /// + /// + /// The `oldest_tag()` function returns tasks which have the same tag as the + /// oldest task (ordered by schedule time). + pub filter: Option, + /// The maximum number of tasks to lease. The maximum that can be + /// requested is 1000. + #[serde(rename="maxTasks")] + pub max_tasks: Option, + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + #[serde(rename="responseView")] + pub response_view: Option, + /// The duration of the lease. + /// + /// Each task returned in the PullTasksResponse will have its + /// Task.schedule_time set to the current time plus the + /// `lease_duration`. A task that has been returned in a + /// PullTasksResponse is leased -- that task will not be + /// returned in a different PullTasksResponse before the + /// Task.schedule_time. + /// + /// After the lease holder has successfully finished the work + /// associated with the task, the lease holder must call + /// CloudTasks.AcknowledgeTask. If the task is not acknowledged + /// via CloudTasks.AcknowledgeTask before the + /// Task.schedule_time then it will be returned in a later + /// PullTasksResponse so that another lease holder can process + /// it. + /// + /// The maximum lease duration is 1 week. + /// `lease_duration` will be truncated to the nearest second. + #[serde(rename="leaseDuration")] + pub lease_duration: Option, +} + +impl RequestValue for PullTasksRequest {} + + +/// The pull message contains data that can be used by the caller of +/// CloudTasks.PullTasks to process the task. +/// +/// This proto can only be used for tasks in a queue which has +/// Queue.pull_target set. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PullMessage { + /// A meta-data tag for this task. + /// + /// This value is used by CloudTasks.PullTasks calls when + /// PullTasksRequest.filter is `tag=`. + /// + /// The tag must be less than 500 bytes. + pub tag: Option, + /// A data payload consumed by the task worker to execute the task. + pub payload: Option, +} + +impl Part for PullMessage {} + + +/// App Engine HTTP request. +/// +/// The message defines the HTTP request that is sent to an App Engine app when +/// the task is dispatched. +/// +/// This proto can only be used for tasks in a queue which has +/// Queue.app_engine_http_target set. +/// +/// Using AppEngineHttpRequest requires +/// [`appengine.applications.get`](/appengine/docs/admin-api/access-control) +/// Google IAM permission for the project +/// and the following scope: +/// +/// `https://www.googleapis.com/auth/cloud-platform` +/// +/// The task will be delivered to the App Engine app which belongs to the same +/// project as the queue. For more information, see +/// [How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed) +/// and how routing is affected by +/// [dispatch files](/appengine/docs/python/config/dispatchref). +/// +/// The AppEngineRouting used to construct the URL that the task is +/// delivered to can be set at the queue-level or task-level: +/// +/// * If set, AppEngineHttpTarget.app_engine_routing_override is used for +/// all tasks in the queue, no matter what the setting is for the +/// task-level app_engine_routing. +/// +/// +/// The `url` that the task will be sent to is: +/// +/// * `url =` AppEngineRouting.host `+` AppEngineHttpRequest.relative_url +/// +/// The task will be sent to a task handler by an HTTP +/// request using the specified AppEngineHttpRequest.http_method (for example +/// POST, HTTP GET, etc). The task attempt has succeeded if the task handler +/// returns an HTTP response code in the range [200 - 299]. Error 503 is +/// considered an App Engine system error instead of an application error. +/// Requests returning error 503 will be retried regardless of retry +/// configuration and not counted against retry counts. +/// Any other response code or a failure to receive a response before the +/// deadline is a failed attempt. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngineHttpRequest { + /// The relative URL. + /// + /// The relative URL must begin with "/" and must be a valid HTTP relative URL. + /// It can contain a path, query string arguments, and `#` fragments. + /// If the relative URL is empty, then the root path "/" will be used. + /// No spaces are allowed, and the maximum length allowed is 2083 characters. + #[serde(rename="relativeUrl")] + pub relative_url: Option, + /// HTTP request headers. + /// + /// This map contains the header field names and values. + /// Headers can be set when the + /// [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). + /// Repeated headers are not supported but a header value can contain commas. + /// + /// Cloud Tasks sets some headers to default values: + /// + /// * `User-Agent`: By default, this header is + /// `"AppEngine-Google; (+http://code.google.com/appengine)"`. + /// This header can be modified, but Cloud Tasks will append + /// `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + /// modified `User-Agent`. + /// + /// If the task has an AppEngineHttpRequest.payload, Cloud Tasks sets the + /// following headers: + /// + /// * `Content-Type`: By default, the `Content-Type` header is set to + /// `"application/octet-stream"`. The default can be overridden by explictly + /// setting `Content-Type` to a particular media type when the + /// [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). + /// For example, `Content-Type` can be set to `"application/json"`. + /// * `Content-Length`: This is computed by Cloud Tasks. This value is + /// output only. It cannot be changed. + /// + /// The headers below cannot be set or overridden: + /// + /// * `Host` + /// * `X-Google-*` + /// * `X-AppEngine-*` + /// + /// In addition, some App Engine headers, which contain + /// task-specific information, are also be sent to the task handler; see + /// [request headers](/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + pub headers: Option>, + /// Task-level setting for App Engine routing. + /// + /// If set, AppEngineHttpTarget.app_engine_routing_override is used for + /// all tasks in the queue, no matter what the setting is for the + /// task-level app_engine_routing. + #[serde(rename="appEngineRouting")] + pub app_engine_routing: Option, + /// Payload. + /// + /// The payload will be sent as the HTTP message body. A message + /// body, and thus a payload, is allowed only if the HTTP method is + /// POST or PUT. It is an error to set a data payload on a task with + /// an incompatible HttpMethod. + pub payload: Option, + /// The HTTP method to use for the request. The default is POST. + /// + /// The app's request handler for the task's target URL must be able to handle + /// HTTP requests with this http_method, otherwise the task attempt will fail + /// with error code 405 "Method Not Allowed" because "the method specified in + /// the Request-Line is not allowed for the resource identified by the + /// Request-URI". See + /// [Writing a push task request handler](/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + /// and the documentation for the request handlers in the language your app is + /// written in e.g. + /// [python RequestHandler](/appengine/docs/python/tools/webapp/requesthandlerclass). + #[serde(rename="httpMethod")] + pub http_method: Option, +} + +impl Part for AppEngineHttpRequest {} + + +/// The status of a task attempt. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AttemptStatus { + /// Output only. + /// + /// The time that this attempt was scheduled. + /// + /// `schedule_time` will be truncated to the nearest microsecond. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, + /// Output only. + /// + /// The response from the target for this attempt. + /// + /// If the task has not been attempted or the task is currently running + /// then the response status is google.rpc.Code.UNKNOWN. + #[serde(rename="responseStatus")] + pub response_status: Option, + /// Output only. + /// + /// The time that this attempt response was received. + /// + /// `response_time` will be truncated to the nearest microsecond. + #[serde(rename="responseTime")] + pub response_time: Option, + /// Output only. + /// + /// The time that this attempt was dispatched. + /// + /// `dispatch_time` will be truncated to the nearest microsecond. + #[serde(rename="dispatchTime")] + pub dispatch_time: Option, +} + +impl Part for AttemptStatus {} + + +/// Request message for CloudTasks.PauseQueue. +/// +/// # 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*). +/// +/// * [locations queues pause projects](struct.ProjectLocationQueuePauseCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PauseQueueRequest { _never_set: Option } + +impl RequestValue for PauseQueueRequest {} + + +/// Deprecated. Use PullTarget. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PullQueueConfig { _never_set: Option } + +impl Part for PullQueueConfig {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +/// `members` to a `role`, where the members can be user accounts, Google groups, +/// Google domains, and service accounts. A `role` is a named list of permissions +/// defined by IAM. +/// +/// **Example** +/// +/// { +/// "bindings": [ +/// { +/// "role": "roles/owner", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +/// ] +/// }, +/// { +/// "role": "roles/viewer", +/// "members": ["user:sean@example.com"] +/// } +/// ] +/// } +/// +/// For a description of IAM and its features, see the +/// [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # 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*). +/// +/// * [locations queues set iam policy projects](struct.ProjectLocationQueueSetIamPolicyCall.html) (response) +/// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, + /// Version of the `Policy`. The default version is 0. + pub version: Option, +} + +impl ResponseResult for Policy {} + + +/// App Engine Routing. +/// +/// For more information about services, versions, and instances see +/// [An Overview of App Engine](/appengine/docs/python/an-overview-of-app-engine), +/// [Microservices Architecture on Google App Engine](/appengine/docs/python/microservices-on-app-engine), +/// [App Engine Standard request routing](/appengine/docs/standard/python/how-requests-are-routed), +/// and [App Engine Flex request routing](/appengine/docs/flexible/python/how-requests-are-routed). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngineRouting { + /// App instance. + /// + /// By default, the task is sent to an instance which is available when + /// the task is attempted. + /// + /// Requests can only be sent to a specific instance if + /// [manual scaling is used in App Engine Standard](/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + /// App Engine Flex does not support instances. For more information, see + /// [App Engine Standard request routing](/appengine/docs/standard/python/how-requests-are-routed) + /// and [App Engine Flex request routing](/appengine/docs/flexible/python/how-requests-are-routed). + pub instance: Option, + /// Output only. + /// + /// The host that the task is sent to. For more information, see + /// [How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed). + /// + /// The host is constructed as: + /// + /// + /// * `host = [application_domain_name]`
+ /// `| [service] + '.' + [application_domain_name]`
+ /// `| [version] + '.' + [application_domain_name]`
+ /// `| [version_dot_service]+ '.' + [application_domain_name]`
+ /// `| [instance] + '.' + [application_domain_name]`
+ /// `| [instance_dot_service] + '.' + [application_domain_name]`
+ /// `| [instance_dot_version] + '.' + [application_domain_name]`
+ /// `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + /// + /// * `application_domain_name` = The domain name of the app, for + /// example .appspot.com, which is associated with the + /// queue's project ID. Some tasks which were created using the App Engine + /// SDK use a custom domain name. + /// + /// * `service =` AppEngineRouting.service + /// + /// * `version =` AppEngineRouting.version + /// + /// * `version_dot_service =` + /// AppEngineRouting.version `+ '.' +` AppEngineRouting.service + /// + /// * `instance =` AppEngineRouting.instance + /// + /// * `instance_dot_service =` + /// AppEngineRouting.instance `+ '.' +` AppEngineRouting.service + /// + /// * `instance_dot_version =` + /// AppEngineRouting.instance `+ '.' +` AppEngineRouting.version + /// + /// * `instance_dot_version_dot_service =` + /// AppEngineRouting.instance `+ '.' +` + /// AppEngineRouting.version `+ '.' +` AppEngineRouting.service + /// + /// If AppEngineRouting.service is empty, then the task will be sent + /// to the service which is the default service when the task is attempted. + /// + /// If AppEngineRouting.version is empty, then the task will be sent + /// to the version which is the default version when the task is attempted. + /// + /// If AppEngineRouting.instance is empty, then the task will be sent + /// to an instance which is available when the task is attempted. + /// + /// When AppEngineRouting.service is "default", + /// AppEngineRouting.version is "default", and + /// AppEngineRouting.instance is empty, AppEngineRouting.host is + /// shortened to just the `application_domain_name`. + /// + /// If AppEngineRouting.service, AppEngineRouting.version, or + /// AppEngineRouting.instance is invalid, then the task will be sent + /// to the default version of the default service when the task is attempted. + pub host: Option, + /// App version. + /// + /// By default, the task is sent to the version which is the default + /// version when the task is attempted ("default"). + /// + /// For some queues or tasks which were created using the App Engine Task Queue + /// API, AppEngineRouting.host is not parsable into + /// AppEngineRouting.service, AppEngineRouting.version, and + /// AppEngineRouting.instance. For example, some tasks which were created + /// using the App Engine SDK use a custom domain name; custom domains are not + /// parsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then + /// AppEngineRouting.service, AppEngineRouting.version, and + /// AppEngineRouting.instance are the empty string. + pub version: Option, + /// App service. + /// + /// By default, the task is sent to the service which is the default + /// service when the task is attempted ("default"). + /// + /// For some queues or tasks which were created using the App Engine Task Queue + /// API, AppEngineRouting.host is not parsable into + /// AppEngineRouting.service, AppEngineRouting.version, and + /// AppEngineRouting.instance. For example, some tasks which were created + /// using the App Engine SDK use a custom domain name; custom domains are not + /// parsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then + /// AppEngineRouting.service, AppEngineRouting.version, and + /// AppEngineRouting.instance are the empty string. + pub service: Option, +} + +impl Part for AppEngineRouting {} + + +/// Deprecated. Use AppEngineHttpRequest. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngineTaskTarget { + /// Deprecated. Use AppEngineHttpRequest.relative_url. + #[serde(rename="relativeUrl")] + pub relative_url: Option, + /// Deprecated. Use AppEngineHttpRequest.headers. + pub headers: Option>, + /// Deprecated. Use AppEngineHttpRequest.app_engine_routing. + #[serde(rename="appEngineRouting")] + pub app_engine_routing: Option, + /// Deprecated. Use AppEngineHttpRequest.payload. + pub payload: Option, + /// Deprecated. Use AppEngineHttpRequest.http_method. + #[serde(rename="httpMethod")] + pub http_method: Option, +} + +impl Part for AppEngineTaskTarget {} + + +/// A resource that represents Google Cloud Platform location. +/// +/// # 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*). +/// +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Location { + /// Cross-service attributes for the location. For example + /// + /// {"cloud.googleapis.com/region": "us-east1"} + pub labels: Option>, + /// The canonical id for this location. For example: `"us-east1"`. + #[serde(rename="locationId")] + pub location_id: Option, + /// Resource name for the location, which may vary between implementations. + /// For example: `"projects/example-project/locations/us-east1"` + pub name: Option, + /// Service-specific metadata. For example the available capacity at the given + /// location. + pub metadata: Option>, +} + +impl ResponseResult for Location {} + + +/// Request message for CloudTasks.PurgeQueue. +/// +/// # 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*). +/// +/// * [locations queues purge projects](struct.ProjectLocationQueuePurgeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PurgeQueueRequest { _never_set: Option } + +impl RequestValue for PurgeQueueRequest {} + + +/// Request message for forcing a task to run now using +/// CloudTasks.RunTask. +/// +/// # 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*). +/// +/// * [locations queues tasks run projects](struct.ProjectLocationQueueTaskRunCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RunTaskRequest { + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + #[serde(rename="responseView")] + pub response_view: Option, +} + +impl RequestValue for RunTaskRequest {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations queues delete projects](struct.ProjectLocationQueueDeleteCall.html) (response) +/// * [locations queues tasks delete projects](struct.ProjectLocationQueueTaskDeleteCall.html) (response) +/// * [locations queues tasks acknowledge projects](struct.ProjectLocationQueueTaskAcknowledgeCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// 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*). +/// +/// * [locations queues test iam permissions projects](struct.ProjectLocationQueueTestIamPermissionCall.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 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*). +/// +/// * [locations queues set iam policy projects](struct.ProjectLocationQueueSetIamPolicyCall.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 a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// Throttle config. +/// +/// These settings determine the throttling behavior. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ThrottleConfig { + /// The maximum rate at which tasks are dispatched from this + /// queue. + /// + /// The maximum allowed value is 500. + /// + /// * For App Engine queues, this field is 1 by default. + /// * For pull queues, this field is output only and always 10,000. + /// + /// This field has the same meaning as + /// [rate in queue.yaml](/appengine/docs/standard/python/config/queueref#rate). + #[serde(rename="maxTasksDispatchedPerSecond")] + pub max_tasks_dispatched_per_second: Option, + /// Output only. + /// + /// The max burst size limits how fast the queue is processed when + /// many tasks are in the queue and the rate is high. This field + /// allows the queue to have a high rate so processing starts shortly + /// after a task is enqueued, but still limits resource usage when + /// many tasks are enqueued in a short period of time. + /// + /// * For App Engine queues, if + /// ThrottleConfig.max_tasks_dispatched_per_second is 1, this + /// field is 10; otherwise this field is + /// ThrottleConfig.max_tasks_dispatched_per_second / 5. + /// * For pull queues, this field is output only and always 10,000. + /// + /// Note: For App Engine queues that were created through + /// `queue.yaml/xml`, `max_burst_size` might not have the same + /// settings as specified above; CloudTasks.UpdateQueue can be + /// used to set `max_burst_size` only to the values specified above. + /// + /// This field has the same meaning as + /// [bucket_size in queue.yaml](/appengine/docs/standard/python/config/queueref#bucket_size). + #[serde(rename="maxBurstSize")] + pub max_burst_size: Option, + /// The maximum number of outstanding tasks that Cloud Tasks allows + /// to be dispatched for this queue. After this threshold has been + /// reached, Cloud Tasks stops dispatching tasks until the number of + /// outstanding requests decreases. + /// + /// The maximum allowed value is 5,000. + /// + /// * For App Engine queues, this field is 10 by default. + /// * For pull queues, this field is output only and always -1, which + /// indicates no limit. + /// + /// This field has the same meaning as + /// [max_concurrent_requests in queue.yaml](/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + #[serde(rename="maxOutstandingTasks")] + pub max_outstanding_tasks: Option, +} + +impl Part for ThrottleConfig {} + + +/// A unit of scheduled work. +/// +/// # 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*). +/// +/// * [locations queues tasks run projects](struct.ProjectLocationQueueTaskRunCall.html) (response) +/// * [locations queues tasks renew lease projects](struct.ProjectLocationQueueTaskRenewLeaseCall.html) (response) +/// * [locations queues tasks cancel lease projects](struct.ProjectLocationQueueTaskCancelLeaseCall.html) (response) +/// * [locations queues tasks get projects](struct.ProjectLocationQueueTaskGetCall.html) (response) +/// * [locations queues tasks create projects](struct.ProjectLocationQueueTaskCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Task { + /// Pull message contains data that should be used by the caller of + /// CloudTasks.PullTasks to process the task. Can be set only if + /// Queue.pull_target is set. + /// + /// A pull task is a task that has PullMessage set. + #[serde(rename="pullMessage")] + pub pull_message: Option, + /// App Engine HTTP request that is sent to the task's target. Can be set + /// only if Queue.app_engine_http_target is set. + /// + /// An App Engine task is a task that has AppEngineHttpRequest set. + #[serde(rename="appEngineHttpRequest")] + pub app_engine_http_request: Option, + /// The task name. + /// + /// The task name must have the following format: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// * `PROJECT_ID` can contain uppercase and lowercase letters, + /// numbers, hyphens, colons, and periods; that is, it must match + /// the regular expression: `[a-zA-Z\\d-:\\.]+`. + /// * `QUEUE_ID` can contain uppercase and lowercase letters, + /// numbers, and hyphens; that is, it must match the regular + /// expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + /// characters. + /// * `TASK_ID` contain uppercase and lowercase letters, numbers, + /// underscores, and hyphens; that is, it must match the regular + /// expression: `[a-zA-Z\\d_-]+`. The maximum length is 500 + /// characters. + /// + /// Optionally caller-specified in CreateTaskRequest. + pub name: Option, + /// The time when the task is scheduled to be attempted. + /// + /// For pull queues, this is the time when the task is available to + /// be leased; if a task is currently leased, this is the time when + /// the current lease expires, that is, the time that the task was + /// leased plus the PullTasksRequest.lease_duration. + /// + /// For App Engine queues, this is when the task will be attempted or retried. + /// + /// `schedule_time` will be truncated to the nearest microsecond. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, + /// Output only. + /// + /// Task status. + #[serde(rename="taskStatus")] + pub task_status: Option, + /// Deprecated. Use Task.pull_message. + #[serde(rename="pullTaskTarget")] + pub pull_task_target: Option, + /// Deprecated. Use Task.app_engine_http_request. + #[serde(rename="appEngineTaskTarget")] + pub app_engine_task_target: Option, + /// Output only. + /// + /// The time that the task was created. + /// + /// `create_time` will be truncated to the nearest second. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. + /// + /// The view specifies which subset of the Task has been + /// returned. + pub view: Option, +} + +impl ResponseResult for Task {} + + +/// 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*). +/// +/// * [locations queues test iam permissions projects](struct.ProjectLocationQueueTestIamPermissionCall.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. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// Pull target. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PullTarget { _never_set: Option } + +impl Part for PullTarget {} + + +/// Response message for listing tasks using CloudTasks.ListTasks. +/// +/// # 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*). +/// +/// * [locations queues tasks list projects](struct.ProjectLocationQueueTaskListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTasksResponse { + /// A token to retrieve next page of results. + /// + /// To return the next page of results, call + /// CloudTasks.ListTasks with this value as the + /// ListTasksRequest.page_token. + /// + /// If the next_page_token is empty, there are no more results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of tasks. + pub tasks: Option>, +} + +impl ResponseResult for ListTasksResponse {} + + +/// Status of the task. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TaskStatus { + /// Output only. + /// + /// The status of the task's last attempt. + /// + /// This field is not calculated for + /// [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + #[serde(rename="lastAttemptStatus")] + pub last_attempt_status: Option, + /// Output only. + /// + /// The status of the task's first attempt. + /// + /// Only AttemptStatus.dispatch_time will be set. + /// The other AttemptStatus information is not retained by Cloud Tasks. + /// + /// This field is not calculated for + /// [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + #[serde(rename="firstAttemptStatus")] + pub first_attempt_status: Option, + /// Output only. + /// + /// The number of attempts dispatched. This count includes tasks which have + /// been dispatched but haven't received a response. + #[serde(rename="attemptDispatchCount")] + pub attempt_dispatch_count: Option, + /// Output only. + /// + /// The number of attempts which have received a response. + /// + /// This field is not calculated for + /// [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + #[serde(rename="attemptResponseCount")] + pub attempt_response_count: Option, +} + +impl Part for TaskStatus {} + + +/// A queue is a container of related tasks. Queues are configured to manage +/// how those tasks are dispatched. Configurable properties include rate limits, +/// retry options, target types, and others. +/// +/// # 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*). +/// +/// * [locations queues pause projects](struct.ProjectLocationQueuePauseCall.html) (response) +/// * [locations queues resume projects](struct.ProjectLocationQueueResumeCall.html) (response) +/// * [locations queues patch projects](struct.ProjectLocationQueuePatchCall.html) (request|response) +/// * [locations queues create projects](struct.ProjectLocationQueueCreateCall.html) (request|response) +/// * [locations queues get projects](struct.ProjectLocationQueueGetCall.html) (response) +/// * [locations queues purge projects](struct.ProjectLocationQueuePurgeCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Queue { + /// The queue name. + /// + /// The queue name must have the following format: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// * `PROJECT_ID` can contain uppercase and lowercase letters, + /// numbers, hyphens, colons, and periods; that is, it must match + /// the regular expression: `[a-zA-Z\\d-:\\.]+`. + /// * `QUEUE_ID` can contain uppercase and lowercase letters, + /// numbers, and hyphens; that is, it must match the regular + /// expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + /// characters. + /// + /// Caller-specified and required in CreateQueueRequest, after which + /// it becomes output only. + pub name: Option, + /// Deprecated. Use Queue.app_engine_http_target. + #[serde(rename="appEngineQueueConfig")] + pub app_engine_queue_config: Option, + /// App Engine HTTP target. + /// + /// An App Engine queue is a queue that has an AppEngineHttpTarget. + #[serde(rename="appEngineHttpTarget")] + pub app_engine_http_target: Option, + /// Pull target. + /// + /// A pull queue is a queue that has a PullTarget. + #[serde(rename="pullTarget")] + pub pull_target: Option, + /// Deprecated. Use Queue.pull_target. + #[serde(rename="pullQueueConfig")] + pub pull_queue_config: Option, + /// Output only. + /// + /// The last time this queue was purged. All tasks that were + /// created before this time were purged. + /// + /// A queue can be purged using CloudTasks.PurgeQueue, the + /// [App Engine Task Queue SDK, or the Cloud Console](/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + /// + /// Purge time will be truncated to the nearest microsecond. Purge + /// time will be zero if the queue has never been purged. + #[serde(rename="purgeTime")] + pub purge_time: Option, + /// Config for throttling task dispatches. + #[serde(rename="throttleConfig")] + pub throttle_config: Option, + /// Output only. + /// + /// The state of the queue. + /// + /// `queue_state` can only be changed by called + /// CloudTasks.PauseQueue, CloudTasks.ResumeQueue, or uploading + /// [queue.yaml](/appengine/docs/python/config/queueref). + /// CloudTasks.UpdateQueue cannot be used to change `queue_state`. + #[serde(rename="queueState")] + pub queue_state: Option, + /// Settings that determine the retry behavior. + /// + /// * For tasks created using Cloud Tasks: the queue-level retry settings + /// apply to all tasks in the queue that were created using Cloud Tasks. + /// Retry settings cannot be set on individual tasks. + /// * For tasks created using the App Engine SDK: the queue-level retry + /// settings apply to all tasks in the queue which do not have retry settings + /// explicitly set on the task and were created by the App Engine SDK. See + /// [App Engine documentation](/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + #[serde(rename="retryConfig")] + pub retry_config: Option, +} + +impl RequestValue for Queue {} +impl ResponseResult for Queue {} + + +/// Request message for canceling a lease using +/// CloudTasks.CancelLease. +/// +/// # 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*). +/// +/// * [locations queues tasks cancel lease projects](struct.ProjectLocationQueueTaskCancelLeaseCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelLeaseRequest { + /// Required. + /// + /// The task's current schedule time, available in the Task.schedule_time + /// returned in PullTasksResponse.tasks or + /// CloudTasks.RenewLease. This restriction is to check that + /// the caller is canceling the correct task. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + #[serde(rename="responseView")] + pub response_view: Option, +} + +impl RequestValue for CancelLeaseRequest {} + + +/// Request message for `GetIamPolicy` 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*). +/// +/// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIamPolicyRequest { _never_set: Option } + +impl RequestValue for GetIamPolicyRequest {} + + +/// Deprecated. Use PullMessage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PullTaskTarget { + /// Deprecated. Use PullMessage.tag. + pub tag: Option, + /// Deprecated. Use PullMessage.payload. + pub payload: Option, +} + +impl Part for PullTaskTarget {} + + +/// Request message for acknowledging a task using +/// CloudTasks.AcknowledgeTask. +/// +/// # 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*). +/// +/// * [locations queues tasks acknowledge projects](struct.ProjectLocationQueueTaskAcknowledgeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcknowledgeTaskRequest { + /// Required. + /// + /// The task's current schedule time, available in the Task.schedule_time + /// returned in PullTasksResponse.tasks or + /// CloudTasks.RenewLease. This restriction is to check that + /// the caller is acknowledging the correct task. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, +} + +impl RequestValue for AcknowledgeTaskRequest {} + + +/// Request message for renewing a lease using CloudTasks.RenewLease. +/// +/// # 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*). +/// +/// * [locations queues tasks renew lease projects](struct.ProjectLocationQueueTaskRenewLeaseCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RenewLeaseRequest { + /// Required. + /// + /// The task's current schedule time, available in the Task.schedule_time + /// returned in PullTasksResponse.tasks or + /// CloudTasks.RenewLease. This restriction is to check that + /// the caller is renewing the correct task. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + #[serde(rename="responseView")] + pub response_view: Option, + /// Required. + /// + /// The desired new lease duration, starting from now. + /// + /// + /// The maximum lease duration is 1 week. + /// `new_lease_duration` will be truncated to the nearest second. + #[serde(rename="newLeaseDuration")] + pub new_lease_duration: Option, +} + +impl RequestValue for RenewLeaseRequest {} + + +/// Deprecated. Use AppEngineTarget. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngineQueueConfig { + /// Deprecated. Use AppEngineTarget.app_engine_routing_override. + #[serde(rename="appEngineRoutingOverride")] + pub app_engine_routing_override: Option, +} + +impl Part for AppEngineQueueConfig {} + + +/// App Engine HTTP target. +/// +/// The task will be delivered to the App Engine application hostname +/// specified by its AppEngineHttpTarget and AppEngineHttpRequest. +/// The documentation for AppEngineHttpRequest explains how the +/// task's host URL is constructed. +/// +/// Using AppEngineHttpTarget requires +/// [`appengine.applications.get`](/appengine/docs/admin-api/access-control) +/// Google IAM permission for the project +/// and the following scope: +/// +/// `https://www.googleapis.com/auth/cloud-platform` +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngineHttpTarget { + /// Overrides for the + /// task-level app_engine_routing. + /// + /// If set, AppEngineHttpTarget.app_engine_routing_override is used for + /// all tasks in the queue, no matter what the setting is for the + /// task-level app_engine_routing. + #[serde(rename="appEngineRoutingOverride")] + pub app_engine_routing_override: Option, +} + +impl Part for AppEngineHttpTarget {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// Request message for CloudTasks.CreateTask. +/// +/// # 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*). +/// +/// * [locations queues tasks create projects](struct.ProjectLocationQueueTaskCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateTaskRequest { + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + #[serde(rename="responseView")] + pub response_view: Option, + /// Required. + /// + /// The task to add. + /// + /// Task names have the following format: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + /// The user can optionally specify a name for the task in + /// Task.name. If a name is not specified then the system will + /// generate a random unique task id, which will be returned in the + /// response's Task.name. + /// + /// Explicitly specifying a Task.name enables task + /// de-duplication. If a task's name is identical to the name of an + /// existing task or a task that was deleted or completed within the + /// last ~10 days then the call to CloudTasks.CreateTask will + /// fail with google.rpc.Code.ALREADY_EXISTS. Because there is an + /// extra lookup cost to identify duplicate task names, these + /// CloudTasks.CreateTask calls have significantly increased + /// latency. Using hashed strings for the task id or for the prefix + /// of the task id is recommended. Choosing task ids that are + /// sequential or have sequential prefixes, for example using a + /// timestamp, causes an increase in latency and error rates in all + /// task commands. The infrastructure relies on an approximately + /// uniform distribution of task ids to store and serve tasks + /// efficiently. + /// + /// If Task.schedule_time is not set or is in the past then Cloud + /// Tasks will set it to the current time. + pub task: Option, +} + +impl RequestValue for CreateTaskRequest {} + + +/// Response message for pulling tasks using CloudTasks.PullTasks. +/// +/// # 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*). +/// +/// * [locations queues tasks pull projects](struct.ProjectLocationQueueTaskPullCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PullTasksResponse { + /// The leased tasks. + pub tasks: Option>, +} + +impl ResponseResult for PullTasksResponse {} + + +/// Request message for CloudTasks.ResumeQueue. +/// +/// # 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*). +/// +/// * [locations queues resume projects](struct.ProjectLocationQueueResumeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResumeQueueRequest { _never_set: Option } + +impl RequestValue for ResumeQueueRequest {} + + +/// The response message for Locations.ListLocations. +/// +/// # 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*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLocationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of locations that matches the specified filter in the request. + pub locations: Option>, +} + +impl ResponseResult for ListLocationsResponse {} + + +/// Response message for CloudTasks.ListQueues. +/// +/// # 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*). +/// +/// * [locations queues list projects](struct.ProjectLocationQueueListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListQueuesResponse { + /// A token to retrieve next page of results. + /// + /// To return the next page of results, call + /// CloudTasks.ListQueues with this value as the + /// ListQueuesRequest.page_token. + /// + /// If the next_page_token is empty, there are no more results. + /// + /// The page token is valid for only 2 hours. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of queues. + pub queues: Option>, +} + +impl ResponseResult for ListQueuesResponse {} + + +/// Retry config. +/// +/// These settings determine retry behavior. +/// +/// If a task does not complete successfully, meaning that an +/// acknowledgement is not received from the handler before the +/// [deadline](/appengine/docs/python/taskqueue/push/#the_task_deadline), +/// then it will be retried with exponential backoff according to the +/// settings in RetryConfig. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RetryConfig { + /// The maximum number of attempts for a task. + /// + /// Cloud Tasks will attempt the task `max_attempts` times (that + /// is, if the first attempt fails, then there will be + /// `max_attempts - 1` retries). Must be > 0. + #[serde(rename="maxAttempts")] + pub max_attempts: Option, + /// The minimum amount of time to wait before retrying a task after + /// it fails. + /// + /// * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + /// this field is 0.1 seconds by default. + /// * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + /// field is output only and always 0. + /// + /// `min_backoff` will be truncated to the nearest second. + #[serde(rename="minBackoff")] + pub min_backoff: Option, + /// If positive, task_age_limit specifies the time limit for retrying a failed + /// task, measured from when the task was first run. If specified with + /// RetryConfig.max_attempts, the task will be retried until both + /// limits are reached. + /// + /// If zero, then the task age is unlimited. This field is zero by default. + /// + /// `task_age_limit` will be truncated to the nearest second. + #[serde(rename="taskAgeLimit")] + pub task_age_limit: Option, + /// The maximum number of times that the interval between failed task + /// retries will be doubled before the increase becomes constant. The + /// constant is: 2**(max_doublings - 1) * + /// RetryConfig.min_backoff. + /// + /// * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + /// this field is 16 by default. + /// * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field + /// is output only and always 0. + #[serde(rename="maxDoublings")] + pub max_doublings: Option, + /// The maximum amount of time to wait before retrying a task after + /// it fails. The default is 1 hour. + /// + /// * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + /// this field is 1 hour by default. + /// * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field + /// is output only and always 0. + /// + /// `max_backoff` will be truncated to the nearest second. + #[serde(rename="maxBackoff")] + pub max_backoff: Option, + /// If true, then the number of attempts is unlimited. + #[serde(rename="unlimitedAttempts")] + pub unlimited_attempts: Option, +} + +impl Part for RetryConfig {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudTasks` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudtasks2_beta2::CloudTasks; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `locations_get(...)`, `locations_list(...)`, `locations_queues_create(...)`, `locations_queues_delete(...)`, `locations_queues_get(...)`, `locations_queues_get_iam_policy(...)`, `locations_queues_list(...)`, `locations_queues_patch(...)`, `locations_queues_pause(...)`, `locations_queues_purge(...)`, `locations_queues_resume(...)`, `locations_queues_set_iam_policy(...)`, `locations_queues_tasks_acknowledge(...)`, `locations_queues_tasks_cancel_lease(...)`, `locations_queues_tasks_create(...)`, `locations_queues_tasks_delete(...)`, `locations_queues_tasks_get(...)`, `locations_queues_tasks_list(...)`, `locations_queues_tasks_pull(...)`, `locations_queues_tasks_renew_lease(...)`, `locations_queues_tasks_run(...)` and `locations_queues_test_iam_permissions(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, +} + +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: + /// + /// Gets a task. + /// + /// # Arguments + /// + /// * `name` - Required. + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + pub fn locations_queues_tasks_get(&self, name: &str) -> ProjectLocationQueueTaskGetCall<'a, C, A> { + ProjectLocationQueueTaskGetCall { + hub: self.hub, + _name: name.to_string(), + _response_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the tasks in a queue. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default due to performance + /// considerations; ListTasksRequest.response_view controls the + /// subset of information which is returned. + /// + /// # Arguments + /// + /// * `parent` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_tasks_list(&self, parent: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { + ProjectLocationQueueTaskListCall { + hub: self.hub, + _parent: parent.to_string(), + _response_view: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a queue. + /// + /// This command will delete the queue even if it has tasks in it. + /// + /// Note: If you delete a queue, a queue with the same name can't be created + /// for 7 days. + /// + /// WARNING: This method is only available to whitelisted + /// users. Using this method carries some risk. Read + /// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + /// carefully and then sign up for + /// [whitelist access to this method](https://goo.gl/Fe5mUy). + /// + /// # Arguments + /// + /// * `name` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_delete(&self, name: &str) -> ProjectLocationQueueDeleteCall<'a, C, A> { + ProjectLocationQueueDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy for a Queue. Replaces any existing + /// policy. + /// + /// Authorization requires the following [Google IAM](/iam) permission on the + /// specified resource parent: + /// + /// * `cloudtasks.queues.setIamPolicy` + /// + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_queues_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationQueueSetIamPolicyCall<'a, C, A> { + ProjectLocationQueueSetIamPolicyCall { + 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: + /// + /// Updates a queue. + /// + /// This method creates the queue if it does not exist and updates + /// the queue if it does exist. + /// + /// WARNING: This method is only available to whitelisted + /// users. Using this method carries some risk. Read + /// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + /// carefully and then sign up for + /// [whitelist access to this method](https://goo.gl/Fe5mUy). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The queue name. + /// The queue name must have the following format: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// * `PROJECT_ID` can contain uppercase and lowercase letters, + /// numbers, hyphens, colons, and periods; that is, it must match + /// the regular expression: `[a-zA-Z\\d-:\\.]+`. + /// * `QUEUE_ID` can contain uppercase and lowercase letters, + /// numbers, and hyphens; that is, it must match the regular + /// expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + /// characters. + /// Caller-specified and required in CreateQueueRequest, after which + /// it becomes output only. + pub fn locations_queues_patch(&self, request: Queue, name: &str) -> ProjectLocationQueuePatchCall<'a, C, A> { + ProjectLocationQueuePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a queue. + /// + /// WARNING: This method is only available to whitelisted + /// users. Using this method carries some risk. Read + /// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + /// carefully and then sign up for + /// [whitelist access to this method](https://goo.gl/Fe5mUy). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. + /// The location name in which the queue will be created. + /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` + /// The list of allowed locations can be obtained by calling Cloud + /// Tasks' implementation of + /// google.cloud.location.Locations.ListLocations. + pub fn locations_queues_create(&self, request: Queue, parent: &str) -> ProjectLocationQueueCreateCall<'a, C, A> { + ProjectLocationQueueCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a queue. + /// + /// # Arguments + /// + /// * `name` - Required. + /// The resource name of the queue. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_get(&self, name: &str) -> ProjectLocationQueueGetCall<'a, C, A> { + ProjectLocationQueueGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a task and adds it to a queue. + /// + /// To add multiple tasks at the same time, use + /// [HTTP batching](/storage/docs/json_api/v1/how-tos/batch) + /// or the batching documentation for your client library, for example + /// https://developers.google.com/api-client-library/python/guide/batch. + /// + /// Tasks cannot be updated after creation; there is no UpdateTask command. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// The queue must already exist. + pub fn locations_queues_tasks_create(&self, request: CreateTaskRequest, parent: &str) -> ProjectLocationQueueTaskCreateCall<'a, C, A> { + ProjectLocationQueueTaskCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a task. + /// + /// A task can be deleted if it is scheduled or dispatched. A task + /// cannot be deleted if it has completed successfully or permanently + /// failed. + /// + /// # Arguments + /// + /// * `name` - Required. + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + pub fn locations_queues_tasks_delete(&self, name: &str) -> ProjectLocationQueueTaskDeleteCall<'a, C, A> { + ProjectLocationQueueTaskDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Pulls tasks from a pull queue and acquires a lease on them for a + /// specified PullTasksRequest.lease_duration. + /// + /// This method is invoked by the lease holder to obtain the + /// lease. The lease holder must acknowledge the task via + /// CloudTasks.AcknowledgeTask after they have performed the work + /// associated with the task. + /// + /// The payload is intended to store data that the lease holder needs + /// to perform the work associated with the task. To return the + /// payloads in the PullTasksResponse, set + /// PullTasksRequest.response_view to Task.View.FULL. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_tasks_pull(&self, request: PullTasksRequest, name: &str) -> ProjectLocationQueueTaskPullCall<'a, C, A> { + ProjectLocationQueueTaskPullCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Acknowledges a pull task. + /// + /// The lease holder, that is, the entity that received this task in + /// a PullTasksResponse, must call this method to indicate that + /// the work associated with the task has finished. + /// + /// The lease holder must acknowledge a task within the + /// PullTasksRequest.lease_duration or the lease will expire and + /// the task will become ready to be returned in a different + /// PullTasksResponse. After the task is acknowledged, it will + /// not be returned by a later CloudTasks.PullTasks, + /// CloudTasks.GetTask, or CloudTasks.ListTasks. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + pub fn locations_queues_tasks_acknowledge(&self, request: AcknowledgeTaskRequest, name: &str) -> ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> { + ProjectLocationQueueTaskAcknowledgeCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Resume a queue. + /// + /// This method resumes a queue after it has been + /// Queue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of + /// a queue is stored in Queue.queue_state; after calling this method it + /// will be set to Queue.QueueState.RUNNING. + /// + /// WARNING: This method is only available to whitelisted + /// users. Using this method carries some risk. Read + /// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + /// carefully and then sign up for + /// [whitelist access to this method](https://goo.gl/Fe5mUy). + /// + /// WARNING: Resuming many high-QPS queues at the same time can + /// lead to target overloading. If you are resuming high-QPS + /// queues, follow the 500/50/5 pattern described in + /// [Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_resume(&self, request: ResumeQueueRequest, name: &str) -> ProjectLocationQueueResumeCall<'a, C, A> { + ProjectLocationQueueResumeCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancel a pull task's lease. + /// + /// The lease holder can use this method to cancel a task's lease + /// by setting Task.schedule_time to now. This will make the task + /// available to be leased to the next caller of CloudTasks.PullTasks. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + pub fn locations_queues_tasks_cancel_lease(&self, request: CancelLeaseRequest, name: &str) -> ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> { + ProjectLocationQueueTaskCancelLeaseCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists queues. + /// + /// Queues are returned in lexicographical order. + /// + /// # Arguments + /// + /// * `parent` - Required. + /// The location name. + /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` + pub fn locations_queues_list(&self, parent: &str) -> ProjectLocationQueueListCall<'a, C, A> { + ProjectLocationQueueListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Forces a task to run now. + /// + /// This command is meant to be used for manual debugging. For + /// example, CloudTasks.RunTask can be used to retry a failed + /// task after a fix has been made or to manually force a task to be + /// dispatched now. + /// + /// When this method is called, Cloud Tasks will dispatch the task to its + /// target, even if the queue is Queue.QueueState.PAUSED. + /// + /// The dispatched task is returned. That is, the task that is returned + /// contains the Task.task_status after the task is dispatched but + /// before the task is received by its target. + /// + /// If Cloud Tasks receives a successful response from the task's + /// handler, then the task will be deleted; otherwise the task's + /// Task.schedule_time will be reset to the time that + /// CloudTasks.RunTask was called plus the retry delay specified + /// in the queue and task's RetryConfig. + /// + /// CloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when + /// it is called on a task that has already succeeded or permanently + /// failed. google.rpc.Code.FAILED_PRECONDITION is returned when + /// CloudTasks.RunTask is called on task that is dispatched or + /// already running. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + pub fn locations_queues_tasks_run(&self, request: RunTaskRequest, name: &str) -> ProjectLocationQueueTaskRunCall<'a, C, A> { + ProjectLocationQueueTaskRunCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Pauses the queue. + /// + /// If a queue is paused then the system will stop executing the + /// tasks in the queue until it is resumed via + /// CloudTasks.ResumeQueue. Tasks can still be added when the + /// queue is paused. The state of the queue is stored in + /// Queue.queue_state; if paused it will be set to + /// Queue.QueueState.PAUSED. + /// + /// WARNING: This method is only available to whitelisted + /// users. Using this method carries some risk. Read + /// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + /// carefully and then sign up for + /// [whitelist access to this method](https://goo.gl/Fe5mUy). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_pause(&self, request: PauseQueueRequest, name: &str) -> ProjectLocationQueuePauseCall<'a, C, A> { + ProjectLocationQueuePauseCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a Queue. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Authorization requires the following [Google IAM](/iam) permission on the + /// specified resource parent: + /// + /// * `cloudtasks.queues.getIamPolicy` + /// + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_queues_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectLocationQueueGetIamPolicyCall<'a, C, A> { + ProjectLocationQueueGetIamPolicyCall { + 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: + /// + /// Get information about a location. + /// + /// # Arguments + /// + /// * `name` - Resource name for the location. + pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { + ProjectLocationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Renew the current lease of a pull task. + /// + /// The lease holder can use this method to extend the lease by a new + /// duration, starting from now. The new task lease will be + /// returned in Task.schedule_time. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + pub fn locations_queues_tasks_renew_lease(&self, request: RenewLeaseRequest, name: &str) -> ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> { + ProjectLocationQueueTaskRenewLeaseCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists information about the supported locations for this service. + /// + /// # Arguments + /// + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on a Queue. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a google.rpc.Code.NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_queues_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationQueueTestIamPermissionCall<'a, C, A> { + ProjectLocationQueueTestIamPermissionCall { + 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: + /// + /// Purges a queue by deleting all of its tasks. + /// + /// All tasks created before this method is called are permanently deleted. + /// + /// Purge operations can take up to one minute to take effect. Tasks + /// might be dispatched before the purge takes effect. A purge is irreversible. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. + /// The queue name. For example: + /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + pub fn locations_queues_purge(&self, request: PurgeQueueRequest, name: &str) -> ProjectLocationQueuePurgeCall<'a, C, A> { + ProjectLocationQueuePurgeCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Gets a task. +/// +/// A builder for the *locations.queues.tasks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_tasks_get("name") +/// .response_view("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _name: String, + _response_view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskGetCall<'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, Task)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._response_view { + params.push(("responseView", value.to_string())); + } + for &field in ["alt", "name", "responseView"].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 = self.hub._base_url.clone() + "v2beta2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + /// + /// Sets the *response view* query property to the given value. + pub fn response_view(mut self, new_value: &str) -> ProjectLocationQueueTaskGetCall<'a, C, A> { + self._response_view = 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) -> ProjectLocationQueueTaskGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the tasks in a queue. +/// +/// By default response_view is Task.View.BASIC; not all +/// information is retrieved by default due to performance +/// considerations; ListTasksRequest.response_view controls the +/// subset of information which is returned. +/// +/// A builder for the *locations.queues.tasks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_tasks_list("parent") +/// .response_view("justo") +/// .page_token("amet.") +/// .page_size(-81) +/// .order_by("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _parent: String, + _response_view: Option, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskListCall<'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, ListTasksResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._response_view { + params.push(("responseView", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "parent", "responseView", "pageToken", "pageSize", "orderBy"].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 = self.hub._base_url.clone() + "v2beta2/{+parent}/tasks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The response_view specifies which subset of the Task will be + /// returned. + /// + /// By default response_view is Task.View.BASIC; not all + /// information is retrieved by default because some data, such as + /// payloads, might be desirable to return only when needed because + /// of its large size or because of the sensitivity of data that it + /// contains. + /// + /// Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + /// [Google IAM](/iam/) permission on the + /// Task.name resource. + /// + /// Sets the *response view* query property to the given value. + pub fn response_view(mut self, new_value: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { + self._response_view = Some(new_value.to_string()); + self + } + /// A token identifying the page of results to return. + /// + /// To request the first page results, page_token must be empty. To + /// request the next page of results, page_token must be the value of + /// ListTasksResponse.next_page_token returned from the previous + /// call to CloudTasks.ListTasks method. + /// + /// The page token is valid for only 2 hours. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. Fewer tasks than requested might be returned. + /// + /// The maximum page size is 1000. If unspecified, the page size will + /// be the maximum. Fewer tasks than requested might be returned, + /// even if more tasks exist; use + /// ListTasksResponse.next_page_token to determine if more tasks + /// exist. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationQueueTaskListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// + /// Sort order used for the query. The fields supported for sorting + /// are Task.schedule_time and PullMessage.tag. All results will be + /// returned in ascending order. The default ordering is by + /// Task.schedule_time. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { + self._order_by = 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) -> ProjectLocationQueueTaskListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a queue. +/// +/// This command will delete the queue even if it has tasks in it. +/// +/// Note: If you delete a queue, a queue with the same name can't be created +/// for 7 days. +/// +/// WARNING: This method is only available to whitelisted +/// users. Using this method carries some risk. Read +/// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) +/// carefully and then sign up for +/// [whitelist access to this method](https://goo.gl/Fe5mUy). +/// +/// A builder for the *locations.queues.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy for a Queue. Replaces any existing +/// policy. +/// +/// Authorization requires the following [Google IAM](/iam) permission on the +/// specified resource parent: +/// +/// * `cloudtasks.queues.setIamPolicy` +/// +/// +/// A builder for the *locations.queues.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueSetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.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 = self.hub._base_url.clone() + "v2beta2/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectLocationQueueSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationQueueSetIamPolicyCall<'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) -> ProjectLocationQueueSetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a queue. +/// +/// This method creates the queue if it does not exist and updates +/// the queue if it does exist. +/// +/// WARNING: This method is only available to whitelisted +/// users. Using this method carries some risk. Read +/// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) +/// carefully and then sign up for +/// [whitelist access to this method](https://goo.gl/Fe5mUy). +/// +/// A builder for the *locations.queues.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::Queue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Queue::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().locations_queues_patch(req, "name") +/// .update_mask("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueuePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: Queue, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueuePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueuePatchCall<'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, Queue)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Queue) -> ProjectLocationQueuePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The queue name. + /// + /// The queue name must have the following format: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// * `PROJECT_ID` can contain uppercase and lowercase letters, + /// numbers, hyphens, colons, and periods; that is, it must match + /// the regular expression: `[a-zA-Z\\d-:\\.]+`. + /// * `QUEUE_ID` can contain uppercase and lowercase letters, + /// numbers, and hyphens; that is, it must match the regular + /// expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + /// characters. + /// + /// Caller-specified and required in CreateQueueRequest, after which + /// it becomes output only. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueuePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A mask used to specify which fields of the queue are being updated. + /// + /// If empty, then all fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationQueuePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueuePatchCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueuePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueuePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a queue. +/// +/// WARNING: This method is only available to whitelisted +/// users. Using this method carries some risk. Read +/// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) +/// carefully and then sign up for +/// [whitelist access to this method](https://goo.gl/Fe5mUy). +/// +/// A builder for the *locations.queues.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::Queue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Queue::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().locations_queues_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: Queue, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueCreateCall<'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, Queue)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v2beta2/{+parent}/queues"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Queue) -> ProjectLocationQueueCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The location name in which the queue will be created. + /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` + /// + /// The list of allowed locations can be obtained by calling Cloud + /// Tasks' implementation of + /// google.cloud.location.Locations.ListLocations. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationQueueCreateCall<'a, C, A> { + self._parent = 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) -> ProjectLocationQueueCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a queue. +/// +/// A builder for the *locations.queues.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueGetCall<'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, Queue)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the queue. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a task and adds it to a queue. +/// +/// To add multiple tasks at the same time, use +/// [HTTP batching](/storage/docs/json_api/v1/how-tos/batch) +/// or the batching documentation for your client library, for example +/// https://developers.google.com/api-client-library/python/guide/batch. +/// +/// Tasks cannot be updated after creation; there is no UpdateTask command. +/// +/// A builder for the *locations.queues.tasks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::CreateTaskRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateTaskRequest::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().locations_queues_tasks_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: CreateTaskRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskCreateCall<'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, Task)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v2beta2/{+parent}/tasks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateTaskRequest) -> ProjectLocationQueueTaskCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// The queue must already exist. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationQueueTaskCreateCall<'a, C, A> { + self._parent = 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) -> ProjectLocationQueueTaskCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a task. +/// +/// A task can be deleted if it is scheduled or dispatched. A task +/// cannot be deleted if it has completed successfully or permanently +/// failed. +/// +/// A builder for the *locations.queues.tasks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_tasks_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueTaskDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Pulls tasks from a pull queue and acquires a lease on them for a +/// specified PullTasksRequest.lease_duration. +/// +/// This method is invoked by the lease holder to obtain the +/// lease. The lease holder must acknowledge the task via +/// CloudTasks.AcknowledgeTask after they have performed the work +/// associated with the task. +/// +/// The payload is intended to store data that the lease holder needs +/// to perform the work associated with the task. To return the +/// payloads in the PullTasksResponse, set +/// PullTasksRequest.response_view to Task.View.FULL. +/// +/// A builder for the *locations.queues.tasks.pull* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::PullTasksRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PullTasksRequest::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().locations_queues_tasks_pull(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskPullCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: PullTasksRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskPullCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskPullCall<'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, PullTasksResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.pull", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}/tasks:pull"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PullTasksRequest) -> ProjectLocationQueueTaskPullCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The queue name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskPullCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueTaskPullCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskPullCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskPullCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Acknowledges a pull task. +/// +/// The lease holder, that is, the entity that received this task in +/// a PullTasksResponse, must call this method to indicate that +/// the work associated with the task has finished. +/// +/// The lease holder must acknowledge a task within the +/// PullTasksRequest.lease_duration or the lease will expire and +/// the task will become ready to be returned in a different +/// PullTasksResponse. After the task is acknowledged, it will +/// not be returned by a later CloudTasks.PullTasks, +/// CloudTasks.GetTask, or CloudTasks.ListTasks. +/// +/// A builder for the *locations.queues.tasks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::AcknowledgeTaskRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AcknowledgeTaskRequest::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().locations_queues_tasks_acknowledge(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: AcknowledgeTaskRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskAcknowledgeCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.acknowledge", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:acknowledge"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AcknowledgeTaskRequest) -> ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueTaskAcknowledgeCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskAcknowledgeCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Resume a queue. +/// +/// This method resumes a queue after it has been +/// Queue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of +/// a queue is stored in Queue.queue_state; after calling this method it +/// will be set to Queue.QueueState.RUNNING. +/// +/// WARNING: This method is only available to whitelisted +/// users. Using this method carries some risk. Read +/// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) +/// carefully and then sign up for +/// [whitelist access to this method](https://goo.gl/Fe5mUy). +/// +/// WARNING: Resuming many high-QPS queues at the same time can +/// lead to target overloading. If you are resuming high-QPS +/// queues, follow the 500/50/5 pattern described in +/// [Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf). +/// +/// A builder for the *locations.queues.resume* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::ResumeQueueRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ResumeQueueRequest::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().locations_queues_resume(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueResumeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: ResumeQueueRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueResumeCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueResumeCall<'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, Queue)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.resume", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:resume"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ResumeQueueRequest) -> ProjectLocationQueueResumeCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The queue name. For example: + /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueResumeCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueResumeCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueResumeCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueResumeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Cancel a pull task's lease. +/// +/// The lease holder can use this method to cancel a task's lease +/// by setting Task.schedule_time to now. This will make the task +/// available to be leased to the next caller of CloudTasks.PullTasks. +/// +/// A builder for the *locations.queues.tasks.cancelLease* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::CancelLeaseRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CancelLeaseRequest::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().locations_queues_tasks_cancel_lease(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: CancelLeaseRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskCancelLeaseCall<'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, Task)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.cancelLease", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:cancelLease"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CancelLeaseRequest) -> ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueTaskCancelLeaseCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskCancelLeaseCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists queues. +/// +/// Queues are returned in lexicographical order. +/// +/// A builder for the *locations.queues.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_list("parent") +/// .page_token("ipsum") +/// .page_size(-5) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueListCall<'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, ListQueuesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "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 = self.hub._base_url.clone() + "v2beta2/{+parent}/queues"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 location name. + /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectLocationQueueListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// A token identifying the page of results to return. + /// + /// To request the first page results, page_token must be empty. To + /// request the next page of results, page_token must be the value of + /// ListQueuesResponse.next_page_token returned from the previous + /// call to CloudTasks.ListQueues method. It is an error to + /// switch the value of ListQueuesRequest.filter while iterating + /// through pages. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationQueueListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. + /// + /// The maximum page size is 9800. If unspecified, the page size will + /// be the maximum. Fewer queues than requested might be returned, + /// even if more queues exist; use + /// ListQueuesResponse.next_page_token to determine if more + /// queues exist. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationQueueListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// `filter` can be used to specify a subset of queues. Any Queue + /// field can be used as a filter and several operators as supported. + /// For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + /// described in + /// [Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters). + /// + /// Sample filter "app_engine_http_target: *". + /// + /// Note that using filters might cause fewer queues than the + /// requested_page size to be returned. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationQueueListCall<'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) -> ProjectLocationQueueListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Forces a task to run now. +/// +/// This command is meant to be used for manual debugging. For +/// example, CloudTasks.RunTask can be used to retry a failed +/// task after a fix has been made or to manually force a task to be +/// dispatched now. +/// +/// When this method is called, Cloud Tasks will dispatch the task to its +/// target, even if the queue is Queue.QueueState.PAUSED. +/// +/// The dispatched task is returned. That is, the task that is returned +/// contains the Task.task_status after the task is dispatched but +/// before the task is received by its target. +/// +/// If Cloud Tasks receives a successful response from the task's +/// handler, then the task will be deleted; otherwise the task's +/// Task.schedule_time will be reset to the time that +/// CloudTasks.RunTask was called plus the retry delay specified +/// in the queue and task's RetryConfig. +/// +/// CloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when +/// it is called on a task that has already succeeded or permanently +/// failed. google.rpc.Code.FAILED_PRECONDITION is returned when +/// CloudTasks.RunTask is called on task that is dispatched or +/// already running. +/// +/// A builder for the *locations.queues.tasks.run* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::RunTaskRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RunTaskRequest::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().locations_queues_tasks_run(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskRunCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: RunTaskRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskRunCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskRunCall<'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, Task)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.run", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:run"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RunTaskRequest) -> ProjectLocationQueueTaskRunCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskRunCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueTaskRunCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskRunCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskRunCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Pauses the queue. +/// +/// If a queue is paused then the system will stop executing the +/// tasks in the queue until it is resumed via +/// CloudTasks.ResumeQueue. Tasks can still be added when the +/// queue is paused. The state of the queue is stored in +/// Queue.queue_state; if paused it will be set to +/// Queue.QueueState.PAUSED. +/// +/// WARNING: This method is only available to whitelisted +/// users. Using this method carries some risk. Read +/// [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) +/// carefully and then sign up for +/// [whitelist access to this method](https://goo.gl/Fe5mUy). +/// +/// A builder for the *locations.queues.pause* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::PauseQueueRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PauseQueueRequest::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().locations_queues_pause(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueuePauseCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: PauseQueueRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueuePauseCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueuePauseCall<'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, Queue)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.pause", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:pause"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PauseQueueRequest) -> ProjectLocationQueuePauseCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The queue name. For example: + /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueuePauseCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueuePauseCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueuePauseCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueuePauseCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a Queue. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// Authorization requires the following [Google IAM](/iam) permission on the +/// specified resource parent: +/// +/// * `cloudtasks.queues.getIamPolicy` +/// +/// +/// A builder for the *locations.queues.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::GetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GetIamPolicyRequest::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().locations_queues_get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.getIamPolicy", + 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 = self.hub._base_url.clone() + "v2beta2/{+resource}:getIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GetIamPolicyRequest) -> ProjectLocationQueueGetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationQueueGetIamPolicyCall<'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) -> ProjectLocationQueueGetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a location. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationGetCall<'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, Location)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Resource name for the location. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Renew the current lease of a pull task. +/// +/// The lease holder can use this method to extend the lease by a new +/// duration, starting from now. The new task lease will be +/// returned in Task.schedule_time. +/// +/// A builder for the *locations.queues.tasks.renewLease* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::RenewLeaseRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RenewLeaseRequest::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().locations_queues_tasks_renew_lease(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: RenewLeaseRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTaskRenewLeaseCall<'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, Task)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.tasks.renewLease", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:renewLease"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RenewLeaseRequest) -> ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The task name. For example: + /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueueTaskRenewLeaseCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTaskRenewLeaseCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists information about the supported locations for this service. +/// +/// A builder for the *locations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_list("name") +/// .page_token("sadipscing") +/// .page_size(-48) +/// .filter("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'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, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource that owns the locations collection, if applicable. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'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) -> ProjectLocationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on a Queue. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a google.rpc.Code.NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// +/// A builder for the *locations.queues.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().locations_queues_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueueTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueueTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueueTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.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 = self.hub._base_url.clone() + "v2beta2/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectLocationQueueTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectLocationQueueTestIamPermissionCall<'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) -> ProjectLocationQueueTestIamPermissionCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueueTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueueTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Purges a queue by deleting all of its tasks. +/// +/// All tasks created before this method is called are permanently deleted. +/// +/// Purge operations can take up to one minute to take effect. Tasks +/// might be dispatched before the purge takes effect. A purge is irreversible. +/// +/// A builder for the *locations.queues.purge* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudtasks2_beta2 as cloudtasks2_beta2; +/// use cloudtasks2_beta2::PurgeQueueRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudtasks2_beta2::CloudTasks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudTasks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PurgeQueueRequest::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().locations_queues_purge(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationQueuePurgeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudTasks, + _request: PurgeQueueRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationQueuePurgeCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationQueuePurgeCall<'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, Queue)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudtasks.projects.locations.queues.purge", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta2/{+name}:purge"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PurgeQueueRequest) -> ProjectLocationQueuePurgeCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. + /// + /// The queue name. For example: + /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationQueuePurgeCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationQueuePurgeCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationQueuePurgeCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLocationQueuePurgeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/container1-cli/Cargo.toml b/gen/container1-cli/Cargo.toml index f8c1cad852..e567ddb6dd 100644 --- a/gen/container1-cli/Cargo.toml +++ b/gen/container1-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-container1-cli" -version = "1.0.6+20170430" +version = "1.0.6+20170915" authors = ["Sebastian Thiel "] -description = "A complete library to interact with container (protocol v1)" +description = "A complete library to interact with Container (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1-cli" homepage = "https://cloud.google.com/container-engine/" documentation = "http://byron.github.io/google-apis-rs/google_container1_cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-container1] path = "../container1" -version = "1.0.6+20170430" +version = "1.0.6+20170915" diff --git a/gen/container1-cli/README.md b/gen/container1-cli/README.md index 592d632d25..54878c8814 100644 --- a/gen/container1-cli/README.md +++ b/gen/container1-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `container1` command-line interface *(CLI)* allows to use most features of the *Google container* service from the comfort of your terminal. +The `container1` command-line interface *(CLI)* allows to use most features of the *Google Container* 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 *container* API can be found at the +Everything else about the *Container* API can be found at the [official documentation site](https://cloud.google.com/container-engine/). # Installation and Source Code @@ -25,25 +25,35 @@ 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 *20170430*. The CLI is at version *1.0.6*. +This documentation was generated from the *Container* API at revision *20170915*. The CLI is at version *1.0.6*. ```bash container1 [options] projects + zones-clusters-addons (-r )... [-p ]... [-o ] zones-clusters-complete-ip-rotation (-r )... [-p ]... [-o ] zones-clusters-create (-r )... [-p ]... [-o ] zones-clusters-delete [-p ]... [-o ] zones-clusters-get [-p ]... [-o ] zones-clusters-legacy-abac (-r )... [-p ]... [-o ] zones-clusters-list [-p ]... [-o ] + zones-clusters-locations (-r )... [-p ]... [-o ] + zones-clusters-logging (-r )... [-p ]... [-o ] + zones-clusters-master (-r )... [-p ]... [-o ] + zones-clusters-monitoring (-r )... [-p ]... [-o ] + zones-clusters-node-pools-autoscaling (-r )... [-p ]... [-o ] zones-clusters-node-pools-create (-r )... [-p ]... [-o ] zones-clusters-node-pools-delete [-p ]... [-o ] zones-clusters-node-pools-get [-p ]... [-o ] zones-clusters-node-pools-list [-p ]... [-o ] zones-clusters-node-pools-rollback (-r )... [-p ]... [-o ] zones-clusters-node-pools-set-management (-r )... [-p ]... [-o ] + zones-clusters-node-pools-set-size (-r )... [-p ]... [-o ] + zones-clusters-node-pools-update (-r )... [-p ]... [-o ] zones-clusters-resource-labels (-r )... [-p ]... [-o ] + zones-clusters-set-maintenance-policy (-r )... [-p ]... [-o ] zones-clusters-set-master-auth (-r )... [-p ]... [-o ] + zones-clusters-set-network-policy (-r )... [-p ]... [-o ] zones-clusters-start-ip-rotation (-r )... [-p ]... [-o ] zones-clusters-update (-r )... [-p ]... [-o ] zones-get-serverconfig [-p ]... [-o ] diff --git a/gen/container1-cli/mkdocs.yml b/gen/container1-cli/mkdocs.yml index bf73b9e8df..24177ddd80 100644 --- a/gen/container1-cli/mkdocs.yml +++ b/gen/container1-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: container v1.0.6+20170430 +site_name: Container v1.0.6+20170915 site_url: http://byron.github.io/google-apis-rs/google-container1-cli -site_description: A complete library to interact with container (protocol v1) +site_description: A complete library to interact with Container (protocol v1) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/container1-cli @@ -9,20 +9,30 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_zones-clusters-addons.md', 'Projects', 'Zones Clusters Addons'] - ['projects_zones-clusters-complete-ip-rotation.md', 'Projects', 'Zones Clusters Complete Ip Rotation'] - ['projects_zones-clusters-create.md', 'Projects', 'Zones Clusters Create'] - ['projects_zones-clusters-delete.md', 'Projects', 'Zones Clusters Delete'] - ['projects_zones-clusters-get.md', 'Projects', 'Zones Clusters Get'] - ['projects_zones-clusters-legacy-abac.md', 'Projects', 'Zones Clusters Legacy Abac'] - ['projects_zones-clusters-list.md', 'Projects', 'Zones Clusters List'] +- ['projects_zones-clusters-locations.md', 'Projects', 'Zones Clusters Locations'] +- ['projects_zones-clusters-logging.md', 'Projects', 'Zones Clusters Logging'] +- ['projects_zones-clusters-master.md', 'Projects', 'Zones Clusters Master'] +- ['projects_zones-clusters-monitoring.md', 'Projects', 'Zones Clusters Monitoring'] +- ['projects_zones-clusters-node-pools-autoscaling.md', 'Projects', 'Zones Clusters Node Pools Autoscaling'] - ['projects_zones-clusters-node-pools-create.md', 'Projects', 'Zones Clusters Node Pools Create'] - ['projects_zones-clusters-node-pools-delete.md', 'Projects', 'Zones Clusters Node Pools Delete'] - ['projects_zones-clusters-node-pools-get.md', 'Projects', 'Zones Clusters Node Pools Get'] - ['projects_zones-clusters-node-pools-list.md', 'Projects', 'Zones Clusters Node Pools List'] - ['projects_zones-clusters-node-pools-rollback.md', 'Projects', 'Zones Clusters Node Pools Rollback'] - ['projects_zones-clusters-node-pools-set-management.md', 'Projects', 'Zones Clusters Node Pools Set Management'] +- ['projects_zones-clusters-node-pools-set-size.md', 'Projects', 'Zones Clusters Node Pools Set Size'] +- ['projects_zones-clusters-node-pools-update.md', 'Projects', 'Zones Clusters Node Pools Update'] - ['projects_zones-clusters-resource-labels.md', 'Projects', 'Zones Clusters Resource Labels'] +- ['projects_zones-clusters-set-maintenance-policy.md', 'Projects', 'Zones Clusters Set Maintenance Policy'] - ['projects_zones-clusters-set-master-auth.md', 'Projects', 'Zones Clusters Set Master Auth'] +- ['projects_zones-clusters-set-network-policy.md', 'Projects', 'Zones Clusters Set Network Policy'] - ['projects_zones-clusters-start-ip-rotation.md', 'Projects', 'Zones Clusters Start Ip Rotation'] - ['projects_zones-clusters-update.md', 'Projects', 'Zones Clusters Update'] - ['projects_zones-get-serverconfig.md', 'Projects', 'Zones Get Serverconfig'] diff --git a/gen/container1-cli/src/main.rs b/gen/container1-cli/src/main.rs index d73c3b0bc7..f3f2343a4d 100644 --- a/gen/container1-cli/src/main.rs +++ b/gen/container1-cli/src/main.rs @@ -46,6 +46,94 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_zones_clusters_addons(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "addons-config.http-load-balancing.disabled" => Some(("addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "addons-config.network-policy-config.disabled" => Some(("addonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "addons-config.kubernetes-dashboard.disabled" => Some(("addonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "addons-config.horizontal-pod-autoscaling.disabled" => Some(("addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "disabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "network-policy-config"]); + 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::SetAddonsConfigRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_addons(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_complete_ip_rotation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -154,34 +242,53 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "cluster.node-ipv4-cidr-size" => Some(("cluster.nodeIpv4CidrSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.daily-maintenance-window.duration" => Some(("cluster.maintenancePolicy.window.dailyMaintenanceWindow.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.daily-maintenance-window.start-time" => Some(("cluster.maintenancePolicy.window.dailyMaintenanceWindow.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.network-policy.enabled" => Some(("cluster.networkPolicy.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.network-policy.provider" => Some(("cluster.networkPolicy.provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.master-authorized-networks-config.enabled" => Some(("cluster.masterAuthorizedNetworksConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.http-load-balancing.disabled" => Some(("cluster.addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.addons-config.network-policy-config.disabled" => Some(("cluster.addonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.addons-config.kubernetes-dashboard.disabled" => Some(("cluster.addonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.horizontal-pod-autoscaling.disabled" => Some(("cluster.addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.locations" => Some(("cluster.locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "cluster.enable-kubernetes-alpha" => Some(("cluster.enableKubernetesAlpha", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.legacy-abac.enabled" => Some(("cluster.legacyAbac.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.network" => Some(("cluster.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.logging-service" => Some(("cluster.loggingService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.instance-group-urls" => Some(("cluster.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "cluster.zone" => Some(("cluster.zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.node-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.nodeIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.use-ip-aliases" => Some(("cluster.ipAllocationPolicy.useIpAliases", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.cluster-secondary-range-name" => Some(("cluster.ipAllocationPolicy.clusterSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.cluster-ipv4-cidr-block" => Some(("cluster.ipAllocationPolicy.clusterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.services-ipv4-cidr-block" => Some(("cluster.ipAllocationPolicy.servicesIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.create-subnetwork" => Some(("cluster.ipAllocationPolicy.createSubnetwork", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.node-ipv4-cidr-block" => Some(("cluster.ipAllocationPolicy.nodeIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.cluster-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.clusterIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.subnetwork-name" => Some(("cluster.ipAllocationPolicy.subnetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.services-secondary-range-name" => Some(("cluster.ipAllocationPolicy.servicesSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.ip-allocation-policy.services-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.servicesIpv4Cidr", 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.resource-labels" => Some(("cluster.resourceLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.status" => Some(("cluster.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.description" => Some(("cluster.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-version" => Some(("cluster.currentNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.label-fingerprint" => Some(("cluster.labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-master-version" => Some(("cluster.currentMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.username" => Some(("cluster.masterAuth.username", 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.client-certificate-config.issue-client-certificate" => Some(("cluster.masterAuth.clientCertificateConfig.issueClientCertificate", JsonTypeInfo { jtype: JsonType::Boolean, 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.expire-time" => Some(("cluster.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.initial-node-count" => Some(("cluster.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.monitoring-service" => Some(("cluster.monitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.create-time" => Some(("cluster.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.endpoint" => Some(("cluster.endpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-count" => Some(("cluster.currentNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.legacy-abac.enabled" => Some(("cluster.legacyAbac.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.zone" => Some(("cluster.zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.enable-kubernetes-alpha" => Some(("cluster.enableKubernetesAlpha", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.initial-cluster-version" => Some(("cluster.initialClusterVersion", 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.tags" => Some(("cluster.nodeConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -190,15 +297,16 @@ impl<'n> Engine<'n> { "cluster.node-config.service-account" => Some(("cluster.nodeConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.oauth-scopes" => Some(("cluster.nodeConfig.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.node-config.disk-size-gb" => Some(("cluster.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "cluster.node-config.local-ssd-count" => Some(("cluster.nodeConfig.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "cluster.node-config.image-type" => Some(("cluster.nodeConfig.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.min-cpu-platform" => Some(("cluster.nodeConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.metadata" => Some(("cluster.nodeConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "cluster.node-config.image-type" => Some(("cluster.nodeConfig.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.local-ssd-count" => Some(("cluster.nodeConfig.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.cluster-ipv4-cidr" => Some(("cluster.clusterIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.subnetwork" => Some(("cluster.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.resource-labels" => Some(("cluster.resourceLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "cluster.services-ipv4-cidr" => Some(("cluster.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.self-link" => Some(("cluster.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "client-certificate", "client-key", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "create-time", "current-master-version", "current-node-count", "current-node-version", "description", "disabled", "disk-size-gb", "enable-kubernetes-alpha", "enabled", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "locations", "logging-service", "machine-type", "master-auth", "metadata", "monitoring-service", "name", "network", "node-config", "node-ipv4-cidr-size", "oauth-scopes", "password", "preemptible", "resource-labels", "self-link", "service-account", "services-ipv4-cidr", "status", "status-message", "subnetwork", "tags", "username", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "client-certificate", "client-certificate-config", "client-key", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "create-subnetwork", "create-time", "current-master-version", "current-node-count", "current-node-version", "daily-maintenance-window", "description", "disabled", "disk-size-gb", "duration", "enable-kubernetes-alpha", "enabled", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "ip-allocation-policy", "issue-client-certificate", "kubernetes-dashboard", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "locations", "logging-service", "machine-type", "maintenance-policy", "master-auth", "master-authorized-networks-config", "metadata", "min-cpu-platform", "monitoring-service", "name", "network", "network-policy", "network-policy-config", "node-config", "node-ipv4-cidr", "node-ipv4-cidr-block", "node-ipv4-cidr-size", "oauth-scopes", "password", "preemptible", "provider", "resource-labels", "self-link", "service-account", "services-ipv4-cidr", "services-ipv4-cidr-block", "services-secondary-range-name", "start-time", "status", "status-message", "subnetwork", "subnetwork-name", "tags", "use-ip-aliases", "username", "window", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -499,6 +607,433 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_clusters_locations(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "locations" => Some(("locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["locations"]); + 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::SetLocationsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_locations(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_logging(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "logging-service" => Some(("loggingService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["logging-service"]); + 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::SetLoggingServiceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_logging(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_master(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "master-version" => Some(("masterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["master-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::UpdateMasterRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_master(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_monitoring(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "monitoring-service" => Some(("monitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["monitoring-service"]); + 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::SetMonitoringServiceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_monitoring(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_node_pools_autoscaling(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "autoscaling.min-node-count" => Some(("autoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling.enabled" => Some(("autoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "autoscaling.max-node-count" => Some(("autoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling", "enabled", "max-node-count", "min-node-count"]); + 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::SetNodePoolAutoscalingRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_node_pools_autoscaling(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or(""), opt.value_of("node-pool-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_node_pools_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -524,9 +1059,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "node-pool.status" => Some(("nodePool.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.self-link" => Some(("nodePool.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.management.auto-repair" => Some(("nodePool.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.management.upgrade-options.description" => Some(("nodePool.management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.management.upgrade-options.auto-upgrade-start-time" => Some(("nodePool.management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "node-pool.management.auto-repair" => Some(("nodePool.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.management.auto-upgrade" => Some(("nodePool.management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.name" => Some(("nodePool.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.instance-group-urls" => Some(("nodePool.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -542,12 +1077,13 @@ impl<'n> Engine<'n> { "node-pool.config.service-account" => Some(("nodePool.config.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.oauth-scopes" => Some(("nodePool.config.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.config.disk-size-gb" => Some(("nodePool.config.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "node-pool.config.local-ssd-count" => Some(("nodePool.config.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "node-pool.config.image-type" => Some(("nodePool.config.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.min-cpu-platform" => Some(("nodePool.config.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.metadata" => Some(("nodePool.config.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "node-pool.config.image-type" => Some(("nodePool.config.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.local-ssd-count" => Some(("nodePool.config.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.status-message" => Some(("nodePool.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoscaling", "config", "description", "disk-size-gb", "enabled", "image-type", "initial-node-count", "instance-group-urls", "labels", "local-ssd-count", "machine-type", "management", "max-node-count", "metadata", "min-node-count", "name", "node-pool", "oauth-scopes", "preemptible", "self-link", "service-account", "status", "status-message", "tags", "upgrade-options", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoscaling", "config", "description", "disk-size-gb", "enabled", "image-type", "initial-node-count", "instance-group-urls", "labels", "local-ssd-count", "machine-type", "management", "max-node-count", "metadata", "min-cpu-platform", "min-node-count", "name", "node-pool", "oauth-scopes", "preemptible", "self-link", "service-account", "status", "status-message", "tags", "upgrade-options", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -870,9 +1406,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "management.auto-repair" => Some(("management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "management.upgrade-options.description" => Some(("management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "management.upgrade-options.auto-upgrade-start-time" => Some(("management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "management.auto-repair" => Some(("management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "management.auto-upgrade" => Some(("management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "description", "management", "upgrade-options"]); @@ -935,6 +1471,177 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_clusters_node_pools_set_size(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "node-count" => Some(("nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["node-count"]); + 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::SetNodePoolSizeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_node_pools_set_size(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or(""), opt.value_of("node-pool-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_node_pools_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "node-version" => Some(("nodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "image-type" => Some(("imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["image-type", "node-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::UpdateNodePoolRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_node_pools_update(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or(""), opt.value_of("node-pool-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_resource_labels(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1021,6 +1728,92 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_clusters_set_maintenance_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "maintenance-policy.window.daily-maintenance-window.duration" => Some(("maintenancePolicy.window.dailyMaintenanceWindow.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.daily-maintenance-window.start-time" => Some(("maintenancePolicy.window.dailyMaintenanceWindow.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["daily-maintenance-window", "duration", "maintenance-policy", "start-time", "window"]); + 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::SetMaintenancePolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_set_maintenance_policy(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_set_master_auth(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1046,12 +1839,13 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.username" => Some(("update.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update.password" => Some(("update.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.client-key" => Some(("update.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.client-certificate" => Some(("update.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.client-certificate-config.issue-client-certificate" => Some(("update.clientCertificateConfig.issueClientCertificate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.password" => Some(("update.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.cluster-ca-certificate" => Some(("update.clusterCaCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "client-certificate", "client-key", "cluster-ca-certificate", "password", "update", "username"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "client-certificate", "client-certificate-config", "client-key", "cluster-ca-certificate", "issue-client-certificate", "password", "update", "username"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1111,6 +1905,92 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_clusters_set_network_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "network-policy.enabled" => Some(("networkPolicy.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-policy.provider" => Some(("networkPolicy.provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["enabled", "network-policy", "provider"]); + 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::SetNetworkPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_set_network_policy(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_start_ip_rotation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1218,11 +2098,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update.desired-node-pool-id" => Some(("update.desiredNodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-master-authorized-networks-config.enabled" => Some(("update.desiredMasterAuthorizedNetworksConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-locations" => Some(("update.desiredLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "update.desired-addons-config.http-load-balancing.disabled" => Some(("update.desiredAddonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-addons-config.network-policy-config.disabled" => Some(("update.desiredAddonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-addons-config.kubernetes-dashboard.disabled" => Some(("update.desiredAddonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.horizontal-pod-autoscaling.disabled" => Some(("update.desiredAddonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-master-version" => Some(("update.desiredMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update.desired-locations" => Some(("update.desiredLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.desired-node-pool-id" => Some(("update.desiredNodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-node-version" => Some(("update.desiredNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-monitoring-service" => Some(("update.desiredMonitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.min-node-count" => Some(("update.desiredNodePoolAutoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1230,7 +2113,7 @@ impl<'n> Engine<'n> { "update.desired-node-pool-autoscaling.max-node-count" => Some(("update.desiredNodePoolAutoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update.desired-image-type" => Some(("update.desiredImageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["desired-addons-config", "desired-image-type", "desired-locations", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "disabled", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "max-node-count", "min-node-count", "update"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["desired-addons-config", "desired-image-type", "desired-locations", "desired-master-authorized-networks-config", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "disabled", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "max-node-count", "min-node-count", "network-policy-config", "update"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1537,6 +2420,9 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { + ("zones-clusters-addons", Some(opt)) => { + call_result = self._projects_zones_clusters_addons(opt, dry_run, &mut err); + }, ("zones-clusters-complete-ip-rotation", Some(opt)) => { call_result = self._projects_zones_clusters_complete_ip_rotation(opt, dry_run, &mut err); }, @@ -1555,6 +2441,21 @@ impl<'n> Engine<'n> { ("zones-clusters-list", Some(opt)) => { call_result = self._projects_zones_clusters_list(opt, dry_run, &mut err); }, + ("zones-clusters-locations", Some(opt)) => { + call_result = self._projects_zones_clusters_locations(opt, dry_run, &mut err); + }, + ("zones-clusters-logging", Some(opt)) => { + call_result = self._projects_zones_clusters_logging(opt, dry_run, &mut err); + }, + ("zones-clusters-master", Some(opt)) => { + call_result = self._projects_zones_clusters_master(opt, dry_run, &mut err); + }, + ("zones-clusters-monitoring", Some(opt)) => { + call_result = self._projects_zones_clusters_monitoring(opt, dry_run, &mut err); + }, + ("zones-clusters-node-pools-autoscaling", Some(opt)) => { + call_result = self._projects_zones_clusters_node_pools_autoscaling(opt, dry_run, &mut err); + }, ("zones-clusters-node-pools-create", Some(opt)) => { call_result = self._projects_zones_clusters_node_pools_create(opt, dry_run, &mut err); }, @@ -1573,12 +2474,24 @@ impl<'n> Engine<'n> { ("zones-clusters-node-pools-set-management", Some(opt)) => { call_result = self._projects_zones_clusters_node_pools_set_management(opt, dry_run, &mut err); }, + ("zones-clusters-node-pools-set-size", Some(opt)) => { + call_result = self._projects_zones_clusters_node_pools_set_size(opt, dry_run, &mut err); + }, + ("zones-clusters-node-pools-update", Some(opt)) => { + call_result = self._projects_zones_clusters_node_pools_update(opt, dry_run, &mut err); + }, ("zones-clusters-resource-labels", Some(opt)) => { call_result = self._projects_zones_clusters_resource_labels(opt, dry_run, &mut err); }, + ("zones-clusters-set-maintenance-policy", Some(opt)) => { + call_result = self._projects_zones_clusters_set_maintenance_policy(opt, dry_run, &mut err); + }, ("zones-clusters-set-master-auth", Some(opt)) => { call_result = self._projects_zones_clusters_set_master_auth(opt, dry_run, &mut err); }, + ("zones-clusters-set-network-policy", Some(opt)) => { + call_result = self._projects_zones_clusters_set_network_policy(opt, dry_run, &mut err); + }, ("zones-clusters-start-ip-rotation", Some(opt)) => { call_result = self._projects_zones_clusters_start_ip_rotation(opt, dry_run, &mut err); }, @@ -1689,7 +2602,50 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'zones-clusters-complete-ip-rotation', 'zones-clusters-create', 'zones-clusters-delete', 'zones-clusters-get', 'zones-clusters-legacy-abac', 'zones-clusters-list', 'zones-clusters-node-pools-create', 'zones-clusters-node-pools-delete', 'zones-clusters-node-pools-get', 'zones-clusters-node-pools-list', 'zones-clusters-node-pools-rollback', 'zones-clusters-node-pools-set-management', 'zones-clusters-resource-labels', 'zones-clusters-set-master-auth', 'zones-clusters-start-ip-rotation', 'zones-clusters-update', 'zones-get-serverconfig', 'zones-operations-cancel', 'zones-operations-get' and 'zones-operations-list'", vec![ + ("projects", "methods: 'zones-clusters-addons', 'zones-clusters-complete-ip-rotation', 'zones-clusters-create', 'zones-clusters-delete', 'zones-clusters-get', 'zones-clusters-legacy-abac', 'zones-clusters-list', 'zones-clusters-locations', 'zones-clusters-logging', 'zones-clusters-master', 'zones-clusters-monitoring', 'zones-clusters-node-pools-autoscaling', 'zones-clusters-node-pools-create', 'zones-clusters-node-pools-delete', 'zones-clusters-node-pools-get', 'zones-clusters-node-pools-list', 'zones-clusters-node-pools-rollback', 'zones-clusters-node-pools-set-management', 'zones-clusters-node-pools-set-size', 'zones-clusters-node-pools-update', 'zones-clusters-resource-labels', 'zones-clusters-set-maintenance-policy', 'zones-clusters-set-master-auth', 'zones-clusters-set-network-policy', 'zones-clusters-start-ip-rotation', 'zones-clusters-update', 'zones-get-serverconfig', 'zones-operations-cancel', 'zones-operations-get' and 'zones-operations-list'", vec![ + ("zones-clusters-addons", + Some(r##"Sets the addons of a specific cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-addons", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + 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)), + ]), ("zones-clusters-complete-ip-rotation", Some(r##"Completes master IP rotation."##), "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-complete-ip-rotation", @@ -1933,6 +2889,227 @@ 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-clusters-locations", + Some(r##"Sets the locations of a specific cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-locations", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + 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)), + ]), + ("zones-clusters-logging", + Some(r##"Sets the logging service of a specific cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-logging", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + 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)), + ]), + ("zones-clusters-master", + Some(r##"Updates the master of a specific cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-master", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + 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)), + ]), + ("zones-clusters-monitoring", + Some(r##"Sets the monitoring service of a specific cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-monitoring", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + 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)), + ]), + ("zones-clusters-node-pools-autoscaling", + Some(r##"Sets the autoscaling settings of a specific node pool."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-node-pools-autoscaling", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + Some(true), + Some(false)), + + (Some(r##"node-pool-id"##), + None, + Some(r##"The name of the node pool to upgrade."##), + 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"##), @@ -2198,6 +3375,104 @@ 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-clusters-node-pools-set-size", + Some(r##"Sets the size of a specific node pool."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-node-pools-set-size", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to update."##), + Some(true), + Some(false)), + + (Some(r##"node-pool-id"##), + None, + Some(r##"The name of the node pool to update."##), + 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)), + ]), + ("zones-clusters-node-pools-update", + Some(r##"Updates the version and/or image type of a specific node pool."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-node-pools-update", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + Some(true), + Some(false)), + + (Some(r##"node-pool-id"##), + None, + Some(r##"The name of the node pool to upgrade."##), + 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"##), @@ -2241,6 +3516,49 @@ 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-clusters-set-maintenance-policy", + Some(r##"Sets the maintenance policy for a cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-set-maintenance-policy", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to update."##), + 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"##), @@ -2286,6 +3604,49 @@ 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-clusters-set-network-policy", + Some(r##"Enables/Disables Network Policy for a cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-set-network-policy", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster."##), + 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"##), @@ -2523,7 +3884,7 @@ fn main() { let mut app = App::new("container1") .author("Sebastian Thiel ") - .version("1.0.6+20170430") + .version("1.0.6+20170915") .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_cli") .arg(Arg::with_name("url") diff --git a/gen/container1/Cargo.toml b/gen/container1/Cargo.toml index a049fb9d40..f3d43d8e25 100644 --- a/gen/container1/Cargo.toml +++ b/gen/container1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-container1" -version = "1.0.6+20170430" +version = "1.0.6+20170915" authors = ["Sebastian Thiel "] -description = "A complete library to interact with container (protocol v1)" +description = "A complete library to interact with Container (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1" homepage = "https://cloud.google.com/container-engine/" -documentation = "https://docs.rs/google-container1/1.0.6+20170430" +documentation = "https://docs.rs/google-container1/1.0.6+20170915" license = "MIT" keywords = ["container", "google", "protocol", "web", "api"] diff --git a/gen/container1/README.md b/gen/container1/README.md index e9a912d763..a6792f1bde 100644 --- a/gen/container1/README.md +++ b/gen/container1/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-container1` library allows access to all features of the *Google container* service. +The `google-container1` library allows access to all features of the *Google Container* service. -This documentation was generated from *container* crate version *1.0.6+20170430*, where *20170430* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Container* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. -Everything else about the *container* *v1* API can be found at the +Everything else about the *Container* *v1* API can be found at the [official documentation site](https://cloud.google.com/container-engine/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.Container.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.Container.html) ... * projects - * [*zones clusters complete ip rotation*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters resource labels*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set master auth*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters start ip rotation*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.ProjectZoneOperationListCall.html) + * [*zones clusters addons*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterAddonCall.html), [*zones clusters complete ip rotation*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters locations*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterLocationCall.html), [*zones clusters logging*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterLoggingCall.html), [*zones clusters master*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterMasterCall.html), [*zones clusters monitoring*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterMonitoringCall.html), [*zones clusters node pools autoscaling*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolAutoscalingCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters node pools set size*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolSetSizeCall.html), [*zones clusters node pools update*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterNodePoolUpdateCall.html), [*zones clusters resource labels*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set maintenance policy*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterSetMaintenancePolicyCall.html), [*zones clusters set master auth*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters set network policy*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterSetNetworkPolicyCall.html), [*zones clusters start ip rotation*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.ProjectZoneOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-container1/1.0.6+20170430/google_container1/struct.Container.html)** +* **[Hub](https://docs.rs/google-container1/1.0.6+20170915/google_container1/struct.Container.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.Part.html)** + * **[Parts](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -48,18 +48,28 @@ Or specifically ... ```ignore let r = hub.projects().zones_clusters_node_pools_rollback(...).doit() -let r = hub.projects().zones_clusters_delete(...).doit() let r = hub.projects().zones_clusters_node_pools_create(...).doit() +let r = hub.projects().zones_clusters_monitoring(...).doit() +let r = hub.projects().zones_clusters_delete(...).doit() +let r = hub.projects().zones_clusters_legacy_abac(...).doit() +let r = hub.projects().zones_clusters_addons(...).doit() +let r = hub.projects().zones_clusters_start_ip_rotation(...).doit() +let r = hub.projects().zones_clusters_create(...).doit() +let r = hub.projects().zones_clusters_node_pools_set_management(...).doit() +let r = hub.projects().zones_operations_get(...).doit() +let r = hub.projects().zones_clusters_logging(...).doit() +let r = hub.projects().zones_clusters_update(...).doit() +let r = hub.projects().zones_clusters_node_pools_autoscaling(...).doit() +let r = hub.projects().zones_clusters_node_pools_set_size(...).doit() +let r = hub.projects().zones_clusters_set_maintenance_policy(...).doit() +let r = hub.projects().zones_clusters_node_pools_delete(...).doit() +let r = hub.projects().zones_clusters_locations(...).doit() +let r = hub.projects().zones_clusters_master(...).doit() +let r = hub.projects().zones_clusters_node_pools_update(...).doit() +let r = hub.projects().zones_clusters_set_network_policy(...).doit() let r = hub.projects().zones_clusters_set_master_auth(...).doit() let r = hub.projects().zones_clusters_complete_ip_rotation(...).doit() -let r = hub.projects().zones_clusters_node_pools_set_management(...).doit() -let r = hub.projects().zones_clusters_legacy_abac(...).doit() -let r = hub.projects().zones_operations_get(...).doit() let r = hub.projects().zones_clusters_resource_labels(...).doit() -let r = hub.projects().zones_clusters_create(...).doit() -let r = hub.projects().zones_clusters_update(...).doit() -let r = hub.projects().zones_clusters_start_ip_rotation(...).doit() -let r = hub.projects().zones_clusters_node_pools_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -134,17 +144,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-container1/1.0.6+20170430/google_container1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-container1/1.0.6+20170915/google_container1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-container1/1.0.6+20170430/google_container1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-container1/1.0.6+20170915/google_container1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-container1/1.0.6+20170915/google_container1/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")`. @@ -154,29 +164,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-container1/1.0.6+20170915/google_container1/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](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-container1/1.0.6+20170915/google_container1/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](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-container1/1.0.6+20170915/google_container1/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](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-container1/1.0.6+20170915/google_container1/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](https://docs.rs/google-container1/1.0.6+20170430/google_container1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/container1/src/lib.rs b/gen/container1/src/lib.rs index 303d8e5ceb..020ad20a1f 100644 --- a/gen/container1/src/lib.rs +++ b/gen/container1/src/lib.rs @@ -2,9 +2,9 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *container* crate version *1.0.6+20170430*, where *20170430* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Container* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! -//! Everything else about the *container* *v1* API can be found at the +//! Everything else about the *Container* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/container-engine/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/container1). //! # Features @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Container.html) ... //! //! * projects -//! * [*zones clusters complete ip rotation*](struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](struct.ProjectZoneClusterListCall.html), [*zones clusters node pools create*](struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters resource labels*](struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set master auth*](struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters start ip rotation*](struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](struct.ProjectZoneOperationListCall.html) +//! * [*zones clusters addons*](struct.ProjectZoneClusterAddonCall.html), [*zones clusters complete ip rotation*](struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](struct.ProjectZoneClusterListCall.html), [*zones clusters locations*](struct.ProjectZoneClusterLocationCall.html), [*zones clusters logging*](struct.ProjectZoneClusterLoggingCall.html), [*zones clusters master*](struct.ProjectZoneClusterMasterCall.html), [*zones clusters monitoring*](struct.ProjectZoneClusterMonitoringCall.html), [*zones clusters node pools autoscaling*](struct.ProjectZoneClusterNodePoolAutoscalingCall.html), [*zones clusters node pools create*](struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters node pools set size*](struct.ProjectZoneClusterNodePoolSetSizeCall.html), [*zones clusters node pools update*](struct.ProjectZoneClusterNodePoolUpdateCall.html), [*zones clusters resource labels*](struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set maintenance policy*](struct.ProjectZoneClusterSetMaintenancePolicyCall.html), [*zones clusters set master auth*](struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters set network policy*](struct.ProjectZoneClusterSetNetworkPolicyCall.html), [*zones clusters start ip rotation*](struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](struct.ProjectZoneOperationListCall.html) //! //! //! @@ -48,18 +48,28 @@ //! //! ```ignore //! let r = hub.projects().zones_clusters_node_pools_rollback(...).doit() -//! let r = hub.projects().zones_clusters_delete(...).doit() //! let r = hub.projects().zones_clusters_node_pools_create(...).doit() +//! let r = hub.projects().zones_clusters_monitoring(...).doit() +//! let r = hub.projects().zones_clusters_delete(...).doit() +//! let r = hub.projects().zones_clusters_legacy_abac(...).doit() +//! let r = hub.projects().zones_clusters_addons(...).doit() +//! let r = hub.projects().zones_clusters_start_ip_rotation(...).doit() +//! let r = hub.projects().zones_clusters_create(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_set_management(...).doit() +//! let r = hub.projects().zones_operations_get(...).doit() +//! let r = hub.projects().zones_clusters_logging(...).doit() +//! let r = hub.projects().zones_clusters_update(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_autoscaling(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_set_size(...).doit() +//! let r = hub.projects().zones_clusters_set_maintenance_policy(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_delete(...).doit() +//! let r = hub.projects().zones_clusters_locations(...).doit() +//! let r = hub.projects().zones_clusters_master(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_update(...).doit() +//! let r = hub.projects().zones_clusters_set_network_policy(...).doit() //! let r = hub.projects().zones_clusters_set_master_auth(...).doit() //! let r = hub.projects().zones_clusters_complete_ip_rotation(...).doit() -//! let r = hub.projects().zones_clusters_node_pools_set_management(...).doit() -//! let r = hub.projects().zones_clusters_legacy_abac(...).doit() -//! let r = hub.projects().zones_operations_get(...).doit() //! let r = hub.projects().zones_clusters_resource_labels(...).doit() -//! let r = hub.projects().zones_clusters_create(...).doit() -//! let r = hub.projects().zones_clusters_update(...).doit() -//! let r = hub.projects().zones_clusters_start_ip_rotation(...).doit() -//! let r = hub.projects().zones_clusters_node_pools_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -374,6 +384,26 @@ impl<'a, C, A> Container // ############ // SCHEMAS ### // ########## +/// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +/// +/// # 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 clusters set maintenance policy projects](struct.ProjectZoneClusterSetMaintenancePolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetMaintenancePolicyRequest { + /// The maintenance policy to be set for the cluster. An empty field + /// clears the existing maintenance policy. + #[serde(rename="maintenancePolicy")] + pub maintenance_policy: Option, +} + +impl RequestValue for SetMaintenancePolicyRequest {} + + /// ClusterUpdate describes an update to the cluster. Exactly one update can /// be applied to a cluster with each request, so at most one field can be /// provided. @@ -382,6 +412,24 @@ impl<'a, C, A> Container /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClusterUpdate { + /// Master authorized networks is a Beta feature. + /// The desired configuration options for master authorized networks feature. + #[serde(rename="desiredMasterAuthorizedNetworksConfig")] + pub desired_master_authorized_networks_config: Option, + /// The node pool to be upgraded. This field is mandatory if + /// "desired_node_version", "desired_image_family" or + /// "desired_node_pool_autoscaling" is specified and there is more than one + /// node pool on the cluster. + #[serde(rename="desiredNodePoolId")] + pub desired_node_pool_id: Option, + /// Configurations for the various addons available to run in the cluster. + #[serde(rename="desiredAddonsConfig")] + pub desired_addons_config: Option, + /// The Kubernetes version to change the master to. The only valid value is the + /// latest supported version. Use "-" to have the server automatically select + /// the latest version. + #[serde(rename="desiredMasterVersion")] + pub desired_master_version: Option, /// The desired list of Google Compute Engine /// [locations](/compute/docs/zones#available) in which the cluster's nodes /// should be located. Changing the locations a cluster is in will result @@ -391,20 +439,6 @@ pub struct ClusterUpdate { /// This list must always include the cluster's primary zone. #[serde(rename="desiredLocations")] pub desired_locations: Option>, - /// Configurations for the various addons available to run in the cluster. - #[serde(rename="desiredAddonsConfig")] - pub desired_addons_config: Option, - /// The Kubernetes version to change the master to. The only valid value is the - /// latest supported version. Use "-" to have the server automatically select - /// the latest version. - #[serde(rename="desiredMasterVersion")] - pub desired_master_version: Option, - /// The node pool to be upgraded. This field is mandatory if - /// "desired_node_version", "desired_image_family" or - /// "desired_node_pool_autoscaling" is specified and there is more than one - /// node pool on the cluster. - #[serde(rename="desiredNodePoolId")] - pub desired_node_pool_id: Option, /// The Kubernetes version to change the nodes to (typically an /// upgrade). Use `-` to upgrade to the latest version supported by /// the server. @@ -432,85 +466,6 @@ pub struct ClusterUpdate { impl Part for ClusterUpdate {} -/// UpdateClusterRequest updates the settings of a cluster. -/// -/// # 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 clusters update projects](struct.ProjectZoneClusterUpdateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UpdateClusterRequest { - /// A description of the update. - pub update: Option, -} - -impl RequestValue for UpdateClusterRequest {} - - -/// Configuration options for the HTTP (L7) load balancing controller addon, -/// which makes it easy to set up HTTP load balancers for services in a cluster. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HttpLoadBalancing { - /// Whether the HTTP Load Balancing controller is enabled in the cluster. - /// When enabled, it runs a small pod in the cluster that manages the load - /// balancers. - pub disabled: Option, -} - -impl Part for HttpLoadBalancing {} - - -/// ListOperationsResponse is the result of ListOperationsRequest. -/// -/// # 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 operations list projects](struct.ProjectZoneOperationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListOperationsResponse { - /// A list of operations in the project in the specified zone. - pub operations: Option>, - /// If any zones are listed here, the list of operations returned - /// may be missing the operations from those zones. - #[serde(rename="missingZones")] - pub missing_zones: Option>, -} - -impl ResponseResult for ListOperationsResponse {} - - -/// ListClustersResponse is the result of ListClustersRequest. -/// -/// # 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 clusters list projects](struct.ProjectZoneClusterListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListClustersResponse { - /// A list of clusters in the project in the specified zone, or - /// across all ones. - pub clusters: Option>, - /// If any zones are listed here, the list of clusters returned - /// may be missing those zones. - #[serde(rename="missingZones")] - pub missing_zones: Option>, -} - -impl ResponseResult for ListClustersResponse {} - - /// Container Engine service configuration. /// /// # Activities @@ -542,198 +497,6 @@ pub struct ServerConfig { impl ResponseResult for ServerConfig {} -/// A Google Container Engine cluster. -/// -/// # 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 clusters get projects](struct.ProjectZoneClusterGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Cluster { - /// [Output only] The size of the address space on each node for hosting - /// containers. This is provisioned from within the `container_ipv4_cidr` - /// range. - #[serde(rename="nodeIpv4CidrSize")] - pub node_ipv4_cidr_size: Option, - /// [Output only] The current status of this cluster. - pub status: Option, - /// [Output only] The current software version of the master endpoint. - #[serde(rename="currentMasterVersion")] - pub current_master_version: Option, - /// An optional description of this cluster. - pub description: Option, - /// [Output only] The current version of the node software components. - /// If they are currently at multiple versions because they're in the process - /// of being upgraded, this reflects the minimum version of all nodes. - #[serde(rename="currentNodeVersion")] - pub current_node_version: Option, - /// The fingerprint of the set of labels for this cluster. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// Configurations for the various addons available to run in the cluster. - #[serde(rename="addonsConfig")] - pub addons_config: Option, - /// The list of Google Compute Engine - /// [locations](/compute/docs/zones#available) in which the cluster's nodes - /// should be located. - pub locations: Option>, - /// The authentication information for accessing the master endpoint. - #[serde(rename="masterAuth")] - pub master_auth: Option, - /// [Output only] The time the cluster will be automatically - /// deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - #[serde(rename="expireTime")] - pub expire_time: Option, - /// Kubernetes alpha features are enabled on this cluster. This includes alpha - /// API groups (e.g. v1alpha1) and features that may not be production ready in - /// the kubernetes version of the master and nodes. - /// The cluster has no SLA for uptime and master/node upgrades are disabled. - /// Alpha enabled clusters are automatically deleted thirty days after - /// creation. - #[serde(rename="enableKubernetesAlpha")] - pub enable_kubernetes_alpha: 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. You must also have available - /// firewall and routes quota. - /// For requests, this field should only be used in lieu of a - /// "node_pool" object, since this configuration (along with the - /// "node_config") will be used to create a "NodePool" object with an - /// auto-generated name. Do not use this and a node_pool at the same time. - #[serde(rename="initialNodeCount")] - pub initial_node_count: Option, - /// The node pools associated with this cluster. - /// This field should not be set if "node_config" or "initial_node_count" are - /// specified. - #[serde(rename="nodePools")] - pub node_pools: Option>, - /// The monitoring service the cluster should use to write metrics. - /// Currently available options: - /// - /// * `monitoring.googleapis.com` - the Google Cloud Monitoring service. - /// * `none` - no metrics will be exported from the cluster. - /// * if left as an empty string, `monitoring.googleapis.com` will be used. - #[serde(rename="monitoringService")] - pub monitoring_service: Option, - /// [Output only] The time the cluster was created, in - /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - #[serde(rename="createTime")] - pub create_time: 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 master endpoint. - /// 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, - /// [Output only] The number of nodes currently in the cluster. - #[serde(rename="currentNodeCount")] - pub current_node_count: Option, - /// The name of the Google Compute Engine - /// [network](/compute/docs/networks-and-firewalls#networks) to which the - /// cluster is connected. If left unspecified, the `default` network - /// will be used. - pub network: Option, - /// The logging service the cluster should use to write logs. - /// Currently available options: - /// - /// * `logging.googleapis.com` - the Google Cloud Logging service. - /// * `none` - no logs will be exported from the cluster. - /// * if left as an empty string,`logging.googleapis.com` will be used. - #[serde(rename="loggingService")] - pub logging_service: 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>, - /// Configuration for the legacy ABAC authorization mode. - #[serde(rename="legacyAbac")] - pub legacy_abac: Option, - /// The initial Kubernetes version for this cluster. Valid versions are those - /// found in validMasterVersions returned by getServerConfig. The version can - /// be upgraded over time; such upgrades are reflected in - /// currentMasterVersion and currentNodeVersion. - #[serde(rename="initialClusterVersion")] - pub initial_cluster_version: Option, - /// Parameters used in creating the cluster's nodes. - /// See `nodeConfig` for the description of its properties. - /// For requests, this field should only be used in lieu of a - /// "node_pool" object, since this configuration (along with the - /// "initial_node_count") will be used to create a "NodePool" object with an - /// auto-generated name. Do not use this and a node_pool at the same time. - /// For responses, this field will be populated with the node configuration of - /// the first node pool. - /// - /// If unspecified, the defaults are used. - #[serde(rename="nodeConfig")] - pub node_config: Option, - /// [Output only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The IP address range of the container pods in this cluster, in - /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - /// 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`. - #[serde(rename="clusterIpv4Cidr")] - pub cluster_ipv4_cidr: Option, - /// The name of the Google Compute Engine - /// [subnetwork](/compute/docs/subnetworks) to which the - /// cluster is connected. - pub subnetwork: Option, - /// [Output only] The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - pub zone: Option, - /// [Output only] The IP address range of the Kubernetes services in - /// this cluster, in - /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - /// 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, - /// [Output only] Additional information about the current status of this - /// cluster, if available. - #[serde(rename="statusMessage")] - pub status_message: Option, - /// The resource labels for the cluster to use to annotate any related GCE - /// resources. - #[serde(rename="resourceLabels")] - pub resource_labels: Option>, -} - -impl ResponseResult for Cluster {} - - -/// CreateClusterRequest creates a cluster. -/// -/// # 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 clusters create projects](struct.ProjectZoneClusterCreateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateClusterRequest { - /// A [cluster - /// resource](/container-engine/reference/rest/v1/projects.zones.clusters) - pub cluster: Option, -} - -impl RequestValue for CreateClusterRequest {} - - /// Parameters that describe the nodes in a cluster. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -755,7 +518,7 @@ pub struct NodeConfig { pub tags: Option>, /// Whether the nodes are created as preemptible VM instances. See: /// https://cloud.google.com/compute/docs/instances/preemptible for more - /// inforamtion about preemptible VM instances. + /// information about preemptible VM instances. pub preemptible: Option, /// The map of Kubernetes labels (key/value pairs) to be applied to each node. /// These will added in addition to any default label(s) that @@ -764,7 +527,7 @@ pub struct NodeConfig { /// the Kubernetes version -- it's best to assume the behavior is undefined /// and conflicts should be avoided. /// For more information, including usage and the valid values, see: - /// http://kubernetes.io/v1.1/docs/user-guide/labels.html + /// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ pub labels: Option>, /// The Google Cloud Platform Service Account to be used by the node VMs. If /// no Service Account is specified, the "default" service account is used. @@ -792,6 +555,30 @@ pub struct NodeConfig { /// If unspecified, the default disk size is 100GB. #[serde(rename="diskSizeGb")] pub disk_size_gb: Option, + /// A list of hardware accelerators to be attached to each node. + /// See https://cloud.google.com/compute/docs/gpus for more information about + /// support for GPUs. + pub accelerators: Option>, + /// Minimum CPU platform to be used by this instance. The instance may be + /// scheduled on the specified or newer CPU platform. Applicable values are the + /// friendly names of CPU platforms, such as + /// minCpuPlatform: "Intel Haswell" or + /// minCpuPlatform: "Intel Sandy Bridge". For more + /// information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + #[serde(rename="minCpuPlatform")] + pub min_cpu_platform: Option, + /// The number of local SSD disks to be attached to the node. + /// + /// The limit for this value is dependant upon the maximum number of + /// disks available on a machine per zone. See: + /// https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + /// for more information. + #[serde(rename="localSsdCount")] + pub local_ssd_count: Option, + /// The image type to use for this node. Note that for a given image type, + /// the latest version of it will be used. + #[serde(rename="imageType")] + pub image_type: Option, /// The metadata key/value pairs assigned to instances in the cluster. /// /// Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes @@ -806,18 +593,6 @@ pub struct NodeConfig { /// /// The total size of all keys and values must be less than 512 KB. pub metadata: Option>, - /// The image type to use for this node. Note that for a given image type, - /// the latest version of it will be used. - #[serde(rename="imageType")] - pub image_type: Option, - /// The number of local SSD disks to be attached to the node. - /// - /// The limit for this value is dependant upon the maximum number of - /// disks available on a machine per zone. See: - /// https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits - /// for more information. - #[serde(rename="localSsdCount")] - pub local_ssd_count: Option, } impl Part for NodeConfig {} @@ -843,40 +618,27 @@ pub struct AutoUpgradeOptions { impl Part for AutoUpgradeOptions {} -/// Configuration options for the horizontal pod autoscaling feature, which -/// increases or decreases the number of replica pods a replication controller -/// has based on the resource usage of the existing pods. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HorizontalPodAutoscaling { - /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - /// When enabled, it ensures that a Heapster pod is running in the cluster, - /// which is also used by the Cloud Monitoring service. - pub disabled: Option, -} - -impl Part for HorizontalPodAutoscaling {} - - -/// ListNodePoolsResponse is the result of ListNodePoolsRequest. +/// SetMonitoringServiceRequest sets the monitoring service of a cluster. /// /// # 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 clusters node pools list projects](struct.ProjectZoneClusterNodePoolListCall.html) (response) +/// * [zones clusters monitoring projects](struct.ProjectZoneClusterMonitoringCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListNodePoolsResponse { - /// A list of node pools for a cluster. - #[serde(rename="nodePools")] - pub node_pools: Option>, +pub struct SetMonitoringServiceRequest { + /// The monitoring service the cluster should use to write metrics. + /// Currently available options: + /// + /// * "monitoring.googleapis.com" - the Google Cloud Monitoring service + /// * "none" - no metrics will be exported from the cluster + #[serde(rename="monitoringService")] + pub monitoring_service: Option, } -impl ResponseResult for ListNodePoolsResponse {} +impl RequestValue for SetMonitoringServiceRequest {} /// A generic empty message that you can re-use to avoid defining duplicated @@ -919,19 +681,66 @@ pub struct RollbackNodePoolUpgradeRequest { _never_set: Option } impl RequestValue for RollbackNodePoolUpgradeRequest {} -/// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +/// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. /// /// # 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 clusters complete ip rotation projects](struct.ProjectZoneClusterCompleteIpRotationCall.html) (request) +/// * [zones clusters node pools autoscaling projects](struct.ProjectZoneClusterNodePoolAutoscalingCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CompleteIPRotationRequest { _never_set: Option } +pub struct SetNodePoolAutoscalingRequest { + /// Autoscaling configuration for the node pool. + pub autoscaling: Option, +} -impl RequestValue for CompleteIPRotationRequest {} +impl RequestValue for SetNodePoolAutoscalingRequest {} + + +/// Configuration for NetworkPolicy. This only tracks whether the addon +/// is enabled or not on the Master, it does not track whether network policy +/// is enabled for the nodes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkPolicyConfig { + /// Whether NetworkPolicy is enabled for this cluster. + pub disabled: Option, +} + +impl Part for NetworkPolicyConfig {} + + +/// MaintenancePolicy defines the maintenance policy to be used for the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MaintenancePolicy { + /// Specifies the maintenance window in which maintenance may be performed. + pub window: Option, +} + +impl Part for MaintenancePolicy {} + + +/// Configuration options for the NetworkPolicy feature. +/// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkPolicy { + /// Whether network policy is enabled on the cluster. + pub enabled: Option, + /// The selected network policy provider. + pub provider: Option, +} + +impl Part for NetworkPolicy {} /// SetNodePoolManagementRequest sets the node management properties of a node @@ -953,23 +762,25 @@ pub struct SetNodePoolManagementRequest { impl RequestValue for SetNodePoolManagementRequest {} -/// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -/// a cluster. +/// Master authorized networks is a Beta feature. +/// Configuration options for the master authorized networks feature. Enabled +/// master authorized networks will disallow all external traffic to access +/// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +/// Google Compute Engine Public IPs and Google Prod IPs. /// -/// # 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 clusters legacy abac projects](struct.ProjectZoneClusterLegacyAbacCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetLegacyAbacRequest { - /// Whether ABAC authorization will be enabled in the cluster. +pub struct MasterAuthorizedNetworksConfig { + /// Whether or not master authorized networks is enabled. pub enabled: Option, + /// cidr_blocks define up to 10 external networks that could access + /// Kubernetes master through HTTPS. + #[serde(rename="cidrBlocks")] + pub cidr_blocks: Option>, } -impl RequestValue for SetLegacyAbacRequest {} +impl Part for MasterAuthorizedNetworksConfig {} /// Configuration for the addons that can be automatically spun up in the @@ -983,6 +794,14 @@ pub struct AddonsConfig { /// makes it easy to set up HTTP load balancers for services in a cluster. #[serde(rename="httpLoadBalancing")] pub http_load_balancing: Option, + /// Configuration for NetworkPolicy. This only tracks whether the addon + /// is enabled or not on the Master, it does not track whether network policy + /// is enabled for the nodes. + #[serde(rename="networkPolicyConfig")] + pub network_policy_config: Option, + /// Configuration for the Kubernetes Dashboard. + #[serde(rename="kubernetesDashboard")] + pub kubernetes_dashboard: Option, /// Configuration for the horizontal pod autoscaling feature, which /// increases or decreases the number of replica pods a replication controller /// has based on the resource usage of the existing pods. @@ -993,80 +812,258 @@ pub struct AddonsConfig { impl Part for AddonsConfig {} -/// NodePoolAutoscaling contains information required by cluster autoscaler to -/// adjust the size of the node pool to the current cluster usage. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodePoolAutoscaling { - /// Minimum number of nodes in the NodePool. Must be >= 1 and <= - /// max_node_count. - #[serde(rename="minNodeCount")] - pub min_node_count: Option, - /// Is autoscaling enabled for this node pool. - pub enabled: Option, - /// Maximum number of nodes in the NodePool. Must be >= min_node_count. There - /// has to enough quota to scale up the cluster. - #[serde(rename="maxNodeCount")] - pub max_node_count: Option, -} - -impl Part for NodePoolAutoscaling {} - - -/// The authentication information for accessing the master endpoint. -/// Authentication can be done using HTTP basic auth or using client -/// certificates. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MasterAuth { - /// The username to use for HTTP basic authentication to the master endpoint. - /// For clusters v1.6.0 and later, you can disable basic authentication by - /// providing an empty username. - pub username: Option, - /// The password to use for HTTP basic authentication to the master endpoint. - /// Because the master endpoint is open to the Internet, you should create a - /// strong password. If a password is provided for cluster creation, username - /// must be non-empty. - pub password: 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 used by clients to - /// authenticate to the cluster endpoint. - #[serde(rename="clientCertificate")] - pub client_certificate: 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 {} - - -/// SetMasterAuthRequest updates the admin password of a cluster. +/// SetAddonsConfigRequest sets the addons associated with the cluster. /// /// # 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 clusters set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.html) (request) +/// * [zones clusters addons projects](struct.ProjectZoneClusterAddonCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetMasterAuthRequest { - /// The exact form of action to be taken on the master auth - pub action: Option, - /// A description of the update. - pub update: Option, +pub struct SetAddonsConfigRequest { + /// The desired configurations for the various addons available to run in the + /// cluster. + #[serde(rename="addonsConfig")] + pub addons_config: Option, } -impl RequestValue for SetMasterAuthRequest {} +impl RequestValue for SetAddonsConfigRequest {} + + +/// Configuration options for the HTTP (L7) load balancing controller addon, +/// which makes it easy to set up HTTP load balancers for services in a cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpLoadBalancing { + /// Whether the HTTP Load Balancing controller is enabled in the cluster. + /// When enabled, it runs a small pod in the cluster that manages the load + /// balancers. + pub disabled: Option, +} + +impl Part for HttpLoadBalancing {} + + +/// Configuration for the legacy Attribute Based Access Control authorization +/// mode. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LegacyAbac { + /// Whether the ABAC authorizer is enabled for this cluster. When enabled, + /// identities in the system, including service accounts, nodes, and + /// controllers, will have statically granted permissions beyond those + /// provided by the RBAC configuration or IAM. + pub enabled: Option, +} + +impl Part for LegacyAbac {} + + +/// NodeManagement defines the set of node management services turned on for the +/// node pool. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeManagement { + /// A flag that specifies whether the node auto-repair is enabled for the node + /// pool. If enabled, the nodes in this node pool will be monitored and, if + /// they fail health checks too many times, an automatic repair action will be + /// triggered. + #[serde(rename="autoRepair")] + pub auto_repair: Option, + /// Specifies the Auto Upgrade knobs for the node pool. + #[serde(rename="upgradeOptions")] + pub upgrade_options: Option, + /// A flag that specifies whether node auto-upgrade is enabled for the node + /// pool. If enabled, node auto-upgrade helps keep the nodes in your node pool + /// up to date with the latest release version of Kubernetes. + #[serde(rename="autoUpgrade")] + pub auto_upgrade: Option, +} + +impl Part for NodeManagement {} + + +/// SetLocationsRequest sets the locations of the cluster. +/// +/// # 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 clusters locations projects](struct.ProjectZoneClusterLocationCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetLocationsRequest { + /// The desired list of Google Compute Engine + /// [locations](/compute/docs/zones#available) in which the cluster's nodes + /// should be located. Changing the locations a cluster is in will result + /// in nodes being either created or removed from the cluster, depending on + /// whether locations are being added or removed. + /// + /// This list must always include the cluster's primary zone. + pub locations: Option>, +} + +impl RequestValue for SetLocationsRequest {} + + +/// Time window specified for daily maintenance operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DailyMaintenanceWindow { + /// [Output only] Duration of the time window, automatically chosen to be + /// smallest possible in the given scenario. + /// Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + /// format "PTnHnMnS". + pub duration: Option, + /// Time within the maintenance window to start the maintenance operations. + /// Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + /// format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for DailyMaintenanceWindow {} + + +/// Configuration for the Kubernetes Dashboard. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KubernetesDashboard { + /// Whether the Kubernetes Dashboard is enabled for this cluster. + pub disabled: Option, +} + +impl Part for KubernetesDashboard {} + + +/// StartIPRotationRequest creates a new IP for the cluster and then performs +/// a node upgrade on each node pool to point to the new IP. +/// +/// # 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 clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StartIPRotationRequest { _never_set: Option } + +impl RequestValue for StartIPRotationRequest {} + + +/// Configuration for client certificates on the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClientCertificateConfig { + /// Issue a client certificate. + #[serde(rename="issueClientCertificate")] + pub issue_client_certificate: Option, +} + +impl Part for ClientCertificateConfig {} + + +/// This operation resource represents operations that may have happened or are +/// happening on the cluster. All fields are output only. +/// +/// # 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 clusters node pools rollback projects](struct.ProjectZoneClusterNodePoolRollbackCall.html) (response) +/// * [zones clusters node pools create projects](struct.ProjectZoneClusterNodePoolCreateCall.html) (response) +/// * [zones clusters monitoring projects](struct.ProjectZoneClusterMonitoringCall.html) (response) +/// * [zones clusters delete projects](struct.ProjectZoneClusterDeleteCall.html) (response) +/// * [zones clusters legacy abac projects](struct.ProjectZoneClusterLegacyAbacCall.html) (response) +/// * [zones clusters addons projects](struct.ProjectZoneClusterAddonCall.html) (response) +/// * [zones clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (response) +/// * [zones clusters create projects](struct.ProjectZoneClusterCreateCall.html) (response) +/// * [zones clusters node pools set management projects](struct.ProjectZoneClusterNodePoolSetManagementCall.html) (response) +/// * [zones operations get projects](struct.ProjectZoneOperationGetCall.html) (response) +/// * [zones clusters logging projects](struct.ProjectZoneClusterLoggingCall.html) (response) +/// * [zones clusters update projects](struct.ProjectZoneClusterUpdateCall.html) (response) +/// * [zones clusters node pools autoscaling projects](struct.ProjectZoneClusterNodePoolAutoscalingCall.html) (response) +/// * [zones clusters node pools set size projects](struct.ProjectZoneClusterNodePoolSetSizeCall.html) (response) +/// * [zones clusters set maintenance policy projects](struct.ProjectZoneClusterSetMaintenancePolicyCall.html) (response) +/// * [zones clusters node pools delete projects](struct.ProjectZoneClusterNodePoolDeleteCall.html) (response) +/// * [zones clusters locations projects](struct.ProjectZoneClusterLocationCall.html) (response) +/// * [zones clusters master projects](struct.ProjectZoneClusterMasterCall.html) (response) +/// * [zones clusters node pools update projects](struct.ProjectZoneClusterNodePoolUpdateCall.html) (response) +/// * [zones clusters set network policy projects](struct.ProjectZoneClusterSetNetworkPolicyCall.html) (response) +/// * [zones clusters set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.html) (response) +/// * [zones clusters complete ip rotation projects](struct.ProjectZoneClusterCompleteIpRotationCall.html) (response) +/// * [zones clusters resource labels projects](struct.ProjectZoneClusterResourceLabelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The current status of the operation. + pub status: Option, + /// If an error has occurred, a textual description of the error. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// [Output only] The time the operation started, in + /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="startTime")] + pub start_time: Option, + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the operation + /// is taking place. + pub zone: Option, + /// Detailed operation progress, if available. + pub detail: Option, + /// Server-defined URL for the target of the operation. + #[serde(rename="targetLink")] + pub target_link: Option, + /// The operation type. + #[serde(rename="operationType")] + pub operation_type: Option, + /// [Output only] The time the operation completed, in + /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="endTime")] + pub end_time: Option, + /// Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The server-assigned ID for the operation. + pub name: Option, +} + +impl ResponseResult for Operation {} + + +/// UpdateClusterRequest updates the settings of a cluster. +/// +/// # 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 clusters update projects](struct.ProjectZoneClusterUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateClusterRequest { + /// A description of the update. + pub update: Option, +} + +impl RequestValue for UpdateClusterRequest {} /// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container @@ -1098,47 +1095,143 @@ pub struct SetLabelsRequest { impl RequestValue for SetLabelsRequest {} -/// Configuration for the legacy Attribute Based Access Control authorization -/// mode. +/// ListClustersResponse is the result of ListClustersRequest. +/// +/// # 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 clusters list projects](struct.ProjectZoneClusterListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListClustersResponse { + /// A list of clusters in the project in the specified zone, or + /// across all ones. + pub clusters: Option>, + /// If any zones are listed here, the list of clusters returned + /// may be missing those zones. + #[serde(rename="missingZones")] + pub missing_zones: Option>, +} + +impl ResponseResult for ListClustersResponse {} + + +/// Configuration options for the horizontal pod autoscaling feature, which +/// increases or decreases the number of replica pods a replication controller +/// has based on the resource usage of the existing pods. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LegacyAbac { - /// Whether the ABAC authorizer is enabled for this cluster. When enabled, - /// identities in the system, including service accounts, nodes, and - /// controllers, will have statically granted permissions beyond those - /// provided by the RBAC configuration or IAM. - pub enabled: Option, +pub struct HorizontalPodAutoscaling { + /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + /// When enabled, it ensures that a Heapster pod is running in the cluster, + /// which is also used by the Cloud Monitoring service. + pub disabled: Option, } -impl Part for LegacyAbac {} +impl Part for HorizontalPodAutoscaling {} -/// NodeManagement defines the set of node management services turned on for the -/// node pool. +/// CreateNodePoolRequest creates a node pool for a cluster. +/// +/// # 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 clusters node pools create projects](struct.ProjectZoneClusterNodePoolCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateNodePoolRequest { + /// The node pool to create. + #[serde(rename="nodePool")] + pub node_pool: Option, +} + +impl RequestValue for CreateNodePoolRequest {} + + +/// UpdateNodePoolRequests update a node pool's image and/or version. +/// +/// # 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 clusters node pools update projects](struct.ProjectZoneClusterNodePoolUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateNodePoolRequest { + /// The Kubernetes version to change the nodes to (typically an + /// upgrade). Use `-` to upgrade to the latest version supported by + /// the server. + #[serde(rename="nodeVersion")] + pub node_version: Option, + /// The desired image type for the node pool. + #[serde(rename="imageType")] + pub image_type: Option, +} + +impl RequestValue for UpdateNodePoolRequest {} + + +/// SetLoggingServiceRequest sets the logging service of a cluster. +/// +/// # 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 clusters logging projects](struct.ProjectZoneClusterLoggingCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetLoggingServiceRequest { + /// The logging service the cluster should use to write metrics. + /// Currently available options: + /// + /// * "logging.googleapis.com" - the Google Cloud Logging service + /// * "none" - no metrics will be exported from the cluster + #[serde(rename="loggingService")] + pub logging_service: Option, +} + +impl RequestValue for SetLoggingServiceRequest {} + + +/// MaintenanceWindow defines the maintenance window to be used for the cluster. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeManagement { - /// Specifies the Auto Upgrade knobs for the node pool. - #[serde(rename="upgradeOptions")] - pub upgrade_options: Option, - /// A flag that specifies whether the node auto-repair is enabled for the node - /// pool. If enabled, the nodes in this node pool will be monitored and, if - /// they fail health checks too many times, an automatic repair action will be - /// triggered. - #[serde(rename="autoRepair")] - pub auto_repair: Option, - /// A flag that specifies whether node auto-upgrade is enabled for the node - /// pool. If enabled, node auto-upgrade helps keep the nodes in your node pool - /// up to date with the latest release version of Kubernetes. - #[serde(rename="autoUpgrade")] - pub auto_upgrade: Option, +pub struct MaintenanceWindow { + /// DailyMaintenanceWindow specifies a daily maintenance operation window. + #[serde(rename="dailyMaintenanceWindow")] + pub daily_maintenance_window: Option, } -impl Part for NodeManagement {} +impl Part for MaintenanceWindow {} + + +/// ListNodePoolsResponse is the result of ListNodePoolsRequest. +/// +/// # 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 clusters node pools list projects](struct.ProjectZoneClusterNodePoolListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListNodePoolsResponse { + /// A list of node pools for a cluster. + #[serde(rename="nodePools")] + pub node_pools: Option>, +} + +impl ResponseResult for ListNodePoolsResponse {} /// NodePool contains the name and configuration for a cluster's node pool. @@ -1193,6 +1286,506 @@ pub struct NodePool { impl ResponseResult for NodePool {} +/// CreateClusterRequest creates a cluster. +/// +/// # 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 clusters create projects](struct.ProjectZoneClusterCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateClusterRequest { + /// A [cluster + /// resource](/container-engine/reference/rest/v1/projects.zones.clusters) + pub cluster: Option, +} + +impl RequestValue for CreateClusterRequest {} + + +/// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +/// +/// # 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 clusters complete ip rotation projects](struct.ProjectZoneClusterCompleteIpRotationCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CompleteIPRotationRequest { _never_set: Option } + +impl RequestValue for CompleteIPRotationRequest {} + + +/// UpdateMasterRequest updates the master of the cluster. +/// +/// # 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 clusters master projects](struct.ProjectZoneClusterMasterCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateMasterRequest { + /// The Kubernetes version to change the master to. The only valid value is the + /// latest supported version. Use "-" to have the server automatically select + /// the latest version. + #[serde(rename="masterVersion")] + pub master_version: Option, +} + +impl RequestValue for UpdateMasterRequest {} + + +/// ListOperationsResponse is the result of ListOperationsRequest. +/// +/// # 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 operations list projects](struct.ProjectZoneOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// A list of operations in the project in the specified zone. + pub operations: Option>, + /// If any zones are listed here, the list of operations returned + /// may be missing the operations from those zones. + #[serde(rename="missingZones")] + pub missing_zones: Option>, +} + +impl ResponseResult for ListOperationsResponse {} + + +/// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +/// a cluster. +/// +/// # 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 clusters legacy abac projects](struct.ProjectZoneClusterLegacyAbacCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetLegacyAbacRequest { + /// Whether ABAC authorization will be enabled in the cluster. + pub enabled: Option, +} + +impl RequestValue for SetLegacyAbacRequest {} + + +/// AcceleratorConfig represents a Hardware Accelerator request. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorConfig { + /// The accelerator type resource name. List of supported accelerators + /// [here](/compute/docs/gpus/#Introduction) + #[serde(rename="acceleratorType")] + pub accelerator_type: Option, + /// The number of the accelerator cards exposed to an instance. + #[serde(rename="acceleratorCount")] + pub accelerator_count: Option, +} + +impl Part for AcceleratorConfig {} + + +/// NodePoolAutoscaling contains information required by cluster autoscaler to +/// adjust the size of the node pool to the current cluster usage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodePoolAutoscaling { + /// Minimum number of nodes in the NodePool. Must be >= 1 and <= + /// max_node_count. + #[serde(rename="minNodeCount")] + pub min_node_count: Option, + /// Is autoscaling enabled for this node pool. + pub enabled: Option, + /// Maximum number of nodes in the NodePool. Must be >= min_node_count. There + /// has to enough quota to scale up the cluster. + #[serde(rename="maxNodeCount")] + pub max_node_count: Option, +} + +impl Part for NodePoolAutoscaling {} + + +/// The authentication information for accessing the master endpoint. +/// Authentication can be done using HTTP basic auth or using client +/// certificates. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MasterAuth { + /// The username to use for HTTP basic authentication to the master endpoint. + /// For clusters v1.6.0 and later, you can disable basic authentication by + /// providing an empty username. + pub username: Option, + /// The password to use for HTTP basic authentication to the master endpoint. + /// Because the master endpoint is open to the Internet, you should create a + /// strong password. If a password is provided for cluster creation, username + /// must be non-empty. + 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, + /// [Output only] Base64-encoded private key used by clients to authenticate + /// to the cluster endpoint. + #[serde(rename="clientKey")] + pub client_key: Option, + /// Configuration for client certificate authentication on the cluster. If no + /// configuration is specified, a client certificate is issued. + #[serde(rename="clientCertificateConfig")] + pub client_certificate_config: 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 {} + + +/// A Google Container Engine cluster. +/// +/// # 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 clusters get projects](struct.ProjectZoneClusterGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Cluster { + /// [Output only] The size of the address space on each node for hosting + /// containers. This is provisioned from within the `container_ipv4_cidr` + /// range. + #[serde(rename="nodeIpv4CidrSize")] + pub node_ipv4_cidr_size: Option, + /// Configure the maintenance policy for this cluster. + #[serde(rename="maintenancePolicy")] + pub maintenance_policy: Option, + /// Configuration options for the NetworkPolicy feature. + #[serde(rename="networkPolicy")] + pub network_policy: Option, + /// Master authorized networks is a Beta feature. + /// The configuration options for master authorized networks feature. + #[serde(rename="masterAuthorizedNetworksConfig")] + pub master_authorized_networks_config: Option, + /// Configurations for the various addons available to run in the cluster. + #[serde(rename="addonsConfig")] + pub addons_config: Option, + /// The list of Google Compute Engine + /// [locations](/compute/docs/zones#available) in which the cluster's nodes + /// should be located. + pub locations: Option>, + /// Configuration for the legacy ABAC authorization mode. + #[serde(rename="legacyAbac")] + pub legacy_abac: Option, + /// The name of the Google Compute Engine + /// [network](/compute/docs/networks-and-firewalls#networks) to which the + /// cluster is connected. If left unspecified, the `default` network + /// will be used. + pub network: Option, + /// The logging service the cluster should use to write logs. + /// Currently available options: + /// + /// * `logging.googleapis.com` - the Google Cloud Logging service. + /// * `none` - no logs will be exported from the cluster. + /// * if left as an empty string,`logging.googleapis.com` will be used. + #[serde(rename="loggingService")] + pub logging_service: 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>, + /// Configuration for cluster IP allocation. + #[serde(rename="ipAllocationPolicy")] + pub ip_allocation_policy: Option, + /// [Output only] The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + pub zone: Option, + /// [Output only] Additional information about the current status of this + /// cluster, if available. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// The resource labels for the cluster to use to annotate any related + /// Google Compute Engine resources. + #[serde(rename="resourceLabels")] + pub resource_labels: Option>, + /// [Output only] The current status of this cluster. + pub status: Option, + /// An optional description of this cluster. + pub description: Option, + /// [Output only] The current version of the node software components. + /// If they are currently at multiple versions because they're in the process + /// of being upgraded, this reflects the minimum version of all nodes. + #[serde(rename="currentNodeVersion")] + pub current_node_version: Option, + /// The fingerprint of the set of labels for this cluster. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// [Output only] The current software version of the master endpoint. + #[serde(rename="currentMasterVersion")] + pub current_master_version: Option, + /// The authentication information for accessing the master endpoint. + #[serde(rename="masterAuth")] + pub master_auth: Option, + /// [Output only] The time the cluster will be automatically + /// deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="expireTime")] + pub expire_time: 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. You must also have available + /// firewall and routes quota. + /// For requests, this field should only be used in lieu of a + /// "node_pool" object, since this configuration (along with the + /// "node_config") will be used to create a "NodePool" object with an + /// auto-generated name. Do not use this and a node_pool at the same time. + #[serde(rename="initialNodeCount")] + pub initial_node_count: Option, + /// The node pools associated with this cluster. + /// This field should not be set if "node_config" or "initial_node_count" are + /// specified. + #[serde(rename="nodePools")] + pub node_pools: Option>, + /// The monitoring service the cluster should use to write metrics. + /// Currently available options: + /// + /// * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + /// * `none` - no metrics will be exported from the cluster. + /// * if left as an empty string, `monitoring.googleapis.com` will be used. + #[serde(rename="monitoringService")] + pub monitoring_service: Option, + /// [Output only] The time the cluster was created, in + /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="createTime")] + pub create_time: Option, + /// [Output only] The IP address of this cluster's master endpoint. + /// 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, + /// [Output only] The number of nodes currently in the cluster. + #[serde(rename="currentNodeCount")] + pub current_node_count: 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, + /// Kubernetes alpha features are enabled on this cluster. This includes alpha + /// API groups (e.g. v1alpha1) and features that may not be production ready in + /// the kubernetes version of the master and nodes. + /// The cluster has no SLA for uptime and master/node upgrades are disabled. + /// Alpha enabled clusters are automatically deleted thirty days after + /// creation. + #[serde(rename="enableKubernetesAlpha")] + pub enable_kubernetes_alpha: Option, + /// The initial Kubernetes version for this cluster. Valid versions are those + /// found in validMasterVersions returned by getServerConfig. The version can + /// be upgraded over time; such upgrades are reflected in + /// currentMasterVersion and currentNodeVersion. + #[serde(rename="initialClusterVersion")] + pub initial_cluster_version: Option, + /// Parameters used in creating the cluster's nodes. + /// See `nodeConfig` for the description of its properties. + /// For requests, this field should only be used in lieu of a + /// "node_pool" object, since this configuration (along with the + /// "initial_node_count") will be used to create a "NodePool" object with an + /// auto-generated name. Do not use this and a node_pool at the same time. + /// For responses, this field will be populated with the node configuration of + /// the first node pool. + /// + /// If unspecified, the defaults are used. + #[serde(rename="nodeConfig")] + pub node_config: Option, + /// The IP address range of the container pods in this cluster, in + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// 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`. + #[serde(rename="clusterIpv4Cidr")] + pub cluster_ipv4_cidr: Option, + /// The name of the Google Compute Engine + /// [subnetwork](/compute/docs/subnetworks) to which the + /// cluster is connected. + pub subnetwork: Option, + /// [Output only] The IP address range of the Kubernetes services in + /// this cluster, in + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// 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, + /// [Output only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for Cluster {} + + +/// SetMasterAuthRequest updates the admin password of a cluster. +/// +/// # 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 clusters set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetMasterAuthRequest { + /// The exact form of action to be taken on the master auth + pub action: Option, + /// A description of the update. + pub update: Option, +} + +impl RequestValue for SetMasterAuthRequest {} + + +/// SetNetworkPolicyRequest enables/disables network policy for a cluster. +/// +/// # 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 clusters set network policy projects](struct.ProjectZoneClusterSetNetworkPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetNetworkPolicyRequest { + /// Configuration options for the NetworkPolicy feature. + #[serde(rename="networkPolicy")] + pub network_policy: Option, +} + +impl RequestValue for SetNetworkPolicyRequest {} + + +/// Configuration for controlling how IPs are allocated in the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IPAllocationPolicy { + /// The IP address range of the services IPs in this cluster. If blank, a range + /// will be automatically chosen with the default size. + /// + /// This field is only applicable when `use_ip_aliases` is true. + /// + /// Set to blank to have a range chosen with the default size. + /// + /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific + /// netmask. + /// + /// Set to a + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + /// to use. + #[serde(rename="servicesIpv4CidrBlock")] + pub services_ipv4_cidr_block: Option, + /// Whether alias IPs will be used for pod IPs in the cluster. + #[serde(rename="useIpAliases")] + pub use_ip_aliases: Option, + /// This field is deprecated, use node_ipv4_cidr_block. + #[serde(rename="nodeIpv4Cidr")] + pub node_ipv4_cidr: Option, + /// The IP address range for the cluster pod IPs. If this field is set, then + /// `cluster.cluster_ipv4_cidr` must be left blank. + /// + /// This field is only applicable when `use_ip_aliases` is true. + /// + /// Set to blank to have a range chosen with the default size. + /// + /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific + /// netmask. + /// + /// Set to a + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + /// to use. + #[serde(rename="clusterIpv4CidrBlock")] + pub cluster_ipv4_cidr_block: Option, + /// The name of the secondary range to be used for the cluster CIDR + /// block. The secondary range will be used for pod IP + /// addresses. This must be an existing secondary range associated + /// with the cluster subnetwork. + /// + /// This field is only applicable with use_ip_aliases is true and + /// create_subnetwork is false. + #[serde(rename="clusterSecondaryRangeName")] + pub cluster_secondary_range_name: Option, + /// Whether a new subnetwork will be created automatically for the cluster. + /// + /// This field is only applicable when `use_ip_aliases` is true. + #[serde(rename="createSubnetwork")] + pub create_subnetwork: Option, + /// The IP address range of the instance IPs in this cluster. + /// + /// This is applicable only if `create_subnetwork` is true. + /// + /// Set to blank to have a range chosen with the default size. + /// + /// Set to /netmask (e.g. `/14`) to have a range chosen with a specific + /// netmask. + /// + /// Set to a + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + /// to use. + #[serde(rename="nodeIpv4CidrBlock")] + pub node_ipv4_cidr_block: Option, + /// This field is deprecated, use cluster_ipv4_cidr_block. + #[serde(rename="clusterIpv4Cidr")] + pub cluster_ipv4_cidr: Option, + /// This field is deprecated, use services_ipv4_cidr_block. + #[serde(rename="servicesIpv4Cidr")] + pub services_ipv4_cidr: Option, + /// The name of the secondary range to be used as for the services + /// CIDR block. The secondary range will be used for service + /// ClusterIPs. This must be an existing secondary range associated + /// with the cluster subnetwork. + /// + /// This field is only applicable with use_ip_aliases is true and + /// create_subnetwork is false. + #[serde(rename="servicesSecondaryRangeName")] + pub services_secondary_range_name: Option, + /// A custom subnetwork name to be used if `create_subnetwork` is true. If + /// this field is empty, then an automatic name will be chosen for the new + /// subnetwork. + #[serde(rename="subnetworkName")] + pub subnetwork_name: Option, +} + +impl Part for IPAllocationPolicy {} + + /// CancelOperationRequest cancels a single operation. /// /// # Activities @@ -1208,90 +1801,41 @@ pub struct CancelOperationRequest { _never_set: Option } impl RequestValue for CancelOperationRequest {} -/// CreateNodePoolRequest creates a node pool for a cluster. +/// SetNodePoolSizeRequest sets the size a node +/// pool. /// /// # 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 clusters node pools create projects](struct.ProjectZoneClusterNodePoolCreateCall.html) (request) +/// * [zones clusters node pools set size projects](struct.ProjectZoneClusterNodePoolSetSizeCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateNodePoolRequest { - /// The node pool to create. - #[serde(rename="nodePool")] - pub node_pool: Option, +pub struct SetNodePoolSizeRequest { + /// The desired node count for the pool. + #[serde(rename="nodeCount")] + pub node_count: Option, } -impl RequestValue for CreateNodePoolRequest {} +impl RequestValue for SetNodePoolSizeRequest {} -/// This operation resource represents operations that may have happened or are -/// happening on the cluster. All fields are output only. +/// CidrBlock contains an optional name and one CIDR block. /// -/// # 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 clusters node pools rollback projects](struct.ProjectZoneClusterNodePoolRollbackCall.html) (response) -/// * [zones clusters delete projects](struct.ProjectZoneClusterDeleteCall.html) (response) -/// * [zones clusters node pools create projects](struct.ProjectZoneClusterNodePoolCreateCall.html) (response) -/// * [zones clusters set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.html) (response) -/// * [zones clusters complete ip rotation projects](struct.ProjectZoneClusterCompleteIpRotationCall.html) (response) -/// * [zones clusters node pools set management projects](struct.ProjectZoneClusterNodePoolSetManagementCall.html) (response) -/// * [zones clusters legacy abac projects](struct.ProjectZoneClusterLegacyAbacCall.html) (response) -/// * [zones operations get projects](struct.ProjectZoneOperationGetCall.html) (response) -/// * [zones clusters resource labels projects](struct.ProjectZoneClusterResourceLabelCall.html) (response) -/// * [zones clusters create projects](struct.ProjectZoneClusterCreateCall.html) (response) -/// * [zones clusters update projects](struct.ProjectZoneClusterUpdateCall.html) (response) -/// * [zones clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (response) -/// * [zones clusters node pools delete projects](struct.ProjectZoneClusterNodePoolDeleteCall.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 Operation { - /// The current status of the operation. - pub status: Option, - /// The server-assigned ID for the operation. - pub name: Option, - /// The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the operation - /// is taking place. - pub zone: Option, - /// Detailed operation progress, if available. - pub detail: Option, - /// Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The operation type. - #[serde(rename="operationType")] - pub operation_type: Option, - /// If an error has occurred, a textual description of the error. - #[serde(rename="statusMessage")] - pub status_message: Option, - /// Server-defined URL for the target of the operation. - #[serde(rename="targetLink")] - pub target_link: Option, +pub struct CidrBlock { + /// display_name is an optional field for users to identify CIDR blocks. + #[serde(rename="displayName")] + pub display_name: Option, + /// cidr_block must be specified in CIDR notation. + #[serde(rename="cidrBlock")] + pub cidr_block: Option, } -impl ResponseResult for Operation {} - - -/// StartIPRotationRequest creates a new IP for the cluster and then performs -/// a node upgrade on each node pool to point to the new IP. -/// -/// # 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 clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StartIPRotationRequest { _never_set: Option } - -impl RequestValue for StartIPRotationRequest {} +impl Part for CidrBlock {} @@ -1323,7 +1867,7 @@ impl RequestValue for StartIPRotationRequest {} /// ::default(), None); /// let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `zones_clusters_complete_ip_rotation(...)`, `zones_clusters_create(...)`, `zones_clusters_delete(...)`, `zones_clusters_get(...)`, `zones_clusters_legacy_abac(...)`, `zones_clusters_list(...)`, `zones_clusters_node_pools_create(...)`, `zones_clusters_node_pools_delete(...)`, `zones_clusters_node_pools_get(...)`, `zones_clusters_node_pools_list(...)`, `zones_clusters_node_pools_rollback(...)`, `zones_clusters_node_pools_set_management(...)`, `zones_clusters_resource_labels(...)`, `zones_clusters_set_master_auth(...)`, `zones_clusters_start_ip_rotation(...)`, `zones_clusters_update(...)`, `zones_get_serverconfig(...)`, `zones_operations_cancel(...)`, `zones_operations_get(...)` and `zones_operations_list(...)` +/// // like `zones_clusters_addons(...)`, `zones_clusters_complete_ip_rotation(...)`, `zones_clusters_create(...)`, `zones_clusters_delete(...)`, `zones_clusters_get(...)`, `zones_clusters_legacy_abac(...)`, `zones_clusters_list(...)`, `zones_clusters_locations(...)`, `zones_clusters_logging(...)`, `zones_clusters_master(...)`, `zones_clusters_monitoring(...)`, `zones_clusters_node_pools_autoscaling(...)`, `zones_clusters_node_pools_create(...)`, `zones_clusters_node_pools_delete(...)`, `zones_clusters_node_pools_get(...)`, `zones_clusters_node_pools_list(...)`, `zones_clusters_node_pools_rollback(...)`, `zones_clusters_node_pools_set_management(...)`, `zones_clusters_node_pools_set_size(...)`, `zones_clusters_node_pools_update(...)`, `zones_clusters_resource_labels(...)`, `zones_clusters_set_maintenance_policy(...)`, `zones_clusters_set_master_auth(...)`, `zones_clusters_set_network_policy(...)`, `zones_clusters_start_ip_rotation(...)`, `zones_clusters_update(...)`, `zones_get_serverconfig(...)`, `zones_operations_cancel(...)`, `zones_operations_get(...)` and `zones_operations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1338,51 +1882,6 @@ 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: - /// - /// Gets the details of a specific cluster. - /// - /// # Arguments - /// - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster to retrieve. - pub fn zones_clusters_get(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterGetCall<'a, C, A> { - ProjectZoneClusterGetCall { - hub: self.hub, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _cluster_id: cluster_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns configuration info about the Container Engine service. - /// - /// # Arguments - /// - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) - /// to return operations for. - pub fn zones_get_serverconfig(&self, project_id: &str, zone: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { - ProjectZoneGetServerconfigCall { - hub: self.hub, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Cancels the specified operation. @@ -1410,19 +1909,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the node pools for a cluster. + /// Creates a node pool for a cluster. /// /// # Arguments /// + /// * `request` - No description provided. /// * `projectId` - The Google Developers Console [project ID or project /// number](https://developers.google.com/console/help/new/#projectnumber). /// * `zone` - The name of the Google Compute Engine /// [zone](/compute/docs/zones#available) in which the cluster /// resides. /// * `clusterId` - The name of the cluster. - pub fn zones_clusters_node_pools_list(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { - ProjectZoneClusterNodePoolListCall { + pub fn zones_clusters_node_pools_create(&self, request: CreateNodePoolRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolCreateCall<'a, C, A> { + ProjectZoneClusterNodePoolCreateCall { hub: self.hub, + _request: request, _project_id: project_id.to_string(), _zone: zone.to_string(), _cluster_id: cluster_id.to_string(), @@ -1434,9 +1935,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Used to set master auth materials. Currently supports :- - /// Changing the admin password of a specific cluster. - /// This can be either via password generation or explicitly set the password. + /// Sets the monitoring service of a specific cluster. /// /// # Arguments /// @@ -1447,8 +1946,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// [zone](/compute/docs/zones#available) in which the cluster /// resides. /// * `clusterId` - The name of the cluster to upgrade. - pub fn zones_clusters_set_master_auth(&self, request: SetMasterAuthRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { - ProjectZoneClusterSetMasterAuthCall { + pub fn zones_clusters_monitoring(&self, request: SetMonitoringServiceRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterMonitoringCall<'a, C, A> { + ProjectZoneClusterMonitoringCall { hub: self.hub, _request: request, _project_id: project_id.to_string(), @@ -1460,6 +1959,35 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Roll back the previously Aborted or Failed NodePool upgrade. + /// This will be an no-op if the last upgrade successfully completed. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to rollback. + /// * `nodePoolId` - The name of the node pool to rollback. + pub fn zones_clusters_node_pools_rollback(&self, request: RollbackNodePoolUpgradeRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { + ProjectZoneClusterNodePoolRollbackCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the cluster, including the Kubernetes endpoint and all worker @@ -1494,159 +2022,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a node pool for a cluster. + /// Returns configuration info about the Container Engine service. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster. - pub fn zones_clusters_node_pools_create(&self, request: CreateNodePoolRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolCreateCall<'a, C, A> { - ProjectZoneClusterNodePoolCreateCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _cluster_id: cluster_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 node pool requested. - /// - /// # Arguments - /// - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster. - /// * `nodePoolId` - The name of the node pool. - pub fn zones_clusters_node_pools_get(&self, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { - ProjectZoneClusterNodePoolGetCall { - hub: self.hub, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _cluster_id: cluster_id.to_string(), - _node_pool_id: node_pool_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Roll back the previously Aborted or Failed NodePool upgrade. - /// This will be an no-op if the last upgrade successfully completed. - /// - /// # Arguments - /// - /// * `request` - No description provided. /// * `projectId` - The Google Developers Console [project ID or project /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster to rollback. - /// * `nodePoolId` - The name of the node pool to rollback. - pub fn zones_clusters_node_pools_rollback(&self, request: RollbackNodePoolUpgradeRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { - ProjectZoneClusterNodePoolRollbackCall { + /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for. + pub fn zones_get_serverconfig(&self, project_id: &str, zone: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { + ProjectZoneGetServerconfigCall { hub: self.hub, - _request: request, _project_id: project_id.to_string(), _zone: zone.to_string(), - _cluster_id: cluster_id.to_string(), - _node_pool_id: node_pool_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Start master IP rotation. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster. - pub fn zones_clusters_start_ip_rotation(&self, request: StartIPRotationRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { - ProjectZoneClusterStartIpRotationCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _cluster_id: cluster_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Completes master IP rotation. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster. - pub fn zones_clusters_complete_ip_rotation(&self, request: CompleteIPRotationRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { - ProjectZoneClusterCompleteIpRotationCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _cluster_id: cluster_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the NodeManagement options for a node pool. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `clusterId` - The name of the cluster to update. - /// * `nodePoolId` - The name of the node pool to update. - pub fn zones_clusters_node_pools_set_management(&self, request: SetNodePoolManagementRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { - ProjectZoneClusterNodePoolSetManagementCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _cluster_id: cluster_id.to_string(), - _node_pool_id: node_pool_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1681,43 +2069,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the specified operation. - /// - /// # Arguments - /// - /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// * `operationId` - The server-assigned `name` of the operation. - pub fn zones_operations_get(&self, project_id: &str, zone: &str, operation_id: &str) -> ProjectZoneOperationGetCall<'a, C, A> { - ProjectZoneOperationGetCall { - hub: self.hub, - _project_id: project_id.to_string(), - _zone: zone.to_string(), - _operation_id: operation_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets labels on a cluster. + /// Sets the addons of a specific cluster. /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). + /// number](https://support.google.com/cloud/answer/6158840). /// * `zone` - The name of the Google Compute Engine /// [zone](/compute/docs/zones#available) in which the cluster /// resides. - /// * `clusterId` - The name of the cluster. - pub fn zones_clusters_resource_labels(&self, request: SetLabelsRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { - ProjectZoneClusterResourceLabelCall { + /// * `clusterId` - The name of the cluster to upgrade. + pub fn zones_clusters_addons(&self, request: SetAddonsConfigRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterAddonCall<'a, C, A> { + ProjectZoneClusterAddonCall { hub: self.hub, _request: request, _project_id: project_id.to_string(), @@ -1731,19 +2095,24 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all operations in a project in a specific zone or all zones. + /// Start master IP rotation. /// /// # Arguments /// + /// * `request` - No description provided. /// * `projectId` - The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) - /// to return operations for, or `-` for all zones. - pub fn zones_operations_list(&self, project_id: &str, zone: &str) -> ProjectZoneOperationListCall<'a, C, A> { - ProjectZoneOperationListCall { + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_start_ip_rotation(&self, request: StartIPRotationRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { + ProjectZoneClusterStartIpRotationCall { hub: self.hub, + _request: request, _project_id: project_id.to_string(), _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1786,6 +2155,108 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets the NodeManagement options for a node pool. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to update. + /// * `nodePoolId` - The name of the node pool to update. + pub fn zones_clusters_node_pools_set_management(&self, request: SetNodePoolManagementRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + ProjectZoneClusterNodePoolSetManagementCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_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 node pools for a cluster. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_node_pools_list(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + ProjectZoneClusterNodePoolListCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified operation. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `operationId` - The server-assigned `name` of the operation. + pub fn zones_operations_get(&self, project_id: &str, zone: &str, operation_id: &str) -> ProjectZoneOperationGetCall<'a, C, A> { + ProjectZoneOperationGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _operation_id: operation_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the logging service of a specific cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + pub fn zones_clusters_logging(&self, request: SetLoggingServiceRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterLoggingCall<'a, C, A> { + ProjectZoneClusterLoggingCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_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 settings of a specific cluster. @@ -1835,6 +2306,88 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets the autoscaling settings of a specific node pool. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + /// * `nodePoolId` - The name of the node pool to upgrade. + pub fn zones_clusters_node_pools_autoscaling(&self, request: SetNodePoolAutoscalingRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> { + ProjectZoneClusterNodePoolAutoscalingCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the size of a specific node pool. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to update. + /// * `nodePoolId` - The name of the node pool to update. + pub fn zones_clusters_node_pools_set_size(&self, request: SetNodePoolSizeRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> { + ProjectZoneClusterNodePoolSetSizeCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the maintenance policy for a cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to update. + pub fn zones_clusters_set_maintenance_policy(&self, request: SetMaintenancePolicyRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> { + ProjectZoneClusterSetMaintenancePolicyCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a node pool from a cluster. @@ -1860,6 +2413,263 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Sets the locations of a specific cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + pub fn zones_clusters_locations(&self, request: SetLocationsRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterLocationCall<'a, C, A> { + ProjectZoneClusterLocationCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the details of a specific cluster. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to retrieve. + pub fn zones_clusters_get(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterGetCall<'a, C, A> { + ProjectZoneClusterGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_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 master of a specific cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + pub fn zones_clusters_master(&self, request: UpdateMasterRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterMasterCall<'a, C, A> { + ProjectZoneClusterMasterCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_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 version and/or image type of a specific node pool. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + /// * `nodePoolId` - The name of the node pool to upgrade. + pub fn zones_clusters_node_pools_update(&self, request: UpdateNodePoolRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> { + ProjectZoneClusterNodePoolUpdateCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Enables/Disables Network Policy for a cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_set_network_policy(&self, request: SetNetworkPolicyRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> { + ProjectZoneClusterSetNetworkPolicyCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_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 node pool requested. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + /// * `nodePoolId` - The name of the node pool. + pub fn zones_clusters_node_pools_get(&self, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + ProjectZoneClusterNodePoolGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Used to set master auth materials. Currently supports :- + /// Changing the admin password of a specific cluster. + /// This can be either via password generation or explicitly set the password. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + pub fn zones_clusters_set_master_auth(&self, request: SetMasterAuthRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + ProjectZoneClusterSetMasterAuthCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Completes master IP rotation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_complete_ip_rotation(&self, request: CompleteIPRotationRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + ProjectZoneClusterCompleteIpRotationCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets labels on a cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_resource_labels(&self, request: SetLabelsRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + ProjectZoneClusterResourceLabelCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.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 in a project in a specific zone or all zones. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for, or `-` for all zones. + pub fn zones_operations_list(&self, project_id: &str, zone: &str) -> ProjectZoneOperationListCall<'a, C, A> { + ProjectZoneOperationListCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -1870,545 +2680,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Gets the details of a specific cluster. -/// -/// A builder for the *zones.clusters.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_clusters_get("projectId", "zone", "clusterId") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneClusterGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _project_id: String, - _zone: String, - _cluster_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneClusterGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneClusterGetCall<'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, Cluster)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.clusters.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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(Bearer { 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(d); - 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(d); - 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 Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// - /// 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) -> ProjectZoneClusterGetCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterGetCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the cluster to retrieve. - /// - /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterGetCall<'a, C, A> { - self._cluster_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) -> ProjectZoneClusterGetCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneClusterGetCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneClusterGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns configuration info about the Container Engine service. -/// -/// A builder for the *zones.getServerconfig* 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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_get_serverconfig("projectId", "zone") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneGetServerconfigCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _project_id: String, - _zone: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneGetServerconfigCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneGetServerconfigCall<'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, ServerConfig)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getServerconfig", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - for &field in ["alt", "projectId", "zone"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/serverconfig"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].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 ["zone", "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(Bearer { 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(d); - 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(d); - 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 Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// - /// 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) -> ProjectZoneGetServerconfigCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) - /// to return operations for. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { - self._zone = 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) -> ProjectZoneGetServerconfigCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneGetServerconfigCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneGetServerconfigCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Cancels the specified operation. /// /// A builder for the *zones.operations.cancel* method supported by a *project* resource. @@ -2675,12 +2946,12 @@ impl<'a, C, A> ProjectZoneOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneOperationCancelCall<'a, C, A> @@ -2715,875 +2986,6 @@ impl<'a, C, A> ProjectZoneOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_clusters_node_pools_list("projectId", "zone", "clusterId") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneClusterNodePoolListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _project_id: String, - _zone: String, - _cluster_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolListCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'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, ListNodePoolsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.clusters.nodePools.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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(Bearer { 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(d); - 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(d); - 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 Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). - /// - /// 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) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the cluster. - /// - /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { - self._cluster_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) -> ProjectZoneClusterNodePoolListCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneClusterNodePoolListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneClusterNodePoolListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Used to set master auth materials. Currently supports :- -/// Changing the admin password of a specific cluster. -/// This can be either via password generation or explicitly set the password. -/// -/// A builder for the *zones.clusters.setMasterAuth* 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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// use container1::SetMasterAuthRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetMasterAuthRequest::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().zones_clusters_set_master_auth(req, "projectId", "zone", "clusterId") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneClusterSetMasterAuthCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _request: SetMasterAuthRequest, - _project_id: String, - _zone: String, - _cluster_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneClusterSetMasterAuthCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneClusterSetMasterAuthCall<'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, Bearer, 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.clusters.setMasterAuth", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: SetMasterAuthRequest) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { - self._request = new_value; - self - } - /// The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// - /// 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) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the cluster to upgrade. - /// - /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { - self._cluster_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) -> ProjectZoneClusterSetMasterAuthCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneClusterSetMasterAuthCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the cluster, including the Kubernetes endpoint and all worker -/// nodes. -/// -/// Firewalls and routes that were configured during cluster creation -/// are also deleted. -/// -/// Other Google Compute Engine resources that might be in use by the cluster -/// (e.g. load balancer resources) will not be deleted if they weren't present -/// at the initial create time. -/// -/// A builder for the *zones.clusters.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_clusters_delete("projectId", "zone", "clusterId") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneClusterDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _project_id: String, - _zone: String, - _cluster_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneClusterDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneClusterDeleteCall<'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, Bearer, 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.clusters.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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(Bearer { 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(d); - 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(d); - 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 Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// - /// 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) -> ProjectZoneClusterDeleteCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the cluster to delete. - /// - /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { - self._cluster_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) -> ProjectZoneClusterDeleteCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneClusterDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneClusterDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates a node pool for a cluster. /// /// A builder for the *zones.clusters.nodePools.create* method supported by a *project* resource. @@ -3851,12 +3253,12 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolCreateCall<'a, C, A> @@ -3891,9 +3293,9 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut } -/// Retrieves the node pool requested. +/// Sets the monitoring service of a specific cluster. /// -/// A builder for the *zones.clusters.nodePools.get* method supported by a *project* resource. +/// A builder for the *zones.clusters.monitoring* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -3905,6 +3307,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_container1 as container1; +/// use container1::SetMonitoringServiceRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -3915,33 +3318,38 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetMonitoringServiceRequest::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().zones_clusters_node_pools_get("projectId", "zone", "clusterId", "nodePoolId") +/// let result = hub.projects().zones_clusters_monitoring(req, "projectId", "zone", "clusterId") /// .doit(); /// # } /// ``` -pub struct ProjectZoneClusterNodePoolGetCall<'a, C, A> +pub struct ProjectZoneClusterMonitoringCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Container, + _request: SetMonitoringServiceRequest, _project_id: String, _zone: String, _cluster_id: String, - _node_pool_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectZoneClusterMonitoringCall<'a, C, A> {} -impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectZoneClusterMonitoringCall<'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, NodePool)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -3949,14 +3357,13 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "container.projects.zones.clusters.nodePools.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.monitoring", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("zone", self._zone.to_string())); params.push(("clusterId", self._cluster_id.to_string())); - params.push(("nodePoolId", self._node_pool_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].iter() { + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3968,12 +3375,12 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -3984,8 +3391,8 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(4); - for param_name in ["nodePoolId", "clusterId", "zone", "projectId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -4000,6 +3407,17 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterMonitoringCall<'a, C, A> { + self._request = new_value; + self + } /// The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). + /// number](https://support.google.com/cloud/answer/6158840). /// /// 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) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterMonitoringCall<'a, C, A> { self._project_id = new_value.to_string(); self } @@ -4090,37 +3521,27 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterMonitoringCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// The name of the cluster. + /// The name of the cluster to upgrade. /// /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterMonitoringCall<'a, C, A> { self._cluster_id = new_value.to_string(); self } - /// The name of the node pool. - /// - /// Sets the *node pool 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 node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { - self._node_pool_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) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterMonitoringCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4139,15 +3560,15 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterMonitoringCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4167,7 +3588,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterMonitoringCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4459,12 +3880,12 @@ impl<'a, C, A> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where C: BorrowM /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> @@ -4499,6 +3920,1167 @@ impl<'a, C, A> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where C: BorrowM } +/// Deletes the cluster, including the Kubernetes endpoint and all worker +/// nodes. +/// +/// Firewalls and routes that were configured during cluster creation +/// are also deleted. +/// +/// Other Google Compute Engine resources that might be in use by the cluster +/// (e.g. load balancer resources) will not be deleted if they weren't present +/// at the initial create time. +/// +/// A builder for the *zones.clusters.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_clusters_delete("projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterDeleteCall<'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, Bearer, 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.clusters.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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(Bearer { 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(d); + 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(d); + 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 Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to delete. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns configuration info about the Container Engine service. +/// +/// A builder for the *zones.getServerconfig* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_get_serverconfig("projectId", "zone") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneGetServerconfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneGetServerconfigCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneGetServerconfigCall<'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, ServerConfig)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getServerconfig", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "projectId", "zone"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/serverconfig"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].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 ["zone", "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(Bearer { 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(d); + 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(d); + 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 Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneGetServerconfigCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { + self._zone = 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) -> ProjectZoneGetServerconfigCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneGetServerconfigCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneGetServerconfigCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enables or disables the ABAC authorization mechanism on a cluster. +/// +/// A builder for the *zones.clusters.legacyAbac* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetLegacyAbacRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetLegacyAbacRequest::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().zones_clusters_legacy_abac(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterLegacyAbacCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetLegacyAbacRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterLegacyAbacCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'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, Bearer, 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.clusters.legacyAbac", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetLegacyAbacRequest) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to update. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterLegacyAbacCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterLegacyAbacCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the addons of a specific cluster. +/// +/// A builder for the *zones.clusters.addons* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetAddonsConfigRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetAddonsConfigRequest::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().zones_clusters_addons(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterAddonCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetAddonsConfigRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterAddonCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterAddonCall<'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, Bearer, 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.clusters.addons", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetAddonsConfigRequest) -> ProjectZoneClusterAddonCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterAddonCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterAddonCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterAddonCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterAddonCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterAddonCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterAddonCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Start master IP rotation. /// /// A builder for the *zones.clusters.startIpRotation* method supported by a *project* resource. @@ -4766,12 +5348,12 @@ impl<'a, C, A> ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: BorrowMu /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> @@ -4806,9 +5388,21 @@ impl<'a, C, A> ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: BorrowMu } -/// Completes master IP rotation. +/// Creates a cluster, consisting of the specified number and type of Google +/// Compute Engine instances. +/// +/// By default, the cluster is created in the project's +/// [default network](/compute/docs/networks-and-firewalls#networks). +/// +/// One firewall is added for the cluster. After cluster creation, +/// the cluster creates routes for each node to allow the containers +/// on that node to communicate with all other instances in the +/// cluster. +/// +/// Finally, an entry is added to the project's global metadata indicating +/// which CIDR range is being used by the cluster. /// -/// A builder for the *zones.clusters.completeIpRotation* method supported by a *project* resource. +/// A builder for the *zones.clusters.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4820,7 +5414,7 @@ impl<'a, C, A> ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: BorrowMu /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_container1 as container1; -/// use container1::CompleteIPRotationRequest; +/// use container1::CreateClusterRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -4834,31 +5428,30 @@ impl<'a, C, A> ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: BorrowMu /// // 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 = CompleteIPRotationRequest::default(); +/// let mut req = CreateClusterRequest::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().zones_clusters_complete_ip_rotation(req, "projectId", "zone", "clusterId") +/// let result = hub.projects().zones_clusters_create(req, "projectId", "zone") /// .doit(); /// # } /// ``` -pub struct ProjectZoneClusterCompleteIpRotationCall<'a, C, A> +pub struct ProjectZoneClusterCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Container, - _request: CompleteIPRotationRequest, + _request: CreateClusterRequest, _project_id: String, _zone: String, - _cluster_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectZoneClusterCompleteIpRotationCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectZoneClusterCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -4870,13 +5463,12 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "container.projects.zones.clusters.completeIpRotation", + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("zone", self._zone.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + for &field in ["alt", "projectId", "zone"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4888,12 +5480,12 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation"; + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -4904,8 +5496,8 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro 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 ["clusterId", "zone", "projectId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "projectId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5011,18 +5603,18 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro /// /// 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: CompleteIPRotationRequest) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + pub fn request(mut self, new_value: CreateClusterRequest) -> ProjectZoneClusterCreateCall<'a, C, A> { self._request = new_value; self } /// The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). + /// number](https://support.google.com/cloud/answer/6158840). /// /// 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) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterCreateCall<'a, C, A> { self._project_id = new_value.to_string(); self } @@ -5034,27 +5626,17 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterCreateCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// The name of the cluster. - /// - /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { - self._cluster_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) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5073,15 +5655,15 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5101,7 +5683,7 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: Borro /// 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) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5392,12 +5974,12 @@ impl<'a, C, A> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> where C: Bo /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> @@ -5432,9 +6014,9 @@ impl<'a, C, A> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> where C: Bo } -/// Enables or disables the ABAC authorization mechanism on a cluster. +/// Lists the node pools for a cluster. /// -/// A builder for the *zones.clusters.legacyAbac* method supported by a *project* resource. +/// A builder for the *zones.clusters.nodePools.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5446,7 +6028,6 @@ impl<'a, C, A> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> where C: Bo /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_container1 as container1; -/// use container1::SetLegacyAbacRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -5457,23 +6038,17 @@ impl<'a, C, A> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> where C: Bo /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetLegacyAbacRequest::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().zones_clusters_legacy_abac(req, "projectId", "zone", "clusterId") +/// let result = hub.projects().zones_clusters_node_pools_list("projectId", "zone", "clusterId") /// .doit(); /// # } /// ``` -pub struct ProjectZoneClusterLegacyAbacCall<'a, C, A> +pub struct ProjectZoneClusterNodePoolListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Container, - _request: SetLegacyAbacRequest, _project_id: String, _zone: String, _cluster_id: String, @@ -5482,13 +6057,13 @@ pub struct ProjectZoneClusterLegacyAbacCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectZoneClusterLegacyAbacCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolListCall<'a, C, A> {} -impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListNodePoolsResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -5496,9 +6071,9 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "container.projects.zones.clusters.legacyAbac", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.nodePools.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("zone", self._zone.to_string())); params.push(("clusterId", self._cluster_id.to_string())); @@ -5514,7 +6089,7 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> { - self._request = new_value; - self - } /// The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). + /// number](https://developers.google.com/console/help/new/#projectnumber). /// /// 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) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { self._project_id = new_value.to_string(); self } @@ -5660,17 +6211,17 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// The name of the cluster to update. + /// The name of the cluster. /// /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { self._cluster_id = new_value.to_string(); self } @@ -5680,7 +6231,7 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5699,15 +6250,15 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5727,7 +6278,7 @@ impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterNodePoolListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5975,12 +6526,12 @@ impl<'a, C, A> ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneOperationGetCall<'a, C, A> @@ -6015,9 +6566,9 @@ impl<'a, C, A> ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut +pub struct ProjectZoneClusterLoggingCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Container, - _request: SetLabelsRequest, + _request: SetLoggingServiceRequest, _project_id: String, _zone: String, _cluster_id: String, @@ -6065,9 +6616,9 @@ pub struct ProjectZoneClusterResourceLabelCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectZoneClusterResourceLabelCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectZoneClusterLoggingCall<'a, C, A> {} -impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectZoneClusterLoggingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -6079,7 +6630,7 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut< Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "container.projects.zones.clusters.resourceLabels", + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.logging", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); @@ -6097,7 +6648,7 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels"; + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6220,18 +6771,18 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'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. - pub fn request(mut self, new_value: SetLabelsRequest) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + pub fn request(mut self, new_value: SetLoggingServiceRequest) -> ProjectZoneClusterLoggingCall<'a, C, A> { self._request = new_value; self } /// The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). + /// number](https://support.google.com/cloud/answer/6158840). /// /// 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) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterLoggingCall<'a, C, A> { self._project_id = new_value.to_string(); self } @@ -6243,17 +6794,17 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'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. - pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterLoggingCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// The name of the cluster. + /// The name of the cluster to upgrade. /// /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterLoggingCall<'a, C, A> { self._cluster_id = new_value.to_string(); self } @@ -6263,7 +6814,7 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut< /// 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) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterLoggingCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6282,15 +6833,15 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut< /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterResourceLabelCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterLoggingCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6310,577 +6861,7 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut< /// 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) -> ProjectZoneClusterResourceLabelCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all operations in a project in a specific zone or all zones. -/// -/// A builder for the *zones.operations.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_operations_list("projectId", "zone") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneOperationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _project_id: String, - _zone: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneOperationListCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.operations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - for &field in ["alt", "projectId", "zone"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/operations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].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 ["zone", "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(Bearer { 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(d); - 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(d); - 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 Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// - /// 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) -> ProjectZoneOperationListCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) - /// to return operations for, or `-` for all zones. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneOperationListCall<'a, C, A> { - self._zone = 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) -> ProjectZoneOperationListCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneOperationListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneOperationListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a cluster, consisting of the specified number and type of Google -/// Compute Engine instances. -/// -/// By default, the cluster is created in the project's -/// [default network](/compute/docs/networks-and-firewalls#networks). -/// -/// One firewall is added for the cluster. After cluster creation, -/// the cluster creates routes for each node to allow the containers -/// on that node to communicate with all other instances in the -/// cluster. -/// -/// Finally, an entry is added to the project's global metadata indicating -/// which CIDR range is being used by the cluster. -/// -/// A builder for the *zones.clusters.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// use container1::CreateClusterRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateClusterRequest::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().zones_clusters_create(req, "projectId", "zone") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneClusterCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _request: CreateClusterRequest, - _project_id: String, - _zone: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneClusterCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneClusterCreateCall<'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, Bearer, 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.clusters.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - for &field in ["alt", "projectId", "zone"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].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 ["zone", "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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: CreateClusterRequest) -> ProjectZoneClusterCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The Google Developers Console [project ID or project - /// number](https://support.google.com/cloud/answer/6158840). - /// - /// 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) -> ProjectZoneClusterCreateCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// - /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterCreateCall<'a, C, A> { - self._zone = 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) -> ProjectZoneClusterCreateCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectZoneClusterCreateCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectZoneClusterCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterLoggingCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7159,12 +7140,12 @@ impl<'a, C, A> ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneClusterUpdateCall<'a, C, A> @@ -7424,12 +7405,12 @@ impl<'a, C, A> ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneClusterListCall<'a, C, A> @@ -7464,6 +7445,951 @@ impl<'a, C, A> ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetNodePoolAutoscalingRequest::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().zones_clusters_node_pools_autoscaling(req, "projectId", "zone", "clusterId", "nodePoolId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetNodePoolAutoscalingRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _node_pool_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterNodePoolAutoscalingCall<'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, Bearer, 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.clusters.nodePools.autoscaling", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + params.push(("nodePoolId", self._node_pool_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId"), ("{nodePoolId}", "nodePoolId")].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 ["nodePoolId", "clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetNodePoolAutoscalingRequest) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The name of the node pool to upgrade. + /// + /// Sets the *node pool 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 node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> { + self._node_pool_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) -> ProjectZoneClusterNodePoolAutoscalingCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolAutoscalingCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterNodePoolAutoscalingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the size of a specific node pool. +/// +/// A builder for the *zones.clusters.nodePools.setSize* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetNodePoolSizeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetNodePoolSizeRequest::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().zones_clusters_node_pools_set_size(req, "projectId", "zone", "clusterId", "nodePoolId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetNodePoolSizeRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _node_pool_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterNodePoolSetSizeCall<'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, Bearer, 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.clusters.nodePools.setSize", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + params.push(("nodePoolId", self._node_pool_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId"), ("{nodePoolId}", "nodePoolId")].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 ["nodePoolId", "clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetNodePoolSizeRequest) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to update. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The name of the node pool to update. + /// + /// Sets the *node pool 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 node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> { + self._node_pool_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) -> ProjectZoneClusterNodePoolSetSizeCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolSetSizeCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterNodePoolSetSizeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the maintenance policy for a cluster. +/// +/// A builder for the *zones.clusters.setMaintenancePolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetMaintenancePolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetMaintenancePolicyRequest::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().zones_clusters_set_maintenance_policy(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetMaintenancePolicyRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterSetMaintenancePolicyCall<'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, Bearer, 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.clusters.setMaintenancePolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetMaintenancePolicyRequest) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to update. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterSetMaintenancePolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterSetMaintenancePolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a node pool from a cluster. /// /// A builder for the *zones.clusters.nodePools.delete* method supported by a *project* resource. @@ -7712,12 +8638,12 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> @@ -7752,3 +8678,2993 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut } +/// Sets the locations of a specific cluster. +/// +/// A builder for the *zones.clusters.locations* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetLocationsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetLocationsRequest::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().zones_clusters_locations(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterLocationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetLocationsRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterLocationCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterLocationCall<'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, Bearer, 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.clusters.locations", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetLocationsRequest) -> ProjectZoneClusterLocationCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterLocationCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterLocationCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterLocationCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterLocationCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterLocationCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterLocationCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the details of a specific cluster. +/// +/// A builder for the *zones.clusters.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_clusters_get("projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterGetCall<'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, Cluster)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.clusters.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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(Bearer { 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(d); + 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(d); + 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 Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to retrieve. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterGetCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the master of a specific cluster. +/// +/// A builder for the *zones.clusters.master* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::UpdateMasterRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateMasterRequest::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().zones_clusters_master(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterMasterCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: UpdateMasterRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterMasterCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterMasterCall<'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, Bearer, 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.clusters.master", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UpdateMasterRequest) -> ProjectZoneClusterMasterCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterMasterCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterMasterCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterMasterCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterMasterCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterMasterCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterMasterCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the version and/or image type of a specific node pool. +/// +/// A builder for the *zones.clusters.nodePools.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::UpdateNodePoolRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateNodePoolRequest::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().zones_clusters_node_pools_update(req, "projectId", "zone", "clusterId", "nodePoolId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterNodePoolUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: UpdateNodePoolRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _node_pool_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterNodePoolUpdateCall<'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, Bearer, 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.clusters.nodePools.update", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + params.push(("nodePoolId", self._node_pool_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId"), ("{nodePoolId}", "nodePoolId")].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 ["nodePoolId", "clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UpdateNodePoolRequest) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The name of the node pool to upgrade. + /// + /// Sets the *node pool 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 node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> { + self._node_pool_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) -> ProjectZoneClusterNodePoolUpdateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterNodePoolUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enables/Disables Network Policy for a cluster. +/// +/// A builder for the *zones.clusters.setNetworkPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetNetworkPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetNetworkPolicyRequest::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().zones_clusters_set_network_policy(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetNetworkPolicyRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterSetNetworkPolicyCall<'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, Bearer, 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.clusters.setNetworkPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetNetworkPolicyRequest) -> ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// 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) -> ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterSetNetworkPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterSetNetworkPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterSetNetworkPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the node pool requested. +/// +/// A builder for the *zones.clusters.nodePools.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_clusters_node_pools_get("projectId", "zone", "clusterId", "nodePoolId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterNodePoolGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _cluster_id: String, + _node_pool_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'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, NodePool)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.clusters.nodePools.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + params.push(("nodePoolId", self._node_pool_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId"), ("{nodePoolId}", "nodePoolId")].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 ["nodePoolId", "clusterId", "zone", "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(Bearer { 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(d); + 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(d); + 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 Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// 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) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The name of the node pool. + /// + /// Sets the *node pool 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 node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { + self._node_pool_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) -> ProjectZoneClusterNodePoolGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Used to set master auth materials. Currently supports :- +/// Changing the admin password of a specific cluster. +/// This can be either via password generation or explicitly set the password. +/// +/// A builder for the *zones.clusters.setMasterAuth* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetMasterAuthRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetMasterAuthRequest::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().zones_clusters_set_master_auth(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterSetMasterAuthCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetMasterAuthRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterSetMasterAuthCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterSetMasterAuthCall<'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, Bearer, 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.clusters.setMasterAuth", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetMasterAuthRequest) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterSetMasterAuthCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterSetMasterAuthCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Completes master IP rotation. +/// +/// A builder for the *zones.clusters.completeIpRotation* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::CompleteIPRotationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CompleteIPRotationRequest::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().zones_clusters_complete_ip_rotation(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: CompleteIPRotationRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterCompleteIpRotationCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'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, Bearer, 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.clusters.completeIpRotation", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CompleteIPRotationRequest) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// 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) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterCompleteIpRotationCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterCompleteIpRotationCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets labels on a cluster. +/// +/// A builder for the *zones.clusters.resourceLabels* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetLabelsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SetLabelsRequest::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().zones_clusters_resource_labels(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterResourceLabelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetLabelsRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterResourceLabelCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'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, Bearer, 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.clusters.resourceLabels", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].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 ["clusterId", "zone", "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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SetLabelsRequest) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// 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) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster 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 cluster_id(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._cluster_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) -> ProjectZoneClusterResourceLabelCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterResourceLabelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneClusterResourceLabelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all operations in a project in a specific zone or all zones. +/// +/// A builder for the *zones.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_operations_list("projectId", "zone") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "projectId", "zone"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].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 ["zone", "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(Bearer { 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(d); + 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(d); + 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 Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// 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) -> ProjectZoneOperationListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for, or `-` for all zones. + /// + /// Sets the *zone* 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(mut self, new_value: &str) -> ProjectZoneOperationListCall<'a, C, A> { + self._zone = 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) -> ProjectZoneOperationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectZoneOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/content2-cli/Cargo.toml b/gen/content2-cli/Cargo.toml index 71259984b0..d262d645ef 100644 --- a/gen/content2-cli/Cargo.toml +++ b/gen/content2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2-cli" -version = "1.0.6+20170519" +version = "1.0.6+20170926" 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-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-content2] path = "../content2" -version = "1.0.6+20170519" +version = "1.0.6+20170926" diff --git a/gen/content2-cli/README.md b/gen/content2-cli/README.md index c2fc23121e..978a09e440 100644 --- a/gen/content2-cli/README.md +++ b/gen/content2-cli/README.md @@ -25,7 +25,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 *20170519*. The CLI is at version *1.0.6*. +This documentation was generated from the *Shopping Content* API at revision *20170926*. The CLI is at version *1.0.6*. ```bash content2 [options] diff --git a/gen/content2-cli/mkdocs.yml b/gen/content2-cli/mkdocs.yml index 642c1c898b..97f1386b7d 100644 --- a/gen/content2-cli/mkdocs.yml +++ b/gen/content2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v1.0.6+20170519 +site_name: Shopping Content v1.0.6+20170926 site_url: http://byron.github.io/google-apis-rs/google-content2-cli site_description: A complete library to interact with Shopping Content (protocol v2) diff --git a/gen/content2-cli/src/main.rs b/gen/content2-cli/src/main.rs index 66de2dfd43..d18e14e842 100644 --- a/gen/content2-cli/src/main.rs +++ b/gen/content2-cli/src/main.rs @@ -248,6 +248,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "force" => { + call = call.force(arg_from_str(value.unwrap_or("false"), err, "force", "boolean")); + }, "dry-run" => { call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); }, @@ -264,7 +267,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["dry-run"].iter().map(|v|*v)); + v.extend(["dry-run", "force"].iter().map(|v|*v)); v } )); } } @@ -1481,6 +1484,7 @@ impl<'n> Engine<'n> { "fetch-schedule.username" => Some(("fetchSchedule.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.hour" => Some(("fetchSchedule.hour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "fetch-schedule.fetch-url" => Some(("fetchSchedule.fetchUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fetch-schedule.paused" => Some(("fetchSchedule.paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fetch-schedule.weekday" => Some(("fetchSchedule.weekday", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.time-zone" => Some(("fetchSchedule.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.password" => Some(("fetchSchedule.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1488,11 +1492,11 @@ impl<'n> Engine<'n> { "fetch-schedule.day-of-month" => Some(("fetchSchedule.dayOfMonth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target-country" => Some(("targetCountry", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "attribute-language" => Some(("attributeLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "paused", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1648,6 +1652,7 @@ impl<'n> Engine<'n> { "fetch-schedule.username" => Some(("fetchSchedule.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.hour" => Some(("fetchSchedule.hour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "fetch-schedule.fetch-url" => Some(("fetchSchedule.fetchUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fetch-schedule.paused" => Some(("fetchSchedule.paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fetch-schedule.weekday" => Some(("fetchSchedule.weekday", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.time-zone" => Some(("fetchSchedule.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.password" => Some(("fetchSchedule.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1655,11 +1660,11 @@ impl<'n> Engine<'n> { "fetch-schedule.day-of-month" => Some(("fetchSchedule.dayOfMonth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target-country" => Some(("targetCountry", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "attribute-language" => Some(("attributeLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "paused", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1756,6 +1761,7 @@ impl<'n> Engine<'n> { "fetch-schedule.username" => Some(("fetchSchedule.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.hour" => Some(("fetchSchedule.hour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "fetch-schedule.fetch-url" => Some(("fetchSchedule.fetchUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fetch-schedule.paused" => Some(("fetchSchedule.paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fetch-schedule.weekday" => Some(("fetchSchedule.weekday", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.time-zone" => Some(("fetchSchedule.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fetch-schedule.password" => Some(("fetchSchedule.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1763,11 +1769,11 @@ impl<'n> Engine<'n> { "fetch-schedule.day-of-month" => Some(("fetchSchedule.dayOfMonth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target-country" => Some(("targetCountry", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "attribute-language" => Some(("attributeLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "paused", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1921,6 +1927,12 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "language" => { + call = call.language(value.unwrap_or("")); + }, + "country" => { + call = call.country(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1934,6 +1946,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["country", "language"].iter().map(|v|*v)); v } )); } } @@ -3148,10 +3161,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "shipment-id" => Some(("shipmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "carrier" => Some(("carrier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tracking-id" => Some(("trackingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shipment-id" => Some(("shipmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["carrier", "operation-id", "shipment-id", "tracking-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3599,11 +3612,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "max-handling-time" => Some(("maxHandlingTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "adult" => Some(("adult", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "color" => Some(("color", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "additional-image-links" => Some(("additionalImageLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "adwords-labels" => Some(("adwordsLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "item-group-id" => Some(("itemGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "min-handling-time" => Some(("minHandlingTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "gtin" => Some(("gtin", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-date" => Some(("expirationDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "google-product-category" => Some(("googleProductCategory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3677,7 +3692,7 @@ impl<'n> Engine<'n> { "age-group" => Some(("ageGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-ads-title" => Some(("displayAdsTitle", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-image-links", "additional-product-types", "adult", "adwords-grouping", "adwords-labels", "adwords-redirect", "age-group", "amount", "availability", "availability-date", "brand", "channel", "color", "condition", "content-language", "currency", "custom-label0", "custom-label1", "custom-label2", "custom-label3", "custom-label4", "description", "display-ads-id", "display-ads-link", "display-ads-similar-ids", "display-ads-title", "display-ads-value", "energy-efficiency-class", "expiration-date", "gender", "google-product-category", "gtin", "id", "identifier-exists", "image-link", "installment", "is-bundle", "item-group-id", "kind", "link", "loyalty-points", "material", "mobile-link", "months", "mpn", "multipack", "name", "offer-id", "online-only", "pattern", "points-value", "price", "product-type", "promotion-ids", "ratio", "sale-price", "sale-price-effective-date", "sell-on-google-quantity", "shipping-height", "shipping-label", "shipping-length", "shipping-weight", "shipping-width", "size-system", "size-type", "sizes", "target-country", "title", "unit", "unit-pricing-base-measure", "unit-pricing-measure", "validated-destinations", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-image-links", "additional-product-types", "adult", "adwords-grouping", "adwords-labels", "adwords-redirect", "age-group", "amount", "availability", "availability-date", "brand", "channel", "color", "condition", "content-language", "currency", "custom-label0", "custom-label1", "custom-label2", "custom-label3", "custom-label4", "description", "display-ads-id", "display-ads-link", "display-ads-similar-ids", "display-ads-title", "display-ads-value", "energy-efficiency-class", "expiration-date", "gender", "google-product-category", "gtin", "id", "identifier-exists", "image-link", "installment", "is-bundle", "item-group-id", "kind", "link", "loyalty-points", "material", "max-handling-time", "min-handling-time", "mobile-link", "months", "mpn", "multipack", "name", "offer-id", "online-only", "pattern", "points-value", "price", "product-type", "promotion-ids", "ratio", "sale-price", "sale-price-effective-date", "sell-on-google-quantity", "shipping-height", "shipping-label", "shipping-length", "shipping-weight", "shipping-width", "size-system", "size-type", "sizes", "target-country", "title", "unit", "unit-pricing-base-measure", "unit-pricing-measure", "validated-destinations", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4800,7 +4815,7 @@ fn main() { Some(false)), ]), ("claimwebsite", - Some(r##"Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts."##), + Some(r##"Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_claimwebsite", vec![ (Some(r##"merchant-id"##), @@ -4872,7 +4887,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_get", vec![ (Some(r##"merchant-id"##), @@ -4950,7 +4965,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics."##), + Some(r##"Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_patch", vec![ (Some(r##"merchant-id"##), @@ -4984,7 +4999,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_update", vec![ (Some(r##"merchant-id"##), @@ -5043,7 +5058,7 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountstatuses_get", vec![ (Some(r##"merchant-id"##), @@ -5118,7 +5133,7 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_get", vec![ (Some(r##"merchant-id"##), @@ -5168,7 +5183,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics."##), + Some(r##"Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_patch", vec![ (Some(r##"merchant-id"##), @@ -5202,7 +5217,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_update", vec![ (Some(r##"merchant-id"##), @@ -5261,7 +5276,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_delete", vec![ (Some(r##"merchant-id"##), @@ -5283,7 +5298,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_get", vec![ (Some(r##"merchant-id"##), @@ -5311,7 +5326,7 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Registers a datafeed with your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_insert", vec![ (Some(r##"merchant-id"##), @@ -5361,7 +5376,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics."##), + Some(r##"Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_patch", vec![ (Some(r##"merchant-id"##), @@ -5395,7 +5410,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_update", vec![ (Some(r##"merchant-id"##), @@ -6253,7 +6268,7 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_get", vec![ (Some(r##"merchant-id"##), @@ -6325,7 +6340,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics."##), + Some(r##"Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_patch", vec![ (Some(r##"merchant-id"##), @@ -6359,7 +6374,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), + Some(r##"Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_update", vec![ (Some(r##"merchant-id"##), @@ -6398,7 +6413,7 @@ fn main() { let mut app = App::new("content2") .author("Sebastian Thiel ") - .version("1.0.6+20170519") + .version("1.0.6+20170926") .about("Manages 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 1e0974754a..a036e7eea6 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-content2" -version = "1.0.6+20170519" +version = "1.0.6+20170926" 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" homepage = "https://developers.google.com/shopping-content" -documentation = "https://docs.rs/google-content2/1.0.6+20170519" +documentation = "https://docs.rs/google-content2/1.0.6+20170926" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] diff --git a/gen/content2/README.md b/gen/content2/README.md index a243adc0fd..a8f6161686 100644 --- a/gen/content2/README.md +++ b/gen/content2/README.md @@ -5,34 +5,34 @@ 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 *1.0.6+20170519*, where *20170519* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Shopping Content* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Shopping Content* *v2* API can be found at the [official documentation site](https://developers.google.com/shopping-content). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShoppingContent.html) ... -* [accounts](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.Account.html) - * [*authinfo*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountAuthinfoCall.html), [*claimwebsite*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountClaimwebsiteCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountUpdateCall.html) +* [accounts](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.Account.html) + * [*authinfo*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountAuthinfoCall.html), [*claimwebsite*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountClaimwebsiteCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountUpdateCall.html) * accountstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccountstatuseListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccountstatuseListCall.html) * accounttax - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccounttaxListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccounttaxPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.AccounttaxUpdateCall.html) -* [datafeeds](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.Datafeed.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccounttaxListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccounttaxPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.AccounttaxUpdateCall.html) +* [datafeeds](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.Datafeed.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedUpdateCall.html) * datafeedstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.DatafeedstatuseListCall.html) -* [inventory](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.Inventory.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.InventorySetCall.html) -* [orders](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.Order.html) - * [*acknowledge*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.OrderUpdateshipmentCall.html) -* [products](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.Product.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.DatafeedstatuseListCall.html) +* [inventory](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.Inventory.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.InventorySetCall.html) +* [orders](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.OrderUpdateshipmentCall.html) +* [products](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.Product.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductListCall.html) * productstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ProductstatuseListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ProductstatuseListCall.html) * shippingsettings - * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShippingsettingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShippingsettingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShippingsettingUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShippingsettingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShippingsettingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShippingsettingUpdateCall.html) @@ -41,17 +41,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-content2/1.0.6+20170519/google_content2/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2/1.0.6+20170926/google_content2/struct.ShoppingContent.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -155,17 +155,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-content2/1.0.6+20170519/google_content2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-content2/1.0.6+20170926/google_content2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-content2/1.0.6+20170519/google_content2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-content2/1.0.6+20170926/google_content2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-content2/1.0.6+20170926/google_content2/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")`. @@ -175,29 +175,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2/1.0.6+20170926/google_content2/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](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-content2/1.0.6+20170926/google_content2/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](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-content2/1.0.6+20170926/google_content2/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](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-content2/1.0.6+20170926/google_content2/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](https://docs.rs/google-content2/1.0.6+20170519/google_content2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/content2/src/lib.rs b/gen/content2/src/lib.rs index 823eea34dd..c105564ffd 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 *1.0.6+20170519*, where *20170519* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Shopping Content* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Shopping Content* *v2* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content). @@ -431,7 +431,7 @@ impl<'a, C, A> ShoppingContent pub struct OrdersCustomBatchRequestEntryUpdateShipment { /// New status for the shipment. Not updated if missing. pub status: Option, - /// The carrier handling the shipment. Not updated if missing. + /// The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, /// The tracking id for the shipment. Not updated if missing. #[serde(rename="trackingId")] @@ -482,6 +482,9 @@ pub struct Service { /// Shipping rate group definitions. Only the last one is allowed to have an empty applicableShippingLabels, which means "everything else". The other applicableShippingLabels must not overlap. #[serde(rename="rateGroups")] pub rate_groups: Option>, + /// Minimum order value for this service. If set, indicates that customers will have to spend at least this amount. All prices within a service must have the same currency. + #[serde(rename="minimumOrderValue")] + pub minimum_order_value: Option, } impl Part for Service {} @@ -612,16 +615,16 @@ impl ResponseResult for InventorySetResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductStatus { - /// Date on which the item expires in Google Shopping, in ISO 8601 format. - #[serde(rename="googleExpirationDate")] - pub google_expiration_date: Option, + /// Product data after applying all the join inputs. + pub product: Option, /// The intended destinations for the product. #[serde(rename="destinationStatuses")] pub destination_statuses: Option>, /// The title of the product. pub title: Option, - /// Identifies what kind of resource this is. Value: the fixed string "content#productStatus". - pub kind: Option, + /// Date on which the item expires in Google Shopping, in ISO 8601 format. + #[serde(rename="googleExpirationDate")] + pub google_expiration_date: Option, /// Date on which the item has been last updated, in ISO 8601 format. #[serde(rename="lastUpdateDate")] pub last_update_date: Option, @@ -630,6 +633,8 @@ pub struct ProductStatus { /// Date on which the item has been created, in ISO 8601 format. #[serde(rename="creationDate")] pub creation_date: Option, + /// Identifies what kind of resource this is. Value: the fixed string "content#productStatus". + pub kind: Option, /// A list of data quality issues associated with the product. #[serde(rename="dataQualityIssues")] pub data_quality_issues: Option>, @@ -723,6 +728,9 @@ pub struct Account { pub kind: Option, /// Display name for the account. pub name: Option, + /// List of linked YouTube channels that are active or pending approval. To create a new link request, add a new link with status active to the list. It will remain in a pending state until approved or rejected in the YT Creator Studio interface. To delete an active link, or to cancel a link request, remove it from the list. + #[serde(rename="youtubeChannelLinks")] + pub youtube_channel_links: Option>, /// Indicates whether the merchant sells adult content. #[serde(rename="adultContent")] pub adult_content: Option, @@ -914,7 +922,7 @@ pub struct ProductShipping { pub country: Option, /// Fixed shipping price, represented as a number. pub price: Option, - /// The geographic region to which a shipping rate applies (e.g. zip code). + /// The geographic region to which a shipping rate applies. pub region: Option, /// The location where the shipping is applicable, represented by a location group name. #[serde(rename="locationGroupName")] @@ -1193,16 +1201,18 @@ pub struct AccountsCustomBatchRequestEntry { pub batch_id: Option, /// The account to create or update. Only defined if the method is insert or update. pub account: Option, + /// Whether the account should be deleted if the account has offers. Only applicable if the method is delete. + pub force: Option, /// The ID of the targeted account. Only defined if the method is get, delete or claimwebsite. #[serde(rename="accountId")] pub account_id: Option, + /// no description provided + pub method: Option, + /// Only applicable if the method is claimwebsite. Indicates whether or not to take the claim from another account in case there is a conflict. + pub overwrite: Option, /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, - /// Only applicable if the method is claimwebsite. Indicates whether or not to take the claim from another account in case there is a conflict. - pub overwrite: Option, - /// no description provided - pub method: Option, } impl Part for AccountsCustomBatchRequestEntry {} @@ -1334,20 +1344,23 @@ impl Part for Inventory {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersShipLineItemsRequest { - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, + /// Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. + pub carrier: Option, + /// Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. + #[serde(rename="trackingId")] + pub tracking_id: Option, + /// Deprecated. Please use shipmentInfo instead. The ID of the shipment. + #[serde(rename="shipmentId")] + pub shipment_id: Option, /// Line items to ship. #[serde(rename="lineItems")] pub line_items: Option>, - /// The carrier handling the shipment. - pub carrier: Option, - /// The tracking id for the shipment. - #[serde(rename="trackingId")] - pub tracking_id: Option, - /// The ID of the shipment. - #[serde(rename="shipmentId")] - pub shipment_id: Option, + /// Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). + #[serde(rename="shipmentInfos")] + pub shipment_infos: Option>, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, } impl RequestValue for OrdersShipLineItemsRequest {} @@ -1358,17 +1371,20 @@ impl RequestValue for OrdersShipLineItemsRequest {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProductStatusDestinationStatus { - /// The destination's approval status. - #[serde(rename="approvalStatus")] - pub approval_status: Option, - /// The name of the destination - pub destination: Option, - /// Whether the destination is required, excluded, selected by default or should be validated. - pub intention: Option, +pub struct AccountStatusAccountLevelIssue { + /// Country for which this issue is reported. + pub country: Option, + /// Additional details about the issue. + pub detail: Option, + /// Issue identifier. + pub id: Option, + /// Severity of the issue. + pub severity: Option, + /// Short description of the issue. + pub title: Option, } -impl Part for ProductStatusDestinationStatus {} +impl Part for AccountStatusAccountLevelIssue {} /// There is no detailed description. @@ -1855,6 +1871,22 @@ pub struct OrderDeliveryDetails { impl Part for OrderDeliveryDetails {} +/// 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 AccountYouTubeChannelLink { + /// Status of the link between this Merchant Center account and the YouTube channel. Upon retrieval, it represents the actual status of the link and can be either active if it was approved in YT Creator Studio or pending if it's pending approval. Upon insertion, it represents the intended status of the link. Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status will remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if it was active or cancel the link request if it was pending. + pub status: Option, + /// Channel ID. + #[serde(rename="channelId")] + pub channel_id: Option, +} + +impl Part for AccountYouTubeChannelLink {} + + /// The required fields vary based on the frequency of fetching. For a monthly fetch schedule, day_of_month and hour are required. For a weekly fetch schedule, weekday and hour are required. For a daily fetch schedule, only hour is required. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1868,6 +1900,8 @@ pub struct DatafeedFetchSchedule { /// The URL where the feed file can be fetched. Google Merchant Center will support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP protocols, so the value will need to be a valid link using one of those four protocols. #[serde(rename="fetchUrl")] pub fetch_url: Option, + /// Whether the scheduled fetch is paused or not. + pub paused: Option, /// The day of the week the feed file should be fetched. pub weekday: Option, /// Time zone used for schedule. UTC by default. E.g., "America/Los_Angeles". @@ -2017,6 +2051,9 @@ pub struct ProductstatusesCustomBatchRequestEntry { pub merchant_id: Option, /// no description provided pub method: Option, + /// no description provided + #[serde(rename="includeAttributes")] + pub include_attributes: Option, /// The ID of the product whose status to get. #[serde(rename="productId")] pub product_id: Option, @@ -2164,14 +2201,18 @@ pub struct DatafeedStatus { pub kind: Option, /// The list of errors occurring in the feed. pub errors: Option>, - /// The list of errors occurring in the feed. - pub warnings: Option>, - /// The number of items in the feed that were processed. - #[serde(rename="itemsTotal")] - pub items_total: Option, + /// The two-letter ISO 639-1 language for which the status is reported. + pub language: Option, /// The processing status of the feed. #[serde(rename="processingStatus")] pub processing_status: Option, + /// The number of items in the feed that were processed. + #[serde(rename="itemsTotal")] + pub items_total: Option, + /// The country for which the status is reported, represented as a CLDR territory code. + pub country: Option, + /// The list of errors occurring in the feed. + pub warnings: Option>, /// The last date at which the feed was uploaded. #[serde(rename="lastUploadDate")] pub last_upload_date: Option, @@ -2220,9 +2261,13 @@ pub struct DatafeedstatusesCustomBatchRequestEntry { /// An entry ID, unique within the batch request. #[serde(rename="batchId")] pub batch_id: Option, - /// The ID of the data feed to get or delete. + /// The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that for multi-target datafeeds this parameter is required. + pub language: Option, + /// The ID of the data feed to get. #[serde(rename="datafeedId")] pub datafeed_id: Option, + /// The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that for multi-target datafeeds this parameter is required. + pub country: Option, /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, @@ -2380,15 +2425,18 @@ impl Part for AccountstatusesCustomBatchResponseEntry {} pub struct AccountStatus { /// Identifies what kind of resource this is. Value: the fixed string "content#accountStatus". pub kind: Option, + /// The ID of the account for which the status is reported. + #[serde(rename="accountId")] + pub account_id: Option, /// Whether the account's website is claimed or not. #[serde(rename="websiteClaimed")] pub website_claimed: Option, /// A list of data quality issues. #[serde(rename="dataQualityIssues")] pub data_quality_issues: Option>, - /// The ID of the account for which the status is reported. - #[serde(rename="accountId")] - pub account_id: Option, + /// A list of account level issues. + #[serde(rename="accountLevelIssues")] + pub account_level_issues: Option>, } impl ResponseResult for AccountStatus {} @@ -2686,7 +2734,7 @@ pub struct OrderLineItemProduct { impl Part for OrderLineItemProduct {} -/// Datafeed data. +/// Datafeed configuration data. /// /// # Activities /// @@ -2710,7 +2758,7 @@ pub struct Datafeed { pub content_type: Option, /// A descriptive name of the data feed. pub name: Option, - /// The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targetCountry. + /// [DEPRECATED] Please use target.language instead. The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targetCountry. #[serde(rename="contentLanguage")] pub content_language: Option, /// Format of the feed file. @@ -2718,17 +2766,19 @@ pub struct Datafeed { /// Fetch schedule for the feed file. #[serde(rename="fetchSchedule")] pub fetch_schedule: Option, - /// The country where the items in the feed will be included in the search index, represented as a CLDR territory code. + /// [DEPRECATED] Please use target.country instead. The country where the items in the feed will be included in the search index, represented as a CLDR territory code. #[serde(rename="targetCountry")] pub target_country: Option, /// The filename of the feed. All feeds must have a unique file name. #[serde(rename="fileName")] pub file_name: Option, - /// The ID of the data feed. - pub id: Option, - /// The list of intended destinations (corresponds to checked check boxes in Merchant Center). + /// [DEPRECATED] Please use target.includedDestination instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center). #[serde(rename="intendedDestinations")] pub intended_destinations: Option>, + /// The ID of the data feed. + pub id: Option, + /// The targets this feed should apply to (country, language, destinations). + pub targets: Option>, /// The two-letter ISO 639-1 language in which the attributes are defined in the data feed. #[serde(rename="attributeLanguage")] pub attribute_language: Option, @@ -2747,7 +2797,7 @@ impl ResponseResult for Datafeed {} pub struct TestOrder { /// The details of the customer who placed the order. pub customer: Option, - /// The details of the merchant provided promotions applied to the order. More details about the program are here. + /// The details of the merchant provided promotions applied to the order. More details about the program are here. pub promotions: Option>, /// Identifies what kind of resource this is. Value: the fixed string "content#testOrder". pub kind: Option, @@ -2783,7 +2833,7 @@ pub struct OrderLineItemShippingDetailsMethod { /// Minimum transit time. #[serde(rename="minDaysInTransit")] pub min_days_in_transit: Option, - /// The carrier for the shipping. Optional. + /// The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values. pub carrier: Option, /// The name of the shipping method. #[serde(rename="methodName")] @@ -2922,6 +2972,24 @@ pub struct AccountsClaimWebsiteResponse { impl ResponseResult for AccountsClaimWebsiteResponse {} +/// 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 ProductStatusDestinationStatus { + /// The destination's approval status. + #[serde(rename="approvalStatus")] + pub approval_status: Option, + /// The name of the destination + pub destination: Option, + /// Whether the destination is required, excluded, selected by default or should be validated. + pub intention: Option, +} + +impl Part for ProductStatusDestinationStatus {} + + /// A batch entry encoding a single non-batch inventory request. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2959,6 +3027,30 @@ pub struct OrderShipment { #[serde(rename="creationDate")] pub creation_date: Option, /// The carrier handling the shipment. + /// + /// Acceptable values are: + /// - "gsx" + /// - "ups" + /// - "united parcel service" + /// - "usps" + /// - "united states postal service" + /// - "fedex" + /// - "dhl" + /// - "ecourier" + /// - "cxt" + /// - "google" + /// - "on trac" + /// - "ontrac" + /// - "on-trac" + /// - "on_trac" + /// - "delvic" + /// - "dynamex" + /// - "lasership" + /// - "smartpost" + /// - "fedex smartpost" + /// - "mpx" + /// - "uds" + /// - "united delivery service" pub carrier: Option, /// The tracking id for the shipment. #[serde(rename="trackingId")] @@ -3151,6 +3243,25 @@ impl RequestValue for ShippingSettings {} impl ResponseResult for ShippingSettings {} +/// 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 OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { + /// The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. + pub carrier: Option, + /// The tracking id for the shipment. + #[serde(rename="trackingId")] + pub tracking_id: Option, + /// The ID of the shipment. + #[serde(rename="shipmentId")] + pub shipment_id: Option, +} + +impl Part for OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo {} + + /// There is no detailed description. /// /// # Activities @@ -3393,6 +3504,9 @@ impl ResponseResult for OrdersCustomBatchResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Product { + /// Maximal product handling time (in business days). + #[serde(rename="maxHandlingTime")] + pub max_handling_time: Option, /// Color of the item. pub color: Option, /// Similar to adwords_grouping, but only works on CPC. @@ -3510,6 +3624,9 @@ pub struct Product { /// An identifier of the item. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. Only valid unicode characters are accepted. See the products feed specification for details. #[serde(rename="offerId")] pub offer_id: Option, + /// Minimal product handling time (in business days). + #[serde(rename="minHandlingTime")] + pub min_handling_time: Option, /// Global Trade Item Number (GTIN) of the item. pub gtin: Option, /// The shipping label of the product, used to group product in account-level shipping rules. @@ -3614,6 +3731,27 @@ pub struct ProductsListResponse { impl ResponseResult for ProductsListResponse {} +/// 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 DatafeedTarget { + /// The country where the items in the feed will be included in the search index, represented as a CLDR territory code. + pub country: Option, + /// The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center). + #[serde(rename="excludedDestinations")] + pub excluded_destinations: Option>, + /// The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targets[].country. + pub language: Option, + /// The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included unless provided in the excluded_destination field. + #[serde(rename="includedDestinations")] + pub included_destinations: Option>, +} + +impl Part for DatafeedTarget {} + + /// There is no detailed description. /// /// # Activities @@ -3736,7 +3874,7 @@ pub struct Order { pub net_amount: Option, /// The REST id of the order. Globally unique. pub id: Option, - /// The details of the merchant provided promotions applied to the order. More details about the program are here. + /// The details of the merchant provided promotions applied to the order. More details about the program are here. pub promotions: Option>, /// Identifies what kind of resource this is. Value: the fixed string "content#order". pub kind: Option, @@ -3891,12 +4029,15 @@ pub struct OrdersCustomBatchRequestEntryShipLineItems { /// Line items to ship. #[serde(rename="lineItems")] pub line_items: Option>, - /// The carrier handling the shipment. + /// Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, - /// The tracking id for the shipment. + /// Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). + #[serde(rename="shipmentInfos")] + pub shipment_infos: Option>, + /// Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. #[serde(rename="trackingId")] pub tracking_id: Option, - /// The ID of the shipment. + /// Deprecated. Please use shipmentInfo instead. The ID of the shipment. #[serde(rename="shipmentId")] pub shipment_id: Option, } @@ -3958,7 +4099,16 @@ pub struct OrderPaymentMethod { /// The billing address. #[serde(rename="billingAddress")] pub billing_address: Option, - /// The type of instrument (VISA, Mastercard, etc). + /// The type of instrument. + /// + /// Acceptable values are: + /// - "AMEX" + /// - "DISCOVER" + /// - "JCB" + /// - "MASTERCARD" + /// - "UNIONPAY" + /// - "VISA" + /// - "" #[serde(rename="type")] pub type_: Option, /// The last four digits of the card number. @@ -4090,7 +4240,7 @@ impl ResponseResult for ShippingsettingsGetSupportedCarriersResponse {} pub struct OrdersUpdateShipmentRequest { /// New status for the shipment. Not updated if missing. pub status: Option, - /// The carrier handling the shipment. Not updated if missing. + /// The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, /// The ID of the operation. Unique across all operations for a given order. #[serde(rename="operationId")] @@ -4248,7 +4398,7 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. + /// Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. /// /// # Arguments /// @@ -4289,7 +4439,7 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4311,7 +4461,7 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4372,7 +4522,7 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. + /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. /// /// # Arguments /// @@ -4448,7 +4598,7 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4470,7 +4620,7 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4546,7 +4696,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -4565,7 +4715,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics. + /// Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics. /// /// # Arguments /// @@ -4587,7 +4737,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -4607,7 +4757,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Registers a datafeed with your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -4646,7 +4796,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -4710,7 +4860,7 @@ impl<'a, C, A> AccountstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4804,7 +4954,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4838,7 +4988,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. + /// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. /// /// # Arguments /// @@ -4860,7 +5010,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts. + /// Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -4910,6 +5060,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { hub: self.hub, _merchant_id: merchant_id.to_string(), _account_id: account_id.to_string(), + _force: Default::default(), _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -4937,7 +5088,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. + /// Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// # Arguments /// @@ -5353,6 +5504,8 @@ impl<'a, C, A> DatafeedstatuseMethods<'a, C, A> { hub: self.hub, _merchant_id: merchant_id.to_string(), _datafeed_id: datafeed_id.to_string(), + _language: Default::default(), + _country: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -6000,7 +6153,7 @@ impl<'a, C, A> AccounttaxCustombatchCall<'a, C, A> where C: BorrowMut AccounttaxListCall<'a, C, A> where C: BorrowMut, A } -/// Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. +/// Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// A builder for the *update* method supported by a *accounttax* resource. /// It is not used directly, but through a `AccounttaxMethods` instance. @@ -6863,7 +7016,7 @@ impl<'a, C, A> AccounttaxUpdateCall<'a, C, A> where C: BorrowMut, } -/// Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. +/// Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// A builder for the *get* method supported by a *accounttax* resource. /// It is not used directly, but through a `AccounttaxMethods` instance. @@ -7118,7 +7271,7 @@ impl<'a, C, A> AccounttaxGetCall<'a, C, A> where C: BorrowMut, A: } -/// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. +/// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *shippingsetting* resource. /// It is not used directly, but through a `ShippingsettingMethods` instance. @@ -8179,7 +8332,7 @@ impl<'a, C, A> ShippingsettingCustombatchCall<'a, C, A> where C: BorrowMut ShippingsettingUpdateCall<'a, C, A> where C: BorrowMut DatafeedCustombatchCall<'a, C, A> where C: BorrowMut DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics. +/// Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -9532,7 +9685,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// A builder for the *delete* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -9786,7 +9939,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A } -/// Registers a datafeed with your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// A builder for the *insert* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -10338,7 +10491,7 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: } -/// Updates a datafeed of your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// A builder for the *update* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -10634,7 +10787,7 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A } -/// Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. +/// Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// A builder for the *get* method supported by a *accountstatuse* resource. /// It is not used directly, but through a `AccountstatuseMethods` instance. @@ -11395,7 +11548,7 @@ impl<'a, C, A> AccountstatuseListCall<'a, C, A> where C: BorrowMut AccountAuthinfoCall<'a, C, A> where C: BorrowMut, } -/// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. +/// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -12201,7 +12354,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts. +/// Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. /// /// A builder for the *claimwebsite* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -12402,7 +12555,7 @@ impl<'a, C, A> AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut AccountClaimwebsiteCall<'a, C, A> { @@ -12763,6 +12916,7 @@ impl<'a, C, A> AccountListCall<'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.accounts().delete("merchantId", "accountId") +/// .force(true) /// .dry_run(true) /// .doit(); /// # } @@ -12773,6 +12927,7 @@ pub struct AccountDeleteCall<'a, C, A> hub: &'a ShoppingContent, _merchant_id: String, _account_id: String, + _force: Option, _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -12795,13 +12950,16 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.accounts.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(("merchantId", self._merchant_id.to_string())); params.push(("accountId", self._account_id.to_string())); + if let Some(value) = self._force { + params.push(("force", value.to_string())); + } if let Some(value) = self._dry_run { params.push(("dryRun", value.to_string())); } - for &field in ["merchantId", "accountId", "dryRun"].iter() { + for &field in ["merchantId", "accountId", "force", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12925,6 +13083,13 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: self._account_id = new_value.to_string(); self } + /// Flag to delete sub-accounts with products. The default value of false will become active on September 28, 2017. + /// + /// Sets the *force* query property to the given value. + pub fn force(mut self, new_value: bool) -> AccountDeleteCall<'a, C, A> { + self._force = Some(new_value); + self + } /// Flag to run the request in dry-run mode. /// /// Sets the *dry run* query property to the given value. @@ -13244,7 +13409,7 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut AccountInsertCall<'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.inventory().custombatch(req) -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -14072,7 +14237,7 @@ impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut InventorySetCall<'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.productstatuses().get("merchantId", "productId") -/// .include_attributes(false) +/// .include_attributes(true) /// .doit(); /// # } /// ``` @@ -14643,10 +14808,10 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.productstatuses().list("merchantId") -/// .page_token("nonumy") -/// .max_results(72) +/// .page_token("sed") +/// .max_results(19) /// .include_invalid_inserted_items(false) -/// .include_attributes(false) +/// .include_attributes(true) /// .doit(); /// # } /// ``` @@ -15187,9 +15352,9 @@ impl<'a, C, A> ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductInsertCall<'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.datafeedstatuses().get("merchantId", "datafeedId") +/// .language("ut") +/// .country("justo") /// .doit(); /// # } /// ``` @@ -16525,6 +16692,8 @@ pub struct DatafeedstatuseGetCall<'a, C, A> hub: &'a ShoppingContent, _merchant_id: String, _datafeed_id: String, + _language: Option, + _country: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -16546,10 +16715,16 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("datafeedId", self._datafeed_id.to_string())); - for &field in ["alt", "merchantId", "datafeedId"].iter() { + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + if let Some(value) = self._country { + params.push(("country", value.to_string())); + } + for &field in ["alt", "merchantId", "datafeedId", "language", "country"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16682,6 +16857,20 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseGetCall<'a, C, A> { + self._language = Some(new_value.to_string()); + self + } + /// The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + /// + /// Sets the *country* query property to the given value. + pub fn country(mut self, new_value: &str) -> DatafeedstatuseGetCall<'a, C, A> { + self._country = 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. /// @@ -16769,8 +16958,8 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Shopping Content (protocol v2sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2_sandbox-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-content2_sandbox] path = "../content2_sandbox" -version = "1.0.6+20170519" +version = "1.0.6+20170926" diff --git a/gen/content2_sandbox-cli/README.md b/gen/content2_sandbox-cli/README.md index 6589d4bf9a..56df43a8db 100644 --- a/gen/content2_sandbox-cli/README.md +++ b/gen/content2_sandbox-cli/README.md @@ -25,7 +25,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 *20170519*. The CLI is at version *1.0.6*. +This documentation was generated from the *Shopping Content* API at revision *20170926*. The CLI is at version *1.0.6*. ```bash content2-sandbox [options] diff --git a/gen/content2_sandbox-cli/mkdocs.yml b/gen/content2_sandbox-cli/mkdocs.yml index 74734dc52d..f609d0e5d9 100644 --- a/gen/content2_sandbox-cli/mkdocs.yml +++ b/gen/content2_sandbox-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v1.0.6+20170519 +site_name: Shopping Content v1.0.6+20170926 site_url: http://byron.github.io/google-apis-rs/google-content2_sandbox-cli site_description: A complete library to interact with Shopping Content (protocol v2sandbox) diff --git a/gen/content2_sandbox-cli/src/main.rs b/gen/content2_sandbox-cli/src/main.rs index ee200d2c19..b508b375dc 100644 --- a/gen/content2_sandbox-cli/src/main.rs +++ b/gen/content2_sandbox-cli/src/main.rs @@ -976,10 +976,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "shipment-id" => Some(("shipmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "carrier" => Some(("carrier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tracking-id" => Some(("trackingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shipment-id" => Some(("shipmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["carrier", "operation-id", "shipment-id", "tracking-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1819,7 +1819,7 @@ fn main() { let mut app = App::new("content2-sandbox") .author("Sebastian Thiel ") - .version("1.0.6+20170519") + .version("1.0.6+20170926") .about("Manages 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_sandbox_cli") .arg(Arg::with_name("url") diff --git a/gen/content2_sandbox/Cargo.toml b/gen/content2_sandbox/Cargo.toml index 1dec20d9a7..121f2badfb 100644 --- a/gen/content2_sandbox/Cargo.toml +++ b/gen/content2_sandbox/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-content2_sandbox" -version = "1.0.6+20170519" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2_sandbox" homepage = "https://developers.google.com/shopping-content" -documentation = "https://docs.rs/google-content2_sandbox/1.0.6+20170519" +documentation = "https://docs.rs/google-content2_sandbox/1.0.6+20170926" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] diff --git a/gen/content2_sandbox/README.md b/gen/content2_sandbox/README.md index 994b806a91..fdbceb191c 100644 --- a/gen/content2_sandbox/README.md +++ b/gen/content2_sandbox/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-content2_sandbox` library allows access to all features of the *Google Shopping Content* service. -This documentation was generated from *Shopping Content* crate version *1.0.6+20170519*, where *20170519* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Shopping Content* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Shopping Content* *v2_sandbox* API can be found at the [official documentation site](https://developers.google.com/shopping-content). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.ShoppingContent.html) ... -* [orders](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.Order.html) - * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.OrderUpdateshipmentCall.html) +* [orders](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.OrderUpdateshipmentCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/struct.ShoppingContent.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/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")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/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](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/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](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.RequestValue.html) and -[decodable](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/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](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/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](https://docs.rs/google-content2_sandbox/1.0.6+20170519/google_content2_sandbox/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2_sandbox/1.0.6+20170926/google_content2_sandbox/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/content2_sandbox/src/lib.rs b/gen/content2_sandbox/src/lib.rs index 7ba741d288..18c94179f9 100644 --- a/gen/content2_sandbox/src/lib.rs +++ b/gen/content2_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 *Shopping Content* crate version *1.0.6+20170519*, where *20170519* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Shopping Content* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Shopping Content* *v2_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content). @@ -387,7 +387,7 @@ pub struct OrderLineItemShippingDetailsMethod { /// Minimum transit time. #[serde(rename="minDaysInTransit")] pub min_days_in_transit: Option, - /// The carrier for the shipping. Optional. + /// The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values. pub carrier: Option, /// The name of the shipping method. #[serde(rename="methodName")] @@ -466,7 +466,7 @@ impl ResponseResult for OrdersAdvanceTestOrderResponse {} pub struct OrdersCustomBatchRequestEntryUpdateShipment { /// New status for the shipment. Not updated if missing. pub status: Option, - /// The carrier handling the shipment. Not updated if missing. + /// The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, /// The tracking id for the shipment. Not updated if missing. #[serde(rename="trackingId")] @@ -525,20 +525,23 @@ impl RequestValue for OrdersCustomBatchRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersShipLineItemsRequest { - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, + /// Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. + pub carrier: Option, + /// Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. + #[serde(rename="trackingId")] + pub tracking_id: Option, + /// Deprecated. Please use shipmentInfo instead. The ID of the shipment. + #[serde(rename="shipmentId")] + pub shipment_id: Option, /// Line items to ship. #[serde(rename="lineItems")] pub line_items: Option>, - /// The carrier handling the shipment. - pub carrier: Option, - /// The tracking id for the shipment. - #[serde(rename="trackingId")] - pub tracking_id: Option, - /// The ID of the shipment. - #[serde(rename="shipmentId")] - pub shipment_id: Option, + /// Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). + #[serde(rename="shipmentInfos")] + pub shipment_infos: Option>, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, } impl RequestValue for OrdersShipLineItemsRequest {} @@ -556,6 +559,30 @@ pub struct OrderShipment { #[serde(rename="creationDate")] pub creation_date: Option, /// The carrier handling the shipment. + /// + /// Acceptable values are: + /// - "gsx" + /// - "ups" + /// - "united parcel service" + /// - "usps" + /// - "united states postal service" + /// - "fedex" + /// - "dhl" + /// - "ecourier" + /// - "cxt" + /// - "google" + /// - "on trac" + /// - "ontrac" + /// - "on-trac" + /// - "on_trac" + /// - "delvic" + /// - "dynamex" + /// - "lasership" + /// - "smartpost" + /// - "fedex smartpost" + /// - "mpx" + /// - "uds" + /// - "united delivery service" pub carrier: Option, /// The tracking id for the shipment. #[serde(rename="trackingId")] @@ -737,7 +764,7 @@ pub struct Order { pub net_amount: Option, /// The REST id of the order. Globally unique. pub id: Option, - /// The details of the merchant provided promotions applied to the order. More details about the program are here. + /// The details of the merchant provided promotions applied to the order. More details about the program are here. pub promotions: Option>, /// Identifies what kind of resource this is. Value: the fixed string "content#order". pub kind: Option, @@ -780,6 +807,25 @@ impl Resource for Order {} impl ResponseResult for Order {} +/// 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 OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { + /// The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. + pub carrier: Option, + /// The tracking id for the shipment. + #[serde(rename="trackingId")] + pub tracking_id: Option, + /// The ID of the shipment. + #[serde(rename="shipmentId")] + pub shipment_id: Option, +} + +impl Part for OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1574,12 +1620,15 @@ pub struct OrdersCustomBatchRequestEntryShipLineItems { /// Line items to ship. #[serde(rename="lineItems")] pub line_items: Option>, - /// The carrier handling the shipment. + /// Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, - /// The tracking id for the shipment. + /// Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). + #[serde(rename="shipmentInfos")] + pub shipment_infos: Option>, + /// Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. #[serde(rename="trackingId")] pub tracking_id: Option, - /// The ID of the shipment. + /// Deprecated. Please use shipmentInfo instead. The ID of the shipment. #[serde(rename="shipmentId")] pub shipment_id: Option, } @@ -1649,7 +1698,16 @@ pub struct OrderPaymentMethod { /// The billing address. #[serde(rename="billingAddress")] pub billing_address: Option, - /// The type of instrument (VISA, Mastercard, etc). + /// The type of instrument. + /// + /// Acceptable values are: + /// - "AMEX" + /// - "DISCOVER" + /// - "JCB" + /// - "MASTERCARD" + /// - "UNIONPAY" + /// - "VISA" + /// - "" #[serde(rename="type")] pub type_: Option, /// The last four digits of the card number. @@ -1715,7 +1773,7 @@ impl ResponseResult for OrdersCancelResponse {} pub struct OrdersUpdateShipmentRequest { /// New status for the shipment. Not updated if missing. pub status: Option, - /// The carrier handling the shipment. Not updated if missing. + /// The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, /// The ID of the operation. Unique across all operations for a given order. #[serde(rename="operationId")] @@ -1777,7 +1835,7 @@ impl Part for OrdersCustomBatchRequestEntryRefund {} pub struct TestOrder { /// The details of the customer who placed the order. pub customer: Option, - /// The details of the merchant provided promotions applied to the order. More details about the program are here. + /// The details of the merchant provided promotions applied to the order. More details about the program are here. pub promotions: Option>, /// Identifies what kind of resource this is. Value: the fixed string "content#testOrder". pub kind: Option, diff --git a/gen/customsearch1-cli/Cargo.toml b/gen/customsearch1-cli/Cargo.toml index 873f4da2ab..2be191cc90 100644 --- a/gen/customsearch1-cli/Cargo.toml +++ b/gen/customsearch1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-customsearch1-cli" -version = "1.0.6+20160411" +version = "1.0.6+20170615" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-customsearch1] path = "../customsearch1" -version = "1.0.6+20160411" +version = "1.0.6+20170615" diff --git a/gen/customsearch1-cli/README.md b/gen/customsearch1-cli/README.md index f4452bffa4..0eea793a87 100644 --- a/gen/customsearch1-cli/README.md +++ b/gen/customsearch1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *customsearch* API at revision *20160411*. The CLI is at version *1.0.6*. +This documentation was generated from the *customsearch* API at revision *20170615*. The CLI is at version *1.0.6*. ```bash customsearch1 [options] diff --git a/gen/customsearch1-cli/mkdocs.yml b/gen/customsearch1-cli/mkdocs.yml index bc4ce5b281..69586db5ac 100644 --- a/gen/customsearch1-cli/mkdocs.yml +++ b/gen/customsearch1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: customsearch v1.0.6+20160411 +site_name: customsearch v1.0.6+20170615 site_url: http://byron.github.io/google-apis-rs/google-customsearch1-cli site_description: A complete library to interact with customsearch (protocol v1) diff --git a/gen/customsearch1-cli/src/main.rs b/gen/customsearch1-cli/src/main.rs index ae79cbf780..4b45c85a32 100644 --- a/gen/customsearch1-cli/src/main.rs +++ b/gen/customsearch1-cli/src/main.rs @@ -136,9 +136,6 @@ impl<'n> Engine<'n> { "cx" => { call = call.cx(value.unwrap_or("")); }, - "cref" => { - call = call.cref(value.unwrap_or("")); - }, "cr" => { call = call.cr(value.unwrap_or("")); }, @@ -158,7 +155,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["date-restrict", "or-terms", "high-range", "num", "cr", "img-type", "related-site", "gl", "search-type", "file-type", "start", "img-dominant-color", "lr", "site-search", "cref", "sort", "safe", "c2coff", "googlehost", "hq", "exact-terms", "hl", "low-range", "img-size", "img-color-type", "rights", "exclude-terms", "filter", "link-site", "cx", "site-search-filter"].iter().map(|v|*v)); + v.extend(["date-restrict", "or-terms", "high-range", "num", "cr", "img-type", "related-site", "gl", "search-type", "file-type", "start", "img-dominant-color", "lr", "site-search", "sort", "safe", "c2coff", "googlehost", "hq", "exact-terms", "hl", "low-range", "img-size", "img-color-type", "rights", "exclude-terms", "filter", "link-site", "cx", "site-search-filter"].iter().map(|v|*v)); v } )); } } @@ -316,8 +313,8 @@ fn main() { let mut app = App::new("customsearch1") .author("Sebastian Thiel ") - .version("1.0.6+20160411") - .about("Lets you search over a website or collection of websites") + .version("1.0.6+20170615") + .about("Searches over a website or collection of websites") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_customsearch1_cli") .arg(Arg::with_name("folder") .long("config-dir") diff --git a/gen/customsearch1/Cargo.toml b/gen/customsearch1/Cargo.toml index ecbecc1e41..e9e8033bfb 100644 --- a/gen/customsearch1/Cargo.toml +++ b/gen/customsearch1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-customsearch1" -version = "1.0.6+20160411" +version = "1.0.6+20170615" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1" homepage = "https://developers.google.com/custom-search/v1/using_rest" -documentation = "https://docs.rs/google-customsearch1/1.0.6+20160411" +documentation = "https://docs.rs/google-customsearch1/1.0.6+20170615" license = "MIT" keywords = ["customsearch", "google", "protocol", "web", "api"] diff --git a/gen/customsearch1/README.md b/gen/customsearch1/README.md index 7b28488f08..508c4d5271 100644 --- a/gen/customsearch1/README.md +++ b/gen/customsearch1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-customsearch1` library allows access to all features of the *Google customsearch* service. -This documentation was generated from *customsearch* crate version *1.0.6+20160411*, where *20160411* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *customsearch* crate version *1.0.6+20170615*, where *20170615* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *customsearch* *v1* API can be found at the [official documentation site](https://developers.google.com/custom-search/v1/using_rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/struct.Customsearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/struct.Customsearch.html) ... * cse - * [*list*](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/struct.CseListCall.html) + * [*list*](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/struct.CseListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/struct.Customsearch.html)** +* **[Hub](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/struct.Customsearch.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.Part.html)** + * **[Parts](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -122,9 +122,8 @@ let result = hub.cse().list("q") .exact_terms("ipsum") .date_restrict("Lorem") .cx("et") - .cref("duo") - .cr("aliquyam") - .c2coff("sea") + .cr("duo") + .c2coff("aliquyam") .doit(); match result { @@ -147,17 +146,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/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")`. @@ -167,29 +166,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/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](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/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](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/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](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/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](https://docs.rs/google-customsearch1/1.0.6+20160411/google_customsearch1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-customsearch1/1.0.6+20170615/google_customsearch1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/customsearch1/src/lib.rs b/gen/customsearch1/src/lib.rs index 54ac782968..396f145148 100644 --- a/gen/customsearch1/src/lib.rs +++ b/gen/customsearch1/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 *customsearch* crate version *1.0.6+20160411*, where *20160411* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *customsearch* crate version *1.0.6+20170615*, where *20170615* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *customsearch* *v1* API can be found at the //! [official documentation site](https://developers.google.com/custom-search/v1/using_rest). @@ -95,36 +95,35 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.cse().list("q") -//! .start(26) -//! .sort("erat") -//! .site_search_filter("sadipscing") -//! .site_search("dolor") -//! .search_type("eirmod") -//! .safe("elitr") -//! .rights("amet") -//! .related_site("no") -//! .or_terms("labore") -//! .num(62) -//! .lr("dolore") -//! .low_range("invidunt") -//! .link_site("aliquyam") -//! .img_type("accusam") -//! .img_size("Lorem") -//! .img_dominant_color("sea") -//! .img_color_type("et") -//! .hq("duo") -//! .hl("et") -//! .high_range("eirmod") -//! .googlehost("sanctus") -//! .gl("et") -//! .filter("amet") -//! .file_type("et") -//! .exclude_terms("consetetur") -//! .exact_terms("ut") -//! .date_restrict("ea") -//! .cx("sed") -//! .cref("dolor") -//! .cr("dolor") +//! .start(46) +//! .sort("eos") +//! .site_search_filter("erat") +//! .site_search("sadipscing") +//! .search_type("dolor") +//! .safe("eirmod") +//! .rights("elitr") +//! .related_site("amet") +//! .or_terms("no") +//! .num(65) +//! .lr("eirmod") +//! .low_range("dolore") +//! .link_site("invidunt") +//! .img_type("aliquyam") +//! .img_size("accusam") +//! .img_dominant_color("Lorem") +//! .img_color_type("sea") +//! .hq("et") +//! .hl("duo") +//! .high_range("et") +//! .googlehost("eirmod") +//! .gl("sanctus") +//! .filter("et") +//! .file_type("amet") +//! .exclude_terms("et") +//! .exact_terms("consetetur") +//! .date_restrict("ut") +//! .cx("ea") +//! .cr("sed") //! .c2coff("dolor") //! .doit(); //! @@ -283,37 +282,36 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.cse().list("q") -/// .start(5) -/// .sort("amet.") -/// .site_search_filter("voluptua.") -/// .site_search("Lorem") -/// .search_type("gubergren") -/// .safe("justo") -/// .rights("sit") -/// .related_site("vero") -/// .or_terms("diam") -/// .num(35) -/// .lr("consetetur") -/// .low_range("sadipscing") -/// .link_site("vero") +/// .start(53) +/// .sort("et") +/// .site_search_filter("consetetur") +/// .site_search("amet.") +/// .search_type("voluptua.") +/// .safe("Lorem") +/// .rights("gubergren") +/// .related_site("justo") +/// .or_terms("sit") +/// .num(75) +/// .lr("diam") +/// .low_range("rebum.") +/// .link_site("consetetur") /// .img_type("sadipscing") -/// .img_size("invidunt") -/// .img_dominant_color("consetetur") -/// .img_color_type("dolore") -/// .hq("duo") -/// .hl("aliquyam") -/// .high_range("Lorem") -/// .googlehost("et") -/// .gl("clita") -/// .filter("consetetur") -/// .file_type("takimata") -/// .exclude_terms("nonumy") -/// .exact_terms("kasd") -/// .date_restrict("sanctus") -/// .cx("takimata") -/// .cref("At") -/// .cr("labore") -/// .c2coff("invidunt") +/// .img_size("vero") +/// .img_dominant_color("sadipscing") +/// .img_color_type("invidunt") +/// .hq("consetetur") +/// .hl("dolore") +/// .high_range("duo") +/// .googlehost("aliquyam") +/// .gl("Lorem") +/// .filter("et") +/// .file_type("clita") +/// .exclude_terms("consetetur") +/// .exact_terms("takimata") +/// .date_restrict("nonumy") +/// .cx("kasd") +/// .cr("sanctus") +/// .c2coff("takimata") /// .doit(); /// /// match result { @@ -663,8 +661,6 @@ pub struct Query { #[serde(rename="siteSearch")] pub site_search: Option, /// no description provided - pub cref: Option, - /// no description provided pub sort: Option, /// no description provided pub hq: Option, @@ -870,7 +866,6 @@ impl<'a, C, A> CseMethods<'a, C, A> { _exact_terms: Default::default(), _date_restrict: Default::default(), _cx: Default::default(), - _cref: Default::default(), _cr: Default::default(), _c2coff: Default::default(), _delegate: Default::default(), @@ -915,37 +910,36 @@ impl<'a, C, A> CseMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.cse().list("q") -/// .start(6) -/// .sort("rebum.") -/// .site_search_filter("dolore") -/// .site_search("nonumy") -/// .search_type("sed") -/// .safe("aliquyam") -/// .rights("sit") -/// .related_site("eirmod") -/// .or_terms("consetetur") -/// .num(16) -/// .lr("sed") -/// .low_range("ea") -/// .link_site("gubergren") -/// .img_type("aliquyam") -/// .img_size("eos") -/// .img_dominant_color("tempor") -/// .img_color_type("sea") -/// .hq("labore") -/// .hl("ipsum") -/// .high_range("aliquyam") -/// .googlehost("dolores") -/// .gl("sit") -/// .filter("diam") -/// .file_type("ut") -/// .exclude_terms("justo") -/// .exact_terms("est") -/// .date_restrict("amet") -/// .cx("accusam") -/// .cref("clita") -/// .cr("diam") -/// .c2coff("justo") +/// .start(15) +/// .sort("invidunt") +/// .site_search_filter("ea") +/// .site_search("sadipscing") +/// .search_type("rebum.") +/// .safe("dolore") +/// .rights("nonumy") +/// .related_site("sed") +/// .or_terms("aliquyam") +/// .num(48) +/// .lr("eirmod") +/// .low_range("consetetur") +/// .link_site("labore") +/// .img_type("sed") +/// .img_size("ea") +/// .img_dominant_color("gubergren") +/// .img_color_type("aliquyam") +/// .hq("eos") +/// .hl("tempor") +/// .high_range("sea") +/// .googlehost("labore") +/// .gl("ipsum") +/// .filter("aliquyam") +/// .file_type("dolores") +/// .exclude_terms("sit") +/// .exact_terms("diam") +/// .date_restrict("ut") +/// .cx("justo") +/// .cr("est") +/// .c2coff("amet") /// .doit(); /// # } /// ``` @@ -982,7 +976,6 @@ pub struct CseListCall<'a, C, A> _exact_terms: Option, _date_restrict: Option, _cx: Option, - _cref: Option, _cr: Option, _c2coff: Option, _delegate: Option<&'a mut Delegate>, @@ -1005,7 +998,7 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth }; dlg.begin(MethodInfo { id: "search.cse.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((34 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((33 + self._additional_params.len())); params.push(("q", self._q.to_string())); if let Some(value) = self._start { params.push(("start", value.to_string())); @@ -1091,16 +1084,13 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth if let Some(value) = self._cx { params.push(("cx", value.to_string())); } - if let Some(value) = self._cref { - params.push(("cref", value.to_string())); - } if let Some(value) = self._cr { params.push(("cr", value.to_string())); } if let Some(value) = self._c2coff { params.push(("c2coff", value.to_string())); } - for &field in ["alt", "q", "start", "sort", "siteSearchFilter", "siteSearch", "searchType", "safe", "rights", "relatedSite", "orTerms", "num", "lr", "lowRange", "linkSite", "imgType", "imgSize", "imgDominantColor", "imgColorType", "hq", "hl", "highRange", "googlehost", "gl", "filter", "fileType", "excludeTerms", "exactTerms", "dateRestrict", "cx", "cref", "cr", "c2coff"].iter() { + for &field in ["alt", "q", "start", "sort", "siteSearchFilter", "siteSearch", "searchType", "safe", "rights", "relatedSite", "orTerms", "num", "lr", "lowRange", "linkSite", "imgType", "imgSize", "imgDominantColor", "imgColorType", "hq", "hl", "highRange", "googlehost", "gl", "filter", "fileType", "excludeTerms", "exactTerms", "dateRestrict", "cx", "cr", "c2coff"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1395,13 +1385,6 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth self._cx = Some(new_value.to_string()); self } - /// The URL of a linked custom search engine - /// - /// Sets the *cref* query property to the given value. - pub fn cref(mut self, new_value: &str) -> CseListCall<'a, C, A> { - self._cref = Some(new_value.to_string()); - self - } /// Country restrict(s). /// /// Sets the *cr* query property to the given value. diff --git a/gen/dataproc1-cli/Cargo.toml b/gen/dataproc1-cli/Cargo.toml index 23e58fd4c6..8b3c9c8c69 100644 --- a/gen/dataproc1-cli/Cargo.toml +++ b/gen/dataproc1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dataproc1-cli" -version = "1.0.6+20170515" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with dataproc (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dataproc1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-dataproc1] path = "../dataproc1" -version = "1.0.6+20170515" +version = "1.0.6+20170919" diff --git a/gen/dataproc1-cli/README.md b/gen/dataproc1-cli/README.md index d78b81fb1a..1a997944b0 100644 --- a/gen/dataproc1-cli/README.md +++ b/gen/dataproc1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dataproc* API at revision *20170515*. The CLI is at version *1.0.6*. +This documentation was generated from the *dataproc* API at revision *20170919*. The CLI is at version *1.0.6*. ```bash dataproc1 [options] diff --git a/gen/dataproc1-cli/mkdocs.yml b/gen/dataproc1-cli/mkdocs.yml index e08061bcb8..d30fa59542 100644 --- a/gen/dataproc1-cli/mkdocs.yml +++ b/gen/dataproc1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dataproc v1.0.6+20170515 +site_name: dataproc v1.0.6+20170919 site_url: http://byron.github.io/google-apis-rs/google-dataproc1-cli site_description: A complete library to interact with dataproc (protocol v1) diff --git a/gen/dataproc1-cli/src/main.rs b/gen/dataproc1-cli/src/main.rs index eedf2d8000..c9c53149a7 100644 --- a/gen/dataproc1-cli/src/main.rs +++ b/gen/dataproc1-cli/src/main.rs @@ -93,30 +93,30 @@ impl<'n> Engine<'n> { "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.machine-type-uri" => Some(("config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.instance-names" => Some(("config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-template-name" => Some(("config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-group-manager-name" => Some(("config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.machine-type-uri" => Some(("config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.instance-names" => Some(("config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.machine-type-uri" => Some(("config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.instance-names" => Some(("config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-template-name" => Some(("config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-group-manager-name" => Some(("config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "cluster-name", "cluster-uuid", "config", "config-bucket", "detail", "disk-config", "gce-cluster-config", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "project-id", "properties", "secondary-worker-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "worker-config", "yarn-metrics", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -475,30 +475,30 @@ impl<'n> Engine<'n> { "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.machine-type-uri" => Some(("config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.instance-names" => Some(("config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-template-name" => Some(("config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-group-manager-name" => Some(("config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.machine-type-uri" => Some(("config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.instance-names" => Some(("config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.machine-type-uri" => Some(("config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.instance-names" => Some(("config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-template-name" => Some(("config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-group-manager-name" => Some(("config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "cluster-name", "cluster-uuid", "config", "config-bucket", "detail", "disk-config", "gce-cluster-config", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "project-id", "properties", "secondary-worker-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "worker-config", "yarn-metrics", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -845,8 +845,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "status.state" => Some(("status.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.state-start-time" => Some(("status.stateStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.details" => Some(("status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.substate" => Some(("status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.details" => Some(("status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spark-sql-job.query-file-uri" => Some(("sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spark-sql-job.script-variables" => Some(("sparkSqlJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "spark-sql-job.logging-config.driver-log-levels" => Some(("sparkSqlJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -988,8 +988,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "job.status.state" => Some(("job.status.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.status.state-start-time" => Some(("job.status.stateStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.status.details" => Some(("job.status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.status.substate" => Some(("job.status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.status.details" => Some(("job.status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.spark-sql-job.query-file-uri" => Some(("job.sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.spark-sql-job.script-variables" => Some(("job.sparkSqlJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.spark-sql-job.logging-config.driver-log-levels" => Some(("job.sparkSqlJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -1955,12 +1955,12 @@ fn main() { Some(false)), ]), ("regions-operations-list", - Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations."##), + Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-operations-list", vec![ (Some(r##"name"##), None, - Some(r##"The name of the operation collection."##), + Some(r##"The name of the operation's parent resource."##), Some(true), Some(false)), @@ -1982,7 +1982,7 @@ fn main() { let mut app = App::new("dataproc1") .author("Sebastian Thiel ") - .version("1.0.6+20170515") + .version("1.0.6+20170919") .about("Manages Hadoop-based clusters and jobs on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dataproc1_cli") .arg(Arg::with_name("url") diff --git a/gen/dataproc1/Cargo.toml b/gen/dataproc1/Cargo.toml index c66e76bca0..cd63dbebfd 100644 --- a/gen/dataproc1/Cargo.toml +++ b/gen/dataproc1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dataproc1" -version = "1.0.6+20170515" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with dataproc (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dataproc1" homepage = "https://cloud.google.com/dataproc/" -documentation = "https://docs.rs/google-dataproc1/1.0.6+20170515" +documentation = "https://docs.rs/google-dataproc1/1.0.6+20170919" license = "MIT" keywords = ["dataproc", "google", "protocol", "web", "api"] diff --git a/gen/dataproc1/README.md b/gen/dataproc1/README.md index 4feb8a525f..d44daccb9c 100644 --- a/gen/dataproc1/README.md +++ b/gen/dataproc1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-dataproc1` library allows access to all features of the *Google dataproc* service. -This documentation was generated from *dataproc* crate version *1.0.6+20170515*, where *20170515* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *dataproc* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *dataproc* *v1* API can be found at the [official documentation site](https://cloud.google.com/dataproc/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.Dataproc.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.Dataproc.html) ... * projects - * [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs patch*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionJobPatchCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.ProjectRegionOperationListCall.html) + * [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs patch*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionJobPatchCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.ProjectRegionOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/struct.Dataproc.html)** +* **[Hub](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/struct.Dataproc.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/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")`. @@ -147,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/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](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/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](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/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](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/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](https://docs.rs/google-dataproc1/1.0.6+20170515/google_dataproc1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dataproc1/src/lib.rs b/gen/dataproc1/src/lib.rs index 774cefcb0e..9f41e58421 100644 --- a/gen/dataproc1/src/lib.rs +++ b/gen/dataproc1/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 *dataproc* crate version *1.0.6+20170515*, where *20170515* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *dataproc* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *dataproc* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/dataproc/). @@ -419,26 +419,29 @@ pub struct InstanceGroupConfig { /// Optional. Specifies that this instance group contains preemptible instances. #[serde(rename="isPreemptible")] pub is_preemptible: Option, - /// Required. The Google Compute Engine machine type used for cluster instances. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2. + /// Optional. The Google Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples: + /// https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + /// projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + /// n1-standard-2 #[serde(rename="machineTypeUri")] pub machine_type_uri: Option, /// Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user (recommended practice is to let Cloud Dataproc derive the name). #[serde(rename="instanceNames")] pub instance_names: Option>, - /// Optional. Disk option config settings. - #[serde(rename="diskConfig")] - pub disk_config: Option, - /// Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release. - pub accelerators: Option>, - /// Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. - #[serde(rename="managedGroupConfig")] - pub managed_group_config: Option, - /// Required. The number of VM instances in the instance group. For master instance groups, must be set to 1. - #[serde(rename="numInstances")] - pub num_instances: Option, /// Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version. #[serde(rename="imageUri")] pub image_uri: Option, + /// Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. + #[serde(rename="managedGroupConfig")] + pub managed_group_config: Option, + /// Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release. + pub accelerators: Option>, + /// Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1. + #[serde(rename="numInstances")] + pub num_instances: Option, + /// Optional. Disk option config settings. + #[serde(rename="diskConfig")] + pub disk_config: Option, } impl Part for InstanceGroupConfig {} @@ -502,25 +505,28 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. pub details: Option>>, } impl Part for Status {} -/// The runtime logging config of the job. +/// Encapsulates the full scoping used to reference a job. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LoggingConfig { - /// The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' - #[serde(rename="driverLogLevels")] - pub driver_log_levels: Option>, +pub struct JobReference { + /// Required. The ID of the Google Cloud Platform project that the job belongs to. + #[serde(rename="projectId")] + pub project_id: Option, + /// Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters. + #[serde(rename="jobId")] + pub job_id: Option, } -impl Part for LoggingConfig {} +impl Part for JobReference {} /// Common config settings for resources of Google Compute Engine cluster instances, applicable to all instances in the cluster. @@ -532,7 +538,10 @@ pub struct GceClusterConfig { /// Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses. #[serde(rename="internalIpOnly")] pub internal_ip_only: Option, - /// Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see Using Subnetworks for more information). Example: https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default. + /// Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see Using Subnetworks for more information).A full URL, partial URI, or short name are valid. Examples: + /// https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default + /// projects/[project_id]/regions/global/default + /// default #[serde(rename="networkUri")] pub network_uri: Option, /// The Google Compute Engine tags to add to all instances (see Tagging instances). @@ -542,10 +551,16 @@ pub struct GceClusterConfig { /// roles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: [account_id]@[project_id].iam.gserviceaccount.com #[serde(rename="serviceAccount")] pub service_account: Option, - /// Required. The zone where the Google Compute Engine cluster will be located. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]. + /// Optional. The zone where the Google Compute Engine cluster will be located. On a create request, it is required in the "global" region. If omitted in a non-global Cloud Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be present.A full URL, partial URI, or short name are valid. Examples: + /// https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] + /// projects/[project_id]/zones/[zone] + /// us-central1-f #[serde(rename="zoneUri")] pub zone_uri: Option, - /// Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0. + /// Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri.A full URL, partial URI, or short name are valid. Examples: + /// https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 + /// projects/[project_id]/regions/us-east1/sub0 + /// sub0 #[serde(rename="subnetworkUri")] pub subnetwork_uri: Option, /// Optional. The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included: @@ -574,7 +589,7 @@ pub struct AcceleratorConfig { /// The number of the accelerator cards of this type exposed to this instance. #[serde(rename="acceleratorCount")] pub accelerator_count: Option, - /// Full or partial URI of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( /compute/docs/reference/beta/acceleratorTypes) + /// Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( /compute/docs/reference/beta/acceleratorTypes)Examples * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80 #[serde(rename="acceleratorTypeUri")] pub accelerator_type_uri: Option, } @@ -713,6 +728,9 @@ pub struct Job { /// Output-only. A URI pointing to the location of the stdout of the job's driver program. #[serde(rename="driverOutputResourceUri")] pub driver_output_resource_uri: Option, + /// Job is a Pyspark job. + #[serde(rename="pysparkJob")] + pub pyspark_job: Option, /// Output-only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files may be placed in the same location as driver_output_uri. #[serde(rename="driverControlFilesUri")] pub driver_control_files_uri: Option, @@ -727,9 +745,6 @@ pub struct Job { /// Output-only. The previous job status. #[serde(rename="statusHistory")] pub status_history: Option>, - /// Job is a Pyspark job. - #[serde(rename="pysparkJob")] - pub pyspark_job: Option, /// Job is a Hive job. #[serde(rename="hiveJob")] pub hive_job: Option, @@ -874,10 +889,10 @@ pub struct JobStatus { /// Output-only. The time when this state was entered. #[serde(rename="stateStartTime")] pub state_start_time: Option, - /// Output-only. Optional job state details, such as an error description if the state is ERROR. - pub details: Option, /// Output-only. Additional state information, which includes status reported by the agent. pub substate: Option, + /// Output-only. Optional job state details, such as an error description if the state is ERROR. + pub details: Option, } impl Part for JobStatus {} @@ -900,21 +915,18 @@ pub struct JobPlacement { impl Part for JobPlacement {} -/// Encapsulates the full scoping used to reference a job. +/// The runtime logging config of the job. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobReference { - /// Required. The ID of the Google Cloud Platform project that the job belongs to. - #[serde(rename="projectId")] - pub project_id: Option, - /// Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters. - #[serde(rename="jobId")] - pub job_id: Option, +pub struct LoggingConfig { + /// The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' + #[serde(rename="driverLogLevels")] + pub driver_log_levels: Option>, } -impl Part for JobReference {} +impl Part for LoggingConfig {} /// Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release. @@ -1013,7 +1025,7 @@ pub struct SoftwareConfig { /// mapred: mapred-site.xml /// pig: pig.properties /// spark: spark-defaults.conf - /// yarn: yarn-site.xml + /// yarn: yarn-site.xmlFor more information, see Cluster properties. pub properties: Option>, } @@ -1031,11 +1043,11 @@ impl Part for SoftwareConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListOperationsResponse { - /// A list of operations that matches the specified filter in the request. - pub operations: Option>, /// The standard List next-page token. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, } impl ResponseResult for ListOperationsResponse {} @@ -1525,11 +1537,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations. + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. /// /// # Arguments /// - /// * `name` - The name of the operation collection. + /// * `name` - The name of the operation's parent resource. pub fn regions_operations_list(&self, name: &str) -> ProjectRegionOperationListCall<'a, C, A> { ProjectRegionOperationListCall { hub: self.hub, @@ -1832,12 +1844,12 @@ impl<'a, C, A> ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionClusterGetCall<'a, C, A> @@ -2129,12 +2141,12 @@ impl<'a, C, A> ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionClusterListCall<'a, C, A> @@ -2450,12 +2462,12 @@ impl<'a, C, A> ProjectRegionJobListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionJobListCall<'a, C, A> @@ -2782,12 +2794,12 @@ impl<'a, C, A> ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionClusterPatchCall<'a, C, A> @@ -3055,12 +3067,12 @@ impl<'a, C, A> ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionJobGetCall<'a, C, A> @@ -3308,12 +3320,12 @@ impl<'a, C, A> ProjectRegionOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionOperationCancelCall<'a, C, A> @@ -3561,12 +3573,12 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionOperationGetCall<'a, C, A> @@ -3834,12 +3846,12 @@ impl<'a, C, A> ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionClusterDeleteCall<'a, C, A> @@ -4138,12 +4150,12 @@ impl<'a, C, A> ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionClusterDiagnoseCall<'a, C, A> @@ -4430,12 +4442,12 @@ impl<'a, C, A> ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionJobSubmitCall<'a, C, A> @@ -4722,12 +4734,12 @@ impl<'a, C, A> ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionClusterCreateCall<'a, C, A> @@ -4995,12 +5007,12 @@ impl<'a, C, A> ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionJobDeleteCall<'a, C, A> @@ -5248,12 +5260,12 @@ impl<'a, C, A> ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionOperationDeleteCall<'a, C, A> @@ -5288,7 +5300,7 @@ impl<'a, C, A> ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionOperationListCall<'a, C, A> @@ -5853,12 +5865,12 @@ impl<'a, C, A> ProjectRegionJobPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionJobPatchCall<'a, C, A> @@ -6157,12 +6169,12 @@ impl<'a, C, A> ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionJobCancelCall<'a, C, A> diff --git a/gen/deploymentmanager2-cli/Cargo.toml b/gen/deploymentmanager2-cli/Cargo.toml index ee7cb4152c..ee2aaff765 100644 --- a/gen/deploymentmanager2-cli/Cargo.toml +++ b/gen/deploymentmanager2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-deploymentmanager2-cli" -version = "1.0.6+20170501" +version = "1.0.6+20170925" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-deploymentmanager2] path = "../deploymentmanager2" -version = "1.0.6+20170501" +version = "1.0.6+20170925" diff --git a/gen/deploymentmanager2-cli/README.md b/gen/deploymentmanager2-cli/README.md index 8cf8ec8d62..7f2ce8a0e4 100644 --- a/gen/deploymentmanager2-cli/README.md +++ b/gen/deploymentmanager2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Deployment Manager* API at revision *20170501*. The CLI is at version *1.0.6*. +This documentation was generated from the *Deployment Manager* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash deploymentmanager2 [options] diff --git a/gen/deploymentmanager2-cli/mkdocs.yml b/gen/deploymentmanager2-cli/mkdocs.yml index f1d7e1687a..b17a0cb02c 100644 --- a/gen/deploymentmanager2-cli/mkdocs.yml +++ b/gen/deploymentmanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Deployment Manager v1.0.6+20170501 +site_name: Deployment Manager v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-deploymentmanager2-cli site_description: A complete library to interact with Deployment Manager (protocol v2) diff --git a/gen/deploymentmanager2-cli/src/main.rs b/gen/deploymentmanager2-cli/src/main.rs index a0a7a4d7ce..67432e798d 100644 --- a/gen/deploymentmanager2-cli/src/main.rs +++ b/gen/deploymentmanager2-cli/src/main.rs @@ -2132,7 +2132,7 @@ fn main() { let mut app = App::new("deploymentmanager2") .author("Sebastian Thiel ") - .version("1.0.6+20170501") + .version("1.0.6+20170925") .about("Declares, configures, and deploys complex solutions on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_deploymentmanager2_cli") .arg(Arg::with_name("url") diff --git a/gen/deploymentmanager2/Cargo.toml b/gen/deploymentmanager2/Cargo.toml index c173bd7771..f4a2e927f6 100644 --- a/gen/deploymentmanager2/Cargo.toml +++ b/gen/deploymentmanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-deploymentmanager2" -version = "1.0.6+20170501" +version = "1.0.6+20170925" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2" homepage = "https://cloud.google.com/deployment-manager/" -documentation = "https://docs.rs/google-deploymentmanager2/1.0.6+20170501" +documentation = "https://docs.rs/google-deploymentmanager2/1.0.6+20170925" license = "MIT" keywords = ["deploymentmanager", "google", "protocol", "web", "api"] diff --git a/gen/deploymentmanager2/README.md b/gen/deploymentmanager2/README.md index a9282ae5f6..7246adc09f 100644 --- a/gen/deploymentmanager2/README.md +++ b/gen/deploymentmanager2/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-deploymentmanager2` library allows access to all features of the *Google Deployment Manager* service. -This documentation was generated from *Deployment Manager* crate version *1.0.6+20170501*, where *20170501* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Deployment Manager* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Deployment Manager* *v2* API can be found at the [official documentation site](https://cloud.google.com/deployment-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentManager.html) ... -* [deployments](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.Deployment.html) - * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentUpdateCall.html) -* [manifests](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.Manifest.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.ManifestListCall.html) -* [operations](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.Operation.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.OperationListCall.html) -* [resources](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.ResourceType.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.ResourceListCall.html) -* [types](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.Type.html) - * [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.TypeListCall.html) +* [deployments](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.Deployment.html) + * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentUpdateCall.html) +* [manifests](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.Manifest.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.ManifestListCall.html) +* [operations](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.Operation.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.OperationListCall.html) +* [resources](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.ResourceType.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.ResourceListCall.html) +* [types](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.Type.html) + * [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.TypeListCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/struct.DeploymentManager.html)** +* **[Hub](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/struct.DeploymentManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.Part.html)** + * **[Parts](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -143,17 +143,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/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")`. @@ -163,29 +163,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/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](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/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](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/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](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/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](https://docs.rs/google-deploymentmanager2/1.0.6+20170501/google_deploymentmanager2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/deploymentmanager2/src/lib.rs b/gen/deploymentmanager2/src/lib.rs index 5383b66667..5b16e902bb 100644 --- a/gen/deploymentmanager2/src/lib.rs +++ b/gen/deploymentmanager2/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 *Deployment Manager* crate version *1.0.6+20170501*, where *20170501* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Deployment Manager* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Deployment Manager* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/deployment-manager/). @@ -410,6 +410,462 @@ impl<'a, C, A> DeploymentManager // ############ // SCHEMAS ### // ########## +/// Authorization-related information used by Cloud Audit Logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthorizationLoggingOptions { + /// The type of the permission that was checked. + #[serde(rename="permissionType")] + pub permission_type: Option, +} + +impl Part for AuthorizationLoggingOptions {} + + +/// 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 LogConfigCloudAuditOptions { + /// The log_name to populate in the Cloud Audit Record. + #[serde(rename="logName")] + pub log_name: Option, + /// Information used by the Cloud Audit Logging pipeline. + #[serde(rename="authorizationLoggingOptions")] + pub authorization_logging_options: Option, +} + +impl Part for LogConfigCloudAuditOptions {} + + +/// +/// +/// # 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*). +/// +/// * [stop deployments](struct.DeploymentStopCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeploymentsStopRequest { + /// Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to stop an ongoing update request, this would prevent a collision). + /// + /// The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment. + pub fingerprint: Option, +} + +impl RequestValue for DeploymentsStopRequest {} + + +/// +/// +/// # 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 preview deployments](struct.DeploymentCancelPreviewCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeploymentsCancelPreviewRequest { + /// Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to cancel a preview, this would prevent one of the requests). + /// + /// The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment. + pub fingerprint: Option, +} + +impl RequestValue for DeploymentsCancelPreviewRequest {} + + +/// Output only. If warning messages are generated during processing of this resource, 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 ResourceWarnings { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ResourceWarnings {} +impl Part for ResourceWarnings {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceUpdateWarningsData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ResourceUpdateWarningsData {} +impl Part for ResourceUpdateWarningsData {} + + +/// +/// +/// 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. Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)? + pub labels: Option>, + /// Output only. An optional user-provided description of the deployment after the current update has been applied. + pub description: 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 ResourceUpdate { + /// The Access Control Policy to set on this resource after updating the resource itself. + #[serde(rename="accessControl")] + pub access_control: Option, + /// 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. If warning messages are generated during processing of this resource, this field will be populated. + pub warnings: Option>, + /// Output only. URL of the manifest representing the update configuration of this resource. + pub manifest: Option, + /// Output only. The state of the resource. + pub state: Option, + /// Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. + pub intent: Option, + /// Output only. If errors are generated during update of the resource, this field will be populated. + pub error: Option, + /// Output only. The set of updated properties for this resource, before references are expanded. Returned as serialized YAML. + pub properties: Option, +} + +impl Part for ResourceUpdate {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. +/// +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. +/// +/// **Example** +/// +/// { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } +/// +/// For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # 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 iam policy deployments](struct.DeploymentGetIamPolicyCall.html) (response) +/// * [set iam policy deployments](struct.DeploymentSetIamPolicyCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. + pub etag: Option, + /// If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied. + pub rules: Option>, + /// Associates a list of `members` to a `role`. `bindings` with no members will result in an error. + pub bindings: Option>, + /// + #[serde(rename="iamOwned")] + pub iam_owned: Option, +} + +impl RequestValue for Policy {} +impl ResponseResult for Policy {} + + +/// 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 {} + + +/// 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 { + /// Output only. The Operation that most recently ran, or is currently running, on this type. + pub operation: Option, + /// Output only. Timestamp when the type was created, in RFC3339 text format. + #[serde(rename="insertTime")] + pub insert_time: Option, + /// Output only. Unique identifier for the resource; defined by the server. + pub id: Option, + /// Output only. Self link for the type. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the type. + pub name: Option, +} + +impl Resource for 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 ImportFile { + /// The contents of the file. + pub content: Option, + /// The name of the file. + pub name: Option, +} + +impl Part for ImportFile {} + + +/// 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*). +/// +/// * [test iam permissions deployments](struct.DeploymentTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestPermissionsRequest { + /// 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 TestPermissionsRequest {} + + +/// 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 DeploymentLabelEntry { + /// no description provided + pub key: Option, + /// no description provided + pub value: Option, +} + +impl Part for DeploymentLabelEntry {} + + +/// 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 LogConfigDataAccessOptions { + /// Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. + #[serde(rename="logMode")] + pub log_mode: Option, +} + +impl Part for LogConfigDataAccessOptions {} + + +/// [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 {} + + +/// 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) +/// * [test iam permissions deployments](struct.DeploymentTestIamPermissionCall.html) (none) +/// * [cancel preview deployments](struct.DeploymentCancelPreviewCall.html) (none) +/// * [list deployments](struct.DeploymentListCall.html) (none) +/// * [patch deployments](struct.DeploymentPatchCall.html) (request) +/// * [stop deployments](struct.DeploymentStopCall.html) (none) +/// * [get iam policy deployments](struct.DeploymentGetIamPolicyCall.html) (none) +/// * [set iam policy deployments](struct.DeploymentSetIamPolicyCall.html) (none) +/// * [delete deployments](struct.DeploymentDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Deployment { + /// An optional user-provided description of the deployment. + pub description: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)? + pub labels: 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. Timestamp when the deployment was created, in RFC3339 text format . + #[serde(rename="insertTime")] + pub insert_time: Option, + /// Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens 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. The Operation that most recently ran, or is currently running, on this deployment. + pub operation: Option, + /// Output only. Unique identifier for the resource; defined by the server. + pub id: Option, + /// Output only. Self link for the deployment. + #[serde(rename="selfLink")] + pub self_link: 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 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 {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceWarningsData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ResourceWarningsData {} +impl Part for ResourceWarningsData {} + + /// Provides the configuration for logging a type of permissions. Example: /// /// { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } @@ -431,25 +887,6 @@ pub struct AuditLogConfig { impl Part for AuditLogConfig {} -/// [Output Only] If warning messages are generated during processing of this resource, 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 ResourceWarnings { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ResourceWarnings {} -impl Part for ResourceWarnings {} - - /// /// /// # Activities @@ -465,31 +902,31 @@ pub struct ResourceType { /// The Access Control Policy set on this resource. #[serde(rename="accessControl")] pub access_control: Option, - /// [Output Only] The evaluated properties of the resource with references expanded. Returned as serialized YAML. + /// 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 . + /// 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. + /// Output only. The name of the resource as it appears in the YAML config. pub name: Option, - /// [Output Only] If warning messages are generated during processing of this resource, this field will be populated. + /// Output only. If warning messages are generated during processing of this resource, this field will be populated. pub warnings: Option>, - /// [Output Only] The URL of the actual resource. + /// 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. + /// 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. + /// Output only. URL of the manifest representing the current configuration of this resource. pub manifest: Option, - /// [Output Only] Timestamp when the resource was created or acquired, in RFC3339 text format . + /// Output only. Timestamp when the resource was created or acquired, in RFC3339 text format . #[serde(rename="insertTime")] pub insert_time: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. + /// Output only. Unique identifier for the resource; defined by the server. pub id: Option, - /// [Output Only] The type of the resource, for example compute.v1.instance, or cloudfunctions.v1beta1.function. + /// Output only. The type of the resource, for example compute.v1.instance, or cloudfunctions.v1beta1.function. #[serde(rename="type")] pub type_: Option, - /// [Output Only] The current properties of the resource before any references have been filled in. Returned as serialized YAML. + /// Output only. The current properties of the resource before any references have been filled in. Returned as serialized YAML. pub properties: Option, } @@ -579,61 +1016,27 @@ impl Resource for Operation {} impl ResponseResult for Operation {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// Represents an expression text. Example: +/// +/// title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourceUpdateWarningsData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ResourceUpdateWarningsData {} -impl Part for ResourceUpdateWarningsData {} - - -/// -/// -/// # 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*). -/// -/// * [stop deployments](struct.DeploymentStopCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeploymentsStopRequest { - /// Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to stop an ongoing update request, this would prevent a collision). +pub struct Expr { + /// An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language syntax. /// - /// The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment. - pub fingerprint: Option, + /// The application context of the containing message determines which well-known feature set of CEL is supported. + pub expression: Option, + /// An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + pub location: Option, + /// An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + pub title: Option, } -impl RequestValue for DeploymentsStopRequest {} - - -/// -/// -/// # 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 preview deployments](struct.DeploymentCancelPreviewCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeploymentsCancelPreviewRequest { - /// Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to cancel a preview, this would prevent one of the requests). - /// - /// The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request on the deployment. - pub fingerprint: Option, -} - -impl RequestValue for DeploymentsCancelPreviewRequest {} +impl Part for Expr {} /// A response containing a partial list of resources and a page token used to build the next request if the request has been truncated. @@ -674,7 +1077,7 @@ pub struct Rule { pub permissions: Option>, /// If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. pub ins: Option>, - /// Additional restrictions that must be met + /// Additional restrictions that must be met. All conditions must pass for the rule to match. pub conditions: Option>, /// The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. #[serde(rename="logConfigs")] @@ -696,23 +1099,25 @@ impl Part for Rule {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Manifest { - /// [Output Only] The YAML layout for this manifest. + /// Output only. The YAML layout for this manifest. pub layout: Option, - /// [Output Only] The name of the manifest. + /// Output only. + /// + /// The name of the manifest. pub name: Option, - /// [Output Only] The fully-expanded configuration file, including any templates and references. + /// Output only. The fully-expanded configuration file, including any templates and references. #[serde(rename="expandedConfig")] pub expanded_config: Option, - /// [Output Only] The imported files for this manifest. + /// Output only. The imported files for this manifest. pub imports: Option>, - /// [Output Only] Timestamp when the manifest was created, in RFC3339 text format. + /// 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. + /// Output only. The YAML configuration for this manifest. pub config: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. + /// Output only. Unique identifier for the resource; defined by the server. pub id: Option, - /// [Output Only] Self link for the manifest. + /// Output only. Self link for the manifest. #[serde(rename="selfLink")] pub self_link: Option, } @@ -726,37 +1131,12 @@ impl ResponseResult for Manifest {} /// 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] Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)? - pub labels: Option>, - /// [Output Only] An optional user-provided description of the deployment after the current update has been applied. - pub description: Option, - /// [Output Only] URL of the manifest representing the update configuration of this deployment. - pub manifest: Option, +pub struct ConfigFile { + /// The contents of the file. + pub content: 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 {} +impl Part for ConfigFile {} /// @@ -792,98 +1172,51 @@ impl NestedType for OperationErrorErrors {} impl Part for OperationErrorErrors {} -/// +/// 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 ResourceUpdate { - /// The Access Control Policy to set on this resource after updating the resource itself. - #[serde(rename="accessControl")] - pub access_control: Option, - /// [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] If warning messages are generated during processing of this resource, this field will be populated. - pub warnings: Option>, - /// [Output Only] URL of the manifest representing the update configuration of this resource. - pub manifest: Option, - /// [Output Only] The state of the resource. - pub state: Option, - /// [Output Only] The intent of the resource: PREVIEW, UPDATE, or CANCEL. - pub intent: Option, - /// [Output Only] If errors are generated during update of the resource, this field will be populated. - pub error: Option, - /// [Output Only] The set of updated properties for this resource, before references are expanded. Returned as serialized YAML. - pub properties: Option, +pub struct DeploymentUpdateLabelEntry { + /// no description provided + pub key: Option, + /// no description provided + pub value: Option, } -impl Part for ResourceUpdate {} +impl Part for DeploymentUpdateLabelEntry {} -/// Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. +/// [Output Only] The array of errors encountered while processing this operation. /// -/// -/// -/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. -/// -/// **Example** -/// -/// { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } -/// -/// For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam). -/// -/// # 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 iam policy deployments](struct.DeploymentGetIamPolicyCall.html) (response) -/// * [set iam policy deployments](struct.DeploymentSetIamPolicyCall.html) (request|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 Policy { - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, - /// Version of the `Policy`. The default version is 0. - pub version: Option, - /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. - pub etag: Option, - /// If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied. - pub rules: Option>, - /// Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error. - pub bindings: Option>, - /// - #[serde(rename="iamOwned")] - pub iam_owned: Option, +pub struct ResourceUpdateErrorErrors { + /// [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 that caused the error. This property is optional. + pub location: Option, } -impl RequestValue for Policy {} -impl ResponseResult for Policy {} +impl NestedType for ResourceUpdateErrorErrors {} +impl Part for ResourceUpdateErrorErrors {} -/// A response containing a partial list of operations and a page token used to build the next request if the request has been truncated. +/// The access controls set on the resource. /// -/// # 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) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[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>, +pub struct ResourceAccessControl { + /// The GCP IAM Policy to set on the resource. + #[serde(rename="gcpIamPolicy")] + pub gcp_iam_policy: Option, } -impl ResponseResult for OperationsListResponse {} +impl Part for ResourceAccessControl {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -903,127 +1236,7 @@ impl NestedType for OperationWarningsData {} impl Part for OperationWarningsData {} -/// 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 { - /// [Output Only] The Operation that most recently ran, or is currently running, on this type. - pub operation: Option, - /// [Output Only] Timestamp when the type was created, in RFC3339 text format. - #[serde(rename="insertTime")] - pub insert_time: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Self link for the type. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the type. - pub name: Option, -} - -impl Resource for Type {} - - -/// 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 DeploymentUpdateLabelEntry { - /// no description provided - pub key: Option, - /// no description provided - pub value: Option, -} - -impl Part for DeploymentUpdateLabelEntry {} - - -/// 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 LogConfigCounterOptions { - /// The field value to attribute. - pub field: Option, - /// The metric to update. - pub metric: Option, -} - -impl Part for LogConfigCounterOptions {} - - -/// -/// -/// 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 {} - - -/// The access controls set on the resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourceAccessControl { - /// The GCP IAM Policy to set on the resource. - #[serde(rename="gcpIamPolicy")] - pub gcp_iam_policy: Option, -} - -impl Part for ResourceAccessControl {} - - -/// 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*). -/// -/// * [test iam permissions deployments](struct.DeploymentTestIamPermissionCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestPermissionsRequest { - /// 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 TestPermissionsRequest {} - - -/// 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 DeploymentLabelEntry { - /// no description provided - pub key: Option, - /// no description provided - pub value: Option, -} - -impl Part for DeploymentLabelEntry {} - - -/// [Output Only] If errors are generated during update of the resource, this field will be populated. +/// Output only. If errors are generated during update of the resource, this field will be populated. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1056,7 +1269,7 @@ impl NestedType for OperationWarnings {} impl Part for OperationWarnings {} -/// [Output Only] If warning messages are generated during processing of this resource, this field will be populated. +/// Output only. If warning messages are generated during processing of this resource, this field will be populated. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1083,6 +1296,8 @@ impl Part for ResourceUpdateWarnings {} pub struct Binding { /// Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. pub role: Option, + /// The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. This field is GOOGLE_INTERNAL. + pub condition: Option, /// Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: /// /// * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. @@ -1097,6 +1312,8 @@ pub struct Binding { /// /// * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. /// + /// + /// /// * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. pub members: Option>, } @@ -1104,31 +1321,29 @@ pub struct Binding { impl Part for Binding {} +/// 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 the only supported field names are - "iam_principal", corresponding to IAMContext.principal; - "" (empty string), resulting in one aggretated counter with no field. +/// +/// 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 ConfigFile { - /// The contents of the file. - pub content: Option, +pub struct LogConfigCounterOptions { + /// The field value to attribute. + pub field: Option, + /// The metric to update. + pub metric: Option, } -impl Part for ConfigFile {} - - -/// [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 {} +impl Part for LogConfigCounterOptions {} /// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. @@ -1158,151 +1373,6 @@ pub struct AuditConfig { impl Part for AuditConfig {} -/// 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 {} - - -/// 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) -/// * [test iam permissions deployments](struct.DeploymentTestIamPermissionCall.html) (none) -/// * [cancel preview deployments](struct.DeploymentCancelPreviewCall.html) (none) -/// * [list deployments](struct.DeploymentListCall.html) (none) -/// * [patch deployments](struct.DeploymentPatchCall.html) (request) -/// * [stop deployments](struct.DeploymentStopCall.html) (none) -/// * [get iam policy deployments](struct.DeploymentGetIamPolicyCall.html) (none) -/// * [set iam policy deployments](struct.DeploymentSetIamPolicyCall.html) (none) -/// * [delete deployments](struct.DeploymentDeleteCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Deployment { - /// An optional user-provided description of the deployment. - pub description: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// Map of labels; provided by the client when the resource is created or updated. Specifically: 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])?)? - pub labels: 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] Timestamp when the deployment was created, in RFC3339 text format . - #[serde(rename="insertTime")] - pub insert_time: Option, - /// Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens 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] The Operation that most recently ran, or is currently running, on this deployment. - pub operation: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Self link for the deployment. - #[serde(rename="selfLink")] - pub self_link: 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 {} - - -/// 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*). -/// -/// * [test iam permissions deployments](struct.DeploymentTestIamPermissionCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed. - pub permissions: Option>, -} - -impl ResponseResult for TestPermissionsResponse {} - - -/// [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 ResourceUpdateErrorErrors { - /// [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 that caused the error. This property is optional. - pub location: Option, -} - -impl NestedType for ResourceUpdateErrorErrors {} -impl Part for ResourceUpdateErrorErrors {} - - -/// Specifies what kind of log the caller must write -/// -/// 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, -} - -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. @@ -1326,21 +1396,41 @@ pub struct Condition { impl Part for Condition {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// 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*). +/// +/// * [test iam permissions deployments](struct.DeploymentTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + pub permissions: Option>, +} + +impl ResponseResult for TestPermissionsResponse {} + + +/// Specifies what kind of log the caller must write /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourceWarningsData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +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 NestedType for ResourceWarningsData {} -impl Part for ResourceWarningsData {} +impl Part for LogConfig {} @@ -2428,11 +2518,11 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. + /// Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. /// /// The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + /// For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. /// /// You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. /// @@ -2743,11 +2833,11 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. + /// Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. /// /// The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + /// For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. /// /// You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. /// @@ -3313,11 +3403,11 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut self._max_results = Some(new_value); self } - /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. + /// Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. /// /// The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + /// For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. /// /// You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. /// @@ -3895,11 +3985,11 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. + /// Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. /// /// The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + /// For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. /// /// You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. /// @@ -5888,11 +5978,11 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A self._max_results = Some(new_value); self } - /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. + /// Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. /// /// The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (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, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + /// For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. /// /// You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. /// diff --git a/gen/dfareporting2d7-cli/Cargo.toml b/gen/dfareporting2d7-cli/Cargo.toml index 97796ee142..d8faa94790 100644 --- a/gen/dfareporting2d7-cli/Cargo.toml +++ b/gen/dfareporting2d7-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d7-cli" -version = "1.0.6+20170428" +version = "1.0.6+20170818" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.7)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d7-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-dfareporting2d7] path = "../dfareporting2d7" -version = "1.0.6+20170428" +version = "1.0.6+20170818" diff --git a/gen/dfareporting2d7-cli/README.md b/gen/dfareporting2d7-cli/README.md index 88036f2467..d8d1440d00 100644 --- a/gen/dfareporting2d7-cli/README.md +++ b/gen/dfareporting2d7-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dfareporting* API at revision *20170428*. The CLI is at version *1.0.6*. +This documentation was generated from the *dfareporting* API at revision *20170818*. The CLI is at version *1.0.6*. ```bash dfareporting2d7 [options] diff --git a/gen/dfareporting2d7-cli/mkdocs.yml b/gen/dfareporting2d7-cli/mkdocs.yml index 39a0401e25..50e2f833e7 100644 --- a/gen/dfareporting2d7-cli/mkdocs.yml +++ b/gen/dfareporting2d7-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.6+20170428 +site_name: dfareporting v1.0.6+20170818 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d7-cli site_description: A complete library to interact with dfareporting (protocol v2.7) diff --git a/gen/dfareporting2d7-cli/src/main.rs b/gen/dfareporting2d7-cli/src/main.rs index 432415425c..ba5a4f8cc4 100644 --- a/gen/dfareporting2d7-cli/src/main.rs +++ b/gen/dfareporting2d7-cli/src/main.rs @@ -23630,7 +23630,7 @@ fn main() { let mut app = App::new("dfareporting2d7") .author("Sebastian Thiel ") - .version("1.0.6+20170428") + .version("1.0.6+20170818") .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting2d7_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting2d7/Cargo.toml b/gen/dfareporting2d7/Cargo.toml index 8fc1301661..ecbd7c70c5 100644 --- a/gen/dfareporting2d7/Cargo.toml +++ b/gen/dfareporting2d7/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting2d7" -version = "1.0.6+20170428" +version = "1.0.6+20170818" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.7)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d7" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting2d7/1.0.6+20170428" +documentation = "https://docs.rs/google-dfareporting2d7/1.0.6+20170818" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] diff --git a/gen/dfareporting2d7/README.md b/gen/dfareporting2d7/README.md index 5002b77fb0..5ca1adeb84 100644 --- a/gen/dfareporting2d7/README.md +++ b/gen/dfareporting2d7/README.md @@ -5,144 +5,144 @@ DO NOT EDIT ! --> The `google-dfareporting2d7` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.6+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *dfareporting* crate version *1.0.6+20170818*, where *20170818* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *dfareporting* *v2d7* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGroupUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ConversionBatchinsertCall.html) -* [countries](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.InventoryItemListCall.html) -* [landing pages](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPage.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LandingPageUpdateCall.html) -* [languages](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.MetroListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.UserRoleUpdateCall.html) -* [video formats](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.VideoFormat.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.VideoFormatListCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ConversionBatchinsertCall.html) +* [countries](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LandingPageUpdateCall.html) +* [languages](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.VideoFormatListCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.ReportFileGetCall.html) @@ -150,17 +150,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -257,17 +257,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/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")`. @@ -277,29 +277,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/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](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/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](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/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](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/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](https://docs.rs/google-dfareporting2d7/1.0.6+20170428/google_dfareporting2d7/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting2d7/1.0.6+20170818/google_dfareporting2d7/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dfareporting2d7/src/lib.rs b/gen/dfareporting2d7/src/lib.rs index 3afa60e5fe..46668e4051 100644 --- a/gen/dfareporting2d7/src/lib.rs +++ b/gen/dfareporting2d7/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 *dfareporting* crate version *1.0.6+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *dfareporting* crate version *1.0.6+20170818*, where *20170818* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *dfareporting* *v2d7* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -905,7 +905,7 @@ pub struct DirectorySiteSettings { /// Whether this directory site has disabled active view creatives. #[serde(rename="activeViewOptOut")] pub active_view_opt_out: Option, - /// Whether this directory site has disabled active view for in-stream video creatives. + /// Whether this directory site has disabled active view for in-stream video creatives. This is a read-only field. #[serde(rename="videoActiveViewOptOut")] pub video_active_view_opt_out: Option, /// Directory site DFP settings. @@ -1162,7 +1162,9 @@ pub struct SiteSettings { /// Configuration settings for dynamic and image floodlight tags. #[serde(rename="tagSetting")] pub tag_setting: Option, - /// Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter, and Flash VPAID creatives use the Flash adapter). + /// Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter). + /// + /// Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. #[serde(rename="vpaidAdapterChoiceTemplate")] pub vpaid_adapter_choice_template: Option, /// Site-wide creative settings. @@ -2249,6 +2251,8 @@ pub struct Placement { #[serde(rename="pricingSchedule")] pub pricing_schedule: Option, /// VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this placement. + /// + /// Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. #[serde(rename="vpaidAdapterChoice")] pub vpaid_adapter_choice: Option, } @@ -4144,7 +4148,7 @@ pub struct Creative { /// Required if dynamicAssetSelection is true. #[serde(rename="creativeAssetSelection")] pub creative_asset_selection: Option, - /// HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is false. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA. + /// HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is true. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA. #[serde(rename="htmlCode")] pub html_code: Option, /// Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types. @@ -5179,28 +5183,8 @@ pub struct FloodlightActivity { /// Floodlight activity group ID of this floodlight activity. This is a required field. #[serde(rename="floodlightActivityGroupId")] pub floodlight_activity_group_id: Option, - /// List of the user-defined variables used by this conversion tag. These map to the "u[1-20]=" in the tags. Each of these can have a user defined type. - /// Acceptable values are: - /// - "U1" - /// - "U2" - /// - "U3" - /// - "U4" - /// - "U5" - /// - "U6" - /// - "U7" - /// - "U8" - /// - "U9" - /// - "U10" - /// - "U11" - /// - "U12" - /// - "U13" - /// - "U14" - /// - "U15" - /// - "U16" - /// - "U17" - /// - "U18" - /// - "U19" - /// - "U20" + /// List of the user-defined variables used by this conversion tag. These map to the "u[1-100]=" in the tags. Each of these can have a user defined type. + /// Acceptable values are U1 to U100, inclusive. #[serde(rename="userDefinedVariableTypes")] pub user_defined_variable_types: Option>, /// Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activities of the same activity group. This field is read-only after insertion. @@ -72149,6 +72133,8 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut"] +description = "A complete library to interact with dfareporting (protocol v2.8)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8-cli" +homepage = "https://developers.google.com/doubleclick-advertisers/" +documentation = "http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli" +license = "MIT" +keywords = ["dfareporting", "google", "cli"] + +[[bin]] +name = "dfareporting2d8" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-dfareporting2d8] +path = "../dfareporting2d8" +version = "1.0.6+20170818" diff --git a/gen/dfareporting2d8-cli/LICENSE.md b/gen/dfareporting2d8-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dfareporting2d8-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/dfareporting2d8-cli/README.md b/gen/dfareporting2d8-cli/README.md new file mode 100644 index 0000000000..d64eecb398 --- /dev/null +++ b/gen/dfareporting2d8-cli/README.md @@ -0,0 +1,377 @@ + +The `dfareporting2d8` command-line interface *(CLI)* allows to use most features of the *Google dfareporting* 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 *dfareporting* API can be found at the +[official documentation site](https://developers.google.com/doubleclick-advertisers/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-dfareporting2d8-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8-cli). + +# Usage + +This documentation was generated from the *dfareporting* API at revision *20170818*. The CLI is at version *1.0.6*. + +```bash +dfareporting2d8 [options] + account-active-ad-summaries + get [-p ]... [-o ] + account-permission-groups + get [-p ]... [-o ] + list [-p ]... [-o ] + account-permissions + get [-p ]... [-o ] + list [-p ]... [-o ] + account-user-profiles + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + accounts + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + ads + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + advertiser-groups + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + advertisers + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + browsers + list [-p ]... [-o ] + campaign-creative-associations + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + campaigns + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + change-logs + get [-p ]... [-o ] + list [-p ]... [-o ] + cities + list [-p ]... [-o ] + connection-types + get [-p ]... [-o ] + list [-p ]... [-o ] + content-categories + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + conversions + batchinsert (-r )... [-p ]... [-o ] + batchupdate (-r )... [-p ]... [-o ] + countries + get [-p ]... [-o ] + list [-p ]... [-o ] + creative-assets + insert (-r )... (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] + creative-field-values + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + creative-fields + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + creative-groups + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + creatives + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + dimension-values + query (-r )... [-p ]... [-o ] + directory-site-contacts + get [-p ]... [-o ] + list [-p ]... [-o ] + directory-sites + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + dynamic-targeting-keys + delete [-p ]... + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + event-tags + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + files + get [-p ]... [-o ] + list [-p ]... [-o ] + floodlight-activities + delete [-p ]... + generatetag [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + floodlight-activity-groups + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + floodlight-configurations + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + inventory-items + get [-p ]... [-o ] + list [-p ]... [-o ] + landing-pages + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + languages + list [-p ]... [-o ] + metros + list [-p ]... [-o ] + mobile-carriers + get [-p ]... [-o ] + list [-p ]... [-o ] + operating-system-versions + get [-p ]... [-o ] + list [-p ]... [-o ] + operating-systems + get [-p ]... [-o ] + list [-p ]... [-o ] + order-documents + get [-p ]... [-o ] + list [-p ]... [-o ] + orders + get [-p ]... [-o ] + list [-p ]... [-o ] + placement-groups + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + placement-strategies + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + placements + generatetags [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + platform-types + get [-p ]... [-o ] + list [-p ]... [-o ] + postal-codes + get [-p ]... [-o ] + list [-p ]... [-o ] + projects + get [-p ]... [-o ] + list [-p ]... [-o ] + regions + list [-p ]... [-o ] + remarketing-list-shares + get [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + remarketing-lists + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + reports + compatible-fields-query (-r )... [-p ]... [-o ] + delete [-p ]... + files-get [-p ]... [-o ] + files-list [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + run [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + sites + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + sizes + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + subaccounts + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + targetable-remarketing-lists + get [-p ]... [-o ] + list [-p ]... [-o ] + targeting-templates + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + user-profiles + get [-p ]... [-o ] + list [-p ]... [-o ] + user-role-permission-groups + get [-p ]... [-o ] + list [-p ]... [-o ] + user-role-permissions + get [-p ]... [-o ] + list [-p ]... [-o ] + user-roles + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + video-formats + get [-p ]... [-o ] + list [-p ]... [-o ] + dfareporting2d8 --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 `dfareporting2d8-`. 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/dfareporting2d8-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/dfareporting2d8-secret.json`, assuming that the required *dfareporting* 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. `dfareporting2d8 --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/dfareporting2d8-cli/mkdocs.yml b/gen/dfareporting2d8-cli/mkdocs.yml new file mode 100644 index 0000000000..5682639c39 --- /dev/null +++ b/gen/dfareporting2d8-cli/mkdocs.yml @@ -0,0 +1,221 @@ +site_name: dfareporting v1.0.6+20170818 +site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d8-cli +site_description: A complete library to interact with dfareporting (protocol v2.8) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['account-active-ad-summaries_get.md', 'Account Active Ad Summaries', 'Get'] +- ['account-permission-groups_get.md', 'Account Permission Groups', 'Get'] +- ['account-permission-groups_list.md', 'Account Permission Groups', 'List'] +- ['account-permissions_get.md', 'Account Permissions', 'Get'] +- ['account-permissions_list.md', 'Account Permissions', 'List'] +- ['account-user-profiles_get.md', 'Account User Profiles', 'Get'] +- ['account-user-profiles_insert.md', 'Account User Profiles', 'Insert'] +- ['account-user-profiles_list.md', 'Account User Profiles', 'List'] +- ['account-user-profiles_patch.md', 'Account User Profiles', 'Patch'] +- ['account-user-profiles_update.md', 'Account User Profiles', 'Update'] +- ['accounts_get.md', 'Accounts', 'Get'] +- ['accounts_list.md', 'Accounts', 'List'] +- ['accounts_patch.md', 'Accounts', 'Patch'] +- ['accounts_update.md', 'Accounts', 'Update'] +- ['ads_get.md', 'Ads', 'Get'] +- ['ads_insert.md', 'Ads', 'Insert'] +- ['ads_list.md', 'Ads', 'List'] +- ['ads_patch.md', 'Ads', 'Patch'] +- ['ads_update.md', 'Ads', 'Update'] +- ['advertiser-groups_delete.md', 'Advertiser Groups', 'Delete'] +- ['advertiser-groups_get.md', 'Advertiser Groups', 'Get'] +- ['advertiser-groups_insert.md', 'Advertiser Groups', 'Insert'] +- ['advertiser-groups_list.md', 'Advertiser Groups', 'List'] +- ['advertiser-groups_patch.md', 'Advertiser Groups', 'Patch'] +- ['advertiser-groups_update.md', 'Advertiser Groups', 'Update'] +- ['advertisers_get.md', 'Advertisers', 'Get'] +- ['advertisers_insert.md', 'Advertisers', 'Insert'] +- ['advertisers_list.md', 'Advertisers', 'List'] +- ['advertisers_patch.md', 'Advertisers', 'Patch'] +- ['advertisers_update.md', 'Advertisers', 'Update'] +- ['browsers_list.md', 'Browsers', 'List'] +- ['campaign-creative-associations_insert.md', 'Campaign Creative Associations', 'Insert'] +- ['campaign-creative-associations_list.md', 'Campaign Creative Associations', 'List'] +- ['campaigns_get.md', 'Campaigns', 'Get'] +- ['campaigns_insert.md', 'Campaigns', 'Insert'] +- ['campaigns_list.md', 'Campaigns', 'List'] +- ['campaigns_patch.md', 'Campaigns', 'Patch'] +- ['campaigns_update.md', 'Campaigns', 'Update'] +- ['change-logs_get.md', 'Change Logs', 'Get'] +- ['change-logs_list.md', 'Change Logs', 'List'] +- ['cities_list.md', 'Cities', 'List'] +- ['connection-types_get.md', 'Connection Types', 'Get'] +- ['connection-types_list.md', 'Connection Types', 'List'] +- ['content-categories_delete.md', 'Content Categories', 'Delete'] +- ['content-categories_get.md', 'Content Categories', 'Get'] +- ['content-categories_insert.md', 'Content Categories', 'Insert'] +- ['content-categories_list.md', 'Content Categories', 'List'] +- ['content-categories_patch.md', 'Content Categories', 'Patch'] +- ['content-categories_update.md', 'Content Categories', 'Update'] +- ['conversions_batchinsert.md', 'Conversions', 'Batchinsert'] +- ['conversions_batchupdate.md', 'Conversions', 'Batchupdate'] +- ['countries_get.md', 'Countries', 'Get'] +- ['countries_list.md', 'Countries', 'List'] +- ['creative-assets_insert.md', 'Creative Assets', 'Insert'] +- ['creative-field-values_delete.md', 'Creative Field Values', 'Delete'] +- ['creative-field-values_get.md', 'Creative Field Values', 'Get'] +- ['creative-field-values_insert.md', 'Creative Field Values', 'Insert'] +- ['creative-field-values_list.md', 'Creative Field Values', 'List'] +- ['creative-field-values_patch.md', 'Creative Field Values', 'Patch'] +- ['creative-field-values_update.md', 'Creative Field Values', 'Update'] +- ['creative-fields_delete.md', 'Creative Fields', 'Delete'] +- ['creative-fields_get.md', 'Creative Fields', 'Get'] +- ['creative-fields_insert.md', 'Creative Fields', 'Insert'] +- ['creative-fields_list.md', 'Creative Fields', 'List'] +- ['creative-fields_patch.md', 'Creative Fields', 'Patch'] +- ['creative-fields_update.md', 'Creative Fields', 'Update'] +- ['creative-groups_get.md', 'Creative Groups', 'Get'] +- ['creative-groups_insert.md', 'Creative Groups', 'Insert'] +- ['creative-groups_list.md', 'Creative Groups', 'List'] +- ['creative-groups_patch.md', 'Creative Groups', 'Patch'] +- ['creative-groups_update.md', 'Creative Groups', 'Update'] +- ['creatives_get.md', 'Creatives', 'Get'] +- ['creatives_insert.md', 'Creatives', 'Insert'] +- ['creatives_list.md', 'Creatives', 'List'] +- ['creatives_patch.md', 'Creatives', 'Patch'] +- ['creatives_update.md', 'Creatives', 'Update'] +- ['dimension-values_query.md', 'Dimension Values', 'Query'] +- ['directory-site-contacts_get.md', 'Directory Site Contacts', 'Get'] +- ['directory-site-contacts_list.md', 'Directory Site Contacts', 'List'] +- ['directory-sites_get.md', 'Directory Sites', 'Get'] +- ['directory-sites_insert.md', 'Directory Sites', 'Insert'] +- ['directory-sites_list.md', 'Directory Sites', 'List'] +- ['dynamic-targeting-keys_delete.md', 'Dynamic Targeting Keys', 'Delete'] +- ['dynamic-targeting-keys_insert.md', 'Dynamic Targeting Keys', 'Insert'] +- ['dynamic-targeting-keys_list.md', 'Dynamic Targeting Keys', 'List'] +- ['event-tags_delete.md', 'Event Tags', 'Delete'] +- ['event-tags_get.md', 'Event Tags', 'Get'] +- ['event-tags_insert.md', 'Event Tags', 'Insert'] +- ['event-tags_list.md', 'Event Tags', 'List'] +- ['event-tags_patch.md', 'Event Tags', 'Patch'] +- ['event-tags_update.md', 'Event Tags', 'Update'] +- ['files_get.md', 'Files', 'Get'] +- ['files_list.md', 'Files', 'List'] +- ['floodlight-activities_delete.md', 'Floodlight Activities', 'Delete'] +- ['floodlight-activities_generatetag.md', 'Floodlight Activities', 'Generatetag'] +- ['floodlight-activities_get.md', 'Floodlight Activities', 'Get'] +- ['floodlight-activities_insert.md', 'Floodlight Activities', 'Insert'] +- ['floodlight-activities_list.md', 'Floodlight Activities', 'List'] +- ['floodlight-activities_patch.md', 'Floodlight Activities', 'Patch'] +- ['floodlight-activities_update.md', 'Floodlight Activities', 'Update'] +- ['floodlight-activity-groups_get.md', 'Floodlight Activity Groups', 'Get'] +- ['floodlight-activity-groups_insert.md', 'Floodlight Activity Groups', 'Insert'] +- ['floodlight-activity-groups_list.md', 'Floodlight Activity Groups', 'List'] +- ['floodlight-activity-groups_patch.md', 'Floodlight Activity Groups', 'Patch'] +- ['floodlight-activity-groups_update.md', 'Floodlight Activity Groups', 'Update'] +- ['floodlight-configurations_get.md', 'Floodlight Configurations', 'Get'] +- ['floodlight-configurations_list.md', 'Floodlight Configurations', 'List'] +- ['floodlight-configurations_patch.md', 'Floodlight Configurations', 'Patch'] +- ['floodlight-configurations_update.md', 'Floodlight Configurations', 'Update'] +- ['inventory-items_get.md', 'Inventory Items', 'Get'] +- ['inventory-items_list.md', 'Inventory Items', 'List'] +- ['landing-pages_delete.md', 'Landing Pages', 'Delete'] +- ['landing-pages_get.md', 'Landing Pages', 'Get'] +- ['landing-pages_insert.md', 'Landing Pages', 'Insert'] +- ['landing-pages_list.md', 'Landing Pages', 'List'] +- ['landing-pages_patch.md', 'Landing Pages', 'Patch'] +- ['landing-pages_update.md', 'Landing Pages', 'Update'] +- ['languages_list.md', 'Languages', 'List'] +- ['metros_list.md', 'Metros', 'List'] +- ['mobile-carriers_get.md', 'Mobile Carriers', 'Get'] +- ['mobile-carriers_list.md', 'Mobile Carriers', 'List'] +- ['operating-system-versions_get.md', 'Operating System Versions', 'Get'] +- ['operating-system-versions_list.md', 'Operating System Versions', 'List'] +- ['operating-systems_get.md', 'Operating Systems', 'Get'] +- ['operating-systems_list.md', 'Operating Systems', 'List'] +- ['order-documents_get.md', 'Order Documents', 'Get'] +- ['order-documents_list.md', 'Order Documents', 'List'] +- ['orders_get.md', 'Orders', 'Get'] +- ['orders_list.md', 'Orders', 'List'] +- ['placement-groups_get.md', 'Placement Groups', 'Get'] +- ['placement-groups_insert.md', 'Placement Groups', 'Insert'] +- ['placement-groups_list.md', 'Placement Groups', 'List'] +- ['placement-groups_patch.md', 'Placement Groups', 'Patch'] +- ['placement-groups_update.md', 'Placement Groups', 'Update'] +- ['placement-strategies_delete.md', 'Placement Strategies', 'Delete'] +- ['placement-strategies_get.md', 'Placement Strategies', 'Get'] +- ['placement-strategies_insert.md', 'Placement Strategies', 'Insert'] +- ['placement-strategies_list.md', 'Placement Strategies', 'List'] +- ['placement-strategies_patch.md', 'Placement Strategies', 'Patch'] +- ['placement-strategies_update.md', 'Placement Strategies', 'Update'] +- ['placements_generatetags.md', 'Placements', 'Generatetags'] +- ['placements_get.md', 'Placements', 'Get'] +- ['placements_insert.md', 'Placements', 'Insert'] +- ['placements_list.md', 'Placements', 'List'] +- ['placements_patch.md', 'Placements', 'Patch'] +- ['placements_update.md', 'Placements', 'Update'] +- ['platform-types_get.md', 'Platform Types', 'Get'] +- ['platform-types_list.md', 'Platform Types', 'List'] +- ['postal-codes_get.md', 'Postal Codes', 'Get'] +- ['postal-codes_list.md', 'Postal Codes', 'List'] +- ['projects_get.md', 'Projects', 'Get'] +- ['projects_list.md', 'Projects', 'List'] +- ['regions_list.md', 'Regions', 'List'] +- ['remarketing-list-shares_get.md', 'Remarketing List Shares', 'Get'] +- ['remarketing-list-shares_patch.md', 'Remarketing List Shares', 'Patch'] +- ['remarketing-list-shares_update.md', 'Remarketing List Shares', 'Update'] +- ['remarketing-lists_get.md', 'Remarketing Lists', 'Get'] +- ['remarketing-lists_insert.md', 'Remarketing Lists', 'Insert'] +- ['remarketing-lists_list.md', 'Remarketing Lists', 'List'] +- ['remarketing-lists_patch.md', 'Remarketing Lists', 'Patch'] +- ['remarketing-lists_update.md', 'Remarketing Lists', 'Update'] +- ['reports_compatible-fields-query.md', 'Reports', 'Compatible Fields Query'] +- ['reports_delete.md', 'Reports', 'Delete'] +- ['reports_files-get.md', 'Reports', 'Files Get'] +- ['reports_files-list.md', 'Reports', 'Files List'] +- ['reports_get.md', 'Reports', 'Get'] +- ['reports_insert.md', 'Reports', 'Insert'] +- ['reports_list.md', 'Reports', 'List'] +- ['reports_patch.md', 'Reports', 'Patch'] +- ['reports_run.md', 'Reports', 'Run'] +- ['reports_update.md', 'Reports', 'Update'] +- ['sites_get.md', 'Sites', 'Get'] +- ['sites_insert.md', 'Sites', 'Insert'] +- ['sites_list.md', 'Sites', 'List'] +- ['sites_patch.md', 'Sites', 'Patch'] +- ['sites_update.md', 'Sites', 'Update'] +- ['sizes_get.md', 'Sizes', 'Get'] +- ['sizes_insert.md', 'Sizes', 'Insert'] +- ['sizes_list.md', 'Sizes', 'List'] +- ['subaccounts_get.md', 'Subaccounts', 'Get'] +- ['subaccounts_insert.md', 'Subaccounts', 'Insert'] +- ['subaccounts_list.md', 'Subaccounts', 'List'] +- ['subaccounts_patch.md', 'Subaccounts', 'Patch'] +- ['subaccounts_update.md', 'Subaccounts', 'Update'] +- ['targetable-remarketing-lists_get.md', 'Targetable Remarketing Lists', 'Get'] +- ['targetable-remarketing-lists_list.md', 'Targetable Remarketing Lists', 'List'] +- ['targeting-templates_get.md', 'Targeting Templates', 'Get'] +- ['targeting-templates_insert.md', 'Targeting Templates', 'Insert'] +- ['targeting-templates_list.md', 'Targeting Templates', 'List'] +- ['targeting-templates_patch.md', 'Targeting Templates', 'Patch'] +- ['targeting-templates_update.md', 'Targeting Templates', 'Update'] +- ['user-profiles_get.md', 'User Profiles', 'Get'] +- ['user-profiles_list.md', 'User Profiles', 'List'] +- ['user-role-permission-groups_get.md', 'User Role Permission Groups', 'Get'] +- ['user-role-permission-groups_list.md', 'User Role Permission Groups', 'List'] +- ['user-role-permissions_get.md', 'User Role Permissions', 'Get'] +- ['user-role-permissions_list.md', 'User Role Permissions', 'List'] +- ['user-roles_delete.md', 'User Roles', 'Delete'] +- ['user-roles_get.md', 'User Roles', 'Get'] +- ['user-roles_insert.md', 'User Roles', 'Insert'] +- ['user-roles_list.md', 'User Roles', 'List'] +- ['user-roles_patch.md', 'User Roles', 'Patch'] +- ['user-roles_update.md', 'User Roles', 'Update'] +- ['video-formats_get.md', 'Video Formats', 'Get'] +- ['video-formats_list.md', 'Video Formats', 'List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/dfareporting2d8-cli/src/cmn.rs b/gen/dfareporting2d8-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/dfareporting2d8-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/dfareporting2d8-cli/src/main.rs b/gen/dfareporting2d8-cli/src/main.rs new file mode 100644 index 0000000000..0f3c68bd5e --- /dev/null +++ b/gen/dfareporting2d8-cli/src/main.rs @@ -0,0 +1,23876 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_dfareporting2d8 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::Dfareporting>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _account_active_ad_summaries_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_active_ad_summaries().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("summary-account-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_permission_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_permission_groups().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_permission_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_permission_groups().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_permissions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_permissions().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_permissions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_permissions().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_user_profiles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_user_profiles().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_user_profiles_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-filter.object-ids" => Some(("userRoleFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-role-filter.status" => Some(("userRoleFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-filter.kind" => Some(("userRoleFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locale" => Some(("locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter.object-ids" => Some(("siteFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "site-filter.status" => Some(("siteFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter.kind" => Some(("siteFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trafficker-type" => Some(("traffickerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-filter.object-ids" => Some(("advertiserFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "advertiser-filter.status" => Some(("advertiserFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-filter.kind" => Some(("advertiserFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-filter.object-ids" => Some(("campaignFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "campaign-filter.status" => Some(("campaignFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-filter.kind" => Some(("campaignFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-id" => Some(("userRoleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-access-type" => Some(("userAccessType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "active", "advertiser-filter", "campaign-filter", "comments", "email", "id", "kind", "locale", "name", "object-ids", "site-filter", "status", "subaccount-id", "trafficker-type", "user-access-type", "user-role-filter", "user-role-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AccountUserProfile = json::value::from_value(object).unwrap(); + let mut call = self.hub.account_user_profiles().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_user_profiles_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.account_user_profiles().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-role-id" => { + call = call.user_role_id(value.unwrap_or("")); + }, + "subaccount-id" => { + call = call.subaccount_id(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + _ => { + 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(["search-string", "subaccount-id", "sort-field", "ids", "max-results", "page-token", "user-role-id", "sort-order", "active"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_user_profiles_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-filter.object-ids" => Some(("userRoleFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-role-filter.status" => Some(("userRoleFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-filter.kind" => Some(("userRoleFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locale" => Some(("locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter.object-ids" => Some(("siteFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "site-filter.status" => Some(("siteFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter.kind" => Some(("siteFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trafficker-type" => Some(("traffickerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-filter.object-ids" => Some(("advertiserFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "advertiser-filter.status" => Some(("advertiserFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-filter.kind" => Some(("advertiserFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-filter.object-ids" => Some(("campaignFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "campaign-filter.status" => Some(("campaignFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-filter.kind" => Some(("campaignFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-id" => Some(("userRoleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-access-type" => Some(("userAccessType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "active", "advertiser-filter", "campaign-filter", "comments", "email", "id", "kind", "locale", "name", "object-ids", "site-filter", "status", "subaccount-id", "trafficker-type", "user-access-type", "user-role-filter", "user-role-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AccountUserProfile = json::value::from_value(object).unwrap(); + let mut call = self.hub.account_user_profiles().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _account_user_profiles_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-filter.object-ids" => Some(("userRoleFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-role-filter.status" => Some(("userRoleFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-filter.kind" => Some(("userRoleFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locale" => Some(("locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter.object-ids" => Some(("siteFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "site-filter.status" => Some(("siteFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter.kind" => Some(("siteFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trafficker-type" => Some(("traffickerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-filter.object-ids" => Some(("advertiserFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "advertiser-filter.status" => Some(("advertiserFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-filter.kind" => Some(("advertiserFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-filter.object-ids" => Some(("campaignFilter.objectIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "campaign-filter.status" => Some(("campaignFilter.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-filter.kind" => Some(("campaignFilter.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-role-id" => Some(("userRoleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-access-type" => Some(("userAccessType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "active", "advertiser-filter", "campaign-filter", "comments", "email", "id", "kind", "locale", "name", "object-ids", "site-filter", "status", "subaccount-id", "trafficker-type", "user-access-type", "user-role-filter", "user-role-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AccountUserProfile = json::value::from_value(object).unwrap(); + let mut call = self.hub.account_user_profiles().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + _ => { + 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(["search-string", "sort-field", "ids", "max-results", "page-token", "sort-order", "active"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "teaser-size-limit" => Some(("teaserSizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-permission-ids" => Some(("availablePermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maximum-image-size" => Some(("maximumImageSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locale" => Some(("locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-creative-size-id" => Some(("defaultCreativeSizeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-permission-ids" => Some(("accountPermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "account-profile" => Some(("accountProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "nielsen-ocr-enabled" => Some(("nielsenOcrEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "reports-configuration.report-generation-time-zone-id" => Some(("reportsConfiguration.reportGenerationTimeZoneId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reports-configuration.exposure-to-conversion-enabled" => Some(("reportsConfiguration.exposureToConversionEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "reports-configuration.lookback-configuration.click-duration" => Some(("reportsConfiguration.lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "reports-configuration.lookback-configuration.post-impression-activities-duration" => Some(("reportsConfiguration.lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "currency-id" => Some(("currencyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "active-view-opt-out" => Some(("activeViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "active-ads-limit-tier" => Some(("activeAdsLimitTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "share-reports-with-twitter" => Some(("shareReportsWithTwitter", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "country-id" => Some(("countryId", 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!["account-permission-ids", "account-profile", "active", "active-ads-limit-tier", "active-view-opt-out", "available-permission-ids", "click-duration", "country-id", "currency-id", "default-creative-size-id", "description", "exposure-to-conversion-enabled", "id", "kind", "locale", "lookback-configuration", "maximum-image-size", "name", "nielsen-ocr-enabled", "post-impression-activities-duration", "report-generation-time-zone-id", "reports-configuration", "share-reports-with-twitter", "teaser-size-limit"]); + 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::Account = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "teaser-size-limit" => Some(("teaserSizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-permission-ids" => Some(("availablePermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maximum-image-size" => Some(("maximumImageSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locale" => Some(("locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-creative-size-id" => Some(("defaultCreativeSizeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-permission-ids" => Some(("accountPermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "account-profile" => Some(("accountProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "nielsen-ocr-enabled" => Some(("nielsenOcrEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "reports-configuration.report-generation-time-zone-id" => Some(("reportsConfiguration.reportGenerationTimeZoneId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reports-configuration.exposure-to-conversion-enabled" => Some(("reportsConfiguration.exposureToConversionEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "reports-configuration.lookback-configuration.click-duration" => Some(("reportsConfiguration.lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "reports-configuration.lookback-configuration.post-impression-activities-duration" => Some(("reportsConfiguration.lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "currency-id" => Some(("currencyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "active-view-opt-out" => Some(("activeViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "active-ads-limit-tier" => Some(("activeAdsLimitTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "share-reports-with-twitter" => Some(("shareReportsWithTwitter", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "country-id" => Some(("countryId", 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!["account-permission-ids", "account-profile", "active", "active-ads-limit-tier", "active-view-opt-out", "available-permission-ids", "click-duration", "country-id", "currency-id", "default-creative-size-id", "description", "exposure-to-conversion-enabled", "id", "kind", "locale", "lookback-configuration", "maximum-image-size", "name", "nielsen-ocr-enabled", "post-impression-activities-duration", "report-generation-time-zone-id", "reports-configuration", "share-reports-with-twitter", "teaser-size-limit"]); + 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::Account = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _ads_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.ads().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _ads_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "click-through-url-suffix-properties.click-through-url-suffix" => Some(("clickThroughUrlSuffixProperties.clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.override-inherited-suffix" => Some(("clickThroughUrlSuffixProperties.overrideInheritedSuffix", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "geo-targeting.exclude-countries" => Some(("geoTargeting.excludeCountries", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delivery-schedule.priority" => Some(("deliverySchedule.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.hard-cutoff" => Some(("deliverySchedule.hardCutoff", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delivery-schedule.frequency-cap.duration" => Some(("deliverySchedule.frequencyCap.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.frequency-cap.impressions" => Some(("deliverySchedule.frequencyCap.impressions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.impression-ratio" => Some(("deliverySchedule.impressionRatio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "targeting-template-id" => Some(("targetingTemplateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.weight-calculation-strategy" => Some(("creativeRotation.weightCalculationStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.creative-optimization-configuration-id" => Some(("creativeRotation.creativeOptimizationConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.type" => Some(("creativeRotation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.computed-click-through-url" => Some(("clickThroughUrl.computedClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.custom-click-through-url" => Some(("clickThroughUrl.customClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.landing-page-id" => Some(("clickThroughUrl.landingPageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.default-landing-page" => Some(("clickThroughUrl.defaultLandingPage", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "remarketing-list-expression.expression" => Some(("remarketingListExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "audience-segment-id" => Some(("audienceSegmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-value-targeting-expression.expression" => Some(("keyValueTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.override-inherited-event-tag" => Some(("defaultClickThroughEventTagProperties.overrideInheritedEventTag", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagProperties.defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "day-part-targeting.user-local-time" => Some(("dayPartTargeting.userLocalTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "day-part-targeting.hours-of-day" => Some(("dayPartTargeting.hoursOfDay", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "day-part-targeting.days-of-week" => Some(("dayPartTargeting.daysOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-click-tracker" => Some(("dynamicClickTracker", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "advertiser-id", "advertiser-id-dimension-value", "archived", "audience-segment-id", "campaign-id", "campaign-id-dimension-value", "click-through-url", "click-through-url-suffix", "click-through-url-suffix-properties", "comments", "compatibility", "computed-click-through-url", "create-info", "creative-optimization-configuration-id", "creative-rotation", "custom-click-through-url", "day-part-targeting", "days-of-week", "default-click-through-event-tag-id", "default-click-through-event-tag-properties", "default-landing-page", "delivery-schedule", "dimension-name", "duration", "dynamic-click-tracker", "end-time", "etag", "exclude-countries", "expression", "frequency-cap", "geo-targeting", "hard-cutoff", "height", "hours-of-day", "iab", "id", "id-dimension-value", "impression-ratio", "impressions", "key-value-targeting-expression", "kind", "landing-page-id", "last-modified-info", "match-type", "name", "override-inherited-event-tag", "override-inherited-suffix", "priority", "remarketing-list-expression", "size", "ssl-compliant", "ssl-required", "start-time", "subaccount-id", "targeting-template-id", "time", "type", "user-local-time", "value", "weight-calculation-strategy", "width"]); + 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::Ad = json::value::from_value(object).unwrap(); + let mut call = self.hub.ads().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _ads_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.ads().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.add_type(value.unwrap_or("")); + }, + "ssl-required" => { + call = call.ssl_required(arg_from_str(value.unwrap_or("false"), err, "ssl-required", "boolean")); + }, + "ssl-compliant" => { + call = call.ssl_compliant(arg_from_str(value.unwrap_or("false"), err, "ssl-compliant", "boolean")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "size-ids" => { + call = call.add_size_ids(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "remarketing-list-ids" => { + call = call.add_remarketing_list_ids(value.unwrap_or("")); + }, + "placement-ids" => { + call = call.add_placement_ids(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "overridden-event-tag-id" => { + call = call.overridden_event_tag_id(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "landing-page-ids" => { + call = call.add_landing_page_ids(value.unwrap_or("")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "dynamic-click-tracker" => { + call = call.dynamic_click_tracker(arg_from_str(value.unwrap_or("false"), err, "dynamic-click-tracker", "boolean")); + }, + "creative-optimization-configuration-ids" => { + call = call.add_creative_optimization_configuration_ids(value.unwrap_or("")); + }, + "creative-ids" => { + call = call.add_creative_ids(value.unwrap_or("")); + }, + "compatibility" => { + call = call.compatibility(value.unwrap_or("")); + }, + "campaign-ids" => { + call = call.add_campaign_ids(value.unwrap_or("")); + }, + "audience-segment-ids" => { + call = call.add_audience_segment_ids(value.unwrap_or("")); + }, + "archived" => { + call = call.archived(arg_from_str(value.unwrap_or("false"), err, "archived", "boolean")); + }, + "advertiser-id" => { + call = call.advertiser_id(value.unwrap_or("")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + _ => { + 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(["landing-page-ids", "overridden-event-tag-id", "campaign-ids", "archived", "creative-optimization-configuration-ids", "ssl-compliant", "size-ids", "page-token", "sort-order", "type", "ssl-required", "creative-ids", "max-results", "placement-ids", "active", "compatibility", "advertiser-id", "search-string", "sort-field", "audience-segment-ids", "ids", "remarketing-list-ids", "dynamic-click-tracker"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _ads_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "click-through-url-suffix-properties.click-through-url-suffix" => Some(("clickThroughUrlSuffixProperties.clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.override-inherited-suffix" => Some(("clickThroughUrlSuffixProperties.overrideInheritedSuffix", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "geo-targeting.exclude-countries" => Some(("geoTargeting.excludeCountries", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delivery-schedule.priority" => Some(("deliverySchedule.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.hard-cutoff" => Some(("deliverySchedule.hardCutoff", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delivery-schedule.frequency-cap.duration" => Some(("deliverySchedule.frequencyCap.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.frequency-cap.impressions" => Some(("deliverySchedule.frequencyCap.impressions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.impression-ratio" => Some(("deliverySchedule.impressionRatio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "targeting-template-id" => Some(("targetingTemplateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.weight-calculation-strategy" => Some(("creativeRotation.weightCalculationStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.creative-optimization-configuration-id" => Some(("creativeRotation.creativeOptimizationConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.type" => Some(("creativeRotation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.computed-click-through-url" => Some(("clickThroughUrl.computedClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.custom-click-through-url" => Some(("clickThroughUrl.customClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.landing-page-id" => Some(("clickThroughUrl.landingPageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.default-landing-page" => Some(("clickThroughUrl.defaultLandingPage", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "remarketing-list-expression.expression" => Some(("remarketingListExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "audience-segment-id" => Some(("audienceSegmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-value-targeting-expression.expression" => Some(("keyValueTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.override-inherited-event-tag" => Some(("defaultClickThroughEventTagProperties.overrideInheritedEventTag", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagProperties.defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "day-part-targeting.user-local-time" => Some(("dayPartTargeting.userLocalTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "day-part-targeting.hours-of-day" => Some(("dayPartTargeting.hoursOfDay", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "day-part-targeting.days-of-week" => Some(("dayPartTargeting.daysOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-click-tracker" => Some(("dynamicClickTracker", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "advertiser-id", "advertiser-id-dimension-value", "archived", "audience-segment-id", "campaign-id", "campaign-id-dimension-value", "click-through-url", "click-through-url-suffix", "click-through-url-suffix-properties", "comments", "compatibility", "computed-click-through-url", "create-info", "creative-optimization-configuration-id", "creative-rotation", "custom-click-through-url", "day-part-targeting", "days-of-week", "default-click-through-event-tag-id", "default-click-through-event-tag-properties", "default-landing-page", "delivery-schedule", "dimension-name", "duration", "dynamic-click-tracker", "end-time", "etag", "exclude-countries", "expression", "frequency-cap", "geo-targeting", "hard-cutoff", "height", "hours-of-day", "iab", "id", "id-dimension-value", "impression-ratio", "impressions", "key-value-targeting-expression", "kind", "landing-page-id", "last-modified-info", "match-type", "name", "override-inherited-event-tag", "override-inherited-suffix", "priority", "remarketing-list-expression", "size", "ssl-compliant", "ssl-required", "start-time", "subaccount-id", "targeting-template-id", "time", "type", "user-local-time", "value", "weight-calculation-strategy", "width"]); + 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::Ad = json::value::from_value(object).unwrap(); + let mut call = self.hub.ads().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _ads_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "click-through-url-suffix-properties.click-through-url-suffix" => Some(("clickThroughUrlSuffixProperties.clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.override-inherited-suffix" => Some(("clickThroughUrlSuffixProperties.overrideInheritedSuffix", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "geo-targeting.exclude-countries" => Some(("geoTargeting.excludeCountries", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delivery-schedule.priority" => Some(("deliverySchedule.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.hard-cutoff" => Some(("deliverySchedule.hardCutoff", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delivery-schedule.frequency-cap.duration" => Some(("deliverySchedule.frequencyCap.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.frequency-cap.impressions" => Some(("deliverySchedule.frequencyCap.impressions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery-schedule.impression-ratio" => Some(("deliverySchedule.impressionRatio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "targeting-template-id" => Some(("targetingTemplateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.weight-calculation-strategy" => Some(("creativeRotation.weightCalculationStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.creative-optimization-configuration-id" => Some(("creativeRotation.creativeOptimizationConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-rotation.type" => Some(("creativeRotation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.computed-click-through-url" => Some(("clickThroughUrl.computedClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.custom-click-through-url" => Some(("clickThroughUrl.customClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.landing-page-id" => Some(("clickThroughUrl.landingPageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url.default-landing-page" => Some(("clickThroughUrl.defaultLandingPage", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "remarketing-list-expression.expression" => Some(("remarketingListExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "audience-segment-id" => Some(("audienceSegmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-value-targeting-expression.expression" => Some(("keyValueTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.override-inherited-event-tag" => Some(("defaultClickThroughEventTagProperties.overrideInheritedEventTag", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagProperties.defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "day-part-targeting.user-local-time" => Some(("dayPartTargeting.userLocalTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "day-part-targeting.hours-of-day" => Some(("dayPartTargeting.hoursOfDay", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "day-part-targeting.days-of-week" => Some(("dayPartTargeting.daysOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-click-tracker" => Some(("dynamicClickTracker", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "advertiser-id", "advertiser-id-dimension-value", "archived", "audience-segment-id", "campaign-id", "campaign-id-dimension-value", "click-through-url", "click-through-url-suffix", "click-through-url-suffix-properties", "comments", "compatibility", "computed-click-through-url", "create-info", "creative-optimization-configuration-id", "creative-rotation", "custom-click-through-url", "day-part-targeting", "days-of-week", "default-click-through-event-tag-id", "default-click-through-event-tag-properties", "default-landing-page", "delivery-schedule", "dimension-name", "duration", "dynamic-click-tracker", "end-time", "etag", "exclude-countries", "expression", "frequency-cap", "geo-targeting", "hard-cutoff", "height", "hours-of-day", "iab", "id", "id-dimension-value", "impression-ratio", "impressions", "key-value-targeting-expression", "kind", "landing-page-id", "last-modified-info", "match-type", "name", "override-inherited-event-tag", "override-inherited-suffix", "priority", "remarketing-list-expression", "size", "ssl-compliant", "ssl-required", "start-time", "subaccount-id", "targeting-template-id", "time", "type", "user-local-time", "value", "weight-calculation-strategy", "width"]); + 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::Ad = json::value::from_value(object).unwrap(); + let mut call = self.hub.ads().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertiser_groups_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertiser_groups().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _advertiser_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertiser_groups().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertiser_groups_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::AdvertiserGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.advertiser_groups().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertiser_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertiser_groups().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(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(["search-string", "sort-field", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertiser_groups_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::AdvertiserGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.advertiser_groups().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertiser_groups_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::AdvertiserGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.advertiser_groups().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertisers_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertisers().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertisers_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "original-floodlight-configuration-id" => Some(("originalFloodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix" => Some(("clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "suspended" => Some(("suspended", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-group-id" => Some(("advertiserGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-email" => Some(("defaultEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-group-id", "click-through-url-suffix", "default-click-through-event-tag-id", "default-email", "dimension-name", "etag", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "id", "id-dimension-value", "kind", "match-type", "name", "original-floodlight-configuration-id", "status", "subaccount-id", "suspended", "value"]); + 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::Advertiser = json::value::from_value(object).unwrap(); + let mut call = self.hub.advertisers().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertisers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertisers().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "subaccount-id" => { + call = call.subaccount_id(value.unwrap_or("")); + }, + "status" => { + call = call.status(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "only-parent" => { + call = call.only_parent(arg_from_str(value.unwrap_or("false"), err, "only-parent", "boolean")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-advertisers-without-groups-only" => { + call = call.include_advertisers_without_groups_only(arg_from_str(value.unwrap_or("false"), err, "include-advertisers-without-groups-only", "boolean")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "floodlight-configuration-ids" => { + call = call.add_floodlight_configuration_ids(value.unwrap_or("")); + }, + "advertiser-group-ids" => { + call = call.add_advertiser_group_ids(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(["status", "search-string", "subaccount-id", "include-advertisers-without-groups-only", "sort-field", "ids", "max-results", "page-token", "only-parent", "sort-order", "floodlight-configuration-ids", "advertiser-group-ids"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertisers_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "original-floodlight-configuration-id" => Some(("originalFloodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix" => Some(("clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "suspended" => Some(("suspended", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-group-id" => Some(("advertiserGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-email" => Some(("defaultEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-group-id", "click-through-url-suffix", "default-click-through-event-tag-id", "default-email", "dimension-name", "etag", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "id", "id-dimension-value", "kind", "match-type", "name", "original-floodlight-configuration-id", "status", "subaccount-id", "suspended", "value"]); + 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::Advertiser = json::value::from_value(object).unwrap(); + let mut call = self.hub.advertisers().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _advertisers_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "original-floodlight-configuration-id" => Some(("originalFloodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix" => Some(("clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "suspended" => Some(("suspended", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-group-id" => Some(("advertiserGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-email" => Some(("defaultEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-group-id", "click-through-url-suffix", "default-click-through-event-tag-id", "default-email", "dimension-name", "etag", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "id", "id-dimension-value", "kind", "match-type", "name", "original-floodlight-configuration-id", "status", "subaccount-id", "suspended", "value"]); + 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::Advertiser = json::value::from_value(object).unwrap(); + let mut call = self.hub.advertisers().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _browsers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.browsers().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaign_creative_associations_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "creative-id" => Some(("creativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creative-id", "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::CampaignCreativeAssociation = json::value::from_value(object).unwrap(); + let mut call = self.hub.campaign_creative_associations().insert(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaign_creative_associations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.campaign_creative_associations().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "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")); + }, + _ => { + 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(["page-token", "sort-order", "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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaigns_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.campaigns().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaigns_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-date" => Some(("startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-date" => Some(("endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.click-through-url-suffix" => Some(("clickThroughUrlSuffixProperties.clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.override-inherited-suffix" => Some(("clickThroughUrlSuffixProperties.overrideInheritedSuffix", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.optimization-model" => Some(("creativeOptimizationConfiguration.optimizationModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.id" => Some(("creativeOptimizationConfiguration.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.name" => Some(("creativeOptimizationConfiguration.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trafficker-emails" => Some(("traffickerEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-group-id" => Some(("advertiserGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "billing-invoice-code" => Some(("billingInvoiceCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-group-ids" => Some(("creativeGroupIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-click-through-event-tag-properties.override-inherited-event-tag" => Some(("defaultClickThroughEventTagProperties.overrideInheritedEventTag", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagProperties.defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.creative-bundle-id" => Some(("adBlockingConfiguration.creativeBundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.click-through-url" => Some(("adBlockingConfiguration.clickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.enabled" => Some(("adBlockingConfiguration.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ad-blocking-configuration.override-click-through-url" => Some(("adBlockingConfiguration.overrideClickThroughUrl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "nielsen-ocr-enabled" => Some(("nielsenOcrEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "ad-blocking-configuration", "advertiser-group-id", "advertiser-id", "advertiser-id-dimension-value", "archived", "billing-invoice-code", "click-duration", "click-through-url", "click-through-url-suffix", "click-through-url-suffix-properties", "comment", "create-info", "creative-bundle-id", "creative-group-ids", "creative-optimization-configuration", "default-click-through-event-tag-id", "default-click-through-event-tag-properties", "dimension-name", "enabled", "end-date", "etag", "external-id", "id", "id-dimension-value", "kind", "last-modified-info", "lookback-configuration", "match-type", "name", "nielsen-ocr-enabled", "optimization-model", "override-click-through-url", "override-inherited-event-tag", "override-inherited-suffix", "post-impression-activities-duration", "start-date", "subaccount-id", "time", "trafficker-emails", "value"]); + 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::Campaign = json::value::from_value(object).unwrap(); + let mut call = self.hub.campaigns().insert(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("default-landing-page-name").unwrap_or(""), opt.value_of("default-landing-page-url").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaigns_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.campaigns().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "subaccount-id" => { + call = call.subaccount_id(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "overridden-event-tag-id" => { + call = call.overridden_event_tag_id(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "excluded-ids" => { + call = call.add_excluded_ids(value.unwrap_or("")); + }, + "at-least-one-optimization-activity" => { + call = call.at_least_one_optimization_activity(arg_from_str(value.unwrap_or("false"), err, "at-least-one-optimization-activity", "boolean")); + }, + "archived" => { + call = call.archived(arg_from_str(value.unwrap_or("false"), err, "archived", "boolean")); + }, + "advertiser-ids" => { + call = call.add_advertiser_ids(value.unwrap_or("")); + }, + "advertiser-group-ids" => { + call = call.add_advertiser_group_ids(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(["archived", "search-string", "subaccount-id", "sort-field", "advertiser-ids", "ids", "max-results", "excluded-ids", "page-token", "advertiser-group-ids", "sort-order", "overridden-event-tag-id", "at-least-one-optimization-activity"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaigns_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-date" => Some(("startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-date" => Some(("endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.click-through-url-suffix" => Some(("clickThroughUrlSuffixProperties.clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.override-inherited-suffix" => Some(("clickThroughUrlSuffixProperties.overrideInheritedSuffix", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.optimization-model" => Some(("creativeOptimizationConfiguration.optimizationModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.id" => Some(("creativeOptimizationConfiguration.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.name" => Some(("creativeOptimizationConfiguration.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trafficker-emails" => Some(("traffickerEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-group-id" => Some(("advertiserGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "billing-invoice-code" => Some(("billingInvoiceCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-group-ids" => Some(("creativeGroupIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-click-through-event-tag-properties.override-inherited-event-tag" => Some(("defaultClickThroughEventTagProperties.overrideInheritedEventTag", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagProperties.defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.creative-bundle-id" => Some(("adBlockingConfiguration.creativeBundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.click-through-url" => Some(("adBlockingConfiguration.clickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.enabled" => Some(("adBlockingConfiguration.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ad-blocking-configuration.override-click-through-url" => Some(("adBlockingConfiguration.overrideClickThroughUrl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "nielsen-ocr-enabled" => Some(("nielsenOcrEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "ad-blocking-configuration", "advertiser-group-id", "advertiser-id", "advertiser-id-dimension-value", "archived", "billing-invoice-code", "click-duration", "click-through-url", "click-through-url-suffix", "click-through-url-suffix-properties", "comment", "create-info", "creative-bundle-id", "creative-group-ids", "creative-optimization-configuration", "default-click-through-event-tag-id", "default-click-through-event-tag-properties", "dimension-name", "enabled", "end-date", "etag", "external-id", "id", "id-dimension-value", "kind", "last-modified-info", "lookback-configuration", "match-type", "name", "nielsen-ocr-enabled", "optimization-model", "override-click-through-url", "override-inherited-event-tag", "override-inherited-suffix", "post-impression-activities-duration", "start-date", "subaccount-id", "time", "trafficker-emails", "value"]); + 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::Campaign = json::value::from_value(object).unwrap(); + let mut call = self.hub.campaigns().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _campaigns_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-date" => Some(("startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-date" => Some(("endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.click-through-url-suffix" => Some(("clickThroughUrlSuffixProperties.clickThroughUrlSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "click-through-url-suffix-properties.override-inherited-suffix" => Some(("clickThroughUrlSuffixProperties.overrideInheritedSuffix", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.optimization-model" => Some(("creativeOptimizationConfiguration.optimizationModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.id" => Some(("creativeOptimizationConfiguration.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-optimization-configuration.name" => Some(("creativeOptimizationConfiguration.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trafficker-emails" => Some(("traffickerEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-group-id" => Some(("advertiserGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "billing-invoice-code" => Some(("billingInvoiceCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-group-ids" => Some(("creativeGroupIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-click-through-event-tag-properties.override-inherited-event-tag" => Some(("defaultClickThroughEventTagProperties.overrideInheritedEventTag", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-click-through-event-tag-properties.default-click-through-event-tag-id" => Some(("defaultClickThroughEventTagProperties.defaultClickThroughEventTagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.creative-bundle-id" => Some(("adBlockingConfiguration.creativeBundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.click-through-url" => Some(("adBlockingConfiguration.clickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-configuration.enabled" => Some(("adBlockingConfiguration.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ad-blocking-configuration.override-click-through-url" => Some(("adBlockingConfiguration.overrideClickThroughUrl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "nielsen-ocr-enabled" => Some(("nielsenOcrEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "ad-blocking-configuration", "advertiser-group-id", "advertiser-id", "advertiser-id-dimension-value", "archived", "billing-invoice-code", "click-duration", "click-through-url", "click-through-url-suffix", "click-through-url-suffix-properties", "comment", "create-info", "creative-bundle-id", "creative-group-ids", "creative-optimization-configuration", "default-click-through-event-tag-id", "default-click-through-event-tag-properties", "dimension-name", "enabled", "end-date", "etag", "external-id", "id", "id-dimension-value", "kind", "last-modified-info", "lookback-configuration", "match-type", "name", "nielsen-ocr-enabled", "optimization-model", "override-click-through-url", "override-inherited-event-tag", "override-inherited-suffix", "post-impression-activities-duration", "start-date", "subaccount-id", "time", "trafficker-emails", "value"]); + 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::Campaign = json::value::from_value(object).unwrap(); + let mut call = self.hub.campaigns().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _change_logs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.change_logs().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _change_logs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.change_logs().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-profile-ids" => { + call = call.add_user_profile_ids(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "object-type" => { + call = call.object_type(value.unwrap_or("")); + }, + "object-ids" => { + call = call.add_object_ids(value.unwrap_or("")); + }, + "min-change-time" => { + call = call.min_change_time(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "max-change-time" => { + call = call.max_change_time(value.unwrap_or("")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "action" => { + call = call.action(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(["min-change-time", "search-string", "max-change-time", "user-profile-ids", "ids", "max-results", "object-ids", "page-token", "action", "object-type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _cities_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.cities().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "region-dart-ids" => { + call = call.add_region_dart_ids(value.unwrap_or("")); + }, + "name-prefix" => { + call = call.name_prefix(value.unwrap_or("")); + }, + "dart-ids" => { + call = call.add_dart_ids(value.unwrap_or("")); + }, + "country-dart-ids" => { + call = call.add_country_dart_ids(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(["dart-ids", "country-dart-ids", "region-dart-ids", "name-prefix"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _connection_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.connection_types().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _connection_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.connection_types().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_categories_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.content_categories().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _content_categories_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.content_categories().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_categories_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::ContentCategory = json::value::from_value(object).unwrap(); + let mut call = self.hub.content_categories().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_categories_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.content_categories().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(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(["search-string", "sort-field", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_categories_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::ContentCategory = json::value::from_value(object).unwrap(); + let mut call = self.hub.content_categories().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_categories_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::ContentCategory = json::value::from_value(object).unwrap(); + let mut call = self.hub.content_categories().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _conversions_batchinsert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.kind" => Some(("encryptionInfo.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.encryption-entity-id" => Some(("encryptionInfo.encryptionEntityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.encryption-source" => Some(("encryptionInfo.encryptionSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.encryption-entity-type" => Some(("encryptionInfo.encryptionEntityType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["encryption-entity-id", "encryption-entity-type", "encryption-info", "encryption-source", "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::ConversionsBatchInsertRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.conversions().batchinsert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _conversions_batchupdate(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.kind" => Some(("encryptionInfo.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.encryption-entity-id" => Some(("encryptionInfo.encryptionEntityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.encryption-source" => Some(("encryptionInfo.encryptionSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-info.encryption-entity-type" => Some(("encryptionInfo.encryptionEntityType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["encryption-entity-id", "encryption-entity-type", "encryption-info", "encryption-source", "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::ConversionsBatchUpdateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.conversions().batchupdate(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _countries_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.countries().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("dart-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _countries_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.countries().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_assets_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "detected-features" => Some(("detectedFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "asset-identifier.type" => Some(("assetIdentifier.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "asset-identifier.name" => Some(("assetIdentifier.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "warned-validation-rules" => Some(("warnedValidationRules", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.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!["asset-identifier", "detected-features", "dimension-name", "etag", "id", "id-dimension-value", "kind", "match-type", "name", "type", "value", "warned-validation-rules"]); + 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::CreativeAssetMetadata = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_assets().insert(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("advertiser-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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 vals = opt.values_of("mode").unwrap().collect::>(); + let protocol = calltype_from_str(vals[0], ["simple", "resumable"].iter().map(|&v| v.to_string()).collect(), err); + let mut input_file = input_file_from_opts(vals[1], err); + let mime_type = input_mime_from_opts(opt.value_of("mime").unwrap_or("application/octet-stream"), err); + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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::Upload(UploadProtocol::Simple) => call.upload(input_file.unwrap(), mime_type.unwrap()), + CallType::Upload(UploadProtocol::Resumable) => call.upload_resumable(input_file.unwrap(), mime_type.unwrap()), + CallType::Standard => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_field_values_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_field_values().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("creative-field-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _creative_field_values_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_field_values().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("creative-field-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_field_values_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["id", "kind", "value"]); + 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::CreativeFieldValue = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_field_values().insert(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("creative-field-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_field_values_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_field_values().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("creative-field-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(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(["search-string", "sort-field", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_field_values_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["id", "kind", "value"]); + 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::CreativeFieldValue = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_field_values().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("creative-field-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_field_values_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["id", "kind", "value"]); + 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::CreativeFieldValue = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_field_values().update(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("creative-field-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_fields_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_fields().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _creative_fields_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_fields().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_fields_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "id", "kind", "match-type", "name", "subaccount-id", "value"]); + 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::CreativeField = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_fields().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_fields_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_fields().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "advertiser-ids" => { + call = call.add_advertiser_ids(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(["search-string", "sort-field", "advertiser-ids", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_fields_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "id", "kind", "match-type", "name", "subaccount-id", "value"]); + 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::CreativeField = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_fields().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_fields_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "id", "kind", "match-type", "name", "subaccount-id", "value"]); + 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::CreativeField = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_fields().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_groups().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_groups_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "group-number" => Some(("groupNumber", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "group-number", "id", "kind", "match-type", "name", "subaccount-id", "value"]); + 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::CreativeGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_groups().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creative_groups().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "group-number" => { + call = call.group_number(arg_from_str(value.unwrap_or("-0"), err, "group-number", "integer")); + }, + "advertiser-ids" => { + call = call.add_advertiser_ids(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(["search-string", "sort-field", "advertiser-ids", "ids", "max-results", "group-number", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_groups_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "group-number" => Some(("groupNumber", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "group-number", "id", "kind", "match-type", "name", "subaccount-id", "value"]); + 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::CreativeGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_groups().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creative_groups_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "group-number" => Some(("groupNumber", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "group-number", "id", "kind", "match-type", "name", "subaccount-id", "value"]); + 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::CreativeGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.creative_groups().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creatives_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creatives().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creatives_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "artwork-type" => Some(("artworkType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "latest-trafficked-creative-id" => Some(("latestTraffickedCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-plugin-version" => Some(("requiredFlashPluginVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fs-command.window-height" => Some(("fsCommand.windowHeight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.top" => Some(("fsCommand.top", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.window-width" => Some(("fsCommand.windowWidth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.position-option" => Some(("fsCommand.positionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fs-command.left" => Some(("fsCommand.left", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.kind" => Some(("renderingIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.value" => Some(("renderingIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.dimension-name" => Some(("renderingIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.etag" => Some(("renderingIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.match-type" => Some(("renderingIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.id" => Some(("renderingIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-asset-selection" => Some(("dynamicAssetSelection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "progress-offset.offset-percentage" => Some(("progressOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "progress-offset.offset-seconds" => Some(("progressOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "studio-trafficked-creative-id" => Some(("studioTraffickedCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "override-css" => Some(("overrideCss", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authoring-source" => Some(("authoringSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-version" => Some(("requiredFlashVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rendering-id" => Some(("renderingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-description" => Some(("videoDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "skip-offset.offset-percentage" => Some(("skipOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "skip-offset.offset-seconds" => Some(("skipOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "third-party-backup-image-impressions-url" => Some(("thirdPartyBackupImageImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "universal-ad-id.registry" => Some(("universalAdId.registry", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "universal-ad-id.value" => Some(("universalAdId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "background-color" => Some(("backgroundColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-key-values" => Some(("customKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-file-size" => Some(("totalFileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "third-party-rich-media-impressions-url" => Some(("thirdPartyRichMediaImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "studio-advertiser-id" => Some(("studioAdvertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-advance-images" => Some(("autoAdvanceImages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-duration" => Some(("videoDuration", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "redirect-url" => Some(("redirectUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "commercial-id" => Some(("commercialId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "backup-image-reporting-label" => Some(("backupImageReportingLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ad-parameters" => Some(("adParameters", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "html-code-locked" => Some(("htmlCodeLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-tag-keys" => Some(("adTagKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "convert-flash-to-html5" => Some(("convertFlashToHtml5", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ssl-override" => Some(("sslOverride", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url" => Some(("backupImageClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "studio-creative-id" => Some(("studioCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authoring-tool" => Some(("authoringTool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-script-access" => Some(("allowScriptAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "companion-creatives" => Some(("companionCreatives", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "creative-asset-selection.default-asset-id" => Some(("creativeAssetSelection.defaultAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "html-code" => Some(("htmlCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-features" => Some(("backupImageFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "backup-image-target-window.custom-html" => Some(("backupImageTargetWindow.customHtml", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-target-window.target-window-option" => Some(("backupImageTargetWindow.targetWindowOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "skippable" => Some(("skippable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "ad-parameters", "ad-tag-keys", "advertiser-id", "allow-script-access", "archived", "artwork-type", "authoring-source", "authoring-tool", "auto-advance-images", "background-color", "backup-image-click-through-url", "backup-image-features", "backup-image-reporting-label", "backup-image-target-window", "commercial-id", "companion-creatives", "compatibility", "convert-flash-to-html5", "creative-asset-selection", "custom-html", "custom-key-values", "default-asset-id", "dimension-name", "dynamic-asset-selection", "etag", "fs-command", "height", "html-code", "html-code-locked", "iab", "id", "id-dimension-value", "kind", "last-modified-info", "latest-trafficked-creative-id", "left", "match-type", "name", "offset-percentage", "offset-seconds", "override-css", "position-option", "progress-offset", "redirect-url", "registry", "rendering-id", "rendering-id-dimension-value", "required-flash-plugin-version", "required-flash-version", "size", "skip-offset", "skippable", "ssl-compliant", "ssl-override", "studio-advertiser-id", "studio-creative-id", "studio-trafficked-creative-id", "subaccount-id", "target-window-option", "third-party-backup-image-impressions-url", "third-party-rich-media-impressions-url", "time", "top", "total-file-size", "type", "universal-ad-id", "value", "version", "video-description", "video-duration", "width", "window-height", "window-width"]); + 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::Creative = json::value::from_value(object).unwrap(); + let mut call = self.hub.creatives().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creatives_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.creatives().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "types" => { + call = call.add_types(value.unwrap_or("")); + }, + "studio-creative-id" => { + call = call.studio_creative_id(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "size-ids" => { + call = call.add_size_ids(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "rendering-ids" => { + call = call.add_rendering_ids(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "creative-field-ids" => { + call = call.add_creative_field_ids(value.unwrap_or("")); + }, + "companion-creative-ids" => { + call = call.add_companion_creative_ids(value.unwrap_or("")); + }, + "campaign-id" => { + call = call.campaign_id(value.unwrap_or("")); + }, + "archived" => { + call = call.archived(arg_from_str(value.unwrap_or("false"), err, "archived", "boolean")); + }, + "advertiser-id" => { + call = call.advertiser_id(value.unwrap_or("")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + _ => { + 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(["advertiser-id", "archived", "search-string", "max-results", "campaign-id", "sort-field", "rendering-ids", "ids", "studio-creative-id", "size-ids", "page-token", "sort-order", "companion-creative-ids", "active", "creative-field-ids", "types"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creatives_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "artwork-type" => Some(("artworkType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "latest-trafficked-creative-id" => Some(("latestTraffickedCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-plugin-version" => Some(("requiredFlashPluginVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fs-command.window-height" => Some(("fsCommand.windowHeight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.top" => Some(("fsCommand.top", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.window-width" => Some(("fsCommand.windowWidth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.position-option" => Some(("fsCommand.positionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fs-command.left" => Some(("fsCommand.left", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.kind" => Some(("renderingIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.value" => Some(("renderingIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.dimension-name" => Some(("renderingIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.etag" => Some(("renderingIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.match-type" => Some(("renderingIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.id" => Some(("renderingIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-asset-selection" => Some(("dynamicAssetSelection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "progress-offset.offset-percentage" => Some(("progressOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "progress-offset.offset-seconds" => Some(("progressOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "studio-trafficked-creative-id" => Some(("studioTraffickedCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "override-css" => Some(("overrideCss", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authoring-source" => Some(("authoringSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-version" => Some(("requiredFlashVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rendering-id" => Some(("renderingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-description" => Some(("videoDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "skip-offset.offset-percentage" => Some(("skipOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "skip-offset.offset-seconds" => Some(("skipOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "third-party-backup-image-impressions-url" => Some(("thirdPartyBackupImageImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "universal-ad-id.registry" => Some(("universalAdId.registry", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "universal-ad-id.value" => Some(("universalAdId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "background-color" => Some(("backgroundColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-key-values" => Some(("customKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-file-size" => Some(("totalFileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "third-party-rich-media-impressions-url" => Some(("thirdPartyRichMediaImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "studio-advertiser-id" => Some(("studioAdvertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-advance-images" => Some(("autoAdvanceImages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-duration" => Some(("videoDuration", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "redirect-url" => Some(("redirectUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "commercial-id" => Some(("commercialId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "backup-image-reporting-label" => Some(("backupImageReportingLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ad-parameters" => Some(("adParameters", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "html-code-locked" => Some(("htmlCodeLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-tag-keys" => Some(("adTagKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "convert-flash-to-html5" => Some(("convertFlashToHtml5", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ssl-override" => Some(("sslOverride", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url" => Some(("backupImageClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "studio-creative-id" => Some(("studioCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authoring-tool" => Some(("authoringTool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-script-access" => Some(("allowScriptAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "companion-creatives" => Some(("companionCreatives", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "creative-asset-selection.default-asset-id" => Some(("creativeAssetSelection.defaultAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "html-code" => Some(("htmlCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-features" => Some(("backupImageFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "backup-image-target-window.custom-html" => Some(("backupImageTargetWindow.customHtml", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-target-window.target-window-option" => Some(("backupImageTargetWindow.targetWindowOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "skippable" => Some(("skippable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "ad-parameters", "ad-tag-keys", "advertiser-id", "allow-script-access", "archived", "artwork-type", "authoring-source", "authoring-tool", "auto-advance-images", "background-color", "backup-image-click-through-url", "backup-image-features", "backup-image-reporting-label", "backup-image-target-window", "commercial-id", "companion-creatives", "compatibility", "convert-flash-to-html5", "creative-asset-selection", "custom-html", "custom-key-values", "default-asset-id", "dimension-name", "dynamic-asset-selection", "etag", "fs-command", "height", "html-code", "html-code-locked", "iab", "id", "id-dimension-value", "kind", "last-modified-info", "latest-trafficked-creative-id", "left", "match-type", "name", "offset-percentage", "offset-seconds", "override-css", "position-option", "progress-offset", "redirect-url", "registry", "rendering-id", "rendering-id-dimension-value", "required-flash-plugin-version", "required-flash-version", "size", "skip-offset", "skippable", "ssl-compliant", "ssl-override", "studio-advertiser-id", "studio-creative-id", "studio-trafficked-creative-id", "subaccount-id", "target-window-option", "third-party-backup-image-impressions-url", "third-party-rich-media-impressions-url", "time", "top", "total-file-size", "type", "universal-ad-id", "value", "version", "video-description", "video-duration", "width", "window-height", "window-width"]); + 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::Creative = json::value::from_value(object).unwrap(); + let mut call = self.hub.creatives().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _creatives_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "artwork-type" => Some(("artworkType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "latest-trafficked-creative-id" => Some(("latestTraffickedCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-plugin-version" => Some(("requiredFlashPluginVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fs-command.window-height" => Some(("fsCommand.windowHeight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.top" => Some(("fsCommand.top", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.window-width" => Some(("fsCommand.windowWidth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "fs-command.position-option" => Some(("fsCommand.positionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fs-command.left" => Some(("fsCommand.left", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.kind" => Some(("renderingIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.value" => Some(("renderingIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.dimension-name" => Some(("renderingIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.etag" => Some(("renderingIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.match-type" => Some(("renderingIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rendering-id-dimension-value.id" => Some(("renderingIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-asset-selection" => Some(("dynamicAssetSelection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "progress-offset.offset-percentage" => Some(("progressOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "progress-offset.offset-seconds" => Some(("progressOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "studio-trafficked-creative-id" => Some(("studioTraffickedCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "override-css" => Some(("overrideCss", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authoring-source" => Some(("authoringSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-version" => Some(("requiredFlashVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rendering-id" => Some(("renderingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-description" => Some(("videoDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "skip-offset.offset-percentage" => Some(("skipOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "skip-offset.offset-seconds" => Some(("skipOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "third-party-backup-image-impressions-url" => Some(("thirdPartyBackupImageImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "universal-ad-id.registry" => Some(("universalAdId.registry", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "universal-ad-id.value" => Some(("universalAdId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "background-color" => Some(("backgroundColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-key-values" => Some(("customKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-file-size" => Some(("totalFileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "third-party-rich-media-impressions-url" => Some(("thirdPartyRichMediaImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "studio-advertiser-id" => Some(("studioAdvertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-advance-images" => Some(("autoAdvanceImages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-duration" => Some(("videoDuration", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "redirect-url" => Some(("redirectUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "commercial-id" => Some(("commercialId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "backup-image-reporting-label" => Some(("backupImageReportingLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ad-parameters" => Some(("adParameters", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "html-code-locked" => Some(("htmlCodeLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-tag-keys" => Some(("adTagKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "convert-flash-to-html5" => Some(("convertFlashToHtml5", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ssl-override" => Some(("sslOverride", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url" => Some(("backupImageClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "studio-creative-id" => Some(("studioCreativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authoring-tool" => Some(("authoringTool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-script-access" => Some(("allowScriptAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "companion-creatives" => Some(("companionCreatives", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "creative-asset-selection.default-asset-id" => Some(("creativeAssetSelection.defaultAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "html-code" => Some(("htmlCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-features" => Some(("backupImageFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "backup-image-target-window.custom-html" => Some(("backupImageTargetWindow.customHtml", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-target-window.target-window-option" => Some(("backupImageTargetWindow.targetWindowOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "skippable" => Some(("skippable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "ad-parameters", "ad-tag-keys", "advertiser-id", "allow-script-access", "archived", "artwork-type", "authoring-source", "authoring-tool", "auto-advance-images", "background-color", "backup-image-click-through-url", "backup-image-features", "backup-image-reporting-label", "backup-image-target-window", "commercial-id", "companion-creatives", "compatibility", "convert-flash-to-html5", "creative-asset-selection", "custom-html", "custom-key-values", "default-asset-id", "dimension-name", "dynamic-asset-selection", "etag", "fs-command", "height", "html-code", "html-code-locked", "iab", "id", "id-dimension-value", "kind", "last-modified-info", "latest-trafficked-creative-id", "left", "match-type", "name", "offset-percentage", "offset-seconds", "override-css", "position-option", "progress-offset", "redirect-url", "registry", "rendering-id", "rendering-id-dimension-value", "required-flash-plugin-version", "required-flash-version", "size", "skip-offset", "skippable", "ssl-compliant", "ssl-override", "studio-advertiser-id", "studio-creative-id", "studio-trafficked-creative-id", "subaccount-id", "target-window-option", "third-party-backup-image-impressions-url", "third-party-rich-media-impressions-url", "time", "top", "total-file-size", "type", "universal-ad-id", "value", "version", "video-description", "video-duration", "width", "window-height", "window-width"]); + 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::Creative = json::value::from_value(object).unwrap(); + let mut call = self.hub.creatives().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _dimension_values_query(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "dimension-name" => Some(("dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-date" => Some(("startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-date" => Some(("endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dimension-name", "end-date", "kind", "start-date"]); + 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::DimensionValueRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.dimension_values().query(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _directory_site_contacts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.directory_site_contacts().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _directory_site_contacts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.directory_site_contacts().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "directory-site-ids" => { + call = call.add_directory_site_ids(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(["search-string", "directory-site-ids", "sort-field", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _directory_sites_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.directory_sites().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _directory_sites_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "country-id" => Some(("countryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.nielsen-ocr-opt-out" => Some(("settings.nielsenOcrOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.active-view-opt-out" => Some(("settings.activeViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.verification-tag-opt-out" => Some(("settings.verificationTagOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.dfp-settings.dfp-network-code" => Some(("settings.dfpSettings.dfpNetworkCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.dfp-settings.publisher-portal-only" => Some(("settings.dfpSettings.publisherPortalOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.dfp-settings.programmatic-placement-accepted" => Some(("settings.dfpSettings.programmaticPlacementAccepted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.dfp-settings.pub-paid-placement-accepted" => Some(("settings.dfpSettings.pubPaidPlacementAccepted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.dfp-settings.dfp-network-name" => Some(("settings.dfpSettings.dfpNetworkName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.interstitial-placement-accepted" => Some(("settings.interstitialPlacementAccepted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.video-active-view-opt-out" => Some(("settings.videoActiveViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.instream-video-placement-accepted" => Some(("settings.instreamVideoPlacementAccepted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "currency-id" => Some(("currencyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inpage-tag-formats" => Some(("inpageTagFormats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-id" => Some(("parentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interstitial-tag-formats" => Some(("interstitialTagFormats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, 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!["active", "active-view-opt-out", "country-id", "currency-id", "description", "dfp-network-code", "dfp-network-name", "dfp-settings", "dimension-name", "etag", "id", "id-dimension-value", "inpage-tag-formats", "instream-video-placement-accepted", "interstitial-placement-accepted", "interstitial-tag-formats", "kind", "match-type", "name", "nielsen-ocr-opt-out", "parent-id", "programmatic-placement-accepted", "pub-paid-placement-accepted", "publisher-portal-only", "settings", "url", "value", "verification-tag-opt-out", "video-active-view-opt-out"]); + 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::DirectorySite = json::value::from_value(object).unwrap(); + let mut call = self.hub.directory_sites().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _directory_sites_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.directory_sites().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "parent-id" => { + call = call.parent_id(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "dfp-network-code" => { + call = call.dfp_network_code(value.unwrap_or("")); + }, + "country-id" => { + call = call.country_id(value.unwrap_or("")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + "accepts-publisher-paid-placements" => { + call = call.accepts_publisher_paid_placements(arg_from_str(value.unwrap_or("false"), err, "accepts-publisher-paid-placements", "boolean")); + }, + "accepts-interstitial-placements" => { + call = call.accepts_interstitial_placements(arg_from_str(value.unwrap_or("false"), err, "accepts-interstitial-placements", "boolean")); + }, + "accepts-in-stream-video-placements" => { + call = call.accepts_in_stream_video_placements(arg_from_str(value.unwrap_or("false"), err, "accepts-in-stream-video-placements", "boolean")); + }, + _ => { + 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(["accepts-interstitial-placements", "dfp-network-code", "search-string", "country-id", "accepts-in-stream-video-placements", "sort-field", "ids", "max-results", "page-token", "sort-order", "parent-id", "active", "accepts-publisher-paid-placements"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _dynamic_targeting_keys_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.dynamic_targeting_keys().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("object-id").unwrap_or(""), opt.value_of("name").unwrap_or(""), opt.value_of("object-type").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _dynamic_targeting_keys_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "object-id" => Some(("objectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "object-type" => Some(("objectType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "name", "object-id", "object-type"]); + 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::DynamicTargetingKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.dynamic_targeting_keys().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _dynamic_targeting_keys_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.dynamic_targeting_keys().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "object-type" => { + call = call.object_type(value.unwrap_or("")); + }, + "object-id" => { + call = call.object_id(value.unwrap_or("")); + }, + "names" => { + call = call.add_names(value.unwrap_or("")); + }, + "advertiser-id" => { + call = call.advertiser_id(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(["advertiser-id", "names", "object-id", "object-type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _event_tags_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.event_tags().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _event_tags_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.event_tags().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _event_tags_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-ids" => Some(("siteIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "url-escape-levels" => Some(("urlEscapeLevels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabled-by-default" => Some(("enabledByDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter-type" => Some(("siteFilterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "exclude-from-adx-requests" => Some(("excludeFromAdxRequests", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "campaign-id", "campaign-id-dimension-value", "dimension-name", "enabled-by-default", "etag", "exclude-from-adx-requests", "id", "kind", "match-type", "name", "site-filter-type", "site-ids", "ssl-compliant", "status", "subaccount-id", "type", "url", "url-escape-levels", "value"]); + 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::EventTag = json::value::from_value(object).unwrap(); + let mut call = self.hub.event_tags().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _event_tags_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.event_tags().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "event-tag-types" => { + call = call.add_event_tag_types(value.unwrap_or("")); + }, + "enabled" => { + call = call.enabled(arg_from_str(value.unwrap_or("false"), err, "enabled", "boolean")); + }, + "definitions-only" => { + call = call.definitions_only(arg_from_str(value.unwrap_or("false"), err, "definitions-only", "boolean")); + }, + "campaign-id" => { + call = call.campaign_id(value.unwrap_or("")); + }, + "advertiser-id" => { + call = call.advertiser_id(value.unwrap_or("")); + }, + "ad-id" => { + call = call.ad_id(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(["search-string", "campaign-id", "sort-field", "enabled", "ids", "advertiser-id", "ad-id", "sort-order", "event-tag-types", "definitions-only"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _event_tags_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-ids" => Some(("siteIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "url-escape-levels" => Some(("urlEscapeLevels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabled-by-default" => Some(("enabledByDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter-type" => Some(("siteFilterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "exclude-from-adx-requests" => Some(("excludeFromAdxRequests", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "campaign-id", "campaign-id-dimension-value", "dimension-name", "enabled-by-default", "etag", "exclude-from-adx-requests", "id", "kind", "match-type", "name", "site-filter-type", "site-ids", "ssl-compliant", "status", "subaccount-id", "type", "url", "url-escape-levels", "value"]); + 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::EventTag = json::value::from_value(object).unwrap(); + let mut call = self.hub.event_tags().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _event_tags_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-ids" => Some(("siteIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "url-escape-levels" => Some(("urlEscapeLevels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabled-by-default" => Some(("enabledByDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-filter-type" => Some(("siteFilterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "exclude-from-adx-requests" => Some(("excludeFromAdxRequests", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "campaign-id", "campaign-id-dimension-value", "dimension-name", "enabled-by-default", "etag", "exclude-from-adx-requests", "id", "kind", "match-type", "name", "site-filter-type", "site-ids", "ssl-compliant", "status", "subaccount-id", "type", "url", "url-escape-levels", "value"]); + 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::EventTag = json::value::from_value(object).unwrap(); + let mut call = self.hub.event_tags().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _files_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut download_mode = false; + let mut call = self.hub.files().get(opt.value_of("report-id").unwrap_or(""), opt.value_of("file-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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 { + if key == "alt" && value.unwrap_or("unset") == "media" { + download_mode = true; + } + 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").map(|i|i.collect()).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)) => { + if !download_mode { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + 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(()) + } + } + } + } + + fn _files_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.files().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "scope" => { + call = call.scope(value.unwrap_or("")); + }, + "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")); + }, + _ => { + 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(["sort-field", "max-results", "sort-order", "page-token", "scope"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activities_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_activities().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _floodlight_activities_generatetag(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_activities().generatetag(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "floodlight-activity-id" => { + call = call.floodlight_activity_id(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(["floodlight-activity-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activities_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_activities().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activities_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "tag-string" => Some(("tagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "secure" => Some(("secure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-activity-group-name" => Some(("floodlightActivityGroupName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "image-tag-enabled" => Some(("imageTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-id" => Some(("floodlightActivityGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-tag-string" => Some(("floodlightActivityGroupTagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cache-busting-type" => Some(("cacheBustingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hidden" => Some(("hidden", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "expected-url" => Some(("expectedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-format" => Some(("tagFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-defined-variable-types" => Some(("userDefinedVariableTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "counting-method" => Some(("countingMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-type" => Some(("floodlightActivityGroupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advertiser-id", "advertiser-id-dimension-value", "cache-busting-type", "counting-method", "dimension-name", "etag", "expected-url", "floodlight-activity-group-id", "floodlight-activity-group-name", "floodlight-activity-group-tag-string", "floodlight-activity-group-type", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "hidden", "id", "id-dimension-value", "image-tag-enabled", "kind", "match-type", "name", "notes", "secure", "ssl-compliant", "ssl-required", "subaccount-id", "tag-format", "tag-string", "user-defined-variable-types", "value"]); + 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::FloodlightActivity = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_activities().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activities_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_activities().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "tag-string" => { + call = call.tag_string(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "floodlight-configuration-id" => { + call = call.floodlight_configuration_id(value.unwrap_or("")); + }, + "floodlight-activity-group-type" => { + call = call.floodlight_activity_group_type(value.unwrap_or("")); + }, + "floodlight-activity-group-tag-string" => { + call = call.floodlight_activity_group_tag_string(value.unwrap_or("")); + }, + "floodlight-activity-group-name" => { + call = call.floodlight_activity_group_name(value.unwrap_or("")); + }, + "floodlight-activity-group-ids" => { + call = call.add_floodlight_activity_group_ids(value.unwrap_or("")); + }, + "advertiser-id" => { + call = call.advertiser_id(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(["floodlight-activity-group-ids", "search-string", "floodlight-activity-group-name", "sort-field", "floodlight-configuration-id", "ids", "max-results", "advertiser-id", "page-token", "sort-order", "tag-string", "floodlight-activity-group-tag-string", "floodlight-activity-group-type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activities_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "tag-string" => Some(("tagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "secure" => Some(("secure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-activity-group-name" => Some(("floodlightActivityGroupName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "image-tag-enabled" => Some(("imageTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-id" => Some(("floodlightActivityGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-tag-string" => Some(("floodlightActivityGroupTagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cache-busting-type" => Some(("cacheBustingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hidden" => Some(("hidden", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "expected-url" => Some(("expectedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-format" => Some(("tagFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-defined-variable-types" => Some(("userDefinedVariableTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "counting-method" => Some(("countingMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-type" => Some(("floodlightActivityGroupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advertiser-id", "advertiser-id-dimension-value", "cache-busting-type", "counting-method", "dimension-name", "etag", "expected-url", "floodlight-activity-group-id", "floodlight-activity-group-name", "floodlight-activity-group-tag-string", "floodlight-activity-group-type", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "hidden", "id", "id-dimension-value", "image-tag-enabled", "kind", "match-type", "name", "notes", "secure", "ssl-compliant", "ssl-required", "subaccount-id", "tag-format", "tag-string", "user-defined-variable-types", "value"]); + 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::FloodlightActivity = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_activities().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activities_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "tag-string" => Some(("tagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "secure" => Some(("secure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-activity-group-name" => Some(("floodlightActivityGroupName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "image-tag-enabled" => Some(("imageTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-id" => Some(("floodlightActivityGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-tag-string" => Some(("floodlightActivityGroupTagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cache-busting-type" => Some(("cacheBustingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hidden" => Some(("hidden", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "expected-url" => Some(("expectedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-format" => Some(("tagFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-defined-variable-types" => Some(("userDefinedVariableTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "counting-method" => Some(("countingMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-activity-group-type" => Some(("floodlightActivityGroupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advertiser-id", "advertiser-id-dimension-value", "cache-busting-type", "counting-method", "dimension-name", "etag", "expected-url", "floodlight-activity-group-id", "floodlight-activity-group-name", "floodlight-activity-group-tag-string", "floodlight-activity-group-type", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "hidden", "id", "id-dimension-value", "image-tag-enabled", "kind", "match-type", "name", "notes", "secure", "ssl-compliant", "ssl-required", "subaccount-id", "tag-format", "tag-string", "user-defined-variable-types", "value"]); + 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::FloodlightActivity = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_activities().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activity_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_activity_groups().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activity_groups_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-string" => Some(("tagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "id", "id-dimension-value", "kind", "match-type", "name", "subaccount-id", "tag-string", "type", "value"]); + 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::FloodlightActivityGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_activity_groups().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activity_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_activity_groups().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.type_(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "floodlight-configuration-id" => { + call = call.floodlight_configuration_id(value.unwrap_or("")); + }, + "advertiser-id" => { + call = call.advertiser_id(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(["search-string", "sort-field", "floodlight-configuration-id", "ids", "max-results", "advertiser-id", "page-token", "sort-order", "type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activity_groups_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-string" => Some(("tagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "id", "id-dimension-value", "kind", "match-type", "name", "subaccount-id", "tag-string", "type", "value"]); + 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::FloodlightActivityGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_activity_groups().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_activity_groups_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id" => Some(("floodlightConfigurationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.kind" => Some(("floodlightConfigurationIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.value" => Some(("floodlightConfigurationIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.dimension-name" => Some(("floodlightConfigurationIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.etag" => Some(("floodlightConfigurationIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.match-type" => Some(("floodlightConfigurationIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-configuration-id-dimension-value.id" => Some(("floodlightConfigurationIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-string" => Some(("tagString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "dimension-name", "etag", "floodlight-configuration-id", "floodlight-configuration-id-dimension-value", "id", "id-dimension-value", "kind", "match-type", "name", "subaccount-id", "tag-string", "type", "value"]); + 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::FloodlightActivityGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_activity_groups().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_configurations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_configurations().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_configurations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.floodlight_configurations().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "ids" => { + call = call.add_ids(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(["ids"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_configurations_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "natural-search-conversion-attribution-option" => Some(("naturalSearchConversionAttributionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "exposure-to-conversion-enabled" => Some(("exposureToConversionEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "analytics-data-sharing-enabled" => Some(("analyticsDataSharingEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "first-day-of-week" => Some(("firstDayOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "omniture-settings.omniture-cost-data-enabled" => Some(("omnitureSettings.omnitureCostDataEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "omniture-settings.omniture-integration-enabled" => Some(("omnitureSettings.omnitureIntegrationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-settings.dynamic-tag-enabled" => Some(("tagSettings.dynamicTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-settings.image-tag-enabled" => Some(("tagSettings.imageTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "in-app-attribution-tracking-enabled" => Some(("inAppAttributionTrackingEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "analytics-data-sharing-enabled", "click-duration", "dimension-name", "dynamic-tag-enabled", "etag", "exposure-to-conversion-enabled", "first-day-of-week", "id", "id-dimension-value", "image-tag-enabled", "in-app-attribution-tracking-enabled", "kind", "lookback-configuration", "match-type", "natural-search-conversion-attribution-option", "omniture-cost-data-enabled", "omniture-integration-enabled", "omniture-settings", "post-impression-activities-duration", "subaccount-id", "tag-settings", "value"]); + 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::FloodlightConfiguration = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_configurations().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _floodlight_configurations_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "natural-search-conversion-attribution-option" => Some(("naturalSearchConversionAttributionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "exposure-to-conversion-enabled" => Some(("exposureToConversionEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "analytics-data-sharing-enabled" => Some(("analyticsDataSharingEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "first-day-of-week" => Some(("firstDayOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "omniture-settings.omniture-cost-data-enabled" => Some(("omnitureSettings.omnitureCostDataEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "omniture-settings.omniture-integration-enabled" => Some(("omnitureSettings.omnitureIntegrationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-settings.dynamic-tag-enabled" => Some(("tagSettings.dynamicTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-settings.image-tag-enabled" => Some(("tagSettings.imageTagEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "in-app-attribution-tracking-enabled" => Some(("inAppAttributionTrackingEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "analytics-data-sharing-enabled", "click-duration", "dimension-name", "dynamic-tag-enabled", "etag", "exposure-to-conversion-enabled", "first-day-of-week", "id", "id-dimension-value", "image-tag-enabled", "in-app-attribution-tracking-enabled", "kind", "lookback-configuration", "match-type", "natural-search-conversion-attribution-option", "omniture-cost-data-enabled", "omniture-integration-enabled", "omniture-settings", "post-impression-activities-duration", "subaccount-id", "tag-settings", "value"]); + 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::FloodlightConfiguration = json::value::from_value(object).unwrap(); + let mut call = self.hub.floodlight_configurations().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inventory_items_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.inventory_items().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("project-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inventory_items_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.inventory_items().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.type_(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "site-id" => { + call = call.add_site_id(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-id" => { + call = call.add_order_id(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "in-plan" => { + call = call.in_plan(arg_from_str(value.unwrap_or("false"), err, "in-plan", "boolean")); + }, + "ids" => { + call = call.add_ids(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(["order-id", "sort-field", "ids", "max-results", "page-token", "in-plan", "site-id", "sort-order", "type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _landing_pages_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.landing_pages().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _landing_pages_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.landing_pages().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _landing_pages_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "default" => Some(("default", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", 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!["default", "id", "kind", "name", "url"]); + 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::LandingPage = json::value::from_value(object).unwrap(); + let mut call = self.hub.landing_pages().insert(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _landing_pages_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.landing_pages().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _landing_pages_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "default" => Some(("default", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", 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!["default", "id", "kind", "name", "url"]); + 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::LandingPage = json::value::from_value(object).unwrap(); + let mut call = self.hub.landing_pages().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _landing_pages_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "default" => Some(("default", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", 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!["default", "id", "kind", "name", "url"]); + 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::LandingPage = json::value::from_value(object).unwrap(); + let mut call = self.hub.landing_pages().update(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("campaign-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _languages_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.languages().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _metros_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.metros().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _mobile_carriers_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.mobile_carriers().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _mobile_carriers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.mobile_carriers().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operating_system_versions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operating_system_versions().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operating_system_versions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operating_system_versions().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operating_systems_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operating_systems().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("dart-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operating_systems_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operating_systems().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _order_documents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.order_documents().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("project-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _order_documents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.order_documents().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "site-id" => { + call = call.add_site_id(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-id" => { + call = call.add_order_id(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "approved" => { + call = call.approved(arg_from_str(value.unwrap_or("false"), err, "approved", "boolean")); + }, + _ => { + 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(["order-id", "search-string", "sort-field", "ids", "max-results", "page-token", "site-id", "sort-order", "approved"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _orders_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.orders().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("project-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _orders_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.orders().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "site-id" => { + call = call.add_site_id(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(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(["search-string", "sort-field", "ids", "max-results", "page-token", "site-id", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placement_groups().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_groups_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id" => Some(("primaryPlacementId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-type" => Some(("placementGroupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "child-placement-ids" => Some(("childPlacementIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "content-category-id" => Some(("contentCategoryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.kind" => Some(("primaryPlacementIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.value" => Some(("primaryPlacementIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.dimension-name" => Some(("primaryPlacementIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.etag" => Some(("primaryPlacementIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.match-type" => Some(("primaryPlacementIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.id" => Some(("primaryPlacementIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id" => Some(("siteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.kind" => Some(("siteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.value" => Some(("siteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.dimension-name" => Some(("siteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.etag" => Some(("siteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.match-type" => Some(("siteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.id" => Some(("siteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-strategy-id" => Some(("placementStrategyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.start-date" => Some(("pricingSchedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.end-date" => Some(("pricingSchedule.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.flighted" => Some(("pricingSchedule.flighted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.disregard-overdelivery" => Some(("pricingSchedule.disregardOverdelivery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.pricing-type" => Some(("pricingSchedule.pricingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.cap-cost-option" => Some(("pricingSchedule.capCostOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.testing-start-date" => Some(("pricingSchedule.testingStartDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.floodlight-activity-id" => Some(("pricingSchedule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advertiser-id", "advertiser-id-dimension-value", "archived", "campaign-id", "campaign-id-dimension-value", "cap-cost-option", "child-placement-ids", "comment", "content-category-id", "create-info", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disregard-overdelivery", "end-date", "etag", "external-id", "flighted", "floodlight-activity-id", "id", "id-dimension-value", "kind", "last-modified-info", "match-type", "name", "placement-group-type", "placement-strategy-id", "pricing-schedule", "pricing-type", "primary-placement-id", "primary-placement-id-dimension-value", "site-id", "site-id-dimension-value", "start-date", "subaccount-id", "testing-start-date", "time", "value"]); + 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::PlacementGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.placement_groups().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placement_groups().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "site-ids" => { + call = call.add_site_ids(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "pricing-types" => { + call = call.add_pricing_types(value.unwrap_or("")); + }, + "placement-strategy-ids" => { + call = call.add_placement_strategy_ids(value.unwrap_or("")); + }, + "placement-group-type" => { + call = call.placement_group_type(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "min-start-date" => { + call = call.min_start_date(value.unwrap_or("")); + }, + "min-end-date" => { + call = call.min_end_date(value.unwrap_or("")); + }, + "max-start-date" => { + call = call.max_start_date(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "max-end-date" => { + call = call.max_end_date(value.unwrap_or("")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "directory-site-ids" => { + call = call.add_directory_site_ids(value.unwrap_or("")); + }, + "content-category-ids" => { + call = call.add_content_category_ids(value.unwrap_or("")); + }, + "campaign-ids" => { + call = call.add_campaign_ids(value.unwrap_or("")); + }, + "archived" => { + call = call.archived(arg_from_str(value.unwrap_or("false"), err, "archived", "boolean")); + }, + "advertiser-ids" => { + call = call.add_advertiser_ids(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(["placement-strategy-ids", "site-ids", "search-string", "min-end-date", "directory-site-ids", "sort-field", "advertiser-ids", "archived", "ids", "max-results", "min-start-date", "page-token", "max-start-date", "sort-order", "placement-group-type", "pricing-types", "content-category-ids", "campaign-ids", "max-end-date"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_groups_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id" => Some(("primaryPlacementId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-type" => Some(("placementGroupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "child-placement-ids" => Some(("childPlacementIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "content-category-id" => Some(("contentCategoryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.kind" => Some(("primaryPlacementIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.value" => Some(("primaryPlacementIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.dimension-name" => Some(("primaryPlacementIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.etag" => Some(("primaryPlacementIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.match-type" => Some(("primaryPlacementIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.id" => Some(("primaryPlacementIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id" => Some(("siteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.kind" => Some(("siteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.value" => Some(("siteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.dimension-name" => Some(("siteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.etag" => Some(("siteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.match-type" => Some(("siteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.id" => Some(("siteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-strategy-id" => Some(("placementStrategyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.start-date" => Some(("pricingSchedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.end-date" => Some(("pricingSchedule.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.flighted" => Some(("pricingSchedule.flighted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.disregard-overdelivery" => Some(("pricingSchedule.disregardOverdelivery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.pricing-type" => Some(("pricingSchedule.pricingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.cap-cost-option" => Some(("pricingSchedule.capCostOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.testing-start-date" => Some(("pricingSchedule.testingStartDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.floodlight-activity-id" => Some(("pricingSchedule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advertiser-id", "advertiser-id-dimension-value", "archived", "campaign-id", "campaign-id-dimension-value", "cap-cost-option", "child-placement-ids", "comment", "content-category-id", "create-info", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disregard-overdelivery", "end-date", "etag", "external-id", "flighted", "floodlight-activity-id", "id", "id-dimension-value", "kind", "last-modified-info", "match-type", "name", "placement-group-type", "placement-strategy-id", "pricing-schedule", "pricing-type", "primary-placement-id", "primary-placement-id-dimension-value", "site-id", "site-id-dimension-value", "start-date", "subaccount-id", "testing-start-date", "time", "value"]); + 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::PlacementGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.placement_groups().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_groups_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id" => Some(("primaryPlacementId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-type" => Some(("placementGroupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "child-placement-ids" => Some(("childPlacementIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "content-category-id" => Some(("contentCategoryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.kind" => Some(("primaryPlacementIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.value" => Some(("primaryPlacementIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.dimension-name" => Some(("primaryPlacementIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.etag" => Some(("primaryPlacementIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.match-type" => Some(("primaryPlacementIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-placement-id-dimension-value.id" => Some(("primaryPlacementIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id" => Some(("siteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.kind" => Some(("siteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.value" => Some(("siteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.dimension-name" => Some(("siteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.etag" => Some(("siteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.match-type" => Some(("siteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.id" => Some(("siteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-strategy-id" => Some(("placementStrategyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.start-date" => Some(("pricingSchedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.end-date" => Some(("pricingSchedule.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.flighted" => Some(("pricingSchedule.flighted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.disregard-overdelivery" => Some(("pricingSchedule.disregardOverdelivery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.pricing-type" => Some(("pricingSchedule.pricingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.cap-cost-option" => Some(("pricingSchedule.capCostOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.testing-start-date" => Some(("pricingSchedule.testingStartDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.floodlight-activity-id" => Some(("pricingSchedule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advertiser-id", "advertiser-id-dimension-value", "archived", "campaign-id", "campaign-id-dimension-value", "cap-cost-option", "child-placement-ids", "comment", "content-category-id", "create-info", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disregard-overdelivery", "end-date", "etag", "external-id", "flighted", "floodlight-activity-id", "id", "id-dimension-value", "kind", "last-modified-info", "match-type", "name", "placement-group-type", "placement-strategy-id", "pricing-schedule", "pricing-type", "primary-placement-id", "primary-placement-id-dimension-value", "site-id", "site-id-dimension-value", "start-date", "subaccount-id", "testing-start-date", "time", "value"]); + 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::PlacementGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.placement_groups().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_strategies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placement_strategies().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _placement_strategies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placement_strategies().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_strategies_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::PlacementStrategy = json::value::from_value(object).unwrap(); + let mut call = self.hub.placement_strategies().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_strategies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placement_strategies().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(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(["search-string", "sort-field", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_strategies_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::PlacementStrategy = json::value::from_value(object).unwrap(); + let mut call = self.hub.placement_strategies().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placement_strategies_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", 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 })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "id", "kind", "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::PlacementStrategy = json::value::from_value(object).unwrap(); + let mut call = self.hub.placement_strategies().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placements_generatetags(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placements().generatetags(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "tag-formats" => { + call = call.add_tag_formats(value.unwrap_or("")); + }, + "placement-ids" => { + call = call.add_placement_ids(value.unwrap_or("")); + }, + "campaign-id" => { + call = call.campaign_id(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(["tag-formats", "placement-ids", "campaign-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placements_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placements().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placements_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-active-view-opt-out" => Some(("videoActiveViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "payment-source" => Some(("paymentSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-name" => Some(("keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.kind" => Some(("videoSettings.skippableSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skippable" => Some(("videoSettings.skippableSettings.skippable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skip-offset.offset-percentage" => Some(("videoSettings.skippableSettings.skipOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skip-offset.offset-seconds" => Some(("videoSettings.skippableSettings.skipOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.progress-offset.offset-percentage" => Some(("videoSettings.skippableSettings.progressOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.progress-offset.offset-seconds" => Some(("videoSettings.skippableSettings.progressOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.kind" => Some(("videoSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.companion-settings.kind" => Some(("videoSettings.companionSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.companion-settings.companions-disabled" => Some(("videoSettings.companionSettings.companionsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.companion-settings.image-only" => Some(("videoSettings.companionSettings.imageOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.transcode-settings.kind" => Some(("videoSettings.transcodeSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.transcode-settings.enabled-video-formats" => Some(("videoSettings.transcodeSettings.enabledVideoFormats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "publisher-update-info.time" => Some(("publisherUpdateInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-formats" => Some(("tagFormats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "payment-approved" => Some(("paymentApproved", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.include-click-through-urls" => Some(("tagSetting.includeClickThroughUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.include-click-tracking" => Some(("tagSetting.includeClickTracking", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.additional-key-values" => Some(("tagSetting.additionalKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-setting.keyword-option" => Some(("tagSetting.keywordOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-category-id" => Some(("contentCategoryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-opt-out" => Some(("adBlockingOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary" => Some(("primary", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement-group-id" => Some(("placementGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id" => Some(("siteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.kind" => Some(("siteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.value" => Some(("siteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.dimension-name" => Some(("siteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.etag" => Some(("siteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.match-type" => Some(("siteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.id" => Some(("siteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-strategy-id" => Some(("placementStrategyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.kind" => Some(("placementGroupIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.value" => Some(("placementGroupIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.dimension-name" => Some(("placementGroupIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.etag" => Some(("placementGroupIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.match-type" => Some(("placementGroupIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.id" => Some(("placementGroupIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.start-date" => Some(("pricingSchedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.end-date" => Some(("pricingSchedule.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.flighted" => Some(("pricingSchedule.flighted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.disregard-overdelivery" => Some(("pricingSchedule.disregardOverdelivery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.pricing-type" => Some(("pricingSchedule.pricingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.cap-cost-option" => Some(("pricingSchedule.capCostOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.testing-start-date" => Some(("pricingSchedule.testingStartDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.floodlight-activity-id" => Some(("pricingSchedule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpaid-adapter-choice" => Some(("vpaidAdapterChoice", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "ad-blocking-opt-out", "additional-key-values", "advertiser-id", "advertiser-id-dimension-value", "archived", "campaign-id", "campaign-id-dimension-value", "cap-cost-option", "click-duration", "comment", "companion-settings", "companions-disabled", "compatibility", "content-category-id", "create-info", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disregard-overdelivery", "enabled-video-formats", "end-date", "etag", "external-id", "flighted", "floodlight-activity-id", "height", "iab", "id", "id-dimension-value", "image-only", "include-click-through-urls", "include-click-tracking", "key-name", "keyword-option", "kind", "last-modified-info", "lookback-configuration", "match-type", "name", "offset-percentage", "offset-seconds", "payment-approved", "payment-source", "placement-group-id", "placement-group-id-dimension-value", "placement-strategy-id", "post-impression-activities-duration", "pricing-schedule", "pricing-type", "primary", "progress-offset", "publisher-update-info", "site-id", "site-id-dimension-value", "size", "skip-offset", "skippable", "skippable-settings", "ssl-required", "start-date", "status", "subaccount-id", "tag-formats", "tag-setting", "testing-start-date", "time", "transcode-settings", "value", "video-active-view-opt-out", "video-settings", "vpaid-adapter-choice", "width"]); + 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::Placement = json::value::from_value(object).unwrap(); + let mut call = self.hub.placements().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placements_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.placements().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "size-ids" => { + call = call.add_size_ids(value.unwrap_or("")); + }, + "site-ids" => { + call = call.add_site_ids(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "pricing-types" => { + call = call.add_pricing_types(value.unwrap_or("")); + }, + "placement-strategy-ids" => { + call = call.add_placement_strategy_ids(value.unwrap_or("")); + }, + "payment-source" => { + call = call.payment_source(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "min-start-date" => { + call = call.min_start_date(value.unwrap_or("")); + }, + "min-end-date" => { + call = call.min_end_date(value.unwrap_or("")); + }, + "max-start-date" => { + call = call.max_start_date(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "max-end-date" => { + call = call.max_end_date(value.unwrap_or("")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "group-ids" => { + call = call.add_group_ids(value.unwrap_or("")); + }, + "directory-site-ids" => { + call = call.add_directory_site_ids(value.unwrap_or("")); + }, + "content-category-ids" => { + call = call.add_content_category_ids(value.unwrap_or("")); + }, + "compatibilities" => { + call = call.add_compatibilities(value.unwrap_or("")); + }, + "campaign-ids" => { + call = call.add_campaign_ids(value.unwrap_or("")); + }, + "archived" => { + call = call.archived(arg_from_str(value.unwrap_or("false"), err, "archived", "boolean")); + }, + "advertiser-ids" => { + call = call.add_advertiser_ids(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(["site-ids", "payment-source", "pricing-types", "campaign-ids", "archived", "advertiser-ids", "size-ids", "page-token", "max-start-date", "sort-order", "max-end-date", "placement-strategy-ids", "content-category-ids", "max-results", "min-start-date", "compatibilities", "search-string", "min-end-date", "directory-site-ids", "sort-field", "ids", "group-ids"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placements_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-active-view-opt-out" => Some(("videoActiveViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "payment-source" => Some(("paymentSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-name" => Some(("keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.kind" => Some(("videoSettings.skippableSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skippable" => Some(("videoSettings.skippableSettings.skippable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skip-offset.offset-percentage" => Some(("videoSettings.skippableSettings.skipOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skip-offset.offset-seconds" => Some(("videoSettings.skippableSettings.skipOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.progress-offset.offset-percentage" => Some(("videoSettings.skippableSettings.progressOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.progress-offset.offset-seconds" => Some(("videoSettings.skippableSettings.progressOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.kind" => Some(("videoSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.companion-settings.kind" => Some(("videoSettings.companionSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.companion-settings.companions-disabled" => Some(("videoSettings.companionSettings.companionsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.companion-settings.image-only" => Some(("videoSettings.companionSettings.imageOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.transcode-settings.kind" => Some(("videoSettings.transcodeSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.transcode-settings.enabled-video-formats" => Some(("videoSettings.transcodeSettings.enabledVideoFormats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "publisher-update-info.time" => Some(("publisherUpdateInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-formats" => Some(("tagFormats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "payment-approved" => Some(("paymentApproved", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.include-click-through-urls" => Some(("tagSetting.includeClickThroughUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.include-click-tracking" => Some(("tagSetting.includeClickTracking", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.additional-key-values" => Some(("tagSetting.additionalKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-setting.keyword-option" => Some(("tagSetting.keywordOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-category-id" => Some(("contentCategoryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-opt-out" => Some(("adBlockingOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary" => Some(("primary", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement-group-id" => Some(("placementGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id" => Some(("siteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.kind" => Some(("siteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.value" => Some(("siteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.dimension-name" => Some(("siteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.etag" => Some(("siteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.match-type" => Some(("siteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.id" => Some(("siteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-strategy-id" => Some(("placementStrategyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.kind" => Some(("placementGroupIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.value" => Some(("placementGroupIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.dimension-name" => Some(("placementGroupIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.etag" => Some(("placementGroupIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.match-type" => Some(("placementGroupIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.id" => Some(("placementGroupIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.start-date" => Some(("pricingSchedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.end-date" => Some(("pricingSchedule.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.flighted" => Some(("pricingSchedule.flighted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.disregard-overdelivery" => Some(("pricingSchedule.disregardOverdelivery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.pricing-type" => Some(("pricingSchedule.pricingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.cap-cost-option" => Some(("pricingSchedule.capCostOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.testing-start-date" => Some(("pricingSchedule.testingStartDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.floodlight-activity-id" => Some(("pricingSchedule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpaid-adapter-choice" => Some(("vpaidAdapterChoice", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "ad-blocking-opt-out", "additional-key-values", "advertiser-id", "advertiser-id-dimension-value", "archived", "campaign-id", "campaign-id-dimension-value", "cap-cost-option", "click-duration", "comment", "companion-settings", "companions-disabled", "compatibility", "content-category-id", "create-info", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disregard-overdelivery", "enabled-video-formats", "end-date", "etag", "external-id", "flighted", "floodlight-activity-id", "height", "iab", "id", "id-dimension-value", "image-only", "include-click-through-urls", "include-click-tracking", "key-name", "keyword-option", "kind", "last-modified-info", "lookback-configuration", "match-type", "name", "offset-percentage", "offset-seconds", "payment-approved", "payment-source", "placement-group-id", "placement-group-id-dimension-value", "placement-strategy-id", "post-impression-activities-duration", "pricing-schedule", "pricing-type", "primary", "progress-offset", "publisher-update-info", "site-id", "site-id-dimension-value", "size", "skip-offset", "skippable", "skippable-settings", "ssl-required", "start-date", "status", "subaccount-id", "tag-formats", "tag-setting", "testing-start-date", "time", "transcode-settings", "value", "video-active-view-opt-out", "video-settings", "vpaid-adapter-choice", "width"]); + 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::Placement = json::value::from_value(object).unwrap(); + let mut call = self.hub.placements().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _placements_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "comment" => Some(("comment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-active-view-opt-out" => Some(("videoActiveViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "campaign-id" => Some(("campaignId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "payment-source" => Some(("paymentSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-name" => Some(("keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.kind" => Some(("videoSettings.skippableSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skippable" => Some(("videoSettings.skippableSettings.skippable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skip-offset.offset-percentage" => Some(("videoSettings.skippableSettings.skipOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.skip-offset.offset-seconds" => Some(("videoSettings.skippableSettings.skipOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.progress-offset.offset-percentage" => Some(("videoSettings.skippableSettings.progressOffset.offsetPercentage", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.skippable-settings.progress-offset.offset-seconds" => Some(("videoSettings.skippableSettings.progressOffset.offsetSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "video-settings.kind" => Some(("videoSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.companion-settings.kind" => Some(("videoSettings.companionSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.companion-settings.companions-disabled" => Some(("videoSettings.companionSettings.companionsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.companion-settings.image-only" => Some(("videoSettings.companionSettings.imageOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-settings.transcode-settings.kind" => Some(("videoSettings.transcodeSettings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-settings.transcode-settings.enabled-video-formats" => Some(("videoSettings.transcodeSettings.enabledVideoFormats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "publisher-update-info.time" => Some(("publisherUpdateInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-formats" => Some(("tagFormats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "payment-approved" => Some(("paymentApproved", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.include-click-through-urls" => Some(("tagSetting.includeClickThroughUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.include-click-tracking" => Some(("tagSetting.includeClickTracking", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-setting.additional-key-values" => Some(("tagSetting.additionalKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-setting.keyword-option" => Some(("tagSetting.keywordOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-category-id" => Some(("contentCategoryId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-blocking-opt-out" => Some(("adBlockingOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "external-id" => Some(("externalId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.width" => Some(("size.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "size.kind" => Some(("size.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.iab" => Some(("size.iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size.id" => Some(("size.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size.height" => Some(("size.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-required" => Some(("sslRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.kind" => Some(("campaignIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.value" => Some(("campaignIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.dimension-name" => Some(("campaignIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.etag" => Some(("campaignIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.match-type" => Some(("campaignIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "campaign-id-dimension-value.id" => Some(("campaignIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary" => Some(("primary", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement-group-id" => Some(("placementGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-info.time" => Some(("createInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id" => Some(("siteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.kind" => Some(("siteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.value" => Some(("siteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.dimension-name" => Some(("siteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.etag" => Some(("siteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.match-type" => Some(("siteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-id-dimension-value.id" => Some(("siteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "compatibility" => Some(("compatibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-strategy-id" => Some(("placementStrategyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.kind" => Some(("placementGroupIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.value" => Some(("placementGroupIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.dimension-name" => Some(("placementGroupIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.etag" => Some(("placementGroupIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.match-type" => Some(("placementGroupIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement-group-id-dimension-value.id" => Some(("placementGroupIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lookback-configuration.click-duration" => Some(("lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lookback-configuration.post-impression-activities-duration" => Some(("lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "last-modified-info.time" => Some(("lastModifiedInfo.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.start-date" => Some(("pricingSchedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.end-date" => Some(("pricingSchedule.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.flighted" => Some(("pricingSchedule.flighted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.disregard-overdelivery" => Some(("pricingSchedule.disregardOverdelivery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pricing-schedule.pricing-type" => Some(("pricingSchedule.pricingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.cap-cost-option" => Some(("pricingSchedule.capCostOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.testing-start-date" => Some(("pricingSchedule.testingStartDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pricing-schedule.floodlight-activity-id" => Some(("pricingSchedule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpaid-adapter-choice" => Some(("vpaidAdapterChoice", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "ad-blocking-opt-out", "additional-key-values", "advertiser-id", "advertiser-id-dimension-value", "archived", "campaign-id", "campaign-id-dimension-value", "cap-cost-option", "click-duration", "comment", "companion-settings", "companions-disabled", "compatibility", "content-category-id", "create-info", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disregard-overdelivery", "enabled-video-formats", "end-date", "etag", "external-id", "flighted", "floodlight-activity-id", "height", "iab", "id", "id-dimension-value", "image-only", "include-click-through-urls", "include-click-tracking", "key-name", "keyword-option", "kind", "last-modified-info", "lookback-configuration", "match-type", "name", "offset-percentage", "offset-seconds", "payment-approved", "payment-source", "placement-group-id", "placement-group-id-dimension-value", "placement-strategy-id", "post-impression-activities-duration", "pricing-schedule", "pricing-type", "primary", "progress-offset", "publisher-update-info", "site-id", "site-id-dimension-value", "size", "skip-offset", "skippable", "skippable-settings", "ssl-required", "start-date", "status", "subaccount-id", "tag-formats", "tag-setting", "testing-start-date", "time", "transcode-settings", "value", "video-active-view-opt-out", "video-settings", "vpaid-adapter-choice", "width"]); + 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::Placement = json::value::from_value(object).unwrap(); + let mut call = self.hub.placements().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _platform_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.platform_types().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _platform_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.platform_types().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _postal_codes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.postal_codes().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("code").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _postal_codes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.postal_codes().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "advertiser-ids" => { + call = call.add_advertiser_ids(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(["search-string", "sort-field", "advertiser-ids", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _regions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.regions().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_list_shares_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.remarketing_list_shares().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("remarketing-list-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_list_shares_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "shared-advertiser-ids" => Some(("sharedAdvertiserIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "remarketing-list-id" => Some(("remarketingListId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shared-account-ids" => Some(("sharedAccountIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "remarketing-list-id", "shared-account-ids", "shared-advertiser-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RemarketingListShare = json::value::from_value(object).unwrap(); + let mut call = self.hub.remarketing_list_shares().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("remarketing-list-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_list_shares_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "shared-advertiser-ids" => Some(("sharedAdvertiserIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "remarketing-list-id" => Some(("remarketingListId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shared-account-ids" => Some(("sharedAccountIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "remarketing-list-id", "shared-account-ids", "shared-advertiser-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RemarketingListShare = json::value::from_value(object).unwrap(); + let mut call = self.hub.remarketing_list_shares().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_lists_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.remarketing_lists().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_lists_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "list-population-rule.floodlight-activity-name" => Some(("listPopulationRule.floodlightActivityName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-population-rule.floodlight-activity-id" => Some(("listPopulationRule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-size" => Some(("listSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "life-span" => Some(("lifeSpan", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-source" => Some(("listSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "advertiser-id", "advertiser-id-dimension-value", "description", "dimension-name", "etag", "floodlight-activity-id", "floodlight-activity-name", "id", "kind", "life-span", "list-population-rule", "list-size", "list-source", "match-type", "name", "subaccount-id", "value"]); + 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::RemarketingList = json::value::from_value(object).unwrap(); + let mut call = self.hub.remarketing_lists().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_lists_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.remarketing_lists().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("advertiser-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "name" => { + call = call.name(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "floodlight-activity-id" => { + call = call.floodlight_activity_id(value.unwrap_or("")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + _ => { + 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(["name", "sort-field", "max-results", "page-token", "sort-order", "active", "floodlight-activity-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_lists_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "list-population-rule.floodlight-activity-name" => Some(("listPopulationRule.floodlightActivityName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-population-rule.floodlight-activity-id" => Some(("listPopulationRule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-size" => Some(("listSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "life-span" => Some(("lifeSpan", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-source" => Some(("listSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "advertiser-id", "advertiser-id-dimension-value", "description", "dimension-name", "etag", "floodlight-activity-id", "floodlight-activity-name", "id", "kind", "life-span", "list-population-rule", "list-size", "list-source", "match-type", "name", "subaccount-id", "value"]); + 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::RemarketingList = json::value::from_value(object).unwrap(); + let mut call = self.hub.remarketing_lists().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _remarketing_lists_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "list-population-rule.floodlight-activity-name" => Some(("listPopulationRule.floodlightActivityName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-population-rule.floodlight-activity-id" => Some(("listPopulationRule.floodlightActivityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-size" => Some(("listSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "life-span" => Some(("lifeSpan", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "list-source" => Some(("listSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "advertiser-id", "advertiser-id-dimension-value", "description", "dimension-name", "etag", "floodlight-activity-id", "floodlight-activity-name", "id", "kind", "life-span", "list-population-rule", "list-size", "list-source", "match-type", "name", "subaccount-id", "value"]); + 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::RemarketingList = json::value::from_value(object).unwrap(); + let mut call = self.hub.remarketing_lists().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_compatible_fields_query(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "criteria.activities.kind" => Some(("criteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.activities.metric-names" => Some(("criteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "criteria.date-range.start-date" => Some(("criteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.kind" => Some(("criteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.end-date" => Some(("criteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.relative-date-range" => Some(("criteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.custom-rich-media-events.kind" => Some(("criteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.metric-names" => Some(("criteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sub-account-id" => Some(("subAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.start-date" => Some(("schedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.runs-on-day-of-month" => Some(("schedule.runsOnDayOfMonth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.every" => Some(("schedule.every", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "schedule.expiration-date" => Some(("schedule.expirationDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.active" => Some(("schedule.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "schedule.repeats" => Some(("schedule.repeats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.repeats-on-week-days" => Some(("schedule.repeatsOnWeekDays", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "path-to-conversion-criteria.date-range.start-date" => Some(("pathToConversionCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.kind" => Some(("pathToConversionCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.end-date" => Some(("pathToConversionCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.relative-date-range" => Some(("pathToConversionCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.kind" => Some(("pathToConversionCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.value" => Some(("pathToConversionCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.dimension-name" => Some(("pathToConversionCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.etag" => Some(("pathToConversionCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.match-type" => Some(("pathToConversionCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.id" => Some(("pathToConversionCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.clicks-lookback-window" => Some(("pathToConversionCriteria.reportProperties.clicksLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.pivot-on-interaction-path" => Some(("pathToConversionCriteria.reportProperties.pivotOnInteractionPath", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.impressions-lookback-window" => Some(("pathToConversionCriteria.reportProperties.impressionsLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-interaction-gap" => Some(("pathToConversionCriteria.reportProperties.maximumInteractionGap", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-attributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-click-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumClickInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-impression-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumImpressionInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.metric-names" => Some(("pathToConversionCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.kind" => Some(("reachCriteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.metric-names" => Some(("reachCriteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.metric-names" => Some(("reachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.date-range.start-date" => Some(("reachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.kind" => Some(("reachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.end-date" => Some(("reachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.relative-date-range" => Some(("reachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.reach-by-frequency-metric-names" => Some(("reachCriteria.reachByFrequencyMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.custom-rich-media-events.kind" => Some(("reachCriteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.enable-all-dimension-combinations" => Some(("reachCriteria.enableAllDimensionCombinations", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.message" => Some(("delivery.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner-delivery-type" => Some(("delivery.emailOwnerDeliveryType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner" => Some(("delivery.emailOwner", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "owner-profile-id" => Some(("ownerProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.start-date" => Some(("floodlightCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.kind" => Some(("floodlightCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.end-date" => Some(("floodlightCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.relative-date-range" => Some(("floodlightCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.kind" => Some(("floodlightCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.value" => Some(("floodlightCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.dimension-name" => Some(("floodlightCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.etag" => Some(("floodlightCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.match-type" => Some(("floodlightCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.id" => Some(("floodlightCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-attributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.metric-names" => Some(("floodlightCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.pivoted" => Some(("crossDimensionReachCriteria.pivoted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.start-date" => Some(("crossDimensionReachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.kind" => Some(("crossDimensionReachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.end-date" => Some(("crossDimensionReachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.relative-date-range" => Some(("crossDimensionReachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.dimension" => Some(("crossDimensionReachCriteria.dimension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.overlap-metric-names" => Some(("crossDimensionReachCriteria.overlapMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.metric-names" => Some(("crossDimensionReachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "activities", "clicks-lookback-window", "criteria", "cross-dimension-reach-criteria", "custom-rich-media-events", "date-range", "delivery", "dimension", "dimension-name", "email-owner", "email-owner-delivery-type", "enable-all-dimension-combinations", "end-date", "etag", "every", "expiration-date", "file-name", "floodlight-config-id", "floodlight-criteria", "format", "id", "impressions-lookback-window", "include-attributed-ip-conversions", "include-unattributed-cookie-conversions", "include-unattributed-ip-conversions", "kind", "last-modified-time", "match-type", "maximum-click-interactions", "maximum-impression-interactions", "maximum-interaction-gap", "message", "metric-names", "name", "overlap-metric-names", "owner-profile-id", "path-to-conversion-criteria", "pivot-on-interaction-path", "pivoted", "reach-by-frequency-metric-names", "reach-criteria", "relative-date-range", "repeats", "repeats-on-week-days", "report-properties", "runs-on-day-of-month", "schedule", "start-date", "sub-account-id", "type", "value"]); + 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::Report = json::value::from_value(object).unwrap(); + let mut call = self.hub.reports().compatible_fields_query(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.reports().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _reports_files_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut download_mode = false; + let mut call = self.hub.reports().files_get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or(""), opt.value_of("file-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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 { + if key == "alt" && value.unwrap_or("unset") == "media" { + download_mode = true; + } + 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").map(|i|i.collect()).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)) => { + if !download_mode { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + 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(()) + } + } + } + } + + fn _reports_files_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.reports().files_list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "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")); + }, + _ => { + 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(["sort-field", "sort-order", "max-results", "page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.reports().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "criteria.activities.kind" => Some(("criteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.activities.metric-names" => Some(("criteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "criteria.date-range.start-date" => Some(("criteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.kind" => Some(("criteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.end-date" => Some(("criteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.relative-date-range" => Some(("criteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.custom-rich-media-events.kind" => Some(("criteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.metric-names" => Some(("criteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sub-account-id" => Some(("subAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.start-date" => Some(("schedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.runs-on-day-of-month" => Some(("schedule.runsOnDayOfMonth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.every" => Some(("schedule.every", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "schedule.expiration-date" => Some(("schedule.expirationDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.active" => Some(("schedule.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "schedule.repeats" => Some(("schedule.repeats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.repeats-on-week-days" => Some(("schedule.repeatsOnWeekDays", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "path-to-conversion-criteria.date-range.start-date" => Some(("pathToConversionCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.kind" => Some(("pathToConversionCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.end-date" => Some(("pathToConversionCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.relative-date-range" => Some(("pathToConversionCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.kind" => Some(("pathToConversionCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.value" => Some(("pathToConversionCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.dimension-name" => Some(("pathToConversionCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.etag" => Some(("pathToConversionCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.match-type" => Some(("pathToConversionCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.id" => Some(("pathToConversionCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.clicks-lookback-window" => Some(("pathToConversionCriteria.reportProperties.clicksLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.pivot-on-interaction-path" => Some(("pathToConversionCriteria.reportProperties.pivotOnInteractionPath", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.impressions-lookback-window" => Some(("pathToConversionCriteria.reportProperties.impressionsLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-interaction-gap" => Some(("pathToConversionCriteria.reportProperties.maximumInteractionGap", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-attributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-click-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumClickInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-impression-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumImpressionInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.metric-names" => Some(("pathToConversionCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.kind" => Some(("reachCriteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.metric-names" => Some(("reachCriteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.metric-names" => Some(("reachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.date-range.start-date" => Some(("reachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.kind" => Some(("reachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.end-date" => Some(("reachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.relative-date-range" => Some(("reachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.reach-by-frequency-metric-names" => Some(("reachCriteria.reachByFrequencyMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.custom-rich-media-events.kind" => Some(("reachCriteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.enable-all-dimension-combinations" => Some(("reachCriteria.enableAllDimensionCombinations", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.message" => Some(("delivery.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner-delivery-type" => Some(("delivery.emailOwnerDeliveryType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner" => Some(("delivery.emailOwner", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "owner-profile-id" => Some(("ownerProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.start-date" => Some(("floodlightCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.kind" => Some(("floodlightCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.end-date" => Some(("floodlightCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.relative-date-range" => Some(("floodlightCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.kind" => Some(("floodlightCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.value" => Some(("floodlightCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.dimension-name" => Some(("floodlightCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.etag" => Some(("floodlightCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.match-type" => Some(("floodlightCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.id" => Some(("floodlightCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-attributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.metric-names" => Some(("floodlightCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.pivoted" => Some(("crossDimensionReachCriteria.pivoted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.start-date" => Some(("crossDimensionReachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.kind" => Some(("crossDimensionReachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.end-date" => Some(("crossDimensionReachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.relative-date-range" => Some(("crossDimensionReachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.dimension" => Some(("crossDimensionReachCriteria.dimension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.overlap-metric-names" => Some(("crossDimensionReachCriteria.overlapMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.metric-names" => Some(("crossDimensionReachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "activities", "clicks-lookback-window", "criteria", "cross-dimension-reach-criteria", "custom-rich-media-events", "date-range", "delivery", "dimension", "dimension-name", "email-owner", "email-owner-delivery-type", "enable-all-dimension-combinations", "end-date", "etag", "every", "expiration-date", "file-name", "floodlight-config-id", "floodlight-criteria", "format", "id", "impressions-lookback-window", "include-attributed-ip-conversions", "include-unattributed-cookie-conversions", "include-unattributed-ip-conversions", "kind", "last-modified-time", "match-type", "maximum-click-interactions", "maximum-impression-interactions", "maximum-interaction-gap", "message", "metric-names", "name", "overlap-metric-names", "owner-profile-id", "path-to-conversion-criteria", "pivot-on-interaction-path", "pivoted", "reach-by-frequency-metric-names", "reach-criteria", "relative-date-range", "repeats", "repeats-on-week-days", "report-properties", "runs-on-day-of-month", "schedule", "start-date", "sub-account-id", "type", "value"]); + 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::Report = json::value::from_value(object).unwrap(); + let mut call = self.hub.reports().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.reports().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "scope" => { + call = call.scope(value.unwrap_or("")); + }, + "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")); + }, + _ => { + 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(["sort-field", "max-results", "sort-order", "page-token", "scope"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "criteria.activities.kind" => Some(("criteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.activities.metric-names" => Some(("criteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "criteria.date-range.start-date" => Some(("criteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.kind" => Some(("criteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.end-date" => Some(("criteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.relative-date-range" => Some(("criteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.custom-rich-media-events.kind" => Some(("criteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.metric-names" => Some(("criteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sub-account-id" => Some(("subAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.start-date" => Some(("schedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.runs-on-day-of-month" => Some(("schedule.runsOnDayOfMonth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.every" => Some(("schedule.every", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "schedule.expiration-date" => Some(("schedule.expirationDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.active" => Some(("schedule.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "schedule.repeats" => Some(("schedule.repeats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.repeats-on-week-days" => Some(("schedule.repeatsOnWeekDays", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "path-to-conversion-criteria.date-range.start-date" => Some(("pathToConversionCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.kind" => Some(("pathToConversionCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.end-date" => Some(("pathToConversionCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.relative-date-range" => Some(("pathToConversionCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.kind" => Some(("pathToConversionCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.value" => Some(("pathToConversionCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.dimension-name" => Some(("pathToConversionCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.etag" => Some(("pathToConversionCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.match-type" => Some(("pathToConversionCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.id" => Some(("pathToConversionCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.clicks-lookback-window" => Some(("pathToConversionCriteria.reportProperties.clicksLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.pivot-on-interaction-path" => Some(("pathToConversionCriteria.reportProperties.pivotOnInteractionPath", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.impressions-lookback-window" => Some(("pathToConversionCriteria.reportProperties.impressionsLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-interaction-gap" => Some(("pathToConversionCriteria.reportProperties.maximumInteractionGap", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-attributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-click-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumClickInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-impression-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumImpressionInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.metric-names" => Some(("pathToConversionCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.kind" => Some(("reachCriteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.metric-names" => Some(("reachCriteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.metric-names" => Some(("reachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.date-range.start-date" => Some(("reachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.kind" => Some(("reachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.end-date" => Some(("reachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.relative-date-range" => Some(("reachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.reach-by-frequency-metric-names" => Some(("reachCriteria.reachByFrequencyMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.custom-rich-media-events.kind" => Some(("reachCriteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.enable-all-dimension-combinations" => Some(("reachCriteria.enableAllDimensionCombinations", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.message" => Some(("delivery.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner-delivery-type" => Some(("delivery.emailOwnerDeliveryType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner" => Some(("delivery.emailOwner", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "owner-profile-id" => Some(("ownerProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.start-date" => Some(("floodlightCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.kind" => Some(("floodlightCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.end-date" => Some(("floodlightCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.relative-date-range" => Some(("floodlightCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.kind" => Some(("floodlightCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.value" => Some(("floodlightCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.dimension-name" => Some(("floodlightCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.etag" => Some(("floodlightCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.match-type" => Some(("floodlightCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.id" => Some(("floodlightCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-attributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.metric-names" => Some(("floodlightCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.pivoted" => Some(("crossDimensionReachCriteria.pivoted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.start-date" => Some(("crossDimensionReachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.kind" => Some(("crossDimensionReachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.end-date" => Some(("crossDimensionReachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.relative-date-range" => Some(("crossDimensionReachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.dimension" => Some(("crossDimensionReachCriteria.dimension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.overlap-metric-names" => Some(("crossDimensionReachCriteria.overlapMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.metric-names" => Some(("crossDimensionReachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "activities", "clicks-lookback-window", "criteria", "cross-dimension-reach-criteria", "custom-rich-media-events", "date-range", "delivery", "dimension", "dimension-name", "email-owner", "email-owner-delivery-type", "enable-all-dimension-combinations", "end-date", "etag", "every", "expiration-date", "file-name", "floodlight-config-id", "floodlight-criteria", "format", "id", "impressions-lookback-window", "include-attributed-ip-conversions", "include-unattributed-cookie-conversions", "include-unattributed-ip-conversions", "kind", "last-modified-time", "match-type", "maximum-click-interactions", "maximum-impression-interactions", "maximum-interaction-gap", "message", "metric-names", "name", "overlap-metric-names", "owner-profile-id", "path-to-conversion-criteria", "pivot-on-interaction-path", "pivoted", "reach-by-frequency-metric-names", "reach-criteria", "relative-date-range", "repeats", "repeats-on-week-days", "report-properties", "runs-on-day-of-month", "schedule", "start-date", "sub-account-id", "type", "value"]); + 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::Report = json::value::from_value(object).unwrap(); + let mut call = self.hub.reports().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_run(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.reports().run(opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "synchronous" => { + call = call.synchronous(arg_from_str(value.unwrap_or("false"), err, "synchronous", "boolean")); + }, + _ => { + 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(["synchronous"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reports_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "criteria.activities.kind" => Some(("criteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.activities.metric-names" => Some(("criteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "criteria.date-range.start-date" => Some(("criteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.kind" => Some(("criteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.end-date" => Some(("criteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.date-range.relative-date-range" => Some(("criteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.custom-rich-media-events.kind" => Some(("criteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "criteria.metric-names" => Some(("criteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sub-account-id" => Some(("subAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.start-date" => Some(("schedule.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.runs-on-day-of-month" => Some(("schedule.runsOnDayOfMonth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.every" => Some(("schedule.every", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "schedule.expiration-date" => Some(("schedule.expirationDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.active" => Some(("schedule.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "schedule.repeats" => Some(("schedule.repeats", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule.repeats-on-week-days" => Some(("schedule.repeatsOnWeekDays", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "path-to-conversion-criteria.date-range.start-date" => Some(("pathToConversionCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.kind" => Some(("pathToConversionCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.end-date" => Some(("pathToConversionCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.date-range.relative-date-range" => Some(("pathToConversionCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.kind" => Some(("pathToConversionCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.value" => Some(("pathToConversionCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.dimension-name" => Some(("pathToConversionCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.etag" => Some(("pathToConversionCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.match-type" => Some(("pathToConversionCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.floodlight-config-id.id" => Some(("pathToConversionCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.clicks-lookback-window" => Some(("pathToConversionCriteria.reportProperties.clicksLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.pivot-on-interaction-path" => Some(("pathToConversionCriteria.reportProperties.pivotOnInteractionPath", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.impressions-lookback-window" => Some(("pathToConversionCriteria.reportProperties.impressionsLookbackWindow", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("pathToConversionCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-interaction-gap" => Some(("pathToConversionCriteria.reportProperties.maximumInteractionGap", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.include-attributed-ip-conversions" => Some(("pathToConversionCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-click-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumClickInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.report-properties.maximum-impression-interactions" => Some(("pathToConversionCriteria.reportProperties.maximumImpressionInteractions", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "path-to-conversion-criteria.metric-names" => Some(("pathToConversionCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.kind" => Some(("reachCriteria.activities.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.activities.metric-names" => Some(("reachCriteria.activities.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.metric-names" => Some(("reachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.date-range.start-date" => Some(("reachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.kind" => Some(("reachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.end-date" => Some(("reachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.date-range.relative-date-range" => Some(("reachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.reach-by-frequency-metric-names" => Some(("reachCriteria.reachByFrequencyMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reach-criteria.custom-rich-media-events.kind" => Some(("reachCriteria.customRichMediaEvents.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reach-criteria.enable-all-dimension-combinations" => Some(("reachCriteria.enableAllDimensionCombinations", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.message" => Some(("delivery.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner-delivery-type" => Some(("delivery.emailOwnerDeliveryType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delivery.email-owner" => Some(("delivery.emailOwner", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "owner-profile-id" => Some(("ownerProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.start-date" => Some(("floodlightCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.kind" => Some(("floodlightCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.end-date" => Some(("floodlightCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.date-range.relative-date-range" => Some(("floodlightCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.kind" => Some(("floodlightCriteria.floodlightConfigId.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.value" => Some(("floodlightCriteria.floodlightConfigId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.dimension-name" => Some(("floodlightCriteria.floodlightConfigId.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.etag" => Some(("floodlightCriteria.floodlightConfigId.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.match-type" => Some(("floodlightCriteria.floodlightConfigId.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.floodlight-config-id.id" => Some(("floodlightCriteria.floodlightConfigId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-unattributed-cookie-conversions" => Some(("floodlightCriteria.reportProperties.includeUnattributedCookieConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.report-properties.include-attributed-ip-conversions" => Some(("floodlightCriteria.reportProperties.includeAttributedIPConversions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "floodlight-criteria.metric-names" => Some(("floodlightCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.pivoted" => Some(("crossDimensionReachCriteria.pivoted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.start-date" => Some(("crossDimensionReachCriteria.dateRange.startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.kind" => Some(("crossDimensionReachCriteria.dateRange.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.end-date" => Some(("crossDimensionReachCriteria.dateRange.endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.date-range.relative-date-range" => Some(("crossDimensionReachCriteria.dateRange.relativeDateRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.dimension" => Some(("crossDimensionReachCriteria.dimension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cross-dimension-reach-criteria.overlap-metric-names" => Some(("crossDimensionReachCriteria.overlapMetricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cross-dimension-reach-criteria.metric-names" => Some(("crossDimensionReachCriteria.metricNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "active", "activities", "clicks-lookback-window", "criteria", "cross-dimension-reach-criteria", "custom-rich-media-events", "date-range", "delivery", "dimension", "dimension-name", "email-owner", "email-owner-delivery-type", "enable-all-dimension-combinations", "end-date", "etag", "every", "expiration-date", "file-name", "floodlight-config-id", "floodlight-criteria", "format", "id", "impressions-lookback-window", "include-attributed-ip-conversions", "include-unattributed-cookie-conversions", "include-unattributed-ip-conversions", "kind", "last-modified-time", "match-type", "maximum-click-interactions", "maximum-impression-interactions", "maximum-interaction-gap", "message", "metric-names", "name", "overlap-metric-names", "owner-profile-id", "path-to-conversion-criteria", "pivot-on-interaction-path", "pivoted", "reach-by-frequency-metric-names", "reach-criteria", "relative-date-range", "repeats", "repeats-on-week-days", "report-properties", "runs-on-day-of-month", "schedule", "start-date", "sub-account-id", "type", "value"]); + 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::Report = json::value::from_value(object).unwrap(); + let mut call = self.hub.reports().update(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("report-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sites().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.active-view-opt-out" => Some(("siteSettings.activeViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.video-active-view-opt-out-template" => Some(("siteSettings.videoActiveViewOptOutTemplate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.lookback-configuration.click-duration" => Some(("siteSettings.lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "site-settings.lookback-configuration.post-impression-activities-duration" => Some(("siteSettings.lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "site-settings.disable-new-cookie" => Some(("siteSettings.disableNewCookie", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.include-click-through-urls" => Some(("siteSettings.tagSetting.includeClickThroughUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.include-click-tracking" => Some(("siteSettings.tagSetting.includeClickTracking", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.additional-key-values" => Some(("siteSettings.tagSetting.additionalKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.tag-setting.keyword-option" => Some(("siteSettings.tagSetting.keywordOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.vpaid-adapter-choice-template" => Some(("siteSettings.vpaidAdapterChoiceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.ad-blocking-opt-out" => Some(("siteSettings.adBlockingOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.creative-settings.i-frame-header" => Some(("siteSettings.creativeSettings.iFrameHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.creative-settings.i-frame-footer" => Some(("siteSettings.creativeSettings.iFrameFooter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "approved" => Some(("approved", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-name" => Some(("keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "active-view-opt-out", "ad-blocking-opt-out", "additional-key-values", "approved", "click-duration", "creative-settings", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disable-new-cookie", "etag", "i-frame-footer", "i-frame-header", "id", "id-dimension-value", "include-click-through-urls", "include-click-tracking", "key-name", "keyword-option", "kind", "lookback-configuration", "match-type", "name", "post-impression-activities-duration", "site-settings", "subaccount-id", "tag-setting", "value", "video-active-view-opt-out-template", "vpaid-adapter-choice-template"]); + 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::Site = json::value::from_value(object).unwrap(); + let mut call = self.hub.sites().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sites().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "unmapped-site" => { + call = call.unmapped_site(arg_from_str(value.unwrap_or("false"), err, "unmapped-site", "boolean")); + }, + "subaccount-id" => { + call = call.subaccount_id(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "directory-site-ids" => { + call = call.add_directory_site_ids(value.unwrap_or("")); + }, + "campaign-ids" => { + call = call.add_campaign_ids(value.unwrap_or("")); + }, + "approved" => { + call = call.approved(arg_from_str(value.unwrap_or("false"), err, "approved", "boolean")); + }, + "ad-words-site" => { + call = call.ad_words_site(arg_from_str(value.unwrap_or("false"), err, "ad-words-site", "boolean")); + }, + "accepts-publisher-paid-placements" => { + call = call.accepts_publisher_paid_placements(arg_from_str(value.unwrap_or("false"), err, "accepts-publisher-paid-placements", "boolean")); + }, + "accepts-interstitial-placements" => { + call = call.accepts_interstitial_placements(arg_from_str(value.unwrap_or("false"), err, "accepts-interstitial-placements", "boolean")); + }, + "accepts-in-stream-video-placements" => { + call = call.accepts_in_stream_video_placements(arg_from_str(value.unwrap_or("false"), err, "accepts-in-stream-video-placements", "boolean")); + }, + _ => { + 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(["accepts-interstitial-placements", "accepts-publisher-paid-placements", "search-string", "subaccount-id", "directory-site-ids", "sort-field", "ids", "max-results", "page-token", "unmapped-site", "accepts-in-stream-video-placements", "ad-words-site", "campaign-ids", "approved", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.active-view-opt-out" => Some(("siteSettings.activeViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.video-active-view-opt-out-template" => Some(("siteSettings.videoActiveViewOptOutTemplate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.lookback-configuration.click-duration" => Some(("siteSettings.lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "site-settings.lookback-configuration.post-impression-activities-duration" => Some(("siteSettings.lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "site-settings.disable-new-cookie" => Some(("siteSettings.disableNewCookie", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.include-click-through-urls" => Some(("siteSettings.tagSetting.includeClickThroughUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.include-click-tracking" => Some(("siteSettings.tagSetting.includeClickTracking", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.additional-key-values" => Some(("siteSettings.tagSetting.additionalKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.tag-setting.keyword-option" => Some(("siteSettings.tagSetting.keywordOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.vpaid-adapter-choice-template" => Some(("siteSettings.vpaidAdapterChoiceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.ad-blocking-opt-out" => Some(("siteSettings.adBlockingOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.creative-settings.i-frame-header" => Some(("siteSettings.creativeSettings.iFrameHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.creative-settings.i-frame-footer" => Some(("siteSettings.creativeSettings.iFrameFooter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "approved" => Some(("approved", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-name" => Some(("keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "active-view-opt-out", "ad-blocking-opt-out", "additional-key-values", "approved", "click-duration", "creative-settings", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disable-new-cookie", "etag", "i-frame-footer", "i-frame-header", "id", "id-dimension-value", "include-click-through-urls", "include-click-tracking", "key-name", "keyword-option", "kind", "lookback-configuration", "match-type", "name", "post-impression-activities-duration", "site-settings", "subaccount-id", "tag-setting", "value", "video-active-view-opt-out-template", "vpaid-adapter-choice-template"]); + 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::Site = json::value::from_value(object).unwrap(); + let mut call = self.hub.sites().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.kind" => Some(("directorySiteIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.value" => Some(("directorySiteIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.dimension-name" => Some(("directorySiteIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.etag" => Some(("directorySiteIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.match-type" => Some(("directorySiteIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id-dimension-value.id" => Some(("directorySiteIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.active-view-opt-out" => Some(("siteSettings.activeViewOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.video-active-view-opt-out-template" => Some(("siteSettings.videoActiveViewOptOutTemplate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.lookback-configuration.click-duration" => Some(("siteSettings.lookbackConfiguration.clickDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "site-settings.lookback-configuration.post-impression-activities-duration" => Some(("siteSettings.lookbackConfiguration.postImpressionActivitiesDuration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "site-settings.disable-new-cookie" => Some(("siteSettings.disableNewCookie", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.include-click-through-urls" => Some(("siteSettings.tagSetting.includeClickThroughUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.include-click-tracking" => Some(("siteSettings.tagSetting.includeClickTracking", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.tag-setting.additional-key-values" => Some(("siteSettings.tagSetting.additionalKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.tag-setting.keyword-option" => Some(("siteSettings.tagSetting.keywordOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.vpaid-adapter-choice-template" => Some(("siteSettings.vpaidAdapterChoiceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.ad-blocking-opt-out" => Some(("siteSettings.adBlockingOptOut", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "site-settings.creative-settings.i-frame-header" => Some(("siteSettings.creativeSettings.iFrameHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "site-settings.creative-settings.i-frame-footer" => Some(("siteSettings.creativeSettings.iFrameFooter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "approved" => Some(("approved", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id-dimension-value.kind" => Some(("idDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.value" => Some(("idDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.dimension-name" => Some(("idDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.etag" => Some(("idDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.match-type" => Some(("idDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-dimension-value.id" => Some(("idDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-name" => Some(("keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "directory-site-id" => Some(("directorySiteId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "active-view-opt-out", "ad-blocking-opt-out", "additional-key-values", "approved", "click-duration", "creative-settings", "dimension-name", "directory-site-id", "directory-site-id-dimension-value", "disable-new-cookie", "etag", "i-frame-footer", "i-frame-header", "id", "id-dimension-value", "include-click-through-urls", "include-click-tracking", "key-name", "keyword-option", "kind", "lookback-configuration", "match-type", "name", "post-impression-activities-duration", "site-settings", "subaccount-id", "tag-setting", "value", "video-active-view-opt-out-template", "vpaid-adapter-choice-template"]); + 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::Site = json::value::from_value(object).unwrap(); + let mut call = self.hub.sites().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sizes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sizes().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sizes_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "width" => Some(("width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iab" => Some(("iab", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "height" => Some(("height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["height", "iab", "id", "kind", "width"]); + 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::Size = json::value::from_value(object).unwrap(); + let mut call = self.hub.sizes().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sizes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sizes().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "width" => { + call = call.width(arg_from_str(value.unwrap_or("-0"), err, "width", "integer")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "iab-standard" => { + call = call.iab_standard(arg_from_str(value.unwrap_or("false"), err, "iab-standard", "boolean")); + }, + "height" => { + call = call.height(arg_from_str(value.unwrap_or("-0"), err, "height", "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(["iab-standard", "width", "ids", "height"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _subaccounts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.subaccounts().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _subaccounts_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-permission-ids" => Some(("availablePermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", 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", "available-permission-ids", "id", "kind", "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::Subaccount = json::value::from_value(object).unwrap(); + let mut call = self.hub.subaccounts().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _subaccounts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.subaccounts().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(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(["search-string", "sort-field", "ids", "max-results", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _subaccounts_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-permission-ids" => Some(("availablePermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", 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", "available-permission-ids", "id", "kind", "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::Subaccount = json::value::from_value(object).unwrap(); + let mut call = self.hub.subaccounts().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _subaccounts_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-permission-ids" => Some(("availablePermissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", 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", "available-permission-ids", "id", "kind", "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::Subaccount = json::value::from_value(object).unwrap(); + let mut call = self.hub.subaccounts().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targetable_remarketing_lists_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.targetable_remarketing_lists().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targetable_remarketing_lists_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.targetable_remarketing_lists().list(opt.value_of("profile-id").unwrap_or(""), opt.value_of("advertiser-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "name" => { + call = call.name(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "active" => { + call = call.active(arg_from_str(value.unwrap_or("false"), err, "active", "boolean")); + }, + _ => { + 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(["name", "sort-field", "max-results", "page-token", "sort-order", "active"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targeting_templates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.targeting_templates().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targeting_templates_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "day-part-targeting.user-local-time" => Some(("dayPartTargeting.userLocalTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "day-part-targeting.hours-of-day" => Some(("dayPartTargeting.hoursOfDay", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "day-part-targeting.days-of-week" => Some(("dayPartTargeting.daysOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "list-targeting-expression.expression" => Some(("listTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-value-targeting-expression.expression" => Some(("keyValueTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "geo-targeting.exclude-countries" => Some(("geoTargeting.excludeCountries", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "day-part-targeting", "days-of-week", "dimension-name", "etag", "exclude-countries", "expression", "geo-targeting", "hours-of-day", "id", "key-value-targeting-expression", "kind", "list-targeting-expression", "match-type", "name", "subaccount-id", "user-local-time", "value"]); + 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::TargetingTemplate = json::value::from_value(object).unwrap(); + let mut call = self.hub.targeting_templates().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targeting_templates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.targeting_templates().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "advertiser-id" => { + call = call.advertiser_id(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(["search-string", "sort-field", "ids", "max-results", "advertiser-id", "page-token", "sort-order"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targeting_templates_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "day-part-targeting.user-local-time" => Some(("dayPartTargeting.userLocalTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "day-part-targeting.hours-of-day" => Some(("dayPartTargeting.hoursOfDay", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "day-part-targeting.days-of-week" => Some(("dayPartTargeting.daysOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "list-targeting-expression.expression" => Some(("listTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-value-targeting-expression.expression" => Some(("keyValueTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "geo-targeting.exclude-countries" => Some(("geoTargeting.excludeCountries", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "day-part-targeting", "days-of-week", "dimension-name", "etag", "exclude-countries", "expression", "geo-targeting", "hours-of-day", "id", "key-value-targeting-expression", "kind", "list-targeting-expression", "match-type", "name", "subaccount-id", "user-local-time", "value"]); + 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::TargetingTemplate = json::value::from_value(object).unwrap(); + let mut call = self.hub.targeting_templates().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _targeting_templates_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "day-part-targeting.user-local-time" => Some(("dayPartTargeting.userLocalTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "day-part-targeting.hours-of-day" => Some(("dayPartTargeting.hoursOfDay", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "day-part-targeting.days-of-week" => Some(("dayPartTargeting.daysOfWeek", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "list-targeting-expression.expression" => Some(("listTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-value-targeting-expression.expression" => Some(("keyValueTargetingExpression.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "geo-targeting.exclude-countries" => Some(("geoTargeting.excludeCountries", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.kind" => Some(("advertiserIdDimensionValue.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.value" => Some(("advertiserIdDimensionValue.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.dimension-name" => Some(("advertiserIdDimensionValue.dimensionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.etag" => Some(("advertiserIdDimensionValue.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.match-type" => Some(("advertiserIdDimensionValue.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id-dimension-value.id" => Some(("advertiserIdDimensionValue.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "advertiser-id", "advertiser-id-dimension-value", "day-part-targeting", "days-of-week", "dimension-name", "etag", "exclude-countries", "expression", "geo-targeting", "hours-of-day", "id", "key-value-targeting-expression", "kind", "list-targeting-expression", "match-type", "name", "subaccount-id", "user-local-time", "value"]); + 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::TargetingTemplate = json::value::from_value(object).unwrap(); + let mut call = self.hub.targeting_templates().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_profiles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_profiles().get(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_profiles_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_profiles().list(); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_role_permission_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_role_permission_groups().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_role_permission_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_role_permission_groups().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_role_permissions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_role_permissions().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_role_permissions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_role_permissions().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "ids" => { + call = call.add_ids(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(["ids"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_roles_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_roles().delete(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _user_roles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_roles().get(opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_roles_insert(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "default-user-role" => Some(("defaultUserRole", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-user-role-id" => Some(("parentUserRoleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "default-user-role", "id", "kind", "name", "parent-user-role-id", "subaccount-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UserRole = json::value::from_value(object).unwrap(); + let mut call = self.hub.user_roles().insert(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_roles_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.user_roles().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "subaccount-id" => { + call = call.subaccount_id(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "sort-field" => { + call = call.sort_field(value.unwrap_or("")); + }, + "search-string" => { + call = call.search_string(value.unwrap_or("")); + }, + "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")); + }, + "ids" => { + call = call.add_ids(value.unwrap_or("")); + }, + "account-user-role-only" => { + call = call.account_user_role_only(arg_from_str(value.unwrap_or("false"), err, "account-user-role-only", "boolean")); + }, + _ => { + 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(["search-string", "subaccount-id", "sort-field", "ids", "max-results", "page-token", "sort-order", "account-user-role-only"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_roles_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "default-user-role" => Some(("defaultUserRole", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-user-role-id" => Some(("parentUserRoleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "default-user-role", "id", "kind", "name", "parent-user-role-id", "subaccount-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UserRole = json::value::from_value(object).unwrap(); + let mut call = self.hub.user_roles().patch(request, opt.value_of("profile-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _user_roles_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "default-user-role" => Some(("defaultUserRole", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subaccount-id" => Some(("subaccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-user-role-id" => Some(("parentUserRoleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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", "default-user-role", "id", "kind", "name", "parent-user-role-id", "subaccount-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UserRole = json::value::from_value(object).unwrap(); + let mut call = self.hub.user_roles().update(request, opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _video_formats_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let id: i32 = arg_from_str(&opt.value_of("id").unwrap_or(""), err, "", "integer"); + let mut call = self.hub.video_formats().get(opt.value_of("profile-id").unwrap_or(""), id); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _video_formats_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.video_formats().list(opt.value_of("profile-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("account-active-ad-summaries", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._account_active_ad_summaries_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("account-active-ad-summaries".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("account-permission-groups", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._account_permission_groups_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._account_permission_groups_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("account-permission-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("account-permissions", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._account_permissions_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._account_permissions_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("account-permissions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("account-user-profiles", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._account_user_profiles_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._account_user_profiles_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._account_user_profiles_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._account_user_profiles_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._account_user_profiles_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("account-user-profiles".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("accounts", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._accounts_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._accounts_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._accounts_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._accounts_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("accounts".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("ads", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._ads_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._ads_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._ads_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._ads_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._ads_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("ads".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("advertiser-groups", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._advertiser_groups_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._advertiser_groups_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._advertiser_groups_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._advertiser_groups_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._advertiser_groups_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._advertiser_groups_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("advertiser-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("advertisers", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._advertisers_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._advertisers_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._advertisers_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._advertisers_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._advertisers_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("advertisers".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("browsers", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._browsers_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("browsers".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("campaign-creative-associations", Some(opt)) => { + match opt.subcommand() { + ("insert", Some(opt)) => { + call_result = self._campaign_creative_associations_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._campaign_creative_associations_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("campaign-creative-associations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("campaigns", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._campaigns_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._campaigns_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._campaigns_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._campaigns_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._campaigns_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("campaigns".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("change-logs", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._change_logs_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._change_logs_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("change-logs".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("cities", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._cities_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("cities".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("connection-types", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._connection_types_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._connection_types_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("connection-types".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("content-categories", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._content_categories_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._content_categories_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._content_categories_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._content_categories_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._content_categories_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._content_categories_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("content-categories".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("conversions", Some(opt)) => { + match opt.subcommand() { + ("batchinsert", Some(opt)) => { + call_result = self._conversions_batchinsert(opt, dry_run, &mut err); + }, + ("batchupdate", Some(opt)) => { + call_result = self._conversions_batchupdate(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("conversions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("countries", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._countries_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._countries_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("countries".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("creative-assets", Some(opt)) => { + match opt.subcommand() { + ("insert", Some(opt)) => { + call_result = self._creative_assets_insert(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("creative-assets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("creative-field-values", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._creative_field_values_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._creative_field_values_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._creative_field_values_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._creative_field_values_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._creative_field_values_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._creative_field_values_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("creative-field-values".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("creative-fields", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._creative_fields_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._creative_fields_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._creative_fields_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._creative_fields_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._creative_fields_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._creative_fields_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("creative-fields".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("creative-groups", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._creative_groups_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._creative_groups_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._creative_groups_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._creative_groups_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._creative_groups_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("creative-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("creatives", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._creatives_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._creatives_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._creatives_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._creatives_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._creatives_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("creatives".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("dimension-values", Some(opt)) => { + match opt.subcommand() { + ("query", Some(opt)) => { + call_result = self._dimension_values_query(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("dimension-values".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("directory-site-contacts", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._directory_site_contacts_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._directory_site_contacts_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("directory-site-contacts".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("directory-sites", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._directory_sites_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._directory_sites_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._directory_sites_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("directory-sites".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("dynamic-targeting-keys", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._dynamic_targeting_keys_delete(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._dynamic_targeting_keys_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._dynamic_targeting_keys_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("dynamic-targeting-keys".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("event-tags", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._event_tags_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._event_tags_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._event_tags_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._event_tags_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._event_tags_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._event_tags_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("event-tags".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("files", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._files_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._files_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("files".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("floodlight-activities", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._floodlight_activities_delete(opt, dry_run, &mut err); + }, + ("generatetag", Some(opt)) => { + call_result = self._floodlight_activities_generatetag(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._floodlight_activities_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._floodlight_activities_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._floodlight_activities_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._floodlight_activities_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._floodlight_activities_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("floodlight-activities".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("floodlight-activity-groups", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._floodlight_activity_groups_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._floodlight_activity_groups_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._floodlight_activity_groups_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._floodlight_activity_groups_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._floodlight_activity_groups_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("floodlight-activity-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("floodlight-configurations", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._floodlight_configurations_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._floodlight_configurations_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._floodlight_configurations_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._floodlight_configurations_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("floodlight-configurations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("inventory-items", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._inventory_items_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._inventory_items_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("inventory-items".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("landing-pages", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._landing_pages_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._landing_pages_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._landing_pages_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._landing_pages_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._landing_pages_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._landing_pages_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("landing-pages".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("languages", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._languages_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("languages".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("metros", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._metros_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("metros".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("mobile-carriers", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._mobile_carriers_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._mobile_carriers_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("mobile-carriers".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("operating-system-versions", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._operating_system_versions_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._operating_system_versions_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("operating-system-versions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("operating-systems", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._operating_systems_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._operating_systems_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("operating-systems".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("order-documents", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._order_documents_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._order_documents_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("order-documents".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("orders", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._orders_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._orders_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("orders".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("placement-groups", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._placement_groups_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._placement_groups_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._placement_groups_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._placement_groups_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._placement_groups_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("placement-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("placement-strategies", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._placement_strategies_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._placement_strategies_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._placement_strategies_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._placement_strategies_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._placement_strategies_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._placement_strategies_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("placement-strategies".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("placements", Some(opt)) => { + match opt.subcommand() { + ("generatetags", Some(opt)) => { + call_result = self._placements_generatetags(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._placements_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._placements_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._placements_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._placements_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._placements_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("placements".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("platform-types", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._platform_types_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._platform_types_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("platform-types".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("postal-codes", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._postal_codes_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._postal_codes_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("postal-codes".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("projects", Some(opt)) => { + match opt.subcommand() { + ("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); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("regions", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._regions_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("regions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("remarketing-list-shares", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._remarketing_list_shares_get(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._remarketing_list_shares_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._remarketing_list_shares_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("remarketing-list-shares".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("remarketing-lists", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._remarketing_lists_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._remarketing_lists_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._remarketing_lists_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._remarketing_lists_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._remarketing_lists_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("remarketing-lists".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("reports", Some(opt)) => { + match opt.subcommand() { + ("compatible-fields-query", Some(opt)) => { + call_result = self._reports_compatible_fields_query(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._reports_delete(opt, dry_run, &mut err); + }, + ("files-get", Some(opt)) => { + call_result = self._reports_files_get(opt, dry_run, &mut err); + }, + ("files-list", Some(opt)) => { + call_result = self._reports_files_list(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._reports_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._reports_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._reports_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._reports_patch(opt, dry_run, &mut err); + }, + ("run", Some(opt)) => { + call_result = self._reports_run(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._reports_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("reports".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("sites", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._sites_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._sites_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._sites_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._sites_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._sites_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("sites".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("sizes", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._sizes_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._sizes_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._sizes_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("sizes".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("subaccounts", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._subaccounts_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._subaccounts_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._subaccounts_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._subaccounts_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._subaccounts_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("subaccounts".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("targetable-remarketing-lists", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._targetable_remarketing_lists_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._targetable_remarketing_lists_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("targetable-remarketing-lists".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("targeting-templates", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._targeting_templates_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._targeting_templates_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._targeting_templates_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._targeting_templates_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._targeting_templates_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("targeting-templates".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("user-profiles", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._user_profiles_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._user_profiles_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("user-profiles".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("user-role-permission-groups", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._user_role_permission_groups_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._user_role_permission_groups_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("user-role-permission-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("user-role-permissions", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._user_role_permissions_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._user_role_permissions_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("user-role-permissions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("user-roles", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._user_roles_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._user_roles_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._user_roles_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._user_roles_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._user_roles_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._user_roles_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("user-roles".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("video-formats", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._video_formats_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._video_formats_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("video-formats".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<'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, "dfareporting2d8-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "dfareporting2d8", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::Dfareporting::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 upload_value_names = ["mode", "file"]; + let arg_data = [ + ("account-active-ad-summaries", "methods: 'get'", vec![ + ("get", + Some(r##"Gets the account's active ad summary by account ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-active-ad-summaries_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"summary-account-id"##), + None, + Some(r##"Account ID."##), + 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)), + ]), + ]), + + ("account-permission-groups", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one account permission group by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-permission-groups_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Account permission group ID."##), + 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##"Retrieves the list of account permission groups."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-permission-groups_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("account-permissions", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one account permission by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-permissions_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Account permission ID."##), + 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##"Retrieves the list of account permissions."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-permissions_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("account-user-profiles", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one account user profile by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-user-profiles_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User profile ID."##), + 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##"Inserts a new account user profile."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-user-profiles_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of account user profiles, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-user-profiles_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing account user profile. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-user-profiles_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User profile ID."##), + 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 an existing account user profile."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/account-user-profiles_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("accounts", "methods: 'get', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one account by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/accounts_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Account ID."##), + 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##"Retrieves the list of accounts, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/accounts_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing account. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/accounts_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Account ID."##), + 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 an existing account."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/accounts_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("ads", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one ad by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/ads_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Ad ID."##), + 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##"Inserts a new ad."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/ads_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of ads, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/ads_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing ad. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/ads_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Ad ID."##), + 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 an existing ad."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/ads_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("advertiser-groups", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing advertiser group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertiser-groups_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Advertiser group ID."##), + 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)), + ]), + ("get", + Some(r##"Gets one advertiser group by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertiser-groups_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Advertiser group ID."##), + 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##"Inserts a new advertiser group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertiser-groups_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of advertiser groups, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertiser-groups_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing advertiser group. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertiser-groups_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Advertiser group ID."##), + 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 an existing advertiser group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertiser-groups_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("advertisers", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one advertiser by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertisers_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Advertiser ID."##), + 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##"Inserts a new advertiser."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertisers_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of advertisers, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertisers_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing advertiser. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertisers_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Advertiser ID."##), + 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 an existing advertiser."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/advertisers_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("browsers", "methods: 'list'", vec![ + ("list", + Some(r##"Retrieves a list of browsers."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/browsers_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("campaign-creative-associations", "methods: 'insert' and 'list'", vec![ + ("insert", + Some(r##"Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaign-creative-associations_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Campaign ID in this association."##), + 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##"Retrieves the list of creative IDs associated with the specified campaign. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaign-creative-associations_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Campaign ID in this association."##), + 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)), + ]), + ]), + + ("campaigns", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one campaign by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaigns_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Campaign ID."##), + 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##"Inserts a new campaign."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaigns_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"default-landing-page-name"##), + None, + Some(r##"Default landing page name for this new campaign. Must be less than 256 characters long."##), + Some(true), + Some(false)), + + (Some(r##"default-landing-page-url"##), + None, + Some(r##"Default landing page URL for this new campaign."##), + 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##"Retrieves a list of campaigns, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaigns_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing campaign. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaigns_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Campaign ID."##), + 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 an existing campaign."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/campaigns_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("change-logs", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one change log by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/change-logs_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Change log ID."##), + 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##"Retrieves a list of change logs. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/change-logs_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("cities", "methods: 'list'", vec![ + ("list", + Some(r##"Retrieves a list of cities, possibly filtered."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/cities_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("connection-types", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one connection type by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/connection-types_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Connection type ID."##), + 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##"Retrieves a list of connection types."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/connection-types_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("content-categories", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing content category."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/content-categories_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Content category ID."##), + 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)), + ]), + ("get", + Some(r##"Gets one content category by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/content-categories_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Content category ID."##), + 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##"Inserts a new content category."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/content-categories_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of content categories, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/content-categories_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing content category. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/content-categories_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Content category ID."##), + 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 an existing content category."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/content-categories_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("conversions", "methods: 'batchinsert' and 'batchupdate'", vec![ + ("batchinsert", + Some(r##"Inserts conversions."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/conversions_batchinsert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ("batchupdate", + Some(r##"Updates existing conversions."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/conversions_batchupdate", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("countries", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one country by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/countries_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"dart-id"##), + None, + Some(r##"Country DART ID."##), + 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##"Retrieves a list of countries."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/countries_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("creative-assets", "methods: 'insert'", vec![ + ("insert", + Some(r##"Inserts a new creative asset."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-assets_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"advertiser-id"##), + None, + Some(r##"Advertiser ID of this creative. This is a required field."##), + 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##"mode"##), + Some(r##"u"##), + Some(r##"Specify the upload protocol (simple|resumable) and the file to upload"##), + 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)), + ]), + ]), + + ("creative-field-values", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing creative field value."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-field-values_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"creative-field-id"##), + None, + Some(r##"Creative field ID for this creative field value."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative Field Value ID"##), + 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)), + ]), + ("get", + Some(r##"Gets one creative field value by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-field-values_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"creative-field-id"##), + None, + Some(r##"Creative field ID for this creative field value."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative Field Value ID"##), + 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##"Inserts a new creative field value."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-field-values_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"creative-field-id"##), + None, + Some(r##"Creative field ID for this creative field value."##), + 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##"Retrieves a list of creative field values, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-field-values_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"creative-field-id"##), + None, + Some(r##"Creative field ID for this creative field value."##), + 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 an existing creative field value. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-field-values_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"creative-field-id"##), + None, + Some(r##"Creative field ID for this creative field value."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative Field Value ID"##), + 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 an existing creative field value."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-field-values_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"creative-field-id"##), + None, + Some(r##"Creative field ID for this creative field value."##), + 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)), + ]), + ]), + + ("creative-fields", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing creative field."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-fields_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative Field ID"##), + 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)), + ]), + ("get", + Some(r##"Gets one creative field by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-fields_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative Field ID"##), + 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##"Inserts a new creative field."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-fields_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of creative fields, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-fields_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing creative field. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-fields_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative Field ID"##), + 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 an existing creative field."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-fields_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("creative-groups", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one creative group by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-groups_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative group ID."##), + 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##"Inserts a new creative group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-groups_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of creative groups, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-groups_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing creative group. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-groups_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative group ID."##), + 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 an existing creative group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creative-groups_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("creatives", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one creative by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creatives_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative ID."##), + 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##"Inserts a new creative."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creatives_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of creatives, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creatives_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing creative. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creatives_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Creative ID."##), + 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 an existing creative."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/creatives_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("dimension-values", "methods: 'query'", vec![ + ("query", + Some(r##"Retrieves list of report dimension values for a list of filters."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/dimension-values_query", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + 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)), + ]), + ]), + + ("directory-site-contacts", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one directory site contact by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/directory-site-contacts_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Directory site contact ID."##), + 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##"Retrieves a list of directory site contacts, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/directory-site-contacts_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("directory-sites", "methods: 'get', 'insert' and 'list'", vec![ + ("get", + Some(r##"Gets one directory site by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/directory-sites_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Directory site ID."##), + 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##"Inserts a new directory site."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/directory-sites_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of directory sites, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/directory-sites_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("dynamic-targeting-keys", "methods: 'delete', 'insert' and 'list'", vec![ + ("delete", + Some(r##"Deletes an existing dynamic targeting key."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/dynamic-targeting-keys_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"object-id"##), + None, + Some(r##"ID of the object of this dynamic targeting key. This is a required field."##), + Some(true), + Some(false)), + + (Some(r##"name"##), + None, + Some(r##"Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase."##), + Some(true), + Some(false)), + + (Some(r##"object-type"##), + None, + Some(r##"Type of the object of this dynamic targeting key. This is a required field."##), + 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)), + ]), + ("insert", + Some(r##"Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/dynamic-targeting-keys_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of dynamic targeting keys."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/dynamic-targeting-keys_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("event-tags", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing event tag."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/event-tags_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Event tag ID."##), + 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)), + ]), + ("get", + Some(r##"Gets one event tag by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/event-tags_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Event tag ID."##), + 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##"Inserts a new event tag."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/event-tags_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of event tags, possibly filtered."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/event-tags_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing event tag. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/event-tags_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Event tag ID."##), + 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 an existing event tag."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/event-tags_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("files", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Retrieves a report file by its report ID and file ID. This method supports media download."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/files_get", + vec![ + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + Some(true), + Some(false)), + + (Some(r##"file-id"##), + None, + Some(r##"The ID of the report file."##), + 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 files for a user profile."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/files_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA profile ID."##), + 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)), + ]), + ]), + + ("floodlight-activities", "methods: 'delete', 'generatetag', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing floodlight activity."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight activity ID."##), + 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)), + ]), + ("generatetag", + Some(r##"Generates a tag for a floodlight activity."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_generatetag", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 one floodlight activity by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight activity ID."##), + 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##"Inserts a new floodlight activity."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of floodlight activities, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing floodlight activity. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight activity ID."##), + 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 an existing floodlight activity."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activities_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("floodlight-activity-groups", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one floodlight activity group by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activity-groups_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight activity Group ID."##), + 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##"Inserts a new floodlight activity group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activity-groups_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activity-groups_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing floodlight activity group. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activity-groups_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight activity Group ID."##), + 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 an existing floodlight activity group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-activity-groups_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("floodlight-configurations", "methods: 'get', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one floodlight configuration by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-configurations_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight configuration ID."##), + 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##"Retrieves a list of floodlight configurations, possibly filtered."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-configurations_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing floodlight configuration. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-configurations_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Floodlight configuration ID."##), + 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 an existing floodlight configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/floodlight-configurations_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("inventory-items", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one inventory item by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/inventory-items_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"project-id"##), + None, + Some(r##"Project ID for order documents."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Inventory item ID."##), + 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##"Retrieves a list of inventory items, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/inventory-items_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"project-id"##), + None, + Some(r##"Project ID for order documents."##), + 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)), + ]), + ]), + + ("landing-pages", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing campaign landing page."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/landing-pages_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Landing page campaign ID."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Landing page ID."##), + 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)), + ]), + ("get", + Some(r##"Gets one campaign landing page by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/landing-pages_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Landing page campaign ID."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Landing page ID."##), + 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##"Inserts a new landing page for the specified campaign."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/landing-pages_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Landing page campaign ID."##), + 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##"Retrieves the list of landing pages for the specified campaign."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/landing-pages_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Landing page campaign ID."##), + 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 an existing campaign landing page. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/landing-pages_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Landing page campaign ID."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Landing page ID."##), + 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 an existing campaign landing page."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/landing-pages_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"campaign-id"##), + None, + Some(r##"Landing page campaign ID."##), + 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)), + ]), + ]), + + ("languages", "methods: 'list'", vec![ + ("list", + Some(r##"Retrieves a list of languages."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/languages_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("metros", "methods: 'list'", vec![ + ("list", + Some(r##"Retrieves a list of metros."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/metros_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("mobile-carriers", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one mobile carrier by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/mobile-carriers_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Mobile carrier ID."##), + 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##"Retrieves a list of mobile carriers."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/mobile-carriers_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("operating-system-versions", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one operating system version by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/operating-system-versions_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Operating system version ID."##), + 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##"Retrieves a list of operating system versions."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/operating-system-versions_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("operating-systems", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one operating system by DART ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/operating-systems_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"dart-id"##), + None, + Some(r##"Operating system DART ID."##), + 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##"Retrieves a list of operating systems."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/operating-systems_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("order-documents", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one order document by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/order-documents_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"project-id"##), + None, + Some(r##"Project ID for order documents."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Order document ID."##), + 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##"Retrieves a list of order documents, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/order-documents_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"project-id"##), + None, + Some(r##"Project ID for order documents."##), + 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)), + ]), + ]), + + ("orders", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one order by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/orders_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"project-id"##), + None, + Some(r##"Project ID for orders."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Order ID."##), + 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##"Retrieves a list of orders, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/orders_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"project-id"##), + None, + Some(r##"Project ID for orders."##), + 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)), + ]), + ]), + + ("placement-groups", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one placement group by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-groups_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement group ID."##), + 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##"Inserts a new placement group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-groups_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of placement groups, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-groups_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing placement group. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-groups_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement group ID."##), + 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 an existing placement group."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-groups_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("placement-strategies", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing placement strategy."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-strategies_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement strategy ID."##), + 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)), + ]), + ("get", + Some(r##"Gets one placement strategy by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-strategies_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement strategy ID."##), + 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##"Inserts a new placement strategy."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-strategies_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of placement strategies, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-strategies_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing placement strategy. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-strategies_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement strategy ID."##), + 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 an existing placement strategy."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placement-strategies_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("placements", "methods: 'generatetags', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("generatetags", + Some(r##"Generates tags for a placement."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placements_generatetags", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 one placement by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placements_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement ID."##), + 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##"Inserts a new placement."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placements_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of placements, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placements_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing placement. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placements_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Placement ID."##), + 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 an existing placement."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/placements_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("platform-types", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one platform type by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/platform-types_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Platform type ID."##), + 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##"Retrieves a list of platform types."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/platform-types_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("postal-codes", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one postal code by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/postal-codes_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"code"##), + None, + Some(r##"Postal code ID."##), + 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##"Retrieves a list of postal codes."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/postal-codes_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("projects", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one project by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/projects_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Project ID."##), + 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##"Retrieves a list of projects, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/projects_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("regions", "methods: 'list'", vec![ + ("list", + Some(r##"Retrieves a list of regions."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/regions_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("remarketing-list-shares", "methods: 'get', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one remarketing list share by remarketing list ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-list-shares_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"remarketing-list-id"##), + None, + Some(r##"Remarketing list ID."##), + 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 an existing remarketing list share. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-list-shares_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"remarketing-list-id"##), + None, + Some(r##"Remarketing list ID."##), + 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 an existing remarketing list share."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-list-shares_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("remarketing-lists", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one remarketing list by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-lists_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Remarketing list ID."##), + 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##"Inserts a new remarketing list."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-lists_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of remarketing lists, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-lists_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"advertiser-id"##), + None, + Some(r##"Select only remarketing lists owned by this advertiser."##), + 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 an existing remarketing list. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-lists_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Remarketing list ID."##), + 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 an existing remarketing list."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/remarketing-lists_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("reports", "methods: 'compatible-fields-query', 'delete', 'files-get', 'files-list', 'get', 'insert', 'list', 'patch', 'run' and 'update'", vec![ + ("compatible-fields-query", + Some(r##"Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_compatible-fields-query", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a report by its ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + 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)), + ]), + ("files-get", + Some(r##"Retrieves a report file. This method supports media download."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_files-get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + Some(true), + Some(false)), + + (Some(r##"file-id"##), + None, + Some(r##"The ID of the report file."##), + 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)), + ]), + ("files-list", + Some(r##"Lists files for a report."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_files-list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the parent report."##), + 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 a report by its ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + 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 report."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + 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##"Retrieves list of reports."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + 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 report. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + 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)), + ]), + ("run", + Some(r##"Runs a report."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_run", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + 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 a report."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/reports_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The DFA user profile ID."##), + Some(true), + Some(false)), + + (Some(r##"report-id"##), + None, + Some(r##"The ID of the report."##), + 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)), + ]), + ]), + + ("sites", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one site by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sites_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Site ID."##), + 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##"Inserts a new site."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sites_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of sites, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sites_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing site. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sites_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Site ID."##), + 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 an existing site."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sites_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("sizes", "methods: 'get', 'insert' and 'list'", vec![ + ("get", + Some(r##"Gets one size by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sizes_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Size ID."##), + 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##"Inserts a new size."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sizes_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of sizes, possibly filtered."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/sizes_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("subaccounts", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one subaccount by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/subaccounts_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Subaccount ID."##), + 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##"Inserts a new subaccount."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/subaccounts_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Gets a list of subaccounts, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/subaccounts_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing subaccount. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/subaccounts_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Subaccount ID."##), + 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 an existing subaccount."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/subaccounts_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("targetable-remarketing-lists", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one remarketing list by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targetable-remarketing-lists_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Remarketing list ID."##), + 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##"Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targetable-remarketing-lists_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"advertiser-id"##), + None, + Some(r##"Select only targetable remarketing lists targetable by these advertisers."##), + 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)), + ]), + ]), + + ("targeting-templates", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one targeting template by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targeting-templates_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Targeting template ID."##), + 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##"Inserts a new targeting template."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targeting-templates_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of targeting templates, optionally filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targeting-templates_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing targeting template. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targeting-templates_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Targeting template ID."##), + 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 an existing targeting template."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/targeting-templates_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("user-profiles", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one user profile by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-profiles_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"The user profile ID."##), + 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##"Retrieves list of user profiles for a user."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-profiles_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)), + ]), + ]), + + ("user-role-permission-groups", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one user role permission group by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-role-permission-groups_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User role permission group ID."##), + 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##"Gets a list of all supported user role permission groups."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-role-permission-groups_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("user-role-permissions", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one user role permission by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-role-permissions_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User role permission ID."##), + 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##"Gets a list of user role permissions, possibly filtered."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-role-permissions_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("user-roles", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes an existing user role."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-roles_delete", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User role ID."##), + 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)), + ]), + ("get", + Some(r##"Gets one user role by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-roles_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User role ID."##), + 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##"Inserts a new user role."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-roles_insert", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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##"Retrieves a list of user roles, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-roles_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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 an existing user role. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-roles_patch", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"User role ID."##), + 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 an existing user role."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/user-roles_update", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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)), + ]), + ]), + + ("video-formats", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets one video format by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/video-formats_get", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with this request."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Video format ID."##), + 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 available video formats."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli/video-formats_list", + vec![ + (Some(r##"profile-id"##), + None, + Some(r##"User profile ID associated with 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("dfareporting2d8") + .author("Sebastian Thiel ") + .version("1.0.6+20170818") + .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting2d8_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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); + } + if arg_name_str == "mode" { + arg = arg.number_of_values(2); + arg = arg.value_names(&upload_value_names); + + scmd = scmd.arg(Arg::with_name("mime") + .short("m") + .requires("mode") + .required(false) + .help("The file's mime time, like 'application/octet-stream'") + .takes_value(true)); + } + 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/dfareporting2d8/Cargo.toml b/gen/dfareporting2d8/Cargo.toml new file mode 100644 index 0000000000..91a01d0077 --- /dev/null +++ b/gen/dfareporting2d8/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-dfareporting2d8" +version = "1.0.6+20170818" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with dfareporting (protocol v2.8)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8" +homepage = "https://developers.google.com/doubleclick-advertisers/" +documentation = "https://docs.rs/google-dfareporting2d8/1.0.6+20170818" +license = "MIT" +keywords = ["dfareporting", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/dfareporting2d8/LICENSE.md b/gen/dfareporting2d8/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dfareporting2d8/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/dfareporting2d8/README.md b/gen/dfareporting2d8/README.md new file mode 100644 index 0000000000..52a7a7f445 --- /dev/null +++ b/gen/dfareporting2d8/README.md @@ -0,0 +1,315 @@ + +The `google-dfareporting2d8` library allows access to all features of the *Google dfareporting* service. + +This documentation was generated from *dfareporting* crate version *1.0.6+20170818*, where *20170818* is the exact revision of the *dfareporting:v2.8* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *dfareporting* *v2d8* API can be found at the +[official documentation site](https://developers.google.com/doubleclick-advertisers/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Dfareporting.html) ... + +* [account active ad summaries](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LandingPageUpdateCall.html) +* [languages](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.VideoFormatListCall.html) + + +Upload supported by ... + +* [*insert creative assets*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) + +Download supported by ... + +* [*get files*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.ReportFileGetCall.html) + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Dfareporting.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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.reports().run(...).doit() +let r = hub.reports().get(...).doit() +let r = hub.reports().list(...).doit() +let r = hub.reports().delete(...).doit() +let r = hub.reports().files_list(...).doit() +let r = hub.reports().insert(...).doit() +let r = hub.reports().patch(...).doit() +let r = hub.reports().compatible_fields_query(...).doit() +let r = hub.reports().update(...).doit() +let r = hub.reports().files_get(...).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-dfareporting2d8 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_dfareporting2d8 as dfareporting2d8; +use dfareporting2d8::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use dfareporting2d8::Dfareporting; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().list("profileId") + .sort_order("sit") + .sort_field("Stet") + .scope("sed") + .page_token("et") + .max_results(-18) + .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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/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 **dfareporting2d8** 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-rsblob/master/LICENSE.md diff --git a/gen/dfareporting2d8/src/cmn.rs b/gen/dfareporting2d8/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/dfareporting2d8/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/dfareporting2d8/src/lib.rs b/gen/dfareporting2d8/src/lib.rs new file mode 100644 index 0000000000..eb4077c13e --- /dev/null +++ b/gen/dfareporting2d8/src/lib.rs @@ -0,0 +1,72604 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *dfareporting* crate version *1.0.6+20170818*, where *20170818* is the exact revision of the *dfareporting:v2.8* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *dfareporting* *v2d8* API can be found at the +//! [official documentation site](https://developers.google.com/doubleclick-advertisers/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Dfareporting.html) ... +//! +//! * [account active ad summaries](struct.AccountActiveAdSummary.html) +//! * [*get*](struct.AccountActiveAdSummaryGetCall.html) +//! * [account permission groups](struct.AccountPermissionGroup.html) +//! * [*get*](struct.AccountPermissionGroupGetCall.html) and [*list*](struct.AccountPermissionGroupListCall.html) +//! * [account permissions](struct.AccountPermission.html) +//! * [*get*](struct.AccountPermissionGetCall.html) and [*list*](struct.AccountPermissionListCall.html) +//! * [account user profiles](struct.AccountUserProfile.html) +//! * [*get*](struct.AccountUserProfileGetCall.html), [*insert*](struct.AccountUserProfileInsertCall.html), [*list*](struct.AccountUserProfileListCall.html), [*patch*](struct.AccountUserProfilePatchCall.html) and [*update*](struct.AccountUserProfileUpdateCall.html) +//! * [accounts](struct.Account.html) +//! * [*get*](struct.AccountGetCall.html), [*list*](struct.AccountListCall.html), [*patch*](struct.AccountPatchCall.html) and [*update*](struct.AccountUpdateCall.html) +//! * [ads](struct.Ad.html) +//! * [*get*](struct.AdGetCall.html), [*insert*](struct.AdInsertCall.html), [*list*](struct.AdListCall.html), [*patch*](struct.AdPatchCall.html) and [*update*](struct.AdUpdateCall.html) +//! * [advertiser groups](struct.AdvertiserGroup.html) +//! * [*delete*](struct.AdvertiserGroupDeleteCall.html), [*get*](struct.AdvertiserGroupGetCall.html), [*insert*](struct.AdvertiserGroupInsertCall.html), [*list*](struct.AdvertiserGroupListCall.html), [*patch*](struct.AdvertiserGroupPatchCall.html) and [*update*](struct.AdvertiserGroupUpdateCall.html) +//! * [advertisers](struct.Advertiser.html) +//! * [*get*](struct.AdvertiserGetCall.html), [*insert*](struct.AdvertiserInsertCall.html), [*list*](struct.AdvertiserListCall.html), [*patch*](struct.AdvertiserPatchCall.html) and [*update*](struct.AdvertiserUpdateCall.html) +//! * [browsers](struct.Browser.html) +//! * [*list*](struct.BrowserListCall.html) +//! * [campaign creative associations](struct.CampaignCreativeAssociation.html) +//! * [*insert*](struct.CampaignCreativeAssociationInsertCall.html) and [*list*](struct.CampaignCreativeAssociationListCall.html) +//! * [campaigns](struct.Campaign.html) +//! * [*get*](struct.CampaignGetCall.html), [*insert*](struct.CampaignInsertCall.html), [*list*](struct.CampaignListCall.html), [*patch*](struct.CampaignPatchCall.html) and [*update*](struct.CampaignUpdateCall.html) +//! * [change logs](struct.ChangeLog.html) +//! * [*get*](struct.ChangeLogGetCall.html) and [*list*](struct.ChangeLogListCall.html) +//! * [cities](struct.City.html) +//! * [*list*](struct.CityListCall.html) +//! * [connection types](struct.ConnectionType.html) +//! * [*get*](struct.ConnectionTypeGetCall.html) and [*list*](struct.ConnectionTypeListCall.html) +//! * [content categories](struct.ContentCategory.html) +//! * [*delete*](struct.ContentCategoryDeleteCall.html), [*get*](struct.ContentCategoryGetCall.html), [*insert*](struct.ContentCategoryInsertCall.html), [*list*](struct.ContentCategoryListCall.html), [*patch*](struct.ContentCategoryPatchCall.html) and [*update*](struct.ContentCategoryUpdateCall.html) +//! * [conversions](struct.Conversion.html) +//! * [*batchinsert*](struct.ConversionBatchinsertCall.html) and [*batchupdate*](struct.ConversionBatchupdateCall.html) +//! * [countries](struct.Country.html) +//! * [*get*](struct.CountryGetCall.html) and [*list*](struct.CountryListCall.html) +//! * [creative assets](struct.CreativeAsset.html) +//! * [*insert*](struct.CreativeAssetInsertCall.html) +//! * [creative field values](struct.CreativeFieldValue.html) +//! * [*delete*](struct.CreativeFieldValueDeleteCall.html), [*get*](struct.CreativeFieldValueGetCall.html), [*insert*](struct.CreativeFieldValueInsertCall.html), [*list*](struct.CreativeFieldValueListCall.html), [*patch*](struct.CreativeFieldValuePatchCall.html) and [*update*](struct.CreativeFieldValueUpdateCall.html) +//! * [creative fields](struct.CreativeField.html) +//! * [*delete*](struct.CreativeFieldDeleteCall.html), [*get*](struct.CreativeFieldGetCall.html), [*insert*](struct.CreativeFieldInsertCall.html), [*list*](struct.CreativeFieldListCall.html), [*patch*](struct.CreativeFieldPatchCall.html) and [*update*](struct.CreativeFieldUpdateCall.html) +//! * [creative groups](struct.CreativeGroup.html) +//! * [*get*](struct.CreativeGroupGetCall.html), [*insert*](struct.CreativeGroupInsertCall.html), [*list*](struct.CreativeGroupListCall.html), [*patch*](struct.CreativeGroupPatchCall.html) and [*update*](struct.CreativeGroupUpdateCall.html) +//! * [creatives](struct.Creative.html) +//! * [*get*](struct.CreativeGetCall.html), [*insert*](struct.CreativeInsertCall.html), [*list*](struct.CreativeListCall.html), [*patch*](struct.CreativePatchCall.html) and [*update*](struct.CreativeUpdateCall.html) +//! * [dimension values](struct.DimensionValue.html) +//! * [*query*](struct.DimensionValueQueryCall.html) +//! * [directory site contacts](struct.DirectorySiteContact.html) +//! * [*get*](struct.DirectorySiteContactGetCall.html) and [*list*](struct.DirectorySiteContactListCall.html) +//! * [directory sites](struct.DirectorySite.html) +//! * [*get*](struct.DirectorySiteGetCall.html), [*insert*](struct.DirectorySiteInsertCall.html) and [*list*](struct.DirectorySiteListCall.html) +//! * [dynamic targeting keys](struct.DynamicTargetingKey.html) +//! * [*delete*](struct.DynamicTargetingKeyDeleteCall.html), [*insert*](struct.DynamicTargetingKeyInsertCall.html) and [*list*](struct.DynamicTargetingKeyListCall.html) +//! * [event tags](struct.EventTag.html) +//! * [*delete*](struct.EventTagDeleteCall.html), [*get*](struct.EventTagGetCall.html), [*insert*](struct.EventTagInsertCall.html), [*list*](struct.EventTagListCall.html), [*patch*](struct.EventTagPatchCall.html) and [*update*](struct.EventTagUpdateCall.html) +//! * [files](struct.File.html) +//! * [*get*](struct.FileGetCall.html) and [*list*](struct.FileListCall.html) +//! * [floodlight activities](struct.FloodlightActivity.html) +//! * [*delete*](struct.FloodlightActivityDeleteCall.html), [*generatetag*](struct.FloodlightActivityGeneratetagCall.html), [*get*](struct.FloodlightActivityGetCall.html), [*insert*](struct.FloodlightActivityInsertCall.html), [*list*](struct.FloodlightActivityListCall.html), [*patch*](struct.FloodlightActivityPatchCall.html) and [*update*](struct.FloodlightActivityUpdateCall.html) +//! * [floodlight activity groups](struct.FloodlightActivityGroup.html) +//! * [*get*](struct.FloodlightActivityGroupGetCall.html), [*insert*](struct.FloodlightActivityGroupInsertCall.html), [*list*](struct.FloodlightActivityGroupListCall.html), [*patch*](struct.FloodlightActivityGroupPatchCall.html) and [*update*](struct.FloodlightActivityGroupUpdateCall.html) +//! * [floodlight configurations](struct.FloodlightConfiguration.html) +//! * [*get*](struct.FloodlightConfigurationGetCall.html), [*list*](struct.FloodlightConfigurationListCall.html), [*patch*](struct.FloodlightConfigurationPatchCall.html) and [*update*](struct.FloodlightConfigurationUpdateCall.html) +//! * [inventory items](struct.InventoryItem.html) +//! * [*get*](struct.InventoryItemGetCall.html) and [*list*](struct.InventoryItemListCall.html) +//! * [landing pages](struct.LandingPage.html) +//! * [*delete*](struct.LandingPageDeleteCall.html), [*get*](struct.LandingPageGetCall.html), [*insert*](struct.LandingPageInsertCall.html), [*list*](struct.LandingPageListCall.html), [*patch*](struct.LandingPagePatchCall.html) and [*update*](struct.LandingPageUpdateCall.html) +//! * [languages](struct.Language.html) +//! * [*list*](struct.LanguageListCall.html) +//! * [metros](struct.Metro.html) +//! * [*list*](struct.MetroListCall.html) +//! * [mobile carriers](struct.MobileCarrier.html) +//! * [*get*](struct.MobileCarrierGetCall.html) and [*list*](struct.MobileCarrierListCall.html) +//! * [operating system versions](struct.OperatingSystemVersion.html) +//! * [*get*](struct.OperatingSystemVersionGetCall.html) and [*list*](struct.OperatingSystemVersionListCall.html) +//! * [operating systems](struct.OperatingSystem.html) +//! * [*get*](struct.OperatingSystemGetCall.html) and [*list*](struct.OperatingSystemListCall.html) +//! * [order documents](struct.OrderDocument.html) +//! * [*get*](struct.OrderDocumentGetCall.html) and [*list*](struct.OrderDocumentListCall.html) +//! * [orders](struct.Order.html) +//! * [*get*](struct.OrderGetCall.html) and [*list*](struct.OrderListCall.html) +//! * [placement groups](struct.PlacementGroup.html) +//! * [*get*](struct.PlacementGroupGetCall.html), [*insert*](struct.PlacementGroupInsertCall.html), [*list*](struct.PlacementGroupListCall.html), [*patch*](struct.PlacementGroupPatchCall.html) and [*update*](struct.PlacementGroupUpdateCall.html) +//! * [placement strategies](struct.PlacementStrategy.html) +//! * [*delete*](struct.PlacementStrategyDeleteCall.html), [*get*](struct.PlacementStrategyGetCall.html), [*insert*](struct.PlacementStrategyInsertCall.html), [*list*](struct.PlacementStrategyListCall.html), [*patch*](struct.PlacementStrategyPatchCall.html) and [*update*](struct.PlacementStrategyUpdateCall.html) +//! * [placements](struct.Placement.html) +//! * [*generatetags*](struct.PlacementGeneratetagCall.html), [*get*](struct.PlacementGetCall.html), [*insert*](struct.PlacementInsertCall.html), [*list*](struct.PlacementListCall.html), [*patch*](struct.PlacementPatchCall.html) and [*update*](struct.PlacementUpdateCall.html) +//! * [platform types](struct.PlatformType.html) +//! * [*get*](struct.PlatformTypeGetCall.html) and [*list*](struct.PlatformTypeListCall.html) +//! * [postal codes](struct.PostalCode.html) +//! * [*get*](struct.PostalCodeGetCall.html) and [*list*](struct.PostalCodeListCall.html) +//! * [projects](struct.Project.html) +//! * [*get*](struct.ProjectGetCall.html) and [*list*](struct.ProjectListCall.html) +//! * [regions](struct.Region.html) +//! * [*list*](struct.RegionListCall.html) +//! * [remarketing list shares](struct.RemarketingListShare.html) +//! * [*get*](struct.RemarketingListShareGetCall.html), [*patch*](struct.RemarketingListSharePatchCall.html) and [*update*](struct.RemarketingListShareUpdateCall.html) +//! * [remarketing lists](struct.RemarketingList.html) +//! * [*get*](struct.RemarketingListGetCall.html), [*insert*](struct.RemarketingListInsertCall.html), [*list*](struct.RemarketingListListCall.html), [*patch*](struct.RemarketingListPatchCall.html) and [*update*](struct.RemarketingListUpdateCall.html) +//! * [reports](struct.Report.html) +//! * [*compatible fields query*](struct.ReportCompatibleFieldQueryCall.html), [*delete*](struct.ReportDeleteCall.html), [*files get*](struct.ReportFileGetCall.html), [*files list*](struct.ReportFileListCall.html), [*get*](struct.ReportGetCall.html), [*insert*](struct.ReportInsertCall.html), [*list*](struct.ReportListCall.html), [*patch*](struct.ReportPatchCall.html), [*run*](struct.ReportRunCall.html) and [*update*](struct.ReportUpdateCall.html) +//! * [sites](struct.Site.html) +//! * [*get*](struct.SiteGetCall.html), [*insert*](struct.SiteInsertCall.html), [*list*](struct.SiteListCall.html), [*patch*](struct.SitePatchCall.html) and [*update*](struct.SiteUpdateCall.html) +//! * [sizes](struct.Size.html) +//! * [*get*](struct.SizeGetCall.html), [*insert*](struct.SizeInsertCall.html) and [*list*](struct.SizeListCall.html) +//! * [subaccounts](struct.Subaccount.html) +//! * [*get*](struct.SubaccountGetCall.html), [*insert*](struct.SubaccountInsertCall.html), [*list*](struct.SubaccountListCall.html), [*patch*](struct.SubaccountPatchCall.html) and [*update*](struct.SubaccountUpdateCall.html) +//! * [targetable remarketing lists](struct.TargetableRemarketingList.html) +//! * [*get*](struct.TargetableRemarketingListGetCall.html) and [*list*](struct.TargetableRemarketingListListCall.html) +//! * [targeting templates](struct.TargetingTemplate.html) +//! * [*get*](struct.TargetingTemplateGetCall.html), [*insert*](struct.TargetingTemplateInsertCall.html), [*list*](struct.TargetingTemplateListCall.html), [*patch*](struct.TargetingTemplatePatchCall.html) and [*update*](struct.TargetingTemplateUpdateCall.html) +//! * [user profiles](struct.UserProfile.html) +//! * [*get*](struct.UserProfileGetCall.html) and [*list*](struct.UserProfileListCall.html) +//! * [user role permission groups](struct.UserRolePermissionGroup.html) +//! * [*get*](struct.UserRolePermissionGroupGetCall.html) and [*list*](struct.UserRolePermissionGroupListCall.html) +//! * [user role permissions](struct.UserRolePermission.html) +//! * [*get*](struct.UserRolePermissionGetCall.html) and [*list*](struct.UserRolePermissionListCall.html) +//! * [user roles](struct.UserRole.html) +//! * [*delete*](struct.UserRoleDeleteCall.html), [*get*](struct.UserRoleGetCall.html), [*insert*](struct.UserRoleInsertCall.html), [*list*](struct.UserRoleListCall.html), [*patch*](struct.UserRolePatchCall.html) and [*update*](struct.UserRoleUpdateCall.html) +//! * [video formats](struct.VideoFormat.html) +//! * [*get*](struct.VideoFormatGetCall.html) and [*list*](struct.VideoFormatListCall.html) +//! +//! +//! Upload supported by ... +//! +//! * [*insert creative assets*](struct.CreativeAssetInsertCall.html) +//! +//! Download supported by ... +//! +//! * [*get files*](struct.FileGetCall.html) +//! * [*files get reports*](struct.ReportFileGetCall.html) +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Dfareporting.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.reports().run(...).doit() +//! let r = hub.reports().get(...).doit() +//! let r = hub.reports().list(...).doit() +//! let r = hub.reports().delete(...).doit() +//! let r = hub.reports().files_list(...).doit() +//! let r = hub.reports().insert(...).doit() +//! let r = hub.reports().patch(...).doit() +//! let r = hub.reports().compatible_fields_query(...).doit() +//! let r = hub.reports().update(...).doit() +//! let r = hub.reports().files_get(...).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-dfareporting2d8 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_dfareporting2d8 as dfareporting2d8; +//! use dfareporting2d8::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use dfareporting2d8::Dfareporting; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().list("profileId") +//! .sort_order("accusam") +//! .sort_field("takimata") +//! .scope("justo") +//! .page_token("amet.") +//! .max_results(-81) +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 DoubleClick Campaign Manager's (DCM) display ad campaigns + Dfatrafficking, + + /// View and manage DoubleClick for Advertisers reports + Full, + + /// Manage DoubleClick Digital Marketing conversions + Ddmconversion, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Dfatrafficking => "https://www.googleapis.com/auth/dfatrafficking", + Scope::Full => "https://www.googleapis.com/auth/dfareporting", + Scope::Ddmconversion => "https://www.googleapis.com/auth/ddmconversions", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Full + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Dfareporting related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().list("profileId") +/// .sort_order("sea") +/// .sort_field("nonumy") +/// .scope("dolores") +/// .page_token("gubergren") +/// .max_results(-95) +/// .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 Dfareporting { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Dfareporting {} + +impl<'a, C, A> Dfareporting + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Dfareporting { + Dfareporting { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://www.googleapis.com/dfareporting/v2.8/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), + } + } + + pub fn account_active_ad_summaries(&'a self) -> AccountActiveAdSummaryMethods<'a, C, A> { + AccountActiveAdSummaryMethods { hub: &self } + } + pub fn account_permission_groups(&'a self) -> AccountPermissionGroupMethods<'a, C, A> { + AccountPermissionGroupMethods { hub: &self } + } + pub fn account_permissions(&'a self) -> AccountPermissionMethods<'a, C, A> { + AccountPermissionMethods { hub: &self } + } + pub fn account_user_profiles(&'a self) -> AccountUserProfileMethods<'a, C, A> { + AccountUserProfileMethods { hub: &self } + } + pub fn accounts(&'a self) -> AccountMethods<'a, C, A> { + AccountMethods { hub: &self } + } + pub fn ads(&'a self) -> AdMethods<'a, C, A> { + AdMethods { hub: &self } + } + pub fn advertiser_groups(&'a self) -> AdvertiserGroupMethods<'a, C, A> { + AdvertiserGroupMethods { hub: &self } + } + pub fn advertisers(&'a self) -> AdvertiserMethods<'a, C, A> { + AdvertiserMethods { hub: &self } + } + pub fn browsers(&'a self) -> BrowserMethods<'a, C, A> { + BrowserMethods { hub: &self } + } + pub fn campaign_creative_associations(&'a self) -> CampaignCreativeAssociationMethods<'a, C, A> { + CampaignCreativeAssociationMethods { hub: &self } + } + pub fn campaigns(&'a self) -> CampaignMethods<'a, C, A> { + CampaignMethods { hub: &self } + } + pub fn change_logs(&'a self) -> ChangeLogMethods<'a, C, A> { + ChangeLogMethods { hub: &self } + } + pub fn cities(&'a self) -> CityMethods<'a, C, A> { + CityMethods { hub: &self } + } + pub fn connection_types(&'a self) -> ConnectionTypeMethods<'a, C, A> { + ConnectionTypeMethods { hub: &self } + } + pub fn content_categories(&'a self) -> ContentCategoryMethods<'a, C, A> { + ContentCategoryMethods { hub: &self } + } + pub fn conversions(&'a self) -> ConversionMethods<'a, C, A> { + ConversionMethods { hub: &self } + } + pub fn countries(&'a self) -> CountryMethods<'a, C, A> { + CountryMethods { hub: &self } + } + pub fn creative_assets(&'a self) -> CreativeAssetMethods<'a, C, A> { + CreativeAssetMethods { hub: &self } + } + pub fn creative_field_values(&'a self) -> CreativeFieldValueMethods<'a, C, A> { + CreativeFieldValueMethods { hub: &self } + } + pub fn creative_fields(&'a self) -> CreativeFieldMethods<'a, C, A> { + CreativeFieldMethods { hub: &self } + } + pub fn creative_groups(&'a self) -> CreativeGroupMethods<'a, C, A> { + CreativeGroupMethods { hub: &self } + } + pub fn creatives(&'a self) -> CreativeMethods<'a, C, A> { + CreativeMethods { hub: &self } + } + pub fn dimension_values(&'a self) -> DimensionValueMethods<'a, C, A> { + DimensionValueMethods { hub: &self } + } + pub fn directory_site_contacts(&'a self) -> DirectorySiteContactMethods<'a, C, A> { + DirectorySiteContactMethods { hub: &self } + } + pub fn directory_sites(&'a self) -> DirectorySiteMethods<'a, C, A> { + DirectorySiteMethods { hub: &self } + } + pub fn dynamic_targeting_keys(&'a self) -> DynamicTargetingKeyMethods<'a, C, A> { + DynamicTargetingKeyMethods { hub: &self } + } + pub fn event_tags(&'a self) -> EventTagMethods<'a, C, A> { + EventTagMethods { hub: &self } + } + pub fn files(&'a self) -> FileMethods<'a, C, A> { + FileMethods { hub: &self } + } + pub fn floodlight_activities(&'a self) -> FloodlightActivityMethods<'a, C, A> { + FloodlightActivityMethods { hub: &self } + } + pub fn floodlight_activity_groups(&'a self) -> FloodlightActivityGroupMethods<'a, C, A> { + FloodlightActivityGroupMethods { hub: &self } + } + pub fn floodlight_configurations(&'a self) -> FloodlightConfigurationMethods<'a, C, A> { + FloodlightConfigurationMethods { hub: &self } + } + pub fn inventory_items(&'a self) -> InventoryItemMethods<'a, C, A> { + InventoryItemMethods { hub: &self } + } + pub fn landing_pages(&'a self) -> LandingPageMethods<'a, C, A> { + LandingPageMethods { hub: &self } + } + pub fn languages(&'a self) -> LanguageMethods<'a, C, A> { + LanguageMethods { hub: &self } + } + pub fn metros(&'a self) -> MetroMethods<'a, C, A> { + MetroMethods { hub: &self } + } + pub fn mobile_carriers(&'a self) -> MobileCarrierMethods<'a, C, A> { + MobileCarrierMethods { hub: &self } + } + pub fn operating_system_versions(&'a self) -> OperatingSystemVersionMethods<'a, C, A> { + OperatingSystemVersionMethods { hub: &self } + } + pub fn operating_systems(&'a self) -> OperatingSystemMethods<'a, C, A> { + OperatingSystemMethods { hub: &self } + } + pub fn order_documents(&'a self) -> OrderDocumentMethods<'a, C, A> { + OrderDocumentMethods { hub: &self } + } + pub fn orders(&'a self) -> OrderMethods<'a, C, A> { + OrderMethods { hub: &self } + } + pub fn placement_groups(&'a self) -> PlacementGroupMethods<'a, C, A> { + PlacementGroupMethods { hub: &self } + } + pub fn placement_strategies(&'a self) -> PlacementStrategyMethods<'a, C, A> { + PlacementStrategyMethods { hub: &self } + } + pub fn placements(&'a self) -> PlacementMethods<'a, C, A> { + PlacementMethods { hub: &self } + } + pub fn platform_types(&'a self) -> PlatformTypeMethods<'a, C, A> { + PlatformTypeMethods { hub: &self } + } + pub fn postal_codes(&'a self) -> PostalCodeMethods<'a, C, A> { + PostalCodeMethods { hub: &self } + } + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } + pub fn regions(&'a self) -> RegionMethods<'a, C, A> { + RegionMethods { hub: &self } + } + pub fn remarketing_list_shares(&'a self) -> RemarketingListShareMethods<'a, C, A> { + RemarketingListShareMethods { hub: &self } + } + pub fn remarketing_lists(&'a self) -> RemarketingListMethods<'a, C, A> { + RemarketingListMethods { hub: &self } + } + pub fn reports(&'a self) -> ReportMethods<'a, C, A> { + ReportMethods { hub: &self } + } + pub fn sites(&'a self) -> SiteMethods<'a, C, A> { + SiteMethods { hub: &self } + } + pub fn sizes(&'a self) -> SizeMethods<'a, C, A> { + SizeMethods { hub: &self } + } + pub fn subaccounts(&'a self) -> SubaccountMethods<'a, C, A> { + SubaccountMethods { hub: &self } + } + pub fn targetable_remarketing_lists(&'a self) -> TargetableRemarketingListMethods<'a, C, A> { + TargetableRemarketingListMethods { hub: &self } + } + pub fn targeting_templates(&'a self) -> TargetingTemplateMethods<'a, C, A> { + TargetingTemplateMethods { hub: &self } + } + pub fn user_profiles(&'a self) -> UserProfileMethods<'a, C, A> { + UserProfileMethods { hub: &self } + } + pub fn user_role_permission_groups(&'a self) -> UserRolePermissionGroupMethods<'a, C, A> { + UserRolePermissionGroupMethods { hub: &self } + } + pub fn user_role_permissions(&'a self) -> UserRolePermissionMethods<'a, C, A> { + UserRolePermissionMethods { hub: &self } + } + pub fn user_roles(&'a self) -> UserRoleMethods<'a, C, A> { + UserRoleMethods { hub: &self } + } + pub fn video_formats(&'a self) -> VideoFormatMethods<'a, C, A> { + VideoFormatMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/dfareporting/v2.8/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Operating System List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list operating systems](struct.OperatingSystemListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperatingSystemsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemsListResponse". + pub kind: Option, + /// Operating system collection. + #[serde(rename="operatingSystems")] + pub operating_systems: Option>, +} + +impl ResponseResult for OperatingSystemsListResponse {} + + +/// A Conversion represents when a user successfully performs a desired action after seeing an ad. +/// +/// # 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*). +/// +/// * [batchinsert conversions](struct.ConversionBatchinsertCall.html) (none) +/// * [batchupdate conversions](struct.ConversionBatchupdateCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Conversion { + /// The ordinal of the conversion. Use this field to control how conversions of the same user and day are de-duplicated. This is a required field. + pub ordinal: Option, + /// The timestamp of conversion, in Unix epoch micros. This is a required field. + #[serde(rename="timestampMicros")] + pub timestamp_micros: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversion". + pub kind: Option, + /// Whether the conversion was directed toward children. + #[serde(rename="childDirectedTreatment")] + pub child_directed_treatment: Option, + /// The alphanumeric encrypted user ID. When set, encryptionInfo should also be specified. This field is mutually exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid. This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required field. + #[serde(rename="encryptedUserId")] + pub encrypted_user_id: Option, + /// The Google click ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId is a required field. + pub gclid: Option, + /// Custom floodlight variables. + #[serde(rename="customVariables")] + pub custom_variables: Option>, + /// Floodlight Configuration ID of this conversion. This is a required field. + #[serde(rename="floodlightConfigurationId")] + pub floodlight_configuration_id: Option, + /// A list of the alphanumeric encrypted user IDs. Any user ID with exposure prior to the conversion timestamp will be used in the inserted conversion. If no such user ID is found then the conversion will be rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be specified. This field may only be used when calling batchinsert; it is not supported by batchupdate. This field is mutually exclusive with encryptedUserId, mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId or gclid is a required field. + #[serde(rename="encryptedUserIdCandidates")] + pub encrypted_user_id_candidates: Option>, + /// The value of the conversion. + pub value: Option, + /// Whether Limit Ad Tracking is enabled. When set to true, the conversion will be used for reporting but not targeting. This will prevent remarketing. + #[serde(rename="limitAdTracking")] + pub limit_ad_tracking: Option, + /// The quantity of the conversion. + pub quantity: Option, + /// Floodlight Activity ID of this conversion. This is a required field. + #[serde(rename="floodlightActivityId")] + pub floodlight_activity_id: Option, + /// The mobile device ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and gclid. This or encryptedUserId or encryptedUserIdCandidates[] or gclid is a required field. + #[serde(rename="mobileDeviceId")] + pub mobile_device_id: Option, +} + +impl Resource for Conversion {} + + +/// Contains information about a mobile carrier that can be targeted by ads. +/// +/// # 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 mobile carriers](struct.MobileCarrierListCall.html) (none) +/// * [get mobile carriers](struct.MobileCarrierGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MobileCarrier { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarrier". + pub kind: Option, + /// DART ID of the country to which this mobile carrier belongs. + #[serde(rename="countryDartId")] + pub country_dart_id: Option, + /// ID of this mobile carrier. + pub id: Option, + /// Country code of the country to which this mobile carrier belongs. + #[serde(rename="countryCode")] + pub country_code: Option, + /// Name of this mobile carrier. + pub name: Option, +} + +impl Resource for MobileCarrier {} +impl ResponseResult for MobileCarrier {} + + +/// Contains properties of a DCM subaccount. +/// +/// # 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 subaccounts](struct.SubaccountGetCall.html) (response) +/// * [update subaccounts](struct.SubaccountUpdateCall.html) (request|response) +/// * [patch subaccounts](struct.SubaccountPatchCall.html) (request|response) +/// * [list subaccounts](struct.SubaccountListCall.html) (none) +/// * [insert subaccounts](struct.SubaccountInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Subaccount { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#subaccount". + pub kind: Option, + /// ID of the account that contains this subaccount. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// IDs of the available user role permissions for this subaccount. + #[serde(rename="availablePermissionIds")] + pub available_permission_ids: Option>, + /// ID of this subaccount. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account. + pub name: Option, +} + +impl RequestValue for Subaccount {} +impl Resource for Subaccount {} +impl ResponseResult for Subaccount {} + + +/// AccountPermissionGroups contains a mapping of permission group IDs to names. A permission group is a grouping of account permissions. +/// +/// # 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 account permission groups](struct.AccountPermissionGroupListCall.html) (none) +/// * [get account permission groups](struct.AccountPermissionGroupGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountPermissionGroup { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionGroup". + pub kind: Option, + /// ID of this account permission group. + pub id: Option, + /// Name of this account permission group. + pub name: Option, +} + +impl Resource for AccountPermissionGroup {} +impl ResponseResult for AccountPermissionGroup {} + + +/// Represents the list of DimensionValue resources. +/// +/// # 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*). +/// +/// * [query dimension values](struct.DimensionValueQueryCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DimensionValueList { + /// Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The dimension values returned in this response. + pub items: Option>, + /// The kind of list this is, in this case dfareporting#dimensionValueList. + pub kind: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, +} + +impl ResponseResult for DimensionValueList {} + + +/// Campaign Creative Association List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list campaign creative associations](struct.CampaignCreativeAssociationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CampaignCreativeAssociationsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Campaign creative association collection + #[serde(rename="campaignCreativeAssociations")] + pub campaign_creative_associations: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignCreativeAssociationsListResponse". + pub kind: Option, +} + +impl ResponseResult for CampaignCreativeAssociationsListResponse {} + + +/// Directory Site Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DirectorySiteSettings { + /// Whether this site accepts interstitial ads. + #[serde(rename="interstitialPlacementAccepted")] + pub interstitial_placement_accepted: Option, + /// Whether this directory site has disabled Nielsen OCR reach ratings. + #[serde(rename="nielsenOcrOptOut")] + pub nielsen_ocr_opt_out: Option, + /// Whether this directory site has disabled active view creatives. + #[serde(rename="activeViewOptOut")] + pub active_view_opt_out: Option, + /// Whether this site accepts in-stream video ads. + #[serde(rename="instreamVideoPlacementAccepted")] + pub instream_video_placement_accepted: Option, + /// Whether this directory site has disabled active view for in-stream video creatives. This is a read-only field. + #[serde(rename="videoActiveViewOptOut")] + pub video_active_view_opt_out: Option, + /// Whether this directory site has disabled generation of Verification ins tags. + #[serde(rename="verificationTagOptOut")] + pub verification_tag_opt_out: Option, + /// Directory site DFP settings. + #[serde(rename="dfpSettings")] + pub dfp_settings: Option, +} + +impl Part for DirectorySiteSettings {} + + +/// User Role Permission Group List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list user role permission groups](struct.UserRolePermissionGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserRolePermissionGroupsListResponse { + /// User role permission group collection. + #[serde(rename="userRolePermissionGroups")] + pub user_role_permission_groups: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionGroupsListResponse". + pub kind: Option, +} + +impl ResponseResult for UserRolePermissionGroupsListResponse {} + + +/// Represents the list of File resources. +/// +/// # 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 files](struct.FileListCall.html) (response) +/// * [files list reports](struct.ReportFileListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileList { + /// Continuation token used to page through files. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The files returned in this response. + pub items: Option>, + /// The kind of list this is, in this case dfareporting#fileList. + pub kind: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, +} + +impl ResponseResult for FileList {} + + +/// Represents a Custom Rich Media Events group. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomRichMediaEvents { + /// The kind of resource this is, in this case dfareporting#customRichMediaEvents. + pub kind: Option, + /// List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName. + #[serde(rename="filteredEventIds")] + pub filtered_event_ids: Option>, +} + +impl Part for CustomRichMediaEvents {} + + +/// Event tag override information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventTagOverride { + /// Whether this override is enabled. + pub enabled: Option, + /// ID of this event tag override. This is a read-only, auto-generated field. + pub id: Option, +} + +impl Part for EventTagOverride {} + + +/// Video Offset +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VideoOffset { + /// Duration, as a percentage of video duration. Do not set when offsetSeconds is set. Acceptable values are 0 to 100, inclusive. + #[serde(rename="offsetPercentage")] + pub offset_percentage: Option, + /// Duration, in seconds. Do not set when offsetPercentage is set. Acceptable values are 0 to 86399, inclusive. + #[serde(rename="offsetSeconds")] + pub offset_seconds: Option, +} + +impl Part for VideoOffset {} + + +/// Update Conversions Request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batchupdate conversions](struct.ConversionBatchupdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConversionsBatchUpdateRequest { + /// The set of conversions to update. + pub conversions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchUpdateRequest". + pub kind: Option, + /// Describes how encryptedUserId is encrypted. This is a required field if encryptedUserId is used. + #[serde(rename="encryptionInfo")] + pub encryption_info: Option, +} + +impl RequestValue for ConversionsBatchUpdateRequest {} + + +/// Change Log List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list change logs](struct.ChangeLogListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChangeLogsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#changeLogsListResponse". + pub kind: Option, + /// Change log collection. + #[serde(rename="changeLogs")] + pub change_logs: Option>, +} + +impl ResponseResult for ChangeLogsListResponse {} + + +/// Gets a summary of active ads in an account. +/// +/// # 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 account active ad summaries](struct.AccountActiveAdSummaryGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountActiveAdSummary { + /// Ads that can be activated for the account. + #[serde(rename="availableAds")] + pub available_ads: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountActiveAdSummary". + pub kind: Option, + /// ID of the account. + #[serde(rename="accountId")] + pub account_id: Option, + /// Ads that have been activated for the account + #[serde(rename="activeAds")] + pub active_ads: Option, + /// Maximum number of active ads allowed for the account. + #[serde(rename="activeAdsLimitTier")] + pub active_ads_limit_tier: Option, +} + +impl ResponseResult for AccountActiveAdSummary {} + + +/// Lookback configuration settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LookbackConfiguration { + /// Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, inclusive. + #[serde(rename="clickDuration")] + pub click_duration: Option, + /// Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, inclusive. + #[serde(rename="postImpressionActivitiesDuration")] + pub post_impression_activities_duration: Option, +} + +impl Part for LookbackConfiguration {} + + +/// Floodlight Activity GenerateTag Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [generatetag floodlight activities](struct.FloodlightActivityGeneratetagCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivitiesGenerateTagResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesGenerateTagResponse". + pub kind: Option, + /// Generated tag for this floodlight activity. + #[serde(rename="floodlightActivityTag")] + pub floodlight_activity_tag: Option, +} + +impl ResponseResult for FloodlightActivitiesGenerateTagResponse {} + + +/// Remarketing List Population Rule Term. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListPopulationTerm { + /// ID of the list in question. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. + #[serde(rename="remarketingListId")] + pub remarketing_list_id: Option, + /// Will be true if the term should check if the user is in the list and false if the term should check if the user is not in the list. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. False by default. + pub contains: Option, + /// Whether to negate the comparison result of this term during rule evaluation. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + pub negation: Option, + /// Literal to compare the variable to. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + pub value: Option, + /// Friendly name of this term's variable. This is a read-only, auto-generated field. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM. + #[serde(rename="variableFriendlyName")] + pub variable_friendly_name: Option, + /// Comparison operator of this term. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + pub operator: Option, + /// List population term type determines the applicable fields in this object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, variableFriendlyName, operator, value, and negation are applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. If set to REFERRER_TERM then operator, value, and negation are applicable. + #[serde(rename="type")] + pub type_: Option, + /// Name of the variable (U1, U2, etc.) being compared in this term. This field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or REFERRER_TERM. + #[serde(rename="variableName")] + pub variable_name: Option, +} + +impl Part for ListPopulationTerm {} + + +/// Site Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SiteSettings { + /// Whether active view creatives are disabled for this site. + #[serde(rename="activeViewOptOut")] + pub active_view_opt_out: Option, + /// Whether Verification and ActiveView for in-stream video creatives are disabled by default for new placements created under this site. This value will be used to populate the placement.videoActiveViewOptOut field, when no value is specified for the new placement. + #[serde(rename="videoActiveViewOptOutTemplate")] + pub video_active_view_opt_out_template: Option, + /// Lookback window settings for this site. + #[serde(rename="lookbackConfiguration")] + pub lookback_configuration: Option, + /// Whether new cookies are disabled for this site. + #[serde(rename="disableNewCookie")] + pub disable_new_cookie: Option, + /// Configuration settings for dynamic and image floodlight tags. + #[serde(rename="tagSetting")] + pub tag_setting: Option, + /// Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter). + /// + /// Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. + #[serde(rename="vpaidAdapterChoiceTemplate")] + pub vpaid_adapter_choice_template: Option, + /// Whether this site opts out of ad blocking. When true, ad blocking is disabled for all placements under the site, regardless of the individual placement settings. When false, the campaign and placement settings take effect. + #[serde(rename="adBlockingOptOut")] + pub ad_blocking_opt_out: Option, + /// Site-wide creative settings. + #[serde(rename="creativeSettings")] + pub creative_settings: Option, +} + +impl Part for SiteSettings {} + + +/// AccountUserProfiles contains properties of a DCM user profile. This resource is specifically for managing user profiles, whereas UserProfiles is for accessing the API. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch account user profiles](struct.AccountUserProfilePatchCall.html) (request|response) +/// * [list account user profiles](struct.AccountUserProfileListCall.html) (none) +/// * [insert account user profiles](struct.AccountUserProfileInsertCall.html) (request|response) +/// * [get account user profiles](struct.AccountUserProfileGetCall.html) (response) +/// * [update account user profiles](struct.AccountUserProfileUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountUserProfile { + /// Locale of the user profile. This is a required field. + /// Acceptable values are: + /// - "cs" (Czech) + /// - "de" (German) + /// - "en" (English) + /// - "en-GB" (English United Kingdom) + /// - "es" (Spanish) + /// - "fr" (French) + /// - "it" (Italian) + /// - "ja" (Japanese) + /// - "ko" (Korean) + /// - "pl" (Polish) + /// - "pt-BR" (Portuguese Brazil) + /// - "ru" (Russian) + /// - "sv" (Swedish) + /// - "tr" (Turkish) + /// - "zh-CN" (Chinese Simplified) + /// - "zh-TW" (Chinese Traditional) + pub locale: Option, + /// Filter that describes which sites are visible to the user profile. + #[serde(rename="siteFilter")] + pub site_filter: Option, + /// Filter that describes which campaigns are visible to the user profile. + #[serde(rename="campaignFilter")] + pub campaign_filter: Option, + /// User role ID of the user profile. This is a required field. + #[serde(rename="userRoleId")] + pub user_role_id: Option, + /// User type of the user profile. This is a read-only field that can be left blank. + #[serde(rename="userAccessType")] + pub user_access_type: Option, + /// Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable. + pub active: Option, + /// ID of the user profile. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of the user profile. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountUserProfile". + pub kind: Option, + /// Subaccount ID of the user profile. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Filter that describes which user roles are visible to the user profile. + #[serde(rename="userRoleFilter")] + pub user_role_filter: Option, + /// Trafficker type of this user profile. + #[serde(rename="traffickerType")] + pub trafficker_type: Option, + /// Comments for this user profile. + pub comments: Option, + /// Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any of the following characters: "&;"#%,". + pub name: Option, + /// Filter that describes which advertisers are visible to the user profile. + #[serde(rename="advertiserFilter")] + pub advertiser_filter: Option, + /// Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion. + pub email: Option, +} + +impl RequestValue for AccountUserProfile {} +impl Resource for AccountUserProfile {} +impl ResponseResult for AccountUserProfile {} + + +/// Dynamic and Image Tag Settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TagSettings { + /// Whether dynamic floodlight tags are enabled. + #[serde(rename="dynamicTagEnabled")] + pub dynamic_tag_enabled: Option, + /// Whether image tags are enabled. + #[serde(rename="imageTagEnabled")] + pub image_tag_enabled: Option, +} + +impl Part for TagSettings {} + + +/// Contains properties of a targetable remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource is a read-only view of a remarketing list to be used to faciliate targeting ads to specific lists. Remarketing lists that are owned by your advertisers and those that are shared to your advertisers or account are accessible via this resource. To manage remarketing lists that are owned by your advertisers, use the RemarketingLists resource. +/// +/// # 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 targetable remarketing lists](struct.TargetableRemarketingListListCall.html) (none) +/// * [get targetable remarketing lists](struct.TargetableRemarketingListGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetableRemarketingList { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetableRemarketingList". + pub kind: Option, + /// Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Targetable remarketing list description. + pub description: Option, + /// Number of users currently in the list. This is a read-only field. + #[serde(rename="listSize")] + pub list_size: Option, + /// Number of days that a user should remain in the targetable remarketing list without an impression. + #[serde(rename="lifeSpan")] + pub life_span: Option, + /// Dimension value for the advertiser ID that owns this targetable remarketing list. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Product from which this targetable remarketing list was originated. + #[serde(rename="listSource")] + pub list_source: Option, + /// Whether this targetable remarketing list is active. + pub active: Option, + /// Dimension value for the ID of the advertiser. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. + #[serde(rename="accountId")] + pub account_id: Option, + /// Targetable remarketing list ID. + pub id: Option, + /// Name of the targetable remarketing list. Is no greater than 128 characters long. + pub name: Option, +} + +impl Resource for TargetableRemarketingList {} +impl ResponseResult for TargetableRemarketingList {} + + +/// Contains information about a particular version of an operating system that can be targeted by ads. +/// +/// # 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 operating system versions](struct.OperatingSystemVersionGetCall.html) (response) +/// * [list operating system versions](struct.OperatingSystemVersionListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperatingSystemVersion { + /// Major version (leftmost number) of this operating system version. + #[serde(rename="majorVersion")] + pub major_version: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersion". + pub kind: Option, + /// Minor version (number after the first dot) of this operating system version. + #[serde(rename="minorVersion")] + pub minor_version: Option, + /// Name of this operating system version. + pub name: Option, + /// Operating system of this operating system version. + #[serde(rename="operatingSystem")] + pub operating_system: Option, + /// ID of this operating system version. + pub id: Option, +} + +impl Resource for OperatingSystemVersion {} +impl ResponseResult for OperatingSystemVersion {} + + +/// Remarketing list response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list remarketing lists](struct.RemarketingListListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemarketingListsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Remarketing list collection. + #[serde(rename="remarketingLists")] + pub remarketing_lists: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingListsListResponse". + pub kind: Option, +} + +impl ResponseResult for RemarketingListsListResponse {} + + +/// Campaign ad blocking settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdBlockingConfiguration { + /// ID of a creative bundle to use for this campaign. If set, brand-neutral ads will select creatives from this bundle. Otherwise, a default transparent pixel will be used. + #[serde(rename="creativeBundleId")] + pub creative_bundle_id: Option, + /// Click-through URL used by brand-neutral ads. This is a required field when overrideClickThroughUrl is set to true. + #[serde(rename="clickThroughUrl")] + pub click_through_url: Option, + /// Whether this campaign has enabled ad blocking. When true, ad blocking is enabled for placements in the campaign, but this may be overridden by site and placement settings. When false, ad blocking is disabled for all placements under the campaign, regardless of site and placement settings. + pub enabled: Option, + /// Whether the brand-neutral ad's click-through URL comes from the campaign's creative bundle or the override URL. Must be set to true if ad blocking is enabled and no creative bundle is configured. + #[serde(rename="overrideClickThroughUrl")] + pub override_click_through_url: Option, +} + +impl Part for AdBlockingConfiguration {} + + +/// Creative Field Assignment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeFieldAssignment { + /// ID of the creative field. + #[serde(rename="creativeFieldId")] + pub creative_field_id: Option, + /// ID of the creative field value. + #[serde(rename="creativeFieldValueId")] + pub creative_field_value_id: Option, +} + +impl Part for CreativeFieldAssignment {} + + +/// Remarketing List Population Rule. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListPopulationRule { + /// Floodlight activity ID associated with this rule. This field can be left blank. + #[serde(rename="floodlightActivityId")] + pub floodlight_activity_id: Option, + /// Name of floodlight activity associated with this rule. This is a read-only, auto-generated field. + #[serde(rename="floodlightActivityName")] + pub floodlight_activity_name: Option, + /// Clauses that make up this list population rule. Clauses are joined by ANDs, and the clauses themselves are made up of list population terms which are joined by ORs. + #[serde(rename="listPopulationClauses")] + pub list_population_clauses: Option>, +} + +impl Part for ListPopulationRule {} + + +/// Contains properties of a DCM account. +/// +/// # 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 accounts](struct.AccountUpdateCall.html) (request|response) +/// * [list accounts](struct.AccountListCall.html) (none) +/// * [get accounts](struct.AccountGetCall.html) (response) +/// * [patch accounts](struct.AccountPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Account { + /// File size limit in kilobytes of Rich Media teaser creatives. Acceptable values are 1 to 10240, inclusive. + #[serde(rename="teaserSizeLimit")] + pub teaser_size_limit: Option, + /// User role permissions available to the user roles of this account. + #[serde(rename="availablePermissionIds")] + pub available_permission_ids: Option>, + /// Description of this account. + pub description: Option, + /// Locale of this account. + /// Acceptable values are: + /// - "cs" (Czech) + /// - "de" (German) + /// - "en" (English) + /// - "en-GB" (English United Kingdom) + /// - "es" (Spanish) + /// - "fr" (French) + /// - "it" (Italian) + /// - "ja" (Japanese) + /// - "ko" (Korean) + /// - "pl" (Polish) + /// - "pt-BR" (Portuguese Brazil) + /// - "ru" (Russian) + /// - "sv" (Swedish) + /// - "tr" (Turkish) + /// - "zh-CN" (Chinese Simplified) + /// - "zh-TW" (Chinese Traditional) + pub locale: Option, + /// Profile for this account. This is a read-only field that can be left blank. + #[serde(rename="accountProfile")] + pub account_profile: Option, + /// Whether this account is active. + pub active: Option, + /// Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions. + #[serde(rename="activeViewOptOut")] + pub active_view_opt_out: Option, + /// Share Path to Conversion reports with Twitter. + #[serde(rename="shareReportsWithTwitter")] + pub share_reports_with_twitter: Option, + /// ID of this account. This is a read-only, auto-generated field. + pub id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#account". + pub kind: Option, + /// ID of the country associated with this account. + #[serde(rename="countryId")] + pub country_id: Option, + /// Name of this account. This is a required field, and must be less than 128 characters long and be globally unique. + pub name: Option, + /// Maximum image size allowed for this account, in kilobytes. Value must be greater than or equal to 1. + #[serde(rename="maximumImageSize")] + pub maximum_image_size: Option, + /// Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default. + #[serde(rename="nielsenOcrEnabled")] + pub nielsen_ocr_enabled: Option, + /// Default placement dimensions for this account. + #[serde(rename="defaultCreativeSizeId")] + pub default_creative_size_id: Option, + /// Account permissions assigned to this account. + #[serde(rename="accountPermissionIds")] + pub account_permission_ids: Option>, + /// ID of currency associated with this account. This is a required field. + /// Acceptable values are: + /// - "1" for USD + /// - "2" for GBP + /// - "3" for ESP + /// - "4" for SEK + /// - "5" for CAD + /// - "6" for JPY + /// - "7" for DEM + /// - "8" for AUD + /// - "9" for FRF + /// - "10" for ITL + /// - "11" for DKK + /// - "12" for NOK + /// - "13" for FIM + /// - "14" for ZAR + /// - "15" for IEP + /// - "16" for NLG + /// - "17" for EUR + /// - "18" for KRW + /// - "19" for TWD + /// - "20" for SGD + /// - "21" for CNY + /// - "22" for HKD + /// - "23" for NZD + /// - "24" for MYR + /// - "25" for BRL + /// - "26" for PTE + /// - "27" for MXP + /// - "28" for CLP + /// - "29" for TRY + /// - "30" for ARS + /// - "31" for PEN + /// - "32" for ILS + /// - "33" for CHF + /// - "34" for VEF + /// - "35" for COP + /// - "36" for GTQ + /// - "37" for PLN + /// - "39" for INR + /// - "40" for THB + /// - "41" for IDR + /// - "42" for CZK + /// - "43" for RON + /// - "44" for HUF + /// - "45" for RUB + /// - "46" for AED + /// - "47" for BGN + /// - "48" for HRK + /// - "49" for MXN + #[serde(rename="currencyId")] + pub currency_id: Option, + /// Reporting configuration of this account. + #[serde(rename="reportsConfiguration")] + pub reports_configuration: Option, + /// Maximum number of active ads allowed for this account. + #[serde(rename="activeAdsLimitTier")] + pub active_ads_limit_tier: Option, +} + +impl RequestValue for Account {} +impl Resource for Account {} +impl ResponseResult for Account {} + + +/// Day Part Targeting. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DayPartTargeting { + /// Days of the week when the ad will serve. + /// + /// Acceptable values are: + /// - "SUNDAY" + /// - "MONDAY" + /// - "TUESDAY" + /// - "WEDNESDAY" + /// - "THURSDAY" + /// - "FRIDAY" + /// - "SATURDAY" + #[serde(rename="daysOfWeek")] + pub days_of_week: Option>, + /// Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with days of week, in which case the ad would serve during these hours on the specified days. For example if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive. + #[serde(rename="hoursOfDay")] + pub hours_of_day: Option>, + /// Whether or not to use the user's local time. If false, the America/New York time zone applies. + #[serde(rename="userLocalTime")] + pub user_local_time: Option, +} + +impl Part for DayPartTargeting {} + + +/// Represents a response to the queryCompatibleFields 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*). +/// +/// * [compatible fields query reports](struct.ReportCompatibleFieldQueryCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CompatibleFields { + /// The kind of resource this is, in this case dfareporting#compatibleFields. + pub kind: Option, + /// Contains items that are compatible to be selected for a report of type "CROSS_DIMENSION_REACH". + #[serde(rename="crossDimensionReachReportCompatibleFields")] + pub cross_dimension_reach_report_compatible_fields: Option, + /// Contains items that are compatible to be selected for a report of type "REACH". + #[serde(rename="reachReportCompatibleFields")] + pub reach_report_compatible_fields: Option, + /// Contains items that are compatible to be selected for a report of type "PATH_TO_CONVERSION". + #[serde(rename="pathToConversionReportCompatibleFields")] + pub path_to_conversion_report_compatible_fields: Option, + /// Contains items that are compatible to be selected for a report of type "FLOODLIGHT". + #[serde(rename="floodlightReportCompatibleFields")] + pub floodlight_report_compatible_fields: Option, + /// Contains items that are compatible to be selected for a report of type "STANDARD". + #[serde(rename="reportCompatibleFields")] + pub report_compatible_fields: Option, +} + +impl ResponseResult for CompatibleFields {} + + +/// Contains information about a region that can be targeted by ads. +/// +/// # 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 regions](struct.RegionListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Region { + /// Region code. + #[serde(rename="regionCode")] + pub region_code: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#region". + pub kind: Option, + /// DART ID of the country to which this region belongs. + #[serde(rename="countryDartId")] + pub country_dart_id: Option, + /// Name of this region. + pub name: Option, + /// Country code of the country to which this region belongs. + #[serde(rename="countryCode")] + pub country_code: Option, + /// DART ID of this region. + #[serde(rename="dartId")] + pub dart_id: Option, +} + +impl Resource for Region {} + + +/// The report criteria for a report of type "STANDARD". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportCriteria { + /// Activity group. + pub activities: Option, + /// The list of standard dimensions the report should include. + pub dimensions: Option>, + /// The list of names of metrics the report should include. + #[serde(rename="metricNames")] + pub metric_names: Option>, + /// The date range for which this report should be run. + #[serde(rename="dateRange")] + pub date_range: Option, + /// Custom Rich Media Events group. + #[serde(rename="customRichMediaEvents")] + pub custom_rich_media_events: Option, + /// The list of filters on which dimensions are filtered. + /// Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, +} + +impl NestedType for ReportCriteria {} +impl Part for ReportCriteria {} + + +/// Order List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list orders](struct.OrderListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#ordersListResponse". + pub kind: Option, + /// Order collection. + pub orders: Option>, +} + +impl ResponseResult for OrdersListResponse {} + + +/// Represents fields that are compatible to be selected for a report of type "CROSS_DIMENSION_REACH". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CrossDimensionReachReportCompatibleFields { + /// Dimensions which are compatible to be selected in the "breakdown" section of the report. + pub breakdown: Option>, + /// Metrics which are compatible to be selected in the "metricNames" section of the report. + pub metrics: Option>, + /// The kind of resource this is, in this case dfareporting#crossDimensionReachReportCompatibleFields. + pub kind: Option, + /// Metrics which are compatible to be selected in the "overlapMetricNames" section of the report. + #[serde(rename="overlapMetrics")] + pub overlap_metrics: Option>, + /// Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, +} + +impl Part for CrossDimensionReachReportCompatibleFields {} + + +/// The error code and description for a conversion that failed to insert or update. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConversionError { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionError". + pub kind: Option, + /// The error code. + pub code: Option, + /// A description of the error. + pub message: Option, +} + +impl Part for ConversionError {} + + +/// Event Tag List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list event tags](struct.EventTagListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventTagsListResponse { + /// Event tag collection. + #[serde(rename="eventTags")] + pub event_tags: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTagsListResponse". + pub kind: Option, +} + +impl ResponseResult for EventTagsListResponse {} + + +/// Contains properties of a Floodlight activity group. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list floodlight activity groups](struct.FloodlightActivityGroupListCall.html) (none) +/// * [get floodlight activity groups](struct.FloodlightActivityGroupGetCall.html) (response) +/// * [insert floodlight activity groups](struct.FloodlightActivityGroupInsertCall.html) (request|response) +/// * [patch floodlight activity groups](struct.FloodlightActivityGroupPatchCall.html) (request|response) +/// * [update floodlight activity groups](struct.FloodlightActivityGroupUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivityGroup { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivityGroup". + pub kind: Option, + /// Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes. + pub name: Option, + /// Floodlight configuration ID of this floodlight activity group. This is a required field. + #[serde(rename="floodlightConfigurationId")] + pub floodlight_configuration_id: Option, + /// Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's advertiser or from the existing activity group's advertiser. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. + #[serde(rename="floodlightConfigurationIdDimensionValue")] + pub floodlight_configuration_id_dimension_value: Option, + /// Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after insertion. + #[serde(rename="tagString")] + pub tag_string: Option, + /// Type of the floodlight activity group. This is a required field that is read-only after insertion. + #[serde(rename="type")] + pub type_: Option, + /// ID of this floodlight activity group. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this floodlight activity group. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for FloodlightActivityGroup {} +impl Resource for FloodlightActivityGroup {} +impl ResponseResult for FloodlightActivityGroup {} + + +/// Audience Segment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AudienceSegment { + /// Weight allocated to this segment. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group. Acceptable values are 1 to 1000, inclusive. + pub allocation: Option, + /// ID of this audience segment. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this audience segment. This is a required field and must be less than 65 characters long. + pub name: Option, +} + +impl Part for AudienceSegment {} + + +/// Contains properties of a DCM campaign. +/// +/// # 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 campaigns](struct.CampaignInsertCall.html) (request|response) +/// * [update campaigns](struct.CampaignUpdateCall.html) (request|response) +/// * [patch campaigns](struct.CampaignPatchCall.html) (request|response) +/// * [get campaigns](struct.CampaignGetCall.html) (response) +/// * [list campaigns](struct.CampaignListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Campaign { + /// Arbitrary comments about this campaign. Must be less than 256 characters long. + pub comment: Option, + /// Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This is a required field. + #[serde(rename="startDate")] + pub start_date: Option, + /// Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field. + #[serde(rename="endDate")] + pub end_date: Option, + /// Click-through URL suffix override properties for this campaign. + #[serde(rename="clickThroughUrlSuffixProperties")] + pub click_through_url_suffix_properties: Option, + /// Whether this campaign has been archived. + pub archived: Option, + /// Additional creative optimization configurations for the campaign. + #[serde(rename="additionalCreativeOptimizationConfigurations")] + pub additional_creative_optimization_configurations: Option>, + /// Advertiser ID of this campaign. This is a required field. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups. + #[serde(rename="audienceSegmentGroups")] + pub audience_segment_groups: Option>, + /// Information about the creation of this campaign. This is a read-only field. + #[serde(rename="createInfo")] + pub create_info: Option, + /// Click-through event tag ID override properties for this campaign. + #[serde(rename="defaultClickThroughEventTagProperties")] + pub default_click_through_event_tag_properties: Option, + /// Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Overrides that can be used to activate or deactivate advertiser event tags. + #[serde(rename="eventTagOverrides")] + pub event_tag_overrides: Option>, + /// Creative optimization configuration for the campaign. + #[serde(rename="creativeOptimizationConfiguration")] + pub creative_optimization_configuration: Option, + /// ID of this campaign. This is a read-only auto-generated field. + pub id: Option, + /// Account ID of this campaign. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Campaign trafficker contact emails. + #[serde(rename="traffickerEmails")] + pub trafficker_emails: Option>, + /// List of creative group IDs that are assigned to the campaign. + #[serde(rename="creativeGroupIds")] + pub creative_group_ids: Option>, + /// Ad blocking settings for this campaign. + #[serde(rename="adBlockingConfiguration")] + pub ad_blocking_configuration: Option, + /// Subaccount ID of this campaign. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser. + pub name: Option, + /// Lookback window settings for the campaign. + #[serde(rename="lookbackConfiguration")] + pub lookback_configuration: Option, + /// Whether Nielsen reports are enabled for this campaign. + #[serde(rename="nielsenOcrEnabled")] + pub nielsen_ocr_enabled: Option, + /// Information about the most recent modification of this campaign. This is a read-only field. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaign". + pub kind: Option, + /// External ID for this campaign. + #[serde(rename="externalId")] + pub external_id: Option, + /// Advertiser group ID of the associated advertiser. + #[serde(rename="advertiserGroupId")] + pub advertiser_group_id: Option, + /// Dimension value for the ID of this campaign. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Billing invoice code included in the DCM client billing invoices associated with the campaign. + #[serde(rename="billingInvoiceCode")] + pub billing_invoice_code: Option, +} + +impl RequestValue for Campaign {} +impl Resource for Campaign {} +impl ResponseResult for Campaign {} + + +/// Describes a change that a user has made to a resource. +/// +/// # 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 change logs](struct.ChangeLogListCall.html) (none) +/// * [get change logs](struct.ChangeLogGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChangeLog { + /// Time when the object was modified. + #[serde(rename="changeTime")] + pub change_time: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#changeLog". + pub kind: Option, + /// Subaccount ID of the modified object. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Old value of the object field. + #[serde(rename="oldValue")] + pub old_value: Option, + /// ID of the object of this change log. The object could be a campaign, placement, ad, or other type. + #[serde(rename="objectId")] + pub object_id: Option, + /// ID of this change log. + pub id: Option, + /// User profile name of the user who modified the object. + #[serde(rename="userProfileName")] + pub user_profile_name: Option, + /// Field name of the object which changed. + #[serde(rename="fieldName")] + pub field_name: Option, + /// ID of the user who modified the object. + #[serde(rename="userProfileId")] + pub user_profile_id: Option, + /// Action which caused the change. + pub action: Option, + /// Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share the same transactionId. + #[serde(rename="transactionId")] + pub transaction_id: Option, + /// Account ID of the modified object. + #[serde(rename="accountId")] + pub account_id: Option, + /// New value of the object field. + #[serde(rename="newValue")] + pub new_value: Option, + /// Object type of the change log. + #[serde(rename="objectType")] + pub object_type: Option, +} + +impl Resource for ChangeLog {} +impl ResponseResult for ChangeLog {} + + +/// Tag Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TagSetting { + /// Whether static landing page URLs should be included in the tags. This setting applies only to placements. + #[serde(rename="includeClickThroughUrls")] + pub include_click_through_urls: Option, + /// Whether click-tracking string should be included in the tags. + #[serde(rename="includeClickTracking")] + pub include_click_tracking: Option, + /// Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys and values must not contain commas. For example, id=2;color=red is a valid value for this field. + #[serde(rename="additionalKeyValues")] + pub additional_key_values: Option, + /// Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags for this site. Publishers can then add keywords to those placeholders. + #[serde(rename="keywordOption")] + pub keyword_option: Option, +} + +impl Part for TagSetting {} + + +/// Represents a File resource. A file contains the metadata for a report run. It shows the status of the run and holds the URLs to the generated report data if the run is finished and the status is "REPORT_AVAILABLE". +/// +/// # 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 files](struct.FileGetCall.html) (response) +/// * [list files](struct.FileListCall.html) (none) +/// * [files get reports](struct.ReportFileGetCall.html) (response) +/// * [run reports](struct.ReportRunCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct File { + /// The status of the report file. + pub status: Option, + /// The kind of resource this is, in this case dfareporting#file. + pub kind: Option, + /// The output format of the report. Only available once the file is available. + pub format: Option, + /// The date range for which the file has report data. The date range will always be the absolute date range for which the report is run. + #[serde(rename="dateRange")] + pub date_range: Option, + /// The filename of the file. + #[serde(rename="fileName")] + pub file_name: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, + /// The ID of the report this file was generated from. + #[serde(rename="reportId")] + pub report_id: Option, + /// The URLs where the completed report file can be downloaded. + pub urls: Option, + /// The timestamp in milliseconds since epoch when this file was last modified. + #[serde(rename="lastModifiedTime")] + pub last_modified_time: Option, + /// The unique ID of this report file. + pub id: Option, +} + +impl Resource for File {} +impl ResponseResult for File {} + + +/// Key Value Targeting Expression. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyValueTargetingExpression { + /// Keyword expression being targeted by the ad. + pub expression: Option, +} + +impl Part for KeyValueTargetingExpression {} + + +/// Transcode Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TranscodeSetting { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#transcodeSetting". + pub kind: Option, + /// Whitelist of video formats to be served to this placement. Set this list to null or empty to serve all video formats. + #[serde(rename="enabledVideoFormats")] + pub enabled_video_formats: Option>, +} + +impl Part for TranscodeSetting {} + + +/// The report criteria for a report of type "CROSS_DIMENSION_REACH". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportCrossDimensionReachCriteria { + /// The list of dimensions the report should include. + pub breakdown: Option>, + /// Whether the report is pivoted or not. Defaults to true. + pub pivoted: Option, + /// The list of names of overlap metrics the report should include. + #[serde(rename="overlapMetricNames")] + pub overlap_metric_names: Option>, + /// The list of names of metrics the report should include. + #[serde(rename="metricNames")] + pub metric_names: Option>, + /// The date range this report should be run for. + #[serde(rename="dateRange")] + pub date_range: Option, + /// The list of filters on which dimensions are filtered. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, + /// The dimension option. + pub dimension: Option, +} + +impl NestedType for ReportCrossDimensionReachCriteria {} +impl Part for ReportCrossDimensionReachCriteria {} + + +/// Contains properties of a placement. +/// +/// # 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*). +/// +/// * [generatetags placements](struct.PlacementGeneratetagCall.html) (none) +/// * [insert placements](struct.PlacementInsertCall.html) (request|response) +/// * [update placements](struct.PlacementUpdateCall.html) (request|response) +/// * [list placements](struct.PlacementListCall.html) (none) +/// * [get placements](struct.PlacementGetCall.html) (response) +/// * [patch placements](struct.PlacementPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Placement { + /// Comments for this placement. + pub comment: Option, + /// Whether Verification and ActiveView are disabled for in-stream video creatives for this placement. The same setting videoActiveViewOptOut exists on the site level -- the opt out occurs if either of these settings are true. These settings are distinct from DirectorySites.settings.activeViewOptOut or Sites.siteSettings.activeViewOptOut which only apply to display ads. However, Accounts.activeViewOptOut opts out both video traffic, as well as display ads, from Verification and ActiveView. + #[serde(rename="videoActiveViewOptOut")] + pub video_active_view_opt_out: Option, + /// Campaign ID of this placement. This field is a required field on insertion. + #[serde(rename="campaignId")] + pub campaign_id: Option, + /// Payment source for this placement. This is a required field that is read-only after insertion. + #[serde(rename="paymentSource")] + pub payment_source: Option, + /// Dimension value for the ID of the directory site. This is a read-only, auto-generated field. + #[serde(rename="directorySiteIdDimensionValue")] + pub directory_site_id_dimension_value: Option, + /// Advertiser ID of this placement. This field can be left blank. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Key name of this placement. This is a read-only, auto-generated field. + #[serde(rename="keyName")] + pub key_name: Option, + /// Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. This is a required field that is read-only after insertion. + #[serde(rename="directorySiteId")] + pub directory_site_id: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// ID of the content category assigned to this placement. + #[serde(rename="contentCategoryId")] + pub content_category_id: Option, + /// Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion. + pub size: Option, + /// Whether this placement is archived. + pub archived: Option, + /// A collection of settings which affect video creatives served through this placement. Applicable to placements with IN_STREAM_VIDEO compatibility. + #[serde(rename="videoSettings")] + pub video_settings: Option, + /// Information about the last publisher update. This is a read-only field. + #[serde(rename="publisherUpdateInfo")] + pub publisher_update_info: Option, + /// Tag formats to generate for this placement. This field is required on insertion. + /// Acceptable values are: + /// - "PLACEMENT_TAG_STANDARD" + /// - "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + /// - "PLACEMENT_TAG_IFRAME_ILAYER" + /// - "PLACEMENT_TAG_INTERNAL_REDIRECT" + /// - "PLACEMENT_TAG_JAVASCRIPT" + /// - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + /// - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + /// - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + /// - "PLACEMENT_TAG_CLICK_COMMANDS" + /// - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + /// - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + /// - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" + /// - "PLACEMENT_TAG_TRACKING" + /// - "PLACEMENT_TAG_TRACKING_IFRAME" + /// - "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + #[serde(rename="tagFormats")] + pub tag_formats: Option>, + /// Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements. + #[serde(rename="paymentApproved")] + pub payment_approved: Option, + /// Tag settings for this placement. + #[serde(rename="tagSetting")] + pub tag_setting: Option, + /// ID of this placement. This is a read-only, auto-generated field. + pub id: Option, + /// Whether this placement opts out of ad blocking. When true, ad blocking is disabled for this placement. When false, the campaign and site settings take effect. + #[serde(rename="adBlockingOptOut")] + pub ad_blocking_opt_out: Option, + /// External ID for this placement. + #[serde(rename="externalId")] + pub external_id: Option, + /// Dimension value for the ID of this placement. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Account ID of this placement. This field can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Whether creatives assigned to this placement must be SSL-compliant. + #[serde(rename="sslRequired")] + pub ssl_required: Option, + /// Third-party placement status. + pub status: Option, + /// Dimension value for the ID of the campaign. This is a read-only, auto-generated field. + #[serde(rename="campaignIdDimensionValue")] + pub campaign_id_dimension_value: Option, + /// Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the roadblock's primaryPlacementId field to the ID of this placement. + pub primary: Option, + /// ID of this placement's group, if applicable. + #[serde(rename="placementGroupId")] + pub placement_group_id: Option, + /// Information about the creation of this placement. This is a read-only field. + #[serde(rename="createInfo")] + pub create_info: Option, + /// Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement. This is a required field that is read-only after insertion. + #[serde(rename="siteId")] + pub site_id: Option, + /// Dimension value for the ID of the site. This is a read-only, auto-generated field. + #[serde(rename="siteIdDimensionValue")] + pub site_id_dimension_value: Option, + /// Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices or in mobile apps for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are no longer allowed for new placement insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion. + pub compatibility: Option, + /// ID of the placement strategy assigned to this placement. + #[serde(rename="placementStrategyId")] + pub placement_strategy_id: Option, + /// Dimension value for the ID of the placement group. This is a read-only, auto-generated field. + #[serde(rename="placementGroupIdDimensionValue")] + pub placement_group_id_dimension_value: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placement". + pub kind: Option, + /// Subaccount ID of this placement. This field can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this placement.This is a required field and must be less than 256 characters long. + pub name: Option, + /// Lookback window settings for this placement. + #[serde(rename="lookbackConfiguration")] + pub lookback_configuration: Option, + /// Information about the most recent modification of this placement. This is a read-only field. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType. + #[serde(rename="pricingSchedule")] + pub pricing_schedule: Option, + /// VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this placement. + /// + /// Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. + #[serde(rename="vpaidAdapterChoice")] + pub vpaid_adapter_choice: Option, +} + +impl RequestValue for Placement {} +impl Resource for Placement {} +impl ResponseResult for Placement {} + + +/// Inventory item List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list inventory items](struct.InventoryItemListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InventoryItemsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#inventoryItemsListResponse". + pub kind: Option, + /// Inventory item collection + #[serde(rename="inventoryItems")] + pub inventory_items: Option>, +} + +impl ResponseResult for InventoryItemsListResponse {} + + +/// Audience Segment Group. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AudienceSegmentGroup { + /// Audience segments assigned to this group. The number of segments must be between 2 and 100. + #[serde(rename="audienceSegments")] + pub audience_segments: Option>, + /// ID of this audience segment group. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this audience segment group. This is a required field and must be less than 65 characters long. + pub name: Option, +} + +impl Part for AudienceSegmentGroup {} + + +/// Contains properties of a placement strategy. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch placement strategies](struct.PlacementStrategyPatchCall.html) (request|response) +/// * [insert placement strategies](struct.PlacementStrategyInsertCall.html) (request|response) +/// * [get placement strategies](struct.PlacementStrategyGetCall.html) (response) +/// * [update placement strategies](struct.PlacementStrategyUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementStrategy { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementStrategy". + pub kind: Option, + /// Account ID of this placement strategy.This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// ID of this placement strategy. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same account. + pub name: Option, +} + +impl RequestValue for PlacementStrategy {} +impl ResponseResult for PlacementStrategy {} + + +/// Creative optimization activity. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OptimizationActivity { + /// Floodlight activity ID of this optimization activity. This is a required field. + #[serde(rename="floodlightActivityId")] + pub floodlight_activity_id: Option, + /// Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field. + #[serde(rename="floodlightActivityIdDimensionValue")] + pub floodlight_activity_id_dimension_value: Option, + /// Weight associated with this optimization. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities. Value must be greater than or equal to 1. + pub weight: Option, +} + +impl Part for OptimizationActivity {} + + +/// Placement Tag +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementTag { + /// Tags generated for this placement. + #[serde(rename="tagDatas")] + pub tag_datas: Option>, + /// Placement ID + #[serde(rename="placementId")] + pub placement_id: Option, +} + +impl Part for PlacementTag {} + + +/// Country List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list countries](struct.CountryListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CountriesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#countriesListResponse". + pub kind: Option, + /// Country collection. + pub countries: Option>, +} + +impl ResponseResult for CountriesListResponse {} + + +/// Click-through 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 ClickThroughUrl { + /// Read-only convenience field representing the actual URL that will be used for this click-through. The URL is computed as follows: + /// - If defaultLandingPage is enabled then the campaign's default landing page URL is assigned to this field. + /// - If defaultLandingPage is not enabled and a landingPageId is specified then that landing page's URL is assigned to this field. + /// - If neither of the above cases apply, then the customClickThroughUrl is assigned to this field. + #[serde(rename="computedClickThroughUrl")] + pub computed_click_through_url: Option, + /// Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset. + #[serde(rename="customClickThroughUrl")] + pub custom_click_through_url: Option, + /// ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false. + #[serde(rename="landingPageId")] + pub landing_page_id: Option, + /// Whether the campaign default landing page is used. + #[serde(rename="defaultLandingPage")] + pub default_landing_page: Option, +} + +impl Part for ClickThroughUrl {} + + +/// Companion Click-through override. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CompanionClickThroughOverride { + /// Click-through URL of this companion click-through override. + #[serde(rename="clickThroughUrl")] + pub click_through_url: Option, + /// ID of the creative for this companion click-through override. + #[serde(rename="creativeId")] + pub creative_id: Option, +} + +impl Part for CompanionClickThroughOverride {} + + +/// Frequency Cap. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FrequencyCap { + /// Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days. Acceptable values are 1 to 7776000, inclusive. + pub duration: Option, + /// Number of times an individual user can be served the ad within the specified duration. Acceptable values are 1 to 15, inclusive. + pub impressions: Option, +} + +impl Part for FrequencyCap {} + + +/// Identifies a creative which has been associated with a given campaign. +/// +/// # 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 campaign creative associations](struct.CampaignCreativeAssociationListCall.html) (none) +/// * [insert campaign creative associations](struct.CampaignCreativeAssociationInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CampaignCreativeAssociation { + /// ID of the creative associated with the campaign. This is a required field. + #[serde(rename="creativeId")] + pub creative_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignCreativeAssociation". + pub kind: Option, +} + +impl RequestValue for CampaignCreativeAssociation {} +impl Resource for CampaignCreativeAssociation {} +impl ResponseResult for CampaignCreativeAssociation {} + + +/// Contains properties of a remarketing list's sharing information. Sharing allows other accounts or advertisers to target to your remarketing lists. This resource can be used to manage remarketing list sharing to other accounts and advertisers. +/// +/// # 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 remarketing list shares](struct.RemarketingListShareGetCall.html) (response) +/// * [patch remarketing list shares](struct.RemarketingListSharePatchCall.html) (request|response) +/// * [update remarketing list shares](struct.RemarketingListShareUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemarketingListShare { + /// Advertisers that the remarketing list is shared with. + #[serde(rename="sharedAdvertiserIds")] + pub shared_advertiser_ids: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingListShare". + pub kind: Option, + /// Remarketing list ID. This is a read-only, auto-generated field. + #[serde(rename="remarketingListId")] + pub remarketing_list_id: Option, + /// Accounts that the remarketing list is shared with. + #[serde(rename="sharedAccountIds")] + pub shared_account_ids: Option>, +} + +impl RequestValue for RemarketingListShare {} +impl Resource for RemarketingListShare {} +impl ResponseResult for RemarketingListShare {} + + +/// Operating System Version List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list operating system versions](struct.OperatingSystemVersionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperatingSystemVersionsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersionsListResponse". + pub kind: Option, + /// Operating system version collection. + #[serde(rename="operatingSystemVersions")] + pub operating_system_versions: Option>, +} + +impl ResponseResult for OperatingSystemVersionsListResponse {} + + +/// Organizes placements according to the contents of their associated webpages. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch content categories](struct.ContentCategoryPatchCall.html) (request|response) +/// * [insert content categories](struct.ContentCategoryInsertCall.html) (request|response) +/// * [update content categories](struct.ContentCategoryUpdateCall.html) (request|response) +/// * [get content categories](struct.ContentCategoryGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContentCategory { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#contentCategory". + pub kind: Option, + /// Account ID of this content category. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// ID of this content category. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same account. + pub name: Option, +} + +impl RequestValue for ContentCategory {} +impl ResponseResult for ContentCategory {} + + +/// Targetable remarketing list response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list targetable remarketing lists](struct.TargetableRemarketingListListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetableRemarketingListsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetableRemarketingListsListResponse". + pub kind: Option, + /// Targetable remarketing list collection. + #[serde(rename="targetableRemarketingLists")] + pub targetable_remarketing_lists: Option>, +} + +impl ResponseResult for TargetableRemarketingListsListResponse {} + + +/// Represents a buy from the DoubleClick Planning inventory store. +/// +/// # 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 inventory items](struct.InventoryItemGetCall.html) (response) +/// * [list inventory items](struct.InventoryItemListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InventoryItem { + /// Order ID of this inventory item. + #[serde(rename="orderId")] + pub order_id: Option, + /// Advertiser ID of this inventory item. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// ID of the site this inventory item is associated with. + #[serde(rename="siteId")] + pub site_id: Option, + /// Ad slots of this inventory item. If this inventory item represents a standalone placement, there will be exactly one ad slot. If this inventory item represents a placement group, there will be more than one ad slot, each representing one child placement in that placement group. + #[serde(rename="adSlots")] + pub ad_slots: Option>, + /// RFP ID of this inventory item. + #[serde(rename="rfpId")] + pub rfp_id: Option, + /// Content category ID of this inventory item. + #[serde(rename="contentCategoryId")] + pub content_category_id: Option, + /// Placement strategy ID of this inventory item. + #[serde(rename="placementStrategyId")] + pub placement_strategy_id: Option, + /// Account ID of this inventory item. + #[serde(rename="accountId")] + pub account_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#inventoryItem". + pub kind: Option, + /// Negotiation channel ID of this inventory item. + #[serde(rename="negotiationChannelId")] + pub negotiation_channel_id: Option, + /// Subaccount ID of this inventory item. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this inventory item. For standalone inventory items, this is the same name as that of its only ad slot. For group inventory items, this can differ from the name of any of its ad slots. + pub name: Option, + /// Estimated click-through rate of this inventory item. + #[serde(rename="estimatedClickThroughRate")] + pub estimated_click_through_rate: Option, + /// Information about the most recent modification of this inventory item. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Estimated conversion rate of this inventory item. + #[serde(rename="estimatedConversionRate")] + pub estimated_conversion_rate: Option, + /// Whether this inventory item is in plan. + #[serde(rename="inPlan")] + pub in_plan: Option, + /// ID of this inventory item. + pub id: Option, + /// Project ID of this inventory item. + #[serde(rename="projectId")] + pub project_id: Option, + /// Type of inventory item. + #[serde(rename="type")] + pub type_: Option, + /// Pricing of this inventory item. + pub pricing: Option, +} + +impl Resource for InventoryItem {} +impl ResponseResult for InventoryItem {} + + +/// Represents fields that are compatible to be selected for a report of type "FlOODLIGHT". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightReportCompatibleFields { + /// Metrics which are compatible to be selected in the "metricNames" section of the report. + pub metrics: Option>, + /// The kind of resource this is, in this case dfareporting#floodlightReportCompatibleFields. + pub kind: Option, + /// Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, + /// Dimensions which are compatible to be selected in the "dimensions" section of the report. + pub dimensions: Option>, +} + +impl Part for FloodlightReportCompatibleFields {} + + +/// Creative Asset 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 CreativeAssetId { + /// Type of asset to upload. This is a required field. FLASH and IMAGE are no longer supported for new uploads. All image assets should use HTML_IMAGE. + #[serde(rename="type")] + pub type_: Option, + /// Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded asset. Characters in the name must be alphanumeric or one of the following: ".-_ ". Spaces are allowed. + pub name: Option, +} + +impl Part for CreativeAssetId {} + + +/// Directory Site Contact Assignment +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DirectorySiteContactAssignment { + /// ID of this directory site contact. This is a read-only, auto-generated field. + #[serde(rename="contactId")] + pub contact_id: Option, + /// Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set to PRIVATE it is visible only to the site. + pub visibility: Option, +} + +impl Part for DirectorySiteContactAssignment {} + + +/// Creative Assignment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeAssignment { + /// Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. + pub weight: Option, + /// Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to 65535, inclusive. + pub sequence: Option, + /// Click-through URL of the creative assignment. + #[serde(rename="clickThroughUrl")] + pub click_through_url: Option, + /// Rich media exit overrides for this creative assignment. + /// Applicable when the creative type is any of the following: + /// - DISPLAY + /// - RICH_MEDIA_INPAGE + /// - RICH_MEDIA_INPAGE_FLOATING + /// - RICH_MEDIA_IM_EXPAND + /// - RICH_MEDIA_EXPANDING + /// - RICH_MEDIA_INTERSTITIAL_FLOAT + /// - RICH_MEDIA_MOBILE_IN_APP + /// - RICH_MEDIA_MULTI_FLOATING + /// - RICH_MEDIA_PEEL_DOWN + /// - VPAID_LINEAR + /// - VPAID_NON_LINEAR + #[serde(rename="richMediaExitOverrides")] + pub rich_media_exit_overrides: Option>, + /// Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. + #[serde(rename="applyEventTags")] + pub apply_event_tags: Option, + /// Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments. + #[serde(rename="creativeGroupAssignments")] + pub creative_group_assignments: Option>, + /// Companion creative overrides for this creative assignment. Applicable to video ads. + #[serde(rename="companionCreativeOverrides")] + pub companion_creative_overrides: Option>, + /// Date and time that the assigned creative should start serving. + #[serde(rename="startTime")] + pub start_time: Option, + /// Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated. + #[serde(rename="sslCompliant")] + pub ssl_compliant: Option, + /// Whether this creative assignment is active. When true, the creative will be included in the ad's rotation. + pub active: Option, + /// ID of the creative to be assigned. This is a required field. + #[serde(rename="creativeId")] + pub creative_id: Option, + /// Date and time that the assigned creative should stop serving. Must be later than the start time. + #[serde(rename="endTime")] + pub end_time: Option, + /// Dimension value for the ID of the creative. This is a read-only, auto-generated field. + #[serde(rename="creativeIdDimensionValue")] + pub creative_id_dimension_value: Option, +} + +impl Part for CreativeAssignment {} + + +/// Represents a DimensionValuesRequest. +/// +/// # 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*). +/// +/// * [query dimension values](struct.DimensionValueQueryCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DimensionValueRequest { + /// The name of the dimension for which values should be requested. + #[serde(rename="dimensionName")] + pub dimension_name: Option, + /// The start date of the date range for which to retrieve dimension values. A string of the format "yyyy-MM-dd". + #[serde(rename="startDate")] + pub start_date: Option, + /// The kind of request this is, in this case dfareporting#dimensionValueRequest. + pub kind: Option, + /// The end date of the date range for which to retrieve dimension values. A string of the format "yyyy-MM-dd". + #[serde(rename="endDate")] + pub end_date: Option, + /// The list of filters by which to filter values. The filters are ANDed. + pub filters: Option>, +} + +impl RequestValue for DimensionValueRequest {} + + +/// Ad Slot +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdSlot { + /// Comment for this ad slot. + pub comment: Option, + /// ID of the placement from an external platform that is linked to this ad slot. + #[serde(rename="linkedPlacementId")] + pub linked_placement_id: Option, + /// Name of this ad slot. + pub name: Option, + /// Primary ad slot of a roadblock inventory item. + pub primary: Option, + /// Height of this ad slot. + pub height: Option, + /// Width of this ad slot. + pub width: Option, + /// Payment source type of this ad slot. + #[serde(rename="paymentSourceType")] + pub payment_source_type: Option, + /// Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile devices or in mobile apps for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. + pub compatibility: Option, +} + +impl Part for AdSlot {} + + +/// Properties of inheriting and overriding the default click-through event tag. A campaign may override the event tag defined at the advertiser level, and an ad may also override the campaign's setting further. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DefaultClickThroughEventTagProperties { + /// Whether this entity should override the inherited default click-through event tag with its own defined value. + #[serde(rename="overrideInheritedEventTag")] + pub override_inherited_event_tag: Option, + /// ID of the click-through event tag to apply to all ads in this entity's scope. + #[serde(rename="defaultClickThroughEventTagId")] + pub default_click_through_event_tag_id: Option, +} + +impl Part for DefaultClickThroughEventTagProperties {} + + +/// Represents the list of user profiles. +/// +/// # 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 user profiles](struct.UserProfileListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserProfileList { + /// The user profiles returned in this response. + pub items: Option>, + /// The kind of list this is, in this case dfareporting#userProfileList. + pub kind: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, +} + +impl ResponseResult for UserProfileList {} + + +/// Subaccount List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list subaccounts](struct.SubaccountListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubaccountsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#subaccountsListResponse". + pub kind: Option, + /// Subaccount collection. + pub subaccounts: Option>, +} + +impl ResponseResult for SubaccountsListResponse {} + + +/// Contains properties of a DoubleClick Planning order document. +/// +/// # 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 order documents](struct.OrderDocumentGetCall.html) (response) +/// * [list order documents](struct.OrderDocumentListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrderDocument { + /// ID of the order from which this order document is created. + #[serde(rename="orderId")] + pub order_id: Option, + /// Timestamp of the last email sent with this order document. + #[serde(rename="lastSentTime")] + pub last_sent_time: Option, + /// The amended order document ID of this order document. An order document can be created by optionally amending another order document so that the change history can be preserved. + #[serde(rename="amendedOrderDocumentId")] + pub amended_order_document_id: Option, + /// List of email addresses that received the last sent document. + #[serde(rename="lastSentRecipients")] + pub last_sent_recipients: Option>, + /// IDs of users who have approved this order document. + #[serde(rename="approvedByUserProfileIds")] + pub approved_by_user_profile_ids: Option>, + /// ID of this order document. + pub id: Option, + /// Account ID of this order document. + #[serde(rename="accountId")] + pub account_id: Option, + /// Advertiser ID of this order document. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#orderDocument". + pub kind: Option, + /// Subaccount ID of this order document. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Effective date of this order document. + #[serde(rename="effectiveDate")] + pub effective_date: Option, + /// Title of this order document. + pub title: Option, + /// Project ID of this order document. + #[serde(rename="projectId")] + pub project_id: Option, + /// Whether this order document has been signed. + pub signed: Option, + /// Information about the creation of this order document. + #[serde(rename="createdInfo")] + pub created_info: Option, + /// Whether this order document is cancelled. + pub cancelled: Option, + /// Type of this order document + #[serde(rename="type")] + pub type_: Option, +} + +impl Resource for OrderDocument {} +impl ResponseResult for OrderDocument {} + + +/// Represents a Report resource. +/// +/// # 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*). +/// +/// * [run reports](struct.ReportRunCall.html) (none) +/// * [get reports](struct.ReportGetCall.html) (response) +/// * [list reports](struct.ReportListCall.html) (none) +/// * [delete reports](struct.ReportDeleteCall.html) (none) +/// * [files list reports](struct.ReportFileListCall.html) (none) +/// * [insert reports](struct.ReportInsertCall.html) (request|response) +/// * [patch reports](struct.ReportPatchCall.html) (request|response) +/// * [compatible fields query reports](struct.ReportCompatibleFieldQueryCall.html) (request) +/// * [update reports](struct.ReportUpdateCall.html) (request|response) +/// * [files get reports](struct.ReportFileGetCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Report { + /// The user profile id of the owner of this report. + #[serde(rename="ownerProfileId")] + pub owner_profile_id: Option, + /// The subaccount ID to which this report belongs if applicable. + #[serde(rename="subAccountId")] + pub sub_account_id: Option, + /// The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not "TODAY". + pub schedule: Option, + /// The report criteria for a report of type "PATH_TO_CONVERSION". + #[serde(rename="pathToConversionCriteria")] + pub path_to_conversion_criteria: Option, + /// The report criteria for a report of type "REACH". + #[serde(rename="reachCriteria")] + pub reach_criteria: Option, + /// The report criteria for a report of type "FLOODLIGHT". + #[serde(rename="floodlightCriteria")] + pub floodlight_criteria: Option, + /// The filename used when generating report files for this report. + #[serde(rename="fileName")] + pub file_name: Option, + /// The report's email delivery settings. + pub delivery: Option, + /// The timestamp (in milliseconds since epoch) of when this report was last modified. + #[serde(rename="lastModifiedTime")] + pub last_modified_time: Option, + /// The report criteria for a report of type "CROSS_DIMENSION_REACH". + #[serde(rename="crossDimensionReachCriteria")] + pub cross_dimension_reach_criteria: Option, + /// The account ID to which this report belongs. + #[serde(rename="accountId")] + pub account_id: Option, + /// The kind of resource this is, in this case dfareporting#report. + pub kind: Option, + /// The name of the report. + pub name: Option, + /// The output format of the report. If not specified, default format is "CSV". Note that the actual format in the completed report file might differ if for instance the report's size exceeds the format's capabilities. "CSV" will then be the fallback format. + pub format: Option, + /// The unique ID identifying this report resource. + pub id: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, + /// The report criteria for a report of type "STANDARD". + pub criteria: Option, + /// The type of the report. + #[serde(rename="type")] + pub type_: Option, +} + +impl RequestValue for Report {} +impl Resource for Report {} +impl ResponseResult for Report {} + + +/// Contains information about a platform type that can be targeted by ads. +/// +/// # 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 platform types](struct.PlatformTypeGetCall.html) (response) +/// * [list platform types](struct.PlatformTypeListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlatformType { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformType". + pub kind: Option, + /// ID of this platform type. + pub id: Option, + /// Name of this platform type. + pub name: Option, +} + +impl Resource for PlatformType {} +impl ResponseResult for PlatformType {} + + +/// Advertiser List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list advertisers](struct.AdvertiserListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdvertisersListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Advertiser collection. + pub advertisers: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertisersListResponse". + pub kind: Option, +} + +impl ResponseResult for AdvertisersListResponse {} + + +/// Creative Asset. +/// +/// # 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 creative assets](struct.CreativeAssetInsertCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeAsset { + /// Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="artworkType")] + pub artwork_type: Option, + /// Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="positionLeftUnit")] + pub position_left_unit: Option, + /// Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + #[serde(rename="collapsedSize")] + pub collapsed_size: Option, + /// Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="flashVersion")] + pub flash_version: Option, + /// Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. + pub pushdown: Option, + /// Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="hideFlashObjects")] + pub hide_flash_objects: Option, + /// List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="detectedFeatures")] + pub detected_features: Option>, + /// List of companion creatives assigned to an in-stream video creative asset. Acceptable values include IDs of existing flash and image creatives. Applicable to INSTREAM_VIDEO creative type with dynamicAssetSelection set to true. + #[serde(rename="companionCreativeIds")] + pub companion_creative_ids: Option>, + /// Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must be greater than or equal to 1. + pub duration: Option, + /// Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="positionTopUnit")] + pub position_top_unit: Option, + /// Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. + pub id: Option, + /// Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. + pub alignment: Option, + /// Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, this field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + pub size: Option, + /// Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="horizontallyLocked")] + pub horizontally_locked: Option, + /// Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="startTimeType")] + pub start_time_type: Option, + /// Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="displayType")] + pub display_type: Option, + /// Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + #[serde(rename="expandedDimension")] + pub expanded_dimension: Option, + /// Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="verticallyLocked")] + pub vertically_locked: Option, + /// Dimension value for the ID of the asset. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required field. + /// PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and all VPAID creatives. + /// BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + /// ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. + /// OTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives. + /// PARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + /// TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + /// ALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within DCM. + /// For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. + pub role: Option, + /// Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. + #[serde(rename="zipFilesize")] + pub zip_filesize: Option, + /// Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + #[serde(rename="bitRate")] + pub bit_rate: Option, + /// Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and RICH_MEDIA_INPAGE_FLOATING. + #[serde(rename="windowMode")] + pub window_mode: Option, + /// Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + #[serde(rename="progressiveServingUrl")] + pub progressive_serving_url: Option, + /// Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="durationType")] + pub duration_type: Option, + /// Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + #[serde(rename="videoDuration")] + pub video_duration: Option, + /// File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. + #[serde(rename="fileSize")] + pub file_size: Option, + /// Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + pub offset: Option, + /// Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + pub active: Option, + /// Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="originalBackup")] + pub original_backup: Option, + /// Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="hideSelectionBoxes")] + pub hide_selection_boxes: Option, + /// Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + #[serde(rename="streamingServingUrl")] + pub streaming_serving_url: Option, + /// zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive. + #[serde(rename="zIndex")] + pub z_index: Option, + /// Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID. + #[serde(rename="childAssetType")] + pub child_asset_type: Option, + /// Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="backupImageExit")] + pub backup_image_exit: Option, + /// Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative type: FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="actionScript3")] + pub action_script3: Option, + /// Pushdown duration in seconds for an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. Acceptable values are 0 to 9.99, inclusive. + #[serde(rename="pushdownDuration")] + pub pushdown_duration: Option, + /// Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. + #[serde(rename="assetIdentifier")] + pub asset_identifier: Option, + /// Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. + pub transparency: Option, + /// Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. + #[serde(rename="sslCompliant")] + pub ssl_compliant: Option, + /// Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA. + pub position: Option, + /// Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA. Value must be greater than or equal to 0. + #[serde(rename="customStartTimeValue")] + pub custom_start_time_value: Option, + /// File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. + #[serde(rename="zipFilename")] + pub zip_filename: Option, +} + +impl Resource for CreativeAsset {} + + +/// Video Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VideoSettings { + /// Settings for the skippability of video creatives served to this placement. If this object is provided, the creative-level skippable settings will be overridden. + #[serde(rename="skippableSettings")] + pub skippable_settings: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoSettings". + pub kind: Option, + /// Settings for the companion creatives of video creatives served to this placement. + #[serde(rename="companionSettings")] + pub companion_settings: Option, + /// Settings for the transcodes of video creatives served to this placement. If this object is provided, the creative-level transcode settings will be overridden. + #[serde(rename="transcodeSettings")] + pub transcode_settings: Option, +} + +impl Part for VideoSettings {} + + +/// Directory Site List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list directory sites](struct.DirectorySiteListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DirectorySitesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySitesListResponse". + pub kind: Option, + /// Directory site collection. + #[serde(rename="directorySites")] + pub directory_sites: Option>, +} + +impl ResponseResult for DirectorySitesListResponse {} + + +/// Modification timestamp. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LastModifiedInfo { + /// Timestamp of the last change in milliseconds since epoch. + pub time: Option, +} + +impl Part for LastModifiedInfo {} + + +/// Region List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list regions](struct.RegionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionsListResponse { + /// Region collection. + pub regions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#regionsListResponse". + pub kind: Option, +} + +impl ResponseResult for RegionsListResponse {} + + +/// Represents a grouping of related user role permissions. +/// +/// # 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 user role permission groups](struct.UserRolePermissionGroupListCall.html) (none) +/// * [get user role permission groups](struct.UserRolePermissionGroupGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserRolePermissionGroup { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionGroup". + pub kind: Option, + /// ID of this user role permission. + pub id: Option, + /// Name of this user role permission group. + pub name: Option, +} + +impl Resource for UserRolePermissionGroup {} +impl ResponseResult for UserRolePermissionGroup {} + + +/// Contact of an order. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrderContact { + /// Type of this contact. + #[serde(rename="contactType")] + pub contact_type: Option, + /// Title of this contact. + #[serde(rename="contactTitle")] + pub contact_title: Option, + /// Free-form information about this contact. It could be any information related to this contact in addition to type, title, name, and signature user profile ID. + #[serde(rename="contactInfo")] + pub contact_info: Option, + /// Name of this contact. + #[serde(rename="contactName")] + pub contact_name: Option, + /// ID of the user profile containing the signature that will be embedded into order documents. + #[serde(rename="signatureUserProfileId")] + pub signature_user_profile_id: Option, +} + +impl Part for OrderContact {} + + +/// Contains information about an internet connection type that can be targeted by ads. Clients can use the connection type to target mobile vs. broadband users. +/// +/// # 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 connection types](struct.ConnectionTypeGetCall.html) (response) +/// * [list connection types](struct.ConnectionTypeListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConnectionType { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionType". + pub kind: Option, + /// ID of this connection type. + pub id: Option, + /// Name of this connection type. + pub name: Option, +} + +impl Resource for ConnectionType {} +impl ResponseResult for ConnectionType {} + + +/// Browser List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list browsers](struct.BrowserListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BrowsersListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#browsersListResponse". + pub kind: Option, + /// Browser collection. + pub browsers: Option>, +} + +impl ResponseResult for BrowsersListResponse {} + + +/// Object Filter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObjectFilter { + /// Applicable when status is ASSIGNED. The user has access to objects with these object IDs. + #[serde(rename="objectIds")] + pub object_ids: Option>, + /// Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has access to the objects with IDs in the objectIds list. + pub status: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#objectFilter". + pub kind: Option, +} + +impl Part for ObjectFilter {} + + +/// Creative Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeSettings { + /// Header text for iFrames for this site. Must be less than or equal to 2000 characters long. + #[serde(rename="iFrameHeader")] + pub i_frame_header: Option, + /// Header text for iFrames for this site. Must be less than or equal to 2000 characters long. + #[serde(rename="iFrameFooter")] + pub i_frame_footer: Option, +} + +impl Part for CreativeSettings {} + + +/// Represents a dimension. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Dimension { + /// The kind of resource this is, in this case dfareporting#dimension. + pub kind: Option, + /// The dimension name, e.g. dfa:advertiser + pub name: Option, +} + +impl Part for Dimension {} + + +/// Contains information about supported video formats. +/// +/// # 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 video formats](struct.VideoFormatListCall.html) (none) +/// * [get video formats](struct.VideoFormatGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VideoFormat { + /// File type of the video format. + #[serde(rename="fileType")] + pub file_type: Option, + /// The resolution of this video format. + pub resolution: Option, + /// ID of the video format. + pub id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoFormat". + pub kind: Option, + /// The target bit rate of this video format. + #[serde(rename="targetBitRate")] + pub target_bit_rate: Option, +} + +impl Resource for VideoFormat {} +impl ResponseResult for VideoFormat {} + + +/// Creative Click Tag. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClickTag { + /// Advertiser event name associated with the click tag. This field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="eventName")] + pub event_name: Option, + /// Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY creative assets, this field must match the value of the creative asset's creativeAssetId.name field. + pub name: Option, + /// Parameter value for the specified click tag. This field contains a click-through url. + pub value: Option, +} + +impl Part for ClickTag {} + + +/// DirectorySites contains properties of a website from the Site Directory. Sites need to be added to an account via the Sites resource before they can be assigned to a placement. +/// +/// # 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 directory sites](struct.DirectorySiteGetCall.html) (response) +/// * [list directory sites](struct.DirectorySiteListCall.html) (none) +/// * [insert directory sites](struct.DirectorySiteInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DirectorySite { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySite". + pub kind: Option, + /// Country ID of this directory site. This is a read-only field. + #[serde(rename="countryId")] + pub country_id: Option, + /// Description of this directory site. This is a read-only field. + pub description: Option, + /// Directory site settings. + pub settings: Option, + /// Currency ID of this directory site. This is a read-only field. + /// Possible values are: + /// - "1" for USD + /// - "2" for GBP + /// - "3" for ESP + /// - "4" for SEK + /// - "5" for CAD + /// - "6" for JPY + /// - "7" for DEM + /// - "8" for AUD + /// - "9" for FRF + /// - "10" for ITL + /// - "11" for DKK + /// - "12" for NOK + /// - "13" for FIM + /// - "14" for ZAR + /// - "15" for IEP + /// - "16" for NLG + /// - "17" for EUR + /// - "18" for KRW + /// - "19" for TWD + /// - "20" for SGD + /// - "21" for CNY + /// - "22" for HKD + /// - "23" for NZD + /// - "24" for MYR + /// - "25" for BRL + /// - "26" for PTE + /// - "27" for MXP + /// - "28" for CLP + /// - "29" for TRY + /// - "30" for ARS + /// - "31" for PEN + /// - "32" for ILS + /// - "33" for CHF + /// - "34" for VEF + /// - "35" for COP + /// - "36" for GTQ + /// - "37" for PLN + /// - "39" for INR + /// - "40" for THB + /// - "41" for IDR + /// - "42" for CZK + /// - "43" for RON + /// - "44" for HUF + /// - "45" for RUB + /// - "46" for AED + /// - "47" for BGN + /// - "48" for HRK + /// - "49" for MXN + #[serde(rename="currencyId")] + pub currency_id: Option, + /// Tag types for regular placements. + /// + /// Acceptable values are: + /// - "STANDARD" + /// - "IFRAME_JAVASCRIPT_INPAGE" + /// - "INTERNAL_REDIRECT_INPAGE" + /// - "JAVASCRIPT_INPAGE" + #[serde(rename="inpageTagFormats")] + pub inpage_tag_formats: Option>, + /// URL of this directory site. + pub url: Option, + /// Directory site contacts. + #[serde(rename="contactAssignments")] + pub contact_assignments: Option>, + /// Parent directory site ID. + #[serde(rename="parentId")] + pub parent_id: Option, + /// Tag types for interstitial placements. + /// + /// Acceptable values are: + /// - "IFRAME_JAVASCRIPT_INTERSTITIAL" + /// - "INTERNAL_REDIRECT_INTERSTITIAL" + /// - "JAVASCRIPT_INTERSTITIAL" + #[serde(rename="interstitialTagFormats")] + pub interstitial_tag_formats: Option>, + /// Dimension value for the ID of this directory site. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Whether this directory site is active. + pub active: Option, + /// ID of this directory site. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this directory site. + pub name: Option, +} + +impl RequestValue for DirectorySite {} +impl Resource for DirectorySite {} +impl ResponseResult for DirectorySite {} + + +/// City List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list cities](struct.CityListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CitiesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#citiesListResponse". + pub kind: Option, + /// City collection. + pub cities: Option>, +} + +impl ResponseResult for CitiesListResponse {} + + +/// Publisher Dynamic Tag +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivityPublisherDynamicTag { + /// Whether this tag is applicable only for view-throughs. + #[serde(rename="viewThrough")] + pub view_through: Option, + /// Site ID of this dynamic tag. + #[serde(rename="siteId")] + pub site_id: Option, + /// Whether this tag is applicable only for click-throughs. + #[serde(rename="clickThrough")] + pub click_through: Option, + /// Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is retrieved, only the siteId field will be populated. + #[serde(rename="directorySiteId")] + pub directory_site_id: Option, + /// Dimension value for the ID of the site. This is a read-only, auto-generated field. + #[serde(rename="siteIdDimensionValue")] + pub site_id_dimension_value: Option, + /// Dynamic floodlight tag. + #[serde(rename="dynamicTag")] + pub dynamic_tag: Option, +} + +impl Part for FloodlightActivityPublisherDynamicTag {} + + +/// Represents a metric. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Metric { + /// The kind of resource this is, in this case dfareporting#metric. + pub kind: Option, + /// The metric name, e.g. dfa:impressions + pub name: Option, +} + +impl Part for Metric {} + + +/// Rich Media Exit Override. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RichMediaExitOverride { + /// Click-through URL of this rich media exit override. Applicable if the enabled field is set to true. + #[serde(rename="clickThroughUrl")] + pub click_through_url: Option, + /// Whether to use the clickThroughUrl. If false, the creative-level exit will be used. + pub enabled: Option, + /// ID for the override to refer to a specific exit in the creative. + #[serde(rename="exitId")] + pub exit_id: Option, +} + +impl Part for RichMediaExitOverride {} + + +/// Account Permission List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list account permissions](struct.AccountPermissionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountPermissionsListResponse { + /// Account permission collection. + #[serde(rename="accountPermissions")] + pub account_permissions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionsListResponse". + pub kind: Option, +} + +impl ResponseResult for AccountPermissionsListResponse {} + + +/// Placement GenerateTags Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [generatetags placements](struct.PlacementGeneratetagCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementsGenerateTagsResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementsGenerateTagsResponse". + pub kind: Option, + /// Set of generated tags for the specified placements. + #[serde(rename="placementTags")] + pub placement_tags: Option>, +} + +impl ResponseResult for PlacementsGenerateTagsResponse {} + + +/// Contains properties of a creative field value. +/// +/// # 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 creative field values](struct.CreativeFieldValueInsertCall.html) (request|response) +/// * [get creative field values](struct.CreativeFieldValueGetCall.html) (response) +/// * [update creative field values](struct.CreativeFieldValueUpdateCall.html) (request|response) +/// * [patch creative field values](struct.CreativeFieldValuePatchCall.html) (request|response) +/// * [list creative field values](struct.CreativeFieldValueListCall.html) (none) +/// * [delete creative field values](struct.CreativeFieldValueDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeFieldValue { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldValue". + pub kind: Option, + /// ID of this creative field value. This is a read-only, auto-generated field. + pub id: Option, + /// Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field. + pub value: Option, +} + +impl RequestValue for CreativeFieldValue {} +impl Resource for CreativeFieldValue {} +impl ResponseResult for CreativeFieldValue {} + + +/// Floodlight Activity Group List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list floodlight activity groups](struct.FloodlightActivityGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivityGroupsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivityGroupsListResponse". + pub kind: Option, + /// Floodlight activity group collection. + #[serde(rename="floodlightActivityGroups")] + pub floodlight_activity_groups: Option>, +} + +impl ResponseResult for FloodlightActivityGroupsListResponse {} + + +/// Directory Site Contact List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list directory site contacts](struct.DirectorySiteContactListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DirectorySiteContactsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Directory site contact collection + #[serde(rename="directorySiteContacts")] + pub directory_site_contacts: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySiteContactsListResponse". + pub kind: Option, +} + +impl ResponseResult for DirectorySiteContactsListResponse {} + + +/// Creative Custom Event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeCustomEvent { + /// Target type used by the event. + #[serde(rename="targetType")] + pub target_type: Option, + /// Artwork type used by the creative.This is a read-only field. + #[serde(rename="artworkType")] + pub artwork_type: Option, + /// Video reporting ID, used to differentiate multiple videos in a single creative. This is a read-only field. + #[serde(rename="videoReportingId")] + pub video_reporting_id: Option, + /// Properties for rich media popup windows. This field is used only for exit events. + #[serde(rename="popupWindowProperties")] + pub popup_window_properties: Option, + /// Unique ID of this event used by DDM Reporting and Data Transfer. This is a read-only field. + #[serde(rename="advertiserCustomEventId")] + pub advertiser_custom_event_id: Option, + /// Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion. + #[serde(rename="artworkLabel")] + pub artwork_label: Option, + /// Type of the event. This is a read-only field. + #[serde(rename="advertiserCustomEventType")] + pub advertiser_custom_event_type: Option, + /// Exit URL of the event. This field is used only for exit events. + #[serde(rename="exitUrl")] + pub exit_url: Option, + /// ID of this event. This is a required field and should not be modified after insertion. + pub id: Option, + /// User-entered name for the event. + #[serde(rename="advertiserCustomEventName")] + pub advertiser_custom_event_name: Option, +} + +impl Part for CreativeCustomEvent {} + + +/// Creative List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list creatives](struct.CreativeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativesListResponse". + pub kind: Option, + /// Creative collection. + pub creatives: Option>, +} + +impl ResponseResult for CreativesListResponse {} + + +/// Omniture Integration Settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OmnitureSettings { + /// Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true. + #[serde(rename="omnitureCostDataEnabled")] + pub omniture_cost_data_enabled: Option, + /// Whether Omniture integration is enabled. This property can be enabled only when the "Advanced Ad Serving" account setting is enabled. + #[serde(rename="omnitureIntegrationEnabled")] + pub omniture_integration_enabled: Option, +} + +impl Part for OmnitureSettings {} + + +/// Represents fields that are compatible to be selected for a report of type "PATH_TO_CONVERSION". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PathToConversionReportCompatibleFields { + /// Metrics which are compatible to be selected in the "metricNames" section of the report. + pub metrics: Option>, + /// Per-interaction dimensions which are compatible to be selected in the "perInteractionDimensions" section of the report. + #[serde(rename="perInteractionDimensions")] + pub per_interaction_dimensions: Option>, + /// The kind of resource this is, in this case dfareporting#pathToConversionReportCompatibleFields. + pub kind: Option, + /// Conversion dimensions which are compatible to be selected in the "conversionDimensions" section of the report. + #[serde(rename="conversionDimensions")] + pub conversion_dimensions: Option>, + /// Custom floodlight variables which are compatible to be selected in the "customFloodlightVariables" section of the report. + #[serde(rename="customFloodlightVariables")] + pub custom_floodlight_variables: Option>, +} + +impl Part for PathToConversionReportCompatibleFields {} + + +/// Mobile Carrier List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list mobile carriers](struct.MobileCarrierListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MobileCarriersListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarriersListResponse". + pub kind: Option, + /// Mobile carrier collection. + #[serde(rename="mobileCarriers")] + pub mobile_carriers: Option>, +} + +impl ResponseResult for MobileCarriersListResponse {} + + +/// Dynamic Targeting Key List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list dynamic targeting keys](struct.DynamicTargetingKeyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DynamicTargetingKeysListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKeysListResponse". + pub kind: Option, + /// Dynamic targeting key collection. + #[serde(rename="dynamicTargetingKeys")] + pub dynamic_targeting_keys: Option>, +} + +impl ResponseResult for DynamicTargetingKeysListResponse {} + + +/// Dynamic Tag +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivityDynamicTag { + /// Tag code. + pub tag: Option, + /// ID of this dynamic tag. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this tag. + pub name: Option, +} + +impl Part for FloodlightActivityDynamicTag {} + + +/// Contains properties of a Creative. +/// +/// # 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 creatives](struct.CreativeInsertCall.html) (request|response) +/// * [get creatives](struct.CreativeGetCall.html) (response) +/// * [list creatives](struct.CreativeListCall.html) (none) +/// * [update creatives](struct.CreativeUpdateCall.html) (request|response) +/// * [patch creatives](struct.CreativePatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Creative { + /// Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="artworkType")] + pub artwork_type: Option, + /// Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="latestTraffickedCreativeId")] + pub latest_trafficked_creative_id: Option, + /// List of counter events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. + #[serde(rename="counterCustomEvents")] + pub counter_custom_events: Option>, + /// Advertiser ID of this creative. This is a required field. Applicable to all creative types. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Whether the creative is active. Applicable to all creative types. + pub active: Option, + /// List of timer events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset is not HTML_IMAGE. + #[serde(rename="timerCustomEvents")] + pub timer_custom_events: Option>, + /// Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types. + #[serde(rename="renderingIdDimensionValue")] + pub rendering_id_dimension_value: Option, + /// OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE. + #[serde(rename="fsCommand")] + pub fs_command: Option, + /// Set this to true to enable the use of rules to target individual assets in this creative. When set to true creativeAssetSelection must be set. This also controls asset-level companions. When this is true, companion creatives should be assigned to creative assets. Learn more. Applicable to INSTREAM_VIDEO creatives. + #[serde(rename="dynamicAssetSelection")] + pub dynamic_asset_selection: Option, + /// ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types. + pub id: Option, + /// Amount of time to play the video before counting a view. Applicable to the following creative types: all INSTREAM_VIDEO. + #[serde(rename="progressOffset")] + pub progress_offset: Option, + /// Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types. + #[serde(rename="accountId")] + pub account_id: Option, + /// Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="studioTraffickedCreativeId")] + pub studio_trafficked_creative_id: Option, + /// Whether the creative is archived. Applicable to all creative types. + pub archived: Option, + /// Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="overrideCss")] + pub override_css: Option, + /// Source application where creative was authored. Presently, only DBM authored creatives will have this field set. Applicable to all creative types. + #[serde(rename="authoringSource")] + pub authoring_source: Option, + /// The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="requiredFlashVersion")] + pub required_flash_version: Option, + /// List of exit events configured for the creative. For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags, For DISPLAY, an event is also created from the backupImageReportingLabel. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="exitCustomEvents")] + pub exit_custom_events: Option>, + /// ID of current rendering version. This is a read-only field. Applicable to all creative types. + #[serde(rename="renderingId")] + pub rendering_id: Option, + /// Description of the video ad. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. + #[serde(rename="videoDescription")] + pub video_description: Option, + /// Amount of time to play the video before the skip button appears. Applicable to the following creative types: all INSTREAM_VIDEO. + #[serde(rename="skipOffset")] + pub skip_offset: Option, + /// Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="thirdPartyBackupImageImpressionsUrl")] + pub third_party_backup_image_impressions_url: Option, + /// The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich Media creative merging. Applicable to all creative types. + pub version: Option, + /// Creative field assignments for this creative. Applicable to all creative types. + #[serde(rename="creativeFieldAssignments")] + pub creative_field_assignments: Option>, + /// The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. Applicable to the following creative types: FLASH_INPAGE. + #[serde(rename="backgroundColor")] + pub background_color: Option, + /// Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="customKeyValues")] + pub custom_key_values: Option>, + /// Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is a required field when applicable; however for IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a primary asset of type HTML_IMAGE, if left blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: DISPLAY, DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. + pub size: Option, + /// Type of this creative. This is a required field. Applicable to all creative types. + /// + /// Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for existing creatives. New creatives should use DISPLAY as a replacement for these types. + #[serde(rename="type")] + pub type_: Option, + /// Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="totalFileSize")] + pub total_file_size: Option, + /// Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA. + #[serde(rename="thirdPartyRichMediaImpressionsUrl")] + pub third_party_rich_media_impressions_url: Option, + /// Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="studioAdvertiserId")] + pub studio_advertiser_id: Option, + /// Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT + #[serde(rename="creativeAssets")] + pub creative_assets: Option>, + /// List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the creativeAssets' detected features. Applicable to the following creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="backupImageFeatures")] + pub backup_image_features: Option>, + /// Whether images are automatically advanced for image gallery creatives. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. + #[serde(rename="autoAdvanceImages")] + pub auto_advance_images: Option, + /// Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID. + #[serde(rename="videoDuration")] + pub video_duration: Option, + /// URL of hosted image or hosted video or another ad tag. For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect URL. The standard for a VAST (Video Ad Serving Template) ad response allows for a redirect link to another VAST 2.0 or 3.0 call. This is a required field when applicable. Applicable to the following creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT + #[serde(rename="redirectUrl")] + pub redirect_url: Option, + /// Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly one entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="clickTags")] + pub click_tags: Option>, + /// Target window for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="backupImageTargetWindow")] + pub backup_image_target_window: Option, + /// The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="requiredFlashPluginVersion")] + pub required_flash_plugin_version: Option, + /// Reporting label used for HTML5 banner backup image. Applicable to the following creative types: DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="backupImageReportingLabel")] + pub backup_image_reporting_label: Option, + /// Compatibilities associated with this creative. This is a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing creatives may have these compatibilities since new creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types. + /// + /// Acceptable values are: + /// - "APP" + /// - "APP_INTERSTITIAL" + /// - "IN_STREAM_VIDEO" + /// - "DISPLAY" + /// - "DISPLAY_INTERSTITIAL" + pub compatibility: Option>, + /// A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following creative types: INSTREAM_VIDEO and VPAID. + #[serde(rename="universalAdId")] + pub universal_ad_id: Option, + /// Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID. + #[serde(rename="adParameters")] + pub ad_parameters: Option, + /// Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. + #[serde(rename="htmlCodeLocked")] + pub html_code_locked: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creative". + pub kind: Option, + /// Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types. + pub name: Option, + /// Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="adTagKeys")] + pub ad_tag_keys: Option>, + /// Whether Flash assets associated with the creative need to be automatically converted to HTML5. This flag is enabled by default and users can choose to disable it if they don't want the system to generate and use HTML5 asset for this creative. Applicable to the following creative type: FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="convertFlashToHtml5")] + pub convert_flash_to_html5: Option, + /// Whether creative should be treated as SSL compliant even if the system scan shows it's not. Applicable to all creative types. + #[serde(rename="sslOverride")] + pub ssl_override: Option, + /// Creative last modification information. This is a read-only field. Applicable to all creative types. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Click-through URL for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + #[serde(rename="backupImageClickThroughUrl")] + pub backup_image_click_through_url: Option, + /// Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. + #[serde(rename="studioCreativeId")] + pub studio_creative_id: Option, + /// Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. + #[serde(rename="authoringTool")] + pub authoring_tool: Option, + /// Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. + #[serde(rename="thirdPartyUrls")] + pub third_party_urls: Option>, + /// List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to the following creative types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection set to false. + #[serde(rename="companionCreatives")] + pub companion_creatives: Option>, + /// Required if dynamicAssetSelection is true. + #[serde(rename="creativeAssetSelection")] + pub creative_asset_selection: Option, + /// HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is true. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA. + #[serde(rename="htmlCode")] + pub html_code: Option, + /// Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types. + #[serde(rename="sslCompliant")] + pub ssl_compliant: Option, + /// Industry standard ID assigned to creative for reach and frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives. + #[serde(rename="commercialId")] + pub commercial_id: Option, + /// Whether the user can choose to skip the creative. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. + pub skippable: Option, + /// Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. Applicable to the following creative types: FLASH_INPAGE. + #[serde(rename="allowScriptAccess")] + pub allow_script_access: Option, +} + +impl RequestValue for Creative {} +impl Resource for Creative {} +impl ResponseResult for Creative {} + + +/// Reporting Configuration +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportsConfiguration { + /// Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting. + #[serde(rename="exposureToConversionEnabled")] + pub exposure_to_conversion_enabled: Option, + /// Report generation time zone ID of this account. This is a required field that can only be changed by a superuser. + /// Acceptable values are: + /// + /// - "1" for "America/New_York" + /// - "2" for "Europe/London" + /// - "3" for "Europe/Paris" + /// - "4" for "Africa/Johannesburg" + /// - "5" for "Asia/Jerusalem" + /// - "6" for "Asia/Shanghai" + /// - "7" for "Asia/Hong_Kong" + /// - "8" for "Asia/Tokyo" + /// - "9" for "Australia/Sydney" + /// - "10" for "Asia/Dubai" + /// - "11" for "America/Los_Angeles" + /// - "12" for "Pacific/Auckland" + /// - "13" for "America/Sao_Paulo" + #[serde(rename="reportGenerationTimeZoneId")] + pub report_generation_time_zone_id: Option, + /// Default lookback windows for new advertisers in this account. + #[serde(rename="lookbackConfiguration")] + pub lookback_configuration: Option, +} + +impl Part for ReportsConfiguration {} + + +/// Campaign List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list campaigns](struct.CampaignListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CampaignsListResponse { + /// Campaign collection. + pub campaigns: Option>, + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignsListResponse". + pub kind: Option, +} + +impl ResponseResult for CampaignsListResponse {} + + +/// User Role Permission List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list user role permissions](struct.UserRolePermissionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserRolePermissionsListResponse { + /// User role permission collection. + #[serde(rename="userRolePermissions")] + pub user_role_permissions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionsListResponse". + pub kind: Option, +} + +impl ResponseResult for UserRolePermissionsListResponse {} + + +/// Represents a UserProfile resource. +/// +/// # 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 user profiles](struct.UserProfileListCall.html) (none) +/// * [get user profiles](struct.UserProfileGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserProfile { + /// The user name. + #[serde(rename="userName")] + pub user_name: Option, + /// The kind of resource this is, in this case dfareporting#userProfile. + pub kind: Option, + /// The sub account ID this profile belongs to if applicable. + #[serde(rename="subAccountId")] + pub sub_account_id: Option, + /// The account name this profile belongs to. + #[serde(rename="accountName")] + pub account_name: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, + /// The sub account name this profile belongs to if applicable. + #[serde(rename="subAccountName")] + pub sub_account_name: Option, + /// The unique ID of the user profile. + #[serde(rename="profileId")] + pub profile_id: Option, + /// The account ID to which this profile belongs. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl Resource for UserProfile {} +impl ResponseResult for UserProfile {} + + +/// Creative Group Assignment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeGroupAssignment { + /// ID of the creative group to be assigned. + #[serde(rename="creativeGroupId")] + pub creative_group_id: Option, + /// Creative group number of the creative group assignment. + #[serde(rename="creativeGroupNumber")] + pub creative_group_number: Option, +} + +impl Part for CreativeGroupAssignment {} + + +/// The report criteria for a report of type "PATH_TO_CONVERSION". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportPathToConversionCriteria { + /// The list of conversion dimensions the report should include. + #[serde(rename="conversionDimensions")] + pub conversion_dimensions: Option>, + /// The list of names of metrics the report should include. + #[serde(rename="metricNames")] + pub metric_names: Option>, + /// The date range this report should be run for. + #[serde(rename="dateRange")] + pub date_range: Option, + /// The list of custom floodlight variables the report should include. + #[serde(rename="customFloodlightVariables")] + pub custom_floodlight_variables: Option>, + /// The list of 'dfa:activity' values to filter on. + #[serde(rename="activityFilters")] + pub activity_filters: Option>, + /// The list of custom rich media events to include. + #[serde(rename="customRichMediaEvents")] + pub custom_rich_media_events: Option>, + /// The list of per interaction dimensions the report should include. + #[serde(rename="perInteractionDimensions")] + pub per_interaction_dimensions: Option>, + /// The properties of the report. + #[serde(rename="reportProperties")] + pub report_properties: Option, + /// The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'. + #[serde(rename="floodlightConfigId")] + pub floodlight_config_id: Option, +} + +impl NestedType for ReportPathToConversionCriteria {} +impl Part for ReportPathToConversionCriteria {} + + +/// Creative Field List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list creative fields](struct.CreativeFieldListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeFieldsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Creative field collection. + #[serde(rename="creativeFields")] + pub creative_fields: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldsListResponse". + pub kind: Option, +} + +impl ResponseResult for CreativeFieldsListResponse {} + + +/// The report's email delivery settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportDelivery { + /// The message to be sent with each email. + pub message: Option, + /// The type of delivery for the owner to receive, if enabled. + #[serde(rename="emailOwnerDeliveryType")] + pub email_owner_delivery_type: Option, + /// The list of recipients to which to email the report. + pub recipients: Option>, + /// Whether the report should be emailed to the report owner. + #[serde(rename="emailOwner")] + pub email_owner: Option, +} + +impl NestedType for ReportDelivery {} +impl Part for ReportDelivery {} + + +/// Companion Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CompanionSetting { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#companionSetting". + pub kind: Option, + /// Whether companions are disabled for this placement. + #[serde(rename="companionsDisabled")] + pub companions_disabled: Option, + /// Whether to serve only static images as companions. + #[serde(rename="imageOnly")] + pub image_only: Option, + /// Whitelist of companion sizes to be served to this placement. Set this list to null or empty to serve all companion sizes. + #[serde(rename="enabledSizes")] + pub enabled_sizes: Option>, +} + +impl Part for CompanionSetting {} + + +/// Project List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list projects](struct.ProjectListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProjectsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#projectsListResponse". + pub kind: Option, + /// Project collection. + pub projects: Option>, +} + +impl ResponseResult for ProjectsListResponse {} + + +/// Contains properties of a dynamic targeting key. Dynamic targeting keys are unique, user-friendly labels, created at the advertiser level in DCM, that can be assigned to ads, creatives, and placements and used for targeting with DoubleClick Studio dynamic creatives. Use these labels instead of numeric DCM IDs (such as placement IDs) to save time and avoid errors in your dynamic feeds. +/// +/// # 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 dynamic targeting keys](struct.DynamicTargetingKeyListCall.html) (none) +/// * [delete dynamic targeting keys](struct.DynamicTargetingKeyDeleteCall.html) (none) +/// * [insert dynamic targeting keys](struct.DynamicTargetingKeyInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DynamicTargetingKey { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKey". + pub kind: Option, + /// Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + pub name: Option, + /// ID of the object of this dynamic targeting key. This is a required field. + #[serde(rename="objectId")] + pub object_id: Option, + /// Type of the object of this dynamic targeting key. This is a required field. + #[serde(rename="objectType")] + pub object_type: Option, +} + +impl RequestValue for DynamicTargetingKey {} +impl Resource for DynamicTargetingKey {} +impl ResponseResult for DynamicTargetingKey {} + + +/// Geographical Targeting. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GeoTargeting { + /// Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a region, do not target or exclude the country of the region. + pub regions: Option>, + /// Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, metros, or postal codes in the same country. + pub countries: Option>, + /// Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a metro, do not target or exclude the country of the metro. + pub metros: Option>, + /// Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city. + pub cities: Option>, + /// Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted by the ad. + #[serde(rename="excludeCountries")] + pub exclude_countries: Option, + /// Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a postal code, do not target or exclude the country of the postal code. + #[serde(rename="postalCodes")] + pub postal_codes: Option>, +} + +impl Part for GeoTargeting {} + + +/// Contains properties of a targeting template. A targeting template encapsulates targeting information which can be reused across multiple ads. +/// +/// # 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 targeting templates](struct.TargetingTemplateInsertCall.html) (request|response) +/// * [update targeting templates](struct.TargetingTemplateUpdateCall.html) (request|response) +/// * [get targeting templates](struct.TargetingTemplateGetCall.html) (response) +/// * [list targeting templates](struct.TargetingTemplateListCall.html) (none) +/// * [patch targeting templates](struct.TargetingTemplatePatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetingTemplate { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplate". + pub kind: Option, + /// Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this targeting template. This field is required. It must be less than 256 characters long and unique within an advertiser. + pub name: Option, + /// Time and day targeting criteria. + #[serde(rename="dayPartTargeting")] + pub day_part_targeting: Option, + /// Key-value targeting criteria. + #[serde(rename="keyValueTargetingExpression")] + pub key_value_targeting_expression: Option, + /// Remarketing list targeting criteria. + #[serde(rename="listTargetingExpression")] + pub list_targeting_expression: Option, + /// Language targeting criteria. + #[serde(rename="languageTargeting")] + pub language_targeting: Option, + /// Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Geographical targeting criteria. + #[serde(rename="geoTargeting")] + pub geo_targeting: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Technology platform targeting criteria. + #[serde(rename="technologyTargeting")] + pub technology_targeting: Option, + /// ID of this targeting template. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for TargetingTemplate {} +impl Resource for TargetingTemplate {} +impl ResponseResult for TargetingTemplate {} + + +/// Delivery Schedule. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeliverySchedule { + /// Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served. + pub priority: Option, + /// Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it has reached its delivery goals. + #[serde(rename="hardCutoff")] + pub hard_cutoff: Option, + /// Limit on the number of times an individual user can be served the ad within a specified period of time. + #[serde(rename="frequencyCap")] + pub frequency_cap: Option, + /// Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Acceptable values are 1 to 10, inclusive. + #[serde(rename="impressionRatio")] + pub impression_ratio: Option, +} + +impl Part for DeliverySchedule {} + + +/// The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not "TODAY". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportSchedule { + /// Start date of date range for which scheduled reports should be run. + #[serde(rename="startDate")] + pub start_date: Option, + /// Enum to define for "MONTHLY" scheduled reports whether reports should be repeated on the same day of the month as "startDate" or the same day of the week of the month. + /// Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run subsequent reports on the 2nd of every Month, and "WEEK_OF_MONTH" would run subsequent reports on the first Monday of the month. + #[serde(rename="runsOnDayOfMonth")] + pub runs_on_day_of_month: Option, + /// The expiration date when the scheduled report stops running. + #[serde(rename="expirationDate")] + pub expiration_date: Option, + /// Whether the schedule is active or not. Must be set to either true or false. + pub active: Option, + /// Defines every how many days, weeks or months the report should be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or "MONTHLY". + pub every: Option, + /// The interval for which the report is repeated. Note: + /// - "DAILY" also requires field "every" to be set. + /// - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be set. + /// - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be set. + pub repeats: Option, + /// List of week days "WEEKLY" on which scheduled reports should run. + #[serde(rename="repeatsOnWeekDays")] + pub repeats_on_week_days: Option>, +} + +impl NestedType for ReportSchedule {} +impl Part for ReportSchedule {} + + +/// Represents a recipient. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Recipient { + /// The kind of resource this is, in this case dfareporting#recipient. + pub kind: Option, + /// The delivery type for the recipient. + #[serde(rename="deliveryType")] + pub delivery_type: Option, + /// The email address of the recipient. + pub email: Option, +} + +impl Part for Recipient {} + + +/// Represents fields that are compatible to be selected for a report of type "STANDARD". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportCompatibleFields { + /// Metrics which are compatible to be selected in the "metricNames" section of the report. + pub metrics: Option>, + /// The kind of resource this is, in this case dfareporting#reportCompatibleFields. + pub kind: Option, + /// Metrics which are compatible to be selected as activity metrics to pivot on in the "activities" section of the report. + #[serde(rename="pivotedActivityMetrics")] + pub pivoted_activity_metrics: Option>, + /// Dimensions which are compatible to be selected in the "dimensions" section of the report. + pub dimensions: Option>, + /// Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, +} + +impl Part for ReportCompatibleFields {} + + +/// Advertiser Group List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list advertiser groups](struct.AdvertiserGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdvertiserGroupsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiserGroupsListResponse". + pub kind: Option, + /// Advertiser group collection. + #[serde(rename="advertiserGroups")] + pub advertiser_groups: Option>, +} + +impl ResponseResult for AdvertiserGroupsListResponse {} + + +/// Placement Group List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list placement groups](struct.PlacementGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementGroupsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementGroupsListResponse". + pub kind: Option, + /// Placement group collection. + #[serde(rename="placementGroups")] + pub placement_groups: Option>, +} + +impl ResponseResult for PlacementGroupsListResponse {} + + +/// The properties of the report. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportPathToConversionCriteriaReportProperties { + /// DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90. + #[serde(rename="clicksLookbackWindow")] + pub clicks_lookback_window: Option, + /// Enable pivoting on interaction path. + #[serde(rename="pivotOnInteractionPath")] + pub pivot_on_interaction_path: Option, + /// DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from Floodlight or you can manually enter a custom value. Valid values: 1-90. + #[serde(rename="impressionsLookbackWindow")] + pub impressions_lookback_window: Option, + /// Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion. + #[serde(rename="includeUnattributedIPConversions")] + pub include_unattributed_ip_conversions: Option, + /// Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window. + #[serde(rename="includeUnattributedCookieConversions")] + pub include_unattributed_cookie_conversions: Option, + /// The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90. + #[serde(rename="maximumInteractionGap")] + pub maximum_interaction_gap: Option, + /// Deprecated: has no effect. + #[serde(rename="includeAttributedIPConversions")] + pub include_attributed_ip_conversions: Option, + /// The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report. + #[serde(rename="maximumClickInteractions")] + pub maximum_click_interactions: Option, + /// The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report. + #[serde(rename="maximumImpressionInteractions")] + pub maximum_impression_interactions: Option, +} + +impl NestedType for ReportPathToConversionCriteriaReportProperties {} +impl Part for ReportPathToConversionCriteriaReportProperties {} + + +/// Technology Targeting. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TechnologyTargeting { + /// Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only browserVersionId will be used. The other fields are populated automatically when the ad is inserted or updated. + pub browsers: Option>, + /// Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating system versions for the same operating system. + #[serde(rename="operatingSystems")] + pub operating_systems: Option>, + /// Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes. + #[serde(rename="mobileCarriers")] + pub mobile_carriers: Option>, + /// Connection types that this ad targets. For each connection type only id is required. The other fields are populated automatically when the ad is inserted or updated. + #[serde(rename="connectionTypes")] + pub connection_types: Option>, + /// Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are populated automatically when the ad is inserted or updated. + #[serde(rename="platformTypes")] + pub platform_types: Option>, + /// Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the corresponding operating system in operatingSystems. + #[serde(rename="operatingSystemVersions")] + pub operating_system_versions: Option>, +} + +impl Part for TechnologyTargeting {} + + +/// Language List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list languages](struct.LanguageListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LanguagesListResponse { + /// Language collection. + pub languages: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#languagesListResponse". + pub kind: Option, +} + +impl ResponseResult for LanguagesListResponse {} + + +/// Contains information about a language that can be targeted by ads. +/// +/// # 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 languages](struct.LanguageListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Language { + /// Format of language code is an ISO 639 two-letter language code optionally followed by an underscore followed by an ISO 3166 code. Examples are "en" for English or "zh_CN" for Simplified Chinese. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#language". + pub kind: Option, + /// Language ID of this language. This is the ID used for targeting and generating reports. + pub id: Option, + /// Name of this language. + pub name: Option, +} + +impl Resource for Language {} + + +/// Represents the list of reports. +/// +/// # 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 reports](struct.ReportListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportList { + /// Continuation token used to page through reports. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The reports returned in this response. + pub items: Option>, + /// The kind of list this is, in this case dfareporting#reportList. + pub kind: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, +} + +impl ResponseResult for ReportList {} + + +/// Remarketing List Targeting Expression. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTargetingExpression { + /// Expression describing which lists are being targeted by the ad. + pub expression: Option, +} + +impl Part for ListTargetingExpression {} + + +/// CreativeAssets contains properties of a creative asset file which will be uploaded or has already been uploaded. Refer to the creative sample code for how to upload assets and insert a creative. +/// +/// # 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 creative assets](struct.CreativeAssetInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeAssetMetadata { + /// Dimension value for the numeric ID of the asset. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeAssetMetadata". + pub kind: Option, + /// List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. + #[serde(rename="detectedFeatures")] + pub detected_features: Option>, + /// List of detected click tags for assets. This is a read-only auto-generated field. + #[serde(rename="clickTags")] + pub click_tags: Option>, + /// Rules validated during code generation that generated a warning. This is a read-only, auto-generated field. + /// + /// Possible values are: + /// - "ADMOB_REFERENCED" + /// - "ASSET_FORMAT_UNSUPPORTED_DCM" + /// - "ASSET_INVALID" + /// - "CLICK_TAG_HARD_CODED" + /// - "CLICK_TAG_INVALID" + /// - "CLICK_TAG_IN_GWD" + /// - "CLICK_TAG_MISSING" + /// - "CLICK_TAG_MORE_THAN_ONE" + /// - "CLICK_TAG_NON_TOP_LEVEL" + /// - "COMPONENT_UNSUPPORTED_DCM" + /// - "ENABLER_UNSUPPORTED_METHOD_DCM" + /// - "EXTERNAL_FILE_REFERENCED" + /// - "FILE_DETAIL_EMPTY" + /// - "FILE_TYPE_INVALID" + /// - "GWD_PROPERTIES_INVALID" + /// - "HTML5_FEATURE_UNSUPPORTED" + /// - "LINKED_FILE_NOT_FOUND" + /// - "MAX_FLASH_VERSION_11" + /// - "MRAID_REFERENCED" + /// - "NOT_SSL_COMPLIANT" + /// - "ORPHANED_ASSET" + /// - "PRIMARY_HTML_MISSING" + /// - "SVG_INVALID" + /// - "ZIP_INVALID" + #[serde(rename="warnedValidationRules")] + pub warned_validation_rules: Option>, + /// ID of the creative asset. This is a required field. + #[serde(rename="assetIdentifier")] + pub asset_identifier: Option, + /// Numeric ID of the asset. This is a read-only, auto-generated field. + pub id: Option, +} + +impl RequestValue for CreativeAssetMetadata {} +impl ResponseResult for CreativeAssetMetadata {} + + +/// A rule associates an asset with a targeting template for asset-level targeting. Applicable to INSTREAM_VIDEO creatives. +/// +/// 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 { + /// A creativeAssets[].id. This should refer to one of the parent assets in this creative. This is a required field. + #[serde(rename="assetId")] + pub asset_id: Option, + /// A targeting template ID. The targeting from the targeting template will be used to determine whether this asset should be served. This is a required field. + #[serde(rename="targetingTemplateId")] + pub targeting_template_id: Option, + /// A user-friendly name for this rule. This is a required field. + pub name: Option, +} + +impl Part for Rule {} + + +/// Placement Tag Data +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TagData { + /// Tag string to record a click. + #[serde(rename="clickTag")] + pub click_tag: Option, + /// Tag string for serving an ad. + #[serde(rename="impressionTag")] + pub impression_tag: Option, + /// Creative associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING. + #[serde(rename="creativeId")] + pub creative_id: Option, + /// Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING. + #[serde(rename="adId")] + pub ad_id: Option, + /// TagData tag format of this tag. + pub format: Option, +} + +impl Part for TagData {} + + +/// The report criteria for a report of type "FLOODLIGHT". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportFloodlightCriteria { + /// The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'. + #[serde(rename="floodlightConfigId")] + pub floodlight_config_id: Option, + /// The list of dimensions the report should include. + pub dimensions: Option>, + /// The list of names of metrics the report should include. + #[serde(rename="metricNames")] + pub metric_names: Option>, + /// The date range this report should be run for. + #[serde(rename="dateRange")] + pub date_range: Option, + /// The list of custom rich media events to include. + #[serde(rename="customRichMediaEvents")] + pub custom_rich_media_events: Option>, + /// The list of filters on which dimensions are filtered. + /// Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, + /// The properties of the report. + #[serde(rename="reportProperties")] + pub report_properties: Option, +} + +impl NestedType for ReportFloodlightCriteria {} +impl Part for ReportFloodlightCriteria {} + + +/// Landing Page List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list landing pages](struct.LandingPageListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LandingPagesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#landingPagesListResponse". + pub kind: Option, + /// Landing page collection + #[serde(rename="landingPages")] + pub landing_pages: Option>, +} + +impl ResponseResult for LandingPagesListResponse {} + + +/// Encapsulates the list of rules for asset selection and a default asset in case none of the rules match. Applicable to INSTREAM_VIDEO creatives. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeAssetSelection { + /// Rules determine which asset will be served to a viewer. Rules will be evaluated in the order in which they are stored in this list. This list must contain at least one rule. Applicable to INSTREAM_VIDEO creatives. + pub rules: Option>, + /// A creativeAssets[].id. This should refer to one of the parent assets in this creative, and will be served if none of the rules match. This is a required field. + #[serde(rename="defaultAssetId")] + pub default_asset_id: Option, +} + +impl Part for CreativeAssetSelection {} + + +/// Site List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list sites](struct.SiteListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SitesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#sitesListResponse". + pub kind: Option, + /// Site collection. + pub sites: Option>, +} + +impl ResponseResult for SitesListResponse {} + + +/// Represents a dimension filter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DimensionFilter { + /// The name of the dimension to filter. + #[serde(rename="dimensionName")] + pub dimension_name: Option, + /// The kind of resource this is, in this case dfareporting#dimensionFilter. + pub kind: Option, + /// The value of the dimension to filter. + pub value: Option, +} + +impl Part for DimensionFilter {} + + +/// Contains information about a postal code that can be targeted by ads. +/// +/// # 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 postal codes](struct.PostalCodeGetCall.html) (response) +/// * [list postal codes](struct.PostalCodeListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PostalCode { + /// Postal code. This is equivalent to the id field. + pub code: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCode". + pub kind: Option, + /// DART ID of the country to which this postal code belongs. + #[serde(rename="countryDartId")] + pub country_dart_id: Option, + /// ID of this postal code. + pub id: Option, + /// Country code of the country to which this postal code belongs. + #[serde(rename="countryCode")] + pub country_code: Option, +} + +impl Resource for PostalCode {} +impl ResponseResult for PostalCode {} + + +/// Contains properties of a remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource can be used to manage remarketing lists that are owned by your advertisers. To see all remarketing lists that are visible to your advertisers, including those that are shared to your advertiser or account, use the TargetableRemarketingLists resource. +/// +/// # 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 remarketing lists](struct.RemarketingListInsertCall.html) (request|response) +/// * [get remarketing lists](struct.RemarketingListGetCall.html) (response) +/// * [update remarketing lists](struct.RemarketingListUpdateCall.html) (request|response) +/// * [list remarketing lists](struct.RemarketingListListCall.html) (none) +/// * [patch remarketing lists](struct.RemarketingListPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemarketingList { + /// Rule used to populate the remarketing list with users. + #[serde(rename="listPopulationRule")] + pub list_population_rule: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingList". + pub kind: Option, + /// Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Remarketing list description. + pub description: Option, + /// Number of users currently in the list. This is a read-only field. + #[serde(rename="listSize")] + pub list_size: Option, + /// Number of days that a user should remain in the remarketing list without an impression. Acceptable values are 1 to 540, inclusive. + #[serde(rename="lifeSpan")] + pub life_span: Option, + /// Dimension value for the advertiser ID that owns this remarketing list. This is a required field. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Product from which this remarketing list was originated. + #[serde(rename="listSource")] + pub list_source: Option, + /// Whether this remarketing list is active. + pub active: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. + #[serde(rename="accountId")] + pub account_id: Option, + /// Remarketing list ID. This is a read-only, auto-generated field. + pub id: Option, + /// Name of the remarketing list. This is a required field. Must be no greater than 128 characters long. + pub name: Option, +} + +impl RequestValue for RemarketingList {} +impl Resource for RemarketingList {} +impl ResponseResult for RemarketingList {} + + +/// Contains properties of a Floodlight activity. +/// +/// # 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 floodlight activities](struct.FloodlightActivityGetCall.html) (response) +/// * [insert floodlight activities](struct.FloodlightActivityInsertCall.html) (request|response) +/// * [patch floodlight activities](struct.FloodlightActivityPatchCall.html) (request|response) +/// * [update floodlight activities](struct.FloodlightActivityUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivity { + /// Whether this tag should use SSL. + pub secure: Option, + /// Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Name of the associated floodlight activity group. This is a read-only field. + #[serde(rename="floodlightActivityGroupName")] + pub floodlight_activity_group_name: Option, + /// Whether the image tag is enabled for this activity. + #[serde(rename="imageTagEnabled")] + pub image_tag_enabled: Option, + /// Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING. + #[serde(rename="cacheBustingType")] + pub cache_busting_type: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Floodlight activity group ID of this floodlight activity. This is a required field. + #[serde(rename="floodlightActivityGroupId")] + pub floodlight_activity_group_id: Option, + /// List of the user-defined variables used by this conversion tag. These map to the "u[1-100]=" in the tags. Each of these can have a user defined type. + /// Acceptable values are U1 to U100, inclusive. + #[serde(rename="userDefinedVariableTypes")] + pub user_defined_variable_types: Option>, + /// Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activities of the same activity group. This field is read-only after insertion. + #[serde(rename="tagString")] + pub tag_string: Option, + /// Tag string of the associated floodlight activity group. This is a read-only field. + #[serde(rename="floodlightActivityGroupTagString")] + pub floodlight_activity_group_tag_string: Option, + /// URL where this tag will be deployed. If specified, must be less than 256 characters long. + #[serde(rename="expectedUrl")] + pub expected_url: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivity". + pub kind: Option, + /// Subaccount ID of this floodlight activity. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes. + pub name: Option, + /// Publisher dynamic floodlight tags. + #[serde(rename="publisherTags")] + pub publisher_tags: Option>, + /// Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags. + #[serde(rename="sslCompliant")] + pub ssl_compliant: Option, + /// General notes or implementation instructions for the tag. + pub notes: Option, + /// Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's floodlight configuration or from the existing activity's floodlight configuration. + #[serde(rename="floodlightConfigurationId")] + pub floodlight_configuration_id: Option, + /// ID of this floodlight activity. This is a read-only, auto-generated field. + pub id: Option, + /// Counting method for conversions for this floodlight activity. This is a required field. + #[serde(rename="countingMethod")] + pub counting_method: Option, + /// Dynamic floodlight tags. + #[serde(rename="defaultTags")] + pub default_tags: Option>, + /// Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. + #[serde(rename="floodlightConfigurationIdDimensionValue")] + pub floodlight_configuration_id_dimension_value: Option, + /// Tag format type for the floodlight activity. If left blank, the tag format will default to HTML. + #[serde(rename="tagFormat")] + pub tag_format: Option, + /// Whether this activity is archived. + pub hidden: Option, + /// Account ID of this floodlight activity. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Whether this floodlight activity must be SSL-compliant. + #[serde(rename="sslRequired")] + pub ssl_required: Option, + /// Type of the associated floodlight activity group. This is a read-only field. + #[serde(rename="floodlightActivityGroupType")] + pub floodlight_activity_group_type: Option, +} + +impl RequestValue for FloodlightActivity {} +impl ResponseResult for FloodlightActivity {} + + +/// Contains information about a browser that can be targeted by ads. +/// +/// # 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 browsers](struct.BrowserListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Browser { + /// Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is. + #[serde(rename="majorVersion")] + pub major_version: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#browser". + pub kind: Option, + /// ID referring to this grouping of browser and version numbers. This is the ID used for targeting. + #[serde(rename="browserVersionId")] + pub browser_version_id: Option, + /// Name of this browser. + pub name: Option, + /// DART ID of this browser. This is the ID used when generating reports. + #[serde(rename="dartId")] + pub dart_id: Option, + /// Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is. + #[serde(rename="minorVersion")] + pub minor_version: Option, +} + +impl Resource for Browser {} + + +/// Account User Profile List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list account user profiles](struct.AccountUserProfileListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountUserProfilesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Account user profile collection. + #[serde(rename="accountUserProfiles")] + pub account_user_profiles: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountUserProfilesListResponse". + pub kind: Option, +} + +impl ResponseResult for AccountUserProfilesListResponse {} + + +/// Contains properties of a DCM advertiser. +/// +/// # 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 advertisers](struct.AdvertiserGetCall.html) (response) +/// * [update advertisers](struct.AdvertiserUpdateCall.html) (request|response) +/// * [patch advertisers](struct.AdvertiserPatchCall.html) (request|response) +/// * [list advertisers](struct.AdvertiserListCall.html) (none) +/// * [insert advertisers](struct.AdvertiserInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Advertiser { + /// Status of this advertiser. + pub status: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiser". + pub kind: Option, + /// Subaccount ID of this advertiser.This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account. + pub name: Option, + /// ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns. + #[serde(rename="defaultClickThroughEventTagId")] + pub default_click_through_event_tag_id: Option, + /// Original floodlight configuration before any sharing occurred. Set the floodlightConfigurationId of this advertiser to originalFloodlightConfigurationId to unshare the advertiser's current floodlight configuration. You cannot unshare an advertiser's floodlight configuration if the shared configuration has activities associated with any campaign or placement. + #[serde(rename="originalFloodlightConfigurationId")] + pub original_floodlight_configuration_id: Option, + /// Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long. + #[serde(rename="clickThroughUrlSuffix")] + pub click_through_url_suffix: Option, + /// Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this advertiser, so long as: + /// - This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. + /// - This advertiser's original floodlight configuration is not already shared with another advertiser. + #[serde(rename="floodlightConfigurationId")] + pub floodlight_configuration_id: Option, + /// ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for all advertisers in each group. + #[serde(rename="advertiserGroupId")] + pub advertiser_group_id: Option, + /// Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. + #[serde(rename="floodlightConfigurationIdDimensionValue")] + pub floodlight_configuration_id_dimension_value: Option, + /// Suspension status of this advertiser. + pub suspended: Option, + /// Dimension value for the ID of this advertiser. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Default email address used in sender field for tag emails. + #[serde(rename="defaultEmail")] + pub default_email: Option, + /// ID of this advertiser. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this advertiser.This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for Advertiser {} +impl Resource for Advertiser {} +impl ResponseResult for Advertiser {} + + +/// Platform Type List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list platform types](struct.PlatformTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlatformTypesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformTypesListResponse". + pub kind: Option, + /// Platform type collection. + #[serde(rename="platformTypes")] + pub platform_types: Option>, +} + +impl ResponseResult for PlatformTypesListResponse {} + + +/// A description of how user IDs are encrypted. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EncryptionInfo { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#encryptionInfo". + pub kind: Option, + /// The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer. + #[serde(rename="encryptionEntityId")] + pub encryption_entity_id: Option, + /// Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer. + #[serde(rename="encryptionSource")] + pub encryption_source: Option, + /// The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer. + #[serde(rename="encryptionEntityType")] + pub encryption_entity_type: Option, +} + +impl Part for EncryptionInfo {} + + +/// Placement List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list placements](struct.PlacementListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementsListResponse". + pub kind: Option, + /// Placement collection. + pub placements: Option>, +} + +impl ResponseResult for PlacementsListResponse {} + + +/// Ad List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list ads](struct.AdListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#adsListResponse". + pub kind: Option, + /// Ad collection. + pub ads: Option>, +} + +impl ResponseResult for AdsListResponse {} + + +/// The report criteria for a report of type "REACH". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportReachCriteria { + /// Activity group. + pub activities: Option, + /// The list of dimensions the report should include. + pub dimensions: Option>, + /// The list of names of metrics the report should include. + #[serde(rename="metricNames")] + pub metric_names: Option>, + /// The date range this report should be run for. + #[serde(rename="dateRange")] + pub date_range: Option, + /// The list of filters on which dimensions are filtered. + /// Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, + /// The list of names of Reach By Frequency metrics the report should include. + #[serde(rename="reachByFrequencyMetricNames")] + pub reach_by_frequency_metric_names: Option>, + /// Custom Rich Media Events group. + #[serde(rename="customRichMediaEvents")] + pub custom_rich_media_events: Option, + /// Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last three months. + #[serde(rename="enableAllDimensionCombinations")] + pub enable_all_dimension_combinations: Option, +} + +impl NestedType for ReportReachCriteria {} +impl Part for ReportReachCriteria {} + + +/// The URLs where the completed report file can be downloaded. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileUrls { + /// The URL for downloading the report data through a browser. + #[serde(rename="browserUrl")] + pub browser_url: Option, + /// The URL for downloading the report data through the API. + #[serde(rename="apiUrl")] + pub api_url: Option, +} + +impl NestedType for FileUrls {} +impl Part for FileUrls {} + + +/// Order document List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list order documents](struct.OrderDocumentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrderDocumentsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#orderDocumentsListResponse". + pub kind: Option, + /// Order document collection + #[serde(rename="orderDocuments")] + pub order_documents: Option>, +} + +impl ResponseResult for OrderDocumentsListResponse {} + + +/// User Defined Variable configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserDefinedVariableConfiguration { + /// Data type for the variable. This is a required field. + #[serde(rename="dataType")] + pub data_type: Option, + /// User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain the following characters: ""<>". + #[serde(rename="reportName")] + pub report_name: Option, + /// Variable name in the tag. This is a required field. + #[serde(rename="variableType")] + pub variable_type: Option, +} + +impl Part for UserDefinedVariableConfiguration {} + + +/// Pricing Information +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Pricing { + /// Group type of this inventory item if it represents a placement group. Is null otherwise. There are two type of placement groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items that acts as a single pricing point for a group of tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned inventory items to be marked as primary. + #[serde(rename="groupType")] + pub group_type: Option, + /// Start date of this inventory item. + #[serde(rename="startDate")] + pub start_date: Option, + /// Flights of this inventory item. A flight (a.k.a. pricing period) represents the inventory item pricing information for a specific period of time. + pub flights: Option>, + /// End date of this inventory item. + #[serde(rename="endDate")] + pub end_date: Option, + /// Pricing type of this inventory item. + #[serde(rename="pricingType")] + pub pricing_type: Option, + /// Cap cost type of this inventory item. + #[serde(rename="capCostType")] + pub cap_cost_type: Option, +} + +impl Part for Pricing {} + + +/// Skippable Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SkippableSetting { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#skippableSetting". + pub kind: Option, + /// Amount of time to play videos served to this placement before the skip button should appear. Applicable when skippable is true. + #[serde(rename="skipOffset")] + pub skip_offset: Option, + /// Whether the user can skip creatives served to this placement. + pub skippable: Option, + /// Amount of time to play videos served to this placement before counting a view. Applicable when skippable is true. + #[serde(rename="progressOffset")] + pub progress_offset: Option, +} + +impl Part for SkippableSetting {} + + +/// Contains information about where a user's browser is taken after the user clicks an ad. +/// +/// # 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 landing pages](struct.LandingPageUpdateCall.html) (request|response) +/// * [list landing pages](struct.LandingPageListCall.html) (none) +/// * [patch landing pages](struct.LandingPagePatchCall.html) (request|response) +/// * [insert landing pages](struct.LandingPageInsertCall.html) (request|response) +/// * [delete landing pages](struct.LandingPageDeleteCall.html) (none) +/// * [get landing pages](struct.LandingPageGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LandingPage { + /// Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing page is allowed per campaign. + pub default: Option, + /// URL of this landing page. This is a required field. + pub url: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#landingPage". + pub kind: Option, + /// ID of this landing page. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same campaign. + pub name: Option, +} + +impl RequestValue for LandingPage {} +impl Resource for LandingPage {} +impl ResponseResult for LandingPage {} + + +/// Represents the dimensions of ads, placements, creatives, or creative assets. +/// +/// # 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 sizes](struct.SizeInsertCall.html) (request|response) +/// * [get sizes](struct.SizeGetCall.html) (response) +/// * [list sizes](struct.SizeListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Size { + /// Width of this size. Acceptable values are 0 to 32767, inclusive. + pub width: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#size". + pub kind: Option, + /// Height of this size. Acceptable values are 0 to 32767, inclusive. + pub height: Option, + /// ID of this size. This is a read-only, auto-generated field. + pub id: Option, + /// IAB standard size. This is a read-only, auto-generated field. + pub iab: Option, +} + +impl RequestValue for Size {} +impl Resource for Size {} +impl ResponseResult for Size {} + + +/// Contains information about a city that can be targeted by ads. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct City { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#city". + pub kind: Option, + /// DART ID of the country to which this city belongs. + #[serde(rename="countryDartId")] + pub country_dart_id: Option, + /// Name of this city. + pub name: Option, + /// Country code of the country to which this city belongs. + #[serde(rename="countryCode")] + pub country_code: Option, + /// Metro region code of the metro region (DMA) to which this city belongs. + #[serde(rename="metroCode")] + pub metro_code: Option, + /// Region code of the region to which this city belongs. + #[serde(rename="regionCode")] + pub region_code: Option, + /// ID of the metro region (DMA) to which this city belongs. + #[serde(rename="metroDmaId")] + pub metro_dma_id: Option, + /// DART ID of this city. This is the ID used for targeting and generating reports. + #[serde(rename="dartId")] + pub dart_id: Option, + /// DART ID of the region to which this city belongs. + #[serde(rename="regionDartId")] + pub region_dart_id: Option, +} + +impl Part for City {} + + +/// Click Through URL Suffix settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClickThroughUrlSuffixProperties { + /// Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long. + #[serde(rename="clickThroughUrlSuffix")] + pub click_through_url_suffix: Option, + /// Whether this entity should override the inherited click-through URL suffix with its own defined value. + #[serde(rename="overrideInheritedSuffix")] + pub override_inherited_suffix: Option, +} + +impl Part for ClickThroughUrlSuffixProperties {} + + +/// Contains properties of a package or roadblock. +/// +/// # 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 placement groups](struct.PlacementGroupUpdateCall.html) (request|response) +/// * [patch placement groups](struct.PlacementGroupPatchCall.html) (request|response) +/// * [get placement groups](struct.PlacementGroupGetCall.html) (response) +/// * [insert placement groups](struct.PlacementGroupInsertCall.html) (request|response) +/// * [list placement groups](struct.PlacementGroupListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementGroup { + /// Comments for this placement group. + pub comment: Option, + /// ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the primary field on all affected roadblock child placements. + #[serde(rename="primaryPlacementId")] + pub primary_placement_id: Option, + /// Campaign ID of this placement group. This field is required on insertion. + #[serde(rename="campaignId")] + pub campaign_id: Option, + /// Dimension value for the ID of the primary placement. This is a read-only, auto-generated field. + #[serde(rename="primaryPlacementIdDimensionValue")] + pub primary_placement_id_dimension_value: Option, + /// Dimension value for the ID of the directory site. This is a read-only, auto-generated field. + #[serde(rename="directorySiteIdDimensionValue")] + pub directory_site_id_dimension_value: Option, + /// Advertiser ID of this placement group. This is a required field on insertion. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated with this placement group. This is a required field that is read-only after insertion. + #[serde(rename="directorySiteId")] + pub directory_site_id: Option, + /// Information about the creation of this placement group. This is a read-only field. + #[serde(rename="createInfo")] + pub create_info: Option, + /// Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement group. This is a required field that is read-only after insertion. + #[serde(rename="siteId")] + pub site_id: Option, + /// Pricing schedule of this placement group. This field is required on insertion. + #[serde(rename="pricingSchedule")] + pub pricing_schedule: Option, + /// Dimension value for the ID of the site. This is a read-only, auto-generated field. + #[serde(rename="siteIdDimensionValue")] + pub site_id_dimension_value: Option, + /// Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion. + #[serde(rename="placementGroupType")] + pub placement_group_type: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Whether this placement group is archived. + pub archived: Option, + /// ID of this placement group. This is a read-only, auto-generated field. + pub id: Option, + /// ID of the placement strategy assigned to this placement group. + #[serde(rename="placementStrategyId")] + pub placement_strategy_id: Option, + /// Account ID of this placement group. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Dimension value for the ID of the campaign. This is a read-only, auto-generated field. + #[serde(rename="campaignIdDimensionValue")] + pub campaign_id_dimension_value: Option, + /// Subaccount ID of this placement group. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this placement group. This is a required field and must be less than 256 characters long. + pub name: Option, + /// IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field. + #[serde(rename="childPlacementIds")] + pub child_placement_ids: Option>, + /// Information about the most recent modification of this placement group. This is a read-only field. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementGroup". + pub kind: Option, + /// ID of the content category assigned to this placement group. + #[serde(rename="contentCategoryId")] + pub content_category_id: Option, + /// External ID for this placement. + #[serde(rename="externalId")] + pub external_id: Option, + /// Dimension value for the ID of this placement group. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, +} + +impl RequestValue for PlacementGroup {} +impl Resource for PlacementGroup {} +impl ResponseResult for PlacementGroup {} + + +/// Third-party Tracking 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 ThirdPartyTrackingUrl { + /// URL for the specified third-party URL type. + pub url: Option, + /// Third-party URL type for in-stream video creatives. + #[serde(rename="thirdPartyUrlType")] + pub third_party_url_type: Option, +} + +impl Part for ThirdPartyTrackingUrl {} + + +/// Represents a date range. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DateRange { + /// The start date of the date range, inclusive. A string of the format: "yyyy-MM-dd". + #[serde(rename="startDate")] + pub start_date: Option, + /// The kind of resource this is, in this case dfareporting#dateRange. + pub kind: Option, + /// The end date of the date range, inclusive. A string of the format: "yyyy-MM-dd". + #[serde(rename="endDate")] + pub end_date: Option, + /// The date range relative to the date of when the report is run. + #[serde(rename="relativeDateRange")] + pub relative_date_range: Option, +} + +impl Part for DateRange {} + + +/// Metro List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list metros](struct.MetroListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetrosListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#metrosListResponse". + pub kind: Option, + /// Metro collection. + pub metros: Option>, +} + +impl ResponseResult for MetrosListResponse {} + + +/// Pricing Schedule +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PricingSchedule { + /// Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This field is required on insertion. + #[serde(rename="startDate")] + pub start_date: Option, + /// Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion. + #[serde(rename="endDate")] + pub end_date: Option, + /// Whether this placement is flighted. If true, pricing periods will be computed automatically. + pub flighted: Option, + /// Whether cap costs are ignored by ad serving. + #[serde(rename="disregardOverdelivery")] + pub disregard_overdelivery: Option, + /// Placement cap cost option. + #[serde(rename="capCostOption")] + pub cap_cost_option: Option, + /// Pricing periods for this placement. + #[serde(rename="pricingPeriods")] + pub pricing_periods: Option>, + /// Placement pricing type. This field is required on insertion. + #[serde(rename="pricingType")] + pub pricing_type: Option, + /// Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. + #[serde(rename="testingStartDate")] + pub testing_start_date: Option, + /// Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA. + #[serde(rename="floodlightActivityId")] + pub floodlight_activity_id: Option, +} + +impl Part for PricingSchedule {} + + +/// Account List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list accounts](struct.AccountListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountsListResponse". + pub kind: Option, + /// Account collection. + pub accounts: Option>, +} + +impl ResponseResult for AccountsListResponse {} + + +/// Targeting Template List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list targeting templates](struct.TargetingTemplateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetingTemplatesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplatesListResponse". + pub kind: Option, + /// Targeting template collection. + #[serde(rename="targetingTemplates")] + pub targeting_templates: Option>, +} + +impl ResponseResult for TargetingTemplatesListResponse {} + + +/// Contains properties of a creative group. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get creative groups](struct.CreativeGroupGetCall.html) (response) +/// * [update creative groups](struct.CreativeGroupUpdateCall.html) (request|response) +/// * [patch creative groups](struct.CreativeGroupPatchCall.html) (request|response) +/// * [list creative groups](struct.CreativeGroupListCall.html) (none) +/// * [insert creative groups](struct.CreativeGroupInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeGroup { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeGroup". + pub kind: Option, + /// Subaccount ID of this creative group. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same advertiser. + pub name: Option, + /// Subgroup of the creative group. Assign your creative groups to a subgroup in order to filter or manage them more easily. This field is required on insertion and is read-only after insertion. Acceptable values are 1 to 2, inclusive. + #[serde(rename="groupNumber")] + pub group_number: Option, + /// Advertiser ID of this creative group. This is a required field on insertion. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// ID of this creative group. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this creative group. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for CreativeGroup {} +impl Resource for CreativeGroup {} +impl ResponseResult for CreativeGroup {} + + +/// Update Conversions Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batchupdate conversions](struct.ConversionBatchupdateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConversionsBatchUpdateResponse { + /// The update status of each conversion. Statuses are returned in the same order that conversions are updated. + pub status: Option>, + /// Indicates that some or all conversions failed to update. + #[serde(rename="hasFailures")] + pub has_failures: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchUpdateResponse". + pub kind: Option, +} + +impl ResponseResult for ConversionsBatchUpdateResponse {} + + +/// The original conversion that was inserted or updated and whether there were any errors. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConversionStatus { + /// The original conversion that was inserted or updated. + pub conversion: Option, + /// A list of errors related to this conversion. + pub errors: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionStatus". + pub kind: Option, +} + +impl Part for ConversionStatus {} + + +/// Represents an activity group. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Activities { + /// The kind of resource this is, in this case dfareporting#activities. + pub kind: Option, + /// List of activity filters. The dimension values need to be all either of type "dfa:activity" or "dfa:activityGroup". + pub filters: Option>, + /// List of names of floodlight activity metrics. + #[serde(rename="metricNames")] + pub metric_names: Option>, +} + +impl Part for Activities {} + + +/// A group clause made up of list population terms representing constraints joined by ORs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListPopulationClause { + /// Terms of this list population clause. Each clause is made up of list population terms representing constraints and are joined by ORs. + pub terms: Option>, +} + +impl Part for ListPopulationClause {} + + +/// Flight +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Flight { + /// Rate or cost of this flight. + #[serde(rename="rateOrCost")] + pub rate_or_cost: Option, + /// Inventory item flight start date. + #[serde(rename="startDate")] + pub start_date: Option, + /// Units of this flight. + pub units: Option, + /// Inventory item flight end date. + #[serde(rename="endDate")] + pub end_date: Option, +} + +impl Part for Flight {} + + +/// Represents a sorted dimension. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SortedDimension { + /// The kind of resource this is, in this case dfareporting#sortedDimension. + pub kind: Option, + /// The name of the dimension. + pub name: Option, + /// An optional sort order for the dimension column. + #[serde(rename="sortOrder")] + pub sort_order: Option, +} + +impl Part for SortedDimension {} + + +/// Placement Strategy List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list placement strategies](struct.PlacementStrategyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementStrategiesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementStrategiesListResponse". + pub kind: Option, + /// Placement strategy collection. + #[serde(rename="placementStrategies")] + pub placement_strategies: Option>, +} + +impl ResponseResult for PlacementStrategiesListResponse {} + + +/// Language Targeting. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LanguageTargeting { + /// Languages that this ad targets. For each language only languageId is required. The other fields are populated automatically when the ad is inserted or updated. + pub languages: Option>, +} + +impl Part for LanguageTargeting {} + + +/// Contains information about an operating system that can be targeted by ads. +/// +/// # 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 operating systems](struct.OperatingSystemGetCall.html) (response) +/// * [list operating systems](struct.OperatingSystemListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperatingSystem { + /// Whether this operating system is for mobile. + pub mobile: Option, + /// DART ID of this operating system. This is the ID used for targeting. + #[serde(rename="dartId")] + pub dart_id: Option, + /// Whether this operating system is for desktop. + pub desktop: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystem". + pub kind: Option, + /// Name of this operating system. + pub name: Option, +} + +impl Resource for OperatingSystem {} +impl ResponseResult for OperatingSystem {} + + +/// Third Party Authentication Token +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ThirdPartyAuthenticationToken { + /// Name of the third-party authentication token. + pub name: Option, + /// Value of the third-party authentication token. This is a read-only, auto-generated field. + pub value: Option, +} + +impl Part for ThirdPartyAuthenticationToken {} + + +/// Groups advertisers together so that reports can be generated for the entire group at once. +/// +/// # 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 advertiser groups](struct.AdvertiserGroupDeleteCall.html) (none) +/// * [get advertiser groups](struct.AdvertiserGroupGetCall.html) (response) +/// * [update advertiser groups](struct.AdvertiserGroupUpdateCall.html) (request|response) +/// * [list advertiser groups](struct.AdvertiserGroupListCall.html) (none) +/// * [patch advertiser groups](struct.AdvertiserGroupPatchCall.html) (request|response) +/// * [insert advertiser groups](struct.AdvertiserGroupInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdvertiserGroup { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiserGroup". + pub kind: Option, + /// Account ID of this advertiser group. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// ID of this advertiser group. This is a read-only, auto-generated field. + pub id: Option, + /// Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same account. + pub name: Option, +} + +impl RequestValue for AdvertiserGroup {} +impl Resource for AdvertiserGroup {} +impl ResponseResult for AdvertiserGroup {} + + +/// FsCommand. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FsCommand { + /// Height of the window. + #[serde(rename="windowHeight")] + pub window_height: Option, + /// Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + pub top: Option, + /// Width of the window. + #[serde(rename="windowWidth")] + pub window_width: Option, + /// Position in the browser where the window will open. + #[serde(rename="positionOption")] + pub position_option: Option, + /// Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + pub left: Option, +} + +impl Part for FsCommand {} + + +/// Creative optimization settings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeOptimizationConfiguration { + /// List of optimization activities associated with this configuration. + #[serde(rename="optimizationActivitys")] + pub optimization_activitys: Option>, + /// ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns. + pub id: Option, + /// Name of this creative optimization config. This is a required field and must be less than 129 characters long. + pub name: Option, + /// Optimization model for this configuration. + #[serde(rename="optimizationModel")] + pub optimization_model: Option, +} + +impl Part for CreativeOptimizationConfiguration {} + + +/// Creative Group List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list creative groups](struct.CreativeGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeGroupsListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Creative group collection. + #[serde(rename="creativeGroups")] + pub creative_groups: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeGroupsListResponse". + pub kind: Option, +} + +impl ResponseResult for CreativeGroupsListResponse {} + + +/// Offset Position. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OffsetPosition { + /// Offset distance from top side of an asset or a window. + pub top: Option, + /// Offset distance from left side of an asset or a window. + pub left: Option, +} + +impl Part for OffsetPosition {} + + +/// Target Window. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetWindow { + /// User-entered value. + #[serde(rename="customHtml")] + pub custom_html: Option, + /// Type of browser window for which the backup image of the flash creative can be displayed. + #[serde(rename="targetWindowOption")] + pub target_window_option: Option, +} + +impl Part for TargetWindow {} + + +/// Contains properties of a user role permission. +/// +/// # 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 user role permissions](struct.UserRolePermissionGetCall.html) (response) +/// * [list user role permissions](struct.UserRolePermissionListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserRolePermission { + /// ID of the permission group that this user role permission belongs to. + #[serde(rename="permissionGroupId")] + pub permission_group_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermission". + pub kind: Option, + /// Levels of availability for a user role permission. + pub availability: Option, + /// ID of this user role permission. + pub id: Option, + /// Name of this user role permission. + pub name: Option, +} + +impl Resource for UserRolePermission {} +impl ResponseResult for UserRolePermission {} + + +/// Site Contact +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SiteContact { + /// First name of this site contact. + #[serde(rename="firstName")] + pub first_name: Option, + /// Title or designation of this site contact. + pub title: Option, + /// Last name of this site contact. + #[serde(rename="lastName")] + pub last_name: Option, + /// Site contact type. + #[serde(rename="contactType")] + pub contact_type: Option, + /// ID of this site contact. This is a read-only, auto-generated field. + pub id: Option, + /// Primary phone number of this site contact. + pub phone: Option, + /// Address of this site contact. + pub address: Option, + /// Email address of this site contact. This is a required field. + pub email: Option, +} + +impl Part for SiteContact {} + + +/// Creative Rotation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeRotation { + /// Creative assignments in this creative rotation. + #[serde(rename="creativeAssignments")] + pub creative_assignments: Option>, + /// Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM. + #[serde(rename="weightCalculationStrategy")] + pub weight_calculation_strategy: Option, + /// Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad. + #[serde(rename="creativeOptimizationConfigurationId")] + pub creative_optimization_configuration_id: Option, + /// Type of creative rotation. Can be used to specify whether to use sequential or random rotation. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for CreativeRotation {} + + +/// Contains information about a metro region that can be targeted by ads. +/// +/// # 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 metros](struct.MetroListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Metro { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#metro". + pub kind: Option, + /// DART ID of the country to which this metro region belongs. + #[serde(rename="countryDartId")] + pub country_dart_id: Option, + /// Name of this metro region. + pub name: Option, + /// Country code of the country to which this metro region belongs. + #[serde(rename="countryCode")] + pub country_code: Option, + /// Metro code of this metro region. This is equivalent to dma_id. + #[serde(rename="metroCode")] + pub metro_code: Option, + /// DART ID of this metro region. + #[serde(rename="dartId")] + pub dart_id: Option, + /// DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code. + #[serde(rename="dmaId")] + pub dma_id: Option, +} + +impl Resource for Metro {} + + +/// Contains information about a country that can be targeted by ads. +/// +/// # 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 countries](struct.CountryGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Country { + /// DART ID of this country. This is the ID used for targeting and generating reports. + #[serde(rename="dartId")] + pub dart_id: Option, + /// Whether ad serving supports secure servers in this country. + #[serde(rename="sslEnabled")] + pub ssl_enabled: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#country". + pub kind: Option, + /// Country code. + #[serde(rename="countryCode")] + pub country_code: Option, + /// Name of this country. + pub name: Option, +} + +impl ResponseResult for Country {} + + +/// Postal Code List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list postal codes](struct.PostalCodeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PostalCodesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCodesListResponse". + pub kind: Option, + /// Postal code collection. + #[serde(rename="postalCodes")] + pub postal_codes: Option>, +} + +impl ResponseResult for PostalCodesListResponse {} + + +/// Video Format List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list video formats](struct.VideoFormatListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VideoFormatsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoFormatsListResponse". + pub kind: Option, + /// Video format collection. + #[serde(rename="videoFormats")] + pub video_formats: Option>, +} + +impl ResponseResult for VideoFormatsListResponse {} + + +/// Contains properties of a creative field. +/// +/// # 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 creative fields](struct.CreativeFieldListCall.html) (none) +/// * [update creative fields](struct.CreativeFieldUpdateCall.html) (request|response) +/// * [get creative fields](struct.CreativeFieldGetCall.html) (response) +/// * [insert creative fields](struct.CreativeFieldInsertCall.html) (request|response) +/// * [delete creative fields](struct.CreativeFieldDeleteCall.html) (none) +/// * [patch creative fields](struct.CreativeFieldPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeField { + /// Advertiser ID of this creative field. This is a required field on insertion. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeField". + pub kind: Option, + /// Subaccount ID of this creative field. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same advertiser. + pub name: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// ID of this creative field. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this creative field. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for CreativeField {} +impl Resource for CreativeField {} +impl ResponseResult for CreativeField {} + + +/// Creative Field Value List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list creative field values](struct.CreativeFieldValueListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreativeFieldValuesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldValuesListResponse". + pub kind: Option, + /// Creative field value collection. + #[serde(rename="creativeFieldValues")] + pub creative_field_values: Option>, +} + +impl ResponseResult for CreativeFieldValuesListResponse {} + + +/// The properties of the report. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReportFloodlightCriteriaReportProperties { + /// Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the lookback window prior to a conversion. + #[serde(rename="includeUnattributedIPConversions")] + pub include_unattributed_ip_conversions: Option, + /// Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser within the Floodlight group, or that the interaction happened outside the lookback window. + #[serde(rename="includeUnattributedCookieConversions")] + pub include_unattributed_cookie_conversions: Option, + /// Include conversions that have no cookie, but do have an exposure path. + #[serde(rename="includeAttributedIPConversions")] + pub include_attributed_ip_conversions: Option, +} + +impl NestedType for ReportFloodlightCriteriaReportProperties {} +impl Part for ReportFloodlightCriteriaReportProperties {} + + +/// Insert Conversions Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batchinsert conversions](struct.ConversionBatchinsertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConversionsBatchInsertResponse { + /// The insert status of each conversion. Statuses are returned in the same order that conversions are inserted. + pub status: Option>, + /// Indicates that some or all conversions failed to insert. + #[serde(rename="hasFailures")] + pub has_failures: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchInsertResponse". + pub kind: Option, +} + +impl ResponseResult for ConversionsBatchInsertResponse {} + + +/// Contains properties of a Site Directory contact. +/// +/// # 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 directory site contacts](struct.DirectorySiteContactGetCall.html) (response) +/// * [list directory site contacts](struct.DirectorySiteContactListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DirectorySiteContact { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySiteContact". + pub kind: Option, + /// First name of this directory site contact. + #[serde(rename="firstName")] + pub first_name: Option, + /// Title or designation of this directory site contact. + pub title: Option, + /// Last name of this directory site contact. + #[serde(rename="lastName")] + pub last_name: Option, + /// ID of this directory site contact. This is a read-only, auto-generated field. + pub id: Option, + /// Phone number of this directory site contact. + pub phone: Option, + /// Directory site contact role. + pub role: Option, + /// Address of this directory site contact. + pub address: Option, + /// Directory site contact type. + #[serde(rename="type")] + pub type_: Option, + /// Email address of this directory site contact. + pub email: Option, +} + +impl Resource for DirectorySiteContact {} +impl ResponseResult for DirectorySiteContact {} + + +/// Represents a DimensionValue resource. +/// +/// # 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*). +/// +/// * [query dimension values](struct.DimensionValueQueryCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DimensionValue { + /// The name of the dimension. + #[serde(rename="dimensionName")] + pub dimension_name: Option, + /// The kind of resource this is, in this case dfareporting#dimensionValue. + pub kind: Option, + /// The eTag of this response for caching purposes. + pub etag: Option, + /// Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT. + #[serde(rename="matchType")] + pub match_type: Option, + /// The ID associated with the value if available. + pub id: Option, + /// The value of the dimension. + pub value: Option, +} + +impl Resource for DimensionValue {} + + +/// Content Category List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list content categories](struct.ContentCategoryListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContentCategoriesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#contentCategoriesListResponse". + pub kind: Option, + /// Content category collection. + #[serde(rename="contentCategories")] + pub content_categories: Option>, +} + +impl ResponseResult for ContentCategoriesListResponse {} + + +/// Floodlight Configuration List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list floodlight configurations](struct.FloodlightConfigurationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightConfigurationsListResponse { + /// Floodlight configuration collection. + #[serde(rename="floodlightConfigurations")] + pub floodlight_configurations: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightConfigurationsListResponse". + pub kind: Option, +} + +impl ResponseResult for FloodlightConfigurationsListResponse {} + + +/// Describes properties of a DoubleClick Planning order. +/// +/// # 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 orders](struct.OrderListCall.html) (none) +/// * [get orders](struct.OrderGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Order { + /// Terms and conditions of this order. + #[serde(rename="termsAndConditions")] + pub terms_and_conditions: Option, + /// Name of the buyer organization. + #[serde(rename="buyerOrganizationName")] + pub buyer_organization_name: Option, + /// Advertiser ID of this order. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Site IDs this order is associated with. + #[serde(rename="siteId")] + pub site_id: Option>, + /// Buyer invoice ID associated with this order. + #[serde(rename="buyerInvoiceId")] + pub buyer_invoice_id: Option, + /// ID of the terms and conditions template used in this order. + #[serde(rename="planningTermId")] + pub planning_term_id: Option, + /// ID of this order. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this order. + #[serde(rename="accountId")] + pub account_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#order". + pub kind: Option, + /// Subaccount ID of this order. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this order. + pub name: Option, + /// Contacts for this order. + pub contacts: Option>, + /// Information about the most recent modification of this order. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Notes of this order. + pub notes: Option, + /// Name of the seller organization. + #[serde(rename="sellerOrganizationName")] + pub seller_organization_name: Option, + /// Comments in this order. + pub comments: Option, + /// IDs for users that have to approve documents created for this order. + #[serde(rename="approverUserProfileIds")] + pub approver_user_profile_ids: Option>, + /// Seller order ID associated with this order. + #[serde(rename="sellerOrderId")] + pub seller_order_id: Option, + /// Project ID of this order. + #[serde(rename="projectId")] + pub project_id: Option, + /// Free-form site names this order is associated with. + #[serde(rename="siteNames")] + pub site_names: Option>, +} + +impl Resource for Order {} +impl ResponseResult for Order {} + + +/// A custom floodlight variable. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomFloodlightVariable { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#customFloodlightVariable". + pub kind: Option, + /// The type of custom floodlight variable to supply a value for. These map to the "u[1-20]=" in the tags. + #[serde(rename="type")] + pub type_: Option, + /// The value of the custom floodlight variable. The length of string must not exceed 50 characters. + pub value: Option, +} + +impl Part for CustomFloodlightVariable {} + + +/// AccountPermissions contains information about a particular account permission. Some features of DCM require an account permission to be present in the account. +/// +/// # 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 account permissions](struct.AccountPermissionListCall.html) (none) +/// * [get account permissions](struct.AccountPermissionGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountPermission { + /// Permission group of this account permission. + #[serde(rename="permissionGroupId")] + pub permission_group_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermission". + pub kind: Option, + /// Name of this account permission. + pub name: Option, + /// Administrative level required to enable this account permission. + pub level: Option, + /// Account profiles associated with this account permission. + /// + /// Possible values are: + /// - "ACCOUNT_PROFILE_BASIC" + /// - "ACCOUNT_PROFILE_STANDARD" + #[serde(rename="accountProfiles")] + pub account_profiles: Option>, + /// ID of this account permission. + pub id: Option, +} + +impl Resource for AccountPermission {} +impl ResponseResult for AccountPermission {} + + +/// Contains properties of a DoubleClick Planning project. +/// +/// # 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 projects](struct.ProjectGetCall.html) (response) +/// * [list projects](struct.ProjectListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Project { + /// Start date of the project. + #[serde(rename="startDate")] + pub start_date: Option, + /// CPM that the advertiser is targeting. + #[serde(rename="targetCpmNanos")] + pub target_cpm_nanos: Option, + /// End date of the project. + #[serde(rename="endDate")] + pub end_date: Option, + /// Client billing code of this project. + #[serde(rename="clientBillingCode")] + pub client_billing_code: Option, + /// Overview of this project. + pub overview: Option, + /// Number of clicks that the advertiser is targeting. + #[serde(rename="targetClicks")] + pub target_clicks: Option, + /// CPA that the advertiser is targeting. + #[serde(rename="targetCpaNanos")] + pub target_cpa_nanos: Option, + /// Advertiser ID of this project. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Number of impressions that the advertiser is targeting. + #[serde(rename="targetImpressions")] + pub target_impressions: Option, + /// Subaccount ID of this project. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Audience gender of this project. + #[serde(rename="audienceGender")] + pub audience_gender: Option, + /// ID of this project. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this project. + #[serde(rename="accountId")] + pub account_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#project". + pub kind: Option, + /// CPC that the advertiser is targeting. + #[serde(rename="targetCpcNanos")] + pub target_cpc_nanos: Option, + /// Name of this project. + pub name: Option, + /// vCPM from Active View that the advertiser is targeting. + #[serde(rename="targetCpmActiveViewNanos")] + pub target_cpm_active_view_nanos: Option, + /// Information about the most recent modification of this project. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Budget of this project in the currency specified by the current account. The value stored in this field represents only the non-fractional amount. For example, for USD, the smallest value that can be represented by this field is 1 US dollar. + pub budget: Option, + /// Audience age group of this project. + #[serde(rename="audienceAgeGroup")] + pub audience_age_group: Option, + /// Number of conversions that the advertiser is targeting. + #[serde(rename="targetConversions")] + pub target_conversions: Option, + /// Name of the project client. + #[serde(rename="clientName")] + pub client_name: Option, +} + +impl Resource for Project {} +impl ResponseResult for Project {} + + +/// Popup Window Properties. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PopupWindowProperties { + /// Whether to display the browser status bar. + #[serde(rename="showStatusBar")] + pub show_status_bar: Option, + /// Whether to display the browser scroll bar. + #[serde(rename="showScrollBar")] + pub show_scroll_bar: Option, + /// Whether to display the browser address bar. + #[serde(rename="showAddressBar")] + pub show_address_bar: Option, + /// Whether to display the browser menu bar. + #[serde(rename="showMenuBar")] + pub show_menu_bar: Option, + /// Title of popup window. + pub title: Option, + /// Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES. + pub offset: Option, + /// Popup window position either centered or at specific coordinate. + #[serde(rename="positionType")] + pub position_type: Option, + /// Whether to display the browser tool bar. + #[serde(rename="showToolBar")] + pub show_tool_bar: Option, + /// Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID + pub dimension: Option, +} + +impl Part for PopupWindowProperties {} + + +/// Contains properties of a DCM ad. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch ads](struct.AdPatchCall.html) (request|response) +/// * [list ads](struct.AdListCall.html) (none) +/// * [insert ads](struct.AdInsertCall.html) (request|response) +/// * [get ads](struct.AdGetCall.html) (response) +/// * [update ads](struct.AdUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Ad { + /// Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative. + #[serde(rename="clickThroughUrlSuffixProperties")] + pub click_through_url_suffix_properties: Option, + /// Campaign ID of this ad. This is a required field on insertion. + #[serde(rename="campaignId")] + pub campaign_id: Option, + /// Language targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="languageTargeting")] + pub language_targeting: Option, + /// Advertiser ID of this ad. This is a required field on insertion. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Geographical targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="geoTargeting")] + pub geo_targeting: Option, + /// Comments for this ad. + pub comments: Option, + /// Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD. + #[serde(rename="deliverySchedule")] + pub delivery_schedule: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Event tag overrides for this ad. + #[serde(rename="eventTagOverrides")] + pub event_tag_overrides: Option>, + /// ID of this ad. This is a read-only, auto-generated field. + pub id: Option, + /// Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + pub size: Option, + /// Whether this ad is archived. When true, active must be false. + pub archived: Option, + /// Targeting template ID, used to apply preconfigured targeting information to this ad. This cannot be set while any of dayPartTargeting, geoTargeting, keyValueTargetingExpression, languageTargeting, remarketingListExpression, or technologyTargeting are set. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="targetingTemplateId")] + pub targeting_template_id: Option, + /// Technology platform targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="technologyTargeting")] + pub technology_targeting: Option, + /// Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment. + #[serde(rename="creativeRotation")] + pub creative_rotation: Option, + /// Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER. + #[serde(rename="clickThroughUrl")] + pub click_through_url: Option, + /// Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for a maximum of two assignments. + #[serde(rename="creativeGroupAssignments")] + pub creative_group_assignments: Option>, + /// Remarketing list targeting expression for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="remarketingListExpression")] + pub remarketing_list_expression: Option, + /// Dimension value for the ID of this ad. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Account ID of this ad. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource). + #[serde(rename="type")] + pub type_: Option, + /// Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated. + #[serde(rename="sslRequired")] + pub ssl_required: Option, + /// Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="audienceSegmentId")] + pub audience_segment_id: Option, + /// Key-value targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="keyValueTargetingExpression")] + pub key_value_targeting_expression: Option, + /// Dimension value for the ID of the campaign. This is a read-only, auto-generated field. + #[serde(rename="campaignIdDimensionValue")] + pub campaign_id_dimension_value: Option, + /// Default click-through event tag properties for this ad. + #[serde(rename="defaultClickThroughEventTagProperties")] + pub default_click_through_event_tag_properties: Option, + /// Information about the creation of this ad. This is a read-only field. + #[serde(rename="createInfo")] + pub create_info: Option, + /// Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion. + #[serde(rename="startTime")] + pub start_time: Option, + /// Whether this ad is active. When true, archived must be false. + pub active: Option, + /// Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are only used for existing default ads. New mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and default ads created for those placements will be limited to those compatibility types. IN_STREAM_VIDEO refers to rendering in-stream video ads developed with the VAST standard. + pub compatibility: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#ad". + pub kind: Option, + /// Subaccount ID of this ad. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this ad. This is a required field and must be less than 256 characters long. + pub name: Option, + /// Time and day targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD. + #[serde(rename="dayPartTargeting")] + pub day_part_targeting: Option, + /// Information about the most recent modification of this ad. This is a read-only field. + #[serde(rename="lastModifiedInfo")] + pub last_modified_info: Option, + /// Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated. + #[serde(rename="sslCompliant")] + pub ssl_compliant: Option, + /// Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion. + #[serde(rename="endTime")] + pub end_time: Option, + /// Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only after insert. + #[serde(rename="dynamicClickTracker")] + pub dynamic_click_tracker: Option, + /// Placement assignments for this ad. + #[serde(rename="placementAssignments")] + pub placement_assignments: Option>, +} + +impl RequestValue for Ad {} +impl Resource for Ad {} +impl ResponseResult for Ad {} + + +/// Pricing Period +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PricingSchedulePricingPeriod { + /// Units of this pricing period. Acceptable values are 0 to 10000000000, inclusive. + pub units: Option, + /// Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. + #[serde(rename="startDate")] + pub start_date: Option, + /// Rate or cost of this pricing period in nanos (i.e., multipled by 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. + #[serde(rename="rateOrCostNanos")] + pub rate_or_cost_nanos: Option, + /// Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. + #[serde(rename="endDate")] + pub end_date: Option, + /// Comments for this pricing period. + #[serde(rename="pricingComment")] + pub pricing_comment: Option, +} + +impl Part for PricingSchedulePricingPeriod {} + + +/// Contains properties of an event tag. +/// +/// # 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 event tags](struct.EventTagDeleteCall.html) (none) +/// * [patch event tags](struct.EventTagPatchCall.html) (request|response) +/// * [list event tags](struct.EventTagListCall.html) (none) +/// * [update event tags](struct.EventTagUpdateCall.html) (request|response) +/// * [insert event tags](struct.EventTagInsertCall.html) (request|response) +/// * [get event tags](struct.EventTagGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventTag { + /// Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field. + pub status: Option, + /// Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter. + #[serde(rename="siteIds")] + pub site_ids: Option>, + /// Campaign ID of this event tag. This field or the advertiserId field is required on insertion. + #[serde(rename="campaignId")] + pub campaign_id: Option, + /// Dimension value for the ID of the campaign. This is a read-only, auto-generated field. + #[serde(rename="campaignIdDimensionValue")] + pub campaign_id_dimension_value: Option, + /// Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads. + #[serde(rename="enabledByDefault")] + pub enabled_by_default: Option, + /// Advertiser ID of this event tag. This field or the campaignId field is required on insertion. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites. + #[serde(rename="siteFilterType")] + pub site_filter_type: Option, + /// Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. This is a required field. + #[serde(rename="type")] + pub type_: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// ID of this event tag. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this event tag. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTag". + pub kind: Option, + /// Subaccount ID of this event tag. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this event tag. This is a required field and must be less than 256 characters long. + pub name: Option, + /// Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required on insertion. + pub url: Option, + /// Whether this tag is SSL-compliant or not. This is a read-only field. + #[serde(rename="sslCompliant")] + pub ssl_compliant: Option, + /// Whether to remove this event tag from ads that are trafficked through DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag uses a pixel that is unapproved for Ad Exchange bids on one or more networks, such as the Google Display Network. + #[serde(rename="excludeFromAdxRequests")] + pub exclude_from_adx_requests: Option, + /// Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through event tags as specified by the event tag type. + #[serde(rename="urlEscapeLevels")] + pub url_escape_levels: Option, +} + +impl RequestValue for EventTag {} +impl Resource for EventTag {} +impl ResponseResult for EventTag {} + + +/// Placement Assignment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlacementAssignment { + /// Whether this placement assignment is active. When true, the placement will be included in the ad's rotation. + pub active: Option, + /// Dimension value for the ID of the placement. This is a read-only, auto-generated field. + #[serde(rename="placementIdDimensionValue")] + pub placement_id_dimension_value: Option, + /// ID of the placement to be assigned. This is a required field. + #[serde(rename="placementId")] + pub placement_id: Option, + /// Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated. + #[serde(rename="sslRequired")] + pub ssl_required: Option, +} + +impl Part for PlacementAssignment {} + + +/// Represents fields that are compatible to be selected for a report of type "REACH". +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReachReportCompatibleFields { + /// Metrics which are compatible to be selected in the "metricNames" section of the report. + pub metrics: Option>, + /// The kind of resource this is, in this case dfareporting#reachReportCompatibleFields. + pub kind: Option, + /// Dimensions which are compatible to be selected in the "dimensions" section of the report. + pub dimensions: Option>, + /// Metrics which are compatible to be selected in the "reachByFrequencyMetricNames" section of the report. + #[serde(rename="reachByFrequencyMetrics")] + pub reach_by_frequency_metrics: Option>, + /// Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. + #[serde(rename="dimensionFilters")] + pub dimension_filters: Option>, + /// Metrics which are compatible to be selected as activity metrics to pivot on in the "activities" section of the report. + #[serde(rename="pivotedActivityMetrics")] + pub pivoted_activity_metrics: Option>, +} + +impl Part for ReachReportCompatibleFields {} + + +/// Insert Conversions Request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batchinsert conversions](struct.ConversionBatchinsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConversionsBatchInsertRequest { + /// The set of conversions to insert. + pub conversions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchInsertRequest". + pub kind: Option, + /// Describes how encryptedUserId or encryptedUserIdCandidates[] is encrypted. This is a required field if encryptedUserId or encryptedUserIdCandidates[] is used. + #[serde(rename="encryptionInfo")] + pub encryption_info: Option, +} + +impl RequestValue for ConversionsBatchInsertRequest {} + + +/// Contains properties of a site. +/// +/// # 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 sites](struct.SiteUpdateCall.html) (request|response) +/// * [list sites](struct.SiteListCall.html) (none) +/// * [insert sites](struct.SiteInsertCall.html) (request|response) +/// * [get sites](struct.SiteGetCall.html) (response) +/// * [patch sites](struct.SitePatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Site { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#site". + pub kind: Option, + /// Subaccount ID of this site. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account. + pub name: Option, + /// Dimension value for the ID of the directory site. This is a read-only, auto-generated field. + #[serde(rename="directorySiteIdDimensionValue")] + pub directory_site_id_dimension_value: Option, + /// Site-wide settings. + #[serde(rename="siteSettings")] + pub site_settings: Option, + /// ID of this site. This is a read-only, auto-generated field. + pub id: Option, + /// Directory site associated with this site. This is a required field that is read-only after insertion. + #[serde(rename="directorySiteId")] + pub directory_site_id: Option, + /// Site contacts. + #[serde(rename="siteContacts")] + pub site_contacts: Option>, + /// Key name of this site. This is a read-only, auto-generated field. + #[serde(rename="keyName")] + pub key_name: Option, + /// Dimension value for the ID of this site. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, + /// Whether this site is approved. + pub approved: Option, + /// Account ID of this site. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for Site {} +impl Resource for Site {} +impl ResponseResult for Site {} + + +/// DFP Settings +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DfpSettings { + /// DFP network code for this directory site. + #[serde(rename="dfpNetworkCode")] + pub dfp_network_code: Option, + /// DFP network name for this directory site. + #[serde(rename="dfpNetworkName")] + pub dfp_network_name: Option, + /// Whether this directory site is available only via DoubleClick Publisher Portal. + #[serde(rename="publisherPortalOnly")] + pub publisher_portal_only: Option, + /// Whether this directory site accepts programmatic placements. + #[serde(rename="programmaticPlacementAccepted")] + pub programmatic_placement_accepted: Option, + /// Whether this directory site accepts publisher-paid tags. + #[serde(rename="pubPaidPlacementAccepted")] + pub pub_paid_placement_accepted: Option, +} + +impl Part for DfpSettings {} + + +/// Connection Type List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list connection types](struct.ConnectionTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConnectionTypesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionTypesListResponse". + pub kind: Option, + /// Collection of connection types such as broadband and mobile. + #[serde(rename="connectionTypes")] + pub connection_types: Option>, +} + +impl ResponseResult for ConnectionTypesListResponse {} + + +/// Contains properties of a Floodlight configuration. +/// +/// # 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 floodlight configurations](struct.FloodlightConfigurationGetCall.html) (response) +/// * [update floodlight configurations](struct.FloodlightConfigurationUpdateCall.html) (request|response) +/// * [patch floodlight configurations](struct.FloodlightConfigurationPatchCall.html) (request|response) +/// * [list floodlight configurations](struct.FloodlightConfigurationListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightConfiguration { + /// List of user defined variables enabled for this configuration. + #[serde(rename="userDefinedVariableConfigurations")] + pub user_defined_variable_configurations: Option>, + /// List of third-party authentication tokens enabled for this configuration. + #[serde(rename="thirdPartyAuthenticationTokens")] + pub third_party_authentication_tokens: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightConfiguration". + pub kind: Option, + /// Advertiser ID of the parent advertiser of this floodlight configuration. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Configuration settings for dynamic and image floodlight tags. + #[serde(rename="tagSettings")] + pub tag_settings: Option, + /// Whether in-app attribution tracking is enabled. + #[serde(rename="inAppAttributionTrackingEnabled")] + pub in_app_attribution_tracking_enabled: Option, + /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. + #[serde(rename="advertiserIdDimensionValue")] + pub advertiser_id_dimension_value: Option, + /// Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// ID of this floodlight configuration. This is a read-only, auto-generated field. + pub id: Option, + /// Account ID of this floodlight configuration. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// Types of attribution options for natural search conversions. + #[serde(rename="naturalSearchConversionAttributionOption")] + pub natural_search_conversion_attribution_option: Option, + /// Settings for DCM Omniture integration. + #[serde(rename="omnitureSettings")] + pub omniture_settings: Option, + /// Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting. + #[serde(rename="exposureToConversionEnabled")] + pub exposure_to_conversion_enabled: Option, + /// Lookback window settings for this floodlight configuration. + #[serde(rename="lookbackConfiguration")] + pub lookback_configuration: Option, + /// Day that will be counted as the first day of the week in reports. This is a required field. + #[serde(rename="firstDayOfWeek")] + pub first_day_of_week: Option, + /// Whether advertiser data is shared with Google Analytics. + #[serde(rename="analyticsDataSharingEnabled")] + pub analytics_data_sharing_enabled: Option, + /// Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field. + #[serde(rename="idDimensionValue")] + pub id_dimension_value: Option, +} + +impl RequestValue for FloodlightConfiguration {} +impl Resource for FloodlightConfiguration {} +impl ResponseResult for FloodlightConfiguration {} + + +/// Account Permission Group List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list account permission groups](struct.AccountPermissionGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountPermissionGroupsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionGroupsListResponse". + pub kind: Option, + /// Account permission group collection. + #[serde(rename="accountPermissionGroups")] + pub account_permission_groups: Option>, +} + +impl ResponseResult for AccountPermissionGroupsListResponse {} + + +/// Size List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list sizes](struct.SizeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SizesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#sizesListResponse". + pub kind: Option, + /// Size collection. + pub sizes: Option>, +} + +impl ResponseResult for SizesListResponse {} + + +/// User Role List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list user roles](struct.UserRoleListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserRolesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolesListResponse". + pub kind: Option, + /// User role collection. + #[serde(rename="userRoles")] + pub user_roles: Option>, +} + +impl ResponseResult for UserRolesListResponse {} + + +/// Floodlight Activity List Response +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list floodlight activities](struct.FloodlightActivityListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FloodlightActivitiesListResponse { + /// Pagination token to be used for the next list operation. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesListResponse". + pub kind: Option, + /// Floodlight activity collection. + #[serde(rename="floodlightActivities")] + pub floodlight_activities: Option>, +} + +impl ResponseResult for FloodlightActivitiesListResponse {} + + +/// A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following creative types: INSTREAM_VIDEO and VPAID. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UniversalAdId { + /// Registry used for the Ad ID value. + pub registry: Option, + /// ID value for this creative. Only alphanumeric characters and the following symbols are valid: "_/\-". Maximum length is 64 characters. Read only when registry is DCM. + pub value: Option, +} + +impl Part for UniversalAdId {} + + +/// Contains properties of auser role, which is used to manage user access. +/// +/// # 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 user roles](struct.UserRoleInsertCall.html) (request|response) +/// * [update user roles](struct.UserRoleUpdateCall.html) (request|response) +/// * [delete user roles](struct.UserRoleDeleteCall.html) (none) +/// * [patch user roles](struct.UserRolePatchCall.html) (request|response) +/// * [list user roles](struct.UserRoleListCall.html) (none) +/// * [get user roles](struct.UserRoleGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserRole { + /// Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each default user role comes with a basic set of preassigned permissions. + #[serde(rename="defaultUserRole")] + pub default_user_role: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRole". + pub kind: Option, + /// Subaccount ID of this user role. This is a read-only field that can be left blank. + #[serde(rename="subaccountId")] + pub subaccount_id: Option, + /// Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles of the same account. + pub name: Option, + /// ID of the user role that this user role is based on or copied from. This is a required field. + #[serde(rename="parentUserRoleId")] + pub parent_user_role_id: Option, + /// Account ID of this user role. This is a read-only field that can be left blank. + #[serde(rename="accountId")] + pub account_id: Option, + /// ID of this user role. This is a read-only, auto-generated field. + pub id: Option, + /// List of permissions associated with this user role. + pub permissions: Option>, +} + +impl RequestValue for UserRole {} +impl Resource for UserRole {} +impl ResponseResult for UserRole {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *conversion* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `batchinsert(...)` and `batchupdate(...)` +/// // to build up your call. +/// let rb = hub.conversions(); +/// # } +/// ``` +pub struct ConversionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for ConversionMethods<'a, C, A> {} + +impl<'a, C, A> ConversionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates existing conversions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn batchupdate(&self, request: ConversionsBatchUpdateRequest, profile_id: &str) -> ConversionBatchupdateCall<'a, C, A> { + ConversionBatchupdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts conversions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn batchinsert(&self, request: ConversionsBatchInsertRequest, profile_id: &str) -> ConversionBatchinsertCall<'a, C, A> { + ConversionBatchinsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *userRolePermissionGroup* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_role_permission_groups(); +/// # } +/// ``` +pub struct UserRolePermissionGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for UserRolePermissionGroupMethods<'a, C, A> {} + +impl<'a, C, A> UserRolePermissionGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one user role permission group by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User role permission group ID. + pub fn get(&self, profile_id: &str, id: &str) -> UserRolePermissionGroupGetCall<'a, C, A> { + UserRolePermissionGroupGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of all supported user role permission groups. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> UserRolePermissionGroupListCall<'a, C, A> { + UserRolePermissionGroupListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *platformType* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.platform_types(); +/// # } +/// ``` +pub struct PlatformTypeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for PlatformTypeMethods<'a, C, A> {} + +impl<'a, C, A> PlatformTypeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one platform type by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Platform type ID. + pub fn get(&self, profile_id: &str, id: &str) -> PlatformTypeGetCall<'a, C, A> { + PlatformTypeGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of platform types. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> PlatformTypeListCall<'a, C, A> { + PlatformTypeListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *orderDocument* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.order_documents(); +/// # } +/// ``` +pub struct OrderDocumentMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for OrderDocumentMethods<'a, C, A> {} + +impl<'a, C, A> OrderDocumentMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one order document by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `projectId` - Project ID for order documents. + /// * `id` - Order document ID. + pub fn get(&self, profile_id: &str, project_id: &str, id: &str) -> OrderDocumentGetCall<'a, C, A> { + OrderDocumentGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _project_id: project_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of order documents, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `projectId` - Project ID for order documents. + pub fn list(&self, profile_id: &str, project_id: &str) -> OrderDocumentListCall<'a, C, A> { + OrderDocumentListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _project_id: project_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _site_id: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _order_id: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _approved: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *creativeField* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_fields(); +/// # } +/// ``` +pub struct CreativeFieldMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CreativeFieldMethods<'a, C, A> {} + +impl<'a, C, A> CreativeFieldMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: CreativeField, profile_id: &str) -> CreativeFieldUpdateCall<'a, C, A> { + CreativeFieldUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of creative fields, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> CreativeFieldListCall<'a, C, A> { + CreativeFieldListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _advertiser_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an existing creative field. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative Field ID + pub fn delete(&self, profile_id: &str, id: &str) -> CreativeFieldDeleteCall<'a, C, A> { + CreativeFieldDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one creative field by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative Field ID + pub fn get(&self, profile_id: &str, id: &str) -> CreativeFieldGetCall<'a, C, A> { + CreativeFieldGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new creative field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: CreativeField, profile_id: &str) -> CreativeFieldInsertCall<'a, C, A> { + CreativeFieldInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative field. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative Field ID + pub fn patch(&self, request: CreativeField, profile_id: &str, id: &str) -> CreativeFieldPatchCall<'a, C, A> { + CreativeFieldPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *userRole* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_roles(); +/// # } +/// ``` +pub struct UserRoleMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for UserRoleMethods<'a, C, A> {} + +impl<'a, C, A> UserRoleMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new user role. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: UserRole, profile_id: &str) -> UserRoleInsertCall<'a, C, A> { + UserRoleInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one user role by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User role ID. + pub fn get(&self, profile_id: &str, id: &str) -> UserRoleGetCall<'a, C, A> { + UserRoleGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing user role. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: UserRole, profile_id: &str) -> UserRoleUpdateCall<'a, C, A> { + UserRoleUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.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 user role. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User role ID. + pub fn delete(&self, profile_id: &str, id: &str) -> UserRoleDeleteCall<'a, C, A> { + UserRoleDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing user role. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User role ID. + pub fn patch(&self, request: UserRole, profile_id: &str, id: &str) -> UserRolePatchCall<'a, C, A> { + UserRolePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of user roles, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> UserRoleListCall<'a, C, A> { + UserRoleListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _subaccount_id: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _account_user_role_only: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *operatingSystemVersion* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.operating_system_versions(); +/// # } +/// ``` +pub struct OperatingSystemVersionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for OperatingSystemVersionMethods<'a, C, A> {} + +impl<'a, C, A> OperatingSystemVersionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one operating system version by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Operating system version ID. + pub fn get(&self, profile_id: &str, id: &str) -> OperatingSystemVersionGetCall<'a, C, A> { + OperatingSystemVersionGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of operating system versions. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> OperatingSystemVersionListCall<'a, C, A> { + OperatingSystemVersionListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *landingPage* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.landing_pages(); +/// # } +/// ``` +pub struct LandingPageMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for LandingPageMethods<'a, C, A> {} + +impl<'a, C, A> LandingPageMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one campaign landing page by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Landing page campaign ID. + /// * `id` - Landing page ID. + pub fn get(&self, profile_id: &str, campaign_id: &str, id: &str) -> LandingPageGetCall<'a, C, A> { + LandingPageGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing campaign landing page. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Landing page campaign ID. + pub fn update(&self, request: LandingPage, profile_id: &str, campaign_id: &str) -> LandingPageUpdateCall<'a, C, A> { + LandingPageUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_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 list of landing pages for the specified campaign. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Landing page campaign ID. + pub fn list(&self, profile_id: &str, campaign_id: &str) -> LandingPageListCall<'a, C, A> { + LandingPageListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new landing page for the specified campaign. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Landing page campaign ID. + pub fn insert(&self, request: LandingPage, profile_id: &str, campaign_id: &str) -> LandingPageInsertCall<'a, C, A> { + LandingPageInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing campaign landing page. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Landing page campaign ID. + /// * `id` - Landing page ID. + pub fn patch(&self, request: LandingPage, profile_id: &str, campaign_id: &str, id: &str) -> LandingPagePatchCall<'a, C, A> { + LandingPagePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_id.to_string(), + _id: id.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 campaign landing page. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Landing page campaign ID. + /// * `id` - Landing page ID. + pub fn delete(&self, profile_id: &str, campaign_id: &str, id: &str) -> LandingPageDeleteCall<'a, C, A> { + LandingPageDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *creativeAsset* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `insert(...)` +/// // to build up your call. +/// let rb = hub.creative_assets(); +/// # } +/// ``` +pub struct CreativeAssetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CreativeAssetMethods<'a, C, A> {} + +impl<'a, C, A> CreativeAssetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new creative asset. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `advertiserId` - Advertiser ID of this creative. This is a required field. + pub fn insert(&self, request: CreativeAssetMetadata, profile_id: &str, advertiser_id: &str) -> CreativeAssetInsertCall<'a, C, A> { + CreativeAssetInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _advertiser_id: advertiser_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *campaignCreativeAssociation* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.campaign_creative_associations(); +/// # } +/// ``` +pub struct CampaignCreativeAssociationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CampaignCreativeAssociationMethods<'a, C, A> {} + +impl<'a, C, A> CampaignCreativeAssociationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Campaign ID in this association. + pub fn insert(&self, request: CampaignCreativeAssociation, profile_id: &str, campaign_id: &str) -> CampaignCreativeAssociationInsertCall<'a, C, A> { + CampaignCreativeAssociationInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_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 list of creative IDs associated with the specified campaign. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `campaignId` - Campaign ID in this association. + pub fn list(&self, profile_id: &str, campaign_id: &str) -> CampaignCreativeAssociationListCall<'a, C, A> { + CampaignCreativeAssociationListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _campaign_id: campaign_id.to_string(), + _sort_order: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *changeLog* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.change_logs(); +/// # } +/// ``` +pub struct ChangeLogMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for ChangeLogMethods<'a, C, A> {} + +impl<'a, C, A> ChangeLogMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of change logs. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> ChangeLogListCall<'a, C, A> { + ChangeLogListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _user_profile_ids: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _object_type: Default::default(), + _object_ids: Default::default(), + _min_change_time: Default::default(), + _max_results: Default::default(), + _max_change_time: Default::default(), + _ids: Default::default(), + _action: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one change log by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Change log ID. + pub fn get(&self, profile_id: &str, id: &str) -> ChangeLogGetCall<'a, C, A> { + ChangeLogGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *remarketingListShare* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.remarketing_list_shares(); +/// # } +/// ``` +pub struct RemarketingListShareMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for RemarketingListShareMethods<'a, C, A> {} + +impl<'a, C, A> RemarketingListShareMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one remarketing list share by remarketing list ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `remarketingListId` - Remarketing list ID. + pub fn get(&self, profile_id: &str, remarketing_list_id: &str) -> RemarketingListShareGetCall<'a, C, A> { + RemarketingListShareGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _remarketing_list_id: remarketing_list_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing remarketing list share. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `remarketingListId` - Remarketing list ID. + pub fn patch(&self, request: RemarketingListShare, profile_id: &str, remarketing_list_id: &str) -> RemarketingListSharePatchCall<'a, C, A> { + RemarketingListSharePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _remarketing_list_id: remarketing_list_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing remarketing list share. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: RemarketingListShare, profile_id: &str) -> RemarketingListShareUpdateCall<'a, C, A> { + RemarketingListShareUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *report* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `compatible_fields_query(...)`, `delete(...)`, `files_get(...)`, `files_list(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)`, `run(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.reports(); +/// # } +/// ``` +pub struct ReportMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for ReportMethods<'a, C, A> {} + +impl<'a, C, A> ReportMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Runs a report. + /// + /// # Arguments + /// + /// * `profileId` - The DFA profile ID. + /// * `reportId` - The ID of the report. + pub fn run(&self, profile_id: &str, report_id: &str) -> ReportRunCall<'a, C, A> { + ReportRunCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _synchronous: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a report. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - The DFA user profile ID. + /// * `reportId` - The ID of the report. + pub fn patch(&self, request: Report, profile_id: &str, report_id: &str) -> ReportPatchCall<'a, C, A> { + ReportPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists files for a report. + /// + /// # Arguments + /// + /// * `profileId` - The DFA profile ID. + /// * `reportId` - The ID of the parent report. + pub fn files_list(&self, profile_id: &str, report_id: &str) -> ReportFileListCall<'a, C, A> { + ReportFileListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a report. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - The DFA user profile ID. + pub fn insert(&self, request: Report, profile_id: &str) -> ReportInsertCall<'a, C, A> { + ReportInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - The DFA user profile ID. + pub fn compatible_fields_query(&self, request: Report, profile_id: &str) -> ReportCompatibleFieldQueryCall<'a, C, A> { + ReportCompatibleFieldQueryCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a report by its ID. + /// + /// # Arguments + /// + /// * `profileId` - The DFA user profile ID. + /// * `reportId` - The ID of the report. + pub fn get(&self, profile_id: &str, report_id: &str) -> ReportGetCall<'a, C, A> { + ReportGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a report file. This method supports media download. + /// + /// # Arguments + /// + /// * `profileId` - The DFA profile ID. + /// * `reportId` - The ID of the report. + /// * `fileId` - The ID of the report file. + pub fn files_get(&self, profile_id: &str, report_id: &str, file_id: &str) -> ReportFileGetCall<'a, C, A> { + ReportFileGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _file_id: file_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a report by its ID. + /// + /// # Arguments + /// + /// * `profileId` - The DFA user profile ID. + /// * `reportId` - The ID of the report. + pub fn delete(&self, profile_id: &str, report_id: &str) -> ReportDeleteCall<'a, C, A> { + ReportDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a report. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - The DFA user profile ID. + /// * `reportId` - The ID of the report. + pub fn update(&self, request: Report, profile_id: &str, report_id: &str) -> ReportUpdateCall<'a, C, A> { + ReportUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _report_id: report_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves list of reports. + /// + /// # Arguments + /// + /// * `profileId` - The DFA user profile ID. + pub fn list(&self, profile_id: &str) -> ReportListCall<'a, C, A> { + ReportListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _scope: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *advertiser* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.advertisers(); +/// # } +/// ``` +pub struct AdvertiserMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AdvertiserMethods<'a, C, A> {} + +impl<'a, C, A> AdvertiserMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new advertiser. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Advertiser, profile_id: &str) -> AdvertiserInsertCall<'a, C, A> { + AdvertiserInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing advertiser. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Advertiser ID. + pub fn patch(&self, request: Advertiser, profile_id: &str, id: &str) -> AdvertiserPatchCall<'a, C, A> { + AdvertiserPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of advertisers, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AdvertiserListCall<'a, C, A> { + AdvertiserListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _subaccount_id: Default::default(), + _status: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _only_parent: Default::default(), + _max_results: Default::default(), + _include_advertisers_without_groups_only: Default::default(), + _ids: Default::default(), + _floodlight_configuration_ids: Default::default(), + _advertiser_group_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing advertiser. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Advertiser, profile_id: &str) -> AdvertiserUpdateCall<'a, C, A> { + AdvertiserUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one advertiser by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Advertiser ID. + pub fn get(&self, profile_id: &str, id: &str) -> AdvertiserGetCall<'a, C, A> { + AdvertiserGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *dimensionValue* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `query(...)` +/// // to build up your call. +/// let rb = hub.dimension_values(); +/// # } +/// ``` +pub struct DimensionValueMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for DimensionValueMethods<'a, C, A> {} + +impl<'a, C, A> DimensionValueMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves list of report dimension values for a list of filters. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - The DFA user profile ID. + pub fn query(&self, request: DimensionValueRequest, profile_id: &str) -> DimensionValueQueryCall<'a, C, A> { + DimensionValueQueryCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *floodlightActivityGroup* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.floodlight_activity_groups(); +/// # } +/// ``` +pub struct FloodlightActivityGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for FloodlightActivityGroupMethods<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one floodlight activity group by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight activity Group ID. + pub fn get(&self, profile_id: &str, id: &str) -> FloodlightActivityGroupGetCall<'a, C, A> { + FloodlightActivityGroupGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing floodlight activity group. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight activity Group ID. + pub fn patch(&self, request: FloodlightActivityGroup, profile_id: &str, id: &str) -> FloodlightActivityGroupPatchCall<'a, C, A> { + FloodlightActivityGroupPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + FloodlightActivityGroupListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _type_: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _floodlight_configuration_id: Default::default(), + _advertiser_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new floodlight activity group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: FloodlightActivityGroup, profile_id: &str) -> FloodlightActivityGroupInsertCall<'a, C, A> { + FloodlightActivityGroupInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing floodlight activity group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: FloodlightActivityGroup, profile_id: &str) -> FloodlightActivityGroupUpdateCall<'a, C, A> { + FloodlightActivityGroupUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *metro* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.metros(); +/// # } +/// ``` +pub struct MetroMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for MetroMethods<'a, C, A> {} + +impl<'a, C, A> MetroMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of metros. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> MetroListCall<'a, C, A> { + MetroListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *order* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.orders(); +/// # } +/// ``` +pub struct OrderMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for OrderMethods<'a, C, A> {} + +impl<'a, C, A> OrderMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of orders, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `projectId` - Project ID for orders. + pub fn list(&self, profile_id: &str, project_id: &str) -> OrderListCall<'a, C, A> { + OrderListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _project_id: project_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _site_id: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one order by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `projectId` - Project ID for orders. + /// * `id` - Order ID. + pub fn get(&self, profile_id: &str, project_id: &str, id: &str) -> OrderGetCall<'a, C, A> { + OrderGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _project_id: project_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *language* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.languages(); +/// # } +/// ``` +pub struct LanguageMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for LanguageMethods<'a, C, A> {} + +impl<'a, C, A> LanguageMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of languages. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> LanguageListCall<'a, C, A> { + LanguageListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *directorySiteContact* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.directory_site_contacts(); +/// # } +/// ``` +pub struct DirectorySiteContactMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for DirectorySiteContactMethods<'a, C, A> {} + +impl<'a, C, A> DirectorySiteContactMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one directory site contact by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Directory site contact ID. + pub fn get(&self, profile_id: &str, id: &str) -> DirectorySiteContactGetCall<'a, C, A> { + DirectorySiteContactGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of directory site contacts, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> DirectorySiteContactListCall<'a, C, A> { + DirectorySiteContactListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _directory_site_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *userProfile* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_profiles(); +/// # } +/// ``` +pub struct UserProfileMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for UserProfileMethods<'a, C, A> {} + +impl<'a, C, A> UserProfileMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves list of user profiles for a user. + pub fn list(&self) -> UserProfileListCall<'a, C, A> { + UserProfileListCall { + hub: self.hub, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one user profile by ID. + /// + /// # Arguments + /// + /// * `profileId` - The user profile ID. + pub fn get(&self, profile_id: &str) -> UserProfileGetCall<'a, C, A> { + UserProfileGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *ad* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.ads(); +/// # } +/// ``` +pub struct AdMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AdMethods<'a, C, A> {} + +impl<'a, C, A> AdMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing ad. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Ad ID. + pub fn patch(&self, request: Ad, profile_id: &str, id: &str) -> AdPatchCall<'a, C, A> { + AdPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new ad. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Ad, profile_id: &str) -> AdInsertCall<'a, C, A> { + AdInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of ads, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AdListCall<'a, C, A> { + AdListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _type_: Default::default(), + _ssl_required: Default::default(), + _ssl_compliant: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _size_ids: Default::default(), + _search_string: Default::default(), + _remarketing_list_ids: Default::default(), + _placement_ids: Default::default(), + _page_token: Default::default(), + _overridden_event_tag_id: Default::default(), + _max_results: Default::default(), + _landing_page_ids: Default::default(), + _ids: Default::default(), + _dynamic_click_tracker: Default::default(), + _creative_optimization_configuration_ids: Default::default(), + _creative_ids: Default::default(), + _compatibility: Default::default(), + _campaign_ids: Default::default(), + _audience_segment_ids: Default::default(), + _archived: Default::default(), + _advertiser_id: Default::default(), + _active: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one ad by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Ad ID. + pub fn get(&self, profile_id: &str, id: &str) -> AdGetCall<'a, C, A> { + AdGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing ad. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Ad, profile_id: &str) -> AdUpdateCall<'a, C, A> { + AdUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *accountPermission* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_permissions(); +/// # } +/// ``` +pub struct AccountPermissionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AccountPermissionMethods<'a, C, A> {} + +impl<'a, C, A> AccountPermissionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one account permission by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Account permission ID. + pub fn get(&self, profile_id: &str, id: &str) -> AccountPermissionGetCall<'a, C, A> { + AccountPermissionGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: 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 list of account permissions. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AccountPermissionListCall<'a, C, A> { + AccountPermissionListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *connectionType* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.connection_types(); +/// # } +/// ``` +pub struct ConnectionTypeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for ConnectionTypeMethods<'a, C, A> {} + +impl<'a, C, A> ConnectionTypeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of connection types. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> ConnectionTypeListCall<'a, C, A> { + ConnectionTypeListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one connection type by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Connection type ID. + pub fn get(&self, profile_id: &str, id: &str) -> ConnectionTypeGetCall<'a, C, A> { + ConnectionTypeGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *targetableRemarketingList* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.targetable_remarketing_lists(); +/// # } +/// ``` +pub struct TargetableRemarketingListMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for TargetableRemarketingListMethods<'a, C, A> {} + +impl<'a, C, A> TargetableRemarketingListMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `advertiserId` - Select only targetable remarketing lists targetable by these advertisers. + pub fn list(&self, profile_id: &str, advertiser_id: &str) -> TargetableRemarketingListListCall<'a, C, A> { + TargetableRemarketingListListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _advertiser_id: advertiser_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _page_token: Default::default(), + _name: Default::default(), + _max_results: Default::default(), + _active: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one remarketing list by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Remarketing list ID. + pub fn get(&self, profile_id: &str, id: &str) -> TargetableRemarketingListGetCall<'a, C, A> { + TargetableRemarketingListGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *advertiserGroup* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.advertiser_groups(); +/// # } +/// ``` +pub struct AdvertiserGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AdvertiserGroupMethods<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one advertiser group by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Advertiser group ID. + pub fn get(&self, profile_id: &str, id: &str) -> AdvertiserGroupGetCall<'a, C, A> { + AdvertiserGroupGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of advertiser groups, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AdvertiserGroupListCall<'a, C, A> { + AdvertiserGroupListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new advertiser group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: AdvertiserGroup, profile_id: &str) -> AdvertiserGroupInsertCall<'a, C, A> { + AdvertiserGroupInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing advertiser group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: AdvertiserGroup, profile_id: &str) -> AdvertiserGroupUpdateCall<'a, C, A> { + AdvertiserGroupUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing advertiser group. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Advertiser group ID. + pub fn patch(&self, request: AdvertiserGroup, profile_id: &str, id: &str) -> AdvertiserGroupPatchCall<'a, C, A> { + AdvertiserGroupPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.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 advertiser group. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Advertiser group ID. + pub fn delete(&self, profile_id: &str, id: &str) -> AdvertiserGroupDeleteCall<'a, C, A> { + AdvertiserGroupDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *site* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.sites(); +/// # } +/// ``` +pub struct SiteMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for SiteMethods<'a, C, A> {} + +impl<'a, C, A> SiteMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new site. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Site, profile_id: &str) -> SiteInsertCall<'a, C, A> { + SiteInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one site by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Site ID. + pub fn get(&self, profile_id: &str, id: &str) -> SiteGetCall<'a, C, A> { + SiteGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of sites, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> SiteListCall<'a, C, A> { + SiteListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _unmapped_site: Default::default(), + _subaccount_id: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _directory_site_ids: Default::default(), + _campaign_ids: Default::default(), + _approved: Default::default(), + _ad_words_site: Default::default(), + _accepts_publisher_paid_placements: Default::default(), + _accepts_interstitial_placements: Default::default(), + _accepts_in_stream_video_placements: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing site. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Site, profile_id: &str) -> SiteUpdateCall<'a, C, A> { + SiteUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing site. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Site ID. + pub fn patch(&self, request: Site, profile_id: &str, id: &str) -> SitePatchCall<'a, C, A> { + SitePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *floodlightActivity* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `generatetag(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.floodlight_activities(); +/// # } +/// ``` +pub struct FloodlightActivityMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for FloodlightActivityMethods<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one floodlight activity by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight activity ID. + pub fn get(&self, profile_id: &str, id: &str) -> FloodlightActivityGetCall<'a, C, A> { + FloodlightActivityGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of floodlight activities, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> FloodlightActivityListCall<'a, C, A> { + FloodlightActivityListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _tag_string: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _floodlight_configuration_id: Default::default(), + _floodlight_activity_group_type: Default::default(), + _floodlight_activity_group_tag_string: Default::default(), + _floodlight_activity_group_name: Default::default(), + _floodlight_activity_group_ids: Default::default(), + _advertiser_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new floodlight activity. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: FloodlightActivity, profile_id: &str) -> FloodlightActivityInsertCall<'a, C, A> { + FloodlightActivityInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.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 floodlight activity. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight activity ID. + pub fn delete(&self, profile_id: &str, id: &str) -> FloodlightActivityDeleteCall<'a, C, A> { + FloodlightActivityDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing floodlight activity. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight activity ID. + pub fn patch(&self, request: FloodlightActivity, profile_id: &str, id: &str) -> FloodlightActivityPatchCall<'a, C, A> { + FloodlightActivityPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Generates a tag for a floodlight activity. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn generatetag(&self, profile_id: &str) -> FloodlightActivityGeneratetagCall<'a, C, A> { + FloodlightActivityGeneratetagCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _floodlight_activity_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing floodlight activity. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: FloodlightActivity, profile_id: &str) -> FloodlightActivityUpdateCall<'a, C, A> { + FloodlightActivityUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *region* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.regions(); +/// # } +/// ``` +pub struct RegionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for RegionMethods<'a, C, A> {} + +impl<'a, C, A> RegionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of regions. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> RegionListCall<'a, C, A> { + RegionListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *creativeGroup* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.creative_groups(); +/// # } +/// ``` +pub struct CreativeGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CreativeGroupMethods<'a, C, A> {} + +impl<'a, C, A> CreativeGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new creative group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: CreativeGroup, profile_id: &str) -> CreativeGroupInsertCall<'a, C, A> { + CreativeGroupInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one creative group by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative group ID. + pub fn get(&self, profile_id: &str, id: &str) -> CreativeGroupGetCall<'a, C, A> { + CreativeGroupGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: CreativeGroup, profile_id: &str) -> CreativeGroupUpdateCall<'a, C, A> { + CreativeGroupUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of creative groups, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> CreativeGroupListCall<'a, C, A> { + CreativeGroupListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _group_number: Default::default(), + _advertiser_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative group. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative group ID. + pub fn patch(&self, request: CreativeGroup, profile_id: &str, id: &str) -> CreativeGroupPatchCall<'a, C, A> { + CreativeGroupPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *targetingTemplate* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.targeting_templates(); +/// # } +/// ``` +pub struct TargetingTemplateMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for TargetingTemplateMethods<'a, C, A> {} + +impl<'a, C, A> TargetingTemplateMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing targeting template. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Targeting template ID. + pub fn patch(&self, request: TargetingTemplate, profile_id: &str, id: &str) -> TargetingTemplatePatchCall<'a, C, A> { + TargetingTemplatePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of targeting templates, optionally filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> TargetingTemplateListCall<'a, C, A> { + TargetingTemplateListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _advertiser_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one targeting template by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Targeting template ID. + pub fn get(&self, profile_id: &str, id: &str) -> TargetingTemplateGetCall<'a, C, A> { + TargetingTemplateGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new targeting template. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: TargetingTemplate, profile_id: &str) -> TargetingTemplateInsertCall<'a, C, A> { + TargetingTemplateInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing targeting template. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: TargetingTemplate, profile_id: &str) -> TargetingTemplateUpdateCall<'a, C, A> { + TargetingTemplateUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *subaccount* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.subaccounts(); +/// # } +/// ``` +pub struct SubaccountMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for SubaccountMethods<'a, C, A> {} + +impl<'a, C, A> SubaccountMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing subaccount. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Subaccount ID. + pub fn patch(&self, request: Subaccount, profile_id: &str, id: &str) -> SubaccountPatchCall<'a, C, A> { + SubaccountPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new subaccount. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Subaccount, profile_id: &str) -> SubaccountInsertCall<'a, C, A> { + SubaccountInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing subaccount. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Subaccount, profile_id: &str) -> SubaccountUpdateCall<'a, C, A> { + SubaccountUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of subaccounts, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> SubaccountListCall<'a, C, A> { + SubaccountListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one subaccount by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Subaccount ID. + pub fn get(&self, profile_id: &str, id: &str) -> SubaccountGetCall<'a, C, A> { + SubaccountGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *mobileCarrier* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.mobile_carriers(); +/// # } +/// ``` +pub struct MobileCarrierMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for MobileCarrierMethods<'a, C, A> {} + +impl<'a, C, A> MobileCarrierMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one mobile carrier by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Mobile carrier ID. + pub fn get(&self, profile_id: &str, id: &str) -> MobileCarrierGetCall<'a, C, A> { + MobileCarrierGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of mobile carriers. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> MobileCarrierListCall<'a, C, A> { + MobileCarrierListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *floodlightConfiguration* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.floodlight_configurations(); +/// # } +/// ``` +pub struct FloodlightConfigurationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for FloodlightConfigurationMethods<'a, C, A> {} + +impl<'a, C, A> FloodlightConfigurationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one floodlight configuration by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight configuration ID. + pub fn get(&self, profile_id: &str, id: &str) -> FloodlightConfigurationGetCall<'a, C, A> { + FloodlightConfigurationGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing floodlight configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: FloodlightConfiguration, profile_id: &str) -> FloodlightConfigurationUpdateCall<'a, C, A> { + FloodlightConfigurationUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing floodlight configuration. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Floodlight configuration ID. + pub fn patch(&self, request: FloodlightConfiguration, profile_id: &str, id: &str) -> FloodlightConfigurationPatchCall<'a, C, A> { + FloodlightConfigurationPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of floodlight configurations, possibly filtered. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> FloodlightConfigurationListCall<'a, C, A> { + FloodlightConfigurationListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *operatingSystem* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.operating_systems(); +/// # } +/// ``` +pub struct OperatingSystemMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for OperatingSystemMethods<'a, C, A> {} + +impl<'a, C, A> OperatingSystemMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of operating systems. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> OperatingSystemListCall<'a, C, A> { + OperatingSystemListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one operating system by DART ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `dartId` - Operating system DART ID. + pub fn get(&self, profile_id: &str, dart_id: &str) -> OperatingSystemGetCall<'a, C, A> { + OperatingSystemGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _dart_id: dart_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *file* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.files(); +/// # } +/// ``` +pub struct FileMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for FileMethods<'a, C, A> {} + +impl<'a, C, A> FileMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists files for a user profile. + /// + /// # Arguments + /// + /// * `profileId` - The DFA profile ID. + pub fn list(&self, profile_id: &str) -> FileListCall<'a, C, A> { + FileListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _scope: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a report file by its report ID and file ID. This method supports media download. + /// + /// # Arguments + /// + /// * `reportId` - The ID of the report. + /// * `fileId` - The ID of the report file. + pub fn get(&self, report_id: &str, file_id: &str) -> FileGetCall<'a, C, A> { + FileGetCall { + hub: self.hub, + _report_id: report_id.to_string(), + _file_id: file_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *placementGroup* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.placement_groups(); +/// # } +/// ``` +pub struct PlacementGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for PlacementGroupMethods<'a, C, A> {} + +impl<'a, C, A> PlacementGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of placement groups, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> PlacementGroupListCall<'a, C, A> { + PlacementGroupListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _site_ids: Default::default(), + _search_string: Default::default(), + _pricing_types: Default::default(), + _placement_strategy_ids: Default::default(), + _placement_group_type: Default::default(), + _page_token: Default::default(), + _min_start_date: Default::default(), + _min_end_date: Default::default(), + _max_start_date: Default::default(), + _max_results: Default::default(), + _max_end_date: Default::default(), + _ids: Default::default(), + _directory_site_ids: Default::default(), + _content_category_ids: Default::default(), + _campaign_ids: Default::default(), + _archived: Default::default(), + _advertiser_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing placement group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: PlacementGroup, profile_id: &str) -> PlacementGroupUpdateCall<'a, C, A> { + PlacementGroupUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new placement group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: PlacementGroup, profile_id: &str) -> PlacementGroupInsertCall<'a, C, A> { + PlacementGroupInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one placement group by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement group ID. + pub fn get(&self, profile_id: &str, id: &str) -> PlacementGroupGetCall<'a, C, A> { + PlacementGroupGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing placement group. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement group ID. + pub fn patch(&self, request: PlacementGroup, profile_id: &str, id: &str) -> PlacementGroupPatchCall<'a, C, A> { + PlacementGroupPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *inventoryItem* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inventory_items(); +/// # } +/// ``` +pub struct InventoryItemMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for InventoryItemMethods<'a, C, A> {} + +impl<'a, C, A> InventoryItemMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of inventory items, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `projectId` - Project ID for order documents. + pub fn list(&self, profile_id: &str, project_id: &str) -> InventoryItemListCall<'a, C, A> { + InventoryItemListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _project_id: project_id.to_string(), + _type_: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _site_id: Default::default(), + _page_token: Default::default(), + _order_id: Default::default(), + _max_results: Default::default(), + _in_plan: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one inventory item by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `projectId` - Project ID for order documents. + /// * `id` - Inventory item ID. + pub fn get(&self, profile_id: &str, project_id: &str, id: &str) -> InventoryItemGetCall<'a, C, A> { + InventoryItemGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _project_id: project_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *userRolePermission* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_role_permissions(); +/// # } +/// ``` +pub struct UserRolePermissionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for UserRolePermissionMethods<'a, C, A> {} + +impl<'a, C, A> UserRolePermissionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one user role permission by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User role permission ID. + pub fn get(&self, profile_id: &str, id: &str) -> UserRolePermissionGetCall<'a, C, A> { + UserRolePermissionGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of user role permissions, possibly filtered. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> UserRolePermissionListCall<'a, C, A> { + UserRolePermissionListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *accountPermissionGroup* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_permission_groups(); +/// # } +/// ``` +pub struct AccountPermissionGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AccountPermissionGroupMethods<'a, C, A> {} + +impl<'a, C, A> AccountPermissionGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of account permission groups. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AccountPermissionGroupListCall<'a, C, A> { + AccountPermissionGroupListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one account permission group by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Account permission group ID. + pub fn get(&self, profile_id: &str, id: &str) -> AccountPermissionGroupGetCall<'a, C, A> { + AccountPermissionGroupGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *contentCategory* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.content_categories(); +/// # } +/// ``` +pub struct ContentCategoryMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for ContentCategoryMethods<'a, C, A> {} + +impl<'a, C, A> ContentCategoryMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of content categories, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> ContentCategoryListCall<'a, C, A> { + ContentCategoryListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing content category. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: ContentCategory, profile_id: &str) -> ContentCategoryUpdateCall<'a, C, A> { + ContentCategoryUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new content category. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: ContentCategory, profile_id: &str) -> ContentCategoryInsertCall<'a, C, A> { + ContentCategoryInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.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 content category. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Content category ID. + pub fn delete(&self, profile_id: &str, id: &str) -> ContentCategoryDeleteCall<'a, C, A> { + ContentCategoryDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one content category by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Content category ID. + pub fn get(&self, profile_id: &str, id: &str) -> ContentCategoryGetCall<'a, C, A> { + ContentCategoryGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing content category. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Content category ID. + pub fn patch(&self, request: ContentCategory, profile_id: &str, id: &str) -> ContentCategoryPatchCall<'a, C, A> { + ContentCategoryPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *creative* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.creatives(); +/// # } +/// ``` +pub struct CreativeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CreativeMethods<'a, C, A> {} + +impl<'a, C, A> CreativeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Creative, profile_id: &str) -> CreativeUpdateCall<'a, C, A> { + CreativeUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new creative. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Creative, profile_id: &str) -> CreativeInsertCall<'a, C, A> { + CreativeInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one creative by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative ID. + pub fn get(&self, profile_id: &str, id: &str) -> CreativeGetCall<'a, C, A> { + CreativeGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of creatives, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> CreativeListCall<'a, C, A> { + CreativeListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _types: Default::default(), + _studio_creative_id: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _size_ids: Default::default(), + _search_string: Default::default(), + _rendering_ids: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _creative_field_ids: Default::default(), + _companion_creative_ids: Default::default(), + _campaign_id: Default::default(), + _archived: Default::default(), + _advertiser_id: Default::default(), + _active: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Creative ID. + pub fn patch(&self, request: Creative, profile_id: &str, id: &str) -> CreativePatchCall<'a, C, A> { + CreativePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *campaign* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.campaigns(); +/// # } +/// ``` +pub struct CampaignMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CampaignMethods<'a, C, A> {} + +impl<'a, C, A> CampaignMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one campaign by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Campaign ID. + pub fn get(&self, profile_id: &str, id: &str) -> CampaignGetCall<'a, C, A> { + CampaignGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new campaign. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `defaultLandingPageName` - Default landing page name for this new campaign. Must be less than 256 characters long. + /// * `defaultLandingPageUrl` - Default landing page URL for this new campaign. + pub fn insert(&self, request: Campaign, profile_id: &str, default_landing_page_name: &str, default_landing_page_url: &str) -> CampaignInsertCall<'a, C, A> { + CampaignInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _default_landing_page_name: default_landing_page_name.to_string(), + _default_landing_page_url: default_landing_page_url.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing campaign. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Campaign ID. + pub fn patch(&self, request: Campaign, profile_id: &str, id: &str) -> CampaignPatchCall<'a, C, A> { + CampaignPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing campaign. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Campaign, profile_id: &str) -> CampaignUpdateCall<'a, C, A> { + CampaignUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of campaigns, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> CampaignListCall<'a, C, A> { + CampaignListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _subaccount_id: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _overridden_event_tag_id: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _excluded_ids: Default::default(), + _at_least_one_optimization_activity: Default::default(), + _archived: Default::default(), + _advertiser_ids: Default::default(), + _advertiser_group_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *eventTag* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.event_tags(); +/// # } +/// ``` +pub struct EventTagMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for EventTagMethods<'a, C, A> {} + +impl<'a, C, A> EventTagMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes an existing event tag. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Event tag ID. + pub fn delete(&self, profile_id: &str, id: &str) -> EventTagDeleteCall<'a, C, A> { + EventTagDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of event tags, possibly filtered. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> EventTagListCall<'a, C, A> { + EventTagListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _ids: Default::default(), + _event_tag_types: Default::default(), + _enabled: Default::default(), + _definitions_only: Default::default(), + _campaign_id: Default::default(), + _advertiser_id: Default::default(), + _ad_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new event tag. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: EventTag, profile_id: &str) -> EventTagInsertCall<'a, C, A> { + EventTagInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing event tag. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Event tag ID. + pub fn patch(&self, request: EventTag, profile_id: &str, id: &str) -> EventTagPatchCall<'a, C, A> { + EventTagPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing event tag. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: EventTag, profile_id: &str) -> EventTagUpdateCall<'a, C, A> { + EventTagUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one event tag by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Event tag ID. + pub fn get(&self, profile_id: &str, id: &str) -> EventTagGetCall<'a, C, A> { + EventTagGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *remarketingList* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.remarketing_lists(); +/// # } +/// ``` +pub struct RemarketingListMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for RemarketingListMethods<'a, C, A> {} + +impl<'a, C, A> RemarketingListMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one remarketing list by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Remarketing list ID. + pub fn get(&self, profile_id: &str, id: &str) -> RemarketingListGetCall<'a, C, A> { + RemarketingListGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing remarketing list. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: RemarketingList, profile_id: &str) -> RemarketingListUpdateCall<'a, C, A> { + RemarketingListUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of remarketing lists, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `advertiserId` - Select only remarketing lists owned by this advertiser. + pub fn list(&self, profile_id: &str, advertiser_id: &str) -> RemarketingListListCall<'a, C, A> { + RemarketingListListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _advertiser_id: advertiser_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _page_token: Default::default(), + _name: Default::default(), + _max_results: Default::default(), + _floodlight_activity_id: Default::default(), + _active: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing remarketing list. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Remarketing list ID. + pub fn patch(&self, request: RemarketingList, profile_id: &str, id: &str) -> RemarketingListPatchCall<'a, C, A> { + RemarketingListPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new remarketing list. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: RemarketingList, profile_id: &str) -> RemarketingListInsertCall<'a, C, A> { + RemarketingListInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *city* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.cities(); +/// # } +/// ``` +pub struct CityMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CityMethods<'a, C, A> {} + +impl<'a, C, A> CityMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of cities, possibly filtered. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> CityListCall<'a, C, A> { + CityListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _region_dart_ids: Default::default(), + _name_prefix: Default::default(), + _dart_ids: Default::default(), + _country_dart_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *placementStrategy* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placement_strategies(); +/// # } +/// ``` +pub struct PlacementStrategyMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for PlacementStrategyMethods<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing placement strategy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: PlacementStrategy, profile_id: &str) -> PlacementStrategyUpdateCall<'a, C, A> { + PlacementStrategyUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one placement strategy by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement strategy ID. + pub fn get(&self, profile_id: &str, id: &str) -> PlacementStrategyGetCall<'a, C, A> { + PlacementStrategyGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of placement strategies, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> PlacementStrategyListCall<'a, C, A> { + PlacementStrategyListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an existing placement strategy. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement strategy ID. + pub fn delete(&self, profile_id: &str, id: &str) -> PlacementStrategyDeleteCall<'a, C, A> { + PlacementStrategyDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new placement strategy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: PlacementStrategy, profile_id: &str) -> PlacementStrategyInsertCall<'a, C, A> { + PlacementStrategyInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing placement strategy. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement strategy ID. + pub fn patch(&self, request: PlacementStrategy, profile_id: &str, id: &str) -> PlacementStrategyPatchCall<'a, C, A> { + PlacementStrategyPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +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: + /// + /// Retrieves a list of projects, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> ProjectListCall<'a, C, A> { + ProjectListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _advertiser_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one project by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Project ID. + pub fn get(&self, profile_id: &str, id: &str) -> ProjectGetCall<'a, C, A> { + ProjectGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *directorySite* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.directory_sites(); +/// # } +/// ``` +pub struct DirectorySiteMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for DirectorySiteMethods<'a, C, A> {} + +impl<'a, C, A> DirectorySiteMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new directory site. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: DirectorySite, profile_id: &str) -> DirectorySiteInsertCall<'a, C, A> { + DirectorySiteInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of directory sites, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> DirectorySiteListCall<'a, C, A> { + DirectorySiteListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _parent_id: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _dfp_network_code: Default::default(), + _country_id: Default::default(), + _active: Default::default(), + _accepts_publisher_paid_placements: Default::default(), + _accepts_interstitial_placements: Default::default(), + _accepts_in_stream_video_placements: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one directory site by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Directory site ID. + pub fn get(&self, profile_id: &str, id: &str) -> DirectorySiteGetCall<'a, C, A> { + DirectorySiteGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *videoFormat* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.video_formats(); +/// # } +/// ``` +pub struct VideoFormatMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for VideoFormatMethods<'a, C, A> {} + +impl<'a, C, A> VideoFormatMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one video format by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Video format ID. + pub fn get(&self, profile_id: &str, id: i32) -> VideoFormatGetCall<'a, C, A> { + VideoFormatGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists available video formats. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> VideoFormatListCall<'a, C, A> { + VideoFormatListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *dynamicTargetingKey* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.dynamic_targeting_keys(); +/// # } +/// ``` +pub struct DynamicTargetingKeyMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for DynamicTargetingKeyMethods<'a, C, A> {} + +impl<'a, C, A> DynamicTargetingKeyMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes an existing dynamic targeting key. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `objectId` - ID of the object of this dynamic targeting key. This is a required field. + /// * `name` - Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + /// * `objectType` - Type of the object of this dynamic targeting key. This is a required field. + pub fn delete(&self, profile_id: &str, object_id: &str, name: &str, object_type: &str) -> DynamicTargetingKeyDeleteCall<'a, C, A> { + DynamicTargetingKeyDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _object_id: object_id.to_string(), + _name: name.to_string(), + _object_type: object_type.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of dynamic targeting keys. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> DynamicTargetingKeyListCall<'a, C, A> { + DynamicTargetingKeyListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _object_type: Default::default(), + _object_id: Default::default(), + _names: Default::default(), + _advertiser_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: DynamicTargetingKey, profile_id: &str) -> DynamicTargetingKeyInsertCall<'a, C, A> { + DynamicTargetingKeyInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *size* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.sizes(); +/// # } +/// ``` +pub struct SizeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for SizeMethods<'a, C, A> {} + +impl<'a, C, A> SizeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new size. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Size, profile_id: &str) -> SizeInsertCall<'a, C, A> { + SizeInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of sizes, possibly filtered. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> SizeListCall<'a, C, A> { + SizeListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _width: Default::default(), + _ids: Default::default(), + _iab_standard: Default::default(), + _height: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one size by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Size ID. + pub fn get(&self, profile_id: &str, id: &str) -> SizeGetCall<'a, C, A> { + SizeGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *accountActiveAdSummary* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` +/// // to build up your call. +/// let rb = hub.account_active_ad_summaries(); +/// # } +/// ``` +pub struct AccountActiveAdSummaryMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AccountActiveAdSummaryMethods<'a, C, A> {} + +impl<'a, C, A> AccountActiveAdSummaryMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets the account's active ad summary by account ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `summaryAccountId` - Account ID. + pub fn get(&self, profile_id: &str, summary_account_id: &str) -> AccountActiveAdSummaryGetCall<'a, C, A> { + AccountActiveAdSummaryGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _summary_account_id: summary_account_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *accountUserProfile* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.account_user_profiles(); +/// # } +/// ``` +pub struct AccountUserProfileMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AccountUserProfileMethods<'a, C, A> {} + +impl<'a, C, A> AccountUserProfileMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing account user profile. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: AccountUserProfile, profile_id: &str) -> AccountUserProfileUpdateCall<'a, C, A> { + AccountUserProfileUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of account user profiles, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AccountUserProfileListCall<'a, C, A> { + AccountUserProfileListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _user_role_id: Default::default(), + _subaccount_id: Default::default(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _active: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new account user profile. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: AccountUserProfile, profile_id: &str) -> AccountUserProfileInsertCall<'a, C, A> { + AccountUserProfileInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing account user profile. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User profile ID. + pub fn patch(&self, request: AccountUserProfile, profile_id: &str, id: &str) -> AccountUserProfilePatchCall<'a, C, A> { + AccountUserProfilePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one account user profile by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - User profile ID. + pub fn get(&self, profile_id: &str, id: &str) -> AccountUserProfileGetCall<'a, C, A> { + AccountUserProfileGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *country* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.countries(); +/// # } +/// ``` +pub struct CountryMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CountryMethods<'a, C, A> {} + +impl<'a, C, A> CountryMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of countries. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> CountryListCall<'a, C, A> { + CountryListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one country by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `dartId` - Country DART ID. + pub fn get(&self, profile_id: &str, dart_id: &str) -> CountryGetCall<'a, C, A> { + CountryGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _dart_id: dart_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *creativeFieldValue* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_field_values(); +/// # } +/// ``` +pub struct CreativeFieldValueMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for CreativeFieldValueMethods<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValueMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative field value. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `creativeFieldId` - Creative field ID for this creative field value. + /// * `id` - Creative Field Value ID + pub fn patch(&self, request: CreativeFieldValue, profile_id: &str, creative_field_id: &str, id: &str) -> CreativeFieldValuePatchCall<'a, C, A> { + CreativeFieldValuePatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _creative_field_id: creative_field_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one creative field value by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `creativeFieldId` - Creative field ID for this creative field value. + /// * `id` - Creative Field Value ID + pub fn get(&self, profile_id: &str, creative_field_id: &str, id: &str) -> CreativeFieldValueGetCall<'a, C, A> { + CreativeFieldValueGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _creative_field_id: creative_field_id.to_string(), + _id: id.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 creative field value. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `creativeFieldId` - Creative field ID for this creative field value. + /// * `id` - Creative Field Value ID + pub fn delete(&self, profile_id: &str, creative_field_id: &str, id: &str) -> CreativeFieldValueDeleteCall<'a, C, A> { + CreativeFieldValueDeleteCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _creative_field_id: creative_field_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new creative field value. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `creativeFieldId` - Creative field ID for this creative field value. + pub fn insert(&self, request: CreativeFieldValue, profile_id: &str, creative_field_id: &str) -> CreativeFieldValueInsertCall<'a, C, A> { + CreativeFieldValueInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _creative_field_id: creative_field_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing creative field value. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `creativeFieldId` - Creative field ID for this creative field value. + pub fn update(&self, request: CreativeFieldValue, profile_id: &str, creative_field_id: &str) -> CreativeFieldValueUpdateCall<'a, C, A> { + CreativeFieldValueUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _creative_field_id: creative_field_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of creative field values, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `creativeFieldId` - Creative field ID for this creative field value. + pub fn list(&self, profile_id: &str, creative_field_id: &str) -> CreativeFieldValueListCall<'a, C, A> { + CreativeFieldValueListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _creative_field_id: creative_field_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *postalCode* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.postal_codes(); +/// # } +/// ``` +pub struct PostalCodeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for PostalCodeMethods<'a, C, A> {} + +impl<'a, C, A> PostalCodeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one postal code by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `code` - Postal code ID. + pub fn get(&self, profile_id: &str, code: &str) -> PostalCodeGetCall<'a, C, A> { + PostalCodeGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _code: code.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of postal codes. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> PostalCodeListCall<'a, C, A> { + PostalCodeListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *browser* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.browsers(); +/// # } +/// ``` +pub struct BrowserMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for BrowserMethods<'a, C, A> {} + +impl<'a, C, A> BrowserMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of browsers. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> BrowserListCall<'a, C, A> { + BrowserListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *account* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.accounts(); +/// # } +/// ``` +pub struct AccountMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AccountMethods<'a, C, A> {} + +impl<'a, C, A> AccountMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets one account by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Account ID. + pub fn get(&self, profile_id: &str, id: &str) -> AccountGetCall<'a, C, A> { + AccountGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: 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 list of accounts, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AccountListCall<'a, C, A> { + AccountListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _search_string: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _ids: Default::default(), + _active: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing account. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Account, profile_id: &str) -> AccountUpdateCall<'a, C, A> { + AccountUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing account. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Account ID. + pub fn patch(&self, request: Account, profile_id: &str, id: &str) -> AccountPatchCall<'a, C, A> { + AccountPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *placement* resources. +/// It is not used directly, but through the `Dfareporting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dfareporting2d8 as dfareporting2d8; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting2d8::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `generatetags(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.placements(); +/// # } +/// ``` +pub struct PlacementMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for PlacementMethods<'a, C, A> {} + +impl<'a, C, A> PlacementMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing placement. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement ID. + pub fn patch(&self, request: Placement, profile_id: &str, id: &str) -> PlacementPatchCall<'a, C, A> { + PlacementPatchCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of placements, possibly filtered. This method supports paging. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> PlacementListCall<'a, C, A> { + PlacementListCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _sort_order: Default::default(), + _sort_field: Default::default(), + _size_ids: Default::default(), + _site_ids: Default::default(), + _search_string: Default::default(), + _pricing_types: Default::default(), + _placement_strategy_ids: Default::default(), + _payment_source: Default::default(), + _page_token: Default::default(), + _min_start_date: Default::default(), + _min_end_date: Default::default(), + _max_start_date: Default::default(), + _max_results: Default::default(), + _max_end_date: Default::default(), + _ids: Default::default(), + _group_ids: Default::default(), + _directory_site_ids: Default::default(), + _content_category_ids: Default::default(), + _compatibilities: Default::default(), + _campaign_ids: Default::default(), + _archived: Default::default(), + _advertiser_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets one placement by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Placement ID. + pub fn get(&self, profile_id: &str, id: &str) -> PlacementGetCall<'a, C, A> { + PlacementGetCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new placement. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: Placement, profile_id: &str) -> PlacementInsertCall<'a, C, A> { + PlacementInsertCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an existing placement. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: Placement, profile_id: &str) -> PlacementUpdateCall<'a, C, A> { + PlacementUpdateCall { + hub: self.hub, + _request: request, + _profile_id: profile_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Generates tags for a placement. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn generatetags(&self, profile_id: &str) -> PlacementGeneratetagCall<'a, C, A> { + PlacementGeneratetagCall { + hub: self.hub, + _profile_id: profile_id.to_string(), + _tag_formats: Default::default(), + _placement_ids: Default::default(), + _campaign_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Updates existing conversions. +/// +/// A builder for the *batchupdate* method supported by a *conversion* resource. +/// It is not used directly, but through a `ConversionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::ConversionsBatchUpdateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ConversionsBatchUpdateRequest::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.conversions().batchupdate(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct ConversionBatchupdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: ConversionsBatchUpdateRequest, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ConversionBatchupdateCall<'a, C, A> {} + +impl<'a, C, A> ConversionBatchupdateCall<'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, ConversionsBatchUpdateResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.conversions.batchupdate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/conversions/batchupdate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ddmconversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ConversionsBatchUpdateRequest) -> ConversionBatchupdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ConversionBatchupdateCall<'a, C, A> { + self._profile_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) -> ConversionBatchupdateCall<'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) -> ConversionBatchupdateCall<'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::Ddmconversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ConversionBatchupdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts conversions. +/// +/// A builder for the *batchinsert* method supported by a *conversion* resource. +/// It is not used directly, but through a `ConversionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::ConversionsBatchInsertRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ConversionsBatchInsertRequest::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.conversions().batchinsert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct ConversionBatchinsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: ConversionsBatchInsertRequest, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ConversionBatchinsertCall<'a, C, A> {} + +impl<'a, C, A> ConversionBatchinsertCall<'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, ConversionsBatchInsertResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.conversions.batchinsert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/conversions/batchinsert"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ddmconversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ConversionsBatchInsertRequest) -> ConversionBatchinsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ConversionBatchinsertCall<'a, C, A> { + self._profile_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) -> ConversionBatchinsertCall<'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) -> ConversionBatchinsertCall<'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::Ddmconversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ConversionBatchinsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one user role permission group by ID. +/// +/// A builder for the *get* method supported by a *userRolePermissionGroup* resource. +/// It is not used directly, but through a `UserRolePermissionGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_role_permission_groups().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserRolePermissionGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRolePermissionGroupGetCall<'a, C, A> {} + +impl<'a, C, A> UserRolePermissionGroupGetCall<'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, UserRolePermissionGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRolePermissionGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRolePermissionGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRolePermissionGroupGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User role permission group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> UserRolePermissionGroupGetCall<'a, C, A> { + self._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) -> UserRolePermissionGroupGetCall<'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) -> UserRolePermissionGroupGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRolePermissionGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a list of all supported user role permission groups. +/// +/// A builder for the *list* method supported by a *userRolePermissionGroup* resource. +/// It is not used directly, but through a `UserRolePermissionGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_role_permission_groups().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct UserRolePermissionGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRolePermissionGroupListCall<'a, C, A> {} + +impl<'a, C, A> UserRolePermissionGroupListCall<'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, UserRolePermissionGroupsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRolePermissionGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRolePermissionGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRolePermissionGroupListCall<'a, C, A> { + self._profile_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) -> UserRolePermissionGroupListCall<'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) -> UserRolePermissionGroupListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRolePermissionGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one platform type by ID. +/// +/// A builder for the *get* method supported by a *platformType* resource. +/// It is not used directly, but through a `PlatformTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.platform_types().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlatformTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlatformTypeGetCall<'a, C, A> {} + +impl<'a, C, A> PlatformTypeGetCall<'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, PlatformType)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.platformTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlatformTypeGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Platform type ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> PlatformTypeGetCall<'a, C, A> { + self._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) -> PlatformTypeGetCall<'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) -> PlatformTypeGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlatformTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of platform types. +/// +/// A builder for the *list* method supported by a *platformType* resource. +/// It is not used directly, but through a `PlatformTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.platform_types().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlatformTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlatformTypeListCall<'a, C, A> {} + +impl<'a, C, A> PlatformTypeListCall<'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, PlatformTypesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.platformTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlatformTypeListCall<'a, C, A> { + self._profile_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) -> PlatformTypeListCall<'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) -> PlatformTypeListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlatformTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one order document by ID. +/// +/// A builder for the *get* method supported by a *orderDocument* resource. +/// It is not used directly, but through a `OrderDocumentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.order_documents().get("profileId", "projectId", "id") +/// .doit(); +/// # } +/// ``` +pub struct OrderDocumentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _project_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderDocumentGetCall<'a, C, A> {} + +impl<'a, C, A> OrderDocumentGetCall<'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, OrderDocument)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.orderDocuments.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("projectId", self._project_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "projectId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{projectId}", "projectId"), ("{id}", "id")].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 ["id", "projectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OrderDocumentGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID for order documents. + /// + /// 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) -> OrderDocumentGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Order document ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> OrderDocumentGetCall<'a, C, A> { + self._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) -> OrderDocumentGetCall<'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) -> OrderDocumentGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrderDocumentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of order documents, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *orderDocument* resource. +/// It is not used directly, but through a `OrderDocumentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.order_documents().list("profileId", "projectId") +/// .sort_order("sea") +/// .sort_field("Lorem") +/// .add_site_id("eos") +/// .search_string("erat") +/// .page_token("sadipscing") +/// .add_order_id("dolor") +/// .max_results(-39) +/// .add_ids("elitr") +/// .approved(false) +/// .doit(); +/// # } +/// ``` +pub struct OrderDocumentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _project_id: String, + _sort_order: Option, + _sort_field: Option, + _site_id: Vec, + _search_string: Option, + _page_token: Option, + _order_id: Vec, + _max_results: Option, + _ids: Vec, + _approved: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderDocumentListCall<'a, C, A> {} + +impl<'a, C, A> OrderDocumentListCall<'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, OrderDocumentsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.orderDocuments.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("projectId", self._project_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._site_id.len() > 0 { + for f in self._site_id.iter() { + params.push(("siteId", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if self._order_id.len() > 0 { + for f in self._order_id.iter() { + params.push(("orderId", f.to_string())); + } + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._approved { + params.push(("approved", value.to_string())); + } + for &field in ["alt", "profileId", "projectId", "sortOrder", "sortField", "siteId", "searchString", "pageToken", "orderId", "maxResults", "ids", "approved"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{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(2); + for param_name in ["projectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID for order documents. + /// + /// 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) -> OrderDocumentListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only order documents that are associated with these sites. + /// + /// Append the given value to the *site id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_site_id(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._site_id.push(new_value.to_string()); + self + } + /// Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only order documents for specified orders. + /// + /// Append the given value to the *order id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_order_id(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._order_id.push(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> OrderDocumentListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only order documents with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> OrderDocumentListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only order documents that have been approved by at least one user. + /// + /// Sets the *approved* query property to the given value. + pub fn approved(mut self, new_value: bool) -> OrderDocumentListCall<'a, C, A> { + self._approved = 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) -> OrderDocumentListCall<'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) -> OrderDocumentListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrderDocumentListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative field. +/// +/// A builder for the *update* method supported by a *creativeField* resource. +/// It is not used directly, but through a `CreativeFieldMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeField; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeField::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.creative_fields().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeField, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldUpdateCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldUpdateCall<'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, CreativeField)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFields.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeField) -> CreativeFieldUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldUpdateCall<'a, C, A> { + self._profile_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) -> CreativeFieldUpdateCall<'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) -> CreativeFieldUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of creative fields, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *creativeField* resource. +/// It is not used directly, but through a `CreativeFieldMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_fields().list("profileId") +/// .sort_order("eirmod") +/// .sort_field("dolore") +/// .search_string("invidunt") +/// .page_token("aliquyam") +/// .max_results(-73) +/// .add_ids("Lorem") +/// .add_advertiser_ids("sea") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _advertiser_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldListCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldListCall<'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, CreativeFieldsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFields.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._advertiser_ids.len() > 0 { + for f in self._advertiser_ids.iter() { + params.push(("advertiserIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "advertiserIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> CreativeFieldListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only creative fields with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only creative fields that belong to these advertisers. + /// + /// Append the given value to the *advertiser ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_ids(mut self, new_value: &str) -> CreativeFieldListCall<'a, C, A> { + self._advertiser_ids.push(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) -> CreativeFieldListCall<'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) -> CreativeFieldListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing creative field. +/// +/// A builder for the *delete* method supported by a *creativeField* resource. +/// It is not used directly, but through a `CreativeFieldMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_fields().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldDeleteCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFields.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative Field ID + /// + /// Sets the *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 id(mut self, new_value: &str) -> CreativeFieldDeleteCall<'a, C, A> { + self._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) -> CreativeFieldDeleteCall<'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) -> CreativeFieldDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one creative field by ID. +/// +/// A builder for the *get* method supported by a *creativeField* resource. +/// It is not used directly, but through a `CreativeFieldMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_fields().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldGetCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldGetCall<'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, CreativeField)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFields.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative Field ID + /// + /// Sets the *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 id(mut self, new_value: &str) -> CreativeFieldGetCall<'a, C, A> { + self._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) -> CreativeFieldGetCall<'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) -> CreativeFieldGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new creative field. +/// +/// A builder for the *insert* method supported by a *creativeField* resource. +/// It is not used directly, but through a `CreativeFieldMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeField; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeField::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.creative_fields().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeField, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldInsertCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldInsertCall<'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, CreativeField)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFields.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeField) -> CreativeFieldInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldInsertCall<'a, C, A> { + self._profile_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) -> CreativeFieldInsertCall<'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) -> CreativeFieldInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative field. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *creativeField* resource. +/// It is not used directly, but through a `CreativeFieldMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeField; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeField::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.creative_fields().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeField, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldPatchCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldPatchCall<'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, CreativeField)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFields.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeField) -> CreativeFieldPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative Field ID + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> CreativeFieldPatchCall<'a, C, A> { + self._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) -> CreativeFieldPatchCall<'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) -> CreativeFieldPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new user role. +/// +/// A builder for the *insert* method supported by a *userRole* resource. +/// It is not used directly, but through a `UserRoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::UserRole; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UserRole::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.user_roles().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct UserRoleInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: UserRole, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRoleInsertCall<'a, C, A> {} + +impl<'a, C, A> UserRoleInsertCall<'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, UserRole)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRoles.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UserRole) -> UserRoleInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRoleInsertCall<'a, C, A> { + self._profile_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) -> UserRoleInsertCall<'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) -> UserRoleInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRoleInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one user role by ID. +/// +/// A builder for the *get* method supported by a *userRole* resource. +/// It is not used directly, but through a `UserRoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_roles().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserRoleGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRoleGetCall<'a, C, A> {} + +impl<'a, C, A> UserRoleGetCall<'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, UserRole)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRoles.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRoleGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User role ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> UserRoleGetCall<'a, C, A> { + self._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) -> UserRoleGetCall<'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) -> UserRoleGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRoleGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing user role. +/// +/// A builder for the *update* method supported by a *userRole* resource. +/// It is not used directly, but through a `UserRoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::UserRole; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UserRole::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.user_roles().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct UserRoleUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: UserRole, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRoleUpdateCall<'a, C, A> {} + +impl<'a, C, A> UserRoleUpdateCall<'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, UserRole)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRoles.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UserRole) -> UserRoleUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRoleUpdateCall<'a, C, A> { + self._profile_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) -> UserRoleUpdateCall<'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) -> UserRoleUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRoleUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing user role. +/// +/// A builder for the *delete* method supported by a *userRole* resource. +/// It is not used directly, but through a `UserRoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_roles().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserRoleDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRoleDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserRoleDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRoles.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRoleDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User role ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> UserRoleDeleteCall<'a, C, A> { + self._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) -> UserRoleDeleteCall<'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) -> UserRoleDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRoleDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing user role. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *userRole* resource. +/// It is not used directly, but through a `UserRoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::UserRole; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UserRole::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.user_roles().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserRolePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: UserRole, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRolePatchCall<'a, C, A> {} + +impl<'a, C, A> UserRolePatchCall<'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, UserRole)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRoles.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UserRole) -> UserRolePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRolePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User role ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> UserRolePatchCall<'a, C, A> { + self._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) -> UserRolePatchCall<'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) -> UserRolePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRolePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of user roles, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *userRole* resource. +/// It is not used directly, but through a `UserRoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_roles().list("profileId") +/// .subaccount_id("consetetur") +/// .sort_order("amet.") +/// .sort_field("voluptua.") +/// .search_string("Lorem") +/// .page_token("gubergren") +/// .max_results(-20) +/// .add_ids("sit") +/// .account_user_role_only(true) +/// .doit(); +/// # } +/// ``` +pub struct UserRoleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _subaccount_id: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _account_user_role_only: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRoleListCall<'a, C, A> {} + +impl<'a, C, A> UserRoleListCall<'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, UserRolesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRoles.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._subaccount_id { + params.push(("subaccountId", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._account_user_role_only { + params.push(("accountUserRoleOnly", value.to_string())); + } + for &field in ["alt", "profileId", "subaccountId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "accountUserRoleOnly"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only user roles that belong to this subaccount. + /// + /// Sets the *subaccount id* query property to the given value. + pub fn subaccount_id(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._subaccount_id = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> UserRoleListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only user roles with the specified IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> UserRoleListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only account level user roles not associated with any specific subaccount. + /// + /// Sets the *account user role only* query property to the given value. + pub fn account_user_role_only(mut self, new_value: bool) -> UserRoleListCall<'a, C, A> { + self._account_user_role_only = 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) -> UserRoleListCall<'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) -> UserRoleListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRoleListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one operating system version by ID. +/// +/// A builder for the *get* method supported by a *operatingSystemVersion* resource. +/// It is not used directly, but through a `OperatingSystemVersionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.operating_system_versions().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct OperatingSystemVersionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperatingSystemVersionGetCall<'a, C, A> {} + +impl<'a, C, A> OperatingSystemVersionGetCall<'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, OperatingSystemVersion)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.operatingSystemVersions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/operatingSystemVersions/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OperatingSystemVersionGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Operating system version ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> OperatingSystemVersionGetCall<'a, C, A> { + self._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) -> OperatingSystemVersionGetCall<'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) -> OperatingSystemVersionGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OperatingSystemVersionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of operating system versions. +/// +/// A builder for the *list* method supported by a *operatingSystemVersion* resource. +/// It is not used directly, but through a `OperatingSystemVersionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.operating_system_versions().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct OperatingSystemVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperatingSystemVersionListCall<'a, C, A> {} + +impl<'a, C, A> OperatingSystemVersionListCall<'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, OperatingSystemVersionsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.operatingSystemVersions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/operatingSystemVersions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OperatingSystemVersionListCall<'a, C, A> { + self._profile_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) -> OperatingSystemVersionListCall<'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) -> OperatingSystemVersionListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OperatingSystemVersionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one campaign landing page by ID. +/// +/// A builder for the *get* method supported by a *landingPage* resource. +/// It is not used directly, but through a `LandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.landing_pages().get("profileId", "campaignId", "id") +/// .doit(); +/// # } +/// ``` +pub struct LandingPageGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _campaign_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LandingPageGetCall<'a, C, A> {} + +impl<'a, C, A> LandingPageGetCall<'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, LandingPage)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.landingPages.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "campaignId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId"), ("{id}", "id")].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 ["id", "campaignId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LandingPageGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Landing page campaign ID. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> LandingPageGetCall<'a, C, A> { + self._campaign_id = new_value.to_string(); + self + } + /// Landing page ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> LandingPageGetCall<'a, C, A> { + self._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) -> LandingPageGetCall<'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) -> LandingPageGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LandingPageGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing campaign landing page. +/// +/// A builder for the *update* method supported by a *landingPage* resource. +/// It is not used directly, but through a `LandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::LandingPage; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LandingPage::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.landing_pages().update(req, "profileId", "campaignId") +/// .doit(); +/// # } +/// ``` +pub struct LandingPageUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: LandingPage, + _profile_id: String, + _campaign_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LandingPageUpdateCall<'a, C, A> {} + +impl<'a, C, A> LandingPageUpdateCall<'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, LandingPage)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.landingPages.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + for &field in ["alt", "profileId", "campaignId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId")].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 ["campaignId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LandingPage) -> LandingPageUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LandingPageUpdateCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Landing page campaign ID. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> LandingPageUpdateCall<'a, C, A> { + self._campaign_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) -> LandingPageUpdateCall<'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) -> LandingPageUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LandingPageUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of landing pages for the specified campaign. +/// +/// A builder for the *list* method supported by a *landingPage* resource. +/// It is not used directly, but through a `LandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.landing_pages().list("profileId", "campaignId") +/// .doit(); +/// # } +/// ``` +pub struct LandingPageListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _campaign_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LandingPageListCall<'a, C, A> {} + +impl<'a, C, A> LandingPageListCall<'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, LandingPagesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.landingPages.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + for &field in ["alt", "profileId", "campaignId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId")].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 ["campaignId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LandingPageListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Landing page campaign ID. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> LandingPageListCall<'a, C, A> { + self._campaign_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) -> LandingPageListCall<'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) -> LandingPageListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LandingPageListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new landing page for the specified campaign. +/// +/// A builder for the *insert* method supported by a *landingPage* resource. +/// It is not used directly, but through a `LandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::LandingPage; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LandingPage::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.landing_pages().insert(req, "profileId", "campaignId") +/// .doit(); +/// # } +/// ``` +pub struct LandingPageInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: LandingPage, + _profile_id: String, + _campaign_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LandingPageInsertCall<'a, C, A> {} + +impl<'a, C, A> LandingPageInsertCall<'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, LandingPage)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.landingPages.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + for &field in ["alt", "profileId", "campaignId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId")].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 ["campaignId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LandingPage) -> LandingPageInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LandingPageInsertCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Landing page campaign ID. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> LandingPageInsertCall<'a, C, A> { + self._campaign_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) -> LandingPageInsertCall<'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) -> LandingPageInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LandingPageInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing campaign landing page. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *landingPage* resource. +/// It is not used directly, but through a `LandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::LandingPage; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LandingPage::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.landing_pages().patch(req, "profileId", "campaignId", "id") +/// .doit(); +/// # } +/// ``` +pub struct LandingPagePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: LandingPage, + _profile_id: String, + _campaign_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LandingPagePatchCall<'a, C, A> {} + +impl<'a, C, A> LandingPagePatchCall<'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, LandingPage)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.landingPages.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "campaignId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId")].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 ["campaignId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LandingPage) -> LandingPagePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LandingPagePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Landing page campaign ID. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> LandingPagePatchCall<'a, C, A> { + self._campaign_id = new_value.to_string(); + self + } + /// Landing page ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> LandingPagePatchCall<'a, C, A> { + self._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) -> LandingPagePatchCall<'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) -> LandingPagePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LandingPagePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing campaign landing page. +/// +/// A builder for the *delete* method supported by a *landingPage* resource. +/// It is not used directly, but through a `LandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.landing_pages().delete("profileId", "campaignId", "id") +/// .doit(); +/// # } +/// ``` +pub struct LandingPageDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _campaign_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LandingPageDeleteCall<'a, C, A> {} + +impl<'a, C, A> LandingPageDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.landingPages.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "campaignId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId"), ("{id}", "id")].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 ["id", "campaignId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LandingPageDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Landing page campaign ID. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> LandingPageDeleteCall<'a, C, A> { + self._campaign_id = new_value.to_string(); + self + } + /// Landing page ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> LandingPageDeleteCall<'a, C, A> { + self._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) -> LandingPageDeleteCall<'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) -> LandingPageDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LandingPageDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new creative asset. +/// +/// A builder for the *insert* method supported by a *creativeAsset* resource. +/// It is not used directly, but through a `CreativeAssetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeAssetMetadata; +/// use std::fs; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeAssetMetadata::default(); +/// +/// // 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.creative_assets().insert(req, "profileId", "advertiserId") +/// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +/// # } +/// ``` +pub struct CreativeAssetInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeAssetMetadata, + _profile_id: String, + _advertiser_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeAssetInsertCall<'a, C, A> {} + +impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + fn doit(mut self, mut reader: RS, reader_mime_type: mime::Mime, protocol: &'static str) -> Result<(hyper::client::Response, CreativeAssetMetadata)> + where RS: ReadSeek { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeAssets.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("advertiserId", self._advertiser_id.to_string())); + for &field in ["alt", "profileId", "advertiserId"].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, upload_type) = + if protocol == "simple" { + (self.hub._root_url.clone() + "upload/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", "multipart") + } else if protocol == "resumable" { + (self.hub._root_url.clone() + "resumable/upload/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", "resumable") + } else { + unreachable!() + }; + params.push(("uploadType", upload_type.to_string())); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{advertiserId}", "advertiserId")].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 ["advertiserId", "profileId"].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).expect("serde to work"); + 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(); + + let mut should_ask_dlg_for_url = false; + let mut upload_url_from_server; + let mut upload_url: Option = None; + + 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(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + if should_ask_dlg_for_url && (upload_url = dlg.upload_url()) == () && upload_url.is_some() { + should_ask_dlg_for_url = false; + upload_url_from_server = false; + let url = upload_url.as_ref().and_then(|s| Some(hyper::Url::parse(s).unwrap())).unwrap(); + hyper::client::Response::new(url, Box::new(cmn::DummyNetworkStream)).and_then(|mut res| { + res.status = hyper::status::StatusCode::Ok; + res.headers.set(Location(upload_url.as_ref().unwrap().clone())); + Ok(res) + }) + } else { + let mut mp_reader: MultiPartReader = Default::default(); + let (mut body_reader, content_type) = match protocol { + "simple" => { + mp_reader.reserve_exact(2); + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 1073741824 { + return Err(Error::UploadSizeLimitExceeded(size, 1073741824)) + } + mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) + .add_part(&mut reader, size, reader_mime_type.clone()); + let mime_type = mp_reader.mime_type(); + (&mut mp_reader as &mut io::Read, ContentType(mime_type)) + }, + _ => (&mut request_value_reader as &mut io::Read, ContentType(json_mime_type.clone())), + }; + 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(content_type) + .body(&mut body_reader); + upload_url_from_server = true; + if protocol == "resumable" { + req = req.header(cmn::XUploadContentType(reader_mime_type.clone())); + } + + dlg.pre_request(); + req.send() + } + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + if protocol == "resumable" { + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 1073741824 { + return Err(Error::UploadSizeLimitExceeded(size, 1073741824)) + } + let mut client = &mut *self.hub.client.borrow_mut(); + let upload_result = { + let url_str = &res.headers.get::().expect("Location header is part of protocol").0; + if upload_url_from_server { + dlg.store_upload_url(Some(url_str)); + } + + cmn::ResumableUploadHelper { + client: &mut client.borrow_mut(), + delegate: dlg, + start_at: if upload_url_from_server { Some(0) } else { None }, + auth: &mut *self.hub.auth.borrow_mut(), + user_agent: &self.hub._user_agent, + auth_header: auth_header.clone(), + url: url_str, + reader: &mut reader, + media_type: reader_mime_type.clone(), + content_length: size + }.upload() + }; + match upload_result { + None => { + dlg.finished(false); + return Err(Error::Cancelled) + } + Some(Err(err)) => { + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Some(Ok(upload_result)) => { + res = upload_result; + if !res.status.is_success() { + dlg.store_upload_url(None); + dlg.finished(false); + return Err(Error::Failure(res)) + } + } + } + } + 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) + } + } + } + } + + /// Upload media all at once. + /// If the upload fails for whichever reason, all progress is lost. + /// + /// * *max size*: 1024MB + /// * *multipart*: yes + /// * *valid mime types*: '*/*' + pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, CreativeAssetMetadata)> + where RS: ReadSeek { + self.doit(stream, mime_type, "simple") + } + /// Upload media in a resumable fashion. + /// Even if the upload fails or is interrupted, it can be resumed for a + /// certain amount of time as the server maintains state temporarily. + /// + /// The delegate will be asked for an `upload_url()`, and if not provided, will be asked to store an upload URL + /// that was provided by the server, using `store_upload_url(...)`. The upload will be done in chunks, the delegate + /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using + /// `cancel_chunk_upload(...)`. + /// + /// * *max size*: 1024MB + /// * *multipart*: yes + /// * *valid mime types*: '*/*' + pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, CreativeAssetMetadata)> + where RS: ReadSeek { + self.doit(resumeable_stream, mime_type, "resumable") + } + + /// + /// 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: CreativeAssetMetadata) -> CreativeAssetInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeAssetInsertCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Advertiser ID of this creative. This is a required field. + /// + /// Sets the *advertiser 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 advertiser_id(mut self, new_value: &str) -> CreativeAssetInsertCall<'a, C, A> { + self._advertiser_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) -> CreativeAssetInsertCall<'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) -> CreativeAssetInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeAssetInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already. +/// +/// A builder for the *insert* method supported by a *campaignCreativeAssociation* resource. +/// It is not used directly, but through a `CampaignCreativeAssociationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CampaignCreativeAssociation; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CampaignCreativeAssociation::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.campaign_creative_associations().insert(req, "profileId", "campaignId") +/// .doit(); +/// # } +/// ``` +pub struct CampaignCreativeAssociationInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CampaignCreativeAssociation, + _profile_id: String, + _campaign_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignCreativeAssociationInsertCall<'a, C, A> {} + +impl<'a, C, A> CampaignCreativeAssociationInsertCall<'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, CampaignCreativeAssociation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaignCreativeAssociations.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + for &field in ["alt", "profileId", "campaignId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId")].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 ["campaignId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CampaignCreativeAssociation) -> CampaignCreativeAssociationInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignCreativeAssociationInsertCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Campaign ID in this association. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> CampaignCreativeAssociationInsertCall<'a, C, A> { + self._campaign_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) -> CampaignCreativeAssociationInsertCall<'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) -> CampaignCreativeAssociationInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignCreativeAssociationInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. +/// +/// A builder for the *list* method supported by a *campaignCreativeAssociation* resource. +/// It is not used directly, but through a `CampaignCreativeAssociationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.campaign_creative_associations().list("profileId", "campaignId") +/// .sort_order("sadipscing") +/// .page_token("rebum.") +/// .max_results(-33) +/// .doit(); +/// # } +/// ``` +pub struct CampaignCreativeAssociationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _campaign_id: String, + _sort_order: Option, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignCreativeAssociationListCall<'a, C, A> {} + +impl<'a, C, A> CampaignCreativeAssociationListCall<'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, CampaignCreativeAssociationsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaignCreativeAssociations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("campaignId", self._campaign_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.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())); + } + for &field in ["alt", "profileId", "campaignId", "sortOrder", "pageToken", "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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{campaignId}", "campaignId")].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 ["campaignId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignCreativeAssociationListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Campaign ID in this association. + /// + /// Sets the *campaign 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 campaign_id(mut self, new_value: &str) -> CampaignCreativeAssociationListCall<'a, C, A> { + self._campaign_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> CampaignCreativeAssociationListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CampaignCreativeAssociationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> CampaignCreativeAssociationListCall<'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) -> CampaignCreativeAssociationListCall<'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) -> CampaignCreativeAssociationListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignCreativeAssociationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of change logs. This method supports paging. +/// +/// A builder for the *list* method supported by a *changeLog* resource. +/// It is not used directly, but through a `ChangeLogMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.change_logs().list("profileId") +/// .add_user_profile_ids("sed") +/// .search_string("aliquyam") +/// .page_token("sit") +/// .object_type("eirmod") +/// .add_object_ids("consetetur") +/// .min_change_time("labore") +/// .max_results(-30) +/// .max_change_time("ea") +/// .add_ids("gubergren") +/// .action("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ChangeLogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _user_profile_ids: Vec, + _search_string: Option, + _page_token: Option, + _object_type: Option, + _object_ids: Vec, + _min_change_time: Option, + _max_results: Option, + _max_change_time: Option, + _ids: Vec, + _action: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ChangeLogListCall<'a, C, A> {} + +impl<'a, C, A> ChangeLogListCall<'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, ChangeLogsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.changeLogs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._user_profile_ids.len() > 0 { + for f in self._user_profile_ids.iter() { + params.push(("userProfileIds", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._object_type { + params.push(("objectType", value.to_string())); + } + if self._object_ids.len() > 0 { + for f in self._object_ids.iter() { + params.push(("objectIds", f.to_string())); + } + } + if let Some(value) = self._min_change_time { + params.push(("minChangeTime", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._max_change_time { + params.push(("maxChangeTime", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._action { + params.push(("action", value.to_string())); + } + for &field in ["alt", "profileId", "userProfileIds", "searchString", "pageToken", "objectType", "objectIds", "minChangeTime", "maxResults", "maxChangeTime", "ids", "action"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only change logs with these user profile IDs. + /// + /// Append the given value to the *user profile ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_user_profile_ids(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._user_profile_ids.push(new_value.to_string()); + self + } + /// Select only change logs whose object ID, user name, old or new values match the search string. + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only change logs with the specified object type. + /// + /// Sets the *object type* query property to the given value. + pub fn object_type(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._object_type = Some(new_value.to_string()); + self + } + /// Select only change logs with these object IDs. + /// + /// Append the given value to the *object ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_object_ids(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._object_ids.push(new_value.to_string()); + self + } + /// Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + /// + /// Sets the *min change time* query property to the given value. + pub fn min_change_time(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._min_change_time = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ChangeLogListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + /// + /// Sets the *max change time* query property to the given value. + pub fn max_change_time(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._max_change_time = Some(new_value.to_string()); + self + } + /// Select only change logs with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only change logs with the specified action. + /// + /// Sets the *action* query property to the given value. + pub fn action(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { + self._action = 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) -> ChangeLogListCall<'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) -> ChangeLogListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ChangeLogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one change log by ID. +/// +/// A builder for the *get* method supported by a *changeLog* resource. +/// It is not used directly, but through a `ChangeLogMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.change_logs().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct ChangeLogGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ChangeLogGetCall<'a, C, A> {} + +impl<'a, C, A> ChangeLogGetCall<'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, ChangeLog)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.changeLogs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ChangeLogGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Change log ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> ChangeLogGetCall<'a, C, A> { + self._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) -> ChangeLogGetCall<'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) -> ChangeLogGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ChangeLogGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one remarketing list share by remarketing list ID. +/// +/// A builder for the *get* method supported by a *remarketingListShare* resource. +/// It is not used directly, but through a `RemarketingListShareMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.remarketing_list_shares().get("profileId", "remarketingListId") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListShareGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _remarketing_list_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListShareGetCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListShareGetCall<'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, RemarketingListShare)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingListShares.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("remarketingListId", self._remarketing_list_id.to_string())); + for &field in ["alt", "profileId", "remarketingListId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingListShares/{remarketingListId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{remarketingListId}", "remarketingListId")].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 ["remarketingListId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListShareGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Remarketing list ID. + /// + /// Sets the *remarketing list 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 remarketing_list_id(mut self, new_value: &str) -> RemarketingListShareGetCall<'a, C, A> { + self._remarketing_list_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) -> RemarketingListShareGetCall<'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) -> RemarketingListShareGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListShareGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing remarketing list share. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *remarketingListShare* resource. +/// It is not used directly, but through a `RemarketingListShareMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::RemarketingListShare; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemarketingListShare::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.remarketing_list_shares().patch(req, "profileId", "remarketingListId") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListSharePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: RemarketingListShare, + _profile_id: String, + _remarketing_list_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListSharePatchCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListSharePatchCall<'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, RemarketingListShare)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingListShares.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("remarketingListId", self._remarketing_list_id.to_string())); + for &field in ["alt", "profileId", "remarketingListId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingListShares"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RemarketingListShare) -> RemarketingListSharePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListSharePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Remarketing list ID. + /// + /// Sets the *remarketing list id* 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. + pub fn remarketing_list_id(mut self, new_value: &str) -> RemarketingListSharePatchCall<'a, C, A> { + self._remarketing_list_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) -> RemarketingListSharePatchCall<'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) -> RemarketingListSharePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListSharePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing remarketing list share. +/// +/// A builder for the *update* method supported by a *remarketingListShare* resource. +/// It is not used directly, but through a `RemarketingListShareMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::RemarketingListShare; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemarketingListShare::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.remarketing_list_shares().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListShareUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: RemarketingListShare, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListShareUpdateCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListShareUpdateCall<'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, RemarketingListShare)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingListShares.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingListShares"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RemarketingListShare) -> RemarketingListShareUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListShareUpdateCall<'a, C, A> { + self._profile_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) -> RemarketingListShareUpdateCall<'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) -> RemarketingListShareUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListShareUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Runs a report. +/// +/// A builder for the *run* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().run("profileId", "reportId") +/// .synchronous(true) +/// .doit(); +/// # } +/// ``` +pub struct ReportRunCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _report_id: String, + _synchronous: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportRunCall<'a, C, A> {} + +impl<'a, C, A> ReportRunCall<'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, File)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.run", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + if let Some(value) = self._synchronous { + params.push(("synchronous", value.to_string())); + } + for &field in ["alt", "profileId", "reportId", "synchronous"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId")].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 ["reportId", "profileId"].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(Bearer { 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(d); + 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(d); + 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 DFA profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportRunCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportRunCall<'a, C, A> { + self._report_id = new_value.to_string(); + self + } + /// If set and true, tries to run the report synchronously. + /// + /// Sets the *synchronous* query property to the given value. + pub fn synchronous(mut self, new_value: bool) -> ReportRunCall<'a, C, A> { + self._synchronous = 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) -> ReportRunCall<'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) -> ReportRunCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportRunCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a report. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Report::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.reports().patch(req, "profileId", "reportId") +/// .doit(); +/// # } +/// ``` +pub struct ReportPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Report, + _profile_id: String, + _report_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportPatchCall<'a, C, A> {} + +impl<'a, C, A> ReportPatchCall<'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, Report)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + for &field in ["alt", "profileId", "reportId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId")].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 ["reportId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Report) -> ReportPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportPatchCall<'a, C, A> { + self._report_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) -> ReportPatchCall<'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) -> ReportPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists files for a report. +/// +/// A builder for the *files.list* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().files_list("profileId", "reportId") +/// .sort_order("clita") +/// .sort_field("diam") +/// .page_token("justo") +/// .max_results(-57) +/// .doit(); +/// # } +/// ``` +pub struct ReportFileListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _report_id: String, + _sort_order: Option, + _sort_field: Option, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportFileListCall<'a, C, A> {} + +impl<'a, C, A> ReportFileListCall<'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, FileList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.files.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.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())); + } + for &field in ["alt", "profileId", "reportId", "sortOrder", "sortField", "pageToken", "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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId")].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 ["reportId", "profileId"].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(Bearer { 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(d); + 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(d); + 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 DFA profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportFileListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the parent report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportFileListCall<'a, C, A> { + self._report_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> ReportFileListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// The field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> ReportFileListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// The value of the nextToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ReportFileListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ReportFileListCall<'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) -> ReportFileListCall<'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) -> ReportFileListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportFileListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a report. +/// +/// A builder for the *insert* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Report::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.reports().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct ReportInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Report, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportInsertCall<'a, C, A> {} + +impl<'a, C, A> ReportInsertCall<'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, Report)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Report) -> ReportInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportInsertCall<'a, C, A> { + self._profile_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) -> ReportInsertCall<'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) -> ReportInsertCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions. +/// +/// A builder for the *compatibleFields.query* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Report::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.reports().compatible_fields_query(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct ReportCompatibleFieldQueryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Report, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportCompatibleFieldQueryCall<'a, C, A> {} + +impl<'a, C, A> ReportCompatibleFieldQueryCall<'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, CompatibleFields)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.compatibleFields.query", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/compatiblefields/query"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Report) -> ReportCompatibleFieldQueryCall<'a, C, A> { + self._request = new_value; + self + } + /// The DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportCompatibleFieldQueryCall<'a, C, A> { + self._profile_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) -> ReportCompatibleFieldQueryCall<'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) -> ReportCompatibleFieldQueryCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportCompatibleFieldQueryCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a report by its ID. +/// +/// A builder for the *get* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().get("profileId", "reportId") +/// .doit(); +/// # } +/// ``` +pub struct ReportGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _report_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportGetCall<'a, C, A> {} + +impl<'a, C, A> ReportGetCall<'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, Report)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + for &field in ["alt", "profileId", "reportId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId")].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 ["reportId", "profileId"].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(Bearer { 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(d); + 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(d); + 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 DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportGetCall<'a, C, A> { + self._report_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) -> ReportGetCall<'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) -> ReportGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a report file. This method supports media download. +/// +/// This method supports **media download**. To enable it, adjust the builder like this: +/// `.param("alt", "media")`. +/// Please note that due to missing multi-part support on the server side, you will only receive the media, +/// but not the `File` structure that you would usually get. The latter will be a default value. +/// +/// A builder for the *files.get* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().files_get("profileId", "reportId", "fileId") +/// .doit(); +/// # } +/// ``` +pub struct ReportFileGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _report_id: String, + _file_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportFileGetCall<'a, C, A> {} + +impl<'a, C, A> ReportFileGetCall<'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, File)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.files.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + params.push(("fileId", self._file_id.to_string())); + for &field in ["profileId", "reportId", "fileId"].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 (json_field_missing, enable_resource_parsing) = { + let mut enable = true; + let mut field_present = true; + for &(name, ref value) in params.iter() { + if name == "alt" { + field_present = false; + if >::as_ref(&value) != "json" { + enable = false; + } + break; + } + } + (field_present, enable) + }; + if json_field_missing { + params.push(("alt", "json".to_string())); + } + + let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId"), ("{fileId}", "fileId")].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 ["fileId", "reportId", "profileId"].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(Bearer { 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(d); + 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(d); + 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 = if enable_resource_parsing { + 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)); + } + } + } else { (res, Default::default()) }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The DFA profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportFileGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportFileGetCall<'a, C, A> { + self._report_id = new_value.to_string(); + self + } + /// The ID of the report file. + /// + /// Sets the *file 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 file_id(mut self, new_value: &str) -> ReportFileGetCall<'a, C, A> { + self._file_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) -> ReportFileGetCall<'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) -> ReportFileGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportFileGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a report by its ID. +/// +/// A builder for the *delete* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().delete("profileId", "reportId") +/// .doit(); +/// # } +/// ``` +pub struct ReportDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _report_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportDeleteCall<'a, C, A> {} + +impl<'a, C, A> ReportDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + for &field in ["profileId", "reportId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId")].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 ["reportId", "profileId"].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(Bearer { 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(d); + 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(d); + 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 DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportDeleteCall<'a, C, A> { + self._report_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) -> ReportDeleteCall<'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) -> ReportDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a report. +/// +/// A builder for the *update* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Report::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.reports().update(req, "profileId", "reportId") +/// .doit(); +/// # } +/// ``` +pub struct ReportUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Report, + _profile_id: String, + _report_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportUpdateCall<'a, C, A> {} + +impl<'a, C, A> ReportUpdateCall<'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, Report)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("reportId", self._report_id.to_string())); + for &field in ["alt", "profileId", "reportId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{reportId}", "reportId")].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 ["reportId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Report) -> ReportUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportUpdateCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> ReportUpdateCall<'a, C, A> { + self._report_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) -> ReportUpdateCall<'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) -> ReportUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves list of reports. +/// +/// A builder for the *list* method supported by a *report* resource. +/// It is not used directly, but through a `ReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.reports().list("profileId") +/// .sort_order("dolor") +/// .sort_field("diam") +/// .scope("kasd") +/// .page_token("invidunt") +/// .max_results(-15) +/// .doit(); +/// # } +/// ``` +pub struct ReportListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _scope: Option, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReportListCall<'a, C, A> {} + +impl<'a, C, A> ReportListCall<'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, ReportList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.reports.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._scope { + params.push(("scope", value.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())); + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "scope", "pageToken", "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 = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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 DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ReportListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> ReportListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// The field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> ReportListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// The scope that defines which results are returned. + /// + /// Sets the *scope* query property to the given value. + pub fn scope(mut self, new_value: &str) -> ReportListCall<'a, C, A> { + self._scope = Some(new_value.to_string()); + self + } + /// The value of the nextToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ReportListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ReportListCall<'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) -> ReportListCall<'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) -> ReportListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ReportListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new advertiser. +/// +/// A builder for the *insert* method supported by a *advertiser* resource. +/// It is not used directly, but through a `AdvertiserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Advertiser; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Advertiser::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.advertisers().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Advertiser, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserInsertCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserInsertCall<'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, Advertiser)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertisers.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Advertiser) -> AdvertiserInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserInsertCall<'a, C, A> { + self._profile_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) -> AdvertiserInsertCall<'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) -> AdvertiserInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing advertiser. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *advertiser* resource. +/// It is not used directly, but through a `AdvertiserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Advertiser; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Advertiser::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.advertisers().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Advertiser, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserPatchCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserPatchCall<'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, Advertiser)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertisers.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Advertiser) -> AdvertiserPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Advertiser ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> AdvertiserPatchCall<'a, C, A> { + self._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) -> AdvertiserPatchCall<'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) -> AdvertiserPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of advertisers, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *advertiser* resource. +/// It is not used directly, but through a `AdvertiserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.advertisers().list("profileId") +/// .subaccount_id("At") +/// .status("consetetur") +/// .sort_order("et") +/// .sort_field("sed") +/// .search_string("sit") +/// .page_token("takimata") +/// .only_parent(true) +/// .max_results(-91) +/// .include_advertisers_without_groups_only(true) +/// .add_ids("Lorem") +/// .add_floodlight_configuration_ids("Lorem") +/// .add_advertiser_group_ids("diam") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _subaccount_id: Option, + _status: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _only_parent: Option, + _max_results: Option, + _include_advertisers_without_groups_only: Option, + _ids: Vec, + _floodlight_configuration_ids: Vec, + _advertiser_group_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserListCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserListCall<'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, AdvertisersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertisers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((15 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._subaccount_id { + params.push(("subaccountId", value.to_string())); + } + if let Some(value) = self._status { + params.push(("status", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._only_parent { + params.push(("onlyParent", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_advertisers_without_groups_only { + params.push(("includeAdvertisersWithoutGroupsOnly", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._floodlight_configuration_ids.len() > 0 { + for f in self._floodlight_configuration_ids.iter() { + params.push(("floodlightConfigurationIds", f.to_string())); + } + } + if self._advertiser_group_ids.len() > 0 { + for f in self._advertiser_group_ids.iter() { + params.push(("advertiserGroupIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "subaccountId", "status", "sortOrder", "sortField", "searchString", "pageToken", "onlyParent", "maxResults", "includeAdvertisersWithoutGroupsOnly", "ids", "floodlightConfigurationIds", "advertiserGroupIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only advertisers with these subaccount IDs. + /// + /// Sets the *subaccount id* query property to the given value. + pub fn subaccount_id(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._subaccount_id = Some(new_value.to_string()); + self + } + /// Select only advertisers with the specified status. + /// + /// Sets the *status* query property to the given value. + pub fn status(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._status = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only advertisers which use another advertiser's floodlight configuration. + /// + /// Sets the *only parent* query property to the given value. + pub fn only_parent(mut self, new_value: bool) -> AdvertiserListCall<'a, C, A> { + self._only_parent = Some(new_value); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> AdvertiserListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only advertisers which do not belong to any advertiser group. + /// + /// Sets the *include advertisers without groups only* query property to the given value. + pub fn include_advertisers_without_groups_only(mut self, new_value: bool) -> AdvertiserListCall<'a, C, A> { + self._include_advertisers_without_groups_only = Some(new_value); + self + } + /// Select only advertisers with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only advertisers with these floodlight configuration IDs. + /// + /// Append the given value to the *floodlight configuration ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_floodlight_configuration_ids(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._floodlight_configuration_ids.push(new_value.to_string()); + self + } + /// Select only advertisers with these advertiser group IDs. + /// + /// Append the given value to the *advertiser group ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_group_ids(mut self, new_value: &str) -> AdvertiserListCall<'a, C, A> { + self._advertiser_group_ids.push(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) -> AdvertiserListCall<'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) -> AdvertiserListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing advertiser. +/// +/// A builder for the *update* method supported by a *advertiser* resource. +/// It is not used directly, but through a `AdvertiserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Advertiser; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Advertiser::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.advertisers().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Advertiser, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserUpdateCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserUpdateCall<'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, Advertiser)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertisers.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Advertiser) -> AdvertiserUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserUpdateCall<'a, C, A> { + self._profile_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) -> AdvertiserUpdateCall<'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) -> AdvertiserUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one advertiser by ID. +/// +/// A builder for the *get* method supported by a *advertiser* resource. +/// It is not used directly, but through a `AdvertiserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.advertisers().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGetCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGetCall<'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, Advertiser)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertisers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Advertiser ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AdvertiserGetCall<'a, C, A> { + self._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) -> AdvertiserGetCall<'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) -> AdvertiserGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves list of report dimension values for a list of filters. +/// +/// A builder for the *query* method supported by a *dimensionValue* resource. +/// It is not used directly, but through a `DimensionValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::DimensionValueRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DimensionValueRequest::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.dimension_values().query(req, "profileId") +/// .page_token("ut") +/// .max_results(-3) +/// .doit(); +/// # } +/// ``` +pub struct DimensionValueQueryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: DimensionValueRequest, + _profile_id: String, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DimensionValueQueryCall<'a, C, A> {} + +impl<'a, C, A> DimensionValueQueryCall<'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, DimensionValueList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.dimensionValues.query", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("profileId", self._profile_id.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())); + } + for &field in ["alt", "profileId", "pageToken", "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 = self.hub._base_url.clone() + "userprofiles/{profileId}/dimensionvalues/query"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DimensionValueRequest) -> DimensionValueQueryCall<'a, C, A> { + self._request = new_value; + self + } + /// The DFA user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DimensionValueQueryCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// The value of the nextToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DimensionValueQueryCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> DimensionValueQueryCall<'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) -> DimensionValueQueryCall<'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) -> DimensionValueQueryCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DimensionValueQueryCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one floodlight activity group by ID. +/// +/// A builder for the *get* method supported by a *floodlightActivityGroup* resource. +/// It is not used directly, but through a `FloodlightActivityGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_activity_groups().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGroupGetCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGroupGetCall<'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, FloodlightActivityGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivityGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivityGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGroupGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight activity Group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> FloodlightActivityGroupGetCall<'a, C, A> { + self._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) -> FloodlightActivityGroupGetCall<'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) -> FloodlightActivityGroupGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing floodlight activity group. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *floodlightActivityGroup* resource. +/// It is not used directly, but through a `FloodlightActivityGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightActivityGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightActivityGroup::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.floodlight_activity_groups().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGroupPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightActivityGroup, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGroupPatchCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGroupPatchCall<'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, FloodlightActivityGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivityGroups.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivityGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightActivityGroup) -> FloodlightActivityGroupPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGroupPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight activity Group ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> FloodlightActivityGroupPatchCall<'a, C, A> { + self._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) -> FloodlightActivityGroupPatchCall<'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) -> FloodlightActivityGroupPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGroupPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *floodlightActivityGroup* resource. +/// It is not used directly, but through a `FloodlightActivityGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_activity_groups().list("profileId") +/// .type_("dolor") +/// .sort_order("et") +/// .sort_field("et") +/// .search_string("vero") +/// .page_token("ut") +/// .max_results(-30) +/// .add_ids("et") +/// .floodlight_configuration_id("ipsum") +/// .advertiser_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _type_: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _floodlight_configuration_id: Option, + _advertiser_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGroupListCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGroupListCall<'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, FloodlightActivityGroupsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivityGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._floodlight_configuration_id { + params.push(("floodlightConfigurationId", value.to_string())); + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + for &field in ["alt", "profileId", "type", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "floodlightConfigurationId", "advertiserId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivityGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only floodlight activity groups with the specified floodlight activity group type. + /// + /// Sets the *type* query property to the given value. + pub fn type_(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._type_ = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> FloodlightActivityGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. + /// + /// Sets the *floodlight configuration id* query property to the given value. + pub fn floodlight_configuration_id(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._floodlight_configuration_id = Some(new_value.to_string()); + self + } + /// Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> FloodlightActivityGroupListCall<'a, C, A> { + self._advertiser_id = 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) -> FloodlightActivityGroupListCall<'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) -> FloodlightActivityGroupListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new floodlight activity group. +/// +/// A builder for the *insert* method supported by a *floodlightActivityGroup* resource. +/// It is not used directly, but through a `FloodlightActivityGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightActivityGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightActivityGroup::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.floodlight_activity_groups().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightActivityGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGroupInsertCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGroupInsertCall<'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, FloodlightActivityGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivityGroups.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivityGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightActivityGroup) -> FloodlightActivityGroupInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGroupInsertCall<'a, C, A> { + self._profile_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) -> FloodlightActivityGroupInsertCall<'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) -> FloodlightActivityGroupInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGroupInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing floodlight activity group. +/// +/// A builder for the *update* method supported by a *floodlightActivityGroup* resource. +/// It is not used directly, but through a `FloodlightActivityGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightActivityGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightActivityGroup::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.floodlight_activity_groups().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGroupUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightActivityGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGroupUpdateCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGroupUpdateCall<'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, FloodlightActivityGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivityGroups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivityGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightActivityGroup) -> FloodlightActivityGroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGroupUpdateCall<'a, C, A> { + self._profile_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) -> FloodlightActivityGroupUpdateCall<'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) -> FloodlightActivityGroupUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGroupUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of metros. +/// +/// A builder for the *list* method supported by a *metro* resource. +/// It is not used directly, but through a `MetroMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.metros().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct MetroListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MetroListCall<'a, C, A> {} + +impl<'a, C, A> MetroListCall<'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, MetrosListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.metros.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> MetroListCall<'a, C, A> { + self._profile_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) -> MetroListCall<'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) -> MetroListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MetroListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of orders, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *order* resource. +/// It is not used directly, but through a `OrderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.orders().list("profileId", "projectId") +/// .sort_order("nonumy") +/// .sort_field("et") +/// .add_site_id("sed") +/// .search_string("no") +/// .page_token("invidunt") +/// .max_results(-15) +/// .add_ids("labore") +/// .doit(); +/// # } +/// ``` +pub struct OrderListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _project_id: String, + _sort_order: Option, + _sort_field: Option, + _site_id: Vec, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderListCall<'a, C, A> {} + +impl<'a, C, A> OrderListCall<'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, OrdersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.orders.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("projectId", self._project_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._site_id.len() > 0 { + for f in self._site_id.iter() { + params.push(("siteId", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "projectId", "sortOrder", "sortField", "siteId", "searchString", "pageToken", "maxResults", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{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(2); + for param_name in ["projectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID for orders. + /// + /// 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) -> OrderListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only orders that are associated with these site IDs. + /// + /// Append the given value to the *site id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_site_id(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._site_id.push(new_value.to_string()); + self + } + /// Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> OrderListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only orders with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> OrderListCall<'a, C, A> { + self._ids.push(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) -> OrderListCall<'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) -> OrderListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrderListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one order by ID. +/// +/// A builder for the *get* method supported by a *order* resource. +/// It is not used directly, but through a `OrderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.orders().get("profileId", "projectId", "id") +/// .doit(); +/// # } +/// ``` +pub struct OrderGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _project_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderGetCall<'a, C, A> {} + +impl<'a, C, A> OrderGetCall<'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, Order)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.orders.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("projectId", self._project_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "projectId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{projectId}", "projectId"), ("{id}", "id")].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 ["id", "projectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OrderGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID for orders. + /// + /// 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) -> OrderGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Order ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> OrderGetCall<'a, C, A> { + self._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) -> OrderGetCall<'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) -> OrderGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrderGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of languages. +/// +/// A builder for the *list* method supported by a *language* resource. +/// It is not used directly, but through a `LanguageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.languages().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct LanguageListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LanguageListCall<'a, C, A> {} + +impl<'a, C, A> LanguageListCall<'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, LanguagesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.languages.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/languages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> LanguageListCall<'a, C, A> { + self._profile_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) -> LanguageListCall<'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) -> LanguageListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LanguageListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one directory site contact by ID. +/// +/// A builder for the *get* method supported by a *directorySiteContact* resource. +/// It is not used directly, but through a `DirectorySiteContactMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.directory_site_contacts().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct DirectorySiteContactGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DirectorySiteContactGetCall<'a, C, A> {} + +impl<'a, C, A> DirectorySiteContactGetCall<'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, DirectorySiteContact)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.directorySiteContacts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySiteContacts/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DirectorySiteContactGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Directory site contact ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> DirectorySiteContactGetCall<'a, C, A> { + self._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) -> DirectorySiteContactGetCall<'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) -> DirectorySiteContactGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DirectorySiteContactGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of directory site contacts, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *directorySiteContact* resource. +/// It is not used directly, but through a `DirectorySiteContactMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.directory_site_contacts().list("profileId") +/// .sort_order("consetetur") +/// .sort_field("diam") +/// .search_string("accusam") +/// .page_token("dolores") +/// .max_results(-46) +/// .add_ids("dolor") +/// .add_directory_site_ids("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct DirectorySiteContactListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _directory_site_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DirectorySiteContactListCall<'a, C, A> {} + +impl<'a, C, A> DirectorySiteContactListCall<'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, DirectorySiteContactsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.directorySiteContacts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._directory_site_ids.len() > 0 { + for f in self._directory_site_ids.iter() { + params.push(("directorySiteIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "directorySiteIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySiteContacts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with name "my directory site contact", "directory site contact 2015", or simply "directory site contact". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> DirectorySiteContactListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only directory site contacts with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only directory site contacts with these directory site IDs. This is a required field. + /// + /// Append the given value to the *directory site ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_directory_site_ids(mut self, new_value: &str) -> DirectorySiteContactListCall<'a, C, A> { + self._directory_site_ids.push(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) -> DirectorySiteContactListCall<'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) -> DirectorySiteContactListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DirectorySiteContactListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves list of user profiles for a user. +/// +/// A builder for the *list* method supported by a *userProfile* resource. +/// It is not used directly, but through a `UserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_profiles().list() +/// .doit(); +/// # } +/// ``` +pub struct UserProfileListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserProfileListCall<'a, C, A> {} + +impl<'a, C, A> UserProfileListCall<'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, UserProfileList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userProfiles.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + 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 = self.hub._base_url.clone() + "userprofiles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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(Bearer { 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(d); + 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(d); + 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 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) -> UserProfileListCall<'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) -> UserProfileListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one user profile by ID. +/// +/// A builder for the *get* method supported by a *userProfile* resource. +/// It is not used directly, but through a `UserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_profiles().get("profileId") +/// .doit(); +/// # } +/// ``` +pub struct UserProfileGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserProfileGetCall<'a, C, A> {} + +impl<'a, C, A> UserProfileGetCall<'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, UserProfile)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userProfiles.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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 user profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserProfileGetCall<'a, C, A> { + self._profile_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) -> UserProfileGetCall<'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) -> UserProfileGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserProfileGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing ad. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *ad* resource. +/// It is not used directly, but through a `AdMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Ad; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Ad::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.ads().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Ad, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdPatchCall<'a, C, A> {} + +impl<'a, C, A> AdPatchCall<'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, Ad)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.ads.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Ad) -> AdPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Ad ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> AdPatchCall<'a, C, A> { + self._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) -> AdPatchCall<'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) -> AdPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new ad. +/// +/// A builder for the *insert* method supported by a *ad* resource. +/// It is not used directly, but through a `AdMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Ad; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Ad::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.ads().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Ad, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdInsertCall<'a, C, A> {} + +impl<'a, C, A> AdInsertCall<'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, Ad)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.ads.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Ad) -> AdInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdInsertCall<'a, C, A> { + self._profile_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) -> AdInsertCall<'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) -> AdInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of ads, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *ad* resource. +/// It is not used directly, but through a `AdMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.ads().list("profileId") +/// .add_type("dolor") +/// .ssl_required(true) +/// .ssl_compliant(true) +/// .sort_order("Lorem") +/// .sort_field("consetetur") +/// .add_size_ids("consetetur") +/// .search_string("eirmod") +/// .add_remarketing_list_ids("labore") +/// .add_placement_ids("gubergren") +/// .page_token("et") +/// .overridden_event_tag_id("sadipscing") +/// .max_results(-73) +/// .add_landing_page_ids("magna") +/// .add_ids("Lorem") +/// .dynamic_click_tracker(true) +/// .add_creative_optimization_configuration_ids("et") +/// .add_creative_ids("clita") +/// .compatibility("eos") +/// .add_campaign_ids("dolores") +/// .add_audience_segment_ids("vero") +/// .archived(false) +/// .advertiser_id("vero") +/// .active(false) +/// .doit(); +/// # } +/// ``` +pub struct AdListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _type_: Vec, + _ssl_required: Option, + _ssl_compliant: Option, + _sort_order: Option, + _sort_field: Option, + _size_ids: Vec, + _search_string: Option, + _remarketing_list_ids: Vec, + _placement_ids: Vec, + _page_token: Option, + _overridden_event_tag_id: Option, + _max_results: Option, + _landing_page_ids: Vec, + _ids: Vec, + _dynamic_click_tracker: Option, + _creative_optimization_configuration_ids: Vec, + _creative_ids: Vec, + _compatibility: Option, + _campaign_ids: Vec, + _audience_segment_ids: Vec, + _archived: Option, + _advertiser_id: Option, + _active: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdListCall<'a, C, A> {} + +impl<'a, C, A> AdListCall<'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, AdsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.ads.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((26 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._type_.len() > 0 { + for f in self._type_.iter() { + params.push(("type", f.to_string())); + } + } + if let Some(value) = self._ssl_required { + params.push(("sslRequired", value.to_string())); + } + if let Some(value) = self._ssl_compliant { + params.push(("sslCompliant", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._size_ids.len() > 0 { + for f in self._size_ids.iter() { + params.push(("sizeIds", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if self._remarketing_list_ids.len() > 0 { + for f in self._remarketing_list_ids.iter() { + params.push(("remarketingListIds", f.to_string())); + } + } + if self._placement_ids.len() > 0 { + for f in self._placement_ids.iter() { + params.push(("placementIds", f.to_string())); + } + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._overridden_event_tag_id { + params.push(("overriddenEventTagId", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if self._landing_page_ids.len() > 0 { + for f in self._landing_page_ids.iter() { + params.push(("landingPageIds", f.to_string())); + } + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._dynamic_click_tracker { + params.push(("dynamicClickTracker", value.to_string())); + } + if self._creative_optimization_configuration_ids.len() > 0 { + for f in self._creative_optimization_configuration_ids.iter() { + params.push(("creativeOptimizationConfigurationIds", f.to_string())); + } + } + if self._creative_ids.len() > 0 { + for f in self._creative_ids.iter() { + params.push(("creativeIds", f.to_string())); + } + } + if let Some(value) = self._compatibility { + params.push(("compatibility", value.to_string())); + } + if self._campaign_ids.len() > 0 { + for f in self._campaign_ids.iter() { + params.push(("campaignIds", f.to_string())); + } + } + if self._audience_segment_ids.len() > 0 { + for f in self._audience_segment_ids.iter() { + params.push(("audienceSegmentIds", f.to_string())); + } + } + if let Some(value) = self._archived { + params.push(("archived", value.to_string())); + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + for &field in ["alt", "profileId", "type", "sslRequired", "sslCompliant", "sortOrder", "sortField", "sizeIds", "searchString", "remarketingListIds", "placementIds", "pageToken", "overriddenEventTagId", "maxResults", "landingPageIds", "ids", "dynamicClickTracker", "creativeOptimizationConfigurationIds", "creativeIds", "compatibility", "campaignIds", "audienceSegmentIds", "archived", "advertiserId", "active"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only ads with these types. + /// + /// Append the given value to the *type* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_type(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._type_.push(new_value.to_string()); + self + } + /// Select only ads that require SSL. + /// + /// Sets the *ssl required* query property to the given value. + pub fn ssl_required(mut self, new_value: bool) -> AdListCall<'a, C, A> { + self._ssl_required = Some(new_value); + self + } + /// Select only ads that are SSL-compliant. + /// + /// Sets the *ssl compliant* query property to the given value. + pub fn ssl_compliant(mut self, new_value: bool) -> AdListCall<'a, C, A> { + self._ssl_compliant = Some(new_value); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only ads with these size IDs. + /// + /// Append the given value to the *size ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_size_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._size_ids.push(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Select only ads whose list targeting expression use these remarketing list IDs. + /// + /// Append the given value to the *remarketing list ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_remarketing_list_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._remarketing_list_ids.push(new_value.to_string()); + self + } + /// Select only ads with these placement IDs assigned. + /// + /// Append the given value to the *placement ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_placement_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._placement_ids.push(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only ads with this event tag override ID. + /// + /// Sets the *overridden event tag id* query property to the given value. + pub fn overridden_event_tag_id(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._overridden_event_tag_id = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> AdListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only ads with these landing page IDs. + /// + /// Append the given value to the *landing page ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_landing_page_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._landing_page_ids.push(new_value.to_string()); + self + } + /// Select only ads with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. + /// + /// Sets the *dynamic click tracker* query property to the given value. + pub fn dynamic_click_tracker(mut self, new_value: bool) -> AdListCall<'a, C, A> { + self._dynamic_click_tracker = Some(new_value); + self + } + /// Select only ads with these creative optimization configuration IDs. + /// + /// Append the given value to the *creative optimization configuration ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_creative_optimization_configuration_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._creative_optimization_configuration_ids.push(new_value.to_string()); + self + } + /// Select only ads with these creative IDs assigned. + /// + /// Append the given value to the *creative ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_creative_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._creative_ids.push(new_value.to_string()); + self + } + /// Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + /// + /// Sets the *compatibility* query property to the given value. + pub fn compatibility(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._compatibility = Some(new_value.to_string()); + self + } + /// Select only ads with these campaign IDs. + /// + /// Append the given value to the *campaign ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_campaign_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._campaign_ids.push(new_value.to_string()); + self + } + /// Select only ads with these audience segment IDs. + /// + /// Append the given value to the *audience segment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_audience_segment_ids(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._audience_segment_ids.push(new_value.to_string()); + self + } + /// Select only archived ads. + /// + /// Sets the *archived* query property to the given value. + pub fn archived(mut self, new_value: bool) -> AdListCall<'a, C, A> { + self._archived = Some(new_value); + self + } + /// Select only ads with this advertiser ID. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> AdListCall<'a, C, A> { + self._advertiser_id = Some(new_value.to_string()); + self + } + /// Select only active ads. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> AdListCall<'a, C, A> { + self._active = 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) -> AdListCall<'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) -> AdListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one ad by ID. +/// +/// A builder for the *get* method supported by a *ad* resource. +/// It is not used directly, but through a `AdMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.ads().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdGetCall<'a, C, A> {} + +impl<'a, C, A> AdGetCall<'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, Ad)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.ads.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Ad ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AdGetCall<'a, C, A> { + self._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) -> AdGetCall<'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) -> AdGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing ad. +/// +/// A builder for the *update* method supported by a *ad* resource. +/// It is not used directly, but through a `AdMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Ad; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Ad::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.ads().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Ad, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdUpdateCall<'a, C, A> {} + +impl<'a, C, A> AdUpdateCall<'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, Ad)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.ads.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Ad) -> AdUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdUpdateCall<'a, C, A> { + self._profile_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) -> AdUpdateCall<'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) -> AdUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one account permission by ID. +/// +/// A builder for the *get* method supported by a *accountPermission* resource. +/// It is not used directly, but through a `AccountPermissionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_permissions().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AccountPermissionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountPermissionGetCall<'a, C, A> {} + +impl<'a, C, A> AccountPermissionGetCall<'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, AccountPermission)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountPermissions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountPermissions/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountPermissionGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Account permission ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AccountPermissionGetCall<'a, C, A> { + self._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) -> AccountPermissionGetCall<'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) -> AccountPermissionGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountPermissionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of account permissions. +/// +/// A builder for the *list* method supported by a *accountPermission* resource. +/// It is not used directly, but through a `AccountPermissionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_permissions().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct AccountPermissionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountPermissionListCall<'a, C, A> {} + +impl<'a, C, A> AccountPermissionListCall<'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, AccountPermissionsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountPermissions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountPermissionListCall<'a, C, A> { + self._profile_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) -> AccountPermissionListCall<'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) -> AccountPermissionListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountPermissionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of connection types. +/// +/// A builder for the *list* method supported by a *connectionType* resource. +/// It is not used directly, but through a `ConnectionTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.connection_types().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct ConnectionTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ConnectionTypeListCall<'a, C, A> {} + +impl<'a, C, A> ConnectionTypeListCall<'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, ConnectionTypesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.connectionTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ConnectionTypeListCall<'a, C, A> { + self._profile_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) -> ConnectionTypeListCall<'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) -> ConnectionTypeListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ConnectionTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one connection type by ID. +/// +/// A builder for the *get* method supported by a *connectionType* resource. +/// It is not used directly, but through a `ConnectionTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.connection_types().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct ConnectionTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ConnectionTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ConnectionTypeGetCall<'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, ConnectionType)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.connectionTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ConnectionTypeGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Connection type ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> ConnectionTypeGetCall<'a, C, A> { + self._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) -> ConnectionTypeGetCall<'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) -> ConnectionTypeGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ConnectionTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *targetableRemarketingList* resource. +/// It is not used directly, but through a `TargetableRemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.targetable_remarketing_lists().list("profileId", "advertiserId") +/// .sort_order("invidunt") +/// .sort_field("accusam") +/// .page_token("labore") +/// .name("diam") +/// .max_results(-41) +/// .active(false) +/// .doit(); +/// # } +/// ``` +pub struct TargetableRemarketingListListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _advertiser_id: String, + _sort_order: Option, + _sort_field: Option, + _page_token: Option, + _name: Option, + _max_results: Option, + _active: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetableRemarketingListListCall<'a, C, A> {} + +impl<'a, C, A> TargetableRemarketingListListCall<'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, TargetableRemarketingListsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetableRemarketingLists.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("advertiserId", self._advertiser_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._name { + params.push(("name", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + for &field in ["alt", "profileId", "advertiserId", "sortOrder", "sortField", "pageToken", "name", "maxResults", "active"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetableRemarketingLists"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetableRemarketingListListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only targetable remarketing lists targetable by these advertisers. + /// + /// Sets the *advertiser id* 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. + pub fn advertiser_id(mut self, new_value: &str) -> TargetableRemarketingListListCall<'a, C, A> { + self._advertiser_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> TargetableRemarketingListListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> TargetableRemarketingListListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetableRemarketingListListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + /// + /// Sets the *name* query property to the given value. + pub fn name(mut self, new_value: &str) -> TargetableRemarketingListListCall<'a, C, A> { + self._name = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> TargetableRemarketingListListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only active or only inactive targetable remarketing lists. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> TargetableRemarketingListListCall<'a, C, A> { + self._active = 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) -> TargetableRemarketingListListCall<'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) -> TargetableRemarketingListListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetableRemarketingListListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one remarketing list by ID. +/// +/// A builder for the *get* method supported by a *targetableRemarketingList* resource. +/// It is not used directly, but through a `TargetableRemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.targetable_remarketing_lists().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct TargetableRemarketingListGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetableRemarketingListGetCall<'a, C, A> {} + +impl<'a, C, A> TargetableRemarketingListGetCall<'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, TargetableRemarketingList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetableRemarketingLists.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetableRemarketingLists/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetableRemarketingListGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Remarketing list ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> TargetableRemarketingListGetCall<'a, C, A> { + self._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) -> TargetableRemarketingListGetCall<'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) -> TargetableRemarketingListGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetableRemarketingListGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one advertiser group by ID. +/// +/// A builder for the *get* method supported by a *advertiserGroup* resource. +/// It is not used directly, but through a `AdvertiserGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.advertiser_groups().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGroupGetCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupGetCall<'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, AdvertiserGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertiserGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertiserGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGroupGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Advertiser group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AdvertiserGroupGetCall<'a, C, A> { + self._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) -> AdvertiserGroupGetCall<'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) -> AdvertiserGroupGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of advertiser groups, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *advertiserGroup* resource. +/// It is not used directly, but through a `AdvertiserGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.advertiser_groups().list("profileId") +/// .sort_order("vero") +/// .sort_field("nonumy") +/// .search_string("takimata") +/// .page_token("dolores") +/// .max_results(-96) +/// .add_ids("erat") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGroupListCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupListCall<'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, AdvertiserGroupsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertiserGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertiserGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGroupListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> AdvertiserGroupListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> AdvertiserGroupListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> AdvertiserGroupListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AdvertiserGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> AdvertiserGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only advertiser groups with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> AdvertiserGroupListCall<'a, C, A> { + self._ids.push(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) -> AdvertiserGroupListCall<'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) -> AdvertiserGroupListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new advertiser group. +/// +/// A builder for the *insert* method supported by a *advertiserGroup* resource. +/// It is not used directly, but through a `AdvertiserGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::AdvertiserGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AdvertiserGroup::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.advertiser_groups().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: AdvertiserGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGroupInsertCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupInsertCall<'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, AdvertiserGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertiserGroups.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertiserGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AdvertiserGroup) -> AdvertiserGroupInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGroupInsertCall<'a, C, A> { + self._profile_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) -> AdvertiserGroupInsertCall<'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) -> AdvertiserGroupInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGroupInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing advertiser group. +/// +/// A builder for the *update* method supported by a *advertiserGroup* resource. +/// It is not used directly, but through a `AdvertiserGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::AdvertiserGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AdvertiserGroup::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.advertiser_groups().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGroupUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: AdvertiserGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGroupUpdateCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupUpdateCall<'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, AdvertiserGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertiserGroups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertiserGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AdvertiserGroup) -> AdvertiserGroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGroupUpdateCall<'a, C, A> { + self._profile_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) -> AdvertiserGroupUpdateCall<'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) -> AdvertiserGroupUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGroupUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing advertiser group. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *advertiserGroup* resource. +/// It is not used directly, but through a `AdvertiserGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::AdvertiserGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AdvertiserGroup::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.advertiser_groups().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGroupPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: AdvertiserGroup, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGroupPatchCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupPatchCall<'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, AdvertiserGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertiserGroups.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertiserGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AdvertiserGroup) -> AdvertiserGroupPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGroupPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Advertiser group ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> AdvertiserGroupPatchCall<'a, C, A> { + self._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) -> AdvertiserGroupPatchCall<'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) -> AdvertiserGroupPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGroupPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing advertiser group. +/// +/// A builder for the *delete* method supported by a *advertiserGroup* resource. +/// It is not used directly, but through a `AdvertiserGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.advertiser_groups().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserGroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserGroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserGroupDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.advertiserGroups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/advertiserGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AdvertiserGroupDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Advertiser group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AdvertiserGroupDeleteCall<'a, C, A> { + self._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) -> AdvertiserGroupDeleteCall<'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) -> AdvertiserGroupDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AdvertiserGroupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new site. +/// +/// A builder for the *insert* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Site; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Site::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.sites().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct SiteInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Site, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteInsertCall<'a, C, A> {} + +impl<'a, C, A> SiteInsertCall<'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, Site)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sites.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Site) -> SiteInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SiteInsertCall<'a, C, A> { + self._profile_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) -> SiteInsertCall<'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) -> SiteInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SiteInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one site by ID. +/// +/// A builder for the *get* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sites().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct SiteGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteGetCall<'a, C, A> {} + +impl<'a, C, A> SiteGetCall<'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, Site)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sites.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SiteGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Site ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> SiteGetCall<'a, C, A> { + self._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) -> SiteGetCall<'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) -> SiteGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SiteGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of sites, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sites().list("profileId") +/// .unmapped_site(false) +/// .subaccount_id("magna") +/// .sort_order("gubergren") +/// .sort_field("sit") +/// .search_string("gubergren") +/// .page_token("sit") +/// .max_results(-97) +/// .add_ids("eirmod") +/// .add_directory_site_ids("sanctus") +/// .add_campaign_ids("Lorem") +/// .approved(true) +/// .ad_words_site(true) +/// .accepts_publisher_paid_placements(true) +/// .accepts_interstitial_placements(true) +/// .accepts_in_stream_video_placements(true) +/// .doit(); +/// # } +/// ``` +pub struct SiteListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _unmapped_site: Option, + _subaccount_id: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _directory_site_ids: Vec, + _campaign_ids: Vec, + _approved: Option, + _ad_words_site: Option, + _accepts_publisher_paid_placements: Option, + _accepts_interstitial_placements: Option, + _accepts_in_stream_video_placements: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteListCall<'a, C, A> {} + +impl<'a, C, A> SiteListCall<'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, SitesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sites.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((18 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._unmapped_site { + params.push(("unmappedSite", value.to_string())); + } + if let Some(value) = self._subaccount_id { + params.push(("subaccountId", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._directory_site_ids.len() > 0 { + for f in self._directory_site_ids.iter() { + params.push(("directorySiteIds", f.to_string())); + } + } + if self._campaign_ids.len() > 0 { + for f in self._campaign_ids.iter() { + params.push(("campaignIds", f.to_string())); + } + } + if let Some(value) = self._approved { + params.push(("approved", value.to_string())); + } + if let Some(value) = self._ad_words_site { + params.push(("adWordsSite", value.to_string())); + } + if let Some(value) = self._accepts_publisher_paid_placements { + params.push(("acceptsPublisherPaidPlacements", value.to_string())); + } + if let Some(value) = self._accepts_interstitial_placements { + params.push(("acceptsInterstitialPlacements", value.to_string())); + } + if let Some(value) = self._accepts_in_stream_video_placements { + params.push(("acceptsInStreamVideoPlacements", value.to_string())); + } + for &field in ["alt", "profileId", "unmappedSite", "subaccountId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "directorySiteIds", "campaignIds", "approved", "adWordsSite", "acceptsPublisherPaidPlacements", "acceptsInterstitialPlacements", "acceptsInStreamVideoPlacements"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only sites that have not been mapped to a directory site. + /// + /// Sets the *unmapped site* query property to the given value. + pub fn unmapped_site(mut self, new_value: bool) -> SiteListCall<'a, C, A> { + self._unmapped_site = Some(new_value); + self + } + /// Select only sites with this subaccount ID. + /// + /// Sets the *subaccount id* query property to the given value. + pub fn subaccount_id(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._subaccount_id = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> SiteListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only sites with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only sites with these directory site IDs. + /// + /// Append the given value to the *directory site ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_directory_site_ids(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._directory_site_ids.push(new_value.to_string()); + self + } + /// Select only sites with these campaign IDs. + /// + /// Append the given value to the *campaign ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_campaign_ids(mut self, new_value: &str) -> SiteListCall<'a, C, A> { + self._campaign_ids.push(new_value.to_string()); + self + } + /// Select only approved sites. + /// + /// Sets the *approved* query property to the given value. + pub fn approved(mut self, new_value: bool) -> SiteListCall<'a, C, A> { + self._approved = Some(new_value); + self + } + /// Select only AdWords sites. + /// + /// Sets the *ad words site* query property to the given value. + pub fn ad_words_site(mut self, new_value: bool) -> SiteListCall<'a, C, A> { + self._ad_words_site = Some(new_value); + self + } + /// Select only sites that accept publisher paid placements. + /// + /// Sets the *accepts publisher paid placements* query property to the given value. + pub fn accepts_publisher_paid_placements(mut self, new_value: bool) -> SiteListCall<'a, C, A> { + self._accepts_publisher_paid_placements = Some(new_value); + self + } + /// This search filter is no longer supported and will have no effect on the results returned. + /// + /// Sets the *accepts interstitial placements* query property to the given value. + pub fn accepts_interstitial_placements(mut self, new_value: bool) -> SiteListCall<'a, C, A> { + self._accepts_interstitial_placements = Some(new_value); + self + } + /// This search filter is no longer supported and will have no effect on the results returned. + /// + /// Sets the *accepts in stream video placements* query property to the given value. + pub fn accepts_in_stream_video_placements(mut self, new_value: bool) -> SiteListCall<'a, C, A> { + self._accepts_in_stream_video_placements = 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) -> SiteListCall<'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) -> SiteListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SiteListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing site. +/// +/// A builder for the *update* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Site; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Site::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.sites().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct SiteUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Site, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteUpdateCall<'a, C, A> {} + +impl<'a, C, A> SiteUpdateCall<'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, Site)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sites.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Site) -> SiteUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SiteUpdateCall<'a, C, A> { + self._profile_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) -> SiteUpdateCall<'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) -> SiteUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SiteUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing site. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Site; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Site::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.sites().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct SitePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Site, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SitePatchCall<'a, C, A> {} + +impl<'a, C, A> SitePatchCall<'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, Site)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sites.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Site) -> SitePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SitePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Site ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> SitePatchCall<'a, C, A> { + self._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) -> SitePatchCall<'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) -> SitePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SitePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one floodlight activity by ID. +/// +/// A builder for the *get* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_activities().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGetCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGetCall<'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, FloodlightActivity)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight activity ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> FloodlightActivityGetCall<'a, C, A> { + self._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) -> FloodlightActivityGetCall<'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) -> FloodlightActivityGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of floodlight activities, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_activities().list("profileId") +/// .tag_string("ut") +/// .sort_order("diam") +/// .sort_field("tempor") +/// .search_string("et") +/// .page_token("erat") +/// .max_results(-18) +/// .add_ids("kasd") +/// .floodlight_configuration_id("et") +/// .floodlight_activity_group_type("clita") +/// .floodlight_activity_group_tag_string("sed") +/// .floodlight_activity_group_name("dolores") +/// .add_floodlight_activity_group_ids("clita") +/// .advertiser_id("eos") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _tag_string: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _floodlight_configuration_id: Option, + _floodlight_activity_group_type: Option, + _floodlight_activity_group_tag_string: Option, + _floodlight_activity_group_name: Option, + _floodlight_activity_group_ids: Vec, + _advertiser_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityListCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityListCall<'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, FloodlightActivitiesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((16 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._tag_string { + params.push(("tagString", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._floodlight_configuration_id { + params.push(("floodlightConfigurationId", value.to_string())); + } + if let Some(value) = self._floodlight_activity_group_type { + params.push(("floodlightActivityGroupType", value.to_string())); + } + if let Some(value) = self._floodlight_activity_group_tag_string { + params.push(("floodlightActivityGroupTagString", value.to_string())); + } + if let Some(value) = self._floodlight_activity_group_name { + params.push(("floodlightActivityGroupName", value.to_string())); + } + if self._floodlight_activity_group_ids.len() > 0 { + for f in self._floodlight_activity_group_ids.iter() { + params.push(("floodlightActivityGroupIds", f.to_string())); + } + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + for &field in ["alt", "profileId", "tagString", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "floodlightConfigurationId", "floodlightActivityGroupType", "floodlightActivityGroupTagString", "floodlightActivityGroupName", "floodlightActivityGroupIds", "advertiserId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only floodlight activities with the specified tag string. + /// + /// Sets the *tag string* query property to the given value. + pub fn tag_string(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._tag_string = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> FloodlightActivityListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + /// + /// Sets the *floodlight configuration id* query property to the given value. + pub fn floodlight_configuration_id(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._floodlight_configuration_id = Some(new_value.to_string()); + self + } + /// Select only floodlight activities with the specified floodlight activity group type. + /// + /// Sets the *floodlight activity group type* query property to the given value. + pub fn floodlight_activity_group_type(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._floodlight_activity_group_type = Some(new_value.to_string()); + self + } + /// Select only floodlight activities with the specified floodlight activity group tag string. + /// + /// Sets the *floodlight activity group tag string* query property to the given value. + pub fn floodlight_activity_group_tag_string(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._floodlight_activity_group_tag_string = Some(new_value.to_string()); + self + } + /// Select only floodlight activities with the specified floodlight activity group name. + /// + /// Sets the *floodlight activity group name* query property to the given value. + pub fn floodlight_activity_group_name(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._floodlight_activity_group_name = Some(new_value.to_string()); + self + } + /// Select only floodlight activities with the specified floodlight activity group IDs. + /// + /// Append the given value to the *floodlight activity group ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_floodlight_activity_group_ids(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._floodlight_activity_group_ids.push(new_value.to_string()); + self + } + /// Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> FloodlightActivityListCall<'a, C, A> { + self._advertiser_id = 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) -> FloodlightActivityListCall<'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) -> FloodlightActivityListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new floodlight activity. +/// +/// A builder for the *insert* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightActivity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightActivity::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.floodlight_activities().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightActivity, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityInsertCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityInsertCall<'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, FloodlightActivity)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightActivity) -> FloodlightActivityInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityInsertCall<'a, C, A> { + self._profile_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) -> FloodlightActivityInsertCall<'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) -> FloodlightActivityInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing floodlight activity. +/// +/// A builder for the *delete* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_activities().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityDeleteCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight activity ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> FloodlightActivityDeleteCall<'a, C, A> { + self._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) -> FloodlightActivityDeleteCall<'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) -> FloodlightActivityDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing floodlight activity. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightActivity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightActivity::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.floodlight_activities().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightActivity, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityPatchCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityPatchCall<'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, FloodlightActivity)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightActivity) -> FloodlightActivityPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight activity ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> FloodlightActivityPatchCall<'a, C, A> { + self._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) -> FloodlightActivityPatchCall<'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) -> FloodlightActivityPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Generates a tag for a floodlight activity. +/// +/// A builder for the *generatetag* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_activities().generatetag("profileId") +/// .floodlight_activity_id("erat") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityGeneratetagCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _floodlight_activity_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityGeneratetagCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityGeneratetagCall<'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, FloodlightActivitiesGenerateTagResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.generatetag", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._floodlight_activity_id { + params.push(("floodlightActivityId", value.to_string())); + } + for &field in ["alt", "profileId", "floodlightActivityId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities/generatetag"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityGeneratetagCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight activity ID for which we want to generate a tag. + /// + /// Sets the *floodlight activity id* query property to the given value. + pub fn floodlight_activity_id(mut self, new_value: &str) -> FloodlightActivityGeneratetagCall<'a, C, A> { + self._floodlight_activity_id = 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) -> FloodlightActivityGeneratetagCall<'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) -> FloodlightActivityGeneratetagCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityGeneratetagCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing floodlight activity. +/// +/// A builder for the *update* method supported by a *floodlightActivity* resource. +/// It is not used directly, but through a `FloodlightActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightActivity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightActivity::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.floodlight_activities().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightActivityUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightActivity, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightActivityUpdateCall<'a, C, A> {} + +impl<'a, C, A> FloodlightActivityUpdateCall<'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, FloodlightActivity)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightActivities.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightActivities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightActivity) -> FloodlightActivityUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightActivityUpdateCall<'a, C, A> { + self._profile_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) -> FloodlightActivityUpdateCall<'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) -> FloodlightActivityUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightActivityUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of regions. +/// +/// A builder for the *list* method supported by a *region* resource. +/// It is not used directly, but through a `RegionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.regions().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct RegionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionListCall<'a, C, A> {} + +impl<'a, C, A> RegionListCall<'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, RegionsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.regions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RegionListCall<'a, C, A> { + self._profile_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) -> RegionListCall<'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) -> RegionListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RegionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new creative group. +/// +/// A builder for the *insert* method supported by a *creativeGroup* resource. +/// It is not used directly, but through a `CreativeGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeGroup::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.creative_groups().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeGroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeGroupInsertCall<'a, C, A> {} + +impl<'a, C, A> CreativeGroupInsertCall<'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, CreativeGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeGroups.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeGroup) -> CreativeGroupInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeGroupInsertCall<'a, C, A> { + self._profile_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) -> CreativeGroupInsertCall<'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) -> CreativeGroupInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeGroupInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one creative group by ID. +/// +/// A builder for the *get* method supported by a *creativeGroup* resource. +/// It is not used directly, but through a `CreativeGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_groups().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeGroupGetCall<'a, C, A> {} + +impl<'a, C, A> CreativeGroupGetCall<'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, CreativeGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeGroupGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CreativeGroupGetCall<'a, C, A> { + self._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) -> CreativeGroupGetCall<'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) -> CreativeGroupGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative group. +/// +/// A builder for the *update* method supported by a *creativeGroup* resource. +/// It is not used directly, but through a `CreativeGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeGroup::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.creative_groups().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeGroupUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeGroupUpdateCall<'a, C, A> {} + +impl<'a, C, A> CreativeGroupUpdateCall<'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, CreativeGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeGroups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeGroup) -> CreativeGroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeGroupUpdateCall<'a, C, A> { + self._profile_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) -> CreativeGroupUpdateCall<'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) -> CreativeGroupUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeGroupUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of creative groups, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *creativeGroup* resource. +/// It is not used directly, but through a `CreativeGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_groups().list("profileId") +/// .sort_order("justo") +/// .sort_field("labore") +/// .search_string("voluptua.") +/// .page_token("takimata") +/// .max_results(-48) +/// .add_ids("takimata") +/// .group_number(-28) +/// .add_advertiser_ids("no") +/// .doit(); +/// # } +/// ``` +pub struct CreativeGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _group_number: Option, + _advertiser_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeGroupListCall<'a, C, A> {} + +impl<'a, C, A> CreativeGroupListCall<'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, CreativeGroupsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._group_number { + params.push(("groupNumber", value.to_string())); + } + if self._advertiser_ids.len() > 0 { + for f in self._advertiser_ids.iter() { + params.push(("advertiserIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "groupNumber", "advertiserIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> CreativeGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only creative groups with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only creative groups that belong to this subgroup. + /// + /// Sets the *group number* query property to the given value. + pub fn group_number(mut self, new_value: i32) -> CreativeGroupListCall<'a, C, A> { + self._group_number = Some(new_value); + self + } + /// Select only creative groups that belong to these advertisers. + /// + /// Append the given value to the *advertiser ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_ids(mut self, new_value: &str) -> CreativeGroupListCall<'a, C, A> { + self._advertiser_ids.push(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) -> CreativeGroupListCall<'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) -> CreativeGroupListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative group. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *creativeGroup* resource. +/// It is not used directly, but through a `CreativeGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeGroup::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.creative_groups().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeGroupPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeGroup, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeGroupPatchCall<'a, C, A> {} + +impl<'a, C, A> CreativeGroupPatchCall<'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, CreativeGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeGroups.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeGroup) -> CreativeGroupPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeGroupPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative group ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> CreativeGroupPatchCall<'a, C, A> { + self._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) -> CreativeGroupPatchCall<'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) -> CreativeGroupPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeGroupPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing targeting template. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *targetingTemplate* resource. +/// It is not used directly, but through a `TargetingTemplateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::TargetingTemplate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TargetingTemplate::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.targeting_templates().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct TargetingTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: TargetingTemplate, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetingTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> TargetingTemplatePatchCall<'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, TargetingTemplate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetingTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetingTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TargetingTemplate) -> TargetingTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetingTemplatePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Targeting template ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> TargetingTemplatePatchCall<'a, C, A> { + self._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) -> TargetingTemplatePatchCall<'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) -> TargetingTemplatePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetingTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of targeting templates, optionally filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *targetingTemplate* resource. +/// It is not used directly, but through a `TargetingTemplateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.targeting_templates().list("profileId") +/// .sort_order("sit") +/// .sort_field("et") +/// .search_string("consetetur") +/// .page_token("sea") +/// .max_results(-91) +/// .add_ids("consetetur") +/// .advertiser_id("accusam") +/// .doit(); +/// # } +/// ``` +pub struct TargetingTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _advertiser_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetingTemplateListCall<'a, C, A> {} + +impl<'a, C, A> TargetingTemplateListCall<'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, TargetingTemplatesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetingTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "advertiserId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetingTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> TargetingTemplateListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only targeting templates with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only targeting templates with this advertiser ID. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> TargetingTemplateListCall<'a, C, A> { + self._advertiser_id = 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) -> TargetingTemplateListCall<'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) -> TargetingTemplateListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetingTemplateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one targeting template by ID. +/// +/// A builder for the *get* method supported by a *targetingTemplate* resource. +/// It is not used directly, but through a `TargetingTemplateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.targeting_templates().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct TargetingTemplateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetingTemplateGetCall<'a, C, A> {} + +impl<'a, C, A> TargetingTemplateGetCall<'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, TargetingTemplate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetingTemplates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetingTemplates/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetingTemplateGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Targeting template ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> TargetingTemplateGetCall<'a, C, A> { + self._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) -> TargetingTemplateGetCall<'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) -> TargetingTemplateGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetingTemplateGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new targeting template. +/// +/// A builder for the *insert* method supported by a *targetingTemplate* resource. +/// It is not used directly, but through a `TargetingTemplateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::TargetingTemplate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TargetingTemplate::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.targeting_templates().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct TargetingTemplateInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: TargetingTemplate, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetingTemplateInsertCall<'a, C, A> {} + +impl<'a, C, A> TargetingTemplateInsertCall<'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, TargetingTemplate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetingTemplates.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetingTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TargetingTemplate) -> TargetingTemplateInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetingTemplateInsertCall<'a, C, A> { + self._profile_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) -> TargetingTemplateInsertCall<'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) -> TargetingTemplateInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetingTemplateInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing targeting template. +/// +/// A builder for the *update* method supported by a *targetingTemplate* resource. +/// It is not used directly, but through a `TargetingTemplateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::TargetingTemplate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TargetingTemplate::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.targeting_templates().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct TargetingTemplateUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: TargetingTemplate, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetingTemplateUpdateCall<'a, C, A> {} + +impl<'a, C, A> TargetingTemplateUpdateCall<'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, TargetingTemplate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.targetingTemplates.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/targetingTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TargetingTemplate) -> TargetingTemplateUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> TargetingTemplateUpdateCall<'a, C, A> { + self._profile_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) -> TargetingTemplateUpdateCall<'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) -> TargetingTemplateUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TargetingTemplateUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing subaccount. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *subaccount* resource. +/// It is not used directly, but through a `SubaccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Subaccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Subaccount::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.subaccounts().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct SubaccountPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Subaccount, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SubaccountPatchCall<'a, C, A> {} + +impl<'a, C, A> SubaccountPatchCall<'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, Subaccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.subaccounts.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Subaccount) -> SubaccountPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SubaccountPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Subaccount ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> SubaccountPatchCall<'a, C, A> { + self._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) -> SubaccountPatchCall<'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) -> SubaccountPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SubaccountPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new subaccount. +/// +/// A builder for the *insert* method supported by a *subaccount* resource. +/// It is not used directly, but through a `SubaccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Subaccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Subaccount::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.subaccounts().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct SubaccountInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Subaccount, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SubaccountInsertCall<'a, C, A> {} + +impl<'a, C, A> SubaccountInsertCall<'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, Subaccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.subaccounts.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Subaccount) -> SubaccountInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SubaccountInsertCall<'a, C, A> { + self._profile_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) -> SubaccountInsertCall<'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) -> SubaccountInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SubaccountInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing subaccount. +/// +/// A builder for the *update* method supported by a *subaccount* resource. +/// It is not used directly, but through a `SubaccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Subaccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Subaccount::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.subaccounts().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct SubaccountUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Subaccount, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SubaccountUpdateCall<'a, C, A> {} + +impl<'a, C, A> SubaccountUpdateCall<'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, Subaccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.subaccounts.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Subaccount) -> SubaccountUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SubaccountUpdateCall<'a, C, A> { + self._profile_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) -> SubaccountUpdateCall<'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) -> SubaccountUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SubaccountUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a list of subaccounts, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *subaccount* resource. +/// It is not used directly, but through a `SubaccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.subaccounts().list("profileId") +/// .sort_order("sit") +/// .sort_field("dolores") +/// .search_string("et") +/// .page_token("sanctus") +/// .max_results(-58) +/// .add_ids("kasd") +/// .doit(); +/// # } +/// ``` +pub struct SubaccountListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SubaccountListCall<'a, C, A> {} + +impl<'a, C, A> SubaccountListCall<'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, SubaccountsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.subaccounts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SubaccountListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> SubaccountListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> SubaccountListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> SubaccountListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SubaccountListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> SubaccountListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only subaccounts with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> SubaccountListCall<'a, C, A> { + self._ids.push(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) -> SubaccountListCall<'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) -> SubaccountListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SubaccountListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one subaccount by ID. +/// +/// A builder for the *get* method supported by a *subaccount* resource. +/// It is not used directly, but through a `SubaccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.subaccounts().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct SubaccountGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SubaccountGetCall<'a, C, A> {} + +impl<'a, C, A> SubaccountGetCall<'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, Subaccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.subaccounts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SubaccountGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Subaccount ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> SubaccountGetCall<'a, C, A> { + self._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) -> SubaccountGetCall<'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) -> SubaccountGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SubaccountGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one mobile carrier by ID. +/// +/// A builder for the *get* method supported by a *mobileCarrier* resource. +/// It is not used directly, but through a `MobileCarrierMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.mobile_carriers().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct MobileCarrierGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MobileCarrierGetCall<'a, C, A> {} + +impl<'a, C, A> MobileCarrierGetCall<'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, MobileCarrier)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.mobileCarriers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> MobileCarrierGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Mobile carrier ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> MobileCarrierGetCall<'a, C, A> { + self._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) -> MobileCarrierGetCall<'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) -> MobileCarrierGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MobileCarrierGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of mobile carriers. +/// +/// A builder for the *list* method supported by a *mobileCarrier* resource. +/// It is not used directly, but through a `MobileCarrierMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.mobile_carriers().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct MobileCarrierListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MobileCarrierListCall<'a, C, A> {} + +impl<'a, C, A> MobileCarrierListCall<'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, MobileCarriersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.mobileCarriers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> MobileCarrierListCall<'a, C, A> { + self._profile_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) -> MobileCarrierListCall<'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) -> MobileCarrierListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MobileCarrierListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one floodlight configuration by ID. +/// +/// A builder for the *get* method supported by a *floodlightConfiguration* resource. +/// It is not used directly, but through a `FloodlightConfigurationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_configurations().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightConfigurationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightConfigurationGetCall<'a, C, A> {} + +impl<'a, C, A> FloodlightConfigurationGetCall<'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, FloodlightConfiguration)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightConfigurations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightConfigurations/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightConfigurationGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight configuration ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> FloodlightConfigurationGetCall<'a, C, A> { + self._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) -> FloodlightConfigurationGetCall<'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) -> FloodlightConfigurationGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightConfigurationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing floodlight configuration. +/// +/// A builder for the *update* method supported by a *floodlightConfiguration* resource. +/// It is not used directly, but through a `FloodlightConfigurationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightConfiguration; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightConfiguration::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.floodlight_configurations().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightConfigurationUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightConfiguration, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightConfigurationUpdateCall<'a, C, A> {} + +impl<'a, C, A> FloodlightConfigurationUpdateCall<'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, FloodlightConfiguration)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightConfigurations.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightConfigurations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightConfiguration) -> FloodlightConfigurationUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightConfigurationUpdateCall<'a, C, A> { + self._profile_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) -> FloodlightConfigurationUpdateCall<'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) -> FloodlightConfigurationUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightConfigurationUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing floodlight configuration. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *floodlightConfiguration* resource. +/// It is not used directly, but through a `FloodlightConfigurationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::FloodlightConfiguration; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = FloodlightConfiguration::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.floodlight_configurations().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightConfigurationPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: FloodlightConfiguration, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightConfigurationPatchCall<'a, C, A> {} + +impl<'a, C, A> FloodlightConfigurationPatchCall<'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, FloodlightConfiguration)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightConfigurations.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightConfigurations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: FloodlightConfiguration) -> FloodlightConfigurationPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightConfigurationPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Floodlight configuration ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> FloodlightConfigurationPatchCall<'a, C, A> { + self._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) -> FloodlightConfigurationPatchCall<'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) -> FloodlightConfigurationPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightConfigurationPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of floodlight configurations, possibly filtered. +/// +/// A builder for the *list* method supported by a *floodlightConfiguration* resource. +/// It is not used directly, but through a `FloodlightConfigurationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.floodlight_configurations().list("profileId") +/// .add_ids("et") +/// .doit(); +/// # } +/// ``` +pub struct FloodlightConfigurationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FloodlightConfigurationListCall<'a, C, A> {} + +impl<'a, C, A> FloodlightConfigurationListCall<'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, FloodlightConfigurationsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.floodlightConfigurations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/floodlightConfigurations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FloodlightConfigurationListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> FloodlightConfigurationListCall<'a, C, A> { + self._ids.push(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) -> FloodlightConfigurationListCall<'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) -> FloodlightConfigurationListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FloodlightConfigurationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of operating systems. +/// +/// A builder for the *list* method supported by a *operatingSystem* resource. +/// It is not used directly, but through a `OperatingSystemMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.operating_systems().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct OperatingSystemListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperatingSystemListCall<'a, C, A> {} + +impl<'a, C, A> OperatingSystemListCall<'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, OperatingSystemsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.operatingSystems.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/operatingSystems"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OperatingSystemListCall<'a, C, A> { + self._profile_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) -> OperatingSystemListCall<'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) -> OperatingSystemListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OperatingSystemListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one operating system by DART ID. +/// +/// A builder for the *get* method supported by a *operatingSystem* resource. +/// It is not used directly, but through a `OperatingSystemMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.operating_systems().get("profileId", "dartId") +/// .doit(); +/// # } +/// ``` +pub struct OperatingSystemGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _dart_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperatingSystemGetCall<'a, C, A> {} + +impl<'a, C, A> OperatingSystemGetCall<'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, OperatingSystem)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.operatingSystems.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("dartId", self._dart_id.to_string())); + for &field in ["alt", "profileId", "dartId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/operatingSystems/{dartId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{dartId}", "dartId")].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 ["dartId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> OperatingSystemGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Operating system DART ID. + /// + /// Sets the *dart 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 dart_id(mut self, new_value: &str) -> OperatingSystemGetCall<'a, C, A> { + self._dart_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) -> OperatingSystemGetCall<'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) -> OperatingSystemGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OperatingSystemGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists files for a user profile. +/// +/// A builder for the *list* method supported by a *file* resource. +/// It is not used directly, but through a `FileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.files().list("profileId") +/// .sort_order("sed") +/// .sort_field("tempor") +/// .scope("clita") +/// .page_token("kasd") +/// .max_results(-94) +/// .doit(); +/// # } +/// ``` +pub struct FileListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _scope: Option, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FileListCall<'a, C, A> {} + +impl<'a, C, A> FileListCall<'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, FileList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.files.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._scope { + params.push(("scope", value.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())); + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "scope", "pageToken", "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 = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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 DFA profile ID. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// The field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// The scope that defines which results are returned. + /// + /// Sets the *scope* query property to the given value. + pub fn scope(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._scope = Some(new_value.to_string()); + self + } + /// The value of the nextToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> FileListCall<'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) -> FileListCall<'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) -> FileListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FileListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a report file by its report ID and file ID. This method supports media download. +/// +/// This method supports **media download**. To enable it, adjust the builder like this: +/// `.param("alt", "media")`. +/// Please note that due to missing multi-part support on the server side, you will only receive the media, +/// but not the `File` structure that you would usually get. The latter will be a default value. +/// +/// A builder for the *get* method supported by a *file* resource. +/// It is not used directly, but through a `FileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.files().get("reportId", "fileId") +/// .doit(); +/// # } +/// ``` +pub struct FileGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _report_id: String, + _file_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FileGetCall<'a, C, A> {} + +impl<'a, C, A> FileGetCall<'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, File)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.files.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("reportId", self._report_id.to_string())); + params.push(("fileId", self._file_id.to_string())); + for &field in ["reportId", "fileId"].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 (json_field_missing, enable_resource_parsing) = { + let mut enable = true; + let mut field_present = true; + for &(name, ref value) in params.iter() { + if name == "alt" { + field_present = false; + if >::as_ref(&value) != "json" { + enable = false; + } + break; + } + } + (field_present, enable) + }; + if json_field_missing { + params.push(("alt", "json".to_string())); + } + + let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{reportId}", "reportId"), ("{fileId}", "fileId")].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 ["fileId", "reportId"].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(Bearer { 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(d); + 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(d); + 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 = if enable_resource_parsing { + 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)); + } + } + } else { (res, Default::default()) }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the report. + /// + /// Sets the *report 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 report_id(mut self, new_value: &str) -> FileGetCall<'a, C, A> { + self._report_id = new_value.to_string(); + self + } + /// The ID of the report file. + /// + /// Sets the *file 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 file_id(mut self, new_value: &str) -> FileGetCall<'a, C, A> { + self._file_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) -> FileGetCall<'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) -> FileGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FileGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of placement groups, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *placementGroup* resource. +/// It is not used directly, but through a `PlacementGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placement_groups().list("profileId") +/// .sort_order("sed") +/// .sort_field("vero") +/// .add_site_ids("nonumy") +/// .search_string("magna") +/// .add_pricing_types("ea") +/// .add_placement_strategy_ids("sea") +/// .placement_group_type("ipsum") +/// .page_token("labore") +/// .min_start_date("Lorem") +/// .min_end_date("aliquyam") +/// .max_start_date("sanctus") +/// .max_results(-34) +/// .max_end_date("consetetur") +/// .add_ids("et") +/// .add_directory_site_ids("justo") +/// .add_content_category_ids("kasd") +/// .add_campaign_ids("kasd") +/// .archived(true) +/// .add_advertiser_ids("eos") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _site_ids: Vec, + _search_string: Option, + _pricing_types: Vec, + _placement_strategy_ids: Vec, + _placement_group_type: Option, + _page_token: Option, + _min_start_date: Option, + _min_end_date: Option, + _max_start_date: Option, + _max_results: Option, + _max_end_date: Option, + _ids: Vec, + _directory_site_ids: Vec, + _content_category_ids: Vec, + _campaign_ids: Vec, + _archived: Option, + _advertiser_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGroupListCall<'a, C, A> {} + +impl<'a, C, A> PlacementGroupListCall<'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, PlacementGroupsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((22 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._site_ids.len() > 0 { + for f in self._site_ids.iter() { + params.push(("siteIds", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if self._pricing_types.len() > 0 { + for f in self._pricing_types.iter() { + params.push(("pricingTypes", f.to_string())); + } + } + if self._placement_strategy_ids.len() > 0 { + for f in self._placement_strategy_ids.iter() { + params.push(("placementStrategyIds", f.to_string())); + } + } + if let Some(value) = self._placement_group_type { + params.push(("placementGroupType", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._min_start_date { + params.push(("minStartDate", value.to_string())); + } + if let Some(value) = self._min_end_date { + params.push(("minEndDate", value.to_string())); + } + if let Some(value) = self._max_start_date { + params.push(("maxStartDate", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._max_end_date { + params.push(("maxEndDate", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._directory_site_ids.len() > 0 { + for f in self._directory_site_ids.iter() { + params.push(("directorySiteIds", f.to_string())); + } + } + if self._content_category_ids.len() > 0 { + for f in self._content_category_ids.iter() { + params.push(("contentCategoryIds", f.to_string())); + } + } + if self._campaign_ids.len() > 0 { + for f in self._campaign_ids.iter() { + params.push(("campaignIds", f.to_string())); + } + } + if let Some(value) = self._archived { + params.push(("archived", value.to_string())); + } + if self._advertiser_ids.len() > 0 { + for f in self._advertiser_ids.iter() { + params.push(("advertiserIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "siteIds", "searchString", "pricingTypes", "placementStrategyIds", "placementGroupType", "pageToken", "minStartDate", "minEndDate", "maxStartDate", "maxResults", "maxEndDate", "ids", "directorySiteIds", "contentCategoryIds", "campaignIds", "archived", "advertiserIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only placement groups that are associated with these sites. + /// + /// Append the given value to the *site ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_site_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._site_ids.push(new_value.to_string()); + self + } + /// Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Select only placement groups with these pricing types. + /// + /// Append the given value to the *pricing types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_pricing_types(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._pricing_types.push(new_value.to_string()); + self + } + /// Select only placement groups that are associated with these placement strategies. + /// + /// Append the given value to the *placement strategy ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_placement_strategy_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._placement_strategy_ids.push(new_value.to_string()); + self + } + /// Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + /// + /// Sets the *placement group type* query property to the given value. + pub fn placement_group_type(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._placement_group_type = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *min start date* query property to the given value. + pub fn min_start_date(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._min_start_date = Some(new_value.to_string()); + self + } + /// Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *min end date* query property to the given value. + pub fn min_end_date(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._min_end_date = Some(new_value.to_string()); + self + } + /// Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *max start date* query property to the given value. + pub fn max_start_date(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._max_start_date = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> PlacementGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *max end date* query property to the given value. + pub fn max_end_date(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._max_end_date = Some(new_value.to_string()); + self + } + /// Select only placement groups with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only placement groups that are associated with these directory sites. + /// + /// Append the given value to the *directory site ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_directory_site_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._directory_site_ids.push(new_value.to_string()); + self + } + /// Select only placement groups that are associated with these content categories. + /// + /// Append the given value to the *content category ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_content_category_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._content_category_ids.push(new_value.to_string()); + self + } + /// Select only placement groups that belong to these campaigns. + /// + /// Append the given value to the *campaign ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_campaign_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._campaign_ids.push(new_value.to_string()); + self + } + /// Select only archived placements. Don't set this field to select both archived and non-archived placements. + /// + /// Sets the *archived* query property to the given value. + pub fn archived(mut self, new_value: bool) -> PlacementGroupListCall<'a, C, A> { + self._archived = Some(new_value); + self + } + /// Select only placement groups that belong to these advertisers. + /// + /// Append the given value to the *advertiser ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_ids(mut self, new_value: &str) -> PlacementGroupListCall<'a, C, A> { + self._advertiser_ids.push(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) -> PlacementGroupListCall<'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) -> PlacementGroupListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing placement group. +/// +/// A builder for the *update* method supported by a *placementGroup* resource. +/// It is not used directly, but through a `PlacementGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::PlacementGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PlacementGroup::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.placement_groups().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGroupUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: PlacementGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGroupUpdateCall<'a, C, A> {} + +impl<'a, C, A> PlacementGroupUpdateCall<'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, PlacementGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementGroups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PlacementGroup) -> PlacementGroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGroupUpdateCall<'a, C, A> { + self._profile_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) -> PlacementGroupUpdateCall<'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) -> PlacementGroupUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGroupUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new placement group. +/// +/// A builder for the *insert* method supported by a *placementGroup* resource. +/// It is not used directly, but through a `PlacementGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::PlacementGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PlacementGroup::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.placement_groups().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: PlacementGroup, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGroupInsertCall<'a, C, A> {} + +impl<'a, C, A> PlacementGroupInsertCall<'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, PlacementGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementGroups.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PlacementGroup) -> PlacementGroupInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGroupInsertCall<'a, C, A> { + self._profile_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) -> PlacementGroupInsertCall<'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) -> PlacementGroupInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGroupInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one placement group by ID. +/// +/// A builder for the *get* method supported by a *placementGroup* resource. +/// It is not used directly, but through a `PlacementGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placement_groups().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGroupGetCall<'a, C, A> {} + +impl<'a, C, A> PlacementGroupGetCall<'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, PlacementGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGroupGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> PlacementGroupGetCall<'a, C, A> { + self._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) -> PlacementGroupGetCall<'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) -> PlacementGroupGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing placement group. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *placementGroup* resource. +/// It is not used directly, but through a `PlacementGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::PlacementGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PlacementGroup::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.placement_groups().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGroupPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: PlacementGroup, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGroupPatchCall<'a, C, A> {} + +impl<'a, C, A> PlacementGroupPatchCall<'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, PlacementGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementGroups.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PlacementGroup) -> PlacementGroupPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGroupPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement group ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> PlacementGroupPatchCall<'a, C, A> { + self._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) -> PlacementGroupPatchCall<'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) -> PlacementGroupPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGroupPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of inventory items, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *inventoryItem* resource. +/// It is not used directly, but through a `InventoryItemMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inventory_items().list("profileId", "projectId") +/// .type_("consetetur") +/// .sort_order("tempor") +/// .sort_field("amet") +/// .add_site_id("Lorem") +/// .page_token("eirmod") +/// .add_order_id("elitr") +/// .max_results(-13) +/// .in_plan(true) +/// .add_ids("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct InventoryItemListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _project_id: String, + _type_: Option, + _sort_order: Option, + _sort_field: Option, + _site_id: Vec, + _page_token: Option, + _order_id: Vec, + _max_results: Option, + _in_plan: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InventoryItemListCall<'a, C, A> {} + +impl<'a, C, A> InventoryItemListCall<'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, InventoryItemsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.inventoryItems.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("projectId", self._project_id.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._site_id.len() > 0 { + for f in self._site_id.iter() { + params.push(("siteId", f.to_string())); + } + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if self._order_id.len() > 0 { + for f in self._order_id.iter() { + params.push(("orderId", f.to_string())); + } + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._in_plan { + params.push(("inPlan", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "projectId", "type", "sortOrder", "sortField", "siteId", "pageToken", "orderId", "maxResults", "inPlan", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{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(2); + for param_name in ["projectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID for order documents. + /// + /// 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) -> InventoryItemListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Select only inventory items with this type. + /// + /// Sets the *type* query property to the given value. + pub fn type_(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._type_ = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only inventory items that are associated with these sites. + /// + /// Append the given value to the *site id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_site_id(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._site_id.push(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only inventory items that belong to specified orders. + /// + /// Append the given value to the *order id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_order_id(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._order_id.push(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> InventoryItemListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only inventory items that are in plan. + /// + /// Sets the *in plan* query property to the given value. + pub fn in_plan(mut self, new_value: bool) -> InventoryItemListCall<'a, C, A> { + self._in_plan = Some(new_value); + self + } + /// Select only inventory items with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> InventoryItemListCall<'a, C, A> { + self._ids.push(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) -> InventoryItemListCall<'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) -> InventoryItemListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InventoryItemListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one inventory item by ID. +/// +/// A builder for the *get* method supported by a *inventoryItem* resource. +/// It is not used directly, but through a `InventoryItemMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inventory_items().get("profileId", "projectId", "id") +/// .doit(); +/// # } +/// ``` +pub struct InventoryItemGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _project_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InventoryItemGetCall<'a, C, A> {} + +impl<'a, C, A> InventoryItemGetCall<'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, InventoryItem)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.inventoryItems.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("projectId", self._project_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "projectId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{projectId}", "projectId"), ("{id}", "id")].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 ["id", "projectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> InventoryItemGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID for order documents. + /// + /// 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) -> InventoryItemGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Inventory item ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> InventoryItemGetCall<'a, C, A> { + self._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) -> InventoryItemGetCall<'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) -> InventoryItemGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InventoryItemGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one user role permission by ID. +/// +/// A builder for the *get* method supported by a *userRolePermission* resource. +/// It is not used directly, but through a `UserRolePermissionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_role_permissions().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserRolePermissionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRolePermissionGetCall<'a, C, A> {} + +impl<'a, C, A> UserRolePermissionGetCall<'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, UserRolePermission)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRolePermissions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRolePermissions/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRolePermissionGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User role permission ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> UserRolePermissionGetCall<'a, C, A> { + self._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) -> UserRolePermissionGetCall<'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) -> UserRolePermissionGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRolePermissionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a list of user role permissions, possibly filtered. +/// +/// A builder for the *list* method supported by a *userRolePermission* resource. +/// It is not used directly, but through a `UserRolePermissionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.user_role_permissions().list("profileId") +/// .add_ids("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct UserRolePermissionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserRolePermissionListCall<'a, C, A> {} + +impl<'a, C, A> UserRolePermissionListCall<'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, UserRolePermissionsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.userRolePermissions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/userRolePermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> UserRolePermissionListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only user role permissions with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> UserRolePermissionListCall<'a, C, A> { + self._ids.push(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) -> UserRolePermissionListCall<'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) -> UserRolePermissionListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserRolePermissionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of account permission groups. +/// +/// A builder for the *list* method supported by a *accountPermissionGroup* resource. +/// It is not used directly, but through a `AccountPermissionGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_permission_groups().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct AccountPermissionGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountPermissionGroupListCall<'a, C, A> {} + +impl<'a, C, A> AccountPermissionGroupListCall<'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, AccountPermissionGroupsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountPermissionGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountPermissionGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountPermissionGroupListCall<'a, C, A> { + self._profile_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) -> AccountPermissionGroupListCall<'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) -> AccountPermissionGroupListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountPermissionGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one account permission group by ID. +/// +/// A builder for the *get* method supported by a *accountPermissionGroup* resource. +/// It is not used directly, but through a `AccountPermissionGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_permission_groups().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AccountPermissionGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountPermissionGroupGetCall<'a, C, A> {} + +impl<'a, C, A> AccountPermissionGroupGetCall<'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, AccountPermissionGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountPermissionGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountPermissionGroups/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountPermissionGroupGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Account permission group ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AccountPermissionGroupGetCall<'a, C, A> { + self._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) -> AccountPermissionGroupGetCall<'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) -> AccountPermissionGroupGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountPermissionGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of content categories, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *contentCategory* resource. +/// It is not used directly, but through a `ContentCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.content_categories().list("profileId") +/// .sort_order("Stet") +/// .sort_field("sea") +/// .search_string("sanctus") +/// .page_token("gubergren") +/// .max_results(-56) +/// .add_ids("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct ContentCategoryListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentCategoryListCall<'a, C, A> {} + +impl<'a, C, A> ContentCategoryListCall<'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, ContentCategoriesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.contentCategories.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/contentCategories"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ContentCategoryListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> ContentCategoryListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> ContentCategoryListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> ContentCategoryListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ContentCategoryListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ContentCategoryListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only content categories with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> ContentCategoryListCall<'a, C, A> { + self._ids.push(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) -> ContentCategoryListCall<'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) -> ContentCategoryListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentCategoryListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing content category. +/// +/// A builder for the *update* method supported by a *contentCategory* resource. +/// It is not used directly, but through a `ContentCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::ContentCategory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ContentCategory::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.content_categories().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct ContentCategoryUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: ContentCategory, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentCategoryUpdateCall<'a, C, A> {} + +impl<'a, C, A> ContentCategoryUpdateCall<'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, ContentCategory)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.contentCategories.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/contentCategories"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ContentCategory) -> ContentCategoryUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ContentCategoryUpdateCall<'a, C, A> { + self._profile_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) -> ContentCategoryUpdateCall<'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) -> ContentCategoryUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentCategoryUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new content category. +/// +/// A builder for the *insert* method supported by a *contentCategory* resource. +/// It is not used directly, but through a `ContentCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::ContentCategory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ContentCategory::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.content_categories().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct ContentCategoryInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: ContentCategory, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentCategoryInsertCall<'a, C, A> {} + +impl<'a, C, A> ContentCategoryInsertCall<'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, ContentCategory)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.contentCategories.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/contentCategories"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ContentCategory) -> ContentCategoryInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ContentCategoryInsertCall<'a, C, A> { + self._profile_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) -> ContentCategoryInsertCall<'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) -> ContentCategoryInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentCategoryInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing content category. +/// +/// A builder for the *delete* method supported by a *contentCategory* resource. +/// It is not used directly, but through a `ContentCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.content_categories().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct ContentCategoryDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentCategoryDeleteCall<'a, C, A> {} + +impl<'a, C, A> ContentCategoryDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.contentCategories.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/contentCategories/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ContentCategoryDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Content category ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> ContentCategoryDeleteCall<'a, C, A> { + self._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) -> ContentCategoryDeleteCall<'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) -> ContentCategoryDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentCategoryDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one content category by ID. +/// +/// A builder for the *get* method supported by a *contentCategory* resource. +/// It is not used directly, but through a `ContentCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.content_categories().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct ContentCategoryGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentCategoryGetCall<'a, C, A> {} + +impl<'a, C, A> ContentCategoryGetCall<'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, ContentCategory)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.contentCategories.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/contentCategories/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ContentCategoryGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Content category ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> ContentCategoryGetCall<'a, C, A> { + self._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) -> ContentCategoryGetCall<'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) -> ContentCategoryGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentCategoryGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing content category. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *contentCategory* resource. +/// It is not used directly, but through a `ContentCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::ContentCategory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ContentCategory::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.content_categories().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct ContentCategoryPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: ContentCategory, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentCategoryPatchCall<'a, C, A> {} + +impl<'a, C, A> ContentCategoryPatchCall<'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, ContentCategory)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.contentCategories.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/contentCategories"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ContentCategory) -> ContentCategoryPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ContentCategoryPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Content category ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> ContentCategoryPatchCall<'a, C, A> { + self._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) -> ContentCategoryPatchCall<'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) -> ContentCategoryPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentCategoryPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative. +/// +/// A builder for the *update* method supported by a *creative* resource. +/// It is not used directly, but through a `CreativeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Creative; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Creative::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.creatives().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Creative, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeUpdateCall<'a, C, A> {} + +impl<'a, C, A> CreativeUpdateCall<'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, Creative)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creatives.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Creative) -> CreativeUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeUpdateCall<'a, C, A> { + self._profile_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) -> CreativeUpdateCall<'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) -> CreativeUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new creative. +/// +/// A builder for the *insert* method supported by a *creative* resource. +/// It is not used directly, but through a `CreativeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Creative; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Creative::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.creatives().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Creative, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeInsertCall<'a, C, A> {} + +impl<'a, C, A> CreativeInsertCall<'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, Creative)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creatives.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Creative) -> CreativeInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeInsertCall<'a, C, A> { + self._profile_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) -> CreativeInsertCall<'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) -> CreativeInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one creative by ID. +/// +/// A builder for the *get* method supported by a *creative* resource. +/// It is not used directly, but through a `CreativeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creatives().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeGetCall<'a, C, A> {} + +impl<'a, C, A> CreativeGetCall<'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, Creative)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creatives.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CreativeGetCall<'a, C, A> { + self._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) -> CreativeGetCall<'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) -> CreativeGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of creatives, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *creative* resource. +/// It is not used directly, but through a `CreativeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creatives().list("profileId") +/// .add_types("diam") +/// .studio_creative_id("dolor") +/// .sort_order("eirmod") +/// .sort_field("amet") +/// .add_size_ids("ipsum") +/// .search_string("voluptua.") +/// .add_rendering_ids("eirmod") +/// .page_token("sed") +/// .max_results(-73) +/// .add_ids("sanctus") +/// .add_creative_field_ids("dolor") +/// .add_companion_creative_ids("dolor") +/// .campaign_id("dolore") +/// .archived(false) +/// .advertiser_id("ipsum") +/// .active(true) +/// .doit(); +/// # } +/// ``` +pub struct CreativeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _types: Vec, + _studio_creative_id: Option, + _sort_order: Option, + _sort_field: Option, + _size_ids: Vec, + _search_string: Option, + _rendering_ids: Vec, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _creative_field_ids: Vec, + _companion_creative_ids: Vec, + _campaign_id: Option, + _archived: Option, + _advertiser_id: Option, + _active: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeListCall<'a, C, A> {} + +impl<'a, C, A> CreativeListCall<'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, CreativesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creatives.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((19 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._types.len() > 0 { + for f in self._types.iter() { + params.push(("types", f.to_string())); + } + } + if let Some(value) = self._studio_creative_id { + params.push(("studioCreativeId", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._size_ids.len() > 0 { + for f in self._size_ids.iter() { + params.push(("sizeIds", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if self._rendering_ids.len() > 0 { + for f in self._rendering_ids.iter() { + params.push(("renderingIds", f.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._creative_field_ids.len() > 0 { + for f in self._creative_field_ids.iter() { + params.push(("creativeFieldIds", f.to_string())); + } + } + if self._companion_creative_ids.len() > 0 { + for f in self._companion_creative_ids.iter() { + params.push(("companionCreativeIds", f.to_string())); + } + } + if let Some(value) = self._campaign_id { + params.push(("campaignId", value.to_string())); + } + if let Some(value) = self._archived { + params.push(("archived", value.to_string())); + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + for &field in ["alt", "profileId", "types", "studioCreativeId", "sortOrder", "sortField", "sizeIds", "searchString", "renderingIds", "pageToken", "maxResults", "ids", "creativeFieldIds", "companionCreativeIds", "campaignId", "archived", "advertiserId", "active"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only creatives with these creative types. + /// + /// Append the given value to the *types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_types(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._types.push(new_value.to_string()); + self + } + /// Select only creatives corresponding to this Studio creative ID. + /// + /// Sets the *studio creative id* query property to the given value. + pub fn studio_creative_id(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._studio_creative_id = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only creatives with these size IDs. + /// + /// Append the given value to the *size ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_size_ids(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._size_ids.push(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Select only creatives with these rendering IDs. + /// + /// Append the given value to the *rendering ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_rendering_ids(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._rendering_ids.push(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> CreativeListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only creatives with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only creatives with these creative field IDs. + /// + /// Append the given value to the *creative field ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_creative_field_ids(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._creative_field_ids.push(new_value.to_string()); + self + } + /// Select only in-stream video creatives with these companion IDs. + /// + /// Append the given value to the *companion creative ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_companion_creative_ids(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._companion_creative_ids.push(new_value.to_string()); + self + } + /// Select only creatives with this campaign ID. + /// + /// Sets the *campaign id* query property to the given value. + pub fn campaign_id(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._campaign_id = Some(new_value.to_string()); + self + } + /// Select only archived creatives. Leave blank to select archived and unarchived creatives. + /// + /// Sets the *archived* query property to the given value. + pub fn archived(mut self, new_value: bool) -> CreativeListCall<'a, C, A> { + self._archived = Some(new_value); + self + } + /// Select only creatives with this advertiser ID. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> CreativeListCall<'a, C, A> { + self._advertiser_id = Some(new_value.to_string()); + self + } + /// Select only active creatives. Leave blank to select active and inactive creatives. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> CreativeListCall<'a, C, A> { + self._active = 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) -> CreativeListCall<'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) -> CreativeListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *creative* resource. +/// It is not used directly, but through a `CreativeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Creative; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Creative::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.creatives().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Creative, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativePatchCall<'a, C, A> {} + +impl<'a, C, A> CreativePatchCall<'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, Creative)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creatives.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Creative) -> CreativePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> CreativePatchCall<'a, C, A> { + self._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) -> CreativePatchCall<'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) -> CreativePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one campaign by ID. +/// +/// A builder for the *get* method supported by a *campaign* resource. +/// It is not used directly, but through a `CampaignMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.campaigns().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CampaignGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignGetCall<'a, C, A> {} + +impl<'a, C, A> CampaignGetCall<'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, Campaign)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaigns.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Campaign ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> CampaignGetCall<'a, C, A> { + self._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) -> CampaignGetCall<'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) -> CampaignGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new campaign. +/// +/// A builder for the *insert* method supported by a *campaign* resource. +/// It is not used directly, but through a `CampaignMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Campaign; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Campaign::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.campaigns().insert(req, "profileId", "defaultLandingPageName", "defaultLandingPageUrl") +/// .doit(); +/// # } +/// ``` +pub struct CampaignInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Campaign, + _profile_id: String, + _default_landing_page_name: String, + _default_landing_page_url: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignInsertCall<'a, C, A> {} + +impl<'a, C, A> CampaignInsertCall<'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, Campaign)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaigns.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("defaultLandingPageName", self._default_landing_page_name.to_string())); + params.push(("defaultLandingPageUrl", self._default_landing_page_url.to_string())); + for &field in ["alt", "profileId", "defaultLandingPageName", "defaultLandingPageUrl"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Campaign) -> CampaignInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignInsertCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Default landing page name for this new campaign. Must be less than 256 characters long. + /// + /// Sets the *default landing page name* 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. + pub fn default_landing_page_name(mut self, new_value: &str) -> CampaignInsertCall<'a, C, A> { + self._default_landing_page_name = new_value.to_string(); + self + } + /// Default landing page URL for this new campaign. + /// + /// Sets the *default landing page url* 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. + pub fn default_landing_page_url(mut self, new_value: &str) -> CampaignInsertCall<'a, C, A> { + self._default_landing_page_url = 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) -> CampaignInsertCall<'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) -> CampaignInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing campaign. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *campaign* resource. +/// It is not used directly, but through a `CampaignMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Campaign; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Campaign::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.campaigns().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CampaignPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Campaign, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignPatchCall<'a, C, A> {} + +impl<'a, C, A> CampaignPatchCall<'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, Campaign)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaigns.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Campaign) -> CampaignPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Campaign ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> CampaignPatchCall<'a, C, A> { + self._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) -> CampaignPatchCall<'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) -> CampaignPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing campaign. +/// +/// A builder for the *update* method supported by a *campaign* resource. +/// It is not used directly, but through a `CampaignMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Campaign; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Campaign::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.campaigns().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct CampaignUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Campaign, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignUpdateCall<'a, C, A> {} + +impl<'a, C, A> CampaignUpdateCall<'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, Campaign)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaigns.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Campaign) -> CampaignUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignUpdateCall<'a, C, A> { + self._profile_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) -> CampaignUpdateCall<'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) -> CampaignUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of campaigns, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *campaign* resource. +/// It is not used directly, but through a `CampaignMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.campaigns().list("profileId") +/// .subaccount_id("kasd") +/// .sort_order("sit") +/// .sort_field("justo") +/// .search_string("gubergren") +/// .page_token("ipsum") +/// .overridden_event_tag_id("amet.") +/// .max_results(-48) +/// .add_ids("sanctus") +/// .add_excluded_ids("ut") +/// .at_least_one_optimization_activity(true) +/// .archived(true) +/// .add_advertiser_ids("eirmod") +/// .add_advertiser_group_ids("ea") +/// .doit(); +/// # } +/// ``` +pub struct CampaignListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _subaccount_id: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _overridden_event_tag_id: Option, + _max_results: Option, + _ids: Vec, + _excluded_ids: Vec, + _at_least_one_optimization_activity: Option, + _archived: Option, + _advertiser_ids: Vec, + _advertiser_group_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CampaignListCall<'a, C, A> {} + +impl<'a, C, A> CampaignListCall<'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, CampaignsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.campaigns.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((16 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._subaccount_id { + params.push(("subaccountId", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._overridden_event_tag_id { + params.push(("overriddenEventTagId", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._excluded_ids.len() > 0 { + for f in self._excluded_ids.iter() { + params.push(("excludedIds", f.to_string())); + } + } + if let Some(value) = self._at_least_one_optimization_activity { + params.push(("atLeastOneOptimizationActivity", value.to_string())); + } + if let Some(value) = self._archived { + params.push(("archived", value.to_string())); + } + if self._advertiser_ids.len() > 0 { + for f in self._advertiser_ids.iter() { + params.push(("advertiserIds", f.to_string())); + } + } + if self._advertiser_group_ids.len() > 0 { + for f in self._advertiser_group_ids.iter() { + params.push(("advertiserGroupIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "subaccountId", "sortOrder", "sortField", "searchString", "pageToken", "overriddenEventTagId", "maxResults", "ids", "excludedIds", "atLeastOneOptimizationActivity", "archived", "advertiserIds", "advertiserGroupIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only campaigns that belong to this subaccount. + /// + /// Sets the *subaccount id* query property to the given value. + pub fn subaccount_id(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._subaccount_id = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only campaigns that have overridden this event tag ID. + /// + /// Sets the *overridden event tag id* query property to the given value. + pub fn overridden_event_tag_id(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._overridden_event_tag_id = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> CampaignListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only campaigns with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Exclude campaigns with these IDs. + /// + /// Append the given value to the *excluded ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_excluded_ids(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._excluded_ids.push(new_value.to_string()); + self + } + /// Select only campaigns that have at least one optimization activity. + /// + /// Sets the *at least one optimization activity* query property to the given value. + pub fn at_least_one_optimization_activity(mut self, new_value: bool) -> CampaignListCall<'a, C, A> { + self._at_least_one_optimization_activity = Some(new_value); + self + } + /// Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. + /// + /// Sets the *archived* query property to the given value. + pub fn archived(mut self, new_value: bool) -> CampaignListCall<'a, C, A> { + self._archived = Some(new_value); + self + } + /// Select only campaigns that belong to these advertisers. + /// + /// Append the given value to the *advertiser ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_ids(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._advertiser_ids.push(new_value.to_string()); + self + } + /// Select only campaigns whose advertisers belong to these advertiser groups. + /// + /// Append the given value to the *advertiser group ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_group_ids(mut self, new_value: &str) -> CampaignListCall<'a, C, A> { + self._advertiser_group_ids.push(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) -> CampaignListCall<'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) -> CampaignListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CampaignListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing event tag. +/// +/// A builder for the *delete* method supported by a *eventTag* resource. +/// It is not used directly, but through a `EventTagMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.event_tags().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct EventTagDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EventTagDeleteCall<'a, C, A> {} + +impl<'a, C, A> EventTagDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.eventTags.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> EventTagDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Event tag ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> EventTagDeleteCall<'a, C, A> { + self._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) -> EventTagDeleteCall<'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) -> EventTagDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EventTagDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of event tags, possibly filtered. +/// +/// A builder for the *list* method supported by a *eventTag* resource. +/// It is not used directly, but through a `EventTagMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.event_tags().list("profileId") +/// .sort_order("diam") +/// .sort_field("eos") +/// .search_string("tempor") +/// .add_ids("sea") +/// .add_event_tag_types("ea") +/// .enabled(false) +/// .definitions_only(false) +/// .campaign_id("tempor") +/// .advertiser_id("consetetur") +/// .ad_id("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct EventTagListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _ids: Vec, + _event_tag_types: Vec, + _enabled: Option, + _definitions_only: Option, + _campaign_id: Option, + _advertiser_id: Option, + _ad_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EventTagListCall<'a, C, A> {} + +impl<'a, C, A> EventTagListCall<'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, EventTagsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.eventTags.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._event_tag_types.len() > 0 { + for f in self._event_tag_types.iter() { + params.push(("eventTagTypes", f.to_string())); + } + } + if let Some(value) = self._enabled { + params.push(("enabled", value.to_string())); + } + if let Some(value) = self._definitions_only { + params.push(("definitionsOnly", value.to_string())); + } + if let Some(value) = self._campaign_id { + params.push(("campaignId", value.to_string())); + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + if let Some(value) = self._ad_id { + params.push(("adId", value.to_string())); + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "ids", "eventTagTypes", "enabled", "definitionsOnly", "campaignId", "advertiserId", "adId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Select only event tags with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. + /// + /// Append the given value to the *event tag types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_event_tag_types(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._event_tag_types.push(new_value.to_string()); + self + } + /// Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + /// + /// Sets the *enabled* query property to the given value. + pub fn enabled(mut self, new_value: bool) -> EventTagListCall<'a, C, A> { + self._enabled = Some(new_value); + self + } + /// Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + /// + /// Sets the *definitions only* query property to the given value. + pub fn definitions_only(mut self, new_value: bool) -> EventTagListCall<'a, C, A> { + self._definitions_only = Some(new_value); + self + } + /// Select only event tags that belong to this campaign. + /// + /// Sets the *campaign id* query property to the given value. + pub fn campaign_id(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._campaign_id = Some(new_value.to_string()); + self + } + /// Select only event tags that belong to this advertiser. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._advertiser_id = Some(new_value.to_string()); + self + } + /// Select only event tags that belong to this ad. + /// + /// Sets the *ad id* query property to the given value. + pub fn ad_id(mut self, new_value: &str) -> EventTagListCall<'a, C, A> { + self._ad_id = 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) -> EventTagListCall<'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) -> EventTagListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EventTagListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new event tag. +/// +/// A builder for the *insert* method supported by a *eventTag* resource. +/// It is not used directly, but through a `EventTagMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::EventTag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EventTag::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.event_tags().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct EventTagInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: EventTag, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EventTagInsertCall<'a, C, A> {} + +impl<'a, C, A> EventTagInsertCall<'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, EventTag)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.eventTags.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: EventTag) -> EventTagInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> EventTagInsertCall<'a, C, A> { + self._profile_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) -> EventTagInsertCall<'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) -> EventTagInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EventTagInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing event tag. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *eventTag* resource. +/// It is not used directly, but through a `EventTagMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::EventTag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EventTag::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.event_tags().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct EventTagPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: EventTag, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EventTagPatchCall<'a, C, A> {} + +impl<'a, C, A> EventTagPatchCall<'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, EventTag)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.eventTags.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: EventTag) -> EventTagPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> EventTagPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Event tag ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> EventTagPatchCall<'a, C, A> { + self._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) -> EventTagPatchCall<'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) -> EventTagPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EventTagPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing event tag. +/// +/// A builder for the *update* method supported by a *eventTag* resource. +/// It is not used directly, but through a `EventTagMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::EventTag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EventTag::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.event_tags().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct EventTagUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: EventTag, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EventTagUpdateCall<'a, C, A> {} + +impl<'a, C, A> EventTagUpdateCall<'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, EventTag)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.eventTags.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: EventTag) -> EventTagUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> EventTagUpdateCall<'a, C, A> { + self._profile_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) -> EventTagUpdateCall<'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) -> EventTagUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EventTagUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one event tag by ID. +/// +/// A builder for the *get* method supported by a *eventTag* resource. +/// It is not used directly, but through a `EventTagMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.event_tags().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct EventTagGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EventTagGetCall<'a, C, A> {} + +impl<'a, C, A> EventTagGetCall<'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, EventTag)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.eventTags.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> EventTagGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Event tag ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> EventTagGetCall<'a, C, A> { + self._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) -> EventTagGetCall<'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) -> EventTagGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> EventTagGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one remarketing list by ID. +/// +/// A builder for the *get* method supported by a *remarketingList* resource. +/// It is not used directly, but through a `RemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.remarketing_lists().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListGetCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListGetCall<'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, RemarketingList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingLists.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingLists/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Remarketing list ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> RemarketingListGetCall<'a, C, A> { + self._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) -> RemarketingListGetCall<'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) -> RemarketingListGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing remarketing list. +/// +/// A builder for the *update* method supported by a *remarketingList* resource. +/// It is not used directly, but through a `RemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::RemarketingList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemarketingList::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.remarketing_lists().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: RemarketingList, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListUpdateCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListUpdateCall<'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, RemarketingList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingLists.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingLists"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RemarketingList) -> RemarketingListUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListUpdateCall<'a, C, A> { + self._profile_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) -> RemarketingListUpdateCall<'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) -> RemarketingListUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of remarketing lists, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *remarketingList* resource. +/// It is not used directly, but through a `RemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.remarketing_lists().list("profileId", "advertiserId") +/// .sort_order("ipsum") +/// .sort_field("dolore") +/// .page_token("sadipscing") +/// .name("ipsum") +/// .max_results(-45) +/// .floodlight_activity_id("ea") +/// .active(true) +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _advertiser_id: String, + _sort_order: Option, + _sort_field: Option, + _page_token: Option, + _name: Option, + _max_results: Option, + _floodlight_activity_id: Option, + _active: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListListCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListListCall<'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, RemarketingListsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingLists.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("advertiserId", self._advertiser_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._name { + params.push(("name", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._floodlight_activity_id { + params.push(("floodlightActivityId", value.to_string())); + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + for &field in ["alt", "profileId", "advertiserId", "sortOrder", "sortField", "pageToken", "name", "maxResults", "floodlightActivityId", "active"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingLists"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only remarketing lists owned by this advertiser. + /// + /// Sets the *advertiser id* 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. + pub fn advertiser_id(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._advertiser_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + /// + /// Sets the *name* query property to the given value. + pub fn name(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._name = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> RemarketingListListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only remarketing lists that have this floodlight activity ID. + /// + /// Sets the *floodlight activity id* query property to the given value. + pub fn floodlight_activity_id(mut self, new_value: &str) -> RemarketingListListCall<'a, C, A> { + self._floodlight_activity_id = Some(new_value.to_string()); + self + } + /// Select only active or only inactive remarketing lists. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> RemarketingListListCall<'a, C, A> { + self._active = 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) -> RemarketingListListCall<'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) -> RemarketingListListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing remarketing list. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *remarketingList* resource. +/// It is not used directly, but through a `RemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::RemarketingList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemarketingList::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.remarketing_lists().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: RemarketingList, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListPatchCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListPatchCall<'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, RemarketingList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingLists.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingLists"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RemarketingList) -> RemarketingListPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Remarketing list ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> RemarketingListPatchCall<'a, C, A> { + self._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) -> RemarketingListPatchCall<'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) -> RemarketingListPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new remarketing list. +/// +/// A builder for the *insert* method supported by a *remarketingList* resource. +/// It is not used directly, but through a `RemarketingListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::RemarketingList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemarketingList::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.remarketing_lists().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct RemarketingListInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: RemarketingList, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RemarketingListInsertCall<'a, C, A> {} + +impl<'a, C, A> RemarketingListInsertCall<'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, RemarketingList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.remarketingLists.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/remarketingLists"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RemarketingList) -> RemarketingListInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> RemarketingListInsertCall<'a, C, A> { + self._profile_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) -> RemarketingListInsertCall<'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) -> RemarketingListInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RemarketingListInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of cities, possibly filtered. +/// +/// A builder for the *list* method supported by a *city* resource. +/// It is not used directly, but through a `CityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.cities().list("profileId") +/// .add_region_dart_ids("invidunt") +/// .name_prefix("amet.") +/// .add_dart_ids("sit") +/// .add_country_dart_ids("dolor") +/// .doit(); +/// # } +/// ``` +pub struct CityListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _region_dart_ids: Vec, + _name_prefix: Option, + _dart_ids: Vec, + _country_dart_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CityListCall<'a, C, A> {} + +impl<'a, C, A> CityListCall<'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, CitiesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.cities.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._region_dart_ids.len() > 0 { + for f in self._region_dart_ids.iter() { + params.push(("regionDartIds", f.to_string())); + } + } + if let Some(value) = self._name_prefix { + params.push(("namePrefix", value.to_string())); + } + if self._dart_ids.len() > 0 { + for f in self._dart_ids.iter() { + params.push(("dartIds", f.to_string())); + } + } + if self._country_dart_ids.len() > 0 { + for f in self._country_dart_ids.iter() { + params.push(("countryDartIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "regionDartIds", "namePrefix", "dartIds", "countryDartIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CityListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only cities from these regions. + /// + /// Append the given value to the *region dart ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_region_dart_ids(mut self, new_value: &str) -> CityListCall<'a, C, A> { + self._region_dart_ids.push(new_value.to_string()); + self + } + /// Select only cities with names starting with this prefix. + /// + /// Sets the *name prefix* query property to the given value. + pub fn name_prefix(mut self, new_value: &str) -> CityListCall<'a, C, A> { + self._name_prefix = Some(new_value.to_string()); + self + } + /// Select only cities with these DART IDs. + /// + /// Append the given value to the *dart ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_dart_ids(mut self, new_value: &str) -> CityListCall<'a, C, A> { + self._dart_ids.push(new_value.to_string()); + self + } + /// Select only cities from these countries. + /// + /// Append the given value to the *country dart ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_country_dart_ids(mut self, new_value: &str) -> CityListCall<'a, C, A> { + self._country_dart_ids.push(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) -> CityListCall<'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) -> CityListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CityListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing placement strategy. +/// +/// A builder for the *update* method supported by a *placementStrategy* resource. +/// It is not used directly, but through a `PlacementStrategyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::PlacementStrategy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PlacementStrategy::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.placement_strategies().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlacementStrategyUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: PlacementStrategy, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementStrategyUpdateCall<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyUpdateCall<'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, PlacementStrategy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementStrategies.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementStrategies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PlacementStrategy) -> PlacementStrategyUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementStrategyUpdateCall<'a, C, A> { + self._profile_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) -> PlacementStrategyUpdateCall<'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) -> PlacementStrategyUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementStrategyUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one placement strategy by ID. +/// +/// A builder for the *get* method supported by a *placementStrategy* resource. +/// It is not used directly, but through a `PlacementStrategyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placement_strategies().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementStrategyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementStrategyGetCall<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyGetCall<'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, PlacementStrategy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementStrategies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementStrategies/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementStrategyGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement strategy ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> PlacementStrategyGetCall<'a, C, A> { + self._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) -> PlacementStrategyGetCall<'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) -> PlacementStrategyGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementStrategyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of placement strategies, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *placementStrategy* resource. +/// It is not used directly, but through a `PlacementStrategyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placement_strategies().list("profileId") +/// .sort_order("nonumy") +/// .sort_field("accusam") +/// .search_string("est") +/// .page_token("sit") +/// .max_results(-81) +/// .add_ids("vero") +/// .doit(); +/// # } +/// ``` +pub struct PlacementStrategyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementStrategyListCall<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyListCall<'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, PlacementStrategiesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementStrategies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementStrategies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementStrategyListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> PlacementStrategyListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> PlacementStrategyListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> PlacementStrategyListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> PlacementStrategyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> PlacementStrategyListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only placement strategies with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> PlacementStrategyListCall<'a, C, A> { + self._ids.push(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) -> PlacementStrategyListCall<'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) -> PlacementStrategyListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementStrategyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing placement strategy. +/// +/// A builder for the *delete* method supported by a *placementStrategy* resource. +/// It is not used directly, but through a `PlacementStrategyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placement_strategies().delete("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementStrategyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementStrategyDeleteCall<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementStrategies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementStrategies/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementStrategyDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement strategy ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> PlacementStrategyDeleteCall<'a, C, A> { + self._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) -> PlacementStrategyDeleteCall<'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) -> PlacementStrategyDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementStrategyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new placement strategy. +/// +/// A builder for the *insert* method supported by a *placementStrategy* resource. +/// It is not used directly, but through a `PlacementStrategyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::PlacementStrategy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PlacementStrategy::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.placement_strategies().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlacementStrategyInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: PlacementStrategy, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementStrategyInsertCall<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyInsertCall<'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, PlacementStrategy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementStrategies.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementStrategies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PlacementStrategy) -> PlacementStrategyInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementStrategyInsertCall<'a, C, A> { + self._profile_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) -> PlacementStrategyInsertCall<'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) -> PlacementStrategyInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementStrategyInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing placement strategy. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *placementStrategy* resource. +/// It is not used directly, but through a `PlacementStrategyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::PlacementStrategy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = PlacementStrategy::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.placement_strategies().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementStrategyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: PlacementStrategy, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementStrategyPatchCall<'a, C, A> {} + +impl<'a, C, A> PlacementStrategyPatchCall<'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, PlacementStrategy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placementStrategies.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placementStrategies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: PlacementStrategy) -> PlacementStrategyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementStrategyPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement strategy ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> PlacementStrategyPatchCall<'a, C, A> { + self._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) -> PlacementStrategyPatchCall<'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) -> PlacementStrategyPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementStrategyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of projects, possibly filtered. This method supports paging. +/// +/// 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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("profileId") +/// .sort_order("diam") +/// .sort_field("ut") +/// .search_string("diam") +/// .page_token("eos") +/// .max_results(-94) +/// .add_ids("tempor") +/// .add_advertiser_ids("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct ProjectListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _advertiser_ids: Vec, + _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, ProjectsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.projects.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._advertiser_ids.len() > 0 { + for f in self._advertiser_ids.iter() { + params.push(("advertiserIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "advertiserIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// 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 + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ProjectListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only projects with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only projects with these advertiser IDs. + /// + /// Append the given value to the *advertiser ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_ids(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._advertiser_ids.push(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 + /// + /// * *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) -> 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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one project by ID. +/// +/// 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.projects.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> ProjectGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Project ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> ProjectGetCall<'a, C, A> { + self._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 + /// + /// * *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) -> 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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new directory site. +/// +/// A builder for the *insert* method supported by a *directorySite* resource. +/// It is not used directly, but through a `DirectorySiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::DirectorySite; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DirectorySite::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.directory_sites().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct DirectorySiteInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: DirectorySite, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DirectorySiteInsertCall<'a, C, A> {} + +impl<'a, C, A> DirectorySiteInsertCall<'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, DirectorySite)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.directorySites.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DirectorySite) -> DirectorySiteInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DirectorySiteInsertCall<'a, C, A> { + self._profile_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) -> DirectorySiteInsertCall<'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) -> DirectorySiteInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DirectorySiteInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of directory sites, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *directorySite* resource. +/// It is not used directly, but through a `DirectorySiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.directory_sites().list("profileId") +/// .sort_order("clita") +/// .sort_field("et") +/// .search_string("justo") +/// .parent_id("clita") +/// .page_token("eos") +/// .max_results(-10) +/// .add_ids("clita") +/// .dfp_network_code("tempor") +/// .country_id("Stet") +/// .active(true) +/// .accepts_publisher_paid_placements(true) +/// .accepts_interstitial_placements(false) +/// .accepts_in_stream_video_placements(true) +/// .doit(); +/// # } +/// ``` +pub struct DirectorySiteListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _parent_id: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _dfp_network_code: Option, + _country_id: Option, + _active: Option, + _accepts_publisher_paid_placements: Option, + _accepts_interstitial_placements: Option, + _accepts_in_stream_video_placements: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DirectorySiteListCall<'a, C, A> {} + +impl<'a, C, A> DirectorySiteListCall<'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, DirectorySitesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.directorySites.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((16 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if let Some(value) = self._parent_id { + params.push(("parentId", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._dfp_network_code { + params.push(("dfpNetworkCode", value.to_string())); + } + if let Some(value) = self._country_id { + params.push(("countryId", value.to_string())); + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + if let Some(value) = self._accepts_publisher_paid_placements { + params.push(("acceptsPublisherPaidPlacements", value.to_string())); + } + if let Some(value) = self._accepts_interstitial_placements { + params.push(("acceptsInterstitialPlacements", value.to_string())); + } + if let Some(value) = self._accepts_in_stream_video_placements { + params.push(("acceptsInStreamVideoPlacements", value.to_string())); + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "parentId", "pageToken", "maxResults", "ids", "dfpNetworkCode", "countryId", "active", "acceptsPublisherPaidPlacements", "acceptsInterstitialPlacements", "acceptsInStreamVideoPlacements"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Select only directory sites with this parent ID. + /// + /// Sets the *parent id* query property to the given value. + pub fn parent_id(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._parent_id = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> DirectorySiteListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only directory sites with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only directory sites with this DFP network code. + /// + /// Sets the *dfp network code* query property to the given value. + pub fn dfp_network_code(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._dfp_network_code = Some(new_value.to_string()); + self + } + /// Select only directory sites with this country ID. + /// + /// Sets the *country id* query property to the given value. + pub fn country_id(mut self, new_value: &str) -> DirectorySiteListCall<'a, C, A> { + self._country_id = Some(new_value.to_string()); + self + } + /// Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> DirectorySiteListCall<'a, C, A> { + self._active = Some(new_value); + self + } + /// Select only directory sites that accept publisher paid placements. This field can be left blank. + /// + /// Sets the *accepts publisher paid placements* query property to the given value. + pub fn accepts_publisher_paid_placements(mut self, new_value: bool) -> DirectorySiteListCall<'a, C, A> { + self._accepts_publisher_paid_placements = Some(new_value); + self + } + /// This search filter is no longer supported and will have no effect on the results returned. + /// + /// Sets the *accepts interstitial placements* query property to the given value. + pub fn accepts_interstitial_placements(mut self, new_value: bool) -> DirectorySiteListCall<'a, C, A> { + self._accepts_interstitial_placements = Some(new_value); + self + } + /// This search filter is no longer supported and will have no effect on the results returned. + /// + /// Sets the *accepts in stream video placements* query property to the given value. + pub fn accepts_in_stream_video_placements(mut self, new_value: bool) -> DirectorySiteListCall<'a, C, A> { + self._accepts_in_stream_video_placements = 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) -> DirectorySiteListCall<'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) -> DirectorySiteListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DirectorySiteListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one directory site by ID. +/// +/// A builder for the *get* method supported by a *directorySite* resource. +/// It is not used directly, but through a `DirectorySiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.directory_sites().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct DirectorySiteGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DirectorySiteGetCall<'a, C, A> {} + +impl<'a, C, A> DirectorySiteGetCall<'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, DirectorySite)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.directorySites.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DirectorySiteGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Directory site ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> DirectorySiteGetCall<'a, C, A> { + self._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) -> DirectorySiteGetCall<'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) -> DirectorySiteGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DirectorySiteGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one video format by ID. +/// +/// A builder for the *get* method supported by a *videoFormat* resource. +/// It is not used directly, but through a `VideoFormatMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.video_formats().get("profileId", -2) +/// .doit(); +/// # } +/// ``` +pub struct VideoFormatGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: i32, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VideoFormatGetCall<'a, C, A> {} + +impl<'a, C, A> VideoFormatGetCall<'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, VideoFormat)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.videoFormats.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/videoFormats/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> VideoFormatGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Video format ID. + /// + /// Sets the *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 id(mut self, new_value: i32) -> VideoFormatGetCall<'a, C, A> { + self._id = 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) -> VideoFormatGetCall<'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) -> VideoFormatGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> VideoFormatGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists available video formats. +/// +/// A builder for the *list* method supported by a *videoFormat* resource. +/// It is not used directly, but through a `VideoFormatMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.video_formats().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct VideoFormatListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VideoFormatListCall<'a, C, A> {} + +impl<'a, C, A> VideoFormatListCall<'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, VideoFormatsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.videoFormats.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/videoFormats"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> VideoFormatListCall<'a, C, A> { + self._profile_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) -> VideoFormatListCall<'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) -> VideoFormatListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> VideoFormatListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing dynamic targeting key. +/// +/// A builder for the *delete* method supported by a *dynamicTargetingKey* resource. +/// It is not used directly, but through a `DynamicTargetingKeyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.dynamic_targeting_keys().delete("profileId", "objectId", "name", "objectType") +/// .doit(); +/// # } +/// ``` +pub struct DynamicTargetingKeyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _object_id: String, + _name: String, + _object_type: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DynamicTargetingKeyDeleteCall<'a, C, A> {} + +impl<'a, C, A> DynamicTargetingKeyDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.dynamicTargetingKeys.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("objectId", self._object_id.to_string())); + params.push(("name", self._name.to_string())); + params.push(("objectType", self._object_type.to_string())); + for &field in ["profileId", "objectId", "name", "objectType"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{objectId}", "objectId")].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 ["objectId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DynamicTargetingKeyDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// ID of the object of this dynamic targeting key. This is a required field. + /// + /// Sets the *object 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 object_id(mut self, new_value: &str) -> DynamicTargetingKeyDeleteCall<'a, C, A> { + self._object_id = new_value.to_string(); + self + } + /// Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + /// + /// Sets the *name* 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. + pub fn name(mut self, new_value: &str) -> DynamicTargetingKeyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Type of the object of this dynamic targeting key. This is a required field. + /// + /// Sets the *object type* 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. + pub fn object_type(mut self, new_value: &str) -> DynamicTargetingKeyDeleteCall<'a, C, A> { + self._object_type = 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) -> DynamicTargetingKeyDeleteCall<'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) -> DynamicTargetingKeyDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DynamicTargetingKeyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of dynamic targeting keys. +/// +/// A builder for the *list* method supported by a *dynamicTargetingKey* resource. +/// It is not used directly, but through a `DynamicTargetingKeyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.dynamic_targeting_keys().list("profileId") +/// .object_type("accusam") +/// .object_id("accusam") +/// .add_names("invidunt") +/// .advertiser_id("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct DynamicTargetingKeyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _object_type: Option, + _object_id: Option, + _names: Vec, + _advertiser_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DynamicTargetingKeyListCall<'a, C, A> {} + +impl<'a, C, A> DynamicTargetingKeyListCall<'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, DynamicTargetingKeysListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.dynamicTargetingKeys.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._object_type { + params.push(("objectType", value.to_string())); + } + if let Some(value) = self._object_id { + params.push(("objectId", value.to_string())); + } + if self._names.len() > 0 { + for f in self._names.iter() { + params.push(("names", f.to_string())); + } + } + if let Some(value) = self._advertiser_id { + params.push(("advertiserId", value.to_string())); + } + for &field in ["alt", "profileId", "objectType", "objectId", "names", "advertiserId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/dynamicTargetingKeys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DynamicTargetingKeyListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only dynamic targeting keys with this object type. + /// + /// Sets the *object type* query property to the given value. + pub fn object_type(mut self, new_value: &str) -> DynamicTargetingKeyListCall<'a, C, A> { + self._object_type = Some(new_value.to_string()); + self + } + /// Select only dynamic targeting keys with this object ID. + /// + /// Sets the *object id* query property to the given value. + pub fn object_id(mut self, new_value: &str) -> DynamicTargetingKeyListCall<'a, C, A> { + self._object_id = Some(new_value.to_string()); + self + } + /// Select only dynamic targeting keys exactly matching these names. + /// + /// Append the given value to the *names* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_names(mut self, new_value: &str) -> DynamicTargetingKeyListCall<'a, C, A> { + self._names.push(new_value.to_string()); + self + } + /// Select only dynamic targeting keys whose object has this advertiser ID. + /// + /// Sets the *advertiser id* query property to the given value. + pub fn advertiser_id(mut self, new_value: &str) -> DynamicTargetingKeyListCall<'a, C, A> { + self._advertiser_id = 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) -> DynamicTargetingKeyListCall<'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) -> DynamicTargetingKeyListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DynamicTargetingKeyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. +/// +/// A builder for the *insert* method supported by a *dynamicTargetingKey* resource. +/// It is not used directly, but through a `DynamicTargetingKeyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::DynamicTargetingKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DynamicTargetingKey::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.dynamic_targeting_keys().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct DynamicTargetingKeyInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: DynamicTargetingKey, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DynamicTargetingKeyInsertCall<'a, C, A> {} + +impl<'a, C, A> DynamicTargetingKeyInsertCall<'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, DynamicTargetingKey)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.dynamicTargetingKeys.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/dynamicTargetingKeys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DynamicTargetingKey) -> DynamicTargetingKeyInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> DynamicTargetingKeyInsertCall<'a, C, A> { + self._profile_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) -> DynamicTargetingKeyInsertCall<'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) -> DynamicTargetingKeyInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DynamicTargetingKeyInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new size. +/// +/// A builder for the *insert* method supported by a *size* resource. +/// It is not used directly, but through a `SizeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Size; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Size::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.sizes().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct SizeInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Size, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SizeInsertCall<'a, C, A> {} + +impl<'a, C, A> SizeInsertCall<'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, Size)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sizes.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Size) -> SizeInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SizeInsertCall<'a, C, A> { + self._profile_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) -> SizeInsertCall<'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) -> SizeInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SizeInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of sizes, possibly filtered. +/// +/// A builder for the *list* method supported by a *size* resource. +/// It is not used directly, but through a `SizeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sizes().list("profileId") +/// .width(-87) +/// .add_ids("duo") +/// .iab_standard(false) +/// .height(-7) +/// .doit(); +/// # } +/// ``` +pub struct SizeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _width: Option, + _ids: Vec, + _iab_standard: Option, + _height: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SizeListCall<'a, C, A> {} + +impl<'a, C, A> SizeListCall<'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, SizesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sizes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._width { + params.push(("width", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._iab_standard { + params.push(("iabStandard", value.to_string())); + } + if let Some(value) = self._height { + params.push(("height", value.to_string())); + } + for &field in ["alt", "profileId", "width", "ids", "iabStandard", "height"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SizeListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only sizes with this width. + /// + /// Sets the *width* query property to the given value. + pub fn width(mut self, new_value: i32) -> SizeListCall<'a, C, A> { + self._width = Some(new_value); + self + } + /// Select only sizes with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> SizeListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only IAB standard sizes. + /// + /// Sets the *iab standard* query property to the given value. + pub fn iab_standard(mut self, new_value: bool) -> SizeListCall<'a, C, A> { + self._iab_standard = Some(new_value); + self + } + /// Select only sizes with this height. + /// + /// Sets the *height* query property to the given value. + pub fn height(mut self, new_value: i32) -> SizeListCall<'a, C, A> { + self._height = 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) -> SizeListCall<'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) -> SizeListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SizeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one size by ID. +/// +/// A builder for the *get* method supported by a *size* resource. +/// It is not used directly, but through a `SizeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.sizes().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct SizeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SizeGetCall<'a, C, A> {} + +impl<'a, C, A> SizeGetCall<'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, Size)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.sizes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> SizeGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Size ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> SizeGetCall<'a, C, A> { + self._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) -> SizeGetCall<'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) -> SizeGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> SizeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the account's active ad summary by account ID. +/// +/// A builder for the *get* method supported by a *accountActiveAdSummary* resource. +/// It is not used directly, but through a `AccountActiveAdSummaryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_active_ad_summaries().get("profileId", "summaryAccountId") +/// .doit(); +/// # } +/// ``` +pub struct AccountActiveAdSummaryGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _summary_account_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountActiveAdSummaryGetCall<'a, C, A> {} + +impl<'a, C, A> AccountActiveAdSummaryGetCall<'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, AccountActiveAdSummary)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountActiveAdSummaries.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("summaryAccountId", self._summary_account_id.to_string())); + for &field in ["alt", "profileId", "summaryAccountId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{summaryAccountId}", "summaryAccountId")].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 ["summaryAccountId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountActiveAdSummaryGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Account ID. + /// + /// Sets the *summary account 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 summary_account_id(mut self, new_value: &str) -> AccountActiveAdSummaryGetCall<'a, C, A> { + self._summary_account_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) -> AccountActiveAdSummaryGetCall<'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) -> AccountActiveAdSummaryGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountActiveAdSummaryGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing account user profile. +/// +/// A builder for the *update* method supported by a *accountUserProfile* resource. +/// It is not used directly, but through a `AccountUserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::AccountUserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AccountUserProfile::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.account_user_profiles().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserProfileUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: AccountUserProfile, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserProfileUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountUserProfileUpdateCall<'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, AccountUserProfile)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountUserProfiles.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountUserProfiles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AccountUserProfile) -> AccountUserProfileUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountUserProfileUpdateCall<'a, C, A> { + self._profile_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) -> AccountUserProfileUpdateCall<'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) -> AccountUserProfileUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserProfileUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of account user profiles, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *accountUserProfile* resource. +/// It is not used directly, but through a `AccountUserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_user_profiles().list("profileId") +/// .user_role_id("At") +/// .subaccount_id("rebum.") +/// .sort_order("sit") +/// .sort_field("ipsum") +/// .search_string("clita") +/// .page_token("clita") +/// .max_results(-15) +/// .add_ids("ut") +/// .active(false) +/// .doit(); +/// # } +/// ``` +pub struct AccountUserProfileListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _user_role_id: Option, + _subaccount_id: Option, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _active: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserProfileListCall<'a, C, A> {} + +impl<'a, C, A> AccountUserProfileListCall<'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, AccountUserProfilesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountUserProfiles.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._user_role_id { + params.push(("userRoleId", value.to_string())); + } + if let Some(value) = self._subaccount_id { + params.push(("subaccountId", value.to_string())); + } + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + for &field in ["alt", "profileId", "userRoleId", "subaccountId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "active"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountUserProfiles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only user profiles with the specified user role ID. + /// + /// Sets the *user role id* query property to the given value. + pub fn user_role_id(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._user_role_id = Some(new_value.to_string()); + self + } + /// Select only user profiles with the specified subaccount ID. + /// + /// Sets the *subaccount id* query property to the given value. + pub fn subaccount_id(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._subaccount_id = Some(new_value.to_string()); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> AccountUserProfileListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only user profiles with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> AccountUserProfileListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only active user profiles. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> AccountUserProfileListCall<'a, C, A> { + self._active = 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) -> AccountUserProfileListCall<'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) -> AccountUserProfileListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserProfileListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new account user profile. +/// +/// A builder for the *insert* method supported by a *accountUserProfile* resource. +/// It is not used directly, but through a `AccountUserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::AccountUserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AccountUserProfile::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.account_user_profiles().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserProfileInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: AccountUserProfile, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserProfileInsertCall<'a, C, A> {} + +impl<'a, C, A> AccountUserProfileInsertCall<'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, AccountUserProfile)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountUserProfiles.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountUserProfiles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AccountUserProfile) -> AccountUserProfileInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountUserProfileInsertCall<'a, C, A> { + self._profile_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) -> AccountUserProfileInsertCall<'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) -> AccountUserProfileInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserProfileInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing account user profile. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *accountUserProfile* resource. +/// It is not used directly, but through a `AccountUserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::AccountUserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AccountUserProfile::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.account_user_profiles().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserProfilePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: AccountUserProfile, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserProfilePatchCall<'a, C, A> {} + +impl<'a, C, A> AccountUserProfilePatchCall<'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, AccountUserProfile)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountUserProfiles.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountUserProfiles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AccountUserProfile) -> AccountUserProfilePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountUserProfilePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User profile ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> AccountUserProfilePatchCall<'a, C, A> { + self._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) -> AccountUserProfilePatchCall<'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) -> AccountUserProfilePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserProfilePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one account user profile by ID. +/// +/// A builder for the *get* method supported by a *accountUserProfile* resource. +/// It is not used directly, but through a `AccountUserProfileMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.account_user_profiles().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserProfileGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserProfileGetCall<'a, C, A> {} + +impl<'a, C, A> AccountUserProfileGetCall<'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, AccountUserProfile)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accountUserProfiles.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accountUserProfiles/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountUserProfileGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// User profile ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AccountUserProfileGetCall<'a, C, A> { + self._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) -> AccountUserProfileGetCall<'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) -> AccountUserProfileGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserProfileGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of countries. +/// +/// A builder for the *list* method supported by a *country* resource. +/// It is not used directly, but through a `CountryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.countries().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct CountryListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CountryListCall<'a, C, A> {} + +impl<'a, C, A> CountryListCall<'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, CountriesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.countries.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CountryListCall<'a, C, A> { + self._profile_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) -> CountryListCall<'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) -> CountryListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CountryListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one country by ID. +/// +/// A builder for the *get* method supported by a *country* resource. +/// It is not used directly, but through a `CountryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.countries().get("profileId", "dartId") +/// .doit(); +/// # } +/// ``` +pub struct CountryGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _dart_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CountryGetCall<'a, C, A> {} + +impl<'a, C, A> CountryGetCall<'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, Country)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.countries.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("dartId", self._dart_id.to_string())); + for &field in ["alt", "profileId", "dartId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{dartId}", "dartId")].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 ["dartId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CountryGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Country DART ID. + /// + /// Sets the *dart 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 dart_id(mut self, new_value: &str) -> CountryGetCall<'a, C, A> { + self._dart_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) -> CountryGetCall<'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) -> CountryGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CountryGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative field value. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *creativeFieldValue* resource. +/// It is not used directly, but through a `CreativeFieldValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeFieldValue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeFieldValue::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.creative_field_values().patch(req, "profileId", "creativeFieldId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldValuePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeFieldValue, + _profile_id: String, + _creative_field_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldValuePatchCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValuePatchCall<'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, CreativeFieldValue)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFieldValues.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("creativeFieldId", self._creative_field_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "creativeFieldId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{creativeFieldId}", "creativeFieldId")].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 ["creativeFieldId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeFieldValue) -> CreativeFieldValuePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldValuePatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative field ID for this creative field value. + /// + /// Sets the *creative field 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 creative_field_id(mut self, new_value: &str) -> CreativeFieldValuePatchCall<'a, C, A> { + self._creative_field_id = new_value.to_string(); + self + } + /// Creative Field Value ID + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> CreativeFieldValuePatchCall<'a, C, A> { + self._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) -> CreativeFieldValuePatchCall<'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) -> CreativeFieldValuePatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldValuePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one creative field value by ID. +/// +/// A builder for the *get* method supported by a *creativeFieldValue* resource. +/// It is not used directly, but through a `CreativeFieldValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_field_values().get("profileId", "creativeFieldId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldValueGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _creative_field_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldValueGetCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValueGetCall<'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, CreativeFieldValue)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFieldValues.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("creativeFieldId", self._creative_field_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "creativeFieldId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{creativeFieldId}", "creativeFieldId"), ("{id}", "id")].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 ["id", "creativeFieldId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldValueGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative field ID for this creative field value. + /// + /// Sets the *creative field 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 creative_field_id(mut self, new_value: &str) -> CreativeFieldValueGetCall<'a, C, A> { + self._creative_field_id = new_value.to_string(); + self + } + /// Creative Field Value ID + /// + /// Sets the *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 id(mut self, new_value: &str) -> CreativeFieldValueGetCall<'a, C, A> { + self._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) -> CreativeFieldValueGetCall<'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) -> CreativeFieldValueGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldValueGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing creative field value. +/// +/// A builder for the *delete* method supported by a *creativeFieldValue* resource. +/// It is not used directly, but through a `CreativeFieldValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_field_values().delete("profileId", "creativeFieldId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldValueDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _creative_field_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldValueDeleteCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValueDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFieldValues.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("creativeFieldId", self._creative_field_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["profileId", "creativeFieldId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{creativeFieldId}", "creativeFieldId"), ("{id}", "id")].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 ["id", "creativeFieldId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldValueDeleteCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative field ID for this creative field value. + /// + /// Sets the *creative field 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 creative_field_id(mut self, new_value: &str) -> CreativeFieldValueDeleteCall<'a, C, A> { + self._creative_field_id = new_value.to_string(); + self + } + /// Creative Field Value ID + /// + /// Sets the *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 id(mut self, new_value: &str) -> CreativeFieldValueDeleteCall<'a, C, A> { + self._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) -> CreativeFieldValueDeleteCall<'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) -> CreativeFieldValueDeleteCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldValueDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new creative field value. +/// +/// A builder for the *insert* method supported by a *creativeFieldValue* resource. +/// It is not used directly, but through a `CreativeFieldValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeFieldValue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeFieldValue::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.creative_field_values().insert(req, "profileId", "creativeFieldId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldValueInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeFieldValue, + _profile_id: String, + _creative_field_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldValueInsertCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValueInsertCall<'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, CreativeFieldValue)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFieldValues.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("creativeFieldId", self._creative_field_id.to_string())); + for &field in ["alt", "profileId", "creativeFieldId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{creativeFieldId}", "creativeFieldId")].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 ["creativeFieldId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeFieldValue) -> CreativeFieldValueInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldValueInsertCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative field ID for this creative field value. + /// + /// Sets the *creative field 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 creative_field_id(mut self, new_value: &str) -> CreativeFieldValueInsertCall<'a, C, A> { + self._creative_field_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) -> CreativeFieldValueInsertCall<'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) -> CreativeFieldValueInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldValueInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing creative field value. +/// +/// A builder for the *update* method supported by a *creativeFieldValue* resource. +/// It is not used directly, but through a `CreativeFieldValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::CreativeFieldValue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreativeFieldValue::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.creative_field_values().update(req, "profileId", "creativeFieldId") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldValueUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: CreativeFieldValue, + _profile_id: String, + _creative_field_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldValueUpdateCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValueUpdateCall<'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, CreativeFieldValue)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFieldValues.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("creativeFieldId", self._creative_field_id.to_string())); + for &field in ["alt", "profileId", "creativeFieldId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{creativeFieldId}", "creativeFieldId")].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 ["creativeFieldId", "profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreativeFieldValue) -> CreativeFieldValueUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldValueUpdateCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative field ID for this creative field value. + /// + /// Sets the *creative field 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 creative_field_id(mut self, new_value: &str) -> CreativeFieldValueUpdateCall<'a, C, A> { + self._creative_field_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) -> CreativeFieldValueUpdateCall<'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) -> CreativeFieldValueUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldValueUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of creative field values, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *creativeFieldValue* resource. +/// It is not used directly, but through a `CreativeFieldValueMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.creative_field_values().list("profileId", "creativeFieldId") +/// .sort_order("Lorem") +/// .sort_field("dolor") +/// .search_string("amet.") +/// .page_token("sed") +/// .max_results(-9) +/// .add_ids("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct CreativeFieldValueListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _creative_field_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CreativeFieldValueListCall<'a, C, A> {} + +impl<'a, C, A> CreativeFieldValueListCall<'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, CreativeFieldValuesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.creativeFieldValues.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("creativeFieldId", self._creative_field_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + for &field in ["alt", "profileId", "creativeFieldId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{creativeFieldId}", "creativeFieldId")].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 ["creativeFieldId", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Creative field ID for this creative field value. + /// + /// Sets the *creative field 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 creative_field_id(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._creative_field_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> CreativeFieldValueListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only creative field values with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> CreativeFieldValueListCall<'a, C, A> { + self._ids.push(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) -> CreativeFieldValueListCall<'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) -> CreativeFieldValueListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> CreativeFieldValueListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one postal code by ID. +/// +/// A builder for the *get* method supported by a *postalCode* resource. +/// It is not used directly, but through a `PostalCodeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.postal_codes().get("profileId", "code") +/// .doit(); +/// # } +/// ``` +pub struct PostalCodeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _code: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PostalCodeGetCall<'a, C, A> {} + +impl<'a, C, A> PostalCodeGetCall<'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, PostalCode)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.postalCodes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("code", self._code.to_string())); + for &field in ["alt", "profileId", "code"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{code}", "code")].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 ["code", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PostalCodeGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Postal code ID. + /// + /// Sets the *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 code(mut self, new_value: &str) -> PostalCodeGetCall<'a, C, A> { + self._code = 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) -> PostalCodeGetCall<'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) -> PostalCodeGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PostalCodeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of postal codes. +/// +/// A builder for the *list* method supported by a *postalCode* resource. +/// It is not used directly, but through a `PostalCodeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.postal_codes().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct PostalCodeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PostalCodeListCall<'a, C, A> {} + +impl<'a, C, A> PostalCodeListCall<'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, PostalCodesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.postalCodes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PostalCodeListCall<'a, C, A> { + self._profile_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) -> PostalCodeListCall<'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) -> PostalCodeListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PostalCodeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of browsers. +/// +/// A builder for the *list* method supported by a *browser* resource. +/// It is not used directly, but through a `BrowserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.browsers().list("profileId") +/// .doit(); +/// # } +/// ``` +pub struct BrowserListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BrowserListCall<'a, C, A> {} + +impl<'a, C, A> BrowserListCall<'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, BrowsersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.browsers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> BrowserListCall<'a, C, A> { + self._profile_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) -> BrowserListCall<'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) -> BrowserListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BrowserListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one account by ID. +/// +/// A builder for the *get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AccountGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountGetCall<'a, C, A> {} + +impl<'a, C, A> AccountGetCall<'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, Account)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accounts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Account ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> AccountGetCall<'a, C, A> { + self._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) -> AccountGetCall<'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) -> AccountGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of accounts, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().list("profileId") +/// .sort_order("amet.") +/// .sort_field("clita") +/// .search_string("Stet") +/// .page_token("sed") +/// .max_results(-90) +/// .add_ids("elitr") +/// .active(false) +/// .doit(); +/// # } +/// ``` +pub struct AccountListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _search_string: Option, + _page_token: Option, + _max_results: Option, + _ids: Vec, + _active: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountListCall<'a, C, A> {} + +impl<'a, C, A> AccountListCall<'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, AccountsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accounts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if let Some(value) = self._search_string { + params.push(("searchString", value.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 self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if let Some(value) = self._active { + params.push(("active", value.to_string())); + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "active"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> AccountListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only accounts with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only active accounts. Don't set this field to select both active and non-active accounts. + /// + /// Sets the *active* query property to the given value. + pub fn active(mut self, new_value: bool) -> AccountListCall<'a, C, A> { + self._active = 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) -> AccountListCall<'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) -> AccountListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing account. +/// +/// A builder for the *update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Account; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Account::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.accounts().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AccountUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Account, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountUpdateCall<'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, Account)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accounts.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Account) -> AccountUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountUpdateCall<'a, C, A> { + self._profile_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) -> AccountUpdateCall<'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) -> AccountUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing account. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Account; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Account::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.accounts().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AccountPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Account, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountPatchCall<'a, C, A> {} + +impl<'a, C, A> AccountPatchCall<'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, Account)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.accounts.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Account) -> AccountPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> AccountPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Account ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> AccountPatchCall<'a, C, A> { + self._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) -> AccountPatchCall<'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) -> AccountPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing placement. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *placement* resource. +/// It is not used directly, but through a `PlacementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Placement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Placement::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.placements().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Placement, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementPatchCall<'a, C, A> {} + +impl<'a, C, A> PlacementPatchCall<'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, Placement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placements.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Placement) -> PlacementPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementPatchCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement ID. + /// + /// Sets the *id* 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. + pub fn id(mut self, new_value: &str) -> PlacementPatchCall<'a, C, A> { + self._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) -> PlacementPatchCall<'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) -> PlacementPatchCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of placements, possibly filtered. This method supports paging. +/// +/// A builder for the *list* method supported by a *placement* resource. +/// It is not used directly, but through a `PlacementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placements().list("profileId") +/// .sort_order("dolor") +/// .sort_field("tempor") +/// .add_size_ids("ipsum") +/// .add_site_ids("est") +/// .search_string("et") +/// .add_pricing_types("no") +/// .add_placement_strategy_ids("sed") +/// .payment_source("kasd") +/// .page_token("ipsum") +/// .min_start_date("sadipscing") +/// .min_end_date("sea") +/// .max_start_date("eos") +/// .max_results(-53) +/// .max_end_date("Lorem") +/// .add_ids("amet") +/// .add_group_ids("Lorem") +/// .add_directory_site_ids("kasd") +/// .add_content_category_ids("nonumy") +/// .add_compatibilities("dolor") +/// .add_campaign_ids("diam") +/// .archived(true) +/// .add_advertiser_ids("tempor") +/// .doit(); +/// # } +/// ``` +pub struct PlacementListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _sort_order: Option, + _sort_field: Option, + _size_ids: Vec, + _site_ids: Vec, + _search_string: Option, + _pricing_types: Vec, + _placement_strategy_ids: Vec, + _payment_source: Option, + _page_token: Option, + _min_start_date: Option, + _min_end_date: Option, + _max_start_date: Option, + _max_results: Option, + _max_end_date: Option, + _ids: Vec, + _group_ids: Vec, + _directory_site_ids: Vec, + _content_category_ids: Vec, + _compatibilities: Vec, + _campaign_ids: Vec, + _archived: Option, + _advertiser_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementListCall<'a, C, A> {} + +impl<'a, C, A> PlacementListCall<'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, PlacementsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placements.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((25 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if let Some(value) = self._sort_order { + params.push(("sortOrder", value.to_string())); + } + if let Some(value) = self._sort_field { + params.push(("sortField", value.to_string())); + } + if self._size_ids.len() > 0 { + for f in self._size_ids.iter() { + params.push(("sizeIds", f.to_string())); + } + } + if self._site_ids.len() > 0 { + for f in self._site_ids.iter() { + params.push(("siteIds", f.to_string())); + } + } + if let Some(value) = self._search_string { + params.push(("searchString", value.to_string())); + } + if self._pricing_types.len() > 0 { + for f in self._pricing_types.iter() { + params.push(("pricingTypes", f.to_string())); + } + } + if self._placement_strategy_ids.len() > 0 { + for f in self._placement_strategy_ids.iter() { + params.push(("placementStrategyIds", f.to_string())); + } + } + if let Some(value) = self._payment_source { + params.push(("paymentSource", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._min_start_date { + params.push(("minStartDate", value.to_string())); + } + if let Some(value) = self._min_end_date { + params.push(("minEndDate", value.to_string())); + } + if let Some(value) = self._max_start_date { + params.push(("maxStartDate", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._max_end_date { + params.push(("maxEndDate", value.to_string())); + } + if self._ids.len() > 0 { + for f in self._ids.iter() { + params.push(("ids", f.to_string())); + } + } + if self._group_ids.len() > 0 { + for f in self._group_ids.iter() { + params.push(("groupIds", f.to_string())); + } + } + if self._directory_site_ids.len() > 0 { + for f in self._directory_site_ids.iter() { + params.push(("directorySiteIds", f.to_string())); + } + } + if self._content_category_ids.len() > 0 { + for f in self._content_category_ids.iter() { + params.push(("contentCategoryIds", f.to_string())); + } + } + if self._compatibilities.len() > 0 { + for f in self._compatibilities.iter() { + params.push(("compatibilities", f.to_string())); + } + } + if self._campaign_ids.len() > 0 { + for f in self._campaign_ids.iter() { + params.push(("campaignIds", f.to_string())); + } + } + if let Some(value) = self._archived { + params.push(("archived", value.to_string())); + } + if self._advertiser_ids.len() > 0 { + for f in self._advertiser_ids.iter() { + params.push(("advertiserIds", f.to_string())); + } + } + for &field in ["alt", "profileId", "sortOrder", "sortField", "sizeIds", "siteIds", "searchString", "pricingTypes", "placementStrategyIds", "paymentSource", "pageToken", "minStartDate", "minEndDate", "maxStartDate", "maxResults", "maxEndDate", "ids", "groupIds", "directorySiteIds", "contentCategoryIds", "compatibilities", "campaignIds", "archived", "advertiserIds"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Order of sorted results. + /// + /// Sets the *sort order* query property to the given value. + pub fn sort_order(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._sort_order = Some(new_value.to_string()); + self + } + /// Field by which to sort the list. + /// + /// Sets the *sort field* query property to the given value. + pub fn sort_field(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Select only placements that are associated with these sizes. + /// + /// Append the given value to the *size ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_size_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._size_ids.push(new_value.to_string()); + self + } + /// Select only placements that are associated with these sites. + /// + /// Append the given value to the *site ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_site_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._site_ids.push(new_value.to_string()); + self + } + /// Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._search_string = Some(new_value.to_string()); + self + } + /// Select only placements with these pricing types. + /// + /// Append the given value to the *pricing types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_pricing_types(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._pricing_types.push(new_value.to_string()); + self + } + /// Select only placements that are associated with these placement strategies. + /// + /// Append the given value to the *placement strategy ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_placement_strategy_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._placement_strategy_ids.push(new_value.to_string()); + self + } + /// Select only placements with this payment source. + /// + /// Sets the *payment source* query property to the given value. + pub fn payment_source(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._payment_source = Some(new_value.to_string()); + self + } + /// Value of the nextPageToken from the previous result page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *min start date* query property to the given value. + pub fn min_start_date(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._min_start_date = Some(new_value.to_string()); + self + } + /// Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *min end date* query property to the given value. + pub fn min_end_date(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._min_end_date = Some(new_value.to_string()); + self + } + /// Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *max start date* query property to the given value. + pub fn max_start_date(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._max_start_date = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> PlacementListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + /// + /// Sets the *max end date* query property to the given value. + pub fn max_end_date(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._max_end_date = Some(new_value.to_string()); + self + } + /// Select only placements with these IDs. + /// + /// Append the given value to the *ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only placements that belong to these placement groups. + /// + /// Append the given value to the *group ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_group_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._group_ids.push(new_value.to_string()); + self + } + /// Select only placements that are associated with these directory sites. + /// + /// Append the given value to the *directory site ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_directory_site_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._directory_site_ids.push(new_value.to_string()); + self + } + /// Select only placements that are associated with these content categories. + /// + /// Append the given value to the *content category ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_content_category_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._content_category_ids.push(new_value.to_string()); + self + } + /// Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. + /// + /// Append the given value to the *compatibilities* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_compatibilities(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._compatibilities.push(new_value.to_string()); + self + } + /// Select only placements that belong to these campaigns. + /// + /// Append the given value to the *campaign ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_campaign_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._campaign_ids.push(new_value.to_string()); + self + } + /// Select only archived placements. Don't set this field to select both archived and non-archived placements. + /// + /// Sets the *archived* query property to the given value. + pub fn archived(mut self, new_value: bool) -> PlacementListCall<'a, C, A> { + self._archived = Some(new_value); + self + } + /// Select only placements that belong to these advertisers. + /// + /// Append the given value to the *advertiser ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_advertiser_ids(mut self, new_value: &str) -> PlacementListCall<'a, C, A> { + self._advertiser_ids.push(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) -> PlacementListCall<'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) -> PlacementListCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets one placement by ID. +/// +/// A builder for the *get* method supported by a *placement* resource. +/// It is not used directly, but through a `PlacementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placements().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGetCall<'a, C, A> {} + +impl<'a, C, A> PlacementGetCall<'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, Placement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placements.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "profileId", "id"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId"), ("{id}", "id")].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 ["id", "profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGetCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Placement ID. + /// + /// Sets the *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 id(mut self, new_value: &str) -> PlacementGetCall<'a, C, A> { + self._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) -> PlacementGetCall<'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) -> PlacementGetCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inserts a new placement. +/// +/// A builder for the *insert* method supported by a *placement* resource. +/// It is not used directly, but through a `PlacementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Placement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Placement::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.placements().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlacementInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Placement, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementInsertCall<'a, C, A> {} + +impl<'a, C, A> PlacementInsertCall<'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, Placement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placements.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Placement) -> PlacementInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementInsertCall<'a, C, A> { + self._profile_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) -> PlacementInsertCall<'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) -> PlacementInsertCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an existing placement. +/// +/// A builder for the *update* method supported by a *placement* resource. +/// It is not used directly, but through a `PlacementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// use dfareporting2d8::Placement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Placement::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.placements().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct PlacementUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: Placement, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementUpdateCall<'a, C, A> {} + +impl<'a, C, A> PlacementUpdateCall<'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, Placement)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placements.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + for &field in ["alt", "profileId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Placement) -> PlacementUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementUpdateCall<'a, C, A> { + self._profile_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) -> PlacementUpdateCall<'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) -> PlacementUpdateCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Generates tags for a placement. +/// +/// A builder for the *generatetags* method supported by a *placement* resource. +/// It is not used directly, but through a `PlacementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting2d8 as dfareporting2d8; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting2d8::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dfareporting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.placements().generatetags("profileId") +/// .add_tag_formats("Lorem") +/// .add_placement_ids("dolores") +/// .campaign_id("dolores") +/// .doit(); +/// # } +/// ``` +pub struct PlacementGeneratetagCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _profile_id: String, + _tag_formats: Vec, + _placement_ids: Vec, + _campaign_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PlacementGeneratetagCall<'a, C, A> {} + +impl<'a, C, A> PlacementGeneratetagCall<'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, PlacementsGenerateTagsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dfareporting.placements.generatetags", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("profileId", self._profile_id.to_string())); + if self._tag_formats.len() > 0 { + for f in self._tag_formats.iter() { + params.push(("tagFormats", f.to_string())); + } + } + if self._placement_ids.len() > 0 { + for f in self._placement_ids.iter() { + params.push(("placementIds", f.to_string())); + } + } + if let Some(value) = self._campaign_id { + params.push(("campaignId", value.to_string())); + } + for &field in ["alt", "profileId", "tagFormats", "placementIds", "campaignId"].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 = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/generatetags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{profileId}", "profileId")].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 ["profileId"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// User profile ID associated with this request. + /// + /// Sets the *profile 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 profile_id(mut self, new_value: &str) -> PlacementGeneratetagCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Tag formats to generate for these placements. + /// + /// Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + /// + /// Append the given value to the *tag formats* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_tag_formats(mut self, new_value: &str) -> PlacementGeneratetagCall<'a, C, A> { + self._tag_formats.push(new_value.to_string()); + self + } + /// Generate tags for these placements. + /// + /// Append the given value to the *placement ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_placement_ids(mut self, new_value: &str) -> PlacementGeneratetagCall<'a, C, A> { + self._placement_ids.push(new_value.to_string()); + self + } + /// Generate placements belonging to this campaign. This is a required field. + /// + /// Sets the *campaign id* query property to the given value. + pub fn campaign_id(mut self, new_value: &str) -> PlacementGeneratetagCall<'a, C, A> { + self._campaign_id = 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) -> PlacementGeneratetagCall<'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) -> PlacementGeneratetagCall<'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::Dfatrafficking`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PlacementGeneratetagCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/dlp2_beta1-cli/Cargo.toml b/gen/dlp2_beta1-cli/Cargo.toml new file mode 100644 index 0000000000..c786d1be7b --- /dev/null +++ b/gen/dlp2_beta1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-dlp2_beta1-cli" +version = "1.0.6+20170918" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with DLP (protocol v2beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1-cli" +homepage = "https://cloud.google.com/dlp/docs/" +documentation = "http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli" +license = "MIT" +keywords = ["dlp", "google", "cli"] + +[[bin]] +name = "dlp2-beta1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-dlp2_beta1] +path = "../dlp2_beta1" +version = "1.0.6+20170918" diff --git a/gen/dlp2_beta1-cli/LICENSE.md b/gen/dlp2_beta1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dlp2_beta1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/dlp2_beta1-cli/README.md b/gen/dlp2_beta1-cli/README.md new file mode 100644 index 0000000000..49dabc3400 --- /dev/null +++ b/gen/dlp2_beta1-cli/README.md @@ -0,0 +1,133 @@ + +The `dlp2-beta1` command-line interface *(CLI)* allows to use most features of the *Google DLP* 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 *DLP* API can be found at the +[official documentation site](https://cloud.google.com/dlp/docs/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-dlp2_beta1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1-cli). + +# Usage + +This documentation was generated from the *DLP* API at revision *20170918*. The CLI is at version *1.0.6*. + +```bash +dlp2-beta1 [options] + content + deidentify (-r )... [-p ]... [-o ] + inspect (-r )... [-p ]... [-o ] + redact (-r )... [-p ]... [-o ] + data-source + analyze (-r )... [-p ]... [-o ] + inspect + operations-cancel (-r )... [-p ]... [-o ] + operations-create (-r )... [-p ]... [-o ] + operations-delete [-p ]... [-o ] + operations-get [-p ]... [-o ] + operations-list [-p ]... [-o ] + results-findings-list [-p ]... [-o ] + risk-analysis + operations-cancel (-r )... [-p ]... [-o ] + operations-delete [-p ]... [-o ] + operations-get [-p ]... [-o ] + operations-list [-p ]... [-o ] + root-categories + info-types-list [-p ]... [-o ] + list [-p ]... [-o ] + dlp2-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 `dlp2-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/dlp2-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/dlp2-beta1-secret.json`, assuming that the required *dlp* 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. `dlp2-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/dlp2_beta1-cli/mkdocs.yml b/gen/dlp2_beta1-cli/mkdocs.yml new file mode 100644 index 0000000000..ccf59ad1c4 --- /dev/null +++ b/gen/dlp2_beta1-cli/mkdocs.yml @@ -0,0 +1,32 @@ +site_name: DLP v1.0.6+20170918 +site_url: http://byron.github.io/google-apis-rs/google-dlp2_beta1-cli +site_description: A complete library to interact with DLP (protocol v2beta1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['content_deidentify.md', 'Content', 'Deidentify'] +- ['content_inspect.md', 'Content', 'Inspect'] +- ['content_redact.md', 'Content', 'Redact'] +- ['data-source_analyze.md', 'Data Source', 'Analyze'] +- ['inspect_operations-cancel.md', 'Inspect', 'Operations Cancel'] +- ['inspect_operations-create.md', 'Inspect', 'Operations Create'] +- ['inspect_operations-delete.md', 'Inspect', 'Operations Delete'] +- ['inspect_operations-get.md', 'Inspect', 'Operations Get'] +- ['inspect_operations-list.md', 'Inspect', 'Operations List'] +- ['inspect_results-findings-list.md', 'Inspect', 'Results Findings List'] +- ['risk-analysis_operations-cancel.md', 'Risk Analysis', 'Operations Cancel'] +- ['risk-analysis_operations-delete.md', 'Risk Analysis', 'Operations Delete'] +- ['risk-analysis_operations-get.md', 'Risk Analysis', 'Operations Get'] +- ['risk-analysis_operations-list.md', 'Risk Analysis', 'Operations List'] +- ['root-categories_info-types-list.md', 'Root Categories', 'Info Types List'] +- ['root-categories_list.md', 'Root Categories', 'List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/dlp2_beta1-cli/src/cmn.rs b/gen/dlp2_beta1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/dlp2_beta1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/dlp2_beta1-cli/src/main.rs b/gen/dlp2_beta1-cli/src/main.rs new file mode 100644 index 0000000000..a525f38a7b --- /dev/null +++ b/gen/dlp2_beta1-cli/src/main.rs @@ -0,0 +1,1838 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_dlp2_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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::DLP>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _content_deidentify(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "inspect-config.max-findings" => Some(("inspectConfig.maxFindings", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.exclude-types" => Some(("inspectConfig.excludeTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["exclude-types", "include-quote", "inspect-config", "max-findings", "min-likelihood"]); + 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::GooglePrivacyDlpV2beta1DeidentifyContentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.content().deidentify(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_inspect(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "inspect-config.max-findings" => Some(("inspectConfig.maxFindings", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.exclude-types" => Some(("inspectConfig.excludeTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["exclude-types", "include-quote", "inspect-config", "max-findings", "min-likelihood"]); + 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::GooglePrivacyDlpV2beta1InspectContentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.content().inspect(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _content_redact(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "inspect-config.max-findings" => Some(("inspectConfig.maxFindings", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.exclude-types" => Some(("inspectConfig.excludeTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["exclude-types", "include-quote", "inspect-config", "max-findings", "min-likelihood"]); + 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::GooglePrivacyDlpV2beta1RedactContentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.content().redact(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _data_source_analyze(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "privacy-metric.numerical-stats-config.field.column-name" => Some(("privacyMetric.numericalStatsConfig.field.columnName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "privacy-metric.l-diversity-config.sensitive-attribute.column-name" => Some(("privacyMetric.lDiversityConfig.sensitiveAttribute.columnName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "privacy-metric.categorical-stats-config.field.column-name" => Some(("privacyMetric.categoricalStatsConfig.field.columnName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "privacy-metric.k-anonymity-config.entity-id.field.column-name" => Some(("privacyMetric.kAnonymityConfig.entityId.field.columnName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-table.project-id" => Some(("sourceTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-table.table-id" => Some(("sourceTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-table.dataset-id" => Some(("sourceTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["categorical-stats-config", "column-name", "dataset-id", "entity-id", "field", "k-anonymity-config", "l-diversity-config", "numerical-stats-config", "privacy-metric", "project-id", "sensitive-attribute", "source-table", "table-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.data_source().analyze(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inspect_operations_cancel(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleLongrunningCancelOperationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.inspect().operations_cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inspect_operations_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "output-config.table.project-id" => Some(("outputConfig.table.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-config.table.table-id" => Some(("outputConfig.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-config.table.dataset-id" => Some(("outputConfig.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-config.storage-path.path" => Some(("outputConfig.storagePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-config.max-findings" => Some(("inspectConfig.maxFindings", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.exclude-types" => Some(("inspectConfig.excludeTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.datastore-options.partition-id.project-id" => Some(("storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.datastore-options.partition-id.namespace-id" => Some(("storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.datastore-options.kind.name" => Some(("storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.big-query-options.table-reference.project-id" => Some(("storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.big-query-options.table-reference.table-id" => Some(("storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.big-query-options.table-reference.dataset-id" => Some(("storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-config.cloud-storage-options.file-set.url" => Some(("storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-config.max-item-findings" => Some(("operationConfig.maxItemFindings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "cloud-storage-options", "dataset-id", "datastore-options", "exclude-types", "file-set", "include-quote", "inspect-config", "kind", "max-findings", "max-item-findings", "min-likelihood", "name", "namespace-id", "operation-config", "output-config", "partition-id", "path", "project-id", "storage-config", "storage-path", "table", "table-id", "table-reference", "url"]); + 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::GooglePrivacyDlpV2beta1CreateInspectOperationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.inspect().operations_create(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inspect_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.inspect().operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inspect_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.inspect().operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inspect_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.inspect().operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _inspect_results_findings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.inspect().results_findings_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _risk_analysis_operations_cancel(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleLongrunningCancelOperationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.risk_analysis().operations_cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _risk_analysis_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.risk_analysis().operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _risk_analysis_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.risk_analysis().operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _risk_analysis_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.risk_analysis().operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _root_categories_info_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.root_categories().info_types_list(opt.value_of("category").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _root_categories_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.root_categories().list(); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("content", Some(opt)) => { + match opt.subcommand() { + ("deidentify", Some(opt)) => { + call_result = self._content_deidentify(opt, dry_run, &mut err); + }, + ("inspect", Some(opt)) => { + call_result = self._content_inspect(opt, dry_run, &mut err); + }, + ("redact", Some(opt)) => { + call_result = self._content_redact(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("content".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("data-source", Some(opt)) => { + match opt.subcommand() { + ("analyze", Some(opt)) => { + call_result = self._data_source_analyze(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("data-source".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("inspect", Some(opt)) => { + match opt.subcommand() { + ("operations-cancel", Some(opt)) => { + call_result = self._inspect_operations_cancel(opt, dry_run, &mut err); + }, + ("operations-create", Some(opt)) => { + call_result = self._inspect_operations_create(opt, dry_run, &mut err); + }, + ("operations-delete", Some(opt)) => { + call_result = self._inspect_operations_delete(opt, dry_run, &mut err); + }, + ("operations-get", Some(opt)) => { + call_result = self._inspect_operations_get(opt, dry_run, &mut err); + }, + ("operations-list", Some(opt)) => { + call_result = self._inspect_operations_list(opt, dry_run, &mut err); + }, + ("results-findings-list", Some(opt)) => { + call_result = self._inspect_results_findings_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("inspect".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("risk-analysis", Some(opt)) => { + match opt.subcommand() { + ("operations-cancel", Some(opt)) => { + call_result = self._risk_analysis_operations_cancel(opt, dry_run, &mut err); + }, + ("operations-delete", Some(opt)) => { + call_result = self._risk_analysis_operations_delete(opt, dry_run, &mut err); + }, + ("operations-get", Some(opt)) => { + call_result = self._risk_analysis_operations_get(opt, dry_run, &mut err); + }, + ("operations-list", Some(opt)) => { + call_result = self._risk_analysis_operations_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("risk-analysis".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("root-categories", Some(opt)) => { + match opt.subcommand() { + ("info-types-list", Some(opt)) => { + call_result = self._root_categories_info_types_list(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._root_categories_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("root-categories".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<'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, "dlp2-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "dlp2-beta1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::DLP::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 = [ + ("content", "methods: 'deidentify', 'inspect' and 'redact'", vec![ + ("deidentify", + Some(r##"De-identifies potentially sensitive info from a list of strings. + This method has limits on input size and output size."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/content_deidentify", + 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)), + ]), + ("inspect", + Some(r##"Finds potentially sensitive info in a list of strings. + This method has limits on input size, processing time, and output size."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/content_inspect", + 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)), + ]), + ("redact", + Some(r##"Redacts potentially sensitive info from a list of strings. + This method has limits on input size, processing time, and output size."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/content_redact", + 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)), + ]), + ]), + + ("data-source", "methods: 'analyze'", vec![ + ("analyze", + Some(r##"Schedules a job to compute risk analysis metrics over content in a Google + Cloud Platform repository."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/data-source_analyze", + 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)), + ]), + ]), + + ("inspect", "methods: 'operations-cancel', 'operations-create', 'operations-delete', 'operations-get', 'operations-list' and 'results-findings-list'", vec![ + ("operations-cancel", + Some(r##"Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/inspect_operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-create", + Some(r##"Schedules a job scanning content in a Google Cloud Platform data + repository."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/inspect_operations-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)), + ]), + ("operations-delete", + Some(r##"This method is not supported and the server returns `UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/inspect_operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/inspect_operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-list", + Some(r##"Fetches the list of long running operations."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/inspect_operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("results-findings-list", + Some(r##"Returns list of results for given inspect operation result set id."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/inspect_results-findings-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"Identifier of the results set returned as metadata of + the longrunning operation created by a call to InspectDataSource. + Should be in the format of `inspect/results/{id}`."##), + 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)), + ]), + ]), + + ("risk-analysis", "methods: 'operations-cancel', 'operations-delete', 'operations-get' and 'operations-list'", vec![ + ("operations-cancel", + Some(r##"Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/risk-analysis_operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-delete", + Some(r##"This method is not supported and the server returns `UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/risk-analysis_operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/risk-analysis_operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-list", + Some(r##"Fetches the list of long running operations."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/risk-analysis_operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("root-categories", "methods: 'info-types-list' and 'list'", vec![ + ("info-types-list", + Some(r##"Returns sensitive information types for given category."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/root-categories_info-types-list", + vec![ + (Some(r##"category"##), + None, + Some(r##"Category name as returned by ListRootCategories."##), + 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##"Returns the list of root categories of sensitive information."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli/root-categories_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)), + ]), + ]), + + ]; + + let mut app = App::new("dlp2-beta1") + .author("Sebastian Thiel ") + .version("1.0.6+20170918") + .about("The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dlp2_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/dlp2_beta1/Cargo.toml b/gen/dlp2_beta1/Cargo.toml new file mode 100644 index 0000000000..aa10dbb159 --- /dev/null +++ b/gen/dlp2_beta1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-dlp2_beta1" +version = "1.0.6+20170918" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with DLP (protocol v2beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1" +homepage = "https://cloud.google.com/dlp/docs/" +documentation = "https://docs.rs/google-dlp2_beta1/1.0.6+20170918" +license = "MIT" +keywords = ["dlp", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/dlp2_beta1/LICENSE.md b/gen/dlp2_beta1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dlp2_beta1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/dlp2_beta1/README.md b/gen/dlp2_beta1/README.md new file mode 100644 index 0000000000..2eb7733d90 --- /dev/null +++ b/gen/dlp2_beta1/README.md @@ -0,0 +1,191 @@ + +The `google-dlp2_beta1` library allows access to all features of the *Google DLP* service. + +This documentation was generated from *DLP* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *dlp:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *DLP* *v2_beta1* API can be found at the +[official documentation site](https://cloud.google.com/dlp/docs/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.DLP.html) ... + +* content + * [*deidentify*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.ContentDeidentifyCall.html), [*inspect*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.ContentInspectCall.html) and [*redact*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.ContentRedactCall.html) +* data source + * [*analyze*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.DataSourceAnalyzeCall.html) +* inspect + * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.InspectOperationCancelCall.html), [*operations create*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.InspectOperationCreateCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.InspectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.InspectOperationGetCall.html), [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.InspectOperationListCall.html) and [*results findings list*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.InspectResultFindingListCall.html) +* risk analysis + * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.RiskAnalysiOperationCancelCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.RiskAnalysiOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.RiskAnalysiOperationGetCall.html) and [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.RiskAnalysiOperationListCall.html) +* root categories + * [*info types list*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.RootCategoryInfoTypeListCall.html) and [*list*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.RootCategoryListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.DLP.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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.data_source().analyze(...).doit() +let r = hub.risk_analysis().operations_get(...).doit() +let r = hub.inspect().operations_get(...).doit() +let r = hub.inspect().operations_create(...).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-dlp2_beta1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_dlp2_beta1 as dlp2_beta1; +use dlp2_beta1::GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest; +use dlp2_beta1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use dlp2_beta1::DLP; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest::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.data_source().analyze(req) + .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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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](https://docs.rs/google-dlp2_beta1/1.0.6+20170918/google_dlp2_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 **dlp2_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-rsblob/master/LICENSE.md diff --git a/gen/dlp2_beta1/src/cmn.rs b/gen/dlp2_beta1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/dlp2_beta1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/dlp2_beta1/src/lib.rs b/gen/dlp2_beta1/src/lib.rs new file mode 100644 index 0000000000..a265c52335 --- /dev/null +++ b/gen/dlp2_beta1/src/lib.rs @@ -0,0 +1,7051 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *DLP* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *dlp:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *DLP* *v2_beta1* API can be found at the +//! [official documentation site](https://cloud.google.com/dlp/docs/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.DLP.html) ... +//! +//! * content +//! * [*deidentify*](struct.ContentDeidentifyCall.html), [*inspect*](struct.ContentInspectCall.html) and [*redact*](struct.ContentRedactCall.html) +//! * data source +//! * [*analyze*](struct.DataSourceAnalyzeCall.html) +//! * inspect +//! * [*operations cancel*](struct.InspectOperationCancelCall.html), [*operations create*](struct.InspectOperationCreateCall.html), [*operations delete*](struct.InspectOperationDeleteCall.html), [*operations get*](struct.InspectOperationGetCall.html), [*operations list*](struct.InspectOperationListCall.html) and [*results findings list*](struct.InspectResultFindingListCall.html) +//! * risk analysis +//! * [*operations cancel*](struct.RiskAnalysiOperationCancelCall.html), [*operations delete*](struct.RiskAnalysiOperationDeleteCall.html), [*operations get*](struct.RiskAnalysiOperationGetCall.html) and [*operations list*](struct.RiskAnalysiOperationListCall.html) +//! * root categories +//! * [*info types list*](struct.RootCategoryInfoTypeListCall.html) and [*list*](struct.RootCategoryListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.DLP.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.data_source().analyze(...).doit() +//! let r = hub.risk_analysis().operations_get(...).doit() +//! let r = hub.inspect().operations_get(...).doit() +//! let r = hub.inspect().operations_create(...).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-dlp2_beta1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_dlp2_beta1 as dlp2_beta1; +//! use dlp2_beta1::GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest; +//! use dlp2_beta1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use dlp2_beta1::DLP; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest::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.data_source().analyze(req) +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 DLP related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest; +/// use dlp2_beta1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2_beta1::DLP; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest::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.data_source().analyze(req) +/// .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 DLP { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for DLP {} + +impl<'a, C, A> DLP + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> DLP { + DLP { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://dlp.googleapis.com/".to_string(), + _root_url: "https://dlp.googleapis.com/".to_string(), + } + } + + pub fn content(&'a self) -> ContentMethods<'a, C, A> { + ContentMethods { hub: &self } + } + pub fn data_source(&'a self) -> DataSourceMethods<'a, C, A> { + DataSourceMethods { hub: &self } + } + pub fn inspect(&'a self) -> InspectMethods<'a, C, A> { + InspectMethods { hub: &self } + } + pub fn risk_analysis(&'a self) -> RiskAnalysiMethods<'a, C, A> { + RiskAnalysiMethods { hub: &self } + } + pub fn root_categories(&'a self) -> RootCategoryMethods<'a, C, A> { + RootCategoryMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://dlp.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://dlp.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Location of a finding within a `ContentItem.Table`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1TableLocation { + /// The zero-based index of the row where the finding is located. + #[serde(rename="rowIndex")] + pub row_index: Option, +} + +impl Part for GooglePrivacyDlpV2beta1TableLocation {} + + +/// Represents a time of day. The date and time zone are either not significant +/// or are specified elsewhere. An API may choose to allow leap seconds. Related +/// types are google.type.Date and `google.protobuf.Timestamp`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleTypeTimeOfDay { + /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + pub nanos: Option, + /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may + /// allow the value 60 if it allows leap-seconds. + pub seconds: Option, + /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + /// to allow the value "24:00:00" for scenarios like business closing time. + pub hours: Option, + /// Minutes of hour of day. Must be from 0 to 59. + pub minutes: Option, +} + +impl Part for GoogleTypeTimeOfDay {} + + +/// Info Type Category 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 GooglePrivacyDlpV2beta1CategoryDescription { + /// Human readable form of the category name. + #[serde(rename="displayName")] + pub display_name: Option, + /// Internal name of the category. + pub name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CategoryDescription {} + + +/// This is a data encryption key (DEK) (as opposed to +/// a key encryption key (KEK) stored by KMS). +/// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate +/// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot +/// unwrap the data crypto key. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CryptoKey { + /// no description provided + #[serde(rename="kmsWrapped")] + pub kms_wrapped: Option, + /// no description provided + pub unwrapped: Option, + /// no description provided + pub transient: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CryptoKey {} + + +/// Set of files to scan. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1FileSet { + /// The url, in the format `gs:///`. Trailing wildcard in the + /// path is allowed. + pub url: Option, +} + +impl Part for GooglePrivacyDlpV2beta1FileSet {} + + +/// Buckets values based on fixed size ranges. The +/// Bucketing transformation can provide all of this functionality, +/// but requires more configuration. This message is provided as a convenience to +/// the user for simple bucketing strategies. +/// The resulting value will be a hyphenated string of +/// lower_bound-upper_bound. +/// This can be used on data of type: double, long. +/// If the bound Value type differs from the type of data +/// being transformed, we will first attempt converting the type of the data to +/// be transformed to match the type of the bound before comparing. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1FixedSizeBucketingConfig { + /// Lower bound value of buckets. All values less than `lower_bound` are + /// grouped together into a single bucket; for example if `lower_bound` = 10, + /// then all values less than 10 are replaced with the value “-10”. [Required]. + #[serde(rename="lowerBound")] + pub lower_bound: Option, + /// Upper bound value of buckets. All values greater than upper_bound are + /// grouped together into a single bucket; for example if `upper_bound` = 89, + /// then all values greater than 89 are replaced with the value “89+”. + /// [Required]. + #[serde(rename="upperBound")] + pub upper_bound: Option, + /// Size of each bucket (except for minimum and maximum buckets). So if + /// `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + /// following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + /// 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + #[serde(rename="bucketSize")] + pub bucket_size: Option, +} + +impl Part for GooglePrivacyDlpV2beta1FixedSizeBucketingConfig {} + + +/// Request to de-identify a list of items. +/// +/// # 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*). +/// +/// * [deidentify content](struct.ContentDeidentifyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1DeidentifyContentRequest { + /// The list of items to inspect. Up to 100 are allowed per request. + /// All items will be treated as text/*. + pub items: Option>, + /// Configuration for the de-identification of the list of content items. + #[serde(rename="deidentifyConfig")] + pub deidentify_config: Option, + /// Configuration for the inspector. + #[serde(rename="inspectConfig")] + pub inspect_config: Option, +} + +impl RequestValue for GooglePrivacyDlpV2beta1DeidentifyContentRequest {} + + +/// Results of redacting a list of items. +/// +/// # 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*). +/// +/// * [redact content](struct.ContentRedactCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RedactContentResponse { + /// The redacted content. + pub items: Option>, +} + +impl ResponseResult for GooglePrivacyDlpV2beta1RedactContentResponse {} + + +/// The transformation to apply to the field. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1FieldTransformation { + /// Input field(s) to apply the transformation to. [required] + pub fields: Option>, + /// Apply the transformation to the entire field. + #[serde(rename="primitiveTransformation")] + pub primitive_transformation: Option, + /// Only apply the transformation if the condition evaluates to true for the + /// given `RecordCondition`. The conditions are allowed to reference fields + /// that are not used in the actual transformation. [optional] + /// + /// Example Use Cases: + /// + /// - Apply a different bucket transformation to an age column if the zip code + /// column for the same record is within a specific range. + /// - Redact a field if the date of birth field is greater than 85. + pub condition: Option, + /// Treat the contents of the field as free text, and selectively + /// transform content that matches an `InfoType`. + #[serde(rename="infoTypeTransformations")] + pub info_type_transformations: Option, +} + +impl Part for GooglePrivacyDlpV2beta1FieldTransformation {} + + +/// Summary of a single tranformation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1TransformationSummary { + /// Set if the transformation was limited to a specific FieldId. + pub field: Option, + /// The field transformation that was applied. This list will contain + /// multiple only in the case of errors. + #[serde(rename="fieldTransformations")] + pub field_transformations: Option>, + /// Set if the transformation was limited to a specific info_type. + #[serde(rename="infoType")] + pub info_type: Option, + /// The specific suppression option these stats apply to. + #[serde(rename="recordSuppress")] + pub record_suppress: Option, + /// no description provided + pub results: Option>, + /// The specific transformation these stats apply to. + pub transformation: Option, +} + +impl Part for GooglePrivacyDlpV2beta1TransformationSummary {} + + +/// Options defining BigQuery table and row identifiers. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1BigQueryOptions { + /// References to fields uniquely identifying rows within the table. + /// Nested fields in the format, like `person.birthdate.year`, are allowed. + #[serde(rename="identifyingFields")] + pub identifying_fields: Option>, + /// Complete BigQuery table reference. + #[serde(rename="tableReference")] + pub table_reference: Option, +} + +impl Part for GooglePrivacyDlpV2beta1BigQueryOptions {} + + +/// A collection of expressions +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Expressions { + /// no description provided + pub conditions: Option, + /// The operator to apply to the result of conditions. Default and currently + /// only supported value is `AND`. + #[serde(rename="logicalOperator")] + pub logical_operator: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Expressions {} + + +/// 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 GooglePrivacyDlpV2beta1ReplaceConfig { + /// Content replacing sensitive information of given type. Max 256 chars. + #[serde(rename="replaceWith")] + pub replace_with: Option, + /// Type of information to replace. Only one ReplaceConfig per info_type + /// should be provided. If ReplaceConfig does not have an info_type, the DLP + /// API matches it against all info_types that are found but not specified in + /// another ReplaceConfig. + #[serde(rename="infoType")] + pub info_type: Option, +} + +impl Part for GooglePrivacyDlpV2beta1ReplaceConfig {} + + +/// Configuration for determing how redaction of images should occur. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ImageRedactionConfig { + /// If true, all text found in the image, regardless whether it matches an + /// info_type, is redacted. + #[serde(rename="redactAllText")] + pub redact_all_text: Option, + /// Only one per info_type should be provided per request. If not + /// specified, and redact_all_text is false, the DLP API will redact all + /// text that it matches against all info_types that are found, but not + /// specified in another ImageRedactionConfig. + #[serde(rename="infoType")] + pub info_type: Option, + /// The color to use when redacting content from an image. If not specified, + /// the default is black. + #[serde(rename="redactionColor")] + pub redaction_color: Option, +} + +impl Part for GooglePrivacyDlpV2beta1ImageRedactionConfig {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleRpcStatus { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for GoogleRpcStatus {} + + +/// Message defining the location of a BigQuery table. A table is uniquely +/// identified by its project_id, dataset_id, and table_name. Within a query +/// a table is often referenced with a string in the format of: +/// `:.` or +/// `..`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1BigQueryTable { + /// The Google Cloud Platform project ID of the project containing the table. + /// If omitted, project ID is inferred from the API call. + #[serde(rename="projectId")] + pub project_id: Option, + /// Name of the table. + #[serde(rename="tableId")] + pub table_id: Option, + /// Dataset ID of the table. + #[serde(rename="datasetId")] + pub dataset_id: Option, +} + +impl Part for GooglePrivacyDlpV2beta1BigQueryTable {} + + +/// Buckets represented as ranges, along with replacement values. Ranges must +/// be non-overlapping. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Bucket { + /// Upper bound of the range, exclusive; type must match min. + pub max: Option, + /// Replacement value for this bucket. If not provided + /// the default behavior will be to hyphenate the min-max range. + #[serde(rename="replacementValue")] + pub replacement_value: Option, + /// Lower bound of the range, inclusive. Type should be the same as max if + /// used. + pub min: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Bucket {} + + +/// k-anonymity metric, used for analysis of reidentification risk. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1KAnonymityConfig { + /// Optional message indicating that each distinct `EntityId` should not + /// contribute to the k-anonymity count more than once per equivalence class. + #[serde(rename="entityId")] + pub entity_id: Option, + /// Set of fields to compute k-anonymity over. When multiple fields are + /// specified, they are considered a single composite key. Structs and + /// repeated data types are not supported; however, nested fields are + /// supported so long as they are not structs themselves or nested within + /// a repeated field. + #[serde(rename="quasiIds")] + pub quasi_ids: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1KAnonymityConfig {} + + +/// Datastore partition ID. +/// A partition ID identifies a grouping of entities. The grouping is always +/// by project and namespace, however the namespace ID may be empty. +/// +/// A partition ID contains several dimensions: +/// project ID and namespace 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 GooglePrivacyDlpV2beta1PartitionId { + /// The ID of the project to which the entities belong. + #[serde(rename="projectId")] + pub project_id: Option, + /// If not empty, the ID of the namespace to which the entities belong. + #[serde(rename="namespaceId")] + pub namespace_id: Option, +} + +impl Part for GooglePrivacyDlpV2beta1PartitionId {} + + +/// Request to search for potentially sensitive info in a list of items +/// and replace it with a default or provided content. +/// +/// # 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*). +/// +/// * [redact content](struct.ContentRedactCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RedactContentRequest { + /// The list of items to inspect. Up to 100 are allowed per request. + pub items: Option>, + /// The strings to replace findings text findings with. Must specify at least + /// one of these or one ImageRedactionConfig if redacting images. + #[serde(rename="replaceConfigs")] + pub replace_configs: Option>, + /// Configuration for the inspector. + #[serde(rename="inspectConfig")] + pub inspect_config: Option, + /// The configuration for specifying what content to redact from images. + #[serde(rename="imageRedactionConfigs")] + pub image_redaction_configs: Option>, +} + +impl RequestValue for GooglePrivacyDlpV2beta1RedactContentRequest {} + + +/// Configuration description of the scanning process. +/// When used with redactContent only info_types and min_likelihood are currently +/// used. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1InspectConfig { + /// When true, excludes type information of the findings. + #[serde(rename="excludeTypes")] + pub exclude_types: Option, + /// Only returns findings equal or above this threshold. + #[serde(rename="minLikelihood")] + pub min_likelihood: Option, + /// Configuration of findings limit given for specified info types. + #[serde(rename="infoTypeLimits")] + pub info_type_limits: Option>, + /// When true, a contextual quote from the data that triggered a finding is + /// included in the response; see Finding.quote. + #[serde(rename="includeQuote")] + pub include_quote: Option, + /// Restricts what info_types to look for. The values must correspond to + /// InfoType values returned by ListInfoTypes or found in documentation. + /// Empty info_types runs all enabled detectors. + #[serde(rename="infoTypes")] + pub info_types: Option>, + /// Limits the number of findings per content item or long running operation. + #[serde(rename="maxFindings")] + pub max_findings: Option, +} + +impl Part for GooglePrivacyDlpV2beta1InspectConfig {} + + +/// The request message for Operations.CancelOperation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [operations cancel inspect](struct.InspectOperationCancelCall.html) (request) +/// * [operations cancel risk analysis](struct.RiskAnalysiOperationCancelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunningCancelOperationRequest { _never_set: Option } + +impl RequestValue for GoogleLongrunningCancelOperationRequest {} + + +/// Bounding box encompassing detected text within an image. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ImageLocation { + /// Width of the bounding box in pixels. + pub width: Option, + /// Top coordinate of the bounding box. (0,0) is upper left. + pub top: Option, + /// Height of the bounding box in pixels. + pub height: Option, + /// Left coordinate of the bounding box. (0,0) is upper left. + pub left: Option, +} + +impl Part for GooglePrivacyDlpV2beta1ImageLocation {} + + +/// A representation of a Datastore property in a projection. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Projection { + /// The property to project. + pub property: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Projection {} + + +/// Using raw keys is prone to security risks due to accidentally +/// leaking the key. Choose another type of key if possible. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1UnwrappedCryptoKey { + /// The AES 128/192/256 bit key. [required] + pub key: Option, +} + +impl Part for GooglePrivacyDlpV2beta1UnwrappedCryptoKey {} + + +/// Additional configuration for inspect long running operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1OperationConfig { + /// Max number of findings per file, Datastore entity, or database row. + #[serde(rename="maxItemFindings")] + pub max_item_findings: Option, +} + +impl Part for GooglePrivacyDlpV2beta1OperationConfig {} + + +/// A rule for transforming a value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1PrimitiveTransformation { + /// no description provided + #[serde(rename="characterMaskConfig")] + pub character_mask_config: Option, + /// no description provided + #[serde(rename="redactConfig")] + pub redact_config: Option, + /// no description provided + #[serde(rename="bucketingConfig")] + pub bucketing_config: Option, + /// no description provided + #[serde(rename="replaceWithInfoTypeConfig")] + pub replace_with_info_type_config: Option, + /// no description provided + #[serde(rename="timePartConfig")] + pub time_part_config: Option, + /// no description provided + #[serde(rename="cryptoHashConfig")] + pub crypto_hash_config: Option, + /// no description provided + #[serde(rename="fixedSizeBucketingConfig")] + pub fixed_size_bucketing_config: Option, + /// no description provided + #[serde(rename="cryptoReplaceFfxFpeConfig")] + pub crypto_replace_ffx_fpe_config: Option, + /// no description provided + #[serde(rename="replaceConfig")] + pub replace_config: Option, +} + +impl Part for GooglePrivacyDlpV2beta1PrimitiveTransformation {} + + +/// Results of de-identifying a list of items. +/// +/// # 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*). +/// +/// * [deidentify content](struct.ContentDeidentifyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1DeidentifyContentResponse { + /// no description provided + pub items: Option>, + /// A review of the transformations that took place for each item. + pub summaries: Option>, +} + +impl ResponseResult for GooglePrivacyDlpV2beta1DeidentifyContentResponse {} + + +/// Type of information detected by the API. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1InfoType { + /// Name of the information type. + pub name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1InfoType {} + + +/// Shared message indicating Cloud storage 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 GooglePrivacyDlpV2beta1StorageConfig { + /// Google Cloud Datastore options specification. + #[serde(rename="datastoreOptions")] + pub datastore_options: Option, + /// BigQuery options specification. + #[serde(rename="bigQueryOptions")] + pub big_query_options: Option, + /// Google Cloud Storage options specification. + #[serde(rename="cloudStorageOptions")] + pub cloud_storage_options: Option, +} + +impl Part for GooglePrivacyDlpV2beta1StorageConfig {} + + +/// Compute numerical stats over an individual column, including +/// min, max, and quantiles. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1NumericalStatsConfig { + /// Field to compute numerical stats on. Supported types are + /// integer, float, date, datetime, timestamp, time. + pub field: Option, +} + +impl Part for GooglePrivacyDlpV2beta1NumericalStatsConfig {} + + +/// A unique identifier for a Datastore entity. +/// If a key's partition ID or any of its path kinds or names are +/// reserved/read-only, the key is reserved/read-only. +/// A reserved/read-only key is forbidden in certain documented contexts. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Key { + /// The entity path. + /// An entity path consists of one or more elements composed of a kind and a + /// string or numerical identifier, which identify entities. The first + /// element identifies a _root entity_, the second element identifies + /// a _child_ of the root entity, the third element identifies a child of the + /// second entity, and so forth. The entities identified by all prefixes of + /// the path are called the element's _ancestors_. + /// + /// A path can never be empty, and a path can have at most 100 elements. + pub path: Option>, + /// Entities are partitioned into subsets, currently identified by a project + /// ID and namespace ID. + /// Queries are scoped to a single partition. + #[serde(rename="partitionId")] + pub partition_id: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Key {} + + +/// A type of transformation that will scan unstructured text and +/// apply various `PrimitiveTransformation`s to each finding, where the +/// transformation is applied to only values that were identified as a specific +/// info_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 GooglePrivacyDlpV2beta1InfoTypeTransformations { + /// Transformation for each info type. Cannot specify more than one + /// for a given info type. [required] + pub transformations: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1InfoTypeTransformations {} + + +/// 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 GooglePrivacyDlpV2beta1Row { + /// no description provided + pub values: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1Row {} + + +/// High level summary of deidentification. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1DeidentificationSummary { + /// Transformations applied to the dataset. + #[serde(rename="transformationSummaries")] + pub transformation_summaries: Option>, + /// Total size in bytes that were transformed in some way. + #[serde(rename="transformedBytes")] + pub transformed_bytes: Option, +} + +impl Part for GooglePrivacyDlpV2beta1DeidentificationSummary {} + + +/// A location in Cloud Storage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CloudStoragePath { + /// The url, in the format of `gs://bucket/`. + pub path: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CloudStoragePath {} + + +/// For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a +/// portion of the value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1TimePartConfig { + /// no description provided + #[serde(rename="partToExtract")] + pub part_to_extract: Option, +} + +impl Part for GooglePrivacyDlpV2beta1TimePartConfig {} + + +/// Response for ListRootCategories request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list root categories](struct.RootCategoryListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ListRootCategoriesResponse { + /// List of all into type categories supported by the API. + pub categories: Option>, +} + +impl ResponseResult for GooglePrivacyDlpV2beta1ListRootCategoriesResponse {} + + +/// Container structure describing a single finding within a string or image. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Finding { + /// The specific string that may be potentially sensitive info. + pub quote: Option, + /// The specific type of info the string might be. + #[serde(rename="infoType")] + pub info_type: Option, + /// Estimate of how likely it is that the info_type is correct. + pub likelihood: Option, + /// Timestamp when finding was detected. + #[serde(rename="createTime")] + pub create_time: Option, + /// Location of the info found. + pub location: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Finding {} + + +/// A reference to a property relative to the Datastore kind expressions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1PropertyReference { + /// The name of the property. + /// If name includes "."s, it may be interpreted as a property name path. + pub name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1PropertyReference {} + + +/// Message for a unique key indicating a record that contains a finding. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RecordKey { + /// no description provided + #[serde(rename="cloudStorageKey")] + pub cloud_storage_key: Option, + /// no description provided + #[serde(rename="datastoreKey")] + pub datastore_key: Option, +} + +impl Part for GooglePrivacyDlpV2beta1RecordKey {} + + +/// General identifier of a data field in a storage service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1FieldId { + /// Name describing the field. + #[serde(rename="columnName")] + pub column_name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1FieldId {} + + +/// Partially mask a string by replacing a given number of characters with a +/// fixed character. Masking can start from the beginning or end of the string. +/// This can be used on data of any type (numbers, longs, and so on) and when +/// de-identifying structured data we'll attempt to preserve the original data's +/// type. (This allows you to take a long like 123 and modify it to a string like +/// **3. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CharacterMaskConfig { + /// When masking a string, items in this list will be skipped when replacing. + /// For example, if your string is 555-555-5555 and you ask us to skip `-` and + /// mask 5 chars with * we would produce ***-*55-5555. + #[serde(rename="charactersToIgnore")] + pub characters_to_ignore: Option>, + /// Number of characters to mask. If not set, all matching chars will be + /// masked. Skipped characters do not count towards this tally. + #[serde(rename="numberToMask")] + pub number_to_mask: Option, + /// Character to mask the sensitive values—for example, "*" for an + /// alphabetic string such as name, or "0" for a numeric string such as ZIP + /// code or credit card number. String must have length 1. If not supplied, we + /// will default to "*" for strings, 0 for digits. + #[serde(rename="maskingCharacter")] + pub masking_character: Option, + /// Mask characters in reverse order. For example, if `masking_character` is + /// '0', number_to_mask is 14, and `reverse_order` is false, then + /// 1234-5678-9012-3456 -> 00000000000000-3456 + /// If `masking_character` is '*', `number_to_mask` is 3, and `reverse_order` + /// is true, then 12345 -> 12*** + #[serde(rename="reverseOrder")] + pub reverse_order: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CharacterMaskConfig {} + + +/// Redact a given value. For example, if used with an `InfoTypeTransformation` +/// transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the +/// output would be 'My phone number is '. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RedactConfig { _never_set: Option } + +impl Part for GooglePrivacyDlpV2beta1RedactConfig {} + + +/// A collection that informs the user the number of times a particular +/// `TransformationResultCode` and error details occurred. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1SummaryResult { + /// no description provided + pub count: Option, + /// no description provided + pub code: Option, + /// A place for warnings or errors to show up if a transformation didn't + /// work as expected. + pub details: Option, +} + +impl Part for GooglePrivacyDlpV2beta1SummaryResult {} + + +/// Replace each input value with a given `Value`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ReplaceValueConfig { + /// Value to replace it with. + #[serde(rename="newValue")] + pub new_value: Option, +} + +impl Part for GooglePrivacyDlpV2beta1ReplaceValueConfig {} + + +/// A (kind, ID/name) pair used to construct a key path. +/// +/// If either name or ID is set, the element is complete. +/// If neither is set, the element is incomplete. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1PathElement { + /// The kind of the entity. + /// A kind matching regex `__.*__` is reserved/read-only. + /// A kind must not contain more than 1500 bytes when UTF-8 encoded. + /// Cannot be `""`. + pub kind: Option, + /// The auto-allocated ID of the entity. + /// Never equal to zero. Values less than zero are discouraged and may not + /// be supported in the future. + pub id: Option, + /// The name of the entity. + /// A name matching regex `__.*__` is reserved/read-only. + /// A name must not be more than 1500 bytes when UTF-8 encoded. + /// Cannot be `""`. + pub name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1PathElement {} + + +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleTypeDate { + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, + /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + /// if specifying a year/month where the day is not significant. + pub day: Option, + /// Month of year. Must be from 1 to 12. + pub month: Option, +} + +impl Part for GoogleTypeDate {} + + +/// Options defining a file or a set of files (path ending with *) within +/// a Google Cloud Storage bucket. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CloudStorageOptions { + /// no description provided + #[serde(rename="fileSet")] + pub file_set: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CloudStorageOptions {} + + +/// All the findings for a single scanned item. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1InspectResult { + /// If true, then this item might have more findings than were returned, + /// and the findings returned are an arbitrary subset of all findings. + /// The findings list might be truncated because the input items were too + /// large, or because the server reached the maximum amount of resources + /// allowed for a single API call. For best results, divide the input into + /// smaller batches. + #[serde(rename="findingsTruncated")] + pub findings_truncated: Option, + /// List of findings for an item. + pub findings: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1InspectResult {} + + +/// Replaces an identifier with an surrogate using FPE with the FFX +/// mode of operation. +/// The identifier must be encoded as ASCII. +/// For a given crypto key and context, the same identifier will be +/// replaced with the same surrogate. +/// Note that a given identifier must be either the empty string or be at +/// least two characters long. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { + /// The key used by the encryption algorithm. [required] + #[serde(rename="cryptoKey")] + pub crypto_key: Option, + /// This is supported by mapping these to the alphanumeric characters + /// that the FFX mode natively supports. This happens before/after + /// encryption/decryption. + /// Each character listed must appear only once. + /// Number of characters must be in the range [2, 62]. + /// This must be encoded as ASCII. + /// The order of characters does not matter. + #[serde(rename="customAlphabet")] + pub custom_alphabet: Option, + /// The native way to select the alphabet. Must be in the range [2, 62]. + pub radix: Option, + /// no description provided + #[serde(rename="commonAlphabet")] + pub common_alphabet: Option, + /// A context may be used for higher security since the same + /// identifier in two different contexts likely will be given a distinct + /// surrogate. The principle is that the likeliness is inversely related + /// to the ratio of the number of distinct identifiers per context over the + /// number of possible surrogates: As long as this ratio is small, the + /// likehood is large. + /// + /// If the context is not set, a default tweak will be used. + /// If the context is set but: + /// + /// 1. there is no record present when transforming a given value or + /// 1. the field is not present when transforming a given value, + /// + /// a default tweak will be used. + /// + /// Note that case (1) is expected when an `InfoTypeTransformation` is + /// applied to both structured and non-structured `ContentItem`s. + /// Currently, the referenced field may be of value type integer or string. + /// + /// The tweak is constructed as a sequence of bytes in big endian byte order + /// such that: + /// + /// - a 64 bit integer is encoded followed by a single byte of value 1 + /// - a string is encoded in UTF-8 format followed by a single byte of value 2 + /// + /// This is also known as the 'tweak', as in tweakable encryption. + pub context: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig {} + + +/// Record key for a finding in a Cloud Storage file. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CloudStorageKey { + /// Byte offset of the referenced data in the file. + #[serde(rename="startOffset")] + pub start_offset: Option, + /// Path to the file. + #[serde(rename="filePath")] + pub file_path: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CloudStorageKey {} + + +/// Results of inspecting a list of items. +/// +/// # 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*). +/// +/// * [inspect content](struct.ContentInspectCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1InspectContentResponse { + /// Each content_item from the request has a result in this list, in the + /// same order as the request. + pub results: Option>, +} + +impl ResponseResult for GooglePrivacyDlpV2beta1InspectContentResponse {} + + +/// 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 GooglePrivacyDlpV2beta1Conditions { + /// no description provided + pub conditions: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1Conditions {} + + +/// Represents a color in the RGB color space. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Color { + /// The amount of blue in the color as a value in the interval [0, 1]. + pub blue: Option, + /// The amount of green in the color as a value in the interval [0, 1]. + pub green: Option, + /// The amount of red in the color as a value in the interval [0, 1]. + pub red: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Color {} + + +/// Generalization function that buckets values based on ranges. The ranges and +/// replacement values are dynamically provided by the user for custom behavior, +/// such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH +/// This can be used on +/// data of type: number, long, string, timestamp. +/// If the bound `Value` type differs from the type of data being transformed, we +/// will first attempt converting the type of the data to be transformed to match +/// the type of the bound before comparing. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1BucketingConfig { + /// no description provided + pub buckets: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1BucketingConfig {} + + +/// The configuration that controls how the data will change. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1DeidentifyConfig { + /// Treat the dataset as free-form text and apply the same free text + /// transformation everywhere. + #[serde(rename="infoTypeTransformations")] + pub info_type_transformations: Option, + /// Treat the dataset as structured. Transformations can be applied to + /// specific locations within structured datasets, such as transforming + /// a column within a table. + #[serde(rename="recordTransformations")] + pub record_transformations: Option, +} + +impl Part for GooglePrivacyDlpV2beta1DeidentifyConfig {} + + +/// Use this to have a random data crypto key generated. +/// It will be discarded after the operation/request finishes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1TransientCryptoKey { + /// Name of the key. [required] + /// This is an arbitrary string used to differentiate different keys. + /// A unique key is generated per name: two separate `TransientCryptoKey` + /// protos share the same generated key if their names are the same. + /// When the data crypto key is generated, this name is not used in any way + /// (repeating the api call will result in a different key being generated). + pub name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1TransientCryptoKey {} + + +/// Cloud repository for storing output. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1OutputStorageConfig { + /// Store findings in a new table in the dataset. + pub table: Option, + /// The path to a Google Cloud Storage location to store output. + #[serde(rename="storagePath")] + pub storage_path: Option, +} + +impl Part for GooglePrivacyDlpV2beta1OutputStorageConfig {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [operations cancel inspect](struct.InspectOperationCancelCall.html) (response) +/// * [operations delete inspect](struct.InspectOperationDeleteCall.html) (response) +/// * [operations cancel risk analysis](struct.RiskAnalysiOperationCancelCall.html) (response) +/// * [operations delete risk analysis](struct.RiskAnalysiOperationDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleProtobufEmpty { _never_set: Option } + +impl ResponseResult for GoogleProtobufEmpty {} + + +/// Pseudonymization method that generates surrogates via cryptographic hashing. +/// Uses SHA-256. +/// Outputs a 32 byte digest as an uppercase hex string +/// (for example, 41D1567F7F99F1DC2A5FAB886DEE5BEE). +/// Currently, only string and integer values can be hashed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CryptoHashConfig { + /// The key used by the hash function. + #[serde(rename="cryptoKey")] + pub crypto_key: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CryptoHashConfig {} + + +/// l-diversity metric, used for analysis of reidentification risk. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1LDiversityConfig { + /// Sensitive field for computing the l-value. + #[serde(rename="sensitiveAttribute")] + pub sensitive_attribute: Option, + /// Set of quasi-identifiers indicating how equivalence classes are + /// defined for the l-diversity computation. When multiple fields are + /// specified, they are considered a single composite key. + #[serde(rename="quasiIds")] + pub quasi_ids: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1LDiversityConfig {} + + +/// Request for scheduling a scan of a data subset from a Google Platform data +/// repository. +/// +/// # 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*). +/// +/// * [operations create inspect](struct.InspectOperationCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CreateInspectOperationRequest { + /// Optional location to store findings. The bucket must already exist and + /// the Google APIs service account for DLP must have write permission to + /// write to the given bucket. + /// Results are split over multiple csv files with each file name matching + /// the pattern "[operation_id]_[count].csv", for example + /// `3094877188788974909_1.csv`. The `operation_id` matches the + /// identifier for the Operation, and the `count` is a counter used for + /// tracking the number of files written. + /// + /// The CSV file(s) contain the following columns regardless of storage type + /// scanned: + /// - id + /// - info_type + /// - likelihood + /// - byte size of finding + /// - quote + /// - timestamp + /// + /// For Cloud Storage the next columns are: + /// + /// - file_path + /// - start_offset + /// + /// For Cloud Datastore the next columns are: + /// + /// - project_id + /// - namespace_id + /// - path + /// - column_name + /// - offset + /// + /// For BigQuery the next columns are: + /// + /// - row_number + /// - project_id + /// - dataset_id + /// - table_id + #[serde(rename="outputConfig")] + pub output_config: Option, + /// Configuration for the inspector. + #[serde(rename="inspectConfig")] + pub inspect_config: Option, + /// Specification of the data set to process. + #[serde(rename="storageConfig")] + pub storage_config: Option, + /// Additional configuration settings for long running operations. + #[serde(rename="operationConfig")] + pub operation_config: Option, +} + +impl RequestValue for GooglePrivacyDlpV2beta1CreateInspectOperationRequest {} + + +/// Max findings configuration per info type, per content item or long running +/// 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 GooglePrivacyDlpV2beta1InfoTypeLimit { + /// Type of information the findings limit applies to. Only one limit per + /// info_type should be provided. If InfoTypeLimit does not have an + /// info_type, the DLP API applies the limit against all info_types that are + /// found but not specified in another InfoTypeLimit. + #[serde(rename="infoType")] + pub info_type: Option, + /// Max findings limit for the given infoType. + #[serde(rename="maxFindings")] + pub max_findings: Option, +} + +impl Part for GooglePrivacyDlpV2beta1InfoTypeLimit {} + + +/// The field type of `value` and `field` do not need to match to be +/// considered equal, but not all comparisons are possible. +/// +/// A `value` of type: +/// +/// - `string` can be compared against all other types +/// - `boolean` can only be compared against other booleans +/// - `integer` can be compared against doubles or a string if the string value +/// can be parsed as an integer. +/// - `double` can be compared against integers or a string if the string can +/// be parsed as a double. +/// - `Timestamp` can be compared against strings in RFC 3339 date string +/// format. +/// - `TimeOfDay` can be compared against timestamps and strings in the format +/// of 'HH:mm:ss'. +/// +/// If we fail to compare do to type mismatch, a warning will be given and +/// the condition will evaluate to false. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Condition { + /// Operator used to compare the field or info type to the value. [required] + pub operator: Option, + /// Field within the record this condition is evaluated against. [required] + pub field: Option, + /// Value to compare against. [Required, except for `EXISTS` tests.] + pub value: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Condition {} + + +/// Description of the information type (infoType). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1InfoTypeDescription { + /// Human readable form of the infoType name. + #[serde(rename="displayName")] + pub display_name: Option, + /// Internal name of the infoType. + pub name: Option, + /// List of categories this infoType belongs to. + pub categories: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1InfoTypeDescription {} + + +/// A representation of a Datastore kind. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1KindExpression { + /// The name of the kind. + pub name: Option, +} + +impl Part for GooglePrivacyDlpV2beta1KindExpression {} + + +/// Replace each matching finding with the name of the info_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 GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig { _never_set: Option } + +impl Part for GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig {} + + +/// Request to search for potentially sensitive info in a list of items. +/// +/// # 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*). +/// +/// * [inspect content](struct.ContentInspectCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1InspectContentRequest { + /// The list of items to inspect. Items in a single request are + /// considered "related" unless inspect_config.independent_inputs is true. + /// Up to 100 are allowed per request. + pub items: Option>, + /// Configuration for the inspector. + #[serde(rename="inspectConfig")] + pub inspect_config: Option, +} + +impl RequestValue for GooglePrivacyDlpV2beta1InspectContentRequest {} + + +/// Response to the ListInspectFindings request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [results findings list inspect](struct.InspectResultFindingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ListInspectFindingsResponse { + /// If not empty, indicates that there may be more results that match the + /// request; this value should be passed in a new `ListInspectFindingsRequest`. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The results. + pub result: Option, +} + +impl ResponseResult for GooglePrivacyDlpV2beta1ListInspectFindingsResponse {} + + +/// A condition for determing whether a transformation should be applied to +/// a field. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RecordCondition { + /// no description provided + pub expressions: Option, +} + +impl Part for GooglePrivacyDlpV2beta1RecordCondition {} + + +/// Set of primitive values supported by the system. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Value { + /// no description provided + #[serde(rename="booleanValue")] + pub boolean_value: Option, + /// no description provided + #[serde(rename="timeValue")] + pub time_value: Option, + /// no description provided + #[serde(rename="timestampValue")] + pub timestamp_value: Option, + /// no description provided + #[serde(rename="dateValue")] + pub date_value: Option, + /// no description provided + #[serde(rename="stringValue")] + pub string_value: Option, + /// no description provided + #[serde(rename="floatValue")] + pub float_value: Option, + /// no description provided + #[serde(rename="integerValue")] + pub integer_value: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Value {} + + +/// Privacy metric to compute for reidentification risk analysis. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1PrivacyMetric { + /// no description provided + #[serde(rename="numericalStatsConfig")] + pub numerical_stats_config: Option, + /// no description provided + #[serde(rename="lDiversityConfig")] + pub l_diversity_config: Option, + /// no description provided + #[serde(rename="kAnonymityConfig")] + pub k_anonymity_config: Option, + /// no description provided + #[serde(rename="categoricalStatsConfig")] + pub categorical_stats_config: Option, +} + +impl Part for GooglePrivacyDlpV2beta1PrivacyMetric {} + + +/// Request for creating a risk analysis 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*). +/// +/// * [analyze data source](struct.DataSourceAnalyzeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest { + /// Privacy metric to compute. + #[serde(rename="privacyMetric")] + pub privacy_metric: Option, + /// Input dataset to compute metrics over. + #[serde(rename="sourceTable")] + pub source_table: Option, +} + +impl RequestValue for GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest {} + + +/// Options defining a data set within Google Cloud Datastore. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1DatastoreOptions { + /// A partition ID identifies a grouping of entities. The grouping is always + /// by project and namespace, however the namespace ID may be empty. + #[serde(rename="partitionId")] + pub partition_id: Option, + /// The kind to process. + pub kind: Option, + /// Properties to scan. If none are specified, all properties will be scanned + /// by default. + pub projection: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1DatastoreOptions {} + + +/// An entity in a dataset is a field or set of fields that correspond to a +/// single person. For example, in medical records the `EntityId` might be +/// a patient identifier, or for financial records it might be an account +/// identifier. This message is used when generalizations or analysis must be +/// consistent across multiple rows pertaining to the same entity. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1EntityId { + /// Composite key indicating which field contains the entity identifier. + pub field: Option, +} + +impl Part for GooglePrivacyDlpV2beta1EntityId {} + + +/// Characters to skip when doing deidentification of a value. These will be left +/// alone and skipped. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CharsToIgnore { + /// no description provided + #[serde(rename="commonCharactersToIgnore")] + pub common_characters_to_ignore: Option, + /// no description provided + #[serde(rename="charactersToSkip")] + pub characters_to_skip: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CharsToIgnore {} + + +/// Container structure for the content to inspect. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ContentItem { + /// Content data to inspect or redact. + pub data: Option, + /// Type of the content, as defined in Content-Type HTTP header. + /// Supported types are: all "text" types, octet streams, PNG images, + /// JPEG images. + #[serde(rename="type")] + pub type_: Option, + /// String data to inspect or redact. + pub value: Option, + /// Structured content for inspection. + pub table: Option, +} + +impl Part for GooglePrivacyDlpV2beta1ContentItem {} + + +/// Specifies the location of a finding within its source item. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Location { + /// Location within a `ContentItem.Table`. + #[serde(rename="tableLocation")] + pub table_location: Option, + /// Location within an image's pixels. + #[serde(rename="imageBoxes")] + pub image_boxes: Option>, + /// Zero-based byte offsets within a content item. + #[serde(rename="byteRange")] + pub byte_range: Option, + /// Character offsets within a content item, included when content type + /// is a text. Default charset assumed to be UTF-8. + #[serde(rename="codepointRange")] + pub codepoint_range: Option, + /// Field id of the field containing the finding. + #[serde(rename="fieldId")] + pub field_id: Option, + /// Key of the finding. + #[serde(rename="recordKey")] + pub record_key: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Location {} + + +/// Record key for a finding in Cloud Datastore. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1DatastoreKey { + /// Datastore entity key. + #[serde(rename="entityKey")] + pub entity_key: Option, +} + +impl Part for GooglePrivacyDlpV2beta1DatastoreKey {} + + +/// Response to the ListInfoTypes request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [info types list root categories](struct.RootCategoryInfoTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1ListInfoTypesResponse { + /// Set of sensitive info types belonging to a category. + #[serde(rename="infoTypes")] + pub info_types: Option>, +} + +impl ResponseResult for GooglePrivacyDlpV2beta1ListInfoTypesResponse {} + + +/// A type of transformation that is applied over structured data such as a +/// table. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RecordTransformations { + /// Configuration defining which records get suppressed entirely. Records that + /// match any suppression rule are omitted from the output [optional]. + #[serde(rename="recordSuppressions")] + pub record_suppressions: Option>, + /// Transform the record by applying various field transformations. + #[serde(rename="fieldTransformations")] + pub field_transformations: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1RecordTransformations {} + + +/// Structured content to inspect. Up to 50,000 `Value`s per request allowed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Table { + /// no description provided + pub headers: Option>, + /// no description provided + pub rows: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1Table {} + + +/// Include to use an existing data crypto key wrapped by KMS. +/// Authorization requires the following IAM permissions when sending a request +/// to perform a crypto transformation using a kms-wrapped crypto key: +/// dlp.kms.encrypt +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1KmsWrappedCryptoKey { + /// The resource name of the KMS CryptoKey to use for unwrapping. [required] + #[serde(rename="cryptoKeyName")] + pub crypto_key_name: Option, + /// The wrapped data crypto key. [required] + #[serde(rename="wrappedKey")] + pub wrapped_key: Option, +} + +impl Part for GooglePrivacyDlpV2beta1KmsWrappedCryptoKey {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [analyze data source](struct.DataSourceAnalyzeCall.html) (response) +/// * [operations get risk analysis](struct.RiskAnalysiOperationGetCall.html) (response) +/// * [operations get inspect](struct.InspectOperationGetCall.html) (response) +/// * [operations create inspect](struct.InspectOperationCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunningOperation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// This field will contain an InspectOperationResult object for `inspect.operations.create` or a RiskAnalysisOperationResult object for `dataSource.analyze`. + pub response: Option>, + /// The server-assigned name. The `name` should have the format of `inspect/operations/`. + pub name: Option, + /// This field will contain an InspectOperationMetadata object for `inspect.operations.create` or a RiskAnalysisOperationMetadata object for `dataSource.analyze`. This will always be returned with the Operation. + pub metadata: Option>, +} + +impl ResponseResult for GoogleLongrunningOperation {} + + +/// Generic half-open interval [start, end) +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Range { + /// Index of the first character of the range (inclusive). + pub start: Option, + /// Index of the last character of the range (exclusive). + pub end: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Range {} + + +/// Compute numerical stats over an individual column, including +/// number of distinct values and value count distribution. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1CategoricalStatsConfig { + /// Field to compute categorical stats on. All column types are + /// supported except for arrays and structs. However, it may be more + /// informative to use NumericalStats when the field type is supported, + /// depending on the data. + pub field: Option, +} + +impl Part for GooglePrivacyDlpV2beta1CategoricalStatsConfig {} + + +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [operations list inspect](struct.InspectOperationListCall.html) (response) +/// * [operations list risk analysis](struct.RiskAnalysiOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunningListOperationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, +} + +impl ResponseResult for GoogleLongrunningListOperationsResponse {} + + +/// Configuration to suppress records whose suppression conditions evaluate to +/// true. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1RecordSuppression { + /// no description provided + pub condition: Option, +} + +impl Part for GooglePrivacyDlpV2beta1RecordSuppression {} + + +/// A transformation to apply to text that is identified as a specific +/// info_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 GooglePrivacyDlpV2beta1InfoTypeTransformation { + /// Primitive transformation to apply to the info type. [required] + #[serde(rename="primitiveTransformation")] + pub primitive_transformation: Option, + /// Info types to apply the transformation to. Empty list will match all + /// available info types for this transformation. + #[serde(rename="infoTypes")] + pub info_types: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1InfoTypeTransformation {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *content* resources. +/// It is not used directly, but through the `DLP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2_beta1 as dlp2_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2_beta1::DLP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `deidentify(...)`, `inspect(...)` and `redact(...)` +/// // to build up your call. +/// let rb = hub.content(); +/// # } +/// ``` +pub struct ContentMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, +} + +impl<'a, C, A> MethodsBuilder for ContentMethods<'a, C, A> {} + +impl<'a, C, A> ContentMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Redacts potentially sensitive info from a list of strings. + /// This method has limits on input size, processing time, and output size. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn redact(&self, request: GooglePrivacyDlpV2beta1RedactContentRequest) -> ContentRedactCall<'a, C, A> { + ContentRedactCall { + 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: + /// + /// De-identifies potentially sensitive info from a list of strings. + /// This method has limits on input size and output size. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn deidentify(&self, request: GooglePrivacyDlpV2beta1DeidentifyContentRequest) -> ContentDeidentifyCall<'a, C, A> { + ContentDeidentifyCall { + 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: + /// + /// Finds potentially sensitive info in a list of strings. + /// This method has limits on input size, processing time, and output size. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn inspect(&self, request: GooglePrivacyDlpV2beta1InspectContentRequest) -> ContentInspectCall<'a, C, A> { + ContentInspectCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *rootCategory* resources. +/// It is not used directly, but through the `DLP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2_beta1 as dlp2_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2_beta1::DLP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `info_types_list(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.root_categories(); +/// # } +/// ``` +pub struct RootCategoryMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, +} + +impl<'a, C, A> MethodsBuilder for RootCategoryMethods<'a, C, A> {} + +impl<'a, C, A> RootCategoryMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns sensitive information types for given category. + /// + /// # Arguments + /// + /// * `category` - Category name as returned by ListRootCategories. + pub fn info_types_list(&self, category: &str) -> RootCategoryInfoTypeListCall<'a, C, A> { + RootCategoryInfoTypeListCall { + hub: self.hub, + _category: category.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of root categories of sensitive information. + pub fn list(&self) -> RootCategoryListCall<'a, C, A> { + RootCategoryListCall { + hub: self.hub, + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *inspect* resources. +/// It is not used directly, but through the `DLP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2_beta1 as dlp2_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2_beta1::DLP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `operations_cancel(...)`, `operations_create(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)` and `results_findings_list(...)` +/// // to build up your call. +/// let rb = hub.inspect(); +/// # } +/// ``` +pub struct InspectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, +} + +impl<'a, C, A> MethodsBuilder for InspectMethods<'a, C, A> {} + +impl<'a, C, A> InspectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Schedules a job scanning content in a Google Cloud Platform data + /// repository. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn operations_create(&self, request: GooglePrivacyDlpV2beta1CreateInspectOperationRequest) -> InspectOperationCreateCall<'a, C, A> { + InspectOperationCreateCall { + 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: + /// + /// Fetches the list of long running operations. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn operations_list(&self, name: &str) -> InspectOperationListCall<'a, C, A> { + InspectOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn operations_get(&self, name: &str) -> InspectOperationGetCall<'a, C, A> { + InspectOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the operation resource to be cancelled. + pub fn operations_cancel(&self, request: GoogleLongrunningCancelOperationRequest, name: &str) -> InspectOperationCancelCall<'a, C, A> { + InspectOperationCancelCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// This method is not supported and the server returns `UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn operations_delete(&self, name: &str) -> InspectOperationDeleteCall<'a, C, A> { + InspectOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns list of results for given inspect operation result set id. + /// + /// # Arguments + /// + /// * `name` - Identifier of the results set returned as metadata of + /// the longrunning operation created by a call to InspectDataSource. + /// Should be in the format of `inspect/results/{id}`. + pub fn results_findings_list(&self, name: &str) -> InspectResultFindingListCall<'a, C, A> { + InspectResultFindingListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *riskAnalysi* resources. +/// It is not used directly, but through the `DLP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2_beta1 as dlp2_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2_beta1::DLP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)` and `operations_list(...)` +/// // to build up your call. +/// let rb = hub.risk_analysis(); +/// # } +/// ``` +pub struct RiskAnalysiMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, +} + +impl<'a, C, A> MethodsBuilder for RiskAnalysiMethods<'a, C, A> {} + +impl<'a, C, A> RiskAnalysiMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// This method is not supported and the server returns `UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn operations_delete(&self, name: &str) -> RiskAnalysiOperationDeleteCall<'a, C, A> { + RiskAnalysiOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Fetches the list of long running operations. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn operations_list(&self, name: &str) -> RiskAnalysiOperationListCall<'a, C, A> { + RiskAnalysiOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn operations_get(&self, name: &str) -> RiskAnalysiOperationGetCall<'a, C, A> { + RiskAnalysiOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the operation resource to be cancelled. + pub fn operations_cancel(&self, request: GoogleLongrunningCancelOperationRequest, name: &str) -> RiskAnalysiOperationCancelCall<'a, C, A> { + RiskAnalysiOperationCancelCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *dataSource* resources. +/// It is not used directly, but through the `DLP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2_beta1 as dlp2_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2_beta1::DLP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `analyze(...)` +/// // to build up your call. +/// let rb = hub.data_source(); +/// # } +/// ``` +pub struct DataSourceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, +} + +impl<'a, C, A> MethodsBuilder for DataSourceMethods<'a, C, A> {} + +impl<'a, C, A> DataSourceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Schedules a job to compute risk analysis metrics over content in a Google + /// Cloud Platform repository. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn analyze(&self, request: GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest) -> DataSourceAnalyzeCall<'a, C, A> { + DataSourceAnalyzeCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Redacts potentially sensitive info from a list of strings. +/// This method has limits on input size, processing time, and output size. +/// +/// A builder for the *redact* method supported by a *content* resource. +/// It is not used directly, but through a `ContentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GooglePrivacyDlpV2beta1RedactContentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1RedactContentRequest::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.content().redact(req) +/// .doit(); +/// # } +/// ``` +pub struct ContentRedactCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2beta1RedactContentRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentRedactCall<'a, C, A> {} + +impl<'a, C, A> ContentRedactCall<'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, GooglePrivacyDlpV2beta1RedactContentResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.content.redact", + 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 = self.hub._base_url.clone() + "v2beta1/content:redact"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GooglePrivacyDlpV2beta1RedactContentRequest) -> ContentRedactCall<'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) -> ContentRedactCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContentRedactCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentRedactCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// De-identifies potentially sensitive info from a list of strings. +/// This method has limits on input size and output size. +/// +/// A builder for the *deidentify* method supported by a *content* resource. +/// It is not used directly, but through a `ContentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GooglePrivacyDlpV2beta1DeidentifyContentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1DeidentifyContentRequest::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.content().deidentify(req) +/// .doit(); +/// # } +/// ``` +pub struct ContentDeidentifyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2beta1DeidentifyContentRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentDeidentifyCall<'a, C, A> {} + +impl<'a, C, A> ContentDeidentifyCall<'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, GooglePrivacyDlpV2beta1DeidentifyContentResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.content.deidentify", + 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 = self.hub._base_url.clone() + "v2beta1/content:deidentify"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GooglePrivacyDlpV2beta1DeidentifyContentRequest) -> ContentDeidentifyCall<'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) -> ContentDeidentifyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContentDeidentifyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentDeidentifyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Finds potentially sensitive info in a list of strings. +/// This method has limits on input size, processing time, and output size. +/// +/// A builder for the *inspect* method supported by a *content* resource. +/// It is not used directly, but through a `ContentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GooglePrivacyDlpV2beta1InspectContentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1InspectContentRequest::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.content().inspect(req) +/// .doit(); +/// # } +/// ``` +pub struct ContentInspectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2beta1InspectContentRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContentInspectCall<'a, C, A> {} + +impl<'a, C, A> ContentInspectCall<'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, GooglePrivacyDlpV2beta1InspectContentResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.content.inspect", + 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 = self.hub._base_url.clone() + "v2beta1/content:inspect"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GooglePrivacyDlpV2beta1InspectContentRequest) -> ContentInspectCall<'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) -> ContentInspectCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContentInspectCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContentInspectCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns sensitive information types for given category. +/// +/// A builder for the *infoTypes.list* method supported by a *rootCategory* resource. +/// It is not used directly, but through a `RootCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.root_categories().info_types_list("category") +/// .language_code("sit") +/// .doit(); +/// # } +/// ``` +pub struct RootCategoryInfoTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _category: String, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RootCategoryInfoTypeListCall<'a, C, A> {} + +impl<'a, C, A> RootCategoryInfoTypeListCall<'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, GooglePrivacyDlpV2beta1ListInfoTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.rootCategories.infoTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("category", self._category.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "category", "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 = self.hub._base_url.clone() + "v2beta1/rootCategories/{+category}/infoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+category}", "category")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["category"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Category name as returned by ListRootCategories. + /// + /// Sets the *category* 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 category(mut self, new_value: &str) -> RootCategoryInfoTypeListCall<'a, C, A> { + self._category = new_value.to_string(); + self + } + /// Optional BCP-47 language code for localized info type friendly + /// names. If omitted, or if localized strings are not available, + /// en-US strings will be returned. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> RootCategoryInfoTypeListCall<'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) -> RootCategoryInfoTypeListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RootCategoryInfoTypeListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RootCategoryInfoTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of root categories of sensitive information. +/// +/// A builder for the *list* method supported by a *rootCategory* resource. +/// It is not used directly, but through a `RootCategoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.root_categories().list() +/// .language_code("Stet") +/// .doit(); +/// # } +/// ``` +pub struct RootCategoryListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RootCategoryListCall<'a, C, A> {} + +impl<'a, C, A> RootCategoryListCall<'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, GooglePrivacyDlpV2beta1ListRootCategoriesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.rootCategories.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "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 = self.hub._base_url.clone() + "v2beta1/rootCategories"; + 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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Optional language code for localized friendly category names. + /// If omitted or if localized strings are not available, + /// en-US strings will be returned. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> RootCategoryListCall<'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) -> RootCategoryListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RootCategoryListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RootCategoryListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Schedules a job scanning content in a Google Cloud Platform data +/// repository. +/// +/// A builder for the *operations.create* method supported by a *inspect* resource. +/// It is not used directly, but through a `InspectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GooglePrivacyDlpV2beta1CreateInspectOperationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1CreateInspectOperationRequest::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.inspect().operations_create(req) +/// .doit(); +/// # } +/// ``` +pub struct InspectOperationCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2beta1CreateInspectOperationRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InspectOperationCreateCall<'a, C, A> {} + +impl<'a, C, A> InspectOperationCreateCall<'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, GoogleLongrunningOperation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.inspect.operations.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 = self.hub._base_url.clone() + "v2beta1/inspect/operations"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GooglePrivacyDlpV2beta1CreateInspectOperationRequest) -> InspectOperationCreateCall<'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) -> InspectOperationCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> InspectOperationCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InspectOperationCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Fetches the list of long running operations. +/// +/// A builder for the *operations.list* method supported by a *inspect* resource. +/// It is not used directly, but through a `InspectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inspect().operations_list("name") +/// .page_token("et") +/// .page_size(-18) +/// .filter("kasd") +/// .doit(); +/// # } +/// ``` +pub struct InspectOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InspectOperationListCall<'a, C, A> {} + +impl<'a, C, A> InspectOperationListCall<'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, GoogleLongrunningListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.inspect.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> InspectOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InspectOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The list page size. The maximum allowed value is 256 and the default is 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> InspectOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Filters by `done`. That is, `done=true` or `done=false`. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InspectOperationListCall<'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) -> InspectOperationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> InspectOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InspectOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *operations.get* method supported by a *inspect* resource. +/// It is not used directly, but through a `InspectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inspect().operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct InspectOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InspectOperationGetCall<'a, C, A> {} + +impl<'a, C, A> InspectOperationGetCall<'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, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.inspect.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> InspectOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InspectOperationGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> InspectOperationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InspectOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. +/// +/// A builder for the *operations.cancel* method supported by a *inspect* resource. +/// It is not used directly, but through a `InspectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GoogleLongrunningCancelOperationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleLongrunningCancelOperationRequest::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.inspect().operations_cancel(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct InspectOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GoogleLongrunningCancelOperationRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InspectOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> InspectOperationCancelCall<'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, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.inspect.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleLongrunningCancelOperationRequest) -> InspectOperationCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> InspectOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InspectOperationCancelCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> InspectOperationCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InspectOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// This method is not supported and the server returns `UNIMPLEMENTED`. +/// +/// A builder for the *operations.delete* method supported by a *inspect* resource. +/// It is not used directly, but through a `InspectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inspect().operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct InspectOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InspectOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> InspectOperationDeleteCall<'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, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.inspect.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> InspectOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InspectOperationDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> InspectOperationDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InspectOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns list of results for given inspect operation result set id. +/// +/// A builder for the *results.findings.list* method supported by a *inspect* resource. +/// It is not used directly, but through a `InspectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.inspect().results_findings_list("name") +/// .page_token("erat") +/// .page_size(-35) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct InspectResultFindingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InspectResultFindingListCall<'a, C, A> {} + +impl<'a, C, A> InspectResultFindingListCall<'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, GooglePrivacyDlpV2beta1ListInspectFindingsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.inspect.results.findings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}/findings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Identifier of the results set returned as metadata of + /// the longrunning operation created by a call to InspectDataSource. + /// Should be in the format of `inspect/results/{id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> InspectResultFindingListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The value returned by the last `ListInspectFindingsResponse`; indicates + /// that this is a continuation of a prior `ListInspectFindings` 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) -> InspectResultFindingListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. + /// If 0, the implementation selects a reasonable value. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> InspectResultFindingListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Restricts findings to items that match. Supports info_type and likelihood. + /// + /// Examples: + /// + /// - info_type=EMAIL_ADDRESS + /// - info_type=PHONE_NUMBER,EMAIL_ADDRESS + /// - likelihood=VERY_LIKELY + /// - likelihood=VERY_LIKELY,LIKELY + /// - info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InspectResultFindingListCall<'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) -> InspectResultFindingListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> InspectResultFindingListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> InspectResultFindingListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// This method is not supported and the server returns `UNIMPLEMENTED`. +/// +/// A builder for the *operations.delete* method supported by a *riskAnalysi* resource. +/// It is not used directly, but through a `RiskAnalysiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.risk_analysis().operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct RiskAnalysiOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RiskAnalysiOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> RiskAnalysiOperationDeleteCall<'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, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.riskAnalysis.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> RiskAnalysiOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RiskAnalysiOperationDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RiskAnalysiOperationDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RiskAnalysiOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Fetches the list of long running operations. +/// +/// A builder for the *operations.list* method supported by a *riskAnalysi* resource. +/// It is not used directly, but through a `RiskAnalysiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.risk_analysis().operations_list("name") +/// .page_token("gubergren") +/// .page_size(-95) +/// .filter("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct RiskAnalysiOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RiskAnalysiOperationListCall<'a, C, A> {} + +impl<'a, C, A> RiskAnalysiOperationListCall<'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, GoogleLongrunningListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.riskAnalysis.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> RiskAnalysiOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RiskAnalysiOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The list page size. The maximum allowed value is 256 and the default is 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> RiskAnalysiOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Filters by `done`. That is, `done=true` or `done=false`. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RiskAnalysiOperationListCall<'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) -> RiskAnalysiOperationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RiskAnalysiOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RiskAnalysiOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *operations.get* method supported by a *riskAnalysi* resource. +/// It is not used directly, but through a `RiskAnalysiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.risk_analysis().operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct RiskAnalysiOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RiskAnalysiOperationGetCall<'a, C, A> {} + +impl<'a, C, A> RiskAnalysiOperationGetCall<'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, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.riskAnalysis.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> RiskAnalysiOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RiskAnalysiOperationGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RiskAnalysiOperationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RiskAnalysiOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. +/// +/// A builder for the *operations.cancel* method supported by a *riskAnalysi* resource. +/// It is not used directly, but through a `RiskAnalysiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GoogleLongrunningCancelOperationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleLongrunningCancelOperationRequest::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.risk_analysis().operations_cancel(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct RiskAnalysiOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GoogleLongrunningCancelOperationRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RiskAnalysiOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> RiskAnalysiOperationCancelCall<'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, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.riskAnalysis.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleLongrunningCancelOperationRequest) -> RiskAnalysiOperationCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> RiskAnalysiOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RiskAnalysiOperationCancelCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RiskAnalysiOperationCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RiskAnalysiOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Schedules a job to compute risk analysis metrics over content in a Google +/// Cloud Platform repository. +/// +/// A builder for the *analyze* method supported by a *dataSource* resource. +/// It is not used directly, but through a `DataSourceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2_beta1 as dlp2_beta1; +/// use dlp2_beta1::GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2_beta1::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest::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.data_source().analyze(req) +/// .doit(); +/// # } +/// ``` +pub struct DataSourceAnalyzeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DataSourceAnalyzeCall<'a, C, A> {} + +impl<'a, C, A> DataSourceAnalyzeCall<'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, GoogleLongrunningOperation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.dataSource.analyze", + 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 = self.hub._base_url.clone() + "v2beta1/dataSource:analyze"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest) -> DataSourceAnalyzeCall<'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) -> DataSourceAnalyzeCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DataSourceAnalyzeCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DataSourceAnalyzeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/dns1-cli/Cargo.toml b/gen/dns1-cli/Cargo.toml index 911b423e13..5b5fe30215 100644 --- a/gen/dns1-cli/Cargo.toml +++ b/gen/dns1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dns1-cli" -version = "1.0.6+20170512" +version = "1.0.6+20170921" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-dns1] path = "../dns1" -version = "1.0.6+20170512" +version = "1.0.6+20170921" diff --git a/gen/dns1-cli/README.md b/gen/dns1-cli/README.md index 45be90c79b..48264f9786 100644 --- a/gen/dns1-cli/README.md +++ b/gen/dns1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dns* API at revision *20170512*. The CLI is at version *1.0.6*. +This documentation was generated from the *dns* API at revision *20170921*. The CLI is at version *1.0.6*. ```bash dns1 [options] diff --git a/gen/dns1-cli/mkdocs.yml b/gen/dns1-cli/mkdocs.yml index 9641c19133..905b145981 100644 --- a/gen/dns1-cli/mkdocs.yml +++ b/gen/dns1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dns v1.0.6+20170512 +site_name: dns v1.0.6+20170921 site_url: http://byron.github.io/google-apis-rs/google-dns1-cli site_description: A complete library to interact with dns (protocol v1) diff --git a/gen/dns1-cli/src/main.rs b/gen/dns1-cli/src/main.rs index 58e04f11ad..636e2c59e2 100644 --- a/gen/dns1-cli/src/main.rs +++ b/gen/dns1-cli/src/main.rs @@ -1026,7 +1026,7 @@ fn main() { let mut app = App::new("dns1") .author("Sebastian Thiel ") - .version("1.0.6+20170512") + .version("1.0.6+20170921") .about("Configures and serves authoritative DNS records.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dns1_cli") .arg(Arg::with_name("url") diff --git a/gen/dns1/Cargo.toml b/gen/dns1/Cargo.toml index 2f97cccdfc..8aca241856 100644 --- a/gen/dns1/Cargo.toml +++ b/gen/dns1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dns1" -version = "1.0.6+20170512" +version = "1.0.6+20170921" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1" homepage = "https://developers.google.com/cloud-dns" -documentation = "https://docs.rs/google-dns1/1.0.6+20170512" +documentation = "https://docs.rs/google-dns1/1.0.6+20170921" license = "MIT" keywords = ["dns", "google", "protocol", "web", "api"] diff --git a/gen/dns1/README.md b/gen/dns1/README.md index f8cd85bc21..979032cc06 100644 --- a/gen/dns1/README.md +++ b/gen/dns1/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-dns1` library allows access to all features of the *Google dns* service. -This documentation was generated from *dns* crate version *1.0.6+20170512*, where *20170512* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *dns* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *dns* *v1* API can be found at the [official documentation site](https://developers.google.com/cloud-dns). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.Dns.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.Dns.html) ... -* [changes](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.Change.html) - * [*create*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ChangeListCall.html) -* [managed zones](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ManagedZone.html) - * [*create*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ManagedZoneGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ManagedZoneListCall.html) -* [projects](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.Project.html) - * [*get*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ProjectGetCall.html) -* [resource record sets](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ResourceRecordSet.html) - * [*list*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.ResourceRecordSetListCall.html) +* [changes](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.Change.html) + * [*create*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ChangeListCall.html) +* [managed zones](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ManagedZone.html) + * [*create*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ManagedZoneGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ManagedZoneListCall.html) +* [projects](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.Project.html) + * [*get*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ProjectGetCall.html) +* [resource record sets](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ResourceRecordSet.html) + * [*list*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.ResourceRecordSetListCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/struct.Dns.html)** +* **[Hub](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/struct.Dns.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -128,17 +128,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/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")`. @@ -148,29 +148,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/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](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/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](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/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](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/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](https://docs.rs/google-dns1/1.0.6+20170512/google_dns1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dns1/src/lib.rs b/gen/dns1/src/lib.rs index 744e76abc6..e34a6e4ae0 100644 --- a/gen/dns1/src/lib.rs +++ b/gen/dns1/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 *dns* crate version *1.0.6+20170512*, where *20170512* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *dns* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *dns* *v1* API can be found at the //! [official documentation site](https://developers.google.com/cloud-dns). diff --git a/gen/doubleclickbidmanager1-cli/Cargo.toml b/gen/doubleclickbidmanager1-cli/Cargo.toml index afd8cec93c..f0dbc208bf 100644 --- a/gen/doubleclickbidmanager1-cli/Cargo.toml +++ b/gen/doubleclickbidmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclickbidmanager1-cli" -version = "1.0.6+20170224" +version = "1.0.6+20170705" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-doubleclickbidmanager1] path = "../doubleclickbidmanager1" -version = "1.0.6+20170224" +version = "1.0.6+20170705" diff --git a/gen/doubleclickbidmanager1-cli/README.md b/gen/doubleclickbidmanager1-cli/README.md index c94c01788f..0e56a0b3b6 100644 --- a/gen/doubleclickbidmanager1-cli/README.md +++ b/gen/doubleclickbidmanager1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *DoubleClick Bid Manager* API at revision *20170224*. The CLI is at version *1.0.6*. +This documentation was generated from the *DoubleClick Bid Manager* API at revision *20170705*. The CLI is at version *1.0.6*. ```bash doubleclickbidmanager1 [options] diff --git a/gen/doubleclickbidmanager1-cli/mkdocs.yml b/gen/doubleclickbidmanager1-cli/mkdocs.yml index db85f14fbb..ade701d1a5 100644 --- a/gen/doubleclickbidmanager1-cli/mkdocs.yml +++ b/gen/doubleclickbidmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DoubleClick Bid Manager v1.0.6+20170224 +site_name: DoubleClick Bid Manager v1.0.6+20170705 site_url: http://byron.github.io/google-apis-rs/google-doubleclickbidmanager1-cli site_description: A complete library to interact with DoubleClick Bid Manager (protocol v1) diff --git a/gen/doubleclickbidmanager1-cli/src/main.rs b/gen/doubleclickbidmanager1-cli/src/main.rs index 0427c7a3a3..36008d120d 100644 --- a/gen/doubleclickbidmanager1-cli/src/main.rs +++ b/gen/doubleclickbidmanager1-cli/src/main.rs @@ -1045,7 +1045,7 @@ fn main() { let mut app = App::new("doubleclickbidmanager1") .author("Sebastian Thiel ") - .version("1.0.6+20170224") + .version("1.0.6+20170705") .about("API for viewing and managing your reports in DoubleClick Bid Manager.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclickbidmanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/doubleclickbidmanager1/Cargo.toml b/gen/doubleclickbidmanager1/Cargo.toml index 958e3f2d38..e31923a446 100644 --- a/gen/doubleclickbidmanager1/Cargo.toml +++ b/gen/doubleclickbidmanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclickbidmanager1" -version = "1.0.6+20170224" +version = "1.0.6+20170705" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1" homepage = "https://developers.google.com/bid-manager/" -documentation = "https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224" +documentation = "https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705" license = "MIT" keywords = ["doubleclickbidmanage", "google", "protocol", "web", "api"] diff --git a/gen/doubleclickbidmanager1/README.md b/gen/doubleclickbidmanager1/README.md index a823795c0f..f53c042b04 100644 --- a/gen/doubleclickbidmanager1/README.md +++ b/gen/doubleclickbidmanager1/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-doubleclickbidmanager1` library allows access to all features of the *Google DoubleClick Bid Manager* service. -This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.6+20170224*, where *20170224* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.6+20170705*, where *20170705* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/bid-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html) ... * lineitems - * [*downloadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.LineitemDownloadlineitemCall.html) and [*uploadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.LineitemUploadlineitemCall.html) -* [queries](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.Query.html) - * [*createquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.QueryCreatequeryCall.html), [*deletequery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.QueryDeletequeryCall.html), [*getquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.QueryGetqueryCall.html), [*listqueries*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.QueryListqueryCall.html) and [*runquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.QueryRunqueryCall.html) -* [reports](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.Report.html) - * [*listreports*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.ReportListreportCall.html) + * [*downloadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.LineitemDownloadlineitemCall.html) and [*uploadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.LineitemUploadlineitemCall.html) +* [queries](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.Query.html) + * [*createquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.QueryCreatequeryCall.html), [*deletequery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.QueryDeletequeryCall.html), [*getquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.QueryGetqueryCall.html), [*listqueries*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.QueryListqueryCall.html) and [*runquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.QueryRunqueryCall.html) +* [reports](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.Report.html) + * [*listreports*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.ReportListreportCall.html) * sdf - * [*download*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.SdfDownloadCall.html) + * [*download*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.SdfDownloadCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html)** +* **[Hub](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -123,17 +123,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/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")`. @@ -143,29 +143,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/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](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/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](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/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](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/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](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170224/google_doubleclickbidmanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclickbidmanager1/1.0.6+20170705/google_doubleclickbidmanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/doubleclickbidmanager1/src/lib.rs b/gen/doubleclickbidmanager1/src/lib.rs index f3527e8a40..1c7934f58a 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs +++ b/gen/doubleclickbidmanager1/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 *DoubleClick Bid Manager* crate version *1.0.6+20170224*, where *20170224* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.6+20170705*, where *20170705* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/bid-manager/). @@ -789,7 +789,7 @@ impl ResponseResult for Query {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DownloadLineItemsResponse { - /// Retrieved line items in CSV format. Refer to Entity Write File Format or Structured Data File Format for more information on file formats. + /// Retrieved line items in CSV format. For more information about file formats, see Entity Write File Format. #[serde(rename="lineItems")] pub line_items: Option, } diff --git a/gen/doubleclicksearch2-cli/Cargo.toml b/gen/doubleclicksearch2-cli/Cargo.toml index 070f362e8d..4504d8cd13 100644 --- a/gen/doubleclicksearch2-cli/Cargo.toml +++ b/gen/doubleclicksearch2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2-cli" -version = "1.0.6+20170509" +version = "1.0.6+20170919" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-doubleclicksearch2] path = "../doubleclicksearch2" -version = "1.0.6+20170509" +version = "1.0.6+20170919" diff --git a/gen/doubleclicksearch2-cli/README.md b/gen/doubleclicksearch2-cli/README.md index bb6800d120..c001841d43 100644 --- a/gen/doubleclicksearch2-cli/README.md +++ b/gen/doubleclicksearch2-cli/README.md @@ -25,7 +25,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 *20170509*. The CLI is at version *1.0.6*. +This documentation was generated from the *doubleclicksearch* API at revision *20170919*. The CLI is at version *1.0.6*. ```bash doubleclicksearch2 [options] diff --git a/gen/doubleclicksearch2-cli/mkdocs.yml b/gen/doubleclicksearch2-cli/mkdocs.yml index 1e2f358dba..39977d9cfb 100644 --- a/gen/doubleclicksearch2-cli/mkdocs.yml +++ b/gen/doubleclicksearch2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: doubleclicksearch v1.0.6+20170509 +site_name: doubleclicksearch v1.0.6+20170919 site_url: http://byron.github.io/google-apis-rs/google-doubleclicksearch2-cli site_description: A complete library to interact with doubleclicksearch (protocol v2) diff --git a/gen/doubleclicksearch2-cli/src/main.rs b/gen/doubleclicksearch2-cli/src/main.rs index 0f383bc12b..31343195af 100644 --- a/gen/doubleclicksearch2-cli/src/main.rs +++ b/gen/doubleclicksearch2-cli/src/main.rs @@ -1292,7 +1292,7 @@ fn main() { let mut app = App::new("doubleclicksearch2") .author("Sebastian Thiel ") - .version("1.0.6+20170509") + .version("1.0.6+20170919") .about("Reports and modifies 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 533e7da902..dabc554bc4 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclicksearch2" -version = "1.0.6+20170509" +version = "1.0.6+20170919" 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" homepage = "https://developers.google.com/doubleclick-search/" -documentation = "https://docs.rs/google-doubleclicksearch2/1.0.6+20170509" +documentation = "https://docs.rs/google-doubleclicksearch2/1.0.6+20170919" license = "MIT" keywords = ["doubleclicksearch", "google", "protocol", "web", "api"] diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index d71f0a3948..acba256e32 100644 --- a/gen/doubleclicksearch2/README.md +++ b/gen/doubleclicksearch2/README.md @@ -5,25 +5,25 @@ 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 *1.0.6+20170509*, where *20170509* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *doubleclicksearch* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *doubleclicksearch* *v2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-search/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... -* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.Conversion.html) - * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*patch*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ConversionPatchCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) -* [reports](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.Report.html) - * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ReportRequestCall.html) -* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.SavedColumn.html) - * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.SavedColumnListCall.html) +* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.Conversion.html) + * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*patch*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ConversionPatchCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) +* [reports](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.Report.html) + * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ReportRequestCall.html) +* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.SavedColumn.html) + * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.SavedColumnListCall.html) Download supported by ... -* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.ReportGetFileCall.html) +* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ReportGetFileCall.html) @@ -31,17 +31,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/struct.Doubleclicksearch.html)** +* **[Hub](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.Doubleclicksearch.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/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")`. @@ -147,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/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](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/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](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/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](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/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](https://docs.rs/google-doubleclicksearch2/1.0.6+20170509/google_doubleclicksearch2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/doubleclicksearch2/src/lib.rs b/gen/doubleclicksearch2/src/lib.rs index 0ea5885dce..d5efe46e52 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 *1.0.6+20170509*, where *20170509* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *doubleclicksearch* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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/drive2-cli/Cargo.toml b/gen/drive2-cli/Cargo.toml index c616481d00..4f27aa790f 100644 --- a/gen/drive2-cli/Cargo.toml +++ b/gen/drive2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2-cli" -version = "1.0.6+20170512" +version = "1.0.6+20170915" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-drive2] path = "../drive2" -version = "1.0.6+20170512" +version = "1.0.6+20170915" diff --git a/gen/drive2-cli/README.md b/gen/drive2-cli/README.md index a5c3c23365..08f610652d 100644 --- a/gen/drive2-cli/README.md +++ b/gen/drive2-cli/README.md @@ -25,7 +25,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 *20170512*. The CLI is at version *1.0.6*. +This documentation was generated from the *drive* API at revision *20170915*. The CLI is at version *1.0.6*. ```bash drive2 [options] diff --git a/gen/drive2-cli/mkdocs.yml b/gen/drive2-cli/mkdocs.yml index 1c9aca45c7..49d3019fe8 100644 --- a/gen/drive2-cli/mkdocs.yml +++ b/gen/drive2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.6+20170512 +site_name: drive v1.0.6+20170915 site_url: http://byron.github.io/google-apis-rs/google-drive2-cli site_description: A complete library to interact with drive (protocol v2) diff --git a/gen/drive2-cli/src/main.rs b/gen/drive2-cli/src/main.rs index 316e465882..15d2e72820 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -1522,10 +1522,11 @@ impl<'n> Engine<'n> { "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", 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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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 } @@ -2053,10 +2054,11 @@ impl<'n> Engine<'n> { "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", 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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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 } @@ -2392,10 +2394,11 @@ impl<'n> Engine<'n> { "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", 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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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 } @@ -2824,10 +2827,11 @@ impl<'n> Engine<'n> { "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", 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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "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", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "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 } @@ -6474,7 +6478,7 @@ fn main() { Some(true)), ]), ("export", - Some(r##"Exports a Google Doc to the requested MIME type and returns the exported content."##), + Some(r##"Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/files_export", vec![ (Some(r##"file-id"##), @@ -7722,7 +7726,7 @@ fn main() { let mut app = App::new("drive2") .author("Sebastian Thiel ") - .version("1.0.6+20170512") + .version("1.0.6+20170915") .about("Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.") .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 7b044bb662..fd89623bef 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive2" -version = "1.0.6+20170512" +version = "1.0.6+20170915" 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" homepage = "https://developers.google.com/drive/" -documentation = "https://docs.rs/google-drive2/1.0.6+20170512" +documentation = "https://docs.rs/google-drive2/1.0.6+20170915" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] diff --git a/gen/drive2/README.md b/gen/drive2/README.md index c07d071e62..eef7a391a8 100644 --- a/gen/drive2/README.md +++ b/gen/drive2/README.md @@ -5,64 +5,64 @@ 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 *1.0.6+20170512*, where *20170512* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *drive* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *drive* *v2* API can be found at the [official documentation site](https://developers.google.com/drive/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Drive.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Drive.html) ... -* [about](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.About.html) - * [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.AboutGetCall.html) -* [apps](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.App.html) - * [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.AppListCall.html) -* [changes](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Change.html) - * [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChangeGetCall.html), [*get start page token*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChangeWatchCall.html) -* [channels](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Channel.html) - * [*stop*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChannelStopCall.html) +* [about](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.About.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.AboutGetCall.html) +* [apps](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.App.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.AppListCall.html) +* [changes](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Change.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChangeGetCall.html), [*get start page token*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChannelStopCall.html) * children - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChildrenListCall.html) -* [comments](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Comment.html) - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.CommentUpdateCall.html) -* [files](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.File.html) - * [*copy*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileWatchCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChildrenListCall.html) +* [comments](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Comment.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.CommentUpdateCall.html) +* [files](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.File.html) + * [*copy*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileWatchCall.html) * parents - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ParentListCall.html) -* [permissions](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Permission.html) - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PermissionUpdateCall.html) -* [properties](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Property.html) - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.PropertyUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ParentListCall.html) +* [permissions](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Permission.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PermissionUpdateCall.html) +* [properties](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Property.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.PropertyUpdateCall.html) * realtime - * [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RealtimeGetCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RealtimeUpdateCall.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RealtimeGetCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RealtimeUpdateCall.html) * replies - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ReplyUpdateCall.html) -* [revisions](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Revision.html) - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RevisionUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RevisionUpdateCall.html) * teamdrives - * [*delete*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.TeamdriveGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.TeamdriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.TeamdriveUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.TeamdriveGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.TeamdriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*update files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileUpdateCall.html) -* [*insert files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileInsertCall.html) -* [*update realtime*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RealtimeUpdateCall.html) +* [*update files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileUpdateCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileInsertCall.html) +* [*update realtime*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RealtimeUpdateCall.html) Download supported by ... -* [*watch files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileWatchCall.html) -* [*get realtime*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.RealtimeGetCall.html) -* [*get files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileGetCall.html) -* [*export files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileExportCall.html) +* [*watch files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileWatchCall.html) +* [*get realtime*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.RealtimeGetCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileGetCall.html) +* [*export files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileExportCall.html) Subscription supported by ... -* [*watch files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileWatchCall.html) -* [*insert files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileInsertCall.html) -* [*get files*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.FileGetCall.html) -* [*watch changes*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChangeWatchCall.html) -* [*list changes*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.ChangeListCall.html) +* [*watch files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileWatchCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileInsertCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.FileGetCall.html) +* [*watch changes*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.ChangeListCall.html) @@ -70,17 +70,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/struct.Drive.html)** +* **[Hub](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/struct.Drive.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -196,17 +196,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/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")`. @@ -216,29 +216,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/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](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/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](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/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](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/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](https://docs.rs/google-drive2/1.0.6+20170512/google_drive2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/drive2/src/lib.rs b/gen/drive2/src/lib.rs index e322ede0db..0d79e8af45 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 *1.0.6+20170512*, where *20170512* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *drive* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *drive* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -1431,7 +1431,7 @@ pub struct Permission { pub value: Option, /// The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. pub id: Option, - /// The authkey parameter required for this permission. + /// Deprecated. #[serde(rename="authKey")] pub auth_key: Option, /// The ETag of the permission. @@ -2253,6 +2253,9 @@ pub struct File { /// If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files. #[serde(rename="trashingUser")] pub trashing_user: Option, + /// List of permission IDs for users with access to this file. + #[serde(rename="permissionIds")] + pub permission_ids: Option>, /// The number of quota bytes used by this file. #[serde(rename="quotaBytesUsed")] pub quota_bytes_used: Option, @@ -2476,7 +2479,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports a Google Doc to the requested MIME type and returns the exported content. + /// Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. /// /// # Arguments /// @@ -5960,7 +5963,7 @@ impl<'a, C, A> FileTrashCall<'a, C, A> where C: BorrowMut, A: oau } -/// Exports a Google Doc to the requested MIME type and returns the exported content. +/// Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. /// /// This method supports **media download**. To enable it, adjust the builder like this: /// `.param("alt", "media")`. @@ -6654,7 +6657,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._page_token = Some(new_value.to_string()); self } - /// A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + /// A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> FileListCall<'a, C, A> { diff --git a/gen/drive3-cli/Cargo.toml b/gen/drive3-cli/Cargo.toml index e9543cc390..14f7300706 100644 --- a/gen/drive3-cli/Cargo.toml +++ b/gen/drive3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive3-cli" -version = "1.0.6+20170512" +version = "1.0.6+20170915" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive3-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-drive3] path = "../drive3" -version = "1.0.6+20170512" +version = "1.0.6+20170915" diff --git a/gen/drive3-cli/README.md b/gen/drive3-cli/README.md index 175fbf2f36..6e16dfa590 100644 --- a/gen/drive3-cli/README.md +++ b/gen/drive3-cli/README.md @@ -25,7 +25,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 *20170512*. The CLI is at version *1.0.6*. +This documentation was generated from the *drive* API at revision *20170915*. The CLI is at version *1.0.6*. ```bash drive3 [options] diff --git a/gen/drive3-cli/mkdocs.yml b/gen/drive3-cli/mkdocs.yml index d01514c39a..8bdb39908d 100644 --- a/gen/drive3-cli/mkdocs.yml +++ b/gen/drive3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.6+20170512 +site_name: drive v1.0.6+20170915 site_url: http://byron.github.io/google-apis-rs/google-drive3-cli site_description: A complete library to interact with drive (protocol v3) diff --git a/gen/drive3-cli/src/main.rs b/gen/drive3-cli/src/main.rs index 47b1addcea..87242587eb 100644 --- a/gen/drive3-cli/src/main.rs +++ b/gen/drive3-cli/src/main.rs @@ -927,6 +927,7 @@ impl<'n> Engine<'n> { "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trashing-user.photo-link" => Some(("trashingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trashed" => Some(("trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-hints.indexable-text" => Some(("contentHints.indexableText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.mime-type" => Some(("contentHints.thumbnail.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -936,7 +937,7 @@ impl<'n> Engine<'n> { "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1130,6 +1131,7 @@ impl<'n> Engine<'n> { "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trashing-user.photo-link" => Some(("trashingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trashed" => Some(("trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-hints.indexable-text" => Some(("contentHints.indexableText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.mime-type" => Some(("contentHints.thumbnail.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1139,7 +1141,7 @@ impl<'n> Engine<'n> { "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1699,6 +1701,7 @@ impl<'n> Engine<'n> { "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trashing-user.photo-link" => Some(("trashingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "permission-ids" => Some(("permissionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trashed" => Some(("trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-hints.indexable-text" => Some(("contentHints.indexableText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.mime-type" => Some(("contentHints.thumbnail.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1708,7 +1711,7 @@ impl<'n> Engine<'n> { "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3883,7 +3886,7 @@ fn main() { Some(true)), ]), ("export", - Some(r##"Exports a Google Doc to the requested MIME type and returns the exported content."##), + Some(r##"Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB."##), "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/files_export", vec![ (Some(r##"file-id"##), @@ -4558,7 +4561,7 @@ fn main() { let mut app = App::new("drive3") .author("Sebastian Thiel ") - .version("1.0.6+20170512") + .version("1.0.6+20170915") .about("Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_drive3_cli") .arg(Arg::with_name("url") diff --git a/gen/drive3/Cargo.toml b/gen/drive3/Cargo.toml index 4973fc4f81..7f7ff1a162 100644 --- a/gen/drive3/Cargo.toml +++ b/gen/drive3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive3" -version = "1.0.6+20170512" +version = "1.0.6+20170915" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive3" homepage = "https://developers.google.com/drive/" -documentation = "https://docs.rs/google-drive3/1.0.6+20170512" +documentation = "https://docs.rs/google-drive3/1.0.6+20170915" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] diff --git a/gen/drive3/README.md b/gen/drive3/README.md index 15d504061b..4d6492fdad 100644 --- a/gen/drive3/README.md +++ b/gen/drive3/README.md @@ -5,53 +5,53 @@ DO NOT EDIT ! --> The `google-drive3` library allows access to all features of the *Google drive* service. -This documentation was generated from *drive* crate version *1.0.6+20170512*, where *20170512* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *drive* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *drive* *v3* API can be found at the [official documentation site](https://developers.google.com/drive/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Drive.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Drive.html) ... -* [about](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.About.html) - * [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.AboutGetCall.html) -* [changes](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Change.html) - * [*get start page token*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ChangeWatchCall.html) -* [channels](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Channel.html) - * [*stop*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ChannelStopCall.html) -* [comments](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Comment.html) - * [*create*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.CommentUpdateCall.html) -* [files](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.File.html) - * [*copy*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileWatchCall.html) -* [permissions](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Permission.html) - * [*create*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.PermissionUpdateCall.html) -* [replies](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Reply.html) - * [*create*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ReplyUpdateCall.html) -* [revisions](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Revision.html) - * [*delete*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.RevisionUpdateCall.html) +* [about](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.About.html) + * [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.AboutGetCall.html) +* [changes](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Change.html) + * [*get start page token*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ChannelStopCall.html) +* [comments](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Comment.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.CommentUpdateCall.html) +* [files](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.File.html) + * [*copy*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileWatchCall.html) +* [permissions](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Permission.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.PermissionUpdateCall.html) +* [replies](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Reply.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.RevisionUpdateCall.html) * teamdrives - * [*create*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.TeamdriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.TeamdriveGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.TeamdriveUpdateCall.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.TeamdriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.TeamdriveGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*update files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileUpdateCall.html) -* [*create files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileCreateCall.html) +* [*update files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileUpdateCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileCreateCall.html) Download supported by ... -* [*watch files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileWatchCall.html) -* [*export files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileExportCall.html) -* [*get revisions*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.RevisionGetCall.html) -* [*get files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileWatchCall.html) +* [*export files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileExportCall.html) +* [*get revisions*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.RevisionGetCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileGetCall.html) Subscription supported by ... -* [*watch files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileWatchCall.html) -* [*watch changes*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ChangeWatchCall.html) -* [*list changes*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.ChangeListCall.html) -* [*create files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileCreateCall.html) -* [*get files*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileWatchCall.html) +* [*watch changes*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.ChangeListCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileCreateCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.FileGetCall.html) @@ -59,17 +59,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/struct.Drive.html)** +* **[Hub](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/struct.Drive.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -171,17 +171,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/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")`. @@ -191,29 +191,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/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](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/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](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/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](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/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](https://docs.rs/google-drive3/1.0.6+20170512/google_drive3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/drive3/src/lib.rs b/gen/drive3/src/lib.rs index 242e90cb69..b963de6f1f 100644 --- a/gen/drive3/src/lib.rs +++ b/gen/drive3/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 *1.0.6+20170512*, where *20170512* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *drive* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *drive* *v3* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -1489,6 +1489,9 @@ pub struct File { pub trashing_user: Option, /// The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. pub spaces: Option>, + /// List of permission IDs for users with access to this file. + #[serde(rename="permissionIds")] + pub permission_ids: Option>, /// Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash. pub trashed: Option, /// Additional information about the content of the file. These fields are never populated in responses. @@ -1710,7 +1713,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports a Google Doc to the requested MIME type and returns the exported content. + /// Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. /// /// # Arguments /// @@ -3557,7 +3560,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa } -/// Exports a Google Doc to the requested MIME type and returns the exported content. +/// Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. /// /// This method supports **media download**. To enable it, adjust the builder like this: /// `.param("alt", "media")`. @@ -4568,7 +4571,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._page_size = Some(new_value); self } - /// A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + /// A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> FileListCall<'a, C, A> { diff --git a/gen/firebasedynamiclinks1-cli/Cargo.toml b/gen/firebasedynamiclinks1-cli/Cargo.toml index f318f92e45..f5b2835821 100644 --- a/gen/firebasedynamiclinks1-cli/Cargo.toml +++ b/gen/firebasedynamiclinks1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-firebasedynamiclinks1-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Dynamic Links (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebasedynamiclinks1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-firebasedynamiclinks1] path = "../firebasedynamiclinks1" -version = "1.0.6+20170517" +version = "1.0.6+20170926" diff --git a/gen/firebasedynamiclinks1-cli/README.md b/gen/firebasedynamiclinks1-cli/README.md index 005cc4463b..96f3509b92 100644 --- a/gen/firebasedynamiclinks1-cli/README.md +++ b/gen/firebasedynamiclinks1-cli/README.md @@ -25,10 +25,13 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firebase Dynamic Links* API at revision *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *Firebase Dynamic Links* API at revision *20170926*. The CLI is at version *1.0.6*. ```bash firebasedynamiclinks1 [options] + methods + get-link-stats [-p ]... [-o ] + install-attribution (-r )... [-p ]... [-o ] short-links create (-r )... [-p ]... [-o ] firebasedynamiclinks1 --help diff --git a/gen/firebasedynamiclinks1-cli/mkdocs.yml b/gen/firebasedynamiclinks1-cli/mkdocs.yml index bb34c9eca8..69c977f76b 100644 --- a/gen/firebasedynamiclinks1-cli/mkdocs.yml +++ b/gen/firebasedynamiclinks1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Dynamic Links v1.0.6+20170517 +site_name: Firebase Dynamic Links v1.0.6+20170926 site_url: http://byron.github.io/google-apis-rs/google-firebasedynamiclinks1-cli site_description: A complete library to interact with Firebase Dynamic Links (protocol v1) @@ -9,6 +9,8 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['methods_get-link-stats.md', 'Methods', 'Get Link Stats'] +- ['methods_install-attribution.md', 'Methods', 'Install Attribution'] - ['short-links_create.md', 'Short Links', 'Create'] theme: readthedocs diff --git a/gen/firebasedynamiclinks1-cli/src/main.rs b/gen/firebasedynamiclinks1-cli/src/main.rs index 7bd0242e86..b29118b883 100644 --- a/gen/firebasedynamiclinks1-cli/src/main.rs +++ b/gen/firebasedynamiclinks1-cli/src/main.rs @@ -46,6 +46,158 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _methods_get_link_stats(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.methods().get_link_stats(opt.value_of("dynamic-link").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "duration-days" => { + call = call.duration_days(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(["duration-days"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _methods_install_attribution(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "visual-style" => Some(("visualStyle", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sdk-version" => Some(("sdkVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-installation-time" => Some(("appInstallationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-match-link-to-check" => Some(("uniqueMatchLinkToCheck", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retrieval-method" => Some(("retrievalMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.timezone" => Some(("device.timezone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.device-model-name" => Some(("device.deviceModelName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.screen-resolution-width" => Some(("device.screenResolutionWidth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.screen-resolution-height" => Some(("device.screenResolutionHeight", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.language-code" => Some(("device.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bundle-id" => Some(("bundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ios-version" => Some(("iosVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-installation-time", "bundle-id", "device", "device-model-name", "ios-version", "language-code", "retrieval-method", "screen-resolution-height", "screen-resolution-width", "sdk-version", "timezone", "unique-match-link-to-check", "visual-style"]); + 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::GetIosPostInstallAttributionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.methods().install_attribution(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _short_links_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -86,8 +238,8 @@ impl<'n> Engine<'n> { "dynamic-link-info.ios-info.ios-ipad-bundle-id" => Some(("dynamicLinkInfo.iosInfo.iosIpadBundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.ios-info.ios-app-store-id" => Some(("dynamicLinkInfo.iosInfo.iosAppStoreId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.ios-info.ios-ipad-fallback-link" => Some(("dynamicLinkInfo.iosInfo.iosIpadFallbackLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "dynamic-link-info.android-info.android-fallback-link" => Some(("dynamicLinkInfo.androidInfo.androidFallbackLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.android-info.android-package-name" => Some(("dynamicLinkInfo.androidInfo.androidPackageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-link-info.android-info.android-fallback-link" => Some(("dynamicLinkInfo.androidInfo.androidFallbackLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.android-info.android-link" => Some(("dynamicLinkInfo.androidInfo.androidLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.android-info.android-min-package-version-code" => Some(("dynamicLinkInfo.androidInfo.androidMinPackageVersionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.social-meta-tag-info.social-title" => Some(("dynamicLinkInfo.socialMetaTagInfo.socialTitle", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -163,6 +315,20 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("methods", Some(opt)) => { + match opt.subcommand() { + ("get-link-stats", Some(opt)) => { + call_result = self._methods_get_link_stats(opt, dry_run, &mut err); + }, + ("install-attribution", Some(opt)) => { + call_result = self._methods_install_attribution(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("methods".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("short-links", Some(opt)) => { match opt.subcommand() { ("create", Some(opt)) => { @@ -260,6 +426,55 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("methods", "methods: 'get-link-stats' and 'install-attribution'", vec![ + ("get-link-stats", + Some(r##"Fetches analytics stats of a short Dynamic Link for a given + duration. Metrics include number of clicks, redirects, installs, + app first opens, and app reopens."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasedynamiclinks1_cli/methods_get-link-stats", + vec![ + (Some(r##"dynamic-link"##), + None, + Some(r##"Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz"##), + 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)), + ]), + ("install-attribution", + Some(r##"Get iOS strong/weak-match info for post-install attribution."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasedynamiclinks1_cli/methods_install-attribution", + 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)), + ]), + ]), + ("short-links", "methods: 'create'", vec![ ("create", Some(r##"Creates a short Dynamic Link given either a valid long Dynamic Link or @@ -297,7 +512,7 @@ fn main() { let mut app = App::new("firebasedynamiclinks1") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170926") .about("Programmatically creates and manages Firebase Dynamic Links.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firebasedynamiclinks1_cli") .arg(Arg::with_name("url") diff --git a/gen/firebasedynamiclinks1/Cargo.toml b/gen/firebasedynamiclinks1/Cargo.toml index 02eb323851..c10ac5962a 100644 --- a/gen/firebasedynamiclinks1/Cargo.toml +++ b/gen/firebasedynamiclinks1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebasedynamiclinks1" -version = "1.0.6+20170517" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Dynamic Links (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebasedynamiclinks1" homepage = "https://firebase.google.com/docs/dynamic-links/" -documentation = "https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517" +documentation = "https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926" license = "MIT" keywords = ["firebasedynamiclinks", "google", "protocol", "web", "api"] diff --git a/gen/firebasedynamiclinks1/README.md b/gen/firebasedynamiclinks1/README.md index 50c3d61f75..6ba5a5414d 100644 --- a/gen/firebasedynamiclinks1/README.md +++ b/gen/firebasedynamiclinks1/README.md @@ -5,17 +5,21 @@ DO NOT EDIT ! --> The `google-firebasedynamiclinks1` library allows access to all features of the *Google Firebase Dynamic Links* service. -This documentation was generated from *Firebase Dynamic Links* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Firebase Dynamic Links* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Firebase Dynamic Links* *v1* API can be found at the [official documentation site](https://firebase.google.com/docs/dynamic-links/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... * short links - * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.html) + * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.html) +Other activities are ... + +* [get link stats](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.MethodGetLinkStatCall.html) +* [install attribution](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.MethodInstallAttributionCall.html) @@ -23,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html)** +* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,7 +51,7 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.short_links().create(...).doit() +let r = hub.methods().install_attribution(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -73,7 +77,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_firebasedynamiclinks1 as firebasedynamiclinks1; -use firebasedynamiclinks1::CreateShortDynamicLinkRequest; +use firebasedynamiclinks1::GetIosPostInstallAttributionRequest; use firebasedynamiclinks1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -94,12 +98,12 @@ let mut hub = FirebaseDynamicLinks::new(hyper::Client::with_connector(hyper::net // 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 = CreateShortDynamicLinkRequest::default(); +let mut req = GetIosPostInstallAttributionRequest::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.short_links().create(req) +let result = hub.methods().install_attribution(req) .doit(); match result { @@ -122,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/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")`. @@ -142,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/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](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/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](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/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](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/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](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170517/google_firebasedynamiclinks1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firebasedynamiclinks1/src/lib.rs b/gen/firebasedynamiclinks1/src/lib.rs index 2c72bd2646..63c68a3421 100644 --- a/gen/firebasedynamiclinks1/src/lib.rs +++ b/gen/firebasedynamiclinks1/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 *Firebase Dynamic Links* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Firebase Dynamic Links* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Firebase Dynamic Links* *v1* API can be found at the //! [official documentation site](https://firebase.google.com/docs/dynamic-links/). @@ -14,6 +14,10 @@ //! * short links //! * [*create*](struct.ShortLinkCreateCall.html) //! +//! Other activities are ... +//! +//! * [get link stats](struct.MethodGetLinkStatCall.html) +//! * [install attribution](struct.MethodInstallAttributionCall.html) //! //! //! @@ -47,7 +51,7 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.short_links().create(...).doit() +//! let r = hub.methods().install_attribution(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -73,7 +77,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_firebasedynamiclinks1 as firebasedynamiclinks1; -//! use firebasedynamiclinks1::CreateShortDynamicLinkRequest; +//! use firebasedynamiclinks1::GetIosPostInstallAttributionRequest; //! use firebasedynamiclinks1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -95,12 +99,12 @@ //! // 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 = CreateShortDynamicLinkRequest::default(); +//! let mut req = GetIosPostInstallAttributionRequest::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.short_links().create(req) +//! let result = hub.methods().install_attribution(req) //! .doit(); //! //! match result { @@ -258,7 +262,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_firebasedynamiclinks1 as firebasedynamiclinks1; -/// use firebasedynamiclinks1::CreateShortDynamicLinkRequest; +/// use firebasedynamiclinks1::GetIosPostInstallAttributionRequest; /// use firebasedynamiclinks1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -280,12 +284,12 @@ impl Default for Scope { /// // 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 = CreateShortDynamicLinkRequest::default(); +/// let mut req = GetIosPostInstallAttributionRequest::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.short_links().create(req) +/// let result = hub.methods().install_attribution(req) /// .doit(); /// /// match result { @@ -324,11 +328,14 @@ impl<'a, C, A> FirebaseDynamicLinks client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.6".to_string(), - _base_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), - _root_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), + _base_url: "https://firebasedynamiclinks-ipv6.googleapis.com/".to_string(), + _root_url: "https://firebasedynamiclinks-ipv6.googleapis.com/".to_string(), } } + pub fn methods(&'a self) -> MethodMethods<'a, C, A> { + MethodMethods { hub: &self } + } pub fn short_links(&'a self) -> ShortLinkMethods<'a, C, A> { ShortLinkMethods { hub: &self } } @@ -342,7 +349,7 @@ impl<'a, C, A> FirebaseDynamicLinks } /// Set the base url to use in all requests to the server. - /// It defaults to `https://firebasedynamiclinks.googleapis.com/`. + /// It defaults to `https://firebasedynamiclinks-ipv6.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -350,7 +357,7 @@ impl<'a, C, A> FirebaseDynamicLinks } /// Set the root url to use in all requests to the server. - /// It defaults to `https://firebasedynamiclinks.googleapis.com/`. + /// It defaults to `https://firebasedynamiclinks-ipv6.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { @@ -377,6 +384,241 @@ pub struct NavigationInfo { impl Part for NavigationInfo {} +/// Response for iSDK to execute strong match flow for post-install attribution. +/// +/// # 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*). +/// +/// * [install attribution](struct.MethodInstallAttributionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIosPostInstallAttributionResponse { + /// Scion medium value to be propagated by iSDK to Scion at post-install. + #[serde(rename="utmMedium")] + pub utm_medium: Option, + /// Scion source value to be propagated by iSDK to Scion at post-install. + #[serde(rename="utmSource")] + pub utm_source: Option, + /// The minimum version for app, specified by dev through ?imv= parameter. + /// Return to iSDK to allow app to evaluate if current version meets this. + #[serde(rename="appMinimumVersion")] + pub app_minimum_version: Option, + /// The confidence of the returned attribution. + #[serde(rename="attributionConfidence")] + pub attribution_confidence: Option, + /// User-agent specific custom-scheme URIs for iSDK to open. This will be set + /// according to the user-agent tha the click was originally made in. There is + /// no Safari-equivalent custom-scheme open URLs. + /// ie: googlechrome://www.example.com + /// ie: firefox://open-url?url=http://www.example.com + /// ie: opera-http://example.com + #[serde(rename="externalBrowserDestinationLink")] + pub external_browser_destination_link: Option, + /// Instruction for iSDK to attemmpt to perform strong match. For instance, + /// if browser does not support/allow cookie or outside of support browsers, + /// this will be false. + #[serde(rename="isStrongMatchExecutable")] + pub is_strong_match_executable: Option, + /// Invitation ID attributed post-install via one of several techniques + /// (fingerprint, copy unique). + #[serde(rename="invitationId")] + pub invitation_id: Option, + /// The entire FDL, expanded from a short link. It is the same as the + /// requested_link, if it is long. Parameters from this should not be + /// used directly (ie: server can default utm_[campaign|medium|source] + /// to a value when requested_link lack them, server determine the best + /// fallback_link when requested_link specifies >1 fallback links). + #[serde(rename="resolvedLink")] + pub resolved_link: Option, + /// Entire FDL (short or long) attributed post-install via one of several + /// techniques (fingerprint, copy unique). + #[serde(rename="requestedLink")] + pub requested_link: Option, + /// The link to navigate to update the app if min version is not met. + /// This is either (in order): 1) fallback link (from ?ifl= parameter, if + /// specified by developer) or 2) AppStore URL (from ?isi= parameter, if + /// specified), or 3) the payload link (from required link= parameter). + #[serde(rename="fallbackLink")] + pub fallback_link: Option, + /// Describes why match failed, ie: "discarded due to low confidence". + /// This message will be publicly visible. + #[serde(rename="matchMessage")] + pub match_message: Option, + /// Scion campaign value to be propagated by iSDK to Scion at post-install. + #[serde(rename="utmCampaign")] + pub utm_campaign: Option, + /// The deep-link attributed post-install via one of several techniques + /// (fingerprint, copy unique). + #[serde(rename="deepLink")] + pub deep_link: Option, +} + +impl ResponseResult for GetIosPostInstallAttributionResponse {} + + +/// Android related attributes to the Dynamic Link. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidInfo { + /// Android package name of the app. + #[serde(rename="androidPackageName")] + pub android_package_name: Option, + /// Link to open on Android if the app is not installed. + #[serde(rename="androidFallbackLink")] + pub android_fallback_link: Option, + /// If specified, this overrides the ‘link’ parameter on Android. + #[serde(rename="androidLink")] + pub android_link: Option, + /// Minimum version code for the Android app. If the installed app’s version + /// code is lower, then the user is taken to the Play Store. + #[serde(rename="androidMinPackageVersionCode")] + pub android_min_package_version_code: Option, +} + +impl Part for AndroidInfo {} + + +/// Request to create a short Dynamic Link. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create short links](struct.ShortLinkCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateShortDynamicLinkRequest { + /// Information about the Dynamic Link to be shortened. + /// [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + #[serde(rename="dynamicLinkInfo")] + pub dynamic_link_info: Option, + /// Full long Dynamic Link URL with desired query parameters specified. + /// For example, + /// "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", + /// [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + #[serde(rename="longDynamicLink")] + pub long_dynamic_link: Option, + /// Short Dynamic Link suffix. Optional. + pub suffix: Option, +} + +impl RequestValue for CreateShortDynamicLinkRequest {} + + +/// Dynamic Link event stat. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DynamicLinkEventStat { + /// The number of times this event occurred. + pub count: Option, + /// Requested platform. + pub platform: Option, + /// Link event. + pub event: Option, +} + +impl Part for DynamicLinkEventStat {} + + +/// Request for iSDK to execute strong match flow for post-install attribution. +/// This is meant for iOS requests only. Requests from other platforms will +/// not be honored. +/// +/// # 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*). +/// +/// * [install attribution](struct.MethodInstallAttributionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIosPostInstallAttributionRequest { + /// Strong match page information. Disambiguates between default UI and + /// custom page to present when strong match succeeds/fails to find cookie. + #[serde(rename="visualStyle")] + pub visual_style: Option, + /// Google SDK version. + #[serde(rename="sdkVersion")] + pub sdk_version: Option, + /// App installation epoch time (https://en.wikipedia.org/wiki/Unix_time). + /// This is a client signal for a more accurate weak match. + #[serde(rename="appInstallationTime")] + pub app_installation_time: Option, + /// Possible unique matched link that server need to check before performing + /// fingerprint match. If passed link is short server need to expand the link. + /// If link is long server need to vslidate the link. + #[serde(rename="uniqueMatchLinkToCheck")] + pub unique_match_link_to_check: Option, + /// Device information. + pub device: Option, + /// App post install attribution retrieval information. Disambiguates + /// mechanism (iSDK or developer invoked) to retrieve payload from + /// clicked link. + #[serde(rename="retrievalMethod")] + pub retrieval_method: Option, + /// iOS version, ie: 9.3.5. + /// Consider adding "build". + #[serde(rename="iosVersion")] + pub ios_version: Option, + /// APP bundle ID. + #[serde(rename="bundleId")] + pub bundle_id: Option, +} + +impl RequestValue for GetIosPostInstallAttributionRequest {} + + +/// Information about a Dynamic Link. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DynamicLinkInfo { + /// Information of navigation behavior of a Firebase Dynamic Links. + #[serde(rename="navigationInfo")] + pub navigation_info: Option, + /// Parameters used for tracking. See all tracking parameters in the + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + #[serde(rename="analyticsInfo")] + pub analytics_info: Option, + /// The link your app will open, You can specify any URL your app can handle. + /// This link must be a well-formatted URL, be properly URL-encoded, and use + /// the HTTP or HTTPS scheme. See 'link' parameters in the + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + /// + /// Required. + pub link: Option, + /// iOS related information. See iOS related parameters in the + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + #[serde(rename="iosInfo")] + pub ios_info: Option, + /// Android related information. See Android related parameters in the + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + #[serde(rename="androidInfo")] + pub android_info: Option, + /// Parameters for social meta tag params. + /// Used to set meta tag data for link previews on social sites. + #[serde(rename="socialMetaTagInfo")] + pub social_meta_tag_info: Option, + /// Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl + /// [Learn more](https://firebase.google.com/docs/dynamic-links/android/receive) + /// on how to set up Dynamic Link domain associated with your Firebase project. + /// + /// Required. + #[serde(rename="dynamicLinkDomain")] + pub dynamic_link_domain: Option, +} + +impl Part for DynamicLinkInfo {} + + /// Tracking parameters supported by Dynamic Link. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -394,6 +636,25 @@ pub struct AnalyticsInfo { impl Part for AnalyticsInfo {} +/// Analytics stats of a Dynamic Link for a given timeframe. +/// +/// # 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 link stats](struct.MethodGetLinkStatCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DynamicLinkStats { + /// Dynamic Link event stats. + #[serde(rename="linkEventStats")] + pub link_event_stats: Option>, +} + +impl ResponseResult for DynamicLinkStats {} + + /// Short Dynamic Link suffix. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -413,6 +674,9 @@ impl Part for Suffix {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DynamicLinkWarning { + /// The document describing the warning, and helps resolve. + #[serde(rename="warningDocumentLink")] + pub warning_document_link: Option, /// The warning code. #[serde(rename="warningCode")] pub warning_code: Option, @@ -455,30 +719,6 @@ pub struct IosInfo { impl Part for IosInfo {} -/// Android related attributes to the Dynamic Link. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidInfo { - /// Link to open on Android if the app is not installed. - #[serde(rename="androidFallbackLink")] - pub android_fallback_link: Option, - /// Android package name of the app. - #[serde(rename="androidPackageName")] - pub android_package_name: Option, - /// If specified, this overrides the ‘link’ parameter on Android. - #[serde(rename="androidLink")] - pub android_link: Option, - /// Minimum version code for the Android app. If the installed app’s version - /// code is lower, then the user is taken to the Play Store. - #[serde(rename="androidMinPackageVersionCode")] - pub android_min_package_version_code: Option, -} - -impl Part for AndroidInfo {} - - /// Parameters for social meta tag params. /// Used to set meta tag data for link previews on social sites. /// @@ -500,32 +740,29 @@ pub struct SocialMetaTagInfo { impl Part for SocialMetaTagInfo {} -/// Request to create a short Dynamic Link. +/// Signals associated with the device making the request. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [create short links](struct.ShortLinkCreateCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateShortDynamicLinkRequest { - /// Information about the Dynamic Link to be shortened. - /// [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). - #[serde(rename="dynamicLinkInfo")] - pub dynamic_link_info: Option, - /// Full long Dynamic Link URL with desired query parameters specified. - /// For example, - /// "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", - /// [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). - #[serde(rename="longDynamicLink")] - pub long_dynamic_link: Option, - /// Short Dynamic Link suffix. Optional. - pub suffix: Option, +pub struct DeviceInfo { + /// Device timezone setting. + pub timezone: Option, + /// Device language code setting. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Device model name. + #[serde(rename="deviceModelName")] + pub device_model_name: Option, + /// Device display resolution width. + #[serde(rename="screenResolutionWidth")] + pub screen_resolution_width: Option, + /// Device display resolution height. + #[serde(rename="screenResolutionHeight")] + pub screen_resolution_height: Option, } -impl RequestValue for CreateShortDynamicLinkRequest {} +impl Part for DeviceInfo {} /// Parameters for iTunes Connect App Analytics. @@ -583,50 +820,6 @@ pub struct GooglePlayAnalytics { impl Part for GooglePlayAnalytics {} -/// Information about a Dynamic Link. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DynamicLinkInfo { - /// Information of navigation behavior of a Firebase Dynamic Links. - #[serde(rename="navigationInfo")] - pub navigation_info: Option, - /// Parameters used for tracking. See all tracking parameters in the - /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - #[serde(rename="analyticsInfo")] - pub analytics_info: Option, - /// The link your app will open, You can specify any URL your app can handle. - /// This link must be a well-formatted URL, be properly URL-encoded, and use - /// the HTTP or HTTPS scheme. See 'link' parameters in the - /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - /// - /// Required. - pub link: Option, - /// iOS related information. See iOS related parameters in the - /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - #[serde(rename="iosInfo")] - pub ios_info: Option, - /// Android related information. See Android related parameters in the - /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - #[serde(rename="androidInfo")] - pub android_info: Option, - /// Parameters for social meta tag params. - /// Used to set meta tag data for link previews on social sites. - #[serde(rename="socialMetaTagInfo")] - pub social_meta_tag_info: Option, - /// Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl - /// [Learn more](https://firebase.google.com/docs/dynamic-links/android/receive) - /// on how to set up Dynamic Link domain associated with your Firebase project. - /// - /// Required. - #[serde(rename="dynamicLinkDomain")] - pub dynamic_link_domain: Option, -} - -impl Part for DynamicLinkInfo {} - - /// Response to create a short Dynamic Link. /// /// # Activities @@ -723,6 +916,85 @@ impl<'a, C, A> ShortLinkMethods<'a, C, A> { +/// A builder providing access to all free methods, which are not associated with a particular resource. +/// It is not used directly, but through the `FirebaseDynamicLinks` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_firebasedynamiclinks1 as firebasedynamiclinks1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use firebasedynamiclinks1::FirebaseDynamicLinks; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = FirebaseDynamicLinks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get_link_stats(...)` and `install_attribution(...)` +/// // to build up your call. +/// let rb = hub.methods(); +/// # } +/// ``` +pub struct MethodMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseDynamicLinks, +} + +impl<'a, C, A> MethodsBuilder for MethodMethods<'a, C, A> {} + +impl<'a, C, A> MethodMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Fetches analytics stats of a short Dynamic Link for a given + /// duration. Metrics include number of clicks, redirects, installs, + /// app first opens, and app reopens. + /// + /// # Arguments + /// + /// * `dynamicLink` - Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz + pub fn get_link_stats(&self, dynamic_link: &str) -> MethodGetLinkStatCall<'a, C, A> { + MethodGetLinkStatCall { + hub: self.hub, + _dynamic_link: dynamic_link.to_string(), + _duration_days: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get iOS strong/weak-match info for post-install attribution. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn install_attribution(&self, request: GetIosPostInstallAttributionRequest) -> MethodInstallAttributionCall<'a, C, A> { + MethodInstallAttributionCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### @@ -944,12 +1216,12 @@ impl<'a, C, A> ShortLinkCreateCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ShortLinkCreateCall<'a, C, A> @@ -984,3 +1256,513 @@ impl<'a, C, A> ShortLinkCreateCall<'a, C, A> where C: BorrowMut, } +/// Fetches analytics stats of a short Dynamic Link for a given +/// duration. Metrics include number of clicks, redirects, installs, +/// app first opens, and app reopens. +/// +/// A builder for the *getLinkStats* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasedynamiclinks1 as firebasedynamiclinks1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasedynamiclinks1::FirebaseDynamicLinks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseDynamicLinks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.methods().get_link_stats("dynamicLink") +/// .duration_days("sit") +/// .doit(); +/// # } +/// ``` +pub struct MethodGetLinkStatCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseDynamicLinks, + _dynamic_link: String, + _duration_days: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodGetLinkStatCall<'a, C, A> {} + +impl<'a, C, A> MethodGetLinkStatCall<'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, DynamicLinkStats)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasedynamiclinks.getLinkStats", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("dynamicLink", self._dynamic_link.to_string())); + if let Some(value) = self._duration_days { + params.push(("durationDays", value.to_string())); + } + for &field in ["alt", "dynamicLink", "durationDays"].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 = self.hub._base_url.clone() + "v1/{dynamicLink}/linkStats"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Firebase.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{dynamicLink}", "dynamicLink")].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 ["dynamicLink"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz + /// + /// Sets the *dynamic link* 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 dynamic_link(mut self, new_value: &str) -> MethodGetLinkStatCall<'a, C, A> { + self._dynamic_link = new_value.to_string(); + self + } + /// The span of time requested in days. + /// + /// Sets the *duration days* query property to the given value. + pub fn duration_days(mut self, new_value: &str) -> MethodGetLinkStatCall<'a, C, A> { + self._duration_days = 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) -> MethodGetLinkStatCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodGetLinkStatCall<'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::Firebase`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MethodGetLinkStatCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get iOS strong/weak-match info for post-install attribution. +/// +/// A builder for the *installAttribution* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasedynamiclinks1 as firebasedynamiclinks1; +/// use firebasedynamiclinks1::GetIosPostInstallAttributionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasedynamiclinks1::FirebaseDynamicLinks; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseDynamicLinks::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GetIosPostInstallAttributionRequest::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.methods().install_attribution(req) +/// .doit(); +/// # } +/// ``` +pub struct MethodInstallAttributionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseDynamicLinks, + _request: GetIosPostInstallAttributionRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodInstallAttributionCall<'a, C, A> {} + +impl<'a, C, A> MethodInstallAttributionCall<'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, GetIosPostInstallAttributionResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasedynamiclinks.installAttribution", + 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 = self.hub._base_url.clone() + "v1/installAttribution"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Firebase.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GetIosPostInstallAttributionRequest) -> MethodInstallAttributionCall<'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) -> MethodInstallAttributionCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodInstallAttributionCall<'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::Firebase`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MethodInstallAttributionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/firebaseremoteconfig1-cli/Cargo.toml b/gen/firebaseremoteconfig1-cli/Cargo.toml new file mode 100644 index 0000000000..c9c4542aff --- /dev/null +++ b/gen/firebaseremoteconfig1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-firebaseremoteconfig1-cli" +version = "1.0.6+20170912" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Firebase Remote Config (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1-cli" +homepage = "https://firebase.google.com/docs/remote-config/" +documentation = "http://byron.github.io/google-apis-rs/google_firebaseremoteconfig1_cli" +license = "MIT" +keywords = ["firebaseremoteconfig", "google", "cli"] + +[[bin]] +name = "firebaseremoteconfig1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-firebaseremoteconfig1] +path = "../firebaseremoteconfig1" +version = "1.0.6+20170912" diff --git a/gen/firebaseremoteconfig1-cli/LICENSE.md b/gen/firebaseremoteconfig1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/firebaseremoteconfig1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/firebaseremoteconfig1-cli/README.md b/gen/firebaseremoteconfig1-cli/README.md new file mode 100644 index 0000000000..90d457c963 --- /dev/null +++ b/gen/firebaseremoteconfig1-cli/README.md @@ -0,0 +1,111 @@ + +The `firebaseremoteconfig1` command-line interface *(CLI)* allows to use most features of the *Google Firebase Remote Config* 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 *Firebase Remote Config* API can be found at the +[official documentation site](https://firebase.google.com/docs/remote-config/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-firebaseremoteconfig1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1-cli). + +# Usage + +This documentation was generated from the *Firebase Remote Config* API at revision *20170912*. The CLI is at version *1.0.6*. + +```bash +firebaseremoteconfig1 [options] + projects + get-remote-config [-p ]... [-o ] + update-remote-config (-r )... [-p ]... [-o ] + firebaseremoteconfig1 --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 `firebaseremoteconfig1-`. 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/firebaseremoteconfig1-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/firebaseremoteconfig1-secret.json`, assuming that the required *firebaseremoteconfig* 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. `firebaseremoteconfig1 --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/firebaseremoteconfig1-cli/mkdocs.yml b/gen/firebaseremoteconfig1-cli/mkdocs.yml new file mode 100644 index 0000000000..bdfd459309 --- /dev/null +++ b/gen/firebaseremoteconfig1-cli/mkdocs.yml @@ -0,0 +1,18 @@ +site_name: Firebase Remote Config v1.0.6+20170912 +site_url: http://byron.github.io/google-apis-rs/google-firebaseremoteconfig1-cli +site_description: A complete library to interact with Firebase Remote Config (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_get-remote-config.md', 'Projects', 'Get Remote Config'] +- ['projects_update-remote-config.md', 'Projects', 'Update Remote Config'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/firebaseremoteconfig1-cli/src/cmn.rs b/gen/firebaseremoteconfig1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/firebaseremoteconfig1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/firebaseremoteconfig1-cli/src/main.rs b/gen/firebaseremoteconfig1-cli/src/main.rs new file mode 100644 index 0000000000..7420009c2b --- /dev/null +++ b/gen/firebaseremoteconfig1-cli/src/main.rs @@ -0,0 +1,454 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_firebaseremoteconfig1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::FirebaseRemoteConfig>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_get_remote_config(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get_remote_config(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_update_remote_config(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RemoteConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().update_remote_config(request, opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "validate-only" => { + call = call.validate_only(arg_from_str(value.unwrap_or("false"), err, "validate-only", "boolean")); + }, + _ => { + 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(["validate-only"].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).expect("serde to work"); + 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() { + ("get-remote-config", Some(opt)) => { + call_result = self._projects_get_remote_config(opt, dry_run, &mut err); + }, + ("update-remote-config", Some(opt)) => { + call_result = self._projects_update_remote_config(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<'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, "firebaseremoteconfig1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "firebaseremoteconfig1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::FirebaseRemoteConfig::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: 'get-remote-config' and 'update-remote-config'", vec![ + ("get-remote-config", + Some(r##"Get the latest version Remote Configuration for a project. + Returns the RemoteConfig as the payload, and also the eTag as a + response header."##), + "Details at http://byron.github.io/google-apis-rs/google_firebaseremoteconfig1_cli/projects_get-remote-config", + vec![ + (Some(r##"project"##), + None, + Some(r##"The GMP project identifier. Required. + See note at the beginning of this file regarding project ids."##), + 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-remote-config", + Some(r##"Update a RemoteConfig. We treat this as an always-existing + resource (when it is not found in our data store, we treat it as version + 0, a template with zero conditions and zero parameters). Hence there are + no Create or Delete operations. Returns the updated template when + successful (and the updated eTag as a response header), or an error if + things go wrong. + Possible error messages: + * VALIDATION_ERROR (HTTP status 400) with additional details if the + template being passed in can not be validated. + * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be + authenticate (e.g. no access token, or invalid access token). + * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be + authorized (e.g. the user has no access to the specified project id). + * VERSION_MISMATCH (HTTP status 412) when trying to update when the + expected eTag (passed in via the "If-match" header) is not specified, or + is specified but does does not match the current eTag. + * Internal error (HTTP status 500) for Database problems or other internal + errors."##), + "Details at http://byron.github.io/google-apis-rs/google_firebaseremoteconfig1_cli/projects_update-remote-config", + vec![ + (Some(r##"project"##), + None, + Some(r##"The GMP project identifier. Required. + See note at the beginning of this file regarding project ids."##), + 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("firebaseremoteconfig1") + .author("Sebastian Thiel ") + .version("1.0.6+20170912") + .about("Firebase Remote Config API allows the 3P clients to manage Remote Config conditions and parameters for Firebase applications.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firebaseremoteconfig1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/firebaseremoteconfig1/Cargo.toml b/gen/firebaseremoteconfig1/Cargo.toml new file mode 100644 index 0000000000..dd94cb1aa1 --- /dev/null +++ b/gen/firebaseremoteconfig1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-firebaseremoteconfig1" +version = "1.0.6+20170912" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Firebase Remote Config (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1" +homepage = "https://firebase.google.com/docs/remote-config/" +documentation = "https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912" +license = "MIT" +keywords = ["firebaseremoteconfig", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/firebaseremoteconfig1/LICENSE.md b/gen/firebaseremoteconfig1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/firebaseremoteconfig1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/firebaseremoteconfig1/README.md b/gen/firebaseremoteconfig1/README.md new file mode 100644 index 0000000000..c54810bc35 --- /dev/null +++ b/gen/firebaseremoteconfig1/README.md @@ -0,0 +1,182 @@ + +The `google-firebaseremoteconfig1` library allows access to all features of the *Google Firebase Remote Config* service. + +This documentation was generated from *Firebase Remote Config* crate version *1.0.6+20170912*, where *20170912* is the exact revision of the *firebaseremoteconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Firebase Remote Config* *v1* API can be found at the +[official documentation site](https://firebase.google.com/docs/remote-config/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html) ... + +* projects + * [*get remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/struct.ProjectGetRemoteConfigCall.html) and [*update remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/struct.ProjectUpdateRemoteConfigCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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().get_remote_config(...).doit() +let r = hub.projects().update_remote_config(...).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-firebaseremoteconfig1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_firebaseremoteconfig1 as firebaseremoteconfig1; +use firebaseremoteconfig1::RemoteConfig; +use firebaseremoteconfig1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use firebaseremoteconfig1::FirebaseRemoteConfig; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = FirebaseRemoteConfig::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemoteConfig::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_remote_config(req, "project") + .validate_only(true) + .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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/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 **firebaseremoteconfig1** 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-rsblob/master/LICENSE.md diff --git a/gen/firebaseremoteconfig1/src/cmn.rs b/gen/firebaseremoteconfig1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/firebaseremoteconfig1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/firebaseremoteconfig1/src/lib.rs b/gen/firebaseremoteconfig1/src/lib.rs new file mode 100644 index 0000000000..6875264489 --- /dev/null +++ b/gen/firebaseremoteconfig1/src/lib.rs @@ -0,0 +1,1090 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Firebase Remote Config* crate version *1.0.6+20170912*, where *20170912* is the exact revision of the *firebaseremoteconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Firebase Remote Config* *v1* API can be found at the +//! [official documentation site](https://firebase.google.com/docs/remote-config/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.FirebaseRemoteConfig.html) ... +//! +//! * projects +//! * [*get remote config*](struct.ProjectGetRemoteConfigCall.html) and [*update remote config*](struct.ProjectUpdateRemoteConfigCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.FirebaseRemoteConfig.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().get_remote_config(...).doit() +//! let r = hub.projects().update_remote_config(...).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-firebaseremoteconfig1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_firebaseremoteconfig1 as firebaseremoteconfig1; +//! use firebaseremoteconfig1::RemoteConfig; +//! use firebaseremoteconfig1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use firebaseremoteconfig1::FirebaseRemoteConfig; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = FirebaseRemoteConfig::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemoteConfig::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_remote_config(req, "project") +//! .validate_only(true) +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 FirebaseRemoteConfig related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_firebaseremoteconfig1 as firebaseremoteconfig1; +/// use firebaseremoteconfig1::RemoteConfig; +/// use firebaseremoteconfig1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use firebaseremoteconfig1::FirebaseRemoteConfig; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = FirebaseRemoteConfig::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemoteConfig::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_remote_config(req, "project") +/// .validate_only(true) +/// .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 FirebaseRemoteConfig { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for FirebaseRemoteConfig {} + +impl<'a, C, A> FirebaseRemoteConfig + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> FirebaseRemoteConfig { + FirebaseRemoteConfig { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://firebaseremoteconfig.googleapis.com/".to_string(), + _root_url: "https://firebaseremoteconfig.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://firebaseremoteconfig.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://firebaseremoteconfig.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// While default_value and conditional_values are each optional, at least one of +/// the two is required - otherwise, the parameter is meaningless (and an +/// exception will be thrown by the validation logic). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemoteConfigParameter { + /// Optional - value to set the parameter to, when none of the named conditions + /// evaluate to true. + #[serde(rename="defaultValue")] + pub default_value: Option, + /// Optional - a map of (condition_name, value). The condition_name of the + /// highest priority (the one listed first in the conditions array) determines + /// the value of this parameter. + #[serde(rename="conditionalValues")] + pub conditional_values: Option>, +} + +impl Part for RemoteConfigParameter {} + + +/// A single RemoteConfig Condition. A list of these (because order matters) are +/// part of a single RemoteConfig template. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemoteConfigCondition { + /// Required. + pub expression: Option, + /// Optional. + /// The display (tag) color of this condition. This serves as part of a tag + /// (in the future, we may add tag text as well as tag color, but that is not + /// yet implemented in the UI). + /// This value has no affect on the semantics of the delivered config and it + /// is ignored by the backend, except for passing it through write/read + /// requests. + /// Not having this value or having the "CONDITION_DISPLAY_COLOR_UNSPECIFIED" + /// value (0) have the same meaning: Let the UI choose any valid color when + /// displaying the condition. + #[serde(rename="tagColor")] + pub tag_color: Option, + /// Required. + /// A non empty and unique name of this condition. + pub name: Option, +} + +impl Part for RemoteConfigCondition {} + + +/// * +/// The RemoteConfig consists of a list of conditions (which can be +/// thought of as named "if" statements) and a map of parameters (parameter key +/// to a stucture containing an optional default value, as well as a optional +/// submap of (condition name to value when that condition is true). +/// +/// # 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 remote config projects](struct.ProjectGetRemoteConfigCall.html) (response) +/// * [update remote config projects](struct.ProjectUpdateRemoteConfigCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemoteConfig { + /// The list of named conditions. The order *does* affect the semantics. + /// The condition_name values of these entries must be unique. + /// + /// The resolved value of a config parameter P is determined as follow: + /// * Let Y be the set of values from the submap of P that refer to conditions + /// that evaluate to true. + /// * If Y is non empty, the value is taken from the specific submap in Y whose + /// condition_name is the earliest in this condition list. + /// * Else, if P has a default value option (condition_name is empty) then + /// the value is taken from that option. + /// * Else, parameter P has no value and is omitted from the config result. + /// + /// Example: parameter key "p1", default value "v1", submap specified as + /// {"c1": v2, "c2": v3} where "c1" and "c2" are names of conditions in the + /// condition list (where "c1" in this example appears before "c2"). The + /// value of p1 would be v2 as long as c1 is true. Otherwise, if c2 is true, + /// p1 would evaluate to v3, and if c1 and c2 are both false, p1 would evaluate + /// to v1. If no default value was specified, and c1 and c2 were both false, + /// no value for p1 would be generated. + pub conditions: Option>, + /// Map of parameter keys to their optional default values and optional submap + /// of (condition name : value). Order doesn't affect semantics, and so is + /// sorted by the server. The 'key' values of the params must be unique. + pub parameters: Option>, +} + +impl RequestValue for RemoteConfig {} +impl ResponseResult for RemoteConfig {} + + +/// A RemoteConfigParameter's "value" (either the default value, or the value +/// associated with a condition name) is either a string, or the +/// "use_in_app_default" indicator (which means to leave out the parameter from +/// the returned map that is the output of the parameter fetch). +/// We represent the "use_in_app_default" as a bool, but (when using the boolean +/// instead of the string) it should always be true. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemoteConfigParameterValue { + /// if true, omit the parameter from the map of fetched parameter values + #[serde(rename="useInAppDefault")] + pub use_in_app_default: Option, + /// the string to set the parameter to + pub value: Option, +} + +impl Part for RemoteConfigParameterValue {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `FirebaseRemoteConfig` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_firebaseremoteconfig1 as firebaseremoteconfig1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use firebaseremoteconfig1::FirebaseRemoteConfig; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = FirebaseRemoteConfig::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get_remote_config(...)` and `update_remote_config(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseRemoteConfig, +} + +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: + /// + /// Get the latest version Remote Configuration for a project. + /// Returns the RemoteConfig as the payload, and also the eTag as a + /// response header. + /// + /// # Arguments + /// + /// * `project` - The GMP project identifier. Required. + /// See note at the beginning of this file regarding project ids. + pub fn get_remote_config(&self, project: &str) -> ProjectGetRemoteConfigCall<'a, C, A> { + ProjectGetRemoteConfigCall { + hub: self.hub, + _project: project.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update a RemoteConfig. We treat this as an always-existing + /// resource (when it is not found in our data store, we treat it as version + /// 0, a template with zero conditions and zero parameters). Hence there are + /// no Create or Delete operations. Returns the updated template when + /// successful (and the updated eTag as a response header), or an error if + /// things go wrong. + /// Possible error messages: + /// * VALIDATION_ERROR (HTTP status 400) with additional details if the + /// template being passed in can not be validated. + /// * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be + /// authenticate (e.g. no access token, or invalid access token). + /// * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be + /// authorized (e.g. the user has no access to the specified project id). + /// * VERSION_MISMATCH (HTTP status 412) when trying to update when the + /// expected eTag (passed in via the "If-match" header) is not specified, or + /// is specified but does does not match the current eTag. + /// * Internal error (HTTP status 500) for Database problems or other internal + /// errors. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The GMP project identifier. Required. + /// See note at the beginning of this file regarding project ids. + pub fn update_remote_config(&self, request: RemoteConfig, project: &str) -> ProjectUpdateRemoteConfigCall<'a, C, A> { + ProjectUpdateRemoteConfigCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _validate_only: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Get the latest version Remote Configuration for a project. +/// Returns the RemoteConfig as the payload, and also the eTag as a +/// response header. +/// +/// A builder for the *getRemoteConfig* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebaseremoteconfig1 as firebaseremoteconfig1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebaseremoteconfig1::FirebaseRemoteConfig; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseRemoteConfig::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_remote_config("project") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetRemoteConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseRemoteConfig, + _project: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ProjectGetRemoteConfigCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetRemoteConfigCall<'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, RemoteConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebaseremoteconfig.projects.getRemoteConfig", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + 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 = self.hub._base_url.clone() + "v1/{+project}/remoteConfig"; + + 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 [("{+project}", "project")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + 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 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(d); + 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(d); + 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 GMP project identifier. Required. + /// See note at the beginning of this file regarding project ids. + /// + /// 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) -> ProjectGetRemoteConfigCall<'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) -> ProjectGetRemoteConfigCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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) -> ProjectGetRemoteConfigCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Update a RemoteConfig. We treat this as an always-existing +/// resource (when it is not found in our data store, we treat it as version +/// 0, a template with zero conditions and zero parameters). Hence there are +/// no Create or Delete operations. Returns the updated template when +/// successful (and the updated eTag as a response header), or an error if +/// things go wrong. +/// Possible error messages: +/// * VALIDATION_ERROR (HTTP status 400) with additional details if the +/// template being passed in can not be validated. +/// * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be +/// authenticate (e.g. no access token, or invalid access token). +/// * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be +/// authorized (e.g. the user has no access to the specified project id). +/// * VERSION_MISMATCH (HTTP status 412) when trying to update when the +/// expected eTag (passed in via the "If-match" header) is not specified, or +/// is specified but does does not match the current eTag. +/// * Internal error (HTTP status 500) for Database problems or other internal +/// errors. +/// +/// A builder for the *updateRemoteConfig* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebaseremoteconfig1 as firebaseremoteconfig1; +/// use firebaseremoteconfig1::RemoteConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebaseremoteconfig1::FirebaseRemoteConfig; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseRemoteConfig::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemoteConfig::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_remote_config(req, "project") +/// .validate_only(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectUpdateRemoteConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseRemoteConfig, + _request: RemoteConfig, + _project: String, + _validate_only: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ProjectUpdateRemoteConfigCall<'a, C, A> {} + +impl<'a, C, A> ProjectUpdateRemoteConfigCall<'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, RemoteConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebaseremoteconfig.projects.updateRemoteConfig", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._validate_only { + params.push(("validateOnly", value.to_string())); + } + for &field in ["alt", "project", "validateOnly"].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 = self.hub._base_url.clone() + "v1/{+project}/remoteConfig"; + + 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 [("{+project}", "project")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + 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).expect("serde to work"); + 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::Put, &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(d); + 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(d); + 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: RemoteConfig) -> ProjectUpdateRemoteConfigCall<'a, C, A> { + self._request = new_value; + self + } + /// The GMP project identifier. Required. + /// See note at the beginning of this file regarding project ids. + /// + /// 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) -> ProjectUpdateRemoteConfigCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Optional. Defaults to false (UpdateRemoteConfig call should + /// update the backend if there are no validation/interal errors). May be set + /// to true to indicate that, should no validation errors occur, + /// the call should return a "200 OK" instead of performing the update. Note + /// that other error messages (500 Internal Error, 412 Version Mismatch, etc) + /// may still result after flipping to false, even if getting a + /// "200 OK" when calling with true. + /// + /// Sets the *validate only* query property to the given value. + pub fn validate_only(mut self, new_value: bool) -> ProjectUpdateRemoteConfigCall<'a, C, A> { + self._validate_only = 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) -> ProjectUpdateRemoteConfigCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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) -> ProjectUpdateRemoteConfigCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + diff --git a/gen/fitness1-cli/Cargo.toml b/gen/fitness1-cli/Cargo.toml index 30747bede0..bf7ba7c230 100644 --- a/gen/fitness1-cli/Cargo.toml +++ b/gen/fitness1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fitness1-cli" -version = "1.0.6+20161128" +version = "1.0.6+20170830" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-fitness1] path = "../fitness1" -version = "1.0.6+20161128" +version = "1.0.6+20170830" diff --git a/gen/fitness1-cli/README.md b/gen/fitness1-cli/README.md index 765db90f76..c424b04154 100644 --- a/gen/fitness1-cli/README.md +++ b/gen/fitness1-cli/README.md @@ -25,12 +25,13 @@ 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 *20161128*. The CLI is at version *1.0.6*. +This documentation was generated from the *fitness* API at revision *20170830*. The CLI is at version *1.0.6*. ```bash fitness1 [options] users data-sources-create (-r )... [-p ]... [-o ] + data-sources-data-point-changes-list [-p ]... [-o ] data-sources-datasets-delete [-p ]... data-sources-datasets-get [-p ]... [-o ] data-sources-datasets-patch (-r )... [-p ]... [-o ] diff --git a/gen/fitness1-cli/mkdocs.yml b/gen/fitness1-cli/mkdocs.yml index 9b833f2463..68032e4307 100644 --- a/gen/fitness1-cli/mkdocs.yml +++ b/gen/fitness1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fitness v1.0.6+20161128 +site_name: fitness v1.0.6+20170830 site_url: http://byron.github.io/google-apis-rs/google-fitness1-cli site_description: A complete library to interact with fitness (protocol v1) @@ -10,6 +10,7 @@ site_dir: build_html pages: - ['index.md', 'Home'] - ['users_data-sources-create.md', 'Users', 'Data Sources Create'] +- ['users_data-sources-data-point-changes-list.md', 'Users', 'Data Sources Data Point Changes List'] - ['users_data-sources-datasets-delete.md', 'Users', 'Data Sources Datasets Delete'] - ['users_data-sources-datasets-get.md', 'Users', 'Data Sources Datasets Get'] - ['users_data-sources-datasets-patch.md', 'Users', 'Data Sources Datasets Patch'] diff --git a/gen/fitness1-cli/src/main.rs b/gen/fitness1-cli/src/main.rs index 0b598f302c..ab0a3b5e18 100644 --- a/gen/fitness1-cli/src/main.rs +++ b/gen/fitness1-cli/src/main.rs @@ -145,6 +145,65 @@ impl<'n> Engine<'n> { } } + fn _users_data_sources_data_point_changes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().data_sources_data_point_changes_list(opt.value_of("user-id").unwrap_or(""), opt.value_of("data-source-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "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(["page-token", "limit"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _users_data_sources_datasets_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.users().data_sources_datasets_delete(opt.value_of("user-id").unwrap_or(""), opt.value_of("data-source-id").unwrap_or(""), opt.value_of("dataset-id").unwrap_or("")); @@ -1024,6 +1083,9 @@ impl<'n> Engine<'n> { ("data-sources-create", Some(opt)) => { call_result = self._users_data_sources_create(opt, dry_run, &mut err); }, + ("data-sources-data-point-changes-list", Some(opt)) => { + call_result = self._users_data_sources_data_point_changes_list(opt, dry_run, &mut err); + }, ("data-sources-datasets-delete", Some(opt)) => { call_result = self._users_data_sources_datasets_delete(opt, dry_run, &mut err); }, @@ -1148,7 +1210,7 @@ impl<'n> Engine<'n> { 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', 'dataset-aggregate', 'sessions-delete', 'sessions-list' and 'sessions-update'", vec![ + ("users", "methods: 'data-sources-create', 'data-sources-data-point-changes-list', '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", @@ -1171,6 +1233,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)), + ]), + ("data-sources-data-point-changes-list", + Some(r##"results ordered by descending end_time"##), + "Details at http://byron.github.io/google-apis-rs/google_fitness1_cli/users_data-sources-data-point-changes-list", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"List data points for the person identified. Use "me" to indicate the authenticated user. Only "me" is supported at this time."##), + Some(true), + Some(false)), + + (Some(r##"data-source-id"##), + None, + Some(r##"The data stream ID of the data source that created the dataset."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1541,7 +1631,7 @@ fn main() { let mut app = App::new("fitness1") .author("Sebastian Thiel ") - .version("1.0.6+20161128") + .version("1.0.6+20170830") .about("Stores and accesses user data in the fitness store from apps on any platform.") .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 d027cd60ba..a02317dcbb 100644 --- a/gen/fitness1/Cargo.toml +++ b/gen/fitness1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fitness1" -version = "1.0.6+20161128" +version = "1.0.6+20170830" 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" homepage = "https://developers.google.com/fit/rest/" -documentation = "https://docs.rs/google-fitness1/1.0.6+20161128" +documentation = "https://docs.rs/google-fitness1/1.0.6+20170830" license = "MIT" keywords = ["fitness", "google", "protocol", "web", "api"] diff --git a/gen/fitness1/README.md b/gen/fitness1/README.md index 2edcb1811b..3fdc36f87f 100644 --- a/gen/fitness1/README.md +++ b/gen/fitness1/README.md @@ -5,16 +5,16 @@ 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 *1.0.6+20161128*, where *20161128* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *fitness* crate version *1.0.6+20170830*, where *20170830* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *fitness* *v1* API can be found at the [official documentation site](https://developers.google.com/fit/rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.Fitness.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.Fitness.html) ... * users - * [*data sources create*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources datasets delete*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceListCall.html), [*data sources patch*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourcePatchCall.html), [*data sources update*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserDatasetAggregateCall.html), [*sessions delete*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.UserSessionUpdateCall.html) + * [*data sources create*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources data point changes list*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceDataPointChangeListCall.html), [*data sources datasets delete*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceListCall.html), [*data sources patch*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourcePatchCall.html), [*data sources update*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserDatasetAggregateCall.html), [*sessions delete*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.UserSessionUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/struct.Fitness.html)** +* **[Hub](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/struct.Fitness.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.Part.html)** + * **[Parts](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -126,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/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")`. @@ -146,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/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](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/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](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/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](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/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](https://docs.rs/google-fitness1/1.0.6+20161128/google_fitness1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index 92c929963b..24929eca79 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 *1.0.6+20161128*, where *20161128* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *fitness* crate version *1.0.6+20170830*, where *20170830* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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), [*dataset aggregate*](struct.UserDatasetAggregateCall.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 data point changes list*](struct.UserDataSourceDataPointChangeListCall.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) //! //! //! @@ -453,42 +453,29 @@ impl Part for AggregateBy {} /// 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*). +/// +/// * [sessions list users](struct.UserSessionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ValueMapValEntry { - /// no description provided - pub key: Option, - /// no description provided - pub value: Option, +pub struct ListSessionsResponse { + /// Flag to indicate server has more data to transfer + #[serde(rename="hasMoreData")] + pub has_more_data: Option, + /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + #[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 Part for ValueMapValEntry {} - - -/// Holder object for the value of a single field in a data point. -/// -/// A field value has a particular format and is only ever set to one of an integer or a floating point value. LINT.IfChange -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Value { - /// Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled. - #[serde(rename="mapVal")] - pub map_val: Option>, - /// Floating point value. When this is set, other values must not be set. - #[serde(rename="fpVal")] - pub fp_val: Option, - /// Integer value. When this is set, other values must not be set. - #[serde(rename="intVal")] - pub int_val: Option, - /// String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled. - #[serde(rename="stringVal")] - pub string_val: Option, -} - -impl Part for Value {} +impl ResponseResult for ListSessionsResponse {} /// There is no detailed description. @@ -571,31 +558,29 @@ pub struct DataPoint { impl Part for DataPoint {} -/// There is no detailed description. +/// Holder object for the value of a single field in a data point. /// -/// # Activities +/// A field value has a particular format and is only ever set to one of an integer or a floating point value. LINT.IfChange /// -/// 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) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListSessionsResponse { - /// Flag to indicate server has more data to transfer - #[serde(rename="hasMoreData")] - pub has_more_data: Option, - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. - #[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>, +pub struct Value { + /// Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled. + #[serde(rename="mapVal")] + pub map_val: Option>, + /// Floating point value. When this is set, other values must not be set. + #[serde(rename="fpVal")] + pub fp_val: Option, + /// Integer value. When this is set, other values must not be set. + #[serde(rename="intVal")] + pub int_val: Option, + /// String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled. + #[serde(rename="stringVal")] + pub string_val: Option, } -impl ResponseResult for ListSessionsResponse {} +impl Part for Value {} /// There is no detailed description. @@ -681,19 +666,37 @@ pub struct AggregateRequest { impl RequestValue for AggregateRequest {} +/// 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) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AggregateResponse { + /// A list of buckets containing the aggregated data. + pub bucket: Option>, +} + +impl ResponseResult for AggregateResponse {} + + +/// 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 ValueMapValEntry { + /// no description provided + pub key: Option, + /// no description provided + pub value: Option, } -impl Part for DataType {} +impl Part for ValueMapValEntry {} /// 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. @@ -728,22 +731,19 @@ impl RequestValue for Dataset {} impl ResponseResult for Dataset {} -/// 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) (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 AggregateResponse { - /// A list of buckets containing the aggregated data. - pub bucket: Option>, +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 ResponseResult for AggregateResponse {} +impl Part for DataType {} /// Sessions contain metadata, such as a user-friendly name and time interval information. @@ -882,6 +882,34 @@ pub struct DataTypeField { impl Part for DataTypeField {} +/// 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 data point changes list users](struct.UserDataSourceDataPointChangeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDataPointChangesResponse { + /// 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, + /// Data points that have been removed and will not be included in any other request for dataset contents. + #[serde(rename="deletedDataPoint")] + pub deleted_data_point: Option>, + /// The data stream ID of the data source with data point changes. + #[serde(rename="dataSourceId")] + pub data_source_id: Option, + /// Data points listed. + #[serde(rename="insertedDataPoint")] + pub inserted_data_point: Option>, +} + +impl ResponseResult for ListDataPointChangesResponse {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -944,7 +972,7 @@ pub struct DataSource { /// /// The exact format of the data stream ID created by a REST client is: type:dataType.name:developer project number:device.manufacturer:device.model:device.uid:dataStreamName /// - /// When any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minnimum viable data stream ID would be: type:dataType.name:developer project number + /// When any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minimum viable data stream ID would be: type:dataType.name:developer project number /// /// Finally, the developer project number 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 developer project number in clear and normal form. #[serde(rename="dataStreamId")] @@ -987,7 +1015,7 @@ impl ResponseResult for DataSource {} /// ::default(), None); /// let mut hub = Fitness::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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(...)`, `dataset_aggregate(...)`, `sessions_delete(...)`, `sessions_list(...)` and `sessions_update(...)` +/// // like `data_sources_create(...)`, `data_sources_data_point_changes_list(...)`, `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(); /// # } @@ -1234,6 +1262,27 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// results ordered by descending end_time + /// + /// # Arguments + /// + /// * `userId` - List data points for the person identified. Use "me" to indicate the authenticated user. Only "me" is supported at this time. + /// * `dataSourceId` - The data stream ID of the data source that created the dataset. + pub fn data_sources_data_point_changes_list(&self, user_id: &str, data_source_id: &str) -> UserDataSourceDataPointChangeListCall<'a, C, A> { + UserDataSourceDataPointChangeListCall { + hub: self.hub, + _user_id: user_id.to_string(), + _data_source_id: data_source_id.to_string(), + _page_token: Default::default(), + _limit: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be modified. @@ -4356,6 +4405,285 @@ impl<'a, C, A> UserSessionUpdateCall<'a, C, A> where C: BorrowMut } +/// results ordered by descending end_time +/// +/// A builder for the *dataSources.dataPointChanges.list* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_fitness1 as fitness1; +/// # #[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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Fitness::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().data_sources_data_point_changes_list("userId", "dataSourceId") +/// .page_token("labore") +/// .limit(-39) +/// .doit(); +/// # } +/// ``` +pub struct UserDataSourceDataPointChangeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Fitness, + _user_id: String, + _data_source_id: String, + _page_token: Option, + _limit: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserDataSourceDataPointChangeListCall<'a, C, A> {} + +impl<'a, C, A> UserDataSourceDataPointChangeListCall<'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, ListDataPointChangesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.dataSources.dataPointChanges.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + params.push(("dataSourceId", self._data_source_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + for &field in ["alt", "userId", "dataSourceId", "pageToken", "limit"].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 = self.hub._base_url.clone() + "{userId}/dataSources/{dataSourceId}/dataPointChanges"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ActivityRead.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId"), ("{dataSourceId}", "dataSourceId")].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 ["dataSourceId", "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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// List data points for the person identified. Use "me" to indicate the authenticated user. Only "me" is supported at this time. + /// + /// 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) -> UserDataSourceDataPointChangeListCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The data stream ID of the data source that created the dataset. + /// + /// Sets the *data source 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 data_source_id(mut self, new_value: &str) -> UserDataSourceDataPointChangeListCall<'a, C, A> { + self._data_source_id = new_value.to_string(); + self + } + /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UserDataSourceDataPointChangeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// If specified, no more than this many data point changes will be included in the response. The default is 500 data point changes. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> UserDataSourceDataPointChangeListCall<'a, C, A> { + self._limit = 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) -> UserDataSourceDataPointChangeListCall<'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) -> UserDataSourceDataPointChangeListCall<'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::ActivityRead`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserDataSourceDataPointChangeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be modified. /// /// Data sources are identified by their dataStreamId. This method supports patch semantics. @@ -4672,7 +5000,7 @@ impl<'a, C, A> UserDataSourcePatchCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-games1] path = "../games1" -version = "1.0.6+20170511" +version = "1.0.6+20170925" diff --git a/gen/games1-cli/README.md b/gen/games1-cli/README.md index 3bf54f841e..3c6fdb71c7 100644 --- a/gen/games1-cli/README.md +++ b/gen/games1-cli/README.md @@ -25,7 +25,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 *20170511*. The CLI is at version *1.0.6*. +This documentation was generated from the *Games* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash games1 [options] diff --git a/gen/games1-cli/mkdocs.yml b/gen/games1-cli/mkdocs.yml index 03b8641351..c2a958b12c 100644 --- a/gen/games1-cli/mkdocs.yml +++ b/gen/games1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games v1.0.6+20170511 +site_name: Games v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-games1-cli site_description: A complete library to interact with Games (protocol v1) diff --git a/gen/games1-cli/src/main.rs b/gen/games1-cli/src/main.rs index de798350bf..f5b0dea4e0 100644 --- a/gen/games1-cli/src/main.rs +++ b/gen/games1-cli/src/main.rs @@ -5260,7 +5260,7 @@ fn main() { let mut app = App::new("games1") .author("Sebastian Thiel ") - .version("1.0.6+20170511") + .version("1.0.6+20170925") .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 e3ec5f8ad4..2a05f73b3e 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-games1" -version = "1.0.6+20170511" +version = "1.0.6+20170925" 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" homepage = "https://developers.google.com/games/services/" -documentation = "https://docs.rs/google-games1/1.0.6+20170511" +documentation = "https://docs.rs/google-games1/1.0.6+20170925" license = "MIT" keywords = ["games", "google", "protocol", "web", "api"] diff --git a/gen/games1/README.md b/gen/games1/README.md index d155e2ff9f..9380e39211 100644 --- a/gen/games1/README.md +++ b/gen/games1/README.md @@ -5,44 +5,44 @@ 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Games* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Games* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Games.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Games.html) ... -* [achievement definitions](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementDefinition.html) - * [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementDefinitionListCall.html) +* [achievement definitions](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementDefinition.html) + * [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementDefinitionListCall.html) * achievements - * [*increment*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.AchievementUpdateMultipleCall.html) -* [applications](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Application.html) - * [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ApplicationVerifyCall.html) + * [*increment*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.AchievementUpdateMultipleCall.html) +* [applications](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Application.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ApplicationVerifyCall.html) * events - * [*list by player*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.EventRecordCall.html) -* [leaderboards](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Leaderboard.html) - * [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.LeaderboardListCall.html) + * [*list by player*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.EventRecordCall.html) +* [leaderboards](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Leaderboard.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.LeaderboardListCall.html) * metagame - * [*get metagame config*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.MetagameListCategoriesByPlayerCall.html) -* [players](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Player.html) - * [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.PlayerListCall.html) + * [*get metagame config*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.MetagameListCategoriesByPlayerCall.html) +* [players](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Player.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.PlayerListCall.html) * pushtokens - * [*remove*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.PushtokenUpdateCall.html) -* [quest milestones](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.QuestMilestone.html) - * [*claim*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.QuestMilestoneClaimCall.html) -* [quests](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Quest.html) - * [*accept*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.QuestAcceptCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.QuestListCall.html) + * [*remove*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.PushtokenUpdateCall.html) +* [quest milestones](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.QuestMilestone.html) + * [*claim*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.QuestMilestoneClaimCall.html) +* [quests](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Quest.html) + * [*accept*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.QuestAcceptCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.QuestListCall.html) * revisions - * [*check*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RevisionCheckCall.html) -* [rooms](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Room.html) - * [*create*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.RoomReportStatuCall.html) + * [*check*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RevisionCheckCall.html) +* [rooms](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Room.html) + * [*create*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.RoomReportStatuCall.html) * scores - * [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.ScoreSubmitMultipleCall.html) -* [snapshots](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Snapshot.html) - * [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.SnapshotListCall.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.ScoreSubmitMultipleCall.html) +* [snapshots](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Snapshot.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.SnapshotListCall.html) * turn based matches - * [*cancel*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.TurnBasedMatcheTakeTurnCall.html) + * [*cancel*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.TurnBasedMatcheTakeTurnCall.html) @@ -51,17 +51,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-games1/1.0.6+20170511/google_games1/struct.Games.html)** +* **[Hub](https://docs.rs/google-games1/1.0.6+20170925/google_games1/struct.Games.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.Part.html)** + * **[Parts](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -154,17 +154,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-games1/1.0.6+20170511/google_games1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-games1/1.0.6+20170925/google_games1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-games1/1.0.6+20170511/google_games1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-games1/1.0.6+20170925/google_games1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-games1/1.0.6+20170925/google_games1/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")`. @@ -174,29 +174,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-games1/1.0.6+20170925/google_games1/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](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-games1/1.0.6+20170925/google_games1/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](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-games1/1.0.6+20170925/google_games1/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](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-games1/1.0.6+20170925/google_games1/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](https://docs.rs/google-games1/1.0.6+20170511/google_games1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/games1/src/lib.rs b/gen/games1/src/lib.rs index 22eca36eeb..01490c13c0 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Games* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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 f4dca71997..ffefc4a94e 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 = "1.0.6+20170511" +version = "1.0.6+20170925" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-gamesconfiguration1_configuration] path = "../gamesconfiguration1_configuration" -version = "1.0.6+20170511" +version = "1.0.6+20170925" diff --git a/gen/gamesconfiguration1_configuration-cli/README.md b/gen/gamesconfiguration1_configuration-cli/README.md index 33059cf853..e2776425f5 100644 --- a/gen/gamesconfiguration1_configuration-cli/README.md +++ b/gen/gamesconfiguration1_configuration-cli/README.md @@ -25,7 +25,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 *20170511*. The CLI is at version *1.0.6*. +This documentation was generated from the *Games Configuration* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash gamesconfiguration1-configuration [options] diff --git a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml index 31741b2fac..dcc1008c5f 100644 --- a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml +++ b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Configuration v1.0.6+20170511 +site_name: Games Configuration v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-gamesconfiguration1_configuration-cli site_description: A complete library to interact with Games Configuration (protocol v1configuration) diff --git a/gen/gamesconfiguration1_configuration-cli/src/main.rs b/gen/gamesconfiguration1_configuration-cli/src/main.rs index b93dcce33c..57567554f0 100644 --- a/gen/gamesconfiguration1_configuration-cli/src/main.rs +++ b/gen/gamesconfiguration1_configuration-cli/src/main.rs @@ -1552,7 +1552,7 @@ fn main() { let mut app = App::new("gamesconfiguration1-configuration") .author("Sebastian Thiel ") - .version("1.0.6+20170511") + .version("1.0.6+20170925") .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 3ddaf76131..e2a2a99542 100644 --- a/gen/gamesconfiguration1_configuration/Cargo.toml +++ b/gen/gamesconfiguration1_configuration/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gamesconfiguration1_configuration" -version = "1.0.6+20170511" +version = "1.0.6+20170925" 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" homepage = "https://developers.google.com/games/services" -documentation = "https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511" +documentation = "https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925" license = "MIT" keywords = ["gamesConfiguration", "google", "protocol", "web", "api"] diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index 8908d739bb..cfa3668f85 100644 --- a/gen/gamesconfiguration1_configuration/README.md +++ b/gen/gamesconfiguration1_configuration/README.md @@ -5,25 +5,25 @@ 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Games Configuration* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Games Configuration* *v1_configuration* API can be found at the [official documentation site](https://developers.google.com/games/services). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html) ... -* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) - * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) -* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) - * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) -* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) - * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) +* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) +* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) + * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) Upload supported by ... -* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) @@ -31,17 +31,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html)** +* **[Hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/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")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/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](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/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](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/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](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/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](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170511/google_gamesconfiguration1_configuration/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/gamesconfiguration1_configuration/src/lib.rs b/gen/gamesconfiguration1_configuration/src/lib.rs index 3924f7411f..bf4acf5b3c 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Games Configuration* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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 5d211e82d3..9f411f6cc3 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 = "1.0.6+20170511" +version = "1.0.6+20170925" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-gamesmanagement1_management] path = "../gamesmanagement1_management" -version = "1.0.6+20170511" +version = "1.0.6+20170925" diff --git a/gen/gamesmanagement1_management-cli/README.md b/gen/gamesmanagement1_management-cli/README.md index ddff6a150e..56a07f06dd 100644 --- a/gen/gamesmanagement1_management-cli/README.md +++ b/gen/gamesmanagement1_management-cli/README.md @@ -25,7 +25,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 *20170511*. The CLI is at version *1.0.6*. +This documentation was generated from the *Games Management* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash gamesmanagement1-management [options] diff --git a/gen/gamesmanagement1_management-cli/mkdocs.yml b/gen/gamesmanagement1_management-cli/mkdocs.yml index 7dc3169687..1b7f065869 100644 --- a/gen/gamesmanagement1_management-cli/mkdocs.yml +++ b/gen/gamesmanagement1_management-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Management v1.0.6+20170511 +site_name: Games Management v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-gamesmanagement1_management-cli site_description: A complete library to interact with Games Management (protocol v1management) diff --git a/gen/gamesmanagement1_management-cli/src/main.rs b/gen/gamesmanagement1_management-cli/src/main.rs index 15c95b5319..825d78005f 100644 --- a/gen/gamesmanagement1_management-cli/src/main.rs +++ b/gen/gamesmanagement1_management-cli/src/main.rs @@ -2079,7 +2079,7 @@ fn main() { let mut app = App::new("gamesmanagement1-management") .author("Sebastian Thiel ") - .version("1.0.6+20170511") + .version("1.0.6+20170925") .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 3ab44f4a93..cd7cc27459 100644 --- a/gen/gamesmanagement1_management/Cargo.toml +++ b/gen/gamesmanagement1_management/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gamesmanagement1_management" -version = "1.0.6+20170511" +version = "1.0.6+20170925" 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" homepage = "https://developers.google.com/games/services" -documentation = "https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511" +documentation = "https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925" license = "MIT" keywords = ["gamesManagement", "google", "protocol", "web", "api"] diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index ea637f40dd..dcff33537a 100644 --- a/gen/gamesmanagement1_management/README.md +++ b/gen/gamesmanagement1_management/README.md @@ -5,30 +5,30 @@ 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Games Management* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Games Management* *v1_management* API can be found at the [official documentation site](https://developers.google.com/games/services). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.GamesManagement.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.GamesManagement.html) ... * achievements - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) * applications - * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) + * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) * events - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) -* [players](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.Player.html) - * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) +* [players](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.Player.html) + * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) * quests - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.QuestResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.QuestResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.QuestResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.QuestResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.QuestResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.QuestResetMultipleForAllPlayerCall.html) * rooms - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) * scores - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) * turn based matches - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.TurnBasedMatcheResetForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.TurnBasedMatcheResetForAllPlayerCall.html) @@ -37,17 +37,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/struct.GamesManagement.html)** +* **[Hub](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.GamesManagement.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/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")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/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](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/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](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/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](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/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](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170511/google_gamesmanagement1_management/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/gamesmanagement1_management/src/lib.rs b/gen/gamesmanagement1_management/src/lib.rs index 3b9e65695d..7b4db29afb 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 *1.0.6+20170511*, where *20170511* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Games Management* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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/genomics1-cli/Cargo.toml b/gen/genomics1-cli/Cargo.toml index c4c021f66d..3724c8e326 100644 --- a/gen/genomics1-cli/Cargo.toml +++ b/gen/genomics1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1-cli" -version = "1.0.6+20170520" +version = "1.0.6+20170925" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-genomics1] path = "../genomics1" -version = "1.0.6+20170520" +version = "1.0.6+20170925" diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md index 0fad7da4cd..b32461cd0c 100644 --- a/gen/genomics1-cli/README.md +++ b/gen/genomics1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *genomics* API at revision *20170520*. The CLI is at version *1.0.6*. +This documentation was generated from the *genomics* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash genomics1 [options] diff --git a/gen/genomics1-cli/mkdocs.yml b/gen/genomics1-cli/mkdocs.yml index b79921b76f..e6073484d2 100644 --- a/gen/genomics1-cli/mkdocs.yml +++ b/gen/genomics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: genomics v1.0.6+20170520 +site_name: genomics v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-genomics1-cli site_description: A complete library to interact with genomics (protocol v1) diff --git a/gen/genomics1-cli/src/main.rs b/gen/genomics1-cli/src/main.rs index c2568fe5b9..ca229a183b 100644 --- a/gen/genomics1-cli/src/main.rs +++ b/gen/genomics1-cli/src/main.rs @@ -363,9 +363,9 @@ impl<'n> Engine<'n> { "reference-id" => Some(("referenceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "annotation-set-ids" => Some(("annotationSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "annotation-set-ids" => Some(("annotationSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["annotation-set-ids", "end", "page-size", "page-token", "reference-id", "reference-name", "start"]); @@ -559,8 +559,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-uri" => Some(("sourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -753,9 +753,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-ids" => Some(("datasetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "types" => Some(("types", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-ids", "name", "page-size", "page-token", "reference-set-id", "types"]); @@ -843,8 +843,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-uri" => Some(("sourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -2454,8 +2454,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "source-uris" => Some(("sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-uris" => Some(("sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "partition-strategy" => Some(("partitionStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -3361,10 +3361,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "normalize-reference-names" => Some(("normalizeReferenceNames", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "source-uris" => Some(("sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "info-merge-config" => Some(("infoMergeConfig", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "normalize-reference-names" => Some(("normalizeReferenceNames", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["format", "info-merge-config", "normalize-reference-names", "source-uris", "variant-set-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3639,10 +3639,10 @@ impl<'n> Engine<'n> { "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "max-calls" => Some(("maxCalls", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "variant-name" => Some(("variantName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["call-set-ids", "end", "max-calls", "page-size", "page-token", "reference-name", "start", "variant-name", "variant-set-ids"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3869,10 +3869,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "bigquery-dataset" => Some(("bigqueryDataset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "bigquery-table" => Some(("bigqueryTable", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-table" => Some(("bigqueryTable", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-dataset", "bigquery-table", "call-set-ids", "format", "project-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -5313,7 +5313,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the operation collection."##), + Some(r##"The name of the operation's parent resource."##), Some(true), Some(false)), @@ -6241,7 +6241,7 @@ fn main() { let mut app = App::new("genomics1") .author("Sebastian Thiel ") - .version("1.0.6+20170520") + .version("1.0.6+20170925") .about("Upload, process, query, and search Genomics data in the cloud.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_genomics1_cli") .arg(Arg::with_name("url") diff --git a/gen/genomics1/Cargo.toml b/gen/genomics1/Cargo.toml index b0d09439fe..bec9564620 100644 --- a/gen/genomics1/Cargo.toml +++ b/gen/genomics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-genomics1" -version = "1.0.6+20170520" +version = "1.0.6+20170925" 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" homepage = "https://cloud.google.com/genomics" -documentation = "https://docs.rs/google-genomics1/1.0.6+20170520" +documentation = "https://docs.rs/google-genomics1/1.0.6+20170925" license = "MIT" keywords = ["genomics", "google", "protocol", "web", "api"] diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md index 28515e49f2..4d800286f1 100644 --- a/gen/genomics1/README.md +++ b/gen/genomics1/README.md @@ -5,36 +5,36 @@ DO NOT EDIT ! --> The `google-genomics1` library allows access to all features of the *Google genomics* service. -This documentation was generated from *genomics* crate version *1.0.6+20170520*, where *20170520* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *genomics* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *genomics* *v1* API can be found at the [official documentation site](https://cloud.google.com/genomics). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Genomics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Genomics.html) ... -* [annotations](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Annotation.html) - * [*batch create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationBatchCreateCall.html), [*create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationUpdateCall.html) +* [annotations](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Annotation.html) + * [*batch create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationBatchCreateCall.html), [*create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationUpdateCall.html) * annotationsets - * [*create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationsetGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationsetSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.AnnotationsetUpdateCall.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationsetGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationsetSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.AnnotationsetUpdateCall.html) * callsets - * [*create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.CallsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.CallsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.CallsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.CallsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.CallsetSearchCall.html) -* [datasets](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Dataset.html) - * [*create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetGetCall.html), [*get iam policy*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetGetIamPolicyCall.html), [*list*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetPatchCall.html), [*set iam policy*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.DatasetUndeleteCall.html) -* [operations](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.OperationListCall.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.CallsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.CallsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.CallsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.CallsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.CallsetSearchCall.html) +* [datasets](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Dataset.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetGetCall.html), [*get iam policy*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetGetIamPolicyCall.html), [*list*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetPatchCall.html), [*set iam policy*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.DatasetUndeleteCall.html) +* [operations](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.OperationListCall.html) * readgroupsets - * [*coveragebuckets list*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetImportCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadgroupsetSearchCall.html) -* [reads](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Read.html) - * [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReadSearchCall.html) -* [references](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Reference.html) - * [*bases list*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReferenceBaseListCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReferenceGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReferenceSearchCall.html) + * [*coveragebuckets list*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetImportCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadgroupsetSearchCall.html) +* [reads](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Read.html) + * [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReadSearchCall.html) +* [references](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Reference.html) + * [*bases list*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReferenceBaseListCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReferenceGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReferenceSearchCall.html) * referencesets - * [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReferencesetGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.ReferencesetSearchCall.html) -* [variants](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Variant.html) - * [*create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantImportCall.html), [*merge*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantMergeCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantSearchCall.html) + * [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReferencesetGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.ReferencesetSearchCall.html) +* [variants](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Variant.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantImportCall.html), [*merge*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantMergeCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantSearchCall.html) * variantsets - * [*create*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.VariantsetSearchCall.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.VariantsetSearchCall.html) @@ -43,17 +43,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/struct.Genomics.html)** +* **[Hub](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/struct.Genomics.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -151,17 +151,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-genomics1/1.0.6+20170925/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")`. @@ -171,29 +171,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-genomics1/1.0.6+20170925/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](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-genomics1/1.0.6+20170925/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](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-genomics1/1.0.6+20170925/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](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-genomics1/1.0.6+20170925/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](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-genomics1/1.0.6+20170925/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](https://docs.rs/google-genomics1/1.0.6+20170520/google_genomics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-genomics1/1.0.6+20170925/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. diff --git a/gen/genomics1/src/lib.rs b/gen/genomics1/src/lib.rs index 44df2e75a7..896903a527 100644 --- a/gen/genomics1/src/lib.rs +++ b/gen/genomics1/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 *genomics* crate version *1.0.6+20170520*, where *20170520* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *genomics* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *genomics* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/genomics). @@ -444,17 +444,17 @@ impl<'a, C, A> Genomics /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClinicalCondition { - /// The set of external IDs for this condition. - #[serde(rename="externalIds")] - pub external_ids: Option>, - /// The OMIM id for this condition. - /// Search for these IDs at http://omim.org/ - #[serde(rename="omimId")] - pub omim_id: Option, /// The MedGen concept id associated with this gene. /// Search for these IDs at http://www.ncbi.nlm.nih.gov/medgen/ #[serde(rename="conceptId")] pub concept_id: Option, + /// The OMIM id for this condition. + /// Search for these IDs at http://omim.org/ + #[serde(rename="omimId")] + pub omim_id: Option, + /// The set of external IDs for this condition. + #[serde(rename="externalIds")] + pub external_ids: Option>, /// A set of names for the condition. pub names: Option>, } @@ -527,9 +527,6 @@ impl RequestValue for ExportReadGroupSetRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Program { - /// The ID of the program run before this one. - #[serde(rename="prevProgramId")] - pub prev_program_id: Option, /// The command line used to run this program. #[serde(rename="commandLine")] pub command_line: Option, @@ -541,6 +538,9 @@ pub struct Program { /// The display name of the program. This is typically the colloquial name of /// the tool used, for example 'bwa' or 'picard'. pub name: Option, + /// The ID of the program run before this one. + #[serde(rename="prevProgramId")] + pub prev_program_id: Option, } impl Part for Program {} @@ -598,16 +598,9 @@ pub struct ImportVariantsRequest { /// Required. The variant set to which variant data should be imported. #[serde(rename="variantSetId")] pub variant_set_id: Option, - /// Convert reference names to the canonical representation. - /// hg19 haploytypes (those reference names containing "_hap") - /// are not modified in any way. - /// All other reference names are modified according to the following rules: - /// The reference name is capitalized. - /// The "chr" prefix is dropped for all autosomes and sex chromsomes. - /// For example "chr17" becomes "17" and "chrX" becomes "X". - /// All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT". - #[serde(rename="normalizeReferenceNames")] - pub normalize_reference_names: Option, + /// The format of the variant data being imported. If unspecified, defaults to + /// to `VCF`. + pub format: Option, /// A list of URIs referencing variant files in Google Cloud Storage. URIs can /// include wildcards [as described /// here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). @@ -619,9 +612,16 @@ pub struct ImportVariantsRequest { /// generated by the resulting import job. #[serde(rename="infoMergeConfig")] pub info_merge_config: Option>, - /// The format of the variant data being imported. If unspecified, defaults to - /// to `VCF`. - pub format: Option, + /// Convert reference names to the canonical representation. + /// hg19 haploytypes (those reference names containing "_hap") + /// are not modified in any way. + /// All other reference names are modified according to the following rules: + /// The reference name is capitalized. + /// The "chr" prefix is dropped for all autosomes and sex chromsomes. + /// For example "chr17" becomes "17" and "chrX" becomes "X". + /// All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT". + #[serde(rename="normalizeReferenceNames")] + pub normalize_reference_names: Option, } impl RequestValue for ImportVariantsRequest {} @@ -721,8 +721,8 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a - /// common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. pub details: Option>>, } @@ -740,17 +740,17 @@ impl Part for Status {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListCoverageBucketsResponse { - /// The continuation token, which is used to page through large result sets. - /// Provide this value in a subsequent request to return the next page of - /// results. This field will be empty if there aren't any additional results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, /// The coverage buckets. The list of buckets is sparse; a bucket with 0 /// overlapping reads is not returned. A bucket never crosses more than one /// reference sequence. Each bucket has width `bucketWidth`, unless /// its end is the end of the reference sequence. #[serde(rename="coverageBuckets")] pub coverage_buckets: Option>, + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, /// The length of each coverage bucket in base pairs. Note that buckets at the /// end of a reference sequence may be shorter. This value is omitted if the /// bucket width is infinity (the default behaviour, with no range or @@ -826,6 +826,9 @@ pub struct Transcript { /// cannot necessarily be concatenated to produce the original transcript mRNA. #[serde(rename="codingSequence")] pub coding_sequence: Option, + /// The annotation ID of the gene from which this transcript is transcribed. + #[serde(rename="geneId")] + pub gene_id: Option, /// The exons that compose /// this transcript. This field should be unset for genomes where transcript /// splicing does not occur, for example prokaryotes. @@ -841,9 +844,6 @@ pub struct Transcript { /// /// Exons are ordered by start position and may not overlap. pub exons: Option>, - /// The annotation ID of the gene from which this transcript is transcribed. - #[serde(rename="geneId")] - pub gene_id: Option, } impl Part for Transcript {} @@ -1101,6 +1101,25 @@ pub struct Position { impl Part for Position {} +/// ReferenceBound records an upper bound for the starting coordinate of +/// variants in a particular reference. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReferenceBound { + /// An upper bound (inclusive) on the starting coordinate of any + /// variant in the reference sequence. + #[serde(rename="upperBound")] + pub upper_bound: Option, + /// The name of the reference associated with this reference bound. + #[serde(rename="referenceName")] + pub reference_name: Option, +} + +impl Part for ReferenceBound {} + + /// The call set search request. /// /// # Activities @@ -1140,45 +1159,16 @@ impl RequestValue for SearchCallSetsRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [search annotations](struct.AnnotationSearchCall.html) (request) +/// * [batch create annotations](struct.AnnotationBatchCreateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SearchAnnotationsRequest { - /// The start position of the range on the reference, 0-based inclusive. If - /// specified, - /// referenceId or - /// referenceName - /// must be specified. Defaults to 0. - pub start: Option, - /// The ID of the reference to query. - #[serde(rename="referenceId")] - pub reference_id: Option, - /// The end position of the range on the reference, 0-based exclusive. If - /// referenceId or - /// referenceName - /// must be specified, Defaults to the length of the reference. - pub end: Option, - /// The maximum number of results to return in a single page. If unspecified, - /// defaults to 256. The maximum value is 2048. - #[serde(rename="pageSize")] - pub page_size: Option, - /// The continuation token, which is used to page through large result sets. - /// To get the next page of results, set this parameter to the value of - /// `nextPageToken` from the previous response. - #[serde(rename="pageToken")] - pub page_token: Option, - /// The name of the reference to query, within the reference set associated - /// with this query. - #[serde(rename="referenceName")] - pub reference_name: Option, - /// Required. The annotation sets to search within. The caller must have - /// `READ` access to these annotation sets. - /// All queried annotation sets must have the same type. - #[serde(rename="annotationSetIds")] - pub annotation_set_ids: Option>, +pub struct BatchCreateAnnotationsResponse { + /// The resulting per-annotation entries, ordered consistently with the + /// original request. + pub entries: Option>, } -impl RequestValue for SearchAnnotationsRequest {} +impl ResponseResult for BatchCreateAnnotationsResponse {} /// The dataset list response. @@ -1215,12 +1205,6 @@ impl ResponseResult for ListDatasetsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ImportReadGroupSetsRequest { - /// The reference set to which the imported read group sets are aligned to, if - /// any. The reference names of this reference set must be a superset of those - /// found in the imported file headers. If no reference set id is provided, a - /// best effort is made to associate with a matching reference set. - #[serde(rename="referenceSetId")] - pub reference_set_id: Option, /// A list of URIs pointing at [BAM /// files](https://samtools.github.io/hts-specs/SAMv1.pdf) /// in Google Cloud Storage. @@ -1233,6 +1217,12 @@ pub struct ImportReadGroupSetsRequest { /// the import immediately after the files are created. #[serde(rename="sourceUris")] pub source_uris: Option>, + /// The reference set to which the imported read group sets are aligned to, if + /// any. The reference names of this reference set must be a superset of those + /// found in the imported file headers. If no reference set id is provided, a + /// best effort is made to associate with a matching reference set. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, /// The partition strategy describes how read groups are partitioned into read /// group sets. #[serde(rename="partitionStrategy")] @@ -1265,10 +1255,6 @@ impl RequestValue for ImportReadGroupSetsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Reference { - /// MD5 of the upper-case sequence excluding all whitespace characters (this - /// is equivalent to SQ:M5 in SAM). This value is represented in lower case - /// hexadecimal format. - pub md5checksum: Option, /// The length of this reference's sequence. pub length: Option, /// The name of this reference, for example `22`. @@ -1277,69 +1263,99 @@ pub struct Reference { /// format file. #[serde(rename="sourceUri")] pub source_uri: Option, + /// ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human. + #[serde(rename="ncbiTaxonId")] + pub ncbi_taxon_id: Option, /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally /// with a version number, for example `GCF_000001405.26`. #[serde(rename="sourceAccessions")] pub source_accessions: Option>, /// The server-generated reference ID, unique across all references. pub id: Option, - /// ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human. - #[serde(rename="ncbiTaxonId")] - pub ncbi_taxon_id: Option, + /// MD5 of the upper-case sequence excluding all whitespace characters (this + /// is equivalent to SQ:M5 in SAM). This value is represented in lower case + /// hexadecimal format. + pub md5checksum: Option, } impl Resource for Reference {} impl ResponseResult for Reference {} -/// A call represents the determination of genotype with respect to a particular -/// variant. It may include associated information such as quality and phasing. -/// For example, a call might assign a probability of 0.32 to the occurrence of -/// a SNP named rs1234 in a call set with the name NA12345. +/// The variant data export request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [export variantsets](struct.VariantsetExportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExportVariantSetRequest { + /// Required. The BigQuery dataset to export data to. This dataset must already + /// exist. Note that this is distinct from the Genomics concept of "dataset". + #[serde(rename="bigqueryDataset")] + pub bigquery_dataset: Option, + /// Required. The BigQuery table to export data to. + /// If the table doesn't exist, it will be created. If it already exists, it + /// will be overwritten. + #[serde(rename="bigqueryTable")] + pub bigquery_table: Option, + /// If provided, only variant call information from the specified call sets + /// will be exported. By default all variant calls are exported. + #[serde(rename="callSetIds")] + pub call_set_ids: Option>, + /// Required. The Google Cloud project ID that owns the destination + /// BigQuery dataset. The caller must have WRITE access to this project. This + /// project will also own the resulting export job. + #[serde(rename="projectId")] + pub project_id: Option, + /// The format for the exported data. + pub format: Option, +} + +impl RequestValue for ExportVariantSetRequest {} + + +/// Associates `members` with a `role`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VariantCall { - /// A map of additional variant call information. This must be of the form - /// map (string key mapping to a list of string values). - pub info: Option>>, - /// The genotype of this variant call. Each value represents either the value - /// of the `referenceBases` field or a 1-based index into - /// `alternateBases`. If a variant had a `referenceBases` - /// value of `T` and an `alternateBases` - /// value of `["A", "C"]`, and the `genotype` was - /// `[2, 1]`, that would mean the call - /// represented the heterozygous value `CA` for this variant. - /// If the `genotype` was instead `[0, 1]`, the - /// represented value would be `TA`. Ordering of the - /// genotype values is important if the `phaseset` is present. - /// If a genotype is not called (that is, a `.` is present in the - /// GT string) -1 is returned. - pub genotype: Option>, - /// The ID of the call set this variant call belongs to. - #[serde(rename="callSetId")] - pub call_set_id: Option, - /// If this field is present, this variant call's genotype ordering implies - /// the phase of the bases and is consistent with any other variant calls in - /// the same reference sequence which have the same phaseset value. - /// When importing data from VCF, if the genotype data was phased but no - /// phase set was specified this field will be set to `*`. - pub phaseset: Option, - /// The genotype likelihoods for this variant call. Each array entry - /// represents how likely a specific genotype is for this call. The value - /// ordering is defined by the GL tag in the VCF spec. - /// If Phred-scaled genotype likelihood scores (PL) are available and - /// log10(P) genotype likelihood scores (GL) are not, PL scores are converted - /// to GL scores. If both are available, PL scores are stored in `info`. - #[serde(rename="genotypeLikelihood")] - pub genotype_likelihood: Option>, - /// The name of the call set this variant call belongs to. - #[serde(rename="callSetName")] - pub call_set_name: Option, +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, } -impl Part for VariantCall {} +impl Part for Binding {} /// There is no detailed description. @@ -1491,18 +1507,18 @@ impl ResponseResult for SearchReadGroupSetsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Operation { - /// An OperationMetadata object. This will always be returned with the Operation. - pub metadata: Option>, + /// The error result of the operation in case of failure or cancellation. + pub error: Option, /// If the value is `false`, it means the operation is still in progress. - /// If true, the operation is completed, and either `error` or `response` is + /// If `true`, the operation is completed, and either `error` or `response` is /// available. pub done: Option, - /// If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an empty response is returned. + /// If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an Empty response is returned. pub response: Option>, /// The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` pub name: Option, - /// The error result of the operation in case of failure or cancellation. - pub error: Option, + /// An OperationMetadata object. This will always be returned with the Operation. + pub metadata: Option>, } impl Resource for Operation {} @@ -1562,44 +1578,54 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Associates `members` with a `role`. +/// A call represents the determination of genotype with respect to a particular +/// variant. It may include associated information such as quality and phasing. +/// For example, a call might assign a probability of 0.32 to the occurrence of +/// a SNP named rs1234 in a call set with the name NA12345. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to `members`. - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - /// Required - pub role: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. - /// `members` can have the following values: - /// - /// * `allUsers`: A special identifier that represents anyone who is - /// on the internet; with or without a Google account. - /// - /// * `allAuthenticatedUsers`: A special identifier that represents anyone - /// who is authenticated with a Google account or a service account. - /// - /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` or `joe@example.com`. - /// - /// - /// * `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. - /// - /// * `group:{emailid}`: An email address that represents a Google group. - /// For example, `admins@example.com`. - /// - /// - /// * `domain:{domain}`: A Google Apps domain name that represents all the - /// users of that domain. For example, `google.com` or `example.com`. - /// - /// - pub members: Option>, +pub struct VariantCall { + /// A map of additional variant call information. This must be of the form + /// map (string key mapping to a list of string values). + pub info: Option>>, + /// The genotype of this variant call. Each value represents either the value + /// of the `referenceBases` field or a 1-based index into + /// `alternateBases`. If a variant had a `referenceBases` + /// value of `T` and an `alternateBases` + /// value of `["A", "C"]`, and the `genotype` was + /// `[2, 1]`, that would mean the call + /// represented the heterozygous value `CA` for this variant. + /// If the `genotype` was instead `[0, 1]`, the + /// represented value would be `TA`. Ordering of the + /// genotype values is important if the `phaseset` is present. + /// If a genotype is not called (that is, a `.` is present in the + /// GT string) -1 is returned. + pub genotype: Option>, + /// The ID of the call set this variant call belongs to. + #[serde(rename="callSetId")] + pub call_set_id: Option, + /// If this field is present, this variant call's genotype ordering implies + /// the phase of the bases and is consistent with any other variant calls in + /// the same reference sequence which have the same phaseset value. + /// When importing data from VCF, if the genotype data was phased but no + /// phase set was specified this field will be set to `*`. + pub phaseset: Option, + /// The genotype likelihoods for this variant call. Each array entry + /// represents how likely a specific genotype is for this call. The value + /// ordering is defined by the GL tag in the VCF spec. + /// If Phred-scaled genotype likelihood scores (PL) are available and + /// log10(P) genotype likelihood scores (GL) are not, PL scores are converted + /// to GL scores. If both are available, PL scores are stored in `info`. + #[serde(rename="genotypeLikelihood")] + pub genotype_likelihood: Option>, + /// The name of the call set this variant call belongs to. + #[serde(rename="callSetName")] + pub call_set_name: Option, } -impl Part for Binding {} +impl Part for VariantCall {} /// There is no detailed description. @@ -1629,25 +1655,6 @@ pub struct ListBasesResponse { impl ResponseResult for ListBasesResponse {} -/// ReferenceBound records an upper bound for the starting coordinate of -/// variants in a particular reference. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReferenceBound { - /// An upper bound (inclusive) on the starting coordinate of any - /// variant in the reference sequence. - #[serde(rename="upperBound")] - pub upper_bound: Option, - /// The name of the reference associated with this reference bound. - #[serde(rename="referenceName")] - pub reference_name: Option, -} - -impl Part for ReferenceBound {} - - /// Defines an Identity and Access Management (IAM) policy. It is used to /// specify access control policies for Cloud Platform resources. /// @@ -1691,7 +1698,6 @@ impl Part for ReferenceBound {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { /// Associates a list of `members` to a `role`. - /// Multiple `bindings` must not be specified for the same `role`. /// `bindings` with no members will result in an error. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help @@ -1744,27 +1750,82 @@ pub struct SearchVariantsRequest { /// The beginning of the window (0-based, inclusive) for which /// overlapping variants should be returned. If unspecified, defaults to 0. pub start: Option, - /// At most one variant set ID must be provided. Only variants from this - /// variant set will be returned. If omitted, a call set id must be included in - /// the request. - #[serde(rename="variantSetIds")] - pub variant_set_ids: Option>, + /// Only return variant calls which belong to call sets with these ids. + /// Leaving this blank returns all variant calls. If a variant has no + /// calls belonging to any of these call sets, it won't be returned at all. + #[serde(rename="callSetIds")] + pub call_set_ids: Option>, /// Only return variants which have exactly this name. #[serde(rename="variantName")] pub variant_name: Option, /// Required. Only return variants in this reference sequence. #[serde(rename="referenceName")] pub reference_name: Option, - /// Only return variant calls which belong to call sets with these ids. - /// Leaving this blank returns all variant calls. If a variant has no - /// calls belonging to any of these call sets, it won't be returned at all. - #[serde(rename="callSetIds")] - pub call_set_ids: Option>, + /// At most one variant set ID must be provided. Only variants from this + /// variant set will be returned. If omitted, a call set id must be included in + /// the request. + #[serde(rename="variantSetIds")] + pub variant_set_ids: Option>, } impl RequestValue for SearchVariantsRequest {} +/// A reference set is a set of references which typically comprise a reference +/// assembly for a species, such as `GRCh38` which is representative +/// of the human genome. A reference set defines a common coordinate space for +/// comparing reference-aligned experimental data. A reference set contains 1 or +/// more references. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get referencesets](struct.ReferencesetGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReferenceSet { + /// Free text description of this reference set. + pub description: Option, + /// The URI from which the references were obtained. + #[serde(rename="sourceUri")] + pub source_uri: Option, + /// The IDs of the reference objects that are part of this set. + /// `Reference.md5checksum` must be unique within this set. + #[serde(rename="referenceIds")] + pub reference_ids: Option>, + /// Public id of this reference set, such as `GRCh37`. + #[serde(rename="assemblyId")] + pub assembly_id: Option, + /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally + /// with a version number, for example `NC_000001.11`. + #[serde(rename="sourceAccessions")] + pub source_accessions: Option>, + /// Order-independent MD5 checksum which identifies this reference set. The + /// checksum is computed by sorting all lower case hexidecimal string + /// `reference.md5checksum` (for all reference in this set) in + /// ascending lexicographic order, concatenating, and taking the MD5 of that + /// value. The resulting value is represented in lower case hexadecimal format. + pub md5checksum: Option, + /// The server-generated reference set ID, unique across all reference sets. + pub id: Option, + /// ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human) + /// indicating the species which this reference set is intended to model. Note + /// that contained references may specify a different `ncbiTaxonId`, as + /// assemblies may contain reference sequences which do not belong to the + /// modeled species, for example EBV in a human reference genome. + #[serde(rename="ncbiTaxonId")] + pub ncbi_taxon_id: Option, +} + +impl Resource for ReferenceSet {} +impl ResponseResult for ReferenceSet {} + + /// A read alignment describes a linear alignment of a string of DNA to a /// reference sequence, in addition to metadata /// about the fragment (the molecule of DNA sequenced) and the read (the bases @@ -2134,6 +2195,9 @@ impl Part for CodingSequence {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchCreateAnnotationsRequest { + /// The annotations to be created. At most 4096 can be specified in a single + /// request. + pub annotations: Option>, /// A unique request ID which enables the server to detect duplicated requests. /// If provided, duplicated requests will result in the same response; if not /// provided, duplicated requests may result in duplicated data. For a given @@ -2143,9 +2207,6 @@ pub struct BatchCreateAnnotationsRequest { /// a possibility, consider using some unique variant of a worker or run ID. #[serde(rename="requestId")] pub request_id: Option, - /// The annotations to be created. At most 4096 can be specified in a single - /// request. - pub annotations: Option>, } impl RequestValue for BatchCreateAnnotationsRequest {} @@ -2175,61 +2236,6 @@ pub struct SearchReferenceSetsResponse { impl ResponseResult for SearchReferenceSetsResponse {} -/// A reference set is a set of references which typically comprise a reference -/// assembly for a species, such as `GRCh38` which is representative -/// of the human genome. A reference set defines a common coordinate space for -/// comparing reference-aligned experimental data. A reference set contains 1 or -/// more references. -/// -/// For more genomics resource definitions, see [Fundamentals of Google -/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get referencesets](struct.ReferencesetGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReferenceSet { - /// Free text description of this reference set. - pub description: Option, - /// The URI from which the references were obtained. - #[serde(rename="sourceUri")] - pub source_uri: Option, - /// The IDs of the reference objects that are part of this set. - /// `Reference.md5checksum` must be unique within this set. - #[serde(rename="referenceIds")] - pub reference_ids: Option>, - /// Public id of this reference set, such as `GRCh37`. - #[serde(rename="assemblyId")] - pub assembly_id: Option, - /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally - /// with a version number, for example `NC_000001.11`. - #[serde(rename="sourceAccessions")] - pub source_accessions: Option>, - /// ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human) - /// indicating the species which this reference set is intended to model. Note - /// that contained references may specify a different `ncbiTaxonId`, as - /// assemblies may contain reference sequences which do not belong to the - /// modeled species, for example EBV in a human reference genome. - #[serde(rename="ncbiTaxonId")] - pub ncbi_taxon_id: Option, - /// The server-generated reference set ID, unique across all reference sets. - pub id: Option, - /// Order-independent MD5 checksum which identifies this reference set. The - /// checksum is computed by sorting all lower case hexidecimal string - /// `reference.md5checksum` (for all reference in this set) in - /// ascending lexicographic order, concatenating, and taking the MD5 of that - /// value. The resulting value is represented in lower case hexadecimal format. - pub md5checksum: Option, -} - -impl Resource for ReferenceSet {} -impl ResponseResult for ReferenceSet {} - - /// A variant set is a collection of call sets and variants. It contains summary /// statistics of those contents. A variant set belongs to a dataset. /// @@ -2281,40 +2287,52 @@ impl Resource for VariantSet {} impl ResponseResult for VariantSet {} -/// The variant data export request. +/// 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*). /// -/// * [export variantsets](struct.VariantsetExportCall.html) (request) +/// * [search annotations](struct.AnnotationSearchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExportVariantSetRequest { - /// Required. The BigQuery dataset to export data to. This dataset must already - /// exist. Note that this is distinct from the Genomics concept of "dataset". - #[serde(rename="bigqueryDataset")] - pub bigquery_dataset: Option, - /// The format for the exported data. - pub format: Option, - /// If provided, only variant call information from the specified call sets - /// will be exported. By default all variant calls are exported. - #[serde(rename="callSetIds")] - pub call_set_ids: Option>, - /// Required. The Google Cloud project ID that owns the destination - /// BigQuery dataset. The caller must have WRITE access to this project. This - /// project will also own the resulting export job. - #[serde(rename="projectId")] - pub project_id: Option, - /// Required. The BigQuery table to export data to. - /// If the table doesn't exist, it will be created. If it already exists, it - /// will be overwritten. - #[serde(rename="bigqueryTable")] - pub bigquery_table: Option, +pub struct SearchAnnotationsRequest { + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The ID of the reference to query. + #[serde(rename="referenceId")] + pub reference_id: Option, + /// The end position of the range on the reference, 0-based exclusive. If + /// referenceId or + /// referenceName + /// must be specified, Defaults to the length of the reference. + pub end: Option, + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 256. The maximum value is 2048. + #[serde(rename="pageSize")] + pub page_size: Option, + /// The start position of the range on the reference, 0-based inclusive. If + /// specified, + /// referenceId or + /// referenceName + /// must be specified. Defaults to 0. + pub start: Option, + /// The name of the reference to query, within the reference set associated + /// with this query. + #[serde(rename="referenceName")] + pub reference_name: Option, + /// Required. The annotation sets to search within. The caller must have + /// `READ` access to these annotation sets. + /// All queried annotation sets must have the same type. + #[serde(rename="annotationSetIds")] + pub annotation_set_ids: Option>, } -impl RequestValue for ExportVariantSetRequest {} +impl RequestValue for SearchAnnotationsRequest {} /// The read search request. @@ -2383,25 +2401,6 @@ pub struct Range { impl Part for Range {} -/// 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*). -/// -/// * [batch create annotations](struct.AnnotationBatchCreateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BatchCreateAnnotationsResponse { - /// The resulting per-annotation entries, ordered consistently with the - /// original request. - pub entries: Option>, -} - -impl ResponseResult for BatchCreateAnnotationsResponse {} - - /// There is no detailed description. /// /// # Activities @@ -2425,14 +2424,14 @@ pub struct SearchAnnotationSetsRequest { /// defaults to 128. The maximum value is 1024. #[serde(rename="pageSize")] pub page_size: Option, - /// If specified, only annotation sets associated with the given reference set - /// are returned. - #[serde(rename="referenceSetId")] - pub reference_set_id: Option, /// Required. The dataset IDs to search within. Caller must have `READ` access /// to these datasets. #[serde(rename="datasetIds")] pub dataset_ids: Option>, + /// If specified, only annotation sets associated with the given reference set + /// are returned. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, /// If specified, only annotation sets that have any of these types are /// returned. pub types: Option>, @@ -2622,13 +2621,13 @@ pub struct AnnotationSet { /// generated, if any. #[serde(rename="sourceUri")] pub source_uri: Option, - /// The type of annotations contained within this set. - #[serde(rename="type")] - pub type_: Option, /// The ID of the reference set that defines the coordinate space for this /// set's annotations. #[serde(rename="referenceSetId")] pub reference_set_id: Option, + /// The type of annotations contained within this set. + #[serde(rename="type")] + pub type_: Option, /// The server-generated annotation set ID, unique across all annotation sets. pub id: Option, /// The dataset to which this annotation set belongs. @@ -2923,7 +2922,7 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the operation collection. + /// * `name` - The name of the operation's parent resource. pub fn list(&self, name: &str) -> OperationListCall<'a, C, A> { OperationListCall { hub: self.hub, @@ -4942,17 +4941,17 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> OperationCancelCall<'a, C, A> @@ -5197,17 +5196,17 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> OperationGetCall<'a, C, A> @@ -5435,7 +5434,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: } - /// The name of the operation collection. + /// The name of the operation's parent resource. /// /// Sets the *name* path property to the given value. /// @@ -5504,17 +5503,17 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> OperationListCall<'a, C, A> @@ -5755,17 +5754,17 @@ impl<'a, C, A> DatasetCreateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DatasetCreateCall<'a, C, A> @@ -6013,17 +6012,17 @@ impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DatasetDeleteCall<'a, C, A> @@ -6299,17 +6298,17 @@ impl<'a, C, A> DatasetUndeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DatasetUndeleteCall<'a, C, A> @@ -6592,17 +6591,17 @@ impl<'a, C, A> DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetSetIamPolicyCall<'a, C, A> @@ -6883,17 +6882,17 @@ impl<'a, C, A> DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetTestIamPermissionCall<'a, C, A> @@ -7136,17 +7135,17 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DatasetGetCall<'a, C, A> @@ -7395,17 +7394,17 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DatasetListCall<'a, C, A> @@ -7688,17 +7687,17 @@ impl<'a, C, A> DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetGetIamPolicyCall<'a, C, A> @@ -7989,17 +7988,17 @@ impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> DatasetPatchCall<'a, C, A> @@ -8243,17 +8242,17 @@ impl<'a, C, A> ReferencesetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReferencesetSearchCall<'a, C, A> @@ -8499,17 +8498,17 @@ impl<'a, C, A> ReferencesetGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReferencesetGetCall<'a, C, A> @@ -8753,17 +8752,17 @@ impl<'a, C, A> CallsetSearchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CallsetSearchCall<'a, C, A> @@ -9054,17 +9053,17 @@ impl<'a, C, A> CallsetPatchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CallsetPatchCall<'a, C, A> @@ -9305,17 +9304,17 @@ impl<'a, C, A> CallsetCreateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CallsetCreateCall<'a, C, A> @@ -9558,17 +9557,17 @@ impl<'a, C, A> CallsetDeleteCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CallsetDeleteCall<'a, C, A> @@ -9811,17 +9810,17 @@ impl<'a, C, A> CallsetGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> CallsetGetCall<'a, C, A> @@ -10081,17 +10080,17 @@ impl<'a, C, A> ReadSearchCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReadSearchCall<'a, C, A> @@ -10371,17 +10370,17 @@ impl<'a, C, A> ReadgroupsetExportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetExportCall<'a, C, A> @@ -10635,17 +10634,17 @@ impl<'a, C, A> ReadgroupsetImportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetImportCall<'a, C, A> @@ -10940,17 +10939,17 @@ impl<'a, C, A> ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReadgroupsetPatchCall<'a, C, A> @@ -11193,17 +11192,17 @@ impl<'a, C, A> ReadgroupsetGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReadgroupsetGetCall<'a, C, A> @@ -11539,17 +11538,17 @@ impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetCoveragebucketListCall<'a, C, A> @@ -11793,17 +11792,17 @@ impl<'a, C, A> ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetDeleteCall<'a, C, A> @@ -12047,17 +12046,17 @@ impl<'a, C, A> ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetSearchCall<'a, C, A> @@ -12356,17 +12355,17 @@ impl<'a, C, A> ReferenceBaseListCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReferenceBaseListCall<'a, C, A> @@ -12610,17 +12609,17 @@ impl<'a, C, A> ReferenceSearchCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReferenceSearchCall<'a, C, A> @@ -12866,17 +12865,17 @@ impl<'a, C, A> ReferenceGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReferenceGetCall<'a, C, A> @@ -13120,17 +13119,17 @@ impl<'a, C, A> VariantSearchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantSearchCall<'a, C, A> @@ -13373,17 +13372,17 @@ impl<'a, C, A> VariantDeleteCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantDeleteCall<'a, C, A> @@ -13626,17 +13625,17 @@ impl<'a, C, A> VariantGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantGetCall<'a, C, A> @@ -13963,17 +13962,17 @@ impl<'a, C, A> VariantMergeCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantMergeCall<'a, C, A> @@ -14214,17 +14213,17 @@ impl<'a, C, A> VariantCreateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantCreateCall<'a, C, A> @@ -14478,17 +14477,17 @@ impl<'a, C, A> VariantImportCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantImportCall<'a, C, A> @@ -14780,17 +14779,17 @@ impl<'a, C, A> VariantPatchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantPatchCall<'a, C, A> @@ -15078,17 +15077,17 @@ impl<'a, C, A> AnnotationUpdateCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AnnotationUpdateCall<'a, C, A> @@ -15328,17 +15327,17 @@ impl<'a, C, A> AnnotationGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AnnotationGetCall<'a, C, A> @@ -15581,17 +15580,17 @@ impl<'a, C, A> AnnotationSearchCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AnnotationSearchCall<'a, C, A> @@ -15831,17 +15830,17 @@ impl<'a, C, A> AnnotationDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AnnotationDeleteCall<'a, C, A> @@ -16099,17 +16098,17 @@ impl<'a, C, A> AnnotationCreateCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AnnotationCreateCall<'a, C, A> @@ -16359,17 +16358,17 @@ impl<'a, C, A> AnnotationBatchCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationBatchCreateCall<'a, C, A> @@ -16657,17 +16656,17 @@ impl<'a, C, A> AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetUpdateCall<'a, C, A> @@ -16908,17 +16907,17 @@ impl<'a, C, A> AnnotationsetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetSearchCall<'a, C, A> @@ -17164,17 +17163,17 @@ impl<'a, C, A> AnnotationsetCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetCreateCall<'a, C, A> @@ -17414,17 +17413,17 @@ impl<'a, C, A> AnnotationsetDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetDeleteCall<'a, C, A> @@ -17664,17 +17663,17 @@ impl<'a, C, A> AnnotationsetGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AnnotationsetGetCall<'a, C, A> @@ -17919,17 +17918,17 @@ impl<'a, C, A> VariantsetCreateCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantsetCreateCall<'a, C, A> @@ -18173,17 +18172,17 @@ impl<'a, C, A> VariantsetDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantsetDeleteCall<'a, C, A> @@ -18458,17 +18457,17 @@ impl<'a, C, A> VariantsetExportCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantsetExportCall<'a, C, A> @@ -18761,17 +18760,17 @@ impl<'a, C, A> VariantsetPatchCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantsetPatchCall<'a, C, A> @@ -19015,17 +19014,17 @@ impl<'a, C, A> VariantsetSearchCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantsetSearchCall<'a, C, A> @@ -19268,17 +19267,17 @@ impl<'a, C, A> VariantsetGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> VariantsetGetCall<'a, C, A> diff --git a/gen/gmail1-cli/Cargo.toml b/gen/gmail1-cli/Cargo.toml index 29ebf765ef..6440d63973 100644 --- a/gen/gmail1-cli/Cargo.toml +++ b/gen/gmail1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gmail1-cli" -version = "1.0.6+20170510" +version = "1.0.6+20170913" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-gmail1] path = "../gmail1" -version = "1.0.6+20170510" +version = "1.0.6+20170913" diff --git a/gen/gmail1-cli/README.md b/gen/gmail1-cli/README.md index bc39b35f30..de123be1af 100644 --- a/gen/gmail1-cli/README.md +++ b/gen/gmail1-cli/README.md @@ -25,7 +25,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 *20170510*. The CLI is at version *1.0.6*. +This documentation was generated from the *gmail* API at revision *20170913*. The CLI is at version *1.0.6*. ```bash gmail1 [options] diff --git a/gen/gmail1-cli/mkdocs.yml b/gen/gmail1-cli/mkdocs.yml index 3566a3aab1..820f7ee486 100644 --- a/gen/gmail1-cli/mkdocs.yml +++ b/gen/gmail1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gmail v1.0.6+20170510 +site_name: gmail v1.0.6+20170913 site_url: http://byron.github.io/google-apis-rs/google-gmail1-cli site_description: A complete library to interact with gmail (protocol v1) diff --git a/gen/gmail1-cli/src/main.rs b/gen/gmail1-cli/src/main.rs index cc7d2f4c47..1f31aab9a7 100644 --- a/gen/gmail1-cli/src/main.rs +++ b/gen/gmail1-cli/src/main.rs @@ -6247,7 +6247,7 @@ fn main() { let mut app = App::new("gmail1") .author("Sebastian Thiel ") - .version("1.0.6+20170510") + .version("1.0.6+20170913") .about("Access Gmail mailboxes including sending user email.") .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 f841f358ac..58027b9d04 100644 --- a/gen/gmail1/Cargo.toml +++ b/gen/gmail1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gmail1" -version = "1.0.6+20170510" +version = "1.0.6+20170913" 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" homepage = "https://developers.google.com/gmail/api/" -documentation = "https://docs.rs/google-gmail1/1.0.6+20170510" +documentation = "https://docs.rs/google-gmail1/1.0.6+20170913" license = "MIT" keywords = ["gmail", "google", "protocol", "web", "api"] diff --git a/gen/gmail1/README.md b/gen/gmail1/README.md index 5fbdd5b84e..634febacc0 100644 --- a/gen/gmail1/README.md +++ b/gen/gmail1/README.md @@ -5,26 +5,26 @@ 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 *1.0.6+20170510*, where *20170510* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *gmail* crate version *1.0.6+20170913*, where *20170913* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *gmail* *v1* API can be found at the [official documentation site](https://developers.google.com/gmail/api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.Gmail.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.Gmail.html) ... * users - * [*drafts create*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserGetProfileCall.html), [*history list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageBatchModifyCall.html), [*messages delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageUntrashCall.html), [*settings filters create*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingFilterCreateCall.html), [*settings filters delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingFilterDeleteCall.html), [*settings filters get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingFilterGetCall.html), [*settings filters list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingGetImapCall.html), [*settings get pop*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingGetPopCall.html), [*settings get vacation*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingGetVacationCall.html), [*settings send as create*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendACreateCall.html), [*settings send as delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendADeleteCall.html), [*settings send as get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendAGetCall.html), [*settings send as list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendAListCall.html), [*settings send as patch*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendAPatchCall.html), [*settings send as smime info delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendASmimeInfoDeleteCall.html), [*settings send as smime info get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendASmimeInfoGetCall.html), [*settings send as smime info insert*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendASmimeInfoInsertCall.html), [*settings send as smime info list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendASmimeInfoListCall.html), [*settings send as smime info set default*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendASmimeInfoSetDefaultCall.html), [*settings send as update*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingUpdateImapCall.html), [*settings update pop*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingUpdatePopCall.html), [*settings update vacation*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserSettingUpdateVacationCall.html), [*stop*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserStopCall.html), [*threads delete*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserThreadTrashCall.html), [*threads untrash*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserThreadUntrashCall.html) and [*watch*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserWatchCall.html) + * [*drafts create*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserGetProfileCall.html), [*history list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageBatchModifyCall.html), [*messages delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageUntrashCall.html), [*settings filters create*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingFilterCreateCall.html), [*settings filters delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingFilterDeleteCall.html), [*settings filters get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingFilterGetCall.html), [*settings filters list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingGetImapCall.html), [*settings get pop*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingGetPopCall.html), [*settings get vacation*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingGetVacationCall.html), [*settings send as create*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendACreateCall.html), [*settings send as delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendADeleteCall.html), [*settings send as get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendAGetCall.html), [*settings send as list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendAListCall.html), [*settings send as patch*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendAPatchCall.html), [*settings send as smime info delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendASmimeInfoDeleteCall.html), [*settings send as smime info get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendASmimeInfoGetCall.html), [*settings send as smime info insert*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendASmimeInfoInsertCall.html), [*settings send as smime info list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendASmimeInfoListCall.html), [*settings send as smime info set default*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendASmimeInfoSetDefaultCall.html), [*settings send as update*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingUpdateImapCall.html), [*settings update pop*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingUpdatePopCall.html), [*settings update vacation*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserSettingUpdateVacationCall.html), [*stop*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserStopCall.html), [*threads delete*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserThreadTrashCall.html), [*threads untrash*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserThreadUntrashCall.html) and [*watch*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserWatchCall.html) Upload supported by ... -* [*messages import users*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageImportCall.html) -* [*drafts create users*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftCreateCall.html) -* [*drafts send users*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftSendCall.html) -* [*messages send users*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageSendCall.html) -* [*drafts update users*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserDraftUpdateCall.html) -* [*messages insert users*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.UserMessageInsertCall.html) +* [*messages import users*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageImportCall.html) +* [*drafts create users*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftCreateCall.html) +* [*drafts send users*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftSendCall.html) +* [*messages send users*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageSendCall.html) +* [*drafts update users*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserDraftUpdateCall.html) +* [*messages insert users*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.UserMessageInsertCall.html) @@ -32,17 +32,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/struct.Gmail.html)** +* **[Hub](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/struct.Gmail.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.Part.html)** + * **[Parts](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -143,17 +143,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/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")`. @@ -163,29 +163,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/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](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/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](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/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](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/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](https://docs.rs/google-gmail1/1.0.6+20170510/google_gmail1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/gmail1/src/lib.rs b/gen/gmail1/src/lib.rs index 997cb22d85..0331af4a05 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 *1.0.6+20170510*, where *20170510* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *gmail* crate version *1.0.6+20170913*, where *20170913* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *gmail* *v1* API can be found at the //! [official documentation site](https://developers.google.com/gmail/api/). @@ -265,7 +265,7 @@ pub enum Scope { /// Manage mailbox labels Label, - /// View your emails messages and settings + /// View your email messages and settings Readonly, /// Insert mail into your mailbox diff --git a/gen/groupsmigration1-cli/Cargo.toml b/gen/groupsmigration1-cli/Cargo.toml index b44c56d98e..03c4975ce6 100644 --- a/gen/groupsmigration1-cli/Cargo.toml +++ b/gen/groupsmigration1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupsmigration1-cli" -version = "1.0.6+20140416" +version = "1.0.6+20170607" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-groupsmigration1] path = "../groupsmigration1" -version = "1.0.6+20140416" +version = "1.0.6+20170607" diff --git a/gen/groupsmigration1-cli/README.md b/gen/groupsmigration1-cli/README.md index 33101f7f0e..2fc183298e 100644 --- a/gen/groupsmigration1-cli/README.md +++ b/gen/groupsmigration1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Groups Migration* API at revision *20140416*. The CLI is at version *1.0.6*. +This documentation was generated from the *Groups Migration* API at revision *20170607*. The CLI is at version *1.0.6*. ```bash groupsmigration1 [options] diff --git a/gen/groupsmigration1-cli/mkdocs.yml b/gen/groupsmigration1-cli/mkdocs.yml index 1c9d3e4279..3040b586a0 100644 --- a/gen/groupsmigration1-cli/mkdocs.yml +++ b/gen/groupsmigration1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Groups Migration v1.0.6+20140416 +site_name: Groups Migration v1.0.6+20170607 site_url: http://byron.github.io/google-apis-rs/google-groupsmigration1-cli site_description: A complete library to interact with Groups Migration (protocol v1) diff --git a/gen/groupsmigration1-cli/src/main.rs b/gen/groupsmigration1-cli/src/main.rs index d7449153dd..e91717eb7b 100644 --- a/gen/groupsmigration1-cli/src/main.rs +++ b/gen/groupsmigration1-cli/src/main.rs @@ -236,7 +236,7 @@ fn main() { let mut app = App::new("groupsmigration1") .author("Sebastian Thiel ") - .version("1.0.6+20140416") + .version("1.0.6+20170607") .about("Groups Migration Api.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_groupsmigration1_cli") .arg(Arg::with_name("url") diff --git a/gen/groupsmigration1/Cargo.toml b/gen/groupsmigration1/Cargo.toml index b07fff457c..a0bb49d2d8 100644 --- a/gen/groupsmigration1/Cargo.toml +++ b/gen/groupsmigration1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-groupsmigration1" -version = "1.0.6+20140416" +version = "1.0.6+20170607" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1" homepage = "https://developers.google.com/google-apps/groups-migration/" -documentation = "https://docs.rs/google-groupsmigration1/1.0.6+20140416" +documentation = "https://docs.rs/google-groupsmigration1/1.0.6+20170607" license = "MIT" keywords = ["groupsmigration", "google", "protocol", "web", "api"] diff --git a/gen/groupsmigration1/README.md b/gen/groupsmigration1/README.md index c355040246..e252d9cb96 100644 --- a/gen/groupsmigration1/README.md +++ b/gen/groupsmigration1/README.md @@ -5,21 +5,21 @@ DO NOT EDIT ! --> The `google-groupsmigration1` library allows access to all features of the *Google Groups Migration* service. -This documentation was generated from *Groups Migration* crate version *1.0.6+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Groups Migration* crate version *1.0.6+20170607*, where *20170607* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Groups Migration* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-migration/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/struct.GroupsMigration.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/struct.GroupsMigration.html) ... * archive - * [*insert*](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/struct.ArchiveInsertCall.html) + * [*insert*](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/struct.ArchiveInsertCall.html) Upload supported by ... -* [*insert archive*](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/struct.ArchiveInsertCall.html) +* [*insert archive*](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/struct.ArchiveInsertCall.html) @@ -27,17 +27,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/struct.GroupsMigration.html)** +* **[Hub](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/struct.GroupsMigration.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.Part.html)** + * **[Parts](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -121,17 +121,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/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")`. @@ -141,29 +141,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/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](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/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](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/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](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/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](https://docs.rs/google-groupsmigration1/1.0.6+20140416/google_groupsmigration1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-groupsmigration1/1.0.6+20170607/google_groupsmigration1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/groupsmigration1/src/lib.rs b/gen/groupsmigration1/src/lib.rs index f32f2a8174..e4c3fc1c03 100644 --- a/gen/groupsmigration1/src/lib.rs +++ b/gen/groupsmigration1/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 *Groups Migration* crate version *1.0.6+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Groups Migration* crate version *1.0.6+20170607*, where *20170607* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Groups Migration* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-migration/). diff --git a/gen/groupssettings1-cli/Cargo.toml b/gen/groupssettings1-cli/Cargo.toml index 032779f367..0661dce3c3 100644 --- a/gen/groupssettings1-cli/Cargo.toml +++ b/gen/groupssettings1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupssettings1-cli" -version = "1.0.6+20160525" +version = "1.0.6+20170607" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-groupssettings1] path = "../groupssettings1" -version = "1.0.6+20160525" +version = "1.0.6+20170607" diff --git a/gen/groupssettings1-cli/README.md b/gen/groupssettings1-cli/README.md index d5828f7a8a..71468f74d8 100644 --- a/gen/groupssettings1-cli/README.md +++ b/gen/groupssettings1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *groupssettings* API at revision *20160525*. The CLI is at version *1.0.6*. +This documentation was generated from the *groupssettings* API at revision *20170607*. The CLI is at version *1.0.6*. ```bash groupssettings1 [options] diff --git a/gen/groupssettings1-cli/mkdocs.yml b/gen/groupssettings1-cli/mkdocs.yml index 89cfda877b..dbf512e140 100644 --- a/gen/groupssettings1-cli/mkdocs.yml +++ b/gen/groupssettings1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: groupssettings v1.0.6+20160525 +site_name: groupssettings v1.0.6+20170607 site_url: http://byron.github.io/google-apis-rs/google-groupssettings1-cli site_description: A complete library to interact with groupssettings (protocol v1) diff --git a/gen/groupssettings1-cli/src/main.rs b/gen/groupssettings1-cli/src/main.rs index ec8db6cc9c..653aabed6f 100644 --- a/gen/groupssettings1-cli/src/main.rs +++ b/gen/groupssettings1-cli/src/main.rs @@ -517,7 +517,7 @@ fn main() { let mut app = App::new("groupssettings1") .author("Sebastian Thiel ") - .version("1.0.6+20160525") + .version("1.0.6+20170607") .about("Lets you manage permission levels and related settings of a group.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_groupssettings1_cli") .arg(Arg::with_name("url") diff --git a/gen/groupssettings1/Cargo.toml b/gen/groupssettings1/Cargo.toml index f24a6a2ea9..ec02c9f85c 100644 --- a/gen/groupssettings1/Cargo.toml +++ b/gen/groupssettings1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-groupssettings1" -version = "1.0.6+20160525" +version = "1.0.6+20170607" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1" homepage = "https://developers.google.com/google-apps/groups-settings/get_started" -documentation = "https://docs.rs/google-groupssettings1/1.0.6+20160525" +documentation = "https://docs.rs/google-groupssettings1/1.0.6+20170607" license = "MIT" keywords = ["groupssettings", "google", "protocol", "web", "api"] diff --git a/gen/groupssettings1/README.md b/gen/groupssettings1/README.md index 77e5246bda..cc8fe39ac0 100644 --- a/gen/groupssettings1/README.md +++ b/gen/groupssettings1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-groupssettings1` library allows access to all features of the *Google groupssettings* service. -This documentation was generated from *groupssettings* crate version *1.0.6+20160525*, where *20160525* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *groupssettings* crate version *1.0.6+20170607*, where *20170607* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *groupssettings* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/struct.Groupssettings.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/struct.Groupssettings.html) ... * groups - * [*get*](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/struct.GroupGetCall.html), [*patch*](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/struct.GroupUpdateCall.html) + * [*get*](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/struct.GroupGetCall.html), [*patch*](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/struct.GroupUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/struct.Groupssettings.html)** +* **[Hub](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/struct.Groupssettings.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.Part.html)** + * **[Parts](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/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")`. @@ -144,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/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](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/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](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/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](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/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](https://docs.rs/google-groupssettings1/1.0.6+20160525/google_groupssettings1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-groupssettings1/1.0.6+20170607/google_groupssettings1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/groupssettings1/src/lib.rs b/gen/groupssettings1/src/lib.rs index b0f20afe38..49eeafd4aa 100644 --- a/gen/groupssettings1/src/lib.rs +++ b/gen/groupssettings1/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 *groupssettings* crate version *1.0.6+20160525*, where *20160525* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *groupssettings* crate version *1.0.6+20170607*, where *20170607* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *groupssettings* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). @@ -406,7 +406,7 @@ pub struct Groups { /// Permissions to add members. Possible values are: ALL_MANAGERS_CAN_ADD ALL_MEMBERS_CAN_ADD NONE_CAN_ADD #[serde(rename="whoCanAdd")] pub who_can_add: Option, - /// Permissions to post messages to the group. Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST + /// Permissions to post messages to the group. Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST ALL_OWNERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST #[serde(rename="whoCanPostMessage")] pub who_can_post_message: Option, /// Primary language for the group. diff --git a/gen/iam1-cli/Cargo.toml b/gen/iam1-cli/Cargo.toml index 81ea7eb6d3..e8764f39d6 100644 --- a/gen/iam1-cli/Cargo.toml +++ b/gen/iam1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-iam1-cli" -version = "1.0.6+20170515" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with iam (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iam1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-iam1] path = "../iam1" -version = "1.0.6+20170515" +version = "1.0.6+20170919" diff --git a/gen/iam1-cli/README.md b/gen/iam1-cli/README.md index f321f3cce9..ccc85221cd 100644 --- a/gen/iam1-cli/README.md +++ b/gen/iam1-cli/README.md @@ -25,11 +25,26 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *iam* API at revision *20170515*. The CLI is at version *1.0.6*. +This documentation was generated from the *iam* API at revision *20170919*. The CLI is at version *1.0.6*. ```bash iam1 [options] + organizations + roles-create (-r )... [-p ]... [-o ] + roles-delete [-p ]... [-o ] + roles-get [-p ]... [-o ] + roles-list [-p ]... [-o ] + roles-patch (-r )... [-p ]... [-o ] + roles-undelete (-r )... [-p ]... [-o ] + permissions + query-testable-permissions (-r )... [-p ]... [-o ] projects + roles-create (-r )... [-p ]... [-o ] + roles-delete [-p ]... [-o ] + roles-get [-p ]... [-o ] + roles-list [-p ]... [-o ] + roles-patch (-r )... [-p ]... [-o ] + roles-undelete (-r )... [-p ]... [-o ] service-accounts-create (-r )... [-p ]... [-o ] service-accounts-delete [-p ]... [-o ] service-accounts-get [-p ]... [-o ] @@ -45,6 +60,8 @@ iam1 [options] service-accounts-test-iam-permissions (-r )... [-p ]... [-o ] service-accounts-update (-r )... [-p ]... [-o ] roles + get [-p ]... [-o ] + list [-p ]... [-o ] query-grantable-roles (-r )... [-p ]... [-o ] iam1 --help diff --git a/gen/iam1-cli/mkdocs.yml b/gen/iam1-cli/mkdocs.yml index d6b32a183d..328607f82b 100644 --- a/gen/iam1-cli/mkdocs.yml +++ b/gen/iam1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: iam v1.0.6+20170515 +site_name: iam v1.0.6+20170919 site_url: http://byron.github.io/google-apis-rs/google-iam1-cli site_description: A complete library to interact with iam (protocol v1) @@ -9,6 +9,19 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['organizations_roles-create.md', 'Organizations', 'Roles Create'] +- ['organizations_roles-delete.md', 'Organizations', 'Roles Delete'] +- ['organizations_roles-get.md', 'Organizations', 'Roles Get'] +- ['organizations_roles-list.md', 'Organizations', 'Roles List'] +- ['organizations_roles-patch.md', 'Organizations', 'Roles Patch'] +- ['organizations_roles-undelete.md', 'Organizations', 'Roles Undelete'] +- ['permissions_query-testable-permissions.md', 'Permissions', 'Query Testable Permissions'] +- ['projects_roles-create.md', 'Projects', 'Roles Create'] +- ['projects_roles-delete.md', 'Projects', 'Roles Delete'] +- ['projects_roles-get.md', 'Projects', 'Roles Get'] +- ['projects_roles-list.md', 'Projects', 'Roles List'] +- ['projects_roles-patch.md', 'Projects', 'Roles Patch'] +- ['projects_roles-undelete.md', 'Projects', 'Roles Undelete'] - ['projects_service-accounts-create.md', 'Projects', 'Service Accounts Create'] - ['projects_service-accounts-delete.md', 'Projects', 'Service Accounts Delete'] - ['projects_service-accounts-get.md', 'Projects', 'Service Accounts Get'] @@ -23,6 +36,8 @@ pages: - ['projects_service-accounts-sign-jwt.md', 'Projects', 'Service Accounts Sign Jwt'] - ['projects_service-accounts-test-iam-permissions.md', 'Projects', 'Service Accounts Test Iam Permissions'] - ['projects_service-accounts-update.md', 'Projects', 'Service Accounts Update'] +- ['roles_get.md', 'Roles', 'Get'] +- ['roles_list.md', 'Roles', 'List'] - ['roles_query-grantable-roles.md', 'Roles', 'Query Grantable Roles'] theme: readthedocs diff --git a/gen/iam1-cli/src/main.rs b/gen/iam1-cli/src/main.rs index ce34a7cfa9..c7e5946716 100644 --- a/gen/iam1-cli/src/main.rs +++ b/gen/iam1-cli/src/main.rs @@ -46,6 +46,983 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _organizations_roles_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "role-id" => Some(("roleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.description" => Some(("role.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.title" => Some(("role.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.deleted" => Some(("role.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "role.etag" => Some(("role.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.included-permissions" => Some(("role.includedPermissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "role.stage" => Some(("role.stage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.name" => Some(("role.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["deleted", "description", "etag", "included-permissions", "name", "role", "role-id", "stage", "title"]); + 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::CreateRoleRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().roles_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_roles_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().roles_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "etag" => { + call = call.etag(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(["etag"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_roles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().roles_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_roles_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().roles_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "show-deleted" => { + call = call.show_deleted(arg_from_str(value.unwrap_or("false"), err, "show-deleted", "boolean")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["show-deleted", "page-size", "page-token", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_roles_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "included-permissions" => Some(("includedPermissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "stage" => Some(("stage", 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!["deleted", "description", "etag", "included-permissions", "name", "stage", "title"]); + 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::Role = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().roles_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_roles_undelete(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag"]); + 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::UndeleteRoleRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().roles_undelete(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _permissions_query_testable_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "full-resource-name" => Some(("fullResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["full-resource-name", "page-size", "page-token"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::QueryTestablePermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.permissions().query_testable_permissions(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_roles_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "role-id" => Some(("roleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.description" => Some(("role.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.title" => Some(("role.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.deleted" => Some(("role.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "role.etag" => Some(("role.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.included-permissions" => Some(("role.includedPermissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "role.stage" => Some(("role.stage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role.name" => Some(("role.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["deleted", "description", "etag", "included-permissions", "name", "role", "role-id", "stage", "title"]); + 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::CreateRoleRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().roles_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_roles_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().roles_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "etag" => { + call = call.etag(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(["etag"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_roles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().roles_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_roles_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().roles_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "show-deleted" => { + call = call.show_deleted(arg_from_str(value.unwrap_or("false"), err, "show-deleted", "boolean")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["show-deleted", "page-size", "page-token", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_roles_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "included-permissions" => Some(("includedPermissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "stage" => Some(("stage", 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!["deleted", "description", "etag", "included-permissions", "name", "stage", "title"]); + 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::Role = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().roles_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_roles_undelete(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag"]); + 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::UndeleteRoleRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().roles_undelete(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_service_accounts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -317,11 +1294,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "private-key-type" => Some(("privateKeyType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-public-key-data" => Some(("includePublicKeyData", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "key-algorithm" => Some(("keyAlgorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "private-key-type" => Some(("privateKeyType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["include-public-key-data", "key-algorithm", "private-key-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["key-algorithm", "private-key-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1036,6 +2012,126 @@ impl<'n> Engine<'n> { } } + fn _roles_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.roles().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _roles_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.roles().list(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "show-deleted" => { + call = call.show_deleted(arg_from_str(value.unwrap_or("false"), err, "show-deleted", "boolean")); + }, + "parent" => { + call = call.parent(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["show-deleted", "page-token", "page-size", "parent", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _roles_query_grantable_roles(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1062,8 +2158,9 @@ impl<'n> Engine<'n> { "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "full-resource-name" => Some(("fullResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "view" => Some(("view", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["full-resource-name", "page-size", "page-token"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["full-resource-name", "page-size", "page-token", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1128,8 +2225,63 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("organizations", Some(opt)) => { + match opt.subcommand() { + ("roles-create", Some(opt)) => { + call_result = self._organizations_roles_create(opt, dry_run, &mut err); + }, + ("roles-delete", Some(opt)) => { + call_result = self._organizations_roles_delete(opt, dry_run, &mut err); + }, + ("roles-get", Some(opt)) => { + call_result = self._organizations_roles_get(opt, dry_run, &mut err); + }, + ("roles-list", Some(opt)) => { + call_result = self._organizations_roles_list(opt, dry_run, &mut err); + }, + ("roles-patch", Some(opt)) => { + call_result = self._organizations_roles_patch(opt, dry_run, &mut err); + }, + ("roles-undelete", Some(opt)) => { + call_result = self._organizations_roles_undelete(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("organizations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("permissions", Some(opt)) => { + match opt.subcommand() { + ("query-testable-permissions", Some(opt)) => { + call_result = self._permissions_query_testable_permissions(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("permissions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("projects", Some(opt)) => { match opt.subcommand() { + ("roles-create", Some(opt)) => { + call_result = self._projects_roles_create(opt, dry_run, &mut err); + }, + ("roles-delete", Some(opt)) => { + call_result = self._projects_roles_delete(opt, dry_run, &mut err); + }, + ("roles-get", Some(opt)) => { + call_result = self._projects_roles_get(opt, dry_run, &mut err); + }, + ("roles-list", Some(opt)) => { + call_result = self._projects_roles_list(opt, dry_run, &mut err); + }, + ("roles-patch", Some(opt)) => { + call_result = self._projects_roles_patch(opt, dry_run, &mut err); + }, + ("roles-undelete", Some(opt)) => { + call_result = self._projects_roles_undelete(opt, dry_run, &mut err); + }, ("service-accounts-create", Some(opt)) => { call_result = self._projects_service_accounts_create(opt, dry_run, &mut err); }, @@ -1180,6 +2332,12 @@ impl<'n> Engine<'n> { }, ("roles", Some(opt)) => { match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._roles_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._roles_list(opt, dry_run, &mut err); + }, ("query-grantable-roles", Some(opt)) => { call_result = self._roles_query_grantable_roles(opt, dry_run, &mut err); }, @@ -1275,7 +2433,378 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'service-accounts-create', 'service-accounts-delete', 'service-accounts-get', 'service-accounts-get-iam-policy', 'service-accounts-keys-create', 'service-accounts-keys-delete', 'service-accounts-keys-get', 'service-accounts-keys-list', 'service-accounts-list', 'service-accounts-set-iam-policy', 'service-accounts-sign-blob', 'service-accounts-sign-jwt', 'service-accounts-test-iam-permissions' and 'service-accounts-update'", vec![ + ("organizations", "methods: 'roles-create', 'roles-delete', 'roles-get', 'roles-list', 'roles-patch' and 'roles-undelete'", vec![ + ("roles-create", + Some(r##"Creates a new Role."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/organizations_roles-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The resource name of the parent resource in one of the following formats: + `organizations/{ORGANIZATION_ID}` + `projects/{PROJECT_ID}`"##), + 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)), + ]), + ("roles-delete", + Some(r##"Soft deletes a role. The role is suspended and cannot be used to create new + IAM Policy Bindings. + The Role will not be included in `ListRoles()` unless `show_deleted` is set + in the `ListRolesRequest`. The Role contains the deleted boolean set. + Existing Bindings remains, but are inactive. The Role can be undeleted + within 7 days. After 7 days the Role is deleted and all Bindings associated + with the role are removed."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/organizations_roles-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ("roles-get", + Some(r##"Gets a Role definition."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/organizations_roles-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `roles/{ROLE_NAME}` + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ("roles-list", + Some(r##"Lists the Roles defined on a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/organizations_roles-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The resource name of the parent resource in one of the following formats: + `` (empty string) -- this refers to curated roles. + `organizations/{ORGANIZATION_ID}` + `projects/{PROJECT_ID}`"##), + 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)), + ]), + ("roles-patch", + Some(r##"Updates a Role definition."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/organizations_roles-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `roles/{ROLE_NAME}` + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ("roles-undelete", + Some(r##"Undelete a Role, bringing it back in its previous state."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/organizations_roles-undelete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ]), + + ("permissions", "methods: 'query-testable-permissions'", vec![ + ("query-testable-permissions", + Some(r##"Lists the permissions testable on a resource. + A permission is testable if it can be tested for an identity on a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/permissions_query-testable-permissions", + 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)), + ]), + ]), + + ("projects", "methods: 'roles-create', 'roles-delete', 'roles-get', 'roles-list', 'roles-patch', 'roles-undelete', 'service-accounts-create', 'service-accounts-delete', 'service-accounts-get', 'service-accounts-get-iam-policy', 'service-accounts-keys-create', 'service-accounts-keys-delete', 'service-accounts-keys-get', 'service-accounts-keys-list', 'service-accounts-list', 'service-accounts-set-iam-policy', 'service-accounts-sign-blob', 'service-accounts-sign-jwt', 'service-accounts-test-iam-permissions' and 'service-accounts-update'", vec![ + ("roles-create", + Some(r##"Creates a new Role."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The resource name of the parent resource in one of the following formats: + `organizations/{ORGANIZATION_ID}` + `projects/{PROJECT_ID}`"##), + 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)), + ]), + ("roles-delete", + Some(r##"Soft deletes a role. The role is suspended and cannot be used to create new + IAM Policy Bindings. + The Role will not be included in `ListRoles()` unless `show_deleted` is set + in the `ListRolesRequest`. The Role contains the deleted boolean set. + Existing Bindings remains, but are inactive. The Role can be undeleted + within 7 days. After 7 days the Role is deleted and all Bindings associated + with the role are removed."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ("roles-get", + Some(r##"Gets a Role definition."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `roles/{ROLE_NAME}` + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ("roles-list", + Some(r##"Lists the Roles defined on a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The resource name of the parent resource in one of the following formats: + `` (empty string) -- this refers to curated roles. + `organizations/{ORGANIZATION_ID}` + `projects/{PROJECT_ID}`"##), + 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)), + ]), + ("roles-patch", + Some(r##"Updates a Role definition."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `roles/{ROLE_NAME}` + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), + ("roles-undelete", + Some(r##"Undelete a Role, bringing it back in its previous state."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-undelete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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)), + ]), ("service-accounts-create", Some(r##"Creates a ServiceAccount and returns it."##), @@ -1689,7 +3218,48 @@ fn main() { ]), ]), - ("roles", "methods: 'query-grantable-roles'", vec![ + ("roles", "methods: 'get', 'list' and 'query-grantable-roles'", vec![ + ("get", + Some(r##"Gets a Role definition."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/roles_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the role in one of the following formats: + `roles/{ROLE_NAME}` + `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + `projects/{PROJECT_ID}/roles/{ROLE_NAME}`"##), + 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 the Roles defined on a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/roles_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)), + ]), ("query-grantable-roles", Some(r##"Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy @@ -1720,7 +3290,7 @@ fn main() { let mut app = App::new("iam1") .author("Sebastian Thiel ") - .version("1.0.6+20170515") + .version("1.0.6+20170919") .about("Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_iam1_cli") .arg(Arg::with_name("url") diff --git a/gen/iam1/Cargo.toml b/gen/iam1/Cargo.toml index aee6517c06..552b1595c7 100644 --- a/gen/iam1/Cargo.toml +++ b/gen/iam1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iam1" -version = "1.0.6+20170515" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with iam (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iam1" homepage = "https://cloud.google.com/iam/" -documentation = "https://docs.rs/google-iam1/1.0.6+20170515" +documentation = "https://docs.rs/google-iam1/1.0.6+20170919" license = "MIT" keywords = ["iam", "google", "protocol", "web", "api"] diff --git a/gen/iam1/README.md b/gen/iam1/README.md index db231b9bc7..94e9457ab5 100644 --- a/gen/iam1/README.md +++ b/gen/iam1/README.md @@ -5,18 +5,22 @@ DO NOT EDIT ! --> The `google-iam1` library allows access to all features of the *Google iam* service. -This documentation was generated from *iam* crate version *1.0.6+20170515*, where *20170515* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *iam* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *iam* *v1* API can be found at the [official documentation site](https://cloud.google.com/iam/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.Iam.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.Iam.html) ... +* organizations + * [*roles create*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.OrganizationRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.OrganizationRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.OrganizationRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.OrganizationRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.OrganizationRolePatchCall.html) and [*roles undelete*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.OrganizationRoleUndeleteCall.html) +* [permissions](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.Permission.html) + * [*query testable permissions*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.PermissionQueryTestablePermissionCall.html) * projects - * [*service accounts create*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.ProjectServiceAccountUpdateCall.html) -* [roles](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.Role.html) - * [*query grantable roles*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.RoleQueryGrantableRoleCall.html) + * [*roles create*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectRolePatchCall.html), [*roles undelete*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectRoleUndeleteCall.html), [*service accounts create*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.ProjectServiceAccountUpdateCall.html) +* [roles](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.Role.html) + * [*get*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.RoleGetCall.html), [*list*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.RoleListCall.html) and [*query grantable roles*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.RoleQueryGrantableRoleCall.html) @@ -25,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/struct.Iam.html)** +* **[Hub](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/struct.Iam.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -49,9 +53,19 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().service_accounts_update(...).doit() -let r = hub.projects().service_accounts_get(...).doit() -let r = hub.projects().service_accounts_create(...).doit() +let r = hub.organizations().roles_get(...).doit() +let r = hub.projects().roles_patch(...).doit() +let r = hub.roles().list(...).doit() +let r = hub.organizations().roles_delete(...).doit() +let r = hub.projects().roles_get(...).doit() +let r = hub.roles().get(...).doit() +let r = hub.projects().roles_delete(...).doit() +let r = hub.projects().roles_create(...).doit() +let r = hub.organizations().roles_undelete(...).doit() +let r = hub.organizations().roles_patch(...).doit() +let r = hub.roles().query_grantable_roles(...).doit() +let r = hub.organizations().roles_create(...).doit() +let r = hub.projects().roles_undelete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -77,7 +91,6 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_iam1 as iam1; -use iam1::ServiceAccount; use iam1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -95,15 +108,15 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ServiceAccount::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().service_accounts_update(req, "name") +let result = hub.roles().list() + .view("eirmod") + .show_deleted(true) + .parent("Stet") + .page_token("sed") + .page_size(-85) .doit(); match result { @@ -126,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/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")`. @@ -146,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/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](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/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](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/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](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/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](https://docs.rs/google-iam1/1.0.6+20170515/google_iam1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/iam1/src/lib.rs b/gen/iam1/src/lib.rs index b69e72fa8d..18cf468f3c 100644 --- a/gen/iam1/src/lib.rs +++ b/gen/iam1/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 *iam* crate version *1.0.6+20170515*, where *20170515* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *iam* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *iam* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/iam/). @@ -11,10 +11,14 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.Iam.html) ... //! +//! * organizations +//! * [*roles create*](struct.OrganizationRoleCreateCall.html), [*roles delete*](struct.OrganizationRoleDeleteCall.html), [*roles get*](struct.OrganizationRoleGetCall.html), [*roles list*](struct.OrganizationRoleListCall.html), [*roles patch*](struct.OrganizationRolePatchCall.html) and [*roles undelete*](struct.OrganizationRoleUndeleteCall.html) +//! * [permissions](struct.Permission.html) +//! * [*query testable permissions*](struct.PermissionQueryTestablePermissionCall.html) //! * projects -//! * [*service accounts create*](struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](struct.ProjectServiceAccountUpdateCall.html) +//! * [*roles create*](struct.ProjectRoleCreateCall.html), [*roles delete*](struct.ProjectRoleDeleteCall.html), [*roles get*](struct.ProjectRoleGetCall.html), [*roles list*](struct.ProjectRoleListCall.html), [*roles patch*](struct.ProjectRolePatchCall.html), [*roles undelete*](struct.ProjectRoleUndeleteCall.html), [*service accounts create*](struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](struct.ProjectServiceAccountUpdateCall.html) //! * [roles](struct.Role.html) -//! * [*query grantable roles*](struct.RoleQueryGrantableRoleCall.html) +//! * [*get*](struct.RoleGetCall.html), [*list*](struct.RoleListCall.html) and [*query grantable roles*](struct.RoleQueryGrantableRoleCall.html) //! //! //! @@ -49,9 +53,19 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().service_accounts_update(...).doit() -//! let r = hub.projects().service_accounts_get(...).doit() -//! let r = hub.projects().service_accounts_create(...).doit() +//! let r = hub.organizations().roles_get(...).doit() +//! let r = hub.projects().roles_patch(...).doit() +//! let r = hub.roles().list(...).doit() +//! let r = hub.organizations().roles_delete(...).doit() +//! let r = hub.projects().roles_get(...).doit() +//! let r = hub.roles().get(...).doit() +//! let r = hub.projects().roles_delete(...).doit() +//! let r = hub.projects().roles_create(...).doit() +//! let r = hub.organizations().roles_undelete(...).doit() +//! let r = hub.organizations().roles_patch(...).doit() +//! let r = hub.roles().query_grantable_roles(...).doit() +//! let r = hub.organizations().roles_create(...).doit() +//! let r = hub.projects().roles_undelete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -77,7 +91,6 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_iam1 as iam1; -//! use iam1::ServiceAccount; //! use iam1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -96,15 +109,15 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ServiceAccount::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().service_accounts_update(req, "name") +//! let result = hub.roles().list() +//! .view("dolores") +//! .show_deleted(false) +//! .parent("accusam") +//! .page_token("takimata") +//! .page_size(-70) //! .doit(); //! //! match result { @@ -262,7 +275,6 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_iam1 as iam1; -/// use iam1::ServiceAccount; /// use iam1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -281,15 +293,15 @@ impl Default for Scope { /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ServiceAccount::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().service_accounts_update(req, "name") +/// let result = hub.roles().list() +/// .view("amet.") +/// .show_deleted(false) +/// .parent("labore") +/// .page_token("sea") +/// .page_size(-90) /// .doit(); /// /// match result { @@ -333,6 +345,12 @@ impl<'a, C, A> Iam } } + pub fn organizations(&'a self) -> OrganizationMethods<'a, C, A> { + OrganizationMethods { hub: &self } + } + pub fn permissions(&'a self) -> PermissionMethods<'a, C, A> { + PermissionMethods { hub: &self } + } pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } @@ -411,6 +429,25 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} +/// The request to undelete an existing role. +/// +/// # 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*). +/// +/// * [roles undelete organizations](struct.OrganizationRoleUndeleteCall.html) (request) +/// * [roles undelete projects](struct.ProjectRoleUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UndeleteRoleRequest { + /// Used to perform a consistent read-modify-write. + pub etag: Option, +} + +impl RequestValue for UndeleteRoleRequest {} + + /// The service account keys list response. /// /// # Activities @@ -533,6 +570,59 @@ pub struct QueryGrantableRolesResponse { impl ResponseResult for QueryGrantableRolesResponse {} +/// A request to get permissions which can be tested on a resource. +/// +/// # 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*). +/// +/// * [query testable permissions permissions](struct.PermissionQueryTestablePermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryTestablePermissionsRequest { + /// Optional pagination token returned in an earlier + /// QueryTestablePermissionsRequest. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Required. The full resource name to query from the list of testable + /// permissions. + /// + /// The name follows the Google Cloud Platform resource format. + /// For example, a Cloud Platform project with id `my-project` will be named + /// `//cloudresourcemanager.googleapis.com/projects/my-project`. + #[serde(rename="fullResourceName")] + pub full_resource_name: Option, + /// Optional limit on the number of permissions to include in the response. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for QueryTestablePermissionsRequest {} + + +/// The response containing permissions which can be tested on a resource. +/// +/// # 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*). +/// +/// * [query testable permissions permissions](struct.PermissionQueryTestablePermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryTestablePermissionsResponse { + /// To retrieve the next page of results, set + /// `QueryTestableRolesRequest.page_token` to this value. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The Permissions testable on the requested resource. + pub permissions: Option>, +} + +impl ResponseResult for QueryTestablePermissionsResponse {} + + /// A role in the Identity and Access Management API. /// /// # Activities @@ -540,10 +630,24 @@ impl ResponseResult for QueryGrantableRolesResponse {} /// 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*). /// +/// * [roles get organizations](struct.OrganizationRoleGetCall.html) (response) +/// * [roles patch projects](struct.ProjectRolePatchCall.html) (request|response) +/// * [list roles](struct.RoleListCall.html) (none) +/// * [roles delete organizations](struct.OrganizationRoleDeleteCall.html) (response) +/// * [roles get projects](struct.ProjectRoleGetCall.html) (response) +/// * [get roles](struct.RoleGetCall.html) (response) +/// * [roles delete projects](struct.ProjectRoleDeleteCall.html) (response) +/// * [roles create projects](struct.ProjectRoleCreateCall.html) (response) +/// * [roles undelete organizations](struct.OrganizationRoleUndeleteCall.html) (response) +/// * [roles patch organizations](struct.OrganizationRolePatchCall.html) (request|response) /// * [query grantable roles roles](struct.RoleQueryGrantableRoleCall.html) (none) +/// * [roles create organizations](struct.OrganizationRoleCreateCall.html) (response) +/// * [roles undelete projects](struct.ProjectRoleUndeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Role { + /// Used to perform a consistent read-modify-write. + pub etag: Option, /// Optional. A human-readable description for the role. pub description: Option, /// The name of the role. @@ -557,9 +661,19 @@ pub struct Role { /// Optional. A human-readable title for the role. Typically this /// is limited to 100 UTF-8 bytes. pub title: Option, + /// The current deleted state of the role. This field is read only. + /// It will be ignored in calls to CreateRole and UpdateRole. + pub deleted: Option, + /// The names of the permissions this role grants when bound in an IAM policy. + #[serde(rename="includedPermissions")] + pub included_permissions: Option>, + /// The current launch stage of the role. + pub stage: Option, } +impl RequestValue for Role {} impl Resource for Role {} +impl ResponseResult for Role {} /// The service account sign blob request. @@ -647,7 +761,6 @@ impl ResponseResult for ListServiceAccountsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { /// Associates a list of `members` to a `role`. - /// Multiple `bindings` must not be specified for the same `role`. /// `bindings` with no members will result in an error. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help @@ -693,6 +806,8 @@ pub struct QueryGrantableRolesRequest { /// Optional limit on the number of roles to include in the response. #[serde(rename="pageSize")] pub page_size: Option, + /// no description provided + pub view: Option, } impl RequestValue for QueryGrantableRolesRequest {} @@ -741,6 +856,36 @@ pub struct TestIamPermissionsResponse { impl ResponseResult for TestIamPermissionsResponse {} +/// A permission which can be included by a role. +/// +/// # 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*). +/// +/// * [query testable permissions permissions](struct.PermissionQueryTestablePermissionCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Permission { + /// A brief description of what this Permission is used for. + pub description: Option, + /// The title of this Permission. + pub title: Option, + /// The current launch stage of the permission. + pub stage: Option, + /// This permission can ONLY be used in predefined roles. + #[serde(rename="onlyInPredefinedRoles")] + pub only_in_predefined_roles: Option, + /// The current custom role support level. + #[serde(rename="customRolesSupportLevel")] + pub custom_roles_support_level: Option, + /// The name of this Permission. + pub name: Option, +} + +impl Resource for Permission {} + + /// The service account sign JWT response. /// /// # Activities @@ -830,16 +975,6 @@ impl Part for Binding {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ServiceAccountKey { - /// The private key data. Only provided in `CreateServiceAccountKey` - /// responses. - #[serde(rename="privateKeyData")] - pub private_key_data: Option, - /// The resource name of the service account key in the following format - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. - pub name: Option, - /// Specifies the algorithm (and possibly key size) for the key. - #[serde(rename="keyAlgorithm")] - pub key_algorithm: Option, /// The output format for the private key. /// Only provided in `CreateServiceAccountKey` responses, not /// in `GetServiceAccountKey` or `ListServiceAccountKey` responses. @@ -848,6 +983,21 @@ pub struct ServiceAccountKey { /// user-managed private keys. #[serde(rename="privateKeyType")] pub private_key_type: Option, + /// The resource name of the service account key in the following format + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + pub name: Option, + /// Specifies the algorithm (and possibly key size) for the key. + #[serde(rename="keyAlgorithm")] + pub key_algorithm: Option, + /// The private key data. Only provided in `CreateServiceAccountKey` + /// responses. Make sure to keep the private key data secure because it + /// allows for the assertion of the service account identity. + /// When decoded, the private key data can be used to authenticate with + /// Google API client libraries and with + /// gcloud + /// auth activate-service-account. + #[serde(rename="privateKeyData")] + pub private_key_data: Option, /// The key can be used before this timestamp. #[serde(rename="validBeforeTime")] pub valid_before_time: Option, @@ -862,6 +1012,30 @@ pub struct ServiceAccountKey { impl ResponseResult for ServiceAccountKey {} +/// The response containing the roles defined under a resource. +/// +/// # 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*). +/// +/// * [roles list projects](struct.ProjectRoleListCall.html) (response) +/// * [list roles](struct.RoleListCall.html) (response) +/// * [roles list organizations](struct.OrganizationRoleListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListRolesResponse { + /// To retrieve the next page of results, set + /// `ListRolesRequest.page_token` to this value. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The Roles defined on this resource. + pub roles: Option>, +} + +impl ResponseResult for ListRolesResponse {} + + /// The service account sign blob response. /// /// # Activities @@ -894,18 +1068,15 @@ impl ResponseResult for SignBlobResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateServiceAccountKeyRequest { - /// The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the - /// default output format. - #[serde(rename="privateKeyType")] - pub private_key_type: Option, - /// no description provided - #[serde(rename="includePublicKeyData")] - pub include_public_key_data: Option, /// Which type of key and algorithm to use for the key. /// The default is currently a 2K RSA key. However this may change in the /// future. #[serde(rename="keyAlgorithm")] pub key_algorithm: Option, + /// The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the + /// default output format. + #[serde(rename="privateKeyType")] + pub private_key_type: Option, } impl RequestValue for CreateServiceAccountKeyRequest {} @@ -938,11 +1109,210 @@ pub struct CreateServiceAccountRequest { impl RequestValue for CreateServiceAccountRequest {} +/// The request to create a new role. +/// +/// # 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*). +/// +/// * [roles create organizations](struct.OrganizationRoleCreateCall.html) (request) +/// * [roles create projects](struct.ProjectRoleCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateRoleRequest { + /// The role id to use for this role. + #[serde(rename="roleId")] + pub role_id: Option, + /// The Role resource to create. + pub role: Option, +} + +impl RequestValue for CreateRoleRequest {} + + // ################### // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *organization* resources. +/// It is not used directly, but through the `Iam` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_iam1 as iam1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use iam1::Iam; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `roles_create(...)`, `roles_delete(...)`, `roles_get(...)`, `roles_list(...)`, `roles_patch(...)` and `roles_undelete(...)` +/// // to build up your call. +/// let rb = hub.organizations(); +/// # } +/// ``` +pub struct OrganizationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, +} + +impl<'a, C, A> MethodsBuilder for OrganizationMethods<'a, C, A> {} + +impl<'a, C, A> OrganizationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a Role definition. + /// + /// # Arguments + /// + /// * `name` - The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_get(&self, name: &str) -> OrganizationRoleGetCall<'a, C, A> { + OrganizationRoleGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Undelete a Role, bringing it back in its previous state. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_undelete(&self, request: UndeleteRoleRequest, name: &str) -> OrganizationRoleUndeleteCall<'a, C, A> { + OrganizationRoleUndeleteCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Soft deletes a role. The role is suspended and cannot be used to create new + /// IAM Policy Bindings. + /// The Role will not be included in `ListRoles()` unless `show_deleted` is set + /// in the `ListRolesRequest`. The Role contains the deleted boolean set. + /// Existing Bindings remains, but are inactive. The Role can be undeleted + /// within 7 days. After 7 days the Role is deleted and all Bindings associated + /// with the role are removed. + /// + /// # Arguments + /// + /// * `name` - The resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_delete(&self, name: &str) -> OrganizationRoleDeleteCall<'a, C, A> { + OrganizationRoleDeleteCall { + hub: self.hub, + _name: name.to_string(), + _etag: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new Role. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The resource name of the parent resource in one of the following formats: + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + pub fn roles_create(&self, request: CreateRoleRequest, parent: &str) -> OrganizationRoleCreateCall<'a, C, A> { + OrganizationRoleCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a Role definition. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_patch(&self, request: Role, name: &str) -> OrganizationRolePatchCall<'a, C, A> { + OrganizationRolePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the Roles defined on a resource. + /// + /// # Arguments + /// + /// * `parent` - The resource name of the parent resource in one of the following formats: + /// `` (empty string) -- this refers to curated roles. + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + pub fn roles_list(&self, parent: &str) -> OrganizationRoleListCall<'a, C, A> { + OrganizationRoleListCall { + hub: self.hub, + _parent: parent.to_string(), + _view: Default::default(), + _show_deleted: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *role* resources. /// It is not used directly, but through the `Iam` hub. /// @@ -967,7 +1337,7 @@ impl RequestValue for CreateServiceAccountRequest {} /// ::default(), None); /// let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `query_grantable_roles(...)` +/// // like `get(...)`, `list(...)` and `query_grantable_roles(...)` /// // to build up your call. /// let rb = hub.roles(); /// # } @@ -982,6 +1352,43 @@ impl<'a, C, A> MethodsBuilder for RoleMethods<'a, C, A> {} impl<'a, C, A> RoleMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Gets a Role definition. + /// + /// # Arguments + /// + /// * `name` - The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn get(&self, name: &str) -> RoleGetCall<'a, C, A> { + RoleGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the Roles defined on a resource. + pub fn list(&self) -> RoleListCall<'a, C, A> { + RoleListCall { + hub: self.hub, + _view: Default::default(), + _show_deleted: Default::default(), + _parent: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Queries roles that can be granted on a particular resource. @@ -1028,7 +1435,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `service_accounts_create(...)`, `service_accounts_delete(...)`, `service_accounts_get(...)`, `service_accounts_get_iam_policy(...)`, `service_accounts_keys_create(...)`, `service_accounts_keys_delete(...)`, `service_accounts_keys_get(...)`, `service_accounts_keys_list(...)`, `service_accounts_list(...)`, `service_accounts_set_iam_policy(...)`, `service_accounts_sign_blob(...)`, `service_accounts_sign_jwt(...)`, `service_accounts_test_iam_permissions(...)` and `service_accounts_update(...)` +/// // like `roles_create(...)`, `roles_delete(...)`, `roles_get(...)`, `roles_list(...)`, `roles_patch(...)`, `roles_undelete(...)`, `service_accounts_create(...)`, `service_accounts_delete(...)`, `service_accounts_get(...)`, `service_accounts_get_iam_policy(...)`, `service_accounts_keys_create(...)`, `service_accounts_keys_delete(...)`, `service_accounts_keys_get(...)`, `service_accounts_keys_list(...)`, `service_accounts_list(...)`, `service_accounts_set_iam_policy(...)`, `service_accounts_sign_blob(...)`, `service_accounts_sign_jwt(...)`, `service_accounts_test_iam_permissions(...)` and `service_accounts_update(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1043,49 +1450,6 @@ 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: - /// - /// Lists ServiceAccountKeys. - /// - /// # Arguments - /// - /// * `name` - The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - /// Using `-` as a wildcard for the project, will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. - pub fn service_accounts_keys_list(&self, name: &str) -> ProjectServiceAccountKeyListCall<'a, C, A> { - ProjectServiceAccountKeyListCall { - hub: self.hub, - _name: name.to_string(), - _key_types: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the IAM access control policy for a - /// ServiceAccount. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - pub fn service_accounts_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectServiceAccountSetIamPolicyCall<'a, C, A> { - ProjectServiceAccountSetIamPolicyCall { - 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 a ServiceAccountKey. @@ -1109,19 +1473,55 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a ServiceAccountKey - /// and returns it. + /// Gets a Role definition. + /// + /// # Arguments + /// + /// * `name` - The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_get(&self, name: &str) -> ProjectRoleGetCall<'a, C, A> { + ProjectRoleGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the IAM access control policy for a + /// ServiceAccount. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn service_accounts_get_iam_policy(&self, resource: &str) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> { + ProjectServiceAccountGetIamPolicyCall { + 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: + /// + /// Undelete a Role, bringing it back in its previous state. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - /// Using `-` as a wildcard for the project will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. - pub fn service_accounts_keys_create(&self, request: CreateServiceAccountKeyRequest, name: &str) -> ProjectServiceAccountKeyCreateCall<'a, C, A> { - ProjectServiceAccountKeyCreateCall { + /// * `name` - The resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_undelete(&self, request: UndeleteRoleRequest, name: &str) -> ProjectRoleUndeleteCall<'a, C, A> { + ProjectRoleUndeleteCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -1131,6 +1531,53 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Soft deletes a role. The role is suspended and cannot be used to create new + /// IAM Policy Bindings. + /// The Role will not be included in `ListRoles()` unless `show_deleted` is set + /// in the `ListRolesRequest`. The Role contains the deleted boolean set. + /// Existing Bindings remains, but are inactive. The Role can be undeleted + /// within 7 days. After 7 days the Role is deleted and all Bindings associated + /// with the role are removed. + /// + /// # Arguments + /// + /// * `name` - The resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_delete(&self, name: &str) -> ProjectRoleDeleteCall<'a, C, A> { + ProjectRoleDeleteCall { + hub: self.hub, + _name: name.to_string(), + _etag: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Tests the specified permissions against the IAM access control policy + /// for a ServiceAccount. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn service_accounts_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> { + ProjectServiceAccountTestIamPermissionCall { + 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: /// /// Signs a blob using a service account's system-managed private key. @@ -1156,47 +1603,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a ServiceAccount. - /// - /// Currently, only the following fields are updatable: - /// `display_name` . - /// The `etag` is mandatory. + /// Sets the IAM access control policy for a + /// ServiceAccount. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - /// Requests using `-` as a wildcard for the project will infer the project - /// from the `account` and the `account` value can be the `email` address or - /// the `unique_id` of the service account. - /// In responses the resource name will always be in the format - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - pub fn service_accounts_update(&self, request: ServiceAccount, name: &str) -> ProjectServiceAccountUpdateCall<'a, C, A> { - ProjectServiceAccountUpdateCall { + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn service_accounts_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectServiceAccountSetIamPolicyCall<'a, C, A> { + ProjectServiceAccountSetIamPolicyCall { hub: self.hub, _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists ServiceAccounts for a project. - /// - /// # Arguments - /// - /// * `name` - Required. The resource name of the project associated with the service - /// accounts, such as `projects/my-project-123`. - pub fn service_accounts_list(&self, name: &str) -> ProjectServiceAccountListCall<'a, C, A> { - ProjectServiceAccountListCall { - hub: self.hub, - _name: name.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1224,69 +1643,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets the ServiceAccountKey - /// by key id. - /// - /// # Arguments - /// - /// * `name` - The resource name of the service account key in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. - /// Using `-` as a wildcard for the project will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. - pub fn service_accounts_keys_get(&self, name: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { - ProjectServiceAccountKeyGetCall { - hub: self.hub, - _name: name.to_string(), - _public_key_type: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the IAM access control policy for a - /// ServiceAccount. - /// - /// # Arguments - /// - /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - pub fn service_accounts_get_iam_policy(&self, resource: &str) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> { - ProjectServiceAccountGetIamPolicyCall { - 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: - /// - /// Tests the specified permissions against the IAM access control policy - /// for a ServiceAccount. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// See the operation documentation for the appropriate value for this field. - pub fn service_accounts_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> { - ProjectServiceAccountTestIamPermissionCall { - 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 ServiceAccount @@ -1308,6 +1664,103 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates a Role definition. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + pub fn roles_patch(&self, request: Role, name: &str) -> ProjectRolePatchCall<'a, C, A> { + ProjectRolePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new Role. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The resource name of the parent resource in one of the following formats: + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + pub fn roles_create(&self, request: CreateRoleRequest, parent: &str) -> ProjectRoleCreateCall<'a, C, A> { + ProjectRoleCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the Roles defined on a resource. + /// + /// # Arguments + /// + /// * `parent` - The resource name of the parent resource in one of the following formats: + /// `` (empty string) -- this refers to curated roles. + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + pub fn roles_list(&self, parent: &str) -> ProjectRoleListCall<'a, C, A> { + ProjectRoleListCall { + hub: self.hub, + _parent: parent.to_string(), + _view: Default::default(), + _show_deleted: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a ServiceAccount. + /// + /// Currently, only the following fields are updatable: + /// `display_name` . + /// The `etag` is mandatory. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Requests using `-` as a wildcard for the project will infer the project + /// from the `account` and the `account` value can be the `email` address or + /// the `unique_id` of the service account. + /// In responses the resource name will always be in the format + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + pub fn service_accounts_update(&self, request: ServiceAccount, name: &str) -> ProjectServiceAccountUpdateCall<'a, C, A> { + ProjectServiceAccountUpdateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Signs a JWT using a service account's system-managed private key. @@ -1335,6 +1788,95 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists ServiceAccountKeys. + /// + /// # Arguments + /// + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project, will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + pub fn service_accounts_keys_list(&self, name: &str) -> ProjectServiceAccountKeyListCall<'a, C, A> { + ProjectServiceAccountKeyListCall { + hub: self.hub, + _name: name.to_string(), + _key_types: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a ServiceAccountKey + /// and returns it. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + pub fn service_accounts_keys_create(&self, request: CreateServiceAccountKeyRequest, name: &str) -> ProjectServiceAccountKeyCreateCall<'a, C, A> { + ProjectServiceAccountKeyCreateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists ServiceAccounts for a project. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of the project associated with the service + /// accounts, such as `projects/my-project-123`. + pub fn service_accounts_list(&self, name: &str) -> ProjectServiceAccountListCall<'a, C, A> { + ProjectServiceAccountListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the ServiceAccountKey + /// by key id. + /// + /// # Arguments + /// + /// * `name` - The resource name of the service account key in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + pub fn service_accounts_keys_get(&self, name: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { + ProjectServiceAccountKeyGetCall { + hub: self.hub, + _name: name.to_string(), + _public_key_type: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets a ServiceAccount. @@ -1359,12 +1901,2311 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { +/// A builder providing access to all methods supported on *permission* resources. +/// It is not used directly, but through the `Iam` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_iam1 as iam1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use iam1::Iam; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `query_testable_permissions(...)` +/// // to build up your call. +/// let rb = hub.permissions(); +/// # } +/// ``` +pub struct PermissionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, +} + +impl<'a, C, A> MethodsBuilder for PermissionMethods<'a, C, A> {} + +impl<'a, C, A> PermissionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the permissions testable on a resource. + /// A permission is testable if it can be tested for an identity on a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn query_testable_permissions(&self, request: QueryTestablePermissionsRequest) -> PermissionQueryTestablePermissionCall<'a, C, A> { + PermissionQueryTestablePermissionCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### // CallBuilders ### // ################# +/// Gets a Role definition. +/// +/// A builder for the *roles.get* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().roles_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationRoleGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationRoleGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationRoleGetCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.organizations.roles.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationRoleGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationRoleGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationRoleGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationRoleGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Undelete a Role, bringing it back in its previous state. +/// +/// A builder for the *roles.undelete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::UndeleteRoleRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UndeleteRoleRequest::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.organizations().roles_undelete(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationRoleUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: UndeleteRoleRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationRoleUndeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationRoleUndeleteCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.organizations.roles.undelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:undelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UndeleteRoleRequest) -> OrganizationRoleUndeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationRoleUndeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationRoleUndeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationRoleUndeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationRoleUndeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Soft deletes a role. The role is suspended and cannot be used to create new +/// IAM Policy Bindings. +/// The Role will not be included in `ListRoles()` unless `show_deleted` is set +/// in the `ListRolesRequest`. The Role contains the deleted boolean set. +/// Existing Bindings remains, but are inactive. The Role can be undeleted +/// within 7 days. After 7 days the Role is deleted and all Bindings associated +/// with the role are removed. +/// +/// A builder for the *roles.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().roles_delete("name") +/// .etag("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationRoleDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _etag: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationRoleDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationRoleDeleteCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.organizations.roles.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._etag { + params.push(("etag", value.to_string())); + } + for &field in ["alt", "name", "etag"].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 = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationRoleDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Used to perform a consistent read-modify-write. + /// + /// Sets the *etag* query property to the given value. + pub fn etag(mut self, new_value: &str) -> OrganizationRoleDeleteCall<'a, C, A> { + self._etag = 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) -> OrganizationRoleDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationRoleDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationRoleDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new Role. +/// +/// A builder for the *roles.create* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::CreateRoleRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateRoleRequest::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.organizations().roles_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationRoleCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: CreateRoleRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationRoleCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationRoleCreateCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.organizations.roles.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/roles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateRoleRequest) -> OrganizationRoleCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the parent resource in one of the following formats: + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> OrganizationRoleCreateCall<'a, C, A> { + self._parent = 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) -> OrganizationRoleCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationRoleCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationRoleCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a Role definition. +/// +/// A builder for the *roles.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::Role; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Role::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.organizations().roles_patch(req, "name") +/// .update_mask("justo") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationRolePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: Role, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationRolePatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationRolePatchCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.organizations.roles.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Role) -> OrganizationRolePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationRolePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A mask describing which fields in the Role have changed. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationRolePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationRolePatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationRolePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationRolePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the Roles defined on a resource. +/// +/// A builder for the *roles.list* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().roles_list("parent") +/// .view("et") +/// .show_deleted(true) +/// .page_token("diam") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationRoleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _parent: String, + _view: Option, + _show_deleted: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationRoleListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationRoleListCall<'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, ListRolesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.organizations.roles.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._show_deleted { + params.push(("showDeleted", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "view", "showDeleted", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/roles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 resource name of the parent resource in one of the following formats: + /// `` (empty string) -- this refers to curated roles. + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> OrganizationRoleListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional view for the returned Role objects. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> OrganizationRoleListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// Include Roles that have been deleted. + /// + /// Sets the *show deleted* query property to the given value. + pub fn show_deleted(mut self, new_value: bool) -> OrganizationRoleListCall<'a, C, A> { + self._show_deleted = Some(new_value); + self + } + /// Optional pagination token returned in an earlier ListRolesResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationRoleListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of roles to include in the response. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationRoleListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationRoleListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationRoleListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationRoleListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a Role definition. +/// +/// A builder for the *get* method supported by a *role* resource. +/// It is not used directly, but through a `RoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.roles().get("name") +/// .doit(); +/// # } +/// ``` +pub struct RoleGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RoleGetCall<'a, C, A> {} + +impl<'a, C, A> RoleGetCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.roles.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> RoleGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RoleGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RoleGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RoleGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the Roles defined on a resource. +/// +/// A builder for the *list* method supported by a *role* resource. +/// It is not used directly, but through a `RoleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.roles().list() +/// .view("et") +/// .show_deleted(false) +/// .parent("aliquyam") +/// .page_token("sea") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct RoleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _view: Option, + _show_deleted: Option, + _parent: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RoleListCall<'a, C, A> {} + +impl<'a, C, A> RoleListCall<'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, ListRolesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.roles.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._show_deleted { + params.push(("showDeleted", value.to_string())); + } + if let Some(value) = self._parent { + params.push(("parent", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "view", "showDeleted", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/roles"; + 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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Optional view for the returned Role objects. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> RoleListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// Include Roles that have been deleted. + /// + /// Sets the *show deleted* query property to the given value. + pub fn show_deleted(mut self, new_value: bool) -> RoleListCall<'a, C, A> { + self._show_deleted = Some(new_value); + self + } + /// The resource name of the parent resource in one of the following formats: + /// `` (empty string) -- this refers to curated roles. + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + /// + /// Sets the *parent* query property to the given value. + pub fn parent(mut self, new_value: &str) -> RoleListCall<'a, C, A> { + self._parent = Some(new_value.to_string()); + self + } + /// Optional pagination token returned in an earlier ListRolesResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RoleListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of roles to include in the response. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> RoleListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RoleListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> RoleListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RoleListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Queries roles that can be granted on a particular resource. /// A role is grantable if it can be used as the role in a binding for a policy /// for that resource. @@ -1614,9 +4455,9 @@ impl<'a, C, A> RoleQueryGrantableRoleCall<'a, C, A> where C: BorrowMut RoleQueryGrantableRoleCall<'a, C, A> where C: BorrowMut +pub struct ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Iam, _name: String, - _key_types: Vec, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'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, ListServiceAccountKeysResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -1672,16 +4511,11 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("name", self._name.to_string())); - if self._key_types.len() > 0 { - for f in self._key_types.iter() { - params.push(("keyTypes", f.to_string())); - } - } - for &field in ["alt", "name", "keyTypes"].iter() { + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1693,7 +4527,264 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the service account key in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountKeyDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountKeyDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a Role definition. +/// +/// A builder for the *roles.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().roles_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRoleGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRoleGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectRoleGetCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.roles.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1799,38 +4890,26 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectRoleGetCall<'a, C, A> { self._name = new_value.to_string(); self } - /// Filters the types of keys the user wants to include in the list - /// response. Duplicate key types are not allowed. If no key type - /// is provided, all keys are returned. - /// - /// Append the given value to the *key types* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_key_types(mut self, new_value: &str) -> ProjectServiceAccountKeyListCall<'a, C, A> { - self._key_types.push(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) -> ProjectServiceAccountKeyListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRoleGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1857,7 +4936,7 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectRoleGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1877,7 +4956,1395 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectServiceAccountKeyListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectRoleGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the IAM access control policy for a +/// ServiceAccount. +/// +/// A builder for the *serviceAccounts.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.getIamPolicy", + http_method: hyper::method::Method::Post }); + 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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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(Bearer { 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(d); + 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(d); + 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 the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectServiceAccountGetIamPolicyCall<'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) -> ProjectServiceAccountGetIamPolicyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Undelete a Role, bringing it back in its previous state. +/// +/// A builder for the *roles.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::UndeleteRoleRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UndeleteRoleRequest::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().roles_undelete(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRoleUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: UndeleteRoleRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRoleUndeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectRoleUndeleteCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.roles.undelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:undelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UndeleteRoleRequest) -> ProjectRoleUndeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRoleUndeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRoleUndeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRoleUndeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRoleUndeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Soft deletes a role. The role is suspended and cannot be used to create new +/// IAM Policy Bindings. +/// The Role will not be included in `ListRoles()` unless `show_deleted` is set +/// in the `ListRolesRequest`. The Role contains the deleted boolean set. +/// Existing Bindings remains, but are inactive. The Role can be undeleted +/// within 7 days. After 7 days the Role is deleted and all Bindings associated +/// with the role are removed. +/// +/// A builder for the *roles.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().roles_delete("name") +/// .etag("elitr") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRoleDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _etag: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRoleDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectRoleDeleteCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.roles.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._etag { + params.push(("etag", value.to_string())); + } + for &field in ["alt", "name", "etag"].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 = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the role in one of the following formats: + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRoleDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Used to perform a consistent read-modify-write. + /// + /// Sets the *etag* query property to the given value. + pub fn etag(mut self, new_value: &str) -> ProjectRoleDeleteCall<'a, C, A> { + self._etag = 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) -> ProjectRoleDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRoleDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRoleDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Tests the specified permissions against the IAM access control policy +/// for a ServiceAccount. +/// +/// A builder for the *serviceAccounts.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectServiceAccountTestIamPermissionCall<'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) -> ProjectServiceAccountTestIamPermissionCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Signs a blob using a service account's system-managed private key. +/// +/// A builder for the *serviceAccounts.signBlob* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::SignBlobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SignBlobRequest::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().service_accounts_sign_blob(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountSignBlobCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: SignBlobRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountSignBlobCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountSignBlobCall<'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, SignBlobResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.signBlob", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:signBlob"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SignBlobRequest) -> ProjectServiceAccountSignBlobCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountSignBlobCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountSignBlobCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountSignBlobCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountSignBlobCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2175,9 +6642,9 @@ impl<'a, C, A> ProjectServiceAccountSetIamPolicyCall<'a, C, A> where C: BorrowMu } -/// Deletes a ServiceAccountKey. +/// Deletes a ServiceAccount. /// -/// A builder for the *serviceAccounts.keys.delete* method supported by a *project* resource. +/// A builder for the *serviceAccounts.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -2202,11 +6669,11 @@ impl<'a, C, A> ProjectServiceAccountSetIamPolicyCall<'a, C, A> where C: BorrowMu /// // 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().service_accounts_keys_delete("name") +/// let result = hub.projects().service_accounts_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectServiceAccountKeyDeleteCall<'a, C, A> +pub struct ProjectServiceAccountDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Iam, @@ -2216,9 +6683,9 @@ pub struct ProjectServiceAccountKeyDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectServiceAccountDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -2231,7 +6698,7 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.delete", + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("name", self._name.to_string())); @@ -2353,8 +6820,8 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -2373,7 +6840,7 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2400,7 +6867,7 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2420,7 +6887,7 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2432,10 +6899,10 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut +pub struct ProjectServiceAccountCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Iam, - _request: CreateServiceAccountKeyRequest, + _request: CreateServiceAccountRequest, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectServiceAccountCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectServiceAccountCreateCall<'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, ServiceAccountKey)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccount)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2496,7 +6963,7 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.create", + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.create", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("name", self._name.to_string())); @@ -2512,7 +6979,7 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> { + pub fn request(mut self, new_value: CreateServiceAccountRequest) -> ProjectServiceAccountCreateCall<'a, C, A> { self._request = new_value; self } - /// The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - /// Using `-` as a wildcard for the project will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. + /// Required. The resource name of the project associated with the service + /// accounts, such as `projects/my-project-123`. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyCreateCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountCreateCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -2662,7 +7126,7 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2689,7 +7153,7 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2709,7 +7173,7 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectServiceAccountKeyCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2721,9 +7185,9 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut +pub struct ProjectRolePatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Iam, - _request: SignBlobRequest, + _request: Role, _name: String, + _update_mask: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectServiceAccountSignBlobCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectRolePatchCall<'a, C, A> {} -impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectRolePatchCall<'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, SignBlobResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Role)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2784,11 +7250,14 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.signBlob", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "iam.projects.roles.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2800,7 +7269,7 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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: Role) -> ProjectRolePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the role in one of the following formats: + /// `roles/{ROLE_NAME}` + /// `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + /// `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRolePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A mask describing which fields in the Role have changed. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectRolePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRolePatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRolePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRolePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new Role. +/// +/// A builder for the *roles.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::CreateRoleRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateRoleRequest::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().roles_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRoleCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: CreateRoleRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRoleCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectRoleCreateCall<'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, Role)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.roles.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/roles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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, @@ -2926,22 +7689,20 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> { + pub fn request(mut self, new_value: CreateRoleRequest) -> ProjectRoleCreateCall<'a, C, A> { self._request = new_value; self } - /// The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - /// Using `-` as a wildcard for the project will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. + /// The resource name of the parent resource in one of the following formats: + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountSignBlobCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectRoleCreateCall<'a, C, A> { + self._parent = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -2950,7 +7711,7 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRoleCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2977,7 +7738,7 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountSignBlobCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectRoleCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2997,7 +7758,311 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectServiceAccountSignBlobCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectRoleCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the Roles defined on a resource. +/// +/// A builder for the *roles.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().roles_list("parent") +/// .view("sea") +/// .show_deleted(true) +/// .page_token("duo") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct ProjectRoleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _parent: String, + _view: Option, + _show_deleted: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRoleListCall<'a, C, A> {} + +impl<'a, C, A> ProjectRoleListCall<'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, ListRolesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.roles.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._show_deleted { + params.push(("showDeleted", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "view", "showDeleted", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/roles"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 resource name of the parent resource in one of the following formats: + /// `` (empty string) -- this refers to curated roles. + /// `organizations/{ORGANIZATION_ID}` + /// `projects/{PROJECT_ID}` + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectRoleListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional view for the returned Role objects. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> ProjectRoleListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// Include Roles that have been deleted. + /// + /// Sets the *show deleted* query property to the given value. + pub fn show_deleted(mut self, new_value: bool) -> ProjectRoleListCall<'a, C, A> { + self._show_deleted = Some(new_value); + self + } + /// Optional pagination token returned in an earlier ListRolesResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectRoleListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of roles to include in the response. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectRoleListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRoleListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRoleListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRoleListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3305,1644 +8370,6 @@ impl<'a, C, A> ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_list("name") -/// .page_token("erat") -/// .page_size(-35) -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Iam, - _name: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountListCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountListCall<'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, ListServiceAccountsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}/serviceAccounts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 name of the project associated with the service - /// accounts, such as `projects/my-project-123`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountListCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional pagination token returned in an earlier - /// ListServiceAccountsResponse.next_page_token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectServiceAccountListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional limit on the number of service accounts to include in the - /// response. Further accounts can subsequently be obtained by including the - /// ListServiceAccountsResponse.next_page_token - /// in a subsequent request. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectServiceAccountListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountListCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectServiceAccountListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a ServiceAccount. -/// -/// A builder for the *serviceAccounts.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_iam1 as iam1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use iam1::Iam; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Iam, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountDeleteCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. - /// Using `-` as a wildcard for the project will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountDeleteCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectServiceAccountDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the ServiceAccountKey -/// by key id. -/// -/// A builder for the *serviceAccounts.keys.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_iam1 as iam1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use iam1::Iam; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_keys_get("name") -/// .public_key_type("dolores") -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountKeyGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Iam, - _name: String, - _public_key_type: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountKeyGetCall<'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, ServiceAccountKey)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - if let Some(value) = self._public_key_type { - params.push(("publicKeyType", value.to_string())); - } - for &field in ["alt", "name", "publicKeyType"].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 = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 resource name of the service account key in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. - /// - /// Using `-` as a wildcard for the project will infer the project from - /// the account. The `account` value can be the `email` address or the - /// `unique_id` of the service account. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The output format of the public key requested. - /// X509_PEM is the default output format. - /// - /// Sets the *public key type* query property to the given value. - pub fn public_key_type(mut self, new_value: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { - self._public_key_type = 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) -> ProjectServiceAccountKeyGetCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountKeyGetCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectServiceAccountKeyGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the IAM access control policy for a -/// ServiceAccount. -/// -/// A builder for the *serviceAccounts.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_iam1 as iam1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use iam1::Iam; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_get_iam_policy("resource") -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Iam, - _resource: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.getIamPolicy", - http_method: hyper::method::Method::Post }); - 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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; - 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(), DEFAULT_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(Bearer { 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(d); - 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(d); - 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 the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// 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) -> ProjectServiceAccountGetIamPolicyCall<'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) -> ProjectServiceAccountGetIamPolicyCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountGetIamPolicyCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Tests the specified permissions against the IAM access control policy -/// for a ServiceAccount. -/// -/// A builder for the *serviceAccounts.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_iam1 as iam1; -/// use iam1::TestIamPermissionsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use iam1::Iam; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_test_iam_permissions(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountTestIamPermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Iam, - _request: TestIamPermissionsRequest, - _resource: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountTestIamPermissionCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; - 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(), DEFAULT_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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> { - self._request = new_value; - self - } - /// REQUIRED: The resource for which the policy detail is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// 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) -> ProjectServiceAccountTestIamPermissionCall<'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) -> ProjectServiceAccountTestIamPermissionCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountTestIamPermissionCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a ServiceAccount -/// and returns it. -/// -/// A builder for the *serviceAccounts.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_iam1 as iam1; -/// use iam1::CreateServiceAccountRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use iam1::Iam; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateServiceAccountRequest::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().service_accounts_create(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Iam, - _request: CreateServiceAccountRequest, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountCreateCall<'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, ServiceAccount)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}/serviceAccounts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: CreateServiceAccountRequest) -> ProjectServiceAccountCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The resource name of the project associated with the service - /// accounts, such as `projects/my-project-123`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountCreateCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountCreateCall<'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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountCreateCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectServiceAccountCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Signs a JWT using a service account's system-managed private key. /// /// If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an @@ -5235,6 +8662,1124 @@ impl<'a, C, A> ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_keys_list("name") +/// .add_key_types("amet") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountKeyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _key_types: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyListCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountKeyListCall<'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, ListServiceAccountKeysResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if self._key_types.len() > 0 { + for f in self._key_types.iter() { + params.push(("keyTypes", f.to_string())); + } + } + for &field in ["alt", "name", "keyTypes"].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 = self.hub._base_url.clone() + "v1/{+name}/keys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// + /// Using `-` as a wildcard for the project, will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Filters the types of keys the user wants to include in the list + /// response. Duplicate key types are not allowed. If no key type + /// is provided, all keys are returned. + /// + /// Append the given value to the *key types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_key_types(mut self, new_value: &str) -> ProjectServiceAccountKeyListCall<'a, C, A> { + self._key_types.push(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) -> ProjectServiceAccountKeyListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountKeyListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountKeyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a ServiceAccountKey +/// and returns it. +/// +/// A builder for the *serviceAccounts.keys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// use iam1::CreateServiceAccountKeyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateServiceAccountKeyRequest::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().service_accounts_keys_create(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountKeyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: CreateServiceAccountKeyRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'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, ServiceAccountKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/keys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateServiceAccountKeyRequest) -> ProjectServiceAccountKeyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyCreateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountKeyCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountKeyCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountKeyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists ServiceAccounts for a project. +/// +/// A builder for the *serviceAccounts.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_list("name") +/// .page_token("ut") +/// .page_size(-16) +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountListCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountListCall<'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, ListServiceAccountsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/serviceAccounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the project associated with the service + /// accounts, such as `projects/my-project-123`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional pagination token returned in an earlier + /// ListServiceAccountsResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectServiceAccountListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of service accounts to include in the + /// response. Further accounts can subsequently be obtained by including the + /// ListServiceAccountsResponse.next_page_token + /// in a subsequent request. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectServiceAccountListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the ServiceAccountKey +/// by key id. +/// +/// A builder for the *serviceAccounts.keys.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iam1 as iam1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iam1::Iam; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().service_accounts_keys_get("name") +/// .public_key_type("dolor") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountKeyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _name: String, + _public_key_type: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountKeyGetCall<'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, ServiceAccountKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._public_key_type { + params.push(("publicKeyType", value.to_string())); + } + for &field in ["alt", "name", "publicKeyType"].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 = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 resource name of the service account key in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + /// + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The output format of the public key requested. + /// X509_PEM is the default output format. + /// + /// Sets the *public key type* query property to the given value. + pub fn public_key_type(mut self, new_value: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { + self._public_key_type = 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) -> ProjectServiceAccountKeyGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountKeyGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceAccountKeyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets a ServiceAccount. /// /// A builder for the *serviceAccounts.get* method supported by a *project* resource. @@ -5492,3 +10037,251 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = QueryTestablePermissionsRequest::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.permissions().query_testable_permissions(req) +/// .doit(); +/// # } +/// ``` +pub struct PermissionQueryTestablePermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: QueryTestablePermissionsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PermissionQueryTestablePermissionCall<'a, C, A> {} + +impl<'a, C, A> PermissionQueryTestablePermissionCall<'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, QueryTestablePermissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.permissions.queryTestablePermissions", + 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 = self.hub._base_url.clone() + "v1/permissions:queryTestablePermissions"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: QueryTestablePermissionsRequest) -> PermissionQueryTestablePermissionCall<'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) -> PermissionQueryTestablePermissionCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PermissionQueryTestablePermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PermissionQueryTestablePermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/identitytoolkit3-cli/Cargo.toml b/gen/identitytoolkit3-cli/Cargo.toml index 91436d947b..7701003bd5 100644 --- a/gen/identitytoolkit3-cli/Cargo.toml +++ b/gen/identitytoolkit3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3-cli" -version = "1.0.6+20170425" +version = "1.0.6+20170828" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-identitytoolkit3] path = "../identitytoolkit3" -version = "1.0.6+20170425" +version = "1.0.6+20170828" diff --git a/gen/identitytoolkit3-cli/README.md b/gen/identitytoolkit3-cli/README.md index 248cb0baa4..6d9c595ff3 100644 --- a/gen/identitytoolkit3-cli/README.md +++ b/gen/identitytoolkit3-cli/README.md @@ -25,7 +25,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 *20170425*. The CLI is at version *1.0.6*. +This documentation was generated from the *Identity Toolkit* API at revision *20170828*. The CLI is at version *1.0.6*. ```bash identitytoolkit3 [options] @@ -39,6 +39,7 @@ identitytoolkit3 [options] get-public-keys [-p ]... [-o ] get-recaptcha-param [-p ]... [-o ] reset-password (-r )... [-p ]... [-o ] + send-verification-code (-r )... [-p ]... [-o ] set-account-info (-r )... [-p ]... [-o ] set-project-config (-r )... [-p ]... [-o ] sign-out-user (-r )... [-p ]... [-o ] @@ -47,6 +48,7 @@ identitytoolkit3 [options] verify-assertion (-r )... [-p ]... [-o ] verify-custom-token (-r )... [-p ]... [-o ] verify-password (-r )... [-p ]... [-o ] + verify-phone-number (-r )... [-p ]... [-o ] identitytoolkit3 --help Configuration: diff --git a/gen/identitytoolkit3-cli/mkdocs.yml b/gen/identitytoolkit3-cli/mkdocs.yml index bc3d026ec5..93532363bc 100644 --- a/gen/identitytoolkit3-cli/mkdocs.yml +++ b/gen/identitytoolkit3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Identity Toolkit v1.0.6+20170425 +site_name: Identity Toolkit v1.0.6+20170828 site_url: http://byron.github.io/google-apis-rs/google-identitytoolkit3-cli site_description: A complete library to interact with Identity Toolkit (protocol v3) @@ -18,6 +18,7 @@ pages: - ['relyingparty_get-public-keys.md', 'Relyingparty', 'Get Public Keys'] - ['relyingparty_get-recaptcha-param.md', 'Relyingparty', 'Get Recaptcha Param'] - ['relyingparty_reset-password.md', 'Relyingparty', 'Reset Password'] +- ['relyingparty_send-verification-code.md', 'Relyingparty', 'Send Verification Code'] - ['relyingparty_set-account-info.md', 'Relyingparty', 'Set Account Info'] - ['relyingparty_set-project-config.md', 'Relyingparty', 'Set Project Config'] - ['relyingparty_sign-out-user.md', 'Relyingparty', 'Sign Out User'] @@ -26,6 +27,7 @@ pages: - ['relyingparty_verify-assertion.md', 'Relyingparty', 'Verify Assertion'] - ['relyingparty_verify-custom-token.md', 'Relyingparty', 'Verify Custom Token'] - ['relyingparty_verify-password.md', 'Relyingparty', 'Verify Password'] +- ['relyingparty_verify-phone-number.md', 'Relyingparty', 'Verify Phone Number'] theme: readthedocs diff --git a/gen/identitytoolkit3-cli/src/main.rs b/gen/identitytoolkit3-cli/src/main.rs index 62e97704af..2cd36c68ec 100644 --- a/gen/identitytoolkit3-cli/src/main.rs +++ b/gen/identitytoolkit3-cli/src/main.rs @@ -344,10 +344,11 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "delegated-project-number" => Some(("delegatedProjectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "local-id" => Some(("localId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["delegated-project-number", "email", "id-token", "local-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["delegated-project-number", "email", "id-token", "local-id", "phone-number"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -757,6 +758,94 @@ impl<'n> Engine<'n> { } } + fn _relyingparty_send_verification_code(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "recaptcha-token" => Some(("recaptchaToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ios-secret" => Some(("iosSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ios-receipt" => Some(("iosReceipt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ios-receipt", "ios-secret", "phone-number", "recaptcha-token"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::IdentitytoolkitRelyingpartySendVerificationCodeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.relyingparty().send_verification_code(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _relyingparty_set_account_info(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -780,29 +869,31 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "delete-provider" => Some(("deleteProvider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "provider" => Some(("provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "delegated-project-number" => Some(("delegatedProjectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "oob-code" => Some(("oobCode", 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 })), "photo-url" => Some(("photoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "instance-id" => Some(("instanceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-login-at" => Some(("lastLoginAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "upgrade-to-federated-login" => Some(("upgradeToFederatedLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "disable-user" => Some(("disableUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "delete-attribute" => Some(("deleteAttribute", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "captcha-challenge" => Some(("captchaChallenge", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "captcha-response" => Some(("captchaResponse", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "email-verified" => Some(("emailVerified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "return-secure-token" => Some(("returnSecureToken", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "created-at" => Some(("createdAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delete-attribute" => Some(("deleteAttribute", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "upgrade-to-federated-login" => Some(("upgradeToFederatedLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "delete-provider" => Some(("deleteProvider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "captcha-challenge" => Some(("captchaChallenge", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "provider" => Some(("provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "delegated-project-number" => Some(("delegatedProjectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "oob-code" => Some(("oobCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "captcha-response" => Some(("captchaResponse", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "created-at" => Some(("createdAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-attributes" => Some(("customAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email-verified" => Some(("emailVerified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "created-at", "delegated-project-number", "delete-attribute", "delete-provider", "disable-user", "display-name", "email", "email-verified", "id-token", "instance-id", "last-login-at", "local-id", "oob-code", "password", "photo-url", "provider", "return-secure-token", "upgrade-to-federated-login", "valid-since"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "created-at", "custom-attributes", "delegated-project-number", "delete-attribute", "delete-provider", "disable-user", "display-name", "email", "email-verified", "id-token", "instance-id", "last-login-at", "local-id", "oob-code", "password", "phone-number", "photo-url", "provider", "return-secure-token", "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 } @@ -1092,12 +1183,13 @@ impl<'n> Engine<'n> { "email-verified" => Some(("emailVerified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "captcha-response" => Some(("captchaResponse", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "captcha-challenge" => Some(("captchaChallenge", 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", "disabled", "display-name", "email", "email-verified", "id-token", "instance-id", "local-id", "password", "photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "disabled", "display-name", "email", "email-verified", "id-token", "instance-id", "local-id", "password", "phone-number", "photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1180,17 +1272,21 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "dk-len" => Some(("dkLen", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "hash-algorithm" => Some(("hashAlgorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "delegated-project-number" => Some(("delegatedProjectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "allow-overwrite" => Some(("allowOverwrite", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "parallelization" => Some(("parallelization", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "block-size" => Some(("blockSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "sanity-check" => Some(("sanityCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cpu-mem-cost" => Some(("cpuMemCost", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "signer-key" => Some(("signerKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "memory-cost" => Some(("memoryCost", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "salt-separator" => Some(("saltSeparator", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "target-project-id" => Some(("targetProjectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "rounds" => Some(("rounds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-overwrite", "delegated-project-number", "hash-algorithm", "memory-cost", "rounds", "salt-separator", "sanity-check", "signer-key", "target-project-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-overwrite", "block-size", "cpu-mem-cost", "delegated-project-number", "dk-len", "hash-algorithm", "memory-cost", "parallelization", "rounds", "salt-separator", "sanity-check", "signer-key", "target-project-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1526,6 +1622,97 @@ impl<'n> Engine<'n> { } } + fn _relyingparty_verify_phone_number(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "verification-proof" => Some(("verificationProof", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "code" => Some(("code", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "temporary-proof" => Some(("temporaryProof", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation" => Some(("operation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "session-info" => Some(("sessionInfo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "id-token", "operation", "phone-number", "session-info", "temporary-proof", "verification-proof"]); + 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::IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.relyingparty().verify_phone_number(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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(()); @@ -1560,6 +1747,9 @@ impl<'n> Engine<'n> { ("reset-password", Some(opt)) => { call_result = self._relyingparty_reset_password(opt, dry_run, &mut err); }, + ("send-verification-code", Some(opt)) => { + call_result = self._relyingparty_send_verification_code(opt, dry_run, &mut err); + }, ("set-account-info", Some(opt)) => { call_result = self._relyingparty_set_account_info(opt, dry_run, &mut err); }, @@ -1584,6 +1774,9 @@ impl<'n> Engine<'n> { ("verify-password", Some(opt)) => { call_result = self._relyingparty_verify_password(opt, dry_run, &mut err); }, + ("verify-phone-number", Some(opt)) => { + call_result = self._relyingparty_verify_phone_number(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("relyingparty".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -1672,7 +1865,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("relyingparty", "methods: 'create-auth-uri', 'delete-account', 'download-account', 'get-account-info', 'get-oob-confirmation-code', 'get-project-config', 'get-public-keys', 'get-recaptcha-param', 'reset-password', 'set-account-info', 'set-project-config', 'sign-out-user', 'signup-new-user', 'upload-account', 'verify-assertion', 'verify-custom-token' and 'verify-password'", vec![ + ("relyingparty", "methods: 'create-auth-uri', 'delete-account', 'download-account', 'get-account-info', 'get-oob-confirmation-code', 'get-project-config', 'get-public-keys', 'get-recaptcha-param', 'reset-password', 'send-verification-code', 'set-account-info', 'set-project-config', 'sign-out-user', 'signup-new-user', 'upload-account', 'verify-assertion', 'verify-custom-token', 'verify-password' and 'verify-phone-number'", vec![ ("create-auth-uri", Some(r##"Creates the URI used by the IdP to authenticate the user."##), "Details at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli/relyingparty_create-auth-uri", @@ -1847,6 +2040,28 @@ 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)), + ]), + ("send-verification-code", + Some(r##"Send SMS verification code."##), + "Details at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli/relyingparty_send-verification-code", + 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"##), @@ -2023,6 +2238,28 @@ 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)), + ]), + ("verify-phone-number", + Some(r##"Verifies ownership of a phone number and creates/updates the user account accordingly."##), + "Details at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli/relyingparty_verify-phone-number", + 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"##), @@ -2035,7 +2272,7 @@ fn main() { let mut app = App::new("identitytoolkit3") .author("Sebastian Thiel ") - .version("1.0.6+20170425") + .version("1.0.6+20170828") .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("url") diff --git a/gen/identitytoolkit3/Cargo.toml b/gen/identitytoolkit3/Cargo.toml index db7a997e07..372b5d664a 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-identitytoolkit3" -version = "1.0.6+20170425" +version = "1.0.6+20170828" 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" homepage = "https://developers.google.com/identity-toolkit/v3/" -documentation = "https://docs.rs/google-identitytoolkit3/1.0.6+20170425" +documentation = "https://docs.rs/google-identitytoolkit3/1.0.6+20170828" license = "MIT" keywords = ["identitytoolkit", "google", "protocol", "web", "api"] diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index 2d91931a55..f43c8ee0c5 100644 --- a/gen/identitytoolkit3/README.md +++ b/gen/identitytoolkit3/README.md @@ -5,16 +5,16 @@ 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 *1.0.6+20170425*, where *20170425* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Identity Toolkit* crate version *1.0.6+20170828*, where *20170828* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Identity Toolkit* *v3* API can be found at the [official documentation site](https://developers.google.com/identity-toolkit/v3/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.IdentityToolkit.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.IdentityToolkit.html) ... -* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.Relyingparty.html) - * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html) and [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.html) +* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.Relyingparty.html) + * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*send verification code*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartySendVerificationCodeCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html), [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.html) and [*verify phone number*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.RelyingpartyVerifyPhoneNumberCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/struct.IdentityToolkit.html)** +* **[Hub](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/struct.IdentityToolkit.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.Part.html)** + * **[Parts](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -122,17 +122,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/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")`. @@ -142,29 +142,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/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](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/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](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/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](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/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](https://docs.rs/google-identitytoolkit3/1.0.6+20170425/google_identitytoolkit3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/identitytoolkit3/src/lib.rs b/gen/identitytoolkit3/src/lib.rs index b029089906..79daef676d 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 *1.0.6+20170425*, where *20170425* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Identity Toolkit* crate version *1.0.6+20170828*, where *20170828* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Identity Toolkit* *v3* API can be found at the //! [official documentation site](https://developers.google.com/identity-toolkit/v3/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.IdentityToolkit.html) ... //! //! * [relyingparty](struct.Relyingparty.html) -//! * [*create auth uri*](struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](struct.RelyingpartyDeleteAccountCall.html), [*download account*](struct.RelyingpartyDownloadAccountCall.html), [*get account info*](struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](struct.RelyingpartyResetPasswordCall.html), [*set account info*](struct.RelyingpartySetAccountInfoCall.html), [*set project config*](struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](struct.RelyingpartySignOutUserCall.html), [*signup new user*](struct.RelyingpartySignupNewUserCall.html), [*upload account*](struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](struct.RelyingpartyVerifyCustomTokenCall.html) and [*verify password*](struct.RelyingpartyVerifyPasswordCall.html) +//! * [*create auth uri*](struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](struct.RelyingpartyDeleteAccountCall.html), [*download account*](struct.RelyingpartyDownloadAccountCall.html), [*get account info*](struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](struct.RelyingpartyResetPasswordCall.html), [*send verification code*](struct.RelyingpartySendVerificationCodeCall.html), [*set account info*](struct.RelyingpartySetAccountInfoCall.html), [*set project config*](struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](struct.RelyingpartySignOutUserCall.html), [*signup new user*](struct.RelyingpartySignupNewUserCall.html), [*upload account*](struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](struct.RelyingpartyVerifyCustomTokenCall.html), [*verify password*](struct.RelyingpartyVerifyPasswordCall.html) and [*verify phone number*](struct.RelyingpartyVerifyPhoneNumberCall.html) //! //! //! @@ -475,6 +475,34 @@ pub struct IdentitytoolkitRelyingpartyGetProjectConfigResponse { impl ResponseResult for IdentitytoolkitRelyingpartyGetProjectConfigResponse {} +/// Request for Identitytoolkit-SendVerificationCode +/// +/// # 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*). +/// +/// * [send verification code relyingparty](struct.RelyingpartySendVerificationCodeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentitytoolkitRelyingpartySendVerificationCodeRequest { + /// The phone number to send the verification code to in E.164 format. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// Secret delivered to iOS app via APNS. + #[serde(rename="iosSecret")] + pub ios_secret: Option, + /// Receipt of successful app token validation with APNS. + #[serde(rename="iosReceipt")] + pub ios_receipt: Option, + /// Recaptcha solution. + #[serde(rename="recaptchaToken")] + pub recaptcha_token: Option, +} + +impl RequestValue for IdentitytoolkitRelyingpartySendVerificationCodeRequest {} + + /// Request to get the account information. /// /// # Activities @@ -492,6 +520,9 @@ pub struct IdentitytoolkitRelyingpartyGetAccountInfoRequest { /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. #[serde(rename="delegatedProjectNumber")] pub delegated_project_number: Option, + /// Privileged caller can query users by specified phone number. + #[serde(rename="phoneNumber")] + pub phone_number: Option>, /// The list of emails of the users to inquiry. pub email: Option>, /// The list of local ID's of the users to inquiry. @@ -588,16 +619,65 @@ pub struct VerifyCustomTokenResponse { /// The GITKit token for authenticated user. #[serde(rename="idToken")] pub id_token: Option, - /// The fixed string "identitytoolkit#VerifyCustomTokenResponse". - pub kind: Option, + /// True if it's a new user sign-in, false if it's a returning user. + #[serde(rename="isNewUser")] + pub is_new_user: Option, /// If idToken is STS id token, then this field will be refresh token. #[serde(rename="refreshToken")] pub refresh_token: Option, + /// The fixed string "identitytoolkit#VerifyCustomTokenResponse". + pub kind: Option, } impl ResponseResult for VerifyCustomTokenResponse {} +/// Response for Identitytoolkit-VerifyPhoneNumber +/// +/// # 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*). +/// +/// * [verify phone number relyingparty](struct.RelyingpartyVerifyPhoneNumberCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse { + /// no description provided + #[serde(rename="expiresIn")] + pub expires_in: Option, + /// no description provided + #[serde(rename="temporaryProofExpiresIn")] + pub temporary_proof_expires_in: Option, + /// no description provided + #[serde(rename="refreshToken")] + pub refresh_token: Option, + /// no description provided + #[serde(rename="localId")] + pub local_id: Option, + /// no description provided + #[serde(rename="verificationProofExpiresIn")] + pub verification_proof_expires_in: Option, + /// no description provided + #[serde(rename="idToken")] + pub id_token: Option, + /// no description provided + #[serde(rename="isNewUser")] + pub is_new_user: Option, + /// no description provided + #[serde(rename="verificationProof")] + pub verification_proof: Option, + /// no description provided + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// no description provided + #[serde(rename="temporaryProof")] + pub temporary_proof: Option, +} + +impl ResponseResult for IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse {} + + /// Request to verify the password. /// /// # Activities @@ -688,30 +768,86 @@ pub struct VerifyPasswordResponse { impl ResponseResult for VerifyPasswordResponse {} -/// Response of resetting the password. +/// Request to set the account information. /// /// # 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*). /// -/// * [reset password relyingparty](struct.RelyingpartyResetPasswordCall.html) (response) +/// * [set account info relyingparty](struct.RelyingpartySetAccountInfoCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResetPasswordResponse { - /// The request type. - #[serde(rename="requestType")] - pub request_type: Option, - /// The fixed string "identitytoolkit#ResetPasswordResponse". - pub kind: Option, - /// The user's email. If the out-of-band code is for email recovery, the user's original email. +pub struct IdentitytoolkitRelyingpartySetAccountInfoRequest { + /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. + #[serde(rename="delegatedProjectNumber")] + pub delegated_project_number: Option, + /// The out-of-band code of the change email request. + #[serde(rename="oobCode")] + pub oob_code: Option, + /// 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 photo url of the user. + #[serde(rename="photoUrl")] + pub photo_url: Option, + /// Instance id token of the app. + #[serde(rename="instanceId")] + pub instance_id: Option, + /// Last login timestamp. + #[serde(rename="lastLoginAt")] + pub last_login_at: Option, + /// Whether to disable the user. + #[serde(rename="disableUser")] + pub disable_user: Option, + /// Whether return sts id token and refresh token instead of gitkit token. + #[serde(rename="returnSecureToken")] + pub return_secure_token: Option, + /// The new password of the user. + pub password: Option, + /// The name of the user. + #[serde(rename="displayName")] + pub display_name: Option, + /// The timestamp when the account is created. + #[serde(rename="createdAt")] + pub created_at: Option, + /// The attributes users request to delete. + #[serde(rename="deleteAttribute")] + pub delete_attribute: Option>, + /// Mark the user to upgrade to federated login. + #[serde(rename="upgradeToFederatedLogin")] + pub upgrade_to_federated_login: 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, + /// The IDPs the user request to delete. + #[serde(rename="deleteProvider")] + pub delete_provider: Option>, + /// The captcha challenge. + #[serde(rename="captchaChallenge")] + pub captcha_challenge: Option, + /// The custom attributes to be set in the user's id token. + #[serde(rename="customAttributes")] + pub custom_attributes: Option, + /// Privileged caller can update user with specified phone number. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// The associated IDPs of the user. + pub provider: Option>, + /// Response to the captcha. + #[serde(rename="captchaResponse")] + pub captcha_response: Option, + /// The email of the user. pub email: Option, - /// If the out-of-band code is for email recovery, the user's new email. - #[serde(rename="newEmail")] - pub new_email: Option, } -impl ResponseResult for ResetPasswordResponse {} +impl RequestValue for IdentitytoolkitRelyingpartySetAccountInfoRequest {} /// Response of signing out user. @@ -820,6 +956,9 @@ pub struct IdentitytoolkitRelyingpartySignupNewUserRequest { /// Response to the captcha. #[serde(rename="captchaResponse")] pub captcha_response: Option, + /// Privileged caller can create user with specified phone number. + #[serde(rename="phoneNumber")] + pub phone_number: Option, /// The GITKit token of the authenticated user. #[serde(rename="idToken")] pub id_token: Option, @@ -1133,80 +1272,30 @@ pub struct IdentitytoolkitRelyingpartyResetPasswordRequest { impl RequestValue for IdentitytoolkitRelyingpartyResetPasswordRequest {} -/// Request to set the account information. +/// Response of resetting the password. /// /// # 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*). /// -/// * [set account info relyingparty](struct.RelyingpartySetAccountInfoCall.html) (request) +/// * [reset password relyingparty](struct.RelyingpartyResetPasswordCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IdentitytoolkitRelyingpartySetAccountInfoRequest { - /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. - #[serde(rename="delegatedProjectNumber")] - pub delegated_project_number: Option, - /// The out-of-band code of the change email request. - #[serde(rename="oobCode")] - pub oob_code: Option, - /// 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 photo url of the user. - #[serde(rename="photoUrl")] - pub photo_url: Option, - /// Instance id token of the app. - #[serde(rename="instanceId")] - pub instance_id: Option, - /// Last login timestamp. - #[serde(rename="lastLoginAt")] - pub last_login_at: Option, - /// Whether to disable the user. - #[serde(rename="disableUser")] - pub disable_user: Option, - /// Whether return sts id token and refresh token instead of gitkit token. - #[serde(rename="returnSecureToken")] - pub return_secure_token: Option, - /// The new password of the user. - pub password: Option, - /// The name of the user. - #[serde(rename="displayName")] - pub display_name: Option, - /// The timestamp when the account is created. - #[serde(rename="createdAt")] - pub created_at: Option, - /// The attributes users request to delete. - #[serde(rename="deleteAttribute")] - pub delete_attribute: Option>, - /// Mark the user to upgrade to federated login. - #[serde(rename="upgradeToFederatedLogin")] - pub upgrade_to_federated_login: 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, - /// The IDPs the user request to delete. - #[serde(rename="deleteProvider")] - pub delete_provider: Option>, - /// The captcha challenge. - #[serde(rename="captchaChallenge")] - pub captcha_challenge: Option, - /// Response to the captcha. - #[serde(rename="captchaResponse")] - pub captcha_response: Option, - /// The associated IDPs of the user. - pub provider: Option>, - /// The email of the user. +pub struct ResetPasswordResponse { + /// The request type. + #[serde(rename="requestType")] + pub request_type: Option, + /// The fixed string "identitytoolkit#ResetPasswordResponse". + pub kind: Option, + /// The user's email. If the out-of-band code is for email recovery, the user's original email. pub email: Option, + /// If the out-of-band code is for email recovery, the user's new email. + #[serde(rename="newEmail")] + pub new_email: Option, } -impl RequestValue for IdentitytoolkitRelyingpartySetAccountInfoRequest {} +impl ResponseResult for ResetPasswordResponse {} /// Request to delete account. @@ -1544,6 +1633,9 @@ impl ResponseResult for UploadAccountResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IdentitytoolkitRelyingpartyUploadAccountRequest { + /// no description provided + #[serde(rename="dkLen")] + pub dk_len: Option, /// The password hash algorithm. #[serde(rename="hashAlgorithm")] pub hash_algorithm: Option, @@ -1555,9 +1647,17 @@ pub struct IdentitytoolkitRelyingpartyUploadAccountRequest { pub allow_overwrite: Option, /// The account info to be stored. pub users: Option>, + /// no description provided + pub parallelization: Option, + /// no description provided + #[serde(rename="blockSize")] + pub block_size: Option, /// If true, backend will do sanity check(including duplicate email and federated id) when uploading account. #[serde(rename="sanityCheck")] pub sanity_check: Option, + /// The following 4 fields are for standard scrypt algorithm. + #[serde(rename="cpuMemCost")] + pub cpu_mem_cost: Option, /// The key for to hash the password. #[serde(rename="signerKey")] pub signer_key: Option, @@ -1577,6 +1677,41 @@ pub struct IdentitytoolkitRelyingpartyUploadAccountRequest { impl RequestValue for IdentitytoolkitRelyingpartyUploadAccountRequest {} +/// Request for Identitytoolkit-VerifyPhoneNumber +/// +/// # 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*). +/// +/// * [verify phone number relyingparty](struct.RelyingpartyVerifyPhoneNumberCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest { + /// no description provided + #[serde(rename="verificationProof")] + pub verification_proof: Option, + /// no description provided + pub code: Option, + /// no description provided + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// The session info previously returned by IdentityToolkit-SendVerificationCode. + #[serde(rename="sessionInfo")] + pub session_info: Option, + /// no description provided + #[serde(rename="idToken")] + pub id_token: Option, + /// no description provided + pub operation: Option, + /// no description provided + #[serde(rename="temporaryProof")] + pub temporary_proof: Option, +} + +impl RequestValue for IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest {} + + /// Template for an individual account info. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1618,6 +1753,9 @@ pub struct UserInfo { /// Whether the email has been verified. #[serde(rename="emailVerified")] pub email_verified: Option, + /// The custom attributes to be set in the user's id token. + #[serde(rename="customAttributes")] + pub custom_attributes: Option, /// Version of the user's password. pub version: Option, /// User's phone number. @@ -1661,6 +1799,25 @@ pub struct GetOobConfirmationCodeResponse { impl ResponseResult for GetOobConfirmationCodeResponse {} +/// Response for Identitytoolkit-SendVerificationCode +/// +/// # 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*). +/// +/// * [send verification code relyingparty](struct.RelyingpartySendVerificationCodeCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentitytoolkitRelyingpartySendVerificationCodeResponse { + /// Encrypted session information + #[serde(rename="sessionInfo")] + pub session_info: Option, +} + +impl ResponseResult for IdentitytoolkitRelyingpartySendVerificationCodeResponse {} + + /// Response of signing up new user, creating anonymous user or anonymous user reauth. /// /// # Activities @@ -1743,7 +1900,7 @@ impl ResponseResult for DeleteAccountResponse {} /// ::default(), None); /// let mut hub = IdentityToolkit::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `create_auth_uri(...)`, `delete_account(...)`, `download_account(...)`, `get_account_info(...)`, `get_oob_confirmation_code(...)`, `get_project_config(...)`, `get_public_keys(...)`, `get_recaptcha_param(...)`, `reset_password(...)`, `set_account_info(...)`, `set_project_config(...)`, `sign_out_user(...)`, `signup_new_user(...)`, `upload_account(...)`, `verify_assertion(...)`, `verify_custom_token(...)` and `verify_password(...)` +/// // like `create_auth_uri(...)`, `delete_account(...)`, `download_account(...)`, `get_account_info(...)`, `get_oob_confirmation_code(...)`, `get_project_config(...)`, `get_public_keys(...)`, `get_recaptcha_param(...)`, `reset_password(...)`, `send_verification_code(...)`, `set_account_info(...)`, `set_project_config(...)`, `sign_out_user(...)`, `signup_new_user(...)`, `upload_account(...)`, `verify_assertion(...)`, `verify_custom_token(...)`, `verify_password(...)` and `verify_phone_number(...)` /// // to build up your call. /// let rb = hub.relyingparty(); /// # } @@ -1777,15 +1934,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Signup new user. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn signup_new_user(&self, request: IdentitytoolkitRelyingpartySignupNewUserRequest) -> RelyingpartySignupNewUserCall<'a, C, A> { - RelyingpartySignupNewUserCall { + /// Get token signing public key. + pub fn get_public_keys(&self) -> RelyingpartyGetPublicKeyCall<'a, C, A> { + RelyingpartyGetPublicKeyCall { hub: self.hub, - _request: request, _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1809,6 +1961,18 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Get recaptcha secure param. + pub fn get_recaptcha_param(&self) -> RelyingpartyGetRecaptchaParamCall<'a, C, A> { + RelyingpartyGetRecaptchaParamCall { + hub: self.hub, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sign out user. @@ -1964,10 +2128,15 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get token signing public key. - pub fn get_public_keys(&self) -> RelyingpartyGetPublicKeyCall<'a, C, A> { - RelyingpartyGetPublicKeyCall { + /// Signup new user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn signup_new_user(&self, request: IdentitytoolkitRelyingpartySignupNewUserRequest) -> RelyingpartySignupNewUserCall<'a, C, A> { + RelyingpartySignupNewUserCall { hub: self.hub, + _request: request, _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1976,10 +2145,15 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get recaptcha secure param. - pub fn get_recaptcha_param(&self) -> RelyingpartyGetRecaptchaParamCall<'a, C, A> { - RelyingpartyGetRecaptchaParamCall { + /// Verifies ownership of a phone number and creates/updates the user account accordingly. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn verify_phone_number(&self, request: IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest) -> RelyingpartyVerifyPhoneNumberCall<'a, C, A> { + RelyingpartyVerifyPhoneNumberCall { hub: self.hub, + _request: request, _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2020,6 +2194,23 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Send SMS verification code. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn send_verification_code(&self, request: IdentitytoolkitRelyingpartySendVerificationCodeRequest) -> RelyingpartySendVerificationCodeCall<'a, C, A> { + RelyingpartySendVerificationCodeCall { + 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: /// /// Get project configuration. @@ -2284,9 +2475,9 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM } -/// Signup new user. +/// Get token signing public key. /// -/// A builder for the *signupNewUser* method supported by a *relyingparty* resource. +/// A builder for the *getPublicKeys* method supported by a *relyingparty* resource. /// It is not used directly, but through a `RelyingpartyMethods` instance. /// /// # Example @@ -2298,7 +2489,6 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_identitytoolkit3 as identitytoolkit3; -/// use identitytoolkit3::IdentitytoolkitRelyingpartySignupNewUserRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -2309,35 +2499,29 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = IdentityToolkit::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = IdentitytoolkitRelyingpartySignupNewUserRequest::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.relyingparty().signup_new_user(req) +/// let result = hub.relyingparty().get_public_keys() /// .doit(); /// # } /// ``` -pub struct RelyingpartySignupNewUserCall<'a, C, A> +pub struct RelyingpartyGetPublicKeyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a IdentityToolkit, - _request: IdentitytoolkitRelyingpartySignupNewUserRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RelyingpartySignupNewUserCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RelyingpartyGetPublicKeyCall<'a, C, A> {} -impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RelyingpartyGetPublicKeyCall<'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, SignupNewUserResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, IdentitytoolkitRelyingpartyGetPublicKeysResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -2345,9 +2529,9 @@ impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.signupNewUser", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.getPublicKeys", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); for &field in ["alt"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); @@ -2360,7 +2544,7 @@ impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut RelyingpartySignupNewUserCall<'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) -> RelyingpartySignupNewUserCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RelyingpartyGetPublicKeyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2493,7 +2653,7 @@ impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RelyingpartySignupNewUserCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RelyingpartyGetPublicKeyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2513,7 +2673,7 @@ impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RelyingpartySignupNewUserCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RelyingpartyGetPublicKeyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2766,6 +2926,216 @@ impl<'a, C, A> RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = IdentityToolkit::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.relyingparty().get_recaptcha_param() +/// .doit(); +/// # } +/// ``` +pub struct RelyingpartyGetRecaptchaParamCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a IdentityToolkit, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RelyingpartyGetRecaptchaParamCall<'a, C, A> {} + +impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'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, GetRecaptchaParamResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.getRecaptchaParam", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + 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 = self.hub._base_url.clone() + "getRecaptchaParam"; + 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(Bearer { 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(d); + 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(d); + 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 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) -> RelyingpartyGetRecaptchaParamCall<'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) -> RelyingpartyGetRecaptchaParamCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RelyingpartyGetRecaptchaParamCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sign out user. /// /// A builder for the *signOutUser* method supported by a *relyingparty* resource. @@ -4935,9 +5305,9 @@ impl<'a, C, A> RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = IdentityToolkit::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = IdentitytoolkitRelyingpartySignupNewUserRequest::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.relyingparty().get_public_keys() +/// let result = hub.relyingparty().signup_new_user(req) /// .doit(); /// # } /// ``` -pub struct RelyingpartyGetPublicKeyCall<'a, C, A> +pub struct RelyingpartySignupNewUserCall<'a, C, A> where C: 'a, A: 'a { hub: &'a IdentityToolkit, + _request: IdentitytoolkitRelyingpartySignupNewUserRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RelyingpartyGetPublicKeyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RelyingpartySignupNewUserCall<'a, C, A> {} -impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RelyingpartySignupNewUserCall<'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, IdentitytoolkitRelyingpartyGetPublicKeysResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, SignupNewUserResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -4989,9 +5366,9 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.getPublicKeys", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.signupNewUser", + 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); @@ -5004,7 +5381,7 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartySignupNewUserCall<'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) -> RelyingpartyGetPublicKeyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RelyingpartySignupNewUserCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5113,7 +5514,7 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RelyingpartyGetPublicKeyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RelyingpartySignupNewUserCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5133,7 +5534,7 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RelyingpartyGetPublicKeyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RelyingpartySignupNewUserCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5145,9 +5546,9 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = IdentityToolkit::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest::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.relyingparty().get_recaptcha_param() +/// let result = hub.relyingparty().verify_phone_number(req) /// .doit(); /// # } /// ``` -pub struct RelyingpartyGetRecaptchaParamCall<'a, C, A> +pub struct RelyingpartyVerifyPhoneNumberCall<'a, C, A> where C: 'a, A: 'a { hub: &'a IdentityToolkit, + _request: IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RelyingpartyGetRecaptchaParamCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RelyingpartyVerifyPhoneNumberCall<'a, C, A> {} -impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RelyingpartyVerifyPhoneNumberCall<'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, GetRecaptchaParamResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -5199,9 +5607,9 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.getRecaptchaParam", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.verifyPhoneNumber", + 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); @@ -5214,7 +5622,7 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyPhoneNumberCall<'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) -> RelyingpartyGetRecaptchaParamCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> RelyingpartyVerifyPhoneNumberCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5323,7 +5755,7 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RelyingpartyGetRecaptchaParamCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RelyingpartyVerifyPhoneNumberCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5343,7 +5775,7 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RelyingpartyGetRecaptchaParamCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RelyingpartyVerifyPhoneNumberCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5837,6 +6269,247 @@ impl<'a, C, A> RelyingpartySetProjectConfigCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = IdentityToolkit::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = IdentitytoolkitRelyingpartySendVerificationCodeRequest::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.relyingparty().send_verification_code(req) +/// .doit(); +/// # } +/// ``` +pub struct RelyingpartySendVerificationCodeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a IdentityToolkit, + _request: IdentitytoolkitRelyingpartySendVerificationCodeRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RelyingpartySendVerificationCodeCall<'a, C, A> {} + +impl<'a, C, A> RelyingpartySendVerificationCodeCall<'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, IdentitytoolkitRelyingpartySendVerificationCodeResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "identitytoolkit.relyingparty.sendVerificationCode", + 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 = self.hub._base_url.clone() + "sendVerificationCode"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: IdentitytoolkitRelyingpartySendVerificationCodeRequest) -> RelyingpartySendVerificationCodeCall<'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) -> RelyingpartySendVerificationCodeCall<'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) -> RelyingpartySendVerificationCodeCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> RelyingpartySendVerificationCodeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Get project configuration. /// /// A builder for the *getProjectConfig* method supported by a *relyingparty* resource. diff --git a/gen/logging2-cli/Cargo.toml b/gen/logging2-cli/Cargo.toml index 84b369bd70..4ca7a15ae9 100644 --- a/gen/logging2-cli/Cargo.toml +++ b/gen/logging2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-logging2-cli" -version = "1.0.6+20170516" +version = "1.0.6+20170918" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-logging2] path = "../logging2" -version = "1.0.6+20170516" +version = "1.0.6+20170918" diff --git a/gen/logging2-cli/README.md b/gen/logging2-cli/README.md index a8b7741799..f0830bbc7f 100644 --- a/gen/logging2-cli/README.md +++ b/gen/logging2-cli/README.md @@ -25,40 +25,63 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Logging* API at revision *20170516*. The CLI is at version *1.0.6*. +This documentation was generated from the *Logging* API at revision *20170918*. The CLI is at version *1.0.6*. ```bash logging2 [options] billing-accounts + exclusions-create (-r )... [-p ]... [-o ] + exclusions-delete [-p ]... [-o ] + exclusions-get [-p ]... [-o ] + exclusions-list [-p ]... [-o ] + exclusions-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] sinks-create (-r )... [-p ]... [-o ] sinks-delete [-p ]... [-o ] sinks-get [-p ]... [-o ] sinks-list [-p ]... [-o ] + sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] entries list (-r )... [-p ]... [-o ] write (-r )... [-p ]... [-o ] folders + exclusions-create (-r )... [-p ]... [-o ] + exclusions-delete [-p ]... [-o ] + exclusions-get [-p ]... [-o ] + exclusions-list [-p ]... [-o ] + exclusions-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] sinks-create (-r )... [-p ]... [-o ] sinks-delete [-p ]... [-o ] sinks-get [-p ]... [-o ] sinks-list [-p ]... [-o ] + sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] monitored-resource-descriptors list [-p ]... [-o ] organizations + exclusions-create (-r )... [-p ]... [-o ] + exclusions-delete [-p ]... [-o ] + exclusions-get [-p ]... [-o ] + exclusions-list [-p ]... [-o ] + exclusions-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] sinks-create (-r )... [-p ]... [-o ] sinks-delete [-p ]... [-o ] sinks-get [-p ]... [-o ] sinks-list [-p ]... [-o ] + sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] projects + exclusions-create (-r )... [-p ]... [-o ] + exclusions-delete [-p ]... [-o ] + exclusions-get [-p ]... [-o ] + exclusions-list [-p ]... [-o ] + exclusions-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] metrics-create (-r )... [-p ]... [-o ] @@ -70,6 +93,7 @@ logging2 [options] sinks-delete [-p ]... [-o ] sinks-get [-p ]... [-o ] sinks-list [-p ]... [-o ] + sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] logging2 --help diff --git a/gen/logging2-cli/mkdocs.yml b/gen/logging2-cli/mkdocs.yml index bd53b7e4ba..6e5c8e17af 100644 --- a/gen/logging2-cli/mkdocs.yml +++ b/gen/logging2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.6+20170516 +site_name: Logging v1.0.6+20170918 site_url: http://byron.github.io/google-apis-rs/google-logging2-cli site_description: A complete library to interact with Logging (protocol v2) @@ -9,30 +9,53 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['billing-accounts_exclusions-create.md', 'Billing Accounts', 'Exclusions Create'] +- ['billing-accounts_exclusions-delete.md', 'Billing Accounts', 'Exclusions Delete'] +- ['billing-accounts_exclusions-get.md', 'Billing Accounts', 'Exclusions Get'] +- ['billing-accounts_exclusions-list.md', 'Billing Accounts', 'Exclusions List'] +- ['billing-accounts_exclusions-patch.md', 'Billing Accounts', 'Exclusions Patch'] - ['billing-accounts_logs-delete.md', 'Billing Accounts', 'Logs Delete'] - ['billing-accounts_logs-list.md', 'Billing Accounts', 'Logs List'] - ['billing-accounts_sinks-create.md', 'Billing Accounts', 'Sinks Create'] - ['billing-accounts_sinks-delete.md', 'Billing Accounts', 'Sinks Delete'] - ['billing-accounts_sinks-get.md', 'Billing Accounts', 'Sinks Get'] - ['billing-accounts_sinks-list.md', 'Billing Accounts', 'Sinks List'] +- ['billing-accounts_sinks-patch.md', 'Billing Accounts', 'Sinks Patch'] - ['billing-accounts_sinks-update.md', 'Billing Accounts', 'Sinks Update'] - ['entries_list.md', 'Entries', 'List'] - ['entries_write.md', 'Entries', 'Write'] +- ['folders_exclusions-create.md', 'Folders', 'Exclusions Create'] +- ['folders_exclusions-delete.md', 'Folders', 'Exclusions Delete'] +- ['folders_exclusions-get.md', 'Folders', 'Exclusions Get'] +- ['folders_exclusions-list.md', 'Folders', 'Exclusions List'] +- ['folders_exclusions-patch.md', 'Folders', 'Exclusions Patch'] - ['folders_logs-delete.md', 'Folders', 'Logs Delete'] - ['folders_logs-list.md', 'Folders', 'Logs List'] - ['folders_sinks-create.md', 'Folders', 'Sinks Create'] - ['folders_sinks-delete.md', 'Folders', 'Sinks Delete'] - ['folders_sinks-get.md', 'Folders', 'Sinks Get'] - ['folders_sinks-list.md', 'Folders', 'Sinks List'] +- ['folders_sinks-patch.md', 'Folders', 'Sinks Patch'] - ['folders_sinks-update.md', 'Folders', 'Sinks Update'] - ['monitored-resource-descriptors_list.md', 'Monitored Resource Descriptors', 'List'] +- ['organizations_exclusions-create.md', 'Organizations', 'Exclusions Create'] +- ['organizations_exclusions-delete.md', 'Organizations', 'Exclusions Delete'] +- ['organizations_exclusions-get.md', 'Organizations', 'Exclusions Get'] +- ['organizations_exclusions-list.md', 'Organizations', 'Exclusions List'] +- ['organizations_exclusions-patch.md', 'Organizations', 'Exclusions Patch'] - ['organizations_logs-delete.md', 'Organizations', 'Logs Delete'] - ['organizations_logs-list.md', 'Organizations', 'Logs List'] - ['organizations_sinks-create.md', 'Organizations', 'Sinks Create'] - ['organizations_sinks-delete.md', 'Organizations', 'Sinks Delete'] - ['organizations_sinks-get.md', 'Organizations', 'Sinks Get'] - ['organizations_sinks-list.md', 'Organizations', 'Sinks List'] +- ['organizations_sinks-patch.md', 'Organizations', 'Sinks Patch'] - ['organizations_sinks-update.md', 'Organizations', 'Sinks Update'] +- ['projects_exclusions-create.md', 'Projects', 'Exclusions Create'] +- ['projects_exclusions-delete.md', 'Projects', 'Exclusions Delete'] +- ['projects_exclusions-get.md', 'Projects', 'Exclusions Get'] +- ['projects_exclusions-list.md', 'Projects', 'Exclusions List'] +- ['projects_exclusions-patch.md', 'Projects', 'Exclusions Patch'] - ['projects_logs-delete.md', 'Projects', 'Logs Delete'] - ['projects_logs-list.md', 'Projects', 'Logs List'] - ['projects_metrics-create.md', 'Projects', 'Metrics Create'] @@ -44,6 +67,7 @@ pages: - ['projects_sinks-delete.md', 'Projects', 'Sinks Delete'] - ['projects_sinks-get.md', 'Projects', 'Sinks Get'] - ['projects_sinks-list.md', 'Projects', 'Sinks List'] +- ['projects_sinks-patch.md', 'Projects', 'Sinks Patch'] - ['projects_sinks-update.md', 'Projects', 'Sinks Update'] theme: readthedocs diff --git a/gen/logging2-cli/src/main.rs b/gen/logging2-cli/src/main.rs index 11feca233e..69ba93b9fe 100644 --- a/gen/logging2-cli/src/main.rs +++ b/gen/logging2-cli/src/main.rs @@ -46,6 +46,349 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _billing_accounts_exclusions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.billing_accounts().exclusions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _billing_accounts_exclusions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.billing_accounts().exclusions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _billing_accounts_exclusions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.billing_accounts().exclusions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _billing_accounts_exclusions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.billing_accounts().exclusions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _billing_accounts_exclusions_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.billing_accounts().exclusions_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _billing_accounts_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.billing_accounts().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -180,12 +523,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -416,6 +759,105 @@ impl<'n> Engine<'n> { } } + fn _billing_accounts_sinks_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["destination", "end-time", "filter", "include-children", "name", "output-version-format", "start-time", "writer-identity"]); + 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::LogSink = json::value::from_value(object).unwrap(); + let mut call = self.hub.billing_accounts().sinks_patch(request, opt.value_of("sink-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "unique-writer-identity" => { + call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); + }, + _ => { + 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(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _billing_accounts_sinks_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -439,12 +881,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -462,6 +904,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, "unique-writer-identity" => { call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); }, @@ -478,7 +923,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["unique-writer-identity"].iter().map(|v|*v)); + v.extend(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); v } )); } } @@ -625,11 +1070,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "resource.labels" => Some(("resource.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "resource.type" => Some(("resource.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-name" => Some(("logName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "partial-success" => Some(("partialSuccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "log-name" => Some(("logName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.labels" => Some(("resource.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "resource.type" => Some(("resource.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["labels", "log-name", "partial-success", "resource", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -691,6 +1136,349 @@ impl<'n> Engine<'n> { } } + fn _folders_exclusions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().exclusions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _folders_exclusions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.folders().exclusions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _folders_exclusions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.folders().exclusions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _folders_exclusions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.folders().exclusions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _folders_exclusions_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().exclusions_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _folders_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.folders().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -825,12 +1613,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -1061,6 +1849,105 @@ impl<'n> Engine<'n> { } } + fn _folders_sinks_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["destination", "end-time", "filter", "include-children", "name", "output-version-format", "start-time", "writer-identity"]); + 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::LogSink = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().sinks_patch(request, opt.value_of("sink-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "unique-writer-identity" => { + call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); + }, + _ => { + 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(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _folders_sinks_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1084,12 +1971,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -1107,6 +1994,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, "unique-writer-identity" => { call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); }, @@ -1123,7 +2013,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["unique-writer-identity"].iter().map(|v|*v)); + v.extend(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); v } )); } } @@ -1216,6 +2106,349 @@ impl<'n> Engine<'n> { } } + fn _organizations_exclusions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().exclusions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_exclusions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().exclusions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_exclusions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().exclusions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_exclusions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().exclusions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_exclusions_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().exclusions_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _organizations_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.organizations().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -1350,12 +2583,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -1586,6 +2819,105 @@ impl<'n> Engine<'n> { } } + fn _organizations_sinks_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["destination", "end-time", "filter", "include-children", "name", "output-version-format", "start-time", "writer-identity"]); + 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::LogSink = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().sinks_patch(request, opt.value_of("sink-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "unique-writer-identity" => { + call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); + }, + _ => { + 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(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _organizations_sinks_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1609,12 +2941,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -1632,6 +2964,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, "unique-writer-identity" => { call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); }, @@ -1648,7 +2983,350 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["unique-writer-identity"].iter().map(|v|*v)); + v.extend(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_exclusions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().exclusions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_exclusions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().exclusions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_exclusions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().exclusions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_exclusions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().exclusions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_exclusions_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "disabled", "filter", "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::LogExclusion = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().exclusions_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } @@ -1816,12 +3494,28 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.display-name" => Some(("metricDescriptor.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.name" => Some(("metricDescriptor.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.metric-kind" => Some(("metricDescriptor.metricKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.value-type" => Some(("metricDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.unit" => Some(("metricDescriptor.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.description" => Some(("metricDescriptor.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.scale" => Some(("bucketOptions.exponentialBuckets.scale", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.growth-factor" => Some(("bucketOptions.exponentialBuckets.growthFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.num-finite-buckets" => Some(("bucketOptions.exponentialBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.width" => Some(("bucketOptions.linearBuckets.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.num-finite-buckets" => Some(("bucketOptions.linearBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.offset" => Some(("bucketOptions.linearBuckets.offset", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.explicit-buckets.bounds" => Some(("bucketOptions.explicitBuckets.bounds", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "label-extractors" => Some(("labelExtractors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value-extractor" => Some(("valueExtractor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "label-extractors", "linear-buckets", "metric-descriptor", "metric-kind", "name", "num-finite-buckets", "offset", "scale", "type", "unit", "value-extractor", "value-type", "version", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2067,12 +3761,28 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.display-name" => Some(("metricDescriptor.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.name" => Some(("metricDescriptor.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.metric-kind" => Some(("metricDescriptor.metricKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.value-type" => Some(("metricDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.unit" => Some(("metricDescriptor.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.description" => Some(("metricDescriptor.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.scale" => Some(("bucketOptions.exponentialBuckets.scale", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.growth-factor" => Some(("bucketOptions.exponentialBuckets.growthFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.num-finite-buckets" => Some(("bucketOptions.exponentialBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.width" => Some(("bucketOptions.linearBuckets.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.num-finite-buckets" => Some(("bucketOptions.linearBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.offset" => Some(("bucketOptions.linearBuckets.offset", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.explicit-buckets.bounds" => Some(("bucketOptions.explicitBuckets.bounds", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "label-extractors" => Some(("labelExtractors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value-extractor" => Some(("valueExtractor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "label-extractors", "linear-buckets", "metric-descriptor", "metric-kind", "name", "num-finite-buckets", "offset", "scale", "type", "unit", "value-extractor", "value-type", "version", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2155,12 +3865,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -2391,6 +4101,105 @@ impl<'n> Engine<'n> { } } + fn _projects_sinks_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["destination", "end-time", "filter", "include-children", "name", "output-version-format", "start-time", "writer-identity"]); + 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::LogSink = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().sinks_patch(request, opt.value_of("sink-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "unique-writer-identity" => { + call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); + }, + _ => { + 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(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_sinks_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2414,12 +4223,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -2437,6 +4246,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, "unique-writer-identity" => { call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); }, @@ -2453,7 +4265,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["unique-writer-identity"].iter().map(|v|*v)); + v.extend(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); v } )); } } @@ -2494,6 +4306,21 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("billing-accounts", Some(opt)) => { match opt.subcommand() { + ("exclusions-create", Some(opt)) => { + call_result = self._billing_accounts_exclusions_create(opt, dry_run, &mut err); + }, + ("exclusions-delete", Some(opt)) => { + call_result = self._billing_accounts_exclusions_delete(opt, dry_run, &mut err); + }, + ("exclusions-get", Some(opt)) => { + call_result = self._billing_accounts_exclusions_get(opt, dry_run, &mut err); + }, + ("exclusions-list", Some(opt)) => { + call_result = self._billing_accounts_exclusions_list(opt, dry_run, &mut err); + }, + ("exclusions-patch", Some(opt)) => { + call_result = self._billing_accounts_exclusions_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._billing_accounts_logs_delete(opt, dry_run, &mut err); }, @@ -2512,6 +4339,9 @@ impl<'n> Engine<'n> { ("sinks-list", Some(opt)) => { call_result = self._billing_accounts_sinks_list(opt, dry_run, &mut err); }, + ("sinks-patch", Some(opt)) => { + call_result = self._billing_accounts_sinks_patch(opt, dry_run, &mut err); + }, ("sinks-update", Some(opt)) => { call_result = self._billing_accounts_sinks_update(opt, dry_run, &mut err); }, @@ -2537,6 +4367,21 @@ impl<'n> Engine<'n> { }, ("folders", Some(opt)) => { match opt.subcommand() { + ("exclusions-create", Some(opt)) => { + call_result = self._folders_exclusions_create(opt, dry_run, &mut err); + }, + ("exclusions-delete", Some(opt)) => { + call_result = self._folders_exclusions_delete(opt, dry_run, &mut err); + }, + ("exclusions-get", Some(opt)) => { + call_result = self._folders_exclusions_get(opt, dry_run, &mut err); + }, + ("exclusions-list", Some(opt)) => { + call_result = self._folders_exclusions_list(opt, dry_run, &mut err); + }, + ("exclusions-patch", Some(opt)) => { + call_result = self._folders_exclusions_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._folders_logs_delete(opt, dry_run, &mut err); }, @@ -2555,6 +4400,9 @@ impl<'n> Engine<'n> { ("sinks-list", Some(opt)) => { call_result = self._folders_sinks_list(opt, dry_run, &mut err); }, + ("sinks-patch", Some(opt)) => { + call_result = self._folders_sinks_patch(opt, dry_run, &mut err); + }, ("sinks-update", Some(opt)) => { call_result = self._folders_sinks_update(opt, dry_run, &mut err); }, @@ -2577,6 +4425,21 @@ impl<'n> Engine<'n> { }, ("organizations", Some(opt)) => { match opt.subcommand() { + ("exclusions-create", Some(opt)) => { + call_result = self._organizations_exclusions_create(opt, dry_run, &mut err); + }, + ("exclusions-delete", Some(opt)) => { + call_result = self._organizations_exclusions_delete(opt, dry_run, &mut err); + }, + ("exclusions-get", Some(opt)) => { + call_result = self._organizations_exclusions_get(opt, dry_run, &mut err); + }, + ("exclusions-list", Some(opt)) => { + call_result = self._organizations_exclusions_list(opt, dry_run, &mut err); + }, + ("exclusions-patch", Some(opt)) => { + call_result = self._organizations_exclusions_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._organizations_logs_delete(opt, dry_run, &mut err); }, @@ -2595,6 +4458,9 @@ impl<'n> Engine<'n> { ("sinks-list", Some(opt)) => { call_result = self._organizations_sinks_list(opt, dry_run, &mut err); }, + ("sinks-patch", Some(opt)) => { + call_result = self._organizations_sinks_patch(opt, dry_run, &mut err); + }, ("sinks-update", Some(opt)) => { call_result = self._organizations_sinks_update(opt, dry_run, &mut err); }, @@ -2606,6 +4472,21 @@ impl<'n> Engine<'n> { }, ("projects", Some(opt)) => { match opt.subcommand() { + ("exclusions-create", Some(opt)) => { + call_result = self._projects_exclusions_create(opt, dry_run, &mut err); + }, + ("exclusions-delete", Some(opt)) => { + call_result = self._projects_exclusions_delete(opt, dry_run, &mut err); + }, + ("exclusions-get", Some(opt)) => { + call_result = self._projects_exclusions_get(opt, dry_run, &mut err); + }, + ("exclusions-list", Some(opt)) => { + call_result = self._projects_exclusions_list(opt, dry_run, &mut err); + }, + ("exclusions-patch", Some(opt)) => { + call_result = self._projects_exclusions_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._projects_logs_delete(opt, dry_run, &mut err); }, @@ -2639,6 +4520,9 @@ impl<'n> Engine<'n> { ("sinks-list", Some(opt)) => { call_result = self._projects_sinks_list(opt, dry_run, &mut err); }, + ("sinks-patch", Some(opt)) => { + call_result = self._projects_sinks_patch(opt, dry_run, &mut err); + }, ("sinks-update", Some(opt)) => { call_result = self._projects_sinks_update(opt, dry_run, &mut err); }, @@ -2734,7 +4618,154 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("billing-accounts", "methods: 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ + ("billing-accounts", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("exclusions-create", + Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_exclusions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource in which to create the exclusion: + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), + ]), + ("exclusions-delete", + Some(r##"Deletes an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_exclusions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion to delete: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-get", + Some(r##"Gets the description of an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_exclusions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-list", + Some(r##"Lists all the exclusions in a parent resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_exclusions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose exclusions are to be listed. + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + "##), + 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)), + ]), + ("exclusions-patch", + Some(r##"Changes one or more properties of an existing exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_exclusions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the exclusion to update: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), ("logs-delete", Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_logs-delete", @@ -2790,7 +4821,7 @@ fn main() { Some(false)), ]), ("sinks-create", - Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), + Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_sinks-create", vec![ (Some(r##"parent"##), @@ -2897,6 +4928,39 @@ 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)), + ]), + ("sinks-patch", + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_sinks-patch", + vec![ + (Some(r##"sink-name"##), + None, + Some(r##"Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + "projects/[PROJECT_ID]/sinks/[SINK_ID]" + "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + "folders/[FOLDER_ID]/sinks/[SINK_ID]" + Example: "projects/my-project-id/sinks/my-sink-id"."##), + 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"##), @@ -2904,7 +4968,7 @@ fn main() { Some(false)), ]), ("sinks-update", - Some(r##"Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field."##), + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_sinks-update", vec![ (Some(r##"sink-name"##), @@ -2962,7 +5026,7 @@ fn main() { Some(false)), ]), ("write", - Some(r##"Writes log entries to Stackdriver Logging."##), + Some(r##"Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/entries_write", vec![ (Some(r##"kv"##), @@ -2985,7 +5049,154 @@ fn main() { ]), ]), - ("folders", "methods: 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ + ("folders", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("exclusions-create", + Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_exclusions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource in which to create the exclusion: + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), + ]), + ("exclusions-delete", + Some(r##"Deletes an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_exclusions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion to delete: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-get", + Some(r##"Gets the description of an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_exclusions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-list", + Some(r##"Lists all the exclusions in a parent resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_exclusions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose exclusions are to be listed. + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + "##), + 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)), + ]), + ("exclusions-patch", + Some(r##"Changes one or more properties of an existing exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_exclusions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the exclusion to update: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), ("logs-delete", Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_logs-delete", @@ -3041,7 +5252,7 @@ fn main() { Some(false)), ]), ("sinks-create", - Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), + Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_sinks-create", vec![ (Some(r##"parent"##), @@ -3148,6 +5359,39 @@ 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)), + ]), + ("sinks-patch", + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_sinks-patch", + vec![ + (Some(r##"sink-name"##), + None, + Some(r##"Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + "projects/[PROJECT_ID]/sinks/[SINK_ID]" + "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + "folders/[FOLDER_ID]/sinks/[SINK_ID]" + Example: "projects/my-project-id/sinks/my-sink-id"."##), + 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"##), @@ -3155,7 +5399,7 @@ fn main() { Some(false)), ]), ("sinks-update", - Some(r##"Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field."##), + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_sinks-update", vec![ (Some(r##"sink-name"##), @@ -3208,7 +5452,154 @@ fn main() { ]), ]), - ("organizations", "methods: 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ + ("organizations", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("exclusions-create", + Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_exclusions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource in which to create the exclusion: + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), + ]), + ("exclusions-delete", + Some(r##"Deletes an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_exclusions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion to delete: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-get", + Some(r##"Gets the description of an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_exclusions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-list", + Some(r##"Lists all the exclusions in a parent resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_exclusions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose exclusions are to be listed. + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + "##), + 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)), + ]), + ("exclusions-patch", + Some(r##"Changes one or more properties of an existing exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_exclusions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the exclusion to update: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), ("logs-delete", Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_logs-delete", @@ -3264,7 +5655,7 @@ fn main() { Some(false)), ]), ("sinks-create", - Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), + Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_sinks-create", vec![ (Some(r##"parent"##), @@ -3371,6 +5762,39 @@ 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)), + ]), + ("sinks-patch", + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_sinks-patch", + vec![ + (Some(r##"sink-name"##), + None, + Some(r##"Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + "projects/[PROJECT_ID]/sinks/[SINK_ID]" + "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + "folders/[FOLDER_ID]/sinks/[SINK_ID]" + Example: "projects/my-project-id/sinks/my-sink-id"."##), + 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"##), @@ -3378,7 +5802,7 @@ fn main() { Some(false)), ]), ("sinks-update", - Some(r##"Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field."##), + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_sinks-update", vec![ (Some(r##"sink-name"##), @@ -3412,7 +5836,154 @@ fn main() { ]), ]), - ("projects", "methods: 'logs-delete', 'logs-list', 'metrics-create', 'metrics-delete', 'metrics-get', 'metrics-list', 'metrics-update', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ + ("projects", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'metrics-create', 'metrics-delete', 'metrics-get', 'metrics-list', 'metrics-update', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("exclusions-create", + Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_exclusions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource in which to create the exclusion: + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), + ]), + ("exclusions-delete", + Some(r##"Deletes an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_exclusions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion to delete: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-get", + Some(r##"Gets the description of an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_exclusions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of an existing exclusion: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), + ("exclusions-list", + Some(r##"Lists all the exclusions in a parent resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_exclusions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose exclusions are to be listed. + "projects/[PROJECT_ID]" + "organizations/[ORGANIZATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]" + "folders/[FOLDER_ID]" + "##), + 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)), + ]), + ("exclusions-patch", + Some(r##"Changes one or more properties of an existing exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_exclusions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the exclusion to update: + "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + Example: "projects/my-project-id/exclusions/my-exclusion-id"."##), + 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)), + ]), ("logs-delete", Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_logs-delete", @@ -3600,7 +6171,7 @@ fn main() { Some(false)), ]), ("sinks-create", - Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), + Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_sinks-create", vec![ (Some(r##"parent"##), @@ -3707,6 +6278,39 @@ 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)), + ]), + ("sinks-patch", + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_sinks-patch", + vec![ + (Some(r##"sink-name"##), + None, + Some(r##"Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + "projects/[PROJECT_ID]/sinks/[SINK_ID]" + "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + "folders/[FOLDER_ID]/sinks/[SINK_ID]" + Example: "projects/my-project-id/sinks/my-sink-id"."##), + 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"##), @@ -3714,7 +6318,7 @@ fn main() { Some(false)), ]), ("sinks-update", - Some(r##"Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field."##), + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_sinks-update", vec![ (Some(r##"sink-name"##), @@ -3752,7 +6356,7 @@ fn main() { let mut app = App::new("logging2") .author("Sebastian Thiel ") - .version("1.0.6+20170516") + .version("1.0.6+20170918") .about("Writes log entries and manages your Stackdriver Logging configuration.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_logging2_cli") .arg(Arg::with_name("url") diff --git a/gen/logging2/Cargo.toml b/gen/logging2/Cargo.toml index bfae6b243c..4dea119612 100644 --- a/gen/logging2/Cargo.toml +++ b/gen/logging2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-logging2" -version = "1.0.6+20170516" +version = "1.0.6+20170918" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2" homepage = "https://cloud.google.com/logging/docs/" -documentation = "https://docs.rs/google-logging2/1.0.6+20170516" +documentation = "https://docs.rs/google-logging2/1.0.6+20170918" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] diff --git a/gen/logging2/README.md b/gen/logging2/README.md index c3f7069861..801be0d29f 100644 --- a/gen/logging2/README.md +++ b/gen/logging2/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-logging2` library allows access to all features of the *Google Logging* service. -This documentation was generated from *Logging* crate version *1.0.6+20170516*, where *20170516* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Logging* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Logging* *v2* API can be found at the [official documentation site](https://cloud.google.com/logging/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.Logging.html) ... * billing accounts - * [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.BillingAccountSinkUpdateCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.BillingAccountSinkUpdateCall.html) * entries - * [*list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.EntryWriteCall.html) + * [*list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.EntryWriteCall.html) * folders - * [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.FolderSinkUpdateCall.html) -* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.MonitoredResourceDescriptor.html) - * [*list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.MonitoredResourceDescriptorListCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.FolderSinkUpdateCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.OrganizationSinkUpdateCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.OrganizationSinkUpdateCall.html) * projects - * [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.ProjectSinkUpdateCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.ProjectSinkUpdateCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/struct.Logging.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -57,17 +57,21 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().sinks_update(...).doit() +let r = hub.organizations().sinks_patch(...).doit() +let r = hub.projects().sinks_get(...).doit() let r = hub.billing_accounts().sinks_get(...).doit() let r = hub.billing_accounts().sinks_create(...).doit() +let r = hub.billing_accounts().sinks_patch(...).doit() let r = hub.folders().sinks_create(...).doit() +let r = hub.projects().sinks_update(...).doit() +let r = hub.projects().sinks_patch(...).doit() let r = hub.organizations().sinks_create(...).doit() let r = hub.organizations().sinks_update(...).doit() -let r = hub.billing_accounts().sinks_update(...).doit() +let r = hub.folders().sinks_patch(...).doit() let r = hub.organizations().sinks_get(...).doit() let r = hub.projects().sinks_create(...).doit() let r = hub.folders().sinks_update(...).doit() -let r = hub.projects().sinks_get(...).doit() +let r = hub.billing_accounts().sinks_update(...).doit() let r = hub.folders().sinks_get(...).doit() ``` @@ -120,8 +124,9 @@ let mut req = LogSink::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().sinks_update(req, "sinkName") - .unique_writer_identity(true) +let result = hub.organizations().sinks_patch(req, "sinkName") + .update_mask("sit") + .unique_writer_identity(false) .doit(); match result { @@ -144,17 +149,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/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")`. @@ -164,29 +169,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/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](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/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](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/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](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/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](https://docs.rs/google-logging2/1.0.6+20170516/google_logging2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/logging2/src/lib.rs b/gen/logging2/src/lib.rs index eeb28442df..0c06b3ba8f 100644 --- a/gen/logging2/src/lib.rs +++ b/gen/logging2/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 *Logging* crate version *1.0.6+20170516*, where *20170516* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Logging* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Logging* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/logging/docs/). @@ -12,17 +12,17 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Logging.html) ... //! //! * billing accounts -//! * [*logs delete*](struct.BillingAccountLogDeleteCall.html), [*logs list*](struct.BillingAccountLogListCall.html), [*sinks create*](struct.BillingAccountSinkCreateCall.html), [*sinks delete*](struct.BillingAccountSinkDeleteCall.html), [*sinks get*](struct.BillingAccountSinkGetCall.html), [*sinks list*](struct.BillingAccountSinkListCall.html) and [*sinks update*](struct.BillingAccountSinkUpdateCall.html) +//! * [*exclusions create*](struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](struct.BillingAccountExclusionGetCall.html), [*exclusions list*](struct.BillingAccountExclusionListCall.html), [*exclusions patch*](struct.BillingAccountExclusionPatchCall.html), [*logs delete*](struct.BillingAccountLogDeleteCall.html), [*logs list*](struct.BillingAccountLogListCall.html), [*sinks create*](struct.BillingAccountSinkCreateCall.html), [*sinks delete*](struct.BillingAccountSinkDeleteCall.html), [*sinks get*](struct.BillingAccountSinkGetCall.html), [*sinks list*](struct.BillingAccountSinkListCall.html), [*sinks patch*](struct.BillingAccountSinkPatchCall.html) and [*sinks update*](struct.BillingAccountSinkUpdateCall.html) //! * entries //! * [*list*](struct.EntryListCall.html) and [*write*](struct.EntryWriteCall.html) //! * folders -//! * [*logs delete*](struct.FolderLogDeleteCall.html), [*logs list*](struct.FolderLogListCall.html), [*sinks create*](struct.FolderSinkCreateCall.html), [*sinks delete*](struct.FolderSinkDeleteCall.html), [*sinks get*](struct.FolderSinkGetCall.html), [*sinks list*](struct.FolderSinkListCall.html) and [*sinks update*](struct.FolderSinkUpdateCall.html) +//! * [*exclusions create*](struct.FolderExclusionCreateCall.html), [*exclusions delete*](struct.FolderExclusionDeleteCall.html), [*exclusions get*](struct.FolderExclusionGetCall.html), [*exclusions list*](struct.FolderExclusionListCall.html), [*exclusions patch*](struct.FolderExclusionPatchCall.html), [*logs delete*](struct.FolderLogDeleteCall.html), [*logs list*](struct.FolderLogListCall.html), [*sinks create*](struct.FolderSinkCreateCall.html), [*sinks delete*](struct.FolderSinkDeleteCall.html), [*sinks get*](struct.FolderSinkGetCall.html), [*sinks list*](struct.FolderSinkListCall.html), [*sinks patch*](struct.FolderSinkPatchCall.html) and [*sinks update*](struct.FolderSinkUpdateCall.html) //! * [monitored resource descriptors](struct.MonitoredResourceDescriptor.html) //! * [*list*](struct.MonitoredResourceDescriptorListCall.html) //! * organizations -//! * [*logs delete*](struct.OrganizationLogDeleteCall.html), [*logs list*](struct.OrganizationLogListCall.html), [*sinks create*](struct.OrganizationSinkCreateCall.html), [*sinks delete*](struct.OrganizationSinkDeleteCall.html), [*sinks get*](struct.OrganizationSinkGetCall.html), [*sinks list*](struct.OrganizationSinkListCall.html) and [*sinks update*](struct.OrganizationSinkUpdateCall.html) +//! * [*exclusions create*](struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](struct.OrganizationExclusionGetCall.html), [*exclusions list*](struct.OrganizationExclusionListCall.html), [*exclusions patch*](struct.OrganizationExclusionPatchCall.html), [*logs delete*](struct.OrganizationLogDeleteCall.html), [*logs list*](struct.OrganizationLogListCall.html), [*sinks create*](struct.OrganizationSinkCreateCall.html), [*sinks delete*](struct.OrganizationSinkDeleteCall.html), [*sinks get*](struct.OrganizationSinkGetCall.html), [*sinks list*](struct.OrganizationSinkListCall.html), [*sinks patch*](struct.OrganizationSinkPatchCall.html) and [*sinks update*](struct.OrganizationSinkUpdateCall.html) //! * projects -//! * [*logs delete*](struct.ProjectLogDeleteCall.html), [*logs list*](struct.ProjectLogListCall.html), [*metrics create*](struct.ProjectMetricCreateCall.html), [*metrics delete*](struct.ProjectMetricDeleteCall.html), [*metrics get*](struct.ProjectMetricGetCall.html), [*metrics list*](struct.ProjectMetricListCall.html), [*metrics update*](struct.ProjectMetricUpdateCall.html), [*sinks create*](struct.ProjectSinkCreateCall.html), [*sinks delete*](struct.ProjectSinkDeleteCall.html), [*sinks get*](struct.ProjectSinkGetCall.html), [*sinks list*](struct.ProjectSinkListCall.html) and [*sinks update*](struct.ProjectSinkUpdateCall.html) +//! * [*exclusions create*](struct.ProjectExclusionCreateCall.html), [*exclusions delete*](struct.ProjectExclusionDeleteCall.html), [*exclusions get*](struct.ProjectExclusionGetCall.html), [*exclusions list*](struct.ProjectExclusionListCall.html), [*exclusions patch*](struct.ProjectExclusionPatchCall.html), [*logs delete*](struct.ProjectLogDeleteCall.html), [*logs list*](struct.ProjectLogListCall.html), [*metrics create*](struct.ProjectMetricCreateCall.html), [*metrics delete*](struct.ProjectMetricDeleteCall.html), [*metrics get*](struct.ProjectMetricGetCall.html), [*metrics list*](struct.ProjectMetricListCall.html), [*metrics update*](struct.ProjectMetricUpdateCall.html), [*sinks create*](struct.ProjectSinkCreateCall.html), [*sinks delete*](struct.ProjectSinkDeleteCall.html), [*sinks get*](struct.ProjectSinkGetCall.html), [*sinks list*](struct.ProjectSinkListCall.html), [*sinks patch*](struct.ProjectSinkPatchCall.html) and [*sinks update*](struct.ProjectSinkUpdateCall.html) //! //! //! @@ -57,17 +57,21 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().sinks_update(...).doit() +//! let r = hub.organizations().sinks_patch(...).doit() +//! let r = hub.projects().sinks_get(...).doit() //! let r = hub.billing_accounts().sinks_get(...).doit() //! let r = hub.billing_accounts().sinks_create(...).doit() +//! let r = hub.billing_accounts().sinks_patch(...).doit() //! let r = hub.folders().sinks_create(...).doit() +//! let r = hub.projects().sinks_update(...).doit() +//! let r = hub.projects().sinks_patch(...).doit() //! let r = hub.organizations().sinks_create(...).doit() //! let r = hub.organizations().sinks_update(...).doit() -//! let r = hub.billing_accounts().sinks_update(...).doit() +//! let r = hub.folders().sinks_patch(...).doit() //! let r = hub.organizations().sinks_get(...).doit() //! let r = hub.projects().sinks_create(...).doit() //! let r = hub.folders().sinks_update(...).doit() -//! let r = hub.projects().sinks_get(...).doit() +//! let r = hub.billing_accounts().sinks_update(...).doit() //! let r = hub.folders().sinks_get(...).doit() //! ``` //! @@ -121,7 +125,8 @@ //! // 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().sinks_update(req, "sinkName") +//! let result = hub.organizations().sinks_patch(req, "sinkName") +//! .update_mask("et") //! .unique_writer_identity(true) //! .doit(); //! @@ -245,14 +250,14 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// Administrate log data for your projects - Admin, + /// Submit log data for your projects + Write, /// View log data for your projects Read, - /// Submit log data for your projects - Write, + /// Administrate log data for your projects + Admin, /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -264,9 +269,9 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::Admin => "https://www.googleapis.com/auth/logging.admin", - Scope::Read => "https://www.googleapis.com/auth/logging.read", Scope::Write => "https://www.googleapis.com/auth/logging.write", + Scope::Read => "https://www.googleapis.com/auth/logging.read", + Scope::Admin => "https://www.googleapis.com/auth/logging.admin", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } @@ -323,7 +328,8 @@ impl Default for Scope { /// // 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().sinks_update(req, "sinkName") +/// let result = hub.organizations().sinks_patch(req, "sinkName") +/// .update_mask("accusam") /// .unique_writer_identity(true) /// .doit(); /// @@ -430,7 +436,7 @@ pub struct ListLogEntriesResponse { /// If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A list of log entries. + /// A list of log entries. If entries is empty, nextPageToken may still be returned, indicating that more entries may exist. See nextPageToken for more information. pub entries: Option>, } @@ -454,6 +460,25 @@ pub struct LogEntrySourceLocation { impl Part for LogEntrySourceLocation {} +/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 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 Exponential { + /// Must be greater than 0. + pub scale: Option, + /// Must be greater than 1. + #[serde(rename="growthFactor")] + pub growth_factor: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, +} + +impl Part for Exponential {} + + /// Result returned from ListLogs. /// /// # Activities @@ -479,25 +504,70 @@ pub struct ListLogsResponse { impl ResponseResult for ListLogsResponse {} -/// Result returned from ListLogMetrics. +/// Specifies a set of log entries that are not to be stored in Stackdriver Logging. If your project receives a large volume of logs, you might be able to use exclusions to reduce your chargeable logs. Exclusions are processed after log sinks, so you can export log entries before they are excluded. Audit log entries and log entries from Amazon Web Services are never excluded. /// /// # 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*). /// -/// * [metrics list projects](struct.ProjectMetricListCall.html) (response) +/// * [exclusions get folders](struct.FolderExclusionGetCall.html) (response) +/// * [exclusions create organizations](struct.OrganizationExclusionCreateCall.html) (request|response) +/// * [exclusions get projects](struct.ProjectExclusionGetCall.html) (response) +/// * [exclusions create projects](struct.ProjectExclusionCreateCall.html) (request|response) +/// * [exclusions patch projects](struct.ProjectExclusionPatchCall.html) (request|response) +/// * [exclusions patch folders](struct.FolderExclusionPatchCall.html) (request|response) +/// * [exclusions patch organizations](struct.OrganizationExclusionPatchCall.html) (request|response) +/// * [exclusions get billing accounts](struct.BillingAccountExclusionGetCall.html) (response) +/// * [exclusions patch billing accounts](struct.BillingAccountExclusionPatchCall.html) (request|response) +/// * [exclusions get organizations](struct.OrganizationExclusionGetCall.html) (response) +/// * [exclusions create billing accounts](struct.BillingAccountExclusionCreateCall.html) (request|response) +/// * [exclusions create folders](struct.FolderExclusionCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListLogMetricsResponse { - /// A list of logs-based metrics. - pub metrics: Option>, - /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, +pub struct LogExclusion { + /// Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can use exclusions.patch to change the value of this field. + pub disabled: Option, + /// Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. For example, the following filter matches 99% of low-severity log entries from load balancers: + /// "resource.type=http_load_balancer severity, + /// Required. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. + pub name: Option, + /// Optional. A description of this exclusion. + pub description: Option, } -impl ResponseResult for ListLogMetricsResponse {} +impl RequestValue for LogExclusion {} +impl ResponseResult for LogExclusion {} + + +/// Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Explicit { + /// The values must be monotonically increasing. + pub bounds: Option>, +} + +impl Part for Explicit {} + + +/// Result returned from WriteLogEntries. 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*). +/// +/// * [write entries](struct.EntryWriteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WriteLogEntriesResponse { _never_set: Option } + +impl ResponseResult for WriteLogEntriesResponse {} /// An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "instance_id" and "zone": @@ -520,23 +590,28 @@ pub struct MonitoredResource { impl Part for MonitoredResource {} -/// Additional information about a potentially long-running operation with which a log entry is associated. +/// Result returned from ListExclusions. /// -/// 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*). +/// +/// * [exclusions list projects](struct.ProjectExclusionListCall.html) (response) +/// * [exclusions list billing accounts](struct.BillingAccountExclusionListCall.html) (response) +/// * [exclusions list folders](struct.FolderExclusionListCall.html) (response) +/// * [exclusions list organizations](struct.OrganizationExclusionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogEntryOperation { - /// Optional. Set this to True if this is the last log entry in the operation. - pub last: Option, - /// Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. - pub id: Option, - /// Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication". - pub producer: Option, - /// Optional. Set this to True if this is the first log entry in the operation. - pub first: Option, +pub struct ListExclusionsResponse { + /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of exclusions. + pub exclusions: Option>, } -impl Part for LogEntryOperation {} +impl ResponseResult for ListExclusionsResponse {} /// Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder. @@ -546,24 +621,28 @@ impl Part for LogEntryOperation {} /// 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*). /// -/// * [sinks update projects](struct.ProjectSinkUpdateCall.html) (request|response) +/// * [sinks patch organizations](struct.OrganizationSinkPatchCall.html) (request|response) +/// * [sinks get projects](struct.ProjectSinkGetCall.html) (response) /// * [sinks get billing accounts](struct.BillingAccountSinkGetCall.html) (response) /// * [sinks create billing accounts](struct.BillingAccountSinkCreateCall.html) (request|response) +/// * [sinks patch billing accounts](struct.BillingAccountSinkPatchCall.html) (request|response) /// * [sinks create folders](struct.FolderSinkCreateCall.html) (request|response) +/// * [sinks update projects](struct.ProjectSinkUpdateCall.html) (request|response) +/// * [sinks patch projects](struct.ProjectSinkPatchCall.html) (request|response) /// * [sinks create organizations](struct.OrganizationSinkCreateCall.html) (request|response) /// * [sinks update organizations](struct.OrganizationSinkUpdateCall.html) (request|response) -/// * [sinks update billing accounts](struct.BillingAccountSinkUpdateCall.html) (request|response) +/// * [sinks patch folders](struct.FolderSinkPatchCall.html) (request|response) /// * [sinks get organizations](struct.OrganizationSinkGetCall.html) (response) /// * [sinks create projects](struct.ProjectSinkCreateCall.html) (request|response) /// * [sinks update folders](struct.FolderSinkUpdateCall.html) (request|response) -/// * [sinks get projects](struct.ProjectSinkGetCall.html) (response) +/// * [sinks update billing accounts](struct.BillingAccountSinkUpdateCall.html) (request|response) /// * [sinks get folders](struct.FolderSinkGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogSink { - /// Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API. - #[serde(rename="outputVersionFormat")] - pub output_version_format: Option, + /// Deprecated. This field is ignored when creating or updating sinks. + #[serde(rename="endTime")] + pub end_time: Option, /// Required. The client-assigned sink identifier, unique within the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. pub name: Option, /// Required. The export destination: @@ -572,16 +651,16 @@ pub struct LogSink { /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" /// The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks. pub destination: Option, - /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format: + /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. For example: /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR /// pub filter: Option, - /// Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated. + /// Deprecated. This field is ignored when creating or updating sinks. #[serde(rename="startTime")] pub start_time: Option, - /// Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time. - #[serde(rename="endTime")] - pub end_time: Option, + /// Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed. + #[serde(rename="outputVersionFormat")] + pub output_version_format: Option, /// Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting access for a resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity. #[serde(rename="writerIdentity")] pub writer_identity: Option, @@ -650,11 +729,15 @@ impl RequestValue for ListLogEntriesRequest {} /// * [logs delete projects](struct.ProjectLogDeleteCall.html) (response) /// * [sinks delete folders](struct.FolderSinkDeleteCall.html) (response) /// * [sinks delete organizations](struct.OrganizationSinkDeleteCall.html) (response) +/// * [exclusions delete billing accounts](struct.BillingAccountExclusionDeleteCall.html) (response) /// * [sinks delete billing accounts](struct.BillingAccountSinkDeleteCall.html) (response) /// * [logs delete folders](struct.FolderLogDeleteCall.html) (response) /// * [metrics delete projects](struct.ProjectMetricDeleteCall.html) (response) +/// * [exclusions delete organizations](struct.OrganizationExclusionDeleteCall.html) (response) /// * [sinks delete projects](struct.ProjectSinkDeleteCall.html) (response) +/// * [exclusions delete projects](struct.ProjectExclusionDeleteCall.html) (response) /// * [logs delete billing accounts](struct.BillingAccountLogDeleteCall.html) (response) +/// * [exclusions delete folders](struct.FolderExclusionDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -670,29 +753,31 @@ impl ResponseResult for Empty {} pub struct HttpRequest { /// The response code indicating the status of response. Examples: 200, 404. pub status: Option, - /// Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True. - #[serde(rename="cacheValidatedWithOriginServer")] - pub cache_validated_with_origin_server: Option, /// The request processing latency on the server, from the time the request was received until the response was sent. pub latency: Option, + /// Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + pub protocol: Option, + /// The request method. Examples: "GET", "HEAD", "PUT", "POST". + #[serde(rename="requestMethod")] + pub request_method: Option, /// The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted. #[serde(rename="cacheFillBytes")] pub cache_fill_bytes: Option, /// The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: "http://example.com/some/info?color=red". #[serde(rename="requestUrl")] pub request_url: Option, - /// Whether or not an entity was served from cache (with or without validation). - #[serde(rename="cacheHit")] - pub cache_hit: Option, /// The IP address (IPv4 or IPv6) of the origin server that the request was sent to. #[serde(rename="serverIp")] pub server_ip: Option, /// Whether or not a cache lookup was attempted. #[serde(rename="cacheLookup")] pub cache_lookup: Option, - /// The request method. Examples: "GET", "HEAD", "PUT", "POST". - #[serde(rename="requestMethod")] - pub request_method: Option, + /// Whether or not an entity was served from cache (with or without validation). + #[serde(rename="cacheHit")] + pub cache_hit: Option, + /// Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True. + #[serde(rename="cacheValidatedWithOriginServer")] + pub cache_validated_with_origin_server: Option, /// The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). pub referer: Option, /// The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". @@ -734,6 +819,99 @@ pub struct ListMonitoredResourceDescriptorsResponse { impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} +/// Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 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 Linear { + /// Must be greater than 0. + pub width: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, + /// Lower bound of the first bucket. + pub offset: Option, +} + +impl Part for Linear {} + + +/// Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetricDescriptor { + /// A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". + #[serde(rename="displayName")] + pub display_name: Option, + /// The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id: + /// "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" + /// + pub name: Option, + /// Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported. + #[serde(rename="metricKind")] + pub metric_kind: Option, + /// Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported. + #[serde(rename="valueType")] + pub value_type: Option, + /// The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. + pub labels: Option>, + /// The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: + /// "custom.googleapis.com/invoice/paid/amount" + /// "appengine.googleapis.com/http/server/response_latencies" + /// + #[serde(rename="type")] + pub type_: Option, + /// The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) + /// bit bit + /// By byte + /// s second + /// min minute + /// h hour + /// d dayPrefixes (PREFIX) + /// k kilo (10**3) + /// M mega (10**6) + /// G giga (10**9) + /// T tera (10**12) + /// P peta (10**15) + /// E exa (10**18) + /// Z zetta (10**21) + /// Y yotta (10**24) + /// m milli (10**-3) + /// u micro (10**-6) + /// n nano (10**-9) + /// p pico (10**-12) + /// f femto (10**-15) + /// a atto (10**-18) + /// z zepto (10**-21) + /// y yocto (10**-24) + /// Ki kibi (2**10) + /// Mi mebi (2**20) + /// Gi gibi (2**30) + /// Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors: + /// / division (as an infix operator, e.g. 1/s). + /// . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: + /// Expression = Component { "." Component } { "/" Component } ; + /// + /// Component = [ PREFIX ] UNIT [ Annotation ] + /// | Annotation + /// | "1" + /// ; + /// + /// Annotation = "{" NAME "}" ; + /// Notes: + /// Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. + /// NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. + pub unit: Option, + /// A detailed description of the metric, which can be used in documentation. + pub description: Option, +} + +impl Part for MetricDescriptor {} + + /// Result returned from ListSinks. /// /// # Activities @@ -758,19 +936,52 @@ pub struct ListSinksResponse { impl ResponseResult for ListSinksResponse {} -/// Result returned from WriteLogEntries. empty +/// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketOptions { + /// The exponential buckets. + #[serde(rename="exponentialBuckets")] + pub exponential_buckets: Option, + /// The linear bucket. + #[serde(rename="linearBuckets")] + pub linear_buckets: Option, + /// The explicit buckets. + #[serde(rename="explicitBuckets")] + pub explicit_buckets: Option, +} + +impl Part for BucketOptions {} + + +/// An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of "gce_instance" and specifies the use of the labels "instance_id" and "zone" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API. /// /// # 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*). /// -/// * [write entries](struct.EntryWriteCall.html) (response) +/// * [list monitored resource descriptors](struct.MonitoredResourceDescriptorListCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct WriteLogEntriesResponse { _never_set: Option } +pub struct MonitoredResourceDescriptor { + /// Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database". + #[serde(rename="displayName")] + pub display_name: Option, + /// Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone". + pub labels: Option>, + /// Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. + #[serde(rename="type")] + pub type_: Option, + /// Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}". + pub name: Option, + /// Optional. A detailed description of the monitored resource type that might be used in documentation. + pub description: Option, +} -impl ResponseResult for WriteLogEntriesResponse {} +impl Resource for MonitoredResourceDescriptor {} /// The parameters to WriteLogEntries. @@ -784,6 +995,17 @@ impl ResponseResult for WriteLogEntriesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct WriteLogEntriesRequest { + /// Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example: + /// { "type": "gce_instance", + /// "labels": { + /// "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + /// See LogEntry. + pub resource: Option, + /// Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method. + #[serde(rename="partialSuccess")] + pub partial_success: Option, + /// Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry. + pub labels: Option>, /// Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name: /// "projects/[PROJECT_ID]/logs/[LOG_ID]" /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" @@ -792,18 +1014,7 @@ pub struct WriteLogEntriesRequest { /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog" or "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. #[serde(rename="logName")] pub log_name: Option, - /// Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method. - #[serde(rename="partialSuccess")] - pub partial_success: Option, - /// Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry. - pub labels: Option>, - /// Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example: - /// { "type": "gce_instance", - /// "labels": { - /// "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - /// See LogEntry. - pub resource: Option, - /// Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are inserted into those log entries in this list that do not provide their own values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and less than later entries. Otherwise, the order of log entries in this list does not matter.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry. + /// Required. The log entries to send to Stackdriver Logging. The order of log entries in this list does not matter. Values supplied in this method's log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future might be discarded. Discarding does not return an error.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry. pub entries: Option>, } @@ -839,20 +1050,19 @@ pub struct LogEntry { pub http_request: Option, /// Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. pub resource: Option, - /// Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT. - pub severity: Option, /// Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 pub trace: Option, /// The log entry payload, represented as a Unicode string (UTF-8). #[serde(rename="textPayload")] pub text_payload: Option, - /// Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted. - pub timestamp: Option, + /// Output only. The time the log entry was received by Stackdriver Logging. + #[serde(rename="receiveTimestamp")] + pub receive_timestamp: Option, /// Optional. A set of user-defined (key, value) data that provides additional information about the log entry. pub labels: Option>, - /// The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads. - #[serde(rename="protoPayload")] - pub proto_payload: Option>, + /// Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging assigns its own unique identifier. The insert_id is also used to order log entries that have the same timestamp value. + #[serde(rename="insertId")] + pub insert_id: Option, /// The log entry payload, represented as a structure that is expressed as a JSON object. #[serde(rename="jsonPayload")] pub json_payload: Option>, @@ -864,23 +1074,43 @@ pub struct LogEntry { /// [LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". [LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results. #[serde(rename="logName")] pub log_name: Option, - /// Output only. The time the log entry was received by Stackdriver Logging. - #[serde(rename="receiveTimestamp")] - pub receive_timestamp: Option, - /// Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value. - #[serde(rename="insertId")] - pub insert_id: Option, + /// Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Stackdriver Logging assigns it the current time.Incoming log entries should have timestamps that are no more than the logs retention period in the past, and no more than 24 hours in the future. See the entries.write API method for more information. + pub timestamp: Option, + /// The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads. + #[serde(rename="protoPayload")] + pub proto_payload: Option>, /// Optional. Information about an operation associated with the log entry, if applicable. pub operation: Option, /// Optional. Source code location information associated with the log entry, if any. #[serde(rename="sourceLocation")] pub source_location: Option, + /// Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT. + pub severity: Option, } impl Part for LogEntry {} -/// Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval. +/// Additional information about a potentially long-running operation with which a log entry is associated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogEntryOperation { + /// Optional. Set this to True if this is the last log entry in the operation. + pub last: Option, + /// Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. + pub id: Option, + /// Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication". + pub producer: Option, + /// Optional. Set this to True if this is the first log entry in the operation. + pub first: Option, +} + +impl Part for LogEntryOperation {} + + +/// Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options. /// /// # Activities /// @@ -888,53 +1118,58 @@ impl Part for LogEntry {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [metrics create projects](struct.ProjectMetricCreateCall.html) (request|response) -/// * [metrics update projects](struct.ProjectMetricUpdateCall.html) (request|response) /// * [metrics get projects](struct.ProjectMetricGetCall.html) (response) +/// * [metrics update projects](struct.ProjectMetricUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogMetric { + /// Optional. A description of this metric, which is used in documentation. + pub description: Option, + /// Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of "1". Such a metric counts the number of log entries matching the filter expression.The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description. + #[serde(rename="metricDescriptor")] + pub metric_descriptor: Option, + /// Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values. + #[serde(rename="bucketOptions")] + pub bucket_options: Option, + /// Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.The extracted value is converted to the type defined in the label descriptor. If the either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project. + #[serde(rename="labelExtractors")] + pub label_extractors: Option>, /// Required. An advanced logs filter which is used to match log entries. Example: /// "resource.type=gae_app AND severity>=ERROR" /// The maximum length of the filter is 20000 characters. pub filter: Option, - /// Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed. + /// Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the log entry field from which the value is to be extracted. 2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*") + #[serde(rename="valueExtractor")] + pub value_extractor: Option, + /// Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed. pub version: Option, /// Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests". pub name: Option, - /// Optional. A description of this metric, which is used in documentation. - pub description: Option, } impl RequestValue for LogMetric {} impl ResponseResult for LogMetric {} -/// An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of "gce_instance" and specifies the use of the labels "instance_id" and "zone" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API. +/// Result returned from ListLogMetrics. /// /// # 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 monitored resource descriptors](struct.MonitoredResourceDescriptorListCall.html) (none) +/// * [metrics list projects](struct.ProjectMetricListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MonitoredResourceDescriptor { - /// Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database". - #[serde(rename="displayName")] - pub display_name: Option, - /// Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone". - pub labels: Option>, - /// Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. - #[serde(rename="type")] - pub type_: Option, - /// Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}". - pub name: Option, - /// Optional. A detailed description of the monitored resource type that might be used in documentation. - pub description: Option, +pub struct ListLogMetricsResponse { + /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of logs-based metrics. + pub metrics: Option>, } -impl Resource for MonitoredResourceDescriptor {} +impl ResponseResult for ListLogMetricsResponse {} @@ -966,7 +1201,7 @@ impl Resource for MonitoredResourceDescriptor {} /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.folders(); /// # } @@ -983,22 +1218,23 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists sinks. + /// Changes one or more properties of an existing exclusion. /// /// # Arguments /// - /// * `parent` - Required. The parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - pub fn sinks_list(&self, parent: &str) -> FolderSinkListCall<'a, C, A> { - FolderSinkListCall { + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> FolderExclusionPatchCall<'a, C, A> { + FolderExclusionPatchCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1007,7 +1243,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. /// /// # Arguments /// @@ -1023,6 +1259,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { hub: self.hub, _request: request, _sink_name: sink_name.to_string(), + _update_mask: Default::default(), _unique_writer_identity: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1054,7 +1291,53 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// Gets the description of an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_get(&self, name: &str) -> FolderExclusionGetCall<'a, C, A> { + FolderExclusionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the exclusions in a parent resource. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn exclusions_list(&self, parent: &str) -> FolderExclusionListCall<'a, C, A> { + FolderExclusionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// # Arguments /// @@ -1077,6 +1360,52 @@ impl<'a, C, A> FolderMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. + /// + /// # Arguments + /// + /// * `logName` - Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + pub fn logs_delete(&self, log_name: &str) -> FolderLogDeleteCall<'a, C, A> { + FolderLogDeleteCall { + hub: self.hub, + _log_name: log_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> FolderExclusionCreateCall<'a, C, A> { + FolderExclusionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. @@ -1125,20 +1454,70 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. + /// Lists sinks. /// /// # Arguments /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - pub fn logs_delete(&self, log_name: &str) -> FolderLogDeleteCall<'a, C, A> { - FolderLogDeleteCall { + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn sinks_list(&self, parent: &str) -> FolderSinkListCall<'a, C, A> { + FolderSinkListCall { hub: self.hub, - _log_name: log_name.to_string(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> FolderSinkPatchCall<'a, C, A> { + FolderSinkPatchCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_delete(&self, name: &str) -> FolderExclusionDeleteCall<'a, C, A> { + FolderExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1172,7 +1551,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.organizations(); /// # } @@ -1187,6 +1566,101 @@ impl<'a, C, A> MethodsBuilder for OrganizationMethods<'a, C, A> {} impl<'a, C, A> OrganizationMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + /// + /// # Arguments + /// + /// * `sinkName` - Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_delete(&self, sink_name: &str) -> OrganizationSinkDeleteCall<'a, C, A> { + OrganizationSinkDeleteCall { + hub: self.hub, + _sink_name: sink_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> OrganizationSinkPatchCall<'a, C, A> { + OrganizationSinkPatchCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Changes one or more properties of an existing exclusion. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + OrganizationExclusionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_delete(&self, name: &str) -> OrganizationExclusionDeleteCall<'a, C, A> { + OrganizationExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. @@ -1235,7 +1709,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. /// /// # Arguments /// @@ -1251,6 +1725,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { hub: self.hub, _request: request, _sink_name: sink_name.to_string(), + _update_mask: Default::default(), _unique_writer_identity: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1280,6 +1755,52 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all the exclusions in a parent resource. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn exclusions_list(&self, parent: &str) -> OrganizationExclusionListCall<'a, C, A> { + OrganizationExclusionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the description of an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_get(&self, name: &str) -> OrganizationExclusionGetCall<'a, C, A> { + OrganizationExclusionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists sinks. @@ -1306,29 +1827,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. - /// - /// # Arguments - /// - /// * `sinkName` - Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_delete(&self, sink_name: &str) -> OrganizationSinkDeleteCall<'a, C, A> { - OrganizationSinkDeleteCall { - hub: self.hub, - _sink_name: sink_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// # Arguments /// @@ -1350,6 +1849,30 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> OrganizationExclusionCreateCall<'a, C, A> { + OrganizationExclusionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -1395,7 +1918,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Writes log entries to Stackdriver Logging. + /// Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging. /// /// # Arguments /// @@ -1454,7 +1977,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.billing_accounts(); /// # } @@ -1471,7 +1994,7 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// # Arguments /// @@ -1494,6 +2017,31 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Changes one or more properties of an existing exclusion. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + BillingAccountExclusionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. @@ -1518,6 +2066,78 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_delete(&self, name: &str) -> BillingAccountExclusionDeleteCall<'a, C, A> { + BillingAccountExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the exclusions in a parent resource. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn exclusions_list(&self, parent: &str) -> BillingAccountExclusionListCall<'a, C, A> { + BillingAccountExclusionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> BillingAccountSinkPatchCall<'a, C, A> { + BillingAccountSinkPatchCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists sinks. @@ -1542,6 +2162,30 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> BillingAccountExclusionCreateCall<'a, C, A> { + BillingAccountExclusionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. @@ -1564,6 +2208,32 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> BillingAccountSinkUpdateCall<'a, C, A> { + BillingAccountSinkUpdateCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets a sink. @@ -1588,23 +2258,20 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. + /// Gets the description of an exclusion. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> BillingAccountSinkUpdateCall<'a, C, A> { - BillingAccountSinkUpdateCall { + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_get(&self, name: &str) -> BillingAccountExclusionGetCall<'a, C, A> { + BillingAccountExclusionGetCall { hub: self.hub, - _request: request, - _sink_name: sink_name.to_string(), - _unique_writer_identity: Default::default(), + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1716,7 +2383,7 @@ impl<'a, C, A> MonitoredResourceDescriptorMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `logs_delete(...)`, `logs_list(...)`, `metrics_create(...)`, `metrics_delete(...)`, `metrics_get(...)`, `metrics_list(...)`, `metrics_update(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `metrics_create(...)`, `metrics_delete(...)`, `metrics_get(...)`, `metrics_list(...)`, `metrics_update(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1772,6 +2439,58 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> ProjectSinkPatchCall<'a, C, A> { + ProjectSinkPatchCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> ProjectSinkUpdateCall<'a, C, A> { + ProjectSinkUpdateCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. @@ -1796,73 +2515,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Creates a logs-based metric. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The resource name of the project in which to create the metric: - /// "projects/[PROJECT_ID]" - /// The new metric must be provided in the request. - pub fn metrics_create(&self, request: LogMetric, parent: &str) -> ProjectMetricCreateCall<'a, C, A> { - ProjectMetricCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists logs-based metrics. - /// - /// # Arguments - /// - /// * `parent` - Required. The name of the project containing the metrics: - /// "projects/[PROJECT_ID]" - /// - pub fn metrics_list(&self, parent: &str) -> ProjectMetricListCall<'a, C, A> { - ProjectMetricListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> ProjectSinkUpdateCall<'a, C, A> { - ProjectSinkUpdateCall { - hub: self.hub, - _request: request, - _sink_name: sink_name.to_string(), - _unique_writer_identity: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists sinks. @@ -1887,6 +2539,50 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_delete(&self, name: &str) -> ProjectExclusionDeleteCall<'a, C, A> { + ProjectExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the description of an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_get(&self, name: &str) -> ProjectExclusionGetCall<'a, C, A> { + ProjectExclusionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets a sink. @@ -1909,6 +2605,101 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Changes one or more properties of an existing exclusion. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> ProjectExclusionPatchCall<'a, C, A> { + ProjectExclusionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a logs-based metric. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The resource name of the project in which to create the metric: + /// "projects/[PROJECT_ID]" + /// The new metric must be provided in the request. + pub fn metrics_create(&self, request: LogMetric, parent: &str) -> ProjectMetricCreateCall<'a, C, A> { + ProjectMetricCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The resource in which to create the sink: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn sinks_create(&self, request: LogSink, parent: &str) -> ProjectSinkCreateCall<'a, C, A> { + ProjectSinkCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> ProjectExclusionCreateCall<'a, C, A> { + ProjectExclusionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. @@ -1931,31 +2722,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The resource in which to create the sink: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn sinks_create(&self, request: LogSink, parent: &str) -> ProjectSinkCreateCall<'a, C, A> { - ProjectSinkCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _unique_writer_identity: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Creates or updates a logs-based metric. @@ -1977,6 +2743,30 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all the exclusions in a parent resource. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn exclusions_list(&self, parent: &str) -> ProjectExclusionListCall<'a, C, A> { + ProjectExclusionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a logs-based metric. @@ -1995,6 +2785,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Lists logs-based metrics. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project containing the metrics: + /// "projects/[PROJECT_ID]" + /// + pub fn metrics_list(&self, parent: &str) -> ProjectMetricListCall<'a, C, A> { + ProjectMetricListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2005,9 +2816,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists sinks. +/// Changes one or more properties of an existing exclusion. /// -/// A builder for the *sinks.list* method supported by a *folder* resource. +/// A builder for the *exclusions.patch* method supported by a *folder* resource. /// It is not used directly, but through a `FolderMethods` instance. /// /// # Example @@ -2019,6 +2830,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -2029,34 +2841,38 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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.folders().sinks_list("parent") -/// .page_token("accusam") -/// .page_size(-8) +/// let result = hub.folders().exclusions_patch(req, "name") +/// .update_mask("amet.") /// .doit(); /// # } /// ``` -pub struct FolderSinkListCall<'a, C, A> +pub struct FolderExclusionPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, + _request: LogExclusion, + _name: String, + _update_mask: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for FolderSinkListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for FolderExclusionPatchCall<'a, C, A> {} -impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> FolderExclusionPatchCall<'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, ListSinksResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2065,17 +2881,14 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.folders.sinks.list", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "logging.folders.exclusions.patch", + http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2087,12 +2900,12 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + let mut url = self.hub._base_url.clone() + "v2/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -2107,7 +2920,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -2122,6 +2935,17 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A 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).expect("serde to work"); + 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 { @@ -2138,11 +2962,15 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A } }; let auth_header = Authorization(Bearer { 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::Get, &url) + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.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() @@ -2193,33 +3021,35 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A } - /// Required. The parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// /// - /// Sets the *parent* path property to the given 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 parent(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn request(mut self, new_value: LogExclusion) -> FolderExclusionPatchCall<'a, C, A> { + self._request = new_value; self } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FolderExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); self } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> FolderSinkListCall<'a, C, A> { - self._page_size = Some(new_value); + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> FolderExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -2228,7 +3058,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A /// 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) -> FolderSinkListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderExclusionPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2247,15 +3077,15 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderSinkListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> FolderExclusionPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2275,7 +3105,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A /// 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) -> FolderSinkListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> FolderExclusionPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2287,7 +3117,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A } -/// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. /// /// A builder for the *sinks.update* method supported by a *folder* resource. /// It is not used directly, but through a `FolderMethods` instance. @@ -2321,6 +3151,7 @@ impl<'a, C, A> FolderSinkListCall<'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.folders().sinks_update(req, "sinkName") +/// .update_mask("labore") /// .unique_writer_identity(true) /// .doit(); /// # } @@ -2331,6 +3162,7 @@ pub struct FolderSinkUpdateCall<'a, C, A> hub: &'a Logging, _request: LogSink, _sink_name: String, + _update_mask: Option, _unique_writer_identity: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -2354,12 +3186,15 @@ impl<'a, C, A> FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "logging.folders.sinks.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } if let Some(value) = self._unique_writer_identity { params.push(("uniqueWriterIdentity", value.to_string())); } - for &field in ["alt", "sinkName", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2516,10 +3351,17 @@ impl<'a, C, A> FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, self._sink_name = new_value.to_string(); self } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> FolderSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is false. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. /// /// Sets the *unique writer identity* query property to the given value. pub fn unique_writer_identity(mut self, new_value: bool) -> FolderSinkUpdateCall<'a, C, A> { @@ -2551,12 +3393,12 @@ impl<'a, C, A> FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> FolderSinkUpdateCall<'a, C, A> @@ -2809,12 +3651,12 @@ impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> FolderSinkGetCall<'a, C, A> @@ -2849,7 +3691,547 @@ impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: } -/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. +/// Gets the description of an exclusion. +/// +/// A builder for the *exclusions.get* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().exclusions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct FolderExclusionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderExclusionGetCall<'a, C, A> {} + +impl<'a, C, A> FolderExclusionGetCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FolderExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderExclusionGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderExclusionGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderExclusionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the exclusions in a parent resource. +/// +/// A builder for the *exclusions.list* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().exclusions_list("parent") +/// .page_token("sadipscing") +/// .page_size(-31) +/// .doit(); +/// # } +/// ``` +pub struct FolderExclusionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderExclusionListCall<'a, C, A> {} + +impl<'a, C, A> FolderExclusionListCall<'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, ListExclusionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.exclusions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> FolderExclusionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FolderExclusionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> FolderExclusionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderExclusionListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderExclusionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderExclusionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// A builder for the *sinks.create* method supported by a *folder* resource. /// It is not used directly, but through a `FolderMethods` instance. @@ -2883,7 +4265,7 @@ impl<'a, C, A> FolderSinkGetCall<'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.folders().sinks_create(req, "parent") -/// .unique_writer_identity(true) +/// .unique_writer_identity(false) /// .doit(); /// # } /// ``` @@ -3110,12 +4492,12 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> FolderSinkCreateCall<'a, C, A> @@ -3150,546 +4532,6 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, } -/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. -/// -/// A builder for the *sinks.delete* method supported by a *folder* resource. -/// It is not used directly, but through a `FolderMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().sinks_delete("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct FolderSinkDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderSinkDeleteCall<'a, C, A> {} - -impl<'a, C, A> FolderSinkDeleteCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.folders.sinks.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].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(Bearer { 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(d); - 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(d); - 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 full resource name of the sink to delete, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> FolderSinkDeleteCall<'a, C, A> { - self._sink_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) -> FolderSinkDeleteCall<'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) -> FolderSinkDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> FolderSinkDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. -/// -/// A builder for the *logs.list* method supported by a *folder* resource. -/// It is not used directly, but through a `FolderMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().logs_list("parent") -/// .page_token("gubergren") -/// .page_size(-95) -/// .doit(); -/// # } -/// ``` -pub struct FolderLogListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderLogListCall<'a, C, A> {} - -impl<'a, C, A> FolderLogListCall<'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, ListLogsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.folders.logs.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].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(Bearer { 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(d); - 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(d); - 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 name that owns the logs: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - /// - /// Sets the *parent* 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 parent(mut self, new_value: &str) -> FolderLogListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> FolderLogListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> FolderLogListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderLogListCall<'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) -> FolderLogListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> FolderLogListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. /// /// A builder for the *logs.delete* method supported by a *folder* resource. @@ -3908,12 +4750,12 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> FolderLogDeleteCall<'a, C, A> @@ -3948,6 +4790,2824 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, } +/// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. +/// +/// A builder for the *exclusions.create* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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.folders().exclusions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct FolderExclusionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderExclusionCreateCall<'a, C, A> {} + +impl<'a, C, A> FolderExclusionCreateCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.exclusions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> FolderExclusionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> FolderExclusionCreateCall<'a, C, A> { + self._parent = 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) -> FolderExclusionCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderExclusionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderExclusionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. +/// +/// A builder for the *sinks.delete* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().sinks_delete("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct FolderSinkDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderSinkDeleteCall<'a, C, A> {} + +impl<'a, C, A> FolderSinkDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.sinks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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(Bearer { 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(d); + 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(d); + 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 full resource name of the sink to delete, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> FolderSinkDeleteCall<'a, C, A> { + self._sink_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) -> FolderSinkDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderSinkDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderSinkDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. +/// +/// A builder for the *logs.list* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().logs_list("parent") +/// .page_token("diam") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct FolderLogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderLogListCall<'a, C, A> {} + +impl<'a, C, A> FolderLogListCall<'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, ListLogsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.logs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> FolderLogListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FolderLogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> FolderLogListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderLogListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderLogListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderLogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists sinks. +/// +/// A builder for the *sinks.list* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().sinks_list("parent") +/// .page_token("et") +/// .page_size(-70) +/// .doit(); +/// # } +/// ``` +pub struct FolderSinkListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderSinkListCall<'a, C, A> {} + +impl<'a, C, A> FolderSinkListCall<'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, ListSinksResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.sinks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> FolderSinkListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderSinkListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderSinkListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderSinkListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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.folders().sinks_patch(req, "sinkName") +/// .update_mask("sea") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct FolderSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> FolderSinkPatchCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogSink) -> FolderSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> FolderSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> FolderSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> FolderSinkPatchCall<'a, C, A> { + self._unique_writer_identity = 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) -> FolderSinkPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderSinkPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderSinkPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an exclusion. +/// +/// A builder for the *exclusions.delete* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.folders().exclusions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct FolderExclusionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderExclusionDeleteCall<'a, C, A> {} + +impl<'a, C, A> FolderExclusionDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.exclusions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FolderExclusionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderExclusionDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderExclusionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> FolderExclusionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. +/// +/// A builder for the *sinks.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().sinks_delete("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationSinkDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationSinkDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationSinkDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.sinks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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(Bearer { 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(d); + 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(d); + 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 full resource name of the sink to delete, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> OrganizationSinkDeleteCall<'a, C, A> { + self._sink_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) -> OrganizationSinkDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationSinkDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationSinkDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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.organizations().sinks_patch(req, "sinkName") +/// .update_mask("dolor") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationSinkPatchCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogSink) -> OrganizationSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> OrganizationSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkPatchCall<'a, C, A> { + self._unique_writer_identity = 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) -> OrganizationSinkPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationSinkPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationSinkPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes one or more properties of an existing exclusion. +/// +/// A builder for the *exclusions.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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.organizations().exclusions_patch(req, "name") +/// .update_mask("amet") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationExclusionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationExclusionPatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationExclusionPatchCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.exclusions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> OrganizationExclusionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationExclusionPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationExclusionPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationExclusionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an exclusion. +/// +/// A builder for the *exclusions.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().exclusions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationExclusionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationExclusionDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationExclusionDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.exclusions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationExclusionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationExclusionDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationExclusionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationExclusionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. /// /// A builder for the *logs.list* method supported by a *organization* resource. @@ -3976,8 +7636,8 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.organizations().logs_list("parent") -/// .page_token("no") -/// .page_size(-21) +/// .page_token("eirmod") +/// .page_size(-33) /// .doit(); /// # } /// ``` @@ -4190,12 +7850,12 @@ impl<'a, C, A> OrganizationLogListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationLogListCall<'a, C, A> @@ -4448,12 +8108,12 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationLogDeleteCall<'a, C, A> @@ -4488,7 +8148,7 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut hub: &'a Logging, _request: LogSink, _sink_name: String, + _update_mask: Option, _unique_writer_identity: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -4555,12 +8217,15 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } if let Some(value) = self._unique_writer_identity { params.push(("uniqueWriterIdentity", value.to_string())); } - for &field in ["alt", "sinkName", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4717,10 +8382,17 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is false. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. /// /// Sets the *unique writer identity* query property to the given value. pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkUpdateCall<'a, C, A> { @@ -4752,12 +8424,12 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkUpdateCall<'a, C, A> @@ -5010,12 +8682,12 @@ impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkGetCall<'a, C, A> @@ -5050,6 +8722,546 @@ impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().exclusions_list("parent") +/// .page_token("duo") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationExclusionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationExclusionListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationExclusionListCall<'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, ListExclusionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.exclusions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> OrganizationExclusionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationExclusionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationExclusionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationExclusionListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationExclusionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationExclusionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the description of an exclusion. +/// +/// A builder for the *exclusions.get* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().exclusions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationExclusionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationExclusionGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationExclusionGetCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationExclusionGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationExclusionGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationExclusionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists sinks. /// /// A builder for the *sinks.list* method supported by a *organization* resource. @@ -5078,8 +9290,8 @@ impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut OrganizationSinkListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkListCall<'a, C, A> @@ -5332,265 +9544,7 @@ impl<'a, C, A> OrganizationSinkListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.organizations().sinks_delete("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationSinkDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationSinkDeleteCall<'a, C, A> {} - -impl<'a, C, A> OrganizationSinkDeleteCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.organizations.sinks.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].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(Bearer { 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(d); - 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(d); - 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 full resource name of the sink to delete, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> OrganizationSinkDeleteCall<'a, C, A> { - self._sink_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) -> OrganizationSinkDeleteCall<'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) -> OrganizationSinkDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> OrganizationSinkDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. +/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// A builder for the *sinks.create* method supported by a *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. @@ -5851,12 +9805,12 @@ impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkCreateCall<'a, C, A> @@ -5891,7 +9845,296 @@ impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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.organizations().exclusions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationExclusionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationExclusionCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationExclusionCreateCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.exclusions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> OrganizationExclusionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> OrganizationExclusionCreateCall<'a, C, A> { + self._parent = 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) -> OrganizationExclusionCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationExclusionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> OrganizationExclusionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging. /// /// A builder for the *write* method supported by a *entry* resource. /// It is not used directly, but through a `EntryMethods` instance. @@ -6098,12 +10341,12 @@ impl<'a, C, A> EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> EntryWriteCall<'a, C, A> @@ -6345,12 +10588,12 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> EntryListCall<'a, C, A> @@ -6385,7 +10628,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau } -/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. +/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// A builder for the *sinks.create* method supported by a *billingAccount* resource. /// It is not used directly, but through a `BillingAccountMethods` instance. @@ -6646,12 +10889,12 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkCreateCall<'a, C, A> @@ -6686,6 +10929,307 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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.billing_accounts().exclusions_patch(req, "name") +/// .update_mask("dolor") +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountExclusionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountExclusionPatchCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountExclusionPatchCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BillingAccountExclusionPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountExclusionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. /// /// A builder for the *logs.list* method supported by a *billingAccount* resource. @@ -6714,8 +11258,8 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountLogListCall<'a, C, A> @@ -6968,6 +11512,862 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.billing_accounts().exclusions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountExclusionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountExclusionDeleteCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountExclusionDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> BillingAccountExclusionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BillingAccountExclusionDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountExclusionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the exclusions in a parent resource. +/// +/// A builder for the *exclusions.list* method supported by a *billingAccount* resource. +/// It is not used directly, but through a `BillingAccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.billing_accounts().exclusions_list("parent") +/// .page_token("Lorem") +/// .page_size(-11) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountExclusionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountExclusionListCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountExclusionListCall<'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, ListExclusionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> BillingAccountExclusionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> BillingAccountExclusionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> BillingAccountExclusionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BillingAccountExclusionListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountExclusionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* method supported by a *billingAccount* resource. +/// It is not used directly, but through a `BillingAccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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.billing_accounts().sinks_patch(req, "sinkName") +/// .update_mask("sit") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountSinkPatchCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogSink) -> BillingAccountSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> BillingAccountSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> BillingAccountSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> BillingAccountSinkPatchCall<'a, C, A> { + self._unique_writer_identity = 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) -> BillingAccountSinkPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountSinkPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountSinkPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists sinks. /// /// A builder for the *sinks.list* method supported by a *billingAccount* resource. @@ -6996,8 +12396,8 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountSinkListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkListCall<'a, C, A> @@ -7250,6 +12650,295 @@ impl<'a, C, A> BillingAccountSinkListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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.billing_accounts().exclusions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountExclusionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountExclusionCreateCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountExclusionCreateCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> BillingAccountExclusionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> BillingAccountExclusionCreateCall<'a, C, A> { + self._parent = 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) -> BillingAccountExclusionCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountExclusionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. /// /// A builder for the *sinks.delete* method supported by a *billingAccount* resource. @@ -7468,12 +13157,12 @@ impl<'a, C, A> BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkDeleteCall<'a, C, A> @@ -7508,6 +13197,322 @@ impl<'a, C, A> BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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.billing_accounts().sinks_update(req, "sinkName") +/// .update_mask("invidunt") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountSinkUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountSinkUpdateCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountSinkUpdateCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogSink) -> BillingAccountSinkUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> BillingAccountSinkUpdateCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> BillingAccountSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> BillingAccountSinkUpdateCall<'a, C, A> { + self._unique_writer_identity = 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) -> BillingAccountSinkUpdateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountSinkUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> BillingAccountSinkUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets a sink. /// /// A builder for the *sinks.get* method supported by a *billingAccount* resource. @@ -7726,12 +13731,12 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkGetCall<'a, C, A> @@ -7766,9 +13771,9 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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.billing_accounts().sinks_update(req, "sinkName") -/// .unique_writer_identity(true) +/// let result = hub.billing_accounts().exclusions_get("name") /// .doit(); /// # } /// ``` -pub struct BillingAccountSinkUpdateCall<'a, C, A> +pub struct BillingAccountExclusionGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _unique_writer_identity: Option, + _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BillingAccountSinkUpdateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BillingAccountExclusionGetCall<'a, C, A> {} -impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BillingAccountExclusionGetCall<'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, LogSink)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7831,14 +13827,11 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "uniqueWriterIdentity"].iter() { + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7850,12 +13843,12 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7885,17 +13878,6 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> BillingAccountSinkUpdateCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> BillingAccountSinkUpdateCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); + pub fn name(mut self, new_value: &str) -> BillingAccountExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -8011,7 +13970,7 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BillingAccountExclusionGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8030,15 +13989,15 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkUpdateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8058,7 +14017,7 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> BillingAccountSinkUpdateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BillingAccountExclusionGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8288,12 +14247,12 @@ impl<'a, C, A> BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountLogDeleteCall<'a, C, A> @@ -8356,8 +14315,8 @@ impl<'a, C, A> BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> MonitoredResourceDescriptorListCall<'a, C, A> @@ -8786,12 +14745,12 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectLogDeleteCall<'a, C, A> @@ -9041,12 +15000,12 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectMetricGetCall<'a, C, A> @@ -9081,6 +15040,638 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, } +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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().sinks_patch(req, "sinkName") +/// .update_mask("nonumy") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkPatchCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogSink) -> ProjectSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkPatchCall<'a, C, A> { + self._unique_writer_identity = 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) -> ProjectSinkPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectSinkPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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().sinks_update(req, "sinkName") +/// .update_mask("takimata") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkUpdateCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogSink) -> ProjectSinkUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { + self._unique_writer_identity = 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) -> ProjectSinkUpdateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectSinkUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. /// /// A builder for the *logs.list* method supported by a *project* resource. @@ -9109,8 +15700,8 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().logs_list("parent") -/// .page_token("duo") -/// .page_size(-21) +/// .page_token("invidunt") +/// .page_size(-66) /// .doit(); /// # } /// ``` @@ -9323,12 +15914,12 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectLogListCall<'a, C, A> @@ -9363,6 +15954,1363 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A } +/// Lists sinks. +/// +/// A builder for the *sinks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().sinks_list("parent") +/// .page_token("rebum.") +/// .page_size(-33) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkListCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkListCall<'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, ListSinksResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectSinkListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSinkListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectSinkListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an exclusion. +/// +/// A builder for the *exclusions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().exclusions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectExclusionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectExclusionDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectExclusionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the description of an exclusion. +/// +/// A builder for the *exclusions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().exclusions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionGetCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectExclusionGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectExclusionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a sink. +/// +/// A builder for the *sinks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().sinks_get("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkGetCall<'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, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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(Bearer { 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(d); + 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(d); + 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 name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkGetCall<'a, C, A> { + self._sink_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) -> ProjectSinkGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectSinkGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes one or more properties of an existing exclusion. +/// +/// A builder for the *exclusions.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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().exclusions_patch(req, "name") +/// .update_mask("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionPatchCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> ProjectExclusionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectExclusionPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectExclusionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a logs-based metric. /// /// A builder for the *metrics.create* method supported by a *project* resource. @@ -9609,12 +17557,12 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricCreateCall<'a, C, A> @@ -9649,1388 +17597,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().metrics_list("parent") -/// .page_token("et") -/// .page_size(-46) -/// .doit(); -/// # } -/// ``` -pub struct ProjectMetricListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMetricListCall<'a, C, A> {} - -impl<'a, C, A> ProjectMetricListCall<'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, ListLogMetricsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.metrics.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/metrics"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].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(Bearer { 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(d); - 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(d); - 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 name of the project containing the metrics: - /// "projects/[PROJECT_ID]" - /// - /// - /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectMetricListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectMetricListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectMetricListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMetricListCall<'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) -> ProjectMetricListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectMetricListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. -/// -/// A builder for the *sinks.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogSink; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogSink::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().sinks_update(req, "sinkName") -/// .unique_writer_identity(true) -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _unique_writer_identity: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkUpdateCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkUpdateCall<'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, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "uniqueWriterIdentity"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].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).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: LogSink) -> ProjectSinkUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { - self._unique_writer_identity = 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) -> ProjectSinkUpdateCall<'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) -> ProjectSinkUpdateCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectSinkUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists sinks. -/// -/// A builder for the *sinks.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().sinks_list("parent") -/// .page_token("ea") -/// .page_size(-80) -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkListCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkListCall<'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, ListSinksResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].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(Bearer { 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(d); - 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(d); - 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 parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - /// - /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectSinkListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSinkListCall<'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) -> ProjectSinkListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectSinkListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a sink. -/// -/// A builder for the *sinks.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().sinks_get("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkGetCall<'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, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].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(Bearer { 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(d); - 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(d); - 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 name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkGetCall<'a, C, A> { - self._sink_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) -> ProjectSinkGetCall<'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) -> ProjectSinkGetCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectSinkGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. -/// -/// A builder for the *sinks.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().sinks_delete("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkDeleteCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].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(Bearer { 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(d); - 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(d); - 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 full resource name of the sink to delete, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkDeleteCall<'a, C, A> { - self._sink_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) -> ProjectSinkDeleteCall<'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) -> ProjectSinkDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectSinkDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. +/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// A builder for the *sinks.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -11291,12 +17858,12 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSinkCreateCall<'a, C, A> @@ -11331,6 +17898,553 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut } +/// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. +/// +/// A builder for the *exclusions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = LogExclusion::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().exclusions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionCreateCall<'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, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: LogExclusion) -> ProjectExclusionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectExclusionCreateCall<'a, C, A> { + self._parent = 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) -> ProjectExclusionCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectExclusionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. +/// +/// A builder for the *sinks.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().sinks_delete("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].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 = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].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(Bearer { 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(d); + 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(d); + 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 full resource name of the sink to delete, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink 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 sink_name(mut self, new_value: &str) -> ProjectSinkDeleteCall<'a, C, A> { + self._sink_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) -> ProjectSinkDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectSinkDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates or updates a logs-based metric. /// /// A builder for the *metrics.update* method supported by a *project* resource. @@ -11577,12 +18691,12 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricUpdateCall<'a, C, A> @@ -11617,6 +18731,288 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().exclusions_list("parent") +/// .page_token("tempor") +/// .page_size(-59) +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionListCall<'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, ListExclusionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectExclusionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectExclusionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectExclusionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectExclusionListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectExclusionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a logs-based metric. /// /// A builder for the *metrics.delete* method supported by a *project* resource. @@ -11832,12 +19228,12 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDeleteCall<'a, C, A> @@ -11872,3 +19268,282 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().metrics_list("parent") +/// .page_token("aliquyam") +/// .page_size(-69) +/// .doit(); +/// # } +/// ``` +pub struct ProjectMetricListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMetricListCall<'a, C, A> {} + +impl<'a, C, A> ProjectMetricListCall<'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, ListLogMetricsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.metrics.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/metrics"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the project containing the metrics: + /// "projects/[PROJECT_ID]" + /// + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectMetricListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectMetricListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectMetricListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMetricListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectMetricListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectMetricListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/logging2_beta1-cli/Cargo.toml b/gen/logging2_beta1-cli/Cargo.toml index dc5cb70143..fc34a2d856 100644 --- a/gen/logging2_beta1-cli/Cargo.toml +++ b/gen/logging2_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-logging2_beta1-cli" -version = "1.0.6+20170516" +version = "1.0.6+20170918" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2_beta1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-logging2_beta1] path = "../logging2_beta1" -version = "1.0.6+20170516" +version = "1.0.6+20170918" diff --git a/gen/logging2_beta1-cli/README.md b/gen/logging2_beta1-cli/README.md index acd70c9a50..7348381622 100644 --- a/gen/logging2_beta1-cli/README.md +++ b/gen/logging2_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Logging* API at revision *20170516*. The CLI is at version *1.0.6*. +This documentation was generated from the *Logging* API at revision *20170918*. The CLI is at version *1.0.6*. ```bash logging2-beta1 [options] diff --git a/gen/logging2_beta1-cli/mkdocs.yml b/gen/logging2_beta1-cli/mkdocs.yml index f727395e66..25026ce320 100644 --- a/gen/logging2_beta1-cli/mkdocs.yml +++ b/gen/logging2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.6+20170516 +site_name: Logging v1.0.6+20170918 site_url: http://byron.github.io/google-apis-rs/google-logging2_beta1-cli site_description: A complete library to interact with Logging (protocol v2beta1) diff --git a/gen/logging2_beta1-cli/src/main.rs b/gen/logging2_beta1-cli/src/main.rs index 4fd661ba66..b87ceaae11 100644 --- a/gen/logging2_beta1-cli/src/main.rs +++ b/gen/logging2_beta1-cli/src/main.rs @@ -640,12 +640,28 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.display-name" => Some(("metricDescriptor.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.description" => Some(("metricDescriptor.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.metric-kind" => Some(("metricDescriptor.metricKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.value-type" => Some(("metricDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.unit" => Some(("metricDescriptor.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.name" => Some(("metricDescriptor.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.scale" => Some(("bucketOptions.exponentialBuckets.scale", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.growth-factor" => Some(("bucketOptions.exponentialBuckets.growthFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.num-finite-buckets" => Some(("bucketOptions.exponentialBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.width" => Some(("bucketOptions.linearBuckets.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.num-finite-buckets" => Some(("bucketOptions.linearBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.offset" => Some(("bucketOptions.linearBuckets.offset", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.explicit-buckets.bounds" => Some(("bucketOptions.explicitBuckets.bounds", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "label-extractors" => Some(("labelExtractors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value-extractor" => Some(("valueExtractor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "label-extractors", "linear-buckets", "metric-descriptor", "metric-kind", "name", "num-finite-buckets", "offset", "scale", "type", "unit", "value-extractor", "value-type", "version", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -891,12 +907,28 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.display-name" => Some(("metricDescriptor.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.description" => Some(("metricDescriptor.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.metric-kind" => Some(("metricDescriptor.metricKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.value-type" => Some(("metricDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.unit" => Some(("metricDescriptor.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.name" => Some(("metricDescriptor.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.scale" => Some(("bucketOptions.exponentialBuckets.scale", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.growth-factor" => Some(("bucketOptions.exponentialBuckets.growthFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.exponential-buckets.num-finite-buckets" => Some(("bucketOptions.exponentialBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.width" => Some(("bucketOptions.linearBuckets.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.num-finite-buckets" => Some(("bucketOptions.linearBuckets.numFiniteBuckets", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "bucket-options.linear-buckets.offset" => Some(("bucketOptions.linearBuckets.offset", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "bucket-options.explicit-buckets.bounds" => Some(("bucketOptions.explicitBuckets.bounds", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Vec })), + "label-extractors" => Some(("labelExtractors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "value-extractor" => Some(("valueExtractor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "label-extractors", "linear-buckets", "metric-descriptor", "metric-kind", "name", "num-finite-buckets", "offset", "scale", "type", "unit", "value-extractor", "value-type", "version", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -979,12 +1011,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -1238,12 +1270,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { @@ -1261,6 +1293,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, "unique-writer-identity" => { call = call.unique_writer_identity(arg_from_str(value.unwrap_or("false"), err, "unique-writer-identity", "boolean")); }, @@ -1277,7 +1312,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["unique-writer-identity"].iter().map(|v|*v)); + v.extend(["unique-writer-identity", "update-mask"].iter().map(|v|*v)); v } )); } } @@ -1580,7 +1615,7 @@ fn main() { Some(false)), ]), ("write", - Some(r##"Writes log entries to Stackdriver Logging."##), + Some(r##"Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_beta1_cli/entries_write", vec![ (Some(r##"kv"##), @@ -1867,7 +1902,7 @@ fn main() { Some(false)), ]), ("sinks-create", - Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), + Some(r##"Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_beta1_cli/projects_sinks-create", vec![ (Some(r##"parent"##), @@ -1981,7 +2016,7 @@ fn main() { Some(false)), ]), ("sinks-update", - Some(r##"Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field."##), + Some(r##"Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_beta1_cli/projects_sinks-update", vec![ (Some(r##"sink-name"##), @@ -2019,7 +2054,7 @@ fn main() { let mut app = App::new("logging2-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170516") + .version("1.0.6+20170918") .about("Writes log entries and manages your Stackdriver Logging configuration.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_logging2_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/logging2_beta1/Cargo.toml b/gen/logging2_beta1/Cargo.toml index 861d16fc9c..78c0e487b6 100644 --- a/gen/logging2_beta1/Cargo.toml +++ b/gen/logging2_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-logging2_beta1" -version = "1.0.6+20170516" +version = "1.0.6+20170918" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2_beta1" homepage = "https://cloud.google.com/logging/docs/" -documentation = "https://docs.rs/google-logging2_beta1/1.0.6+20170516" +documentation = "https://docs.rs/google-logging2_beta1/1.0.6+20170918" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] diff --git a/gen/logging2_beta1/README.md b/gen/logging2_beta1/README.md index 8541fec72a..c3129b55c6 100644 --- a/gen/logging2_beta1/README.md +++ b/gen/logging2_beta1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-logging2_beta1` library allows access to all features of the *Google Logging* service. -This documentation was generated from *Logging* crate version *1.0.6+20170516*, where *20170516* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Logging* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Logging* *v2_beta1* API can be found at the [official documentation site](https://cloud.google.com/logging/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.Logging.html) ... * billing accounts - * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.BillingAccountLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.BillingAccountLogListCall.html) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.BillingAccountLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.BillingAccountLogListCall.html) * entries - * [*list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.EntryWriteCall.html) -* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) - * [*list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.EntryWriteCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.OrganizationLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.OrganizationLogListCall.html) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.OrganizationLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.OrganizationLogListCall.html) * projects - * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.ProjectSinkUpdateCall.html) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.ProjectSinkUpdateCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/struct.Logging.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -128,17 +128,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_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")`. @@ -148,29 +148,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_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](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_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](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_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](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_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](https://docs.rs/google-logging2_beta1/1.0.6+20170516/google_logging2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2_beta1/1.0.6+20170918/google_logging2_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. diff --git a/gen/logging2_beta1/src/lib.rs b/gen/logging2_beta1/src/lib.rs index a1b4cda892..edbea56f74 100644 --- a/gen/logging2_beta1/src/lib.rs +++ b/gen/logging2_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 *Logging* crate version *1.0.6+20170516*, where *20170516* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Logging* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Logging* *v2_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/logging/docs/). @@ -229,14 +229,14 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// Administrate log data for your projects - Admin, + /// Submit log data for your projects + Write, /// View log data for your projects Read, - /// Submit log data for your projects - Write, + /// Administrate log data for your projects + Admin, /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -248,9 +248,9 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::Admin => "https://www.googleapis.com/auth/logging.admin", - Scope::Read => "https://www.googleapis.com/auth/logging.read", Scope::Write => "https://www.googleapis.com/auth/logging.write", + Scope::Read => "https://www.googleapis.com/auth/logging.read", + Scope::Admin => "https://www.googleapis.com/auth/logging.admin", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } @@ -404,7 +404,7 @@ pub struct ListLogEntriesResponse { /// If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A list of log entries. + /// A list of log entries. If entries is empty, nextPageToken may still be returned, indicating that more entries may exist. See nextPageToken for more information. pub entries: Option>, } @@ -428,6 +428,25 @@ pub struct LogEntrySourceLocation { impl Part for LogEntrySourceLocation {} +/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 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 Exponential { + /// Must be greater than 0. + pub scale: Option, + /// Must be greater than 1. + #[serde(rename="growthFactor")] + pub growth_factor: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, +} + +impl Part for Exponential {} + + /// Result returned from ListLogs. /// /// # Activities @@ -473,6 +492,34 @@ pub struct ListLogMetricsResponse { impl ResponseResult for ListLogMetricsResponse {} +/// Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Explicit { + /// The values must be monotonically increasing. + pub bounds: Option>, +} + +impl Part for Explicit {} + + +/// Result returned from WriteLogEntries. 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*). +/// +/// * [write entries](struct.EntryWriteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WriteLogEntriesResponse { _never_set: Option } + +impl ResponseResult for WriteLogEntriesResponse {} + + /// An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "instance_id" and "zone": /// { "type": "gce_instance", /// "labels": { "instance_id": "12345678901234", @@ -525,9 +572,9 @@ impl Part for LogEntryOperation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogSink { - /// Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API. - #[serde(rename="outputVersionFormat")] - pub output_version_format: Option, + /// Deprecated. This field is ignored when creating or updating sinks. + #[serde(rename="endTime")] + pub end_time: Option, /// Required. The client-assigned sink identifier, unique within the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. pub name: Option, /// Required. The export destination: @@ -536,16 +583,16 @@ pub struct LogSink { /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" /// The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks. pub destination: Option, - /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format: + /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. For example: /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR /// pub filter: Option, - /// Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated. + /// Deprecated. This field is ignored when creating or updating sinks. #[serde(rename="startTime")] pub start_time: Option, - /// Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time. - #[serde(rename="endTime")] - pub end_time: Option, + /// Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed. + #[serde(rename="outputVersionFormat")] + pub output_version_format: Option, /// Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting access for a resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity. #[serde(rename="writerIdentity")] pub writer_identity: Option, @@ -630,29 +677,31 @@ impl ResponseResult for Empty {} pub struct HttpRequest { /// The response code indicating the status of response. Examples: 200, 404. pub status: Option, - /// Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True. - #[serde(rename="cacheValidatedWithOriginServer")] - pub cache_validated_with_origin_server: Option, /// The request processing latency on the server, from the time the request was received until the response was sent. pub latency: Option, + /// Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + pub protocol: Option, + /// The request method. Examples: "GET", "HEAD", "PUT", "POST". + #[serde(rename="requestMethod")] + pub request_method: Option, /// The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted. #[serde(rename="cacheFillBytes")] pub cache_fill_bytes: Option, /// The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: "http://example.com/some/info?color=red". #[serde(rename="requestUrl")] pub request_url: Option, - /// Whether or not an entity was served from cache (with or without validation). - #[serde(rename="cacheHit")] - pub cache_hit: Option, /// The IP address (IPv4 or IPv6) of the origin server that the request was sent to. #[serde(rename="serverIp")] pub server_ip: Option, /// Whether or not a cache lookup was attempted. #[serde(rename="cacheLookup")] pub cache_lookup: Option, - /// The request method. Examples: "GET", "HEAD", "PUT", "POST". - #[serde(rename="requestMethod")] - pub request_method: Option, + /// Whether or not an entity was served from cache (with or without validation). + #[serde(rename="cacheHit")] + pub cache_hit: Option, + /// Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True. + #[serde(rename="cacheValidatedWithOriginServer")] + pub cache_validated_with_origin_server: Option, /// The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). pub referer: Option, /// The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". @@ -694,6 +743,99 @@ pub struct ListMonitoredResourceDescriptorsResponse { impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} +/// Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 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 Linear { + /// Must be greater than 0. + pub width: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, + /// Lower bound of the first bucket. + pub offset: Option, +} + +impl Part for Linear {} + + +/// Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetricDescriptor { + /// A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". + #[serde(rename="displayName")] + pub display_name: Option, + /// A detailed description of the metric, which can be used in documentation. + pub description: Option, + /// Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported. + #[serde(rename="metricKind")] + pub metric_kind: Option, + /// Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported. + #[serde(rename="valueType")] + pub value_type: Option, + /// The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. + pub labels: Option>, + /// The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: + /// "custom.googleapis.com/invoice/paid/amount" + /// "appengine.googleapis.com/http/server/response_latencies" + /// + #[serde(rename="type")] + pub type_: Option, + /// The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) + /// bit bit + /// By byte + /// s second + /// min minute + /// h hour + /// d dayPrefixes (PREFIX) + /// k kilo (10**3) + /// M mega (10**6) + /// G giga (10**9) + /// T tera (10**12) + /// P peta (10**15) + /// E exa (10**18) + /// Z zetta (10**21) + /// Y yotta (10**24) + /// m milli (10**-3) + /// u micro (10**-6) + /// n nano (10**-9) + /// p pico (10**-12) + /// f femto (10**-15) + /// a atto (10**-18) + /// z zepto (10**-21) + /// y yocto (10**-24) + /// Ki kibi (2**10) + /// Mi mebi (2**20) + /// Gi gibi (2**30) + /// Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors: + /// / division (as an infix operator, e.g. 1/s). + /// . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: + /// Expression = Component { "." Component } { "/" Component } ; + /// + /// Component = [ PREFIX ] UNIT [ Annotation ] + /// | Annotation + /// | "1" + /// ; + /// + /// Annotation = "{" NAME "}" ; + /// Notes: + /// Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. + /// NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. + pub unit: Option, + /// The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id: + /// "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" + /// + pub name: Option, +} + +impl Part for MetricDescriptor {} + + /// Result returned from ListSinks. /// /// # Activities @@ -715,19 +857,24 @@ pub struct ListSinksResponse { impl ResponseResult for ListSinksResponse {} -/// Result returned from WriteLogEntries. empty +/// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. /// -/// # 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*). -/// -/// * [write entries](struct.EntryWriteCall.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 WriteLogEntriesResponse { _never_set: Option } +pub struct BucketOptions { + /// The exponential buckets. + #[serde(rename="exponentialBuckets")] + pub exponential_buckets: Option, + /// The linear bucket. + #[serde(rename="linearBuckets")] + pub linear_buckets: Option, + /// The explicit buckets. + #[serde(rename="explicitBuckets")] + pub explicit_buckets: Option, +} -impl ResponseResult for WriteLogEntriesResponse {} +impl Part for BucketOptions {} /// The parameters to WriteLogEntries. @@ -760,7 +907,7 @@ pub struct WriteLogEntriesRequest { /// "zone": "us-central1-a", "instance_id": "00000000000000000000" }} /// See LogEntry. pub resource: Option, - /// Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are inserted into those log entries in this list that do not provide their own values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and less than later entries. Otherwise, the order of log entries in this list does not matter.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry. + /// Required. The log entries to send to Stackdriver Logging. The order of log entries in this list does not matter. Values supplied in this method's log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future might be discarded. Discarding does not return an error.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry. pub entries: Option>, } @@ -796,21 +943,18 @@ pub struct LogEntry { pub http_request: Option, /// Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. pub resource: Option, - /// Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT. - pub severity: Option, + /// Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 + pub trace: Option, /// The log entry payload, represented as a Unicode string (UTF-8). #[serde(rename="textPayload")] pub text_payload: Option, - /// Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted. + /// Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Stackdriver Logging assigns it the current time.Incoming log entries should have timestamps that are no more than the logs retention period in the past, and no more than 24 hours in the future. See the entries.write API method for more information. pub timestamp: Option, /// Optional. A set of user-defined (key, value) data that provides additional information about the log entry. pub labels: Option>, - /// Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value. + /// Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging assigns its own unique identifier. The insert_id is also used to order log entries that have the same timestamp value. #[serde(rename="insertId")] pub insert_id: Option, - /// The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads. - #[serde(rename="protoPayload")] - pub proto_payload: Option>, /// The log entry payload, represented as a structure that is expressed as a JSON object. #[serde(rename="jsonPayload")] pub json_payload: Option>, @@ -825,19 +969,22 @@ pub struct LogEntry { /// Output only. The time the log entry was received by Stackdriver Logging. #[serde(rename="receiveTimestamp")] pub receive_timestamp: Option, - /// Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 - pub trace: Option, + /// The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads. + #[serde(rename="protoPayload")] + pub proto_payload: Option>, /// Optional. Information about an operation associated with the log entry, if applicable. pub operation: Option, /// Optional. Source code location information associated with the log entry, if any. #[serde(rename="sourceLocation")] pub source_location: Option, + /// Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT. + pub severity: Option, } impl Part for LogEntry {} -/// Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval. +/// Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options. /// /// # Activities /// @@ -845,21 +992,33 @@ impl Part for LogEntry {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [metrics create projects](struct.ProjectMetricCreateCall.html) (request|response) -/// * [metrics update projects](struct.ProjectMetricUpdateCall.html) (request|response) /// * [metrics get projects](struct.ProjectMetricGetCall.html) (response) +/// * [metrics update projects](struct.ProjectMetricUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogMetric { + /// Optional. A description of this metric, which is used in documentation. + pub description: Option, + /// Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of "1". Such a metric counts the number of log entries matching the filter expression.The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description. + #[serde(rename="metricDescriptor")] + pub metric_descriptor: Option, + /// Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values. + #[serde(rename="bucketOptions")] + pub bucket_options: Option, + /// Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.The extracted value is converted to the type defined in the label descriptor. If the either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project. + #[serde(rename="labelExtractors")] + pub label_extractors: Option>, /// Required. An advanced logs filter which is used to match log entries. Example: /// "resource.type=gae_app AND severity>=ERROR" /// The maximum length of the filter is 20000 characters. pub filter: Option, - /// Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed. + /// Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the log entry field from which the value is to be extracted. 2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*") + #[serde(rename="valueExtractor")] + pub value_extractor: Option, + /// Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed. pub version: Option, /// Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests". pub name: Option, - /// Optional. A description of this metric, which is used in documentation. - pub description: Option, } impl RequestValue for LogMetric {} @@ -877,14 +1036,14 @@ impl ResponseResult for LogMetric {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MonitoredResourceDescriptor { - /// Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. - #[serde(rename="type")] - pub type_: Option, - /// Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone". - pub labels: Option>, /// Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database". #[serde(rename="displayName")] pub display_name: Option, + /// Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone". + pub labels: Option>, + /// Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. + #[serde(rename="type")] + pub type_: Option, /// Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}". pub name: Option, /// Optional. A detailed description of the monitored resource type that might be used in documentation. @@ -1170,47 +1329,6 @@ 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: - /// - /// Gets a logs-based metric. - /// - /// # Arguments - /// - /// * `metricName` - The resource name of the desired metric: - /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - /// - pub fn metrics_get(&self, metric_name: &str) -> ProjectMetricGetCall<'a, C, A> { - ProjectMetricGetCall { - hub: self.hub, - _metric_name: metric_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. - /// - /// # Arguments - /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - pub fn logs_delete(&self, log_name: &str) -> ProjectLogDeleteCall<'a, C, A> { - ProjectLogDeleteCall { - hub: self.hub, - _log_name: log_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists sinks. @@ -1280,7 +1398,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. + /// Gets a logs-based metric. + /// + /// # Arguments + /// + /// * `metricName` - The resource name of the desired metric: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// + pub fn metrics_get(&self, metric_name: &str) -> ProjectMetricGetCall<'a, C, A> { + ProjectMetricGetCall { + hub: self.hub, + _metric_name: metric_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. /// /// # Arguments /// @@ -1296,6 +1433,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { hub: self.hub, _request: request, _sink_name: sink_name.to_string(), + _update_mask: Default::default(), _unique_writer_identity: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1327,6 +1465,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. + /// + /// # Arguments + /// + /// * `logName` - Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + pub fn logs_delete(&self, log_name: &str) -> ProjectLogDeleteCall<'a, C, A> { + ProjectLogDeleteCall { + hub: self.hub, + _log_name: log_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a logs-based metric. @@ -1348,7 +1508,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// # Arguments /// @@ -1496,7 +1656,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Writes log entries to Stackdriver Logging. + /// Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging. /// /// # Arguments /// @@ -2840,519 +3000,6 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< } -/// Gets a logs-based metric. -/// -/// A builder for the *metrics.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2_beta1 as logging2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2_beta1::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().metrics_get("metricName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMetricGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _metric_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMetricGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectMetricGetCall<'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, LogMetric)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.metrics.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("metricName", self._metric_name.to_string())); - for &field in ["alt", "metricName"].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 = self.hub._base_url.clone() + "v2beta1/{+metricName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+metricName}", "metricName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["metricName"].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(Bearer { 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(d); - 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(d); - 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 resource name of the desired metric: - /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - /// - /// - /// Sets the *metric 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 metric_name(mut self, new_value: &str) -> ProjectMetricGetCall<'a, C, A> { - self._metric_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) -> ProjectMetricGetCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectMetricGetCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectMetricGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. -/// -/// A builder for the *logs.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2_beta1 as logging2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2_beta1::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().logs_delete("logName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLogDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _log_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLogDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLogDeleteCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.logs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("logName", self._log_name.to_string())); - for &field in ["alt", "logName"].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 = self.hub._base_url.clone() + "v2beta1/{+logName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+logName}", "logName")].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(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["logName"].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(Bearer { 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(d); - 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(d); - 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 name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - /// - /// Sets the *log 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 log_name(mut self, new_value: &str) -> ProjectLogDeleteCall<'a, C, A> { - self._log_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) -> ProjectLogDeleteCall<'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 - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *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) -> ProjectLogDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectLogDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists sinks. /// /// A builder for the *sinks.list* method supported by a *project* resource. @@ -3381,8 +3028,8 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().sinks_list("parent") -/// .page_token("gubergren") -/// .page_size(-95) +/// .page_token("nonumy") +/// .page_size(-19) /// .doit(); /// # } /// ``` @@ -4179,7 +3826,262 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().metrics_get("metricName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMetricGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _metric_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMetricGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectMetricGetCall<'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, LogMetric)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.metrics.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("metricName", self._metric_name.to_string())); + for &field in ["alt", "metricName"].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 = self.hub._base_url.clone() + "v2beta1/{+metricName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+metricName}", "metricName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["metricName"].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(Bearer { 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(d); + 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(d); + 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 resource name of the desired metric: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// + /// + /// Sets the *metric 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 metric_name(mut self, new_value: &str) -> ProjectMetricGetCall<'a, C, A> { + self._metric_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) -> ProjectMetricGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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) -> ProjectMetricGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectMetricGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field. /// /// A builder for the *sinks.update* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4213,6 +4115,7 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut hub: &'a Logging, _request: LogSink, _sink_name: String, + _update_mask: Option, _unique_writer_identity: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -4246,12 +4150,15 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut }; dlg.begin(MethodInfo { id: "logging.projects.sinks.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } if let Some(value) = self._unique_writer_identity { params.push(("uniqueWriterIdentity", value.to_string())); } - for &field in ["alt", "sinkName", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4408,10 +4315,17 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut self._sink_name = new_value.to_string(); self } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is false. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. /// /// Sets the *unique writer identity* query property to the given value. pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { @@ -4765,6 +4679,264 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A } +/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. +/// +/// A builder for the *logs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2_beta1 as logging2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2_beta1::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().logs_delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLogDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _log_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLogDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLogDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.logs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("logName", self._log_name.to_string())); + for &field in ["alt", "logName"].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 = self.hub._base_url.clone() + "v2beta1/{+logName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+logName}", "logName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["logName"].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(Bearer { 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(d); + 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(d); + 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 name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + /// + /// Sets the *log 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 log_name(mut self, new_value: &str) -> ProjectLogDeleteCall<'a, C, A> { + self._log_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) -> ProjectLogDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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) -> ProjectLogDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectLogDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a logs-based metric. /// /// A builder for the *metrics.delete* method supported by a *project* resource. @@ -5020,7 +5192,7 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricCreateCall<'a, C, A> where C: BorrowMut EntryListCall<'a, C, A> where C: BorrowMut, A: oau } -/// Writes log entries to Stackdriver Logging. +/// Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging. /// /// A builder for the *write* method supported by a *entry* resource. /// It is not used directly, but through a `EntryMethods` instance. diff --git a/gen/manufacturers1-cli/Cargo.toml b/gen/manufacturers1-cli/Cargo.toml index d8938428c3..6ddad4f55a 100644 --- a/gen/manufacturers1-cli/Cargo.toml +++ b/gen/manufacturers1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-manufacturers1-cli" -version = "1.0.6+20170412" +version = "1.0.6+20170808" authors = ["Sebastian Thiel "] description = "A complete library to interact with Manufacturer Center (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manufacturers1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-manufacturers1] path = "../manufacturers1" -version = "1.0.6+20170412" +version = "1.0.6+20170808" diff --git a/gen/manufacturers1-cli/README.md b/gen/manufacturers1-cli/README.md index 1ad9efda6c..5a71487be2 100644 --- a/gen/manufacturers1-cli/README.md +++ b/gen/manufacturers1-cli/README.md @@ -25,13 +25,15 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Manufacturer Center* API at revision *20170412*. The CLI is at version *1.0.6*. +This documentation was generated from the *Manufacturer Center* API at revision *20170808*. The CLI is at version *1.0.6*. ```bash manufacturers1 [options] accounts + products-delete [-p ]... [-o ] products-get [-p ]... [-o ] products-list [-p ]... [-o ] + products-update (-r )... [-p ]... [-o ] manufacturers1 --help Configuration: diff --git a/gen/manufacturers1-cli/mkdocs.yml b/gen/manufacturers1-cli/mkdocs.yml index 7a1ea582c3..36bba7ca32 100644 --- a/gen/manufacturers1-cli/mkdocs.yml +++ b/gen/manufacturers1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Manufacturer Center v1.0.6+20170412 +site_name: Manufacturer Center v1.0.6+20170808 site_url: http://byron.github.io/google-apis-rs/google-manufacturers1-cli site_description: A complete library to interact with Manufacturer Center (protocol v1) @@ -9,8 +9,10 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['accounts_products-delete.md', 'Accounts', 'Products Delete'] - ['accounts_products-get.md', 'Accounts', 'Products Get'] - ['accounts_products-list.md', 'Accounts', 'Products List'] +- ['accounts_products-update.md', 'Accounts', 'Products Update'] theme: readthedocs diff --git a/gen/manufacturers1-cli/src/main.rs b/gen/manufacturers1-cli/src/main.rs index 21f39429c0..f34bc8b92e 100644 --- a/gen/manufacturers1-cli/src/main.rs +++ b/gen/manufacturers1-cli/src/main.rs @@ -46,6 +46,58 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _accounts_products_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().products_delete(opt.value_of("parent").unwrap_or(""), opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _accounts_products_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.accounts().products_get(opt.value_of("parent").unwrap_or(""), opt.value_of("name").unwrap_or("")); @@ -157,6 +209,201 @@ impl<'n> Engine<'n> { } } + fn _accounts_products_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "target-country" => Some(("targetCountry", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "manually-deleted-attributes" => Some(("manuallyDeletedAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.product-line" => Some(("manuallyProvidedAttributes.productLine", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.color" => Some(("manuallyProvidedAttributes.color", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.release-date" => Some(("manuallyProvidedAttributes.releaseDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.item-group-id" => Some(("manuallyProvidedAttributes.itemGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.video-link" => Some(("manuallyProvidedAttributes.videoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "manually-provided-attributes.flavor" => Some(("manuallyProvidedAttributes.flavor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.scent" => Some(("manuallyProvidedAttributes.scent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.size" => Some(("manuallyProvidedAttributes.size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.capacity.value" => Some(("manuallyProvidedAttributes.capacity.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.capacity.unit" => Some(("manuallyProvidedAttributes.capacity.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.title" => Some(("manuallyProvidedAttributes.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.pattern" => Some(("manuallyProvidedAttributes.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.disclosure-date" => Some(("manuallyProvidedAttributes.disclosureDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.theme" => Some(("manuallyProvidedAttributes.theme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.suggested-retail-price.currency" => Some(("manuallyProvidedAttributes.suggestedRetailPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.suggested-retail-price.amount" => Some(("manuallyProvidedAttributes.suggestedRetailPrice.amount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.description" => Some(("manuallyProvidedAttributes.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.format" => Some(("manuallyProvidedAttributes.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.mpn" => Some(("manuallyProvidedAttributes.mpn", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.brand" => Some(("manuallyProvidedAttributes.brand", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.material" => Some(("manuallyProvidedAttributes.material", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.product-name" => Some(("manuallyProvidedAttributes.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.size-system" => Some(("manuallyProvidedAttributes.sizeSystem", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.size-type" => Some(("manuallyProvidedAttributes.sizeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.count.value" => Some(("manuallyProvidedAttributes.count.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.count.unit" => Some(("manuallyProvidedAttributes.count.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.gender" => Some(("manuallyProvidedAttributes.gender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.product-page-url" => Some(("manuallyProvidedAttributes.productPageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.image-link.status" => Some(("manuallyProvidedAttributes.imageLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.image-link.image-url" => Some(("manuallyProvidedAttributes.imageLink.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.image-link.type" => Some(("manuallyProvidedAttributes.imageLink.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.product-type" => Some(("manuallyProvidedAttributes.productType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "manually-provided-attributes.target-account-id" => Some(("manuallyProvidedAttributes.targetAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manually-provided-attributes.gtin" => Some(("manuallyProvidedAttributes.gtin", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "manually-provided-attributes.age-group" => Some(("manuallyProvidedAttributes.ageGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.product-line" => Some(("finalAttributes.productLine", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.color" => Some(("finalAttributes.color", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.release-date" => Some(("finalAttributes.releaseDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.item-group-id" => Some(("finalAttributes.itemGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.video-link" => Some(("finalAttributes.videoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "final-attributes.flavor" => Some(("finalAttributes.flavor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.scent" => Some(("finalAttributes.scent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.size" => Some(("finalAttributes.size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.capacity.value" => Some(("finalAttributes.capacity.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.capacity.unit" => Some(("finalAttributes.capacity.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.title" => Some(("finalAttributes.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.pattern" => Some(("finalAttributes.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.disclosure-date" => Some(("finalAttributes.disclosureDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.theme" => Some(("finalAttributes.theme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.suggested-retail-price.currency" => Some(("finalAttributes.suggestedRetailPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.suggested-retail-price.amount" => Some(("finalAttributes.suggestedRetailPrice.amount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.description" => Some(("finalAttributes.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.format" => Some(("finalAttributes.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.mpn" => Some(("finalAttributes.mpn", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.brand" => Some(("finalAttributes.brand", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.material" => Some(("finalAttributes.material", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.product-name" => Some(("finalAttributes.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.size-system" => Some(("finalAttributes.sizeSystem", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.size-type" => Some(("finalAttributes.sizeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.count.value" => Some(("finalAttributes.count.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.count.unit" => Some(("finalAttributes.count.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.gender" => Some(("finalAttributes.gender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.product-page-url" => Some(("finalAttributes.productPageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.image-link.status" => Some(("finalAttributes.imageLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.image-link.image-url" => Some(("finalAttributes.imageLink.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.image-link.type" => Some(("finalAttributes.imageLink.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.product-type" => Some(("finalAttributes.productType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "final-attributes.target-account-id" => Some(("finalAttributes.targetAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-attributes.gtin" => Some(("finalAttributes.gtin", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "final-attributes.age-group" => Some(("finalAttributes.ageGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.product-line" => Some(("uploadedAttributes.productLine", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.color" => Some(("uploadedAttributes.color", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.release-date" => Some(("uploadedAttributes.releaseDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.item-group-id" => Some(("uploadedAttributes.itemGroupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.video-link" => Some(("uploadedAttributes.videoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "uploaded-attributes.flavor" => Some(("uploadedAttributes.flavor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.scent" => Some(("uploadedAttributes.scent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.size" => Some(("uploadedAttributes.size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.capacity.value" => Some(("uploadedAttributes.capacity.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.capacity.unit" => Some(("uploadedAttributes.capacity.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.title" => Some(("uploadedAttributes.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.pattern" => Some(("uploadedAttributes.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.disclosure-date" => Some(("uploadedAttributes.disclosureDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.theme" => Some(("uploadedAttributes.theme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.suggested-retail-price.currency" => Some(("uploadedAttributes.suggestedRetailPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.suggested-retail-price.amount" => Some(("uploadedAttributes.suggestedRetailPrice.amount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.description" => Some(("uploadedAttributes.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.format" => Some(("uploadedAttributes.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.mpn" => Some(("uploadedAttributes.mpn", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.brand" => Some(("uploadedAttributes.brand", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.material" => Some(("uploadedAttributes.material", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.product-name" => Some(("uploadedAttributes.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.size-system" => Some(("uploadedAttributes.sizeSystem", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.size-type" => Some(("uploadedAttributes.sizeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.count.value" => Some(("uploadedAttributes.count.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.count.unit" => Some(("uploadedAttributes.count.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.gender" => Some(("uploadedAttributes.gender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.product-page-url" => Some(("uploadedAttributes.productPageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.image-link.status" => Some(("uploadedAttributes.imageLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.image-link.image-url" => Some(("uploadedAttributes.imageLink.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.image-link.type" => Some(("uploadedAttributes.imageLink.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.product-type" => Some(("uploadedAttributes.productType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "uploaded-attributes.target-account-id" => Some(("uploadedAttributes.targetAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uploaded-attributes.gtin" => Some(("uploadedAttributes.gtin", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "uploaded-attributes.age-group" => Some(("uploadedAttributes.ageGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-language" => Some(("contentLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["age-group", "amount", "brand", "capacity", "color", "content-language", "count", "currency", "description", "disclosure-date", "final-attributes", "flavor", "format", "gender", "gtin", "image-link", "image-url", "item-group-id", "manually-deleted-attributes", "manually-provided-attributes", "material", "mpn", "name", "parent", "pattern", "product-id", "product-line", "product-name", "product-page-url", "product-type", "release-date", "scent", "size", "size-system", "size-type", "status", "suggested-retail-price", "target-account-id", "target-country", "theme", "title", "type", "unit", "uploaded-attributes", "value", "video-link"]); + 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::Product = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().products_update(request, opt.value_of("parent").unwrap_or(""), opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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(()); @@ -164,12 +411,18 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("accounts", Some(opt)) => { match opt.subcommand() { + ("products-delete", Some(opt)) => { + call_result = self._accounts_products_delete(opt, dry_run, &mut err); + }, ("products-get", Some(opt)) => { call_result = self._accounts_products_get(opt, dry_run, &mut err); }, ("products-list", Some(opt)) => { call_result = self._accounts_products_list(opt, dry_run, &mut err); }, + ("products-update", Some(opt)) => { + call_result = self._accounts_products_update(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("accounts".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -262,10 +515,54 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("accounts", "methods: 'products-get' and 'products-list'", vec![ + ("accounts", "methods: 'products-delete', 'products-get', 'products-list' and 'products-update'", vec![ + ("products-delete", + Some(r##"Deletes the product from a Manufacturer Center account."##), + "Details at http://byron.github.io/google-apis-rs/google_manufacturers1_cli/accounts_products-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Parent ID in the format `accounts/{account_id}`. + + `account_id` - The ID of the Manufacturer Center account."##), + Some(true), + Some(false)), + + (Some(r##"name"##), + None, + Some(r##"Name in the format `{target_country}:{content_language}:{product_id}`. + + `target_country` - The target country of the product as a CLDR territory + code (for example, US). + + `content_language` - The content language of the product as a two-letter + ISO 639-1 language code (for example, en). + + `product_id` - The ID of the product. For more information, see + https://support.google.com/manufacturers/answer/6124116#id."##), + 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)), + ]), ("products-get", Some(r##"Gets the product from a Manufacturer Center account, including product - issues."##), + issues. + + A recently updated product takes around 15 minutes to process. Changes are + only visible after it has been processed. While some issues may be + available once the product has been processed, other issues may take days + to appear."##), "Details at http://byron.github.io/google-apis-rs/google_manufacturers1_cli/accounts_products-get", vec![ (Some(r##"parent"##), @@ -321,6 +618,62 @@ 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)), + ]), + ("products-update", + Some(r##"Inserts or updates the product in a Manufacturer Center account. + + The checks at upload time are minimal. All required attributes need to be + present for a product to be valid. Issues may show up later + after the API has accepted an update for a product and it is possible to + overwrite an existing valid product with an invalid product. To detect + this, you should retrieve the product and check it for issues once the + updated version is available. + + Inserted or updated products first need to be processed before they can be + retrieved. Until then, new products will be unavailable, and retrieval + of updated products will return the original state of the product."##), + "Details at http://byron.github.io/google-apis-rs/google_manufacturers1_cli/accounts_products-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Parent ID in the format `accounts/{account_id}`. + + `account_id` - The ID of the Manufacturer Center account."##), + Some(true), + Some(false)), + + (Some(r##"name"##), + None, + Some(r##"Name in the format `{target_country}:{content_language}:{product_id}`. + + `target_country` - The target country of the product as a CLDR territory + code (for example, US). + + `content_language` - The content language of the product as a two-letter + ISO 639-1 language code (for example, en). + + `product_id` - The ID of the product. For more information, see + https://support.google.com/manufacturers/answer/6124116#id."##), + 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"##), @@ -333,7 +686,7 @@ fn main() { let mut app = App::new("manufacturers1") .author("Sebastian Thiel ") - .version("1.0.6+20170412") + .version("1.0.6+20170808") .about("Public API for managing Manufacturer Center related data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_manufacturers1_cli") .arg(Arg::with_name("url") diff --git a/gen/manufacturers1/Cargo.toml b/gen/manufacturers1/Cargo.toml index 7415f7cb4a..b873da5083 100644 --- a/gen/manufacturers1/Cargo.toml +++ b/gen/manufacturers1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-manufacturers1" -version = "1.0.6+20170412" +version = "1.0.6+20170808" authors = ["Sebastian Thiel "] description = "A complete library to interact with Manufacturer Center (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manufacturers1" homepage = "https://developers.google.com/manufacturers/" -documentation = "https://docs.rs/google-manufacturers1/1.0.6+20170412" +documentation = "https://docs.rs/google-manufacturers1/1.0.6+20170808" license = "MIT" keywords = ["manufacturers", "google", "protocol", "web", "api"] diff --git a/gen/manufacturers1/README.md b/gen/manufacturers1/README.md index a2cd57beb3..d8f6d0af78 100644 --- a/gen/manufacturers1/README.md +++ b/gen/manufacturers1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-manufacturers1` library allows access to all features of the *Google Manufacturer Center* service. -This documentation was generated from *Manufacturer Center* crate version *1.0.6+20170412*, where *20170412* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Manufacturer Center* crate version *1.0.6+20170808*, where *20170808* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Manufacturer Center* *v1* API can be found at the [official documentation site](https://developers.google.com/manufacturers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/struct.ManufacturerCenter.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/struct.ManufacturerCenter.html) ... * accounts - * [*products get*](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/struct.AccountProductGetCall.html) and [*products list*](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/struct.AccountProductListCall.html) + * [*products delete*](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/struct.AccountProductDeleteCall.html), [*products get*](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/struct.AccountProductGetCall.html), [*products list*](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/struct.AccountProductListCall.html) and [*products update*](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/struct.AccountProductUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/struct.ManufacturerCenter.html)** +* **[Hub](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/struct.ManufacturerCenter.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.Part.html)** + * **[Parts](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,6 +47,7 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.accounts().products_update(...).doit() let r = hub.accounts().products_get(...).doit() ``` @@ -73,6 +74,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_manufacturers1 as manufacturers1; +use manufacturers1::Product; use manufacturers1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -90,10 +92,15 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = ManufacturerCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Product::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.accounts().products_get("parent", "name") +let result = hub.accounts().products_update(req, "parent", "name") .doit(); match result { @@ -116,17 +123,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/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")`. @@ -136,29 +143,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/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](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/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](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/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](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/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](https://docs.rs/google-manufacturers1/1.0.6+20170412/google_manufacturers1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/manufacturers1/src/lib.rs b/gen/manufacturers1/src/lib.rs index 2056ff8ad0..efd16a2a16 100644 --- a/gen/manufacturers1/src/lib.rs +++ b/gen/manufacturers1/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 *Manufacturer Center* crate version *1.0.6+20170412*, where *20170412* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Manufacturer Center* crate version *1.0.6+20170808*, where *20170808* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Manufacturer Center* *v1* API can be found at the //! [official documentation site](https://developers.google.com/manufacturers/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.ManufacturerCenter.html) ... //! //! * accounts -//! * [*products get*](struct.AccountProductGetCall.html) and [*products list*](struct.AccountProductListCall.html) +//! * [*products delete*](struct.AccountProductDeleteCall.html), [*products get*](struct.AccountProductGetCall.html), [*products list*](struct.AccountProductListCall.html) and [*products update*](struct.AccountProductUpdateCall.html) //! //! //! @@ -47,6 +47,7 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.accounts().products_update(...).doit() //! let r = hub.accounts().products_get(...).doit() //! ``` //! @@ -73,6 +74,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_manufacturers1 as manufacturers1; +//! use manufacturers1::Product; //! use manufacturers1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -91,10 +93,15 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = ManufacturerCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Product::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.accounts().products_get("parent", "name") +//! let result = hub.accounts().products_update(req, "parent", "name") //! .doit(); //! //! match result { @@ -252,6 +259,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_manufacturers1 as manufacturers1; +/// use manufacturers1::Product; /// use manufacturers1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -270,10 +278,15 @@ impl Default for Scope { /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = ManufacturerCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Product::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.accounts().products_get("parent", "name") +/// let result = hub.accounts().products_update(req, "parent", "name") /// .doit(); /// /// match result { @@ -357,10 +370,10 @@ impl<'a, C, A> ManufacturerCenter /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Count { - /// The numeric value of the number of products in a package. - pub value: Option, /// The unit in which these products are counted. pub unit: Option, + /// The numeric value of the number of products in a package. + pub value: Option, } impl Part for Count {} @@ -373,6 +386,7 @@ impl Part for Count {} /// 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*). /// +/// * [products update accounts](struct.AccountProductUpdateCall.html) (request|response) /// * [products get accounts](struct.AccountProductGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -387,16 +401,6 @@ pub struct Product { /// @OutputOnly #[serde(rename="manuallyDeletedAttributes")] pub manually_deleted_attributes: Option>, - /// Parent ID in the format `accounts/{account_id}`. - /// - /// `account_id` - The ID of the Manufacturer Center account. - /// @OutputOnly - pub parent: Option, - /// The content language of the product as a two-letter ISO 639-1 language code - /// (for example, en). - /// @OutputOnly - #[serde(rename="contentLanguage")] - pub content_language: Option, /// Name in the format `{target_country}:{content_language}:{product_id}`. /// /// `target_country` - The target country of the product as a CLDR territory @@ -409,6 +413,11 @@ pub struct Product { /// https://support.google.com/manufacturers/answer/6124116#id. /// @OutputOnly pub name: Option, + /// Parent ID in the format `accounts/{account_id}`. + /// + /// `account_id` - The ID of the Manufacturer Center account. + /// @OutputOnly + pub parent: Option, /// Attributes of the product provided manually via the Manufacturer Center UI. /// @OutputOnly #[serde(rename="manuallyProvidedAttributes")] @@ -424,6 +433,11 @@ pub struct Product { /// feeds. #[serde(rename="uploadedAttributes")] pub uploaded_attributes: Option, + /// The content language of the product as a two-letter ISO 639-1 language code + /// (for example, en). + /// @OutputOnly + #[serde(rename="contentLanguage")] + pub content_language: Option, /// A server-generated list of issues associated with the product. /// @OutputOnly pub issues: Option>, @@ -434,6 +448,7 @@ pub struct Product { pub product_id: Option, } +impl RequestValue for Product {} impl ResponseResult for Product {} @@ -444,10 +459,10 @@ impl ResponseResult for Product {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Capacity { - /// The numeric value of the capacity. - pub value: Option, /// The unit of the capacity, i.e., MB, GB, or TB. pub unit: Option, + /// The numeric value of the capacity. + pub value: Option, } impl Part for Capacity {} @@ -649,6 +664,10 @@ pub struct Attributes { /// https://support.google.com/manufacturers/answer/6124116#producttype. #[serde(rename="productType")] pub product_type: Option>, + /// The target account id. Should only be used in the accounts of the data + /// partners. + #[serde(rename="targetAccountId")] + pub target_account_id: Option, /// The Global Trade Item Number (GTIN) of the product. For more information, /// see https://support.google.com/manufacturers/answer/6124116#gtin. pub gtin: Option>, @@ -701,6 +720,29 @@ pub struct Price { impl Part for Price {} +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [products delete accounts](struct.AccountProductDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + // ################### // MethodBuilders ### @@ -730,7 +772,7 @@ impl Part for Price {} /// ::default(), None); /// let mut hub = ManufacturerCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `products_get(...)` and `products_list(...)` +/// // like `products_delete(...)`, `products_get(...)`, `products_list(...)` and `products_update(...)` /// // to build up your call. /// let rb = hub.accounts(); /// # } @@ -765,11 +807,81 @@ impl<'a, C, A> AccountMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Inserts or updates the product in a Manufacturer Center account. + /// + /// The checks at upload time are minimal. All required attributes need to be + /// present for a product to be valid. Issues may show up later + /// after the API has accepted an update for a product and it is possible to + /// overwrite an existing valid product with an invalid product. To detect + /// this, you should retrieve the product and check it for issues once the + /// updated version is available. + /// + /// Inserted or updated products first need to be processed before they can be + /// retrieved. Until then, new products will be unavailable, and retrieval + /// of updated products will return the original state of the product. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Parent ID in the format `accounts/{account_id}`. + /// `account_id` - The ID of the Manufacturer Center account. + /// * `name` - Name in the format `{target_country}:{content_language}:{product_id}`. + /// `target_country` - The target country of the product as a CLDR territory + /// code (for example, US). + /// `content_language` - The content language of the product as a two-letter + /// ISO 639-1 language code (for example, en). + /// `product_id` - The ID of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#id. + pub fn products_update(&self, request: Product, parent: &str, name: &str) -> AccountProductUpdateCall<'a, C, A> { + AccountProductUpdateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the product from a Manufacturer Center account. + /// + /// # Arguments + /// + /// * `parent` - Parent ID in the format `accounts/{account_id}`. + /// `account_id` - The ID of the Manufacturer Center account. + /// * `name` - Name in the format `{target_country}:{content_language}:{product_id}`. + /// `target_country` - The target country of the product as a CLDR territory + /// code (for example, US). + /// `content_language` - The content language of the product as a two-letter + /// ISO 639-1 language code (for example, en). + /// `product_id` - The ID of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#id. + pub fn products_delete(&self, parent: &str, name: &str) -> AccountProductDeleteCall<'a, C, A> { + AccountProductDeleteCall { + hub: self.hub, + _parent: parent.to_string(), + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the product from a Manufacturer Center account, including product /// issues. /// + /// A recently updated product takes around 15 minutes to process. Changes are + /// only visible after it has been processed. While some issues may be + /// available once the product has been processed, other issues may take days + /// to appear. + /// /// # Arguments /// /// * `parent` - Parent ID in the format `accounts/{account_id}`. @@ -1036,17 +1148,17 @@ impl<'a, C, A> AccountProductListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountProductListCall<'a, C, A> @@ -1081,8 +1193,607 @@ impl<'a, C, A> AccountProductListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ManufacturerCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Product::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.accounts().products_update(req, "parent", "name") +/// .doit(); +/// # } +/// ``` +pub struct AccountProductUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ManufacturerCenter, + _request: Product, + _parent: String, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountProductUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountProductUpdateCall<'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, Product)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "manufacturers.accounts.products.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "parent", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["name", "parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Product) -> AccountProductUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Parent ID in the format `accounts/{account_id}`. + /// + /// `account_id` - The ID of the Manufacturer Center account. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountProductUpdateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Name in the format `{target_country}:{content_language}:{product_id}`. + /// + /// `target_country` - The target country of the product as a CLDR territory + /// code (for example, US). + /// + /// `content_language` - The content language of the product as a two-letter + /// ISO 639-1 language code (for example, en). + /// + /// `product_id` - The ID of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#id. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccountProductUpdateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AccountProductUpdateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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) -> AccountProductUpdateCall<'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::Manufacturercenter`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountProductUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the product from a Manufacturer Center account. +/// +/// A builder for the *products.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_manufacturers1 as manufacturers1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use manufacturers1::ManufacturerCenter; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ManufacturerCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().products_delete("parent", "name") +/// .doit(); +/// # } +/// ``` +pub struct AccountProductDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ManufacturerCenter, + _parent: String, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountProductDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountProductDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "manufacturers.accounts.products.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "parent", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["name", "parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Parent ID in the format `accounts/{account_id}`. + /// + /// `account_id` - The ID of the Manufacturer Center account. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountProductDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Name in the format `{target_country}:{content_language}:{product_id}`. + /// + /// `target_country` - The target country of the product as a CLDR territory + /// code (for example, US). + /// + /// `content_language` - The content language of the product as a two-letter + /// ISO 639-1 language code (for example, en). + /// + /// `product_id` - The ID of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#id. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccountProductDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AccountProductDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *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) -> AccountProductDeleteCall<'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::Manufacturercenter`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountProductDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the product from a Manufacturer Center account, including product /// issues. +/// +/// A recently updated product takes around 15 minutes to process. Changes are +/// only visible after it has been processed. While some issues may be +/// available once the product has been processed, other issues may take days +/// to appear. /// /// A builder for the *products.get* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -1313,17 +2024,17 @@ impl<'a, C, A> AccountProductGetCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AccountProductGetCall<'a, C, A> diff --git a/gen/ml1-cli/Cargo.toml b/gen/ml1-cli/Cargo.toml new file mode 100644 index 0000000000..aa29587867 --- /dev/null +++ b/gen/ml1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-ml1-cli" +version = "1.0.6+20170926" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Machine Learning Engine (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/ml1-cli" +homepage = "https://cloud.google.com/ml/" +documentation = "http://byron.github.io/google-apis-rs/google_ml1_cli" +license = "MIT" +keywords = ["ml", "google", "cli"] + +[[bin]] +name = "ml1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-ml1] +path = "../ml1" +version = "1.0.6+20170926" diff --git a/gen/ml1-cli/LICENSE.md b/gen/ml1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/ml1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/ml1-cli/README.md b/gen/ml1-cli/README.md new file mode 100644 index 0000000000..4dbc5e3978 --- /dev/null +++ b/gen/ml1-cli/README.md @@ -0,0 +1,138 @@ + +The `ml1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Machine Learning Engine* 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 *Cloud Machine Learning Engine* API can be found at the +[official documentation site](https://cloud.google.com/ml/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-ml1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/ml1-cli). + +# Usage + +This documentation was generated from the *Cloud Machine Learning Engine* API at revision *20170926*. The CLI is at version *1.0.6*. + +```bash +ml1 [options] + projects + get-config [-p ]... [-o ] + jobs-cancel (-r )... [-p ]... [-o ] + jobs-create (-r )... [-p ]... [-o ] + jobs-get [-p ]... [-o ] + jobs-get-iam-policy [-p ]... [-o ] + jobs-list [-p ]... [-o ] + jobs-set-iam-policy (-r )... [-p ]... [-o ] + jobs-test-iam-permissions (-r )... [-p ]... [-o ] + models-create (-r )... [-p ]... [-o ] + models-delete [-p ]... [-o ] + models-get [-p ]... [-o ] + models-get-iam-policy [-p ]... [-o ] + models-list [-p ]... [-o ] + models-set-iam-policy (-r )... [-p ]... [-o ] + models-test-iam-permissions (-r )... [-p ]... [-o ] + models-versions-create (-r )... [-p ]... [-o ] + models-versions-delete [-p ]... [-o ] + models-versions-get [-p ]... [-o ] + models-versions-list [-p ]... [-o ] + models-versions-set-default (-r )... [-p ]... [-o ] + operations-cancel [-p ]... [-o ] + operations-delete [-p ]... [-o ] + operations-get [-p ]... [-o ] + operations-list [-p ]... [-o ] + predict (-r )... [-p ]... [-o ] + ml1 --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 `ml1-`. 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/ml1-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/ml1-secret.json`, assuming that the required *ml* 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. `ml1 --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/ml1-cli/mkdocs.yml b/gen/ml1-cli/mkdocs.yml new file mode 100644 index 0000000000..c7cce46641 --- /dev/null +++ b/gen/ml1-cli/mkdocs.yml @@ -0,0 +1,41 @@ +site_name: Cloud Machine Learning Engine v1.0.6+20170926 +site_url: http://byron.github.io/google-apis-rs/google-ml1-cli +site_description: A complete library to interact with Cloud Machine Learning Engine (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/ml1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_get-config.md', 'Projects', 'Get Config'] +- ['projects_jobs-cancel.md', 'Projects', 'Jobs Cancel'] +- ['projects_jobs-create.md', 'Projects', 'Jobs Create'] +- ['projects_jobs-get.md', 'Projects', 'Jobs Get'] +- ['projects_jobs-get-iam-policy.md', 'Projects', 'Jobs Get Iam Policy'] +- ['projects_jobs-list.md', 'Projects', 'Jobs List'] +- ['projects_jobs-set-iam-policy.md', 'Projects', 'Jobs Set Iam Policy'] +- ['projects_jobs-test-iam-permissions.md', 'Projects', 'Jobs Test Iam Permissions'] +- ['projects_models-create.md', 'Projects', 'Models Create'] +- ['projects_models-delete.md', 'Projects', 'Models Delete'] +- ['projects_models-get.md', 'Projects', 'Models Get'] +- ['projects_models-get-iam-policy.md', 'Projects', 'Models Get Iam Policy'] +- ['projects_models-list.md', 'Projects', 'Models List'] +- ['projects_models-set-iam-policy.md', 'Projects', 'Models Set Iam Policy'] +- ['projects_models-test-iam-permissions.md', 'Projects', 'Models Test Iam Permissions'] +- ['projects_models-versions-create.md', 'Projects', 'Models Versions Create'] +- ['projects_models-versions-delete.md', 'Projects', 'Models Versions Delete'] +- ['projects_models-versions-get.md', 'Projects', 'Models Versions Get'] +- ['projects_models-versions-list.md', 'Projects', 'Models Versions List'] +- ['projects_models-versions-set-default.md', 'Projects', 'Models Versions Set Default'] +- ['projects_operations-cancel.md', 'Projects', 'Operations Cancel'] +- ['projects_operations-delete.md', 'Projects', 'Operations Delete'] +- ['projects_operations-get.md', 'Projects', 'Operations Get'] +- ['projects_operations-list.md', 'Projects', 'Operations List'] +- ['projects_predict.md', 'Projects', 'Predict'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/ml1-cli/src/cmn.rs b/gen/ml1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/ml1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/ml1-cli/src/main.rs b/gen/ml1-cli/src/main.rs new file mode 100644 index 0000000000..a863d0cb63 --- /dev/null +++ b/gen/ml1-cli/src/main.rs @@ -0,0 +1,2764 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_ml1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudMachineLearningEngine>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_get_config(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get_config(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_cancel(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__CancelJobRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().jobs_cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "training-output.completed-trial-count" => Some(("trainingOutput.completedTrialCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-output.is-hyperparameter-tuning-job" => Some(("trainingOutput.isHyperparameterTuningJob", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "training-output.consumed-ml-units" => Some(("trainingOutput.consumedMLUnits", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "training-input.worker-type" => Some(("trainingInput.workerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.runtime-version" => Some(("trainingInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.scale-tier" => Some(("trainingInput.scaleTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-type" => Some(("trainingInput.masterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.hyperparameters.max-trials" => Some(("trainingInput.hyperparameters.maxTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.hyperparameters.hyperparameter-metric-tag" => Some(("trainingInput.hyperparameters.hyperparameterMetricTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.hyperparameters.max-parallel-trials" => Some(("trainingInput.hyperparameters.maxParallelTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.hyperparameters.goal" => Some(("trainingInput.hyperparameters.goal", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.region" => Some(("trainingInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.args" => Some(("trainingInput.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "training-input.python-module" => Some(("trainingInput.pythonModule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.job-dir" => Some(("trainingInput.jobDir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.package-uris" => Some(("trainingInput.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "training-input.worker-count" => Some(("trainingInput.workerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.parameter-server-type" => Some(("trainingInput.parameterServerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-count" => Some(("trainingInput.parameterServerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "prediction-input.model-name" => Some(("predictionInput.modelName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.runtime-version" => Some(("predictionInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.batch-size" => Some(("predictionInput.batchSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.max-worker-count" => Some(("predictionInput.maxWorkerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "prediction-input.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "prediction-input.uri" => Some(("predictionInput.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.output-path" => Some(("predictionInput.outputPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.data-format" => Some(("predictionInput.dataFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.version-name" => Some(("predictionInput.versionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.region" => Some(("predictionInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-output.node-hours" => Some(("predictionOutput.nodeHours", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "prediction-output.output-path" => Some(("predictionOutput.outputPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-output.prediction-count" => Some(("predictionOutput.predictionCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "prediction-output.error-count" => Some(("predictionOutput.errorCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["args", "batch-size", "completed-trial-count", "consumed-ml-units", "create-time", "data-format", "end-time", "error-count", "error-message", "goal", "hyperparameter-metric-tag", "hyperparameters", "input-paths", "is-hyperparameter-tuning-job", "job-dir", "job-id", "master-type", "max-parallel-trials", "max-trials", "max-worker-count", "model-name", "node-hours", "output-path", "package-uris", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "region", "runtime-version", "scale-tier", "start-time", "state", "training-input", "training-output", "uri", "version-name", "worker-count", "worker-type"]); + 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::GoogleCloudMlV1__Job = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().jobs_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().jobs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().jobs_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().jobs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "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::GoogleIamV1__SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().jobs_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_jobs_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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::GoogleIamV1__TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().jobs_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "regions" => Some(("regions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-version.error-message" => Some(("defaultVersion.errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.name" => Some(("defaultVersion.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.runtime-version" => Some(("defaultVersion.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.manual-scaling.nodes" => Some(("defaultVersion.manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.auto-scaling.min-nodes" => Some(("defaultVersion.autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.state" => Some(("defaultVersion.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.last-use-time" => Some(("defaultVersion.lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.deployment-uri" => Some(("defaultVersion.deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.create-time" => Some(("defaultVersion.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.is-default" => Some(("defaultVersion.isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-version.description" => Some(("defaultVersion.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "online-prediction-logging" => Some(("onlinePredictionLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "default-version", "deployment-uri", "description", "error-message", "is-default", "last-use-time", "manual-scaling", "min-nodes", "name", "nodes", "online-prediction-logging", "regions", "runtime-version", "state"]); + 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::GoogleCloudMlV1__Model = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().models_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "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::GoogleIamV1__SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().models_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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::GoogleIamV1__TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().models_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_versions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "runtime-version" => Some(("runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.nodes" => Some(("manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "auto-scaling.min-nodes" => Some(("autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-use-time" => Some(("lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deployment-uri" => Some(("deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-default" => Some(("isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "deployment-uri", "description", "error-message", "is-default", "last-use-time", "manual-scaling", "min-nodes", "name", "nodes", "runtime-version", "state"]); + 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::GoogleCloudMlV1__Version = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().models_versions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_versions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_versions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_versions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_versions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_versions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().models_versions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_models_versions_set_default(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__SetDefaultVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().models_versions_set_default(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_predict(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "http-body.data" => Some(("httpBody.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-body.content-type" => Some(("httpBody.contentType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-type", "data", "http-body"]); + 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::GoogleCloudMlV1__PredictRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().predict(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("get-config", Some(opt)) => { + call_result = self._projects_get_config(opt, dry_run, &mut err); + }, + ("jobs-cancel", Some(opt)) => { + call_result = self._projects_jobs_cancel(opt, dry_run, &mut err); + }, + ("jobs-create", Some(opt)) => { + call_result = self._projects_jobs_create(opt, dry_run, &mut err); + }, + ("jobs-get", Some(opt)) => { + call_result = self._projects_jobs_get(opt, dry_run, &mut err); + }, + ("jobs-get-iam-policy", Some(opt)) => { + call_result = self._projects_jobs_get_iam_policy(opt, dry_run, &mut err); + }, + ("jobs-list", Some(opt)) => { + call_result = self._projects_jobs_list(opt, dry_run, &mut err); + }, + ("jobs-set-iam-policy", Some(opt)) => { + call_result = self._projects_jobs_set_iam_policy(opt, dry_run, &mut err); + }, + ("jobs-test-iam-permissions", Some(opt)) => { + call_result = self._projects_jobs_test_iam_permissions(opt, dry_run, &mut err); + }, + ("models-create", Some(opt)) => { + call_result = self._projects_models_create(opt, dry_run, &mut err); + }, + ("models-delete", Some(opt)) => { + call_result = self._projects_models_delete(opt, dry_run, &mut err); + }, + ("models-get", Some(opt)) => { + call_result = self._projects_models_get(opt, dry_run, &mut err); + }, + ("models-get-iam-policy", Some(opt)) => { + call_result = self._projects_models_get_iam_policy(opt, dry_run, &mut err); + }, + ("models-list", Some(opt)) => { + call_result = self._projects_models_list(opt, dry_run, &mut err); + }, + ("models-set-iam-policy", Some(opt)) => { + call_result = self._projects_models_set_iam_policy(opt, dry_run, &mut err); + }, + ("models-test-iam-permissions", Some(opt)) => { + call_result = self._projects_models_test_iam_permissions(opt, dry_run, &mut err); + }, + ("models-versions-create", Some(opt)) => { + call_result = self._projects_models_versions_create(opt, dry_run, &mut err); + }, + ("models-versions-delete", Some(opt)) => { + call_result = self._projects_models_versions_delete(opt, dry_run, &mut err); + }, + ("models-versions-get", Some(opt)) => { + call_result = self._projects_models_versions_get(opt, dry_run, &mut err); + }, + ("models-versions-list", Some(opt)) => { + call_result = self._projects_models_versions_list(opt, dry_run, &mut err); + }, + ("models-versions-set-default", Some(opt)) => { + call_result = self._projects_models_versions_set_default(opt, dry_run, &mut err); + }, + ("operations-cancel", Some(opt)) => { + call_result = self._projects_operations_cancel(opt, dry_run, &mut err); + }, + ("operations-delete", Some(opt)) => { + call_result = self._projects_operations_delete(opt, dry_run, &mut err); + }, + ("operations-get", Some(opt)) => { + call_result = self._projects_operations_get(opt, dry_run, &mut err); + }, + ("operations-list", Some(opt)) => { + call_result = self._projects_operations_list(opt, dry_run, &mut err); + }, + ("predict", Some(opt)) => { + call_result = self._projects_predict(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<'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, "ml1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "ml1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudMachineLearningEngine::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: 'get-config', 'jobs-cancel', 'jobs-create', 'jobs-get', 'jobs-get-iam-policy', 'jobs-list', 'jobs-set-iam-policy', 'jobs-test-iam-permissions', 'models-create', 'models-delete', 'models-get', 'models-get-iam-policy', 'models-list', 'models-set-iam-policy', 'models-test-iam-permissions', 'models-versions-create', 'models-versions-delete', 'models-versions-get', 'models-versions-list', 'models-versions-set-default', 'operations-cancel', 'operations-delete', 'operations-get', 'operations-list' and 'predict'", vec![ + ("get-config", + Some(r##"Get the service account information associated with your project. You need + this information in order to grant the service account persmissions for + the Google Cloud Storage location where you put your model training code + for training the model with Google Cloud Machine Learning."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_get-config", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The project name."##), + 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)), + ]), + ("jobs-cancel", + Some(r##"Cancels a running job."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the job to cancel."##), + 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)), + ]), + ("jobs-create", + Some(r##"Creates a training or a batch prediction job."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project name."##), + 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)), + ]), + ("jobs-get", + Some(r##"Describes a job."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the job to get the description of."##), + 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)), + ]), + ("jobs-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("jobs-list", + Some(r##"Lists the jobs in the project."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project for which to list jobs."##), + 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)), + ]), + ("jobs-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_ml1_cli/projects_jobs-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("jobs-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("models-create", + Some(r##"Creates a model which will later contain one or more versions. + + You must add at least one version before you can request predictions from + the model. Add versions by calling + [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create)."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project name."##), + 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)), + ]), + ("models-delete", + Some(r##"Deletes a model. + + You can only delete a model if there are no versions in it. You can delete + versions by calling + [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete)."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the model."##), + 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)), + ]), + ("models-get", + Some(r##"Gets information about a model, including its name, the description (if + set), and the default version (if at least one version of the model has + been deployed)."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the model."##), + 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)), + ]), + ("models-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("models-list", + Some(r##"Lists the models in a project. + + Each project can contain multiple models, and each model can have multiple + versions."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project whose models are to be listed."##), + 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)), + ]), + ("models-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_ml1_cli/projects_models-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("models-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("models-versions-create", + Some(r##"Creates a new version of a model from a trained TensorFlow model. + + If the version created in the cloud by this call is the first deployed + version of the specified model, it will be made the default version of the + model. When you add a version to a model that already has one or more + versions, the default version does not automatically change. If you want a + new version to be the default, you must call + [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault)."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the model."##), + 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)), + ]), + ("models-versions-delete", + Some(r##"Deletes a model version. + + Each model can have multiple versions deployed and in use at any given + time. Use this method to remove a single version. + + Note: You cannot delete the version that is set as the default version + of the model unless it is the only remaining version."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the version. You can get the names of all the + versions of a model by calling + [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list)."##), + 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)), + ]), + ("models-versions-get", + Some(r##"Gets information about a model version. + + Models can have multiple versions. You can call + [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) + to get the same information that this method returns for all of the + versions of a model."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the version."##), + 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)), + ]), + ("models-versions-list", + Some(r##"Gets basic information about all the versions of a model. + + If you expect that a model has a lot of versions, or if you need to handle + only a limited number of results at a time, you can request that the list + be retrieved in batches (called pages):"##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the model for which to list the version."##), + 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)), + ]), + ("models-versions-set-default", + Some(r##"Designates a version to be the default for the model. + + The default version is used for prediction requests made against the model + that don't specify a version. + + The first version to be created for a model is automatically set as the + default. You must make any subsequent changes to the default version + setting manually using this method."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-set-default", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the version to make the default for the model. You + can get the names of all the versions of a model by calling + [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list)."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + 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-delete", + Some(r##"Deletes a long-running operation. This method indicates that the client is + no longer interested in the operation result. It does not cancel the + operation. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("predict", + Some(r##"Performs prediction on the data in the request. + + **** REMOVE FROM GENERATED DOCUMENTATION"##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_predict", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of a model or a version. + + Authorization: requires the `predict` permission on the specified resource."##), + 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("ml1") + .author("Sebastian Thiel ") + .version("1.0.6+20170926") + .about("An API to enable creating and using machine learning models.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_ml1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/ml1/Cargo.toml b/gen/ml1/Cargo.toml new file mode 100644 index 0000000000..8beed8710b --- /dev/null +++ b/gen/ml1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-ml1" +version = "1.0.6+20170926" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Machine Learning Engine (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/ml1" +homepage = "https://cloud.google.com/ml/" +documentation = "https://docs.rs/google-ml1/1.0.6+20170926" +license = "MIT" +keywords = ["ml", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/ml1/LICENSE.md b/gen/ml1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/ml1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/ml1/README.md b/gen/ml1/README.md new file mode 100644 index 0000000000..9cc0bbdc96 --- /dev/null +++ b/gen/ml1/README.md @@ -0,0 +1,183 @@ + +The `google-ml1` library allows access to all features of the *Google Cloud Machine Learning Engine* service. + +This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *ml:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud Machine Learning Engine* *v1* API can be found at the +[official documentation site](https://cloud.google.com/ml/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.CloudMachineLearningEngine.html) ... + +* projects + * [*get config*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectGetConfigCall.html), [*jobs cancel*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobCancelCall.html), [*jobs create*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobCreateCall.html), [*jobs get*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobGetCall.html), [*jobs get iam policy*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobListCall.html), [*jobs set iam policy*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectJobTestIamPermissionCall.html), [*models create*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelCreateCall.html), [*models delete*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelDeleteCall.html), [*models get*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelGetCall.html), [*models get iam policy*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelGetIamPolicyCall.html), [*models list*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelListCall.html), [*models set iam policy*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelVersionCreateCall.html), [*models versions delete*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelVersionDeleteCall.html), [*models versions get*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelVersionGetCall.html), [*models versions list*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelVersionListCall.html), [*models versions set default*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectOperationCancelCall.html), [*operations delete*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectOperationListCall.html) and [*predict*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.ProjectPredictCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/struct.CloudMachineLearningEngine.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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().models_set_iam_policy(...).doit() +let r = hub.projects().jobs_set_iam_policy(...).doit() +let r = hub.projects().models_get_iam_policy(...).doit() +let r = hub.projects().jobs_get_iam_policy(...).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-ml1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_ml1 as ml1; +use ml1::GoogleIamV1__SetIamPolicyRequest; +use ml1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use ml1::CloudMachineLearningEngine; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().models_set_iam_policy(req, "resource") + .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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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](https://docs.rs/google-ml1/1.0.6+20170926/google_ml1/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 **ml1** 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-rsblob/master/LICENSE.md diff --git a/gen/ml1/src/cmn.rs b/gen/ml1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/ml1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/ml1/src/lib.rs b/gen/ml1/src/lib.rs new file mode 100644 index 0000000000..367aee682e --- /dev/null +++ b/gen/ml1/src/lib.rs @@ -0,0 +1,9311 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *ml:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud Machine Learning Engine* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/ml/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/ml1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudMachineLearningEngine.html) ... +//! +//! * projects +//! * [*get config*](struct.ProjectGetConfigCall.html), [*jobs cancel*](struct.ProjectJobCancelCall.html), [*jobs create*](struct.ProjectJobCreateCall.html), [*jobs get*](struct.ProjectJobGetCall.html), [*jobs get iam policy*](struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](struct.ProjectJobListCall.html), [*jobs set iam policy*](struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](struct.ProjectJobTestIamPermissionCall.html), [*models create*](struct.ProjectModelCreateCall.html), [*models delete*](struct.ProjectModelDeleteCall.html), [*models get*](struct.ProjectModelGetCall.html), [*models get iam policy*](struct.ProjectModelGetIamPolicyCall.html), [*models list*](struct.ProjectModelListCall.html), [*models set iam policy*](struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](struct.ProjectModelVersionCreateCall.html), [*models versions delete*](struct.ProjectModelVersionDeleteCall.html), [*models versions get*](struct.ProjectModelVersionGetCall.html), [*models versions list*](struct.ProjectModelVersionListCall.html), [*models versions set default*](struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations delete*](struct.ProjectOperationDeleteCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html) and [*predict*](struct.ProjectPredictCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudMachineLearningEngine.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().models_set_iam_policy(...).doit() +//! let r = hub.projects().jobs_set_iam_policy(...).doit() +//! let r = hub.projects().models_get_iam_policy(...).doit() +//! let r = hub.projects().jobs_get_iam_policy(...).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-ml1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_ml1 as ml1; +//! use ml1::GoogleIamV1__SetIamPolicyRequest; +//! use ml1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use ml1::CloudMachineLearningEngine; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().models_set_iam_policy(req, "resource") +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 CloudMachineLearningEngine related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_ml1 as ml1; +/// use ml1::GoogleIamV1__SetIamPolicyRequest; +/// use ml1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use ml1::CloudMachineLearningEngine; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().models_set_iam_policy(req, "resource") +/// .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 CloudMachineLearningEngine { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudMachineLearningEngine {} + +impl<'a, C, A> CloudMachineLearningEngine + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudMachineLearningEngine { + CloudMachineLearningEngine { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://ml.googleapis.com/".to_string(), + _root_url: "https://ml.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://ml.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://ml.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [operations list projects](struct.ProjectOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunning__ListOperationsResponse { + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for GoogleLongrunning__ListOperationsResponse {} + + +/// Response message for the ListJobs 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*). +/// +/// * [jobs list projects](struct.ProjectJobListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListJobsResponse { + /// Optional. Pass this token as the `page_token` field of the request for a + /// subsequent call. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of jobs. + pub jobs: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListJobsResponse {} + + +/// Response message for the ListVersions 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*). +/// +/// * [models versions list projects](struct.ProjectModelVersionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListVersionsResponse { + /// Optional. Pass this token as the `page_token` field of the request for a + /// subsequent call. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of versions. + pub versions: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListVersionsResponse {} + + +/// Request message for the SetDefaultVersion request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [models versions set default projects](struct.ProjectModelVersionSetDefaultCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__SetDefaultVersionRequest { _never_set: Option } + +impl RequestValue for GoogleCloudMlV1__SetDefaultVersionRequest {} + + +/// Represents the result of a single hyperparameter tuning trial from a +/// training job. The TrainingOutput object that is returned on successful +/// completion of a training job with hyperparameter tuning includes a list +/// of HyperparameterOutput objects, one for each successful trial. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__HyperparameterOutput { + /// The hyperparameters given to this trial. + pub hyperparameters: Option>, + /// The trial id for these results. + #[serde(rename="trialId")] + pub trial_id: Option, + /// All recorded object metrics for this trial. This field is not currently + /// populated. + #[serde(rename="allMetrics")] + pub all_metrics: Option>, + /// The final objective metric seen for this trial. + #[serde(rename="finalMetric")] + pub final_metric: Option, +} + +impl Part for GoogleCloudMlV1__HyperparameterOutput {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +/// `members` to a `role`, where the members can be user accounts, Google groups, +/// Google domains, and service accounts. A `role` is a named list of permissions +/// defined by IAM. +/// +/// **Example** +/// +/// { +/// "bindings": [ +/// { +/// "role": "roles/owner", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +/// ] +/// }, +/// { +/// "role": "roles/viewer", +/// "members": ["user:sean@example.com"] +/// } +/// ] +/// } +/// +/// For a description of IAM and its features, see the +/// [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # 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*). +/// +/// * [models set iam policy projects](struct.ProjectModelSetIamPolicyCall.html) (response) +/// * [jobs set iam policy projects](struct.ProjectJobSetIamPolicyCall.html) (response) +/// * [models get iam policy projects](struct.ProjectModelGetIamPolicyCall.html) (response) +/// * [jobs get iam policy projects](struct.ProjectJobGetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__Policy { + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, + /// no description provided + #[serde(rename="iamOwned")] + pub iam_owned: Option, +} + +impl ResponseResult for GoogleIamV1__Policy {} + + +/// Represents an expression text. Example: +/// +/// title: "User account presence" +/// description: "Determines whether the request has a user account" +/// expression: "size(request.user) > 0" +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleType__Expr { + /// An optional description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in + /// Common Expression Language syntax. + /// + /// The application context of the containing message determines which + /// well-known feature set of CEL is supported. + pub expression: Option, + /// An optional string indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// An optional title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for GoogleType__Expr {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [jobs cancel projects](struct.ProjectJobCancelCall.html) (response) +/// * [operations delete projects](struct.ProjectOperationDeleteCall.html) (response) +/// * [operations cancel projects](struct.ProjectOperationCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleProtobuf__Empty { _never_set: Option } + +impl ResponseResult for GoogleProtobuf__Empty {} + + +/// Represents a set of hyperparameters to optimize. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__HyperparameterSpec { + /// Optional. How many training trials should be attempted to optimize + /// the specified hyperparameters. + /// + /// Defaults to one. + #[serde(rename="maxTrials")] + pub max_trials: Option, + /// Optional. The Tensorflow summary tag name to use for optimizing trials. For + /// current versions of Tensorflow, this tag name should exactly match what is + /// shown in Tensorboard, including all scopes. For versions of Tensorflow + /// prior to 0.12, this should be only the tag passed to tf.Summary. + /// By default, "training/hptuning/metric" will be used. + #[serde(rename="hyperparameterMetricTag")] + pub hyperparameter_metric_tag: Option, + /// Required. The set of parameters to tune. + pub params: Option>, + /// Optional. The number of training trials to run concurrently. + /// You can reduce the time it takes to perform hyperparameter tuning by adding + /// trials in parallel. However, each trail only benefits from the information + /// gained in completed trials. That means that a trial does not get access to + /// the results of trials running at the same time, which could reduce the + /// quality of the overall optimization. + /// + /// Each trial will use the same scale tier and machine types. + /// + /// Defaults to one. + #[serde(rename="maxParallelTrials")] + pub max_parallel_trials: Option, + /// Required. The type of goal to use for tuning. Available types are + /// `MAXIMIZE` and `MINIMIZE`. + /// + /// Defaults to `MAXIMIZE`. + pub goal: Option, +} + +impl Part for GoogleCloudMlV1__HyperparameterSpec {} + + +/// An observed value of a metric. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric { + /// The global training step for this metric. + #[serde(rename="trainingStep")] + pub training_step: Option, + /// The objective value at this training step. + #[serde(rename="objectiveValue")] + pub objective_value: Option, +} + +impl Part for GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [models versions delete projects](struct.ProjectModelVersionDeleteCall.html) (response) +/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) +/// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (response) +/// * [models delete projects](struct.ProjectModelDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunning__Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should have the format of `operations/some/unique/name`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for GoogleLongrunning__Operation {} + + +/// Represents a machine learning solution. +/// +/// A model can have multiple versions, each of which is a deployed, trained +/// model ready to receive prediction requests. The model itself is just a +/// container. +/// +/// Next ID: 8 +/// +/// # 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*). +/// +/// * [models get projects](struct.ProjectModelGetCall.html) (response) +/// * [models create projects](struct.ProjectModelCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Model { + /// Optional. The list of regions where the model is going to be deployed. + /// Currently only one region per model is supported. + /// Defaults to 'us-central1' if nothing is set. + /// Note: + /// * No matter where a model is deployed, it can always be accessed by + /// users from anywhere, both for online and batch prediction. + /// * The region for a batch prediction job is set by the region field when + /// submitting the batch prediction job and does not take its value from + /// this field. + pub regions: Option>, + /// Output only. The default version of the model. This version will be used to + /// handle prediction requests that do not specify a version. + /// + /// You can change the default version by calling + /// [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + #[serde(rename="defaultVersion")] + pub default_version: Option, + /// Required. The name specified for the model when it was created. + /// + /// The model name must be unique within the project it is created in. + pub name: Option, + /// Optional. If true, enables StackDriver Logging for online prediction. + /// Default is false. + #[serde(rename="onlinePredictionLogging")] + pub online_prediction_logging: Option, + /// Optional. The description specified for the model when it was created. + pub description: Option, +} + +impl RequestValue for GoogleCloudMlV1__Model {} +impl ResponseResult for GoogleCloudMlV1__Model {} + + +/// 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*). +/// +/// * [jobs test iam permissions projects](struct.ProjectJobTestIamPermissionCall.html) (request) +/// * [models test iam permissions projects](struct.ProjectModelTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. Permissions with + /// wildcards (such as '*' or 'storage.*') are not allowed. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for GoogleIamV1__TestIamPermissionsRequest {} + + +/// Represents a single hyperparameter to optimize. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ParameterSpec { + /// Required if type is `DISCRETE`. + /// A list of feasible points. + /// The list should be in strictly increasing order. For instance, this + /// parameter might have possible settings of 1.5, 2.5, and 4.0. This list + /// should not contain more than 1,000 values. + #[serde(rename="discreteValues")] + pub discrete_values: Option>, + /// Optional. How the parameter should be scaled to the hypercube. + /// Leave unset for categorical parameters. + /// Some kind of scaling is strongly recommended for real or integral + /// parameters (e.g., `UNIT_LINEAR_SCALE`). + #[serde(rename="scaleType")] + pub scale_type: Option, + /// Required. The parameter name must be unique amongst all ParameterConfigs in + /// a HyperparameterSpec message. E.g., "learning_rate". + #[serde(rename="parameterName")] + pub parameter_name: Option, + /// Required if type is `CATEGORICAL`. The list of possible categories. + #[serde(rename="categoricalValues")] + pub categorical_values: Option>, + /// Required. The type of the parameter. + #[serde(rename="type")] + pub type_: Option, + /// Required if typeis `DOUBLE` or `INTEGER`. This field + /// should be unset if type is `CATEGORICAL`. This value should be integers if + /// type is `INTEGER`. + #[serde(rename="maxValue")] + pub max_value: Option, + /// Required if type is `DOUBLE` or `INTEGER`. This field + /// should be unset if type is `CATEGORICAL`. This value should be integers if + /// type is INTEGER. + #[serde(rename="minValue")] + pub min_value: Option, +} + +impl Part for GoogleCloudMlV1__ParameterSpec {} + + +/// Specifies the audit configuration for a service. +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. +/// An AuditConfig must have one or more AuditLogConfigs. +/// +/// If there are AuditConfigs for both `allServices` and a specific service, +/// the union of the two AuditConfigs is used for that service: the log_types +/// specified in each AuditConfig are enabled, and the exempted_members in each +/// AuditConfig are exempted. +/// +/// Example Policy with multiple AuditConfigs: +/// +/// { +/// "audit_configs": [ +/// { +/// "service": "allServices" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// }, +/// { +/// "log_type": "ADMIN_READ", +/// } +/// ] +/// }, +/// { +/// "service": "fooservice.googleapis.com" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// "exempted_members": [ +/// "user:bar@gmail.com" +/// ] +/// } +/// ] +/// } +/// ] +/// } +/// +/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts foo@gmail.com from DATA_READ logging, and +/// bar@gmail.com from DATA_WRITE logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__AuditConfig { + /// no description provided + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The configuration for logging of each type of permission. + /// Next ID: 4 + #[serde(rename="auditLogConfigs")] + pub audit_log_configs: Option>, + /// Specifies a service that will be enabled for audit logging. + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + pub service: Option, +} + +impl Part for GoogleIamV1__AuditConfig {} + + +/// Represents input parameters for a training job. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__TrainingInput { + /// Optional. Specifies the type of virtual machine to use for your training + /// job's worker nodes. + /// + /// The supported values are the same as those described in the entry for + /// `masterType`. + /// + /// This value must be present when `scaleTier` is set to `CUSTOM` and + /// `workerCount` is greater than zero. + #[serde(rename="workerType")] + pub worker_type: Option, + /// Optional. The Google Cloud ML runtime version to use for training. If not + /// set, Google Cloud ML will choose the latest stable version. + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, + /// Required. Specifies the machine types, the number of replicas for workers + /// and parameter servers. + #[serde(rename="scaleTier")] + pub scale_tier: Option, + /// Optional. Specifies the type of virtual machine to use for your training + /// job's master worker. + /// + /// The following types are supported: + /// + ///
+ ///
standard
+ ///
+ /// A basic machine configuration suitable for training simple models with + /// small to moderate datasets. + ///
+ ///
large_model
+ ///
+ /// A machine with a lot of memory, specially suited for parameter servers + /// when your model is large (having many hidden layers or layers with very + /// large numbers of nodes). + ///
+ ///
complex_model_s
+ ///
+ /// A machine suitable for the master and workers of the cluster when your + /// model requires more computation than the standard machine can handle + /// satisfactorily. + ///
+ ///
complex_model_m
+ ///
+ /// A machine with roughly twice the number of cores and roughly double the + /// memory of complex_model_s. + ///
+ ///
complex_model_l
+ ///
+ /// A machine with roughly twice the number of cores and roughly double the + /// memory of complex_model_m. + ///
+ ///
standard_gpu
+ ///
+ /// A machine equivalent to standard that + /// also includes a + /// + /// GPU that you can use in your trainer. + ///
+ ///
complex_model_m_gpu
+ ///
+ /// A machine equivalent to + /// complex_model_m that also includes + /// four GPUs. + ///
+ ///
+ /// + /// You must set this value when `scaleTier` is set to `CUSTOM`. + #[serde(rename="masterType")] + pub master_type: Option, + /// Optional. The set of Hyperparameters to tune. + pub hyperparameters: Option, + /// Required. The Google Compute Engine region to run the training job in. + pub region: Option, + /// Optional. Command line arguments to pass to the program. + pub args: Option>, + /// Required. The Python module name to run after installing the packages. + #[serde(rename="pythonModule")] + pub python_module: Option, + /// Optional. A Google Cloud Storage path in which to store training outputs + /// and other data needed for training. This path is passed to your TensorFlow + /// program as the 'job_dir' command-line argument. The benefit of specifying + /// this field is that Cloud ML validates the path for use in training. + #[serde(rename="jobDir")] + pub job_dir: Option, + /// Required. The Google Cloud Storage location of the packages with + /// the training program and any additional dependencies. + /// The maximum number of package URIs is 100. + #[serde(rename="packageUris")] + pub package_uris: Option>, + /// Optional. The number of worker replicas to use for the training job. Each + /// replica in the cluster will be of the type specified in `worker_type`. + /// + /// This value can only be used when `scale_tier` is set to `CUSTOM`. If you + /// set this value, you must also set `worker_type`. + #[serde(rename="workerCount")] + pub worker_count: Option, + /// Optional. Specifies the type of virtual machine to use for your training + /// job's parameter server. + /// + /// The supported values are the same as those described in the entry for + /// `master_type`. + /// + /// This value must be present when `scaleTier` is set to `CUSTOM` and + /// `parameter_server_count` is greater than zero. + #[serde(rename="parameterServerType")] + pub parameter_server_type: Option, + /// Optional. The number of parameter server replicas to use for the training + /// job. Each replica in the cluster will be of the type specified in + /// `parameter_server_type`. + /// + /// This value can only be used when `scale_tier` is set to `CUSTOM`.If you + /// set this value, you must also set `parameter_server_type`. + #[serde(rename="parameterServerCount")] + pub parameter_server_count: Option, +} + +impl Part for GoogleCloudMlV1__TrainingInput {} + + +/// Request for predictions to be issued against a trained model. +/// +/// The body of the request is a single JSON object with a single top-level +/// field: +/// +///
+///
instances
+///
A JSON array containing values representing the instances to use for +/// prediction.
+///
+/// +/// The structure of each element of the instances list is determined by your +/// model's input definition. Instances can include named inputs or can contain +/// only unlabeled values. +/// +/// Not all data includes named inputs. Some instances will be simple +/// JSON values (boolean, number, or string). However, instances are often lists +/// of simple values, or complex nested lists. Here are some examples of request +/// bodies: +/// +/// CSV data with each row encoded as a string value: +///
+/// {"instances": ["1.0,true,\\"x\\"", "-2.0,false,\\"y\\""]}
+/// 
+/// Plain text: +///
+/// {"instances": ["the quick brown fox", "la bruja le dio"]}
+/// 
+/// Sentences encoded as lists of words (vectors of strings): +///
+/// {
+///   "instances": [
+///     ["the","quick","brown"],
+///     ["la","bruja","le"],
+///     ...
+///   ]
+/// }
+/// 
+/// Floating point scalar values: +///
+/// {"instances": [0.0, 1.1, 2.2]}
+/// 
+/// Vectors of integers: +///
+/// {
+///   "instances": [
+///     [0, 1, 2],
+///     [3, 4, 5],
+///     ...
+///   ]
+/// }
+/// 
+/// Tensors (in this case, two-dimensional tensors): +///
+/// {
+///   "instances": [
+///     [
+///       [0, 1, 2],
+///       [3, 4, 5]
+///     ],
+///     ...
+///   ]
+/// }
+/// 
+/// Images can be represented different ways. In this encoding scheme the first +/// two dimensions represent the rows and columns of the image, and the third +/// contains lists (vectors) of the R, G, and B values for each pixel. +///
+/// {
+///   "instances": [
+///     [
+///       [
+///         [138, 30, 66],
+///         [130, 20, 56],
+///         ...
+///       ],
+///       [
+///         [126, 38, 61],
+///         [122, 24, 57],
+///         ...
+///       ],
+///       ...
+///     ],
+///     ...
+///   ]
+/// }
+/// 
+/// JSON strings must be encoded as UTF-8. To send binary data, you must +/// base64-encode the data and mark it as binary. To mark a JSON string +/// as binary, replace it with a JSON object with a single attribute named `b64`: +///
{"b64": "..."} 
+/// For example: +/// +/// Two Serialized tf.Examples (fake data, for illustrative purposes only): +///
+/// {"instances": [{"b64": "X5ad6u"}, {"b64": "IA9j4nx"}]}
+/// 
+/// Two JPEG image byte strings (fake data, for illustrative purposes only): +///
+/// {"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]}
+/// 
+/// If your data includes named references, format each instance as a JSON object +/// with the named references as the keys: +/// +/// JSON input data to be preprocessed: +///
+/// {
+///   "instances": [
+///     {
+///       "a": 1.0,
+///       "b": true,
+///       "c": "x"
+///     },
+///     {
+///       "a": -2.0,
+///       "b": false,
+///       "c": "y"
+///     }
+///   ]
+/// }
+/// 
+/// Some models have an underlying TensorFlow graph that accepts multiple input +/// tensors. In this case, you should use the names of JSON name/value pairs to +/// identify the input tensors, as shown in the following exmaples: +/// +/// For a graph with input tensor aliases "tag" (string) and "image" +/// (base64-encoded string): +///
+/// {
+///   "instances": [
+///     {
+///       "tag": "beach",
+///       "image": {"b64": "ASa8asdf"}
+///     },
+///     {
+///       "tag": "car",
+///       "image": {"b64": "JLK7ljk3"}
+///     }
+///   ]
+/// }
+/// 
+/// For a graph with input tensor aliases "tag" (string) and "image" +/// (3-dimensional array of 8-bit ints): +///
+/// {
+///   "instances": [
+///     {
+///       "tag": "beach",
+///       "image": [
+///         [
+///           [138, 30, 66],
+///           [130, 20, 56],
+///           ...
+///         ],
+///         [
+///           [126, 38, 61],
+///           [122, 24, 57],
+///           ...
+///         ],
+///         ...
+///       ]
+///     },
+///     {
+///       "tag": "car",
+///       "image": [
+///         [
+///           [255, 0, 102],
+///           [255, 0, 97],
+///           ...
+///         ],
+///         [
+///           [254, 1, 101],
+///           [254, 2, 93],
+///           ...
+///         ],
+///         ...
+///       ]
+///     },
+///     ...
+///   ]
+/// }
+/// 
+/// If the call is successful, the response body will contain one prediction +/// entry per instance in the request body. If prediction fails for any +/// instance, the response body will contain no predictions and will contian +/// a single error entry instead. +/// +/// # 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*). +/// +/// * [predict projects](struct.ProjectPredictCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__PredictRequest { + /// + /// Required. The prediction request body. + #[serde(rename="httpBody")] + pub http_body: Option, +} + +impl RequestValue for GoogleCloudMlV1__PredictRequest {} + + +/// Options for manually scaling a model. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ManualScaling { + /// The number of nodes to allocate for this model. These nodes are always up, + /// starting from the time the model is deployed, so the cost of operating + /// this model will be proportional to `nodes` * number of hours since + /// last billing cycle plus the cost for each prediction performed. + pub nodes: Option, +} + +impl Part for GoogleCloudMlV1__ManualScaling {} + + +/// Response message for the ListModels 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*). +/// +/// * [models list projects](struct.ProjectModelListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListModelsResponse { + /// Optional. Pass this token as the `page_token` field of the request for a + /// subsequent call. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of models. + pub models: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListModelsResponse {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// foo@gmail.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for GoogleIamV1__AuditLogConfig {} + + +/// Request message for the CancelJob 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*). +/// +/// * [jobs cancel projects](struct.ProjectJobCancelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__CancelJobRequest { _never_set: Option } + +impl RequestValue for GoogleCloudMlV1__CancelJobRequest {} + + +/// 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*). +/// +/// * [jobs test iam permissions projects](struct.ProjectJobTestIamPermissionCall.html) (response) +/// * [models test iam permissions projects](struct.ProjectModelTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + pub permissions: Option>, +} + +impl ResponseResult for GoogleIamV1__TestIamPermissionsResponse {} + + +/// Represents results of a prediction job. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__PredictionOutput { + /// Node hours used by the batch prediction job. + #[serde(rename="nodeHours")] + pub node_hours: Option, + /// The output Google Cloud Storage location provided at the job creation time. + #[serde(rename="outputPath")] + pub output_path: Option, + /// The number of generated predictions. + #[serde(rename="predictionCount")] + pub prediction_count: Option, + /// The number of data instances which resulted in errors. + #[serde(rename="errorCount")] + pub error_count: Option, +} + +impl Part for GoogleCloudMlV1__PredictionOutput {} + + +/// Represents results of a training job. Output only. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__TrainingOutput { + /// Results for individual Hyperparameter trials. + /// Only set for hyperparameter tuning jobs. + pub trials: Option>, + /// Whether this job is a hyperparameter tuning job. + #[serde(rename="isHyperparameterTuningJob")] + pub is_hyperparameter_tuning_job: Option, + /// The number of hyperparameter tuning trials that completed successfully. + /// Only set for hyperparameter tuning jobs. + #[serde(rename="completedTrialCount")] + pub completed_trial_count: Option, + /// The amount of ML units consumed by the job. + #[serde(rename="consumedMLUnits")] + pub consumed_ml_units: Option, +} + +impl Part for GoogleCloudMlV1__TrainingOutput {} + + +/// 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*). +/// +/// * [models set iam policy projects](struct.ProjectModelSetIamPolicyCall.html) (request) +/// * [jobs set iam policy projects](struct.ProjectJobSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__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 a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + /// the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: + /// paths: "bindings, etag" + /// This field is only used by Cloud IAM. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for GoogleIamV1__SetIamPolicyRequest {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: an unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + /// This field is GOOGLE_INTERNAL. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for GoogleIamV1__Binding {} + + +/// Message that represents an arbitrary HTTP body. It should only be used for +/// payload formats that can't be represented as JSON, such as raw binary or +/// an HTML page. +/// +/// +/// This message can be used both in streaming and non-streaming API methods in +/// the request as well as the response. +/// +/// It can be used as a top-level request field, which is convenient if one +/// wants to extract parameters from either the URL or HTTP template into the +/// request fields and also want access to the raw HTTP body. +/// +/// Example: +/// +/// message GetResourceRequest { +/// // A unique request id. +/// string request_id = 1; +/// +/// // The raw HTTP body is bound to this field. +/// google.api.HttpBody http_body = 2; +/// } +/// +/// service ResourceService { +/// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +/// rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); +/// } +/// +/// Example with streaming methods: +/// +/// service CaldavService { +/// rpc GetCalendar(stream google.api.HttpBody) +/// returns (stream google.api.HttpBody); +/// rpc UpdateCalendar(stream google.api.HttpBody) +/// returns (stream google.api.HttpBody); +/// } +/// +/// Use of this type only changes how the request and response bodies are +/// handled, all other features will continue to work unchanged. +/// +/// # 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*). +/// +/// * [predict projects](struct.ProjectPredictCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleApi__HttpBody { + /// The HTTP Content-Type string representing the content type of the body. + #[serde(rename="contentType")] + pub content_type: Option, + /// Application specific response metadata. Must be set in the first response + /// for streaming APIs. + pub extensions: Option>>, + /// HTTP body binary data. + pub data: Option, +} + +impl ResponseResult for GoogleApi__HttpBody {} + + +/// Represents a training or prediction job. +/// +/// Next ID: 16 +/// +/// # 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*). +/// +/// * [jobs create projects](struct.ProjectJobCreateCall.html) (request|response) +/// * [jobs get projects](struct.ProjectJobGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Job { + /// Output only. The details of a failure or a cancellation. + #[serde(rename="errorMessage")] + pub error_message: Option, + /// The current training job result. + #[serde(rename="trainingOutput")] + pub training_output: Option, + /// Output only. When the job processing was started. + #[serde(rename="startTime")] + pub start_time: Option, + /// Input parameters to create a training job. + #[serde(rename="trainingInput")] + pub training_input: Option, + /// Required. The user-specified id of the job. + #[serde(rename="jobId")] + pub job_id: Option, + /// Output only. The detailed state of a job. + pub state: Option, + /// Input parameters to create a prediction job. + #[serde(rename="predictionInput")] + pub prediction_input: Option, + /// Output only. When the job processing was completed. + #[serde(rename="endTime")] + pub end_time: Option, + /// The current prediction job result. + #[serde(rename="predictionOutput")] + pub prediction_output: Option, + /// Output only. When the job was created. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl RequestValue for GoogleCloudMlV1__Job {} +impl ResponseResult for GoogleCloudMlV1__Job {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleRpc__Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for GoogleRpc__Status {} + + +/// Represents input parameters for a prediction job. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__PredictionInput { + /// Use this field if you want to use the default version for the specified + /// model. The string must use the following format: + /// + /// `"projects/[YOUR_PROJECT]/models/[YOUR_MODEL]"` + #[serde(rename="modelName")] + pub model_name: Option, + /// Optional. The Google Cloud ML runtime version to use for this batch + /// prediction. If not set, Google Cloud ML will pick the runtime version used + /// during the CreateVersion request for this model version, or choose the + /// latest stable version when model version information is not available + /// such as when the model is specified by uri. + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, + /// Optional. Number of records per batch, defaults to 64. + /// The service will buffer batch_size number of records in memory before + /// invoking one Tensorflow prediction call internally. So take the record + /// size and memory available into consideration when setting this parameter. + #[serde(rename="batchSize")] + pub batch_size: Option, + /// Optional. The maximum number of workers to be used for parallel processing. + /// Defaults to 10 if not specified. + #[serde(rename="maxWorkerCount")] + pub max_worker_count: Option, + /// Use this field if you want to specify a Google Cloud Storage path for + /// the model to use. + pub uri: Option, + /// Required. The output Google Cloud Storage location. + #[serde(rename="outputPath")] + pub output_path: Option, + /// Required. The format of the input data files. + #[serde(rename="dataFormat")] + pub data_format: Option, + /// Use this field if you want to specify a version of the model to use. The + /// string is formatted the same way as `model_version`, with the addition + /// of the version information: + /// + /// `"projects/[YOUR_PROJECT]/models/YOUR_MODEL/versions/[YOUR_VERSION]"` + #[serde(rename="versionName")] + pub version_name: Option, + /// Required. The Google Compute Engine region to run the prediction job in. + pub region: Option, + /// Required. The Google Cloud Storage location of the input data files. + /// May contain wildcards. + #[serde(rename="inputPaths")] + pub input_paths: Option>, +} + +impl Part for GoogleCloudMlV1__PredictionInput {} + + +/// Represents a version of the model. +/// +/// Each version is a trained model deployed in the cloud, ready to handle +/// prediction requests. A model can have multiple versions. You can get +/// information about all of the versions of a given model by calling +/// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). +/// +/// Next ID: 19 +/// LINT.IfChange +/// +/// # 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*). +/// +/// * [models versions get projects](struct.ProjectModelVersionGetCall.html) (response) +/// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (request) +/// * [models versions set default projects](struct.ProjectModelVersionSetDefaultCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Version { + /// Output only. The details of a failure or a cancellation. + #[serde(rename="errorMessage")] + pub error_message: Option, + /// Required.The name specified for the version when it was created. + /// + /// The version name must be unique within the model it is created in. + pub name: Option, + /// Optional. The Google Cloud ML runtime version to use for this deployment. + /// If not set, Google Cloud ML will choose a version. + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, + /// Manually select the number of nodes to use for serving the + /// model. You should generally use `auto_scaling` with an appropriate + /// `min_nodes` instead, but this option is available if you want more + /// predictable billing. Beware that latency and error rates will increase + /// if the traffic exceeds that capability of the system to serve it based + /// on the selected number of nodes. + #[serde(rename="manualScaling")] + pub manual_scaling: Option, + /// Automatically scale the number of nodes used to serve the model in + /// response to increases and decreases in traffic. Care should be + /// taken to ramp up traffic according to the model's ability to scale + /// or you will start seeing increases in latency and 429 response codes. + #[serde(rename="autoScaling")] + pub auto_scaling: Option, + /// Output only. The state of a version. + pub state: Option, + /// Output only. The time the version was last used for prediction. + #[serde(rename="lastUseTime")] + pub last_use_time: Option, + /// Required. The Google Cloud Storage location of the trained model used to + /// create the version. See the + /// [overview of model + /// deployment](/ml-engine/docs/concepts/deployment-overview) for more + /// information. + /// + /// When passing Version to + /// [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create) + /// the model service uses the specified location as the source of the model. + /// Once deployed, the model version is hosted by the prediction service, so + /// this location is useful only as a historical record. + /// The total number of model files can't exceed 1000. + #[serde(rename="deploymentUri")] + pub deployment_uri: Option, + /// Output only. The time the version was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. If true, this version will be used to handle prediction + /// requests that do not specify a version. + /// + /// You can change the default version by calling + /// [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + #[serde(rename="isDefault")] + pub is_default: Option, + /// Optional. The description specified for the version when it was created. + pub description: Option, +} + +impl RequestValue for GoogleCloudMlV1__Version {} +impl ResponseResult for GoogleCloudMlV1__Version {} + + +/// Returns service account information associated with a project. +/// +/// # 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 config projects](struct.ProjectGetConfigCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__GetConfigResponse { + /// The project number for `service_account`. + #[serde(rename="serviceAccountProject")] + pub service_account_project: Option, + /// The service account Cloud ML uses to access resources in the project. + #[serde(rename="serviceAccount")] + pub service_account: Option, +} + +impl ResponseResult for GoogleCloudMlV1__GetConfigResponse {} + + +/// Options for automatically scaling a model. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__AutoScaling { + /// Optional. The minimum number of nodes to allocate for this model. These + /// nodes are always up, starting from the time the model is deployed, so the + /// cost of operating this model will be at least + /// `rate` * `min_nodes` * number of hours since last billing cycle, + /// where `rate` is the cost per node-hour as documented in + /// [pricing](https://cloud.google.com/ml-engine/pricing#prediction_pricing), + /// even if no predictions are performed. There is additional cost for each + /// prediction performed. + /// + /// Unlike manual scaling, if the load gets too heavy for the nodes + /// that are up, the service will automatically add nodes to handle the + /// increased load as well as scale back as traffic drops, always maintaining + /// at least `min_nodes`. You will be charged for the time in which additional + /// nodes are used. + /// + /// If not specified, `min_nodes` defaults to 0, in which case, when traffic + /// to a model stops (and after a cool-down period), nodes will be shut down + /// and no charges will be incurred until traffic to the model resumes. + #[serde(rename="minNodes")] + pub min_nodes: Option, +} + +impl Part for GoogleCloudMlV1__AutoScaling {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudMachineLearningEngine` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_ml1 as ml1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use ml1::CloudMachineLearningEngine; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get_config(...)`, `jobs_cancel(...)`, `jobs_create(...)`, `jobs_get(...)`, `jobs_get_iam_policy(...)`, `jobs_list(...)`, `jobs_set_iam_policy(...)`, `jobs_test_iam_permissions(...)`, `models_create(...)`, `models_delete(...)`, `models_get(...)`, `models_get_iam_policy(...)`, `models_list(...)`, `models_set_iam_policy(...)`, `models_test_iam_permissions(...)`, `models_versions_create(...)`, `models_versions_delete(...)`, `models_versions_get(...)`, `models_versions_list(...)`, `models_versions_set_default(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)` and `predict(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, +} + +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: + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn operations_delete(&self, name: &str) -> ProjectOperationDeleteCall<'a, C, A> { + ProjectOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn jobs_set_iam_policy(&self, request: GoogleIamV1__SetIamPolicyRequest, resource: &str) -> ProjectJobSetIamPolicyCall<'a, C, A> { + ProjectJobSetIamPolicyCall { + 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: + /// + /// Performs prediction on the data in the request. + /// + /// **** REMOVE FROM GENERATED DOCUMENTATION + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of a model or a version. + /// Authorization: requires the `predict` permission on the specified resource. + pub fn predict(&self, request: GoogleCloudMlV1__PredictRequest, name: &str) -> ProjectPredictCall<'a, C, A> { + ProjectPredictCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a model version. + /// + /// Each model can have multiple versions deployed and in use at any given + /// time. Use this method to remove a single version. + /// + /// Note: You cannot delete the version that is set as the default version + /// of the model unless it is the only remaining version. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the version. You can get the names of all the + /// versions of a model by calling + /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + pub fn models_versions_delete(&self, name: &str) -> ProjectModelVersionDeleteCall<'a, C, A> { + ProjectModelVersionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a training or a batch prediction job. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project name. + pub fn jobs_create(&self, request: GoogleCloudMlV1__Job, parent: &str) -> ProjectJobCreateCall<'a, C, A> { + ProjectJobCreateCall { + hub: self.hub, + _request: request, + _parent: parent.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. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn jobs_test_iam_permissions(&self, request: GoogleIamV1__TestIamPermissionsRequest, resource: &str) -> ProjectJobTestIamPermissionCall<'a, C, A> { + ProjectJobTestIamPermissionCall { + 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: + /// + /// Designates a version to be the default for the model. + /// + /// The default version is used for prediction requests made against the model + /// that don't specify a version. + /// + /// The first version to be created for a model is automatically set as the + /// default. You must make any subsequent changes to the default version + /// setting manually using this method. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the version to make the default for the model. You + /// can get the names of all the versions of a model by calling + /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + pub fn models_versions_set_default(&self, request: GoogleCloudMlV1__SetDefaultVersionRequest, name: &str) -> ProjectModelVersionSetDefaultCall<'a, C, A> { + ProjectModelVersionSetDefaultCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn models_set_iam_policy(&self, request: GoogleIamV1__SetIamPolicyRequest, resource: &str) -> ProjectModelSetIamPolicyCall<'a, C, A> { + ProjectModelSetIamPolicyCall { + 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: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn jobs_get_iam_policy(&self, resource: &str) -> ProjectJobGetIamPolicyCall<'a, C, A> { + ProjectJobGetIamPolicyCall { + 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: + /// + /// Describes a job. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the job to get the description of. + pub fn jobs_get(&self, name: &str) -> ProjectJobGetCall<'a, C, A> { + ProjectJobGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancels a running job. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the job to cancel. + pub fn jobs_cancel(&self, request: GoogleCloudMlV1__CancelJobRequest, name: &str) -> ProjectJobCancelCall<'a, C, A> { + ProjectJobCancelCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a model version. + /// + /// Models can have multiple versions. You can call + /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) + /// to get the same information that this method returns for all of the + /// versions of a model. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the version. + pub fn models_versions_get(&self, name: &str) -> ProjectModelVersionGetCall<'a, C, A> { + ProjectModelVersionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get the service account information associated with your project. You need + /// this information in order to grant the service account persmissions for + /// the Google Cloud Storage location where you put your model training code + /// for training the model with Google Cloud Machine Learning. + /// + /// # Arguments + /// + /// * `name` - Required. The project name. + pub fn get_config(&self, name: &str) -> ProjectGetConfigCall<'a, C, A> { + ProjectGetConfigCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn models_test_iam_permissions(&self, request: GoogleIamV1__TestIamPermissionsRequest, resource: &str) -> ProjectModelTestIamPermissionCall<'a, C, A> { + ProjectModelTestIamPermissionCall { + 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: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn operations_list(&self, name: &str) -> ProjectOperationListCall<'a, C, A> { + ProjectOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new version of a model from a trained TensorFlow model. + /// + /// If the version created in the cloud by this call is the first deployed + /// version of the specified model, it will be made the default version of the + /// model. When you add a version to a model that already has one or more + /// versions, the default version does not automatically change. If you want a + /// new version to be the default, you must call + /// [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the model. + pub fn models_versions_create(&self, request: GoogleCloudMlV1__Version, parent: &str) -> ProjectModelVersionCreateCall<'a, C, A> { + ProjectModelVersionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.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. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn models_get_iam_policy(&self, resource: &str) -> ProjectModelGetIamPolicyCall<'a, C, A> { + ProjectModelGetIamPolicyCall { + 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: + /// + /// Gets basic information about all the versions of a model. + /// + /// If you expect that a model has a lot of versions, or if you need to handle + /// only a limited number of results at a time, you can request that the list + /// be retrieved in batches (called pages): + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the model for which to list the version. + pub fn models_versions_list(&self, parent: &str) -> ProjectModelVersionListCall<'a, C, A> { + ProjectModelVersionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C, A> { + ProjectOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn operations_cancel(&self, name: &str) -> ProjectOperationCancelCall<'a, C, A> { + ProjectOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a model which will later contain one or more versions. + /// + /// You must add at least one version before you can request predictions from + /// the model. Add versions by calling + /// [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project name. + pub fn models_create(&self, request: GoogleCloudMlV1__Model, parent: &str) -> ProjectModelCreateCall<'a, C, A> { + ProjectModelCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a model. + /// + /// You can only delete a model if there are no versions in it. You can delete + /// versions by calling + /// [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete). + /// + /// # Arguments + /// + /// * `name` - Required. The name of the model. + pub fn models_delete(&self, name: &str) -> ProjectModelDeleteCall<'a, C, A> { + ProjectModelDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the jobs in the project. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which to list jobs. + pub fn jobs_list(&self, parent: &str) -> ProjectJobListCall<'a, C, A> { + ProjectJobListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a model, including its name, the description (if + /// set), and the default version (if at least one version of the model has + /// been deployed). + /// + /// # Arguments + /// + /// * `name` - Required. The name of the model. + pub fn models_get(&self, name: &str) -> ProjectModelGetCall<'a, C, A> { + ProjectModelGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the models in a project. + /// + /// Each project can contain multiple models, and each model can have multiple + /// versions. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project whose models are to be listed. + pub fn models_list(&self, parent: &str) -> ProjectModelListCall<'a, C, A> { + ProjectModelListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Deletes a long-running operation. This method indicates that the client is +/// no longer interested in the operation result. It does not cancel the +/// operation. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. +/// +/// A builder for the *operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationDeleteCall<'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, GoogleProtobuf__Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectOperationDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *jobs.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleIamV1__SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().jobs_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleIamV1__SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobSetIamPolicyCall<'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, GoogleIamV1__Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleIamV1__SetIamPolicyRequest) -> ProjectJobSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectJobSetIamPolicyCall<'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) -> ProjectJobSetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Performs prediction on the data in the request. +/// +/// **** REMOVE FROM GENERATED DOCUMENTATION +/// +/// A builder for the *predict* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__PredictRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudMlV1__PredictRequest::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().predict(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectPredictCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__PredictRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectPredictCall<'a, C, A> {} + +impl<'a, C, A> ProjectPredictCall<'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, GoogleApi__HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.predict", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:predict"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudMlV1__PredictRequest) -> ProjectPredictCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of a model or a version. + /// + /// Authorization: requires the `predict` permission on the specified resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectPredictCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectPredictCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectPredictCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectPredictCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a model version. +/// +/// Each model can have multiple versions deployed and in use at any given +/// time. Use this method to remove a single version. +/// +/// Note: You cannot delete the version that is set as the default version +/// of the model unless it is the only remaining version. +/// +/// A builder for the *models.versions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_versions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelVersionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelVersionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelVersionDeleteCall<'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, GoogleLongrunning__Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.versions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the version. You can get the names of all the + /// versions of a model by calling + /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectModelVersionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelVersionDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelVersionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a training or a batch prediction job. +/// +/// A builder for the *jobs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__Job; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudMlV1__Job::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().jobs_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Job, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobCreateCall<'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, GoogleCloudMlV1__Job)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/jobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudMlV1__Job) -> ProjectJobCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project name. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectJobCreateCall<'a, C, A> { + self._parent = 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) -> ProjectJobCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *jobs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleIamV1__TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().jobs_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleIamV1__TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobTestIamPermissionCall<'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, GoogleIamV1__TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleIamV1__TestIamPermissionsRequest) -> ProjectJobTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectJobTestIamPermissionCall<'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) -> ProjectJobTestIamPermissionCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Designates a version to be the default for the model. +/// +/// The default version is used for prediction requests made against the model +/// that don't specify a version. +/// +/// The first version to be created for a model is automatically set as the +/// default. You must make any subsequent changes to the default version +/// setting manually using this method. +/// +/// A builder for the *models.versions.setDefault* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__SetDefaultVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudMlV1__SetDefaultVersionRequest::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().models_versions_set_default(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelVersionSetDefaultCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__SetDefaultVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelVersionSetDefaultCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelVersionSetDefaultCall<'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, GoogleCloudMlV1__Version)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.versions.setDefault", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:setDefault"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudMlV1__SetDefaultVersionRequest) -> ProjectModelVersionSetDefaultCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the version to make the default for the model. You + /// can get the names of all the versions of a model by calling + /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectModelVersionSetDefaultCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelVersionSetDefaultCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionSetDefaultCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelVersionSetDefaultCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *models.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleIamV1__SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().models_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleIamV1__SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelSetIamPolicyCall<'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, GoogleIamV1__Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleIamV1__SetIamPolicyRequest) -> ProjectModelSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectModelSetIamPolicyCall<'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) -> ProjectModelSetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *jobs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().jobs_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobGetIamPolicyCall<'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, GoogleIamV1__Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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(Bearer { 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(d); + 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(d); + 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 the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectJobGetIamPolicyCall<'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) -> ProjectJobGetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Describes a job. +/// +/// A builder for the *jobs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().jobs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobGetCall<'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, GoogleCloudMlV1__Job)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the job to get the description of. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectJobGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectJobGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Cancels a running job. +/// +/// A builder for the *jobs.cancel* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__CancelJobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudMlV1__CancelJobRequest::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().jobs_cancel(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__CancelJobRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobCancelCall<'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, GoogleProtobuf__Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudMlV1__CancelJobRequest) -> ProjectJobCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the job to cancel. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectJobCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectJobCancelCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information about a model version. +/// +/// Models can have multiple versions. You can call +/// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) +/// to get the same information that this method returns for all of the +/// versions of a model. +/// +/// A builder for the *models.versions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_versions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelVersionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelVersionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelVersionGetCall<'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, GoogleCloudMlV1__Version)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.versions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the version. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectModelVersionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelVersionGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelVersionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get the service account information associated with your project. You need +/// this information in order to grant the service account persmissions for +/// the Google Cloud Storage location where you put your model training code +/// for training the model with Google Cloud Machine Learning. +/// +/// A builder for the *getConfig* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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_config("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetConfigCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetConfigCall<'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, GoogleCloudMlV1__GetConfigResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.getConfig", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:getConfig"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectGetConfigCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetConfigCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGetConfigCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectGetConfigCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *models.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleIamV1__TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleIamV1__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().models_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleIamV1__TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelTestIamPermissionCall<'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, GoogleIamV1__TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleIamV1__TestIamPermissionsRequest) -> ProjectModelTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectModelTestIamPermissionCall<'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) -> ProjectModelTestIamPermissionCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().operations_list("name") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .filter("no") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationListCall<'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, GoogleLongrunning__ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectOperationListCall<'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) -> ProjectOperationListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new version of a model from a trained TensorFlow model. +/// +/// If the version created in the cloud by this call is the first deployed +/// version of the specified model, it will be made the default version of the +/// model. When you add a version to a model that already has one or more +/// versions, the default version does not automatically change. If you want a +/// new version to be the default, you must call +/// [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). +/// +/// A builder for the *models.versions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__Version; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudMlV1__Version::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().models_versions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelVersionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Version, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelVersionCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelVersionCreateCall<'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, GoogleLongrunning__Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.versions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/versions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudMlV1__Version) -> ProjectModelVersionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the model. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectModelVersionCreateCall<'a, C, A> { + self._parent = 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) -> ProjectModelVersionCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelVersionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *models.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelGetIamPolicyCall<'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, GoogleIamV1__Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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(Bearer { 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(d); + 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(d); + 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 the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectModelGetIamPolicyCall<'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) -> ProjectModelGetIamPolicyCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets basic information about all the versions of a model. +/// +/// If you expect that a model has a lot of versions, or if you need to handle +/// only a limited number of results at a time, you can request that the list +/// be retrieved in batches (called pages): +/// +/// A builder for the *models.versions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_versions_list("parent") +/// .page_token("et") +/// .page_size(-41) +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelVersionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelVersionListCall<'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, GoogleCloudMlV1__ListVersionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.versions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/versions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the model for which to list the version. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectModelVersionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. A page token to request the next page of results. + /// + /// You get the token from the `next_page_token` field of the response from + /// the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectModelVersionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The number of versions to retrieve per "page" of results. If + /// there are more remaining results than this number, the response message + /// will contain a valid value in the `next_page_token` field. + /// + /// The default value is 20, and the maximum page size is 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectModelVersionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelVersionListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelVersionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationGetCall<'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, GoogleLongrunning__Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectOperationGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. +/// +/// A builder for the *operations.cancel* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationCancelCall<'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, GoogleProtobuf__Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectOperationCancelCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a model which will later contain one or more versions. +/// +/// You must add at least one version before you can request predictions from +/// the model. Add versions by calling +/// [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create). +/// +/// A builder for the *models.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__Model; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudMlV1__Model::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().models_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Model, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelCreateCall<'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, GoogleCloudMlV1__Model)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/models"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudMlV1__Model) -> ProjectModelCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project name. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectModelCreateCall<'a, C, A> { + self._parent = 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) -> ProjectModelCreateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a model. +/// +/// You can only delete a model if there are no versions in it. You can delete +/// versions by calling +/// [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete). +/// +/// A builder for the *models.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelDeleteCall<'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, GoogleLongrunning__Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the model. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectModelDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the jobs in the project. +/// +/// A builder for the *jobs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().jobs_list("parent") +/// .page_token("sea") +/// .page_size(-55) +/// .filter("eos") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobListCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobListCall<'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, GoogleCloudMlV1__ListJobsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.jobs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "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 = self.hub._base_url.clone() + "v1/{+parent}/jobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the project for which to list jobs. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectJobListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. A page token to request the next page of results. + /// + /// You get the token from the `next_page_token` field of the response from + /// the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectJobListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The number of jobs to retrieve per "page" of results. If there + /// are more remaining results than this number, the response message will + /// contain a valid value in the `next_page_token` field. + /// + /// The default value is 20, and the maximum page size is 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectJobListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. Specifies the subset of jobs to retrieve. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectJobListCall<'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) -> ProjectJobListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectJobListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information about a model, including its name, the description (if +/// set), and the default version (if at least one version of the model has +/// been deployed). +/// +/// A builder for the *models.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelGetCall<'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, GoogleCloudMlV1__Model)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the model. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectModelGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the models in a project. +/// +/// Each project can contain multiple models, and each model can have multiple +/// versions. +/// +/// A builder for the *models.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().models_list("parent") +/// .page_token("dolor") +/// .page_size(-39) +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelListCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelListCall<'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, GoogleCloudMlV1__ListModelsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.models.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/models"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the project whose models are to be listed. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectModelListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. A page token to request the next page of results. + /// + /// You get the token from the `next_page_token` field of the response from + /// the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectModelListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The number of models to retrieve per "page" of results. If there + /// are more remaining results than this number, the response message will + /// contain a valid value in the `next_page_token` field. + /// + /// The default value is 20, and the maximum page size is 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectModelListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectModelListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectModelListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/monitoring3-cli/Cargo.toml b/gen/monitoring3-cli/Cargo.toml index 0fce7a3dcb..345f7c029b 100644 --- a/gen/monitoring3-cli/Cargo.toml +++ b/gen/monitoring3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-monitoring3-cli" -version = "1.0.6+20170519" +version = "1.0.6+20170918" authors = ["Sebastian Thiel "] description = "A complete library to interact with Monitoring (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/monitoring3-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-monitoring3] path = "../monitoring3" -version = "1.0.6+20170519" +version = "1.0.6+20170918" diff --git a/gen/monitoring3-cli/README.md b/gen/monitoring3-cli/README.md index 545efe8eb8..23eae1af89 100644 --- a/gen/monitoring3-cli/README.md +++ b/gen/monitoring3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Monitoring* API at revision *20170519*. The CLI is at version *1.0.6*. +This documentation was generated from the *Monitoring* API at revision *20170918*. The CLI is at version *1.0.6*. ```bash monitoring3 [options] diff --git a/gen/monitoring3-cli/mkdocs.yml b/gen/monitoring3-cli/mkdocs.yml index f87d446abc..d85529fd7d 100644 --- a/gen/monitoring3-cli/mkdocs.yml +++ b/gen/monitoring3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Monitoring v1.0.6+20170519 +site_name: Monitoring v1.0.6+20170918 site_url: http://byron.github.io/google-apis-rs/google-monitoring3-cli site_description: A complete library to interact with Monitoring (protocol v3) diff --git a/gen/monitoring3-cli/src/main.rs b/gen/monitoring3-cli/src/main.rs index dc43a0e993..22b555c129 100644 --- a/gen/monitoring3-cli/src/main.rs +++ b/gen/monitoring3-cli/src/main.rs @@ -1611,7 +1611,7 @@ fn main() { let mut app = App::new("monitoring3") .author("Sebastian Thiel ") - .version("1.0.6+20170519") + .version("1.0.6+20170918") .about("Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_monitoring3_cli") .arg(Arg::with_name("url") diff --git a/gen/monitoring3/Cargo.toml b/gen/monitoring3/Cargo.toml index e030be2c8f..9254898f7c 100644 --- a/gen/monitoring3/Cargo.toml +++ b/gen/monitoring3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-monitoring3" -version = "1.0.6+20170519" +version = "1.0.6+20170918" authors = ["Sebastian Thiel "] description = "A complete library to interact with Monitoring (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/monitoring3" homepage = "https://cloud.google.com/monitoring/api/" -documentation = "https://docs.rs/google-monitoring3/1.0.6+20170519" +documentation = "https://docs.rs/google-monitoring3/1.0.6+20170918" license = "MIT" keywords = ["monitoring", "google", "protocol", "web", "api"] diff --git a/gen/monitoring3/README.md b/gen/monitoring3/README.md index 021c9608b9..d250d66afc 100644 --- a/gen/monitoring3/README.md +++ b/gen/monitoring3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-monitoring3` library allows access to all features of the *Google Monitoring* service. -This documentation was generated from *Monitoring* crate version *1.0.6+20170519*, where *20170519* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Monitoring* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Monitoring* *v3* API can be found at the [official documentation site](https://cloud.google.com/monitoring/api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.Monitoring.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.Monitoring.html) ... * projects - * [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectTimeSeryCreateCall.html) and [*time series list*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.ProjectTimeSeryListCall.html) + * [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectTimeSeryCreateCall.html) and [*time series list*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.ProjectTimeSeryListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/struct.Monitoring.html)** +* **[Hub](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/struct.Monitoring.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.Part.html)** + * **[Parts](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,10 +47,9 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().metric_descriptors_delete(...).doit() -let r = hub.projects().time_series_create(...).doit() -let r = hub.projects().collectd_time_series_create(...).doit() -let r = hub.projects().groups_delete(...).doit() +let r = hub.projects().groups_update(...).doit() +let r = hub.projects().groups_create(...).doit() +let r = hub.projects().groups_get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -76,7 +75,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_monitoring3 as monitoring3; -use monitoring3::CreateTimeSeriesRequest; +use monitoring3::Group; use monitoring3::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -97,12 +96,13 @@ let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsCon // 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 = CreateTimeSeriesRequest::default(); +let mut req = Group::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().time_series_create(req, "name") +let result = hub.projects().groups_update(req, "name") + .validate_only(true) .doit(); match result { @@ -125,17 +125,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/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")`. @@ -145,29 +145,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/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](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/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](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/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](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/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](https://docs.rs/google-monitoring3/1.0.6+20170519/google_monitoring3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/monitoring3/src/lib.rs b/gen/monitoring3/src/lib.rs index ff6183a34c..a23f47b9b5 100644 --- a/gen/monitoring3/src/lib.rs +++ b/gen/monitoring3/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 *Monitoring* crate version *1.0.6+20170519*, where *20170519* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Monitoring* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Monitoring* *v3* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/api/). @@ -47,10 +47,9 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().metric_descriptors_delete(...).doit() -//! let r = hub.projects().time_series_create(...).doit() -//! let r = hub.projects().collectd_time_series_create(...).doit() -//! let r = hub.projects().groups_delete(...).doit() +//! let r = hub.projects().groups_update(...).doit() +//! let r = hub.projects().groups_create(...).doit() +//! let r = hub.projects().groups_get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -76,7 +75,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_monitoring3 as monitoring3; -//! use monitoring3::CreateTimeSeriesRequest; +//! use monitoring3::Group; //! use monitoring3::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -98,12 +97,13 @@ //! // 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 = CreateTimeSeriesRequest::default(); +//! let mut req = Group::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().time_series_create(req, "name") +//! let result = hub.projects().groups_update(req, "name") +//! .validate_only(true) //! .doit(); //! //! match result { @@ -273,7 +273,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_monitoring3 as monitoring3; -/// use monitoring3::CreateTimeSeriesRequest; +/// use monitoring3::Group; /// use monitoring3::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -295,12 +295,13 @@ impl Default for Scope { /// // 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 = CreateTimeSeriesRequest::default(); +/// let mut req = Group::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().time_series_create(req, "name") +/// let result = hub.projects().groups_update(req, "name") +/// .validate_only(true) /// .doit(); /// /// match result { @@ -377,23 +378,6 @@ impl<'a, C, A> Monitoring // ############ // SCHEMAS ### // ########## -/// A time interval extending just after a start time through an end time. If the start time is the same as the end time, then the interval represents a single point in time. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TimeInterval { - /// Required. The end of the time interval. - #[serde(rename="endTime")] - pub end_time: Option, - /// Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. - #[serde(rename="startTime")] - pub start_time: Option, -} - -impl Part for TimeInterval {} - - /// The ListMetricDescriptors response. /// /// # Activities @@ -427,12 +411,12 @@ impl ResponseResult for ListMetricDescriptorsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListGroupMembersResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, /// The total number of elements matching this request. #[serde(rename="totalSize")] pub total_size: Option, + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, /// A set of monitored resources in the group. pub members: Option>, } @@ -472,94 +456,22 @@ impl RequestValue for Group {} impl ResponseResult for Group {} -/// A single strongly-typed value. +/// Describes the error status for payloads that were not written. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TypedValue { - /// A distribution value. - #[serde(rename="distributionValue")] - pub distribution_value: Option, - /// A variable-length string value. - #[serde(rename="stringValue")] - pub string_value: Option, - /// A Boolean value: true or false. - #[serde(rename="boolValue")] - pub bool_value: Option, - /// A 64-bit double-precision floating-point number. Its magnitude is approximately ±10±300 and it has 16 significant digits of precision. - #[serde(rename="doubleValue")] - pub double_value: Option, - /// A 64-bit integer. Its range is approximately ±9.2x1018. - #[serde(rename="int64Value")] - pub int64_value: Option, +pub struct CollectdPayloadError { + /// The zero-based index in CreateCollectdTimeSeriesRequest.collectd_payloads. + pub index: Option, + /// Records the error status for values that were not written due to an error.Failed payloads for which nothing is written will not include partial value errors. + #[serde(rename="valueErrors")] + pub value_errors: Option>, + /// Records the error status for the payload. If this field is present, the partial errors for nested values won't be populated. + pub error: Option, } -impl Part for TypedValue {} - - -/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 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 Exponential { - /// Must be greater than 0. - pub scale: Option, - /// Must be greater than 1. - #[serde(rename="growthFactor")] - pub growth_factor: Option, - /// Must be greater than 0. - #[serde(rename="numFiniteBuckets")] - pub num_finite_buckets: Option, -} - -impl Part for Exponential {} - - -/// A collection of data points sent from a collectd-based plugin. See the collectd documentation for more information. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CollectdPayload { - /// The name of the plugin. Example: "disk". - pub plugin: Option, - /// The measurement type instance. Example: "used". - #[serde(rename="typeInstance")] - pub type_instance: Option, - /// The measured values during this time interval. Each value must have a different dataSourceName. - pub values: Option>, - /// The start time of the interval. - #[serde(rename="startTime")] - pub start_time: Option, - /// The end time of the interval. - #[serde(rename="endTime")] - pub end_time: Option, - /// The measurement type. Example: "memory". - #[serde(rename="type")] - pub type_: Option, - /// The instance name of the plugin Example: "hdcl". - #[serde(rename="pluginInstance")] - pub plugin_instance: Option, - /// The measurement metadata. Example: "process_id" -> 12345 - pub metadata: Option>, -} - -impl Part for CollectdPayload {} - - -/// Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Explicit { - /// The values must be monotonically increasing. - pub bounds: Option>, -} - -impl Part for Explicit {} +impl Part for CollectdPayloadError {} /// An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "instance_id" and "zone": @@ -582,21 +494,6 @@ pub struct MonitoredResource { impl Part for MonitoredResource {} -/// The range of the population values. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Range { - /// The maximum of the population values. - pub max: Option, - /// The minimum of the population values. - pub min: Option, -} - -impl Part for Range {} - - /// A single data point from a collectd-based plugin. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -616,57 +513,6 @@ pub struct CollectdValue { impl Part for CollectdValue {} -/// A collection of data points that describes the time-varying values of a metric. A time series is identified by a combination of a fully-specified monitored resource and a fully-specified metric. This type is used for both listing and creating time series. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TimeSeries { - /// The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE. - #[serde(rename="metricKind")] - pub metric_kind: Option, - /// The associated metric. A fully-specified metric used to identify the time series. - pub metric: Option, - /// The data points of this time series. When listing time series, the order of the points is specified by the list method.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION. - pub points: Option>, - /// The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. - pub resource: Option, - /// The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field. - #[serde(rename="valueType")] - pub value_type: Option, -} - -impl Part for TimeSeries {} - - -/// Distribution contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets.The summary statistics are the count, mean, sum of the squared deviation from the mean, the minimum, and the maximum of the set of population of values. The histogram is based on a sequence of buckets and gives a count of values that fall into each bucket. The boundaries of the buckets are given either explicitly or by formulas for buckets of fixed or exponentially increasing widths.Although it is not forbidden, it is generally a bad idea to include non-finite values (infinities or NaNs) in the population of values, as this will render the mean and sum_of_squared_deviation fields meaningless. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Distribution { - /// The number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided. - pub count: Option, - /// Required in the Stackdriver Monitoring API v3. The values for each bucket specified in bucket_options. The sum of the values in bucketCounts must equal the value in the count field of the Distribution object. The order of the bucket counts follows the numbering schemes described for the three bucket types. The underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; and the overflow bucket has number N-1. The size of bucket_counts must not be greater than N. If the size is less than N, then the remaining buckets are assigned values of zero. - #[serde(rename="bucketCounts")] - pub bucket_counts: Option>, - /// The sum of squared deviations from the mean of the values in the population. For values x_i this is: - /// Sum[i=1..n]((x_i - mean)^2) - /// Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass.If count is zero then this field must be zero. - #[serde(rename="sumOfSquaredDeviation")] - pub sum_of_squared_deviation: Option, - /// If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Stackdriver Monitoring API v3. - pub range: Option, - /// Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries. - #[serde(rename="bucketOptions")] - pub bucket_options: Option, - /// The arithmetic mean of the values in the population. If count is zero then this field must be zero. - pub mean: Option, -} - -impl Part for Distribution {} - - /// 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); @@ -680,7 +526,6 @@ impl Part for Distribution {} /// /// * [metric descriptors delete projects](struct.ProjectMetricDescriptorDeleteCall.html) (response) /// * [time series create projects](struct.ProjectTimeSeryCreateCall.html) (response) -/// * [collectd time series create projects](struct.ProjectCollectdTimeSeryCreateCall.html) (response) /// * [groups delete projects](struct.ProjectGroupDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -689,26 +534,28 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} -/// The ListTimeSeries response. +/// The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). The error model is designed to be: +/// Simple to use and understand for most users +/// Flexible enough to meet unexpected needsOverviewThe Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.Language mappingThe Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.Other usesThe error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.Example uses of this error model include: +/// Partial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors. +/// Workflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting. +/// Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response. +/// Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message. +/// Logging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons. /// -/// # 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*). -/// -/// * [time series list projects](struct.ProjectTimeSeryListCall.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 ListTimeSeriesResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// One or more time series that match the filter included in the request. - #[serde(rename="timeSeries")] - pub time_series: Option>, +pub struct Status { + /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of message types for APIs to use. + pub details: Option>>, } -impl ResponseResult for ListTimeSeriesResponse {} +impl Part for Status {} /// Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)). @@ -811,37 +658,6 @@ impl RequestValue for MetricDescriptor {} impl ResponseResult for MetricDescriptor {} -/// A specific metric, identified by specifying values for all of the labels of a MetricDescriptor. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Metric { - /// The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values. - pub labels: Option>, - /// An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount. - #[serde(rename="type")] - pub type_: Option, -} - -impl Part for Metric {} - - -/// A single data point in a time series. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Point { - /// The time interval to which the data point applies. For GAUGE metrics, only the end time of the interval is used. For DELTA metrics, the start and end time should specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For CUMULATIVE metrics, the start and end time should specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points. - pub interval: Option, - /// The value of the data point. - pub value: Option, -} - -impl Part for Point {} - - /// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -883,46 +699,6 @@ pub struct ListGroupsResponse { impl ResponseResult for ListGroupsResponse {} -/// The ListMonitoredResourceDescriptors response. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [monitored resource descriptors list projects](struct.ProjectMonitoredResourceDescriptorListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListMonitoredResourceDescriptorsResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The monitored resource descriptors that are available to this project and that match filter, if present. - #[serde(rename="resourceDescriptors")] - pub resource_descriptors: Option>, -} - -impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} - - -/// A description of a label. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LabelDescriptor { - /// The type of data that can be assigned to the label. - #[serde(rename="valueType")] - pub value_type: Option, - /// A human-readable description for the label. - pub description: Option, - /// The label key. - pub key: Option, -} - -impl Part for LabelDescriptor {} - - /// The CreateCollectdTimeSeries request. /// /// # Activities @@ -947,25 +723,6 @@ pub struct CreateCollectdTimeSeriesRequest { impl RequestValue for CreateCollectdTimeSeriesRequest {} -/// The CreateTimeSeries request. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [time series create projects](struct.ProjectTimeSeryCreateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateTimeSeriesRequest { - /// The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each TimeSeries value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. - #[serde(rename="timeSeries")] - pub time_series: Option>, -} - -impl RequestValue for CreateTimeSeriesRequest {} - - /// An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of "gce_instance" and specifies the use of the labels "instance_id" and "zone" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API. /// /// # Activities @@ -994,6 +751,325 @@ pub struct MonitoredResourceDescriptor { impl ResponseResult for MonitoredResourceDescriptor {} +/// A time interval extending just after a start time through an end time. If the start time is the same as the end time, then the interval represents a single point in time. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeInterval { + /// Required. The end of the time interval. + #[serde(rename="endTime")] + pub end_time: Option, + /// Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for TimeInterval {} + + +/// A single strongly-typed value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TypedValue { + /// A distribution value. + #[serde(rename="distributionValue")] + pub distribution_value: Option, + /// A variable-length string value. + #[serde(rename="stringValue")] + pub string_value: Option, + /// A Boolean value: true or false. + #[serde(rename="boolValue")] + pub bool_value: Option, + /// A 64-bit double-precision floating-point number. Its magnitude is approximately ±10±300 and it has 16 significant digits of precision. + #[serde(rename="doubleValue")] + pub double_value: Option, + /// A 64-bit integer. Its range is approximately ±9.2x1018. + #[serde(rename="int64Value")] + pub int64_value: Option, +} + +impl Part for TypedValue {} + + +/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 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 Exponential { + /// Must be greater than 0. + pub scale: Option, + /// Must be greater than 1. + #[serde(rename="growthFactor")] + pub growth_factor: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, +} + +impl Part for Exponential {} + + +/// A collection of data points sent from a collectd-based plugin. See the collectd documentation for more information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CollectdPayload { + /// The name of the plugin. Example: "disk". + pub plugin: Option, + /// The measurement type instance. Example: "used". + #[serde(rename="typeInstance")] + pub type_instance: Option, + /// The measured values during this time interval. Each value must have a different dataSourceName. + pub values: Option>, + /// The start time of the interval. + #[serde(rename="startTime")] + pub start_time: Option, + /// The end time of the interval. + #[serde(rename="endTime")] + pub end_time: Option, + /// The measurement type. Example: "memory". + #[serde(rename="type")] + pub type_: Option, + /// The instance name of the plugin Example: "hdcl". + #[serde(rename="pluginInstance")] + pub plugin_instance: Option, + /// The measurement metadata. Example: "process_id" -> 12345 + pub metadata: Option>, +} + +impl Part for CollectdPayload {} + + +/// Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Explicit { + /// The values must be monotonically increasing. + pub bounds: Option>, +} + +impl Part for Explicit {} + + +/// The range of the population values. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Range { + /// The maximum of the population values. + pub max: Option, + /// The minimum of the population values. + pub min: Option, +} + +impl Part for Range {} + + +/// The CreateCollectdTimeSeries response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [collectd time series create projects](struct.ProjectCollectdTimeSeryCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateCollectdTimeSeriesResponse { + /// Records the error status for points that were not written due to an error.Failed requests for which nothing is written will return an error response instead. + #[serde(rename="payloadErrors")] + pub payload_errors: Option>, +} + +impl ResponseResult for CreateCollectdTimeSeriesResponse {} + + +/// A collection of data points that describes the time-varying values of a metric. A time series is identified by a combination of a fully-specified monitored resource and a fully-specified metric. This type is used for both listing and creating time series. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeSeries { + /// The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE. + #[serde(rename="metricKind")] + pub metric_kind: Option, + /// The associated metric. A fully-specified metric used to identify the time series. + pub metric: Option, + /// The data points of this time series. When listing time series, the order of the points is specified by the list method.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION. + pub points: Option>, + /// The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. + pub resource: Option, + /// The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field. + #[serde(rename="valueType")] + pub value_type: Option, +} + +impl Part for TimeSeries {} + + +/// Distribution contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets.The summary statistics are the count, mean, sum of the squared deviation from the mean, the minimum, and the maximum of the set of population of values. The histogram is based on a sequence of buckets and gives a count of values that fall into each bucket. The boundaries of the buckets are given either explicitly or by formulas for buckets of fixed or exponentially increasing widths.Although it is not forbidden, it is generally a bad idea to include non-finite values (infinities or NaNs) in the population of values, as this will render the mean and sum_of_squared_deviation fields meaningless. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Distribution { + /// The number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided. + pub count: Option, + /// Required in the Stackdriver Monitoring API v3. The values for each bucket specified in bucket_options. The sum of the values in bucketCounts must equal the value in the count field of the Distribution object. The order of the bucket counts follows the numbering schemes described for the three bucket types. The underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; and the overflow bucket has number N-1. The size of bucket_counts must not be greater than N. If the size is less than N, then the remaining buckets are assigned values of zero. + #[serde(rename="bucketCounts")] + pub bucket_counts: Option>, + /// The sum of squared deviations from the mean of the values in the population. For values x_i this is: + /// Sum[i=1..n]((x_i - mean)^2) + /// Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass.If count is zero then this field must be zero. + #[serde(rename="sumOfSquaredDeviation")] + pub sum_of_squared_deviation: Option, + /// If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Stackdriver Monitoring API v3. + pub range: Option, + /// Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries. + #[serde(rename="bucketOptions")] + pub bucket_options: Option, + /// The arithmetic mean of the values in the population. If count is zero then this field must be zero. + pub mean: Option, +} + +impl Part for Distribution {} + + +/// A description of a label. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LabelDescriptor { + /// The type of data that can be assigned to the label. + #[serde(rename="valueType")] + pub value_type: Option, + /// A human-readable description for the label. + pub description: Option, + /// The label key. + pub key: Option, +} + +impl Part for LabelDescriptor {} + + +/// The ListTimeSeries response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [time series list projects](struct.ProjectTimeSeryListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTimeSeriesResponse { + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// One or more time series that match the filter included in the request. + #[serde(rename="timeSeries")] + pub time_series: Option>, +} + +impl ResponseResult for ListTimeSeriesResponse {} + + +/// Describes the error status for values that were not written. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CollectdValueError { + /// The zero-based index in CollectdPayload.values within the parent CreateCollectdTimeSeriesRequest.collectd_payloads. + pub index: Option, + /// Records the error status for the value. + pub error: Option, +} + +impl Part for CollectdValueError {} + + +/// A single data point in a time series. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Point { + /// The time interval to which the data point applies. For GAUGE metrics, only the end time of the interval is used. For DELTA metrics, the start and end time should specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For CUMULATIVE metrics, the start and end time should specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points. + pub interval: Option, + /// The value of the data point. + pub value: Option, +} + +impl Part for Point {} + + +/// A specific metric, identified by specifying values for all of the labels of a MetricDescriptor. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Metric { + /// The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values. + pub labels: Option>, + /// An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for Metric {} + + +/// The ListMonitoredResourceDescriptors response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [monitored resource descriptors list projects](struct.ProjectMonitoredResourceDescriptorListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListMonitoredResourceDescriptorsResponse { + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The monitored resource descriptors that are available to this project and that match filter, if present. + #[serde(rename="resourceDescriptors")] + pub resource_descriptors: Option>, +} + +impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} + + +/// The CreateTimeSeries request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [time series create projects](struct.ProjectTimeSeryCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateTimeSeriesRequest { + /// The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each TimeSeries value must fully specify a unique time series by supplying all label values for the metric and the monitored resource. + #[serde(rename="timeSeries")] + pub time_series: Option>, +} + +impl RequestValue for CreateTimeSeriesRequest {} + + // ################### // MethodBuilders ### @@ -1152,18 +1228,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + /// Updates an existing group. You can change any group attributes except name. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". - pub fn monitored_resource_descriptors_list(&self, name: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { - ProjectMonitoredResourceDescriptorListCall { + /// * `request` - No description provided. + /// * `name` - Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. + pub fn groups_update(&self, request: Group, name: &str) -> ProjectGroupUpdateCall<'a, C, A> { + ProjectGroupUpdateCall { hub: self.hub, + _request: request, _name: name.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), + _validate_only: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1210,20 +1286,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the existing groups. + /// Lists time series that match a filter. This method does not require a Stackdriver account. /// /// # Arguments /// - /// * `name` - The project whose groups are to be listed. The format is "projects/{project_id_or_number}". - pub fn groups_list(&self, name: &str) -> ProjectGroupListCall<'a, C, A> { - ProjectGroupListCall { + /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + pub fn time_series_list(&self, name: &str) -> ProjectTimeSeryListCall<'a, C, A> { + ProjectTimeSeryListCall { hub: self.hub, _name: name.to_string(), + _view: Default::default(), _page_token: Default::default(), _page_size: Default::default(), - _descendants_of_group: Default::default(), - _children_of_group: Default::default(), - _ancestors_of_group: Default::default(), + _order_by: Default::default(), + _interval_start_time: Default::default(), + _interval_end_time: Default::default(), + _filter: Default::default(), + _aggregation_per_series_aligner: Default::default(), + _aggregation_group_by_fields: Default::default(), + _aggregation_cross_series_reducer: Default::default(), + _aggregation_alignment_period: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1269,18 +1351,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an existing group. You can change any group attributes except name. + /// Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. - pub fn groups_update(&self, request: Group, name: &str) -> ProjectGroupUpdateCall<'a, C, A> { - ProjectGroupUpdateCall { + /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + pub fn monitored_resource_descriptors_list(&self, name: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { + ProjectMonitoredResourceDescriptorListCall { hub: self.hub, - _request: request, _name: name.to_string(), - _validate_only: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1306,26 +1388,20 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists time series that match a filter. This method does not require a Stackdriver account. + /// Lists the existing groups. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". - pub fn time_series_list(&self, name: &str) -> ProjectTimeSeryListCall<'a, C, A> { - ProjectTimeSeryListCall { + /// * `name` - The project whose groups are to be listed. The format is "projects/{project_id_or_number}". + pub fn groups_list(&self, name: &str) -> ProjectGroupListCall<'a, C, A> { + ProjectGroupListCall { hub: self.hub, _name: name.to_string(), - _view: Default::default(), _page_token: Default::default(), _page_size: Default::default(), - _order_by: Default::default(), - _interval_start_time: Default::default(), - _interval_end_time: Default::default(), - _filter: Default::default(), - _aggregation_per_series_aligner: Default::default(), - _aggregation_group_by_fields: Default::default(), - _aggregation_cross_series_reducer: Default::default(), - _aggregation_alignment_period: Default::default(), + _descendants_of_group: Default::default(), + _children_of_group: Default::default(), + _ancestors_of_group: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1549,17 +1625,17 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorDeleteCall<'a, C, A> @@ -1845,17 +1921,17 @@ impl<'a, C, A> ProjectGroupCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGroupCreateCall<'a, C, A> @@ -2098,17 +2174,17 @@ impl<'a, C, A> ProjectGroupGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectGroupGetCall<'a, C, A> @@ -2351,17 +2427,17 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorGetCall<'a, C, A> @@ -2450,7 +2526,7 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut Result<(hyper::client::Response, Empty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, CreateCollectdTimeSeriesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2635,17 +2711,17 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> @@ -2708,11 +2784,11 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGroupMemberListCall<'a, C, A> @@ -2995,9 +3071,9 @@ impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Group::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().monitored_resource_descriptors_list("name") -/// .page_token("gubergren") -/// .page_size(-95) -/// .filter("aliquyam") +/// let result = hub.projects().groups_update(req, "name") +/// .validate_only(false) /// .doit(); /// # } /// ``` -pub struct ProjectMonitoredResourceDescriptorListCall<'a, C, A> +pub struct ProjectGroupUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, + _request: Group, _name: String, - _page_token: Option, - _page_size: Option, - _filter: Option, + _validate_only: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectMonitoredResourceDescriptorListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectGroupUpdateCall<'a, C, A> {} -impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectGroupUpdateCall<'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, ListMonitoredResourceDescriptorsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Group)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -3057,20 +3136,14 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.monitoredResourceDescriptors.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "monitoring.projects.groups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); + if let Some(value) = self._validate_only { + params.push(("validateOnly", value.to_string())); } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + for &field in ["alt", "name", "validateOnly"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3082,7 +3155,7 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v3/{+name}/monitoredResourceDescriptors"; + let mut url = self.hub._base_url.clone() + "v3/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3117,6 +3190,17 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor 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).expect("serde to work"); + 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 { @@ -3133,11 +3217,15 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor } }; let auth_header = Authorization(Bearer { 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::Get, &url) + let mut req = client.borrow_mut().request(hyper::method::Method::Put, &url) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.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() @@ -3188,37 +3276,30 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor } - /// The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// + /// 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: Group) -> ProjectGroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectGroupUpdateCall<'a, C, A> { self._name = new_value.to_string(); self } - /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// If true, validate this request but do not update the existing group. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// A positive number that is the maximum number of results to return. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: - /// resource.type = starts_with("gce_") AND resource.label:id - /// - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + /// Sets the *validate only* query property to the given value. + pub fn validate_only(mut self, new_value: bool) -> ProjectGroupUpdateCall<'a, C, A> { + self._validate_only = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -3227,7 +3308,7 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor /// 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) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGroupUpdateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3241,20 +3322,20 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectGroupUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3274,7 +3355,7 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor /// 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) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectGroupUpdateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3525,17 +3606,17 @@ impl<'a, C, A> ProjectTimeSeryCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTimeSeryCreateCall<'a, C, A> @@ -3809,17 +3890,17 @@ impl<'a, C, A> ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorCreateCall<'a, C, A> @@ -3854,1412 +3935,6 @@ impl<'a, C, A> ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().groups_list("name") -/// .page_token("justo") -/// .page_size(-34) -/// .descendants_of_group("et") -/// .children_of_group("diam") -/// .ancestors_of_group("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGroupListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _page_token: Option, - _page_size: Option, - _descendants_of_group: Option, - _children_of_group: Option, - _ancestors_of_group: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGroupListCall<'a, C, A> {} - -impl<'a, C, A> ProjectGroupListCall<'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, ListGroupsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.groups.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._descendants_of_group { - params.push(("descendantsOfGroup", value.to_string())); - } - if let Some(value) = self._children_of_group { - params.push(("childrenOfGroup", value.to_string())); - } - if let Some(value) = self._ancestors_of_group { - params.push(("ancestorsOfGroup", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize", "descendantsOfGroup", "childrenOfGroup", "ancestorsOfGroup"].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 = self.hub._base_url.clone() + "v3/{+name}/groups"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 whose groups are to be listed. The format is "projects/{project_id_or_number}". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// A positive number that is the maximum number of results to return. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectGroupListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth. - /// - /// Sets the *descendants of group* query property to the given value. - pub fn descendants_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { - self._descendants_of_group = Some(new_value.to_string()); - self - } - /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty. - /// - /// Sets the *children of group* query property to the given value. - pub fn children_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { - self._children_of_group = Some(new_value.to_string()); - self - } - /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. - /// - /// Sets the *ancestors of group* query property to the given value. - pub fn ancestors_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { - self._ancestors_of_group = 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) -> ProjectGroupListCall<'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) -> ProjectGroupListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectGroupListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists metric descriptors that match a filter. This method does not require a Stackdriver account. -/// -/// A builder for the *metricDescriptors.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().metric_descriptors_list("name") -/// .page_token("et") -/// .page_size(-70) -/// .filter("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMetricDescriptorListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMetricDescriptorListCall<'a, C, A> {} - -impl<'a, C, A> ProjectMetricDescriptorListCall<'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, ListMetricDescriptorsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.metricDescriptors.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}/metricDescriptors"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 on which to execute the request. The format is "projects/{project_id_or_number}". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// A positive number that is the maximum number of results to return. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectMetricDescriptorListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics: - /// metric.type = starts_with("custom.googleapis.com/") - /// - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectMetricDescriptorListCall<'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) -> ProjectMetricDescriptorListCall<'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) -> ProjectMetricDescriptorListCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectMetricDescriptorListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a single monitored resource descriptor. This method does not require a Stackdriver account. -/// -/// A builder for the *monitoredResourceDescriptors.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().monitored_resource_descriptors_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMonitoredResourceDescriptorGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMonitoredResourceDescriptorGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'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, MonitoredResourceDescriptor)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.monitoredResourceDescriptors.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMonitoredResourceDescriptorGetCall<'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) -> ProjectMonitoredResourceDescriptorGetCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates an existing group. You can change any group attributes except name. -/// -/// A builder for the *groups.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// use monitoring3::Group; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Group::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().groups_update(req, "name") -/// .validate_only(false) -/// .doit(); -/// # } -/// ``` -pub struct ProjectGroupUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _request: Group, - _name: String, - _validate_only: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGroupUpdateCall<'a, C, A> {} - -impl<'a, C, A> ProjectGroupUpdateCall<'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, Group)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.groups.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - if let Some(value) = self._validate_only { - params.push(("validateOnly", value.to_string())); - } - for &field in ["alt", "name", "validateOnly"].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 = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - 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(Bearer { 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(d); - 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(d); - 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: Group) -> ProjectGroupUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectGroupUpdateCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// If true, validate this request but do not update the existing group. - /// - /// Sets the *validate only* query property to the given value. - pub fn validate_only(mut self, new_value: bool) -> ProjectGroupUpdateCall<'a, C, A> { - self._validate_only = 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) -> ProjectGroupUpdateCall<'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) -> ProjectGroupUpdateCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectGroupUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes an existing group. -/// -/// A builder for the *groups.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 hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().groups_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGroupDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGroupDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectGroupDeleteCall<'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, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.groups.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { 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(d); - 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(d); - 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 group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectGroupDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGroupDeleteCall<'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) -> ProjectGroupDeleteCall<'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. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// 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) -> ProjectGroupDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists time series that match a filter. This method does not require a Stackdriver account. /// /// A builder for the *timeSeries.list* method supported by a *project* resource. @@ -5288,17 +3963,17 @@ impl<'a, C, A> ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTimeSeryListCall<'a, C, A> @@ -5651,3 +4326,1404 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().metric_descriptors_list("name") +/// .page_token("sadipscing") +/// .page_size(-48) +/// .filter("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMetricDescriptorListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMetricDescriptorListCall<'a, C, A> {} + +impl<'a, C, A> ProjectMetricDescriptorListCall<'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, ListMetricDescriptorsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.metricDescriptors.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}/metricDescriptors"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 on which to execute the request. The format is "projects/{project_id_or_number}". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// A positive number that is the maximum number of results to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectMetricDescriptorListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics: + /// metric.type = starts_with("custom.googleapis.com/") + /// + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectMetricDescriptorListCall<'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) -> ProjectMetricDescriptorListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectMetricDescriptorListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectMetricDescriptorListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a single monitored resource descriptor. This method does not require a Stackdriver account. +/// +/// A builder for the *monitoredResourceDescriptors.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().monitored_resource_descriptors_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMonitoredResourceDescriptorGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMonitoredResourceDescriptorGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'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, MonitoredResourceDescriptor)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.monitoredResourceDescriptors.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMonitoredResourceDescriptorGetCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectMonitoredResourceDescriptorGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. +/// +/// A builder for the *monitoredResourceDescriptors.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().monitored_resource_descriptors_list("name") +/// .page_token("no") +/// .page_size(-36) +/// .filter("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMonitoredResourceDescriptorListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMonitoredResourceDescriptorListCall<'a, C, A> {} + +impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'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, ListMonitoredResourceDescriptorsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.monitoredResourceDescriptors.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}/monitoredResourceDescriptors"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 on which to execute the request. The format is "projects/{project_id_or_number}". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// A positive number that is the maximum number of results to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: + /// resource.type = starts_with("gce_") AND resource.label:id + /// + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectMonitoredResourceDescriptorListCall<'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) -> ProjectMonitoredResourceDescriptorListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectMonitoredResourceDescriptorListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an existing group. +/// +/// A builder for the *groups.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().groups_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectGroupDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.groups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectGroupDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGroupDeleteCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGroupDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectGroupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the existing groups. +/// +/// A builder for the *groups.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().groups_list("name") +/// .page_token("aliquyam") +/// .page_size(-73) +/// .descendants_of_group("Lorem") +/// .children_of_group("sea") +/// .ancestors_of_group("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _page_token: Option, + _page_size: Option, + _descendants_of_group: Option, + _children_of_group: Option, + _ancestors_of_group: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGroupListCall<'a, C, A> {} + +impl<'a, C, A> ProjectGroupListCall<'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, ListGroupsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.groups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._descendants_of_group { + params.push(("descendantsOfGroup", value.to_string())); + } + if let Some(value) = self._children_of_group { + params.push(("childrenOfGroup", value.to_string())); + } + if let Some(value) = self._ancestors_of_group { + params.push(("ancestorsOfGroup", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "descendantsOfGroup", "childrenOfGroup", "ancestorsOfGroup"].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 = self.hub._base_url.clone() + "v3/{+name}/groups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 whose groups are to be listed. The format is "projects/{project_id_or_number}". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// A positive number that is the maximum number of results to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectGroupListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth. + /// + /// Sets the *descendants of group* query property to the given value. + pub fn descendants_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { + self._descendants_of_group = Some(new_value.to_string()); + self + } + /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty. + /// + /// Sets the *children of group* query property to the given value. + pub fn children_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { + self._children_of_group = Some(new_value.to_string()); + self + } + /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. + /// + /// Sets the *ancestors of group* query property to the given value. + pub fn ancestors_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { + self._ancestors_of_group = 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) -> ProjectGroupListCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGroupListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/oslogin1_beta-cli/Cargo.toml b/gen/oslogin1_beta-cli/Cargo.toml new file mode 100644 index 0000000000..1ec7986bc4 --- /dev/null +++ b/gen/oslogin1_beta-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-oslogin1_beta-cli" +version = "1.0.6+20170926" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud OS Login (protocol v1beta)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta-cli" +homepage = "https://cloud.google.com/compute/docs/oslogin/rest/" +documentation = "http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli" +license = "MIT" +keywords = ["oslogin", "google", "cli"] + +[[bin]] +name = "oslogin1-beta" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-oslogin1_beta] +path = "../oslogin1_beta" +version = "1.0.6+20170926" diff --git a/gen/oslogin1_beta-cli/LICENSE.md b/gen/oslogin1_beta-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/oslogin1_beta-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/oslogin1_beta-cli/README.md b/gen/oslogin1_beta-cli/README.md new file mode 100644 index 0000000000..8ece7f7065 --- /dev/null +++ b/gen/oslogin1_beta-cli/README.md @@ -0,0 +1,118 @@ + +The `oslogin1-beta` command-line interface *(CLI)* allows to use most features of the *Google Cloud OS Login* 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 *Cloud OS Login* API can be found at the +[official documentation site](https://cloud.google.com/compute/docs/oslogin/rest/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-oslogin1_beta-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta-cli). + +# Usage + +This documentation was generated from the *Cloud OS Login* API at revision *20170926*. The CLI is at version *1.0.6*. + +```bash +oslogin1-beta [options] + users + get-login-profile [-p ]... [-o ] + import-ssh-public-key (-r )... [-p ]... [-o ] + ssh-public-keys-delete [-p ]... [-o ] + ssh-public-keys-get [-p ]... [-o ] + ssh-public-keys-patch (-r )... [-p ]... [-o ] + oslogin1-beta --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 `oslogin1-beta-`. 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/oslogin1-beta-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/oslogin1-beta-secret.json`, assuming that the required *oslogin* 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. `oslogin1-beta --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/oslogin1_beta-cli/mkdocs.yml b/gen/oslogin1_beta-cli/mkdocs.yml new file mode 100644 index 0000000000..6ab2a67c71 --- /dev/null +++ b/gen/oslogin1_beta-cli/mkdocs.yml @@ -0,0 +1,21 @@ +site_name: Cloud OS Login v1.0.6+20170926 +site_url: http://byron.github.io/google-apis-rs/google-oslogin1_beta-cli +site_description: A complete library to interact with Cloud OS Login (protocol v1beta) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['users_get-login-profile.md', 'Users', 'Get Login Profile'] +- ['users_import-ssh-public-key.md', 'Users', 'Import Ssh Public Key'] +- ['users_ssh-public-keys-delete.md', 'Users', 'Ssh Public Keys Delete'] +- ['users_ssh-public-keys-get.md', 'Users', 'Ssh Public Keys Get'] +- ['users_ssh-public-keys-patch.md', 'Users', 'Ssh Public Keys Patch'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/oslogin1_beta-cli/src/cmn.rs b/gen/oslogin1_beta-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/oslogin1_beta-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/oslogin1_beta-cli/src/main.rs b/gen/oslogin1_beta-cli/src/main.rs new file mode 100644 index 0000000000..b7f8c57b93 --- /dev/null +++ b/gen/oslogin1_beta-cli/src/main.rs @@ -0,0 +1,729 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_oslogin1_beta 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudOSLogin>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _users_get_login_profile(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().get_login_profile(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_import_ssh_public_key(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "key" => Some(("key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration-time-usec" => Some(("expirationTimeUsec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key"]); + 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::SshPublicKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().import_ssh_public_key(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_ssh_public_keys_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().ssh_public_keys_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_ssh_public_keys_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().ssh_public_keys_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_ssh_public_keys_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "key" => Some(("key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration-time-usec" => Some(("expirationTimeUsec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key"]); + 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::SshPublicKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().ssh_public_keys_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("users", Some(opt)) => { + match opt.subcommand() { + ("get-login-profile", Some(opt)) => { + call_result = self._users_get_login_profile(opt, dry_run, &mut err); + }, + ("import-ssh-public-key", Some(opt)) => { + call_result = self._users_import_ssh_public_key(opt, dry_run, &mut err); + }, + ("ssh-public-keys-delete", Some(opt)) => { + call_result = self._users_ssh_public_keys_delete(opt, dry_run, &mut err); + }, + ("ssh-public-keys-get", Some(opt)) => { + call_result = self._users_ssh_public_keys_get(opt, dry_run, &mut err); + }, + ("ssh-public-keys-patch", Some(opt)) => { + call_result = self._users_ssh_public_keys_patch(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("users".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<'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, "oslogin1-beta-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "oslogin1-beta", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudOSLogin::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 = [ + ("users", "methods: 'get-login-profile', 'import-ssh-public-key', 'ssh-public-keys-delete', 'ssh-public-keys-get' and 'ssh-public-keys-patch'", vec![ + ("get-login-profile", + Some(r##"Retrieves the profile information used for logging in to a virtual machine + on Google Compute Engine."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli/users_get-login-profile", + vec![ + (Some(r##"name"##), + None, + Some(r##"The unique ID for the user in format `users/{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)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("import-ssh-public-key", + Some(r##"Adds an SSH public key and returns the profile information. Default POSIX + account information is set when no username and UID exist as part of the + login profile."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli/users_import-ssh-public-key", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The unique ID for the user in format `users/{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"##), + Some(false), + Some(false)), + ]), + ("ssh-public-keys-delete", + Some(r##"Deletes an SSH public key."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli/users_ssh-public-keys-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The fingerprint of the public key to update. Public keys are identified by + their SHA-256 fingerprint. The fingerprint of the public key is in format + `users/{user}/sshPublicKeys/{fingerprint}`."##), + 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)), + ]), + ("ssh-public-keys-get", + Some(r##"Retrieves an SSH public key."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli/users_ssh-public-keys-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The fingerprint of the public key to retrieve. Public keys are identified + by their SHA-256 fingerprint. The fingerprint of the public key is in + format `users/{user}/sshPublicKeys/{fingerprint}`."##), + 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)), + ]), + ("ssh-public-keys-patch", + Some(r##"Updates an SSH public key and returns the profile information. This method + supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli/users_ssh-public-keys-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The fingerprint of the public key to update. Public keys are identified by + their SHA-256 fingerprint. The fingerprint of the public key is in format + `users/{user}/sshPublicKeys/{fingerprint}`."##), + 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("oslogin1-beta") + .author("Sebastian Thiel ") + .version("1.0.6+20170926") + .about("Manages OS login configuration for Directory API users.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_oslogin1_beta_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/oslogin1_beta/Cargo.toml b/gen/oslogin1_beta/Cargo.toml new file mode 100644 index 0000000000..8487d22d8b --- /dev/null +++ b/gen/oslogin1_beta/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-oslogin1_beta" +version = "1.0.6+20170926" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud OS Login (protocol v1beta)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta" +homepage = "https://cloud.google.com/compute/docs/oslogin/rest/" +documentation = "https://docs.rs/google-oslogin1_beta/1.0.6+20170926" +license = "MIT" +keywords = ["oslogin", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/oslogin1_beta/LICENSE.md b/gen/oslogin1_beta/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/oslogin1_beta/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/oslogin1_beta/README.md b/gen/oslogin1_beta/README.md new file mode 100644 index 0000000000..7b22c6b4f3 --- /dev/null +++ b/gen/oslogin1_beta/README.md @@ -0,0 +1,183 @@ + +The `google-oslogin1_beta` library allows access to all features of the *Google Cloud OS Login* service. + +This documentation was generated from *Cloud OS Login* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *oslogin:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud OS Login* *v1_beta* API can be found at the +[official documentation site](https://cloud.google.com/compute/docs/oslogin/rest/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.CloudOSLogin.html) ... + +* users + * [*get login profile*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.UserImportSshPublicKeyCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.UserSshPublicKeyPatchCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.CloudOSLogin.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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.users().ssh_public_keys_patch(...).doit() +let r = hub.users().import_ssh_public_key(...).doit() +let r = hub.users().ssh_public_keys_get(...).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-oslogin1_beta = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_oslogin1_beta as oslogin1_beta; +use oslogin1_beta::SshPublicKey; +use oslogin1_beta::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use oslogin1_beta::CloudOSLogin; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SshPublicKey::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().ssh_public_keys_patch(req, "name") + .update_mask("sit") + .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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.RequestValue.html) and +[decodable](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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](https://docs.rs/google-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/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 **oslogin1_beta** 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-rsblob/master/LICENSE.md diff --git a/gen/oslogin1_beta/src/cmn.rs b/gen/oslogin1_beta/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/oslogin1_beta/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/oslogin1_beta/src/lib.rs b/gen/oslogin1_beta/src/lib.rs new file mode 100644 index 0000000000..a29b5a562e --- /dev/null +++ b/gen/oslogin1_beta/src/lib.rs @@ -0,0 +1,2011 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud OS Login* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *oslogin:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud OS Login* *v1_beta* API can be found at the +//! [official documentation site](https://cloud.google.com/compute/docs/oslogin/rest/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudOSLogin.html) ... +//! +//! * users +//! * [*get login profile*](struct.UserGetLoginProfileCall.html), [*import ssh public key*](struct.UserImportSshPublicKeyCall.html), [*ssh public keys delete*](struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](struct.UserSshPublicKeyPatchCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudOSLogin.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.users().ssh_public_keys_patch(...).doit() +//! let r = hub.users().import_ssh_public_key(...).doit() +//! let r = hub.users().ssh_public_keys_get(...).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-oslogin1_beta = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_oslogin1_beta as oslogin1_beta; +//! use oslogin1_beta::SshPublicKey; +//! use oslogin1_beta::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use oslogin1_beta::CloudOSLogin; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SshPublicKey::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().ssh_public_keys_patch(req, "name") +//! .update_mask("sed") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 Google Compute Engine resources + Compute, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, + + /// View your Google Compute Engine resources + ComputeReadonly, + + /// View your data across Google Cloud Platform services + CloudPlatformReadOnly, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Compute => "https://www.googleapis.com/auth/compute", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::ComputeReadonly => "https://www.googleapis.com/auth/compute.readonly", + Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::ComputeReadonly + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all CloudOSLogin related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_oslogin1_beta as oslogin1_beta; +/// use oslogin1_beta::SshPublicKey; +/// use oslogin1_beta::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use oslogin1_beta::CloudOSLogin; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SshPublicKey::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().ssh_public_keys_patch(req, "name") +/// .update_mask("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 CloudOSLogin { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudOSLogin {} + +impl<'a, C, A> CloudOSLogin + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudOSLogin { + CloudOSLogin { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://oslogin.googleapis.com/".to_string(), + _root_url: "https://oslogin.googleapis.com/".to_string(), + } + } + + pub fn users(&'a self) -> UserMethods<'a, C, A> { + UserMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://oslogin.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://oslogin.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// The user profile information used for logging in to a virtual machine on +/// Google Compute Engine. +/// +/// # 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 login profile users](struct.UserGetLoginProfileCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LoginProfile { + /// The list of POSIX accounts associated with the user. + #[serde(rename="posixAccounts")] + pub posix_accounts: Option>, + /// A map from SSH public key fingerprint to the associated key object. + #[serde(rename="sshPublicKeys")] + pub ssh_public_keys: Option>, + /// The primary email address that uniquely identifies the user. + pub name: Option, + /// Indicates if the user is suspended. A suspended user cannot log in but + /// their profile information is retained. + pub suspended: Option, +} + +impl ResponseResult for LoginProfile {} + + +/// A response message for importing an SSH public key. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [import ssh public key users](struct.UserImportSshPublicKeyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImportSshPublicKeyResponse { + /// The login profile information for the user. + #[serde(rename="loginProfile")] + pub login_profile: Option, +} + +impl ResponseResult for ImportSshPublicKeyResponse {} + + +/// The SSH public key information associated with a Directory API User. +/// +/// # 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*). +/// +/// * [ssh public keys patch users](struct.UserSshPublicKeyPatchCall.html) (request|response) +/// * [import ssh public key users](struct.UserImportSshPublicKeyCall.html) (request) +/// * [ssh public keys get users](struct.UserSshPublicKeyGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SshPublicKey { + /// An expiration time in microseconds since epoch. + #[serde(rename="expirationTimeUsec")] + pub expiration_time_usec: Option, + /// Public key text in SSH format, defined by + /// RFC4253 + /// section 6.6. + pub key: Option, + /// The SHA-256 fingerprint of the SSH public key. + /// Output only. + pub fingerprint: Option, +} + +impl RequestValue for SshPublicKey {} +impl ResponseResult for SshPublicKey {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [ssh public keys delete users](struct.UserSshPublicKeyDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The POSIX account information associated with a Directory API User. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PosixAccount { + /// The username of the POSIX account. + pub username: Option, + /// The path to the logic shell for this account. + pub shell: Option, + /// The user ID. + pub uid: Option, + /// Only one POSIX account can be marked as primary. + pub primary: Option, + /// The default group ID. + pub gid: Option, + /// System identifier for which account the username or uid applies to. + /// By default, the empty value is used. + #[serde(rename="systemId")] + pub system_id: Option, + /// The path to the home directory for this account. + #[serde(rename="homeDirectory")] + pub home_directory: Option, + /// The GECOS (user information) entry for this account. + pub gecos: Option, +} + +impl Part for PosixAccount {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *user* resources. +/// It is not used directly, but through the `CloudOSLogin` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_oslogin1_beta as oslogin1_beta; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use oslogin1_beta::CloudOSLogin; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get_login_profile(...)`, `import_ssh_public_key(...)`, `ssh_public_keys_delete(...)`, `ssh_public_keys_get(...)` and `ssh_public_keys_patch(...)` +/// // to build up your call. +/// let rb = hub.users(); +/// # } +/// ``` +pub struct UserMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, +} + +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: + /// + /// Updates an SSH public key and returns the profile information. This method + /// supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The fingerprint of the public key to update. Public keys are identified by + /// their SHA-256 fingerprint. The fingerprint of the public key is in format + /// `users/{user}/sshPublicKeys/{fingerprint}`. + pub fn ssh_public_keys_patch(&self, request: SshPublicKey, name: &str) -> UserSshPublicKeyPatchCall<'a, C, A> { + UserSshPublicKeyPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Adds an SSH public key and returns the profile information. Default POSIX + /// account information is set when no username and UID exist as part of the + /// login profile. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The unique ID for the user in format `users/{user}`. + pub fn import_ssh_public_key(&self, request: SshPublicKey, parent: &str) -> UserImportSshPublicKeyCall<'a, C, A> { + UserImportSshPublicKeyCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an SSH public key. + /// + /// # Arguments + /// + /// * `name` - The fingerprint of the public key to update. Public keys are identified by + /// their SHA-256 fingerprint. The fingerprint of the public key is in format + /// `users/{user}/sshPublicKeys/{fingerprint}`. + pub fn ssh_public_keys_delete(&self, name: &str) -> UserSshPublicKeyDeleteCall<'a, C, A> { + UserSshPublicKeyDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the profile information used for logging in to a virtual machine + /// on Google Compute Engine. + /// + /// # Arguments + /// + /// * `name` - The unique ID for the user in format `users/{user}`. + pub fn get_login_profile(&self, name: &str) -> UserGetLoginProfileCall<'a, C, A> { + UserGetLoginProfileCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an SSH public key. + /// + /// # Arguments + /// + /// * `name` - The fingerprint of the public key to retrieve. Public keys are identified + /// by their SHA-256 fingerprint. The fingerprint of the public key is in + /// format `users/{user}/sshPublicKeys/{fingerprint}`. + pub fn ssh_public_keys_get(&self, name: &str) -> UserSshPublicKeyGetCall<'a, C, A> { + UserSshPublicKeyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Updates an SSH public key and returns the profile information. This method +/// supports patch semantics. +/// +/// A builder for the *sshPublicKeys.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_oslogin1_beta as oslogin1_beta; +/// use oslogin1_beta::SshPublicKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1_beta::CloudOSLogin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SshPublicKey::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().ssh_public_keys_patch(req, "name") +/// .update_mask("accusam") +/// .doit(); +/// # } +/// ``` +pub struct UserSshPublicKeyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, + _request: SshPublicKey, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserSshPublicKeyPatchCall<'a, C, A> {} + +impl<'a, C, A> UserSshPublicKeyPatchCall<'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, SshPublicKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "oslogin.users.sshPublicKeys.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SshPublicKey) -> UserSshPublicKeyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The fingerprint of the public key to update. Public keys are identified by + /// their SHA-256 fingerprint. The fingerprint of the public key is in format + /// `users/{user}/sshPublicKeys/{fingerprint}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> UserSshPublicKeyPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Mask to control which fields get updated. Updates all if not present. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> UserSshPublicKeyPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSshPublicKeyPatchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> UserSshPublicKeyPatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserSshPublicKeyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Adds an SSH public key and returns the profile information. Default POSIX +/// account information is set when no username and UID exist as part of the +/// login profile. +/// +/// A builder for the *importSshPublicKey* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_oslogin1_beta as oslogin1_beta; +/// use oslogin1_beta::SshPublicKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1_beta::CloudOSLogin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = SshPublicKey::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().import_ssh_public_key(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct UserImportSshPublicKeyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, + _request: SshPublicKey, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserImportSshPublicKeyCall<'a, C, A> {} + +impl<'a, C, A> UserImportSshPublicKeyCall<'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, ImportSshPublicKeyResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "oslogin.users.importSshPublicKey", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1beta/{+parent}:importSshPublicKey"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: SshPublicKey) -> UserImportSshPublicKeyCall<'a, C, A> { + self._request = new_value; + self + } + /// The unique ID for the user in format `users/{user}`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> UserImportSshPublicKeyCall<'a, C, A> { + self._parent = 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) -> UserImportSshPublicKeyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> UserImportSshPublicKeyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserImportSshPublicKeyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an SSH public key. +/// +/// A builder for the *sshPublicKeys.delete* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_oslogin1_beta as oslogin1_beta; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1_beta::CloudOSLogin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().ssh_public_keys_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct UserSshPublicKeyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserSshPublicKeyDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserSshPublicKeyDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "oslogin.users.sshPublicKeys.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 fingerprint of the public key to update. Public keys are identified by + /// their SHA-256 fingerprint. The fingerprint of the public key is in format + /// `users/{user}/sshPublicKeys/{fingerprint}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> UserSshPublicKeyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSshPublicKeyDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> UserSshPublicKeyDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserSshPublicKeyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the profile information used for logging in to a virtual machine +/// on Google Compute Engine. +/// +/// A builder for the *getLoginProfile* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_oslogin1_beta as oslogin1_beta; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1_beta::CloudOSLogin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().get_login_profile("name") +/// .doit(); +/// # } +/// ``` +pub struct UserGetLoginProfileCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserGetLoginProfileCall<'a, C, A> {} + +impl<'a, C, A> UserGetLoginProfileCall<'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, LoginProfile)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "oslogin.users.getLoginProfile", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta/{+name}/loginProfile"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 unique ID for the user in format `users/{user}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> UserGetLoginProfileCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserGetLoginProfileCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> UserGetLoginProfileCall<'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::ComputeReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserGetLoginProfileCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an SSH public key. +/// +/// A builder for the *sshPublicKeys.get* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_oslogin1_beta as oslogin1_beta; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1_beta::CloudOSLogin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudOSLogin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().ssh_public_keys_get("name") +/// .doit(); +/// # } +/// ``` +pub struct UserSshPublicKeyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserSshPublicKeyGetCall<'a, C, A> {} + +impl<'a, C, A> UserSshPublicKeyGetCall<'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, SshPublicKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "oslogin.users.sshPublicKeys.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 fingerprint of the public key to retrieve. Public keys are identified + /// by their SHA-256 fingerprint. The fingerprint of the public key is in + /// format `users/{user}/sshPublicKeys/{fingerprint}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> UserSshPublicKeyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSshPublicKeyGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> UserSshPublicKeyGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> UserSshPublicKeyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/partners2-cli/Cargo.toml b/gen/partners2-cli/Cargo.toml index 4e6a1353b2..ca9958e563 100644 --- a/gen/partners2-cli/Cargo.toml +++ b/gen/partners2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-partners2-cli" -version = "1.0.6+20170503" +version = "1.0.6+20170912" authors = ["Sebastian Thiel "] description = "A complete library to interact with Partners (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/partners2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-partners2] path = "../partners2" -version = "1.0.6+20170503" +version = "1.0.6+20170912" diff --git a/gen/partners2-cli/README.md b/gen/partners2-cli/README.md index d0f3023b35..ea5666d105 100644 --- a/gen/partners2-cli/README.md +++ b/gen/partners2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Partners* API at revision *20170503*. The CLI is at version *1.0.6*. +This documentation was generated from the *Partners* API at revision *20170912*. The CLI is at version *1.0.6*. ```bash partners2 [options] diff --git a/gen/partners2-cli/mkdocs.yml b/gen/partners2-cli/mkdocs.yml index 68d3dcb992..70ee06141e 100644 --- a/gen/partners2-cli/mkdocs.yml +++ b/gen/partners2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Partners v1.0.6+20170503 +site_name: Partners v1.0.6+20170912 site_url: http://byron.github.io/google-apis-rs/google-partners2-cli site_description: A complete library to interact with Partners (protocol v2) diff --git a/gen/partners2-cli/src/main.rs b/gen/partners2-cli/src/main.rs index cc7a1edd62..b5e47b9c03 100644 --- a/gen/partners2-cli/src/main.rs +++ b/gen/partners2-cli/src/main.rs @@ -146,13 +146,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "request-metadata.locale" => Some(("requestMetadata.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.partners-session-id" => Some(("requestMetadata.partnersSessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "request-metadata.traffic-source.traffic-sub-id" => Some(("requestMetadata.trafficSource.trafficSubId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.traffic-source.traffic-source-id" => Some(("requestMetadata.trafficSource.trafficSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.locale" => Some(("requestMetadata.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.user-overrides.ip-address" => Some(("requestMetadata.userOverrides.ipAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.partners-session-id" => Some(("requestMetadata.partnersSessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "client-info" => Some(("clientInfo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "details" => Some(("details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "level" => Some(("level", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -320,22 +320,22 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "request-metadata.locale" => Some(("requestMetadata.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.partners-session-id" => Some(("requestMetadata.partnersSessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "request-metadata.traffic-source.traffic-sub-id" => Some(("requestMetadata.trafficSource.trafficSubId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.traffic-source.traffic-source-id" => Some(("requestMetadata.trafficSource.trafficSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.locale" => Some(("requestMetadata.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.user-overrides.ip-address" => Some(("requestMetadata.userOverrides.ipAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "recaptcha-challenge.id" => Some(("recaptchaChallenge.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.partners-session-id" => Some(("requestMetadata.partnersSessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "recaptcha-challenge.response" => Some(("recaptchaChallenge.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recaptcha-challenge.id" => Some(("recaptchaChallenge.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.marketing-opt-in" => Some(("lead.marketingOptIn", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "lead.language-code" => Some(("lead.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.gps-motivations" => Some(("lead.gpsMotivations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "lead.create-time" => Some(("lead.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.family-name" => Some(("lead.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lead.min-monthly-budget.nanos" => Some(("lead.minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "lead.min-monthly-budget.units" => Some(("lead.minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lead.min-monthly-budget.nanos" => Some(("lead.minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "lead.min-monthly-budget.currency-code" => Some(("lead.minMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.comments" => Some(("lead.comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.email" => Some(("lead.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -775,8 +775,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "company-types" => Some(("companyTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "original-min-monthly-budget.nanos" => Some(("originalMinMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "original-min-monthly-budget.units" => Some(("originalMinMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "original-min-monthly-budget.nanos" => Some(("originalMinMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "original-min-monthly-budget.currency-code" => Some(("originalMinMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auto-approval-email-domains" => Some(("autoApprovalEmailDomains", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -803,8 +803,8 @@ impl<'n> Engine<'n> { "public-profile.display-image-url" => Some(("publicProfile.displayImageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "public-profile.display-name" => Some(("publicProfile.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "public-profile.id" => Some(("publicProfile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "converted-min-monthly-budget.nanos" => Some(("convertedMinMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "converted-min-monthly-budget.units" => Some(("convertedMinMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "converted-min-monthly-budget.nanos" => Some(("convertedMinMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "converted-min-monthly-budget.currency-code" => Some(("convertedMinMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary-language-code" => Some(("primaryLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -919,8 +919,8 @@ impl<'n> Engine<'n> { "gps-motivations" => Some(("gpsMotivations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "family-name" => Some(("familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "min-monthly-budget.nanos" => Some(("minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "min-monthly-budget.units" => Some(("minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "min-monthly-budget.nanos" => Some(("minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "min-monthly-budget.currency-code" => Some(("minMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1196,8 +1196,8 @@ impl<'n> Engine<'n> { "lead.gps-motivations" => Some(("lead.gpsMotivations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "lead.create-time" => Some(("lead.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.family-name" => Some(("lead.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lead.min-monthly-budget.nanos" => Some(("lead.minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "lead.min-monthly-budget.units" => Some(("lead.minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lead.min-monthly-budget.nanos" => Some(("lead.minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "lead.min-monthly-budget.currency-code" => Some(("lead.minMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.comments" => Some(("lead.comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.email" => Some(("lead.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1209,15 +1209,15 @@ impl<'n> Engine<'n> { "lead.adwords-customer-id" => Some(("lead.adwordsCustomerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.id" => Some(("lead.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "event-category" => Some(("eventCategory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "event-action" => Some(("eventAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.locale" => Some(("requestMetadata.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.partners-session-id" => Some(("requestMetadata.partnersSessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-category" => Some(("eventCategory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "request-metadata.traffic-source.traffic-sub-id" => Some(("requestMetadata.trafficSource.trafficSubId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.traffic-source.traffic-source-id" => Some(("requestMetadata.trafficSource.trafficSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.locale" => Some(("requestMetadata.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.user-overrides.ip-address" => Some(("requestMetadata.userOverrides.ipAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-metadata.partners-session-id" => Some(("requestMetadata.partnersSessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "event-scope" => Some(("eventScope", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["adwords-customer-id", "comments", "create-time", "currency-code", "email", "event-action", "event-category", "event-scope", "experiment-ids", "family-name", "given-name", "gps-motivations", "id", "ip-address", "language-code", "lead", "locale", "marketing-opt-in", "min-monthly-budget", "nanos", "partners-session-id", "phone-number", "request-metadata", "state", "traffic-source", "traffic-source-id", "traffic-sub-id", "type", "units", "url", "user-id", "user-overrides", "website-url"]); @@ -1371,22 +1371,36 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "manager-account" => Some(("managerAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website" => Some(("website", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manager-account" => Some(("managerAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "company-id" => Some(("companyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "internal-company-id" => Some(("internalCompanyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-country-code" => Some(("primaryCountryCode", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "is-pending" => Some(("isPending", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "logo-url" => Some(("logoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.language-code" => Some(("primaryAddress.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.address-line" => Some(("primaryAddress.addressLine", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "primary-address.dependent-locality" => Some(("primaryAddress.dependentLocality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.sorting-code" => Some(("primaryAddress.sortingCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.lat-lng.latitude" => Some(("primaryAddress.latLng.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "primary-address.lat-lng.longitude" => Some(("primaryAddress.latLng.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "primary-address.locality" => Some(("primaryAddress.locality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.region-code" => Some(("primaryAddress.regionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.administrative-area" => Some(("primaryAddress.administrativeArea", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.address" => Some(("primaryAddress.address", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-address.postal-code" => Some(("primaryAddress.postalCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "company-id" => Some(("companyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "company-admin" => Some(("companyAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "badge-tier" => Some(("badgeTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "logo-url" => Some(("logoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "address" => Some(("address", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-language-code" => Some(("primaryLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resolved-timestamp" => Some(("resolvedTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "segment" => Some(("segment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "badge-tier", "company-admin", "company-id", "creation-time", "is-pending", "logo-url", "manager-account", "name", "phone-number", "resolved-timestamp", "segment", "state", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "address-line", "administrative-area", "badge-tier", "company-admin", "company-id", "creation-time", "dependent-locality", "internal-company-id", "is-pending", "language-code", "lat-lng", "latitude", "locality", "logo-url", "longitude", "manager-account", "name", "phone-number", "postal-code", "primary-address", "primary-country-code", "primary-language-code", "region-code", "resolved-timestamp", "segment", "sorting-code", "state", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2376,7 +2390,7 @@ fn main() { let mut app = App::new("partners2") .author("Sebastian Thiel ") - .version("1.0.6+20170503") + .version("1.0.6+20170912") .about("Searches certified companies and creates contact leads with them, and also audits the usage of clients.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_partners2_cli") .arg(Arg::with_name("folder") diff --git a/gen/partners2/Cargo.toml b/gen/partners2/Cargo.toml index 586118fd47..b52a1a8b53 100644 --- a/gen/partners2/Cargo.toml +++ b/gen/partners2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-partners2" -version = "1.0.6+20170503" +version = "1.0.6+20170912" authors = ["Sebastian Thiel "] description = "A complete library to interact with Partners (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/partners2" homepage = "https://developers.google.com/partners/" -documentation = "https://docs.rs/google-partners2/1.0.6+20170503" +documentation = "https://docs.rs/google-partners2/1.0.6+20170912" license = "MIT" keywords = ["partners", "google", "protocol", "web", "api"] diff --git a/gen/partners2/README.md b/gen/partners2/README.md index cecd5eaf94..ec02b3a80e 100644 --- a/gen/partners2/README.md +++ b/gen/partners2/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-partners2` library allows access to all features of the *Google Partners* service. -This documentation was generated from *Partners* crate version *1.0.6+20170503*, where *20170503* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Partners* crate version *1.0.6+20170912*, where *20170912* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Partners* *v2* API can be found at the [official documentation site](https://developers.google.com/partners/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.Partners.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.Partners.html) ... * analytics - * [*list*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.AnalyticListCall.html) + * [*list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.AnalyticListCall.html) * client messages - * [*log*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.ClientMessageLogCall.html) -* [companies](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.Company.html) - * [*get*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.CompanyListCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.ClientMessageLogCall.html) +* [companies](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.Company.html) + * [*get*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.CompanyListCall.html) * exams - * [*get token*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.ExamGetTokenCall.html) -* [leads](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.Lead.html) - * [*list*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.LeadListCall.html) + * [*get token*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.ExamGetTokenCall.html) +* [leads](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.Lead.html) + * [*list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.LeadListCall.html) * offers - * [*history list*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.OfferHistoryListCall.html) and [*list*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.OfferListCall.html) + * [*history list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.OfferHistoryListCall.html) and [*list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.OfferListCall.html) * user events - * [*log*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.UserEventLogCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserEventLogCall.html) * user states - * [*list*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.UserStateListCall.html) -* [users](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.User.html) - * [*create company relation*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.UserCreateCompanyRelationCall.html), [*delete company relation*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.UserDeleteCompanyRelationCall.html), [*get*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.UserGetCall.html) and [*update profile*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.UserUpdateProfileCall.html) + * [*list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserStateListCall.html) +* [users](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.User.html) + * [*create company relation*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserCreateCompanyRelationCall.html), [*delete company relation*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserDeleteCompanyRelationCall.html), [*get*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserGetCall.html) and [*update profile*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserUpdateProfileCall.html) Other activities are ... -* [get partnersstatus](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.MethodGetPartnersstatuCall.html) -* [update companies](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.MethodUpdateCompanyCall.html) -* [update leads](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.MethodUpdateLeadCall.html) +* [get partnersstatus](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.MethodGetPartnersstatuCall.html) +* [update companies](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.MethodUpdateCompanyCall.html) +* [update leads](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.MethodUpdateLeadCall.html) @@ -44,17 +44,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/struct.Partners.html)** +* **[Hub](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.Partners.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.Part.html)** + * **[Parts](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -153,17 +153,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/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")`. @@ -173,29 +173,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/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](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/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](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/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](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/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](https://docs.rs/google-partners2/1.0.6+20170503/google_partners2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/partners2/src/lib.rs b/gen/partners2/src/lib.rs index ee720e458e..c7b7cba9e4 100644 --- a/gen/partners2/src/lib.rs +++ b/gen/partners2/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 *Partners* crate version *1.0.6+20170503*, where *20170503* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Partners* crate version *1.0.6+20170912*, where *20170912* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Partners* *v2* API can be found at the //! [official documentation site](https://developers.google.com/partners/). @@ -435,12 +435,12 @@ impl ResponseResult for ListUserStatesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UserOverrides { - /// IP address to use instead of the user's geo-located IP address. - #[serde(rename="ipAddress")] - pub ip_address: Option, /// Logged-in user ID to impersonate instead of the user's ID. #[serde(rename="userId")] pub user_id: Option, + /// IP address to use instead of the user's geo-located IP address. + #[serde(rename="ipAddress")] + pub ip_address: Option, } impl Part for UserOverrides {} @@ -616,6 +616,37 @@ pub struct ListOffersResponse { impl ResponseResult for ListOffersResponse {} +/// Response message for ListLeads. +/// +/// # 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 leads](struct.LeadListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLeadsResponse { + /// A token to retrieve next page of results. + /// Pass this value in the `ListLeadsRequest.page_token` field in the + /// subsequent call to + /// ListLeads to retrieve the + /// next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total count of leads for the given company. + #[serde(rename="totalSize")] + pub total_size: Option, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, + /// The list of leads. + pub leads: Option>, +} + +impl ResponseResult for ListLeadsResponse {} + + /// The localized company information. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -712,6 +743,21 @@ pub struct ListCompaniesResponse { impl ResponseResult for ListCompaniesResponse {} +/// Key value data pair for an event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventData { + /// Data values. + pub values: Option>, + /// Data type. + pub key: Option, +} + +impl Part for EventData {} + + /// 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: @@ -781,53 +827,56 @@ pub struct AnalyticsDataPoint { impl Part for AnalyticsDataPoint {} -/// Offer info by country. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CountryOfferInfo { - /// (localized) Spend X amount for that country's offer. - #[serde(rename="spendXAmount")] - pub spend_x_amount: Option, - /// Country code for which offer codes may be requested. - #[serde(rename="offerCountryCode")] - pub offer_country_code: Option, - /// Type of offer country is eligible for. - #[serde(rename="offerType")] - pub offer_type: Option, - /// (localized) Get Y amount for that country's offer. - #[serde(rename="getYAmount")] - pub get_y_amount: Option, -} - -impl Part for CountryOfferInfo {} - - -/// Response message for CreateLead. +/// Response message for +/// ListAnalytics. /// /// # 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*). /// -/// * [leads create companies](struct.CompanyLeadCreateCall.html) (response) +/// * [list analytics](struct.AnalyticListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateLeadResponse { - /// Lead that was created depending on the outcome of - /// reCaptcha validation. - pub lead: Option, - /// The outcome of reCaptcha - /// validation. - #[serde(rename="recaptchaStatus")] - pub recaptcha_status: Option, +pub struct ListAnalyticsResponse { + /// A token to retrieve next page of results. + /// Pass this value in the `ListAnalyticsRequest.page_token` field in the + /// subsequent call to + /// ListAnalytics to retrieve the + /// next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Aggregated information across the response's + /// analytics. + #[serde(rename="analyticsSummary")] + pub analytics_summary: Option, /// Current response metadata. #[serde(rename="responseMetadata")] pub response_metadata: Option, + /// The list of analytics. + /// Sorted in ascending order of + /// Analytics.event_date. + pub analytics: Option>, } -impl ResponseResult for CreateLeadResponse {} +impl ResponseResult for ListAnalyticsResponse {} + + +/// Agency specialization status +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SpecializationStatus { + /// The specialization this status is for. + #[serde(rename="badgeSpecialization")] + pub badge_specialization: Option, + /// State of agency specialization. + #[serde(rename="badgeSpecializationState")] + pub badge_specialization_state: Option, +} + +impl Part for SpecializationStatus {} /// A company resource in the Google Partners API. Once certified, it qualifies @@ -860,16 +909,16 @@ pub struct Company { /// primary_location /// in the list. pub locations: Option>, - /// The primary location of the company. - #[serde(rename="primaryLocation")] - pub primary_location: Option, + /// Services the company can help with. + pub services: Option>, /// URL of the company's additional websites used to verify the dynamic badges. /// These are stored as full URLs as entered by the user, but only the TLD will /// be used for the actual verification. #[serde(rename="additionalWebsites")] pub additional_websites: Option>, - /// Services the company can help with. - pub services: Option>, + /// The primary location of the company. + #[serde(rename="primaryLocation")] + pub primary_location: Option, /// Basic information from the company's public profile. #[serde(rename="publicProfile")] pub public_profile: Option, @@ -950,11 +999,11 @@ impl RequestValue for LogMessageRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AdWordsManagerAccountInfo { - /// The AdWords Manager Account id. - pub id: Option, /// Name of the customer this account represents. #[serde(rename="customerName")] pub customer_name: Option, + /// The AdWords Manager Account id. + pub id: Option, } impl Part for AdWordsManagerAccountInfo {} @@ -993,39 +1042,27 @@ pub struct ListOffersHistoryResponse { impl ResponseResult for ListOffersHistoryResponse {} -/// Response message for -/// ListAnalytics. +/// Offer info by country. /// -/// # 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 analytics](struct.AnalyticListCall.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 ListAnalyticsResponse { - /// A token to retrieve next page of results. - /// Pass this value in the `ListAnalyticsRequest.page_token` field in the - /// subsequent call to - /// ListAnalytics to retrieve the - /// next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of analytics. - /// Sorted in ascending order of - /// Analytics.event_date. - pub analytics: Option>, - /// Current response metadata. - #[serde(rename="responseMetadata")] - pub response_metadata: Option, - /// Aggregated information across the response's - /// analytics. - #[serde(rename="analyticsSummary")] - pub analytics_summary: Option, +pub struct CountryOfferInfo { + /// (localized) Spend X amount for that country's offer. + #[serde(rename="spendXAmount")] + pub spend_x_amount: Option, + /// Country code for which offer codes may be requested. + #[serde(rename="offerCountryCode")] + pub offer_country_code: Option, + /// Type of offer country is eligible for. + #[serde(rename="offerType")] + pub offer_type: Option, + /// (localized) Get Y amount for that country's offer. + #[serde(rename="getYAmount")] + pub get_y_amount: Option, } -impl ResponseResult for ListAnalyticsResponse {} +impl Part for CountryOfferInfo {} /// Response message for GetCompany. @@ -1055,21 +1092,21 @@ impl ResponseResult for GetCompanyResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RequestMetadata { - /// Locale to use for the current request. - pub locale: Option, - /// Google Partners session ID. - #[serde(rename="partnersSessionId")] - pub partners_session_id: Option, /// Experiment IDs the current request belongs to. #[serde(rename="experimentIds")] pub experiment_ids: Option>, + /// Source of traffic for the current request. + #[serde(rename="trafficSource")] + pub traffic_source: Option, + /// Locale to use for the current request. + pub locale: Option, /// Values to use instead of the user's respective defaults for the current /// request. These are only honored by whitelisted products. #[serde(rename="userOverrides")] pub user_overrides: Option, - /// Source of traffic for the current request. - #[serde(rename="trafficSource")] - pub traffic_source: Option, + /// Google Partners session ID. + #[serde(rename="partnersSessionId")] + pub partners_session_id: Option, } impl Part for RequestMetadata {} @@ -1101,6 +1138,10 @@ pub struct User { /// @OutputOnly #[serde(rename="certificationStatus")] pub certification_status: Option>, + /// The internal user ID. + /// Only available for a whitelisted set of api clients. + #[serde(rename="internalId")] + pub internal_id: Option, /// This is the list of AdWords Manager Accounts the user has edit access to. /// If the user has edit access to multiple accounts, the user can choose the /// preferred account and we use this when a personal account is needed. Can @@ -1146,41 +1187,73 @@ impl ResponseResult for User {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without - /// a year. - pub year: Option, + /// Month of year. Must be from 1 to 12. + pub month: Option, /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 /// if specifying a year/month where the day is not significant. pub day: Option, - /// Month of year. Must be from 1 to 12. - pub month: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, } impl Part for Date {} -/// Basic information from a public profile. +/// The profile information of a Partners user. /// -/// 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*). +/// +/// * [update profile users](struct.UserUpdateProfileCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PublicProfile { - /// The URL of the public profile. - pub url: Option, - /// The URL to the main profile image of the public profile. - #[serde(rename="profileImage")] - pub profile_image: Option, - /// The URL to the main display image of the public profile. Being deprecated. - #[serde(rename="displayImageUrl")] - pub display_image_url: Option, - /// The display name of the public profile. - #[serde(rename="displayName")] - pub display_name: Option, - /// The ID which can be used to retrieve more details about the public profile. - pub id: Option, +pub struct UserProfile { + /// A list of ids representing which industries the user selected. + pub industries: Option>, + /// The user's primary country, an ISO 2-character code. + #[serde(rename="primaryCountryCode")] + pub primary_country_code: Option, + /// If the user has edit access to multiple accounts, the user can choose the + /// preferred account and it is used when a personal account is needed. Can + /// be empty. + #[serde(rename="adwordsManagerAccount")] + pub adwords_manager_account: Option, + /// A list of ids represnting which job categories the user selected. + #[serde(rename="jobFunctions")] + pub job_functions: Option>, + /// The list of opt-ins for the user, related to communication preferences. + #[serde(rename="emailOptIns")] + pub email_opt_ins: Option, + /// The user's family name. + #[serde(rename="familyName")] + pub family_name: Option, + /// The list of languages this user understands. + pub languages: Option>, + /// The email address the user has selected on the Partners site as primary. + #[serde(rename="emailAddress")] + pub email_address: Option, + /// The user's mailing address, contains multiple fields. + pub address: Option, + /// The user's phone number. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// The user's given name. + #[serde(rename="givenName")] + pub given_name: Option, + /// A list of ids representing which markets the user was interested in. + pub markets: Option>, + /// Whether the user's public profile is visible to anyone with the URL. + #[serde(rename="profilePublic")] + pub profile_public: Option, + /// A list of ids representing which channels the user selected they were in. + pub channels: Option>, } -impl Part for PublicProfile {} +impl RequestValue for UserProfile {} +impl ResponseResult for UserProfile {} /// Response message for @@ -1250,69 +1323,23 @@ impl Part for TrafficSource {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CertificationStatus { - /// Whether certification is passing. - #[serde(rename="isCertified")] - pub is_certified: Option, - /// List of certification exam statuses. - #[serde(rename="examStatuses")] - pub exam_statuses: Option>, /// The type of the certification. #[serde(rename="type")] pub type_: Option, /// Number of people who are certified, #[serde(rename="userCount")] pub user_count: Option, + /// Whether certification is passing. + #[serde(rename="isCertified")] + pub is_certified: Option, + /// List of certification exam statuses. + #[serde(rename="examStatuses")] + pub exam_statuses: Option>, } impl Part for CertificationStatus {} -/// Historical information about a Google Partners Offer. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HistoricalOffer { - /// Status of the offer. - pub status: Option, - /// Offer code. - #[serde(rename="offerCode")] - pub offer_code: Option, - /// Country Code for the offer country. - #[serde(rename="offerCountryCode")] - pub offer_country_code: Option, - /// Client's AdWords page URL. - #[serde(rename="adwordsUrl")] - pub adwords_url: Option, - /// Time offer was first created. - #[serde(rename="creationTime")] - pub creation_time: Option, - /// ID of client. - #[serde(rename="clientId")] - pub client_id: Option, - /// Email address for client. - #[serde(rename="clientEmail")] - pub client_email: Option, - /// Time last action was taken. - #[serde(rename="lastModifiedTime")] - pub last_modified_time: Option, - /// Type of offer. - #[serde(rename="offerType")] - pub offer_type: Option, - /// Name (First + Last) of the partners user to whom the incentive is allocated. - #[serde(rename="senderName")] - pub sender_name: Option, - /// Time this offer expires. - #[serde(rename="expirationTime")] - pub expiration_time: Option, - /// Name of the client. - #[serde(rename="clientName")] - pub client_name: Option, -} - -impl Part for HistoricalOffer {} - - /// Common data that is in each API response. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1351,60 +1378,26 @@ pub struct ExamToken { impl ResponseResult for ExamToken {} -/// The profile information of a Partners user. +/// Analytics aggregated data for a `Company` for a given date range. /// -/// # 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 profile users](struct.UserUpdateProfileCall.html) (request|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 UserProfile { - /// A list of ids representing which industries the user selected. - pub industries: Option>, - /// The user's primary country, an ISO 2-character code. - #[serde(rename="primaryCountryCode")] - pub primary_country_code: Option, - /// If the user has edit access to multiple accounts, the user can choose the - /// preferred account and it is used when a personal account is needed. Can - /// be empty. - #[serde(rename="adwordsManagerAccount")] - pub adwords_manager_account: Option, - /// A list of ids represnting which job categories the user selected. - #[serde(rename="jobFunctions")] - pub job_functions: Option>, - /// The list of opt-ins for the user, related to communication preferences. - #[serde(rename="emailOptIns")] - pub email_opt_ins: Option, - /// The user's family name. - #[serde(rename="familyName")] - pub family_name: Option, - /// The list of languages this user understands. - pub languages: Option>, - /// The email address the user has selected on the Partners site as primary. - #[serde(rename="emailAddress")] - pub email_address: Option, - /// The user's mailing address, contains multiple fields. - pub address: Option, - /// The user's phone number. - #[serde(rename="phoneNumber")] - pub phone_number: Option, - /// The user's given name. - #[serde(rename="givenName")] - pub given_name: Option, - /// A list of ids representing which markets the user was interested in. - pub markets: Option>, - /// Whether the user's public profile is visible to anyone with the URL. - #[serde(rename="profilePublic")] - pub profile_public: Option, - /// A list of ids representing which channels the user selected they were in. - pub channels: Option>, +pub struct AnalyticsSummary { + /// Aggregated number of profile views for the `Company` for given date range. + #[serde(rename="profileViewsCount")] + pub profile_views_count: Option, + /// Aggregated number of times users saw the `Company` + /// in Google Partners Search results for given date range. + #[serde(rename="searchViewsCount")] + pub search_views_count: Option, + /// Aggregated number of times users contacted the `Company` + /// for given date range. + #[serde(rename="contactsCount")] + pub contacts_count: Option, } -impl RequestValue for UserProfile {} -impl ResponseResult for UserProfile {} +impl Part for AnalyticsSummary {} /// Request message for @@ -1429,45 +1422,20 @@ pub struct LogUserEventRequest { /// List of event data for the event. #[serde(rename="eventDatas")] pub event_datas: Option>, - /// The category the action belongs to. - #[serde(rename="eventCategory")] - pub event_category: Option, - /// The scope of the event. - #[serde(rename="eventScope")] - pub event_scope: Option, /// The action that occurred. #[serde(rename="eventAction")] pub event_action: Option, + /// The scope of the event. + #[serde(rename="eventScope")] + pub event_scope: Option, + /// The category the action belongs to. + #[serde(rename="eventCategory")] + pub event_category: Option, } impl RequestValue for LogUserEventRequest {} -/// A user's information on a specific exam. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExamStatus { - /// The type of the exam. - #[serde(rename="examType")] - pub exam_type: Option, - /// Whether this exam is in the state of warning. - pub warning: Option, - /// Date this exam is due to expire. - pub expiration: Option, - /// Whether this exam has been passed and not expired. - pub passed: Option, - /// The date the user last taken this exam. - pub taken: Option, - /// The date the user last passed this exam. - #[serde(rename="lastPassed")] - pub last_passed: Option, -} - -impl Part for ExamStatus {} - - /// Customers qualified for an offer. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1511,44 +1479,38 @@ impl Part for OfferCustomer {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RecaptchaChallenge { - /// The ID of the reCaptcha challenge. - pub id: Option, /// The response to the reCaptcha challenge. pub response: Option, + /// The ID of the reCaptcha challenge. + pub id: Option, } impl Part for RecaptchaChallenge {} -/// Response message for ListLeads. +/// A user's information on a specific exam. /// -/// # 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 leads](struct.LeadListCall.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 ListLeadsResponse { - /// A token to retrieve next page of results. - /// Pass this value in the `ListLeadsRequest.page_token` field in the - /// subsequent call to - /// ListLeads to retrieve the - /// next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The total count of leads for the given company. - #[serde(rename="totalSize")] - pub total_size: Option, - /// Current response metadata. - #[serde(rename="responseMetadata")] - pub response_metadata: Option, - /// The list of leads. - pub leads: Option>, +pub struct ExamStatus { + /// The type of the exam. + #[serde(rename="examType")] + pub exam_type: Option, + /// Whether this exam is in the state of warning. + pub warning: Option, + /// Date this exam is due to expire. + pub expiration: Option, + /// Whether this exam has been passed and not expired. + pub passed: Option, + /// The date the user last taken this exam. + pub taken: Option, + /// The date the user last passed this exam. + #[serde(rename="lastPassed")] + pub last_passed: Option, } -impl ResponseResult for ListLeadsResponse {} +impl Part for ExamStatus {} /// Status for a Google Partners certification exam. @@ -1568,43 +1530,54 @@ pub struct CertificationExamStatus { impl Part for CertificationExamStatus {} -/// Agency specialization status +/// Response message for CreateLead. +/// +/// # 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*). +/// +/// * [leads create companies](struct.CompanyLeadCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateLeadResponse { + /// The outcome of reCaptcha + /// validation. + #[serde(rename="recaptchaStatus")] + pub recaptcha_status: Option, + /// Lead that was created depending on the outcome of + /// reCaptcha validation. + pub lead: Option, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for CreateLeadResponse {} + + +/// Basic information from a public profile. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SpecializationStatus { - /// The specialization this status is for. - #[serde(rename="badgeSpecialization")] - pub badge_specialization: Option, - /// State of agency specialization. - #[serde(rename="badgeSpecializationState")] - pub badge_specialization_state: Option, +pub struct PublicProfile { + /// The URL of the public profile. + pub url: Option, + /// The URL to the main profile image of the public profile. + #[serde(rename="profileImage")] + pub profile_image: Option, + /// The URL to the main display image of the public profile. Being deprecated. + #[serde(rename="displayImageUrl")] + pub display_image_url: Option, + /// The display name of the public profile. + #[serde(rename="displayName")] + pub display_name: Option, + /// The ID which can be used to retrieve more details about the public profile. + pub id: Option, } -impl Part for SpecializationStatus {} - - -/// Analytics aggregated data for a `Company` for a given date range. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AnalyticsSummary { - /// Aggregated number of times users contacted the `Company` - /// for given date range. - #[serde(rename="contactsCount")] - pub contacts_count: Option, - /// Aggregated number of times users saw the `Company` - /// in Google Partners Search results for given date range. - #[serde(rename="searchViewsCount")] - pub search_views_count: Option, - /// Aggregated number of profile views for the `Company` for given date range. - #[serde(rename="profileViewsCount")] - pub profile_views_count: Option, -} - -impl Part for AnalyticsSummary {} +impl Part for PublicProfile {} /// A user's information on a specific certification. @@ -1636,6 +1609,9 @@ impl Part for Certification {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Money { + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + pub units: Option, /// Number of nano (10^-9) units of the amount. /// The value must be between -999,999,999 and +999,999,999 inclusive. /// If `units` is positive, `nanos` must be positive or zero. @@ -1643,9 +1619,6 @@ pub struct Money { /// If `units` is negative, `nanos` must be negative or zero. /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. pub nanos: Option, - /// The whole units of the amount. - /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - pub units: Option, /// The 3-letter currency code defined in ISO 4217. #[serde(rename="currencyCode")] pub currency_code: Option, @@ -1694,9 +1667,6 @@ impl Part for Money {} /// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) /// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) /// -/// The code in logs/storage/validator/logs_validator_traits.cc treats this type -/// as if it were annotated as ST_LOCATION. -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1732,17 +1702,17 @@ impl Part for Rank {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Analytics { - /// Date on which these events occurred. - #[serde(rename="eventDate")] - pub event_date: Option, - /// Instances of users viewing the `Company` profile - /// on the specified date. - #[serde(rename="profileViews")] - pub profile_views: Option, /// Instances of users seeing the `Company` in Google Partners Search results /// on the specified date. #[serde(rename="searchViews")] pub search_views: Option, + /// Instances of users viewing the `Company` profile + /// on the specified date. + #[serde(rename="profileViews")] + pub profile_views: Option, + /// Date on which these events occurred. + #[serde(rename="eventDate")] + pub event_date: Option, /// Instances of users contacting the `Company` /// on the specified date. pub contacts: Option, @@ -1788,11 +1758,32 @@ impl RequestValue for CreateLeadRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CompanyRelation { + /// The website URL for this company. + pub website: Option, /// The AdWords manager account # associated this company. #[serde(rename="managerAccount")] pub manager_account: Option, - /// The website URL for this company. - pub website: Option, + /// The list of Google Partners specialization statuses for the company. + #[serde(rename="specializationStatus")] + pub specialization_status: Option>, + /// The internal company ID. + /// Only available for a whitelisted set of api clients. + #[serde(rename="internalCompanyId")] + pub internal_company_id: Option, + /// The timestamp of when affiliation was requested. + /// @OutputOnly + #[serde(rename="creationTime")] + pub creation_time: Option, + /// Indicates if the user is an admin for this company. + #[serde(rename="companyAdmin")] + pub company_admin: Option, + /// The primary address for this company. + pub address: Option, + /// The segment the company is classified as. + pub segment: Option>, + /// The primary country code of the company. + #[serde(rename="primaryCountryCode")] + pub primary_country_code: Option, /// The name (in the company's primary language) for the company. pub name: Option, /// The ID of the company. There may be no id if this is a @@ -1802,15 +1793,9 @@ pub struct CompanyRelation { /// The flag that indicates if the company is pending verification. #[serde(rename="isPending")] pub is_pending: Option, - /// The primary address for this company. - pub address: Option, - /// The timestamp of when affiliation was requested. - /// @OutputOnly - #[serde(rename="creationTime")] - pub creation_time: Option, - /// Indicates if the user is an admin for this company. - #[serde(rename="companyAdmin")] - pub company_admin: Option, + /// The primary location of the company. + #[serde(rename="primaryAddress")] + pub primary_address: Option, /// Whether the company is a Partner. #[serde(rename="badgeTier")] pub badge_tier: Option, @@ -1822,34 +1807,63 @@ pub struct CompanyRelation { /// A URL to a profile photo, e.g. a G+ profile photo. #[serde(rename="logoUrl")] pub logo_url: Option, + /// The primary language code of the company. + #[serde(rename="primaryLanguageCode")] + pub primary_language_code: Option, /// The timestamp when the user was approved. /// @OutputOnly #[serde(rename="resolvedTimestamp")] pub resolved_timestamp: Option, - /// The segment the company is classified as. - pub segment: Option>, - /// The list of Google Partners specialization statuses for the company. - #[serde(rename="specializationStatus")] - pub specialization_status: Option>, } impl RequestValue for CompanyRelation {} impl ResponseResult for CompanyRelation {} -/// Key value data pair for an event. +/// Historical information about a Google Partners Offer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventData { - /// Data values. - pub values: Option>, - /// Data type. - pub key: Option, +pub struct HistoricalOffer { + /// Status of the offer. + pub status: Option, + /// Offer code. + #[serde(rename="offerCode")] + pub offer_code: Option, + /// Country Code for the offer country. + #[serde(rename="offerCountryCode")] + pub offer_country_code: Option, + /// Client's AdWords page URL. + #[serde(rename="adwordsUrl")] + pub adwords_url: Option, + /// Time offer was first created. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// ID of client. + #[serde(rename="clientId")] + pub client_id: Option, + /// Email address for client. + #[serde(rename="clientEmail")] + pub client_email: Option, + /// Time last action was taken. + #[serde(rename="lastModifiedTime")] + pub last_modified_time: Option, + /// Type of offer. + #[serde(rename="offerType")] + pub offer_type: Option, + /// Name (First + Last) of the partners user to whom the incentive is allocated. + #[serde(rename="senderName")] + pub sender_name: Option, + /// Time this offer expires. + #[serde(rename="expirationTime")] + pub expiration_time: Option, + /// Name of the client. + #[serde(rename="clientName")] + pub client_name: Option, } -impl Part for EventData {} +impl Part for HistoricalOffer {} @@ -2990,10 +3004,10 @@ impl<'a, C, A> MethodUpdateCompanyCall<'a, C, A> where C: BorrowMut MethodGetPartnersstatuCall<'a, C, A> where C: BorrowMut MethodUpdateLeadCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -3810,10 +3824,10 @@ impl<'a, C, A> UserEventLogCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -4030,10 +4044,10 @@ impl<'a, C, A> ClientMessageLogCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -4396,10 +4410,10 @@ impl<'a, C, A> CompanyGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -4647,10 +4661,10 @@ impl<'a, C, A> CompanyLeadCreateCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -5185,10 +5199,10 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -5505,10 +5519,10 @@ impl<'a, C, A> LeadListCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -5820,10 +5834,10 @@ impl<'a, C, A> AnalyticListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -6150,10 +6164,10 @@ impl<'a, C, A> OfferHistoryListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -6428,10 +6442,10 @@ impl<'a, C, A> OfferListCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -6739,10 +6753,10 @@ impl<'a, C, A> ExamGetTokenCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -7017,10 +7031,10 @@ impl<'a, C, A> UserStateListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -7327,10 +7341,10 @@ impl<'a, C, A> UserUpdateProfileCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -7670,10 +7684,10 @@ impl<'a, C, A> UserCreateCompanyRelationCall<'a, C, A> where C: BorrowMut UserGetCall<'a, C, A> where C: BorrowMut, A: oauth /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *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. @@ -8306,10 +8320,10 @@ impl<'a, C, A> UserDeleteCompanyRelationCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with People Service (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/people1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-people1] path = "../people1" -version = "1.0.6+20170518" +version = "1.0.6+20170925" diff --git a/gen/people1-cli/README.md b/gen/people1-cli/README.md index e166405597..de8228664a 100644 --- a/gen/people1-cli/README.md +++ b/gen/people1-cli/README.md @@ -25,14 +25,25 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *People Service* API at revision *20170518*. The CLI is at version *1.0.6*. +This documentation was generated from the *People Service* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash people1 [options] + contact-groups + batch-get [-p ]... [-o ] + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + members-modify (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] people connections-list [-p ]... [-o ] + create-contact (-r )... [-p ]... [-o ] + delete-contact [-p ]... [-o ] get [-p ]... [-o ] get-batch-get [-p ]... [-o ] + update-contact (-r )... [-p ]... [-o ] people1 --help Configuration: diff --git a/gen/people1-cli/mkdocs.yml b/gen/people1-cli/mkdocs.yml index 5e2a2c2793..30ea99ea42 100644 --- a/gen/people1-cli/mkdocs.yml +++ b/gen/people1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: People Service v1.0.6+20170518 +site_name: People Service v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-people1-cli site_description: A complete library to interact with People Service (protocol v1) @@ -9,9 +9,19 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['contact-groups_batch-get.md', 'Contact Groups', 'Batch Get'] +- ['contact-groups_create.md', 'Contact Groups', 'Create'] +- ['contact-groups_delete.md', 'Contact Groups', 'Delete'] +- ['contact-groups_get.md', 'Contact Groups', 'Get'] +- ['contact-groups_list.md', 'Contact Groups', 'List'] +- ['contact-groups_members-modify.md', 'Contact Groups', 'Members Modify'] +- ['contact-groups_update.md', 'Contact Groups', 'Update'] - ['people_connections-list.md', 'People', 'Connections List'] +- ['people_create-contact.md', 'People', 'Create Contact'] +- ['people_delete-contact.md', 'People', 'Delete Contact'] - ['people_get.md', 'People', 'Get'] - ['people_get-batch-get.md', 'People', 'Get Batch Get'] +- ['people_update-contact.md', 'People', 'Update Contact'] theme: readthedocs diff --git a/gen/people1-cli/src/main.rs b/gen/people1-cli/src/main.rs index bad06c7f1d..93af0f36bb 100644 --- a/gen/people1-cli/src/main.rs +++ b/gen/people1-cli/src/main.rs @@ -46,24 +46,279 @@ struct Engine<'n> { impl<'n> Engine<'n> { - fn _people_connections_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + fn _contact_groups_batch_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.people().connections_list(opt.value_of("resource-name").unwrap_or("")); + let mut call = self.hub.contact_groups().batch_get(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "resource-names" => { + call = call.add_resource_names(value.unwrap_or("")); + }, + "max-members" => { + call = call.max_members(arg_from_str(value.unwrap_or("-0"), err, "max-members", "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(["resource-names", "max-members"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _contact_groups_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "contact-group.group-type" => Some(("contactGroup.groupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.member-resource-names" => Some(("contactGroup.memberResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "contact-group.name" => Some(("contactGroup.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.member-count" => Some(("contactGroup.memberCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "contact-group.formatted-name" => Some(("contactGroup.formattedName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.etag" => Some(("contactGroup.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.resource-name" => Some(("contactGroup.resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.metadata.deleted" => Some(("contactGroup.metadata.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "contact-group.metadata.update-time" => Some(("contactGroup.metadata.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["contact-group", "deleted", "etag", "formatted-name", "group-type", "member-count", "member-resource-names", "metadata", "name", "resource-name", "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::CreateContactGroupRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.contact_groups().create(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _contact_groups_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.contact_groups().delete(opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "delete-contacts" => { + call = call.delete_contacts(arg_from_str(value.unwrap_or("false"), err, "delete-contacts", "boolean")); + }, + _ => { + 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-contacts"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _contact_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.contact_groups().get(opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "max-members" => { + call = call.max_members(arg_from_str(value.unwrap_or("-0"), err, "max-members", "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(["max-members"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _contact_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.contact_groups().list(); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "sync-token" => { call = call.sync_token(value.unwrap_or("")); }, - "sort-order" => { - call = call.sort_order(value.unwrap_or("")); - }, - "request-sync-token" => { - call = call.request_sync_token(arg_from_str(value.unwrap_or("false"), err, "request-sync-token", "boolean")); - }, - "request-mask-include-field" => { - call = call.request_mask_include_field(value.unwrap_or("")); - }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -83,7 +338,407 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["sync-token", "page-size", "request-mask-include-field", "page-token", "sort-order", "request-sync-token"].iter().map(|v|*v)); + v.extend(["sync-token", "page-size", "page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _contact_groups_members_modify(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "resource-names-to-remove" => Some(("resourceNamesToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource-names-to-add" => Some(("resourceNamesToAdd", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["resource-names-to-add", "resource-names-to-remove"]); + 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::ModifyContactGroupMembersRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.contact_groups().members_modify(request, opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _contact_groups_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "contact-group.group-type" => Some(("contactGroup.groupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.member-resource-names" => Some(("contactGroup.memberResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "contact-group.name" => Some(("contactGroup.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.member-count" => Some(("contactGroup.memberCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "contact-group.formatted-name" => Some(("contactGroup.formattedName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.etag" => Some(("contactGroup.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.resource-name" => Some(("contactGroup.resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.metadata.deleted" => Some(("contactGroup.metadata.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "contact-group.metadata.update-time" => Some(("contactGroup.metadata.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["contact-group", "deleted", "etag", "formatted-name", "group-type", "member-count", "member-resource-names", "metadata", "name", "resource-name", "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::UpdateContactGroupRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.contact_groups().update(request, opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _people_connections_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.people().connections_list(opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sync-token" => { + call = call.sync_token(value.unwrap_or("")); + }, + "sort-order" => { + call = call.sort_order(value.unwrap_or("")); + }, + "request-sync-token" => { + call = call.request_sync_token(arg_from_str(value.unwrap_or("false"), err, "request-sync-token", "boolean")); + }, + "request-mask-include-field" => { + call = call.request_mask_include_field(value.unwrap_or("")); + }, + "person-fields" => { + call = call.person_fields(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["sync-token", "page-size", "request-mask-include-field", "page-token", "sort-order", "person-fields", "request-sync-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _people_create_contact(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "age-range" => Some(("ageRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-name" => Some(("resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.previous-resource-names" => Some(("metadata.previousResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.deleted" => Some(("metadata.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "metadata.linked-people-resource-names" => Some(("metadata.linkedPeopleResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.object-type" => Some(("metadata.objectType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["age-range", "deleted", "etag", "linked-people-resource-names", "metadata", "object-type", "previous-resource-names", "resource-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::Person = json::value::from_value(object).unwrap(); + let mut call = self.hub.people().create_contact(request); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "parent" => { + call = call.parent(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(["parent"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _people_delete_contact(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.people().delete_contact(opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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 } )); } } @@ -126,6 +781,9 @@ impl<'n> Engine<'n> { "request-mask-include-field" => { call = call.request_mask_include_field(value.unwrap_or("")); }, + "person-fields" => { + call = call.person_fields(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -139,7 +797,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["request-mask-include-field"].iter().map(|v|*v)); + v.extend(["person-fields", "request-mask-include-field"].iter().map(|v|*v)); v } )); } } @@ -185,6 +843,9 @@ impl<'n> Engine<'n> { "request-mask-include-field" => { call = call.request_mask_include_field(value.unwrap_or("")); }, + "person-fields" => { + call = call.person_fields(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -198,7 +859,102 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["resource-names", "request-mask-include-field"].iter().map(|v|*v)); + v.extend(["person-fields", "resource-names", "request-mask-include-field"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _people_update_contact(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "age-range" => Some(("ageRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-name" => Some(("resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.previous-resource-names" => Some(("metadata.previousResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.deleted" => Some(("metadata.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "metadata.linked-people-resource-names" => Some(("metadata.linkedPeopleResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.object-type" => Some(("metadata.objectType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["age-range", "deleted", "etag", "linked-people-resource-names", "metadata", "object-type", "previous-resource-names", "resource-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::Person = json::value::from_value(object).unwrap(); + let mut call = self.hub.people().update_contact(request, opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-person-fields" => { + call = call.update_person_fields(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-person-fields"].iter().map(|v|*v)); v } )); } } @@ -237,17 +993,55 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("contact-groups", Some(opt)) => { + match opt.subcommand() { + ("batch-get", Some(opt)) => { + call_result = self._contact_groups_batch_get(opt, dry_run, &mut err); + }, + ("create", Some(opt)) => { + call_result = self._contact_groups_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._contact_groups_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._contact_groups_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._contact_groups_list(opt, dry_run, &mut err); + }, + ("members-modify", Some(opt)) => { + call_result = self._contact_groups_members_modify(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._contact_groups_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("contact-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("people", Some(opt)) => { match opt.subcommand() { ("connections-list", Some(opt)) => { call_result = self._people_connections_list(opt, dry_run, &mut err); }, + ("create-contact", Some(opt)) => { + call_result = self._people_create_contact(opt, dry_run, &mut err); + }, + ("delete-contact", Some(opt)) => { + call_result = self._people_delete_contact(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._people_get(opt, dry_run, &mut err); }, ("get-batch-get", Some(opt)) => { call_result = self._people_get_batch_get(opt, dry_run, &mut err); }, + ("update-contact", Some(opt)) => { + call_result = self._people_update_contact(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("people".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -340,10 +1134,175 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("people", "methods: 'connections-list', 'get' and 'get-batch-get'", vec![ + ("contact-groups", "methods: 'batch-get', 'create', 'delete', 'get', 'list', 'members-modify' and 'update'", vec![ + ("batch-get", + Some(r##"Get a list of contact groups owned by the authenticated user by specifying + a list of contact group resource names."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_batch-get", + 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)), + ]), + ("create", + Some(r##"Create a new contact group owned by the authenticated user."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_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##"Delete an existing contact group owned by the authenticated user by + specifying a contact group resource name."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_delete", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"The resource name of the contact group to delete."##), + 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##"Get a specific contact group owned by the authenticated user by specifying + a contact group resource name."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_get", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"The resource name of the contact group 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)), + ]), + ("list", + Some(r##"List all contact groups owned by the authenticated user. Members of the + contact groups are not populated."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_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)), + ]), + ("members-modify", + Some(r##"Modify the members of a contact group owned by the authenticated user."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_members-modify", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"The resource name of the contact group to modify."##), + 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##"Update the name of an existing contact group owned by the authenticated + user."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/contact-groups_update", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"The resource name for the contact group, assigned by the server. An ASCII + string, in the form of `contactGroups/`contact_group_id."##), + 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)), + ]), + ]), + + ("people", "methods: 'connections-list', 'create-contact', 'delete-contact', 'get', 'get-batch-get' and 'update-contact'", vec![ ("connections-list", Some(r##"Provides a list of the authenticated user's contacts merged with any - linked profiles."##), + connected profiles. +
+ The request throws a 400 error if 'personFields' is not specified."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_connections-list", vec![ (Some(r##"resource-name"##), @@ -358,6 +1317,50 @@ 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)), + ]), + ("create-contact", + Some(r##"Create a new contact and return the person resource for that contact."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_create-contact", + 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-contact", + Some(r##"Delete a contact person. Any non-contact data will not be deleted."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_delete-contact", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"The resource name of the contact to delete."##), + 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"##), @@ -365,8 +1368,10 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Provides information about a person for a resource name. Use - `people/me` to indicate the authenticated user."##), + Some(r##"Provides information about a person by specifying a resource name. Use + `people/me` to indicate the authenticated user. +
+ The request throws a 400 error if 'personFields' is not specified."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_get", vec![ (Some(r##"resource-name"##), @@ -374,9 +1379,11 @@ fn main() { Some(r##"The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - - To get information about any user, specify the resource name that - identifies the user, such as the resource names returned by - [`people.connections.list`](/people/api/rest/v1/people.connections/list)."##), + - To get information about a google account, specify + `people/`account_id. + - To get information about a contact, specify the resource name that + identifies the contact as returned by + [`people.connections.list`](/people/api/rest/v1/people.connections/list)."##), Some(true), Some(false)), @@ -395,7 +1402,9 @@ fn main() { ("get-batch-get", Some(r##"Provides information about a list of specific people by specifying a list of requested resource names. Use `people/me` to indicate the authenticated - user."##), + user. +
+ The request throws a 400 error if 'personFields' is not specified."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_get-batch-get", vec![ (Some(r##"v"##), @@ -404,6 +1413,47 @@ 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)), + ]), + ("update-contact", + Some(r##"Update contact data for an existing contact person. Any non-contact data + will not be modified. + + The request throws a 400 error if `updatePersonFields` is not specified. +
+ The request throws a 400 error if `person.metadata.sources` is not + specified for the contact to be updated. +
+ The request throws a 412 error if `person.metadata.sources.etag` is + different than the contact's etag, which indicates the contact has changed + since its data was read. Clients should get the latest person and re-apply + their updates to the latest person."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_update-contact", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"The resource name for the person, assigned by the server. An ASCII string + with a max length of 27 characters, in the form of + `people/`person_id."##), + 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"##), @@ -416,7 +1466,7 @@ fn main() { let mut app = App::new("people1") .author("Sebastian Thiel ") - .version("1.0.6+20170518") + .version("1.0.6+20170925") .about("Provides access to information about profiles and contacts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_people1_cli") .arg(Arg::with_name("url") diff --git a/gen/people1/Cargo.toml b/gen/people1/Cargo.toml index 28507f4c36..e79f434178 100644 --- a/gen/people1/Cargo.toml +++ b/gen/people1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-people1" -version = "1.0.6+20170518" +version = "1.0.6+20170925" authors = ["Sebastian Thiel "] description = "A complete library to interact with People Service (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/people1" homepage = "https://developers.google.com/people/" -documentation = "https://docs.rs/google-people1/1.0.6+20170518" +documentation = "https://docs.rs/google-people1/1.0.6+20170925" license = "MIT" keywords = ["people", "google", "protocol", "web", "api"] diff --git a/gen/people1/README.md b/gen/people1/README.md index 70286e75d7..b68bab8fe7 100644 --- a/gen/people1/README.md +++ b/gen/people1/README.md @@ -5,16 +5,18 @@ DO NOT EDIT ! --> The `google-people1` library allows access to all features of the *Google People Service* service. -This documentation was generated from *People Service* crate version *1.0.6+20170518*, where *20170518* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *People Service* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *People Service* *v1* API can be found at the [official documentation site](https://developers.google.com/people/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-people1/1.0.6+20170518/google_people1/struct.PeopleService.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleService.html) ... +* [contact groups](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroup.html) + * [*batch get*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupBatchGetCall.html), [*create*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupCreateCall.html), [*delete*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupDeleteCall.html), [*get*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupGetCall.html), [*list*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupListCall.html), [*members modify*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupMemberModifyCall.html) and [*update*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.ContactGroupUpdateCall.html) * people - * [*connections list*](https://docs.rs/google-people1/1.0.6+20170518/google_people1/struct.PeopleConnectionListCall.html), [*get*](https://docs.rs/google-people1/1.0.6+20170518/google_people1/struct.PeopleGetCall.html) and [*get batch get*](https://docs.rs/google-people1/1.0.6+20170518/google_people1/struct.PeopleGetBatchGetCall.html) + * [*connections list*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleConnectionListCall.html), [*create contact*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleCreateContactCall.html), [*delete contact*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleDeleteContactCall.html), [*get*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleGetCall.html), [*get batch get*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleGetBatchGetCall.html) and [*update contact*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleUpdateContactCall.html) @@ -23,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-people1/1.0.6+20170518/google_people1/struct.PeopleService.html)** +* **[Hub](https://docs.rs/google-people1/1.0.6+20170925/google_people1/struct.PeopleService.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.Part.html)** + * **[Parts](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,7 +49,13 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.people().get(...).doit() +let r = hub.contact_groups().batch_get(...).doit() +let r = hub.contact_groups().list(...).doit() +let r = hub.contact_groups().create(...).doit() +let r = hub.contact_groups().update(...).doit() +let r = hub.contact_groups().delete(...).doit() +let r = hub.contact_groups().members_modify(...).doit() +let r = hub.contact_groups().get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -93,8 +101,10 @@ let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::Https // 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.people().get("resourceName") - .request_mask_include_field("sit") +let result = hub.contact_groups().list() + .sync_token("eirmod") + .page_token("sit") + .page_size(-65) .doit(); match result { @@ -117,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-people1/1.0.6+20170518/google_people1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-people1/1.0.6+20170925/google_people1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-people1/1.0.6+20170518/google_people1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-people1/1.0.6+20170925/google_people1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-people1/1.0.6+20170925/google_people1/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")`. @@ -137,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-people1/1.0.6+20170925/google_people1/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](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-people1/1.0.6+20170925/google_people1/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](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-people1/1.0.6+20170925/google_people1/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](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-people1/1.0.6+20170925/google_people1/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](https://docs.rs/google-people1/1.0.6+20170518/google_people1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/people1/src/lib.rs b/gen/people1/src/lib.rs index 928b8e609e..488e1d7050 100644 --- a/gen/people1/src/lib.rs +++ b/gen/people1/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 *People Service* crate version *1.0.6+20170518*, where *20170518* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *People Service* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *People Service* *v1* API can be found at the //! [official documentation site](https://developers.google.com/people/). @@ -11,8 +11,10 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.PeopleService.html) ... //! +//! * [contact groups](struct.ContactGroup.html) +//! * [*batch get*](struct.ContactGroupBatchGetCall.html), [*create*](struct.ContactGroupCreateCall.html), [*delete*](struct.ContactGroupDeleteCall.html), [*get*](struct.ContactGroupGetCall.html), [*list*](struct.ContactGroupListCall.html), [*members modify*](struct.ContactGroupMemberModifyCall.html) and [*update*](struct.ContactGroupUpdateCall.html) //! * people -//! * [*connections list*](struct.PeopleConnectionListCall.html), [*get*](struct.PeopleGetCall.html) and [*get batch get*](struct.PeopleGetBatchGetCall.html) +//! * [*connections list*](struct.PeopleConnectionListCall.html), [*create contact*](struct.PeopleCreateContactCall.html), [*delete contact*](struct.PeopleDeleteContactCall.html), [*get*](struct.PeopleGetCall.html), [*get batch get*](struct.PeopleGetBatchGetCall.html) and [*update contact*](struct.PeopleUpdateContactCall.html) //! //! //! @@ -47,7 +49,13 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.people().get(...).doit() +//! let r = hub.contact_groups().batch_get(...).doit() +//! let r = hub.contact_groups().list(...).doit() +//! let r = hub.contact_groups().create(...).doit() +//! let r = hub.contact_groups().update(...).doit() +//! let r = hub.contact_groups().delete(...).doit() +//! let r = hub.contact_groups().members_modify(...).doit() +//! let r = hub.contact_groups().get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -94,8 +102,10 @@ //! // 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.people().get("resourceName") -//! .request_mask_include_field("sed") +//! let result = hub.contact_groups().list() +//! .sync_token("sed") +//! .page_token("et") +//! .page_size(-18) //! .doit(); //! //! match result { @@ -236,14 +246,14 @@ pub enum Scope { /// Manage your contacts Contact, - /// View your email address - UserinfoEmail, + /// View your phone numbers + UserPhonenumberRead, /// View your basic profile info UserinfoProfile, - /// View your phone numbers - UserPhonenumberRead, + /// View your email address + UserinfoEmail, } impl AsRef for Scope { @@ -255,9 +265,9 @@ impl AsRef for Scope { Scope::UserEmailRead => "https://www.googleapis.com/auth/user.emails.read", Scope::UserAddresseRead => "https://www.googleapis.com/auth/user.addresses.read", Scope::Contact => "https://www.googleapis.com/auth/contacts", - Scope::UserinfoEmail => "https://www.googleapis.com/auth/userinfo.email", - Scope::UserinfoProfile => "https://www.googleapis.com/auth/userinfo.profile", Scope::UserPhonenumberRead => "https://www.googleapis.com/auth/user.phonenumbers.read", + Scope::UserinfoProfile => "https://www.googleapis.com/auth/userinfo.profile", + Scope::UserinfoEmail => "https://www.googleapis.com/auth/userinfo.email", } } } @@ -306,8 +316,10 @@ impl Default for Scope { /// // 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.people().get("resourceName") -/// .request_mask_include_field("dolores") +/// let result = hub.contact_groups().list() +/// .sync_token("kasd") +/// .page_token("accusam") +/// .page_size(-8) /// .doit(); /// /// match result { @@ -351,6 +363,9 @@ impl<'a, C, A> PeopleService } } + pub fn contact_groups(&'a self) -> ContactGroupMethods<'a, C, A> { + ContactGroupMethods { hub: &self } + } pub fn people(&'a self) -> PeopleMethods<'a, C, A> { PeopleMethods { hub: &self } } @@ -384,6 +399,35 @@ impl<'a, C, A> PeopleService // ############ // SCHEMAS ### // ########## +/// The response to a list contact groups request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list contact groups](struct.ContactGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListContactGroupsResponse { + /// The token that can be used to retrieve the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of contact groups. Members of the contact groups are not + /// populated. + #[serde(rename="contactGroups")] + pub contact_groups: Option>, + /// The token that can be used to retrieve changes since the last request. + #[serde(rename="nextSyncToken")] + pub next_sync_token: Option, + /// The total number of items in the list without pagination. + #[serde(rename="totalItems")] + pub total_items: Option, +} + +impl ResponseResult for ListContactGroupsResponse {} + + /// There is no detailed description. /// /// # Activities @@ -406,8 +450,8 @@ pub struct ListConnectionsResponse { /// The total number of items in the list without pagination. #[serde(rename="totalItems")] pub total_items: Option, - /// DEPRECATED(Please use total_items). The total number of people in the list - /// without pagination. + /// **DEPRECATED** (Please use totalItems) + /// The total number of people in the list without pagination. #[serde(rename="totalPeople")] pub total_people: Option, } @@ -451,15 +495,6 @@ impl Part for RelationshipStatus {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PersonResponse { - /// The status of the response. - pub status: Option, - /// The person. - pub person: Option, - /// DEPRECATED(Please use status instead). - /// [HTTP 1.1 status - /// code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). - #[serde(rename="httpStatusCode")] - pub http_status_code: Option, /// The original requested resource name. May be different than the resource /// name on the returned person. /// @@ -468,11 +503,38 @@ pub struct PersonResponse { /// profile URL. #[serde(rename="requestedResourceName")] pub requested_resource_name: Option, + /// The person. + pub person: Option, + /// **DEPRECATED** (Please use status instead) + /// + /// [HTTP 1.1 status code] + /// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). + #[serde(rename="httpStatusCode")] + pub http_status_code: Option, + /// The status of the response. + pub status: Option, } impl Part for PersonResponse {} +/// Arbitrary user data that is populated by the end users. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserDefined { + /// The end user specified value of the user defined data. + pub value: Option, + /// The end user specified key of the user defined data. + pub key: Option, + /// Metadata about the user defined data. + pub metadata: Option, +} + +impl Part for UserDefined {} + + /// A read-only brief one-line description of the person. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -514,15 +576,23 @@ impl Part for ContactGroupMembership {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Source { + /// **Only populated in `person.metadata.sources`.** + /// + /// Last update timestamp of this source. + #[serde(rename="updateTime")] + pub update_time: Option, + /// **Only populated in `person.metadata.sources`.** + /// /// The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the - /// source. Used for web cache validation. Only populated in - /// person.metadata.sources. + /// source. Used for web cache validation. pub etag: Option, /// The source type. #[serde(rename="type")] pub type_: Option, /// The unique identifier within the source type generated by the server. pub id: Option, + /// **Only populated in `person.metadata.sources`.** + /// /// Metadata about a source of type PROFILE. #[serde(rename="profileMetadata")] pub profile_metadata: Option, @@ -546,6 +616,25 @@ pub struct Interest { impl Part for Interest {} +/// A request to update an existing contact group. Only the name can be updated. +/// +/// # 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 contact groups](struct.ContactGroupUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateContactGroupRequest { + /// The contact group to update. + #[serde(rename="contactGroup")] + pub contact_group: Option, +} + +impl RequestValue for UpdateContactGroupRequest {} + + /// A person's read-only cover photo. A large image shown on the person's /// profile page that represents who they are or what they care about. /// @@ -553,11 +642,11 @@ impl Part for Interest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CoverPhoto { + /// The URL of the cover photo. + pub url: Option, /// True if the cover photo is the default cover photo; /// false if the cover photo is a user-provided cover photo. pub default: Option, - /// The URL of the cover photo. - pub url: Option, /// Metadata about the cover photo. pub metadata: Option, } @@ -597,18 +686,18 @@ pub struct Name { /// The honorific prefixes, such as `Mrs.` or `Dr.` #[serde(rename="honorificPrefix")] pub honorific_prefix: Option, - /// The read-only display name with the last name first formatted according to - /// the locale specified by the viewer's account or the - /// Accept-Language HTTP header. - #[serde(rename="displayNameLastFirst")] - pub display_name_last_first: Option, - /// The read-only display name formatted according to the locale specified by - /// the viewer's account or the Accept-Language HTTP header. - #[serde(rename="displayName")] - pub display_name: Option, /// The family name spelled as it sounds. #[serde(rename="phoneticFamilyName")] pub phonetic_family_name: Option, + /// The read-only display name formatted according to the locale specified by + /// the viewer's account or the `Accept-Language` HTTP header. + #[serde(rename="displayName")] + pub display_name: Option, + /// The read-only display name with the last name first formatted according to + /// the locale specified by the viewer's account or the + /// `Accept-Language` HTTP header. + #[serde(rename="displayNameLastFirst")] + pub display_name_last_first: Option, /// The middle name(s). #[serde(rename="middleName")] pub middle_name: Option, @@ -682,6 +771,59 @@ pub struct BraggingRights { impl Part for BraggingRights {} +/// A contact group. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch get contact groups](struct.ContactGroupBatchGetCall.html) (none) +/// * [list contact groups](struct.ContactGroupListCall.html) (none) +/// * [create contact groups](struct.ContactGroupCreateCall.html) (response) +/// * [update contact groups](struct.ContactGroupUpdateCall.html) (response) +/// * [delete contact groups](struct.ContactGroupDeleteCall.html) (none) +/// * [members modify contact groups](struct.ContactGroupMemberModifyCall.html) (none) +/// * [get contact groups](struct.ContactGroupGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContactGroup { + /// The read-only contact group type. + #[serde(rename="groupType")] + pub group_type: Option, + /// The list of contact person resource names that are members of the contact + /// group. The field is not populated for LIST requests and can only be updated + /// through the + /// [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/members/modify). + #[serde(rename="memberResourceNames")] + pub member_resource_names: Option>, + /// The contact group name set by the group owner or a system provided name + /// for system groups. + pub name: Option, + /// The total number of contacts in the group irrespective of max members in + /// specified in the request. + #[serde(rename="memberCount")] + pub member_count: Option, + /// The read-only name translated and formatted in the viewer's account locale + /// or the `Accept-Language` HTTP header locale for system groups names. + /// Group names set by the owner are the same as name. + #[serde(rename="formattedName")] + pub formatted_name: Option, + /// The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the + /// resource. Used for web cache validation. + pub etag: Option, + /// The resource name for the contact group, assigned by the server. An ASCII + /// string, in the form of `contactGroups/`contact_group_id. + #[serde(rename="resourceName")] + pub resource_name: Option, + /// Metadata about the contact group. + pub metadata: Option, +} + +impl Resource for ContactGroup {} +impl ResponseResult for ContactGroup {} + + /// A person's read-only membership in a group. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -720,56 +862,54 @@ pub struct Birthday { impl Part for Birthday {} -/// A person's physical address. May be a P.O. box or street address. All fields -/// are optional. +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete contact groups](struct.ContactGroupDeleteCall.html) (response) +/// * [delete contact people](struct.PeopleDeleteContactCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// A person's gender. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Address { - /// The read-only type of the address translated and formatted in the viewer's +pub struct Gender { + /// The read-only value of the gender translated and formatted in the viewer's /// account locale or the `Accept-Language` HTTP header locale. - #[serde(rename="formattedType")] - pub formatted_type: Option, - /// The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) country - /// code of the address. - #[serde(rename="countryCode")] - pub country_code: Option, - /// The city of the address. - pub city: Option, - /// The unstructured value of the address. If this is not set by the user it - /// will be automatically constructed from structured values. #[serde(rename="formattedValue")] pub formatted_value: Option, - /// The region of the address; for example, the state or province. - pub region: Option, - /// The P.O. box of the address. - #[serde(rename="poBox")] - pub po_box: Option, - /// The street address. - #[serde(rename="streetAddress")] - pub street_address: Option, - /// The country of the address. - pub country: Option, - /// The postal code of the address. - #[serde(rename="postalCode")] - pub postal_code: Option, - /// The extended address of the address; for example, the apartment number. - #[serde(rename="extendedAddress")] - pub extended_address: Option, - /// The type of the address. The type can be custom or predefined. - /// Possible values include, but are not limited to, the following: + /// The gender for the person. The gender can be custom or predefined. + /// Possible values include, but are not limited to, the + /// following: /// - /// * `home` - /// * `work` + /// * `male` + /// * `female` /// * `other` - #[serde(rename="type")] - pub type_: Option, - /// Metadata about the address. + /// * `unknown` + pub value: Option, + /// Metadata about the gender. pub metadata: Option, } -impl Part for Address {} +impl Part for Gender {} /// Represents a whole calendar date, for example a date of birth. The time @@ -797,42 +937,34 @@ pub struct Date { impl Part for Date {} -/// A person's relation to another person. +/// A person's email address. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Relation { - /// The name of the other person this relation refers to. - pub person: Option, - /// The type of the relation translated and formatted in the viewer's account - /// locale or the locale specified in the Accept-Language HTTP header. +pub struct EmailAddress { + /// The read-only type of the email address translated and formatted in the + /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, - /// The person's relation to the other person. The type can be custom or predefined. - /// Possible values include, but are not limited to, the following values: + /// The type of the email address. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: /// - /// * `spouse` - /// * `child` - /// * `mother` - /// * `father` - /// * `parent` - /// * `brother` - /// * `sister` - /// * `friend` - /// * `relative` - /// * `domesticPartner` - /// * `manager` - /// * `assistant` - /// * `referredBy` - /// * `partner` + /// * `home` + /// * `work` + /// * `other` #[serde(rename="type")] pub type_: Option, - /// Metadata about the relation. + /// The display name of the email. + #[serde(rename="displayName")] + pub display_name: Option, + /// The email address. + pub value: Option, + /// Metadata about the email address. pub metadata: Option, } -impl Part for Relation {} +impl Part for EmailAddress {} /// A person's nickname. @@ -853,6 +985,25 @@ pub struct Nickname { impl Part for Nickname {} +/// The response for a specific contact group. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContactGroupResponse { + /// The original requested resource name. + #[serde(rename="requestedResourceName")] + pub requested_resource_name: Option, + /// The contact group. + #[serde(rename="contactGroup")] + pub contact_group: Option, + /// The status of the response. + pub status: Option, +} + +impl Part for ContactGroupResponse {} + + /// The `Status` type defines a logical error model that is suitable for different /// programming environments, including REST APIs and RPC APIs. It is used by /// [gRPC](https://github.com/grpc). The error model is designed to be: @@ -916,8 +1067,8 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a - /// common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. pub details: Option>>, } @@ -1053,6 +1204,100 @@ pub struct Residence { impl Part for Residence {} +/// A person's physical address. May be a P.O. box or street address. All fields +/// are optional. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Address { + /// The read-only type of the address translated and formatted in the viewer's + /// account locale or the `Accept-Language` HTTP header locale. + #[serde(rename="formattedType")] + pub formatted_type: Option, + /// The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) country + /// code of the address. + #[serde(rename="countryCode")] + pub country_code: Option, + /// The city of the address. + pub city: Option, + /// The unstructured value of the address. If this is not set by the user it + /// will be automatically constructed from structured values. + #[serde(rename="formattedValue")] + pub formatted_value: Option, + /// The region of the address; for example, the state or province. + pub region: Option, + /// The P.O. box of the address. + #[serde(rename="poBox")] + pub po_box: Option, + /// The street address. + #[serde(rename="streetAddress")] + pub street_address: Option, + /// The country of the address. + pub country: Option, + /// The postal code of the address. + #[serde(rename="postalCode")] + pub postal_code: Option, + /// The extended address of the address; for example, the apartment number. + #[serde(rename="extendedAddress")] + pub extended_address: Option, + /// The type of the address. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `home` + /// * `work` + /// * `other` + #[serde(rename="type")] + pub type_: Option, + /// Metadata about the address. + pub metadata: Option, +} + +impl Part for Address {} + + +/// A request to modify an existing contact group's members. +/// +/// # 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*). +/// +/// * [members modify contact groups](struct.ContactGroupMemberModifyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModifyContactGroupMembersRequest { + /// The resource names of the contact people to remove in the form of in the + /// form of `people/`person_id. + #[serde(rename="resourceNamesToRemove")] + pub resource_names_to_remove: Option>, + /// The resource names of the contact people to add in the form of in the form + /// `people/`person_id. + #[serde(rename="resourceNamesToAdd")] + pub resource_names_to_add: Option>, +} + +impl RequestValue for ModifyContactGroupMembersRequest {} + + +/// The response to a batch get contact groups request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch get contact groups](struct.ContactGroupBatchGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchGetContactGroupsResponse { + /// The list of responses for each requested contact group resource. + pub responses: Option>, +} + +impl ResponseResult for BatchGetContactGroupsResponse {} + + /// Information about a person merged from various data sources such as the /// authenticated user's contacts and profile data. /// @@ -1065,12 +1310,16 @@ impl Part for Residence {} /// 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 contact people](struct.PeopleUpdateContactCall.html) (request|response) +/// * [create contact people](struct.PeopleCreateContactCall.html) (request|response) /// * [get people](struct.PeopleGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Person { /// The person's interests. pub interests: Option>, + /// The person's read-only taglines. + pub taglines: Option>, /// The person's bragging rights. #[serde(rename="braggingRights")] pub bragging_rights: Option>, @@ -1083,41 +1332,45 @@ pub struct Person { /// The person's phone numbers. #[serde(rename="phoneNumbers")] pub phone_numbers: Option>, - /// The person's photos. + /// The person's read-only photos. pub photos: Option>, /// The person's names. pub names: Option>, - /// DEPRECATED(Please read person.age_ranges instead). The person's age range. + /// **DEPRECATED** (Please use `person.ageRanges` instead)** + /// + /// The person's read-only age range. #[serde(rename="ageRange")] pub age_range: Option, /// The person's residences. pub residences: Option>, /// The resource name for the person, assigned by the server. An ASCII string - /// with a max length of 27 characters, in the form of `people/`. + /// with a max length of 27 characters, in the form of + /// `people/`person_id. #[serde(rename="resourceName")] pub resource_name: Option, - /// The kind of relationship the person is looking for. + /// The person's read-only relationship interests. #[serde(rename="relationshipInterests")] pub relationship_interests: Option>, - /// The person's cover photos. + /// The person's read-only cover photos. #[serde(rename="coverPhotos")] pub cover_photos: Option>, /// The person's locale preferences. pub locales: Option>, /// The person's past or current organizations. pub organizations: Option>, - /// The person's taglines. - pub taglines: Option>, + /// The person's user defined data. + #[serde(rename="userDefined")] + pub user_defined: Option>, /// The person's skills. pub skills: Option>, - /// The person's age ranges. + /// The person's read-only age ranges. #[serde(rename="ageRanges")] pub age_ranges: Option>, /// The person's birthdays. pub birthdays: Option>, /// The person's relations. pub relations: Option>, - /// The person's group memberships. + /// The person's read-only group memberships. pub memberships: Option>, /// The person's biographies. pub biographies: Option>, @@ -1126,7 +1379,7 @@ pub struct Person { pub etag: Option, /// The person's associated URLs. pub urls: Option>, - /// The person's relationship statuses. + /// The person's read-only relationship statuses. #[serde(rename="relationshipStatuses")] pub relationship_statuses: Option>, /// The person's genders. @@ -1139,37 +1392,30 @@ pub struct Person { pub im_clients: Option>, /// The person's events. pub events: Option>, - /// Metadata about the person. + /// Read-only metadata about the person. pub metadata: Option, } +impl RequestValue for Person {} impl ResponseResult for Person {} -/// A person's gender. +/// The read-only metadata about a contact group. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Gender { - /// The read-only value of the gender translated and formatted in the viewer's - /// account locale or the `Accept-Language` HTTP header locale. - #[serde(rename="formattedValue")] - pub formatted_value: Option, - /// The gender for the person. The gender can be custom or predefined. - /// Possible values include, but are not limited to, the - /// following: - /// - /// * `male` - /// * `female` - /// * `other` - /// * `unknown` - pub value: Option, - /// Metadata about the gender. - pub metadata: Option, +pub struct ContactGroupMetadata { + /// True if the contact group resource has been deleted. Populated only for + /// [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) requests + /// that include a sync token. + pub deleted: Option, + /// The time the group was last updated. + #[serde(rename="updateTime")] + pub update_time: Option, } -impl Part for Gender {} +impl Part for ContactGroupMetadata {} /// A person's phone number. @@ -1179,11 +1425,13 @@ impl Part for Gender {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PhoneNumber { /// The read-only type of the phone number translated and formatted in the - /// viewer's account locale or the the `Accept-Language` HTTP header locale. + /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, - /// Metadata about the phone number. - pub metadata: Option, + /// The read-only canonicalized [ITU-T E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) + /// form of the phone number. + #[serde(rename="canonicalForm")] + pub canonical_form: Option, /// The type of the phone number. The type can be custom or predefined. /// Possible values include, but are not limited to, the following: /// @@ -1203,10 +1451,8 @@ pub struct PhoneNumber { pub type_: Option, /// The phone number. pub value: Option, - /// The read-only canonicalized [ITU-T E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) - /// form of the phone number. - #[serde(rename="canonicalForm")] - pub canonical_form: Option, + /// Metadata about the phone number. + pub metadata: Option, } impl Part for PhoneNumber {} @@ -1219,10 +1465,9 @@ impl Part for PhoneNumber {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Organization { - /// The read-only type of the organization translated and formatted in the - /// viewer's account locale or the `Accept-Language` HTTP header locale. - #[serde(rename="formattedType")] - pub formatted_type: Option, + /// The start date when the person joined the organization. + #[serde(rename="startDate")] + pub start_date: Option, /// The domain name associated with the organization; for example, `google.com`. pub domain: Option, /// The end date when the person left the organization. @@ -1230,18 +1475,15 @@ pub struct Organization { pub end_date: Option, /// The name of the organization. pub name: Option, - /// The person's job title at the organization. - pub title: Option, - /// The type of the organization. The type can be custom or predefined. - /// Possible values include, but are not limited to, the following: - /// - /// * `work` - /// * `school` - #[serde(rename="type")] - pub type_: Option, + /// The read-only type of the organization translated and formatted in the + /// viewer's account locale or the `Accept-Language` HTTP header locale. + #[serde(rename="formattedType")] + pub formatted_type: Option, /// The symbol associated with the organization; for example, a stock ticker /// symbol, abbreviation, or acronym. pub symbol: Option, + /// The person's job title at the organization. + pub title: Option, /// True if the organization is the person's current organization; /// false if the organization is a past organization. pub current: Option, @@ -1252,9 +1494,13 @@ pub struct Organization { pub location: Option, /// The person's department at the organization. pub department: Option, - /// The start date when the person joined the organization. - #[serde(rename="startDate")] - pub start_date: Option, + /// The type of the organization. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `work` + /// * `school` + #[serde(rename="type")] + pub type_: Option, /// The phonetic name of the organization. #[serde(rename="phoneticName")] pub phonetic_name: Option, @@ -1265,6 +1511,25 @@ pub struct Organization { impl Part for Organization {} +/// A request to create a new contact group. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create contact groups](struct.ContactGroupCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateContactGroupRequest { + /// The contact group to create. + #[serde(rename="contactGroup")] + pub contact_group: Option, +} + +impl RequestValue for CreateContactGroupRequest {} + + /// A person's locale preference. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1288,8 +1553,13 @@ impl Part for Locale {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Photo { - /// The URL of the photo. + /// The URL of the photo. You can change the desired size by appending a query + /// parameter `sz=`size at the end of the url. Example: + /// `https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50` pub url: Option, + /// True if the photo is a default photo; + /// false if the photo is a user-provided photo. + pub default: Option, /// Metadata about the photo. pub metadata: Option, } @@ -1321,7 +1591,9 @@ pub struct PersonMetadata { /// [`connections.list`](/people/api/rest/v1/people.connections/list) requests /// that include a sync token. pub deleted: Option, - /// DEPRECATED(Please read person.metadata.sources.profile_metadata instead). + /// **DEPRECATED** (Please use + /// `person.metadata.sources.profileMetadata.objectType` instead) + /// /// The type of the person object. #[serde(rename="objectType")] pub object_type: Option, @@ -1330,34 +1602,61 @@ pub struct PersonMetadata { impl Part for PersonMetadata {} -/// A person's email address. +/// The response to a modify contact group members request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [members modify contact groups](struct.ContactGroupMemberModifyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModifyContactGroupMembersResponse { + /// The contact people resource names that were not found. + #[serde(rename="notFoundResourceNames")] + pub not_found_resource_names: Option>, +} + +impl ResponseResult for ModifyContactGroupMembersResponse {} + + +/// A person's relation to another person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EmailAddress { - /// The read-only type of the email address translated and formatted in the - /// viewer's account locale or the `Accept-Language` HTTP header locale. - #[serde(rename="formattedType")] - pub formatted_type: Option, - /// The type of the email address. The type can be custom or predefined. - /// Possible values include, but are not limited to, the following: +pub struct Relation { + /// The name of the other person this relation refers to. + pub person: Option, + /// Metadata about the relation. + pub metadata: Option, + /// The person's relation to the other person. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following values: /// - /// * `home` - /// * `work` - /// * `other` + /// * `spouse` + /// * `child` + /// * `mother` + /// * `father` + /// * `parent` + /// * `brother` + /// * `sister` + /// * `friend` + /// * `relative` + /// * `domesticPartner` + /// * `manager` + /// * `assistant` + /// * `referredBy` + /// * `partner` #[serde(rename="type")] pub type_: Option, - /// The display name of the email. - #[serde(rename="displayName")] - pub display_name: Option, - /// The email address. - pub value: Option, - /// Metadata about the email address. - pub metadata: Option, + /// The type of the relation translated and formatted in the viewer's account + /// locale or the locale specified in the Accept-Language HTTP header. + #[serde(rename="formattedType")] + pub formatted_type: Option, } -impl Part for EmailAddress {} +impl Part for Relation {} /// A skill that the person has. @@ -1375,19 +1674,21 @@ pub struct Skill { impl Part for Skill {} -/// A person's occupation. +/// The read-only metadata about a profile. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Occupation { - /// The occupation; for example, `carpenter`. - pub value: Option, - /// Metadata about the occupation. - pub metadata: Option, +pub struct ProfileMetadata { + /// The user types. + #[serde(rename="userTypes")] + pub user_types: Option>, + /// The profile object type. + #[serde(rename="objectType")] + pub object_type: Option, } -impl Part for Occupation {} +impl Part for ProfileMetadata {} /// A Google Apps Domain membership. @@ -1448,18 +1749,19 @@ pub struct Biography { impl Part for Biography {} -/// The read-only metadata about a profile. +/// A person's occupation. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProfileMetadata { - /// The profile object type. - #[serde(rename="objectType")] - pub object_type: Option, +pub struct Occupation { + /// The occupation; for example, `carpenter`. + pub value: Option, + /// Metadata about the occupation. + pub metadata: Option, } -impl Part for ProfileMetadata {} +impl Part for Occupation {} @@ -1467,6 +1769,174 @@ impl Part for ProfileMetadata {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *contactGroup* resources. +/// It is not used directly, but through the `PeopleService` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_people1 as people1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use people1::PeopleService; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `batch_get(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `members_modify(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.contact_groups(); +/// # } +/// ``` +pub struct ContactGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, +} + +impl<'a, C, A> MethodsBuilder for ContactGroupMethods<'a, C, A> {} + +impl<'a, C, A> ContactGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Get a list of contact groups owned by the authenticated user by specifying + /// a list of contact group resource names. + pub fn batch_get(&self) -> ContactGroupBatchGetCall<'a, C, A> { + ContactGroupBatchGetCall { + hub: self.hub, + _resource_names: Default::default(), + _max_members: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List all contact groups owned by the authenticated user. Members of the + /// contact groups are not populated. + pub fn list(&self) -> ContactGroupListCall<'a, C, A> { + ContactGroupListCall { + hub: self.hub, + _sync_token: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new contact group owned by the authenticated user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: CreateContactGroupRequest) -> ContactGroupCreateCall<'a, C, A> { + ContactGroupCreateCall { + 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: + /// + /// Update the name of an existing contact group owned by the authenticated + /// user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resourceName` - The resource name for the contact group, assigned by the server. An ASCII + /// string, in the form of `contactGroups/`contact_group_id. + pub fn update(&self, request: UpdateContactGroupRequest, resource_name: &str) -> ContactGroupUpdateCall<'a, C, A> { + ContactGroupUpdateCall { + hub: self.hub, + _request: request, + _resource_name: resource_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete an existing contact group owned by the authenticated user by + /// specifying a contact group resource name. + /// + /// # Arguments + /// + /// * `resourceName` - The resource name of the contact group to delete. + pub fn delete(&self, resource_name: &str) -> ContactGroupDeleteCall<'a, C, A> { + ContactGroupDeleteCall { + hub: self.hub, + _resource_name: resource_name.to_string(), + _delete_contacts: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Modify the members of a contact group owned by the authenticated user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resourceName` - The resource name of the contact group to modify. + pub fn members_modify(&self, request: ModifyContactGroupMembersRequest, resource_name: &str) -> ContactGroupMemberModifyCall<'a, C, A> { + ContactGroupMemberModifyCall { + hub: self.hub, + _request: request, + _resource_name: resource_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get a specific contact group owned by the authenticated user by specifying + /// a contact group resource name. + /// + /// # Arguments + /// + /// * `resourceName` - The resource name of the contact group to get. + pub fn get(&self, resource_name: &str) -> ContactGroupGetCall<'a, C, A> { + ContactGroupGetCall { + hub: self.hub, + _resource_name: resource_name.to_string(), + _max_members: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *people* resources. /// It is not used directly, but through the `PeopleService` hub. /// @@ -1491,7 +1961,7 @@ impl Part for ProfileMetadata {} /// ::default(), None); /// let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `connections_list(...)`, `get(...)` and `get_batch_get(...)` +/// // like `connections_list(...)`, `create_contact(...)`, `delete_contact(...)`, `get(...)`, `get_batch_get(...)` and `update_contact(...)` /// // to build up your call. /// let rb = hub.people(); /// # } @@ -1506,33 +1976,12 @@ impl<'a, C, A> MethodsBuilder for PeopleMethods<'a, C, A> {} impl<'a, C, A> PeopleMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Provides information about a person for a resource name. Use - /// `people/me` to indicate the authenticated user. - /// - /// # Arguments - /// - /// * `resourceName` - The resource name of the person to provide information about. - /// - To get information about the authenticated user, specify `people/me`. - /// - To get information about any user, specify the resource name that - /// identifies the user, such as the resource names returned by - /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). - pub fn get(&self, resource_name: &str) -> PeopleGetCall<'a, C, A> { - PeopleGetCall { - hub: self.hub, - _resource_name: resource_name.to_string(), - _request_mask_include_field: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Provides a list of the authenticated user's contacts merged with any - /// linked profiles. + /// connected profiles. + ///
+ /// The request throws a 400 error if 'personFields' is not specified. /// /// # Arguments /// @@ -1545,6 +1994,7 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { _sort_order: Default::default(), _request_sync_token: Default::default(), _request_mask_include_field: Default::default(), + _person_fields: Default::default(), _page_token: Default::default(), _page_size: Default::default(), _delegate: Default::default(), @@ -1553,16 +2003,115 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Create a new contact and return the person resource for that contact. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create_contact(&self, request: Person) -> PeopleCreateContactCall<'a, C, A> { + PeopleCreateContactCall { + hub: self.hub, + _request: request, + _parent: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a contact person. Any non-contact data will not be deleted. + /// + /// # Arguments + /// + /// * `resourceName` - The resource name of the contact to delete. + pub fn delete_contact(&self, resource_name: &str) -> PeopleDeleteContactCall<'a, C, A> { + PeopleDeleteContactCall { + hub: self.hub, + _resource_name: resource_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Provides information about a person by specifying a resource name. Use + /// `people/me` to indicate the authenticated user. + ///
+ /// The request throws a 400 error if 'personFields' is not specified. + /// + /// # Arguments + /// + /// * `resourceName` - The resource name of the person to provide information about. + /// - To get information about the authenticated user, specify `people/me`. + /// - To get information about a google account, specify + /// `people/`account_id. + /// - To get information about a contact, specify the resource name that + /// identifies the contact as returned by + /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). + pub fn get(&self, resource_name: &str) -> PeopleGetCall<'a, C, A> { + PeopleGetCall { + hub: self.hub, + _resource_name: resource_name.to_string(), + _request_mask_include_field: Default::default(), + _person_fields: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update contact data for an existing contact person. Any non-contact data + /// will not be modified. + /// + /// The request throws a 400 error if `updatePersonFields` is not specified. + ///
+ /// The request throws a 400 error if `person.metadata.sources` is not + /// specified for the contact to be updated. + ///
+ /// The request throws a 412 error if `person.metadata.sources.etag` is + /// different than the contact's etag, which indicates the contact has changed + /// since its data was read. Clients should get the latest person and re-apply + /// their updates to the latest person. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resourceName` - The resource name for the person, assigned by the server. An ASCII string + /// with a max length of 27 characters, in the form of + /// `people/`person_id. + pub fn update_contact(&self, request: Person, resource_name: &str) -> PeopleUpdateContactCall<'a, C, A> { + PeopleUpdateContactCall { + hub: self.hub, + _request: request, + _resource_name: resource_name.to_string(), + _update_person_fields: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Provides information about a list of specific people by specifying a list /// of requested resource names. Use `people/me` to indicate the authenticated /// user. + ///
+ /// The request throws a 400 error if 'personFields' is not specified. pub fn get_batch_get(&self) -> PeopleGetBatchGetCall<'a, C, A> { PeopleGetBatchGetCall { hub: self.hub, _resource_names: Default::default(), _request_mask_include_field: Default::default(), + _person_fields: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1578,11 +2127,11 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { // CallBuilders ### // ################# -/// Provides information about a person for a resource name. Use -/// `people/me` to indicate the authenticated user. +/// Get a list of contact groups owned by the authenticated user by specifying +/// a list of contact group resource names. /// -/// A builder for the *get* method supported by a *people* resource. -/// It is not used directly, but through a `PeopleMethods` instance. +/// A builder for the *batchGet* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. /// /// # Example /// @@ -1606,29 +2155,781 @@ impl<'a, C, A> PeopleMethods<'a, C, 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.people().get("resourceName") -/// .request_mask_include_field("accusam") +/// let result = hub.contact_groups().batch_get() +/// .add_resource_names("justo") +/// .max_members(-1) /// .doit(); /// # } /// ``` -pub struct PeopleGetCall<'a, C, A> +pub struct ContactGroupBatchGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a PeopleService, - _resource_name: String, - _request_mask_include_field: Option, + _resource_names: Vec, + _max_members: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for PeopleGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ContactGroupBatchGetCall<'a, C, A> {} -impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ContactGroupBatchGetCall<'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, Person)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchGetContactGroupsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.contactGroups.batchGet", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if self._resource_names.len() > 0 { + for f in self._resource_names.iter() { + params.push(("resourceNames", f.to_string())); + } + } + if let Some(value) = self._max_members { + params.push(("maxMembers", value.to_string())); + } + for &field in ["alt", "resourceNames", "maxMembers"].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 = self.hub._base_url.clone() + "v1/contactGroups:batchGet"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ContactReadonly.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(Bearer { 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(d); + 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(d); + 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 resource names of the contact groups to get. + /// + /// Append the given value to the *resource names* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_resource_names(mut self, new_value: &str) -> ContactGroupBatchGetCall<'a, C, A> { + self._resource_names.push(new_value.to_string()); + self + } + /// Specifies the maximum number of members to return for each group. + /// + /// Sets the *max members* query property to the given value. + pub fn max_members(mut self, new_value: i32) -> ContactGroupBatchGetCall<'a, C, A> { + self._max_members = 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) -> ContactGroupBatchGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContactGroupBatchGetCall<'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::ContactReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContactGroupBatchGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List all contact groups owned by the authenticated user. Members of the +/// contact groups are not populated. +/// +/// A builder for the *list* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.contact_groups().list() +/// .sync_token("erat") +/// .page_token("labore") +/// .page_size(-9) +/// .doit(); +/// # } +/// ``` +pub struct ContactGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _sync_token: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContactGroupListCall<'a, C, A> {} + +impl<'a, C, A> ContactGroupListCall<'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, ListContactGroupsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.contactGroups.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._sync_token { + params.push(("syncToken", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "syncToken", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/contactGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ContactReadonly.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(Bearer { 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(d); + 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(d); + 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 sync token, returned by a previous call to `contactgroups.list`. + /// Only resources changed since the sync token was created will be returned. + /// + /// Sets the *sync token* query property to the given value. + pub fn sync_token(mut self, new_value: &str) -> ContactGroupListCall<'a, C, A> { + self._sync_token = Some(new_value.to_string()); + self + } + /// The next_page_token value returned from a previous call to + /// [ListContactGroups](/people/api/rest/v1/contactgroups/list). + /// Requests the next page of resources. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ContactGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of resources to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ContactGroupListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ContactGroupListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContactGroupListCall<'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::ContactReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContactGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new contact group owned by the authenticated user. +/// +/// A builder for the *create* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// use people1::CreateContactGroupRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateContactGroupRequest::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.contact_groups().create(req) +/// .doit(); +/// # } +/// ``` +pub struct ContactGroupCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _request: CreateContactGroupRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContactGroupCreateCall<'a, C, A> {} + +impl<'a, C, A> ContactGroupCreateCall<'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, ContactGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.contactGroups.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 = self.hub._base_url.clone() + "v1/contactGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateContactGroupRequest) -> ContactGroupCreateCall<'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) -> ContactGroupCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContactGroupCreateCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContactGroupCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update the name of an existing contact group owned by the authenticated +/// user. +/// +/// A builder for the *update* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// use people1::UpdateContactGroupRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateContactGroupRequest::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.contact_groups().update(req, "resourceName") +/// .doit(); +/// # } +/// ``` +pub struct ContactGroupUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _request: UpdateContactGroupRequest, + _resource_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContactGroupUpdateCall<'a, C, A> {} + +impl<'a, C, A> ContactGroupUpdateCall<'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, ContactGroup)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -1637,14 +2938,845 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "people.people.get", + dlg.begin(MethodInfo { id: "people.contactGroups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resourceName", self._resource_name.to_string())); + for &field in ["alt", "resourceName"].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 = self.hub._base_url.clone() + "v1/{+resourceName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UpdateContactGroupRequest) -> ContactGroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name for the contact group, assigned by the server. An ASCII + /// string, in the form of `contactGroups/`contact_group_id. + /// + /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> ContactGroupUpdateCall<'a, C, A> { + self._resource_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) -> ContactGroupUpdateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContactGroupUpdateCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContactGroupUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete an existing contact group owned by the authenticated user by +/// specifying a contact group resource name. +/// +/// A builder for the *delete* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.contact_groups().delete("resourceName") +/// .delete_contacts(false) +/// .doit(); +/// # } +/// ``` +pub struct ContactGroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _resource_name: String, + _delete_contacts: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContactGroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> ContactGroupDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.contactGroups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resourceName", self._resource_name.to_string())); + if let Some(value) = self._delete_contacts { + params.push(("deleteContacts", value.to_string())); + } + for &field in ["alt", "resourceName", "deleteContacts"].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 = self.hub._base_url.clone() + "v1/{+resourceName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].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(Bearer { 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(d); + 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(d); + 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 resource name of the contact group to delete. + /// + /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> ContactGroupDeleteCall<'a, C, A> { + self._resource_name = new_value.to_string(); + self + } + /// Set to true to also delete the contacts in the specified group. + /// + /// Sets the *delete contacts* query property to the given value. + pub fn delete_contacts(mut self, new_value: bool) -> ContactGroupDeleteCall<'a, C, A> { + self._delete_contacts = 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) -> ContactGroupDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContactGroupDeleteCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContactGroupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Modify the members of a contact group owned by the authenticated user. +/// +/// A builder for the *members.modify* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// use people1::ModifyContactGroupMembersRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ModifyContactGroupMembersRequest::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.contact_groups().members_modify(req, "resourceName") +/// .doit(); +/// # } +/// ``` +pub struct ContactGroupMemberModifyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _request: ModifyContactGroupMembersRequest, + _resource_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContactGroupMemberModifyCall<'a, C, A> {} + +impl<'a, C, A> ContactGroupMemberModifyCall<'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, ModifyContactGroupMembersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.contactGroups.members.modify", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resourceName", self._resource_name.to_string())); + for &field in ["alt", "resourceName"].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 = self.hub._base_url.clone() + "v1/{+resourceName}/members:modify"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ModifyContactGroupMembersRequest) -> ContactGroupMemberModifyCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the contact group to modify. + /// + /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> ContactGroupMemberModifyCall<'a, C, A> { + self._resource_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) -> ContactGroupMemberModifyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ContactGroupMemberModifyCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ContactGroupMemberModifyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get a specific contact group owned by the authenticated user by specifying +/// a contact group resource name. +/// +/// A builder for the *get* method supported by a *contactGroup* resource. +/// It is not used directly, but through a `ContactGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.contact_groups().get("resourceName") +/// .max_members(-66) +/// .doit(); +/// # } +/// ``` +pub struct ContactGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _resource_name: String, + _max_members: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ContactGroupGetCall<'a, C, A> {} + +impl<'a, C, A> ContactGroupGetCall<'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, ContactGroup)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.contactGroups.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("resourceName", self._resource_name.to_string())); - if let Some(value) = self._request_mask_include_field { - params.push(("requestMask.includeField", value.to_string())); + if let Some(value) = self._max_members { + params.push(("maxMembers", value.to_string())); } - for &field in ["alt", "resourceName", "requestMask.includeField"].iter() { + for &field in ["alt", "resourceName", "maxMembers"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1762,31 +3894,21 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// The resource name of the person to provide information about. - /// - /// - To get information about the authenticated user, specify `people/me`. - /// - To get information about any user, specify the resource name that - /// identifies the user, such as the resource names returned by - /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). + /// The resource name of the contact group to get. /// /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { + pub fn resource_name(mut self, new_value: &str) -> ContactGroupGetCall<'a, C, A> { self._resource_name = new_value.to_string(); self } - /// Comma-separated list of fields to be included in the response. Omitting - /// this field will include all fields except for connections.list requests, - /// which have a default mask that includes common fields like metadata, name, - /// photo, and profile url. - /// Each path should start with `person.`: for example, `person.names` or - /// `person.photos`. + /// Specifies the maximum number of members to return. /// - /// Sets the *request mask.include field* query property to the given value. - pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { - self._request_mask_include_field = Some(new_value.to_string()); + /// Sets the *max members* query property to the given value. + pub fn max_members(mut self, new_value: i32) -> ContactGroupGetCall<'a, C, A> { + self._max_members = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -1795,7 +3917,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// 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) -> PeopleGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ContactGroupGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1814,15 +3936,15 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> PeopleGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ContactGroupGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1842,7 +3964,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// 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) -> PeopleGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ContactGroupGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -1855,7 +3977,9 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// Provides a list of the authenticated user's contacts merged with any -/// linked profiles. +/// connected profiles. +///
+/// The request throws a 400 error if 'personFields' is not specified. /// /// A builder for the *connections.list* method supported by a *people* resource. /// It is not used directly, but through a `PeopleMethods` instance. @@ -1884,11 +4008,12 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// // Values shown here are possibly random and not representative ! /// let result = hub.people().connections_list("resourceName") /// .sync_token("justo") -/// .sort_order("amet.") -/// .request_sync_token(false) -/// .request_mask_include_field("labore") -/// .page_token("sea") -/// .page_size(-90) +/// .sort_order("justo") +/// .request_sync_token(true) +/// .request_mask_include_field("et") +/// .person_fields("diam") +/// .page_token("ipsum") +/// .page_size(-5) /// .doit(); /// # } /// ``` @@ -1901,6 +4026,7 @@ pub struct PeopleConnectionListCall<'a, C, A> _sort_order: Option, _request_sync_token: Option, _request_mask_include_field: Option, + _person_fields: Option, _page_token: Option, _page_size: Option, _delegate: Option<&'a mut Delegate>, @@ -1925,7 +4051,7 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); params.push(("resourceName", self._resource_name.to_string())); if let Some(value) = self._sync_token { params.push(("syncToken", value.to_string())); @@ -1939,13 +4065,16 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> { self._request_mask_include_field = Some(new_value.to_string()); self } + /// **Required.** A field mask to restrict which fields on each person are + /// returned. Valid values are: + /// + /// * addresses + /// * ageRanges + /// * biographies + /// * birthdays + /// * braggingRights + /// * coverPhotos + /// * emailAddresses + /// * events + /// * genders + /// * imClients + /// * interests + /// * locales + /// * memberships + /// * metadata + /// * names + /// * nicknames + /// * occupations + /// * organizations + /// * phoneNumbers + /// * photos + /// * relations + /// * relationshipInterests + /// * relationshipStatuses + /// * residences + /// * skills + /// * taglines + /// * urls + /// + /// Sets the *person fields* query property to the given value. + pub fn person_fields(mut self, new_value: &str) -> PeopleConnectionListCall<'a, C, A> { + self._person_fields = Some(new_value.to_string()); + self + } /// The token of the page to be returned. /// /// Sets the *page token* query property to the given value. @@ -2149,12 +4311,12 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PeopleConnectionListCall<'a, C, A> @@ -2189,9 +4351,1171 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Person::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.people().create_contact(req) +/// .parent("et") +/// .doit(); +/// # } +/// ``` +pub struct PeopleCreateContactCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _request: Person, + _parent: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PeopleCreateContactCall<'a, C, A> {} + +impl<'a, C, A> PeopleCreateContactCall<'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, Person)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.people.createContact", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._parent { + params.push(("parent", value.to_string())); + } + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/people:createContact"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Person) -> PeopleCreateContactCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the owning person resource. + /// + /// Sets the *parent* query property to the given value. + pub fn parent(mut self, new_value: &str) -> PeopleCreateContactCall<'a, C, A> { + self._parent = 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) -> PeopleCreateContactCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PeopleCreateContactCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PeopleCreateContactCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a contact person. Any non-contact data will not be deleted. +/// +/// A builder for the *deleteContact* method supported by a *people* resource. +/// It is not used directly, but through a `PeopleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.people().delete_contact("resourceName") +/// .doit(); +/// # } +/// ``` +pub struct PeopleDeleteContactCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _resource_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PeopleDeleteContactCall<'a, C, A> {} + +impl<'a, C, A> PeopleDeleteContactCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.people.deleteContact", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("resourceName", self._resource_name.to_string())); + for &field in ["alt", "resourceName"].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 = self.hub._base_url.clone() + "v1/{+resourceName}:deleteContact"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].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(Bearer { 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(d); + 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(d); + 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 resource name of the contact to delete. + /// + /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> PeopleDeleteContactCall<'a, C, A> { + self._resource_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) -> PeopleDeleteContactCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PeopleDeleteContactCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PeopleDeleteContactCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Provides information about a person by specifying a resource name. Use +/// `people/me` to indicate the authenticated user. +///
+/// The request throws a 400 error if 'personFields' is not specified. +/// +/// A builder for the *get* method supported by a *people* resource. +/// It is not used directly, but through a `PeopleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.people().get("resourceName") +/// .request_mask_include_field("sea") +/// .person_fields("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct PeopleGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _resource_name: String, + _request_mask_include_field: Option, + _person_fields: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PeopleGetCall<'a, C, A> {} + +impl<'a, C, A> PeopleGetCall<'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, Person)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.people.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("resourceName", self._resource_name.to_string())); + if let Some(value) = self._request_mask_include_field { + params.push(("requestMask.includeField", value.to_string())); + } + if let Some(value) = self._person_fields { + params.push(("personFields", value.to_string())); + } + for &field in ["alt", "resourceName", "requestMask.includeField", "personFields"].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 = self.hub._base_url.clone() + "v1/{+resourceName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ContactReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].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(Bearer { 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(d); + 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(d); + 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 resource name of the person to provide information about. + /// + /// - To get information about the authenticated user, specify `people/me`. + /// - To get information about a google account, specify + /// `people/`account_id. + /// - To get information about a contact, specify the resource name that + /// identifies the contact as returned by + /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). + /// + /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { + self._resource_name = new_value.to_string(); + self + } + /// **Required.** Comma-separated list of person fields to be included in the + /// response. Each path should start with `person.`: for example, + /// `person.names` or `person.photos`. + /// + /// Sets the *request mask.include field* query property to the given value. + pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { + self._request_mask_include_field = Some(new_value.to_string()); + self + } + /// **Required.** A field mask to restrict which fields on the person are + /// returned. Valid values are: + /// + /// * addresses + /// * ageRanges + /// * biographies + /// * birthdays + /// * braggingRights + /// * coverPhotos + /// * emailAddresses + /// * events + /// * genders + /// * imClients + /// * interests + /// * locales + /// * memberships + /// * metadata + /// * names + /// * nicknames + /// * occupations + /// * organizations + /// * phoneNumbers + /// * photos + /// * relations + /// * relationshipInterests + /// * relationshipStatuses + /// * residences + /// * skills + /// * taglines + /// * urls + /// + /// Sets the *person fields* query property to the given value. + pub fn person_fields(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { + self._person_fields = 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) -> PeopleGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PeopleGetCall<'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::ContactReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PeopleGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update contact data for an existing contact person. Any non-contact data +/// will not be modified. +/// +/// The request throws a 400 error if `updatePersonFields` is not specified. +///
+/// The request throws a 400 error if `person.metadata.sources` is not +/// specified for the contact to be updated. +///
+/// The request throws a 412 error if `person.metadata.sources.etag` is +/// different than the contact's etag, which indicates the contact has changed +/// since its data was read. Clients should get the latest person and re-apply +/// their updates to the latest person. +/// +/// A builder for the *updateContact* method supported by a *people* resource. +/// It is not used directly, but through a `PeopleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// use people1::Person; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Person::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.people().update_contact(req, "resourceName") +/// .update_person_fields("erat") +/// .doit(); +/// # } +/// ``` +pub struct PeopleUpdateContactCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _request: Person, + _resource_name: String, + _update_person_fields: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PeopleUpdateContactCall<'a, C, A> {} + +impl<'a, C, A> PeopleUpdateContactCall<'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, Person)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.people.updateContact", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("resourceName", self._resource_name.to_string())); + if let Some(value) = self._update_person_fields { + params.push(("updatePersonFields", value.to_string())); + } + for &field in ["alt", "resourceName", "updatePersonFields"].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 = self.hub._base_url.clone() + "v1/{+resourceName}:updateContact"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Person) -> PeopleUpdateContactCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name for the person, assigned by the server. An ASCII string + /// with a max length of 27 characters, in the form of + /// `people/`person_id. + /// + /// Sets the *resource 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 resource_name(mut self, new_value: &str) -> PeopleUpdateContactCall<'a, C, A> { + self._resource_name = new_value.to_string(); + self + } + /// **Required.** A field mask to restrict which fields on the person are + /// updated. Valid values are: + /// + /// * addresses + /// * biographies + /// * birthdays + /// * braggingRights + /// * emailAddresses + /// * events + /// * genders + /// * imClients + /// * interests + /// * locales + /// * names + /// * nicknames + /// * occupations + /// * organizations + /// * phoneNumbers + /// * relations + /// * residences + /// * skills + /// * urls + /// + /// Sets the *update person fields* query property to the given value. + pub fn update_person_fields(mut self, new_value: &str) -> PeopleUpdateContactCall<'a, C, A> { + self._update_person_fields = 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) -> PeopleUpdateContactCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PeopleUpdateContactCall<'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::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PeopleUpdateContactCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Provides information about a list of specific people by specifying a list /// of requested resource names. Use `people/me` to indicate the authenticated /// user. +///
+/// The request throws a 400 error if 'personFields' is not specified. /// /// A builder for the *getBatchGet* method supported by a *people* resource. /// It is not used directly, but through a `PeopleMethods` instance. @@ -2219,8 +5543,9 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut hub: &'a PeopleService, _resource_names: Vec, _request_mask_include_field: Option, + _person_fields: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -2251,7 +5577,7 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut }; dlg.begin(MethodInfo { id: "people.people.getBatchGet", http_method: hyper::method::Method::Get }); - 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())); if self._resource_names.len() > 0 { for f in self._resource_names.iter() { params.push(("resourceNames", f.to_string())); @@ -2260,7 +5586,10 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut if let Some(value) = self._request_mask_include_field { params.push(("requestMask.includeField", value.to_string())); } - for &field in ["alt", "resourceNames", "requestMask.includeField"].iter() { + if let Some(value) = self._person_fields { + params.push(("personFields", value.to_string())); + } + for &field in ["alt", "resourceNames", "requestMask.includeField", "personFields"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2354,10 +5683,16 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut } - /// The resource name, such as one returned by - /// [`people.connections.list`](/people/api/rest/v1/people.connections/list), - /// of one of the people to provide information about. You can include this - /// parameter up to 50 times in one request. + /// The resource names of the people to provide information about. + /// + /// - To get information about the authenticated user, specify `people/me`. + /// - To get information about a google account, specify + /// `people/`account_id. + /// - To get information about a contact, specify the resource name that + /// identifies the contact as returned by + /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). + /// + /// You can include up to 50 resource names in one request. /// /// Append the given value to the *resource names* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -2365,18 +5700,51 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut self._resource_names.push(new_value.to_string()); self } - /// Comma-separated list of fields to be included in the response. Omitting - /// this field will include all fields except for connections.list requests, - /// which have a default mask that includes common fields like metadata, name, - /// photo, and profile url. - /// Each path should start with `person.`: for example, `person.names` or - /// `person.photos`. + /// **Required.** Comma-separated list of person fields to be included in the + /// response. Each path should start with `person.`: for example, + /// `person.names` or `person.photos`. /// /// Sets the *request mask.include field* query property to the given value. pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetBatchGetCall<'a, C, A> { self._request_mask_include_field = Some(new_value.to_string()); self } + /// **Required.** A field mask to restrict which fields on each person are + /// returned. Valid values are: + /// + /// * addresses + /// * ageRanges + /// * biographies + /// * birthdays + /// * braggingRights + /// * coverPhotos + /// * emailAddresses + /// * events + /// * genders + /// * imClients + /// * interests + /// * locales + /// * memberships + /// * metadata + /// * names + /// * nicknames + /// * occupations + /// * organizations + /// * phoneNumbers + /// * photos + /// * relations + /// * relationshipInterests + /// * relationshipStatuses + /// * residences + /// * skills + /// * taglines + /// * urls + /// + /// Sets the *person fields* query property to the given value. + pub fn person_fields(mut self, new_value: &str) -> PeopleGetBatchGetCall<'a, C, A> { + self._person_fields = 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. /// @@ -2402,12 +5770,12 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> PeopleGetBatchGetCall<'a, C, A> diff --git a/gen/playcustomapp1-cli/Cargo.toml b/gen/playcustomapp1-cli/Cargo.toml new file mode 100644 index 0000000000..700210e9cc --- /dev/null +++ b/gen/playcustomapp1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-playcustomapp1-cli" +version = "1.0.6+20170622" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with playcustomapp (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1-cli" +homepage = "https://developers.google.com/android/work/play/custom-app-api" +documentation = "http://byron.github.io/google-apis-rs/google_playcustomapp1_cli" +license = "MIT" +keywords = ["playcustomapp", "google", "cli"] + +[[bin]] +name = "playcustomapp1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-playcustomapp1] +path = "../playcustomapp1" +version = "1.0.6+20170622" diff --git a/gen/playcustomapp1-cli/LICENSE.md b/gen/playcustomapp1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/playcustomapp1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/playcustomapp1-cli/README.md b/gen/playcustomapp1-cli/README.md new file mode 100644 index 0000000000..52b55ea18a --- /dev/null +++ b/gen/playcustomapp1-cli/README.md @@ -0,0 +1,114 @@ + +The `playcustomapp1` command-line interface *(CLI)* allows to use most features of the *Google playcustomapp* 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 *playcustomapp* API can be found at the +[official documentation site](https://developers.google.com/android/work/play/custom-app-api). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-playcustomapp1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1-cli). + +# Usage + +This documentation was generated from the *playcustomapp* API at revision *20170622*. The CLI is at version *1.0.6*. + +```bash +playcustomapp1 [options] + accounts + custom-apps-create (-r )... (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] + playcustomapp1 --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 `playcustomapp1-`. 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/playcustomapp1-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/playcustomapp1-secret.json`, assuming that the required *playcustomapp* 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. `playcustomapp1 --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/playcustomapp1-cli/mkdocs.yml b/gen/playcustomapp1-cli/mkdocs.yml new file mode 100644 index 0000000000..b18707691a --- /dev/null +++ b/gen/playcustomapp1-cli/mkdocs.yml @@ -0,0 +1,17 @@ +site_name: playcustomapp v1.0.6+20170622 +site_url: http://byron.github.io/google-apis-rs/google-playcustomapp1-cli +site_description: A complete library to interact with playcustomapp (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['accounts_custom-apps-create.md', 'Accounts', 'Custom Apps Create'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/playcustomapp1-cli/src/cmn.rs b/gen/playcustomapp1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/playcustomapp1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/playcustomapp1-cli/src/main.rs b/gen/playcustomapp1-cli/src/main.rs new file mode 100644 index 0000000000..cd0224a928 --- /dev/null +++ b/gen/playcustomapp1-cli/src/main.rs @@ -0,0 +1,383 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_playcustomapp1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::Playcustomapp>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _accounts_custom_apps_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code", "title"]); + 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::CustomApp = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().custom_apps_create(request, opt.value_of("account").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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 vals = opt.values_of("mode").unwrap().collect::>(); + let protocol = calltype_from_str(vals[0], ["simple", "resumable"].iter().map(|&v| v.to_string()).collect(), err); + let mut input_file = input_file_from_opts(vals[1], err); + let mime_type = input_mime_from_opts(opt.value_of("mime").unwrap_or("application/octet-stream"), err); + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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::Upload(UploadProtocol::Simple) => call.upload(input_file.unwrap(), mime_type.unwrap()), + CallType::Upload(UploadProtocol::Resumable) => call.upload_resumable(input_file.unwrap(), mime_type.unwrap()), + CallType::Standard => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + 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() { + ("accounts", Some(opt)) => { + match opt.subcommand() { + ("custom-apps-create", Some(opt)) => { + call_result = self._accounts_custom_apps_create(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("accounts".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<'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, "playcustomapp1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "playcustomapp1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::Playcustomapp::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 upload_value_names = ["mode", "file"]; + let arg_data = [ + ("accounts", "methods: 'custom-apps-create'", vec![ + ("custom-apps-create", + Some(r##"Create and publish a new custom app."##), + "Details at http://byron.github.io/google-apis-rs/google_playcustomapp1_cli/accounts_custom-apps-create", + vec![ + (Some(r##"account"##), + None, + Some(r##"Developer account ID."##), + 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##"mode"##), + Some(r##"u"##), + Some(r##"Specify the upload protocol (simple|resumable) and the file to upload"##), + 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("playcustomapp1") + .author("Sebastian Thiel ") + .version("1.0.6+20170622") + .about("An API to publish custom Android apps.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_playcustomapp1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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); + } + if arg_name_str == "mode" { + arg = arg.number_of_values(2); + arg = arg.value_names(&upload_value_names); + + scmd = scmd.arg(Arg::with_name("mime") + .short("m") + .requires("mode") + .required(false) + .help("The file's mime time, like 'application/octet-stream'") + .takes_value(true)); + } + 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/playcustomapp1/Cargo.toml b/gen/playcustomapp1/Cargo.toml new file mode 100644 index 0000000000..224b8c4b14 --- /dev/null +++ b/gen/playcustomapp1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-playcustomapp1" +version = "1.0.6+20170622" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with playcustomapp (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1" +homepage = "https://developers.google.com/android/work/play/custom-app-api" +documentation = "https://docs.rs/google-playcustomapp1/1.0.6+20170622" +license = "MIT" +keywords = ["playcustomapp", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/playcustomapp1/LICENSE.md b/gen/playcustomapp1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/playcustomapp1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/playcustomapp1/README.md b/gen/playcustomapp1/README.md new file mode 100644 index 0000000000..7078a21be9 --- /dev/null +++ b/gen/playcustomapp1/README.md @@ -0,0 +1,185 @@ + +The `google-playcustomapp1` library allows access to all features of the *Google playcustomapp* service. + +This documentation was generated from *playcustomapp* crate version *1.0.6+20170622*, where *20170622* is the exact revision of the *playcustomapp:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *playcustomapp* *v1* API can be found at the +[official documentation site](https://developers.google.com/android/work/play/custom-app-api). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/struct.Playcustomapp.html) ... + +* accounts + * [*custom apps create*](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/struct.AccountCustomAppCreateCall.html) + + +Upload supported by ... + +* [*custom apps create accounts*](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/struct.AccountCustomAppCreateCall.html) + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/struct.Playcustomapp.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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.accounts().custom_apps_create(...).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-playcustomapp1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_playcustomapp1 as playcustomapp1; +use playcustomapp1::CustomApp; +use playcustomapp1::{Result, Error}; +use std::fs; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use playcustomapp1::Playcustomapp; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = Playcustomapp::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CustomApp::default(); + +// 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.accounts().custom_apps_create(req, "account") + .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); + +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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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](https://docs.rs/google-playcustomapp1/1.0.6+20170622/google_playcustomapp1/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 **playcustomapp1** 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-rsblob/master/LICENSE.md diff --git a/gen/playcustomapp1/src/cmn.rs b/gen/playcustomapp1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/playcustomapp1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/playcustomapp1/src/lib.rs b/gen/playcustomapp1/src/lib.rs new file mode 100644 index 0000000000..76ca9cbe52 --- /dev/null +++ b/gen/playcustomapp1/src/lib.rs @@ -0,0 +1,852 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *playcustomapp* crate version *1.0.6+20170622*, where *20170622* is the exact revision of the *playcustomapp:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *playcustomapp* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/android/work/play/custom-app-api). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Playcustomapp.html) ... +//! +//! * accounts +//! * [*custom apps create*](struct.AccountCustomAppCreateCall.html) +//! +//! +//! Upload supported by ... +//! +//! * [*custom apps create accounts*](struct.AccountCustomAppCreateCall.html) +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Playcustomapp.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.accounts().custom_apps_create(...).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-playcustomapp1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_playcustomapp1 as playcustomapp1; +//! use playcustomapp1::CustomApp; +//! use playcustomapp1::{Result, Error}; +//! use std::fs; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use playcustomapp1::Playcustomapp; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = Playcustomapp::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CustomApp::default(); +//! +//! // 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.accounts().custom_apps_create(req, "account") +//! .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +//! +//! 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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 Google Play Developer account + Androidpublisher, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Androidpublisher => "https://www.googleapis.com/auth/androidpublisher", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Androidpublisher + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Playcustomapp related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_playcustomapp1 as playcustomapp1; +/// use playcustomapp1::CustomApp; +/// use playcustomapp1::{Result, Error}; +/// use std::fs; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use playcustomapp1::Playcustomapp; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Playcustomapp::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CustomApp::default(); +/// +/// // 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.accounts().custom_apps_create(req, "account") +/// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +/// +/// 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 Playcustomapp { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Playcustomapp {} + +impl<'a, C, A> Playcustomapp + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Playcustomapp { + Playcustomapp { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://www.googleapis.com/playcustomapp/v1/accounts/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), + } + } + + pub fn accounts(&'a self) -> AccountMethods<'a, C, A> { + AccountMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/playcustomapp/v1/accounts/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// This resource represents a custom app. +/// +/// # 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*). +/// +/// * [custom apps create accounts](struct.AccountCustomAppCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomApp { + /// Default listing language in BCP 47 format. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Title for the Android app. + pub title: Option, +} + +impl RequestValue for CustomApp {} +impl ResponseResult for CustomApp {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *account* resources. +/// It is not used directly, but through the `Playcustomapp` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_playcustomapp1 as playcustomapp1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use playcustomapp1::Playcustomapp; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Playcustomapp::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `custom_apps_create(...)` +/// // to build up your call. +/// let rb = hub.accounts(); +/// # } +/// ``` +pub struct AccountMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Playcustomapp, +} + +impl<'a, C, A> MethodsBuilder for AccountMethods<'a, C, A> {} + +impl<'a, C, A> AccountMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Create and publish a new custom app. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `account` - Developer account ID. + pub fn custom_apps_create(&self, request: CustomApp, account: &str) -> AccountCustomAppCreateCall<'a, C, A> { + AccountCustomAppCreateCall { + hub: self.hub, + _request: request, + _account: account.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Create and publish a new custom app. +/// +/// A builder for the *customApps.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_playcustomapp1 as playcustomapp1; +/// use playcustomapp1::CustomApp; +/// use std::fs; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use playcustomapp1::Playcustomapp; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Playcustomapp::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CustomApp::default(); +/// +/// // 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.accounts().custom_apps_create(req, "account") +/// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +/// # } +/// ``` +pub struct AccountCustomAppCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Playcustomapp, + _request: CustomApp, + _account: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountCustomAppCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountCustomAppCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + fn doit(mut self, mut reader: RS, reader_mime_type: mime::Mime, protocol: &'static str) -> Result<(hyper::client::Response, CustomApp)> + where RS: ReadSeek { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "playcustomapp.accounts.customApps.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("account", self._account.to_string())); + for &field in ["alt", "account"].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, upload_type) = + if protocol == "simple" { + (self.hub._root_url.clone() + "upload/playcustomapp/v1/accounts/{account}/customApps", "multipart") + } else if protocol == "resumable" { + (self.hub._root_url.clone() + "resumable/upload/playcustomapp/v1/accounts/{account}/customApps", "resumable") + } else { + unreachable!() + }; + params.push(("uploadType", upload_type.to_string())); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Androidpublisher.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{account}", "account")].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 ["account"].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).expect("serde to work"); + 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(); + + let mut should_ask_dlg_for_url = false; + let mut upload_url_from_server; + let mut upload_url: Option = None; + + 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(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + if should_ask_dlg_for_url && (upload_url = dlg.upload_url()) == () && upload_url.is_some() { + should_ask_dlg_for_url = false; + upload_url_from_server = false; + let url = upload_url.as_ref().and_then(|s| Some(hyper::Url::parse(s).unwrap())).unwrap(); + hyper::client::Response::new(url, Box::new(cmn::DummyNetworkStream)).and_then(|mut res| { + res.status = hyper::status::StatusCode::Ok; + res.headers.set(Location(upload_url.as_ref().unwrap().clone())); + Ok(res) + }) + } else { + let mut mp_reader: MultiPartReader = Default::default(); + let (mut body_reader, content_type) = match protocol { + "simple" => { + mp_reader.reserve_exact(2); + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 104857600 { + return Err(Error::UploadSizeLimitExceeded(size, 104857600)) + } + mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) + .add_part(&mut reader, size, reader_mime_type.clone()); + let mime_type = mp_reader.mime_type(); + (&mut mp_reader as &mut io::Read, ContentType(mime_type)) + }, + _ => (&mut request_value_reader as &mut io::Read, ContentType(json_mime_type.clone())), + }; + 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(content_type) + .body(&mut body_reader); + upload_url_from_server = true; + if protocol == "resumable" { + req = req.header(cmn::XUploadContentType(reader_mime_type.clone())); + } + + dlg.pre_request(); + req.send() + } + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + if protocol == "resumable" { + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 104857600 { + return Err(Error::UploadSizeLimitExceeded(size, 104857600)) + } + let mut client = &mut *self.hub.client.borrow_mut(); + let upload_result = { + let url_str = &res.headers.get::().expect("Location header is part of protocol").0; + if upload_url_from_server { + dlg.store_upload_url(Some(url_str)); + } + + cmn::ResumableUploadHelper { + client: &mut client.borrow_mut(), + delegate: dlg, + start_at: if upload_url_from_server { Some(0) } else { None }, + auth: &mut *self.hub.auth.borrow_mut(), + user_agent: &self.hub._user_agent, + auth_header: auth_header.clone(), + url: url_str, + reader: &mut reader, + media_type: reader_mime_type.clone(), + content_length: size + }.upload() + }; + match upload_result { + None => { + dlg.finished(false); + return Err(Error::Cancelled) + } + Some(Err(err)) => { + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Some(Ok(upload_result)) => { + res = upload_result; + if !res.status.is_success() { + dlg.store_upload_url(None); + dlg.finished(false); + return Err(Error::Failure(res)) + } + } + } + } + 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) + } + } + } + } + + /// Upload media all at once. + /// If the upload fails for whichever reason, all progress is lost. + /// + /// * *max size*: 100MB + /// * *multipart*: yes + /// * *valid mime types*: '*/*' + pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, CustomApp)> + where RS: ReadSeek { + self.doit(stream, mime_type, "simple") + } + /// Upload media in a resumable fashion. + /// Even if the upload fails or is interrupted, it can be resumed for a + /// certain amount of time as the server maintains state temporarily. + /// + /// The delegate will be asked for an `upload_url()`, and if not provided, will be asked to store an upload URL + /// that was provided by the server, using `store_upload_url(...)`. The upload will be done in chunks, the delegate + /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using + /// `cancel_chunk_upload(...)`. + /// + /// * *max size*: 100MB + /// * *multipart*: yes + /// * *valid mime types*: '*/*' + pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, CustomApp)> + where RS: ReadSeek { + self.doit(resumeable_stream, mime_type, "resumable") + } + + /// + /// 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: CustomApp) -> AccountCustomAppCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Developer account ID. + /// + /// Sets the *account* 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 account(mut self, new_value: &str) -> AccountCustomAppCreateCall<'a, C, A> { + self._account = 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) -> AccountCustomAppCreateCall<'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) -> AccountCustomAppCreateCall<'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::Androidpublisher`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountCustomAppCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/playmoviespartner1-cli/Cargo.toml b/gen/playmoviespartner1-cli/Cargo.toml index 01aba32eb5..0a5d741609 100644 --- a/gen/playmoviespartner1-cli/Cargo.toml +++ b/gen/playmoviespartner1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-playmoviespartner1-cli" -version = "1.0.6+20170516" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with Play Movies (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playmoviespartner1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-playmoviespartner1] path = "../playmoviespartner1" -version = "1.0.6+20170516" +version = "1.0.6+20170919" diff --git a/gen/playmoviespartner1-cli/README.md b/gen/playmoviespartner1-cli/README.md index 46e1979093..42aa90c622 100644 --- a/gen/playmoviespartner1-cli/README.md +++ b/gen/playmoviespartner1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Play Movies* API at revision *20170516*. The CLI is at version *1.0.6*. +This documentation was generated from the *Play Movies* API at revision *20170919*. The CLI is at version *1.0.6*. ```bash playmoviespartner1 [options] diff --git a/gen/playmoviespartner1-cli/mkdocs.yml b/gen/playmoviespartner1-cli/mkdocs.yml index 5e9e911151..8c1cb870c0 100644 --- a/gen/playmoviespartner1-cli/mkdocs.yml +++ b/gen/playmoviespartner1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Play Movies v1.0.6+20170516 +site_name: Play Movies v1.0.6+20170919 site_url: http://byron.github.io/google-apis-rs/google-playmoviespartner1-cli site_description: A complete library to interact with Play Movies (protocol v1) diff --git a/gen/playmoviespartner1-cli/src/main.rs b/gen/playmoviespartner1-cli/src/main.rs index ae9eca8bfe..b63c5d8a2a 100644 --- a/gen/playmoviespartner1-cli/src/main.rs +++ b/gen/playmoviespartner1-cli/src/main.rs @@ -737,7 +737,7 @@ fn main() { let mut app = App::new("playmoviespartner1") .author("Sebastian Thiel ") - .version("1.0.6+20170516") + .version("1.0.6+20170919") .about("Gets the delivery status of titles for Google Play Movies Partners.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli") .arg(Arg::with_name("url") diff --git a/gen/playmoviespartner1/Cargo.toml b/gen/playmoviespartner1/Cargo.toml index cb74fdca41..927eeec346 100644 --- a/gen/playmoviespartner1/Cargo.toml +++ b/gen/playmoviespartner1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-playmoviespartner1" -version = "1.0.6+20170516" +version = "1.0.6+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with Play Movies (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playmoviespartner1" homepage = "https://developers.google.com/playmoviespartner/" -documentation = "https://docs.rs/google-playmoviespartner1/1.0.6+20170516" +documentation = "https://docs.rs/google-playmoviespartner1/1.0.6+20170919" license = "MIT" keywords = ["playmoviespartner", "google", "protocol", "web", "api"] diff --git a/gen/playmoviespartner1/README.md b/gen/playmoviespartner1/README.md index e8d4cb8fb4..5acf072ff9 100644 --- a/gen/playmoviespartner1/README.md +++ b/gen/playmoviespartner1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-playmoviespartner1` library allows access to all features of the *Google Play Movies* service. -This documentation was generated from *Play Movies* crate version *1.0.6+20170516*, where *20170516* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Play Movies* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Play Movies* *v1* API can be found at the [official documentation site](https://developers.google.com/playmoviespartner/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.PlayMovies.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.PlayMovies.html) ... * accounts - * [*avails get*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.AccountAvailGetCall.html), [*avails list*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.AccountAvailListCall.html), [*orders get*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.AccountOrderGetCall.html), [*orders list*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.AccountOrderListCall.html), [*store infos country get*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.AccountStoreInfoListCall.html) + * [*avails get*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.AccountAvailGetCall.html), [*avails list*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.AccountAvailListCall.html), [*orders get*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.AccountOrderGetCall.html), [*orders list*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.AccountOrderListCall.html), [*store infos country get*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.AccountStoreInfoListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/struct.PlayMovies.html)** +* **[Hub](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/struct.PlayMovies.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.Part.html)** + * **[Parts](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -116,17 +116,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/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")`. @@ -136,29 +136,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/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](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/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](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/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](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/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](https://docs.rs/google-playmoviespartner1/1.0.6+20170516/google_playmoviespartner1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-playmoviespartner1/1.0.6+20170919/google_playmoviespartner1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/playmoviespartner1/src/lib.rs b/gen/playmoviespartner1/src/lib.rs index 434b5bd0a6..656dc96174 100644 --- a/gen/playmoviespartner1/src/lib.rs +++ b/gen/playmoviespartner1/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 *Play Movies* crate version *1.0.6+20170516*, where *20170516* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Play Movies* crate version *1.0.6+20170919*, where *20170919* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Play Movies* *v1* API can be found at the //! [official documentation site](https://developers.google.com/playmoviespartner/). @@ -572,12 +572,12 @@ pub struct ListStoreInfosResponse { /// See 'List methods rules' for info about this field. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// List of StoreInfos that match the request criteria. - #[serde(rename="storeInfos")] - pub store_infos: Option>, /// See _List methods rules_ for more information about this field. #[serde(rename="totalSize")] pub total_size: Option, + /// List of StoreInfos that match the request criteria. + #[serde(rename="storeInfos")] + pub store_infos: Option>, } impl ResponseResult for ListStoreInfosResponse {} @@ -746,12 +746,12 @@ impl ResponseResult for ListAvailsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Order { + /// High-level status of the order. + pub status: Option, /// ID internally generated by Google to uniquely identify an Order. /// Example: 'abcde12_x' #[serde(rename="orderId")] pub order_id: Option, - /// High-level status of the order. - pub status: Option, /// YouTube Channel ID that should be used to fulfill the Order. /// Example: "UCRG64darCZhb". #[serde(rename="channelId")] @@ -1361,17 +1361,17 @@ impl<'a, C, A> AccountOrderListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AccountOrderListCall<'a, C, A> @@ -1637,17 +1637,17 @@ impl<'a, C, A> AccountStoreInfoCountryGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountStoreInfoCountryGetCall<'a, C, A> @@ -1901,17 +1901,17 @@ impl<'a, C, A> AccountOrderGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AccountOrderGetCall<'a, C, A> @@ -2162,17 +2162,17 @@ impl<'a, C, A> AccountAvailGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AccountAvailGetCall<'a, C, A> @@ -2543,17 +2543,17 @@ impl<'a, C, A> AccountAvailListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *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"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> AccountAvailListCall<'a, C, A> @@ -2937,17 +2937,17 @@ impl<'a, C, A> AccountStoreInfoListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountStoreInfoListCall<'a, C, A> diff --git a/gen/plus1-cli/Cargo.toml b/gen/plus1-cli/Cargo.toml index 0f87071e51..88f344b77b 100644 --- a/gen/plus1-cli/Cargo.toml +++ b/gen/plus1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plus1-cli" -version = "1.0.6+20170410" +version = "1.0.6+20170828" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-plus1] path = "../plus1" -version = "1.0.6+20170410" +version = "1.0.6+20170828" diff --git a/gen/plus1-cli/README.md b/gen/plus1-cli/README.md index ded7ba91cc..a85d2f7ac2 100644 --- a/gen/plus1-cli/README.md +++ b/gen/plus1-cli/README.md @@ -25,7 +25,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 *20170410*. The CLI is at version *1.0.6*. +This documentation was generated from the *plus* API at revision *20170828*. The CLI is at version *1.0.6*. ```bash plus1 [options] diff --git a/gen/plus1-cli/mkdocs.yml b/gen/plus1-cli/mkdocs.yml index 50180053ab..b0a2df5917 100644 --- a/gen/plus1-cli/mkdocs.yml +++ b/gen/plus1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plus v1.0.6+20170410 +site_name: plus v1.0.6+20170828 site_url: http://byron.github.io/google-apis-rs/google-plus1-cli site_description: A complete library to interact with plus (protocol v1) diff --git a/gen/plus1-cli/src/main.rs b/gen/plus1-cli/src/main.rs index a5042ad3be..c2d9d5baad 100644 --- a/gen/plus1-cli/src/main.rs +++ b/gen/plus1-cli/src/main.rs @@ -938,7 +938,7 @@ fn main() { let mut app = App::new("plus1") .author("Sebastian Thiel ") - .version("1.0.6+20170410") + .version("1.0.6+20170828") .about("Builds 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 054d293310..70c691ab9a 100644 --- a/gen/plus1/Cargo.toml +++ b/gen/plus1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plus1" -version = "1.0.6+20170410" +version = "1.0.6+20170828" 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" homepage = "https://developers.google.com/+/api/" -documentation = "https://docs.rs/google-plus1/1.0.6+20170410" +documentation = "https://docs.rs/google-plus1/1.0.6+20170828" license = "MIT" keywords = ["plus", "google", "protocol", "web", "api"] diff --git a/gen/plus1/README.md b/gen/plus1/README.md index 1308f446fe..42e1e17fcc 100644 --- a/gen/plus1/README.md +++ b/gen/plus1/README.md @@ -5,20 +5,20 @@ 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 *1.0.6+20170410*, where *20170410* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *plus* crate version *1.0.6+20170828*, where *20170828* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *plus* *v1* API can be found at the [official documentation site](https://developers.google.com/+/api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.Plus.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.Plus.html) ... -* [activities](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.Activity.html) - * [*get*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.ActivitySearchCall.html) -* [comments](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.Comment.html) - * [*get*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.CommentListCall.html) +* [activities](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.Activity.html) + * [*get*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.ActivitySearchCall.html) +* [comments](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.Comment.html) + * [*get*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.CommentListCall.html) * people - * [*get*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.PeopleSearchCall.html) + * [*get*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.PeopleSearchCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/struct.Plus.html)** +* **[Hub](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/struct.Plus.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -125,17 +125,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/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")`. @@ -145,29 +145,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/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](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/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](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/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](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/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](https://docs.rs/google-plus1/1.0.6+20170410/google_plus1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/plus1/src/lib.rs b/gen/plus1/src/lib.rs index e76e8b5d66..2201517a18 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 *1.0.6+20170410*, where *20170410* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *plus* crate version *1.0.6+20170828*, where *20170828* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! 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 ec82652acf..df070c7ab7 100644 --- a/gen/plusdomains1-cli/Cargo.toml +++ b/gen/plusdomains1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1-cli" -version = "1.0.6+20170410" +version = "1.0.6+20170828" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-plusdomains1] path = "../plusdomains1" -version = "1.0.6+20170410" +version = "1.0.6+20170828" diff --git a/gen/plusdomains1-cli/README.md b/gen/plusdomains1-cli/README.md index ba627dd530..8b42cbb73b 100644 --- a/gen/plusdomains1-cli/README.md +++ b/gen/plusdomains1-cli/README.md @@ -25,7 +25,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 *20170410*. The CLI is at version *1.0.6*. +This documentation was generated from the *plusDomains* API at revision *20170828*. The CLI is at version *1.0.6*. ```bash plusdomains1 [options] diff --git a/gen/plusdomains1-cli/mkdocs.yml b/gen/plusdomains1-cli/mkdocs.yml index 5fa43c8088..55063edc3e 100644 --- a/gen/plusdomains1-cli/mkdocs.yml +++ b/gen/plusdomains1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plusDomains v1.0.6+20170410 +site_name: plusDomains v1.0.6+20170828 site_url: http://byron.github.io/google-apis-rs/google-plusdomains1-cli site_description: A complete library to interact with plusDomains (protocol v1) diff --git a/gen/plusdomains1-cli/src/main.rs b/gen/plusdomains1-cli/src/main.rs index 7ed20f7ff3..6dd449eb7a 100644 --- a/gen/plusdomains1-cli/src/main.rs +++ b/gen/plusdomains1-cli/src/main.rs @@ -2164,7 +2164,7 @@ fn main() { let mut app = App::new("plusdomains1") .author("Sebastian Thiel ") - .version("1.0.6+20170410") + .version("1.0.6+20170828") .about("Builds on top of the Google+ platform for Google Apps Domains.") .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 ef29955ce0..8fd64ebef3 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plusdomains1" -version = "1.0.6+20170410" +version = "1.0.6+20170828" 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" homepage = "https://developers.google.com/+/domains/" -documentation = "https://docs.rs/google-plusdomains1/1.0.6+20170410" +documentation = "https://docs.rs/google-plusdomains1/1.0.6+20170828" license = "MIT" keywords = ["plusDomains", "google", "protocol", "web", "api"] diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index e6fcad4679..b6ef5b5214 100644 --- a/gen/plusdomains1/README.md +++ b/gen/plusdomains1/README.md @@ -5,31 +5,31 @@ 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 *1.0.6+20170410*, where *20170410* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *plusDomains* crate version *1.0.6+20170828*, where *20170828* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *plusDomains* *v1* API can be found at the [official documentation site](https://developers.google.com/+/domains/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.PlusDomains.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.PlusDomains.html) ... -* [activities](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.Activity.html) - * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.ActivityGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.ActivityListCall.html) -* [audiences](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.Audience.html) - * [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.AudienceListCall.html) -* [circles](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.Circle.html) - * [*add people*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleAddPeopleCall.html), [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleInsertCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleListCall.html), [*patch*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CirclePatchCall.html), [*remove*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleRemoveCall.html), [*remove people*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleRemovePeopleCall.html) and [*update*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CircleUpdateCall.html) -* [comments](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.Comment.html) - * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CommentInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.CommentListCall.html) -* [media](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.Media.html) - * [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.MediaInsertCall.html) +* [activities](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.Activity.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.ActivityGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.ActivityListCall.html) +* [audiences](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.Audience.html) + * [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.AudienceListCall.html) +* [circles](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.Circle.html) + * [*add people*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleAddPeopleCall.html), [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleInsertCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleListCall.html), [*patch*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CirclePatchCall.html), [*remove*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleRemoveCall.html), [*remove people*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleRemovePeopleCall.html) and [*update*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CircleUpdateCall.html) +* [comments](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.Comment.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CommentInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.CommentListCall.html) +* [media](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.Media.html) + * [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.MediaInsertCall.html) * people - * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.PeopleListByActivityCall.html) and [*list by circle*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.PeopleListByCircleCall.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.PeopleListByActivityCall.html) and [*list by circle*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.PeopleListByCircleCall.html) Upload supported by ... -* [*insert media*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.MediaInsertCall.html) +* [*insert media*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.MediaInsertCall.html) @@ -37,17 +37,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/struct.PlusDomains.html)** +* **[Hub](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.PlusDomains.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/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")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/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](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/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](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/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](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/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](https://docs.rs/google-plusdomains1/1.0.6+20170410/google_plusdomains1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/plusdomains1/src/lib.rs b/gen/plusdomains1/src/lib.rs index 3a5411fa92..80cd11b88f 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 *1.0.6+20170410*, where *20170410* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *plusDomains* crate version *1.0.6+20170828*, where *20170828* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *plusDomains* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/domains/). diff --git a/gen/proximitybeacon1_beta1-cli/Cargo.toml b/gen/proximitybeacon1_beta1-cli/Cargo.toml index 17fcae5634..11656274c6 100644 --- a/gen/proximitybeacon1_beta1-cli/Cargo.toml +++ b/gen/proximitybeacon1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-proximitybeacon1_beta1-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170913" authors = ["Sebastian Thiel "] description = "A complete library to interact with proximitybeacon (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/proximitybeacon1_beta1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-proximitybeacon1_beta1] path = "../proximitybeacon1_beta1" -version = "1.0.6+20170517" +version = "1.0.6+20170913" diff --git a/gen/proximitybeacon1_beta1-cli/README.md b/gen/proximitybeacon1_beta1-cli/README.md index e0d40fe18b..66443867ca 100644 --- a/gen/proximitybeacon1_beta1-cli/README.md +++ b/gen/proximitybeacon1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *proximitybeacon* API at revision *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *proximitybeacon* API at revision *20170913*. The CLI is at version *1.0.6*. ```bash proximitybeacon1-beta1 [options] diff --git a/gen/proximitybeacon1_beta1-cli/mkdocs.yml b/gen/proximitybeacon1_beta1-cli/mkdocs.yml index 6a76f130cb..58a2d4615e 100644 --- a/gen/proximitybeacon1_beta1-cli/mkdocs.yml +++ b/gen/proximitybeacon1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: proximitybeacon v1.0.6+20170517 +site_name: proximitybeacon v1.0.6+20170913 site_url: http://byron.github.io/google-apis-rs/google-proximitybeacon1_beta1-cli site_description: A complete library to interact with proximitybeacon (protocol v1beta1) diff --git a/gen/proximitybeacon1_beta1-cli/src/main.rs b/gen/proximitybeacon1_beta1-cli/src/main.rs index 838037f6e3..1300fe44ff 100644 --- a/gen/proximitybeacon1_beta1-cli/src/main.rs +++ b/gen/proximitybeacon1_beta1-cli/src/main.rs @@ -835,9 +835,9 @@ impl<'n> Engine<'n> { "place-id" => Some(("placeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ephemeral-id-registration.rotation-period-exponent" => Some(("ephemeralIdRegistration.rotationPeriodExponent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "ephemeral-id-registration.initial-clock-value" => Some(("ephemeralIdRegistration.initialClockValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ephemeral-id-registration.beacon-ecdh-public-key" => Some(("ephemeralIdRegistration.beaconEcdhPublicKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ephemeral-id-registration.initial-eid" => Some(("ephemeralIdRegistration.initialEid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ephemeral-id-registration.service-ecdh-public-key" => Some(("ephemeralIdRegistration.serviceEcdhPublicKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ephemeral-id-registration.initial-eid" => Some(("ephemeralIdRegistration.initialEid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ephemeral-id-registration.beacon-ecdh-public-key" => Some(("ephemeralIdRegistration.beaconEcdhPublicKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ephemeral-id-registration.beacon-identity-key" => Some(("ephemeralIdRegistration.beaconIdentityKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advertised-id.type" => Some(("advertisedId.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advertised-id.id" => Some(("advertisedId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -941,9 +941,9 @@ impl<'n> Engine<'n> { "place-id" => Some(("placeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ephemeral-id-registration.rotation-period-exponent" => Some(("ephemeralIdRegistration.rotationPeriodExponent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "ephemeral-id-registration.initial-clock-value" => Some(("ephemeralIdRegistration.initialClockValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ephemeral-id-registration.beacon-ecdh-public-key" => Some(("ephemeralIdRegistration.beaconEcdhPublicKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ephemeral-id-registration.initial-eid" => Some(("ephemeralIdRegistration.initialEid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ephemeral-id-registration.service-ecdh-public-key" => Some(("ephemeralIdRegistration.serviceEcdhPublicKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ephemeral-id-registration.initial-eid" => Some(("ephemeralIdRegistration.initialEid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ephemeral-id-registration.beacon-ecdh-public-key" => Some(("ephemeralIdRegistration.beaconEcdhPublicKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ephemeral-id-registration.beacon-identity-key" => Some(("ephemeralIdRegistration.beaconIdentityKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advertised-id.type" => Some(("advertisedId.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advertised-id.id" => Some(("advertisedId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1147,8 +1147,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "namespace-name" => Some(("namespaceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-visibility" => Some(("servingVisibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "namespace-name" => Some(("namespaceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["namespace-name", "serving-visibility"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1961,7 +1961,7 @@ fn main() { let mut app = App::new("proximitybeacon1-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170913") .about("Registers, manages, indexes, and searches beacons.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/proximitybeacon1_beta1/Cargo.toml b/gen/proximitybeacon1_beta1/Cargo.toml index 75bf8074fd..4244098a85 100644 --- a/gen/proximitybeacon1_beta1/Cargo.toml +++ b/gen/proximitybeacon1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-proximitybeacon1_beta1" -version = "1.0.6+20170517" +version = "1.0.6+20170913" authors = ["Sebastian Thiel "] description = "A complete library to interact with proximitybeacon (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/proximitybeacon1_beta1" homepage = "https://developers.google.com/beacons/proximity/" -documentation = "https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517" +documentation = "https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913" license = "MIT" keywords = ["proximitybeacon", "google", "protocol", "web", "api"] diff --git a/gen/proximitybeacon1_beta1/README.md b/gen/proximitybeacon1_beta1/README.md index be21065cdb..dab01639f2 100644 --- a/gen/proximitybeacon1_beta1/README.md +++ b/gen/proximitybeacon1_beta1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-proximitybeacon1_beta1` library allows access to all features of the *Google proximitybeacon* service. -This documentation was generated from *proximitybeacon* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *proximitybeacon* crate version *1.0.6+20170913*, where *20170913* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *proximitybeacon* *v1_beta1* API can be found at the [official documentation site](https://developers.google.com/beacons/proximity/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... * beaconinfo - * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) -* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.Beacon.html) - * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconDeleteCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) -* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.Namespace.html) - * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) + * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) +* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.Beacon.html) + * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconDeleteCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) +* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.Namespace.html) + * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) Other activities are ... -* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.MethodGetEidparamCall.html) +* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.MethodGetEidparamCall.html) @@ -30,17 +30,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/struct.Proximitybeacon.html)** +* **[Hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.Proximitybeacon.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_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")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_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](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_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](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_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](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_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](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170517/google_proximitybeacon1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_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. diff --git a/gen/proximitybeacon1_beta1/src/lib.rs b/gen/proximitybeacon1_beta1/src/lib.rs index 70ed17c9d3..2e714d92c5 100644 --- a/gen/proximitybeacon1_beta1/src/lib.rs +++ b/gen/proximitybeacon1_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 *proximitybeacon* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *proximitybeacon* crate version *1.0.6+20170913*, where *20170913* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *proximitybeacon* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/beacons/proximity/). @@ -479,12 +479,12 @@ pub struct ListBeaconsResponse { /// request to retrieve the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The beacons that matched the search criteria. - pub beacons: Option>, /// Estimate of the total number of beacons matched by the query. Higher /// values may be less accurate. #[serde(rename="totalCount")] pub total_count: Option, + /// The beacons that matched the search criteria. + pub beacons: Option>, } impl ResponseResult for ListBeaconsResponse {} @@ -532,14 +532,14 @@ impl RequestValue for GetInfoForObservedBeaconsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Namespace { - /// Resource name of this namespace. Namespaces names have the format: - /// namespaces/namespace. - #[serde(rename="namespaceName")] - pub namespace_name: Option, /// Specifies what clients may receive attachments under this namespace /// via `beaconinfo.getforobserved`. #[serde(rename="servingVisibility")] pub serving_visibility: Option, + /// Resource name of this namespace. Namespaces names have the format: + /// namespaces/namespace. + #[serde(rename="namespaceName")] + pub namespace_name: Option, } impl RequestValue for Namespace {} @@ -797,11 +797,11 @@ pub struct EphemeralIdRegistration { /// broadcasting a new ephemeral ID on average every 2^K seconds. #[serde(rename="rotationPeriodExponent")] pub rotation_period_exponent: Option, - /// The beacon's public key used for the Elliptic curve Diffie-Hellman - /// key exchange. When this field is populated, `service_ecdh_public_key` + /// The service's public key used for the Elliptic curve Diffie-Hellman + /// key exchange. When this field is populated, `beacon_ecdh_public_key` /// must also be populated, and `beacon_identity_key` must not be. - #[serde(rename="beaconEcdhPublicKey")] - pub beacon_ecdh_public_key: Option, + #[serde(rename="serviceEcdhPublicKey")] + pub service_ecdh_public_key: Option, /// The initial clock value of the beacon. The beacon's clock must have /// begun counting at this value immediately prior to transmitting this /// value to the resolving service. Significant delay in transmitting this @@ -809,11 +809,11 @@ pub struct EphemeralIdRegistration { /// value is not provided, the default is zero. #[serde(rename="initialClockValue")] pub initial_clock_value: Option, - /// The service's public key used for the Elliptic curve Diffie-Hellman - /// key exchange. When this field is populated, `beacon_ecdh_public_key` + /// The beacon's public key used for the Elliptic curve Diffie-Hellman + /// key exchange. When this field is populated, `service_ecdh_public_key` /// must also be populated, and `beacon_identity_key` must not be. - #[serde(rename="serviceEcdhPublicKey")] - pub service_ecdh_public_key: Option, + #[serde(rename="beaconEcdhPublicKey")] + pub beacon_ecdh_public_key: Option, /// The private key of the beacon. If this field is populated, /// `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be /// populated. @@ -1000,14 +1000,14 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without - /// a year. - pub year: Option, + /// Month of year. Must be from 1 to 12. + pub month: Option, /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 /// if specifying a year/month where the day is not significant. pub day: Option, - /// Month of year. Must be from 1 to 12. - pub month: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, } impl Part for Date {} diff --git a/gen/pubsub1-cli/Cargo.toml b/gen/pubsub1-cli/Cargo.toml index 2cf550c166..49637cb60b 100644 --- a/gen/pubsub1-cli/Cargo.toml +++ b/gen/pubsub1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pubsub1-cli" -version = "1.0.6+20170502" +version = "1.0.6+20170829" authors = ["Sebastian Thiel "] description = "A complete library to interact with Pubsub (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-pubsub1] path = "../pubsub1" -version = "1.0.6+20170502" +version = "1.0.6+20170829" diff --git a/gen/pubsub1-cli/README.md b/gen/pubsub1-cli/README.md index 816d531b21..d7b57a20a5 100644 --- a/gen/pubsub1-cli/README.md +++ b/gen/pubsub1-cli/README.md @@ -25,7 +25,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 *20170502*. The CLI is at version *1.0.6*. +This documentation was generated from the *Pubsub* API at revision *20170829*. The CLI is at version *1.0.6*. ```bash pubsub1 [options] diff --git a/gen/pubsub1-cli/mkdocs.yml b/gen/pubsub1-cli/mkdocs.yml index 3fc5903d0c..788706b6fe 100644 --- a/gen/pubsub1-cli/mkdocs.yml +++ b/gen/pubsub1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Pubsub v1.0.6+20170502 +site_name: Pubsub v1.0.6+20170829 site_url: http://byron.github.io/google-apis-rs/google-pubsub1-cli site_description: A complete library to interact with Pubsub (protocol v1) diff --git a/gen/pubsub1-cli/src/main.rs b/gen/pubsub1-cli/src/main.rs index d373ee5ed9..143d93c657 100644 --- a/gen/pubsub1-cli/src/main.rs +++ b/gen/pubsub1-cli/src/main.rs @@ -121,8 +121,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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())))); @@ -939,8 +939,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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())))); @@ -1494,8 +1494,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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())))); @@ -2555,7 +2555,7 @@ fn main() { let mut app = App::new("pubsub1") .author("Sebastian Thiel ") - .version("1.0.6+20170502") + .version("1.0.6+20170829") .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_cli") diff --git a/gen/pubsub1/Cargo.toml b/gen/pubsub1/Cargo.toml index ecf025e304..96d812c408 100644 --- a/gen/pubsub1/Cargo.toml +++ b/gen/pubsub1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pubsub1" -version = "1.0.6+20170502" +version = "1.0.6+20170829" authors = ["Sebastian Thiel "] description = "A complete library to interact with Pubsub (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1" homepage = "https://cloud.google.com/pubsub/docs" -documentation = "https://docs.rs/google-pubsub1/1.0.6+20170502" +documentation = "https://docs.rs/google-pubsub1/1.0.6+20170829" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] diff --git a/gen/pubsub1/README.md b/gen/pubsub1/README.md index 509afc74c1..51e95e8f3d 100644 --- a/gen/pubsub1/README.md +++ b/gen/pubsub1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-pubsub1` library allows access to all features of the *Google Pubsub* service. -This documentation was generated from *Pubsub* crate version *1.0.6+20170502*, where *20170502* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Pubsub* crate version *1.0.6+20170829*, where *20170829* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Pubsub* *v1* 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](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.Pubsub.html) ... * projects - * [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.ProjectTopicTestIamPermissionCall.html) + * [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.ProjectTopicTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/struct.Pubsub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/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")`. @@ -147,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/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](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/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](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/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](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/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](https://docs.rs/google-pubsub1/1.0.6+20170502/google_pubsub1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/pubsub1/src/lib.rs b/gen/pubsub1/src/lib.rs index 9367a5b913..e922a069c5 100644 --- a/gen/pubsub1/src/lib.rs +++ b/gen/pubsub1/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 *Pubsub* crate version *1.0.6+20170502*, where *20170502* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Pubsub* crate version *1.0.6+20170829*, where *20170829* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Pubsub* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). @@ -569,9 +569,10 @@ impl RequestValue for PublishRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { /// Associates a list of `members` to a `role`. - /// Multiple `bindings` must not be specified for the same `role`. /// `bindings` with no members will result in an error. pub bindings: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// It is strongly suggested that systems make use of the `etag` in the @@ -583,8 +584,6 @@ pub struct Policy { /// If no `etag` is provided in the call to `setIamPolicy`, then the existing /// policy is overwritten blindly. pub etag: Option, - /// Version of the `Policy`. The default version is 0. - pub version: Option, } impl ResponseResult for Policy {} @@ -735,68 +734,6 @@ pub struct PullRequest { impl RequestValue for PullRequest {} -/// 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 pushed message. This attribute - /// indicates the version of the data expected by the endpoint. This - /// controls the shape of the pushed message (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 {} - - -/// A topic resource. -/// -/// # 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*). -/// -/// * [topics create projects](struct.ProjectTopicCreateCall.html) (request|response) -/// * [topics get projects](struct.ProjectTopicGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Topic { - /// The name of the topic. It must have the format - /// `"projects/{project}/topics/{topic}"`. `{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, -} - -impl RequestValue for Topic {} -impl ResponseResult for Topic {} - - /// Associates `members` with a `role`. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -826,6 +763,7 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// /// * `domain:{domain}`: A Google Apps domain name that represents all the /// users of that domain. For example, `google.com` or `example.com`. /// @@ -836,6 +774,31 @@ pub struct Binding { impl Part for Binding {} +/// A topic resource. +/// +/// # 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*). +/// +/// * [topics create projects](struct.ProjectTopicCreateCall.html) (request|response) +/// * [topics get projects](struct.ProjectTopicGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Topic { + /// The name of the topic. It must have the format + /// `"projects/{project}/topics/{topic}"`. `{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, +} + +impl RequestValue for Topic {} +impl ResponseResult for Topic {} + + /// Response for the `Publish` method. /// /// # Activities @@ -906,6 +869,43 @@ pub struct PubsubMessage { impl Part for PubsubMessage {} +/// 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 pushed message. This attribute + /// indicates the version of the data expected by the endpoint. This + /// controls the shape of the pushed message (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 {} + + /// A subscription resource. /// /// # Activities @@ -1773,12 +1773,12 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionListCall<'a, C, A> @@ -2062,12 +2062,12 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicCreateCall<'a, C, A> @@ -2353,12 +2353,12 @@ impl<'a, C, A> ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicTestIamPermissionCall<'a, C, A> @@ -2644,12 +2644,12 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -2935,12 +2935,12 @@ impl<'a, C, A> ProjectSnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSnapshotTestIamPermissionCall<'a, C, A> @@ -3223,12 +3223,12 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionPullCall<'a, C, A> @@ -3513,12 +3513,12 @@ impl<'a, C, A> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -3769,12 +3769,12 @@ impl<'a, C, A> ProjectSnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSnapshotGetIamPolicyCall<'a, C, A> @@ -4058,12 +4058,12 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -4314,12 +4314,12 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicGetIamPolicyCall<'a, C, A> @@ -4605,12 +4605,12 @@ impl<'a, C, A> ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> @@ -4863,12 +4863,12 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionDeleteCall<'a, C, A> @@ -5119,12 +5119,12 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -5399,12 +5399,12 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -5686,12 +5686,12 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicPublishCall<'a, C, A> @@ -5940,12 +5940,12 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> @@ -6226,12 +6226,12 @@ impl<'a, C, A> ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSetIamPolicyCall<'a, C, A> @@ -6484,12 +6484,12 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicDeleteCall<'a, C, A> @@ -6782,12 +6782,12 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionCreateCall<'a, C, A> @@ -7068,12 +7068,12 @@ impl<'a, C, A> ProjectSnapshotSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSnapshotSetIamPolicyCall<'a, C, A> @@ -7322,12 +7322,12 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionGetCall<'a, C, A> @@ -7602,12 +7602,12 @@ impl<'a, C, A> ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSubscriptionListCall<'a, C, A> @@ -7888,12 +7888,12 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< /// * *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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *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> diff --git a/gen/pubsub1_beta2-cli/Cargo.toml b/gen/pubsub1_beta2-cli/Cargo.toml index 2b438bb329..34bd0bb376 100644 --- a/gen/pubsub1_beta2-cli/Cargo.toml +++ b/gen/pubsub1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pubsub1_beta2-cli" -version = "1.0.6+20170502" +version = "1.0.6+20170829" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-pubsub1_beta2] path = "../pubsub1_beta2" -version = "1.0.6+20170502" +version = "1.0.6+20170829" diff --git a/gen/pubsub1_beta2-cli/README.md b/gen/pubsub1_beta2-cli/README.md index 17eaae9e59..4c90c6cca7 100644 --- a/gen/pubsub1_beta2-cli/README.md +++ b/gen/pubsub1_beta2-cli/README.md @@ -25,7 +25,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 *20170502*. The CLI is at version *1.0.6*. +This documentation was generated from the *Pubsub* API at revision *20170829*. The CLI is at version *1.0.6*. ```bash pubsub1-beta2 [options] diff --git a/gen/pubsub1_beta2-cli/mkdocs.yml b/gen/pubsub1_beta2-cli/mkdocs.yml index 0950d146bd..5850b66f8f 100644 --- a/gen/pubsub1_beta2-cli/mkdocs.yml +++ b/gen/pubsub1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Pubsub v1.0.6+20170502 +site_name: Pubsub v1.0.6+20170829 site_url: http://byron.github.io/google-apis-rs/google-pubsub1_beta2-cli site_description: A complete library to interact with Pubsub (protocol v1beta2) diff --git a/gen/pubsub1_beta2-cli/src/main.rs b/gen/pubsub1_beta2-cli/src/main.rs index 9c1955ac6e..524112a7bc 100644 --- a/gen/pubsub1_beta2-cli/src/main.rs +++ b/gen/pubsub1_beta2-cli/src/main.rs @@ -459,8 +459,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = 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 })), + "ack-id" => Some(("ackId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { 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())))); @@ -717,8 +717,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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())))); @@ -1272,8 +1272,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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())))); @@ -2219,7 +2219,7 @@ fn main() { let mut app = App::new("pubsub1-beta2") .author("Sebastian Thiel ") - .version("1.0.6+20170502") + .version("1.0.6+20170829") .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") diff --git a/gen/pubsub1_beta2/Cargo.toml b/gen/pubsub1_beta2/Cargo.toml index cccbe4446e..9815b81099 100644 --- a/gen/pubsub1_beta2/Cargo.toml +++ b/gen/pubsub1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pubsub1_beta2" -version = "1.0.6+20170502" +version = "1.0.6+20170829" 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 = "https://docs.rs/google-pubsub1_beta2/1.0.6+20170502" +documentation = "https://docs.rs/google-pubsub1_beta2/1.0.6+20170829" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index b36799af04..52739f7e00 100644 --- a/gen/pubsub1_beta2/README.md +++ b/gen/pubsub1_beta2/README.md @@ -5,16 +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 *1.0.6+20170502*, where *20170502* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Pubsub* crate version *1.0.6+20170829*, where *20170829* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. 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](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.Pubsub.html) ... * projects - * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.ProjectTopicTestIamPermissionCall.html) + * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.ProjectTopicTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/struct.Pubsub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -126,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_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")`. @@ -146,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_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](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_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](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_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](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_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](https://docs.rs/google-pubsub1_beta2/1.0.6+20170502/google_pubsub1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1_beta2/1.0.6+20170829/google_pubsub1_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. diff --git a/gen/pubsub1_beta2/src/lib.rs b/gen/pubsub1_beta2/src/lib.rs index c9e0df1884..7491d6f551 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_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 *Pubsub* crate version *1.0.6+20170502*, where *20170502* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Pubsub* crate version *1.0.6+20170829*, where *20170829* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Pubsub* *v1_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). @@ -227,18 +227,18 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View and manage Pub/Sub topics and subscriptions - Full, - /// View and manage your data across Google Cloud Platform services CloudPlatform, + + /// View and manage Pub/Sub topics and subscriptions + Full, } impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::Full => "https://www.googleapis.com/auth/pubsub", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::Full => "https://www.googleapis.com/auth/pubsub", } } } @@ -491,13 +491,13 @@ pub struct ModifyAckDeadlineRequest { /// another pull request. #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, + /// List of acknowledgment IDs. + #[serde(rename="ackIds")] + pub ack_ids: Option>, /// The acknowledgment ID. Either this or ack_ids must be populated, but not /// both. #[serde(rename="ackId")] pub ack_id: Option, - /// List of acknowledgment IDs. - #[serde(rename="ackIds")] - pub ack_ids: Option>, } impl RequestValue for ModifyAckDeadlineRequest {} @@ -566,9 +566,10 @@ impl RequestValue for PublishRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { /// Associates a list of `members` to a `role`. - /// Multiple `bindings` must not be specified for the same `role`. /// `bindings` with no members will result in an error. pub bindings: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// It is strongly suggested that systems make use of the `etag` in the @@ -580,8 +581,6 @@ pub struct Policy { /// If no `etag` is provided in the call to `setIamPolicy`, then the existing /// policy is overwritten blindly. pub etag: Option, - /// Version of the `Policy`. The default version is 0. - pub version: Option, } impl ResponseResult for Policy {} @@ -822,6 +821,7 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// /// * `domain:{domain}`: A Google Apps domain name that represents all the /// users of that domain. For example, `google.com` or `example.com`. /// diff --git a/gen/safebrowsing4-cli/Cargo.toml b/gen/safebrowsing4-cli/Cargo.toml index 5b8828e10d..638d832f0b 100644 --- a/gen/safebrowsing4-cli/Cargo.toml +++ b/gen/safebrowsing4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-safebrowsing4-cli" -version = "1.0.6+20170509" +version = "1.0.6+20170921" authors = ["Sebastian Thiel "] description = "A complete library to interact with safebrowsing (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/safebrowsing4-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-safebrowsing4] path = "../safebrowsing4" -version = "1.0.6+20170509" +version = "1.0.6+20170921" diff --git a/gen/safebrowsing4-cli/README.md b/gen/safebrowsing4-cli/README.md index 3fd0313c66..ad2583de58 100644 --- a/gen/safebrowsing4-cli/README.md +++ b/gen/safebrowsing4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *safebrowsing* API at revision *20170509*. The CLI is at version *1.0.6*. +This documentation was generated from the *safebrowsing* API at revision *20170921*. The CLI is at version *1.0.6*. ```bash safebrowsing4 [options] diff --git a/gen/safebrowsing4-cli/mkdocs.yml b/gen/safebrowsing4-cli/mkdocs.yml index 7d7d560b15..98e2722fd3 100644 --- a/gen/safebrowsing4-cli/mkdocs.yml +++ b/gen/safebrowsing4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: safebrowsing v1.0.6+20170509 +site_name: safebrowsing v1.0.6+20170921 site_url: http://byron.github.io/google-apis-rs/google-safebrowsing4-cli site_description: A complete library to interact with safebrowsing (protocol v4) diff --git a/gen/safebrowsing4-cli/src/main.rs b/gen/safebrowsing4-cli/src/main.rs index fcfc84a4b4..311f586402 100644 --- a/gen/safebrowsing4-cli/src/main.rs +++ b/gen/safebrowsing4-cli/src/main.rs @@ -181,10 +181,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "client.client-id" => Some(("client.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-client.client-version" => Some(("apiClient.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-client.client-id" => Some(("apiClient.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-client.client-version" => Some(("apiClient.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "threat-info.threat-types" => Some(("threatInfo.threatTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "threat-info.platform-types" => Some(("threatInfo.platformTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "threat-info.threat-entry-types" => Some(("threatInfo.threatEntryTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -270,8 +270,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "client.client-id" => Some(("client.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["client", "client-id", "client-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -402,8 +402,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "client.client-id" => Some(("client.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "threat-info.threat-types" => Some(("threatInfo.threatTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "threat-info.platform-types" => Some(("threatInfo.platformTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "threat-info.threat-entry-types" => Some(("threatInfo.threatEntryTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -771,8 +771,8 @@ fn main() { let mut app = App::new("safebrowsing4") .author("Sebastian Thiel ") - .version("1.0.6+20170509") - .about("The Safe Browsing API is an experimental API that allows client applications to check URLs against Google's constantly-updated blacklists of suspected phishing and malware pages. Your client application can use the API to download an encrypted table for local, client-side lookups of URLs.") + .version("1.0.6+20170921") + .about("Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli") .arg(Arg::with_name("folder") .long("config-dir") diff --git a/gen/safebrowsing4/Cargo.toml b/gen/safebrowsing4/Cargo.toml index 1004607efd..5e90301a84 100644 --- a/gen/safebrowsing4/Cargo.toml +++ b/gen/safebrowsing4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-safebrowsing4" -version = "1.0.6+20170509" +version = "1.0.6+20170921" authors = ["Sebastian Thiel "] description = "A complete library to interact with safebrowsing (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/safebrowsing4" homepage = "https://developers.google.com/safe-browsing/" -documentation = "https://docs.rs/google-safebrowsing4/1.0.6+20170509" +documentation = "https://docs.rs/google-safebrowsing4/1.0.6+20170921" license = "MIT" keywords = ["safebrowsing", "google", "protocol", "web", "api"] diff --git a/gen/safebrowsing4/README.md b/gen/safebrowsing4/README.md index af5c87b3f1..62a1133a69 100644 --- a/gen/safebrowsing4/README.md +++ b/gen/safebrowsing4/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-safebrowsing4` library allows access to all features of the *Google safebrowsing* service. -This documentation was generated from *safebrowsing* crate version *1.0.6+20170509*, where *20170509* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *safebrowsing* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *safebrowsing* *v4* API can be found at the [official documentation site](https://developers.google.com/safe-browsing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.Safebrowsing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.Safebrowsing.html) ... * encoded full hashes - * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) + * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) * encoded updates - * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.EncodedUpdateGetCall.html) + * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.EncodedUpdateGetCall.html) * full hashes - * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.FullHasheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.FullHasheFindCall.html) * threat list updates - * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) + * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) * threat lists - * [*list*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.ThreatListListCall.html) + * [*list*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.ThreatListListCall.html) * threat matches - * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.ThreatMatcheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.ThreatMatcheFindCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/struct.Safebrowsing.html)** +* **[Hub](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.Safebrowsing.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.Part.html)** + * **[Parts](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -129,17 +129,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/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")`. @@ -149,29 +149,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/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](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/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](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/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](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/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](https://docs.rs/google-safebrowsing4/1.0.6+20170509/google_safebrowsing4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/safebrowsing4/src/lib.rs b/gen/safebrowsing4/src/lib.rs index c350e24b49..0cb972a22d 100644 --- a/gen/safebrowsing4/src/lib.rs +++ b/gen/safebrowsing4/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 *safebrowsing* crate version *1.0.6+20170509*, where *20170509* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *safebrowsing* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *safebrowsing* *v4* API can be found at the //! [official documentation site](https://developers.google.com/safe-browsing/). @@ -450,17 +450,25 @@ pub struct Checksum { impl Part for Checksum {} -/// A set of raw indices to remove from a local list. +/// Request to check entries against lists. /// -/// 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*). +/// +/// * [find threat matches](struct.ThreatMatcheFindCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RawIndices { - /// The indices to remove from a lexicographically-sorted local list. - pub indices: Option>, +pub struct FindThreatMatchesRequest { + /// The client metadata. + pub client: Option, + /// The lists and entries to be checked for matches. + #[serde(rename="threatInfo")] + pub threat_info: Option, } -impl Part for RawIndices {} +impl RequestValue for FindThreatMatchesRequest {} /// A set of threats that should be added or removed from a client's local @@ -610,13 +618,13 @@ impl Part for ThreatMatch {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClientInfo { + /// The version of the client implementation. + #[serde(rename="clientVersion")] + pub client_version: Option, /// A client ID that (hopefully) uniquely identifies the client implementation /// of the Safe Browsing API. #[serde(rename="clientId")] pub client_id: Option, - /// The version of the client implementation. - #[serde(rename="clientVersion")] - pub client_version: Option, } impl Part for ClientInfo {} @@ -717,10 +725,10 @@ impl Part for ThreatEntry {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MetadataEntry { - /// The metadata entry value. For JSON requests, the value is base64-encoded. - pub value: Option, /// The metadata entry key. For JSON requests, the key is base64-encoded. pub key: Option, + /// The metadata entry value. For JSON requests, the value is base64-encoded. + pub value: Option, } impl Part for MetadataEntry {} @@ -769,25 +777,17 @@ pub struct ListThreatListsResponse { impl ResponseResult for ListThreatListsResponse {} -/// Request to check entries against lists. +/// A set of raw indices to remove from a local list. /// -/// # 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*). -/// -/// * [find threat matches](struct.ThreatMatcheFindCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FindThreatMatchesRequest { - /// The client metadata. - pub client: Option, - /// The lists and entries to be checked for matches. - #[serde(rename="threatInfo")] - pub threat_info: Option, +pub struct RawIndices { + /// The indices to remove from a lexicographically-sorted local list. + pub indices: Option>, } -impl RequestValue for FindThreatMatchesRequest {} +impl Part for RawIndices {} /// Describes a Safe Browsing API update request. Clients can request updates for @@ -1455,12 +1455,12 @@ impl<'a, C, A> EncodedFullHasheGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> EncodedFullHasheGetCall<'a, C, A> @@ -1673,12 +1673,12 @@ impl<'a, C, A> FullHasheFindCall<'a, C, A> where C: BorrowMut, A: /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> FullHasheFindCall<'a, C, A> @@ -1892,12 +1892,12 @@ impl<'a, C, A> ThreatListUpdateFetchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ThreatListUpdateFetchCall<'a, C, A> @@ -2137,12 +2137,12 @@ impl<'a, C, A> EncodedUpdateGetCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> EncodedUpdateGetCall<'a, C, A> @@ -2324,12 +2324,12 @@ impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ThreatListListCall<'a, C, A> @@ -2542,12 +2542,12 @@ impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ThreatMatcheFindCall<'a, C, A> diff --git a/gen/searchconsole1-cli/Cargo.toml b/gen/searchconsole1-cli/Cargo.toml index 393e92b3ba..65da7cf7a2 100644 --- a/gen/searchconsole1-cli/Cargo.toml +++ b/gen/searchconsole1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-searchconsole1-cli" -version = "1.0.6+20170520" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with Search Console (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-searchconsole1] path = "../searchconsole1" -version = "1.0.6+20170520" +version = "1.0.6+20170926" diff --git a/gen/searchconsole1-cli/README.md b/gen/searchconsole1-cli/README.md index 8ad626eeda..d972f474a9 100644 --- a/gen/searchconsole1-cli/README.md +++ b/gen/searchconsole1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Search Console* API at revision *20170520*. The CLI is at version *1.0.6*. +This documentation was generated from the *Search Console* API at revision *20170926*. The CLI is at version *1.0.6*. ```bash searchconsole1 [options] diff --git a/gen/searchconsole1-cli/mkdocs.yml b/gen/searchconsole1-cli/mkdocs.yml index 4af82e4028..c044b1872b 100644 --- a/gen/searchconsole1-cli/mkdocs.yml +++ b/gen/searchconsole1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Search Console v1.0.6+20170520 +site_name: Search Console v1.0.6+20170926 site_url: http://byron.github.io/google-apis-rs/google-searchconsole1-cli site_description: A complete library to interact with Search Console (protocol v1) diff --git a/gen/searchconsole1-cli/src/main.rs b/gen/searchconsole1-cli/src/main.rs index 3ef38a623c..dd19e13aaf 100644 --- a/gen/searchconsole1-cli/src/main.rs +++ b/gen/searchconsole1-cli/src/main.rs @@ -260,7 +260,7 @@ fn main() { let mut app = App::new("searchconsole1") .author("Sebastian Thiel ") - .version("1.0.6+20170520") + .version("1.0.6+20170926") .about("Provides tools for running validation tests against single URLs") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_searchconsole1_cli") .arg(Arg::with_name("folder") diff --git a/gen/searchconsole1/Cargo.toml b/gen/searchconsole1/Cargo.toml index 1bf984cad4..730bcc0911 100644 --- a/gen/searchconsole1/Cargo.toml +++ b/gen/searchconsole1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-searchconsole1" -version = "1.0.6+20170520" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with Search Console (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1" homepage = "https://developers.google.com/webmaster-tools/search-console-api/" -documentation = "https://docs.rs/google-searchconsole1/1.0.6+20170520" +documentation = "https://docs.rs/google-searchconsole1/1.0.6+20170926" license = "MIT" keywords = ["searchconsole", "google", "protocol", "web", "api"] diff --git a/gen/searchconsole1/README.md b/gen/searchconsole1/README.md index ba5b3df4f5..3f5eb00d45 100644 --- a/gen/searchconsole1/README.md +++ b/gen/searchconsole1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-searchconsole1` library allows access to all features of the *Google Search Console* service. -This documentation was generated from *Search Console* crate version *1.0.6+20170520*, where *20170520* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Search Console* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Search Console* *v1* API can be found at the [official documentation site](https://developers.google.com/webmaster-tools/search-console-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/struct.SearchConsole.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/struct.SearchConsole.html) ... * url testing tools - * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/struct.UrlTestingToolMobileFriendlyTestRunCall.html) + * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/struct.UrlTestingToolMobileFriendlyTestRunCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/struct.SearchConsole.html)** +* **[Hub](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/struct.SearchConsole.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.Part.html)** + * **[Parts](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -122,17 +122,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/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")`. @@ -142,29 +142,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/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](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/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](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/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](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/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](https://docs.rs/google-searchconsole1/1.0.6+20170520/google_searchconsole1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/searchconsole1/src/lib.rs b/gen/searchconsole1/src/lib.rs index becf7ffc0f..3f29c6c072 100644 --- a/gen/searchconsole1/src/lib.rs +++ b/gen/searchconsole1/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 *Search Console* crate version *1.0.6+20170520*, where *20170520* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Search Console* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Search Console* *v1* API can be found at the //! [official documentation site](https://developers.google.com/webmaster-tools/search-console-api/). diff --git a/gen/serviceuser1-cli/Cargo.toml b/gen/serviceuser1-cli/Cargo.toml new file mode 100644 index 0000000000..b13609b2d4 --- /dev/null +++ b/gen/serviceuser1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-serviceuser1-cli" +version = "1.0.6+20170916" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Service User (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/serviceuser1-cli" +homepage = "https://cloud.google.com/service-management/" +documentation = "http://byron.github.io/google-apis-rs/google_serviceuser1_cli" +license = "MIT" +keywords = ["serviceuser", "google", "cli"] + +[[bin]] +name = "serviceuser1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-serviceuser1] +path = "../serviceuser1" +version = "1.0.6+20170916" diff --git a/gen/serviceuser1-cli/LICENSE.md b/gen/serviceuser1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/serviceuser1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/serviceuser1-cli/README.md b/gen/serviceuser1-cli/README.md new file mode 100644 index 0000000000..d65e5284cb --- /dev/null +++ b/gen/serviceuser1-cli/README.md @@ -0,0 +1,118 @@ + +The `serviceuser1` command-line interface *(CLI)* allows to use most features of the *Google Service User* 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 *Service User* API can be found at the +[official documentation site](https://cloud.google.com/service-management/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-serviceuser1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/serviceuser1-cli). + +# Usage + +This documentation was generated from the *Service User* API at revision *20170916*. The CLI is at version *1.0.6*. + +```bash +serviceuser1 [options] + projects + services-disable (-r )... [-p ]... [-o ] + services-enable (-r )... [-p ]... [-o ] + services-list [-p ]... [-o ] + services + search [-p ]... [-o ] + serviceuser1 --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 `serviceuser1-`. 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/serviceuser1-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/serviceuser1-secret.json`, assuming that the required *serviceuser* 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. `serviceuser1 --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/serviceuser1-cli/mkdocs.yml b/gen/serviceuser1-cli/mkdocs.yml new file mode 100644 index 0000000000..cbfb3e5f53 --- /dev/null +++ b/gen/serviceuser1-cli/mkdocs.yml @@ -0,0 +1,20 @@ +site_name: Service User v1.0.6+20170916 +site_url: http://byron.github.io/google-apis-rs/google-serviceuser1-cli +site_description: A complete library to interact with Service User (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/serviceuser1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_services-disable.md', 'Projects', 'Services Disable'] +- ['projects_services-enable.md', 'Projects', 'Services Enable'] +- ['projects_services-list.md', 'Projects', 'Services List'] +- ['services_search.md', 'Services', 'Search'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/serviceuser1-cli/src/cmn.rs b/gen/serviceuser1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/serviceuser1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/serviceuser1-cli/src/main.rs b/gen/serviceuser1-cli/src/main.rs new file mode 100644 index 0000000000..d53b61f58e --- /dev/null +++ b/gen/serviceuser1-cli/src/main.rs @@ -0,0 +1,675 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_serviceuser1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::ServiceUser>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_services_disable(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DisableServiceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().services_disable(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_services_enable(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::EnableServiceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().services_enable(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_services_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().services_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().search(); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("services-disable", Some(opt)) => { + call_result = self._projects_services_disable(opt, dry_run, &mut err); + }, + ("services-enable", Some(opt)) => { + call_result = self._projects_services_enable(opt, dry_run, &mut err); + }, + ("services-list", Some(opt)) => { + call_result = self._projects_services_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("services", Some(opt)) => { + match opt.subcommand() { + ("search", Some(opt)) => { + call_result = self._services_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("services".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<'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, "serviceuser1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "serviceuser1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::ServiceUser::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: 'services-disable', 'services-enable' and 'services-list'", vec![ + ("services-disable", + Some(r##"Disable a service so it can no longer be used with a + project. This prevents unintended usage that may cause unexpected billing + charges or security leaks. + + Operation"##), + "Details at http://byron.github.io/google-apis-rs/google_serviceuser1_cli/projects_services-disable", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the consumer and the service to disable for that consumer. + + The Service User implementation accepts the following forms for consumer: + - "project:" + + A valid path would be: + - /v1/projects/my-project/services/servicemanagement.googleapis.com:disable"##), + 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)), + ]), + ("services-enable", + Some(r##"Enable a service so it can be used with a project. + See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for + more information. + + Operation"##), + "Details at http://byron.github.io/google-apis-rs/google_serviceuser1_cli/projects_services-enable", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the consumer and the service to enable for that consumer. + + A valid path would be: + - /v1/projects/my-project/services/servicemanagement.googleapis.com:enable"##), + 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)), + ]), + ("services-list", + Some(r##"List enabled services for the specified consumer."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceuser1_cli/projects_services-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"List enabled services for the specified parent. + + An example valid parent would be: + - projects/my-project"##), + 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)), + ]), + ]), + + ("services", "methods: 'search'", vec![ + ("search", + Some(r##"Search available services. + + When no filter is specified, returns all accessible services. For + authenticated users, also returns all services the calling user has + "servicemanagement.services.bind" permission for."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceuser1_cli/services_search", + 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)), + ]), + ]), + + ]; + + let mut app = App::new("serviceuser1") + .author("Sebastian Thiel ") + .version("1.0.6+20170916") + .about("Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_serviceuser1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/serviceuser1/Cargo.toml b/gen/serviceuser1/Cargo.toml new file mode 100644 index 0000000000..0c8c9618d0 --- /dev/null +++ b/gen/serviceuser1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-serviceuser1" +version = "1.0.6+20170916" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Service User (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/serviceuser1" +homepage = "https://cloud.google.com/service-management/" +documentation = "https://docs.rs/google-serviceuser1/1.0.6+20170916" +license = "MIT" +keywords = ["serviceuser", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/serviceuser1/LICENSE.md b/gen/serviceuser1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/serviceuser1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/serviceuser1/README.md b/gen/serviceuser1/README.md new file mode 100644 index 0000000000..6481e5705d --- /dev/null +++ b/gen/serviceuser1/README.md @@ -0,0 +1,183 @@ + +The `google-serviceuser1` library allows access to all features of the *Google Service User* service. + +This documentation was generated from *Service User* crate version *1.0.6+20170916*, where *20170916* is the exact revision of the *serviceuser:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Service User* *v1* API can be found at the +[official documentation site](https://cloud.google.com/service-management/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.ServiceUser.html) ... + +* projects + * [*services disable*](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.ProjectServiceDisableCall.html), [*services enable*](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.ProjectServiceEnableCall.html) and [*services list*](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.ProjectServiceListCall.html) +* [services](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.Service.html) + * [*search*](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.ServiceSearchCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/struct.ServiceUser.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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().services_enable(...).doit() +let r = hub.projects().services_disable(...).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-serviceuser1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_serviceuser1 as serviceuser1; +use serviceuser1::EnableServiceRequest; +use serviceuser1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use serviceuser1::ServiceUser; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EnableServiceRequest::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().services_enable(req, "name") + .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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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](https://docs.rs/google-serviceuser1/1.0.6+20170916/google_serviceuser1/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 **serviceuser1** 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-rsblob/master/LICENSE.md diff --git a/gen/serviceuser1/src/cmn.rs b/gen/serviceuser1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/serviceuser1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/serviceuser1/src/lib.rs b/gen/serviceuser1/src/lib.rs new file mode 100644 index 0000000000..63f7600923 --- /dev/null +++ b/gen/serviceuser1/src/lib.rs @@ -0,0 +1,4212 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Service User* crate version *1.0.6+20170916*, where *20170916* is the exact revision of the *serviceuser:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Service User* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/service-management/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/serviceuser1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.ServiceUser.html) ... +//! +//! * projects +//! * [*services disable*](struct.ProjectServiceDisableCall.html), [*services enable*](struct.ProjectServiceEnableCall.html) and [*services list*](struct.ProjectServiceListCall.html) +//! * [services](struct.Service.html) +//! * [*search*](struct.ServiceSearchCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.ServiceUser.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().services_enable(...).doit() +//! let r = hub.projects().services_disable(...).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-serviceuser1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_serviceuser1 as serviceuser1; +//! use serviceuser1::EnableServiceRequest; +//! use serviceuser1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use serviceuser1::ServiceUser; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EnableServiceRequest::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().services_enable(req, "name") +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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, + + /// Manage your Google API service configuration + ServiceManagement, + + /// View your data across Google Cloud Platform services + CloudPlatformReadOnly, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::ServiceManagement => "https://www.googleapis.com/auth/service.management", + Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all ServiceUser related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_serviceuser1 as serviceuser1; +/// use serviceuser1::EnableServiceRequest; +/// use serviceuser1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use serviceuser1::ServiceUser; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EnableServiceRequest::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().services_enable(req, "name") +/// .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 ServiceUser { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for ServiceUser {} + +impl<'a, C, A> ServiceUser + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> ServiceUser { + ServiceUser { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://serviceuser.googleapis.com/".to_string(), + _root_url: "https://serviceuser.googleapis.com/".to_string(), + } + } + + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } + pub fn services(&'a self) -> ServiceMethods<'a, C, A> { + ServiceMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://serviceuser.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://serviceuser.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// OAuth scopes are a way to define data and permissions on data. For example, +/// there are scopes defined for "Read-only access to Google Calendar" and +/// "Access to Cloud Platform". Users can consent to a scope for an application, +/// giving it permission to access that data on their behalf. +/// +/// OAuth scope specifications should be fairly coarse grained; a user will need +/// to see and understand the text description of what your scope means. +/// +/// In most cases: use one or at most two OAuth scopes for an entire family of +/// products. If your product has multiple APIs, you should probably be sharing +/// the OAuth scope across all of those APIs. +/// +/// When you need finer grained OAuth consent screens: talk with your product +/// management about how developers will use them in practice. +/// +/// Please note that even though each of the canonical scopes is enough for a +/// request to be accepted and passed to the backend, a request can still fail +/// due to the backend requiring additional scopes or permissions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OAuthRequirements { + /// The list of publicly documented OAuth scopes that are allowed access. An + /// OAuth token containing any of these scopes will be accepted. + /// + /// Example: + /// + /// canonical_scopes: https://www.googleapis.com/auth/calendar, + /// https://www.googleapis.com/auth/calendar.read + #[serde(rename="canonicalScopes")] + pub canonical_scopes: Option, +} + +impl Part for OAuthRequirements {} + + +/// `QuotaLimit` defines a specific limit that applies over a specified duration +/// for a limit type. There can be at most one limit for a duration and limit +/// type combination defined within a `QuotaGroup`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QuotaLimit { + /// User-visible display name for this limit. + /// Optional. If not set, the UI will provide a default display name based on + /// the quota configuration. This field can be used to override the default + /// display name generated from the configuration. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. User-visible, extended description for this quota limit. + /// Should be used only when more context is needed to understand this limit + /// than provided by the limit's display name (see: `display_name`). + pub description: Option, + /// Default number of tokens that can be consumed during the specified + /// duration. This is the number of tokens assigned when a client + /// application developer activates the service for his/her project. + /// + /// Specifying a value of 0 will block all requests. This can be used if you + /// are provisioning quota to selected consumers and blocking others. + /// Similarly, a value of -1 will indicate an unlimited quota. No other + /// negative values are allowed. + /// + /// Used by group-based quotas only. + #[serde(rename="defaultLimit")] + pub default_limit: Option, + /// The name of the metric this quota limit applies to. The quota limits with + /// the same metric will be checked together during runtime. The metric must be + /// defined within the service config. + /// + /// Used by metric-based quotas only. + pub metric: Option, + /// Tiered limit values, currently only STANDARD is supported. + pub values: Option>, + /// Maximum number of tokens that can be consumed during the specified + /// duration. Client application developers can override the default limit up + /// to this maximum. If specified, this value cannot be set to a value less + /// than the default limit. If not specified, it is set to the default limit. + /// + /// To allow clients to apply overrides with no upper bound, set this to -1, + /// indicating unlimited maximum quota. + /// + /// Used by group-based quotas only. + #[serde(rename="maxLimit")] + pub max_limit: Option, + /// Duration of this limit in textual notation. Example: "100s", "24h", "1d". + /// For duration longer than a day, only multiple of days is supported. We + /// support only "100s" and "1d" for now. Additional support will be added in + /// the future. "0" indicates indefinite duration. + /// + /// Used by group-based quotas only. + pub duration: Option, + /// Free tier value displayed in the Developers Console for this limit. + /// The free tier is the number of tokens that will be subtracted from the + /// billed amount when billing is enabled. + /// This field can only be set on a limit with duration "1d", in a billable + /// group; it is invalid on any other limit. If this field is not set, it + /// defaults to 0, indicating that there is no free tier for this service. + /// + /// Used by group-based quotas only. + #[serde(rename="freeTier")] + pub free_tier: Option, + /// Specify the unit of the quota limit. It uses the same syntax as + /// Metric.unit. The supported unit kinds are determined by the quota + /// backend system. + /// + /// The [Google Service Control](https://cloud.google.com/service-control) + /// supports the following unit components: + /// * One of the time intevals: + /// * "/min" for quota every minute. + /// * "/d" for quota every 24 hours, starting 00:00 US Pacific Time. + /// * Otherwise the quota won't be reset by time, such as storage limit. + /// * One and only one of the granted containers: + /// * "/{project}" quota for a project + /// + /// Here are some examples: + /// * "1/min/{project}" for quota per minute per project. + /// + /// Note: the order of unit components is insignificant. + /// The "1" at the beginning is required to follow the metric unit syntax. + /// + /// Used by metric-based quotas only. + pub unit: Option, + /// Name of the quota limit. The name is used to refer to the limit when + /// overriding the default limit on per-consumer basis. + /// + /// For metric-based quota limits, the name must be provided, and it must be + /// unique within the service. The name can only include alphanumeric + /// characters as well as '-'. + /// + /// The maximum length of the limit name is 64 characters. + /// + /// The name of a limit is used as a unique identifier for this limit. + /// Therefore, once a limit has been put into use, its name should be + /// immutable. You can use the display_name field to provide a user-friendly + /// name for the limit. The display name can be evolved over time without + /// affecting the identity of the limit. + pub name: Option, +} + +impl Part for QuotaLimit {} + + +/// Monitoring configuration of the service. +/// +/// The example below shows how to configure monitored resources and metrics +/// for monitoring. In the example, a monitored resource and two metrics are +/// defined. The `library.googleapis.com/book/returned_count` metric is sent +/// to both producer and consumer projects, whereas the +/// `library.googleapis.com/book/overdue_count` metric is only sent to the +/// consumer project. +/// +/// monitored_resources: +/// - type: library.googleapis.com/branch +/// labels: +/// - key: /city +/// description: The city where the library branch is located in. +/// - key: /name +/// description: The name of the branch. +/// metrics: +/// - name: library.googleapis.com/book/returned_count +/// metric_kind: DELTA +/// value_type: INT64 +/// labels: +/// - key: /customer_id +/// - name: library.googleapis.com/book/overdue_count +/// metric_kind: GAUGE +/// value_type: INT64 +/// labels: +/// - key: /customer_id +/// monitoring: +/// producer_destinations: +/// - monitored_resource: library.googleapis.com/branch +/// metrics: +/// - library.googleapis.com/book/returned_count +/// consumer_destinations: +/// - monitored_resource: library.googleapis.com/branch +/// metrics: +/// - library.googleapis.com/book/returned_count +/// - library.googleapis.com/book/overdue_count +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Monitoring { + /// Monitoring configurations for sending metrics to the producer project. + /// There can be multiple producer destinations, each one must have a + /// different monitored resource type. A metric can be used in at most + /// one producer destination. + #[serde(rename="producerDestinations")] + pub producer_destinations: Option>, + /// Monitoring configurations for sending metrics to the consumer project. + /// There can be multiple consumer destinations, each one must have a + /// different monitored resource type. A metric can be used in at most + /// one consumer destination. + #[serde(rename="consumerDestinations")] + pub consumer_destinations: Option>, +} + +impl Part for Monitoring {} + + +/// Customize service error responses. For example, list any service +/// specific protobuf types that can appear in error detail lists of +/// error responses. +/// +/// Example: +/// +/// custom_error: +/// types: +/// - google.foo.v1.CustomError +/// - google.foo.v1.AnotherError +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomError { + /// The list of custom error rules that apply to individual API messages. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, + /// The list of custom error detail types, e.g. 'google.foo.v1.CustomError'. + pub types: Option>, +} + +impl Part for CustomError {} + + +/// `Service` is the root object of Google service configuration schema. It +/// describes basic information about a service, such as the name and the +/// title, and delegates other aspects to sub-sections. Each sub-section is +/// either a proto message or a repeated proto message that configures a +/// specific aspect, such as auth. See each proto message definition for details. +/// +/// Example: +/// +/// type: google.api.Service +/// config_version: 3 +/// name: calendar.googleapis.com +/// title: Google Calendar API +/// apis: +/// - name: google.calendar.v3.Calendar +/// authentication: +/// providers: +/// - id: google_calendar_auth +/// jwks_uri: https://www.googleapis.com/oauth2/v1/certs +/// issuer: https://securetoken.google.com +/// rules: +/// - selector: "*" +/// requirements: +/// provider_id: google_calendar_auth +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search services](struct.ServiceSearchCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Service { + /// Configuration for the service control plane. + pub control: Option, + /// Defines the monitored resources used by this service. This is required + /// by the Service.monitoring and Service.logging configurations. + #[serde(rename="monitoredResources")] + pub monitored_resources: Option>, + /// The Google project that owns this service. + #[serde(rename="producerProjectId")] + pub producer_project_id: Option, + /// HTTP configuration. + pub http: Option, + /// Defines the logs used by this service. + pub logs: Option>, + /// A list of API interfaces exported by this service. Only the `name` field + /// of the google.protobuf.Api needs to be provided by the configuration + /// author, as the remaining fields will be derived from the IDL during the + /// normalization process. It is an error to specify an API interface here + /// which cannot be resolved against the associated IDL files. + pub apis: Option>, + /// Additional API documentation. + pub documentation: Option, + /// Custom error configuration. + #[serde(rename="customError")] + pub custom_error: Option, + /// Quota configuration. + pub quota: Option, + /// API visibility configuration. + pub visibility: Option, + /// Defines the metrics used by this service. + pub metrics: Option>, + /// Logging configuration. + pub logging: Option, + /// A list of all enum types included in this API service. Enums + /// referenced directly or indirectly by the `apis` are automatically + /// included. Enums which are not referenced but shall be included + /// should be listed here by name. Example: + /// + /// enums: + /// - name: google.someapi.v1.SomeEnum + pub enums: Option>, + /// A unique ID for a specific instance of this message, typically assigned + /// by the client for tracking purpose. If empty, the server may choose to + /// generate one instead. + pub id: Option, + /// A list of all proto message types included in this API service. + /// Types referenced directly or indirectly by the `apis` are + /// automatically included. Messages which are not referenced but + /// shall be included, such as types used by the `google.protobuf.Any` type, + /// should be listed here by name. Example: + /// + /// types: + /// - name: google.protobuf.Int32 + pub types: Option>, + /// API backend configuration. + pub backend: Option, + /// Configuration for network endpoints. If this is empty, then an endpoint + /// with the same name as the service is automatically generated to service all + /// defined APIs. + pub endpoints: Option>, + /// Monitoring configuration. + pub monitoring: Option, + /// The DNS address at which this service is available, + /// e.g. `calendar.googleapis.com`. + pub name: Option, + /// System parameter configuration. + #[serde(rename="systemParameters")] + pub system_parameters: Option, + /// The product title for this service. + pub title: Option, + /// Output only. The source information for this configuration if available. + #[serde(rename="sourceInfo")] + pub source_info: Option, + /// A list of all proto message types included in this API service. + /// It serves similar purpose as [google.api.Service.types], except that + /// these types are not needed by user-defined APIs. Therefore, they will not + /// show up in the generated discovery doc. This field should only be used + /// to define system APIs in ESF. + #[serde(rename="systemTypes")] + pub system_types: Option>, + /// Auth configuration. + pub authentication: Option, + /// Context configuration. + pub context: Option, + /// Configuration controlling usage of this service. + pub usage: Option, + /// The semantic version of the service configuration. The config version + /// affects the interpretation of the service configuration. For example, + /// certain features are enabled by default for certain config versions. + /// The latest config version is `3`. + #[serde(rename="configVersion")] + pub config_version: Option, + /// Experimental configuration. + pub experimental: Option, +} + +impl Resource for Service {} + + +/// Define a system parameter rule mapping system parameter definitions to +/// methods. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemParameterRule { + /// Define parameters. Multiple names may be defined for a parameter. + /// For a given method call, only one of them should be used. If multiple + /// names are used the behavior is implementation-dependent. + /// If none of the specified names are present the behavior is + /// parameter-dependent. + pub parameters: Option>, + /// Selects the methods to which this rule applies. Use '*' to indicate all + /// methods in all APIs. + /// + /// Refer to selector for syntax details. + pub selector: Option, +} + +impl Part for SystemParameterRule {} + + +/// Configuration of a specific monitoring destination (the producer project +/// or the consumer project). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MonitoringDestination { + /// The monitored resource type. The type must be defined in + /// Service.monitored_resources section. + #[serde(rename="monitoredResource")] + pub monitored_resource: Option, + /// Names of the metrics to report to this monitoring destination. + /// Each name must be defined in Service.metrics section. + pub metrics: Option>, +} + +impl Part for MonitoringDestination {} + + +/// A custom pattern is used for defining custom HTTP verb. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomHttpPattern { + /// The path matched by this custom verb. + pub path: Option, + /// The name of this custom HTTP verb. + pub kind: Option, +} + +impl Part for CustomHttpPattern {} + + +/// A single field of a message 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 Field { + /// The field type. + pub kind: Option, + /// The index of the field type in `Type.oneofs`, for message or enumeration + /// types. The first type has index 1; zero means the type is not in the list. + #[serde(rename="oneofIndex")] + pub oneof_index: Option, + /// The field type URL, without the scheme, for message or enumeration + /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + #[serde(rename="typeUrl")] + pub type_url: Option, + /// The field name. + pub name: Option, + /// The string value of the default value of this field. Proto2 syntax only. + #[serde(rename="defaultValue")] + pub default_value: Option, + /// The field JSON name. + #[serde(rename="jsonName")] + pub json_name: Option, + /// The field number. + pub number: Option, + /// The field cardinality. + pub cardinality: Option, + /// The protocol buffer options. + pub options: Option>, + /// Whether to use alternative packed wire representation. + pub packed: Option, +} + +impl Part for Field {} + + +/// `Authentication` defines the authentication configuration for an API. +/// +/// Example for an API targeted for external use: +/// +/// name: calendar.googleapis.com +/// authentication: +/// providers: +/// - id: google_calendar_auth +/// jwks_uri: https://www.googleapis.com/oauth2/v1/certs +/// issuer: https://securetoken.google.com +/// rules: +/// - selector: "*" +/// requirements: +/// provider_id: google_calendar_auth +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Authentication { + /// A list of authentication rules that apply to individual API methods. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, + /// Defines a set of authentication providers that a service supports. + pub providers: Option>, +} + +impl Part for Authentication {} + + +/// Define a parameter's name and location. The parameter may be passed as either +/// an HTTP header or a URL query parameter, and if both are passed the behavior +/// is implementation-dependent. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemParameter { + /// Define the URL query parameter name to use for the parameter. It is case + /// sensitive. + #[serde(rename="urlQueryParameter")] + pub url_query_parameter: Option, + /// Define the name of the parameter, such as "api_key" . It is case sensitive. + pub name: Option, + /// Define the HTTP header name to use for the parameter. It is case + /// insensitive. + #[serde(rename="httpHeader")] + pub http_header: Option, +} + +impl Part for SystemParameter {} + + +/// Response message for `ListEnabledServices` 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*). +/// +/// * [services list projects](struct.ProjectServiceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListEnabledServicesResponse { + /// Token that can be passed to `ListEnabledServices` to resume a paginated + /// query. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Services enabled for the specified parent. + pub services: Option>, +} + +impl ResponseResult for ListEnabledServicesResponse {} + + +/// Configuration controlling usage of a service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Usage { + /// A list of usage rules that apply to individual API methods. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, + /// The full resource name of a channel used for sending notifications to the + /// service producer. + /// + /// Google Service Management currently only supports + /// [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + /// channel. To use Google Cloud Pub/Sub as the channel, this must be the name + /// of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + /// documented in https://cloud.google.com/pubsub/docs/overview. + #[serde(rename="producerNotificationChannel")] + pub producer_notification_channel: Option, + /// Requirements that must be satisfied before a consumer project can use the + /// service. Each requirement is of the form /; + /// for example 'serviceusage.googleapis.com/billing-enabled'. + pub requirements: Option>, +} + +impl Part for Usage {} + + +/// A backend rule provides configuration for an individual API element. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendRule { + /// Minimum deadline in seconds needed for this method. Calls having deadline + /// value lower than this will be rejected. + #[serde(rename="minDeadline")] + pub min_deadline: Option, + /// The number of seconds to wait for a response from a request. The default + /// deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds. + pub deadline: Option, + /// The address of the API backend. + pub address: Option, + /// Selects the methods to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, +} + +impl Part for BackendRule {} + + +/// A protocol buffer message 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 Type { + /// The list of types appearing in `oneof` definitions in this type. + pub oneofs: Option>, + /// The fully qualified message name. + pub name: Option, + /// The list of fields. + pub fields: Option>, + /// The source context. + #[serde(rename="sourceContext")] + pub source_context: Option, + /// The protocol buffer options. + pub options: Option>, + /// The source syntax. + pub syntax: Option, +} + +impl Part for Type {} + + +/// Method represents a method of an API interface. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Method { + /// A URL of the input message type. + #[serde(rename="requestTypeUrl")] + pub request_type_url: Option, + /// If true, the response is streamed. + #[serde(rename="responseStreaming")] + pub response_streaming: Option, + /// Any metadata attached to the method. + pub options: Option>, + /// The simple name of this method. + pub name: Option, + /// The URL of the output message type. + #[serde(rename="responseTypeUrl")] + pub response_type_url: Option, + /// If true, the request is streamed. + #[serde(rename="requestStreaming")] + pub request_streaming: Option, + /// The source syntax of this method. + pub syntax: Option, +} + +impl Part for Method {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// `HttpRule` defines the mapping of an RPC method to one or more HTTP +/// REST API methods. The mapping specifies how different portions of the RPC +/// request message are mapped to URL path, URL query parameters, and +/// HTTP request body. The mapping is typically specified as an +/// `google.api.http` annotation on the RPC method, +/// see "google/api/annotations.proto" for details. +/// +/// The mapping consists of a field specifying the path template and +/// method kind. The path template can refer to fields in the request +/// message, as in the example below which describes a REST GET +/// operation on a resource collection of messages: +/// +/// +/// service Messaging { +/// rpc GetMessage(GetMessageRequest) returns (Message) { +/// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; +/// } +/// } +/// message GetMessageRequest { +/// message SubMessage { +/// string subfield = 1; +/// } +/// string message_id = 1; // mapped to the URL +/// SubMessage sub = 2; // `sub.subfield` is url-mapped +/// } +/// message Message { +/// string text = 1; // content of the resource +/// } +/// +/// The same http annotation can alternatively be expressed inside the +/// `GRPC API Configuration` YAML file. +/// +/// http: +/// rules: +/// - selector: .Messaging.GetMessage +/// get: /v1/messages/{message_id}/{sub.subfield} +/// +/// This definition enables an automatic, bidrectional mapping of HTTP +/// JSON to RPC. Example: +/// +/// HTTP | RPC +/// -----|----- +/// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` +/// +/// In general, not only fields but also field paths can be referenced +/// from a path pattern. Fields mapped to the path pattern cannot be +/// repeated and must have a primitive (non-message) type. +/// +/// Any fields in the request message which are not bound by the path +/// pattern automatically become (optional) HTTP query +/// parameters. Assume the following definition of the request message: +/// +/// +/// service Messaging { +/// rpc GetMessage(GetMessageRequest) returns (Message) { +/// option (google.api.http).get = "/v1/messages/{message_id}"; +/// } +/// } +/// message GetMessageRequest { +/// message SubMessage { +/// string subfield = 1; +/// } +/// string message_id = 1; // mapped to the URL +/// int64 revision = 2; // becomes a parameter +/// SubMessage sub = 3; // `sub.subfield` becomes a parameter +/// } +/// +/// +/// This enables a HTTP JSON to RPC mapping as below: +/// +/// HTTP | RPC +/// -----|----- +/// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` +/// +/// Note that fields which are mapped to HTTP parameters must have a +/// primitive type or a repeated primitive type. Message types are not +/// allowed. In the case of a repeated type, the parameter can be +/// repeated in the URL, as in `...?param=A¶m=B`. +/// +/// For HTTP method kinds which allow a request body, the `body` field +/// specifies the mapping. Consider a REST update method on the +/// message resource collection: +/// +/// +/// service Messaging { +/// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +/// option (google.api.http) = { +/// put: "/v1/messages/{message_id}" +/// body: "message" +/// }; +/// } +/// } +/// message UpdateMessageRequest { +/// string message_id = 1; // mapped to the URL +/// Message message = 2; // mapped to the body +/// } +/// +/// +/// The following HTTP JSON to RPC mapping is enabled, where the +/// representation of the JSON in the request body is determined by +/// protos JSON encoding: +/// +/// HTTP | RPC +/// -----|----- +/// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +/// +/// The special name `*` can be used in the body mapping to define that +/// every field not bound by the path template should be mapped to the +/// request body. This enables the following alternative definition of +/// the update method: +/// +/// service Messaging { +/// rpc UpdateMessage(Message) returns (Message) { +/// option (google.api.http) = { +/// put: "/v1/messages/{message_id}" +/// body: "*" +/// }; +/// } +/// } +/// message Message { +/// string message_id = 1; +/// string text = 2; +/// } +/// +/// +/// The following HTTP JSON to RPC mapping is enabled: +/// +/// HTTP | RPC +/// -----|----- +/// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` +/// +/// Note that when using `*` in the body mapping, it is not possible to +/// have HTTP parameters, as all fields not bound by the path end in +/// the body. This makes this option more rarely used in practice of +/// defining REST APIs. The common usage of `*` is in custom methods +/// which don't use the URL at all for transferring data. +/// +/// It is possible to define multiple HTTP methods for one RPC by using +/// the `additional_bindings` option. Example: +/// +/// service Messaging { +/// rpc GetMessage(GetMessageRequest) returns (Message) { +/// option (google.api.http) = { +/// get: "/v1/messages/{message_id}" +/// additional_bindings { +/// get: "/v1/users/{user_id}/messages/{message_id}" +/// } +/// }; +/// } +/// } +/// message GetMessageRequest { +/// string message_id = 1; +/// string user_id = 2; +/// } +/// +/// +/// This enables the following two alternative HTTP JSON to RPC +/// mappings: +/// +/// HTTP | RPC +/// -----|----- +/// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +/// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` +/// +/// # Rules for HTTP mapping +/// +/// The rules for mapping HTTP path, query parameters, and body fields +/// to the request message are as follows: +/// +/// 1. The `body` field specifies either `*` or a field path, or is +/// omitted. If omitted, it indicates there is no HTTP request body. +/// 2. Leaf fields (recursive expansion of nested messages in the +/// request) can be classified into three types: +/// (a) Matched in the URL template. +/// (b) Covered by body (if body is `*`, everything except (a) fields; +/// else everything under the body field) +/// (c) All other fields. +/// 3. URL query parameters found in the HTTP request are mapped to (c) fields. +/// 4. Any body sent with an HTTP request can contain only (b) fields. +/// +/// The syntax of the path template is as follows: +/// +/// Template = "/" Segments [ Verb ] ; +/// Segments = Segment { "/" Segment } ; +/// Segment = "*" | "**" | LITERAL | Variable ; +/// Variable = "{" FieldPath [ "=" Segments ] "}" ; +/// FieldPath = IDENT { "." IDENT } ; +/// Verb = ":" LITERAL ; +/// +/// The syntax `*` matches a single path segment. The syntax `**` matches zero +/// or more path segments, which must be the last part of the path except the +/// `Verb`. The syntax `LITERAL` matches literal text in the path. +/// +/// The syntax `Variable` matches part of the URL path as specified by its +/// template. A variable template must not contain other variables. If a variable +/// matches a single path segment, its template may be omitted, e.g. `{var}` +/// is equivalent to `{var=*}`. +/// +/// If a variable contains exactly one path segment, such as `"{var}"` or +/// `"{var=*}"`, when such a variable is expanded into a URL path, all characters +/// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the +/// Discovery Document as `{var}`. +/// +/// If a variable contains one or more path segments, such as `"{var=foo/*}"` +/// or `"{var=**}"`, when such a variable is expanded into a URL path, all +/// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables +/// show up in the Discovery Document as `{+var}`. +/// +/// NOTE: While the single segment variable matches the semantics of +/// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 +/// Simple String Expansion, the multi segment variable **does not** match +/// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion +/// does not expand special characters like `?` and `#`, which would lead +/// to invalid URLs. +/// +/// NOTE: the field paths in variables and in the `body` must not refer to +/// repeated fields or map fields. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpRule { + /// The name of the request field whose value is mapped to the HTTP body, or + /// `*` for mapping all fields not captured by the path pattern to the HTTP + /// body. NOTE: the referred field must not be a repeated field and must be + /// present at the top-level of request message type. + pub body: Option, + /// The custom pattern is used for specifying an HTTP method that is not + /// included in the `pattern` field, such as HEAD, or "*" to leave the + /// HTTP method unspecified for this rule. The wild-card rule is useful + /// for services that provide content to Web (HTML) clients. + pub custom: Option, + /// Specifies the permission(s) required for an API element for the overall + /// API request to succeed. It is typically used to mark request message fields + /// that contain the name of the resource and indicates the permissions that + /// will be checked on that resource. + pub authorizations: Option>, + /// Used for listing and getting information about resources. + pub get: Option, + /// Use this only for Scotty Requests. Do not use this for media support using + /// Bytestream, add instead + /// [][google.bytestream.RestByteStream] as an API to your + /// configuration for Bytestream methods. + #[serde(rename="mediaUpload")] + pub media_upload: Option, + /// Additional HTTP bindings for the selector. Nested bindings must + /// not contain an `additional_bindings` field themselves (that is, + /// the nesting may only be one level deep). + #[serde(rename="additionalBindings")] + pub additional_bindings: Option>, + /// DO NOT USE. This is an experimental field. + /// + /// Optional. The REST collection name is by default derived from the URL + /// pattern. If specified, this field overrides the default collection name. + /// Example: + /// + /// rpc AddressesAggregatedList(AddressesAggregatedListRequest) + /// returns (AddressesAggregatedListResponse) { + /// option (google.api.http) = { + /// get: "/v1/projects/{project_id}/aggregated/addresses" + /// rest_collection: "projects.addresses" + /// }; + /// } + /// + /// This method has the automatically derived collection name + /// "projects.aggregated". Because, semantically, this rpc is actually an + /// operation on the "projects.addresses" collection, the `rest_collection` + /// field is configured to override the derived collection name. + #[serde(rename="restCollection")] + pub rest_collection: Option, + /// Selects methods to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, + /// The name of the response field whose value is mapped to the HTTP body of + /// response. Other response fields are ignored. This field is optional. When + /// not set, the response message will be used as HTTP body of response. + /// NOTE: the referred field must be not a repeated field and must be present + /// at the top-level of response message type. + #[serde(rename="responseBody")] + pub response_body: Option, + /// DO NOT USE. This is an experimental field. + /// + /// Optional. The rest method name is by default derived from the URL + /// pattern. If specified, this field overrides the default method name. + /// Example: + /// + /// rpc CreateResource(CreateResourceRequest) + /// returns (CreateResourceResponse) { + /// option (google.api.http) = { + /// post: "/v1/resources", + /// body: "resource", + /// rest_method_name: "insert" + /// }; + /// } + /// + /// This method has the automatically derived rest method name + /// "create", but for backwards compatibility with apiary, it is specified as + /// insert. + #[serde(rename="restMethodName")] + pub rest_method_name: Option, + /// Use this only for Scotty Requests. Do not use this for bytestream methods. + /// For media support, add instead [][google.bytestream.RestByteStream] as an + /// API to your configuration. + #[serde(rename="mediaDownload")] + pub media_download: Option, + /// Used for updating a resource. + pub put: Option, + /// Used for creating a resource. + pub post: Option, + /// Used for updating a resource. + pub patch: Option, + /// Used for deleting a resource. + pub delete: Option, +} + +impl Part for HttpRule {} + + +/// Defines the HTTP configuration for an API service. It contains a list of +/// HttpRule, each specifying the mapping of an RPC method +/// to one or more HTTP REST API methods. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Http { + /// A list of HTTP configuration rules that apply to individual API methods. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, + /// When set to true, URL path parmeters will be fully URI-decoded except in + /// cases of single segment matches in reserved expansion, where "%2F" will be + /// left encoded. + /// + /// The default behavior is to not decode RFC 6570 reserved characters in multi + /// segment matches. + #[serde(rename="fullyDecodeReservedExpansion")] + pub fully_decode_reserved_expansion: Option, +} + +impl Part for Http {} + + +/// Configuration for an anthentication provider, including support for +/// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthProvider { + /// URL of the provider's public key set to validate signature of the JWT. See + /// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + /// Optional if the key set document: + /// - can be retrieved from + /// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html + /// of the issuer. + /// - can be inferred from the email domain of the issuer (e.g. a Google service account). + /// + /// Example: https://www.googleapis.com/oauth2/v1/certs + #[serde(rename="jwksUri")] + pub jwks_uri: Option, + /// The list of JWT + /// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + /// that are allowed to access. A JWT containing any of these audiences will + /// be accepted. When this setting is absent, only JWTs with audience + /// "https://Service_name/API_name" + /// will be accepted. For example, if no audiences are in the setting, + /// LibraryService API will only accept JWTs with the following audience + /// "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + /// + /// Example: + /// + /// audiences: bookstore_android.apps.googleusercontent.com, + /// bookstore_web.apps.googleusercontent.com + pub audiences: Option, + /// The unique identifier of the auth provider. It will be referred to by + /// `AuthRequirement.provider_id`. + /// + /// Example: "bookstore_auth". + pub id: Option, + /// Redirect URL if JWT token is required but no present or is expired. + /// Implement authorizationUrl of securityDefinitions in OpenAPI spec. + #[serde(rename="authorizationUrl")] + pub authorization_url: Option, + /// Identifies the principal that issued the JWT. See + /// https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + /// Usually a URL or an email address. + /// + /// Example: https://securetoken.google.com + /// Example: 1234567-compute@developer.gserviceaccount.com + pub issuer: Option, +} + +impl Part for AuthProvider {} + + +/// Defines a metric type and its schema. Once a metric descriptor is created, +/// deleting or altering it stops data collection and makes the metric type's +/// existing data unusable. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetricDescriptor { + /// A concise name for the metric, which can be displayed in user interfaces. + /// Use sentence case without an ending period, for example "Request count". + #[serde(rename="displayName")] + pub display_name: Option, + /// The resource name of the metric descriptor. Depending on the + /// implementation, the name typically includes: (1) the parent resource name + /// that defines the scope of the metric type or of its data; and (2) the + /// metric's URL-encoded type, which also appears in the `type` field of this + /// descriptor. For example, following is the resource name of a custom + /// metric within the GCP project `my-project-id`: + /// + /// "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" + pub name: Option, + /// Whether the metric records instantaneous values, changes to a value, etc. + /// Some combinations of `metric_kind` and `value_type` might not be supported. + #[serde(rename="metricKind")] + pub metric_kind: Option, + /// Whether the measurement is an integer, a floating-point number, etc. + /// Some combinations of `metric_kind` and `value_type` might not be supported. + #[serde(rename="valueType")] + pub value_type: Option, + /// The set of labels that can be used to describe a specific + /// instance of this metric type. For example, the + /// `appengine.googleapis.com/http/server/response_latencies` metric + /// type has a label for the HTTP response code, `response_code`, so + /// you can look at latencies for successful responses or just + /// for responses that failed. + pub labels: Option>, + /// The metric type, including its DNS name prefix. The type is not + /// URL-encoded. All user-defined custom metric types have the DNS name + /// `custom.googleapis.com`. Metric types should use a natural hierarchical + /// grouping. For example: + /// + /// "custom.googleapis.com/invoice/paid/amount" + /// "appengine.googleapis.com/http/server/response_latencies" + #[serde(rename="type")] + pub type_: Option, + /// The unit in which the metric value is reported. It is only applicable + /// if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The + /// supported units are a subset of [The Unified Code for Units of + /// Measure](http://unitsofmeasure.org/ucum.html) standard: + /// + /// **Basic units (UNIT)** + /// + /// * `bit` bit + /// * `By` byte + /// * `s` second + /// * `min` minute + /// * `h` hour + /// * `d` day + /// + /// **Prefixes (PREFIX)** + /// + /// * `k` kilo (10**3) + /// * `M` mega (10**6) + /// * `G` giga (10**9) + /// * `T` tera (10**12) + /// * `P` peta (10**15) + /// * `E` exa (10**18) + /// * `Z` zetta (10**21) + /// * `Y` yotta (10**24) + /// * `m` milli (10**-3) + /// * `u` micro (10**-6) + /// * `n` nano (10**-9) + /// * `p` pico (10**-12) + /// * `f` femto (10**-15) + /// * `a` atto (10**-18) + /// * `z` zepto (10**-21) + /// * `y` yocto (10**-24) + /// * `Ki` kibi (2**10) + /// * `Mi` mebi (2**20) + /// * `Gi` gibi (2**30) + /// * `Ti` tebi (2**40) + /// + /// **Grammar** + /// + /// The grammar includes the dimensionless unit `1`, such as `1/s`. + /// + /// The grammar also includes these connectors: + /// + /// * `/` division (as an infix operator, e.g. `1/s`). + /// * `.` multiplication (as an infix operator, e.g. `GBy.d`) + /// + /// The grammar for a unit is as follows: + /// + /// Expression = Component { "." Component } { "/" Component } ; + /// + /// Component = [ PREFIX ] UNIT [ Annotation ] + /// | Annotation + /// | "1" + /// ; + /// + /// Annotation = "{" NAME "}" ; + /// + /// Notes: + /// + /// * `Annotation` is just a comment if it follows a `UNIT` and is + /// equivalent to `1` if it is used alone. For examples, + /// `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. + /// * `NAME` is a sequence of non-blank printable ASCII characters not + /// containing '{' or '}'. + pub unit: Option, + /// A detailed description of the metric, which can be used in documentation. + pub description: Option, +} + +impl Part for MetricDescriptor {} + + +/// `SourceContext` represents information about the source of a +/// protobuf element, like the file in which it is defined. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SourceContext { + /// The path-qualified name of the .proto file that contained the associated + /// protobuf element. For example: `"google/protobuf/source_context.proto"`. + #[serde(rename="fileName")] + pub file_name: Option, +} + +impl Part for SourceContext {} + + +/// The published version of a Service that is managed by +/// Google Service Management. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PublishedService { + /// The resource name of the service. + /// + /// A valid name would be: + /// - services/serviceuser.googleapis.com + pub name: Option, + /// The service's published configuration. + pub service: Option, +} + +impl Part for PublishedService {} + + +/// Defines the Media configuration for a service in case of an upload. +/// Use this only for Scotty Requests. Do not use this for media support using +/// Bytestream, add instead [][google.bytestream.RestByteStream] as an API to +/// your configuration for Bytestream methods. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MediaUpload { + /// Whether to receive a notification for progress changes of media upload. + #[serde(rename="progressNotification")] + pub progress_notification: Option, + /// Whether to receive a notification on the start of media upload. + #[serde(rename="startNotification")] + pub start_notification: Option, + /// An array of mimetype patterns. Esf will only accept uploads that match one + /// of the given patterns. + #[serde(rename="mimeTypes")] + pub mime_types: Option>, + /// A boolean that determines whether a notification for the completion of an + /// upload should be sent to the backend. These notifications will not be seen + /// by the client and will not consume quota. + #[serde(rename="completeNotification")] + pub complete_notification: Option, + /// Whether upload is enabled. + pub enabled: Option, + /// Name of the Scotty dropzone to use for the current API. + pub dropzone: Option, + /// Optional maximum acceptable size for an upload. + /// The size is specified in bytes. + #[serde(rename="maxSize")] + pub max_size: Option, + /// DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. + /// + /// Specify name of the upload service if one is used for upload. + #[serde(rename="uploadService")] + pub upload_service: Option, +} + +impl Part for MediaUpload {} + + +/// Quota configuration helps to achieve fairness and budgeting in service +/// usage. +/// +/// The quota configuration works this way: +/// - The service configuration defines a set of metrics. +/// - For API calls, the quota.metric_rules maps methods to metrics with +/// corresponding costs. +/// - The quota.limits defines limits on the metrics, which will be used for +/// quota checks at runtime. +/// +/// An example quota configuration in yaml format: +/// +/// quota: +/// +/// - name: apiWriteQpsPerProject +/// metric: library.googleapis.com/write_calls +/// unit: "1/min/{project}" # rate limit for consumer projects +/// values: +/// STANDARD: 10000 +/// +/// +/// # The metric rules bind all methods to the read_calls metric, +/// # except for the UpdateBook and DeleteBook methods. These two methods +/// # are mapped to the write_calls metric, with the UpdateBook method +/// # consuming at twice rate as the DeleteBook method. +/// metric_rules: +/// - selector: "*" +/// metric_costs: +/// library.googleapis.com/read_calls: 1 +/// - selector: google.example.library.v1.LibraryService.UpdateBook +/// metric_costs: +/// library.googleapis.com/write_calls: 2 +/// - selector: google.example.library.v1.LibraryService.DeleteBook +/// metric_costs: +/// library.googleapis.com/write_calls: 1 +/// +/// Corresponding Metric definition: +/// +/// metrics: +/// - name: library.googleapis.com/read_calls +/// display_name: Read requests +/// metric_kind: DELTA +/// value_type: INT64 +/// +/// - name: library.googleapis.com/write_calls +/// display_name: Write requests +/// metric_kind: DELTA +/// value_type: INT64 +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Quota { + /// List of `MetricRule` definitions, each one mapping a selected method to one + /// or more metrics. + #[serde(rename="metricRules")] + pub metric_rules: Option>, + /// List of `QuotaLimit` definitions for the service. + pub limits: Option>, +} + +impl Part for Quota {} + + +/// `Visibility` defines restrictions for the visibility of service +/// elements. Restrictions are specified using visibility labels +/// (e.g., TRUSTED_TESTER) that are elsewhere linked to users and projects. +/// +/// Users and projects can have access to more than one visibility label. The +/// effective visibility for multiple labels is the union of each label's +/// elements, plus any unrestricted elements. +/// +/// If an element and its parents have no restrictions, visibility is +/// unconditionally granted. +/// +/// Example: +/// +/// visibility: +/// rules: +/// - selector: google.calendar.Calendar.EnhancedSearch +/// restriction: TRUSTED_TESTER +/// - selector: google.calendar.Calendar.Delegate +/// restriction: GOOGLE_INTERNAL +/// +/// Here, all methods are publicly visible except for the restricted methods +/// EnhancedSearch and Delegate. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Visibility { + /// A list of visibility rules that apply to individual API elements. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, +} + +impl Part for Visibility {} + + +/// A custom error rule. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomErrorRule { + /// Mark this message as possible payload in error response. Otherwise, + /// objects of this type will be filtered when they appear in error payload. + #[serde(rename="isErrorType")] + pub is_error_type: Option, + /// Selects messages to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, +} + +impl Part for CustomErrorRule {} + + +/// Bind API methods to metrics. Binding a method to a metric causes that +/// metric's configured quota behaviors to apply to the method call. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetricRule { + /// Metrics to update when the selected methods are called, and the associated + /// cost applied to each metric. + /// + /// The key of the map is the metric name, and the values are the amount + /// increased for the metric against which the quota limits are defined. + /// The value must not be negative. + #[serde(rename="metricCosts")] + pub metric_costs: Option>, + /// Selects the methods to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, +} + +impl Part for MetricRule {} + + +/// A description of a label. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LabelDescriptor { + /// The type of data that can be assigned to the label. + #[serde(rename="valueType")] + pub value_type: Option, + /// A human-readable description for the label. + pub description: Option, + /// The label key. + pub key: Option, +} + +impl Part for LabelDescriptor {} + + +/// Declares an API Interface to be included in this interface. The including +/// interface must redeclare all the methods from the included interface, but +/// documentation and options are inherited as follows: +/// +/// - If after comment and whitespace stripping, the documentation +/// string of the redeclared method is empty, it will be inherited +/// from the original method. +/// +/// - Each annotation belonging to the service config (http, +/// visibility) which is not set in the redeclared method will be +/// inherited. +/// +/// - If an http annotation is inherited, the path pattern will be +/// modified as follows. Any version prefix will be replaced by the +/// version of the including interface plus the root path if +/// specified. +/// +/// Example of a simple mixin: +/// +/// package google.acl.v1; +/// service AccessControl { +/// // Get the underlying ACL object. +/// rpc GetAcl(GetAclRequest) returns (Acl) { +/// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +/// } +/// } +/// +/// package google.storage.v2; +/// service Storage { +/// // rpc GetAcl(GetAclRequest) returns (Acl); +/// +/// // Get a data record. +/// rpc GetData(GetDataRequest) returns (Data) { +/// option (google.api.http).get = "/v2/{resource=**}"; +/// } +/// } +/// +/// Example of a mixin configuration: +/// +/// apis: +/// - name: google.storage.v2.Storage +/// mixins: +/// - name: google.acl.v1.AccessControl +/// +/// The mixin construct implies that all methods in `AccessControl` are +/// also declared with same name and request/response types in +/// `Storage`. A documentation generator or annotation processor will +/// see the effective `Storage.GetAcl` method after inherting +/// documentation and annotations as follows: +/// +/// service Storage { +/// // Get the underlying ACL object. +/// rpc GetAcl(GetAclRequest) returns (Acl) { +/// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +/// } +/// ... +/// } +/// +/// Note how the version in the path pattern changed from `v1` to `v2`. +/// +/// If the `root` field in the mixin is specified, it should be a +/// relative path under which inherited HTTP paths are placed. Example: +/// +/// apis: +/// - name: google.storage.v2.Storage +/// mixins: +/// - name: google.acl.v1.AccessControl +/// root: acls +/// +/// This implies the following inherited HTTP annotation: +/// +/// service Storage { +/// // Get the underlying ACL object. +/// rpc GetAcl(GetAclRequest) returns (Acl) { +/// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +/// } +/// ... +/// } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Mixin { + /// If non-empty specifies a path under which inherited HTTP paths + /// are rooted. + pub root: Option, + /// The fully qualified name of the interface which is included. + pub name: Option, +} + +impl Part for Mixin {} + + +/// An object that describes the schema of a MonitoredResource object using a +/// type name and a set of labels. For example, the monitored resource +/// descriptor for Google Compute Engine VM instances has a type of +/// `"gce_instance"` and specifies the use of the labels `"instance_id"` and +/// `"zone"` to identify particular VM instances. +/// +/// Different APIs can support different monitored resource types. APIs generally +/// provide a `list` method that returns the monitored resource descriptors used +/// by the API. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MonitoredResourceDescriptor { + /// Optional. A concise name for the monitored resource type that might be + /// displayed in user interfaces. It should be a Title Cased Noun Phrase, + /// without any article or other determiners. For example, + /// `"Google Cloud SQL Database"`. + #[serde(rename="displayName")] + pub display_name: Option, + /// Required. A set of labels used to describe instances of this monitored + /// resource type. For example, an individual Google Cloud SQL database is + /// identified by values for the labels `"database_id"` and `"zone"`. + pub labels: Option>, + /// Required. The monitored resource type. For example, the type + /// `"cloudsql_database"` represents databases in Google Cloud SQL. + /// The maximum length of this value is 256 characters. + #[serde(rename="type")] + pub type_: Option, + /// Optional. The resource name of the monitored resource descriptor: + /// `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + /// {type} is the value of the `type` field in this object and + /// {project_id} is a project ID that provides API-specific context for + /// accessing the type. APIs that do not use project information can use the + /// resource name format `"monitoredResourceDescriptors/{type}"`. + pub name: Option, + /// Optional. A detailed description of the monitored resource type that might + /// be used in documentation. + pub description: Option, +} + +impl Part for MonitoredResourceDescriptor {} + + +/// A description of a log type. Example in YAML format: +/// +/// - name: library.googleapis.com/activity_history +/// description: The history of borrowing and returning library items. +/// display_name: Activity +/// labels: +/// - key: /customer_id +/// description: Identifier of a library customer +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogDescriptor { + /// The set of labels that are available to describe a specific log entry. + /// Runtime requests that contain labels not specified here are + /// considered invalid. + pub labels: Option>, + /// The human-readable name for this log. This information appears on + /// the user interface and should be concise. + #[serde(rename="displayName")] + pub display_name: Option, + /// The name of the log. It must be less than 512 characters long and can + /// include the following characters: upper- and lower-case alphanumeric + /// characters [A-Za-z0-9], and punctuation characters including + /// slash, underscore, hyphen, period [/_-.]. + pub name: Option, + /// A human-readable description of this log. This information appears in + /// the documentation and can contain details. + pub description: Option, +} + +impl Part for LogDescriptor {} + + +/// Configuration of a specific logging destination (the producer project +/// or the consumer project). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LoggingDestination { + /// The monitored resource type. The type must be defined in the + /// Service.monitored_resources section. + #[serde(rename="monitoredResource")] + pub monitored_resource: Option, + /// Names of the logs to be sent to this destination. Each name must + /// be defined in the Service.logs section. If the log name is + /// not a domain scoped name, it will be automatically prefixed with + /// the service name followed by "/". + pub logs: Option>, +} + +impl Part for LoggingDestination {} + + +/// Logging configuration of the service. +/// +/// The following example shows how to configure logs to be sent to the +/// producer and consumer projects. In the example, the `activity_history` +/// log is sent to both the producer and consumer projects, whereas the +/// `purchase_history` log is only sent to the producer project. +/// +/// monitored_resources: +/// - type: library.googleapis.com/branch +/// labels: +/// - key: /city +/// description: The city where the library branch is located in. +/// - key: /name +/// description: The name of the branch. +/// logs: +/// - name: activity_history +/// labels: +/// - key: /customer_id +/// - name: purchase_history +/// logging: +/// producer_destinations: +/// - monitored_resource: library.googleapis.com/branch +/// logs: +/// - activity_history +/// - purchase_history +/// consumer_destinations: +/// - monitored_resource: library.googleapis.com/branch +/// logs: +/// - activity_history +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Logging { + /// Logging configurations for sending logs to the producer project. + /// There can be multiple producer destinations, each one must have a + /// different monitored resource type. A log can be used in at most + /// one producer destination. + #[serde(rename="producerDestinations")] + pub producer_destinations: Option>, + /// Logging configurations for sending logs to the consumer project. + /// There can be multiple consumer destinations, each one must have a + /// different monitored resource type. A log can be used in at most + /// one consumer destination. + #[serde(rename="consumerDestinations")] + pub consumer_destinations: Option>, +} + +impl Part for Logging {} + + +/// Request message for DisableService 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*). +/// +/// * [services disable projects](struct.ProjectServiceDisableCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisableServiceRequest { _never_set: Option } + +impl RequestValue for DisableServiceRequest {} + + +/// ### System parameter configuration +/// +/// A system parameter is a special kind of parameter defined by the API +/// system, not by an individual API. It is typically mapped to an HTTP header +/// and/or a URL query parameter. This configuration specifies which methods +/// change the names of the system parameters. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemParameters { + /// Define system parameters. + /// + /// The parameters defined here will override the default parameters + /// implemented by the system. If this field is missing from the service + /// config, default system parameters will be used. Default system parameters + /// and names is implementation-dependent. + /// + /// Example: define api key for all methods + /// + /// system_parameters + /// rules: + /// - selector: "*" + /// parameters: + /// - name: api_key + /// url_query_parameter: api_key + /// + /// + /// Example: define 2 api key names for a specific method. + /// + /// system_parameters + /// rules: + /// - selector: "/ListShelves" + /// parameters: + /// - name: api_key + /// http_header: Api-Key1 + /// - name: api_key + /// http_header: Api-Key2 + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, +} + +impl Part for SystemParameters {} + + +/// `Documentation` provides the information for describing a service. +/// +/// Example: +///
documentation:
+///   summary: >
+///     The Google Calendar API gives access
+///     to most calendar features.
+///   pages:
+///   - name: Overview
+///     content: (== include google/foo/overview.md ==)
+///   - name: Tutorial
+///     content: (== include google/foo/tutorial.md ==)
+///     subpages;
+///     - name: Java
+///       content: (== include google/foo/tutorial_java.md ==)
+///   rules:
+///   - selector: google.calendar.Calendar.Get
+///     description: >
+///       ...
+///   - selector: google.calendar.Calendar.Put
+///     description: >
+///       ...
+/// 
+/// Documentation is provided in markdown syntax. In addition to +/// standard markdown features, definition lists, tables and fenced +/// code blocks are supported. Section headers can be provided and are +/// interpreted relative to the section nesting of the context where +/// a documentation fragment is embedded. +/// +/// Documentation from the IDL is merged with documentation defined +/// via the config at normalization time, where documentation provided +/// by config rules overrides IDL provided. +/// +/// A number of constructs specific to the API platform are supported +/// in documentation text. +/// +/// In order to reference a proto element, the following +/// notation can be used: +///
[fully.qualified.proto.name][]
+/// To override the display text used for the link, this can be used: +///
[display text][fully.qualified.proto.name]
+/// Text can be excluded from doc using the following notation: +///
(-- internal comment --)
+/// Comments can be made conditional using a visibility label. The below +/// text will be only rendered if the `BETA` label is available: +///
(--BETA: comment for BETA users --)
+/// A few directives are available in documentation. Note that +/// directives must appear on a single line to be properly +/// identified. The `include` directive includes a markdown file from +/// an external source: +///
(== include path/to/file ==)
+/// The `resource_for` directive marks a message to be the resource of +/// a collection in REST view. If it is not specified, tools attempt +/// to infer the resource from the operations in a collection: +///
(== resource_for v1.shelves.books ==)
+/// The directive `suppress_warning` does not directly affect documentation +/// and is documented together with service config validation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Documentation { + /// A list of documentation rules that apply to individual API elements. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, + /// The URL to the root of documentation. + #[serde(rename="documentationRootUrl")] + pub documentation_root_url: Option, + /// A short summary of what the service does. Can only be provided by + /// plain text. + pub summary: Option, + /// The top level pages for the documentation set. + pub pages: Option>, + /// Declares a single overview page. For example: + ///
documentation:
+    ///   summary: ...
+    ///   overview: (== include overview.md ==)
+    /// 
+ /// This is a shortcut for the following declaration (using pages style): + ///
documentation:
+    ///   summary: ...
+    ///   pages:
+    ///   - name: Overview
+    ///     content: (== include overview.md ==)
+    /// 
+ /// Note: you cannot specify both `overview` field and `pages` field. + pub overview: Option, +} + +impl Part for Documentation {} + + +/// Configuration for a custom authentication provider. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomAuthRequirements { + /// A configuration string containing connection information for the + /// authentication provider, typically formatted as a SmartService string + /// (go/smartservice). + pub provider: Option, +} + +impl Part for CustomAuthRequirements {} + + +/// Source information used to create a Service Config +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SourceInfo { + /// All files used during config generation. + #[serde(rename="sourceFiles")] + pub source_files: Option>>, +} + +impl Part for SourceInfo {} + + +/// User-defined authentication requirements, including support for +/// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthRequirement { + /// id from authentication provider. + /// + /// Example: + /// + /// provider_id: bookstore_auth + #[serde(rename="providerId")] + pub provider_id: Option, + /// NOTE: This will be deprecated soon, once AuthProvider.audiences is + /// implemented and accepted in all the runtime components. + /// + /// The list of JWT + /// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + /// that are allowed to access. A JWT containing any of these audiences will + /// be accepted. When this setting is absent, only JWTs with audience + /// "https://Service_name/API_name" + /// will be accepted. For example, if no audiences are in the setting, + /// LibraryService API will only accept JWTs with the following audience + /// "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + /// + /// Example: + /// + /// audiences: bookstore_android.apps.googleusercontent.com, + /// bookstore_web.apps.googleusercontent.com + pub audiences: Option, +} + +impl Part for AuthRequirement {} + + +/// `Context` defines which contexts an API requests. +/// +/// Example: +/// +/// context: +/// rules: +/// - selector: "*" +/// requested: +/// - google.rpc.context.ProjectContext +/// - google.rpc.context.OriginContext +/// +/// The above specifies that all methods in the API request +/// `google.rpc.context.ProjectContext` and +/// `google.rpc.context.OriginContext`. +/// +/// Available context types are defined in package +/// `google.rpc.context`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Context { + /// A list of RPC context rules that apply to individual API methods. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, +} + +impl Part for Context {} + + +/// Enum type definition. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Enum { + /// The source context. + #[serde(rename="sourceContext")] + pub source_context: Option, + /// Enum value definitions. + pub enumvalue: Option>, + /// Protocol buffer options. + pub options: Option>, + /// Enum type name. + pub name: Option, + /// The source syntax. + pub syntax: Option, +} + +impl Part for Enum {} + + +/// Represents a documentation page. A page can contain subpages to represent +/// nested documentation set structure. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Page { + /// The Markdown content of the page. You can use (== include {path} ==) + /// to include content from a Markdown file. + pub content: Option, + /// Subpages of this page. The order of subpages specified here will be + /// honored in the generated docset. + pub subpages: Option>, + /// The name of the page. It will be used as an identity of the page to + /// generate URI of the page, text of the link to this page in navigation, + /// etc. The full page name (start from the root page name to this page + /// concatenated with `.`) can be used as reference to the page in your + /// documentation. For example: + ///
pages:
+    /// - name: Tutorial
+    ///   content: (== include tutorial.md ==)
+    ///   subpages:
+    ///   - name: Java
+    ///     content: (== include tutorial_java.md ==)
+    /// 
+ /// You can reference `Java` page using Markdown reference link syntax: + /// `Java`. + pub name: Option, +} + +impl Part for Page {} + + +/// Experimental service configuration. These configuration options can +/// only be used by whitelisted users. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Experimental { + /// Authorization configuration. + pub authorization: Option, +} + +impl Part for Experimental {} + + +/// A protocol buffer option, which can be attached to a message, field, +/// enumeration, etc. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Option { + /// The option's name. For protobuf built-in options (options defined in + /// descriptor.proto), this is the short name. For example, `"map_entry"`. + /// For custom options, it should be the fully-qualified name. For example, + /// `"google.api.http"`. + pub name: Option, + /// The option's value packed in an Any message. If the value is a primitive, + /// the corresponding wrapper type defined in google/protobuf/wrappers.proto + /// should be used. If the value is an enum, it should be stored as an int32 + /// value using the google.protobuf.Int32Value type. + pub value: Option>, +} + +impl Part for Option {} + + +/// Selects and configures the service controller used by the service. The +/// service controller handles features like abuse, quota, billing, logging, +/// monitoring, etc. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Control { + /// The service control environment to use. If empty, no control plane + /// feature (like quota and billing) will be enabled. + pub environment: Option, +} + +impl Part for Control {} + + +/// Request message for EnableService 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*). +/// +/// * [services enable projects](struct.ProjectServiceEnableCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnableServiceRequest { _never_set: Option } + +impl RequestValue for EnableServiceRequest {} + + +/// A context rule provides information about the context for an individual API +/// element. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContextRule { + /// A list of full type names of provided contexts. + pub provided: Option>, + /// Selects the methods to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, + /// A list of full type names of requested contexts. + pub requested: Option>, +} + +impl Part for ContextRule {} + + +/// Response message for SearchServices 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*). +/// +/// * [search services](struct.ServiceSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchServicesResponse { + /// Token that can be passed to `ListAvailableServices` to resume a paginated + /// query. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Services available publicly or available to the authenticated caller. + pub services: Option>, +} + +impl ResponseResult for SearchServicesResponse {} + + +/// A visibility rule provides visibility configuration for an individual API +/// element. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VisibilityRule { + /// A comma-separated list of visibility labels that apply to the `selector`. + /// Any of the listed labels can be used to grant the visibility. + /// + /// If a rule has multiple labels, removing one of the labels but not all of + /// them can break clients. + /// + /// Example: + /// + /// visibility: + /// rules: + /// - selector: google.calendar.Calendar.EnhancedSearch + /// restriction: GOOGLE_INTERNAL, TRUSTED_TESTER + /// + /// Removing GOOGLE_INTERNAL from this restriction will break clients that + /// rely on this method and only had access to it through GOOGLE_INTERNAL. + pub restriction: Option, + /// Selects methods, messages, fields, enums, etc. to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, +} + +impl Part for VisibilityRule {} + + +/// Defines the Media configuration for a service in case of a download. +/// Use this only for Scotty Requests. Do not use this for media support using +/// Bytestream, add instead [][google.bytestream.RestByteStream] as an API to +/// your configuration for Bytestream methods. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MediaDownload { + /// Optional maximum acceptable size for direct download. + /// The size is specified in bytes. + #[serde(rename="maxDirectDownloadSize")] + pub max_direct_download_size: Option, + /// A boolean that determines if direct download from ESF should be used for + /// download of this media. + #[serde(rename="useDirectDownload")] + pub use_direct_download: Option, + /// Whether download is enabled. + pub enabled: Option, + /// A boolean that determines whether a notification for the completion of a + /// download should be sent to the backend. + #[serde(rename="completeNotification")] + pub complete_notification: Option, + /// Name of the Scotty dropzone to use for the current API. + pub dropzone: Option, + /// DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. + /// + /// Specify name of the download service if one is used for download. + #[serde(rename="downloadService")] + pub download_service: Option, +} + +impl Part for MediaDownload {} + + +/// Configuration of authorization. +/// +/// This section determines the authorization provider, if unspecified, then no +/// authorization check will be done. +/// +/// Example: +/// +/// experimental: +/// authorization: +/// provider: firebaserules.googleapis.com +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthorizationConfig { + /// The name of the authorization provider, such as + /// firebaserules.googleapis.com. + pub provider: Option, +} + +impl Part for AuthorizationConfig {} + + +/// A documentation rule provides information about individual API elements. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DocumentationRule { + /// Description of the selected API(s). + pub description: Option, + /// Deprecation description of the selected element(s). It can be provided if an + /// element is marked as `deprecated`. + #[serde(rename="deprecationDescription")] + pub deprecation_description: Option, + /// The selector is a comma-separated list of patterns. Each pattern is a + /// qualified name of the element which may end in "*", indicating a wildcard. + /// Wildcards are only allowed at the end and for a whole component of the + /// qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". To + /// specify a default for all applicable elements, the whole pattern "*" + /// is used. + pub selector: Option, +} + +impl Part for DocumentationRule {} + + +/// Enum value definition. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnumValue { + /// Protocol buffer options. + pub options: Option>, + /// Enum value number. + pub number: Option, + /// Enum value name. + pub name: Option, +} + +impl Part for EnumValue {} + + +/// Api is a light-weight descriptor for an API Interface. +/// +/// Interfaces are also described as "protocol buffer services" in some contexts, +/// such as by the "service" keyword in a .proto file, but they are different +/// from API Services, which represent a concrete implementation of an interface +/// as opposed to simply a description of methods and bindings. They are also +/// sometimes simply referred to as "APIs" in other contexts, such as the name of +/// this message itself. See https://cloud.google.com/apis/design/glossary for +/// detailed terminology. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Api { + /// A version string for this interface. If specified, must have the form + /// `major-version.minor-version`, as in `1.10`. If the minor version is + /// omitted, it defaults to zero. If the entire version field is empty, the + /// major version is derived from the package name, as outlined below. If the + /// field is not empty, the version in the package name will be verified to be + /// consistent with what is provided here. + /// + /// The versioning schema uses [semantic + /// versioning](http://semver.org) where the major version number + /// indicates a breaking change and the minor version an additive, + /// non-breaking change. Both version numbers are signals to users + /// what to expect from different versions, and should be carefully + /// chosen based on the product plan. + /// + /// The major version is also reflected in the package name of the + /// interface, which must end in `v`, as in + /// `google.feature.v1`. For major versions 0 and 1, the suffix can + /// be omitted. Zero major versions must only be used for + /// experimental, non-GA interfaces. + /// + pub version: Option, + /// The methods of this interface, in unspecified order. + pub methods: Option>, + /// The fully qualified name of this interface, including package name + /// followed by the interface's simple name. + pub name: Option, + /// Source context for the protocol buffer service represented by this + /// message. + #[serde(rename="sourceContext")] + pub source_context: Option, + /// Included interfaces. See Mixin. + pub mixins: Option>, + /// Any metadata attached to the interface. + pub options: Option>, + /// The source syntax of the service. + pub syntax: Option, +} + +impl Part for Api {} + + +/// `Endpoint` describes a network endpoint that serves a set of APIs. +/// A service may expose any number of endpoints, and all endpoints share the +/// same service configuration, such as quota configuration and monitoring +/// configuration. +/// +/// Example service configuration: +/// +/// name: library-example.googleapis.com +/// endpoints: +/// # Below entry makes 'google.example.library.v1.Library' +/// # API be served from endpoint address library-example.googleapis.com. +/// # It also allows HTTP OPTIONS calls to be passed to the backend, for +/// # it to decide whether the subsequent cross-origin request is +/// # allowed to proceed. +/// - name: library-example.googleapis.com +/// allow_cors: true +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Endpoint { + /// The list of features enabled on this endpoint. + pub features: Option>, + /// The specification of an Internet routable address of API frontend that will + /// handle requests to this [API Endpoint](https://cloud.google.com/apis/design/glossary). + /// It should be either a valid IPv4 address or a fully-qualified domain name. + /// For example, "8.8.8.8" or "myservice.appspot.com". + pub target: Option, + /// The list of APIs served by this endpoint. + /// + /// If no APIs are specified this translates to "all APIs" exported by the + /// service, as defined in the top-level service configuration. + pub apis: Option>, + /// Allowing + /// [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + /// cross-domain traffic, would allow the backends served from this endpoint to + /// receive and respond to HTTP OPTIONS requests. The response will be used by + /// the browser to determine whether the subsequent cross-origin request is + /// allowed to proceed. + #[serde(rename="allowCors")] + pub allow_cors: Option, + /// DEPRECATED: This field is no longer supported. Instead of using aliases, + /// please specify multiple google.api.Endpoint for each of the intented + /// alias. + /// + /// Additional names that this endpoint will be hosted on. + pub aliases: Option>, + /// The canonical name of this endpoint. + pub name: Option, +} + +impl Part for Endpoint {} + + +/// Authorization rule for API services. +/// +/// It specifies the permission(s) required for an API element for the overall +/// API request to succeed. It is typically used to mark request message fields +/// that contain the name of the resource and indicates the permissions that +/// will be checked on that resource. +/// +/// For example: +/// +/// package google.storage.v1; +/// +/// message CopyObjectRequest { +/// string source = 1 [ +/// (google.api.authz).permissions = "storage.objects.get"]; +/// +/// string destination = 2 [ +/// (google.api.authz).permissions = +/// "storage.objects.create,storage.objects.update"]; +/// } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthorizationRule { + /// Selects the API elements to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, + /// The required permissions. The acceptable values vary depend on the + /// authorization system used. For Google APIs, it should be a comma-separated + /// Google IAM permission values. When multiple permissions are listed, the + /// semantics is not defined by the system. Additional documentation must + /// be provided manually. + pub permissions: Option, +} + +impl Part for AuthorizationRule {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [services enable projects](struct.ProjectServiceEnableCall.html) (response) +/// * [services disable projects](struct.ProjectServiceDisableCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should have the format of `operations/some/unique/name`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for Operation {} + + +/// Authentication rules for the service. +/// +/// By default, if a method has any authentication requirements, every request +/// must include a valid credential matching one of the requirements. +/// It's an error to include more than one kind of credential in a single +/// request. +/// +/// If a method doesn't have any auth requirements, request credentials will be +/// ignored. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthenticationRule { + /// The requirements for OAuth credentials. + pub oauth: Option, + /// Requirements for additional authentication providers. + pub requirements: Option>, + /// Whether to allow requests without a credential. The credential can be + /// an OAuth token, Google cookies (first-party auth) or EndUserCreds. + /// + /// For requests without credentials, if the service control environment is + /// specified, each incoming request **must** be associated with a service + /// consumer. This can be done by passing an API key that belongs to a consumer + /// project. + #[serde(rename="allowWithoutCredential")] + pub allow_without_credential: Option, + /// Configuration for custom authentication. + #[serde(rename="customAuth")] + pub custom_auth: Option, + /// Selects the methods to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: Option, +} + +impl Part for AuthenticationRule {} + + +/// Usage configuration rules for the service. +/// +/// NOTE: Under development. +/// +/// +/// Use this rule to configure unregistered calls for the service. Unregistered +/// calls are calls that do not contain consumer project identity. +/// (Example: calls that do not contain an API key). +/// By default, API methods do not allow unregistered calls, and each method call +/// must be identified by a consumer project identity. Use this rule to +/// allow/disallow unregistered calls. +/// +/// Example of an API that wants to allow unregistered calls for entire service. +/// +/// usage: +/// rules: +/// - selector: "*" +/// allow_unregistered_calls: true +/// +/// Example of a method that wants to allow unregistered calls. +/// +/// usage: +/// rules: +/// - selector: "google.example.library.v1.LibraryService.CreateBook" +/// allow_unregistered_calls: true +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UsageRule { + /// Selects the methods to which this rule applies. Use '*' to indicate all + /// methods in all APIs. + /// + /// Refer to selector for syntax details. + pub selector: Option, + /// True, if the method should skip service control. If so, no control plane + /// feature (like quota and billing) will be enabled. + #[serde(rename="skipServiceControl")] + pub skip_service_control: Option, + /// True, if the method allows unregistered calls; false otherwise. + #[serde(rename="allowUnregisteredCalls")] + pub allow_unregistered_calls: Option, +} + +impl Part for UsageRule {} + + +/// `Backend` defines the backend configuration for a service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Backend { + /// A list of API backend rules that apply to individual API methods. + /// + /// **NOTE:** All service configuration rules follow "last one wins" order. + pub rules: Option>, +} + +impl Part for Backend {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *service* resources. +/// It is not used directly, but through the `ServiceUser` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_serviceuser1 as serviceuser1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use serviceuser1::ServiceUser; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `search(...)` +/// // to build up your call. +/// let rb = hub.services(); +/// # } +/// ``` +pub struct ServiceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceUser, +} + +impl<'a, C, A> MethodsBuilder for ServiceMethods<'a, C, A> {} + +impl<'a, C, A> ServiceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Search available services. + /// + /// When no filter is specified, returns all accessible services. For + /// authenticated users, also returns all services the calling user has + /// "servicemanagement.services.bind" permission for. + pub fn search(&self) -> ServiceSearchCall<'a, C, A> { + ServiceSearchCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `ServiceUser` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_serviceuser1 as serviceuser1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use serviceuser1::ServiceUser; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `services_disable(...)`, `services_enable(...)` and `services_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceUser, +} + +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: + /// + /// Enable a service so it can be used with a project. + /// See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for + /// more information. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Name of the consumer and the service to enable for that consumer. + /// A valid path would be: + /// - /v1/projects/my-project/services/servicemanagement.googleapis.com:enable + pub fn services_enable(&self, request: EnableServiceRequest, name: &str) -> ProjectServiceEnableCall<'a, C, A> { + ProjectServiceEnableCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List enabled services for the specified consumer. + /// + /// # Arguments + /// + /// * `parent` - List enabled services for the specified parent. + /// An example valid parent would be: + /// - projects/my-project + pub fn services_list(&self, parent: &str) -> ProjectServiceListCall<'a, C, A> { + ProjectServiceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Disable a service so it can no longer be used with a + /// project. This prevents unintended usage that may cause unexpected billing + /// charges or security leaks. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Name of the consumer and the service to disable for that consumer. + /// The Service User implementation accepts the following forms for consumer: + /// - "project:" + /// A valid path would be: + /// - /v1/projects/my-project/services/servicemanagement.googleapis.com:disable + pub fn services_disable(&self, request: DisableServiceRequest, name: &str) -> ProjectServiceDisableCall<'a, C, A> { + ProjectServiceDisableCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Search available services. +/// +/// When no filter is specified, returns all accessible services. For +/// authenticated users, also returns all services the calling user has +/// "servicemanagement.services.bind" permission for. +/// +/// A builder for the *search* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_serviceuser1 as serviceuser1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceuser1::ServiceUser; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.services().search() +/// .page_token("sed") +/// .page_size(-85) +/// .doit(); +/// # } +/// ``` +pub struct ServiceSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceUser, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceSearchCall<'a, C, A> {} + +impl<'a, C, A> ServiceSearchCall<'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, SearchServicesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceuser.services.search", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + 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())); + } + for &field in ["alt", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/services:search"; + 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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Token identifying which result to start with; returned by a previous list + /// call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ServiceSearchCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested size of the next page of data. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ServiceSearchCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ServiceSearchCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceSearchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ServiceSearchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enable a service so it can be used with a project. +/// See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for +/// more information. +/// +/// Operation +/// +/// A builder for the *services.enable* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_serviceuser1 as serviceuser1; +/// use serviceuser1::EnableServiceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceuser1::ServiceUser; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = EnableServiceRequest::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().services_enable(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceEnableCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceUser, + _request: EnableServiceRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceEnableCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceEnableCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceuser.projects.services.enable", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:enable"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: EnableServiceRequest) -> ProjectServiceEnableCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the consumer and the service to enable for that consumer. + /// + /// A valid path would be: + /// - /v1/projects/my-project/services/servicemanagement.googleapis.com:enable + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceEnableCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceEnableCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceEnableCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceEnableCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List enabled services for the specified consumer. +/// +/// A builder for the *services.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_serviceuser1 as serviceuser1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceuser1::ServiceUser; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().services_list("parent") +/// .page_token("accusam") +/// .page_size(-8) +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceUser, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceListCall<'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, ListEnabledServicesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceuser.projects.services.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// List enabled services for the specified parent. + /// + /// An example valid parent would be: + /// - projects/my-project + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectServiceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Token identifying which result to start with; returned by a previous list + /// call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectServiceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested size of the next page of data. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectServiceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Disable a service so it can no longer be used with a +/// project. This prevents unintended usage that may cause unexpected billing +/// charges or security leaks. +/// +/// Operation +/// +/// A builder for the *services.disable* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_serviceuser1 as serviceuser1; +/// use serviceuser1::DisableServiceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceuser1::ServiceUser; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceUser::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DisableServiceRequest::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().services_disable(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceDisableCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceUser, + _request: DisableServiceRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceDisableCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceDisableCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceuser.projects.services.disable", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:disable"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DisableServiceRequest) -> ProjectServiceDisableCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the consumer and the service to disable for that consumer. + /// + /// The Service User implementation accepts the following forms for consumer: + /// - "project:" + /// + /// A valid path would be: + /// - /v1/projects/my-project/services/servicemanagement.googleapis.com:disable + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceDisableCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceDisableCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceDisableCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectServiceDisableCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/sourcerepo1-cli/Cargo.toml b/gen/sourcerepo1-cli/Cargo.toml new file mode 100644 index 0000000000..651fe37381 --- /dev/null +++ b/gen/sourcerepo1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-sourcerepo1-cli" +version = "1.0.6+20170908" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Source Repositories (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1-cli" +homepage = "https://cloud.google.com/source-repositories/docs/apis" +documentation = "http://byron.github.io/google-apis-rs/google_sourcerepo1_cli" +license = "MIT" +keywords = ["sourcerepo", "google", "cli"] + +[[bin]] +name = "sourcerepo1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-sourcerepo1] +path = "../sourcerepo1" +version = "1.0.6+20170908" diff --git a/gen/sourcerepo1-cli/LICENSE.md b/gen/sourcerepo1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/sourcerepo1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/sourcerepo1-cli/README.md b/gen/sourcerepo1-cli/README.md new file mode 100644 index 0000000000..1e8f3f1aac --- /dev/null +++ b/gen/sourcerepo1-cli/README.md @@ -0,0 +1,120 @@ + +The `sourcerepo1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Source Repositories* 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 *Cloud Source Repositories* API can be found at the +[official documentation site](https://cloud.google.com/source-repositories/docs/apis). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-sourcerepo1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1-cli). + +# Usage + +This documentation was generated from the *Cloud Source Repositories* API at revision *20170908*. The CLI is at version *1.0.6*. + +```bash +sourcerepo1 [options] + projects + repos-create (-r )... [-p ]... [-o ] + repos-delete [-p ]... [-o ] + repos-get [-p ]... [-o ] + repos-get-iam-policy [-p ]... [-o ] + repos-list [-p ]... [-o ] + repos-set-iam-policy (-r )... [-p ]... [-o ] + repos-test-iam-permissions (-r )... [-p ]... [-o ] + sourcerepo1 --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 `sourcerepo1-`. 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/sourcerepo1-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/sourcerepo1-secret.json`, assuming that the required *sourcerepo* 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. `sourcerepo1 --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/sourcerepo1-cli/mkdocs.yml b/gen/sourcerepo1-cli/mkdocs.yml new file mode 100644 index 0000000000..11e8448b77 --- /dev/null +++ b/gen/sourcerepo1-cli/mkdocs.yml @@ -0,0 +1,23 @@ +site_name: Cloud Source Repositories v1.0.6+20170908 +site_url: http://byron.github.io/google-apis-rs/google-sourcerepo1-cli +site_description: A complete library to interact with Cloud Source Repositories (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_repos-create.md', 'Projects', 'Repos Create'] +- ['projects_repos-delete.md', 'Projects', 'Repos Delete'] +- ['projects_repos-get.md', 'Projects', 'Repos Get'] +- ['projects_repos-get-iam-policy.md', 'Projects', 'Repos Get Iam Policy'] +- ['projects_repos-list.md', 'Projects', 'Repos List'] +- ['projects_repos-set-iam-policy.md', 'Projects', 'Repos Set Iam Policy'] +- ['projects_repos-test-iam-permissions.md', 'Projects', 'Repos Test Iam Permissions'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/sourcerepo1-cli/src/cmn.rs b/gen/sourcerepo1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/sourcerepo1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/sourcerepo1-cli/src/main.rs b/gen/sourcerepo1-cli/src/main.rs new file mode 100644 index 0000000000..26798dd23b --- /dev/null +++ b/gen/sourcerepo1-cli/src/main.rs @@ -0,0 +1,935 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_sourcerepo1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudSourceRepositories>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_repos_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mirror-config.url" => Some(("mirrorConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mirror-config.webhook-id" => Some(("mirrorConfig.webhookId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mirror-config.deploy-key-id" => Some(("mirrorConfig.deployKeyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["deploy-key-id", "mirror-config", "name", "size", "url", "webhook-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Repo = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().repos_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_repos_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().repos_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_repos_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().repos_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_repos_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().repos_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_repos_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().repos_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_repos_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "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().repos_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_repos_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().repos_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("repos-create", Some(opt)) => { + call_result = self._projects_repos_create(opt, dry_run, &mut err); + }, + ("repos-delete", Some(opt)) => { + call_result = self._projects_repos_delete(opt, dry_run, &mut err); + }, + ("repos-get", Some(opt)) => { + call_result = self._projects_repos_get(opt, dry_run, &mut err); + }, + ("repos-get-iam-policy", Some(opt)) => { + call_result = self._projects_repos_get_iam_policy(opt, dry_run, &mut err); + }, + ("repos-list", Some(opt)) => { + call_result = self._projects_repos_list(opt, dry_run, &mut err); + }, + ("repos-set-iam-policy", Some(opt)) => { + call_result = self._projects_repos_set_iam_policy(opt, dry_run, &mut err); + }, + ("repos-test-iam-permissions", Some(opt)) => { + call_result = self._projects_repos_test_iam_permissions(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<'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, "sourcerepo1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "sourcerepo1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudSourceRepositories::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: 'repos-create', 'repos-delete', 'repos-get', 'repos-get-iam-policy', 'repos-list', 'repos-set-iam-policy' and 'repos-test-iam-permissions'", vec![ + ("repos-create", + Some(r##"Creates a repo in the given project with the given name. + + If the named repository already exists, `CreateRepo` returns + `ALREADY_EXISTS`."##), + "Details at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli/projects_repos-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project in which to create the repo. Values are of the form + `projects/`."##), + 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)), + ]), + ("repos-delete", + Some(r##"Deletes a repo."##), + "Details at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli/projects_repos-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the repo to delete. Values are of the form + `projects//repos/`."##), + 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)), + ]), + ("repos-get", + Some(r##"Returns information about a repo."##), + "Details at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli/projects_repos-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the requested repository. Values are of the form + `projects//repos/`."##), + 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)), + ]), + ("repos-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli/projects_repos-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("repos-list", + Some(r##"Returns all repos belonging to a project. The sizes of the repos are + not set by ListRepos. To get the size of a repo, use GetRepo."##), + "Details at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli/projects_repos-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The project ID whose repos should be listed. Values are of the form + `projects/`."##), + 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)), + ]), + ("repos-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_sourcerepo1_cli/projects_repos-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + 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)), + ]), + ("repos-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error."##), + "Details at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli/projects_repos-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + 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("sourcerepo1") + .author("Sebastian Thiel ") + .version("1.0.6+20170908") + .about("Access source code repositories hosted by Google.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sourcerepo1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/sourcerepo1/Cargo.toml b/gen/sourcerepo1/Cargo.toml new file mode 100644 index 0000000000..03fc0bc7c9 --- /dev/null +++ b/gen/sourcerepo1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-sourcerepo1" +version = "1.0.6+20170908" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Source Repositories (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1" +homepage = "https://cloud.google.com/source-repositories/docs/apis" +documentation = "https://docs.rs/google-sourcerepo1/1.0.6+20170908" +license = "MIT" +keywords = ["sourcerepo", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/sourcerepo1/LICENSE.md b/gen/sourcerepo1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/sourcerepo1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/sourcerepo1/README.md b/gen/sourcerepo1/README.md new file mode 100644 index 0000000000..084142c30b --- /dev/null +++ b/gen/sourcerepo1/README.md @@ -0,0 +1,181 @@ + +The `google-sourcerepo1` library allows access to all features of the *Google Cloud Source Repositories* service. + +This documentation was generated from *Cloud Source Repositories* crate version *1.0.6+20170908*, where *20170908* is the exact revision of the *sourcerepo:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud Source Repositories* *v1* API can be found at the +[official documentation site](https://cloud.google.com/source-repositories/docs/apis). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.CloudSourceRepositories.html) ... + +* projects + * [*repos create*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoCreateCall.html), [*repos delete*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoDeleteCall.html), [*repos get*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoGetCall.html), [*repos get iam policy*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoGetIamPolicyCall.html), [*repos list*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoListCall.html), [*repos set iam policy*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoSetIamPolicyCall.html) and [*repos test iam permissions*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.ProjectRepoTestIamPermissionCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.CloudSourceRepositories.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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().repos_set_iam_policy(...).doit() +let r = hub.projects().repos_get_iam_policy(...).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-sourcerepo1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_sourcerepo1 as sourcerepo1; +use sourcerepo1::SetIamPolicyRequest; +use sourcerepo1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use sourcerepo1::CloudSourceRepositories; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_set_iam_policy(req, "resource") + .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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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](https://docs.rs/google-sourcerepo1/1.0.6+20170908/google_sourcerepo1/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 **sourcerepo1** 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-rsblob/master/LICENSE.md diff --git a/gen/sourcerepo1/src/cmn.rs b/gen/sourcerepo1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/sourcerepo1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/sourcerepo1/src/lib.rs b/gen/sourcerepo1/src/lib.rs new file mode 100644 index 0000000000..fa1f22ef8f --- /dev/null +++ b/gen/sourcerepo1/src/lib.rs @@ -0,0 +1,2904 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud Source Repositories* crate version *1.0.6+20170908*, where *20170908* is the exact revision of the *sourcerepo:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud Source Repositories* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/source-repositories/docs/apis). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudSourceRepositories.html) ... +//! +//! * projects +//! * [*repos create*](struct.ProjectRepoCreateCall.html), [*repos delete*](struct.ProjectRepoDeleteCall.html), [*repos get*](struct.ProjectRepoGetCall.html), [*repos get iam policy*](struct.ProjectRepoGetIamPolicyCall.html), [*repos list*](struct.ProjectRepoListCall.html), [*repos set iam policy*](struct.ProjectRepoSetIamPolicyCall.html) and [*repos test iam permissions*](struct.ProjectRepoTestIamPermissionCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudSourceRepositories.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().repos_set_iam_policy(...).doit() +//! let r = hub.projects().repos_get_iam_policy(...).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-sourcerepo1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_sourcerepo1 as sourcerepo1; +//! use sourcerepo1::SetIamPolicyRequest; +//! use sourcerepo1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use sourcerepo1::CloudSourceRepositories; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_set_iam_policy(req, "resource") +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Manage your source code repositories + SourceFullControl, + + /// View the contents of your source code repositories + SourceReadOnly, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, + + /// Manage the contents of your source code repositories + SourceReadWrite, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::SourceFullControl => "https://www.googleapis.com/auth/source.full_control", + Scope::SourceReadOnly => "https://www.googleapis.com/auth/source.read_only", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::SourceReadWrite => "https://www.googleapis.com/auth/source.read_write", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all CloudSourceRepositories related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_sourcerepo1 as sourcerepo1; +/// use sourcerepo1::SetIamPolicyRequest; +/// use sourcerepo1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use sourcerepo1::CloudSourceRepositories; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_set_iam_policy(req, "resource") +/// .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 CloudSourceRepositories { + client: RefCell, + auth: RefCell
, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudSourceRepositories {} + +impl<'a, C, A> CloudSourceRepositories + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudSourceRepositories { + CloudSourceRepositories { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://sourcerepo.googleapis.com/".to_string(), + _root_url: "https://sourcerepo.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://sourcerepo.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://sourcerepo.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// foo@gmail.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// 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*). +/// +/// * [repos test iam permissions projects](struct.ProjectRepoTestIamPermissionCall.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 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*). +/// +/// * [repos test iam permissions projects](struct.ProjectRepoTestIamPermissionCall.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. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// 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*). +/// +/// * [repos set iam policy projects](struct.ProjectRepoSetIamPolicyCall.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 a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + /// the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: + /// paths: "bindings, etag" + /// This field is only used by Cloud IAM. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// Represents an expression text. Example: +/// +/// title: "User account presence" +/// description: "Determines whether the request has a user account" +/// expression: "size(request.user) > 0" +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// An optional title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, + /// Textual representation of an expression in + /// Common Expression Language syntax. + /// + /// The application context of the containing message determines which + /// well-known feature set of CEL is supported. + pub expression: Option, + /// An optional string indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// An optional description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, +} + +impl Part for Expr {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: an unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + /// This field is GOOGLE_INTERNAL. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// A repository (or repo) is a Git repository storing versioned source content. +/// +/// # 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*). +/// +/// * [repos get projects](struct.ProjectRepoGetCall.html) (response) +/// * [repos create projects](struct.ProjectRepoCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Repo { + /// URL to clone the repository from Google Cloud Source Repositories. + pub url: Option, + /// The disk usage of the repo, in bytes. + /// Only returned by GetRepo. + pub size: Option, + /// Resource name of the repository, of the form + /// `projects//repos/`. The repo name may contain slashes. + /// eg, `projects/myproject/repos/name/with/slash` + pub name: Option, + /// How this repository mirrors a repository managed by another service. + #[serde(rename="mirrorConfig")] + pub mirror_config: Option, +} + +impl RequestValue for Repo {} +impl ResponseResult for Repo {} + + +/// Specifies the audit configuration for a service. +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. +/// An AuditConfig must have one or more AuditLogConfigs. +/// +/// If there are AuditConfigs for both `allServices` and a specific service, +/// the union of the two AuditConfigs is used for that service: the log_types +/// specified in each AuditConfig are enabled, and the exempted_members in each +/// AuditConfig are exempted. +/// +/// Example Policy with multiple AuditConfigs: +/// +/// { +/// "audit_configs": [ +/// { +/// "service": "allServices" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// }, +/// { +/// "log_type": "ADMIN_READ", +/// } +/// ] +/// }, +/// { +/// "service": "fooservice.googleapis.com" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// "exempted_members": [ +/// "user:bar@gmail.com" +/// ] +/// } +/// ] +/// } +/// ] +/// } +/// +/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts foo@gmail.com from DATA_READ logging, and +/// bar@gmail.com from DATA_WRITE logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditConfig { + /// no description provided + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The configuration for logging of each type of permission. + /// Next ID: 4 + #[serde(rename="auditLogConfigs")] + pub audit_log_configs: Option>, + /// Specifies a service that will be enabled for audit logging. + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + pub service: Option, +} + +impl Part for AuditConfig {} + + +/// Configuration to automatically mirror a repository from another +/// hosting service, for example GitHub or BitBucket. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MirrorConfig { + /// URL of the main repository at the other hosting service. + pub url: Option, + /// ID of the webhook listening to updates to trigger mirroring. + /// Removing this webook from the other hosting service will stop + /// Google Cloud Source Repositories from receiving notifications, + /// and thereby disabling mirroring. + #[serde(rename="webhookId")] + pub webhook_id: Option, + /// ID of the SSH deploy key at the other hosting service. + /// Removing this key from the other service would deauthorize + /// Google Cloud Source Repositories from mirroring. + #[serde(rename="deployKeyId")] + pub deploy_key_id: Option, +} + +impl Part for MirrorConfig {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +/// `members` to a `role`, where the members can be user accounts, Google groups, +/// Google domains, and service accounts. A `role` is a named list of permissions +/// defined by IAM. +/// +/// **Example** +/// +/// { +/// "bindings": [ +/// { +/// "role": "roles/owner", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +/// ] +/// }, +/// { +/// "role": "roles/viewer", +/// "members": ["user:sean@example.com"] +/// } +/// ] +/// } +/// +/// For a description of IAM and its features, see the +/// [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # 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*). +/// +/// * [repos set iam policy projects](struct.ProjectRepoSetIamPolicyCall.html) (response) +/// * [repos get iam policy projects](struct.ProjectRepoGetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, + /// no description provided + #[serde(rename="iamOwned")] + pub iam_owned: Option, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, +} + +impl ResponseResult for Policy {} + + +/// Response for ListRepos. The size is not set in the returned repositories. +/// +/// # 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*). +/// +/// * [repos list projects](struct.ProjectRepoListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListReposResponse { + /// If non-empty, additional repositories exist within the project. These + /// can be retrieved by including this value in the next ListReposRequest's + /// page_token field. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The listed repos. + pub repos: Option>, +} + +impl ResponseResult for ListReposResponse {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [repos delete projects](struct.ProjectRepoDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudSourceRepositories` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_sourcerepo1 as sourcerepo1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use sourcerepo1::CloudSourceRepositories; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `repos_create(...)`, `repos_delete(...)`, `repos_get(...)`, `repos_get_iam_policy(...)`, `repos_list(...)`, `repos_set_iam_policy(...)` and `repos_test_iam_permissions(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, +} + +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: + /// + /// Deletes a repo. + /// + /// # Arguments + /// + /// * `name` - The name of the repo to delete. Values are of the form + /// `projects//repos/`. + pub fn repos_delete(&self, name: &str) -> ProjectRepoDeleteCall<'a, C, A> { + ProjectRepoDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn repos_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectRepoTestIamPermissionCall<'a, C, A> { + ProjectRepoTestIamPermissionCall { + 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: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn repos_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectRepoSetIamPolicyCall<'a, C, A> { + ProjectRepoSetIamPolicyCall { + 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: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn repos_get_iam_policy(&self, resource: &str) -> ProjectRepoGetIamPolicyCall<'a, C, A> { + ProjectRepoGetIamPolicyCall { + 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: + /// + /// Creates a repo in the given project with the given name. + /// + /// If the named repository already exists, `CreateRepo` returns + /// `ALREADY_EXISTS`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The project in which to create the repo. Values are of the form + /// `projects/`. + pub fn repos_create(&self, request: Repo, parent: &str) -> ProjectRepoCreateCall<'a, C, A> { + ProjectRepoCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns all repos belonging to a project. The sizes of the repos are + /// not set by ListRepos. To get the size of a repo, use GetRepo. + /// + /// # Arguments + /// + /// * `name` - The project ID whose repos should be listed. Values are of the form + /// `projects/`. + pub fn repos_list(&self, name: &str) -> ProjectRepoListCall<'a, C, A> { + ProjectRepoListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns information about a repo. + /// + /// # Arguments + /// + /// * `name` - The name of the requested repository. Values are of the form + /// `projects//repos/`. + pub fn repos_get(&self, name: &str) -> ProjectRepoGetCall<'a, C, A> { + ProjectRepoGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Deletes a repo. +/// +/// A builder for the *repos.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the repo to delete. Values are of the form + /// `projects//repos/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRepoDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRepoDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// A builder for the *repos.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// use sourcerepo1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectRepoTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectRepoTestIamPermissionCall<'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) -> ProjectRepoTestIamPermissionCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *repos.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// use sourcerepo1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoSetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectRepoSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectRepoSetIamPolicyCall<'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) -> ProjectRepoSetIamPolicyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *repos.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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(Bearer { 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(d); + 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(d); + 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 the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// 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) -> ProjectRepoGetIamPolicyCall<'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) -> ProjectRepoGetIamPolicyCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a repo in the given project with the given name. +/// +/// If the named repository already exists, `CreateRepo` returns +/// `ALREADY_EXISTS`. +/// +/// A builder for the *repos.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// use sourcerepo1::Repo; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Repo::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().repos_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _request: Repo, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoCreateCall<'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, Repo)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/repos"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Repo) -> ProjectRepoCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project in which to create the repo. Values are of the form + /// `projects/`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectRepoCreateCall<'a, C, A> { + self._parent = 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) -> ProjectRepoCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns all repos belonging to a project. The sizes of the repos are +/// not set by ListRepos. To get the size of a repo, use GetRepo. +/// +/// A builder for the *repos.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_list("name") +/// .page_token("justo") +/// .page_size(-1) +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _name: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoListCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoListCall<'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, ListReposResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/repos"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 whose repos should be listed. Values are of the form + /// `projects/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRepoListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Resume listing repositories where a prior ListReposResponse + /// left off. This is an opaque token that must be obtained from + /// a recent, prior ListReposResponse's next_page_token field. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectRepoListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of repositories to return; between 1 and 500. + /// If not set or zero, defaults to 100 at the server. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectRepoListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRepoListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns information about a repo. +/// +/// A builder for the *repos.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sourcerepo1 as sourcerepo1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sourcerepo1::CloudSourceRepositories; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudSourceRepositories::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().repos_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRepoGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudSourceRepositories, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRepoGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectRepoGetCall<'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, Repo)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sourcerepo.projects.repos.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the requested repository. Values are of the form + /// `projects//repos/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRepoGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRepoGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRepoGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectRepoGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/spanner1-cli/Cargo.toml b/gen/spanner1-cli/Cargo.toml new file mode 100644 index 0000000000..24a2d2af74 --- /dev/null +++ b/gen/spanner1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-spanner1-cli" +version = "1.0.6+20170914" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Spanner (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1-cli" +homepage = "https://cloud.google.com/spanner/" +documentation = "http://byron.github.io/google-apis-rs/google_spanner1_cli" +license = "MIT" +keywords = ["spanner", "google", "cli"] + +[[bin]] +name = "spanner1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-spanner1] +path = "../spanner1" +version = "1.0.6+20170914" diff --git a/gen/spanner1-cli/LICENSE.md b/gen/spanner1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/spanner1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/spanner1-cli/README.md b/gen/spanner1-cli/README.md new file mode 100644 index 0000000000..a08f054537 --- /dev/null +++ b/gen/spanner1-cli/README.md @@ -0,0 +1,151 @@ + +The `spanner1` command-line interface *(CLI)* allows to use most features of the *Google Spanner* 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 *Spanner* API can be found at the +[official documentation site](https://cloud.google.com/spanner/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-spanner1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1-cli). + +# Usage + +This documentation was generated from the *Spanner* API at revision *20170914*. The CLI is at version *1.0.6*. + +```bash +spanner1 [options] + projects + instance-configs-get [-p ]... [-o ] + instance-configs-list [-p ]... [-o ] + instances-create (-r )... [-p ]... [-o ] + instances-databases-create (-r )... [-p ]... [-o ] + instances-databases-drop-database [-p ]... [-o ] + instances-databases-get [-p ]... [-o ] + instances-databases-get-ddl [-p ]... [-o ] + instances-databases-get-iam-policy (-r )... [-p ]... [-o ] + instances-databases-list [-p ]... [-o ] + instances-databases-operations-cancel [-p ]... [-o ] + instances-databases-operations-delete [-p ]... [-o ] + instances-databases-operations-get [-p ]... [-o ] + instances-databases-operations-list [-p ]... [-o ] + instances-databases-sessions-begin-transaction (-r )... [-p ]... [-o ] + instances-databases-sessions-commit (-r )... [-p ]... [-o ] + instances-databases-sessions-create (-r )... [-p ]... [-o ] + instances-databases-sessions-delete [-p ]... [-o ] + instances-databases-sessions-execute-sql (-r )... [-p ]... [-o ] + instances-databases-sessions-execute-streaming-sql (-r )... [-p ]... [-o ] + instances-databases-sessions-get [-p ]... [-o ] + instances-databases-sessions-list [-p ]... [-o ] + instances-databases-sessions-read (-r )... [-p ]... [-o ] + instances-databases-sessions-rollback (-r )... [-p ]... [-o ] + instances-databases-sessions-streaming-read (-r )... [-p ]... [-o ] + instances-databases-set-iam-policy (-r )... [-p ]... [-o ] + instances-databases-test-iam-permissions (-r )... [-p ]... [-o ] + instances-databases-update-ddl (-r )... [-p ]... [-o ] + instances-delete [-p ]... [-o ] + instances-get [-p ]... [-o ] + instances-get-iam-policy (-r )... [-p ]... [-o ] + instances-list [-p ]... [-o ] + instances-operations-cancel [-p ]... [-o ] + instances-operations-delete [-p ]... [-o ] + instances-operations-get [-p ]... [-o ] + instances-operations-list [-p ]... [-o ] + instances-patch (-r )... [-p ]... [-o ] + instances-set-iam-policy (-r )... [-p ]... [-o ] + instances-test-iam-permissions (-r )... [-p ]... [-o ] + spanner1 --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 `spanner1-`. 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/spanner1-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/spanner1-secret.json`, assuming that the required *spanner* 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. `spanner1 --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/spanner1-cli/mkdocs.yml b/gen/spanner1-cli/mkdocs.yml new file mode 100644 index 0000000000..90b4856c57 --- /dev/null +++ b/gen/spanner1-cli/mkdocs.yml @@ -0,0 +1,54 @@ +site_name: Spanner v1.0.6+20170914 +site_url: http://byron.github.io/google-apis-rs/google-spanner1-cli +site_description: A complete library to interact with Spanner (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_instance-configs-get.md', 'Projects', 'Instance Configs Get'] +- ['projects_instance-configs-list.md', 'Projects', 'Instance Configs List'] +- ['projects_instances-create.md', 'Projects', 'Instances Create'] +- ['projects_instances-databases-create.md', 'Projects', 'Instances Databases Create'] +- ['projects_instances-databases-drop-database.md', 'Projects', 'Instances Databases Drop Database'] +- ['projects_instances-databases-get.md', 'Projects', 'Instances Databases Get'] +- ['projects_instances-databases-get-ddl.md', 'Projects', 'Instances Databases Get Ddl'] +- ['projects_instances-databases-get-iam-policy.md', 'Projects', 'Instances Databases Get Iam Policy'] +- ['projects_instances-databases-list.md', 'Projects', 'Instances Databases List'] +- ['projects_instances-databases-operations-cancel.md', 'Projects', 'Instances Databases Operations Cancel'] +- ['projects_instances-databases-operations-delete.md', 'Projects', 'Instances Databases Operations Delete'] +- ['projects_instances-databases-operations-get.md', 'Projects', 'Instances Databases Operations Get'] +- ['projects_instances-databases-operations-list.md', 'Projects', 'Instances Databases Operations List'] +- ['projects_instances-databases-sessions-begin-transaction.md', 'Projects', 'Instances Databases Sessions Begin Transaction'] +- ['projects_instances-databases-sessions-commit.md', 'Projects', 'Instances Databases Sessions Commit'] +- ['projects_instances-databases-sessions-create.md', 'Projects', 'Instances Databases Sessions Create'] +- ['projects_instances-databases-sessions-delete.md', 'Projects', 'Instances Databases Sessions Delete'] +- ['projects_instances-databases-sessions-execute-sql.md', 'Projects', 'Instances Databases Sessions Execute Sql'] +- ['projects_instances-databases-sessions-execute-streaming-sql.md', 'Projects', 'Instances Databases Sessions Execute Streaming Sql'] +- ['projects_instances-databases-sessions-get.md', 'Projects', 'Instances Databases Sessions Get'] +- ['projects_instances-databases-sessions-list.md', 'Projects', 'Instances Databases Sessions List'] +- ['projects_instances-databases-sessions-read.md', 'Projects', 'Instances Databases Sessions Read'] +- ['projects_instances-databases-sessions-rollback.md', 'Projects', 'Instances Databases Sessions Rollback'] +- ['projects_instances-databases-sessions-streaming-read.md', 'Projects', 'Instances Databases Sessions Streaming Read'] +- ['projects_instances-databases-set-iam-policy.md', 'Projects', 'Instances Databases Set Iam Policy'] +- ['projects_instances-databases-test-iam-permissions.md', 'Projects', 'Instances Databases Test Iam Permissions'] +- ['projects_instances-databases-update-ddl.md', 'Projects', 'Instances Databases Update Ddl'] +- ['projects_instances-delete.md', 'Projects', 'Instances Delete'] +- ['projects_instances-get.md', 'Projects', 'Instances Get'] +- ['projects_instances-get-iam-policy.md', 'Projects', 'Instances Get Iam Policy'] +- ['projects_instances-list.md', 'Projects', 'Instances List'] +- ['projects_instances-operations-cancel.md', 'Projects', 'Instances Operations Cancel'] +- ['projects_instances-operations-delete.md', 'Projects', 'Instances Operations Delete'] +- ['projects_instances-operations-get.md', 'Projects', 'Instances Operations Get'] +- ['projects_instances-operations-list.md', 'Projects', 'Instances Operations List'] +- ['projects_instances-patch.md', 'Projects', 'Instances Patch'] +- ['projects_instances-set-iam-policy.md', 'Projects', 'Instances Set Iam Policy'] +- ['projects_instances-test-iam-permissions.md', 'Projects', 'Instances Test Iam Permissions'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/spanner1-cli/src/cmn.rs b/gen/spanner1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/spanner1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/spanner1-cli/src/main.rs b/gen/spanner1-cli/src/main.rs new file mode 100644 index 0000000000..6bdcad098e --- /dev/null +++ b/gen/spanner1-cli/src/main.rs @@ -0,0 +1,4273 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_spanner1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::Spanner>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_instance_configs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instance_configs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instance_configs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instance_configs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "instance-id" => Some(("instanceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.display-name" => Some(("instance.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.name" => Some(("instance.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.labels" => Some(("instance.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "instance.state" => Some(("instance.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.node-count" => Some(("instance.nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "instance.config" => Some(("instance.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "display-name", "instance", "instance-id", "labels", "name", "node-count", "state"]); + 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::CreateInstanceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "extra-statements" => Some(("extraStatements", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "create-statement" => Some(("createStatement", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-statement", "extra-statements"]); + 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::CreateDatabaseRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_drop_database(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_drop_database(opt.value_of("database").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_get_ddl(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_get_ddl(opt.value_of("database").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_get_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_get_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_begin_transaction(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "options.read-only.min-read-timestamp" => Some(("options.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "options.read-only.return-read-timestamp" => Some(("options.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "options.read-only.max-staleness" => Some(("options.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "options.read-only.exact-staleness" => Some(("options.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "options.read-only.read-timestamp" => Some(("options.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "options.read-only.strong" => Some(("options.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["exact-staleness", "max-staleness", "min-read-timestamp", "options", "read-only", "read-timestamp", "return-read-timestamp", "strong"]); + 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::BeginTransactionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_begin_transaction(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_commit(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "transaction-id" => Some(("transactionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "single-use-transaction.read-only.min-read-timestamp" => Some(("singleUseTransaction.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "single-use-transaction.read-only.return-read-timestamp" => Some(("singleUseTransaction.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "single-use-transaction.read-only.max-staleness" => Some(("singleUseTransaction.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "single-use-transaction.read-only.exact-staleness" => Some(("singleUseTransaction.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "single-use-transaction.read-only.read-timestamp" => Some(("singleUseTransaction.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "single-use-transaction.read-only.strong" => Some(("singleUseTransaction.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["exact-staleness", "max-staleness", "min-read-timestamp", "read-only", "read-timestamp", "return-read-timestamp", "single-use-transaction", "strong", "transaction-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CommitRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_commit(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "session.labels" => Some(("session.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "session.create-time" => Some(("session.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "session.approximate-last-use-time" => Some(("session.approximateLastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "session.name" => Some(("session.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["approximate-last-use-time", "create-time", "labels", "name", "session"]); + 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::CreateSessionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_create(request, opt.value_of("database").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_sessions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_execute_sql(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "resume-token" => Some(("resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.min-read-timestamp" => Some(("transaction.begin.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.return-read-timestamp" => Some(("transaction.begin.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.begin.read-only.max-staleness" => Some(("transaction.begin.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.exact-staleness" => Some(("transaction.begin.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.read-timestamp" => Some(("transaction.begin.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.strong" => Some(("transaction.begin.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.min-read-timestamp" => Some(("transaction.singleUse.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.return-read-timestamp" => Some(("transaction.singleUse.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.max-staleness" => Some(("transaction.singleUse.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.exact-staleness" => Some(("transaction.singleUse.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.read-timestamp" => Some(("transaction.singleUse.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.strong" => Some(("transaction.singleUse.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.id" => Some(("transaction.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-mode" => Some(("queryMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sql" => Some(("sql", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["begin", "exact-staleness", "id", "max-staleness", "min-read-timestamp", "query-mode", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "single-use", "sql", "strong", "transaction"]); + 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::ExecuteSqlRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_execute_sql(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_execute_streaming_sql(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "resume-token" => Some(("resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.min-read-timestamp" => Some(("transaction.begin.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.return-read-timestamp" => Some(("transaction.begin.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.begin.read-only.max-staleness" => Some(("transaction.begin.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.exact-staleness" => Some(("transaction.begin.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.read-timestamp" => Some(("transaction.begin.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.strong" => Some(("transaction.begin.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.min-read-timestamp" => Some(("transaction.singleUse.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.return-read-timestamp" => Some(("transaction.singleUse.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.max-staleness" => Some(("transaction.singleUse.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.exact-staleness" => Some(("transaction.singleUse.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.read-timestamp" => Some(("transaction.singleUse.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.strong" => Some(("transaction.singleUse.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.id" => Some(("transaction.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-mode" => Some(("queryMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sql" => Some(("sql", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["begin", "exact-staleness", "id", "max-staleness", "min-read-timestamp", "query-mode", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "single-use", "sql", "strong", "transaction"]); + 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::ExecuteSqlRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_execute_streaming_sql(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_sessions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_databases_sessions_list(opt.value_of("database").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_read(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "index" => Some(("index", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.min-read-timestamp" => Some(("transaction.begin.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.return-read-timestamp" => Some(("transaction.begin.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.begin.read-only.max-staleness" => Some(("transaction.begin.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.exact-staleness" => Some(("transaction.begin.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.read-timestamp" => Some(("transaction.begin.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.strong" => Some(("transaction.begin.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.min-read-timestamp" => Some(("transaction.singleUse.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.return-read-timestamp" => Some(("transaction.singleUse.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.max-staleness" => Some(("transaction.singleUse.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.exact-staleness" => Some(("transaction.singleUse.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.read-timestamp" => Some(("transaction.singleUse.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.strong" => Some(("transaction.singleUse.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.id" => Some(("transaction.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resume-token" => Some(("resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-set.all" => Some(("keySet.all", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "limit" => Some(("limit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "table" => Some(("table", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "columns" => Some(("columns", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["all", "begin", "columns", "exact-staleness", "id", "index", "key-set", "limit", "max-staleness", "min-read-timestamp", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "single-use", "strong", "table", "transaction"]); + 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::ReadRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_read(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_rollback(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "transaction-id" => Some(("transactionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["transaction-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RollbackRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_rollback(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_streaming_read(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "index" => Some(("index", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.min-read-timestamp" => Some(("transaction.begin.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.return-read-timestamp" => Some(("transaction.begin.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.begin.read-only.max-staleness" => Some(("transaction.begin.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.exact-staleness" => Some(("transaction.begin.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.read-timestamp" => Some(("transaction.begin.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.begin.read-only.strong" => Some(("transaction.begin.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.min-read-timestamp" => Some(("transaction.singleUse.readOnly.minReadTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.return-read-timestamp" => Some(("transaction.singleUse.readOnly.returnReadTimestamp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.max-staleness" => Some(("transaction.singleUse.readOnly.maxStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.exact-staleness" => Some(("transaction.singleUse.readOnly.exactStaleness", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.read-timestamp" => Some(("transaction.singleUse.readOnly.readTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction.single-use.read-only.strong" => Some(("transaction.singleUse.readOnly.strong", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "transaction.id" => Some(("transaction.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resume-token" => Some(("resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "key-set.all" => Some(("keySet.all", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "limit" => Some(("limit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "table" => Some(("table", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "columns" => Some(("columns", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["all", "begin", "columns", "exact-staleness", "id", "index", "key-set", "limit", "max-staleness", "min-read-timestamp", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "single-use", "strong", "table", "transaction"]); + 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::ReadRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_streaming_read(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().instances_databases_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().instances_databases_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_update_ddl(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "statements" => Some(("statements", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["operation-id", "statements"]); + 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::UpdateDatabaseDdlRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_update_ddl(request, opt.value_of("database").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_get_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_get_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "instance.display-name" => Some(("instance.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.name" => Some(("instance.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.labels" => Some(("instance.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "instance.state" => Some(("instance.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.node-count" => Some(("instance.nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "instance.config" => Some(("instance.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "field-mask" => Some(("fieldMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "display-name", "field-mask", "instance", "labels", "name", "node-count", "state"]); + 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::UpdateInstanceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_set_iam_policy(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().instances_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_test_iam_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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().instances_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("instance-configs-get", Some(opt)) => { + call_result = self._projects_instance_configs_get(opt, dry_run, &mut err); + }, + ("instance-configs-list", Some(opt)) => { + call_result = self._projects_instance_configs_list(opt, dry_run, &mut err); + }, + ("instances-create", Some(opt)) => { + call_result = self._projects_instances_create(opt, dry_run, &mut err); + }, + ("instances-databases-create", Some(opt)) => { + call_result = self._projects_instances_databases_create(opt, dry_run, &mut err); + }, + ("instances-databases-drop-database", Some(opt)) => { + call_result = self._projects_instances_databases_drop_database(opt, dry_run, &mut err); + }, + ("instances-databases-get", Some(opt)) => { + call_result = self._projects_instances_databases_get(opt, dry_run, &mut err); + }, + ("instances-databases-get-ddl", Some(opt)) => { + call_result = self._projects_instances_databases_get_ddl(opt, dry_run, &mut err); + }, + ("instances-databases-get-iam-policy", Some(opt)) => { + call_result = self._projects_instances_databases_get_iam_policy(opt, dry_run, &mut err); + }, + ("instances-databases-list", Some(opt)) => { + call_result = self._projects_instances_databases_list(opt, dry_run, &mut err); + }, + ("instances-databases-operations-cancel", Some(opt)) => { + call_result = self._projects_instances_databases_operations_cancel(opt, dry_run, &mut err); + }, + ("instances-databases-operations-delete", Some(opt)) => { + call_result = self._projects_instances_databases_operations_delete(opt, dry_run, &mut err); + }, + ("instances-databases-operations-get", Some(opt)) => { + call_result = self._projects_instances_databases_operations_get(opt, dry_run, &mut err); + }, + ("instances-databases-operations-list", Some(opt)) => { + call_result = self._projects_instances_databases_operations_list(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-begin-transaction", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_begin_transaction(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-commit", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_commit(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-create", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_create(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-delete", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_delete(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-execute-sql", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_execute_sql(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-execute-streaming-sql", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_execute_streaming_sql(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-get", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_get(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-list", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_list(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-read", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_read(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-rollback", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_rollback(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-streaming-read", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_streaming_read(opt, dry_run, &mut err); + }, + ("instances-databases-set-iam-policy", Some(opt)) => { + call_result = self._projects_instances_databases_set_iam_policy(opt, dry_run, &mut err); + }, + ("instances-databases-test-iam-permissions", Some(opt)) => { + call_result = self._projects_instances_databases_test_iam_permissions(opt, dry_run, &mut err); + }, + ("instances-databases-update-ddl", Some(opt)) => { + call_result = self._projects_instances_databases_update_ddl(opt, dry_run, &mut err); + }, + ("instances-delete", Some(opt)) => { + call_result = self._projects_instances_delete(opt, dry_run, &mut err); + }, + ("instances-get", Some(opt)) => { + call_result = self._projects_instances_get(opt, dry_run, &mut err); + }, + ("instances-get-iam-policy", Some(opt)) => { + call_result = self._projects_instances_get_iam_policy(opt, dry_run, &mut err); + }, + ("instances-list", Some(opt)) => { + call_result = self._projects_instances_list(opt, dry_run, &mut err); + }, + ("instances-operations-cancel", Some(opt)) => { + call_result = self._projects_instances_operations_cancel(opt, dry_run, &mut err); + }, + ("instances-operations-delete", Some(opt)) => { + call_result = self._projects_instances_operations_delete(opt, dry_run, &mut err); + }, + ("instances-operations-get", Some(opt)) => { + call_result = self._projects_instances_operations_get(opt, dry_run, &mut err); + }, + ("instances-operations-list", Some(opt)) => { + call_result = self._projects_instances_operations_list(opt, dry_run, &mut err); + }, + ("instances-patch", Some(opt)) => { + call_result = self._projects_instances_patch(opt, dry_run, &mut err); + }, + ("instances-set-iam-policy", Some(opt)) => { + call_result = self._projects_instances_set_iam_policy(opt, dry_run, &mut err); + }, + ("instances-test-iam-permissions", Some(opt)) => { + call_result = self._projects_instances_test_iam_permissions(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<'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, "spanner1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "spanner1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::Spanner::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: 'instance-configs-get', 'instance-configs-list', 'instances-create', 'instances-databases-create', 'instances-databases-drop-database', 'instances-databases-get', 'instances-databases-get-ddl', 'instances-databases-get-iam-policy', 'instances-databases-list', 'instances-databases-operations-cancel', 'instances-databases-operations-delete', 'instances-databases-operations-get', 'instances-databases-operations-list', 'instances-databases-sessions-begin-transaction', 'instances-databases-sessions-commit', 'instances-databases-sessions-create', 'instances-databases-sessions-delete', 'instances-databases-sessions-execute-sql', 'instances-databases-sessions-execute-streaming-sql', 'instances-databases-sessions-get', 'instances-databases-sessions-list', 'instances-databases-sessions-read', 'instances-databases-sessions-rollback', 'instances-databases-sessions-streaming-read', 'instances-databases-set-iam-policy', 'instances-databases-test-iam-permissions', 'instances-databases-update-ddl', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-operations-cancel', 'instances-operations-delete', 'instances-operations-get', 'instances-operations-list', 'instances-patch', 'instances-set-iam-policy' and 'instances-test-iam-permissions'", vec![ + ("instance-configs-get", + Some(r##"Gets information about a particular instance configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instance-configs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the requested instance configuration. Values are of + the form `projects//instanceConfigs/`."##), + 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)), + ]), + ("instance-configs-list", + Some(r##"Lists the supported instance configurations for a given project."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instance-configs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project for which a list of supported instance + configurations is requested. Values are of the form + `projects/`."##), + 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)), + ]), + ("instances-create", + Some(r##"Creates an instance and begins preparing it to begin serving. The + returned long-running operation + can be used to track the progress of preparing the new + instance. The instance name is assigned by the caller. If the + named instance already exists, `CreateInstance` returns + `ALREADY_EXISTS`. + + Immediately upon completion of this request: + + * The instance is readable via the API, with all requested attributes + but no allocated resources. Its state is `CREATING`. + + Until completion of the returned operation: + + * Cancelling the operation renders the instance immediately unreadable + via the API. + * The instance can be deleted. + * All other attempts to modify the instance are rejected. + + Upon completion of the returned operation: + + * Billing for all successfully-allocated resources begins (some types + may have lower than the requested levels). + * Databases can be created in the instance. + * The instance's allocated resource levels are readable via the API. + * The instance's state becomes `READY`. + + The returned long-running operation will + have a name of the format `/operations/` and + can be used to track creation of the instance. The + metadata field type is + CreateInstanceMetadata. + The response field type is + Instance, if successful."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project in which to create the instance. Values + are of the form `projects/`."##), + 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)), + ]), + ("instances-databases-create", + Some(r##"Creates a new Cloud Spanner database and starts to prepare it for serving. + The returned long-running operation will + have a name of the format `/operations/` and + can be used to track preparation of the database. The + metadata field type is + CreateDatabaseMetadata. The + response field type is + Database, if successful."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the instance that will serve the new database. + Values are of the form `projects//instances/`."##), + 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)), + ]), + ("instances-databases-drop-database", + Some(r##"Drops (aka deletes) a Cloud Spanner database."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-drop-database", + vec![ + (Some(r##"database"##), + None, + Some(r##"Required. The database to be dropped."##), + 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)), + ]), + ("instances-databases-get", + Some(r##"Gets the state of a Cloud Spanner database."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the requested database. Values are of the form + `projects//instances//databases/`."##), + 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)), + ]), + ("instances-databases-get-ddl", + Some(r##"Returns the schema of a Cloud Spanner database as a list of formatted + DDL statements. This method does not show pending schema updates, those may + be queried using the Operations API."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-get-ddl", + vec![ + (Some(r##"database"##), + None, + Some(r##"Required. The database whose schema we wish 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)), + ]), + ("instances-databases-get-iam-policy", + Some(r##"Gets the access control policy for a database resource. Returns an empty + policy if a database exists but does not have a policy set. + + Authorization requires `spanner.databases.getIamPolicy` permission on + resource."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources."##), + 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)), + ]), + ("instances-databases-list", + Some(r##"Lists Cloud Spanner databases."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The instance whose databases should be listed. + Values are of the form `projects//instances/`."##), + 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)), + ]), + ("instances-databases-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + 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)), + ]), + ("instances-databases-operations-delete", + Some(r##"Deletes a long-running operation. This method indicates that the client is + no longer interested in the operation result. It does not cancel the + operation. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-databases-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-databases-operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-databases-sessions-begin-transaction", + Some(r##"Begins a new transaction. This step can often be skipped: + Read, ExecuteSql and + Commit can begin a new transaction as a + side-effect."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-begin-transaction", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the transaction runs."##), + 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)), + ]), + ("instances-databases-sessions-commit", + Some(r##"Commits a transaction. The request includes the mutations to be + applied to rows in the database. + + `Commit` might return an `ABORTED` error. This can occur at any time; + commonly, the cause is conflicts with concurrent + transactions. However, it can also happen for a variety of other + reasons. If `Commit` returns `ABORTED`, the caller should re-attempt + the transaction from the beginning, re-using the same session."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-commit", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the transaction to be committed is running."##), + 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)), + ]), + ("instances-databases-sessions-create", + Some(r##"Creates a new session. A session can be used to perform + transactions that read and/or modify data in a Cloud Spanner database. + Sessions are meant to be reused for many consecutive + transactions. + + Sessions can only execute one transaction at a time. To execute + multiple concurrent read-write/write-only transactions, create + multiple sessions. Note that standalone reads and queries use a + transaction internally, and count toward the one transaction + limit. + + Cloud Spanner limits the number of sessions that can exist at any given + time; thus, it is a good idea to delete idle and/or unneeded sessions. + Aside from explicit deletes, Cloud Spanner can delete sessions for which no + operations are sent for more than an hour. If a session is deleted, + requests to it return `NOT_FOUND`. + + Idle sessions can be kept alive by sending a trivial SQL query + periodically, e.g., `"SELECT 1"`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-create", + vec![ + (Some(r##"database"##), + None, + Some(r##"Required. The database in which the new session is created."##), + 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)), + ]), + ("instances-databases-sessions-delete", + Some(r##"Ends a session, releasing server resources associated with it."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the session to delete."##), + 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)), + ]), + ("instances-databases-sessions-execute-sql", + Some(r##"Executes an SQL query, returning all rows in a single reply. This + method cannot be used to return a result set larger than 10 MiB; + if the query yields more data than that, the query fails with + a `FAILED_PRECONDITION` error. + + Queries inside read-write transactions might return `ABORTED`. If + this occurs, the application should restart the transaction from + the beginning. See Transaction for more details. + + Larger result sets can be fetched in streaming fashion by calling + ExecuteStreamingSql instead."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-execute-sql", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the SQL query should be performed."##), + 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)), + ]), + ("instances-databases-sessions-execute-streaming-sql", + Some(r##"Like ExecuteSql, except returns the result + set as a stream. Unlike ExecuteSql, there + is no limit on the size of the returned result set. However, no + individual row in the result set can exceed 100 MiB, and no + column value can exceed 10 MiB."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-execute-streaming-sql", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the SQL query should be performed."##), + 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)), + ]), + ("instances-databases-sessions-get", + Some(r##"Gets a session. Returns `NOT_FOUND` if the session does not exist. + This is mainly useful for determining whether a session is still + alive."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the session to retrieve."##), + 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)), + ]), + ("instances-databases-sessions-list", + Some(r##"Lists all sessions in a given database."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-list", + vec![ + (Some(r##"database"##), + None, + Some(r##"Required. The database in which to list sessions."##), + 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)), + ]), + ("instances-databases-sessions-read", + Some(r##"Reads rows from the database using key lookups and scans, as a + simple key/value style alternative to + ExecuteSql. This method cannot be used to + return a result set larger than 10 MiB; if the read matches more + data than that, the read fails with a `FAILED_PRECONDITION` + error. + + Reads inside read-write transactions might return `ABORTED`. If + this occurs, the application should restart the transaction from + the beginning. See Transaction for more details. + + Larger result sets can be yielded in streaming fashion by calling + StreamingRead instead."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-read", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the read should be performed."##), + 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)), + ]), + ("instances-databases-sessions-rollback", + Some(r##"Rolls back a transaction, releasing any locks it holds. It is a good + idea to call this for any transaction that includes one or more + Read or ExecuteSql requests and + ultimately decides not to commit. + + `Rollback` returns `OK` if it successfully aborts the transaction, the + transaction was already aborted, or the transaction is not + found. `Rollback` never returns `ABORTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-rollback", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the transaction to roll back is running."##), + 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)), + ]), + ("instances-databases-sessions-streaming-read", + Some(r##"Like Read, except returns the result set as a + stream. Unlike Read, there is no limit on the + size of the returned result set. However, no individual row in + the result set can exceed 100 MiB, and no column value can exceed + 10 MiB."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-streaming-read", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The session in which the read should be performed."##), + 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)), + ]), + ("instances-databases-set-iam-policy", + Some(r##"Sets the access control policy on a database resource. Replaces any + existing policy. + + Authorization requires `spanner.databases.setIamPolicy` permission on + resource."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources."##), + 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)), + ]), + ("instances-databases-test-iam-permissions", + Some(r##"Returns permissions that the caller has on the specified database resource. + + Attempting this RPC on a non-existent Cloud Spanner database will result in + a NOT_FOUND error if the user has `spanner.databases.list` permission on + the containing Cloud Spanner instance. Otherwise returns an empty set of + permissions."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources."##), + 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)), + ]), + ("instances-databases-update-ddl", + Some(r##"Updates the schema of a Cloud Spanner database by + creating/altering/dropping tables, columns, indexes, etc. The returned + long-running operation will have a name of + the format `/operations/` and can be used to + track execution of the schema change(s). The + metadata field type is + UpdateDatabaseDdlMetadata. The operation has no response."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-update-ddl", + vec![ + (Some(r##"database"##), + None, + Some(r##"Required. The database to update."##), + 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)), + ]), + ("instances-delete", + Some(r##"Deletes an instance. + + Immediately upon completion of the request: + + * Billing ceases for all of the instance's reserved resources. + + Soon afterward: + + * The instance and *all of its databases* immediately and + irrevocably disappear from the API. All data in the databases + is permanently deleted."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the instance to be deleted. Values are of the form + `projects//instances/`"##), + 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)), + ]), + ("instances-get", + Some(r##"Gets information about a particular instance."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the requested instance. Values are of the form + `projects//instances/`."##), + 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)), + ]), + ("instances-get-iam-policy", + Some(r##"Gets the access control policy for an instance resource. Returns an empty + policy if an instance exists but does not have a policy set. + + Authorization requires `spanner.instances.getIamPolicy` on + resource."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources."##), + 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)), + ]), + ("instances-list", + Some(r##"Lists all instances in the given project."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project for which a list of instances is + requested. Values are of the form `projects/`."##), + 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)), + ]), + ("instances-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + 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)), + ]), + ("instances-operations-delete", + Some(r##"Deletes a long-running operation. This method indicates that the client is + no longer interested in the operation result. It does not cancel the + operation. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-patch", + Some(r##"Updates an instance, and begins allocating or releasing resources + as requested. The returned long-running + operation can be used to track the + progress of updating the instance. If the named instance does not + exist, returns `NOT_FOUND`. + + Immediately upon completion of this request: + + * For resource types for which a decrease in the instance's allocation + has been requested, billing is based on the newly-requested level. + + Until completion of the returned operation: + + * Cancelling the operation sets its metadata's + cancel_time, and begins + restoring resources to their pre-request values. The operation + is guaranteed to succeed at undoing all resource changes, + after which point it terminates with a `CANCELLED` status. + * All other attempts to modify the instance are rejected. + * Reading the instance via the API continues to give the pre-request + resource levels. + + Upon completion of the returned operation: + + * Billing begins for all successfully-allocated resources (some types + may have lower than the requested levels). + * All newly-reserved resources are available for serving the instance's + tables. + * The instance's new resource levels are readable via the API. + + The returned long-running operation will + have a name of the format `/operations/` and + can be used to track the instance modification. The + metadata field type is + UpdateInstanceMetadata. + The response field type is + Instance, if successful. + + Authorization requires `spanner.instances.update` permission on + resource name."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. A unique identifier for the instance, which cannot be changed + after the instance is created. Values are of the form + `projects//instances/a-z*[a-z0-9]`. The final + segment of the name must be between 6 and 30 characters in length."##), + 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)), + ]), + ("instances-set-iam-policy", + Some(r##"Sets the access control policy on an instance resource. Replaces any + existing policy. + + Authorization requires `spanner.instances.setIamPolicy` on + resource."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources."##), + 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)), + ]), + ("instances-test-iam-permissions", + Some(r##"Returns permissions that the caller has on the specified instance resource. + + Attempting this RPC on a non-existent Cloud Spanner instance resource will + result in a NOT_FOUND error if the user has `spanner.instances.list` + permission on the containing Google Cloud Project. Otherwise returns an + empty set of permissions."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources."##), + 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("spanner1") + .author("Sebastian Thiel ") + .version("1.0.6+20170914") + .about("Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_spanner1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/spanner1/Cargo.toml b/gen/spanner1/Cargo.toml new file mode 100644 index 0000000000..3cf9658a30 --- /dev/null +++ b/gen/spanner1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-spanner1" +version = "1.0.6+20170914" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Spanner (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1" +homepage = "https://cloud.google.com/spanner/" +documentation = "https://docs.rs/google-spanner1/1.0.6+20170914" +license = "MIT" +keywords = ["spanner", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/spanner1/LICENSE.md b/gen/spanner1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/spanner1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/spanner1/README.md b/gen/spanner1/README.md new file mode 100644 index 0000000000..7f7d89fb3b --- /dev/null +++ b/gen/spanner1/README.md @@ -0,0 +1,187 @@ + +The `google-spanner1` library allows access to all features of the *Google Spanner* service. + +This documentation was generated from *Spanner* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *spanner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Spanner* *v1* API can be found at the +[official documentation site](https://cloud.google.com/spanner/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.Spanner.html) ... + +* projects + * [*instance configs get*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceConfigListCall.html), [*instances create*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceCreateCall.html), [*instances databases create*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases sessions begin transaction*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute sql*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions read*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceDeleteCall.html), [*instances get*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceGetCall.html), [*instances get iam policy*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceListCall.html), [*instances operations cancel*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceOperationListCall.html), [*instances patch*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstancePatchCall.html), [*instances set iam policy*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.ProjectInstanceTestIamPermissionCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/struct.Spanner.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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().instances_databases_operations_cancel(...).doit() +let r = hub.projects().instances_databases_drop_database(...).doit() +let r = hub.projects().instances_operations_delete(...).doit() +let r = hub.projects().instances_databases_operations_delete(...).doit() +let r = hub.projects().instances_delete(...).doit() +let r = hub.projects().instances_operations_cancel(...).doit() +let r = hub.projects().instances_databases_sessions_rollback(...).doit() +let r = hub.projects().instances_databases_sessions_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-spanner1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_spanner1 as spanner1; +use spanner1::RollbackRequest; +use spanner1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use spanner1::Spanner; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RollbackRequest::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().instances_databases_sessions_rollback(req, "session") + .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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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](https://docs.rs/google-spanner1/1.0.6+20170914/google_spanner1/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 **spanner1** 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-rsblob/master/LICENSE.md diff --git a/gen/spanner1/src/cmn.rs b/gen/spanner1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/spanner1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/spanner1/src/lib.rs b/gen/spanner1/src/lib.rs new file mode 100644 index 0000000000..6b348cc8d7 --- /dev/null +++ b/gen/spanner1/src/lib.rs @@ -0,0 +1,13963 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Spanner* crate version *1.0.6+20170914*, where *20170914* is the exact revision of the *spanner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Spanner* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/spanner/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Spanner.html) ... +//! +//! * projects +//! * [*instance configs get*](struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](struct.ProjectInstanceConfigListCall.html), [*instances create*](struct.ProjectInstanceCreateCall.html), [*instances databases create*](struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases sessions begin transaction*](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute sql*](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions read*](struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](struct.ProjectInstanceDeleteCall.html), [*instances get*](struct.ProjectInstanceGetCall.html), [*instances get iam policy*](struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](struct.ProjectInstanceListCall.html), [*instances operations cancel*](struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](struct.ProjectInstanceOperationListCall.html), [*instances patch*](struct.ProjectInstancePatchCall.html), [*instances set iam policy*](struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](struct.ProjectInstanceTestIamPermissionCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Spanner.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().instances_databases_operations_cancel(...).doit() +//! let r = hub.projects().instances_databases_drop_database(...).doit() +//! let r = hub.projects().instances_operations_delete(...).doit() +//! let r = hub.projects().instances_databases_operations_delete(...).doit() +//! let r = hub.projects().instances_delete(...).doit() +//! let r = hub.projects().instances_operations_cancel(...).doit() +//! let r = hub.projects().instances_databases_sessions_rollback(...).doit() +//! let r = hub.projects().instances_databases_sessions_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-spanner1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_spanner1 as spanner1; +//! use spanner1::RollbackRequest; +//! use spanner1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use spanner1::Spanner; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RollbackRequest::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().instances_databases_sessions_rollback(req, "session") +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Administer your Spanner databases + Admin, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, + + /// View and manage the contents of your Spanner databases + Data, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Admin => "https://www.googleapis.com/auth/spanner.admin", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::Data => "https://www.googleapis.com/auth/spanner.data", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Data + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Spanner related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_spanner1 as spanner1; +/// use spanner1::RollbackRequest; +/// use spanner1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use spanner1::Spanner; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RollbackRequest::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().instances_databases_sessions_rollback(req, "session") +/// .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 Spanner { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Spanner {} + +impl<'a, C, A> Spanner + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Spanner { + Spanner { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://spanner.googleapis.com/".to_string(), + _root_url: "https://spanner.googleapis.com/".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/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://spanner.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://spanner.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// The response for ListInstances. +/// +/// # 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*). +/// +/// * [instances list projects](struct.ProjectInstanceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListInstancesResponse { + /// `next_page_token` can be sent in a subsequent + /// ListInstances call to fetch more + /// of the matching instances. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of requested instances. + pub instances: Option>, +} + +impl ResponseResult for ListInstancesResponse {} + + +/// Contains an ordered list of nodes appearing in the query plan. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryPlan { + /// The nodes in the query plan. Plan nodes are returned in pre-order starting + /// with the plan root. Each PlanNode's `id` corresponds to its index in + /// `plan_nodes`. + #[serde(rename="planNodes")] + pub plan_nodes: Option>, +} + +impl Part for QueryPlan {} + + +/// 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*). +/// +/// * [instances databases set iam policy projects](struct.ProjectInstanceDatabaseSetIamPolicyCall.html) (request) +/// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.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 a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// Results from Read or +/// ExecuteSql. +/// +/// # 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*). +/// +/// * [instances databases sessions execute sql projects](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html) (response) +/// * [instances databases sessions read projects](struct.ProjectInstanceDatabaseSessionReadCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultSet { + /// Each element in `rows` is a row whose format is defined by + /// metadata.row_type. The ith element + /// in each row matches the ith field in + /// metadata.row_type. Elements are + /// encoded based on type as described + /// here. + pub rows: Option>>, + /// Query plan and execution statistics for the query that produced this + /// result set. These can be requested by setting + /// ExecuteSqlRequest.query_mode. + pub stats: Option, + /// Metadata about the result set, such as row type information. + pub metadata: Option, +} + +impl ResponseResult for ResultSet {} + + +/// The response for ListSessions. +/// +/// # 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*). +/// +/// * [instances databases sessions list projects](struct.ProjectInstanceDatabaseSessionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSessionsResponse { + /// `next_page_token` can be sent in a subsequent + /// ListSessions call to fetch more of the matching + /// sessions. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of requested sessions. + pub sessions: Option>, +} + +impl ResponseResult for ListSessionsResponse {} + + +/// The request for CreateSession. +/// +/// # 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*). +/// +/// * [instances databases sessions create projects](struct.ProjectInstanceDatabaseSessionCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateSessionRequest { + /// The session to create. + pub session: Option, +} + +impl RequestValue for CreateSessionRequest {} + + +/// Arguments to insert, update, insert_or_update, and +/// replace operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Write { + /// Required. The table whose rows will be written. + pub table: Option, + /// The values to be written. `values` can contain more than one + /// list of values. If it does, then multiple rows are written, one + /// for each entry in `values`. Each list in `values` must have + /// exactly as many entries as there are entries in columns + /// above. Sending multiple lists is equivalent to sending multiple + /// `Mutation`s, each containing one `values` entry and repeating + /// table and columns. Individual values in each list are + /// encoded as described here. + pub values: Option>>, + /// The names of the columns in table to be written. + /// + /// The list of columns must contain enough columns to allow + /// Cloud Spanner to derive values for all primary key columns in the + /// row(s) to be modified. + pub columns: Option>, +} + +impl Part for Write {} + + +/// An isolated set of Cloud Spanner resources on which databases can be hosted. +/// +/// # 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*). +/// +/// * [instances get projects](struct.ProjectInstanceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Instance { + /// Output only. The current instance state. For + /// CreateInstance, the state must be + /// either omitted or set to `CREATING`. For + /// UpdateInstance, the state must be + /// either omitted or set to `READY`. + pub state: Option, + /// Required. The descriptive name for this instance as it appears in UIs. + /// Must be unique per project and between 4 and 30 characters in length. + #[serde(rename="displayName")] + pub display_name: Option, + /// Required. A unique identifier for the instance, which cannot be changed + /// after the instance is created. Values are of the form + /// `projects//instances/a-z*[a-z0-9]`. The final + /// segment of the name must be between 6 and 30 characters in length. + pub name: Option, + /// Required. The number of nodes allocated to this instance. This may be zero + /// in API responses for instances that are not yet in state `READY`. + /// + /// Each Spanner node can provide up to 10,000 QPS of reads or 2000 QPS of + /// writes (writing single rows at 1KB data per row), and 2 TiB storage. + /// + /// For optimal performance, we recommend provisioning enough nodes to keep + /// overall CPU utilization under 75%. + /// + /// A minimum of 3 nodes is recommended for production environments. This + /// minimum is required for SLAs to apply to your instance. + /// + /// Note that Cloud Spanner performance is highly dependent on workload, schema + /// design, and dataset characteristics. The performance numbers above are + /// estimates, and assume [best practices](https://cloud.google.com/spanner/docs/bulk-loading) + /// are followed. + #[serde(rename="nodeCount")] + pub node_count: Option, + /// Cloud Labels are a flexible and lightweight mechanism for organizing cloud + /// resources into groups that reflect a customer's organizational needs and + /// deployment strategies. Cloud Labels can be used to filter collections of + /// resources. They can be used to control how resource metrics are aggregated. + /// And they can be used as arguments to policy management rules (e.g. route, + /// firewall, load balancing, etc.). + /// + /// * 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 64 labels can be associated with a given resource. + /// + /// See https://goo.gl/xmQnxf for more information on and examples of labels. + /// + /// If you plan to use labels in your own code, please note that additional + /// characters may be allowed in the future. And so you are advised to use an + /// internal label representation, such as JSON, which doesn't rely upon + /// specific characters being disallowed. For example, representing labels + /// as the string: name + "_" + value would prove problematic if we were to + /// allow "_" in a future release. + pub labels: Option>, + /// Required. The name of the instance's configuration. Values are of the form + /// `projects//instanceConfigs/`. See + /// also InstanceConfig and + /// ListInstanceConfigs. + pub config: Option, +} + +impl ResponseResult for Instance {} + + +/// The response for ListDatabases. +/// +/// # 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*). +/// +/// * [instances databases list projects](struct.ProjectInstanceDatabaseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDatabasesResponse { + /// `next_page_token` can be sent in a subsequent + /// ListDatabases call to fetch more + /// of the matching databases. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Databases that matched the request. + pub databases: Option>, +} + +impl ResponseResult for ListDatabasesResponse {} + + +/// Request message for `GetIamPolicy` 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*). +/// +/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (request) +/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIamPolicyRequest { _never_set: Option } + +impl RequestValue for GetIamPolicyRequest {} + + +/// KeyRange represents a range of rows in a table or index. +/// +/// A range has a start key and an end key. These keys can be open or +/// closed, indicating if the range includes rows with that key. +/// +/// Keys are represented by lists, where the ith value in the list +/// corresponds to the ith component of the table or index primary key. +/// Individual values are encoded as described here. +/// +/// For example, consider the following table definition: +/// +/// CREATE TABLE UserEvents ( +/// UserName STRING(MAX), +/// EventDate STRING(10) +/// ) PRIMARY KEY(UserName, EventDate); +/// +/// The following keys name rows in this table: +/// +/// "Bob", "2014-09-23" +/// +/// Since the `UserEvents` table's `PRIMARY KEY` clause names two +/// columns, each `UserEvents` key has two elements; the first is the +/// `UserName`, and the second is the `EventDate`. +/// +/// Key ranges with multiple components are interpreted +/// lexicographically by component using the table or index key's declared +/// sort order. For example, the following range returns all events for +/// user `"Bob"` that occurred in the year 2015: +/// +/// "start_closed": ["Bob", "2015-01-01"] +/// "end_closed": ["Bob", "2015-12-31"] +/// +/// Start and end keys can omit trailing key components. This affects the +/// inclusion and exclusion of rows that exactly match the provided key +/// components: if the key is closed, then rows that exactly match the +/// provided components are included; if the key is open, then rows +/// that exactly match are not included. +/// +/// For example, the following range includes all events for `"Bob"` that +/// occurred during and after the year 2000: +/// +/// "start_closed": ["Bob", "2000-01-01"] +/// "end_closed": ["Bob"] +/// +/// The next example retrieves all events for `"Bob"`: +/// +/// "start_closed": ["Bob"] +/// "end_closed": ["Bob"] +/// +/// To retrieve events before the year 2000: +/// +/// "start_closed": ["Bob"] +/// "end_open": ["Bob", "2000-01-01"] +/// +/// The following range includes all rows in the table: +/// +/// "start_closed": [] +/// "end_closed": [] +/// +/// This range returns all users whose `UserName` begins with any +/// character from A to C: +/// +/// "start_closed": ["A"] +/// "end_open": ["D"] +/// +/// This range returns all users whose `UserName` begins with B: +/// +/// "start_closed": ["B"] +/// "end_open": ["C"] +/// +/// Key ranges honor column sort order. For example, suppose a table is +/// defined as follows: +/// +/// CREATE TABLE DescendingSortedTable { +/// Key INT64, +/// ... +/// ) PRIMARY KEY(Key DESC); +/// +/// The following range retrieves all rows with key values between 1 +/// and 100 inclusive: +/// +/// "start_closed": ["100"] +/// "end_closed": ["1"] +/// +/// Note that 100 is passed as the start, and 1 is passed as the end, +/// because `Key` is a descending column in the schema. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyRange { + /// If the end is open, then the range excludes rows whose first + /// `len(end_open)` key columns exactly match `end_open`. + #[serde(rename="endOpen")] + pub end_open: Option>, + /// If the start is open, then the range excludes rows whose first + /// `len(start_open)` key columns exactly match `start_open`. + #[serde(rename="startOpen")] + pub start_open: Option>, + /// If the end is closed, then the range includes all rows whose + /// first `len(end_closed)` key columns exactly match `end_closed`. + #[serde(rename="endClosed")] + pub end_closed: Option>, + /// If the start is closed, then the range includes all rows whose + /// first `len(start_closed)` key columns exactly match `start_closed`. + #[serde(rename="startClosed")] + pub start_closed: Option>, +} + +impl Part for KeyRange {} + + +/// A modification to one or more Cloud Spanner rows. Mutations can be +/// applied to a Cloud Spanner database by sending them in a +/// Commit call. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Mutation { + /// Insert new rows in a table. If any of the rows already exist, + /// the write or transaction fails with error `ALREADY_EXISTS`. + pub insert: Option, + /// Delete rows from a table. Succeeds whether or not the named + /// rows were present. + pub delete: Option, + /// Like insert, except that if the row already exists, then + /// its column values are overwritten with the ones provided. Any + /// column values not explicitly written are preserved. + #[serde(rename="insertOrUpdate")] + pub insert_or_update: Option, + /// Update existing rows in a table. If any of the rows does not + /// already exist, the transaction fails with error `NOT_FOUND`. + pub update: Option, + /// Like insert, except that if the row already exists, it is + /// deleted, and the column values provided are inserted + /// instead. Unlike insert_or_update, this means any values not + /// explicitly written become `NULL`. + pub replace: Option, +} + +impl Part for Mutation {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +/// `members` to a `role`, where the members can be user accounts, Google groups, +/// Google domains, and service accounts. A `role` is a named list of permissions +/// defined by IAM. +/// +/// **Example** +/// +/// { +/// "bindings": [ +/// { +/// "role": "roles/owner", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +/// ] +/// }, +/// { +/// "role": "roles/viewer", +/// "members": ["user:sean@example.com"] +/// } +/// ] +/// } +/// +/// For a description of IAM and its features, see the +/// [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # 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*). +/// +/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (response) +/// * [instances databases set iam policy projects](struct.ProjectInstanceDatabaseSetIamPolicyCall.html) (response) +/// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (response) +/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of `members` to a `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, +} + +impl ResponseResult for Policy {} + + +/// Enqueues the given DDL statements to be applied, in order but not +/// necessarily all at once, to the database schema at some point (or +/// points) in the future. The server checks that the statements +/// are executable (syntactically valid, name tables that exist, etc.) +/// before enqueueing them, but they may still fail upon +/// later execution (e.g., if a statement from another batch of +/// statements is applied first and it conflicts in some way, or if +/// there is some data-related problem like a `NULL` value in a column to +/// which `NOT NULL` would be added). If a statement fails, all +/// subsequent statements in the batch are automatically cancelled. +/// +/// Each batch of statements is assigned a name which can be used with +/// the Operations API to monitor +/// progress. See the +/// operation_id field for more +/// details. +/// +/// # 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*). +/// +/// * [instances databases update ddl projects](struct.ProjectInstanceDatabaseUpdateDdlCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateDatabaseDdlRequest { + /// DDL statements to be applied to the database. + pub statements: Option>, + /// If empty, the new update request is assigned an + /// automatically-generated operation ID. Otherwise, `operation_id` + /// is used to construct the name of the resulting + /// Operation. + /// + /// Specifying an explicit operation ID simplifies determining + /// whether the statements were executed in the event that the + /// UpdateDatabaseDdl call is replayed, + /// or the return value is otherwise lost: the database and + /// `operation_id` fields can be combined to form the + /// name of the resulting + /// longrunning.Operation: `/operations/`. + /// + /// `operation_id` should be unique within the database, and must be + /// a valid identifier: `a-z*`. Note that + /// automatically-generated operation IDs always begin with an + /// underscore. If the named operation already exists, + /// UpdateDatabaseDdl returns + /// `ALREADY_EXISTS`. + #[serde(rename="operationId")] + pub operation_id: Option, +} + +impl RequestValue for UpdateDatabaseDdlRequest {} + + +/// `Type` indicates the type of a Cloud Spanner value, as might be stored in a +/// table cell or returned from an SQL query. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Type { + /// If code == STRUCT, then `struct_type` + /// provides type information for the struct's fields. + #[serde(rename="structType")] + pub struct_type: Option, + /// Required. The TypeCode for this type. + pub code: Option, + /// If code == ARRAY, then `array_element_type` + /// is the type of the array elements. + #[serde(rename="arrayElementType")] + pub array_element_type: Option>>, +} + +impl Part for Type {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases operations cancel projects](struct.ProjectInstanceDatabaseOperationCancelCall.html) (response) +/// * [instances databases drop database projects](struct.ProjectInstanceDatabaseDropDatabaseCall.html) (response) +/// * [instances operations delete projects](struct.ProjectInstanceOperationDeleteCall.html) (response) +/// * [instances databases operations delete projects](struct.ProjectInstanceDatabaseOperationDeleteCall.html) (response) +/// * [instances delete projects](struct.ProjectInstanceDeleteCall.html) (response) +/// * [instances operations cancel projects](struct.ProjectInstanceOperationCancelCall.html) (response) +/// * [instances databases sessions rollback projects](struct.ProjectInstanceDatabaseSessionRollbackCall.html) (response) +/// * [instances databases sessions delete projects](struct.ProjectInstanceDatabaseSessionDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// # Transactions +/// +/// +/// Each session can have at most one active transaction at a time. After the +/// active transaction is completed, the session can immediately be +/// re-used for the next transaction. It is not necessary to create a +/// new session for each transaction. +/// +/// # Transaction Modes +/// +/// Cloud Spanner supports two transaction modes: +/// +/// 1. Locking read-write. This type of transaction is the only way +/// to write data into Cloud Spanner. These transactions rely on +/// pessimistic locking and, if necessary, two-phase commit. +/// Locking read-write transactions may abort, requiring the +/// application to retry. +/// +/// 2. Snapshot read-only. This transaction type provides guaranteed +/// consistency across several reads, but does not allow +/// writes. Snapshot read-only transactions can be configured to +/// read at timestamps in the past. Snapshot read-only +/// transactions do not need to be committed. +/// +/// For transactions that only read, snapshot read-only transactions +/// provide simpler semantics and are almost always faster. In +/// particular, read-only transactions do not take locks, so they do +/// not conflict with read-write transactions. As a consequence of not +/// taking locks, they also do not abort, so retry loops are not needed. +/// +/// Transactions may only read/write data in a single database. They +/// may, however, read/write data in different tables within that +/// database. +/// +/// ## Locking Read-Write Transactions +/// +/// Locking transactions may be used to atomically read-modify-write +/// data anywhere in a database. This type of transaction is externally +/// consistent. +/// +/// Clients should attempt to minimize the amount of time a transaction +/// is active. Faster transactions commit with higher probability +/// and cause less contention. Cloud Spanner attempts to keep read locks +/// active as long as the transaction continues to do reads, and the +/// transaction has not been terminated by +/// Commit or +/// Rollback. Long periods of +/// inactivity at the client may cause Cloud Spanner to release a +/// transaction's locks and abort it. +/// +/// Reads performed within a transaction acquire locks on the data +/// being read. Writes can only be done at commit time, after all reads +/// have been completed. +/// Conceptually, a read-write transaction consists of zero or more +/// reads or SQL queries followed by +/// Commit. At any time before +/// Commit, the client can send a +/// Rollback request to abort the +/// transaction. +/// +/// ### Semantics +/// +/// Cloud Spanner can commit the transaction if all read locks it acquired +/// are still valid at commit time, and it is able to acquire write +/// locks for all writes. Cloud Spanner can abort the transaction for any +/// reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees +/// that the transaction has not modified any user data in Cloud Spanner. +/// +/// Unless the transaction commits, Cloud Spanner makes no guarantees about +/// how long the transaction's locks were held for. It is an error to +/// use Cloud Spanner locks for any sort of mutual exclusion other than +/// between Cloud Spanner transactions themselves. +/// +/// ### Retrying Aborted Transactions +/// +/// When a transaction aborts, the application can choose to retry the +/// whole transaction again. To maximize the chances of successfully +/// committing the retry, the client should execute the retry in the +/// same session as the original attempt. The original session's lock +/// priority increases with each consecutive abort, meaning that each +/// attempt has a slightly better chance of success than the previous. +/// +/// Under some circumstances (e.g., many transactions attempting to +/// modify the same row(s)), a transaction can abort many times in a +/// short period before successfully committing. Thus, it is not a good +/// idea to cap the number of retries a transaction can attempt; +/// instead, it is better to limit the total amount of wall time spent +/// retrying. +/// +/// ### Idle Transactions +/// +/// A transaction is considered idle if it has no outstanding reads or +/// SQL queries and has not started a read or SQL query within the last 10 +/// seconds. Idle transactions can be aborted by Cloud Spanner so that they +/// don't hold on to locks indefinitely. In that case, the commit will +/// fail with error `ABORTED`. +/// +/// If this behavior is undesirable, periodically executing a simple +/// SQL query in the transaction (e.g., `SELECT 1`) prevents the +/// transaction from becoming idle. +/// +/// ## Snapshot Read-Only Transactions +/// +/// Snapshot read-only transactions provides a simpler method than +/// locking read-write transactions for doing several consistent +/// reads. However, this type of transaction does not support writes. +/// +/// Snapshot transactions do not take locks. Instead, they work by +/// choosing a Cloud Spanner timestamp, then executing all reads at that +/// timestamp. Since they do not acquire locks, they do not block +/// concurrent read-write transactions. +/// +/// Unlike locking read-write transactions, snapshot read-only +/// transactions never abort. They can fail if the chosen read +/// timestamp is garbage collected; however, the default garbage +/// collection policy is generous enough that most applications do not +/// need to worry about this in practice. +/// +/// Snapshot read-only transactions do not need to call +/// Commit or +/// Rollback (and in fact are not +/// permitted to do so). +/// +/// To execute a snapshot transaction, the client specifies a timestamp +/// bound, which tells Cloud Spanner how to choose a read timestamp. +/// +/// The types of timestamp bound are: +/// +/// - Strong (the default). +/// - Bounded staleness. +/// - Exact staleness. +/// +/// If the Cloud Spanner database to be read is geographically distributed, +/// stale read-only transactions can execute more quickly than strong +/// or read-write transaction, because they are able to execute far +/// from the leader replica. +/// +/// Each type of timestamp bound is discussed in detail below. +/// +/// ### Strong +/// +/// Strong reads are guaranteed to see the effects of all transactions +/// that have committed before the start of the read. Furthermore, all +/// rows yielded by a single read are consistent with each other -- if +/// any part of the read observes a transaction, all parts of the read +/// see the transaction. +/// +/// Strong reads are not repeatable: two consecutive strong read-only +/// transactions might return inconsistent results if there are +/// concurrent writes. If consistency across reads is required, the +/// reads should be executed within a transaction or at an exact read +/// timestamp. +/// +/// See TransactionOptions.ReadOnly.strong. +/// +/// ### Exact Staleness +/// +/// These timestamp bounds execute reads at a user-specified +/// timestamp. Reads at a timestamp are guaranteed to see a consistent +/// prefix of the global transaction history: they observe +/// modifications done by all transactions with a commit timestamp <= +/// the read timestamp, and observe none of the modifications done by +/// transactions with a larger commit timestamp. They will block until +/// all conflicting transactions that may be assigned commit timestamps +/// <= the read timestamp have finished. +/// +/// The timestamp can either be expressed as an absolute Cloud Spanner commit +/// timestamp or a staleness relative to the current time. +/// +/// These modes do not require a "negotiation phase" to pick a +/// timestamp. As a result, they execute slightly faster than the +/// equivalent boundedly stale concurrency modes. On the other hand, +/// boundedly stale reads usually return fresher results. +/// +/// See TransactionOptions.ReadOnly.read_timestamp and +/// TransactionOptions.ReadOnly.exact_staleness. +/// +/// ### Bounded Staleness +/// +/// Bounded staleness modes allow Cloud Spanner to pick the read timestamp, +/// subject to a user-provided staleness bound. Cloud Spanner chooses the +/// newest timestamp within the staleness bound that allows execution +/// of the reads at the closest available replica without blocking. +/// +/// All rows yielded are consistent with each other -- if any part of +/// the read observes a transaction, all parts of the read see the +/// transaction. Boundedly stale reads are not repeatable: two stale +/// reads, even if they use the same staleness bound, can execute at +/// different timestamps and thus return inconsistent results. +/// +/// Boundedly stale reads execute in two phases: the first phase +/// negotiates a timestamp among all replicas needed to serve the +/// read. In the second phase, reads are executed at the negotiated +/// timestamp. +/// +/// As a result of the two phase execution, bounded staleness reads are +/// usually a little slower than comparable exact staleness +/// reads. However, they are typically able to return fresher +/// results, and are more likely to execute at the closest replica. +/// +/// Because the timestamp negotiation requires up-front knowledge of +/// which rows will be read, it can only be used with single-use +/// read-only transactions. +/// +/// See TransactionOptions.ReadOnly.max_staleness and +/// TransactionOptions.ReadOnly.min_read_timestamp. +/// +/// ### Old Read Timestamps and Garbage Collection +/// +/// Cloud Spanner continuously garbage collects deleted and overwritten data +/// in the background to reclaim storage space. This process is known +/// as "version GC". By default, version GC reclaims versions after they +/// are one hour old. Because of this, Cloud Spanner cannot perform reads +/// at read timestamps more than one hour in the past. This +/// restriction also applies to in-progress reads and/or SQL queries whose +/// timestamp become too old while executing. Reads and SQL queries with +/// too-old read timestamps fail with the error `FAILED_PRECONDITION`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransactionOptions { + /// Transaction may write. + /// + /// Authorization to begin a read-write transaction requires + /// `spanner.databases.beginOrRollbackReadWriteTransaction` permission + /// on the `session` resource. + #[serde(rename="readWrite")] + pub read_write: Option, + /// Transaction will not write. + /// + /// Authorization to begin a read-only transaction requires + /// `spanner.databases.beginReadOnlyTransaction` permission + /// on the `session` resource. + #[serde(rename="readOnly")] + pub read_only: Option, +} + +impl Part for TransactionOptions {} + + +/// 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*). +/// +/// * [instances databases test iam permissions projects](struct.ProjectInstanceDatabaseTestIamPermissionCall.html) (response) +/// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.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 {} + + +/// The response for Commit. +/// +/// # 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*). +/// +/// * [instances databases sessions commit projects](struct.ProjectInstanceDatabaseSessionCommitCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitResponse { + /// The Cloud Spanner timestamp at which the transaction committed. + #[serde(rename="commitTimestamp")] + pub commit_timestamp: Option, +} + +impl ResponseResult for CommitResponse {} + + +/// Metadata associated with a parent-child relationship appearing in a +/// PlanNode. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChildLink { + /// Only present if the child node is SCALAR and corresponds + /// to an output variable of the parent node. The field carries the name of + /// the output variable. + /// For example, a `TableScan` operator that reads rows from a table will + /// have child links to the `SCALAR` nodes representing the output variables + /// created for each column that is read by the operator. The corresponding + /// `variable` fields will be set to the variable names assigned to the + /// columns. + pub variable: Option, + /// The type of the link. For example, in Hash Joins this could be used to + /// distinguish between the build child and the probe child, or in the case + /// of the child being an output variable, to represent the tag associated + /// with the output variable. + #[serde(rename="type")] + pub type_: Option, + /// The node to which the link points. + #[serde(rename="childIndex")] + pub child_index: Option, +} + +impl Part for ChildLink {} + + +/// The request for UpdateInstance. +/// +/// # 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*). +/// +/// * [instances patch projects](struct.ProjectInstancePatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateInstanceRequest { + /// Required. The instance to update, which must always include the instance + /// name. Otherwise, only fields mentioned in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included. + pub instance: Option, + /// Required. A mask specifying which fields in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should be updated. + /// The field mask must always be specified; this prevents any future fields in + /// [][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know + /// about them. + #[serde(rename="fieldMask")] + pub field_mask: Option, +} + +impl RequestValue for UpdateInstanceRequest {} + + +/// The request for CreateInstance. +/// +/// # 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*). +/// +/// * [instances create projects](struct.ProjectInstanceCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateInstanceRequest { + /// Required. The ID of the instance to create. Valid identifiers are of the + /// form `a-z*[a-z0-9]` and must be between 6 and 30 characters in + /// length. + #[serde(rename="instanceId")] + pub instance_id: Option, + /// Required. The instance to create. The name may be omitted, but if + /// specified must be `/instances/`. + pub instance: Option, +} + +impl RequestValue for CreateInstanceRequest {} + + +/// `StructType` defines the fields of a STRUCT 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 StructType { + /// The list of fields that make up this struct. Order is + /// significant, because values of this struct type are represented as + /// lists, where the order of field values matches the order of + /// fields in the StructType. In turn, the order of fields + /// matches the order of columns in a read request, or the order of + /// fields in the `SELECT` clause of a query. + pub fields: Option>, +} + +impl Part for StructType {} + + +/// A transaction. +/// +/// # 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*). +/// +/// * [instances databases sessions begin transaction projects](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Transaction { + /// For snapshot read-only transactions, the read timestamp chosen + /// for the transaction. Not returned by default: see + /// TransactionOptions.ReadOnly.return_read_timestamp. + #[serde(rename="readTimestamp")] + pub read_timestamp: Option, + /// `id` may be used to identify the transaction in subsequent + /// Read, + /// ExecuteSql, + /// Commit, or + /// Rollback calls. + /// + /// Single-use read-only transactions do not have IDs, because + /// single-use transactions do not support multiple requests. + pub id: Option, +} + +impl ResponseResult for Transaction {} + + +/// 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*). +/// +/// * [instances databases test iam permissions projects](struct.ProjectInstanceDatabaseTestIamPermissionCall.html) (request) +/// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsRequest { + /// REQUIRED: The set of permissions to check for 'resource'. + /// Permissions with wildcards (such as '*', 'spanner.*', 'spanner.instances.*') are not allowed. + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// A Cloud Spanner database. +/// +/// # 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*). +/// +/// * [instances databases get projects](struct.ProjectInstanceDatabaseGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Database { + /// Output only. The current database state. + pub state: Option, + /// Required. The name of the database. Values are of the form + /// `projects//instances//databases/`, + /// where `` is as specified in the `CREATE DATABASE` + /// statement. This name can be passed to other API methods to + /// identify the database. + pub name: Option, +} + +impl ResponseResult for Database {} + + +/// Node information for nodes appearing in a QueryPlan.plan_nodes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlanNode { + /// The `PlanNode`'s index in node list. + pub index: Option, + /// Used to determine the type of node. May be needed for visualizing + /// different kinds of nodes differently. For example, If the node is a + /// SCALAR node, it will have a condensed representation + /// which can be used to directly embed a description of the node in its + /// parent. + pub kind: Option, + /// The display name for the node. + #[serde(rename="displayName")] + pub display_name: Option, + /// The execution statistics associated with the node, contained in a group of + /// key-value pairs. Only present if the plan was returned as a result of a + /// profile query. For example, number of executions, number of rows/time per + /// execution etc. + #[serde(rename="executionStats")] + pub execution_stats: Option>, + /// List of child node `index`es and their relationship to this parent. + #[serde(rename="childLinks")] + pub child_links: Option>, + /// Condensed representation for SCALAR nodes. + #[serde(rename="shortRepresentation")] + pub short_representation: Option, + /// Attributes relevant to the node contained in a group of key-value pairs. + /// For example, a Parameter Reference node could have the following + /// information in its metadata: + /// + /// { + /// "parameter_reference": "param1", + /// "parameter_type": "array" + /// } + pub metadata: Option>, +} + +impl Part for PlanNode {} + + +/// The response for GetDatabaseDdl. +/// +/// # 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*). +/// +/// * [instances databases get ddl projects](struct.ProjectInstanceDatabaseGetDdlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetDatabaseDdlResponse { + /// A list of formatted DDL statements defining the schema of the database + /// specified in the request. + pub statements: Option>, +} + +impl ResponseResult for GetDatabaseDdlResponse {} + + +/// The response for ListInstanceConfigs. +/// +/// # 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*). +/// +/// * [instance configs list projects](struct.ProjectInstanceConfigListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListInstanceConfigsResponse { + /// `next_page_token` can be sent in a subsequent + /// ListInstanceConfigs call to + /// fetch more of the matching instance configurations. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of requested instance configurations. + #[serde(rename="instanceConfigs")] + pub instance_configs: Option>, +} + +impl ResponseResult for ListInstanceConfigsResponse {} + + +/// Additional statistics about a ResultSet or PartialResultSet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultSetStats { + /// QueryPlan for the query associated with this result. + #[serde(rename="queryPlan")] + pub query_plan: Option, + /// Aggregated statistics from the execution of the query. Only present when + /// the query is profiled. For example, a query could return the statistics as + /// follows: + /// + /// { + /// "rows_returned": "3", + /// "elapsed_time": "1.22 secs", + /// "cpu_time": "1.19 secs" + /// } + #[serde(rename="queryStats")] + pub query_stats: Option>, +} + +impl Part for ResultSetStats {} + + +/// The request for ExecuteSql and +/// ExecuteStreamingSql. +/// +/// # 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*). +/// +/// * [instances databases sessions execute sql projects](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html) (request) +/// * [instances databases sessions execute streaming sql projects](struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExecuteSqlRequest { + /// It is not always possible for Cloud Spanner to infer the right SQL type + /// from a JSON value. For example, values of type `BYTES` and values + /// of type `STRING` both appear in params as JSON strings. + /// + /// In these cases, `param_types` can be used to specify the exact + /// SQL type for some or all of the SQL query parameters. See the + /// definition of Type for more information + /// about SQL types. + #[serde(rename="paramTypes")] + pub param_types: Option>, + /// The transaction to use. If none is provided, the default is a + /// temporary read-only transaction with strong concurrency. + pub transaction: Option, + /// The SQL query string can contain parameter placeholders. A parameter + /// placeholder consists of `'@'` followed by the parameter + /// name. Parameter names consist of any combination of letters, + /// numbers, and underscores. + /// + /// Parameters can appear anywhere that a literal value is expected. The same + /// parameter name can be used more than once, for example: + /// `"WHERE id > @msg_id AND id < @msg_id + 100"` + /// + /// It is an error to execute an SQL query with unbound parameters. + /// + /// Parameter values are specified using `params`, which is a JSON + /// object whose keys are parameter names, and whose values are the + /// corresponding parameter values. + pub params: Option>, + /// Required. The SQL query string. + pub sql: Option, + /// Used to control the amount of debugging information returned in + /// ResultSetStats. + #[serde(rename="queryMode")] + pub query_mode: Option, + /// If this request is resuming a previously interrupted SQL query + /// execution, `resume_token` should be copied from the last + /// PartialResultSet yielded before the interruption. Doing this + /// enables the new SQL query execution to resume where the last one left + /// off. The rest of the request parameters must exactly match the + /// request that yielded this token. + #[serde(rename="resumeToken")] + pub resume_token: Option, +} + +impl RequestValue for ExecuteSqlRequest {} + + +/// This message is used to select the transaction in which a +/// Read or +/// ExecuteSql call runs. +/// +/// See TransactionOptions for more information about transactions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransactionSelector { + /// Begin a new transaction and execute this read or SQL query in + /// it. The transaction ID of the new transaction is returned in + /// ResultSetMetadata.transaction, which is a Transaction. + pub begin: Option, + /// Execute the read or SQL query in a temporary transaction. + /// This is the most efficient way to execute a transaction that + /// consists of a single SQL query. + #[serde(rename="singleUse")] + pub single_use: Option, + /// Execute the read or SQL query in a previously-started transaction. + pub id: Option, +} + +impl Part for TransactionSelector {} + + +/// A possible configuration for a Cloud Spanner instance. Configurations +/// define the geographic placement of nodes and their replication. +/// +/// # 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*). +/// +/// * [instance configs get projects](struct.ProjectInstanceConfigGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceConfig { + /// The name of this instance configuration as it appears in UIs. + #[serde(rename="displayName")] + pub display_name: Option, + /// A unique identifier for the instance configuration. Values + /// are of the form + /// `projects//instanceConfigs/a-z*` + pub name: Option, +} + +impl ResponseResult for InstanceConfig {} + + +/// Arguments to delete operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Delete { + /// Required. The table whose rows will be deleted. + pub table: Option, + /// Required. The primary keys of the rows within table to delete. + #[serde(rename="keySet")] + pub key_set: Option, +} + +impl Part for Delete {} + + +/// The request for Commit. +/// +/// # 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*). +/// +/// * [instances databases sessions commit projects](struct.ProjectInstanceDatabaseSessionCommitCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitRequest { + /// Commit a previously-started transaction. + #[serde(rename="transactionId")] + pub transaction_id: Option, + /// The mutations to be executed when this transaction commits. All + /// mutations are applied atomically, in the order they appear in + /// this list. + pub mutations: Option>, + /// Execute mutations in a temporary transaction. Note that unlike + /// commit of a previously-started transaction, commit with a + /// temporary transaction is non-idempotent. That is, if the + /// `CommitRequest` is sent to Cloud Spanner more than once (for + /// instance, due to retries in the application, or in the + /// transport library), it is possible that the mutations are + /// executed more than once. If this is undesirable, use + /// BeginTransaction and + /// Commit instead. + #[serde(rename="singleUseTransaction")] + pub single_use_transaction: Option, +} + +impl RequestValue for CommitRequest {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases operations list projects](struct.ProjectInstanceDatabaseOperationListCall.html) (response) +/// * [instances operations list projects](struct.ProjectInstanceOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListOperationsResponse {} + + +/// Message representing a single field of a struct. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Field { + /// The type of the field. + #[serde(rename="type")] + pub type_: Option, + /// The name of the field. For reads, this is the column name. For + /// SQL queries, it is the column alias (e.g., `"Word"` in the + /// query `"SELECT 'hello' AS Word"`), or the column name (e.g., + /// `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + /// columns might have an empty name (e.g., !"SELECT + /// UPPER(ColName)"`). Note that a query result can contain + /// multiple fields with the same name. + pub name: Option, +} + +impl Part for Field {} + + +/// Message type to initiate a read-write transaction. Currently this +/// transaction type has no options. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadWrite { _never_set: Option } + +impl Part for ReadWrite {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// The request for CreateDatabase. +/// +/// # 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*). +/// +/// * [instances databases create projects](struct.ProjectInstanceDatabaseCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateDatabaseRequest { + /// An optional list of DDL statements to run inside the newly created + /// database. Statements can create tables, indexes, etc. These + /// statements execute atomically with the creation of the database: + /// if there is an error in any statement, the database is not created. + #[serde(rename="extraStatements")] + pub extra_statements: Option>, + /// Required. A `CREATE DATABASE` statement, which specifies the ID of the + /// new database. The database ID must conform to the regular expression + /// `a-z*[a-z0-9]` and be between 2 and 30 characters in length. + /// If the database ID is a reserved word or if it contains a hyphen, the + /// database ID must be enclosed in backticks (`` ` ``). + #[serde(rename="createStatement")] + pub create_statement: Option, +} + +impl RequestValue for CreateDatabaseRequest {} + + +/// The request for Rollback. +/// +/// # 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*). +/// +/// * [instances databases sessions rollback projects](struct.ProjectInstanceDatabaseSessionRollbackCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RollbackRequest { + /// Required. The transaction to roll back. + #[serde(rename="transactionId")] + pub transaction_id: Option, +} + +impl RequestValue for RollbackRequest {} + + +/// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All +/// the keys are expected to be in the same table or index. The keys need +/// not be sorted in any particular way. +/// +/// If the same key is specified multiple times in the set (for example +/// if two ranges, two keys, or a key and a range overlap), Cloud Spanner +/// behaves as if the key were only specified once. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeySet { + /// A list of key ranges. See KeyRange for more information about + /// key range specifications. + pub ranges: Option>, + /// A list of specific keys. Entries in `keys` should have exactly as + /// many elements as there are columns in the primary or index key + /// with which this `KeySet` is used. Individual key values are + /// encoded as described here. + pub keys: Option>>, + /// For convenience `all` can be set to `true` to indicate that this + /// `KeySet` matches all keys in the table or index. Note that any keys + /// specified in `keys` or `ranges` are only yielded once. + pub all: Option, +} + +impl Part for KeySet {} + + +/// Message type to initiate a read-only transaction. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadOnly { + /// Executes all reads at a timestamp >= `min_read_timestamp`. + /// + /// This is useful for requesting fresher data than some previous + /// read, or data that is fresh enough to observe the effects of some + /// previously committed transaction whose timestamp is known. + /// + /// Note that this option can only be used in single-use transactions. + #[serde(rename="minReadTimestamp")] + pub min_read_timestamp: Option, + /// Executes all reads at the given timestamp. Unlike other modes, + /// reads at a specific timestamp are repeatable; the same read at + /// the same timestamp always returns the same data. If the + /// timestamp is in the future, the read will block until the + /// specified timestamp, modulo the read's deadline. + /// + /// Useful for large scale consistent reads such as mapreduces, or + /// for coordinating many reads against a consistent snapshot of the + /// data. + #[serde(rename="readTimestamp")] + pub read_timestamp: Option, + /// Read at a timestamp where all previously committed transactions + /// are visible. + pub strong: Option, + /// If true, the Cloud Spanner-selected read timestamp is included in + /// the Transaction message that describes the transaction. + #[serde(rename="returnReadTimestamp")] + pub return_read_timestamp: Option, + /// Read data at a timestamp >= `NOW - max_staleness` + /// seconds. Guarantees that all writes that have committed more + /// than the specified number of seconds ago are visible. Because + /// Cloud Spanner chooses the exact timestamp, this mode works even if + /// the client's local clock is substantially skewed from Cloud Spanner + /// commit timestamps. + /// + /// Useful for reading the freshest data available at a nearby + /// replica, while bounding the possible staleness if the local + /// replica has fallen behind. + /// + /// Note that this option can only be used in single-use + /// transactions. + #[serde(rename="maxStaleness")] + pub max_staleness: Option, + /// Executes all reads at a timestamp that is `exact_staleness` + /// old. The timestamp is chosen soon after the read is started. + /// + /// Guarantees that all writes that have committed more than the + /// specified number of seconds ago are visible. Because Cloud Spanner + /// chooses the exact timestamp, this mode works even if the client's + /// local clock is substantially skewed from Cloud Spanner commit + /// timestamps. + /// + /// Useful for reading at nearby replicas without the distributed + /// timestamp negotiation overhead of `max_staleness`. + #[serde(rename="exactStaleness")] + pub exact_staleness: Option, +} + +impl Part for ReadOnly {} + + +/// The request for BeginTransaction. +/// +/// # 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*). +/// +/// * [instances databases sessions begin transaction projects](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BeginTransactionRequest { + /// Required. Options for the new transaction. + pub options: Option, +} + +impl RequestValue for BeginTransactionRequest {} + + +/// The request for Read and +/// StreamingRead. +/// +/// # 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*). +/// +/// * [instances databases sessions streaming read projects](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html) (request) +/// * [instances databases sessions read projects](struct.ProjectInstanceDatabaseSessionReadCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadRequest { + /// If non-empty, the name of an index on table. This index is + /// used instead of the table primary key when interpreting key_set + /// and sorting result rows. See key_set for further information. + pub index: Option, + /// The transaction to use. If none is provided, the default is a + /// temporary read-only transaction with strong concurrency. + pub transaction: Option, + /// If greater than zero, only the first `limit` rows are yielded. If `limit` + /// is zero, the default is no limit. + /// A limit cannot be specified if partition_token is set. + pub limit: Option, + /// Required. `key_set` identifies the rows to be yielded. `key_set` names the + /// primary keys of the rows in table to be yielded, unless index + /// is present. If index is present, then key_set instead names + /// index keys in index. + /// + /// Rows are yielded in table primary key order (if index is empty) + /// or index key order (if index is non-empty). + /// + /// It is not an error for the `key_set` to name rows that do not + /// exist in the database. Read yields nothing for nonexistent rows. + #[serde(rename="keySet")] + pub key_set: Option, + /// Required. The name of the table in the database to be read. + pub table: Option, + /// If this request is resuming a previously interrupted read, + /// `resume_token` should be copied from the last + /// PartialResultSet yielded before the interruption. Doing this + /// enables the new read to resume where the last read left off. The + /// rest of the request parameters must exactly match the request + /// that yielded this token. + #[serde(rename="resumeToken")] + pub resume_token: Option, + /// The columns of table to be returned for each row matching + /// this request. + pub columns: Option>, +} + +impl RequestValue for ReadRequest {} + + +/// A session in the Cloud Spanner API. +/// +/// # 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*). +/// +/// * [instances databases sessions get projects](struct.ProjectInstanceDatabaseSessionGetCall.html) (response) +/// * [instances databases sessions create projects](struct.ProjectInstanceDatabaseSessionCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Session { + /// The labels for the session. + /// + /// * 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 20 labels can be associated with a given session. + pub labels: Option>, + /// Output only. The timestamp when the session is created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The approximate timestamp when the session is last used. It is + /// typically earlier than the actual last use time. + #[serde(rename="approximateLastUseTime")] + pub approximate_last_use_time: Option, + /// The name of the session. + pub name: Option, +} + +impl ResponseResult for Session {} + + +/// Metadata about a ResultSet or PartialResultSet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultSetMetadata { + /// Indicates the field names and types for the rows in the result + /// set. For example, a SQL query like `"SELECT UserId, UserName FROM + /// Users"` could return a `row_type` value like: + /// + /// "fields": [ + /// { "name": "UserId", "type": { "code": "INT64" } }, + /// { "name": "UserName", "type": { "code": "STRING" } }, + /// ] + #[serde(rename="rowType")] + pub row_type: Option, + /// If the read or SQL query began a transaction as a side-effect, the + /// information about the new transaction is yielded here. + pub transaction: Option, +} + +impl Part for ResultSetMetadata {} + + +/// Partial results from a streaming read or SQL query. Streaming reads and +/// SQL queries better tolerate large result sets, large rows, and large +/// values, but are a little trickier to consume. +/// +/// # 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*). +/// +/// * [instances databases sessions streaming read projects](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html) (response) +/// * [instances databases sessions execute streaming sql projects](struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartialResultSet { + /// If true, then the final value in values is chunked, and must + /// be combined with more values from subsequent `PartialResultSet`s + /// to obtain a complete field value. + #[serde(rename="chunkedValue")] + pub chunked_value: Option, + /// Streaming calls might be interrupted for a variety of reasons, such + /// as TCP connection loss. If this occurs, the stream of results can + /// be resumed by re-sending the original request and including + /// `resume_token`. Note that executing any other transaction in the + /// same session invalidates the token. + #[serde(rename="resumeToken")] + pub resume_token: Option, + /// A streamed result set consists of a stream of values, which might + /// be split into many `PartialResultSet` messages to accommodate + /// large rows and/or large values. Every N complete values defines a + /// row, where N is equal to the number of entries in + /// metadata.row_type.fields. + /// + /// Most values are encoded based on type as described + /// here. + /// + /// It is possible that the last value in values is "chunked", + /// meaning that the rest of the value is sent in subsequent + /// `PartialResultSet`(s). This is denoted by the chunked_value + /// field. Two or more chunked values can be merged to form a + /// complete value as follows: + /// + /// * `bool/number/null`: cannot be chunked + /// * `string`: concatenate the strings + /// * `list`: concatenate the lists. If the last element in a list is a + /// `string`, `list`, or `object`, merge it with the first element in + /// the next list by applying these rules recursively. + /// * `object`: concatenate the (field name, field value) pairs. If a + /// field name is duplicated, then apply these rules recursively + /// to merge the field values. + /// + /// Some examples of merging: + /// + /// # Strings are concatenated. + /// "foo", "bar" => "foobar" + /// + /// # Lists of non-strings are concatenated. + /// [2, 3], [4] => [2, 3, 4] + /// + /// # Lists are concatenated, but the last and first elements are merged + /// # because they are strings. + /// ["a", "b"], ["c", "d"] => ["a", "bc", "d"] + /// + /// # Lists are concatenated, but the last and first elements are merged + /// # because they are lists. Recursively, the last and first elements + /// # of the inner lists are merged because they are strings. + /// ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] + /// + /// # Non-overlapping object fields are combined. + /// {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} + /// + /// # Overlapping object fields are merged. + /// {"a": "1"}, {"a": "2"} => {"a": "12"} + /// + /// # Examples of merging objects containing lists of strings. + /// {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} + /// + /// For a more complete example, suppose a streaming SQL query is + /// yielding a result set whose rows contain a single string + /// field. The following `PartialResultSet`s might be yielded: + /// + /// { + /// "metadata": { ... } + /// "values": ["Hello", "W"] + /// "chunked_value": true + /// "resume_token": "Af65..." + /// } + /// { + /// "values": ["orl"] + /// "chunked_value": true + /// "resume_token": "Bqp2..." + /// } + /// { + /// "values": ["d"] + /// "resume_token": "Zx1B..." + /// } + /// + /// This sequence of `PartialResultSet`s encodes two rows, one + /// containing the field value `"Hello"`, and a second containing the + /// field value `"World" = "W" + "orl" + "d"`. + pub values: Option>, + /// Metadata about the result set, such as row type information. + /// Only present in the first response. + pub metadata: Option, + /// Query plan and execution statistics for the query that produced this + /// streaming result set. These can be requested by setting + /// ExecuteSqlRequest.query_mode and are sent + /// only once with the last response in the stream. + pub stats: Option, +} + +impl ResponseResult for PartialResultSet {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases operations get projects](struct.ProjectInstanceDatabaseOperationGetCall.html) (response) +/// * [instances operations get projects](struct.ProjectInstanceOperationGetCall.html) (response) +/// * [instances databases create projects](struct.ProjectInstanceDatabaseCreateCall.html) (response) +/// * [instances create projects](struct.ProjectInstanceCreateCall.html) (response) +/// * [instances databases update ddl projects](struct.ProjectInstanceDatabaseUpdateDdlCall.html) (response) +/// * [instances patch projects](struct.ProjectInstancePatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should have the format of `operations/some/unique/name`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for Operation {} + + +/// Condensed representation of a node and its subtree. Only present for +/// `SCALAR` PlanNode(s). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShortRepresentation { + /// A mapping of (subquery variable name) -> (subquery node id) for cases + /// where the `description` string of this node references a `SCALAR` + /// subquery contained in the expression subtree rooted at this node. The + /// referenced `SCALAR` subquery may not necessarily be a direct child of + /// this node. + pub subqueries: Option>, + /// A string representation of the expression subtree rooted at this node. + pub description: Option, +} + +impl Part for ShortRepresentation {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Spanner` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_spanner1 as spanner1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use spanner1::Spanner; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `instance_configs_get(...)`, `instance_configs_list(...)`, `instances_create(...)`, `instances_databases_create(...)`, `instances_databases_drop_database(...)`, `instances_databases_get(...)`, `instances_databases_get_ddl(...)`, `instances_databases_get_iam_policy(...)`, `instances_databases_list(...)`, `instances_databases_operations_cancel(...)`, `instances_databases_operations_delete(...)`, `instances_databases_operations_get(...)`, `instances_databases_operations_list(...)`, `instances_databases_sessions_begin_transaction(...)`, `instances_databases_sessions_commit(...)`, `instances_databases_sessions_create(...)`, `instances_databases_sessions_delete(...)`, `instances_databases_sessions_execute_sql(...)`, `instances_databases_sessions_execute_streaming_sql(...)`, `instances_databases_sessions_get(...)`, `instances_databases_sessions_list(...)`, `instances_databases_sessions_read(...)`, `instances_databases_sessions_rollback(...)`, `instances_databases_sessions_streaming_read(...)`, `instances_databases_set_iam_policy(...)`, `instances_databases_test_iam_permissions(...)`, `instances_databases_update_ddl(...)`, `instances_delete(...)`, `instances_get(...)`, `instances_get_iam_policy(...)`, `instances_list(...)`, `instances_operations_cancel(...)`, `instances_operations_delete(...)`, `instances_operations_get(...)`, `instances_operations_list(...)`, `instances_patch(...)`, `instances_set_iam_policy(...)` and `instances_test_iam_permissions(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, +} + +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: + /// + /// Gets the state of a Cloud Spanner database. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the requested database. Values are of the form + /// `projects//instances//databases/`. + pub fn instances_databases_get(&self, name: &str) -> ProjectInstanceDatabaseGetCall<'a, C, A> { + ProjectInstanceDatabaseGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Commits a transaction. The request includes the mutations to be + /// applied to rows in the database. + /// + /// `Commit` might return an `ABORTED` error. This can occur at any time; + /// commonly, the cause is conflicts with concurrent + /// transactions. However, it can also happen for a variety of other + /// reasons. If `Commit` returns `ABORTED`, the caller should re-attempt + /// the transaction from the beginning, re-using the same session. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the transaction to be committed is running. + pub fn instances_databases_sessions_commit(&self, request: CommitRequest, session: &str) -> ProjectInstanceDatabaseSessionCommitCall<'a, C, A> { + ProjectInstanceDatabaseSessionCommitCall { + hub: self.hub, + _request: request, + _session: session.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 an instance resource. Returns an empty + /// policy if an instance exists but does not have a policy set. + /// + /// Authorization requires `spanner.instances.getIamPolicy` on + /// resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceGetIamPolicyCall<'a, C, A> { + ProjectInstanceGetIamPolicyCall { + 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: + /// + /// Reads rows from the database using key lookups and scans, as a + /// simple key/value style alternative to + /// ExecuteSql. This method cannot be used to + /// return a result set larger than 10 MiB; if the read matches more + /// data than that, the read fails with a `FAILED_PRECONDITION` + /// error. + /// + /// Reads inside read-write transactions might return `ABORTED`. If + /// this occurs, the application should restart the transaction from + /// the beginning. See Transaction for more details. + /// + /// Larger result sets can be yielded in streaming fashion by calling + /// StreamingRead instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the read should be performed. + pub fn instances_databases_sessions_read(&self, request: ReadRequest, session: &str) -> ProjectInstanceDatabaseSessionReadCall<'a, C, A> { + ProjectInstanceDatabaseSessionReadCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on an instance resource. Replaces any + /// existing policy. + /// + /// Authorization requires `spanner.instances.setIamPolicy` on + /// resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + pub fn instances_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceSetIamPolicyCall<'a, C, A> { + ProjectInstanceSetIamPolicyCall { + 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: + /// + /// Returns permissions that the caller has on the specified database resource. + /// + /// Attempting this RPC on a non-existent Cloud Spanner database will result in + /// a NOT_FOUND error if the user has `spanner.databases.list` permission on + /// the containing Cloud Spanner instance. Otherwise returns an empty set of + /// permissions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_databases_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + ProjectInstanceDatabaseTestIamPermissionCall { + 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: + /// + /// Lists Cloud Spanner databases. + /// + /// # Arguments + /// + /// * `parent` - Required. The instance whose databases should be listed. + /// Values are of the form `projects//instances/`. + pub fn instances_databases_list(&self, parent: &str) -> ProjectInstanceDatabaseListCall<'a, C, A> { + ProjectInstanceDatabaseListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rolls back a transaction, releasing any locks it holds. It is a good + /// idea to call this for any transaction that includes one or more + /// Read or ExecuteSql requests and + /// ultimately decides not to commit. + /// + /// `Rollback` returns `OK` if it successfully aborts the transaction, the + /// transaction was already aborted, or the transaction is not + /// found. `Rollback` never returns `ABORTED`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the transaction to roll back is running. + pub fn instances_databases_sessions_rollback(&self, request: RollbackRequest, session: &str) -> ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> { + ProjectInstanceDatabaseSessionRollbackCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a particular instance. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the requested instance. Values are of the form + /// `projects//instances/`. + pub fn instances_get(&self, name: &str) -> ProjectInstanceGetCall<'a, C, A> { + ProjectInstanceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn instances_databases_operations_get(&self, name: &str) -> ProjectInstanceDatabaseOperationGetCall<'a, C, A> { + ProjectInstanceDatabaseOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Like Read, except returns the result set as a + /// stream. Unlike Read, there is no limit on the + /// size of the returned result set. However, no individual row in + /// the result set can exceed 100 MiB, and no column value can exceed + /// 10 MiB. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the read should be performed. + pub fn instances_databases_sessions_streaming_read(&self, request: ReadRequest, session: &str) -> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> { + ProjectInstanceDatabaseSessionStreamingReadCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all instances in the given project. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which a list of instances is + /// requested. Values are of the form `projects/`. + pub fn instances_list(&self, parent: &str) -> ProjectInstanceListCall<'a, C, A> { + ProjectInstanceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new session. A session can be used to perform + /// transactions that read and/or modify data in a Cloud Spanner database. + /// Sessions are meant to be reused for many consecutive + /// transactions. + /// + /// Sessions can only execute one transaction at a time. To execute + /// multiple concurrent read-write/write-only transactions, create + /// multiple sessions. Note that standalone reads and queries use a + /// transaction internally, and count toward the one transaction + /// limit. + /// + /// Cloud Spanner limits the number of sessions that can exist at any given + /// time; thus, it is a good idea to delete idle and/or unneeded sessions. + /// Aside from explicit deletes, Cloud Spanner can delete sessions for which no + /// operations are sent for more than an hour. If a session is deleted, + /// requests to it return `NOT_FOUND`. + /// + /// Idle sessions can be kept alive by sending a trivial SQL query + /// periodically, e.g., `"SELECT 1"`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - Required. The database in which the new session is created. + pub fn instances_databases_sessions_create(&self, request: CreateSessionRequest, database: &str) -> ProjectInstanceDatabaseSessionCreateCall<'a, C, A> { + ProjectInstanceDatabaseSessionCreateCall { + hub: self.hub, + _request: request, + _database: database.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new Cloud Spanner database and starts to prepare it for serving. + /// The returned long-running operation will + /// have a name of the format `/operations/` and + /// can be used to track preparation of the database. The + /// metadata field type is + /// CreateDatabaseMetadata. The + /// response field type is + /// Database, if successful. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the instance that will serve the new database. + /// Values are of the form `projects//instances/`. + pub fn instances_databases_create(&self, request: CreateDatabaseRequest, parent: &str) -> ProjectInstanceDatabaseCreateCall<'a, C, A> { + ProjectInstanceDatabaseCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the schema of a Cloud Spanner database by + /// creating/altering/dropping tables, columns, indexes, etc. The returned + /// long-running operation will have a name of + /// the format `/operations/` and can be used to + /// track execution of the schema change(s). The + /// metadata field type is + /// UpdateDatabaseDdlMetadata. The operation has no response. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - Required. The database to update. + pub fn instances_databases_update_ddl(&self, request: UpdateDatabaseDdlRequest, database: &str) -> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> { + ProjectInstanceDatabaseUpdateDdlCall { + hub: self.hub, + _request: request, + _database: database.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on a database resource. Replaces any + /// existing policy. + /// + /// Authorization requires `spanner.databases.setIamPolicy` permission on + /// resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + pub fn instances_databases_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> { + ProjectInstanceDatabaseSetIamPolicyCall { + 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: + /// + /// Updates an instance, and begins allocating or releasing resources + /// as requested. The returned long-running + /// operation can be used to track the + /// progress of updating the instance. If the named instance does not + /// exist, returns `NOT_FOUND`. + /// + /// Immediately upon completion of this request: + /// + /// * For resource types for which a decrease in the instance's allocation + /// has been requested, billing is based on the newly-requested level. + /// + /// Until completion of the returned operation: + /// + /// * Cancelling the operation sets its metadata's + /// cancel_time, and begins + /// restoring resources to their pre-request values. The operation + /// is guaranteed to succeed at undoing all resource changes, + /// after which point it terminates with a `CANCELLED` status. + /// * All other attempts to modify the instance are rejected. + /// * Reading the instance via the API continues to give the pre-request + /// resource levels. + /// + /// Upon completion of the returned operation: + /// + /// * Billing begins for all successfully-allocated resources (some types + /// may have lower than the requested levels). + /// * All newly-reserved resources are available for serving the instance's + /// tables. + /// * The instance's new resource levels are readable via the API. + /// + /// The returned long-running operation will + /// have a name of the format `/operations/` and + /// can be used to track the instance modification. The + /// metadata field type is + /// UpdateInstanceMetadata. + /// The response field type is + /// Instance, if successful. + /// + /// Authorization requires `spanner.instances.update` permission on + /// resource name. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. A unique identifier for the instance, which cannot be changed + /// after the instance is created. Values are of the form + /// `projects//instances/a-z*[a-z0-9]`. The final + /// segment of the name must be between 6 and 30 characters in length. + pub fn instances_patch(&self, request: UpdateInstanceRequest, name: &str) -> ProjectInstancePatchCall<'a, C, A> { + ProjectInstancePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Ends a session, releasing server resources associated with it. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the session to delete. + pub fn instances_databases_sessions_delete(&self, name: &str) -> ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> { + ProjectInstanceDatabaseSessionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a particular instance configuration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the requested instance configuration. Values are of + /// the form `projects//instanceConfigs/`. + pub fn instance_configs_get(&self, name: &str) -> ProjectInstanceConfigGetCall<'a, C, A> { + ProjectInstanceConfigGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Executes an SQL query, returning all rows in a single reply. This + /// method cannot be used to return a result set larger than 10 MiB; + /// if the query yields more data than that, the query fails with + /// a `FAILED_PRECONDITION` error. + /// + /// Queries inside read-write transactions might return `ABORTED`. If + /// this occurs, the application should restart the transaction from + /// the beginning. See Transaction for more details. + /// + /// Larger result sets can be fetched in streaming fashion by calling + /// ExecuteStreamingSql instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the SQL query should be performed. + pub fn instances_databases_sessions_execute_sql(&self, request: ExecuteSqlRequest, session: &str) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> { + ProjectInstanceDatabaseSessionExecuteSqlCall { + hub: self.hub, + _request: request, + _session: session.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 the caller has on the specified instance resource. + /// + /// Attempting this RPC on a non-existent Cloud Spanner instance resource will + /// result in a NOT_FOUND error if the user has `spanner.instances.list` + /// permission on the containing Google Cloud Project. Otherwise returns an + /// empty set of permissions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceTestIamPermissionCall<'a, C, A> { + ProjectInstanceTestIamPermissionCall { + 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: + /// + /// Returns the schema of a Cloud Spanner database as a list of formatted + /// DDL statements. This method does not show pending schema updates, those may + /// be queried using the Operations API. + /// + /// # Arguments + /// + /// * `database` - Required. The database whose schema we wish to get. + pub fn instances_databases_get_ddl(&self, database: &str) -> ProjectInstanceDatabaseGetDdlCall<'a, C, A> { + ProjectInstanceDatabaseGetDdlCall { + hub: self.hub, + _database: database.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Begins a new transaction. This step can often be skipped: + /// Read, ExecuteSql and + /// Commit can begin a new transaction as a + /// side-effect. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the transaction runs. + pub fn instances_databases_sessions_begin_transaction(&self, request: BeginTransactionRequest, session: &str) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> { + ProjectInstanceDatabaseSessionBeginTransactionCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn instances_operations_list(&self, name: &str) -> ProjectInstanceOperationListCall<'a, C, A> { + ProjectInstanceOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the supported instance configurations for a given project. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which a list of supported instance + /// configurations is requested. Values are of the form + /// `projects/`. + pub fn instance_configs_list(&self, parent: &str) -> ProjectInstanceConfigListCall<'a, C, A> { + ProjectInstanceConfigListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _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 database resource. Returns an empty + /// policy if a database exists but does not have a policy set. + /// + /// Authorization requires `spanner.databases.getIamPolicy` permission on + /// resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_databases_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + ProjectInstanceDatabaseGetIamPolicyCall { + 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: + /// + /// Like ExecuteSql, except returns the result + /// set as a stream. Unlike ExecuteSql, there + /// is no limit on the size of the returned result set. However, no + /// individual row in the result set can exceed 100 MiB, and no + /// column value can exceed 10 MiB. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The session in which the SQL query should be performed. + pub fn instances_databases_sessions_execute_streaming_sql(&self, request: ExecuteSqlRequest, session: &str) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> { + ProjectInstanceDatabaseSessionExecuteStreamingSqlCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn instances_operations_get(&self, name: &str) -> ProjectInstanceOperationGetCall<'a, C, A> { + ProjectInstanceOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn instances_databases_operations_cancel(&self, name: &str) -> ProjectInstanceDatabaseOperationCancelCall<'a, C, A> { + ProjectInstanceDatabaseOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all sessions in a given database. + /// + /// # Arguments + /// + /// * `database` - Required. The database in which to list sessions. + pub fn instances_databases_sessions_list(&self, database: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + ProjectInstanceDatabaseSessionListCall { + hub: self.hub, + _database: database.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn instances_databases_operations_list(&self, name: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + ProjectInstanceDatabaseOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an instance and begins preparing it to begin serving. The + /// returned long-running operation + /// can be used to track the progress of preparing the new + /// instance. The instance name is assigned by the caller. If the + /// named instance already exists, `CreateInstance` returns + /// `ALREADY_EXISTS`. + /// + /// Immediately upon completion of this request: + /// + /// * The instance is readable via the API, with all requested attributes + /// but no allocated resources. Its state is `CREATING`. + /// + /// Until completion of the returned operation: + /// + /// * Cancelling the operation renders the instance immediately unreadable + /// via the API. + /// * The instance can be deleted. + /// * All other attempts to modify the instance are rejected. + /// + /// Upon completion of the returned operation: + /// + /// * Billing for all successfully-allocated resources begins (some types + /// may have lower than the requested levels). + /// * Databases can be created in the instance. + /// * The instance's allocated resource levels are readable via the API. + /// * The instance's state becomes `READY`. + /// + /// The returned long-running operation will + /// have a name of the format `/operations/` and + /// can be used to track creation of the instance. The + /// metadata field type is + /// CreateInstanceMetadata. + /// The response field type is + /// Instance, if successful. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the project in which to create the instance. Values + /// are of the form `projects/`. + pub fn instances_create(&self, request: CreateInstanceRequest, parent: &str) -> ProjectInstanceCreateCall<'a, C, A> { + ProjectInstanceCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Drops (aka deletes) a Cloud Spanner database. + /// + /// # Arguments + /// + /// * `database` - Required. The database to be dropped. + pub fn instances_databases_drop_database(&self, database: &str) -> ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> { + ProjectInstanceDatabaseDropDatabaseCall { + hub: self.hub, + _database: database.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn instances_operations_delete(&self, name: &str) -> ProjectInstanceOperationDeleteCall<'a, C, A> { + ProjectInstanceOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn instances_databases_operations_delete(&self, name: &str) -> ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> { + ProjectInstanceDatabaseOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an instance. + /// + /// Immediately upon completion of the request: + /// + /// * Billing ceases for all of the instance's reserved resources. + /// + /// Soon afterward: + /// + /// * The instance and *all of its databases* immediately and + /// irrevocably disappear from the API. All data in the databases + /// is permanently deleted. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the instance to be deleted. Values are of the form + /// `projects//instances/` + pub fn instances_delete(&self, name: &str) -> ProjectInstanceDeleteCall<'a, C, A> { + ProjectInstanceDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn instances_operations_cancel(&self, name: &str) -> ProjectInstanceOperationCancelCall<'a, C, A> { + ProjectInstanceOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a session. Returns `NOT_FOUND` if the session does not exist. + /// This is mainly useful for determining whether a session is still + /// alive. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the session to retrieve. + pub fn instances_databases_sessions_get(&self, name: &str) -> ProjectInstanceDatabaseSessionGetCall<'a, C, A> { + ProjectInstanceDatabaseSessionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Gets the state of a Cloud Spanner database. +/// +/// A builder for the *instances.databases.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseGetCall<'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, Database)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the requested database. Values are of the form + /// `projects//instances//databases/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseGetCall<'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) -> ProjectInstanceDatabaseGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Commits a transaction. The request includes the mutations to be +/// applied to rows in the database. +/// +/// `Commit` might return an `ABORTED` error. This can occur at any time; +/// commonly, the cause is conflicts with concurrent +/// transactions. However, it can also happen for a variety of other +/// reasons. If `Commit` returns `ABORTED`, the caller should re-attempt +/// the transaction from the beginning, re-using the same session. +/// +/// A builder for the *instances.databases.sessions.commit* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::CommitRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CommitRequest::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().instances_databases_sessions_commit(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionCommitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: CommitRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionCommitCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionCommitCall<'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, CommitResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.commit", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:commit"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CommitRequest) -> ProjectInstanceDatabaseSessionCommitCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the transaction to be committed is running. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionCommitCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionCommitCall<'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) -> ProjectInstanceDatabaseSessionCommitCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionCommitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for an instance resource. Returns an empty +/// policy if an instance exists but does not have a policy set. +/// +/// Authorization requires `spanner.instances.getIamPolicy` on +/// resource. +/// +/// A builder for the *instances.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::GetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GetIamPolicyRequest::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().instances_get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.getIamPolicy", + 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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GetIamPolicyRequest) -> ProjectInstanceGetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// 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) -> ProjectInstanceGetIamPolicyCall<'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) -> ProjectInstanceGetIamPolicyCall<'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) -> ProjectInstanceGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reads rows from the database using key lookups and scans, as a +/// simple key/value style alternative to +/// ExecuteSql. This method cannot be used to +/// return a result set larger than 10 MiB; if the read matches more +/// data than that, the read fails with a `FAILED_PRECONDITION` +/// error. +/// +/// Reads inside read-write transactions might return `ABORTED`. If +/// this occurs, the application should restart the transaction from +/// the beginning. See Transaction for more details. +/// +/// Larger result sets can be yielded in streaming fashion by calling +/// StreamingRead instead. +/// +/// A builder for the *instances.databases.sessions.read* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::ReadRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ReadRequest::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().instances_databases_sessions_read(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionReadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: ReadRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionReadCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionReadCall<'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, ResultSet)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.read", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:read"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ReadRequest) -> ProjectInstanceDatabaseSessionReadCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the read should be performed. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionReadCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionReadCall<'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) -> ProjectInstanceDatabaseSessionReadCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionReadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on an instance resource. Replaces any +/// existing policy. +/// +/// Authorization requires `spanner.instances.setIamPolicy` on +/// resource. +/// +/// A builder for the *instances.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceSetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectInstanceSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + /// + /// 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) -> ProjectInstanceSetIamPolicyCall<'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) -> ProjectInstanceSetIamPolicyCall<'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) -> ProjectInstanceSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that the caller has on the specified database resource. +/// +/// Attempting this RPC on a non-existent Cloud Spanner database will result in +/// a NOT_FOUND error if the user has `spanner.databases.list` permission on +/// the containing Cloud Spanner instance. Otherwise returns an empty set of +/// permissions. +/// +/// A builder for the *instances.databases.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// 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) -> ProjectInstanceDatabaseTestIamPermissionCall<'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) -> ProjectInstanceDatabaseTestIamPermissionCall<'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) -> ProjectInstanceDatabaseTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists Cloud Spanner databases. +/// +/// A builder for the *instances.databases.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_list("parent") +/// .page_token("amet.") +/// .page_size(-81) +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseListCall<'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, ListDatabasesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/databases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 instance whose databases should be listed. + /// Values are of the form `projects//instances/`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectInstanceDatabaseListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token from a + /// previous ListDatabasesResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceDatabaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of databases to be returned in the response. If 0 or less, + /// defaults to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceDatabaseListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseListCall<'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) -> ProjectInstanceDatabaseListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rolls back a transaction, releasing any locks it holds. It is a good +/// idea to call this for any transaction that includes one or more +/// Read or ExecuteSql requests and +/// ultimately decides not to commit. +/// +/// `Rollback` returns `OK` if it successfully aborts the transaction, the +/// transaction was already aborted, or the transaction is not +/// found. `Rollback` never returns `ABORTED`. +/// +/// A builder for the *instances.databases.sessions.rollback* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::RollbackRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RollbackRequest::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().instances_databases_sessions_rollback(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: RollbackRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionRollbackCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.rollback", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:rollback"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RollbackRequest) -> ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the transaction to roll back is running. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionRollbackCall<'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) -> ProjectInstanceDatabaseSessionRollbackCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information about a particular instance. +/// +/// A builder for the *instances.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceGetCall<'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, Instance)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the requested instance. Values are of the form + /// `projects//instances/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceGetCall<'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) -> ProjectInstanceGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *instances.databases.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseOperationGetCall<'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) -> ProjectInstanceDatabaseOperationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Like Read, except returns the result set as a +/// stream. Unlike Read, there is no limit on the +/// size of the returned result set. However, no individual row in +/// the result set can exceed 100 MiB, and no column value can exceed +/// 10 MiB. +/// +/// A builder for the *instances.databases.sessions.streamingRead* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::ReadRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ReadRequest::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().instances_databases_sessions_streaming_read(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: ReadRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionStreamingReadCall<'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, PartialResultSet)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.streamingRead", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:streamingRead"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ReadRequest) -> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the read should be performed. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionStreamingReadCall<'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) -> ProjectInstanceDatabaseSessionStreamingReadCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all instances in the given project. +/// +/// A builder for the *instances.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_list("parent") +/// .page_token("sadipscing") +/// .page_size(-31) +/// .filter("ea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceListCall<'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, ListInstancesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "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 = self.hub._base_url.clone() + "v1/{+parent}/instances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the project for which a list of instances is + /// requested. Values are of the form `projects/`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token from a + /// previous ListInstancesResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of instances to be returned in the response. If 0 or less, defaults + /// to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceListCall<'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 + /// * display_name + /// * labels.key where key is the name of a label + /// + /// Some examples of using filters are: + /// + /// * name:* --> The instance has a name. + /// * name:Howl --> The instance's name contains the string "howl". + /// * name:HOWL --> Equivalent to above. + /// * NAME:howl --> Equivalent to above. + /// * labels.env:* --> The instance has the label "env". + /// * labels.env:dev --> The instance has the label "env" and the value of + /// the label contains the string "dev". + /// * name:howl labels.env:dev --> The instance's name contains "howl" and + /// it has the label "env" with its value + /// containing "dev". + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceListCall<'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) -> ProjectInstanceListCall<'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) -> ProjectInstanceListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new session. A session can be used to perform +/// transactions that read and/or modify data in a Cloud Spanner database. +/// Sessions are meant to be reused for many consecutive +/// transactions. +/// +/// Sessions can only execute one transaction at a time. To execute +/// multiple concurrent read-write/write-only transactions, create +/// multiple sessions. Note that standalone reads and queries use a +/// transaction internally, and count toward the one transaction +/// limit. +/// +/// Cloud Spanner limits the number of sessions that can exist at any given +/// time; thus, it is a good idea to delete idle and/or unneeded sessions. +/// Aside from explicit deletes, Cloud Spanner can delete sessions for which no +/// operations are sent for more than an hour. If a session is deleted, +/// requests to it return `NOT_FOUND`. +/// +/// Idle sessions can be kept alive by sending a trivial SQL query +/// periodically, e.g., `"SELECT 1"`. +/// +/// A builder for the *instances.databases.sessions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::CreateSessionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateSessionRequest::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().instances_databases_sessions_create(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: CreateSessionRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionCreateCall<'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, Session)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("database", self._database.to_string())); + for &field in ["alt", "database"].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 = self.hub._base_url.clone() + "v1/{+database}/sessions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateSessionRequest) -> ProjectInstanceDatabaseSessionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The database in which the new session is created. + /// + /// Sets the *database* 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 database(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionCreateCall<'a, C, A> { + self._database = 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) -> ProjectInstanceDatabaseSessionCreateCall<'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) -> ProjectInstanceDatabaseSessionCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new Cloud Spanner database and starts to prepare it for serving. +/// The returned long-running operation will +/// have a name of the format `/operations/` and +/// can be used to track preparation of the database. The +/// metadata field type is +/// CreateDatabaseMetadata. The +/// response field type is +/// Database, if successful. +/// +/// A builder for the *instances.databases.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::CreateDatabaseRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateDatabaseRequest::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().instances_databases_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: CreateDatabaseRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/databases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateDatabaseRequest) -> ProjectInstanceDatabaseCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the instance that will serve the new database. + /// Values are of the form `projects//instances/`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectInstanceDatabaseCreateCall<'a, C, A> { + self._parent = 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) -> ProjectInstanceDatabaseCreateCall<'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) -> ProjectInstanceDatabaseCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the schema of a Cloud Spanner database by +/// creating/altering/dropping tables, columns, indexes, etc. The returned +/// long-running operation will have a name of +/// the format `/operations/` and can be used to +/// track execution of the schema change(s). The +/// metadata field type is +/// UpdateDatabaseDdlMetadata. The operation has no response. +/// +/// A builder for the *instances.databases.updateDdl* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::UpdateDatabaseDdlRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateDatabaseDdlRequest::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().instances_databases_update_ddl(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: UpdateDatabaseDdlRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.updateDdl", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("database", self._database.to_string())); + for &field in ["alt", "database"].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 = self.hub._base_url.clone() + "v1/{+database}/ddl"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UpdateDatabaseDdlRequest) -> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The database to update. + /// + /// Sets the *database* 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 database(mut self, new_value: &str) -> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> { + self._database = 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) -> ProjectInstanceDatabaseUpdateDdlCall<'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) -> ProjectInstanceDatabaseUpdateDdlCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on a database resource. Replaces any +/// existing policy. +/// +/// Authorization requires `spanner.databases.setIamPolicy` permission on +/// resource. +/// +/// A builder for the *instances.databases.setIamPolicy* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.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 = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + /// + /// 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) -> ProjectInstanceDatabaseSetIamPolicyCall<'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) -> ProjectInstanceDatabaseSetIamPolicyCall<'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) -> ProjectInstanceDatabaseSetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an instance, and begins allocating or releasing resources +/// as requested. The returned long-running +/// operation can be used to track the +/// progress of updating the instance. If the named instance does not +/// exist, returns `NOT_FOUND`. +/// +/// Immediately upon completion of this request: +/// +/// * For resource types for which a decrease in the instance's allocation +/// has been requested, billing is based on the newly-requested level. +/// +/// Until completion of the returned operation: +/// +/// * Cancelling the operation sets its metadata's +/// cancel_time, and begins +/// restoring resources to their pre-request values. The operation +/// is guaranteed to succeed at undoing all resource changes, +/// after which point it terminates with a `CANCELLED` status. +/// * All other attempts to modify the instance are rejected. +/// * Reading the instance via the API continues to give the pre-request +/// resource levels. +/// +/// Upon completion of the returned operation: +/// +/// * Billing begins for all successfully-allocated resources (some types +/// may have lower than the requested levels). +/// * All newly-reserved resources are available for serving the instance's +/// tables. +/// * The instance's new resource levels are readable via the API. +/// +/// The returned long-running operation will +/// have a name of the format `/operations/` and +/// can be used to track the instance modification. The +/// metadata field type is +/// UpdateInstanceMetadata. +/// The response field type is +/// Instance, if successful. +/// +/// Authorization requires `spanner.instances.update` permission on +/// resource name. +/// +/// A builder for the *instances.patch* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::UpdateInstanceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateInstanceRequest::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().instances_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstancePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: UpdateInstanceRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstancePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UpdateInstanceRequest) -> ProjectInstancePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. A unique identifier for the instance, which cannot be changed + /// after the instance is created. Values are of the form + /// `projects//instances/a-z*[a-z0-9]`. The final + /// segment of the name must be between 6 and 30 characters in length. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstancePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstancePatchCall<'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) -> ProjectInstancePatchCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstancePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Ends a session, releasing server resources associated with it. +/// +/// A builder for the *instances.databases.sessions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_sessions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the session to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseSessionDeleteCall<'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) -> ProjectInstanceDatabaseSessionDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information about a particular instance configuration. +/// +/// A builder for the *instanceConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instance_configs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceConfigGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceConfigGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceConfigGetCall<'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, InstanceConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instanceConfigs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the requested instance configuration. Values are of + /// the form `projects//instanceConfigs/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceConfigGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceConfigGetCall<'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) -> ProjectInstanceConfigGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceConfigGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Executes an SQL query, returning all rows in a single reply. This +/// method cannot be used to return a result set larger than 10 MiB; +/// if the query yields more data than that, the query fails with +/// a `FAILED_PRECONDITION` error. +/// +/// Queries inside read-write transactions might return `ABORTED`. If +/// this occurs, the application should restart the transaction from +/// the beginning. See Transaction for more details. +/// +/// Larger result sets can be fetched in streaming fashion by calling +/// ExecuteStreamingSql instead. +/// +/// A builder for the *instances.databases.sessions.executeSql* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::ExecuteSqlRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ExecuteSqlRequest::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().instances_databases_sessions_execute_sql(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: ExecuteSqlRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionExecuteSqlCall<'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, ResultSet)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.executeSql", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:executeSql"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ExecuteSqlRequest) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the SQL query should be performed. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'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) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that the caller has on the specified instance resource. +/// +/// Attempting this RPC on a non-existent Cloud Spanner instance resource will +/// result in a NOT_FOUND error if the user has `spanner.instances.list` +/// permission on the containing Google Cloud Project. Otherwise returns an +/// empty set of permissions. +/// +/// A builder for the *instances.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceTestIamPermissionCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.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 = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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) -> ProjectInstanceTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// 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) -> ProjectInstanceTestIamPermissionCall<'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) -> ProjectInstanceTestIamPermissionCall<'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) -> ProjectInstanceTestIamPermissionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the schema of a Cloud Spanner database as a list of formatted +/// DDL statements. This method does not show pending schema updates, those may +/// be queried using the Operations API. +/// +/// A builder for the *instances.databases.getDdl* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_get_ddl("database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseGetDdlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseGetDdlCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseGetDdlCall<'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, GetDatabaseDdlResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.getDdl", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("database", self._database.to_string())); + for &field in ["alt", "database"].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 = self.hub._base_url.clone() + "v1/{+database}/ddl"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].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(Bearer { 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(d); + 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(d); + 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 database whose schema we wish to get. + /// + /// Sets the *database* 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 database(mut self, new_value: &str) -> ProjectInstanceDatabaseGetDdlCall<'a, C, A> { + self._database = 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) -> ProjectInstanceDatabaseGetDdlCall<'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) -> ProjectInstanceDatabaseGetDdlCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseGetDdlCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Begins a new transaction. This step can often be skipped: +/// Read, ExecuteSql and +/// Commit can begin a new transaction as a +/// side-effect. +/// +/// A builder for the *instances.databases.sessions.beginTransaction* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::BeginTransactionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = BeginTransactionRequest::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().instances_databases_sessions_begin_transaction(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: BeginTransactionRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionBeginTransactionCall<'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, Transaction)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.beginTransaction", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:beginTransaction"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: BeginTransactionRequest) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the transaction runs. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'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) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *instances.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_operations_list("name") +/// .page_token("Lorem") +/// .page_size(-75) +/// .filter("erat") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceOperationListCall<'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) -> ProjectInstanceOperationListCall<'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) -> ProjectInstanceOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the supported instance configurations for a given project. +/// +/// A builder for the *instanceConfigs.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instance_configs_list("parent") +/// .page_token("dolor") +/// .page_size(-39) +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceConfigListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceConfigListCall<'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, ListInstanceConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instanceConfigs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/instanceConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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 name of the project for which a list of supported instance + /// configurations is requested. Values are of the form + /// `projects/`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectInstanceConfigListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token + /// from a previous ListInstanceConfigsResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of instance configurations to be returned in the response. If 0 or + /// less, defaults to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceConfigListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceConfigListCall<'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) -> ProjectInstanceConfigListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceConfigListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a database resource. Returns an empty +/// policy if a database exists but does not have a policy set. +/// +/// Authorization requires `spanner.databases.getIamPolicy` permission on +/// resource. +/// +/// A builder for the *instances.databases.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::GetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GetIamPolicyRequest::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().instances_databases_get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.getIamPolicy", + 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 = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + 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(), DEFAULT_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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GetIamPolicyRequest) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// 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) -> ProjectInstanceDatabaseGetIamPolicyCall<'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) -> ProjectInstanceDatabaseGetIamPolicyCall<'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) -> ProjectInstanceDatabaseGetIamPolicyCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Like ExecuteSql, except returns the result +/// set as a stream. Unlike ExecuteSql, there +/// is no limit on the size of the returned result set. However, no +/// individual row in the result set can exceed 100 MiB, and no +/// column value can exceed 10 MiB. +/// +/// A builder for the *instances.databases.sessions.executeStreamingSql* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::ExecuteSqlRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ExecuteSqlRequest::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().instances_databases_sessions_execute_streaming_sql(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: ExecuteSqlRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'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, PartialResultSet)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.executeStreamingSql", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].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 = self.hub._base_url.clone() + "v1/{+session}:executeStreamingSql"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ExecuteSqlRequest) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session in which the SQL query should be performed. + /// + /// Sets the *session* 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 session(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> { + self._session = 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) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'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) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *instances.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceOperationGetCall<'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) -> ProjectInstanceOperationGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. +/// +/// A builder for the *instances.databases.operations.cancel* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseOperationCancelCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseOperationCancelCall<'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) -> ProjectInstanceDatabaseOperationCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all sessions in a given database. +/// +/// A builder for the *instances.databases.sessions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_sessions_list("database") +/// .page_token("dolore") +/// .page_size(-37) +/// .filter("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _database: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'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, ListSessionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("database", self._database.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "database", "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 = self.hub._base_url.clone() + "v1/{+database}/sessions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].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(Bearer { 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(d); + 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(d); + 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 database in which to list sessions. + /// + /// Sets the *database* 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 database(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._database = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token from a previous + /// ListSessionsResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of sessions to be returned in the response. If 0 or less, defaults + /// to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceDatabaseSessionListCall<'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: + /// + /// * labels.key where key is the name of a label + /// + /// Some examples of using filters are: + /// + /// * labels.env:* --> The session has the label "env". + /// * labels.env:dev --> The session has the label "env" and the value of + /// the label contains the string "dev". + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'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) -> ProjectInstanceDatabaseSessionListCall<'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) -> ProjectInstanceDatabaseSessionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *instances.databases.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_operations_list("name") +/// .page_token("Lorem") +/// .page_size(-9) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationListCall<'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) -> ProjectInstanceDatabaseOperationListCall<'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) -> ProjectInstanceDatabaseOperationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an instance and begins preparing it to begin serving. The +/// returned long-running operation +/// can be used to track the progress of preparing the new +/// instance. The instance name is assigned by the caller. If the +/// named instance already exists, `CreateInstance` returns +/// `ALREADY_EXISTS`. +/// +/// Immediately upon completion of this request: +/// +/// * The instance is readable via the API, with all requested attributes +/// but no allocated resources. Its state is `CREATING`. +/// +/// Until completion of the returned operation: +/// +/// * Cancelling the operation renders the instance immediately unreadable +/// via the API. +/// * The instance can be deleted. +/// * All other attempts to modify the instance are rejected. +/// +/// Upon completion of the returned operation: +/// +/// * Billing for all successfully-allocated resources begins (some types +/// may have lower than the requested levels). +/// * Databases can be created in the instance. +/// * The instance's allocated resource levels are readable via the API. +/// * The instance's state becomes `READY`. +/// +/// The returned long-running operation will +/// have a name of the format `/operations/` and +/// can be used to track creation of the instance. The +/// metadata field type is +/// CreateInstanceMetadata. +/// The response field type is +/// Instance, if successful. +/// +/// A builder for the *instances.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::CreateInstanceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateInstanceRequest::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().instances_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: CreateInstanceRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "v1/{+parent}/instances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateInstanceRequest) -> ProjectInstanceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the project in which to create the instance. Values + /// are of the form `projects/`. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectInstanceCreateCall<'a, C, A> { + self._parent = 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) -> ProjectInstanceCreateCall<'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) -> ProjectInstanceCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Drops (aka deletes) a Cloud Spanner database. +/// +/// A builder for the *instances.databases.dropDatabase* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_drop_database("database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseDropDatabaseCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.dropDatabase", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("database", self._database.to_string())); + for &field in ["alt", "database"].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 = self.hub._base_url.clone() + "v1/{+database}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].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(Bearer { 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(d); + 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(d); + 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 database to be dropped. + /// + /// Sets the *database* 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 database(mut self, new_value: &str) -> ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> { + self._database = 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) -> ProjectInstanceDatabaseDropDatabaseCall<'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) -> ProjectInstanceDatabaseDropDatabaseCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a long-running operation. This method indicates that the client is +/// no longer interested in the operation result. It does not cancel the +/// operation. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. +/// +/// A builder for the *instances.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceOperationDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceOperationDeleteCall<'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) -> ProjectInstanceOperationDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a long-running operation. This method indicates that the client is +/// no longer interested in the operation result. It does not cancel the +/// operation. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. +/// +/// A builder for the *instances.databases.operations.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseOperationDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseOperationDeleteCall<'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) -> ProjectInstanceDatabaseOperationDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an instance. +/// +/// Immediately upon completion of the request: +/// +/// * Billing ceases for all of the instance's reserved resources. +/// +/// Soon afterward: +/// +/// * The instance and *all of its databases* immediately and +/// irrevocably disappear from the API. All data in the databases +/// is permanently deleted. +/// +/// A builder for the *instances.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDeleteCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the instance to be deleted. Values are of the form + /// `projects//instances/` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDeleteCall<'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) -> ProjectInstanceDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. +/// +/// A builder for the *instances.operations.cancel* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceOperationCancelCall<'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, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceOperationCancelCall<'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) -> ProjectInstanceOperationCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a session. Returns `NOT_FOUND` if the session does not exist. +/// This is mainly useful for determining whether a session is still +/// alive. +/// +/// A builder for the *instances.databases.sessions.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().instances_databases_sessions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionGetCall<'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, Session)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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 name of the session to retrieve. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectInstanceDatabaseSessionGetCall<'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) -> ProjectInstanceDatabaseSessionGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectInstanceDatabaseSessionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/sqladmin1_beta4-cli/Cargo.toml b/gen/sqladmin1_beta4-cli/Cargo.toml index a5e2e8d245..b2181d097a 100644 --- a/gen/sqladmin1_beta4-cli/Cargo.toml +++ b/gen/sqladmin1_beta4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sqladmin1_beta4-cli" -version = "1.0.6+20170502" +version = "1.0.6+20170807" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-sqladmin1_beta4] path = "../sqladmin1_beta4" -version = "1.0.6+20170502" +version = "1.0.6+20170807" diff --git a/gen/sqladmin1_beta4-cli/README.md b/gen/sqladmin1_beta4-cli/README.md index fb7762d3a8..f2b6ac2d3b 100644 --- a/gen/sqladmin1_beta4-cli/README.md +++ b/gen/sqladmin1_beta4-cli/README.md @@ -25,7 +25,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 *20170502*. The CLI is at version *1.0.6*. +This documentation was generated from the *SQL Admin* API at revision *20170807*. The CLI is at version *1.0.6*. ```bash sqladmin1-beta4 [options] diff --git a/gen/sqladmin1_beta4-cli/mkdocs.yml b/gen/sqladmin1_beta4-cli/mkdocs.yml index 1b37d484eb..7ca932ddbd 100644 --- a/gen/sqladmin1_beta4-cli/mkdocs.yml +++ b/gen/sqladmin1_beta4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: SQL Admin v1.0.6+20170502 +site_name: SQL Admin v1.0.6+20170807 site_url: http://byron.github.io/google-apis-rs/google-sqladmin1_beta4-cli site_description: A complete library to interact with SQL Admin (protocol v1beta4) diff --git a/gen/sqladmin1_beta4-cli/src/main.rs b/gen/sqladmin1_beta4-cli/src/main.rs index d9a83785a7..0b978d3b1f 100644 --- a/gen/sqladmin1_beta4-cli/src/main.rs +++ b/gen/sqladmin1_beta4-cli/src/main.rs @@ -1188,14 +1188,15 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "import-context.file-type" => Some(("importContext.fileType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "import-context.database" => Some(("importContext.database", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "import-context.uri" => Some(("importContext.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.kind" => Some(("importContext.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "import-context.database" => Some(("importContext.database", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "import-context.file-type" => Some(("importContext.fileType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "import-context.uri" => Some(("importContext.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "import-context.import-user" => Some(("importContext.importUser", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.csv-import-options.table" => Some(("importContext.csvImportOptions.table", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.csv-import-options.columns" => Some(("importContext.csvImportOptions.columns", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["columns", "csv-import-options", "database", "file-type", "import-context", "kind", "table", "uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["columns", "csv-import-options", "database", "file-type", "import-context", "import-user", "kind", "table", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1288,6 +1289,7 @@ impl<'n> Engine<'n> { "master-instance-name" => Some(("masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gce-zone" => Some(("gceZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "failover-replica.available" => Some(("failoverReplica.available", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "failover-replica.name" => Some(("failoverReplica.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "replica-names" => Some(("replicaNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1323,6 +1325,7 @@ impl<'n> Engine<'n> { "settings.ip-configuration.ipv4-enabled" => Some(("settings.ipConfiguration.ipv4Enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.require-ssl" => Some(("settings.ipConfiguration.requireSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.crash-safe-replication-enabled" => Some(("settings.crashSafeReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.user-labels" => Some(("settings.userLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "settings.database-replication-enabled" => Some(("settings.databaseReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.replication-type" => Some(("settings.replicationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.storage-auto-resize-limit" => Some(("settings.storageAutoResizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1350,7 +1353,7 @@ impl<'n> Engine<'n> { "replica-configuration.mysql-replica-configuration.client-key" => Some(("replicaConfiguration.mysqlReplicaConfiguration.clientKey", 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!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1505,6 +1508,7 @@ impl<'n> Engine<'n> { "master-instance-name" => Some(("masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gce-zone" => Some(("gceZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "failover-replica.available" => Some(("failoverReplica.available", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "failover-replica.name" => Some(("failoverReplica.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "replica-names" => Some(("replicaNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1540,6 +1544,7 @@ impl<'n> Engine<'n> { "settings.ip-configuration.ipv4-enabled" => Some(("settings.ipConfiguration.ipv4Enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.require-ssl" => Some(("settings.ipConfiguration.requireSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.crash-safe-replication-enabled" => Some(("settings.crashSafeReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.user-labels" => Some(("settings.userLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "settings.database-replication-enabled" => Some(("settings.databaseReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.replication-type" => Some(("settings.replicationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.storage-auto-resize-limit" => Some(("settings.storageAutoResizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1567,7 +1572,7 @@ impl<'n> Engine<'n> { "replica-configuration.mysql-replica-configuration.client-key" => Some(("replicaConfiguration.mysqlReplicaConfiguration.clientKey", 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!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2093,6 +2098,7 @@ impl<'n> Engine<'n> { "master-instance-name" => Some(("masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gce-zone" => Some(("gceZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "failover-replica.available" => Some(("failoverReplica.available", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "failover-replica.name" => Some(("failoverReplica.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "replica-names" => Some(("replicaNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2128,6 +2134,7 @@ impl<'n> Engine<'n> { "settings.ip-configuration.ipv4-enabled" => Some(("settings.ipConfiguration.ipv4Enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.require-ssl" => Some(("settings.ipConfiguration.requireSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.crash-safe-replication-enabled" => Some(("settings.crashSafeReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "settings.user-labels" => Some(("settings.userLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "settings.database-replication-enabled" => Some(("settings.databaseReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.replication-type" => Some(("settings.replicationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.storage-auto-resize-limit" => Some(("settings.storageAutoResizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2155,7 +2162,7 @@ impl<'n> Engine<'n> { "replica-configuration.mysql-replica-configuration.client-key" => Some(("replicaConfiguration.mysqlReplicaConfiguration.clientKey", 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!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4553,7 +4560,7 @@ fn main() { let mut app = App::new("sqladmin1-beta4") .author("Sebastian Thiel ") - .version("1.0.6+20170502") + .version("1.0.6+20170807") .about("Creates and configures Cloud SQL instances, which provide fully-managed MySQL databases.") .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 e20f2fb0f2..2b14738401 100644 --- a/gen/sqladmin1_beta4/Cargo.toml +++ b/gen/sqladmin1_beta4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-sqladmin1_beta4" -version = "1.0.6+20170502" +version = "1.0.6+20170807" 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://cloud.google.com/sql/docs/reference/latest" -documentation = "https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502" +documentation = "https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807" license = "MIT" keywords = ["sqladmin", "google", "protocol", "web", "api"] diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index 2aae1dfb22..0fe1b09b08 100644 --- a/gen/sqladmin1_beta4/README.md +++ b/gen/sqladmin1_beta4/README.md @@ -5,30 +5,30 @@ 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 *1.0.6+20170502*, where *20170502* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *SQL Admin* crate version *1.0.6+20170807*, where *20170807* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *SQL Admin* *v1_beta4* API can be found at the [official documentation site](https://cloud.google.com/sql/docs/reference/latest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SQLAdmin.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SQLAdmin.html) ... -* [backup runs](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.BackupRun.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.BackupRunListCall.html) -* [databases](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.Database.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.DatabaseUpdateCall.html) -* [flags](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.Flag.html) - * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.FlagListCall.html) +* [backup runs](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.BackupRun.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.BackupRunListCall.html) +* [databases](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.Database.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.DatabaseUpdateCall.html) +* [flags](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.Flag.html) + * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.FlagListCall.html) * instances - * [*clone*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceDeleteCall.html), [*export*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceRestoreBackupCall.html), [*start replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.InstanceUpdateCall.html) -* [operations](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.Operation.html) - * [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.OperationListCall.html) -* [ssl certs](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SslCert.html) - * [*create ephemeral*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SslCertListCall.html) -* [tiers](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.Tier.html) - * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.TierListCall.html) -* [users](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.User.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.UserUpdateCall.html) + * [*clone*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceDeleteCall.html), [*export*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceRestoreBackupCall.html), [*start replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.InstanceUpdateCall.html) +* [operations](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.Operation.html) + * [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.OperationListCall.html) +* [ssl certs](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SslCert.html) + * [*create ephemeral*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SslCertListCall.html) +* [tiers](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.Tier.html) + * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.TierListCall.html) +* [users](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.User.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.UserUpdateCall.html) @@ -37,17 +37,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/struct.SQLAdmin.html)** +* **[Hub](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/struct.SQLAdmin.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -162,17 +162,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/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")`. @@ -182,29 +182,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/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](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/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](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/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](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/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](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170502/google_sqladmin1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-sqladmin1_beta4/1.0.6+20170807/google_sqladmin1_beta4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/sqladmin1_beta4/src/lib.rs b/gen/sqladmin1_beta4/src/lib.rs index f54af653b9..18a69b25dc 100644 --- a/gen/sqladmin1_beta4/src/lib.rs +++ b/gen/sqladmin1_beta4/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 *SQL Admin* crate version *1.0.6+20170502*, where *20170502* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *SQL Admin* crate version *1.0.6+20170807*, where *20170807* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *SQL Admin* *v1_beta4* API can be found at the //! [official documentation site](https://cloud.google.com/sql/docs/reference/latest). @@ -724,6 +724,13 @@ impl ResponseResult for TiersListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ImportContext { + /// This is always sql#importContext. + pub kind: Option, + /// The PostgreSQL user for this import operation. Defaults to cloudsqlsuperuser. Used only for PostgreSQL instances. + #[serde(rename="importUser")] + pub import_user: Option, + /// The database (for example, guestbook) to which the import is made. If fileType is SQL and no database is specified, it is assumed that the database is specified in the file to be imported. If fileType is CSV, it must be specified. + pub database: Option, /// The file type for the specified uri. /// SQL: The file contains SQL statements. /// CSV: The file contains CSV data. @@ -734,10 +741,6 @@ pub struct ImportContext { pub csv_import_options: Option, /// A path to the file in Google Cloud Storage from which the import is made. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. pub uri: Option, - /// This is always sql#importContext. - pub kind: Option, - /// The database (for example, guestbook) to which the import is made. If fileType is SQL and no database is specified, it is assumed that the database is specified in the file to be imported. If fileType is CSV, it must be specified. - pub database: Option, } impl Part for ImportContext {} @@ -876,7 +879,7 @@ impl Part for ImportContextCsvImportOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IpConfiguration { - /// Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP. + /// Whether SSL connections over IP should be enforced or not. #[serde(rename="requireSsl")] pub require_ssl: Option, /// Whether the instance should be assigned an IP address or not. @@ -1162,8 +1165,6 @@ pub struct Settings { /// Reserved for future use. #[serde(rename="availabilityType")] pub availability_type: Option, - /// Reserved for future use. - pub labels: Option>, /// The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. The activation policy cannot be updated together with other settings for Second Generation instances. Valid values: /// ALWAYS: The instance is on; it is not deactivated by inactivity. /// NEVER: The instance is off; it is not activated, even if a connection request arrives. @@ -1173,6 +1174,9 @@ pub struct Settings { /// The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. #[serde(rename="ipConfiguration")] pub ip_configuration: Option, + /// User-provided labels, represented as a dictionary where each label is a single key value pair. + #[serde(rename="userLabels")] + pub user_labels: Option>, /// Configuration specific to read replica instances. Indicates whether replication is enabled or not. #[serde(rename="databaseReplicationEnabled")] pub database_replication_enabled: Option, @@ -1184,7 +1188,7 @@ pub struct Settings { /// The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. #[serde(rename="settingsVersion")] pub settings_version: Option, - /// Configuration to increase storage size automatically. The default value is false. Applies only to Second Generation instances. + /// Configuration to increase storage size automatically. The default value is true. Applies only to Second Generation instances. #[serde(rename="storageAutoResize")] pub storage_auto_resize: Option, /// The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or GCE zone for better performance. App Engine co-location is only applicable to First Generation instances. @@ -1401,21 +1405,6 @@ pub struct InstancesExportRequest { impl RequestValue for InstancesExportRequest {} -/// Reserved for future use. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Labels { - /// Reserved for future use. - pub key: Option, - /// Reserved for future use. - pub value: Option, -} - -impl Part for Labels {} - - /// User list response. /// /// # Activities @@ -1476,7 +1465,7 @@ pub struct DatabaseInstance { /// Connection name of the Cloud SQL instance used in connection strings. #[serde(rename="connectionName")] pub connection_name: Option, - /// The database engine type and version. The databaseVersion can not be changed after instance creation. Can be MYSQL_5_5, MYSQL_5_6 or MYSQL_5_7. Defaults to MYSQL_5_6. MYSQL_5_7 is applicable only to Second Generation instances. + /// The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 #[serde(rename="databaseVersion")] pub database_version: Option, /// The instance type. This can be one of the following. @@ -1524,6 +1513,9 @@ pub struct DatabaseInstance { /// Configuration specific to read-replicas replicating from on-premises masters. #[serde(rename="replicaConfiguration")] pub replica_configuration: Option, + /// The GCE zone that the instance is serving from. In case when the instance is failed over to standby zone, this value may be different with what user specified in the settings. + #[serde(rename="gceZone")] + pub gce_zone: Option, /// The user settings. pub settings: Option, /// The URI of this resource. @@ -7971,7 +7963,7 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Reserved for future use. + /// An expression for filtering the results of the request, such as by name or label. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { diff --git a/gen/storage1-cli/Cargo.toml b/gen/storage1-cli/Cargo.toml index d81b93cb52..2029411fed 100644 --- a/gen/storage1-cli/Cargo.toml +++ b/gen/storage1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-storage1-cli" -version = "1.0.6+20170504" +version = "1.0.6+20170915" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-storage1] path = "../storage1" -version = "1.0.6+20170504" +version = "1.0.6+20170915" diff --git a/gen/storage1-cli/README.md b/gen/storage1-cli/README.md index 97805f6b43..87e3890f1e 100644 --- a/gen/storage1-cli/README.md +++ b/gen/storage1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *storage* API at revision *20170504*. The CLI is at version *1.0.6*. +This documentation was generated from the *storage* API at revision *20170915*. The CLI is at version *1.0.6*. ```bash storage1 [options] diff --git a/gen/storage1-cli/mkdocs.yml b/gen/storage1-cli/mkdocs.yml index 073df57856..4065868dda 100644 --- a/gen/storage1-cli/mkdocs.yml +++ b/gen/storage1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storage v1.0.6+20170504 +site_name: storage v1.0.6+20170915 site_url: http://byron.github.io/google-apis-rs/google-storage1-cli site_description: A complete library to interact with storage (protocol v1) diff --git a/gen/storage1-cli/src/main.rs b/gen/storage1-cli/src/main.rs index 77a91cfbed..e102152afc 100644 --- a/gen/storage1-cli/src/main.rs +++ b/gen/storage1-cli/src/main.rs @@ -712,7 +712,8 @@ impl<'n> Engine<'n> { "logging.log-bucket" => Some(("logging.logBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-created" => Some(("timeCreated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption.default-kms-key-name" => Some(("encryption.defaultKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -723,9 +724,9 @@ impl<'n> Engine<'n> { "owner.entity" => Some(("owner.entity", 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 })), - "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "enabled", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "default-kms-key-name", "enabled", "encryption", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -739,6 +740,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -761,7 +765,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["predefined-acl", "projection", "predefined-default-object-acl"].iter().map(|v|*v)); + v.extend(["predefined-acl", "user-project", "projection", "predefined-default-object-acl"].iter().map(|v|*v)); v } )); } } @@ -801,6 +805,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -826,7 +833,7 @@ impl<'n> Engine<'n> { 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", "prefix", "projection", "max-results"].iter().map(|v|*v)); + v.extend(["page-token", "prefix", "user-project", "projection", "max-results"].iter().map(|v|*v)); v } )); } } @@ -891,7 +898,8 @@ impl<'n> Engine<'n> { "logging.log-bucket" => Some(("logging.logBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-created" => Some(("timeCreated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption.default-kms-key-name" => Some(("encryption.defaultKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -902,9 +910,9 @@ impl<'n> Engine<'n> { "owner.entity" => Some(("owner.entity", 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 })), - "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "enabled", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "default-kms-key-name", "enabled", "encryption", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1161,7 +1169,8 @@ impl<'n> Engine<'n> { "logging.log-bucket" => Some(("logging.logBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-created" => Some(("timeCreated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption.default-kms-key-name" => Some(("encryption.defaultKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1172,9 +1181,9 @@ impl<'n> Engine<'n> { "owner.entity" => Some(("owner.entity", 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 })), - "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "enabled", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "default-kms-key-name", "enabled", "encryption", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2579,6 +2588,7 @@ impl<'n> Engine<'n> { "destination.generation" => Some(("destination.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination.component-count" => Some(("destination.componentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "destination.media-link" => Some(("destination.mediaLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination.kms-key-name" => Some(("destination.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination.owner.entity-id" => Some(("destination.owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination.owner.entity" => Some(("destination.owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination.cache-control" => Some(("destination.cacheControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2605,7 +2615,7 @@ impl<'n> Engine<'n> { "destination.storage-class" => Some(("destination.storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination.self-link" => Some(("destination.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "destination", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "destination", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "kms-key-name", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2623,6 +2633,9 @@ impl<'n> Engine<'n> { "user-project" => { call = call.user_project(value.unwrap_or("")); }, + "kms-key-name" => { + call = call.kms_key_name(value.unwrap_or("")); + }, "if-metageneration-match" => { call = call.if_metageneration_match(value.unwrap_or("")); }, @@ -2648,7 +2661,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-match", "user-project", "destination-predefined-acl", "if-generation-match"].iter().map(|v|*v)); + v.extend(["if-metageneration-match", "user-project", "destination-predefined-acl", "if-generation-match", "kms-key-name"].iter().map(|v|*v)); v } )); } } @@ -2713,6 +2726,7 @@ impl<'n> Engine<'n> { "generation" => Some(("generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "component-count" => Some(("componentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "media-link" => Some(("mediaLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cache-control" => Some(("cacheControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2739,7 +2753,7 @@ impl<'n> Engine<'n> { "storage-class" => Some(("storageClass", 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!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "kms-key-name", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3076,6 +3090,7 @@ impl<'n> Engine<'n> { "generation" => Some(("generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "component-count" => Some(("componentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "media-link" => Some(("mediaLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cache-control" => Some(("cacheControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3102,7 +3117,7 @@ impl<'n> Engine<'n> { "storage-class" => Some(("storageClass", 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!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "kms-key-name", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3128,6 +3143,9 @@ impl<'n> Engine<'n> { "name" => { call = call.name(value.unwrap_or("")); }, + "kms-key-name" => { + call = call.kms_key_name(value.unwrap_or("")); + }, "if-metageneration-not-match" => { call = call.if_metageneration_not_match(value.unwrap_or("")); }, @@ -3156,7 +3174,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-generation-match", "projection", "if-metageneration-match", "user-project", "content-encoding", "if-generation-not-match", "predefined-acl", "if-metageneration-not-match", "name"].iter().map(|v|*v)); + v.extend(["if-generation-match", "projection", "if-metageneration-not-match", "user-project", "content-encoding", "if-generation-not-match", "kms-key-name", "predefined-acl", "if-metageneration-match", "name"].iter().map(|v|*v)); v } )); } } @@ -3296,6 +3314,7 @@ impl<'n> Engine<'n> { "generation" => Some(("generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "component-count" => Some(("componentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "media-link" => Some(("mediaLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cache-control" => Some(("cacheControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3322,7 +3341,7 @@ impl<'n> Engine<'n> { "storage-class" => Some(("storageClass", 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!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "kms-key-name", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3433,6 +3452,7 @@ impl<'n> Engine<'n> { "generation" => Some(("generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "component-count" => Some(("componentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "media-link" => Some(("mediaLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cache-control" => Some(("cacheControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3459,7 +3479,7 @@ impl<'n> Engine<'n> { "storage-class" => Some(("storageClass", 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!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "kms-key-name", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3515,6 +3535,9 @@ impl<'n> Engine<'n> { "destination-predefined-acl" => { call = call.destination_predefined_acl(value.unwrap_or("")); }, + "destination-kms-key-name" => { + call = call.destination_kms_key_name(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3528,7 +3551,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-source-generation-match", "if-generation-match", "projection", "if-source-metageneration-not-match", "if-metageneration-not-match", "user-project", "source-generation", "max-bytes-rewritten-per-call", "if-source-generation-not-match", "destination-predefined-acl", "if-source-metageneration-match", "rewrite-token", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-source-generation-match", "if-generation-match", "projection", "if-source-metageneration-not-match", "destination-kms-key-name", "if-metageneration-not-match", "user-project", "source-generation", "max-bytes-rewritten-per-call", "if-source-generation-not-match", "destination-predefined-acl", "if-source-metageneration-match", "rewrite-token", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); v } )); } } @@ -3741,6 +3764,7 @@ impl<'n> Engine<'n> { "generation" => Some(("generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "component-count" => Some(("componentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "media-link" => Some(("mediaLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cache-control" => Some(("cacheControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3767,7 +3791,7 @@ impl<'n> Engine<'n> { "storage-class" => Some(("storageClass", 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!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bucket", "cache-control", "component-count", "content-disposition", "content-encoding", "content-language", "content-type", "crc32c", "customer-encryption", "encryption-algorithm", "entity", "entity-id", "etag", "generation", "id", "key-sha256", "kind", "kms-key-name", "md5-hash", "media-link", "metadata", "metageneration", "name", "owner", "self-link", "size", "storage-class", "time-created", "time-deleted", "time-storage-class-updated", "updated"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3983,6 +4007,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3996,6 +4023,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -4990,7 +5018,7 @@ fn main() { vec![ (Some(r##"bucket"##), None, - Some(r##"Name of a GCS bucket."##), + Some(r##"Name of a Google Cloud Storage bucket."##), Some(true), Some(false)), @@ -5644,7 +5672,7 @@ fn main() { ("projects", "methods: 'service-account-get'", vec![ ("service-account-get", - Some(r##"Get the email address of this project's GCS service account."##), + Some(r##"Get the email address of this project's Google Cloud Storage service account."##), "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/projects_service-account-get", vec![ (Some(r##"project-id"##), @@ -5671,7 +5699,7 @@ fn main() { let mut app = App::new("storage1") .author("Sebastian Thiel ") - .version("1.0.6+20170504") + .version("1.0.6+20170915") .about("Stores and retrieves potentially large, immutable data objects.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_storage1_cli") .arg(Arg::with_name("url") diff --git a/gen/storage1/Cargo.toml b/gen/storage1/Cargo.toml index ab0331230d..75f7f37918 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storage1" -version = "1.0.6+20170504" +version = "1.0.6+20170915" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1" homepage = "https://developers.google.com/storage/docs/json_api/" -documentation = "https://docs.rs/google-storage1/1.0.6+20170504" +documentation = "https://docs.rs/google-storage1/1.0.6+20170915" license = "MIT" keywords = ["storage", "google", "protocol", "web", "api"] diff --git a/gen/storage1/README.md b/gen/storage1/README.md index eec40b3ab4..d1871da407 100644 --- a/gen/storage1/README.md +++ b/gen/storage1/README.md @@ -5,48 +5,48 @@ DO NOT EDIT ! --> The `google-storage1` library allows access to all features of the *Google storage* service. -This documentation was generated from *storage* crate version *1.0.6+20170504*, where *20170504* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *storage* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *storage* *v1* API can be found at the [official documentation site](https://developers.google.com/storage/docs/json_api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.Storage.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Storage.html) ... -* [bucket access controls](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControl.html) - * [*delete*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketAccessControlUpdateCall.html) -* [buckets](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.Bucket.html) - * [*delete*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketPatchCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketTestIamPermissionCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.BucketUpdateCall.html) -* [channels](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.Channel.html) - * [*stop*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ChannelStopCall.html) +* [bucket access controls](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketAccessControlUpdateCall.html) +* [buckets](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Bucket.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketPatchCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketTestIamPermissionCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.BucketUpdateCall.html) +* [channels](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Channel.html) + * [*stop*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ChannelStopCall.html) * default object access controls - * [*delete*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) -* [notifications](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.Notification.html) - * [*delete*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.NotificationGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.NotificationInsertCall.html) and [*list*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.NotificationListCall.html) -* [object access controls](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControl.html) - * [*delete*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectAccessControlUpdateCall.html) -* [objects](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.Object.html) - * [*compose*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectRewriteCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectTestIamPermissionCall.html), [*update*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectWatchAllCall.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) +* [notifications](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Notification.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.NotificationGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.NotificationInsertCall.html) and [*list*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.NotificationListCall.html) +* [object access controls](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectAccessControlUpdateCall.html) +* [objects](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Object.html) + * [*compose*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectRewriteCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectTestIamPermissionCall.html), [*update*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectWatchAllCall.html) * projects - * [*service account get*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ProjectServiceAccountGetCall.html) + * [*service account get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ProjectServiceAccountGetCall.html) Upload supported by ... -* [*insert objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectInsertCall.html) +* [*insert objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectInsertCall.html) Download supported by ... -* [*get objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectGetCall.html) -* [*update objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectUpdateCall.html) -* [*insert objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectInsertCall.html) -* [*compose objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectComposeCall.html) -* [*copy objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectCopyCall.html) +* [*get objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectGetCall.html) +* [*update objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectUpdateCall.html) +* [*insert objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectInsertCall.html) +* [*compose objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectComposeCall.html) +* [*copy objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectCopyCall.html) Subscription supported by ... -* [*watch all objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectWatchAllCall.html) -* [*list objects*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.ObjectListCall.html) +* [*watch all objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectWatchAllCall.html) +* [*list objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectListCall.html) @@ -54,17 +54,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/struct.Storage.html)** +* **[Hub](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Storage.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -157,6 +157,7 @@ let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destina .if_generation_not_match("dolores") .if_generation_match("gubergren") .destination_predefined_acl("sadipscing") + .destination_kms_key_name("aliquyam") .doit(); match result { @@ -179,17 +180,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/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")`. @@ -199,29 +200,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/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](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/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](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/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](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/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](https://docs.rs/google-storage1/1.0.6+20170504/google_storage1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/storage1/src/lib.rs b/gen/storage1/src/lib.rs index 6118a7abc5..34fe4bf581 100644 --- a/gen/storage1/src/lib.rs +++ b/gen/storage1/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 *storage* crate version *1.0.6+20170504*, where *20170504* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *storage* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *storage* *v1* API can be found at the //! [official documentation site](https://developers.google.com/storage/docs/json_api/). @@ -144,20 +144,21 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -//! .user_project("justo") +//! .user_project("et") //! .source_generation("et") -//! .rewrite_token("et") -//! .projection("diam") -//! .max_bytes_rewritten_per_call("ipsum") -//! .if_source_metageneration_not_match("Lorem") -//! .if_source_metageneration_match("et") -//! .if_source_generation_not_match("duo") -//! .if_source_generation_match("aliquyam") -//! .if_metageneration_not_match("sea") -//! .if_metageneration_match("Lorem") -//! .if_generation_not_match("eos") -//! .if_generation_match("erat") -//! .destination_predefined_acl("sadipscing") +//! .rewrite_token("diam") +//! .projection("ipsum") +//! .max_bytes_rewritten_per_call("Lorem") +//! .if_source_metageneration_not_match("et") +//! .if_source_metageneration_match("duo") +//! .if_source_generation_not_match("aliquyam") +//! .if_source_generation_match("sea") +//! .if_metageneration_not_match("Lorem") +//! .if_metageneration_match("eos") +//! .if_generation_not_match("erat") +//! .if_generation_match("sadipscing") +//! .destination_predefined_acl("dolor") +//! .destination_kms_key_name("eirmod") //! .doit(); //! //! match result { @@ -359,20 +360,21 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -/// .user_project("no") -/// .source_generation("labore") -/// .rewrite_token("eirmod") -/// .projection("dolore") -/// .max_bytes_rewritten_per_call("invidunt") -/// .if_source_metageneration_not_match("aliquyam") -/// .if_source_metageneration_match("accusam") -/// .if_source_generation_not_match("Lorem") -/// .if_source_generation_match("sea") +/// .user_project("eirmod") +/// .source_generation("dolore") +/// .rewrite_token("invidunt") +/// .projection("aliquyam") +/// .max_bytes_rewritten_per_call("accusam") +/// .if_source_metageneration_not_match("Lorem") +/// .if_source_metageneration_match("sea") +/// .if_source_generation_not_match("et") +/// .if_source_generation_match("duo") /// .if_metageneration_not_match("et") -/// .if_metageneration_match("duo") -/// .if_generation_not_match("et") -/// .if_generation_match("eirmod") -/// .destination_predefined_acl("sanctus") +/// .if_metageneration_match("eirmod") +/// .if_generation_not_match("sanctus") +/// .if_generation_match("et") +/// .destination_predefined_acl("amet") +/// .destination_kms_key_name("et") /// .doit(); /// /// match result { @@ -628,6 +630,9 @@ pub struct Bucket { pub acl: Option>, /// The ID of the bucket. For buckets, the id and name properities are the same. pub id: Option, + /// The project number of the project the bucket belongs to. + #[serde(rename="projectNumber")] + pub project_number: Option, /// The kind of item this is. For buckets, this is always storage#bucket. pub kind: Option, /// The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. @@ -636,20 +641,19 @@ pub struct Bucket { pub name: Option, /// The bucket's billing configuration. pub billing: Option, - /// The project number of the project the bucket belongs to. - #[serde(rename="projectNumber")] - pub project_number: Option, + /// Encryption configuration used by default for newly inserted objects, when no encryption config is specified. + pub encryption: Option, + /// The bucket's lifecycle configuration. See lifecycle management for more information. + pub lifecycle: Option, /// HTTP 1.1 Entity tag for the bucket. pub etag: Option, + /// The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list. + pub location: Option, + /// The bucket's versioning configuration. + pub versioning: Option, /// The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. #[serde(rename="storageClass")] pub storage_class: Option, - /// The bucket's lifecycle configuration. See lifecycle management for more information. - pub lifecycle: Option, - /// The bucket's versioning configuration. - pub versioning: Option, - /// The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list. - pub location: Option, } impl RequestValue for Bucket {} @@ -673,6 +677,21 @@ impl NestedType for BucketLifecycleRule {} impl Part for BucketLifecycleRule {} +/// Encryption configuration used by default for newly inserted objects, when no encryption config is specified. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketEncryption { + /// no description provided + #[serde(rename="defaultKmsKeyName")] + pub default_kms_key_name: Option, +} + +impl NestedType for BucketEncryption {} +impl Part for BucketEncryption {} + + /// Metadata of customer-supplied encryption key, if the object is encrypted by such a key. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -748,7 +767,7 @@ impl Part for BucketLifecycleRuleCondition {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// The ID of the resource to which this policy belongs. Will be of the form buckets/bucket for buckets, and buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input. + /// The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input. #[serde(rename="resourceId")] pub resource_id: Option, /// An association between a role, which comes with a set of permissions, and members who may assume that role. @@ -938,6 +957,8 @@ pub struct PolicyBindings { /// - roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. /// - roles/storage.legacyBucketOwner — Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role. pub role: Option, + /// no description provided + pub condition: Option, /// A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: /// - allUsers — A special identifier that represents anyone on the internet; with or without a Google account. /// - allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. @@ -1138,7 +1159,7 @@ pub struct Object { pub self_link: Option, /// The modification time of the object metadata in RFC 3339 format. pub updated: Option, - /// Content-Type of the object data. If contentType is not specified, object downloads will be served as application/octet-stream. + /// Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. #[serde(rename="contentType")] pub content_type: Option, /// The creation time of the object in RFC 3339 format. @@ -1160,13 +1181,17 @@ pub struct Object { /// Media download link. #[serde(rename="mediaLink")] pub media_link: Option, + /// Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key. + #[serde(rename="kmsKeyName")] + pub kms_key_name: Option, /// The owner of the object. This will always be the uploader of the object. pub owner: Option, /// Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. #[serde(rename="cacheControl")] pub cache_control: Option, - /// Access controls on the object. - pub acl: Option>, + /// Content-Encoding of the object data. + #[serde(rename="contentEncoding")] + pub content_encoding: Option, /// The ID of the object, including the bucket name, object name, and generation number. pub id: Option, /// Content-Length of the data in bytes. @@ -1186,9 +1211,8 @@ pub struct Object { pub md5_hash: Option, /// The name of the bucket containing this object. pub bucket: Option, - /// Content-Encoding of the object data. - #[serde(rename="contentEncoding")] - pub content_encoding: Option, + /// Access controls on the object. + pub acl: Option>, /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices. pub crc32c: Option, /// HTTP 1.1 Entity tag for the object. @@ -1911,7 +1935,7 @@ impl<'a, C, A> NotificationMethods<'a, C, A> { /// /// # Arguments /// - /// * `bucket` - Name of a GCS bucket. + /// * `bucket` - Name of a Google Cloud Storage bucket. pub fn list(&self, bucket: &str) -> NotificationListCall<'a, C, A> { NotificationListCall { hub: self.hub, @@ -1998,6 +2022,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _if_generation_not_match: Default::default(), _if_generation_match: Default::default(), _destination_predefined_acl: Default::default(), + _destination_kms_key_name: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2146,6 +2171,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _projection: Default::default(), _predefined_acl: Default::default(), _name: Default::default(), + _kms_key_name: Default::default(), _if_metageneration_not_match: Default::default(), _if_metageneration_match: Default::default(), _if_generation_not_match: Default::default(), @@ -2173,6 +2199,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _destination_bucket: destination_bucket.to_string(), _destination_object: destination_object.to_string(), _user_project: Default::default(), + _kms_key_name: Default::default(), _if_metageneration_match: Default::default(), _if_generation_match: Default::default(), _destination_predefined_acl: Default::default(), @@ -2648,6 +2675,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { hub: self.hub, _request: request, _project: project.to_string(), + _user_project: Default::default(), _projection: Default::default(), _predefined_default_object_acl: Default::default(), _predefined_acl: Default::default(), @@ -2726,6 +2754,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { BucketListCall { hub: self.hub, _project: project.to_string(), + _user_project: Default::default(), _projection: Default::default(), _prefix: Default::default(), _page_token: Default::default(), @@ -2780,7 +2809,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get the email address of this project's GCS service account. + /// Get the email address of this project's Google Cloud Storage service account. /// /// # Arguments /// @@ -2789,6 +2818,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectServiceAccountGetCall { hub: self.hub, _project_id: project_id.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2838,7 +2868,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().insert(req, "bucket") -/// .user_project("amet") +/// .user_project("ut") /// .doit(); /// # } /// ``` @@ -3024,7 +3054,7 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlInsertCall<'a, C, A> { @@ -3118,9 +3148,9 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().list("bucket") -/// .user_project("consetetur") -/// .if_metageneration_not_match("ut") -/// .if_metageneration_match("ea") +/// .user_project("sed") +/// .if_metageneration_not_match("dolor") +/// .if_metageneration_match("dolor") /// .doit(); /// # } /// ``` @@ -3289,7 +3319,7 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlListCall<'a, C, A> { @@ -3403,7 +3433,7 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< self._entity = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlPatchCall<'a, C, A> { @@ -3695,7 +3725,7 @@ impl<'a, C, A> DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().delete("bucket", "entity") -/// .user_project("consetetur") +/// .user_project("Lorem") /// .doit(); /// # } /// ``` @@ -3857,7 +3887,7 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut self._entity = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlDeleteCall<'a, C, A> { @@ -3957,7 +3987,7 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().update(req, "bucket", "entity") -/// .user_project("Lorem") +/// .user_project("sit") /// .doit(); /// # } /// ``` @@ -4155,7 +4185,7 @@ impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut self._entity = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { @@ -4249,7 +4279,7 @@ impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().get("bucket", "entity") -/// .user_project("sit") +/// .user_project("rebum.") /// .doit(); /// # } /// ``` @@ -4422,7 +4452,7 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlGetCall<'a, C, A> { @@ -4522,7 +4552,7 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut BucketAccessControlPatchCall<'a, C, A> { @@ -4814,7 +4844,7 @@ impl<'a, C, A> BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut BucketAccessControlDeleteCall<'a, C, A> { @@ -5076,7 +5106,7 @@ impl<'a, C, A> BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketAccessControlInsertCall<'a, C, A> { @@ -5356,7 +5386,7 @@ impl<'a, C, A> BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlGetCall<'a, C, A> { @@ -5629,7 +5659,7 @@ impl<'a, C, A> BucketAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut BucketAccessControlUpdateCall<'a, C, A> { @@ -5921,7 +5951,7 @@ impl<'a, C, A> BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut BucketAccessControlListCall<'a, C, A> where C: BorrowMut BucketAccessControlListCall<'a, C, A> { @@ -6412,7 +6442,7 @@ impl<'a, C, A> ChannelStopCall<'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.notifications().insert(req, "bucket") -/// .user_project("nonumy") +/// .user_project("takimata") /// .doit(); /// # } /// ``` @@ -6598,7 +6628,7 @@ impl<'a, C, A> NotificationInsertCall<'a, C, A> where C: BorrowMut NotificationInsertCall<'a, C, A> { @@ -6692,7 +6722,7 @@ impl<'a, C, A> NotificationInsertCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> { @@ -6948,7 +6978,7 @@ impl<'a, C, A> NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationGetCall<'a, C, A> where C: BorrowMut, self._notification = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> NotificationGetCall<'a, C, A> { @@ -7215,7 +7245,7 @@ impl<'a, C, A> NotificationGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.notifications().list("bucket") -/// .user_project("sadipscing") +/// .user_project("nonumy") /// .doit(); /// # } /// ``` @@ -7366,7 +7396,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, } - /// Name of a GCS bucket. + /// Name of a Google Cloud Storage bucket. /// /// Sets the *bucket* path property to the given value. /// @@ -7376,7 +7406,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> NotificationListCall<'a, C, A> { @@ -7476,20 +7506,21 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -/// .user_project("aliquyam") -/// .source_generation("sit") -/// .rewrite_token("eirmod") -/// .projection("consetetur") -/// .max_bytes_rewritten_per_call("labore") -/// .if_source_metageneration_not_match("sed") -/// .if_source_metageneration_match("ea") -/// .if_source_generation_not_match("gubergren") -/// .if_source_generation_match("aliquyam") -/// .if_metageneration_not_match("eos") -/// .if_metageneration_match("tempor") -/// .if_generation_not_match("sea") -/// .if_generation_match("labore") -/// .destination_predefined_acl("ipsum") +/// .user_project("consetetur") +/// .source_generation("labore") +/// .rewrite_token("sed") +/// .projection("ea") +/// .max_bytes_rewritten_per_call("gubergren") +/// .if_source_metageneration_not_match("aliquyam") +/// .if_source_metageneration_match("eos") +/// .if_source_generation_not_match("tempor") +/// .if_source_generation_match("sea") +/// .if_metageneration_not_match("labore") +/// .if_metageneration_match("ipsum") +/// .if_generation_not_match("aliquyam") +/// .if_generation_match("dolores") +/// .destination_predefined_acl("sit") +/// .destination_kms_key_name("diam") /// .doit(); /// # } /// ``` @@ -7516,6 +7547,7 @@ pub struct ObjectRewriteCall<'a, C, A> _if_generation_not_match: Option, _if_generation_match: Option, _destination_predefined_acl: Option, + _destination_kms_key_name: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7537,7 +7569,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.objects.rewrite", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((21 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((22 + self._additional_params.len())); params.push(("sourceBucket", self._source_bucket.to_string())); params.push(("sourceObject", self._source_object.to_string())); params.push(("destinationBucket", self._destination_bucket.to_string())); @@ -7584,7 +7616,10 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._destination_predefined_acl { params.push(("destinationPredefinedAcl", value.to_string())); } - for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "rewriteToken", "projection", "maxBytesRewrittenPerCall", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + if let Some(value) = self._destination_kms_key_name { + params.push(("destinationKmsKeyName", value.to_string())); + } + for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "rewriteToken", "projection", "maxBytesRewrittenPerCall", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl", "destinationKmsKeyName"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7763,7 +7798,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._destination_object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { @@ -7812,14 +7847,14 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._if_source_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the source object's generation does not match the given value. + /// Makes the operation conditional on whether the source object's current generation does not match the given value. /// /// Sets the *if source generation not match* query property to the given value. pub fn if_source_generation_not_match(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { self._if_source_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the source object's generation matches the given value. + /// Makes the operation conditional on whether the source object's current generation matches the given value. /// /// Sets the *if source generation match* query property to the given value. pub fn if_source_generation_match(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { @@ -7840,14 +7875,14 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the destination object's current generation does not match the given value. + /// Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the destination object's current generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { @@ -7861,6 +7896,13 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._destination_predefined_acl = Some(new_value.to_string()); self } + /// Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + /// + /// Sets the *destination kms key name* query property to the given value. + pub fn destination_kms_key_name(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { + self._destination_kms_key_name = 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. /// @@ -7953,13 +7995,13 @@ impl<'a, C, A> ObjectRewriteCall<'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.objects().get("bucket", "object") -/// .user_project("sit") -/// .projection("diam") -/// .if_metageneration_not_match("ut") -/// .if_metageneration_match("justo") -/// .if_generation_not_match("est") -/// .if_generation_match("amet") -/// .generation("accusam") +/// .user_project("est") +/// .projection("amet") +/// .if_metageneration_not_match("accusam") +/// .if_metageneration_match("clita") +/// .if_generation_not_match("diam") +/// .if_generation_match("justo") +/// .generation("est") /// .doit(); /// # } /// ``` @@ -8172,7 +8214,7 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau self._object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectGetCall<'a, C, A> { @@ -8200,14 +8242,14 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's generation does not match the given value. + /// Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectGetCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectGetCall<'a, C, A> { @@ -8314,13 +8356,13 @@ impl<'a, C, A> ObjectGetCall<'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.objects().watch_all(req, "bucket") -/// .versions(false) -/// .user_project("justo") -/// .projection("est") -/// .prefix("clita") -/// .page_token("invidunt") -/// .max_results(14) -/// .delimiter("dolores") +/// .versions(true) +/// .user_project("ut") +/// .projection("dolores") +/// .prefix("eos") +/// .page_token("voluptua.") +/// .max_results(82) +/// .delimiter("sed") /// .doit(); /// # } /// ``` @@ -8537,7 +8579,7 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A self._versions = Some(new_value); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { @@ -8672,8 +8714,8 @@ impl<'a, C, A> ObjectWatchAllCall<'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.objects().set_iam_policy(req, "bucket", "object") -/// .user_project("duo") -/// .generation("sed") +/// .user_project("ea") +/// .generation("et") /// .doit(); /// # } /// ``` @@ -8875,7 +8917,7 @@ impl<'a, C, A> ObjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectSetIamPolicyCall<'a, C, A> { @@ -8976,8 +9018,8 @@ impl<'a, C, A> ObjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectGetIamPolicyCall<'a, C, A> { @@ -9266,14 +9308,14 @@ impl<'a, C, A> ObjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: self._object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectUpdateCall<'a, C, A> { @@ -9550,14 +9592,14 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation does not match the given value. + /// Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectUpdateCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectUpdateCall<'a, C, A> { @@ -9670,15 +9712,16 @@ impl<'a, C, A> ObjectUpdateCall<'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.objects().insert(req, "bucket") -/// .user_project("et") -/// .projection("sed") -/// .predefined_acl("sit") -/// .name("takimata") -/// .if_metageneration_not_match("elitr") -/// .if_metageneration_match("nonumy") -/// .if_generation_not_match("rebum.") -/// .if_generation_match("Lorem") -/// .content_encoding("Lorem") +/// .user_project("elitr") +/// .projection("nonumy") +/// .predefined_acl("rebum.") +/// .name("Lorem") +/// .kms_key_name("Lorem") +/// .if_metageneration_not_match("diam") +/// .if_metageneration_match("ut") +/// .if_generation_not_match("ut") +/// .if_generation_match("amet.") +/// .content_encoding("ipsum") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -9692,6 +9735,7 @@ pub struct ObjectInsertCall<'a, C, A> _projection: Option, _predefined_acl: Option, _name: Option, + _kms_key_name: Option, _if_metageneration_not_match: Option, _if_metageneration_match: Option, _if_generation_not_match: Option, @@ -9719,7 +9763,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.objects.insert", http_method: hyper::method::Method::Post }); - 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(("bucket", self._bucket.to_string())); if let Some(value) = self._user_project { params.push(("userProject", value.to_string())); @@ -9733,6 +9777,9 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._name { params.push(("name", value.to_string())); } + if let Some(value) = self._kms_key_name { + params.push(("kmsKeyName", value.to_string())); + } if let Some(value) = self._if_metageneration_not_match { params.push(("ifMetagenerationNotMatch", value.to_string())); } @@ -9748,7 +9795,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._content_encoding { params.push(("contentEncoding", value.to_string())); } - for &field in ["bucket", "userProject", "projection", "predefinedAcl", "name", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "contentEncoding"].iter() { + for &field in ["bucket", "userProject", "projection", "predefinedAcl", "name", "kmsKeyName", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "contentEncoding"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10021,7 +10068,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectInsertCall<'a, C, A> { @@ -10049,6 +10096,13 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: self._name = Some(new_value.to_string()); self } + /// Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + /// + /// Sets the *kms key name* query property to the given value. + pub fn kms_key_name(mut self, new_value: &str) -> ObjectInsertCall<'a, C, A> { + self._kms_key_name = Some(new_value.to_string()); + self + } /// Makes the operation conditional on whether the object's current metageneration does not match the given value. /// /// Sets the *if metageneration not match* query property to the given value. @@ -10063,14 +10117,14 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation does not match the given value. + /// Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectInsertCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectInsertCall<'a, C, A> { @@ -10182,10 +10236,11 @@ impl<'a, C, A> ObjectInsertCall<'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.objects().compose(req, "destinationBucket", "destinationObject") -/// .user_project("ut") -/// .if_metageneration_match("amet.") -/// .if_generation_match("ipsum") -/// .destination_predefined_acl("ut") +/// .user_project("sea") +/// .kms_key_name("ut") +/// .if_metageneration_match("eirmod") +/// .if_generation_match("sanctus") +/// .destination_predefined_acl("voluptua.") /// .doit(); /// # } /// ``` @@ -10197,6 +10252,7 @@ pub struct ObjectComposeCall<'a, C, A> _destination_bucket: String, _destination_object: String, _user_project: Option, + _kms_key_name: Option, _if_metageneration_match: Option, _if_generation_match: Option, _destination_predefined_acl: Option, @@ -10221,12 +10277,15 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.objects.compose", 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())); params.push(("destinationBucket", self._destination_bucket.to_string())); params.push(("destinationObject", self._destination_object.to_string())); if let Some(value) = self._user_project { params.push(("userProject", value.to_string())); } + if let Some(value) = self._kms_key_name { + params.push(("kmsKeyName", value.to_string())); + } if let Some(value) = self._if_metageneration_match { params.push(("ifMetagenerationMatch", value.to_string())); } @@ -10236,7 +10295,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._destination_predefined_acl { params.push(("destinationPredefinedAcl", value.to_string())); } - for &field in ["destinationBucket", "destinationObject", "userProject", "ifMetagenerationMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + for &field in ["destinationBucket", "destinationObject", "userProject", "kmsKeyName", "ifMetagenerationMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10411,13 +10470,20 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: self._destination_object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectComposeCall<'a, C, A> { self._user_project = Some(new_value.to_string()); self } + /// Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + /// + /// Sets the *kms key name* query property to the given value. + pub fn kms_key_name(mut self, new_value: &str) -> ObjectComposeCall<'a, C, A> { + self._kms_key_name = Some(new_value.to_string()); + self + } /// Makes the operation conditional on whether the object's current metageneration matches the given value. /// /// Sets the *if metageneration match* query property to the given value. @@ -10425,7 +10491,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectComposeCall<'a, C, A> { @@ -10526,12 +10592,12 @@ impl<'a, C, A> ObjectComposeCall<'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.objects().delete("bucket", "object") -/// .user_project("ut") -/// .if_metageneration_not_match("eirmod") -/// .if_metageneration_match("sanctus") -/// .if_generation_not_match("voluptua.") -/// .if_generation_match("dolor") -/// .generation("et") +/// .user_project("et") +/// .if_metageneration_not_match("vero") +/// .if_metageneration_match("ut") +/// .if_generation_not_match("sed") +/// .if_generation_match("et") +/// .generation("ipsum") /// .doit(); /// # } /// ``` @@ -10713,7 +10779,7 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: self._object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectDeleteCall<'a, C, A> { @@ -10734,14 +10800,14 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation does not match the given value. + /// Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectDeleteCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectDeleteCall<'a, C, A> { @@ -10843,12 +10909,12 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().list("bucket") /// .versions(true) -/// .user_project("ut") -/// .projection("sed") -/// .prefix("et") -/// .page_token("ipsum") -/// .max_results(81) -/// .delimiter("dolore") +/// .user_project("vero") +/// .projection("dolor") +/// .prefix("takimata") +/// .page_token("et") +/// .max_results(10) +/// .delimiter("et") /// .doit(); /// # } /// ``` @@ -11040,7 +11106,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa self._versions = Some(new_value); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectListCall<'a, C, A> { @@ -11169,8 +11235,8 @@ impl<'a, C, A> ObjectListCall<'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.objects().test_iam_permissions("bucket", "object", "permissions") -/// .user_project("et") -/// .generation("nonumy") +/// .user_project("rebum.") +/// .generation("labore") /// .doit(); /// # } /// ``` @@ -11364,7 +11430,7 @@ impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ObjectTestIamPermissionCall<'a, C, A> { @@ -11476,18 +11542,18 @@ impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa self._destination_object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { @@ -11804,14 +11870,14 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa self._if_source_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the source object's generation does not match the given value. + /// Makes the operation conditional on whether the source object's current generation does not match the given value. /// /// Sets the *if source generation not match* query property to the given value. pub fn if_source_generation_not_match(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { self._if_source_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the source object's generation matches the given value. + /// Makes the operation conditional on whether the source object's current generation matches the given value. /// /// Sets the *if source generation match* query property to the given value. pub fn if_source_generation_match(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { @@ -11832,14 +11898,14 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the destination object's current generation does not match the given value. + /// Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the destination object's current generation matches the given value. + /// Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { @@ -11946,14 +12012,14 @@ impl<'a, C, A> ObjectCopyCall<'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.objects().patch(req, "bucket", "object") -/// .user_project("dolor") -/// .projection("aliquyam") -/// .predefined_acl("elitr") -/// .if_metageneration_not_match("ea") -/// .if_metageneration_match("et") -/// .if_generation_not_match("Stet") -/// .if_generation_match("sed") -/// .generation("dolor") +/// .user_project("sed") +/// .projection("dolor") +/// .predefined_acl("sanctus") +/// .if_metageneration_not_match("dolore") +/// .if_metageneration_match("Lorem") +/// .if_generation_not_match("consetetur") +/// .if_generation_match("consetetur") +/// .generation("eirmod") /// .doit(); /// # } /// ``` @@ -12179,7 +12245,7 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o self._object = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> ObjectPatchCall<'a, C, A> { @@ -12214,14 +12280,14 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o self._if_metageneration_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation does not match the given value. + /// Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. /// /// Sets the *if generation not match* query property to the given value. pub fn if_generation_not_match(mut self, new_value: &str) -> ObjectPatchCall<'a, C, A> { self._if_generation_not_match = Some(new_value.to_string()); self } - /// Makes the operation conditional on whether the object's current generation matches the given value. + /// Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. /// /// Sets the *if generation match* query property to the given value. pub fn if_generation_match(mut self, new_value: &str) -> ObjectPatchCall<'a, C, A> { @@ -12322,8 +12388,8 @@ impl<'a, C, A> ObjectPatchCall<'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.object_access_controls().get("bucket", "object", "entity") -/// .user_project("consetetur") -/// .generation("consetetur") +/// .user_project("sadipscing") +/// .generation("accusam") /// .doit(); /// # } /// ``` @@ -12512,7 +12578,7 @@ impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut ObjectAccessControlGetCall<'a, C, A> { @@ -12620,7 +12686,7 @@ impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> { @@ -12935,8 +13001,8 @@ impl<'a, C, A> ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> { @@ -13214,8 +13280,8 @@ impl<'a, C, A> ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> { @@ -13500,8 +13566,8 @@ impl<'a, C, A> ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> { @@ -13822,8 +13888,8 @@ impl<'a, C, A> ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> { @@ -14132,12 +14198,12 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketPatchCall<'a, C, A> where C: BorrowMut, A: o self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { @@ -14478,12 +14544,12 @@ impl<'a, C, A> BucketPatchCall<'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.buckets().update(req, "bucket") -/// .user_project("diam") -/// .projection("nonumy") -/// .predefined_default_object_acl("sed") -/// .predefined_acl("diam") -/// .if_metageneration_not_match("magna") -/// .if_metageneration_match("dolor") +/// .user_project("Lorem") +/// .projection("dolor") +/// .predefined_default_object_acl("vero") +/// .predefined_acl("nonumy") +/// .if_metageneration_not_match("takimata") +/// .if_metageneration_match("dolores") /// .doit(); /// # } /// ``` @@ -14689,7 +14755,7 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> BucketUpdateCall<'a, C, A> { @@ -14818,10 +14884,10 @@ impl<'a, C, A> BucketUpdateCall<'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.buckets().get("bucket") -/// .user_project("dolor") -/// .projection("vero") -/// .if_metageneration_not_match("nonumy") -/// .if_metageneration_match("takimata") +/// .user_project("erat") +/// .projection("amet.") +/// .if_metageneration_not_match("dolores") +/// .if_metageneration_match("dolores") /// .doit(); /// # } /// ``` @@ -14994,7 +15060,7 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> BucketGetCall<'a, C, A> { @@ -15109,9 +15175,9 @@ impl<'a, C, A> BucketGetCall<'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.buckets().delete("bucket") -/// .user_project("consetetur") -/// .if_metageneration_not_match("erat") -/// .if_metageneration_match("amet.") +/// .user_project("sed") +/// .if_metageneration_not_match("et") +/// .if_metageneration_match("aliquyam") /// .doit(); /// # } /// ``` @@ -15269,7 +15335,7 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } - /// The project number to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request, for Requester Pays buckets. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> BucketDeleteCall<'a, C, A> { @@ -15383,9 +15449,10 @@ impl<'a, C, A> BucketDeleteCall<'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.buckets().insert(req, "project") -/// .projection("dolores") -/// .predefined_default_object_acl("et") -/// .predefined_acl("sed") +/// .user_project("sit") +/// .projection("aliquyam") +/// .predefined_default_object_acl("sadipscing") +/// .predefined_acl("magna") /// .doit(); /// # } /// ``` @@ -15395,6 +15462,7 @@ pub struct BucketInsertCall<'a, C, A> hub: &'a Storage, _request: Bucket, _project: String, + _user_project: Option, _projection: Option, _predefined_default_object_acl: Option, _predefined_acl: Option, @@ -15419,8 +15487,11 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.buckets.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())); params.push(("project", self._project.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -15430,7 +15501,7 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._predefined_acl { params.push(("predefinedAcl", value.to_string())); } - for &field in ["alt", "project", "projection", "predefinedDefaultObjectAcl", "predefinedAcl"].iter() { + for &field in ["alt", "project", "userProject", "projection", "predefinedDefaultObjectAcl", "predefinedAcl"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15558,6 +15629,13 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } + /// The project to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketInsertCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. /// /// Sets the *projection* query property to the given value. @@ -15666,7 +15744,7 @@ impl<'a, C, A> BucketInsertCall<'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.buckets().test_iam_permissions("bucket", "permissions") -/// .user_project("nonumy") +/// .user_project("gubergren") /// .doit(); /// # } /// ``` @@ -15844,7 +15922,7 @@ impl<'a, C, A> BucketTestIamPermissionCall<'a, C, A> where C: BorrowMut BucketTestIamPermissionCall<'a, C, A> { @@ -15944,7 +16022,7 @@ impl<'a, C, A> BucketTestIamPermissionCall<'a, C, A> where C: BorrowMut BucketSetIamPolicyCall<'a, C, A> where C: BorrowMut BucketSetIamPolicyCall<'a, C, A> { @@ -16224,7 +16302,7 @@ impl<'a, C, A> BucketSetIamPolicyCall<'a, C, A> where C: BorrowMut BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut BucketGetIamPolicyCall<'a, C, A> { @@ -16479,10 +16557,11 @@ impl<'a, C, A> BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _project: String, + _user_project: Option, _projection: Option, _prefix: Option, _page_token: Option, @@ -16516,8 +16596,11 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "storage.buckets.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(("project", self._project.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -16530,7 +16613,7 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "project", "projection", "prefix", "pageToken", "maxResults"].iter() { + for &field in ["alt", "project", "userProject", "projection", "prefix", "pageToken", "maxResults"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16634,6 +16717,13 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa self._project = new_value.to_string(); self } + /// The project to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketListCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to noAcl. /// /// Sets the *projection* query property to the given value. @@ -16721,7 +16811,7 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Get the email address of this project's GCS service account. +/// Get the email address of this project's Google Cloud Storage service account. /// /// A builder for the *serviceAccount.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -16749,6 +16839,7 @@ impl<'a, C, A> BucketListCall<'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.projects().service_account_get("projectId") +/// .user_project("sit") /// .doit(); /// # } /// ``` @@ -16757,6 +16848,7 @@ pub struct ProjectServiceAccountGetCall<'a, C, A> hub: &'a Storage, _project_id: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -16778,9 +16870,12 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); + 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 let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "projectId", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16905,6 +17000,13 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> { + self._user_project = 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. /// diff --git a/gen/storagetransfer1-cli/Cargo.toml b/gen/storagetransfer1-cli/Cargo.toml index 7a64431dfd..a90b534db9 100644 --- a/gen/storagetransfer1-cli/Cargo.toml +++ b/gen/storagetransfer1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-storagetransfer1-cli" -version = "1.0.6+20170515" +version = "1.0.6+20170921" authors = ["Sebastian Thiel "] description = "A complete library to interact with storagetransfer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storagetransfer1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-storagetransfer1] path = "../storagetransfer1" -version = "1.0.6+20170515" +version = "1.0.6+20170921" diff --git a/gen/storagetransfer1-cli/README.md b/gen/storagetransfer1-cli/README.md index ffb86184c2..e30713362c 100644 --- a/gen/storagetransfer1-cli/README.md +++ b/gen/storagetransfer1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *storagetransfer* API at revision *20170515*. The CLI is at version *1.0.6*. +This documentation was generated from the *storagetransfer* API at revision *20170921*. The CLI is at version *1.0.6*. ```bash storagetransfer1 [options] diff --git a/gen/storagetransfer1-cli/mkdocs.yml b/gen/storagetransfer1-cli/mkdocs.yml index fab13c60ab..e28c547199 100644 --- a/gen/storagetransfer1-cli/mkdocs.yml +++ b/gen/storagetransfer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storagetransfer v1.0.6+20170515 +site_name: storagetransfer v1.0.6+20170921 site_url: http://byron.github.io/google-apis-rs/google-storagetransfer1-cli site_description: A complete library to interact with storagetransfer (protocol v1) diff --git a/gen/storagetransfer1-cli/src/main.rs b/gen/storagetransfer1-cli/src/main.rs index 7f5c8a7826..479ec8261e 100644 --- a/gen/storagetransfer1-cli/src/main.rs +++ b/gen/storagetransfer1-cli/src/main.rs @@ -147,10 +147,10 @@ impl<'n> Engine<'n> { "schedule.schedule-end-date.day" => Some(("schedule.scheduleEndDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.schedule-end-date.year" => Some(("schedule.scheduleEndDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modification-time" => Some(("lastModificationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["access-key-id", "aws-access-key", "aws-s3-data-source", "bucket-name", "creation-time", "day", "delete-objects-from-source-after-transfer", "delete-objects-unique-in-sink", "deletion-time", "description", "exclude-prefixes", "gcs-data-sink", "gcs-data-source", "hours", "http-data-source", "include-prefixes", "last-modification-time", "list-url", "max-time-elapsed-since-last-modification", "min-time-elapsed-since-last-modification", "minutes", "month", "name", "nanos", "object-conditions", "overwrite-objects-already-existing-in-sink", "project-id", "schedule", "schedule-end-date", "schedule-start-date", "seconds", "secret-access-key", "start-time-of-day", "status", "transfer-options", "transfer-spec", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -381,10 +381,10 @@ impl<'n> Engine<'n> { "transfer-job.schedule.schedule-end-date.day" => Some(("transferJob.schedule.scheduleEndDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-end-date.year" => Some(("transferJob.schedule.scheduleEndDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.project-id" => Some(("transferJob.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transfer-job.description" => Some(("transferJob.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.last-modification-time" => Some(("transferJob.lastModificationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.creation-time" => Some(("transferJob.creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.name" => Some(("transferJob.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.description" => Some(("transferJob.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["access-key-id", "aws-access-key", "aws-s3-data-source", "bucket-name", "creation-time", "day", "delete-objects-from-source-after-transfer", "delete-objects-unique-in-sink", "deletion-time", "description", "exclude-prefixes", "gcs-data-sink", "gcs-data-source", "hours", "http-data-source", "include-prefixes", "last-modification-time", "list-url", "max-time-elapsed-since-last-modification", "min-time-elapsed-since-last-modification", "minutes", "month", "name", "nanos", "object-conditions", "overwrite-objects-already-existing-in-sink", "project-id", "schedule", "schedule-end-date", "schedule-start-date", "seconds", "secret-access-key", "start-time-of-day", "status", "transfer-job", "transfer-options", "transfer-spec", "update-transfer-job-field-mask", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1182,8 +1182,13 @@ fn main() { Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. - NOTE: the `name` binding below allows API services to override the binding - to use different resource name schemes, such as `users/*/operations`."##), + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-operations_list", vec![ (Some(r##"name"##), @@ -1268,7 +1273,7 @@ fn main() { let mut app = App::new("storagetransfer1") .author("Sebastian Thiel ") - .version("1.0.6+20170515") + .version("1.0.6+20170921") .about("Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli") .arg(Arg::with_name("url") diff --git a/gen/storagetransfer1/Cargo.toml b/gen/storagetransfer1/Cargo.toml index c8d8007544..6493d4dd28 100644 --- a/gen/storagetransfer1/Cargo.toml +++ b/gen/storagetransfer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storagetransfer1" -version = "1.0.6+20170515" +version = "1.0.6+20170921" authors = ["Sebastian Thiel "] description = "A complete library to interact with storagetransfer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storagetransfer1" homepage = "https://cloud.google.com/storage/transfer" -documentation = "https://docs.rs/google-storagetransfer1/1.0.6+20170515" +documentation = "https://docs.rs/google-storagetransfer1/1.0.6+20170921" license = "MIT" keywords = ["storagetransfer", "google", "protocol", "web", "api"] diff --git a/gen/storagetransfer1/README.md b/gen/storagetransfer1/README.md index ce4a93f729..e34f9c13fc 100644 --- a/gen/storagetransfer1/README.md +++ b/gen/storagetransfer1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-storagetransfer1` library allows access to all features of the *Google storagetransfer* service. -This documentation was generated from *storagetransfer* crate version *1.0.6+20170515*, where *20170515* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *storagetransfer* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *storagetransfer* *v1* API can be found at the [official documentation site](https://cloud.google.com/storage/transfer). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.Storagetransfer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.Storagetransfer.html) ... -* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.GoogleServiceAccount.html) - * [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) -* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferJob.html) - * [*create*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferJobPatchCall.html) -* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperation.html) - * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*delete*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperationDeleteCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.TransferOperationResumeCall.html) +* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.GoogleServiceAccount.html) + * [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) +* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferJob.html) + * [*create*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferJobPatchCall.html) +* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperation.html) + * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*delete*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperationDeleteCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.TransferOperationResumeCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/struct.Storagetransfer.html)** +* **[Hub](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/struct.Storagetransfer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -128,17 +128,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/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")`. @@ -148,29 +148,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/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](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/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](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/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](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/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](https://docs.rs/google-storagetransfer1/1.0.6+20170515/google_storagetransfer1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/storagetransfer1/src/lib.rs b/gen/storagetransfer1/src/lib.rs index e46095c81a..003dcdb130 100644 --- a/gen/storagetransfer1/src/lib.rs +++ b/gen/storagetransfer1/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 *storagetransfer* crate version *1.0.6+20170515*, where *20170515* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *storagetransfer* crate version *1.0.6+20170921*, where *20170921* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *storagetransfer* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/storage/transfer). @@ -616,27 +616,26 @@ pub struct TransferOperation { impl Resource for TransferOperation {} -/// An AwsS3Data can be a data source, but not a data sink. -/// In an AwsS3Data, an object's name is the S3 object's key name. +/// Response from ListTransferJobs. /// -/// 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 transfer jobs](struct.TransferJobListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AwsS3Data { - /// AWS access key used to sign the API requests to the AWS S3 bucket. - /// Permissions on the bucket must be granted to the access ID of the - /// AWS access key. - /// Required. - #[serde(rename="awsAccessKey")] - pub aws_access_key: Option, - /// S3 Bucket name (see - /// [Creating a bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). - /// Required. - #[serde(rename="bucketName")] - pub bucket_name: Option, +pub struct ListTransferJobsResponse { + /// The list next page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of transfer jobs. + #[serde(rename="transferJobs")] + pub transfer_jobs: Option>, } -impl Part for AwsS3Data {} +impl ResponseResult for ListTransferJobsResponse {} /// An entry describing an error that has occurred. @@ -645,13 +644,13 @@ impl Part for AwsS3Data {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ErrorLogEntry { + /// A list of messages that carry the error details. + #[serde(rename="errorDetails")] + pub error_details: Option>, /// A URL that refers to the target (a data source, a data sink, /// or an object) with which the error is associated. /// Required. pub url: Option, - /// A list of messages that carry the error details. - #[serde(rename="errorDetails")] - pub error_details: Option>, } impl Part for ErrorLogEntry {} @@ -689,7 +688,7 @@ impl Part for GcsData {} /// * MD5 - The base64-encoded MD5 hash of the object. /// /// For an example of a valid TSV file, see -/// [Transferring data from URLs](https://cloud.google.com/storage/transfer/#urls) +/// [Transferring data from URLs](https://cloud.google.com/storage/transfer/create-url-list). /// /// When transferring data based on a URL list, keep the following in mind: /// @@ -844,8 +843,8 @@ pub struct Status { pub message: Option, /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a - /// common set of message types for APIs to use. + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. pub details: Option>>, } @@ -883,11 +882,11 @@ impl ResponseResult for GoogleServiceAccount {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListOperationsResponse { - /// A list of operations that matches the specified filter in the request. - pub operations: Option>, /// The standard List next-page token. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, } impl ResponseResult for ListOperationsResponse {} @@ -984,7 +983,10 @@ pub struct UpdateTransferJobRequest { /// with the error `INVALID_ARGUMENT`. #[serde(rename="updateTransferJobFieldMask")] pub update_transfer_job_field_mask: Option, - /// The job to update. + /// The job to update. `transferJob` is expected to specify only three fields: + /// `description`, `transferSpec`, and `status`. An UpdateTransferJobRequest + /// that specifies other fields will be rejected with an error + /// `INVALID_ARGUMENT`. /// Required. #[serde(rename="transferJob")] pub transfer_job: Option, @@ -993,26 +995,27 @@ pub struct UpdateTransferJobRequest { impl RequestValue for UpdateTransferJobRequest {} -/// Response from ListTransferJobs. +/// An AwsS3Data can be a data source, but not a data sink. +/// In an AwsS3Data, an object's name is the S3 object's key name. /// -/// # 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 transfer jobs](struct.TransferJobListCall.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 ListTransferJobsResponse { - /// The list next page token. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of transfer jobs. - #[serde(rename="transferJobs")] - pub transfer_jobs: Option>, +pub struct AwsS3Data { + /// AWS access key used to sign the API requests to the AWS S3 bucket. + /// Permissions on the bucket must be granted to the access ID of the + /// AWS access key. + /// Required. + #[serde(rename="awsAccessKey")] + pub aws_access_key: Option, + /// S3 Bucket name (see + /// [Creating a bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + /// Required. + #[serde(rename="bucketName")] + pub bucket_name: Option, } -impl ResponseResult for ListTransferJobsResponse {} +impl Part for AwsS3Data {} /// TransferOptions uses three boolean parameters to define the actions @@ -1026,10 +1029,13 @@ pub struct TransferOptions { #[serde(rename="overwriteObjectsAlreadyExistingInSink")] pub overwrite_objects_already_existing_in_sink: Option, /// Whether objects should be deleted from the source after they are - /// transferred to the sink. + /// transferred to the sink. Note that this option and + /// `deleteObjectsUniqueInSink` are mutually exclusive. #[serde(rename="deleteObjectsFromSourceAfterTransfer")] pub delete_objects_from_source_after_transfer: Option, - /// Whether objects that exist only in the sink should be deleted. + /// Whether objects that exist only in the sink should be deleted. Note that + /// this option and `deleteObjectsFromSourceAfterTransfer` are mutually + /// exclusive. #[serde(rename="deleteObjectsUniqueInSink")] pub delete_objects_unique_in_sink: Option, } @@ -1047,13 +1053,12 @@ impl Part for TransferOptions {} /// /// * [list transfer jobs](struct.TransferJobListCall.html) (none) /// * [create transfer jobs](struct.TransferJobCreateCall.html) (request|response) -/// * [get transfer jobs](struct.TransferJobGetCall.html) (response) /// * [patch transfer jobs](struct.TransferJobPatchCall.html) (response) +/// * [get transfer jobs](struct.TransferJobGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferJob { /// Transfer specification. - /// Required. #[serde(rename="transferSpec")] pub transfer_spec: Option, /// Status of the job. This value MUST be specified for @@ -1067,11 +1072,12 @@ pub struct TransferJob { /// This field cannot be changed by user requests. #[serde(rename="deletionTime")] pub deletion_time: Option, + /// A description provided by the user for the job. Its max length is 1024 + /// bytes when Unicode-encoded. + pub description: Option, /// Schedule specification. - /// Required. pub schedule: Option, /// The ID of the Google Cloud Platform Console project that owns the job. - /// Required. #[serde(rename="projectId")] pub project_id: Option, /// This field cannot be changed by user requests. @@ -1085,9 +1091,6 @@ pub struct TransferJob { /// transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` /// error. pub name: Option, - /// A description provided by the user for the job. Its max length is 1024 - /// bytes when Unicode-encoded. - pub description: Option, } impl RequestValue for TransferJob {} @@ -1135,7 +1138,7 @@ pub struct Operation { /// The error result of the operation in case of failure or cancellation. pub error: Option, /// If the value is `false`, it means the operation is still in progress. - /// If true, the operation is completed, and either `error` or `response` is + /// If `true`, the operation is completed, and either `error` or `response` is /// available. pub done: Option, /// The normal response of the operation in case of success. If the original @@ -1281,8 +1284,13 @@ impl<'a, C, A> TransferOperationMethods<'a, C, A> { /// Lists operations that match the specified filter in the request. If the /// server doesn't support this method, it returns `UNIMPLEMENTED`. /// - /// NOTE: the `name` binding below allows API services to override the binding - /// to use different resource name schemes, such as `users/*/operations`. + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. /// /// # Arguments /// @@ -1754,12 +1762,12 @@ impl<'a, C, A> TransferOperationPauseCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationPauseCall<'a, C, A> @@ -2039,12 +2047,12 @@ impl<'a, C, A> TransferOperationResumeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationResumeCall<'a, C, A> @@ -2292,12 +2300,12 @@ impl<'a, C, A> TransferOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationDeleteCall<'a, C, A> @@ -2547,12 +2555,12 @@ impl<'a, C, A> TransferOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationGetCall<'a, C, A> @@ -2590,8 +2598,13 @@ impl<'a, C, A> TransferOperationGetCall<'a, C, A> where C: BorrowMut TransferOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationListCall<'a, C, A> @@ -3093,12 +3106,12 @@ impl<'a, C, A> TransferOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationCancelCall<'a, C, A> @@ -3351,12 +3364,12 @@ impl<'a, C, A> GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GoogleServiceAccountGetCall<'a, C, A> @@ -3610,12 +3623,12 @@ impl<'a, C, A> TransferJobListCall<'a, C, A> where C: BorrowMut, /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> TransferJobListCall<'a, C, A> @@ -3897,12 +3910,12 @@ impl<'a, C, A> TransferJobPatchCall<'a, C, A> where C: BorrowMut, /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> TransferJobPatchCall<'a, C, A> @@ -4164,12 +4177,12 @@ impl<'a, C, A> TransferJobGetCall<'a, C, A> where C: BorrowMut, A /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> TransferJobGetCall<'a, C, A> @@ -4411,12 +4424,12 @@ impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> TransferJobCreateCall<'a, C, A> diff --git a/gen/streetviewpublish1-cli/Cargo.toml b/gen/streetviewpublish1-cli/Cargo.toml new file mode 100644 index 0000000000..2f58290233 --- /dev/null +++ b/gen/streetviewpublish1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-streetviewpublish1-cli" +version = "1.0.6+20170925" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Street View Publish (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/streetviewpublish1-cli" +homepage = "https://developers.google.com/streetview/publish/" +documentation = "http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli" +license = "MIT" +keywords = ["streetviewpublish", "google", "cli"] + +[[bin]] +name = "streetviewpublish1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-streetviewpublish1] +path = "../streetviewpublish1" +version = "1.0.6+20170925" diff --git a/gen/streetviewpublish1-cli/LICENSE.md b/gen/streetviewpublish1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/streetviewpublish1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/streetviewpublish1-cli/README.md b/gen/streetviewpublish1-cli/README.md new file mode 100644 index 0000000000..123f6ed6fb --- /dev/null +++ b/gen/streetviewpublish1-cli/README.md @@ -0,0 +1,123 @@ + +The `streetviewpublish1` command-line interface *(CLI)* allows to use most features of the *Google Street View Publish* 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 *Street View Publish* API can be found at the +[official documentation site](https://developers.google.com/streetview/publish/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-streetviewpublish1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/streetviewpublish1-cli). + +# Usage + +This documentation was generated from the *Street View Publish* API at revision *20170925*. The CLI is at version *1.0.6*. + +```bash +streetviewpublish1 [options] + photo + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + start-upload (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + photos + batch-delete (-r )... [-p ]... [-o ] + batch-get [-p ]... [-o ] + batch-update (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + streetviewpublish1 --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 `streetviewpublish1-`. 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/streetviewpublish1-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/streetviewpublish1-secret.json`, assuming that the required *streetviewpublish* 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. `streetviewpublish1 --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/streetviewpublish1-cli/mkdocs.yml b/gen/streetviewpublish1-cli/mkdocs.yml new file mode 100644 index 0000000000..fecc685b1d --- /dev/null +++ b/gen/streetviewpublish1-cli/mkdocs.yml @@ -0,0 +1,25 @@ +site_name: Street View Publish v1.0.6+20170925 +site_url: http://byron.github.io/google-apis-rs/google-streetviewpublish1-cli +site_description: A complete library to interact with Street View Publish (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/streetviewpublish1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['photo_create.md', 'Photo', 'Create'] +- ['photo_delete.md', 'Photo', 'Delete'] +- ['photo_get.md', 'Photo', 'Get'] +- ['photo_start-upload.md', 'Photo', 'Start Upload'] +- ['photo_update.md', 'Photo', 'Update'] +- ['photos_batch-delete.md', 'Photos', 'Batch Delete'] +- ['photos_batch-get.md', 'Photos', 'Batch Get'] +- ['photos_batch-update.md', 'Photos', 'Batch Update'] +- ['photos_list.md', 'Photos', 'List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/streetviewpublish1-cli/src/cmn.rs b/gen/streetviewpublish1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/streetviewpublish1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/streetviewpublish1-cli/src/main.rs b/gen/streetviewpublish1-cli/src/main.rs new file mode 100644 index 0000000000..6ccbc97837 --- /dev/null +++ b/gen/streetviewpublish1-cli/src/main.rs @@ -0,0 +1,1285 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_streetviewpublish1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::StreetViewPublish>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _photo_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "view-count" => Some(("viewCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "photo-id.id" => Some(("photoId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "upload-reference.upload-url" => Some(("uploadReference.uploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pose.lat-lng-pair.latitude" => Some(("pose.latLngPair.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.lat-lng-pair.longitude" => Some(("pose.latLngPair.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.level.number" => Some(("pose.level.number", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.level.name" => Some(("pose.level.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pose.altitude" => Some(("pose.altitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.heading" => Some(("pose.heading", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.pitch" => Some(("pose.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.roll" => Some(("pose.roll", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "download-url" => Some(("downloadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "capture-time" => Some(("captureTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "thumbnail-url" => Some(("thumbnailUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "share-link" => Some(("shareLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "capture-time", "download-url", "heading", "id", "lat-lng-pair", "latitude", "level", "longitude", "name", "number", "photo-id", "pitch", "pose", "roll", "share-link", "thumbnail-url", "upload-reference", "upload-url", "view-count"]); + 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::Photo = json::value::from_value(object).unwrap(); + let mut call = self.hub.photo().create(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photo_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.photo().delete(opt.value_of("photo-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photo_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.photo().get(opt.value_of("photo-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(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(["view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photo_start_upload(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Empty = json::value::from_value(object).unwrap(); + let mut call = self.hub.photo().start_upload(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photo_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "view-count" => Some(("viewCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "photo-id.id" => Some(("photoId.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "upload-reference.upload-url" => Some(("uploadReference.uploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pose.lat-lng-pair.latitude" => Some(("pose.latLngPair.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.lat-lng-pair.longitude" => Some(("pose.latLngPair.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.level.number" => Some(("pose.level.number", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.level.name" => Some(("pose.level.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pose.altitude" => Some(("pose.altitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.heading" => Some(("pose.heading", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.pitch" => Some(("pose.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "pose.roll" => Some(("pose.roll", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "download-url" => Some(("downloadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "capture-time" => Some(("captureTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "thumbnail-url" => Some(("thumbnailUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "share-link" => Some(("shareLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "capture-time", "download-url", "heading", "id", "lat-lng-pair", "latitude", "level", "longitude", "name", "number", "photo-id", "pitch", "pose", "roll", "share-link", "thumbnail-url", "upload-reference", "upload-url", "view-count"]); + 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::Photo = json::value::from_value(object).unwrap(); + let mut call = self.hub.photo().update(request, opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photos_batch_delete(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "photo-ids" => Some(("photoIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["photo-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchDeletePhotosRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.photos().batch_delete(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photos_batch_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.photos().batch_get(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "photo-ids" => { + call = call.add_photo_ids(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(["photo-ids", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photos_batch_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchUpdatePhotosRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.photos().batch_update(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _photos_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.photos().list(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "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", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("photo", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._photo_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._photo_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._photo_get(opt, dry_run, &mut err); + }, + ("start-upload", Some(opt)) => { + call_result = self._photo_start_upload(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._photo_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("photo".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("photos", Some(opt)) => { + match opt.subcommand() { + ("batch-delete", Some(opt)) => { + call_result = self._photos_batch_delete(opt, dry_run, &mut err); + }, + ("batch-get", Some(opt)) => { + call_result = self._photos_batch_get(opt, dry_run, &mut err); + }, + ("batch-update", Some(opt)) => { + call_result = self._photos_batch_update(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._photos_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("photos".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<'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, "streetviewpublish1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "streetviewpublish1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::StreetViewPublish::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 = [ + ("photo", "methods: 'create', 'delete', 'get', 'start-upload' and 'update'", vec![ + ("create", + Some(r##"After the client finishes uploading the photo with the returned + UploadRef, + CreatePhoto + publishes the uploaded Photo to + Street View on Google Maps. + + This method returns the following error codes: + + * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. + * google.rpc.Code.NOT_FOUND if the upload reference does not exist. + * google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the + storage limit."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photo_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a Photo and its metadata. + + This method returns the following error codes: + + * google.rpc.Code.PERMISSION_DENIED if the requesting user did not + create the requested photo. + * google.rpc.Code.NOT_FOUND if the photo ID does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photo_delete", + vec![ + (Some(r##"photo-id"##), + None, + Some(r##"Required. ID of the Photo."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets the metadata of the specified + Photo. + + This method returns the following error codes: + + * google.rpc.Code.PERMISSION_DENIED if the requesting user did not + create the requested Photo. + * google.rpc.Code.NOT_FOUND if the requested + Photo does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photo_get", + vec![ + (Some(r##"photo-id"##), + None, + Some(r##"Required. ID of the Photo."##), + 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)), + ]), + ("start-upload", + Some(r##"Creates an upload session to start uploading photo bytes. The upload URL of + the returned UploadRef is used to + upload the bytes for the Photo. + + In addition to the photo requirements shown in + https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, + the photo must also meet the following requirements: + + * Photo Sphere XMP metadata must be included in the photo medadata. See + https://developers.google.com/streetview/spherical-metadata for the + required fields. + * The pixel size of the photo must meet the size requirements listed in + https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and + the photo must be a full 360 horizontally. + + After the upload is complete, the + UploadRef is used with + CreatePhoto + to create the Photo object entry."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photo_start-upload", + 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)), + ]), + ("update", + Some(r##"Updates the metadata of a Photo, such + as pose, place association, connections, etc. Changing the pixels of a + photo is not supported. + + Only the fields specified in the + updateMask + field are used. If `updateMask` is not present, the update applies to all + fields. + + + + This method returns the following error codes: + + * google.rpc.Code.PERMISSION_DENIED if the requesting user did not + create the requested photo. + * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. + * google.rpc.Code.NOT_FOUND if the requested photo does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photo_update", + vec![ + (Some(r##"id"##), + None, + Some(r##"Required. A unique identifier for a photo."##), + 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)), + ]), + ]), + + ("photos", "methods: 'batch-delete', 'batch-get', 'batch-update' and 'list'", vec![ + ("batch-delete", + Some(r##"Deletes a list of Photos and their + metadata. + + Note that if + BatchDeletePhotos + fails, either critical fields are missing or there was an authentication + error. Even if + BatchDeletePhotos + succeeds, there may have been failures for single photos in the batch. + These failures will be specified in each + PhotoResponse.status + in + BatchDeletePhotosResponse.results. + See + DeletePhoto + for specific failures that can occur per photo."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photos_batch-delete", + 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)), + ]), + ("batch-get", + Some(r##"Gets the metadata of the specified + Photo batch. + + Note that if + BatchGetPhotos + fails, either critical fields are missing or there was an authentication + error. Even if + BatchGetPhotos + succeeds, there may have been failures for single photos in the batch. + These failures will be specified in each + PhotoResponse.status + in + BatchGetPhotosResponse.results. + See + GetPhoto + for specific failures that can occur per photo."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photos_batch-get", + 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)), + ]), + ("batch-update", + Some(r##"Updates the metadata of Photos, such + as pose, place association, connections, etc. Changing the pixels of photos + is not supported. + + Note that if + BatchUpdatePhotos + fails, either critical fields are missing or there was an authentication + error. Even if + BatchUpdatePhotos + succeeds, there may have been failures for single photos in the batch. + These failures will be specified in each + PhotoResponse.status + in + BatchUpdatePhotosResponse.results. + See + UpdatePhoto + for specific failures that can occur per photo. + + Only the fields specified in + updateMask + field are used. If `updateMask` is not present, the update applies to all + fields. + + "##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photos_batch-update", + 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)), + ]), + ("list", + Some(r##"Lists all the Photos that belong to + the user."##), + "Details at http://byron.github.io/google-apis-rs/google_streetviewpublish1_cli/photos_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)), + ]), + ]), + + ]; + + let mut app = App::new("streetviewpublish1") + .author("Sebastian Thiel ") + .version("1.0.6+20170925") + .about("Publishes 360 photos to Google Maps, along with position, orientation, and connectivity metadata. Apps can offer an interface for positioning, connecting, and uploading user-generated Street View images. + ") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_streetviewpublish1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/streetviewpublish1/Cargo.toml b/gen/streetviewpublish1/Cargo.toml new file mode 100644 index 0000000000..ccabd72c2f --- /dev/null +++ b/gen/streetviewpublish1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-streetviewpublish1" +version = "1.0.6+20170925" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Street View Publish (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/streetviewpublish1" +homepage = "https://developers.google.com/streetview/publish/" +documentation = "https://docs.rs/google-streetviewpublish1/1.0.6+20170925" +license = "MIT" +keywords = ["streetviewpublish", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/streetviewpublish1/LICENSE.md b/gen/streetviewpublish1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/streetviewpublish1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/streetviewpublish1/README.md b/gen/streetviewpublish1/README.md new file mode 100644 index 0000000000..be31219975 --- /dev/null +++ b/gen/streetviewpublish1/README.md @@ -0,0 +1,186 @@ + +The `google-streetviewpublish1` library allows access to all features of the *Google Street View Publish* service. + +This documentation was generated from *Street View Publish* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *streetviewpublish:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Street View Publish* *v1* API can be found at the +[official documentation site](https://developers.google.com/streetview/publish/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.StreetViewPublish.html) ... + +* [photo](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.Photo.html) + * [*create*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoCreateCall.html), [*delete*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoDeleteCall.html), [*get*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoGetCall.html), [*start upload*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoStartUploadCall.html) and [*update*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoUpdateCall.html) +* [photos](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.Photo.html) + * [*batch delete*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoBatchDeleteCall.html), [*batch get*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoBatchGetCall.html), [*batch update*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoBatchUpdateCall.html) and [*list*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.PhotoListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/struct.StreetViewPublish.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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.photo().create(...).doit() +let r = hub.photos().batch_update(...).doit() +let r = hub.photos().list(...).doit() +let r = hub.photo().update(...).doit() +let r = hub.photos().batch_delete(...).doit() +let r = hub.photo().get(...).doit() +let r = hub.photos().batch_get(...).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-streetviewpublish1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_streetviewpublish1 as streetviewpublish1; +use streetviewpublish1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use streetviewpublish1::StreetViewPublish; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photos().list() + .view("eirmod") + .page_token("sit") + .page_size(-65) + .filter("sed") + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} + +``` +## Handling Errors + +All errors produced by the system are provided either as [Result](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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](https://docs.rs/google-streetviewpublish1/1.0.6+20170925/google_streetviewpublish1/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 **streetviewpublish1** 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-rsblob/master/LICENSE.md diff --git a/gen/streetviewpublish1/src/cmn.rs b/gen/streetviewpublish1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/streetviewpublish1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/streetviewpublish1/src/lib.rs b/gen/streetviewpublish1/src/lib.rs new file mode 100644 index 0000000000..53e6270066 --- /dev/null +++ b/gen/streetviewpublish1/src/lib.rs @@ -0,0 +1,3716 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Street View Publish* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *streetviewpublish:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Street View Publish* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/streetview/publish/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/streetviewpublish1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.StreetViewPublish.html) ... +//! +//! * [photo](struct.Photo.html) +//! * [*create*](struct.PhotoCreateCall.html), [*delete*](struct.PhotoDeleteCall.html), [*get*](struct.PhotoGetCall.html), [*start upload*](struct.PhotoStartUploadCall.html) and [*update*](struct.PhotoUpdateCall.html) +//! * [photos](struct.Photo.html) +//! * [*batch delete*](struct.PhotoBatchDeleteCall.html), [*batch get*](struct.PhotoBatchGetCall.html), [*batch update*](struct.PhotoBatchUpdateCall.html) and [*list*](struct.PhotoListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.StreetViewPublish.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.photo().create(...).doit() +//! let r = hub.photos().batch_update(...).doit() +//! let r = hub.photos().list(...).doit() +//! let r = hub.photo().update(...).doit() +//! let r = hub.photos().batch_delete(...).doit() +//! let r = hub.photo().get(...).doit() +//! let r = hub.photos().batch_get(...).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-streetviewpublish1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_streetviewpublish1 as streetviewpublish1; +//! use streetviewpublish1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use streetviewpublish1::StreetViewPublish; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photos().list() +//! .view("et") +//! .page_token("dolores") +//! .page_size(-63) +//! .filter("accusam") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## 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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Publish and manage your 360 photos on Google Street View + Full, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Full => "https://www.googleapis.com/auth/streetviewpublish", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Full + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all StreetViewPublish related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_streetviewpublish1 as streetviewpublish1; +/// use streetviewpublish1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use streetviewpublish1::StreetViewPublish; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photos().list() +/// .view("takimata") +/// .page_token("justo") +/// .page_size(-1) +/// .filter("erat") +/// .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 StreetViewPublish { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for StreetViewPublish {} + +impl<'a, C, A> StreetViewPublish + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> StreetViewPublish { + StreetViewPublish { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://streetviewpublish.googleapis.com/".to_string(), + _root_url: "https://streetviewpublish.googleapis.com/".to_string(), + } + } + + pub fn photo(&'a self) -> PhotoMethods<'a, C, A> { + PhotoMethods { hub: &self } + } + pub fn photos(&'a self) -> PhotoMethods<'a, C, A> { + PhotoMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://streetviewpublish.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://streetviewpublish.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Identifier for a Photo. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PhotoId { + /// Required. A unique identifier for a photo. + pub id: Option, +} + +impl Part for PhotoId {} + + +/// Level information containing level number and its corresponding name. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Level { + /// Floor number, used for ordering. 0 indicates the ground level, 1 indicates + /// the first level above ground level, -1 indicates the first level under + /// ground level. Non-integer values are OK. + pub number: Option, + /// Required. A name assigned to this Level, restricted to 3 characters. + /// Consider how the elevator buttons would be labeled for this level if there + /// was an elevator. + pub name: Option, +} + +impl Part for Level {} + + +/// Request to update the metadata of photos. +/// Updating the pixels of photos is not supported. +/// +/// # 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*). +/// +/// * [batch update photos](struct.PhotoBatchUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUpdatePhotosRequest { + /// Required. List of + /// UpdatePhotoRequests. + #[serde(rename="updatePhotoRequests")] + pub update_photo_requests: Option>, +} + +impl RequestValue for BatchUpdatePhotosRequest {} + + +/// Response to batch update of metadata of one or more +/// Photos. +/// +/// # 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*). +/// +/// * [batch update photos](struct.PhotoBatchUpdateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUpdatePhotosResponse { + /// List of results for each individual + /// Photo updated, in the same order as + /// the request. + pub results: Option>, +} + +impl ResponseResult for BatchUpdatePhotosResponse {} + + +/// A connection is the link from a source photo to a destination photo. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Connection { + /// Required. The destination of the connection from the containing photo to + /// another photo. + pub target: Option, +} + +impl Part for Connection {} + + +/// Place metadata for an entity. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Place { + /// Place identifier, as described in + /// https://developers.google.com/places/place-id. + #[serde(rename="placeId")] + pub place_id: Option, +} + +impl Part for Place {} + + +/// Upload reference for media files. +/// +/// # 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*). +/// +/// * [start upload photo](struct.PhotoStartUploadCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UploadRef { + /// Required. An upload reference should be unique for each user. It follows + /// the form: + /// "https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{upload_reference}" + #[serde(rename="uploadUrl")] + pub upload_url: Option, +} + +impl ResponseResult for UploadRef {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete photo](struct.PhotoDeleteCall.html) (response) +/// * [start upload photo](struct.PhotoStartUploadCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl RequestValue for Empty {} +impl ResponseResult for Empty {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// Response to batch delete of one or more +/// Photos. +/// +/// # 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*). +/// +/// * [batch delete photos](struct.PhotoBatchDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeletePhotosResponse { + /// The status for the operation to delete a single + /// Photo in the batch request. + pub status: Option>, +} + +impl ResponseResult for BatchDeletePhotosResponse {} + + +/// Response to batch get of Photos. +/// +/// # 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*). +/// +/// * [batch get photos](struct.PhotoBatchGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchGetPhotosResponse { + /// List of results for each individual + /// Photo requested, in the same order as + /// the requests in + /// BatchGetPhotos. + pub results: Option>, +} + +impl ResponseResult for BatchGetPhotosResponse {} + + +/// Photo is used to store 360 photos along with photo metadata. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create photo](struct.PhotoCreateCall.html) (request|response) +/// * [batch update photos](struct.PhotoBatchUpdateCall.html) (none) +/// * [list photos](struct.PhotoListCall.html) (none) +/// * [update photo](struct.PhotoUpdateCall.html) (request|response) +/// * [batch delete photos](struct.PhotoBatchDeleteCall.html) (none) +/// * [get photo](struct.PhotoGetCall.html) (response) +/// * [batch get photos](struct.PhotoBatchGetCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Photo { + /// Output only. View count of the photo. + #[serde(rename="viewCount")] + pub view_count: Option, + /// Required when updating a photo. Output only when creating a photo. + /// Identifier for the photo, which is unique among all photos in + /// Google. + #[serde(rename="photoId")] + pub photo_id: Option, + /// Required when creating a photo. Input only. The resource URL where the + /// photo bytes are uploaded to. + #[serde(rename="uploadReference")] + pub upload_reference: Option, + /// Places where this photo belongs. + pub places: Option>, + /// Output only. The download URL for the photo bytes. This field is set only + /// when + /// GetPhotoRequest.view + /// is set to + /// PhotoView.INCLUDE_DOWNLOAD_URL. + #[serde(rename="downloadUrl")] + pub download_url: Option, + /// Pose of the photo. + pub pose: Option, + /// Connections to other photos. A connection represents the link from this + /// photo to another photo. + pub connections: Option>, + /// Absolute time when the photo was captured. + /// When the photo has no exif timestamp, this is used to set a timestamp in + /// the photo metadata. + #[serde(rename="captureTime")] + pub capture_time: Option, + /// Output only. The thumbnail URL for showing a preview of the given photo. + #[serde(rename="thumbnailUrl")] + pub thumbnail_url: Option, + /// Output only. The share link for the photo. + #[serde(rename="shareLink")] + pub share_link: Option, +} + +impl RequestValue for Photo {} +impl Resource for Photo {} +impl ResponseResult for Photo {} + + +/// An object representing a latitude/longitude pair. This is expressed as a pair +/// of doubles representing degrees latitude and degrees longitude. Unless +/// specified otherwise, this must conform to the +/// WGS84 +/// standard. Values must be within normalized ranges. +/// +/// Example of normalization code in Python: +/// +/// def NormalizeLongitude(longitude): +/// """Wraps decimal degrees longitude to [-180.0, 180.0].""" +/// q, r = divmod(longitude, 360.0) +/// if r > 180.0 or (r == 180.0 and q <= -1.0): +/// return r - 360.0 +/// return r +/// +/// def NormalizeLatLng(latitude, longitude): +/// """Wraps decimal degrees latitude and longitude to +/// [-90.0, 90.0] and [-180.0, 180.0], respectively.""" +/// r = latitude % 360.0 +/// if r <= 90.0: +/// return r, NormalizeLongitude(longitude) +/// elif r >= 270.0: +/// return r - 360, NormalizeLongitude(longitude) +/// else: +/// return 180 - r, NormalizeLongitude(longitude + 180.0) +/// +/// assert 180.0 == NormalizeLongitude(180.0) +/// assert -180.0 == NormalizeLongitude(-180.0) +/// assert -179.0 == NormalizeLongitude(181.0) +/// assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) +/// assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) +/// assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) +/// assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) +/// assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) +/// assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) +/// assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) +/// assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) +/// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) +/// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LatLng { + /// The latitude in degrees. It must be in the range [-90.0, +90.0]. + pub latitude: Option, + /// The longitude in degrees. It must be in the range [-180.0, +180.0]. + pub longitude: Option, +} + +impl Part for LatLng {} + + +/// Raw pose measurement for an entity. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Pose { + /// Latitude and longitude pair of the pose, as explained here: + /// https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng + /// When creating a Photo, if the + /// latitude and longitude pair are not provided here, the geolocation from the + /// exif header will be used. If the latitude and longitude pair is not + /// provided and cannot be found in the exif header, the create photo process + /// will fail. + #[serde(rename="latLngPair")] + pub lat_lng_pair: Option, + /// Level (the floor in a building) used to configure vertical navigation. + pub level: Option, + /// Altitude of the pose in meters above ground level (as defined by WGS84). + /// NaN indicates an unmeasured quantity. + pub altitude: Option, + /// Pitch, measured at the center of the photo in degrees. Value must be >=-90 + /// and <= 90. A value of -90 means looking directly down, and a value of 90 + /// means looking directly up. + /// NaN indicates an unmeasured quantity. + pub pitch: Option, + /// Compass heading, measured at the center of the photo in degrees clockwise + /// from North. Value must be >=0 and <360. + /// NaN indicates an unmeasured quantity. + pub heading: Option, + /// Roll, measured in degrees. Value must be >= 0 and <360. A value of 0 + /// means level with the horizon. + /// NaN indicates an unmeasured quantity. + pub roll: Option, +} + +impl Part for Pose {} + + +/// Response payload for a single +/// Photo +/// in batch operations including +/// BatchGetPhotos +/// and +/// BatchUpdatePhotos. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PhotoResponse { + /// The status for the operation to get or update a single photo in the batch + /// request. + pub status: Option, + /// The Photo resource, if the request + /// was successful. + pub photo: Option, +} + +impl Part for PhotoResponse {} + + +/// Response to list all photos that belong to a user. +/// +/// # 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 photos](struct.PhotoListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListPhotosResponse { + /// Token to retrieve the next page of results, or empty if there are no more + /// results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of photos. The maximum number of items returned is based on the + /// pageSize field + /// in the request. + pub photos: Option>, +} + +impl ResponseResult for ListPhotosResponse {} + + +/// Request to update the metadata of a +/// Photo. Updating the pixels of a photo +/// is not supported. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdatePhotoRequest { + /// Required. Photo object containing the + /// new metadata. + pub photo: Option, + /// Mask that identifies fields on the photo metadata to update. + /// If not present, the old Photo + /// metadata will be entirely replaced with the + /// new Photo metadata in this request. + /// The update fails if invalid fields are specified. Multiple fields can be + /// specified in a comma-delimited list. + /// + /// The following fields are valid: + /// + /// * `pose.heading` + /// * `pose.latLngPair` + /// * `pose.pitch` + /// * `pose.roll` + /// * `pose.level` + /// * `pose.altitude` + /// * `connections` + /// * `places` + /// + /// + /// + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl Part for UpdatePhotoRequest {} + + +/// Request to delete multiple Photos. +/// +/// # 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*). +/// +/// * [batch delete photos](struct.PhotoBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeletePhotosRequest { + /// Required. IDs of the Photos. For HTTP + /// GET requests, the URL query parameter should be + /// `photoIds=&photoIds=&...`. + #[serde(rename="photoIds")] + pub photo_ids: Option>, +} + +impl RequestValue for BatchDeletePhotosRequest {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *photo* resources. +/// It is not used directly, but through the `StreetViewPublish` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_streetviewpublish1 as streetviewpublish1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use streetviewpublish1::StreetViewPublish; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `batch_delete(...)`, `batch_get(...)`, `batch_update(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.photos(); +/// # } +/// ``` +pub struct PhotoMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, +} + +impl<'a, C, A> MethodsBuilder for PhotoMethods<'a, C, A> {} + +impl<'a, C, A> PhotoMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all the Photos that belong to + /// the user. + pub fn list(&self) -> PhotoListCall<'a, C, A> { + PhotoListCall { + hub: self.hub, + _view: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the metadata of Photos, such + /// as pose, place association, connections, etc. Changing the pixels of photos + /// is not supported. + /// + /// Note that if + /// BatchUpdatePhotos + /// fails, either critical fields are missing or there was an authentication + /// error. Even if + /// BatchUpdatePhotos + /// succeeds, there may have been failures for single photos in the batch. + /// These failures will be specified in each + /// PhotoResponse.status + /// in + /// BatchUpdatePhotosResponse.results. + /// See + /// UpdatePhoto + /// for specific failures that can occur per photo. + /// + /// Only the fields specified in + /// updateMask + /// field are used. If `updateMask` is not present, the update applies to all + /// fields. + /// + /// + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn batch_update(&self, request: BatchUpdatePhotosRequest) -> PhotoBatchUpdateCall<'a, C, A> { + PhotoBatchUpdateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a list of Photos and their + /// metadata. + /// + /// Note that if + /// BatchDeletePhotos + /// fails, either critical fields are missing or there was an authentication + /// error. Even if + /// BatchDeletePhotos + /// succeeds, there may have been failures for single photos in the batch. + /// These failures will be specified in each + /// PhotoResponse.status + /// in + /// BatchDeletePhotosResponse.results. + /// See + /// DeletePhoto + /// for specific failures that can occur per photo. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn batch_delete(&self, request: BatchDeletePhotosRequest) -> PhotoBatchDeleteCall<'a, C, A> { + PhotoBatchDeleteCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the metadata of the specified + /// Photo batch. + /// + /// Note that if + /// BatchGetPhotos + /// fails, either critical fields are missing or there was an authentication + /// error. Even if + /// BatchGetPhotos + /// succeeds, there may have been failures for single photos in the batch. + /// These failures will be specified in each + /// PhotoResponse.status + /// in + /// BatchGetPhotosResponse.results. + /// See + /// GetPhoto + /// for specific failures that can occur per photo. + pub fn batch_get(&self) -> PhotoBatchGetCall<'a, C, A> { + PhotoBatchGetCall { + hub: self.hub, + _view: Default::default(), + _photo_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *photo* resources. +/// It is not used directly, but through the `StreetViewPublish` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_streetviewpublish1 as streetviewpublish1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use streetviewpublish1::StreetViewPublish; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `start_upload(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.photo(); +/// # } +/// ``` +pub struct PhotoMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, +} + +impl<'a, C, A> MethodsBuilder for PhotoMethods<'a, C, A> {} + +impl<'a, C, A> PhotoMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// After the client finishes uploading the photo with the returned + /// UploadRef, + /// CreatePhoto + /// publishes the uploaded Photo to + /// Street View on Google Maps. + /// + /// This method returns the following error codes: + /// + /// * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. + /// * google.rpc.Code.NOT_FOUND if the upload reference does not exist. + /// * google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the + /// storage limit. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Photo) -> PhotoCreateCall<'a, C, A> { + PhotoCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a Photo and its metadata. + /// + /// This method returns the following error codes: + /// + /// * google.rpc.Code.PERMISSION_DENIED if the requesting user did not + /// create the requested photo. + /// * google.rpc.Code.NOT_FOUND if the photo ID does not exist. + /// + /// # Arguments + /// + /// * `photoId` - Required. ID of the Photo. + pub fn delete(&self, photo_id: &str) -> PhotoDeleteCall<'a, C, A> { + PhotoDeleteCall { + hub: self.hub, + _photo_id: photo_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 metadata of a Photo, such + /// as pose, place association, connections, etc. Changing the pixels of a + /// photo is not supported. + /// + /// Only the fields specified in the + /// updateMask + /// field are used. If `updateMask` is not present, the update applies to all + /// fields. + /// + /// + /// + /// This method returns the following error codes: + /// + /// * google.rpc.Code.PERMISSION_DENIED if the requesting user did not + /// create the requested photo. + /// * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. + /// * google.rpc.Code.NOT_FOUND if the requested photo does not exist. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `id` - Required. A unique identifier for a photo. + pub fn update(&self, request: Photo, id: &str) -> PhotoUpdateCall<'a, C, A> { + PhotoUpdateCall { + hub: self.hub, + _request: request, + _id: id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an upload session to start uploading photo bytes. The upload URL of + /// the returned UploadRef is used to + /// upload the bytes for the Photo. + /// + /// In addition to the photo requirements shown in + /// https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, + /// the photo must also meet the following requirements: + /// + /// * Photo Sphere XMP metadata must be included in the photo medadata. See + /// https://developers.google.com/streetview/spherical-metadata for the + /// required fields. + /// * The pixel size of the photo must meet the size requirements listed in + /// https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and + /// the photo must be a full 360 horizontally. + /// + /// After the upload is complete, the + /// UploadRef is used with + /// CreatePhoto + /// to create the Photo object entry. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn start_upload(&self, request: Empty) -> PhotoStartUploadCall<'a, C, A> { + PhotoStartUploadCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the metadata of the specified + /// Photo. + /// + /// This method returns the following error codes: + /// + /// * google.rpc.Code.PERMISSION_DENIED if the requesting user did not + /// create the requested Photo. + /// * google.rpc.Code.NOT_FOUND if the requested + /// Photo does not exist. + /// + /// # Arguments + /// + /// * `photoId` - Required. ID of the Photo. + pub fn get(&self, photo_id: &str) -> PhotoGetCall<'a, C, A> { + PhotoGetCall { + hub: self.hub, + _photo_id: photo_id.to_string(), + _view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Lists all the Photos that belong to +/// the user. +/// +/// A builder for the *list* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photos().list() +/// .view("labore") +/// .page_token("sea") +/// .page_size(-90) +/// .filter("dolores") +/// .doit(); +/// # } +/// ``` +pub struct PhotoListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _view: Option, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoListCall<'a, C, A> {} + +impl<'a, C, A> PhotoListCall<'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, ListPhotosResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photos.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "view", "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 = self.hub._base_url.clone() + "v1/photos"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Specifies if a download URL for the photos bytes should be returned in the + /// Photos response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> PhotoListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// The + /// nextPageToken + /// value returned from a previous + /// ListPhotos + /// request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> PhotoListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of photos to return. + /// `pageSize` must be non-negative. If `pageSize` is zero or is not provided, + /// the default page size of 100 will be used. + /// The number of photos returned in the response may be less than `pageSize` + /// if the number of photos that belong to the user is less than `pageSize`. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> PhotoListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> PhotoListCall<'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) -> PhotoListCall<'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) -> PhotoListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the metadata of Photos, such +/// as pose, place association, connections, etc. Changing the pixels of photos +/// is not supported. +/// +/// Note that if +/// BatchUpdatePhotos +/// fails, either critical fields are missing or there was an authentication +/// error. Even if +/// BatchUpdatePhotos +/// succeeds, there may have been failures for single photos in the batch. +/// These failures will be specified in each +/// PhotoResponse.status +/// in +/// BatchUpdatePhotosResponse.results. +/// See +/// UpdatePhoto +/// for specific failures that can occur per photo. +/// +/// Only the fields specified in +/// updateMask +/// field are used. If `updateMask` is not present, the update applies to all +/// fields. +/// +/// +/// +/// A builder for the *batchUpdate* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// use streetviewpublish1::BatchUpdatePhotosRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = BatchUpdatePhotosRequest::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.photos().batch_update(req) +/// .doit(); +/// # } +/// ``` +pub struct PhotoBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _request: BatchUpdatePhotosRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> PhotoBatchUpdateCall<'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, BatchUpdatePhotosResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photos.batchUpdate", + 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 = self.hub._base_url.clone() + "v1/photos:batchUpdate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: BatchUpdatePhotosRequest) -> PhotoBatchUpdateCall<'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) -> PhotoBatchUpdateCall<'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) -> PhotoBatchUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoBatchUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a list of Photos and their +/// metadata. +/// +/// Note that if +/// BatchDeletePhotos +/// fails, either critical fields are missing or there was an authentication +/// error. Even if +/// BatchDeletePhotos +/// succeeds, there may have been failures for single photos in the batch. +/// These failures will be specified in each +/// PhotoResponse.status +/// in +/// BatchDeletePhotosResponse.results. +/// See +/// DeletePhoto +/// for specific failures that can occur per photo. +/// +/// A builder for the *batchDelete* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// use streetviewpublish1::BatchDeletePhotosRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = BatchDeletePhotosRequest::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.photos().batch_delete(req) +/// .doit(); +/// # } +/// ``` +pub struct PhotoBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _request: BatchDeletePhotosRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> PhotoBatchDeleteCall<'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, BatchDeletePhotosResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photos.batchDelete", + 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 = self.hub._base_url.clone() + "v1/photos:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: BatchDeletePhotosRequest) -> PhotoBatchDeleteCall<'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) -> PhotoBatchDeleteCall<'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) -> PhotoBatchDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the metadata of the specified +/// Photo batch. +/// +/// Note that if +/// BatchGetPhotos +/// fails, either critical fields are missing or there was an authentication +/// error. Even if +/// BatchGetPhotos +/// succeeds, there may have been failures for single photos in the batch. +/// These failures will be specified in each +/// PhotoResponse.status +/// in +/// BatchGetPhotosResponse.results. +/// See +/// GetPhoto +/// for specific failures that can occur per photo. +/// +/// A builder for the *batchGet* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photos().batch_get() +/// .view("gubergren") +/// .add_photo_ids("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct PhotoBatchGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _view: Option, + _photo_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoBatchGetCall<'a, C, A> {} + +impl<'a, C, A> PhotoBatchGetCall<'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, BatchGetPhotosResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photos.batchGet", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if self._photo_ids.len() > 0 { + for f in self._photo_ids.iter() { + params.push(("photoIds", f.to_string())); + } + } + for &field in ["alt", "view", "photoIds"].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 = self.hub._base_url.clone() + "v1/photos:batchGet"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Specifies if a download URL for the photo bytes should be returned in the + /// Photo response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> PhotoBatchGetCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// Required. IDs of the Photos. For HTTP + /// GET requests, the URL query parameter should be + /// `photoIds=&photoIds=&...`. + /// + /// Append the given value to the *photo ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_photo_ids(mut self, new_value: &str) -> PhotoBatchGetCall<'a, C, A> { + self._photo_ids.push(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) -> PhotoBatchGetCall<'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) -> PhotoBatchGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoBatchGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// After the client finishes uploading the photo with the returned +/// UploadRef, +/// CreatePhoto +/// publishes the uploaded Photo to +/// Street View on Google Maps. +/// +/// This method returns the following error codes: +/// +/// * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. +/// * google.rpc.Code.NOT_FOUND if the upload reference does not exist. +/// * google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the +/// storage limit. +/// +/// A builder for the *create* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// use streetviewpublish1::Photo; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Photo::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.photo().create(req) +/// .doit(); +/// # } +/// ``` +pub struct PhotoCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _request: Photo, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoCreateCall<'a, C, A> {} + +impl<'a, C, A> PhotoCreateCall<'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, Photo)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photo.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 = self.hub._base_url.clone() + "v1/photo"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Photo) -> PhotoCreateCall<'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) -> PhotoCreateCall<'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) -> PhotoCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a Photo and its metadata. +/// +/// This method returns the following error codes: +/// +/// * google.rpc.Code.PERMISSION_DENIED if the requesting user did not +/// create the requested photo. +/// * google.rpc.Code.NOT_FOUND if the photo ID does not exist. +/// +/// A builder for the *delete* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photo().delete("photoId") +/// .doit(); +/// # } +/// ``` +pub struct PhotoDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _photo_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoDeleteCall<'a, C, A> {} + +impl<'a, C, A> PhotoDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photo.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("photoId", self._photo_id.to_string())); + for &field in ["alt", "photoId"].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 = self.hub._base_url.clone() + "v1/photo/{photoId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{photoId}", "photoId")].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 ["photoId"].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(Bearer { 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(d); + 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(d); + 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. ID of the Photo. + /// + /// Sets the *photo 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 photo_id(mut self, new_value: &str) -> PhotoDeleteCall<'a, C, A> { + self._photo_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) -> PhotoDeleteCall<'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) -> PhotoDeleteCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the metadata of a Photo, such +/// as pose, place association, connections, etc. Changing the pixels of a +/// photo is not supported. +/// +/// Only the fields specified in the +/// updateMask +/// field are used. If `updateMask` is not present, the update applies to all +/// fields. +/// +/// +/// +/// This method returns the following error codes: +/// +/// * google.rpc.Code.PERMISSION_DENIED if the requesting user did not +/// create the requested photo. +/// * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. +/// * google.rpc.Code.NOT_FOUND if the requested photo does not exist. +/// +/// A builder for the *update* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// use streetviewpublish1::Photo; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Photo::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.photo().update(req, "id") +/// .update_mask("no") +/// .doit(); +/// # } +/// ``` +pub struct PhotoUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _request: Photo, + _id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoUpdateCall<'a, C, A> {} + +impl<'a, C, A> PhotoUpdateCall<'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, Photo)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photo.update", + http_method: hyper::method::Method::Put }); + 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._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "id", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/photo/{id}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{id}", "id")].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 ["id"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Photo) -> PhotoUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. A unique identifier for a photo. + /// + /// Sets the *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 id(mut self, new_value: &str) -> PhotoUpdateCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// Mask that identifies fields on the photo metadata to update. + /// If not present, the old Photo + /// metadata will be entirely replaced with the + /// new Photo metadata in this request. + /// The update fails if invalid fields are specified. Multiple fields can be + /// specified in a comma-delimited list. + /// + /// The following fields are valid: + /// + /// * `pose.heading` + /// * `pose.latLngPair` + /// * `pose.pitch` + /// * `pose.roll` + /// * `pose.level` + /// * `pose.altitude` + /// * `connections` + /// * `places` + /// + /// + /// + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> PhotoUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> PhotoUpdateCall<'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) -> PhotoUpdateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an upload session to start uploading photo bytes. The upload URL of +/// the returned UploadRef is used to +/// upload the bytes for the Photo. +/// +/// In addition to the photo requirements shown in +/// https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, +/// the photo must also meet the following requirements: +/// +/// * Photo Sphere XMP metadata must be included in the photo medadata. See +/// https://developers.google.com/streetview/spherical-metadata for the +/// required fields. +/// * The pixel size of the photo must meet the size requirements listed in +/// https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and +/// the photo must be a full 360 horizontally. +/// +/// After the upload is complete, the +/// UploadRef is used with +/// CreatePhoto +/// to create the Photo object entry. +/// +/// A builder for the *startUpload* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// use streetviewpublish1::Empty; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Empty::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.photo().start_upload(req) +/// .doit(); +/// # } +/// ``` +pub struct PhotoStartUploadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _request: Empty, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoStartUploadCall<'a, C, A> {} + +impl<'a, C, A> PhotoStartUploadCall<'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, UploadRef)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photo.startUpload", + 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 = self.hub._base_url.clone() + "v1/photo:startUpload"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Empty) -> PhotoStartUploadCall<'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) -> PhotoStartUploadCall<'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) -> PhotoStartUploadCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoStartUploadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the metadata of the specified +/// Photo. +/// +/// This method returns the following error codes: +/// +/// * google.rpc.Code.PERMISSION_DENIED if the requesting user did not +/// create the requested Photo. +/// * google.rpc.Code.NOT_FOUND if the requested +/// Photo does not exist. +/// +/// A builder for the *get* method supported by a *photo* resource. +/// It is not used directly, but through a `PhotoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_streetviewpublish1 as streetviewpublish1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use streetviewpublish1::StreetViewPublish; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = StreetViewPublish::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.photo().get("photoId") +/// .view("justo") +/// .doit(); +/// # } +/// ``` +pub struct PhotoGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a StreetViewPublish, + _photo_id: String, + _view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PhotoGetCall<'a, C, A> {} + +impl<'a, C, A> PhotoGetCall<'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, Photo)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "streetviewpublish.photo.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("photoId", self._photo_id.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + for &field in ["alt", "photoId", "view"].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 = self.hub._base_url.clone() + "v1/photo/{photoId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{photoId}", "photoId")].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 ["photoId"].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(Bearer { 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(d); + 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(d); + 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. ID of the Photo. + /// + /// Sets the *photo 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 photo_id(mut self, new_value: &str) -> PhotoGetCall<'a, C, A> { + self._photo_id = new_value.to_string(); + self + } + /// Specifies if a download URL for the photo bytes should be returned in the + /// Photo response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> PhotoGetCall<'a, C, A> { + self._view = 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) -> PhotoGetCall<'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) -> PhotoGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> PhotoGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/tagmanager2-cli/Cargo.toml b/gen/tagmanager2-cli/Cargo.toml new file mode 100644 index 0000000000..7251480ff1 --- /dev/null +++ b/gen/tagmanager2-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-tagmanager2-cli" +version = "1.0.6+20170915" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Tag Manager (protocol v2)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2-cli" +homepage = "https://developers.google.com/tag-manager/api/v2/" +documentation = "http://byron.github.io/google-apis-rs/google_tagmanager2_cli" +license = "MIT" +keywords = ["tagmanager", "google", "cli"] + +[[bin]] +name = "tagmanager2" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-tagmanager2] +path = "../tagmanager2" +version = "1.0.6+20170915" diff --git a/gen/tagmanager2-cli/LICENSE.md b/gen/tagmanager2-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/tagmanager2-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/tagmanager2-cli/README.md b/gen/tagmanager2-cli/README.md new file mode 100644 index 0000000000..2b9b7531ea --- /dev/null +++ b/gen/tagmanager2-cli/README.md @@ -0,0 +1,186 @@ + +The `tagmanager2` command-line interface *(CLI)* allows to use most features of the *Google Tag 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 *Tag Manager* API can be found at the +[official documentation site](https://developers.google.com/tag-manager/api/v2/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-tagmanager2-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2-cli). + +# Usage + +This documentation was generated from the *Tag Manager* API at revision *20170915*. The CLI is at version *1.0.6*. + +```bash +tagmanager2 [options] + accounts + containers-create (-r )... [-p ]... [-o ] + containers-delete [-p ]... + containers-environments-create (-r )... [-p ]... [-o ] + containers-environments-delete [-p ]... + containers-environments-get [-p ]... [-o ] + containers-environments-list [-p ]... [-o ] + containers-environments-patch (-r )... [-p ]... [-o ] + containers-environments-reauthorize (-r )... [-p ]... [-o ] + containers-environments-update (-r )... [-p ]... [-o ] + containers-get [-p ]... [-o ] + containers-list [-p ]... [-o ] + containers-update (-r )... [-p ]... [-o ] + containers-version-headers-latest [-p ]... [-o ] + containers-version-headers-list [-p ]... [-o ] + containers-versions-delete [-p ]... + containers-versions-get [-p ]... [-o ] + containers-versions-live [-p ]... [-o ] + containers-versions-publish [-p ]... [-o ] + containers-versions-set-latest [-p ]... [-o ] + containers-versions-undelete [-p ]... [-o ] + containers-versions-update (-r )... [-p ]... [-o ] + containers-workspaces-built-in-variables-create [-p ]... [-o ] + containers-workspaces-built-in-variables-delete [-p ]... + containers-workspaces-built-in-variables-list [-p ]... [-o ] + containers-workspaces-built-in-variables-revert [-p ]... [-o ] + containers-workspaces-create (-r )... [-p ]... [-o ] + containers-workspaces-create-version (-r )... [-p ]... [-o ] + containers-workspaces-delete [-p ]... + containers-workspaces-folders-create (-r )... [-p ]... [-o ] + containers-workspaces-folders-delete [-p ]... + containers-workspaces-folders-entities [-p ]... [-o ] + containers-workspaces-folders-get [-p ]... [-o ] + containers-workspaces-folders-list [-p ]... [-o ] + containers-workspaces-folders-move-entities-to-folder (-r )... [-p ]... + containers-workspaces-folders-revert [-p ]... [-o ] + containers-workspaces-folders-update (-r )... [-p ]... [-o ] + containers-workspaces-get [-p ]... [-o ] + containers-workspaces-get-proposal [-p ]... [-o ] + containers-workspaces-get-status [-p ]... [-o ] + containers-workspaces-list [-p ]... [-o ] + containers-workspaces-proposal-create (-r )... [-p ]... [-o ] + containers-workspaces-proposal-delete [-p ]... + containers-workspaces-quick-preview [-p ]... [-o ] + containers-workspaces-resolve-conflict (-r )... [-p ]... + containers-workspaces-sync [-p ]... [-o ] + containers-workspaces-tags-create (-r )... [-p ]... [-o ] + containers-workspaces-tags-delete [-p ]... + containers-workspaces-tags-get [-p ]... [-o ] + containers-workspaces-tags-list [-p ]... [-o ] + containers-workspaces-tags-revert [-p ]... [-o ] + containers-workspaces-tags-update (-r )... [-p ]... [-o ] + containers-workspaces-triggers-create (-r )... [-p ]... [-o ] + containers-workspaces-triggers-delete [-p ]... + containers-workspaces-triggers-get [-p ]... [-o ] + containers-workspaces-triggers-list [-p ]... [-o ] + containers-workspaces-triggers-revert [-p ]... [-o ] + containers-workspaces-triggers-update (-r )... [-p ]... [-o ] + containers-workspaces-update (-r )... [-p ]... [-o ] + containers-workspaces-update-proposal (-r )... [-p ]... [-o ] + containers-workspaces-variables-create (-r )... [-p ]... [-o ] + containers-workspaces-variables-delete [-p ]... + containers-workspaces-variables-get [-p ]... [-o ] + containers-workspaces-variables-list [-p ]... [-o ] + containers-workspaces-variables-revert [-p ]... [-o ] + containers-workspaces-variables-update (-r )... [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + user-permissions-create (-r )... [-p ]... [-o ] + user-permissions-delete [-p ]... + user-permissions-get [-p ]... [-o ] + user-permissions-list [-p ]... [-o ] + user-permissions-update (-r )... [-p ]... [-o ] + tagmanager2 --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 `tagmanager2-`. 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/tagmanager2-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/tagmanager2-secret.json`, assuming that the required *tagmanager* 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. `tagmanager2 --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/tagmanager2-cli/mkdocs.yml b/gen/tagmanager2-cli/mkdocs.yml new file mode 100644 index 0000000000..d5c147a0b6 --- /dev/null +++ b/gen/tagmanager2-cli/mkdocs.yml @@ -0,0 +1,89 @@ +site_name: Tag Manager v1.0.6+20170915 +site_url: http://byron.github.io/google-apis-rs/google-tagmanager2-cli +site_description: A complete library to interact with Tag Manager (protocol v2) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['accounts_containers-create.md', 'Accounts', 'Containers Create'] +- ['accounts_containers-delete.md', 'Accounts', 'Containers Delete'] +- ['accounts_containers-environments-create.md', 'Accounts', 'Containers Environments Create'] +- ['accounts_containers-environments-delete.md', 'Accounts', 'Containers Environments Delete'] +- ['accounts_containers-environments-get.md', 'Accounts', 'Containers Environments Get'] +- ['accounts_containers-environments-list.md', 'Accounts', 'Containers Environments List'] +- ['accounts_containers-environments-patch.md', 'Accounts', 'Containers Environments Patch'] +- ['accounts_containers-environments-reauthorize.md', 'Accounts', 'Containers Environments Reauthorize'] +- ['accounts_containers-environments-update.md', 'Accounts', 'Containers Environments Update'] +- ['accounts_containers-get.md', 'Accounts', 'Containers Get'] +- ['accounts_containers-list.md', 'Accounts', 'Containers List'] +- ['accounts_containers-update.md', 'Accounts', 'Containers Update'] +- ['accounts_containers-version-headers-latest.md', 'Accounts', 'Containers Version Headers Latest'] +- ['accounts_containers-version-headers-list.md', 'Accounts', 'Containers Version Headers List'] +- ['accounts_containers-versions-delete.md', 'Accounts', 'Containers Versions Delete'] +- ['accounts_containers-versions-get.md', 'Accounts', 'Containers Versions Get'] +- ['accounts_containers-versions-live.md', 'Accounts', 'Containers Versions Live'] +- ['accounts_containers-versions-publish.md', 'Accounts', 'Containers Versions Publish'] +- ['accounts_containers-versions-set-latest.md', 'Accounts', 'Containers Versions Set Latest'] +- ['accounts_containers-versions-undelete.md', 'Accounts', 'Containers Versions Undelete'] +- ['accounts_containers-versions-update.md', 'Accounts', 'Containers Versions Update'] +- ['accounts_containers-workspaces-built-in-variables-create.md', 'Accounts', 'Containers Workspaces Built In Variables Create'] +- ['accounts_containers-workspaces-built-in-variables-delete.md', 'Accounts', 'Containers Workspaces Built In Variables Delete'] +- ['accounts_containers-workspaces-built-in-variables-list.md', 'Accounts', 'Containers Workspaces Built In Variables List'] +- ['accounts_containers-workspaces-built-in-variables-revert.md', 'Accounts', 'Containers Workspaces Built In Variables Revert'] +- ['accounts_containers-workspaces-create.md', 'Accounts', 'Containers Workspaces Create'] +- ['accounts_containers-workspaces-create-version.md', 'Accounts', 'Containers Workspaces Create Version'] +- ['accounts_containers-workspaces-delete.md', 'Accounts', 'Containers Workspaces Delete'] +- ['accounts_containers-workspaces-folders-create.md', 'Accounts', 'Containers Workspaces Folders Create'] +- ['accounts_containers-workspaces-folders-delete.md', 'Accounts', 'Containers Workspaces Folders Delete'] +- ['accounts_containers-workspaces-folders-entities.md', 'Accounts', 'Containers Workspaces Folders Entities'] +- ['accounts_containers-workspaces-folders-get.md', 'Accounts', 'Containers Workspaces Folders Get'] +- ['accounts_containers-workspaces-folders-list.md', 'Accounts', 'Containers Workspaces Folders List'] +- ['accounts_containers-workspaces-folders-move-entities-to-folder.md', 'Accounts', 'Containers Workspaces Folders Move Entities To Folder'] +- ['accounts_containers-workspaces-folders-revert.md', 'Accounts', 'Containers Workspaces Folders Revert'] +- ['accounts_containers-workspaces-folders-update.md', 'Accounts', 'Containers Workspaces Folders Update'] +- ['accounts_containers-workspaces-get.md', 'Accounts', 'Containers Workspaces Get'] +- ['accounts_containers-workspaces-get-proposal.md', 'Accounts', 'Containers Workspaces Get Proposal'] +- ['accounts_containers-workspaces-get-status.md', 'Accounts', 'Containers Workspaces Get Status'] +- ['accounts_containers-workspaces-list.md', 'Accounts', 'Containers Workspaces List'] +- ['accounts_containers-workspaces-proposal-create.md', 'Accounts', 'Containers Workspaces Proposal Create'] +- ['accounts_containers-workspaces-proposal-delete.md', 'Accounts', 'Containers Workspaces Proposal Delete'] +- ['accounts_containers-workspaces-quick-preview.md', 'Accounts', 'Containers Workspaces Quick Preview'] +- ['accounts_containers-workspaces-resolve-conflict.md', 'Accounts', 'Containers Workspaces Resolve Conflict'] +- ['accounts_containers-workspaces-sync.md', 'Accounts', 'Containers Workspaces Sync'] +- ['accounts_containers-workspaces-tags-create.md', 'Accounts', 'Containers Workspaces Tags Create'] +- ['accounts_containers-workspaces-tags-delete.md', 'Accounts', 'Containers Workspaces Tags Delete'] +- ['accounts_containers-workspaces-tags-get.md', 'Accounts', 'Containers Workspaces Tags Get'] +- ['accounts_containers-workspaces-tags-list.md', 'Accounts', 'Containers Workspaces Tags List'] +- ['accounts_containers-workspaces-tags-revert.md', 'Accounts', 'Containers Workspaces Tags Revert'] +- ['accounts_containers-workspaces-tags-update.md', 'Accounts', 'Containers Workspaces Tags Update'] +- ['accounts_containers-workspaces-triggers-create.md', 'Accounts', 'Containers Workspaces Triggers Create'] +- ['accounts_containers-workspaces-triggers-delete.md', 'Accounts', 'Containers Workspaces Triggers Delete'] +- ['accounts_containers-workspaces-triggers-get.md', 'Accounts', 'Containers Workspaces Triggers Get'] +- ['accounts_containers-workspaces-triggers-list.md', 'Accounts', 'Containers Workspaces Triggers List'] +- ['accounts_containers-workspaces-triggers-revert.md', 'Accounts', 'Containers Workspaces Triggers Revert'] +- ['accounts_containers-workspaces-triggers-update.md', 'Accounts', 'Containers Workspaces Triggers Update'] +- ['accounts_containers-workspaces-update.md', 'Accounts', 'Containers Workspaces Update'] +- ['accounts_containers-workspaces-update-proposal.md', 'Accounts', 'Containers Workspaces Update Proposal'] +- ['accounts_containers-workspaces-variables-create.md', 'Accounts', 'Containers Workspaces Variables Create'] +- ['accounts_containers-workspaces-variables-delete.md', 'Accounts', 'Containers Workspaces Variables Delete'] +- ['accounts_containers-workspaces-variables-get.md', 'Accounts', 'Containers Workspaces Variables Get'] +- ['accounts_containers-workspaces-variables-list.md', 'Accounts', 'Containers Workspaces Variables List'] +- ['accounts_containers-workspaces-variables-revert.md', 'Accounts', 'Containers Workspaces Variables Revert'] +- ['accounts_containers-workspaces-variables-update.md', 'Accounts', 'Containers Workspaces Variables Update'] +- ['accounts_get.md', 'Accounts', 'Get'] +- ['accounts_list.md', 'Accounts', 'List'] +- ['accounts_update.md', 'Accounts', 'Update'] +- ['accounts_user-permissions-create.md', 'Accounts', 'User Permissions Create'] +- ['accounts_user-permissions-delete.md', 'Accounts', 'User Permissions Delete'] +- ['accounts_user-permissions-get.md', 'Accounts', 'User Permissions Get'] +- ['accounts_user-permissions-list.md', 'Accounts', 'User Permissions List'] +- ['accounts_user-permissions-update.md', 'Accounts', 'User Permissions Update'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/tagmanager2-cli/src/cmn.rs b/gen/tagmanager2-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/tagmanager2-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/tagmanager2-cli/src/main.rs b/gen/tagmanager2-cli/src/main.rs new file mode 100644 index 0000000000..b431a56db8 --- /dev/null +++ b/gen/tagmanager2-cli/src/main.rs @@ -0,0 +1,7229 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_tagmanager2 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::TagManager>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _accounts_containers_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "public-id" => Some(("publicId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "domain-name" => Some(("domainName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "usage-context" => Some(("usageContext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", 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!["account-id", "container-id", "domain-name", "fingerprint", "name", "notes", "path", "public-id", "tag-manager-url", "usage-context"]); + 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::Container = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_environments_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "authorization-code" => Some(("authorizationCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-version-id" => Some(("containerVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Environment = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_environments_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_environments_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_environments_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_environments_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_environments_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_environments_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_environments_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_environments_patch(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "authorization-code" => Some(("authorizationCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-version-id" => Some(("containerVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Environment = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_environments_patch(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_environments_reauthorize(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "authorization-code" => Some(("authorizationCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-version-id" => Some(("containerVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Environment = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_environments_reauthorize(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_environments_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "authorization-code" => Some(("authorizationCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-version-id" => Some(("containerVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Environment = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_environments_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "public-id" => Some(("publicId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "domain-name" => Some(("domainName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "usage-context" => Some(("usageContext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", 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!["account-id", "container-id", "domain-name", "fingerprint", "name", "notes", "path", "public-id", "tag-manager-url", "usage-context"]); + 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::Container = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_version_headers_latest(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_version_headers_latest(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_version_headers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_version_headers_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + "include-deleted" => { + call = call.include_deleted(arg_from_str(value.unwrap_or("false"), err, "include-deleted", "boolean")); + }, + _ => { + 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(["page-token", "include-deleted"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_versions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_versions_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_versions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_versions_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "container-version-id" => { + call = call.container_version_id(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(["container-version-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_versions_live(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_versions_live(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_versions_publish(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_versions_publish(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_versions_set_latest(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_versions_set_latest(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_versions_undelete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_versions_undelete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_versions_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "container.public-id" => Some(("container.publicId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.container-id" => Some(("container.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.domain-name" => Some(("container.domainName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "container.notes" => Some(("container.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.tag-manager-url" => Some(("container.tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.usage-context" => Some(("container.usageContext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "container.fingerprint" => Some(("container.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.path" => Some(("container.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.account-id" => Some(("container.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container.name" => Some(("container.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-version-id" => Some(("containerVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", 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", "container", "container-id", "container-version-id", "deleted", "description", "domain-name", "fingerprint", "name", "notes", "path", "public-id", "tag-manager-url", "usage-context"]); + 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::ContainerVersion = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_versions_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_built_in_variables_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_built_in_variables_create(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.add_type(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(["type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_built_in_variables_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_built_in_variables_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.add_type(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(["type"].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").map(|i|i.collect()).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 _accounts_containers_workspaces_built_in_variables_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_built_in_variables_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_built_in_variables_revert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_built_in_variables_revert(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.type_(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(["type"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "description", "fingerprint", "name", "path", "tag-manager-url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Workspace = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_create_version(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "notes" => Some(("notes", 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!["name", "notes"]); + 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::CreateContainerVersionRequestVersionOptions = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_create_version(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_workspaces_folders_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder-id" => Some(("folderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", 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!["account-id", "container-id", "fingerprint", "folder-id", "name", "notes", "path", "tag-manager-url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Folder = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_folders_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_folders_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_folders_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_workspaces_folders_entities(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_folders_entities(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_folders_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_folders_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_folders_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_folders_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_folders_move_entities_to_folder(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder-id" => Some(("folderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", 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!["account-id", "container-id", "fingerprint", "folder-id", "name", "notes", "path", "tag-manager-url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Folder = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_folders_move_entities_to_folder(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "variable-id" => { + call = call.add_variable_id(value.unwrap_or("")); + }, + "trigger-id" => { + call = call.add_trigger_id(value.unwrap_or("")); + }, + "tag-id" => { + call = call.add_tag_id(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(["trigger-id", "tag-id", "variable-id"].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").map(|i|i.collect()).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 _accounts_containers_workspaces_folders_revert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_folders_revert(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_folders_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder-id" => Some(("folderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", 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!["account-id", "container-id", "fingerprint", "folder-id", "name", "notes", "path", "tag-manager-url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Folder = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_folders_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_get_proposal(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_get_proposal(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_get_status(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_get_status(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_proposal_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "initial-comment.content" => Some(("initialComment.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content", "initial-comment"]); + 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::CreateWorkspaceProposalRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_proposal_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_proposal_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_proposal_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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); + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok(mut response) => { + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_quick_preview(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_quick_preview(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_resolve_conflict(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "variable.schedule-start-ms" => Some(("variable.scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.schedule-end-ms" => Some(("variable.scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.variable-id" => Some(("variable.variableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.notes" => Some(("variable.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.name" => Some(("variable.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.enabling-trigger-id" => Some(("variable.enablingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "variable.workspace-id" => Some(("variable.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.tag-manager-url" => Some(("variable.tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.fingerprint" => Some(("variable.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.path" => Some(("variable.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.account-id" => Some(("variable.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.type" => Some(("variable.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.parent-folder-id" => Some(("variable.parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable.disabling-trigger-id" => Some(("variable.disablingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "variable.container-id" => Some(("variable.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "change-status" => Some(("changeStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.max-timer-length-seconds.type" => Some(("trigger.maxTimerLengthSeconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.max-timer-length-seconds.value" => Some(("trigger.maxTimerLengthSeconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.max-timer-length-seconds.key" => Some(("trigger.maxTimerLengthSeconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.total-time-min-milliseconds.type" => Some(("trigger.totalTimeMinMilliseconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.total-time-min-milliseconds.value" => Some(("trigger.totalTimeMinMilliseconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.total-time-min-milliseconds.key" => Some(("trigger.totalTimeMinMilliseconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.unique-trigger-id.type" => Some(("trigger.uniqueTriggerId.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.unique-trigger-id.value" => Some(("trigger.uniqueTriggerId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.unique-trigger-id.key" => Some(("trigger.uniqueTriggerId.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.vertical-scroll-percentage-list.type" => Some(("trigger.verticalScrollPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.vertical-scroll-percentage-list.value" => Some(("trigger.verticalScrollPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.vertical-scroll-percentage-list.key" => Some(("trigger.verticalScrollPercentageList.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.horizontal-scroll-percentage-list.type" => Some(("trigger.horizontalScrollPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.horizontal-scroll-percentage-list.value" => Some(("trigger.horizontalScrollPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.horizontal-scroll-percentage-list.key" => Some(("trigger.horizontalScrollPercentageList.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.container-id" => Some(("trigger.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.wait-for-tags.type" => Some(("trigger.waitForTags.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.wait-for-tags.value" => Some(("trigger.waitForTags.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.wait-for-tags.key" => Some(("trigger.waitForTags.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.interval-seconds.type" => Some(("trigger.intervalSeconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.interval-seconds.value" => Some(("trigger.intervalSeconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.interval-seconds.key" => Some(("trigger.intervalSeconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.event-name.type" => Some(("trigger.eventName.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.event-name.value" => Some(("trigger.eventName.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.event-name.key" => Some(("trigger.eventName.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visibility-selector.type" => Some(("trigger.visibilitySelector.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visibility-selector.value" => Some(("trigger.visibilitySelector.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visibility-selector.key" => Some(("trigger.visibilitySelector.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.workspace-id" => Some(("trigger.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.account-id" => Some(("trigger.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.type" => Some(("trigger.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.parent-folder-id" => Some(("trigger.parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.continuous-time-min-milliseconds.type" => Some(("trigger.continuousTimeMinMilliseconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.continuous-time-min-milliseconds.value" => Some(("trigger.continuousTimeMinMilliseconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.continuous-time-min-milliseconds.key" => Some(("trigger.continuousTimeMinMilliseconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.selector.type" => Some(("trigger.selector.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.selector.value" => Some(("trigger.selector.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.selector.key" => Some(("trigger.selector.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.trigger-id" => Some(("trigger.triggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.tag-manager-url" => Some(("trigger.tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.fingerprint" => Some(("trigger.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visible-percentage-max.type" => Some(("trigger.visiblePercentageMax.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visible-percentage-max.value" => Some(("trigger.visiblePercentageMax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visible-percentage-max.key" => Some(("trigger.visiblePercentageMax.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.path" => Some(("trigger.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.name" => Some(("trigger.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visible-percentage-min.type" => Some(("trigger.visiblePercentageMin.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visible-percentage-min.value" => Some(("trigger.visiblePercentageMin.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.visible-percentage-min.key" => Some(("trigger.visiblePercentageMin.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.notes" => Some(("trigger.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.interval.type" => Some(("trigger.interval.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.interval.value" => Some(("trigger.interval.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.interval.key" => Some(("trigger.interval.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.wait-for-tags-timeout.type" => Some(("trigger.waitForTagsTimeout.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.wait-for-tags-timeout.value" => Some(("trigger.waitForTagsTimeout.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.wait-for-tags-timeout.key" => Some(("trigger.waitForTagsTimeout.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.limit.type" => Some(("trigger.limit.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.limit.value" => Some(("trigger.limit.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.limit.key" => Some(("trigger.limit.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.check-validation.type" => Some(("trigger.checkValidation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.check-validation.value" => Some(("trigger.checkValidation.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger.check-validation.key" => Some(("trigger.checkValidation.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.schedule-start-ms" => Some(("tag.scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.schedule-end-ms" => Some(("tag.scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.container-id" => Some(("tag.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.blocking-trigger-id" => Some(("tag.blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag.tag-firing-option" => Some(("tag.tagFiringOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.tag-id" => Some(("tag.tagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.parent-folder-id" => Some(("tag.parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.name" => Some(("tag.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.priority.type" => Some(("tag.priority.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.priority.value" => Some(("tag.priority.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.priority.key" => Some(("tag.priority.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.blocking-rule-id" => Some(("tag.blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag.workspace-id" => Some(("tag.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.live-only" => Some(("tag.liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag.tag-manager-url" => Some(("tag.tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.fingerprint" => Some(("tag.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.firing-rule-id" => Some(("tag.firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag.path" => Some(("tag.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.firing-trigger-id" => Some(("tag.firingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag.type" => Some(("tag.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.notes" => Some(("tag.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.account-id" => Some(("tag.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.container-id" => Some(("folder.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.notes" => Some(("folder.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.workspace-id" => Some(("folder.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.tag-manager-url" => Some(("folder.tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.fingerprint" => Some(("folder.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.path" => Some(("folder.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.folder-id" => Some(("folder.folderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.account-id" => Some(("folder.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "folder.name" => Some(("folder.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "change-status", "check-validation", "container-id", "continuous-time-min-milliseconds", "disabling-trigger-id", "enabling-trigger-id", "event-name", "fingerprint", "firing-rule-id", "firing-trigger-id", "folder", "folder-id", "horizontal-scroll-percentage-list", "interval", "interval-seconds", "key", "limit", "live-only", "max-timer-length-seconds", "name", "notes", "parent-folder-id", "path", "priority", "schedule-end-ms", "schedule-start-ms", "selector", "tag", "tag-firing-option", "tag-id", "tag-manager-url", "total-time-min-milliseconds", "trigger", "trigger-id", "type", "unique-trigger-id", "value", "variable", "variable-id", "vertical-scroll-percentage-list", "visibility-selector", "visible-percentage-max", "visible-percentage-min", "wait-for-tags", "wait-for-tags-timeout", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Entity = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_resolve_conflict(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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 _accounts_containers_workspaces_sync(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_sync(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_tags_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-start-ms" => Some(("scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule-end-ms" => Some(("scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "blocking-trigger-id" => Some(("blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag-firing-option" => Some(("tagFiringOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-id" => Some(("tagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "priority.type" => Some(("priority.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "priority.value" => Some(("priority.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "priority.key" => Some(("priority.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "blocking-rule-id" => Some(("blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "firing-rule-id" => Some(("firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "firing-trigger-id" => Some(("firingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", 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", "blocking-rule-id", "blocking-trigger-id", "container-id", "fingerprint", "firing-rule-id", "firing-trigger-id", "key", "live-only", "name", "notes", "parent-folder-id", "path", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "tag-manager-url", "type", "value", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Tag = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_tags_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_tags_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_tags_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_workspaces_tags_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_tags_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_tags_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_tags_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_tags_revert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_tags_revert(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_tags_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-start-ms" => Some(("scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule-end-ms" => Some(("scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "blocking-trigger-id" => Some(("blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag-firing-option" => Some(("tagFiringOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-id" => Some(("tagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "priority.type" => Some(("priority.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "priority.value" => Some(("priority.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "priority.key" => Some(("priority.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "blocking-rule-id" => Some(("blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "firing-rule-id" => Some(("firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "firing-trigger-id" => Some(("firingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", 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", "blocking-rule-id", "blocking-trigger-id", "container-id", "fingerprint", "firing-rule-id", "firing-trigger-id", "key", "live-only", "name", "notes", "parent-folder-id", "path", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "tag-manager-url", "type", "value", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Tag = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_tags_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_triggers_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "max-timer-length-seconds.type" => Some(("maxTimerLengthSeconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-timer-length-seconds.value" => Some(("maxTimerLengthSeconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-timer-length-seconds.key" => Some(("maxTimerLengthSeconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-time-min-milliseconds.type" => Some(("totalTimeMinMilliseconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-time-min-milliseconds.value" => Some(("totalTimeMinMilliseconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-time-min-milliseconds.key" => Some(("totalTimeMinMilliseconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-trigger-id.type" => Some(("uniqueTriggerId.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-trigger-id.value" => Some(("uniqueTriggerId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-trigger-id.key" => Some(("uniqueTriggerId.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vertical-scroll-percentage-list.type" => Some(("verticalScrollPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vertical-scroll-percentage-list.value" => Some(("verticalScrollPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vertical-scroll-percentage-list.key" => Some(("verticalScrollPercentageList.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "horizontal-scroll-percentage-list.type" => Some(("horizontalScrollPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "horizontal-scroll-percentage-list.value" => Some(("horizontalScrollPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "horizontal-scroll-percentage-list.key" => Some(("horizontalScrollPercentageList.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags.type" => Some(("waitForTags.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags.value" => Some(("waitForTags.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags.key" => Some(("waitForTags.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval-seconds.type" => Some(("intervalSeconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval-seconds.value" => Some(("intervalSeconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval-seconds.key" => Some(("intervalSeconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-name.type" => Some(("eventName.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-name.value" => Some(("eventName.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-name.key" => Some(("eventName.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visibility-selector.type" => Some(("visibilitySelector.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visibility-selector.value" => Some(("visibilitySelector.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visibility-selector.key" => Some(("visibilitySelector.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continuous-time-min-milliseconds.type" => Some(("continuousTimeMinMilliseconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continuous-time-min-milliseconds.value" => Some(("continuousTimeMinMilliseconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continuous-time-min-milliseconds.key" => Some(("continuousTimeMinMilliseconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selector.type" => Some(("selector.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selector.value" => Some(("selector.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selector.key" => Some(("selector.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger-id" => Some(("triggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-max.type" => Some(("visiblePercentageMax.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-max.value" => Some(("visiblePercentageMax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-max.key" => Some(("visiblePercentageMax.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-min.type" => Some(("visiblePercentageMin.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-min.value" => Some(("visiblePercentageMin.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-min.key" => Some(("visiblePercentageMin.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval.type" => Some(("interval.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval.value" => Some(("interval.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval.key" => Some(("interval.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags-timeout.type" => Some(("waitForTagsTimeout.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags-timeout.value" => Some(("waitForTagsTimeout.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags-timeout.key" => Some(("waitForTagsTimeout.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit.type" => Some(("limit.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit.value" => Some(("limit.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit.key" => Some(("limit.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-validation.type" => Some(("checkValidation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-validation.value" => Some(("checkValidation.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-validation.key" => Some(("checkValidation.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "check-validation", "container-id", "continuous-time-min-milliseconds", "event-name", "fingerprint", "horizontal-scroll-percentage-list", "interval", "interval-seconds", "key", "limit", "max-timer-length-seconds", "name", "notes", "parent-folder-id", "path", "selector", "tag-manager-url", "total-time-min-milliseconds", "trigger-id", "type", "unique-trigger-id", "value", "vertical-scroll-percentage-list", "visibility-selector", "visible-percentage-max", "visible-percentage-min", "wait-for-tags", "wait-for-tags-timeout", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Trigger = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_triggers_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_triggers_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_triggers_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_workspaces_triggers_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_triggers_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_triggers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_triggers_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_triggers_revert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_triggers_revert(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_triggers_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "max-timer-length-seconds.type" => Some(("maxTimerLengthSeconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-timer-length-seconds.value" => Some(("maxTimerLengthSeconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-timer-length-seconds.key" => Some(("maxTimerLengthSeconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-time-min-milliseconds.type" => Some(("totalTimeMinMilliseconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-time-min-milliseconds.value" => Some(("totalTimeMinMilliseconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "total-time-min-milliseconds.key" => Some(("totalTimeMinMilliseconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-trigger-id.type" => Some(("uniqueTriggerId.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-trigger-id.value" => Some(("uniqueTriggerId.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "unique-trigger-id.key" => Some(("uniqueTriggerId.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vertical-scroll-percentage-list.type" => Some(("verticalScrollPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vertical-scroll-percentage-list.value" => Some(("verticalScrollPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vertical-scroll-percentage-list.key" => Some(("verticalScrollPercentageList.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "horizontal-scroll-percentage-list.type" => Some(("horizontalScrollPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "horizontal-scroll-percentage-list.value" => Some(("horizontalScrollPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "horizontal-scroll-percentage-list.key" => Some(("horizontalScrollPercentageList.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags.type" => Some(("waitForTags.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags.value" => Some(("waitForTags.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags.key" => Some(("waitForTags.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval-seconds.type" => Some(("intervalSeconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval-seconds.value" => Some(("intervalSeconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval-seconds.key" => Some(("intervalSeconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-name.type" => Some(("eventName.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-name.value" => Some(("eventName.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-name.key" => Some(("eventName.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visibility-selector.type" => Some(("visibilitySelector.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visibility-selector.value" => Some(("visibilitySelector.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visibility-selector.key" => Some(("visibilitySelector.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continuous-time-min-milliseconds.type" => Some(("continuousTimeMinMilliseconds.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continuous-time-min-milliseconds.value" => Some(("continuousTimeMinMilliseconds.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continuous-time-min-milliseconds.key" => Some(("continuousTimeMinMilliseconds.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selector.type" => Some(("selector.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selector.value" => Some(("selector.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selector.key" => Some(("selector.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger-id" => Some(("triggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-max.type" => Some(("visiblePercentageMax.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-max.value" => Some(("visiblePercentageMax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-max.key" => Some(("visiblePercentageMax.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-min.type" => Some(("visiblePercentageMin.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-min.value" => Some(("visiblePercentageMin.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "visible-percentage-min.key" => Some(("visiblePercentageMin.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval.type" => Some(("interval.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval.value" => Some(("interval.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "interval.key" => Some(("interval.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags-timeout.type" => Some(("waitForTagsTimeout.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags-timeout.value" => Some(("waitForTagsTimeout.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "wait-for-tags-timeout.key" => Some(("waitForTagsTimeout.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit.type" => Some(("limit.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit.value" => Some(("limit.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "limit.key" => Some(("limit.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-validation.type" => Some(("checkValidation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-validation.value" => Some(("checkValidation.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-validation.key" => Some(("checkValidation.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "check-validation", "container-id", "continuous-time-min-milliseconds", "event-name", "fingerprint", "horizontal-scroll-percentage-list", "interval", "interval-seconds", "key", "limit", "max-timer-length-seconds", "name", "notes", "parent-folder-id", "path", "selector", "tag-manager-url", "total-time-min-milliseconds", "trigger-id", "type", "unique-trigger-id", "value", "vertical-scroll-percentage-list", "visibility-selector", "visible-percentage-max", "visible-percentage-min", "wait-for-tags", "wait-for-tags-timeout", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Trigger = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_triggers_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "description", "fingerprint", "name", "path", "tag-manager-url", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Workspace = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_update_proposal(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "new-comment.content" => Some(("newComment.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content", "fingerprint", "new-comment", "status"]); + 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::UpdateWorkspaceProposalRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_update_proposal(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_variables_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-start-ms" => Some(("scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule-end-ms" => Some(("scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable-id" => Some(("variableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabling-trigger-id" => Some(("enablingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabling-trigger-id" => Some(("disablingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "disabling-trigger-id", "enabling-trigger-id", "fingerprint", "name", "notes", "parent-folder-id", "path", "schedule-end-ms", "schedule-start-ms", "tag-manager-url", "type", "variable-id", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Variable = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_variables_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_variables_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_variables_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_containers_workspaces_variables_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_variables_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_variables_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_variables_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_variables_revert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().containers_workspaces_variables_revert(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_containers_workspaces_variables_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "schedule-start-ms" => Some(("scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schedule-end-ms" => Some(("scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variable-id" => Some(("variableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabling-trigger-id" => Some(("enablingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabling-trigger-id" => Some(("disablingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "disabling-trigger-id", "enabling-trigger-id", "fingerprint", "name", "notes", "parent-folder-id", "path", "schedule-end-ms", "schedule-start-ms", "tag-manager-url", "type", "variable-id", "workspace-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Variable = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().containers_workspaces_variables_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().list(); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "share-data" => Some(("shareData", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "path" => Some(("path", 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", "fingerprint", "name", "path", "share-data", "tag-manager-url"]); + 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::Account = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "fingerprint" => { + call = call.fingerprint(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(["fingerprint"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_user_permissions_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-access.permission" => Some(("accountAccess.permission", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email-address" => Some(("emailAddress", 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-access", "account-id", "email-address", "path", "permission"]); + 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::UserPermission = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().user_permissions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_user_permissions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().user_permissions_delete(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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 _accounts_user_permissions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().user_permissions_get(opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_user_permissions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().user_permissions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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("")); + }, + _ => { + 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(["page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _accounts_user_permissions_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "account-access.permission" => Some(("accountAccess.permission", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email-address" => Some(("emailAddress", 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-access", "account-id", "email-address", "path", "permission"]); + 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::UserPermission = json::value::from_value(object).unwrap(); + let mut call = self.hub.accounts().user_permissions_update(request, opt.value_of("path").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("accounts", Some(opt)) => { + match opt.subcommand() { + ("containers-create", Some(opt)) => { + call_result = self._accounts_containers_create(opt, dry_run, &mut err); + }, + ("containers-delete", Some(opt)) => { + call_result = self._accounts_containers_delete(opt, dry_run, &mut err); + }, + ("containers-environments-create", Some(opt)) => { + call_result = self._accounts_containers_environments_create(opt, dry_run, &mut err); + }, + ("containers-environments-delete", Some(opt)) => { + call_result = self._accounts_containers_environments_delete(opt, dry_run, &mut err); + }, + ("containers-environments-get", Some(opt)) => { + call_result = self._accounts_containers_environments_get(opt, dry_run, &mut err); + }, + ("containers-environments-list", Some(opt)) => { + call_result = self._accounts_containers_environments_list(opt, dry_run, &mut err); + }, + ("containers-environments-patch", Some(opt)) => { + call_result = self._accounts_containers_environments_patch(opt, dry_run, &mut err); + }, + ("containers-environments-reauthorize", Some(opt)) => { + call_result = self._accounts_containers_environments_reauthorize(opt, dry_run, &mut err); + }, + ("containers-environments-update", Some(opt)) => { + call_result = self._accounts_containers_environments_update(opt, dry_run, &mut err); + }, + ("containers-get", Some(opt)) => { + call_result = self._accounts_containers_get(opt, dry_run, &mut err); + }, + ("containers-list", Some(opt)) => { + call_result = self._accounts_containers_list(opt, dry_run, &mut err); + }, + ("containers-update", Some(opt)) => { + call_result = self._accounts_containers_update(opt, dry_run, &mut err); + }, + ("containers-version-headers-latest", Some(opt)) => { + call_result = self._accounts_containers_version_headers_latest(opt, dry_run, &mut err); + }, + ("containers-version-headers-list", Some(opt)) => { + call_result = self._accounts_containers_version_headers_list(opt, dry_run, &mut err); + }, + ("containers-versions-delete", Some(opt)) => { + call_result = self._accounts_containers_versions_delete(opt, dry_run, &mut err); + }, + ("containers-versions-get", Some(opt)) => { + call_result = self._accounts_containers_versions_get(opt, dry_run, &mut err); + }, + ("containers-versions-live", Some(opt)) => { + call_result = self._accounts_containers_versions_live(opt, dry_run, &mut err); + }, + ("containers-versions-publish", Some(opt)) => { + call_result = self._accounts_containers_versions_publish(opt, dry_run, &mut err); + }, + ("containers-versions-set-latest", Some(opt)) => { + call_result = self._accounts_containers_versions_set_latest(opt, dry_run, &mut err); + }, + ("containers-versions-undelete", Some(opt)) => { + call_result = self._accounts_containers_versions_undelete(opt, dry_run, &mut err); + }, + ("containers-versions-update", Some(opt)) => { + call_result = self._accounts_containers_versions_update(opt, dry_run, &mut err); + }, + ("containers-workspaces-built-in-variables-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_built_in_variables_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-built-in-variables-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_built_in_variables_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-built-in-variables-list", Some(opt)) => { + call_result = self._accounts_containers_workspaces_built_in_variables_list(opt, dry_run, &mut err); + }, + ("containers-workspaces-built-in-variables-revert", Some(opt)) => { + call_result = self._accounts_containers_workspaces_built_in_variables_revert(opt, dry_run, &mut err); + }, + ("containers-workspaces-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-create-version", Some(opt)) => { + call_result = self._accounts_containers_workspaces_create_version(opt, dry_run, &mut err); + }, + ("containers-workspaces-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-entities", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_entities(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-get", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_get(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-list", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_list(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-move-entities-to-folder", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_move_entities_to_folder(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-revert", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_revert(opt, dry_run, &mut err); + }, + ("containers-workspaces-folders-update", Some(opt)) => { + call_result = self._accounts_containers_workspaces_folders_update(opt, dry_run, &mut err); + }, + ("containers-workspaces-get", Some(opt)) => { + call_result = self._accounts_containers_workspaces_get(opt, dry_run, &mut err); + }, + ("containers-workspaces-get-proposal", Some(opt)) => { + call_result = self._accounts_containers_workspaces_get_proposal(opt, dry_run, &mut err); + }, + ("containers-workspaces-get-status", Some(opt)) => { + call_result = self._accounts_containers_workspaces_get_status(opt, dry_run, &mut err); + }, + ("containers-workspaces-list", Some(opt)) => { + call_result = self._accounts_containers_workspaces_list(opt, dry_run, &mut err); + }, + ("containers-workspaces-proposal-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_proposal_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-proposal-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_proposal_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-quick-preview", Some(opt)) => { + call_result = self._accounts_containers_workspaces_quick_preview(opt, dry_run, &mut err); + }, + ("containers-workspaces-resolve-conflict", Some(opt)) => { + call_result = self._accounts_containers_workspaces_resolve_conflict(opt, dry_run, &mut err); + }, + ("containers-workspaces-sync", Some(opt)) => { + call_result = self._accounts_containers_workspaces_sync(opt, dry_run, &mut err); + }, + ("containers-workspaces-tags-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_tags_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-tags-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_tags_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-tags-get", Some(opt)) => { + call_result = self._accounts_containers_workspaces_tags_get(opt, dry_run, &mut err); + }, + ("containers-workspaces-tags-list", Some(opt)) => { + call_result = self._accounts_containers_workspaces_tags_list(opt, dry_run, &mut err); + }, + ("containers-workspaces-tags-revert", Some(opt)) => { + call_result = self._accounts_containers_workspaces_tags_revert(opt, dry_run, &mut err); + }, + ("containers-workspaces-tags-update", Some(opt)) => { + call_result = self._accounts_containers_workspaces_tags_update(opt, dry_run, &mut err); + }, + ("containers-workspaces-triggers-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_triggers_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-triggers-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_triggers_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-triggers-get", Some(opt)) => { + call_result = self._accounts_containers_workspaces_triggers_get(opt, dry_run, &mut err); + }, + ("containers-workspaces-triggers-list", Some(opt)) => { + call_result = self._accounts_containers_workspaces_triggers_list(opt, dry_run, &mut err); + }, + ("containers-workspaces-triggers-revert", Some(opt)) => { + call_result = self._accounts_containers_workspaces_triggers_revert(opt, dry_run, &mut err); + }, + ("containers-workspaces-triggers-update", Some(opt)) => { + call_result = self._accounts_containers_workspaces_triggers_update(opt, dry_run, &mut err); + }, + ("containers-workspaces-update", Some(opt)) => { + call_result = self._accounts_containers_workspaces_update(opt, dry_run, &mut err); + }, + ("containers-workspaces-update-proposal", Some(opt)) => { + call_result = self._accounts_containers_workspaces_update_proposal(opt, dry_run, &mut err); + }, + ("containers-workspaces-variables-create", Some(opt)) => { + call_result = self._accounts_containers_workspaces_variables_create(opt, dry_run, &mut err); + }, + ("containers-workspaces-variables-delete", Some(opt)) => { + call_result = self._accounts_containers_workspaces_variables_delete(opt, dry_run, &mut err); + }, + ("containers-workspaces-variables-get", Some(opt)) => { + call_result = self._accounts_containers_workspaces_variables_get(opt, dry_run, &mut err); + }, + ("containers-workspaces-variables-list", Some(opt)) => { + call_result = self._accounts_containers_workspaces_variables_list(opt, dry_run, &mut err); + }, + ("containers-workspaces-variables-revert", Some(opt)) => { + call_result = self._accounts_containers_workspaces_variables_revert(opt, dry_run, &mut err); + }, + ("containers-workspaces-variables-update", Some(opt)) => { + call_result = self._accounts_containers_workspaces_variables_update(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._accounts_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._accounts_list(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._accounts_update(opt, dry_run, &mut err); + }, + ("user-permissions-create", Some(opt)) => { + call_result = self._accounts_user_permissions_create(opt, dry_run, &mut err); + }, + ("user-permissions-delete", Some(opt)) => { + call_result = self._accounts_user_permissions_delete(opt, dry_run, &mut err); + }, + ("user-permissions-get", Some(opt)) => { + call_result = self._accounts_user_permissions_get(opt, dry_run, &mut err); + }, + ("user-permissions-list", Some(opt)) => { + call_result = self._accounts_user_permissions_list(opt, dry_run, &mut err); + }, + ("user-permissions-update", Some(opt)) => { + call_result = self._accounts_user_permissions_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("accounts".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<'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, "tagmanager2-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "tagmanager2", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::TagManager::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 = [ + ("accounts", "methods: 'containers-create', 'containers-delete', 'containers-environments-create', 'containers-environments-delete', 'containers-environments-get', 'containers-environments-list', 'containers-environments-patch', 'containers-environments-reauthorize', 'containers-environments-update', 'containers-get', 'containers-list', 'containers-update', 'containers-version-headers-latest', 'containers-version-headers-list', 'containers-versions-delete', 'containers-versions-get', 'containers-versions-live', 'containers-versions-publish', 'containers-versions-set-latest', 'containers-versions-undelete', 'containers-versions-update', 'containers-workspaces-built-in-variables-create', 'containers-workspaces-built-in-variables-delete', 'containers-workspaces-built-in-variables-list', 'containers-workspaces-built-in-variables-revert', 'containers-workspaces-create', 'containers-workspaces-create-version', 'containers-workspaces-delete', 'containers-workspaces-folders-create', 'containers-workspaces-folders-delete', 'containers-workspaces-folders-entities', 'containers-workspaces-folders-get', 'containers-workspaces-folders-list', 'containers-workspaces-folders-move-entities-to-folder', 'containers-workspaces-folders-revert', 'containers-workspaces-folders-update', 'containers-workspaces-get', 'containers-workspaces-get-proposal', 'containers-workspaces-get-status', 'containers-workspaces-list', 'containers-workspaces-proposal-create', 'containers-workspaces-proposal-delete', 'containers-workspaces-quick-preview', 'containers-workspaces-resolve-conflict', 'containers-workspaces-sync', 'containers-workspaces-tags-create', 'containers-workspaces-tags-delete', 'containers-workspaces-tags-get', 'containers-workspaces-tags-list', 'containers-workspaces-tags-revert', 'containers-workspaces-tags-update', 'containers-workspaces-triggers-create', 'containers-workspaces-triggers-delete', 'containers-workspaces-triggers-get', 'containers-workspaces-triggers-list', 'containers-workspaces-triggers-revert', 'containers-workspaces-triggers-update', 'containers-workspaces-update', 'containers-workspaces-update-proposal', 'containers-workspaces-variables-create', 'containers-workspaces-variables-delete', 'containers-workspaces-variables-get', 'containers-workspaces-variables-list', 'containers-workspaces-variables-revert', 'containers-workspaces-variables-update', 'get', 'list', 'update', 'user-permissions-create', 'user-permissions-delete', 'user-permissions-get', 'user-permissions-list' and 'user-permissions-update'", vec![ + ("containers-create", + Some(r##"Creates a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Account's API relative path. Example: accounts/{account_id}."##), + 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)), + ]), + ("containers-delete", + Some(r##"Deletes a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-environments-create", + Some(r##"Creates a GTM Environment."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-environments-delete", + Some(r##"Deletes a GTM Environment."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + 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)), + ]), + ("containers-environments-get", + Some(r##"Gets a GTM Environment."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + 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)), + ]), + ("containers-environments-list", + Some(r##"Lists all GTM Environments of a GTM Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-environments-patch", + Some(r##"Updates a GTM Environment. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-patch", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + 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)), + ]), + ("containers-environments-reauthorize", + Some(r##"Re-generates the authorization code for a GTM Environment."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-reauthorize", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + 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)), + ]), + ("containers-environments-update", + Some(r##"Updates a GTM Environment."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-environments-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + 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)), + ]), + ("containers-get", + Some(r##"Gets a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-list", + Some(r##"Lists all Containers that belongs to a GTM Account."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}."##), + 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)), + ]), + ("containers-update", + Some(r##"Updates a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-version-headers-latest", + Some(r##"Gets the latest container version header"##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-version-headers-latest", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-version-headers-list", + Some(r##"Lists all Container Versions of a GTM Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-version-headers-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-versions-delete", + Some(r##"Deletes a Container Version."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + 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)), + ]), + ("containers-versions-get", + Some(r##"Gets a Container Version."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + 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)), + ]), + ("containers-versions-live", + Some(r##"Gets the live (i.e. published) container version"##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-live", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-versions-publish", + Some(r##"Publishes a Container Version."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-publish", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + 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)), + ]), + ("containers-versions-set-latest", + Some(r##"Sets the latest version used for synchronization of workspaces when detecting conflicts and errors."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-set-latest", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + 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)), + ]), + ("containers-versions-undelete", + Some(r##"Undeletes a Container Version."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-undelete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + 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)), + ]), + ("containers-versions-update", + Some(r##"Updates a Container Version."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + 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)), + ]), + ("containers-workspaces-built-in-variables-create", + Some(r##"Creates one or more GTM Built-In Variables."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-built-in-variables-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-built-in-variables-delete", + Some(r##"Deletes one or more GTM Built-In Variables."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-built-in-variables-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables"##), + 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)), + ]), + ("containers-workspaces-built-in-variables-list", + Some(r##"Lists all the enabled Built-In Variables of a GTM Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-built-in-variables-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-built-in-variables-revert", + Some(r##"Reverts changes to a GTM Built-In Variables in a GTM Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-built-in-variables-revert", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables"##), + 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)), + ]), + ("containers-workspaces-create", + Some(r##"Creates a Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-workspaces-create-version", + Some(r##"Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-create-version", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-delete", + Some(r##"Deletes a Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-folders-create", + Some(r##"Creates a GTM Folder."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-folders-delete", + Some(r##"Deletes a GTM Folder."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + 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)), + ]), + ("containers-workspaces-folders-entities", + Some(r##"List all entities in a GTM Folder."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-entities", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + 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)), + ]), + ("containers-workspaces-folders-get", + Some(r##"Gets a GTM Folder."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + 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)), + ]), + ("containers-workspaces-folders-list", + Some(r##"Lists all GTM Folders of a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-folders-move-entities-to-folder", + Some(r##"Moves entities to a GTM Folder."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-move-entities-to-folder", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + 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)), + ]), + ("containers-workspaces-folders-revert", + Some(r##"Reverts changes to a GTM Folder in a GTM Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-revert", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + 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)), + ]), + ("containers-workspaces-folders-update", + Some(r##"Updates a GTM Folder."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-folders-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + 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)), + ]), + ("containers-workspaces-get", + Some(r##"Gets a Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-get-proposal", + Some(r##"Gets a GTM Workspace Proposal."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-get-proposal", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal"##), + 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)), + ]), + ("containers-workspaces-get-status", + Some(r##"Finds conflicting and modified entities in the workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-get-status", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-list", + Some(r##"Lists all Workspaces that belong to a GTM Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + 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)), + ]), + ("containers-workspaces-proposal-create", + Some(r##"Creates a GTM Workspace Proposal."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-proposal-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid}"##), + 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)), + ]), + ("containers-workspaces-proposal-delete", + Some(r##"Deletes a GTM Workspace Proposal."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-proposal-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal"##), + 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)), + ]), + ("containers-workspaces-quick-preview", + Some(r##"Quick previews a workspace by creating a fake container version from all entities in the provided workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-quick-preview", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-resolve-conflict", + Some(r##"Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-resolve-conflict", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-sync", + Some(r##"Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-sync", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-tags-create", + Some(r##"Creates a GTM Tag."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-tags-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-tags-delete", + Some(r##"Deletes a GTM Tag."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-tags-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + 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)), + ]), + ("containers-workspaces-tags-get", + Some(r##"Gets a GTM Tag."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-tags-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + 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)), + ]), + ("containers-workspaces-tags-list", + Some(r##"Lists all GTM Tags of a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-tags-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-tags-revert", + Some(r##"Reverts changes to a GTM Tag in a GTM Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-tags-revert", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + 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)), + ]), + ("containers-workspaces-tags-update", + Some(r##"Updates a GTM Tag."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-tags-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + 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)), + ]), + ("containers-workspaces-triggers-create", + Some(r##"Creates a GTM Trigger."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-triggers-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-triggers-delete", + Some(r##"Deletes a GTM Trigger."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-triggers-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + 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)), + ]), + ("containers-workspaces-triggers-get", + Some(r##"Gets a GTM Trigger."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-triggers-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + 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)), + ]), + ("containers-workspaces-triggers-list", + Some(r##"Lists all GTM Triggers of a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-triggers-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-triggers-revert", + Some(r##"Reverts changes to a GTM Trigger in a GTM Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-triggers-revert", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + 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)), + ]), + ("containers-workspaces-triggers-update", + Some(r##"Updates a GTM Trigger."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-triggers-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + 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)), + ]), + ("containers-workspaces-update", + Some(r##"Updates a Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-update-proposal", + Some(r##"Updates a GTM Workspace Proposal."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-update-proposal", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal"##), + 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)), + ]), + ("containers-workspaces-variables-create", + Some(r##"Creates a GTM Variable."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-variables-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-variables-delete", + Some(r##"Deletes a GTM Variable."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-variables-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + 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)), + ]), + ("containers-workspaces-variables-get", + Some(r##"Gets a GTM Variable."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-variables-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + 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)), + ]), + ("containers-workspaces-variables-list", + Some(r##"Lists all GTM Variables of a Container."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-variables-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + 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)), + ]), + ("containers-workspaces-variables-revert", + Some(r##"Reverts changes to a GTM Variable in a GTM Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-variables-revert", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + 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)), + ]), + ("containers-workspaces-variables-update", + Some(r##"Updates a GTM Variable."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-variables-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a GTM Account."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}"##), + 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 GTM Accounts that a user has access to."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_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)), + ]), + ("update", + Some(r##"Updates a GTM Account."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}"##), + 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)), + ]), + ("user-permissions-create", + Some(r##"Creates a user's Account & Container access."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Account's API relative path. Example: accounts/{account_id}"##), + 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)), + ]), + ("user-permissions-delete", + Some(r##"Removes a user from the account, revoking access to it and all of its containers."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-delete", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), + 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)), + ]), + ("user-permissions-get", + Some(r##"Gets a user's Account & Container access."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-get", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), + 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)), + ]), + ("user-permissions-list", + Some(r##"List all users that have access to the account along with Account and Container user access granted to each of them."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}"##), + 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)), + ]), + ("user-permissions-update", + Some(r##"Updates a user's Account & Container access."##), + "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-update", + vec![ + (Some(r##"path"##), + None, + Some(r##"GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), + 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("tagmanager2") + .author("Sebastian Thiel ") + .version("1.0.6+20170915") + .about("Accesses Tag Manager accounts and containers.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager2_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/tagmanager2/Cargo.toml b/gen/tagmanager2/Cargo.toml new file mode 100644 index 0000000000..de8a44052f --- /dev/null +++ b/gen/tagmanager2/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-tagmanager2" +version = "1.0.6+20170915" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Tag Manager (protocol v2)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2" +homepage = "https://developers.google.com/tag-manager/api/v2/" +documentation = "https://docs.rs/google-tagmanager2/1.0.6+20170915" +license = "MIT" +keywords = ["tagmanager", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/tagmanager2/LICENSE.md b/gen/tagmanager2/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/tagmanager2/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/tagmanager2/README.md b/gen/tagmanager2/README.md new file mode 100644 index 0000000000..4ef6bbfacf --- /dev/null +++ b/gen/tagmanager2/README.md @@ -0,0 +1,255 @@ + +The `google-tagmanager2` library allows access to all features of the *Google Tag Manager* service. + +This documentation was generated from *Tag Manager* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *tagmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Tag Manager* *v2* API can be found at the +[official documentation site](https://developers.google.com/tag-manager/api/v2/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.TagManager.html) ... + +* [accounts](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.Account.html) + * [*containers create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentListCall.html), [*containers environments patch*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentPatchCall.html), [*containers environments reauthorize*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentReauthorizeCall.html), [*containers environments update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerEnvironmentUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerListCall.html), [*containers update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerUpdateCall.html), [*containers version_headers latest*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionHeaderLatestCall.html), [*containers version_headers list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionHeaderListCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionGetCall.html), [*containers versions live*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionLiveCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionPublishCall.html), [*containers versions set_latest*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionSetLatestCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerVersionUpdateCall.html), [*containers workspaces built_in_variables create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html), [*containers workspaces built_in_variables delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableDeleteCall.html), [*containers workspaces built_in_variables list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableListCall.html), [*containers workspaces built_in_variables revert*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html), [*containers workspaces create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceCreateCall.html), [*containers workspaces create_version*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceCreateVersionCall.html), [*containers workspaces delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceDeleteCall.html), [*containers workspaces folders create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderCreateCall.html), [*containers workspaces folders delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderDeleteCall.html), [*containers workspaces folders entities*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderEntityCall.html), [*containers workspaces folders get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderGetCall.html), [*containers workspaces folders list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderListCall.html), [*containers workspaces folders move_entities_to_folder*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html), [*containers workspaces folders revert*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderRevertCall.html), [*containers workspaces folders update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceFolderUpdateCall.html), [*containers workspaces get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceGetCall.html), [*containers workspaces get proposal*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceGetProposalCall.html), [*containers workspaces get status*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceGetStatuCall.html), [*containers workspaces list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceListCall.html), [*containers workspaces proposal create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceProposalCreateCall.html), [*containers workspaces proposal delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceProposalDeleteCall.html), [*containers workspaces quick_preview*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceQuickPreviewCall.html), [*containers workspaces resolve_conflict*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceResolveConflictCall.html), [*containers workspaces sync*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceSyncCall.html), [*containers workspaces tags create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTagCreateCall.html), [*containers workspaces tags delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTagDeleteCall.html), [*containers workspaces tags get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTagGetCall.html), [*containers workspaces tags list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTagListCall.html), [*containers workspaces tags revert*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTagRevertCall.html), [*containers workspaces tags update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTagUpdateCall.html), [*containers workspaces triggers create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTriggerCreateCall.html), [*containers workspaces triggers delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTriggerDeleteCall.html), [*containers workspaces triggers get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTriggerGetCall.html), [*containers workspaces triggers list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTriggerListCall.html), [*containers workspaces triggers revert*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTriggerRevertCall.html), [*containers workspaces triggers update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceTriggerUpdateCall.html), [*containers workspaces update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceUpdateCall.html), [*containers workspaces update proposal*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceUpdateProposalCall.html), [*containers workspaces variables create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceVariableCreateCall.html), [*containers workspaces variables delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceVariableDeleteCall.html), [*containers workspaces variables get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceVariableGetCall.html), [*containers workspaces variables list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceVariableListCall.html), [*containers workspaces variables revert*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceVariableRevertCall.html), [*containers workspaces variables update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountContainerWorkspaceVariableUpdateCall.html), [*get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountListCall.html), [*update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountUpdateCall.html), [*user_permissions create*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountUserPermissionCreateCall.html), [*user_permissions delete*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountUserPermissionDeleteCall.html), [*user_permissions get*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountUserPermissionGetCall.html), [*user_permissions list*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountUserPermissionListCall.html) and [*user_permissions update*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.AccountUserPermissionUpdateCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.TagManager.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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.accounts().containers_workspaces_get(...).doit() +let r = hub.accounts().containers_workspaces_folders_move_entities_to_folder(...).doit() +let r = hub.accounts().containers_version_headers_latest(...).doit() +let r = hub.accounts().containers_workspaces_triggers_create(...).doit() +let r = hub.accounts().containers_workspaces_list(...).doit() +let r = hub.accounts().containers_workspaces_built_in_variables_revert(...).doit() +let r = hub.accounts().containers_workspaces_built_in_variables_delete(...).doit() +let r = hub.accounts().containers_environments_create(...).doit() +let r = hub.accounts().containers_versions_publish(...).doit() +let r = hub.accounts().containers_workspaces_folders_get(...).doit() +let r = hub.accounts().containers_workspaces_tags_create(...).doit() +let r = hub.accounts().containers_environments_delete(...).doit() +let r = hub.accounts().containers_get(...).doit() +let r = hub.accounts().user_permissions_create(...).doit() +let r = hub.accounts().containers_workspaces_folders_list(...).doit() +let r = hub.accounts().containers_environments_reauthorize(...).doit() +let r = hub.accounts().containers_workspaces_delete(...).doit() +let r = hub.accounts().containers_workspaces_get_proposal(...).doit() +let r = hub.accounts().user_permissions_list(...).doit() +let r = hub.accounts().containers_workspaces_folders_delete(...).doit() +let r = hub.accounts().containers_workspaces_quick_preview(...).doit() +let r = hub.accounts().containers_workspaces_variables_get(...).doit() +let r = hub.accounts().containers_versions_set_latest(...).doit() +let r = hub.accounts().containers_workspaces_variables_update(...).doit() +let r = hub.accounts().containers_environments_list(...).doit() +let r = hub.accounts().containers_workspaces_tags_list(...).doit() +let r = hub.accounts().containers_versions_undelete(...).doit() +let r = hub.accounts().containers_workspaces_triggers_list(...).doit() +let r = hub.accounts().containers_workspaces_create_version(...).doit() +let r = hub.accounts().containers_delete(...).doit() +let r = hub.accounts().containers_workspaces_create(...).doit() +let r = hub.accounts().update(...).doit() +let r = hub.accounts().containers_version_headers_list(...).doit() +let r = hub.accounts().containers_workspaces_built_in_variables_list(...).doit() +let r = hub.accounts().user_permissions_update(...).doit() +let r = hub.accounts().containers_environments_get(...).doit() +let r = hub.accounts().get(...).doit() +let r = hub.accounts().containers_versions_live(...).doit() +let r = hub.accounts().list(...).doit() +let r = hub.accounts().containers_workspaces_variables_list(...).doit() +let r = hub.accounts().containers_workspaces_variables_revert(...).doit() +let r = hub.accounts().containers_workspaces_folders_entities(...).doit() +let r = hub.accounts().containers_workspaces_folders_create(...).doit() +let r = hub.accounts().containers_workspaces_get_status(...).doit() +let r = hub.accounts().containers_workspaces_tags_delete(...).doit() +let r = hub.accounts().containers_update(...).doit() +let r = hub.accounts().containers_environments_patch(...).doit() +let r = hub.accounts().containers_workspaces_folders_update(...).doit() +let r = hub.accounts().containers_workspaces_built_in_variables_create(...).doit() +let r = hub.accounts().containers_workspaces_proposal_delete(...).doit() +let r = hub.accounts().containers_list(...).doit() +let r = hub.accounts().containers_workspaces_triggers_delete(...).doit() +let r = hub.accounts().containers_workspaces_sync(...).doit() +let r = hub.accounts().containers_workspaces_tags_revert(...).doit() +let r = hub.accounts().containers_versions_delete(...).doit() +let r = hub.accounts().containers_workspaces_tags_update(...).doit() +let r = hub.accounts().containers_create(...).doit() +let r = hub.accounts().containers_workspaces_triggers_update(...).doit() +let r = hub.accounts().containers_workspaces_variables_create(...).doit() +let r = hub.accounts().user_permissions_get(...).doit() +let r = hub.accounts().containers_workspaces_triggers_revert(...).doit() +let r = hub.accounts().containers_workspaces_variables_delete(...).doit() +let r = hub.accounts().containers_workspaces_tags_get(...).doit() +let r = hub.accounts().containers_workspaces_resolve_conflict(...).doit() +let r = hub.accounts().containers_environments_update(...).doit() +let r = hub.accounts().containers_workspaces_triggers_get(...).doit() +let r = hub.accounts().containers_workspaces_folders_revert(...).doit() +let r = hub.accounts().containers_workspaces_proposal_create(...).doit() +let r = hub.accounts().containers_versions_update(...).doit() +let r = hub.accounts().containers_versions_get(...).doit() +let r = hub.accounts().containers_workspaces_update(...).doit() +let r = hub.accounts().containers_workspaces_update_proposal(...).doit() +let r = hub.accounts().user_permissions_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-tagmanager2 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_tagmanager2 as tagmanager2; +use tagmanager2::Folder; +use tagmanager2::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use tagmanager2::TagManager; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Folder::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.accounts().containers_workspaces_folders_move_entities_to_folder(req, "path") + .add_variable_id("sit") + .add_trigger_id("Stet") + .add_tag_id("sed") + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} + +``` +## Handling Errors + +All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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](https://docs.rs/google-tagmanager2/1.0.6+20170915/google_tagmanager2/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 **tagmanager2** 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-rsblob/master/LICENSE.md diff --git a/gen/tagmanager2/src/cmn.rs b/gen/tagmanager2/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/tagmanager2/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/tagmanager2/src/lib.rs b/gen/tagmanager2/src/lib.rs new file mode 100644 index 0000000000..ee51c88668 --- /dev/null +++ b/gen/tagmanager2/src/lib.rs @@ -0,0 +1,22473 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Tag Manager* crate version *1.0.6+20170915*, where *20170915* is the exact revision of the *tagmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Tag Manager* *v2* API can be found at the +//! [official documentation site](https://developers.google.com/tag-manager/api/v2/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.TagManager.html) ... +//! +//! * [accounts](struct.Account.html) +//! * [*containers create*](struct.AccountContainerCreateCall.html), [*containers delete*](struct.AccountContainerDeleteCall.html), [*containers environments create*](struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](struct.AccountContainerEnvironmentListCall.html), [*containers environments patch*](struct.AccountContainerEnvironmentPatchCall.html), [*containers environments reauthorize*](struct.AccountContainerEnvironmentReauthorizeCall.html), [*containers environments update*](struct.AccountContainerEnvironmentUpdateCall.html), [*containers get*](struct.AccountContainerGetCall.html), [*containers list*](struct.AccountContainerListCall.html), [*containers update*](struct.AccountContainerUpdateCall.html), [*containers version_headers latest*](struct.AccountContainerVersionHeaderLatestCall.html), [*containers version_headers list*](struct.AccountContainerVersionHeaderListCall.html), [*containers versions delete*](struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](struct.AccountContainerVersionGetCall.html), [*containers versions live*](struct.AccountContainerVersionLiveCall.html), [*containers versions publish*](struct.AccountContainerVersionPublishCall.html), [*containers versions set_latest*](struct.AccountContainerVersionSetLatestCall.html), [*containers versions undelete*](struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](struct.AccountContainerVersionUpdateCall.html), [*containers workspaces built_in_variables create*](struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html), [*containers workspaces built_in_variables delete*](struct.AccountContainerWorkspaceBuiltInVariableDeleteCall.html), [*containers workspaces built_in_variables list*](struct.AccountContainerWorkspaceBuiltInVariableListCall.html), [*containers workspaces built_in_variables revert*](struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html), [*containers workspaces create*](struct.AccountContainerWorkspaceCreateCall.html), [*containers workspaces create_version*](struct.AccountContainerWorkspaceCreateVersionCall.html), [*containers workspaces delete*](struct.AccountContainerWorkspaceDeleteCall.html), [*containers workspaces folders create*](struct.AccountContainerWorkspaceFolderCreateCall.html), [*containers workspaces folders delete*](struct.AccountContainerWorkspaceFolderDeleteCall.html), [*containers workspaces folders entities*](struct.AccountContainerWorkspaceFolderEntityCall.html), [*containers workspaces folders get*](struct.AccountContainerWorkspaceFolderGetCall.html), [*containers workspaces folders list*](struct.AccountContainerWorkspaceFolderListCall.html), [*containers workspaces folders move_entities_to_folder*](struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html), [*containers workspaces folders revert*](struct.AccountContainerWorkspaceFolderRevertCall.html), [*containers workspaces folders update*](struct.AccountContainerWorkspaceFolderUpdateCall.html), [*containers workspaces get*](struct.AccountContainerWorkspaceGetCall.html), [*containers workspaces get proposal*](struct.AccountContainerWorkspaceGetProposalCall.html), [*containers workspaces get status*](struct.AccountContainerWorkspaceGetStatuCall.html), [*containers workspaces list*](struct.AccountContainerWorkspaceListCall.html), [*containers workspaces proposal create*](struct.AccountContainerWorkspaceProposalCreateCall.html), [*containers workspaces proposal delete*](struct.AccountContainerWorkspaceProposalDeleteCall.html), [*containers workspaces quick_preview*](struct.AccountContainerWorkspaceQuickPreviewCall.html), [*containers workspaces resolve_conflict*](struct.AccountContainerWorkspaceResolveConflictCall.html), [*containers workspaces sync*](struct.AccountContainerWorkspaceSyncCall.html), [*containers workspaces tags create*](struct.AccountContainerWorkspaceTagCreateCall.html), [*containers workspaces tags delete*](struct.AccountContainerWorkspaceTagDeleteCall.html), [*containers workspaces tags get*](struct.AccountContainerWorkspaceTagGetCall.html), [*containers workspaces tags list*](struct.AccountContainerWorkspaceTagListCall.html), [*containers workspaces tags revert*](struct.AccountContainerWorkspaceTagRevertCall.html), [*containers workspaces tags update*](struct.AccountContainerWorkspaceTagUpdateCall.html), [*containers workspaces triggers create*](struct.AccountContainerWorkspaceTriggerCreateCall.html), [*containers workspaces triggers delete*](struct.AccountContainerWorkspaceTriggerDeleteCall.html), [*containers workspaces triggers get*](struct.AccountContainerWorkspaceTriggerGetCall.html), [*containers workspaces triggers list*](struct.AccountContainerWorkspaceTriggerListCall.html), [*containers workspaces triggers revert*](struct.AccountContainerWorkspaceTriggerRevertCall.html), [*containers workspaces triggers update*](struct.AccountContainerWorkspaceTriggerUpdateCall.html), [*containers workspaces update*](struct.AccountContainerWorkspaceUpdateCall.html), [*containers workspaces update proposal*](struct.AccountContainerWorkspaceUpdateProposalCall.html), [*containers workspaces variables create*](struct.AccountContainerWorkspaceVariableCreateCall.html), [*containers workspaces variables delete*](struct.AccountContainerWorkspaceVariableDeleteCall.html), [*containers workspaces variables get*](struct.AccountContainerWorkspaceVariableGetCall.html), [*containers workspaces variables list*](struct.AccountContainerWorkspaceVariableListCall.html), [*containers workspaces variables revert*](struct.AccountContainerWorkspaceVariableRevertCall.html), [*containers workspaces variables update*](struct.AccountContainerWorkspaceVariableUpdateCall.html), [*get*](struct.AccountGetCall.html), [*list*](struct.AccountListCall.html), [*update*](struct.AccountUpdateCall.html), [*user_permissions create*](struct.AccountUserPermissionCreateCall.html), [*user_permissions delete*](struct.AccountUserPermissionDeleteCall.html), [*user_permissions get*](struct.AccountUserPermissionGetCall.html), [*user_permissions list*](struct.AccountUserPermissionListCall.html) and [*user_permissions update*](struct.AccountUserPermissionUpdateCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.TagManager.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.accounts().containers_workspaces_get(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_move_entities_to_folder(...).doit() +//! let r = hub.accounts().containers_version_headers_latest(...).doit() +//! let r = hub.accounts().containers_workspaces_triggers_create(...).doit() +//! let r = hub.accounts().containers_workspaces_list(...).doit() +//! let r = hub.accounts().containers_workspaces_built_in_variables_revert(...).doit() +//! let r = hub.accounts().containers_workspaces_built_in_variables_delete(...).doit() +//! let r = hub.accounts().containers_environments_create(...).doit() +//! let r = hub.accounts().containers_versions_publish(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_get(...).doit() +//! let r = hub.accounts().containers_workspaces_tags_create(...).doit() +//! let r = hub.accounts().containers_environments_delete(...).doit() +//! let r = hub.accounts().containers_get(...).doit() +//! let r = hub.accounts().user_permissions_create(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_list(...).doit() +//! let r = hub.accounts().containers_environments_reauthorize(...).doit() +//! let r = hub.accounts().containers_workspaces_delete(...).doit() +//! let r = hub.accounts().containers_workspaces_get_proposal(...).doit() +//! let r = hub.accounts().user_permissions_list(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_delete(...).doit() +//! let r = hub.accounts().containers_workspaces_quick_preview(...).doit() +//! let r = hub.accounts().containers_workspaces_variables_get(...).doit() +//! let r = hub.accounts().containers_versions_set_latest(...).doit() +//! let r = hub.accounts().containers_workspaces_variables_update(...).doit() +//! let r = hub.accounts().containers_environments_list(...).doit() +//! let r = hub.accounts().containers_workspaces_tags_list(...).doit() +//! let r = hub.accounts().containers_versions_undelete(...).doit() +//! let r = hub.accounts().containers_workspaces_triggers_list(...).doit() +//! let r = hub.accounts().containers_workspaces_create_version(...).doit() +//! let r = hub.accounts().containers_delete(...).doit() +//! let r = hub.accounts().containers_workspaces_create(...).doit() +//! let r = hub.accounts().update(...).doit() +//! let r = hub.accounts().containers_version_headers_list(...).doit() +//! let r = hub.accounts().containers_workspaces_built_in_variables_list(...).doit() +//! let r = hub.accounts().user_permissions_update(...).doit() +//! let r = hub.accounts().containers_environments_get(...).doit() +//! let r = hub.accounts().get(...).doit() +//! let r = hub.accounts().containers_versions_live(...).doit() +//! let r = hub.accounts().list(...).doit() +//! let r = hub.accounts().containers_workspaces_variables_list(...).doit() +//! let r = hub.accounts().containers_workspaces_variables_revert(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_entities(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_create(...).doit() +//! let r = hub.accounts().containers_workspaces_get_status(...).doit() +//! let r = hub.accounts().containers_workspaces_tags_delete(...).doit() +//! let r = hub.accounts().containers_update(...).doit() +//! let r = hub.accounts().containers_environments_patch(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_update(...).doit() +//! let r = hub.accounts().containers_workspaces_built_in_variables_create(...).doit() +//! let r = hub.accounts().containers_workspaces_proposal_delete(...).doit() +//! let r = hub.accounts().containers_list(...).doit() +//! let r = hub.accounts().containers_workspaces_triggers_delete(...).doit() +//! let r = hub.accounts().containers_workspaces_sync(...).doit() +//! let r = hub.accounts().containers_workspaces_tags_revert(...).doit() +//! let r = hub.accounts().containers_versions_delete(...).doit() +//! let r = hub.accounts().containers_workspaces_tags_update(...).doit() +//! let r = hub.accounts().containers_create(...).doit() +//! let r = hub.accounts().containers_workspaces_triggers_update(...).doit() +//! let r = hub.accounts().containers_workspaces_variables_create(...).doit() +//! let r = hub.accounts().user_permissions_get(...).doit() +//! let r = hub.accounts().containers_workspaces_triggers_revert(...).doit() +//! let r = hub.accounts().containers_workspaces_variables_delete(...).doit() +//! let r = hub.accounts().containers_workspaces_tags_get(...).doit() +//! let r = hub.accounts().containers_workspaces_resolve_conflict(...).doit() +//! let r = hub.accounts().containers_environments_update(...).doit() +//! let r = hub.accounts().containers_workspaces_triggers_get(...).doit() +//! let r = hub.accounts().containers_workspaces_folders_revert(...).doit() +//! let r = hub.accounts().containers_workspaces_proposal_create(...).doit() +//! let r = hub.accounts().containers_versions_update(...).doit() +//! let r = hub.accounts().containers_versions_get(...).doit() +//! let r = hub.accounts().containers_workspaces_update(...).doit() +//! let r = hub.accounts().containers_workspaces_update_proposal(...).doit() +//! let r = hub.accounts().user_permissions_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-tagmanager2 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_tagmanager2 as tagmanager2; +//! use tagmanager2::Folder; +//! use tagmanager2::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use tagmanager2::TagManager; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Folder::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.accounts().containers_workspaces_folders_move_entities_to_folder(req, "path") +//! .add_variable_id("dolores") +//! .add_trigger_id("kasd") +//! .add_tag_id("accusam") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## 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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Manage user permissions of your Google Tag Manager account and container + ManageUser, + + /// View and manage your Google Tag Manager accounts + ManageAccount, + + /// View your Google Tag Manager container and its subcomponents + Readonly, + + /// Manage your Google Tag Manager container versions + EditContainerversion, + + /// Manage your Google Tag Manager container and its subcomponents, excluding versioning and publishing + EditContainer, + + /// Delete your Google Tag Manager containers + DeleteContainer, + + /// Publish your Google Tag Manager container versions + Publish, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::ManageUser => "https://www.googleapis.com/auth/tagmanager.manage.users", + Scope::ManageAccount => "https://www.googleapis.com/auth/tagmanager.manage.accounts", + Scope::Readonly => "https://www.googleapis.com/auth/tagmanager.readonly", + Scope::EditContainerversion => "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + Scope::EditContainer => "https://www.googleapis.com/auth/tagmanager.edit.containers", + Scope::DeleteContainer => "https://www.googleapis.com/auth/tagmanager.delete.containers", + Scope::Publish => "https://www.googleapis.com/auth/tagmanager.publish", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Readonly + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all TagManager related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Folder; +/// use tagmanager2::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use tagmanager2::TagManager; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Folder::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.accounts().containers_workspaces_folders_move_entities_to_folder(req, "path") +/// .add_variable_id("justo") +/// .add_trigger_id("amet.") +/// .add_tag_id("erat") +/// .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 TagManager { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for TagManager {} + +impl<'a, C, A> TagManager + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> TagManager { + TagManager { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://www.googleapis.com/tagmanager/v2/".to_string(), + _root_url: "https://www.googleapis.com/".to_string(), + } + } + + pub fn accounts(&'a self) -> AccountMethods<'a, C, A> { + AccountMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/tagmanager/v2/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://www.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// A response after synchronizing the workspace to the latest container version. +/// +/// # 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*). +/// +/// * [containers workspaces sync accounts](struct.AccountContainerWorkspaceSyncCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SyncWorkspaceResponse { + /// Indicates whether synchronization caused a merge conflict or sync error. + #[serde(rename="syncStatus")] + pub sync_status: Option, + /// The merge conflict after sync. If this field is not empty, the sync is still treated as successful. But a version cannot be created until all conflicts are resolved. + #[serde(rename="mergeConflict")] + pub merge_conflict: Option>, +} + +impl ResponseResult for SyncWorkspaceResponse {} + + +/// 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*). +/// +/// * [containers workspaces built_in_variables create accounts](struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateBuiltInVariableResponse { + /// List of created built-in variables. + #[serde(rename="builtInVariable")] + pub built_in_variable: Option>, +} + +impl ResponseResult for CreateBuiltInVariableResponse {} + + +/// Defines the Google Tag Manager Account access permissions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccountAccess { + /// Whether the user has no access, user access, or admin access to an account. + pub permission: Option, +} + +impl Part for AccountAccess {} + + +/// Represents a Google Tag Manager Container, which specifies the platform tags will run on, manages workspaces, and retains container versions. +/// +/// # 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*). +/// +/// * [containers update accounts](struct.AccountContainerUpdateCall.html) (request|response) +/// * [containers create accounts](struct.AccountContainerCreateCall.html) (request|response) +/// * [containers get accounts](struct.AccountContainerGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Container { + /// Container Public ID. + #[serde(rename="publicId")] + pub public_id: Option, + /// The Container ID uniquely identifies the GTM Container. + #[serde(rename="containerId")] + pub container_id: Option, + /// List of domain names associated with the Container. + #[serde(rename="domainName")] + pub domain_name: Option>, + /// Container Notes. + pub notes: Option, + /// Container display name. + pub name: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// List of Usage Contexts for the Container. Valid values include: web, android, or ios. + #[serde(rename="usageContext")] + pub usage_context: Option>, + /// The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified. + pub fingerprint: Option, + /// GTM Container's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for Container {} +impl ResponseResult for Container {} + + +/// Represents a Google Tag Manager Zone's contents. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Zone { + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// Zone display name. + pub name: Option, + /// Containers that are children of this Zone. + #[serde(rename="childContainer")] + pub child_container: Option>, + /// User notes on how to apply this zone in the container. + pub notes: Option, + /// The Zone ID uniquely identifies the GTM Zone. + #[serde(rename="zoneId")] + pub zone_id: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Zone as computed at storage time. This value is recomputed whenever the zone is modified. + pub fingerprint: Option, + /// GTM Zone's API relative path. + pub path: Option, + /// This Zone's boundary. + pub boundary: Option, + /// This Zone's type restrictions. + #[serde(rename="typeRestriction")] + pub type_restriction: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl Part for Zone {} + + +/// List Containers Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers list accounts](struct.AccountContainerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListContainersResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All Containers of a GTM Account. + pub container: Option>, +} + +impl ResponseResult for ListContainersResponse {} + + +/// List Variables Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers workspaces variables list accounts](struct.AccountContainerWorkspaceVariableListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListVariablesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All GTM Variables of a GTM Container. + pub variable: Option>, +} + +impl ResponseResult for ListVariablesResponse {} + + +/// Represents a Google Tag Manager Environment. Note that a user can create, delete and update environments of type USER, but can only update the enable_debug and url fields of environments of other types. +/// +/// # 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*). +/// +/// * [containers environments create accounts](struct.AccountContainerEnvironmentCreateCall.html) (request|response) +/// * [containers environments reauthorize accounts](struct.AccountContainerEnvironmentReauthorizeCall.html) (request|response) +/// * [containers environments patch accounts](struct.AccountContainerEnvironmentPatchCall.html) (request|response) +/// * [containers environments update accounts](struct.AccountContainerEnvironmentUpdateCall.html) (request|response) +/// * [containers environments get accounts](struct.AccountContainerEnvironmentGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Environment { + /// The environment authorization code. + #[serde(rename="authorizationCode")] + pub authorization_code: Option, + /// The environment description. Can be set or changed only on USER type environments. + pub description: Option, + /// GTM Environment ID uniquely identifies the GTM Environment. + #[serde(rename="environmentId")] + pub environment_id: Option, + /// Default preview page url for the environment. + pub url: Option, + /// The last update time-stamp for the authorization code. + #[serde(rename="authorizationTimestamp")] + pub authorization_timestamp: Option, + /// Whether or not to enable debug by default for the environment. + #[serde(rename="enableDebug")] + pub enable_debug: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// Represents a link to a quick preview of a workspace. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// Represents a link to a container version. + #[serde(rename="containerVersionId")] + pub container_version_id: Option, + /// The fingerprint of the GTM environment as computed at storage time. This value is recomputed whenever the environment is modified. + pub fingerprint: Option, + /// GTM Environment's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// The type of this environment. + #[serde(rename="type")] + pub type_: Option, + /// The environment display name. Can be set or changed only on USER type environments. + pub name: Option, +} + +impl RequestValue for Environment {} +impl ResponseResult for Environment {} + + +/// Represents a user's permissions to an account and its container. +/// +/// # 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*). +/// +/// * [user_permissions update accounts](struct.AccountUserPermissionUpdateCall.html) (request|response) +/// * [user_permissions get accounts](struct.AccountUserPermissionGetCall.html) (response) +/// * [user_permissions create accounts](struct.AccountUserPermissionCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserPermission { + /// GTM Container access permissions. + #[serde(rename="containerAccess")] + pub container_access: Option>, + /// GTM UserPermission's API relative path. + pub path: Option, + /// GTM Account access permissions. + #[serde(rename="accountAccess")] + pub account_access: Option, + /// User's email address. + #[serde(rename="emailAddress")] + pub email_address: Option, + /// The Account ID uniquely identifies the GTM Account. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for UserPermission {} +impl ResponseResult for UserPermission {} + + +/// Represents a Google Tag Manager Container Version. +/// +/// # 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*). +/// +/// * [containers versions undelete accounts](struct.AccountContainerVersionUndeleteCall.html) (response) +/// * [containers versions get accounts](struct.AccountContainerVersionGetCall.html) (response) +/// * [containers versions set_latest accounts](struct.AccountContainerVersionSetLatestCall.html) (response) +/// * [containers versions live accounts](struct.AccountContainerVersionLiveCall.html) (response) +/// * [containers versions update accounts](struct.AccountContainerVersionUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContainerVersion { + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// A value of true indicates this container version has been deleted. + pub deleted: Option, + /// The tags in the container that this version was taken from. + pub tag: Option>, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The Container Version ID uniquely identifies the GTM Container Version. + #[serde(rename="containerVersionId")] + pub container_version_id: Option, + /// The fingerprint of the GTM Container Version as computed at storage time. This value is recomputed whenever the container version is modified. + pub fingerprint: Option, + /// The variables in the container that this version was taken from. + pub variable: Option>, + /// GTM ContainerVersions's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// The container that this version was taken from. + pub container: Option, + /// Container version display name. + pub name: Option, + /// The zones in the container that this version was taken from. + pub zone: Option>, + /// Container version description. + pub description: Option, + /// The built-in variables in the container that this version was taken from. + #[serde(rename="builtInVariable")] + pub built_in_variable: Option>, + /// The triggers in the container that this version was taken from. + pub trigger: Option>, + /// The folders in the container that this version was taken from. + pub folder: Option>, +} + +impl RequestValue for ContainerVersion {} +impl ResponseResult for ContainerVersion {} + + +/// Defines the Google Tag Manager Container access permissions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContainerAccess { + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// List of Container permissions. + pub permission: Option, +} + +impl Part for ContainerAccess {} + + +/// A list of enabled built-in variables. +/// +/// # 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*). +/// +/// * [containers workspaces built_in_variables list accounts](struct.AccountContainerWorkspaceBuiltInVariableListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListEnabledBuiltInVariablesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All GTM BuiltInVariables of a GTM container. + #[serde(rename="builtInVariable")] + pub built_in_variable: Option>, +} + +impl ResponseResult for ListEnabledBuiltInVariablesResponse {} + + +/// Represents a Google Tag Manager Folder. +/// +/// # 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*). +/// +/// * [containers workspaces folders create accounts](struct.AccountContainerWorkspaceFolderCreateCall.html) (request|response) +/// * [containers workspaces folders move_entities_to_folder accounts](struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html) (request) +/// * [containers workspaces folders get accounts](struct.AccountContainerWorkspaceFolderGetCall.html) (response) +/// * [containers workspaces folders update accounts](struct.AccountContainerWorkspaceFolderUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Folder { + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// User notes on how to apply this folder in the container. + pub notes: Option, + /// Folder display name. + pub name: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Folder as computed at storage time. This value is recomputed whenever the folder is modified. + pub fingerprint: Option, + /// GTM Folder's API relative path. + pub path: Option, + /// The Folder ID uniquely identifies the GTM Folder. + #[serde(rename="folderId")] + pub folder_id: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for Folder {} +impl ResponseResult for Folder {} + + +/// Represents a Google Tag Manager Parameter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Parameter { + /// This map parameter's parameters (must have keys; keys must be unique). + pub map: Option>, + /// This list parameter's parameters (keys will be ignored). + pub list: Option>, + /// The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values. + pub key: Option, + /// A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. + pub value: Option, + /// The parameter type. Valid values are: + /// - boolean: The value represents a boolean, represented as 'true' or 'false' + /// - integer: The value represents a 64-bit signed integer value, in base 10 + /// - list: A list of parameters should be specified + /// - map: A map of parameters should be specified + /// - template: The value represents any text; this can include variable references (even variable references that might return non-string types) + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for Parameter {} + + +/// Response to quick previewing a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces quick_preview accounts](struct.AccountContainerWorkspaceQuickPreviewCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QuickPreviewResponse { + /// The quick previewed container version. + #[serde(rename="containerVersion")] + pub container_version: Option, + /// Whether quick previewing failed when syncing the workspace to the latest container version. + #[serde(rename="syncStatus")] + pub sync_status: Option, + /// Were there compiler errors or not. + #[serde(rename="compilerError")] + pub compiler_error: Option, +} + +impl ResponseResult for QuickPreviewResponse {} + + +/// The result of reverting folder changes in a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces folders revert accounts](struct.AccountContainerWorkspaceFolderRevertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevertFolderResponse { + /// Folder as it appears in the latest container version since the last workspace synchronization operation. If no folder is present, that means the folder was deleted in the latest container version. + pub folder: Option, +} + +impl ResponseResult for RevertFolderResponse {} + + +/// List Folders Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers workspaces folders list accounts](struct.AccountContainerWorkspaceFolderListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListFoldersResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All GTM Folders of a GTM Container. + pub folder: Option>, +} + +impl ResponseResult for ListFoldersResponse {} + + +/// The changes that have occurred in the workspace since the base container version. +/// +/// # 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*). +/// +/// * [containers workspaces get status accounts](struct.AccountContainerWorkspaceGetStatuCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetWorkspaceStatusResponse { + /// Entities that have been changed in the workspace. + #[serde(rename="workspaceChange")] + pub workspace_change: Option>, + /// The merge conflict after sync. + #[serde(rename="mergeConflict")] + pub merge_conflict: Option>, +} + +impl ResponseResult for GetWorkspaceStatusResponse {} + + +/// Represents an external user or internal Google Tag Manager system. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkspaceProposalUser { + /// Gaia id associated with a user, absent for the Google Tag Manager system. + #[serde(rename="gaiaId")] + pub gaia_id: Option, + /// User type distinguishes between a user and the Google Tag Manager system. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for WorkspaceProposalUser {} + + +/// Represents a child container of a Zone. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneChildContainer { + /// The zone's nickname for the child container. + pub nickname: Option, + /// The child container's public id. + #[serde(rename="publicId")] + pub public_id: Option, +} + +impl Part for ZoneChildContainer {} + + +/// A workspace proposal represents an ongoing review of workspace changes in an effort to gain approval for container version creation. +/// +/// # 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*). +/// +/// * [containers workspaces proposal create accounts](struct.AccountContainerWorkspaceProposalCreateCall.html) (response) +/// * [containers workspaces update proposal accounts](struct.AccountContainerWorkspaceUpdateProposalCall.html) (response) +/// * [containers workspaces get proposal accounts](struct.AccountContainerWorkspaceGetProposalCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkspaceProposal { + /// The status of the workspace proposal as it goes through review. + pub status: Option, + /// List of authors for the workspace proposal. + pub authors: Option>, + /// Lists of reviewers for the workspace proposal. + pub reviewers: Option>, + /// GTM workspace proposal's relative path. + pub path: Option, + /// The fingerprint of the GTM workspace proposal as computed at storage time. This value is recomputed whenever the proposal is modified. + pub fingerprint: Option, + /// Records the history of comments and status changes. + pub history: Option>, +} + +impl ResponseResult for WorkspaceProposal {} + + +/// List triggers response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers workspaces triggers list accounts](struct.AccountContainerWorkspaceTriggerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTriggersResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All GTM Triggers of a GTM Container. + pub trigger: Option>, +} + +impl ResponseResult for ListTriggersResponse {} + + +/// Represents a merge conflict. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MergeConflict { + /// The base version entity (since the latest sync operation) that has conflicting changes compared to the workspace. If this field is missing, it means the workspace entity is deleted from the base version. + #[serde(rename="entityInBaseVersion")] + pub entity_in_base_version: Option, + /// The workspace entity that has conflicting changes compared to the base version. If an entity is deleted in a workspace, it will still appear with a deleted change status. + #[serde(rename="entityInWorkspace")] + pub entity_in_workspace: Option, +} + +impl Part for MergeConflict {} + + +/// Represents a reference to atag that fires before another tag in order to set up dependencies. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetupTag { + /// If true, fire the main tag if and only if the setup tag fires successfully. If false, fire the main tag regardless of setup tag firing status. + #[serde(rename="stopOnSetupFailure")] + pub stop_on_setup_failure: Option, + /// The name of the setup tag. + #[serde(rename="tagName")] + pub tag_name: Option, +} + +impl Part for SetupTag {} + + +/// Represents a Google Tag Manager Container Version Header. +/// +/// # 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*). +/// +/// * [containers version_headers latest accounts](struct.AccountContainerVersionHeaderLatestCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContainerVersionHeader { + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// Number of tags in the container version. + #[serde(rename="numTags")] + pub num_tags: Option, + /// A value of true indicates this container version has been deleted. + pub deleted: Option, + /// Number of zones in the container version. + #[serde(rename="numZones")] + pub num_zones: Option, + /// Number of macros in the container version. + #[serde(rename="numMacros")] + pub num_macros: Option, + /// Container version display name. + pub name: Option, + /// Number of triggers in the container version. + #[serde(rename="numTriggers")] + pub num_triggers: Option, + /// Number of rules in the container version. + #[serde(rename="numRules")] + pub num_rules: Option, + /// The Container Version ID uniquely identifies the GTM Container Version. + #[serde(rename="containerVersionId")] + pub container_version_id: Option, + /// GTM Container Versions's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Number of variables in the container version. + #[serde(rename="numVariables")] + pub num_variables: Option, +} + +impl ResponseResult for ContainerVersionHeader {} + + +/// List Environments Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers environments list accounts](struct.AccountContainerEnvironmentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListEnvironmentsResponse { + /// All Environments of a GTM Container. + pub environment: Option>, + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListEnvironmentsResponse {} + + +/// The status of a workspace after synchronization. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SyncStatus { + /// An error occurred during the synchronization operation. + #[serde(rename="syncError")] + pub sync_error: Option, + /// Synchornization operation detected a merge conflict. + #[serde(rename="mergeConflict")] + pub merge_conflict: Option, +} + +impl Part for SyncStatus {} + + +/// The result of reverting a trigger in a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces triggers revert accounts](struct.AccountContainerWorkspaceTriggerRevertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevertTriggerResponse { + /// Trigger as it appears in the latest container version since the last workspace synchronization operation. If no trigger is present, that means the trigger was deleted in the latest container version. + pub trigger: Option, +} + +impl ResponseResult for RevertTriggerResponse {} + + +/// Represents a Google Tag Manager Variable. +/// +/// # 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*). +/// +/// * [containers workspaces variables create accounts](struct.AccountContainerWorkspaceVariableCreateCall.html) (request|response) +/// * [containers workspaces variables update accounts](struct.AccountContainerWorkspaceVariableUpdateCall.html) (request|response) +/// * [containers workspaces variables get accounts](struct.AccountContainerWorkspaceVariableGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Variable { + /// The start timestamp in milliseconds to schedule a variable. + #[serde(rename="scheduleStartMs")] + pub schedule_start_ms: Option, + /// The end timestamp in milliseconds to schedule a variable. + #[serde(rename="scheduleEndMs")] + pub schedule_end_ms: Option, + /// The Variable ID uniquely identifies the GTM Variable. + #[serde(rename="variableId")] + pub variable_id: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// For mobile containers only: A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set. + #[serde(rename="enablingTriggerId")] + pub enabling_trigger_id: Option>, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified. + pub fingerprint: Option, + /// GTM Variable's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Variable display name. + pub name: Option, + /// The variable's parameters. + pub parameter: Option>, + /// User notes on how to apply this variable in the container. + pub notes: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// GTM Variable Type. + #[serde(rename="type")] + pub type_: Option, + /// Parent folder id. + #[serde(rename="parentFolderId")] + pub parent_folder_id: Option, + /// For mobile containers only: A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set. + #[serde(rename="disablingTriggerId")] + pub disabling_trigger_id: Option>, +} + +impl RequestValue for Variable {} +impl ResponseResult for Variable {} + + +/// The result of reverting a variable in a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces variables revert accounts](struct.AccountContainerWorkspaceVariableRevertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevertVariableResponse { + /// Variable as it appears in the latest container version since the last workspace synchronization operation. If no variable is present, that means the variable was deleted in the latest container version. + pub variable: Option, +} + +impl ResponseResult for RevertVariableResponse {} + + +/// A history event that represents a comment or status change in the proposal. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkspaceProposalHistory { + /// A user or reviewer comment. + pub comment: Option, + /// When this history event was added to the workspace proposal. + #[serde(rename="createdTimestamp")] + pub created_timestamp: Option, + /// The history type distinguishing between comments and status changes. + #[serde(rename="type")] + pub type_: Option, + /// The party responsible for the change in history. + #[serde(rename="createdBy")] + pub created_by: Option, + /// A change in the proposal's status. + #[serde(rename="statusChange")] + pub status_change: Option, +} + +impl Part for WorkspaceProposalHistory {} + + +/// Represents a predicate. +/// +/// 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 { + /// A list of named parameters (key/value), depending on the condition's type. Notes: + /// - For binary operators, include parameters named arg0 and arg1 for specifying the left and right operands, respectively. + /// - At this time, the left operand (arg0) must be a reference to a variable. + /// - For case-insensitive Regex matching, include a boolean parameter named ignore_case that is set to true. If not specified or set to any other value, the matching will be case sensitive. + /// - To negate an operator, include a boolean parameter named negate boolean parameter that is set to true. + pub parameter: Option>, + /// The type of operator for this condition. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for Condition {} + + +/// A change in the proposal's status. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkspaceProposalHistoryStatusChange { + /// The new proposal status after that status change. + #[serde(rename="newStatus")] + pub new_status: Option, + /// The old proposal status before the status change. + #[serde(rename="oldStatus")] + pub old_status: Option, +} + +impl Part for WorkspaceProposalHistoryStatusChange {} + + +/// Represents a Google Tag Manager Account. +/// +/// # 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*). +/// +/// * [containers workspaces get accounts](struct.AccountContainerWorkspaceGetCall.html) (none) +/// * [containers workspaces folders move_entities_to_folder accounts](struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html) (none) +/// * [containers version_headers latest accounts](struct.AccountContainerVersionHeaderLatestCall.html) (none) +/// * [containers workspaces triggers create accounts](struct.AccountContainerWorkspaceTriggerCreateCall.html) (none) +/// * [containers workspaces list accounts](struct.AccountContainerWorkspaceListCall.html) (none) +/// * [containers workspaces built_in_variables revert accounts](struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html) (none) +/// * [containers workspaces built_in_variables delete accounts](struct.AccountContainerWorkspaceBuiltInVariableDeleteCall.html) (none) +/// * [containers environments create accounts](struct.AccountContainerEnvironmentCreateCall.html) (none) +/// * [containers versions publish accounts](struct.AccountContainerVersionPublishCall.html) (none) +/// * [containers workspaces folders get accounts](struct.AccountContainerWorkspaceFolderGetCall.html) (none) +/// * [containers workspaces tags create accounts](struct.AccountContainerWorkspaceTagCreateCall.html) (none) +/// * [containers environments delete accounts](struct.AccountContainerEnvironmentDeleteCall.html) (none) +/// * [containers get accounts](struct.AccountContainerGetCall.html) (none) +/// * [user_permissions create accounts](struct.AccountUserPermissionCreateCall.html) (none) +/// * [containers workspaces folders list accounts](struct.AccountContainerWorkspaceFolderListCall.html) (none) +/// * [containers environments reauthorize accounts](struct.AccountContainerEnvironmentReauthorizeCall.html) (none) +/// * [containers workspaces delete accounts](struct.AccountContainerWorkspaceDeleteCall.html) (none) +/// * [containers workspaces get proposal accounts](struct.AccountContainerWorkspaceGetProposalCall.html) (none) +/// * [user_permissions list accounts](struct.AccountUserPermissionListCall.html) (none) +/// * [containers workspaces folders delete accounts](struct.AccountContainerWorkspaceFolderDeleteCall.html) (none) +/// * [containers workspaces quick_preview accounts](struct.AccountContainerWorkspaceQuickPreviewCall.html) (none) +/// * [containers workspaces variables get accounts](struct.AccountContainerWorkspaceVariableGetCall.html) (none) +/// * [containers versions set_latest accounts](struct.AccountContainerVersionSetLatestCall.html) (none) +/// * [containers workspaces variables update accounts](struct.AccountContainerWorkspaceVariableUpdateCall.html) (none) +/// * [containers environments list accounts](struct.AccountContainerEnvironmentListCall.html) (none) +/// * [containers workspaces tags list accounts](struct.AccountContainerWorkspaceTagListCall.html) (none) +/// * [containers versions undelete accounts](struct.AccountContainerVersionUndeleteCall.html) (none) +/// * [containers workspaces triggers list accounts](struct.AccountContainerWorkspaceTriggerListCall.html) (none) +/// * [containers workspaces create_version accounts](struct.AccountContainerWorkspaceCreateVersionCall.html) (none) +/// * [containers delete accounts](struct.AccountContainerDeleteCall.html) (none) +/// * [containers workspaces create accounts](struct.AccountContainerWorkspaceCreateCall.html) (none) +/// * [update accounts](struct.AccountUpdateCall.html) (request|response) +/// * [containers version_headers list accounts](struct.AccountContainerVersionHeaderListCall.html) (none) +/// * [containers workspaces built_in_variables list accounts](struct.AccountContainerWorkspaceBuiltInVariableListCall.html) (none) +/// * [user_permissions update accounts](struct.AccountUserPermissionUpdateCall.html) (none) +/// * [containers environments get accounts](struct.AccountContainerEnvironmentGetCall.html) (none) +/// * [get accounts](struct.AccountGetCall.html) (response) +/// * [containers versions live accounts](struct.AccountContainerVersionLiveCall.html) (none) +/// * [list accounts](struct.AccountListCall.html) (none) +/// * [containers workspaces variables list accounts](struct.AccountContainerWorkspaceVariableListCall.html) (none) +/// * [containers workspaces variables revert accounts](struct.AccountContainerWorkspaceVariableRevertCall.html) (none) +/// * [containers workspaces folders entities accounts](struct.AccountContainerWorkspaceFolderEntityCall.html) (none) +/// * [containers workspaces folders create accounts](struct.AccountContainerWorkspaceFolderCreateCall.html) (none) +/// * [containers workspaces get status accounts](struct.AccountContainerWorkspaceGetStatuCall.html) (none) +/// * [containers workspaces tags delete accounts](struct.AccountContainerWorkspaceTagDeleteCall.html) (none) +/// * [containers update accounts](struct.AccountContainerUpdateCall.html) (none) +/// * [containers environments patch accounts](struct.AccountContainerEnvironmentPatchCall.html) (none) +/// * [containers workspaces folders update accounts](struct.AccountContainerWorkspaceFolderUpdateCall.html) (none) +/// * [containers workspaces built_in_variables create accounts](struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html) (none) +/// * [containers workspaces proposal delete accounts](struct.AccountContainerWorkspaceProposalDeleteCall.html) (none) +/// * [containers list accounts](struct.AccountContainerListCall.html) (none) +/// * [containers workspaces triggers delete accounts](struct.AccountContainerWorkspaceTriggerDeleteCall.html) (none) +/// * [containers workspaces sync accounts](struct.AccountContainerWorkspaceSyncCall.html) (none) +/// * [containers workspaces tags revert accounts](struct.AccountContainerWorkspaceTagRevertCall.html) (none) +/// * [containers versions delete accounts](struct.AccountContainerVersionDeleteCall.html) (none) +/// * [containers workspaces tags update accounts](struct.AccountContainerWorkspaceTagUpdateCall.html) (none) +/// * [containers create accounts](struct.AccountContainerCreateCall.html) (none) +/// * [containers workspaces triggers update accounts](struct.AccountContainerWorkspaceTriggerUpdateCall.html) (none) +/// * [containers workspaces variables create accounts](struct.AccountContainerWorkspaceVariableCreateCall.html) (none) +/// * [user_permissions get accounts](struct.AccountUserPermissionGetCall.html) (none) +/// * [containers workspaces triggers revert accounts](struct.AccountContainerWorkspaceTriggerRevertCall.html) (none) +/// * [containers workspaces variables delete accounts](struct.AccountContainerWorkspaceVariableDeleteCall.html) (none) +/// * [containers workspaces tags get accounts](struct.AccountContainerWorkspaceTagGetCall.html) (none) +/// * [containers workspaces resolve_conflict accounts](struct.AccountContainerWorkspaceResolveConflictCall.html) (none) +/// * [containers environments update accounts](struct.AccountContainerEnvironmentUpdateCall.html) (none) +/// * [containers workspaces triggers get accounts](struct.AccountContainerWorkspaceTriggerGetCall.html) (none) +/// * [containers workspaces folders revert accounts](struct.AccountContainerWorkspaceFolderRevertCall.html) (none) +/// * [containers workspaces proposal create accounts](struct.AccountContainerWorkspaceProposalCreateCall.html) (none) +/// * [containers versions update accounts](struct.AccountContainerVersionUpdateCall.html) (none) +/// * [containers versions get accounts](struct.AccountContainerVersionGetCall.html) (none) +/// * [containers workspaces update accounts](struct.AccountContainerWorkspaceUpdateCall.html) (none) +/// * [containers workspaces update proposal accounts](struct.AccountContainerWorkspaceUpdateProposalCall.html) (none) +/// * [user_permissions delete accounts](struct.AccountUserPermissionDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Account { + /// Account display name. + pub name: Option, + /// The fingerprint of the GTM Account as computed at storage time. This value is recomputed whenever the account is modified. + pub fingerprint: Option, + /// Whether the account shares data anonymously with Google and others. This flag enables benchmarking by sharing your data in an anonymous form. Google will remove all identifiable information about your website, combine the data with hundreds of other anonymous sites and report aggregate trends in the benchmarking service. + #[serde(rename="shareData")] + pub share_data: Option, + /// GTM Account's API relative path. + pub path: Option, + /// The Account ID uniquely identifies the GTM Account. + #[serde(rename="accountId")] + pub account_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, +} + +impl RequestValue for Account {} +impl Resource for Account {} +impl ResponseResult for Account {} + + +/// Represents a Zone's type restrictions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneTypeRestriction { + /// True if type restrictions have been enabled for this Zone. + pub enable: Option, + /// List of type public ids that have been whitelisted for use in this Zone. + #[serde(rename="whitelistedTypeId")] + pub whitelisted_type_id: Option>, +} + +impl Part for ZoneTypeRestriction {} + + +/// The result of reverting a tag in a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces tags revert accounts](struct.AccountContainerWorkspaceTagRevertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevertTagResponse { + /// Tag as it appears in the latest container version since the last workspace synchronization operation. If no tag is present, that means the tag was deleted in the latest container version. + pub tag: Option, +} + +impl ResponseResult for RevertTagResponse {} + + +/// List Accounts Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list accounts](struct.AccountListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAccountsResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of GTM Accounts that a user has access to. + pub account: Option>, +} + +impl ResponseResult for ListAccountsResponse {} + + +/// Built-in variables are a special category of variables that are pre-created and non-customizable. They provide common functionality like accessing propeties of the gtm data layer, monitoring clicks, or accessing elements of a page 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 BuiltInVariable { + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// GTM BuiltInVariable's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Type of built-in variable. + #[serde(rename="type")] + pub type_: Option, + /// Name of the built-in variable to be used to refer to the built-in variable. + pub name: Option, +} + +impl Part for BuiltInVariable {} + + +/// Represents a Google Tag Manager Trigger +/// +/// # 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*). +/// +/// * [containers workspaces triggers update accounts](struct.AccountContainerWorkspaceTriggerUpdateCall.html) (request|response) +/// * [containers workspaces triggers create accounts](struct.AccountContainerWorkspaceTriggerCreateCall.html) (request|response) +/// * [containers workspaces triggers get accounts](struct.AccountContainerWorkspaceTriggerGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Trigger { + /// Max time to fire Timer Events (in seconds). Only valid for AMP Timer trigger. + #[serde(rename="maxTimerLengthSeconds")] + pub max_timer_length_seconds: Option, + /// A visibility trigger minimum total visible time (in milliseconds). Only valid for AMP Visibility trigger. + #[serde(rename="totalTimeMinMilliseconds")] + pub total_time_min_milliseconds: Option, + /// Globally unique id of the trigger that auto-generates this (a Form Submit, Link Click or Timer listener) if any. Used to make incompatible auto-events work together with trigger filtering based on trigger ids. This value is populated during output generation since the tags implied by triggers don't exist until then. Only valid for Form Submit, Link Click and Timer triggers. + #[serde(rename="uniqueTriggerId")] + pub unique_trigger_id: Option, + /// List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled vertically. Only valid for AMP scroll triggers. + #[serde(rename="verticalScrollPercentageList")] + pub vertical_scroll_percentage_list: Option, + /// A visibility trigger minimum continuous visible time (in milliseconds). Only valid for AMP Visibility trigger. + #[serde(rename="continuousTimeMinMilliseconds")] + pub continuous_time_min_milliseconds: Option, + /// List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled horizontally. Only valid for AMP scroll triggers. + #[serde(rename="horizontalScrollPercentageList")] + pub horizontal_scroll_percentage_list: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Whether or not we should delay the form submissions or link opening until all of the tags have fired (by preventing the default action and later simulating the default action). Only valid for Form Submission and Link Click triggers. + #[serde(rename="waitForTags")] + pub wait_for_tags: Option, + /// Time between Timer Events to fire (in seconds). Only valid for AMP Timer trigger. + #[serde(rename="intervalSeconds")] + pub interval_seconds: Option, + /// Name of the GTM event that is fired. Only valid for Timer triggers. + #[serde(rename="eventName")] + pub event_name: Option, + /// A visibility trigger CSS selector (i.e. "#id"). Only valid for AMP Visibility trigger. + #[serde(rename="visibilitySelector")] + pub visibility_selector: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Used in the case of custom event, which is fired iff all Conditions are true. + #[serde(rename="customEventFilter")] + pub custom_event_filter: Option>, + /// Additional parameters. + pub parameter: Option>, + /// Parent folder id. + #[serde(rename="parentFolderId")] + pub parent_folder_id: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// A click trigger CSS selector (i.e. "a", "button" etc.). Only valid for AMP Click trigger. + pub selector: Option, + /// The Trigger ID uniquely identifies the GTM Trigger. + #[serde(rename="triggerId")] + pub trigger_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified. + pub fingerprint: Option, + /// A visibility trigger maximum percent visibility. Only valid for AMP Visibility trigger. + #[serde(rename="visiblePercentageMax")] + pub visible_percentage_max: Option, + /// GTM Trigger's API relative path. + pub path: Option, + /// Trigger display name. + pub name: Option, + /// A visibility trigger minimum percent visibility. Only valid for AMP Visibility trigger. + #[serde(rename="visiblePercentageMin")] + pub visible_percentage_min: Option, + /// Defines the data layer event that causes this trigger. + #[serde(rename="type")] + pub type_: Option, + /// User notes on how to apply this trigger in the container. + pub notes: Option, + /// Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers. + pub interval: Option, + /// The trigger will only fire iff all Conditions are true. + pub filter: Option>, + /// How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' above evaluates to true. Only valid for Form Submission and Link Click triggers. + #[serde(rename="waitForTagsTimeout")] + pub wait_for_tags_timeout: Option, + /// Limit of the number of GTM events this Timer Trigger will fire. If no limit is set, we will continue to fire GTM events until the user leaves the page. Only valid for Timer triggers. + pub limit: Option, + /// Whether or not we should only fire tags if the form submit or link click event is not cancelled by some other event handler (e.g. because of validation). Only valid for Form Submission and Link Click triggers. + #[serde(rename="checkValidation")] + pub check_validation: Option, + /// Used in the case of auto event tracking. + #[serde(rename="autoEventFilter")] + pub auto_event_filter: Option>, +} + +impl RequestValue for Trigger {} +impl ResponseResult for Trigger {} + + +/// Publish container version response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers versions publish accounts](struct.AccountContainerVersionPublishCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PublishContainerVersionResponse { + /// The container version created. + #[serde(rename="containerVersion")] + pub container_version: Option, + /// Compiler errors or not. + #[serde(rename="compilerError")] + pub compiler_error: Option, +} + +impl ResponseResult for PublishContainerVersionResponse {} + + +/// A list of workspaces in a container. +/// +/// # 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*). +/// +/// * [containers workspaces list accounts](struct.AccountContainerWorkspaceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListWorkspacesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All Workspaces of a GTM Container. + pub workspace: Option>, +} + +impl ResponseResult for ListWorkspacesResponse {} + + +/// Represents a Google Tag Manager Tag. +/// +/// # 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*). +/// +/// * [containers workspaces tags get accounts](struct.AccountContainerWorkspaceTagGetCall.html) (response) +/// * [containers workspaces tags update accounts](struct.AccountContainerWorkspaceTagUpdateCall.html) (request|response) +/// * [containers workspaces tags create accounts](struct.AccountContainerWorkspaceTagCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Tag { + /// The start timestamp in milliseconds to schedule a tag. + #[serde(rename="scheduleStartMs")] + pub schedule_start_ms: Option, + /// The end timestamp in milliseconds to schedule a tag. + #[serde(rename="scheduleEndMs")] + pub schedule_end_ms: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// Option to fire this tag. + #[serde(rename="tagFiringOption")] + pub tag_firing_option: Option, + /// The Tag ID uniquely identifies the GTM Tag. + #[serde(rename="tagId")] + pub tag_id: Option, + /// The list of setup tags. Currently we only allow one. + #[serde(rename="setupTag")] + pub setup_tag: Option>, + /// Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire. + #[serde(rename="blockingRuleId")] + pub blocking_rule_id: Option>, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified. + pub fingerprint: Option, + /// Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false. + #[serde(rename="firingRuleId")] + pub firing_rule_id: Option>, + /// GTM Tag's API relative path. + pub path: Option, + /// The list of teardown tags. Currently we only allow one. + #[serde(rename="teardownTag")] + pub teardown_tag: Option>, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false. + #[serde(rename="firingTriggerId")] + pub firing_trigger_id: Option>, + /// Tag display name. + pub name: Option, + /// The tag's parameters. + pub parameter: Option>, + /// User notes on how to apply this tag in the container. + pub notes: Option, + /// Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire. + #[serde(rename="blockingTriggerId")] + pub blocking_trigger_id: Option>, + /// User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0. + pub priority: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode). + #[serde(rename="liveOnly")] + pub live_only: Option, + /// GTM Tag Type. + #[serde(rename="type")] + pub type_: Option, + /// Parent folder id. + #[serde(rename="parentFolderId")] + pub parent_folder_id: Option, +} + +impl RequestValue for Tag {} +impl ResponseResult for Tag {} + + +/// Represents a Google Tag Manager Folder's contents. +/// +/// # 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*). +/// +/// * [containers workspaces folders entities accounts](struct.AccountContainerWorkspaceFolderEntityCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FolderEntities { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of variables inside the folder. + pub variable: Option>, + /// The list of triggers inside the folder. + pub trigger: Option>, + /// The list of tags inside the folder. + pub tag: Option>, +} + +impl ResponseResult for FolderEntities {} + + +/// Create container versions response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers workspaces create_version accounts](struct.AccountContainerWorkspaceCreateVersionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateContainerVersionResponse { + /// Auto generated workspace path created as a result of version creation. This field should only be populated if the created version was not a quick preview. + #[serde(rename="newWorkspacePath")] + pub new_workspace_path: Option, + /// The container version created. + #[serde(rename="containerVersion")] + pub container_version: Option, + /// Whether version creation failed when syncing the workspace to the latest container version. + #[serde(rename="syncStatus")] + pub sync_status: Option, + /// Compiler errors or not. + #[serde(rename="compilerError")] + pub compiler_error: Option, +} + +impl ResponseResult for CreateContainerVersionResponse {} + + +/// Represents a Google Tag Manager Container Workspace. +/// +/// # 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*). +/// +/// * [containers workspaces get accounts](struct.AccountContainerWorkspaceGetCall.html) (response) +/// * [containers workspaces update accounts](struct.AccountContainerWorkspaceUpdateCall.html) (request|response) +/// * [containers workspaces create accounts](struct.AccountContainerWorkspaceCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Workspace { + /// Workspace description. + pub description: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// The Workspace ID uniquely identifies the GTM Workspace. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Workspace as computed at storage time. This value is recomputed whenever the workspace is modified. + pub fingerprint: Option, + /// GTM Workspace's API relative path. + pub path: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Workspace display name. + pub name: Option, +} + +impl RequestValue for Workspace {} +impl ResponseResult for Workspace {} + + +/// Represents a Zone's boundaries. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneBoundary { + /// The conditions that, when conjoined, make up the boundary. + pub condition: Option>, + /// Custom evaluation trigger IDs. A zone will evaluate its boundary conditions when any of the listed triggers are true. + #[serde(rename="customEvaluationTriggerId")] + pub custom_evaluation_trigger_id: Option>, +} + +impl Part for ZoneBoundary {} + + +/// List user permissions response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [user_permissions list accounts](struct.AccountUserPermissionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListUserPermissionsResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All GTM UserPermissions of a GTM Account. + #[serde(rename="userPermission")] + pub user_permission: Option>, +} + +impl ResponseResult for ListUserPermissionsResponse {} + + +/// Creates a workspace proposal to start a review of a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces proposal create accounts](struct.AccountContainerWorkspaceProposalCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateWorkspaceProposalRequest { + /// List of users to review the workspace proposal. + pub reviewers: Option>, + /// If present, an initial comment to associate with the workspace proposal. + #[serde(rename="initialComment")] + pub initial_comment: Option, +} + +impl RequestValue for CreateWorkspaceProposalRequest {} + + +/// List Tags Response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers workspaces tags list accounts](struct.AccountContainerWorkspaceTagListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTagsResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All GTM Tags of a GTM Container. + pub tag: Option>, +} + +impl ResponseResult for ListTagsResponse {} + + +/// A comment from the reviewer or author. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkspaceProposalHistoryComment { + /// The contents of the reviewer or author comment. + pub content: Option, +} + +impl Part for WorkspaceProposalHistoryComment {} + + +/// Options for new container versions. +/// +/// # 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*). +/// +/// * [containers workspaces create_version accounts](struct.AccountContainerWorkspaceCreateVersionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateContainerVersionRequestVersionOptions { + /// The notes of the container version to be created. + pub notes: Option, + /// The name of the container version to be created. + pub name: Option, +} + +impl RequestValue for CreateContainerVersionRequestVersionOptions {} + + +/// A workspace entity that may represent a tag, trigger, variable, or folder in addition to its status in the workspace. +/// +/// # 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*). +/// +/// * [containers workspaces resolve_conflict accounts](struct.AccountContainerWorkspaceResolveConflictCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Entity { + /// The variable being represented by the entity. + pub variable: Option, + /// Represents how the entity has been changed in the workspace. + #[serde(rename="changeStatus")] + pub change_status: Option, + /// The trigger being represented by the entity. + pub trigger: Option, + /// The tag being represented by the entity. + pub tag: Option, + /// The Folder being represented by the entity. + pub folder: Option, +} + +impl RequestValue for Entity {} + + +/// The result of reverting a built-in variable in a workspace. +/// +/// # 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*). +/// +/// * [containers workspaces built_in_variables revert accounts](struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevertBuiltInVariableResponse { + /// Whether the built-in variable is enabled after reversion. + pub enabled: Option, +} + +impl ResponseResult for RevertBuiltInVariableResponse {} + + +/// A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings. See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). +/// +/// # Examples +/// +/// Example 1: Compute Timestamp from POSIX `time()`. +/// +/// Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); +/// +/// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +/// +/// struct timeval tv; gettimeofday(&tv, NULL); +/// +/// Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); +/// +/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +/// +/// FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +/// +/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +/// +/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +/// +/// long millis = System.currentTimeMillis(); +/// +/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); +/// +/// +/// +/// Example 5: Compute Timestamp from current time in Python. +/// +/// timestamp = Timestamp() timestamp.GetCurrentTime() +/// +/// # JSON Mapping +/// +/// In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required, though only UTC (as indicated by "Z") is presently supported. +/// +/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. +/// +/// In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) to obtain a formatter capable of generating timestamps in this 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 Timestamp { + /// Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. + pub nanos: Option, + /// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. + pub seconds: Option, +} + +impl Part for Timestamp {} + + +/// Represents a tag that fires after another tag in order to tear down dependencies. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TeardownTag { + /// If true, fire the teardown tag if and only if the main tag fires successfully. If false, fire the teardown tag regardless of main tag firing status. + #[serde(rename="stopTeardownOnFailure")] + pub stop_teardown_on_failure: Option, + /// The name of the teardown tag. + #[serde(rename="tagName")] + pub tag_name: Option, +} + +impl Part for TeardownTag {} + + +/// Updates a workspace proposal with patch-like semantics. +/// +/// # 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*). +/// +/// * [containers workspaces update proposal accounts](struct.AccountContainerWorkspaceUpdateProposalCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateWorkspaceProposalRequest { + /// If present, the status of the workspace proposal is updated. + pub status: Option, + /// If present, the list of reviewers of the workspace proposal is updated. + pub reviewers: Option>, + /// If present, a new comment is added to the workspace proposal history. + #[serde(rename="newComment")] + pub new_comment: Option, + /// When provided, this fingerprint must match the fingerprint of the proposal in storage. + pub fingerprint: Option, +} + +impl RequestValue for UpdateWorkspaceProposalRequest {} + + +/// List container versions response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers version_headers list accounts](struct.AccountContainerVersionHeaderListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListContainerVersionsResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// All container version headers of a GTM Container. + #[serde(rename="containerVersionHeader")] + pub container_version_header: Option>, +} + +impl ResponseResult for ListContainerVersionsResponse {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *account* resources. +/// It is not used directly, but through the `TagManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_tagmanager2 as tagmanager2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use tagmanager2::TagManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `containers_create(...)`, `containers_delete(...)`, `containers_environments_create(...)`, `containers_environments_delete(...)`, `containers_environments_get(...)`, `containers_environments_list(...)`, `containers_environments_patch(...)`, `containers_environments_reauthorize(...)`, `containers_environments_update(...)`, `containers_get(...)`, `containers_list(...)`, `containers_update(...)`, `containers_version_headers_latest(...)`, `containers_version_headers_list(...)`, `containers_versions_delete(...)`, `containers_versions_get(...)`, `containers_versions_live(...)`, `containers_versions_publish(...)`, `containers_versions_set_latest(...)`, `containers_versions_undelete(...)`, `containers_versions_update(...)`, `containers_workspaces_built_in_variables_create(...)`, `containers_workspaces_built_in_variables_delete(...)`, `containers_workspaces_built_in_variables_list(...)`, `containers_workspaces_built_in_variables_revert(...)`, `containers_workspaces_create(...)`, `containers_workspaces_create_version(...)`, `containers_workspaces_delete(...)`, `containers_workspaces_folders_create(...)`, `containers_workspaces_folders_delete(...)`, `containers_workspaces_folders_entities(...)`, `containers_workspaces_folders_get(...)`, `containers_workspaces_folders_list(...)`, `containers_workspaces_folders_move_entities_to_folder(...)`, `containers_workspaces_folders_revert(...)`, `containers_workspaces_folders_update(...)`, `containers_workspaces_get(...)`, `containers_workspaces_get_proposal(...)`, `containers_workspaces_get_status(...)`, `containers_workspaces_list(...)`, `containers_workspaces_proposal_create(...)`, `containers_workspaces_proposal_delete(...)`, `containers_workspaces_quick_preview(...)`, `containers_workspaces_resolve_conflict(...)`, `containers_workspaces_sync(...)`, `containers_workspaces_tags_create(...)`, `containers_workspaces_tags_delete(...)`, `containers_workspaces_tags_get(...)`, `containers_workspaces_tags_list(...)`, `containers_workspaces_tags_revert(...)`, `containers_workspaces_tags_update(...)`, `containers_workspaces_triggers_create(...)`, `containers_workspaces_triggers_delete(...)`, `containers_workspaces_triggers_get(...)`, `containers_workspaces_triggers_list(...)`, `containers_workspaces_triggers_revert(...)`, `containers_workspaces_triggers_update(...)`, `containers_workspaces_update(...)`, `containers_workspaces_update_proposal(...)`, `containers_workspaces_variables_create(...)`, `containers_workspaces_variables_delete(...)`, `containers_workspaces_variables_get(...)`, `containers_workspaces_variables_list(...)`, `containers_workspaces_variables_revert(...)`, `containers_workspaces_variables_update(...)`, `get(...)`, `list(...)`, `update(...)`, `user_permissions_create(...)`, `user_permissions_delete(...)`, `user_permissions_get(...)`, `user_permissions_list(...)` and `user_permissions_update(...)` +/// // to build up your call. +/// let rb = hub.accounts(); +/// # } +/// ``` +pub struct AccountMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, +} + +impl<'a, C, A> MethodsBuilder for AccountMethods<'a, C, A> {} + +impl<'a, C, A> AccountMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_get(&self, path: &str) -> AccountContainerWorkspaceGetCall<'a, C, A> { + AccountContainerWorkspaceGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Moves entities to a GTM Folder. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + pub fn containers_workspaces_folders_move_entities_to_folder(&self, request: Folder, path: &str) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { + AccountContainerWorkspaceFolderMoveEntitiesToFolderCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _variable_id: Default::default(), + _trigger_id: Default::default(), + _tag_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest container version header + /// + /// # Arguments + /// + /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_version_headers_latest(&self, parent: &str) -> AccountContainerVersionHeaderLatestCall<'a, C, A> { + AccountContainerVersionHeaderLatestCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a GTM Trigger. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_triggers_create(&self, request: Trigger, parent: &str) -> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> { + AccountContainerWorkspaceTriggerCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all Workspaces that belong to a GTM Container. + /// + /// # Arguments + /// + /// * `parent` - GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_workspaces_list(&self, parent: &str) -> AccountContainerWorkspaceListCall<'a, C, A> { + AccountContainerWorkspaceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reverts changes to a GTM Built-In Variables in a GTM Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + pub fn containers_workspaces_built_in_variables_revert(&self, path: &str) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> { + AccountContainerWorkspaceBuiltInVariableRevertCall { + hub: self.hub, + _path: path.to_string(), + _type_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes one or more GTM Built-In Variables. + /// + /// # Arguments + /// + /// * `path` - GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + pub fn containers_workspaces_built_in_variables_delete(&self, path: &str) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> { + AccountContainerWorkspaceBuiltInVariableDeleteCall { + hub: self.hub, + _path: path.to_string(), + _type_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a GTM Environment. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_environments_create(&self, request: Environment, parent: &str) -> AccountContainerEnvironmentCreateCall<'a, C, A> { + AccountContainerEnvironmentCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Publishes a Container Version. + /// + /// # Arguments + /// + /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + pub fn containers_versions_publish(&self, path: &str) -> AccountContainerVersionPublishCall<'a, C, A> { + AccountContainerVersionPublishCall { + hub: self.hub, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Folder. + /// + /// # Arguments + /// + /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + pub fn containers_workspaces_folders_get(&self, path: &str) -> AccountContainerWorkspaceFolderGetCall<'a, C, A> { + AccountContainerWorkspaceFolderGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a GTM Tag. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_tags_create(&self, request: Tag, parent: &str) -> AccountContainerWorkspaceTagCreateCall<'a, C, A> { + AccountContainerWorkspaceTagCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a GTM Environment. + /// + /// # Arguments + /// + /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + pub fn containers_environments_delete(&self, path: &str) -> AccountContainerEnvironmentDeleteCall<'a, C, A> { + AccountContainerEnvironmentDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a Container. + /// + /// # Arguments + /// + /// * `path` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_get(&self, path: &str) -> AccountContainerGetCall<'a, C, A> { + AccountContainerGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a user's Account & Container access. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Account's API relative path. Example: accounts/{account_id} + pub fn user_permissions_create(&self, request: UserPermission, parent: &str) -> AccountUserPermissionCreateCall<'a, C, A> { + AccountUserPermissionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all GTM Folders of a Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_folders_list(&self, parent: &str) -> AccountContainerWorkspaceFolderListCall<'a, C, A> { + AccountContainerWorkspaceFolderListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Re-generates the authorization code for a GTM Environment. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + pub fn containers_environments_reauthorize(&self, request: Environment, path: &str) -> AccountContainerEnvironmentReauthorizeCall<'a, C, A> { + AccountContainerEnvironmentReauthorizeCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_delete(&self, path: &str) -> AccountContainerWorkspaceDeleteCall<'a, C, A> { + AccountContainerWorkspaceDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Workspace Proposal. + /// + /// # Arguments + /// + /// * `path` - GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + pub fn containers_workspaces_get_proposal(&self, path: &str) -> AccountContainerWorkspaceGetProposalCall<'a, C, A> { + AccountContainerWorkspaceGetProposalCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List all users that have access to the account along with Account and Container user access granted to each of them. + /// + /// # Arguments + /// + /// * `parent` - GTM Accounts's API relative path. Example: accounts/{account_id} + pub fn user_permissions_list(&self, parent: &str) -> AccountUserPermissionListCall<'a, C, A> { + AccountUserPermissionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a GTM Folder. + /// + /// # Arguments + /// + /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + pub fn containers_workspaces_folders_delete(&self, path: &str) -> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> { + AccountContainerWorkspaceFolderDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Quick previews a workspace by creating a fake container version from all entities in the provided workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_quick_preview(&self, path: &str) -> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> { + AccountContainerWorkspaceQuickPreviewCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Variable. + /// + /// # Arguments + /// + /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + pub fn containers_workspaces_variables_get(&self, path: &str) -> AccountContainerWorkspaceVariableGetCall<'a, C, A> { + AccountContainerWorkspaceVariableGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the latest version used for synchronization of workspaces when detecting conflicts and errors. + /// + /// # Arguments + /// + /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + pub fn containers_versions_set_latest(&self, path: &str) -> AccountContainerVersionSetLatestCall<'a, C, A> { + AccountContainerVersionSetLatestCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Variable. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + pub fn containers_workspaces_variables_update(&self, request: Variable, path: &str) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> { + AccountContainerWorkspaceVariableUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all GTM Environments of a GTM Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_environments_list(&self, parent: &str) -> AccountContainerEnvironmentListCall<'a, C, A> { + AccountContainerEnvironmentListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all GTM Tags of a Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_tags_list(&self, parent: &str) -> AccountContainerWorkspaceTagListCall<'a, C, A> { + AccountContainerWorkspaceTagListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Undeletes a Container Version. + /// + /// # Arguments + /// + /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + pub fn containers_versions_undelete(&self, path: &str) -> AccountContainerVersionUndeleteCall<'a, C, A> { + AccountContainerVersionUndeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all GTM Triggers of a Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_triggers_list(&self, parent: &str) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> { + AccountContainerWorkspaceTriggerListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_create_version(&self, request: CreateContainerVersionRequestVersionOptions, path: &str) -> AccountContainerWorkspaceCreateVersionCall<'a, C, A> { + AccountContainerWorkspaceCreateVersionCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a Container. + /// + /// # Arguments + /// + /// * `path` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_delete(&self, path: &str) -> AccountContainerDeleteCall<'a, C, A> { + AccountContainerDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a Workspace. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_workspaces_create(&self, request: Workspace, parent: &str) -> AccountContainerWorkspaceCreateCall<'a, C, A> { + AccountContainerWorkspaceCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Account. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Accounts's API relative path. Example: accounts/{account_id} + pub fn update(&self, request: Account, path: &str) -> AccountUpdateCall<'a, C, A> { + AccountUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all Container Versions of a GTM Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_version_headers_list(&self, parent: &str) -> AccountContainerVersionHeaderListCall<'a, C, A> { + AccountContainerVersionHeaderListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _include_deleted: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the enabled Built-In Variables of a GTM Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_built_in_variables_list(&self, parent: &str) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> { + AccountContainerWorkspaceBuiltInVariableListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a user's Account & Container access. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + pub fn user_permissions_update(&self, request: UserPermission, path: &str) -> AccountUserPermissionUpdateCall<'a, C, A> { + AccountUserPermissionUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Environment. + /// + /// # Arguments + /// + /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + pub fn containers_environments_get(&self, path: &str) -> AccountContainerEnvironmentGetCall<'a, C, A> { + AccountContainerEnvironmentGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Account. + /// + /// # Arguments + /// + /// * `path` - GTM Accounts's API relative path. Example: accounts/{account_id} + pub fn get(&self, path: &str) -> AccountGetCall<'a, C, A> { + AccountGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the live (i.e. published) container version + /// + /// # Arguments + /// + /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_versions_live(&self, parent: &str) -> AccountContainerVersionLiveCall<'a, C, A> { + AccountContainerVersionLiveCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all GTM Accounts that a user has access to. + pub fn list(&self) -> AccountListCall<'a, C, A> { + AccountListCall { + hub: self.hub, + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all GTM Variables of a Container. + /// + /// # Arguments + /// + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_variables_list(&self, parent: &str) -> AccountContainerWorkspaceVariableListCall<'a, C, A> { + AccountContainerWorkspaceVariableListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reverts changes to a GTM Variable in a GTM Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + pub fn containers_workspaces_variables_revert(&self, path: &str) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> { + AccountContainerWorkspaceVariableRevertCall { + hub: self.hub, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List all entities in a GTM Folder. + /// + /// # Arguments + /// + /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + pub fn containers_workspaces_folders_entities(&self, path: &str) -> AccountContainerWorkspaceFolderEntityCall<'a, C, A> { + AccountContainerWorkspaceFolderEntityCall { + hub: self.hub, + _path: path.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a GTM Folder. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_folders_create(&self, request: Folder, parent: &str) -> AccountContainerWorkspaceFolderCreateCall<'a, C, A> { + AccountContainerWorkspaceFolderCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Finds conflicting and modified entities in the workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_get_status(&self, path: &str) -> AccountContainerWorkspaceGetStatuCall<'a, C, A> { + AccountContainerWorkspaceGetStatuCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a GTM Tag. + /// + /// # Arguments + /// + /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + pub fn containers_workspaces_tags_delete(&self, path: &str) -> AccountContainerWorkspaceTagDeleteCall<'a, C, A> { + AccountContainerWorkspaceTagDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a Container. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + pub fn containers_update(&self, request: Container, path: &str) -> AccountContainerUpdateCall<'a, C, A> { + AccountContainerUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Environment. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + pub fn containers_environments_patch(&self, request: Environment, path: &str) -> AccountContainerEnvironmentPatchCall<'a, C, A> { + AccountContainerEnvironmentPatchCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Folder. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + pub fn containers_workspaces_folders_update(&self, request: Folder, path: &str) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> { + AccountContainerWorkspaceFolderUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates one or more GTM Built-In Variables. + /// + /// # Arguments + /// + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_built_in_variables_create(&self, parent: &str) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> { + AccountContainerWorkspaceBuiltInVariableCreateCall { + hub: self.hub, + _parent: parent.to_string(), + _type_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a GTM Workspace Proposal. + /// + /// # Arguments + /// + /// * `path` - GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + pub fn containers_workspaces_proposal_delete(&self, path: &str) -> AccountContainerWorkspaceProposalDeleteCall<'a, C, A> { + AccountContainerWorkspaceProposalDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all Containers that belongs to a GTM Account. + /// + /// # Arguments + /// + /// * `parent` - GTM Accounts's API relative path. Example: accounts/{account_id}. + pub fn containers_list(&self, parent: &str) -> AccountContainerListCall<'a, C, A> { + AccountContainerListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a GTM Trigger. + /// + /// # Arguments + /// + /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + pub fn containers_workspaces_triggers_delete(&self, path: &str) -> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> { + AccountContainerWorkspaceTriggerDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities. + /// + /// # Arguments + /// + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_sync(&self, path: &str) -> AccountContainerWorkspaceSyncCall<'a, C, A> { + AccountContainerWorkspaceSyncCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reverts changes to a GTM Tag in a GTM Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + pub fn containers_workspaces_tags_revert(&self, path: &str) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> { + AccountContainerWorkspaceTagRevertCall { + hub: self.hub, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a Container Version. + /// + /// # Arguments + /// + /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + pub fn containers_versions_delete(&self, path: &str) -> AccountContainerVersionDeleteCall<'a, C, A> { + AccountContainerVersionDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Tag. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + pub fn containers_workspaces_tags_update(&self, request: Tag, path: &str) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> { + AccountContainerWorkspaceTagUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a Container. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Account's API relative path. Example: accounts/{account_id}. + pub fn containers_create(&self, request: Container, parent: &str) -> AccountContainerCreateCall<'a, C, A> { + AccountContainerCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Trigger. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + pub fn containers_workspaces_triggers_update(&self, request: Trigger, path: &str) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> { + AccountContainerWorkspaceTriggerUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a GTM Variable. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_variables_create(&self, request: Variable, parent: &str) -> AccountContainerWorkspaceVariableCreateCall<'a, C, A> { + AccountContainerWorkspaceVariableCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a user's Account & Container access. + /// + /// # Arguments + /// + /// * `path` - GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + pub fn user_permissions_get(&self, path: &str) -> AccountUserPermissionGetCall<'a, C, A> { + AccountUserPermissionGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reverts changes to a GTM Trigger in a GTM Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + pub fn containers_workspaces_triggers_revert(&self, path: &str) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> { + AccountContainerWorkspaceTriggerRevertCall { + hub: self.hub, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a GTM Variable. + /// + /// # Arguments + /// + /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + pub fn containers_workspaces_variables_delete(&self, path: &str) -> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> { + AccountContainerWorkspaceVariableDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Tag. + /// + /// # Arguments + /// + /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + pub fn containers_workspaces_tags_get(&self, path: &str) -> AccountContainerWorkspaceTagGetCall<'a, C, A> { + AccountContainerWorkspaceTagGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_resolve_conflict(&self, request: Entity, path: &str) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> { + AccountContainerWorkspaceResolveConflictCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Environment. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + pub fn containers_environments_update(&self, request: Environment, path: &str) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { + AccountContainerEnvironmentUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a GTM Trigger. + /// + /// # Arguments + /// + /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + pub fn containers_workspaces_triggers_get(&self, path: &str) -> AccountContainerWorkspaceTriggerGetCall<'a, C, A> { + AccountContainerWorkspaceTriggerGetCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reverts changes to a GTM Folder in a GTM Workspace. + /// + /// # Arguments + /// + /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + pub fn containers_workspaces_folders_revert(&self, path: &str) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> { + AccountContainerWorkspaceFolderRevertCall { + hub: self.hub, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a GTM Workspace Proposal. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid} + pub fn containers_workspaces_proposal_create(&self, request: CreateWorkspaceProposalRequest, parent: &str) -> AccountContainerWorkspaceProposalCreateCall<'a, C, A> { + AccountContainerWorkspaceProposalCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a Container Version. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + pub fn containers_versions_update(&self, request: ContainerVersion, path: &str) -> AccountContainerVersionUpdateCall<'a, C, A> { + AccountContainerVersionUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a Container Version. + /// + /// # Arguments + /// + /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + pub fn containers_versions_get(&self, path: &str) -> AccountContainerVersionGetCall<'a, C, A> { + AccountContainerVersionGetCall { + hub: self.hub, + _path: path.to_string(), + _container_version_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a Workspace. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + pub fn containers_workspaces_update(&self, request: Workspace, path: &str) -> AccountContainerWorkspaceUpdateCall<'a, C, A> { + AccountContainerWorkspaceUpdateCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _fingerprint: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a GTM Workspace Proposal. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `path` - GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + pub fn containers_workspaces_update_proposal(&self, request: UpdateWorkspaceProposalRequest, path: &str) -> AccountContainerWorkspaceUpdateProposalCall<'a, C, A> { + AccountContainerWorkspaceUpdateProposalCall { + hub: self.hub, + _request: request, + _path: path.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Removes a user from the account, revoking access to it and all of its containers. + /// + /// # Arguments + /// + /// * `path` - GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + pub fn user_permissions_delete(&self, path: &str) -> AccountUserPermissionDeleteCall<'a, C, A> { + AccountUserPermissionDeleteCall { + hub: self.hub, + _path: path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Gets a Workspace. +/// +/// A builder for the *containers.workspaces.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceGetCall<'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, Workspace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceGetCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceGetCall<'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) -> AccountContainerWorkspaceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Moves entities to a GTM Folder. +/// +/// A builder for the *containers.workspaces.folders.move_entities_to_folder* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Folder; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Folder::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.accounts().containers_workspaces_folders_move_entities_to_folder(req, "path") +/// .add_variable_id("nonumy") +/// .add_trigger_id("dolores") +/// .add_tag_id("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Folder, + _path: String, + _variable_id: Vec, + _trigger_id: Vec, + _tag_id: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if self._variable_id.len() > 0 { + for f in self._variable_id.iter() { + params.push(("variableId", f.to_string())); + } + } + if self._trigger_id.len() > 0 { + for f in self._trigger_id.iter() { + params.push(("triggerId", f.to_string())); + } + } + if self._tag_id.len() > 0 { + for f in self._tag_id.iter() { + params.push(("tagId", f.to_string())); + } + } + for &field in ["path", "variableId", "triggerId", "tagId"].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 = self.hub._base_url.clone() + "{+path}:move_entities_to_folder"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Folder) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// The variables to be moved to the folder. + /// + /// Append the given value to the *variable id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_variable_id(mut self, new_value: &str) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { + self._variable_id.push(new_value.to_string()); + self + } + /// The triggers to be moved to the folder. + /// + /// Append the given value to the *trigger id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_trigger_id(mut self, new_value: &str) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { + self._trigger_id.push(new_value.to_string()); + self + } + /// The tags to be moved to the folder. + /// + /// Append the given value to the *tag id* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_tag_id(mut self, new_value: &str) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { + self._tag_id.push(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) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'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) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest container version header +/// +/// A builder for the *containers.version_headers.latest* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_version_headers_latest("parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionHeaderLatestCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionHeaderLatestCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionHeaderLatestCall<'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, ContainerVersionHeader)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.version_headers.latest", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/version_headers:latest"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerVersionHeaderLatestCall<'a, C, A> { + self._parent = 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) -> AccountContainerVersionHeaderLatestCall<'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) -> AccountContainerVersionHeaderLatestCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionHeaderLatestCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a GTM Trigger. +/// +/// A builder for the *containers.workspaces.triggers.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Trigger; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Trigger::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.accounts().containers_workspaces_triggers_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTriggerCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Trigger, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTriggerCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTriggerCreateCall<'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, Trigger)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.triggers.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/triggers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Trigger) -> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerWorkspaceTriggerCreateCall<'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) -> AccountContainerWorkspaceTriggerCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all Workspaces that belong to a GTM Container. +/// +/// A builder for the *containers.workspaces.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_list("parent") +/// .page_token("no") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceListCall<'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, ListWorkspacesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/workspaces"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceListCall<'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) -> AccountContainerWorkspaceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reverts changes to a GTM Built-In Variables in a GTM Workspace. +/// +/// A builder for the *containers.workspaces.built_in_variables.revert* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_built_in_variables_revert("path") +/// .type_("justo") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _type_: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableRevertCall<'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, RevertBuiltInVariableResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.built_in_variables.revert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } + for &field in ["alt", "path", "type"].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 = self.hub._base_url.clone() + "{+path}/built_in_variables:revert"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// The type of built-in variable to revert. + /// + /// Sets the *type* query property to the given value. + pub fn type_(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> { + self._type_ = 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) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'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) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes one or more GTM Built-In Variables. +/// +/// A builder for the *containers.workspaces.built_in_variables.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_built_in_variables_delete("path") +/// .add_type("et") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _type_: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.built_in_variables.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if self._type_.len() > 0 { + for f in self._type_.iter() { + params.push(("type", f.to_string())); + } + } + for &field in ["path", "type"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// The types of built-in variables to delete. + /// + /// Append the given value to the *type* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_type(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> { + self._type_.push(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) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'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) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a GTM Environment. +/// +/// A builder for the *containers.environments.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Environment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Environment::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.accounts().containers_environments_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Environment, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentCreateCall<'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, Environment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/environments"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Environment) -> AccountContainerEnvironmentCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerEnvironmentCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerEnvironmentCreateCall<'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) -> AccountContainerEnvironmentCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Publishes a Container Version. +/// +/// A builder for the *containers.versions.publish* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_versions_publish("path") +/// .fingerprint("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionPublishCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionPublishCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionPublishCall<'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, PublishContainerVersionResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.publish", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}:publish"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Publish.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerVersionPublishCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the container version in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerVersionPublishCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerVersionPublishCall<'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) -> AccountContainerVersionPublishCall<'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::Publish`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionPublishCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Folder. +/// +/// A builder for the *containers.workspaces.folders.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_folders_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderGetCall<'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, Folder)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceFolderGetCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceFolderGetCall<'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) -> AccountContainerWorkspaceFolderGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a GTM Tag. +/// +/// A builder for the *containers.workspaces.tags.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Tag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Tag::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.accounts().containers_workspaces_tags_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTagCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Tag, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTagCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTagCreateCall<'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, Tag)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.tags.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/tags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Tag) -> AccountContainerWorkspaceTagCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceTagCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerWorkspaceTagCreateCall<'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) -> AccountContainerWorkspaceTagCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTagCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a GTM Environment. +/// +/// A builder for the *containers.environments.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_environments_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerEnvironmentDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerEnvironmentDeleteCall<'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) -> AccountContainerEnvironmentDeleteCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a Container. +/// +/// A builder for the *containers.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerGetCall<'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, Container)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerGetCall<'a, C, A> { + self._path = 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) -> AccountContainerGetCall<'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) -> AccountContainerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a user's Account & Container access. +/// +/// A builder for the *user_permissions.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::UserPermission; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UserPermission::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.accounts().user_permissions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserPermissionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: UserPermission, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserPermissionCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountUserPermissionCreateCall<'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, UserPermission)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.user_permissions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/user_permissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UserPermission) -> AccountUserPermissionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Account's API relative path. Example: accounts/{account_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountUserPermissionCreateCall<'a, C, A> { + self._parent = 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) -> AccountUserPermissionCreateCall<'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) -> AccountUserPermissionCreateCall<'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::ManageUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserPermissionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all GTM Folders of a Container. +/// +/// A builder for the *containers.workspaces.folders.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_folders_list("parent") +/// .page_token("erat") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderListCall<'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, ListFoldersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/folders"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceFolderListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceFolderListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceFolderListCall<'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) -> AccountContainerWorkspaceFolderListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Re-generates the authorization code for a GTM Environment. +/// +/// A builder for the *containers.environments.reauthorize* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Environment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Environment::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.accounts().containers_environments_reauthorize(req, "path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentReauthorizeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Environment, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentReauthorizeCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentReauthorizeCall<'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, Environment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.reauthorize", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}:reauthorize"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Publish.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Environment) -> AccountContainerEnvironmentReauthorizeCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerEnvironmentReauthorizeCall<'a, C, A> { + self._path = 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) -> AccountContainerEnvironmentReauthorizeCall<'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) -> AccountContainerEnvironmentReauthorizeCall<'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::Publish`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentReauthorizeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a Workspace. +/// +/// A builder for the *containers.workspaces.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DeleteContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceDeleteCall<'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) -> AccountContainerWorkspaceDeleteCall<'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::DeleteContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Workspace Proposal. +/// +/// A builder for the *containers.workspaces.getProposal* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_get_proposal("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceGetProposalCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceGetProposalCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceGetProposalCall<'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, WorkspaceProposal)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.getProposal", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + + 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 [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceGetProposalCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceGetProposalCall<'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) -> AccountContainerWorkspaceGetProposalCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// List all users that have access to the account along with Account and Container user access granted to each of them. +/// +/// A builder for the *user_permissions.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().user_permissions_list("parent") +/// .page_token("amet") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserPermissionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserPermissionListCall<'a, C, A> {} + +impl<'a, C, A> AccountUserPermissionListCall<'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, ListUserPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.user_permissions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/user_permissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Accounts's API relative path. Example: accounts/{account_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountUserPermissionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountUserPermissionListCall<'a, C, A> { + self._page_token = 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) -> AccountUserPermissionListCall<'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) -> AccountUserPermissionListCall<'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::ManageUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserPermissionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a GTM Folder. +/// +/// A builder for the *containers.workspaces.folders.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_folders_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceFolderDeleteCall<'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) -> AccountContainerWorkspaceFolderDeleteCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Quick previews a workspace by creating a fake container version from all entities in the provided workspace. +/// +/// A builder for the *containers.workspaces.quick_preview* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_quick_preview("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceQuickPreviewCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceQuickPreviewCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceQuickPreviewCall<'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, QuickPreviewResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.quick_preview", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}:quick_preview"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceQuickPreviewCall<'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) -> AccountContainerWorkspaceQuickPreviewCall<'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::EditContainerversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Variable. +/// +/// A builder for the *containers.workspaces.variables.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_variables_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceVariableGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceVariableGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceVariableGetCall<'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, Variable)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.variables.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceVariableGetCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceVariableGetCall<'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) -> AccountContainerWorkspaceVariableGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceVariableGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the latest version used for synchronization of workspaces when detecting conflicts and errors. +/// +/// A builder for the *containers.versions.set_latest* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_versions_set_latest("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionSetLatestCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionSetLatestCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionSetLatestCall<'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, ContainerVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.set_latest", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}:set_latest"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerVersionSetLatestCall<'a, C, A> { + self._path = 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) -> AccountContainerVersionSetLatestCall<'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) -> AccountContainerVersionSetLatestCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionSetLatestCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Variable. +/// +/// A builder for the *containers.workspaces.variables.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Variable; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Variable::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.accounts().containers_workspaces_variables_update(req, "path") +/// .fingerprint("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceVariableUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Variable, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceVariableUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceVariableUpdateCall<'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, Variable)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.variables.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Variable) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the variable in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceVariableUpdateCall<'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) -> AccountContainerWorkspaceVariableUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all GTM Environments of a GTM Container. +/// +/// A builder for the *containers.environments.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_environments_list("parent") +/// .page_token("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentListCall<'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, ListEnvironmentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/environments"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerEnvironmentListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerEnvironmentListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerEnvironmentListCall<'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) -> AccountContainerEnvironmentListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all GTM Tags of a Container. +/// +/// A builder for the *containers.workspaces.tags.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_tags_list("parent") +/// .page_token("et") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTagListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTagListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTagListCall<'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, ListTagsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.tags.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/tags"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceTagListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceTagListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceTagListCall<'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) -> AccountContainerWorkspaceTagListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTagListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Undeletes a Container Version. +/// +/// A builder for the *containers.versions.undelete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_versions_undelete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionUndeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionUndeleteCall<'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, ContainerVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.undelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}:undelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerVersionUndeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerVersionUndeleteCall<'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) -> AccountContainerVersionUndeleteCall<'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::EditContainerversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionUndeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all GTM Triggers of a Container. +/// +/// A builder for the *containers.workspaces.triggers.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_triggers_list("parent") +/// .page_token("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTriggerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTriggerListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTriggerListCall<'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, ListTriggersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.triggers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/triggers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceTriggerListCall<'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) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version. +/// +/// A builder for the *containers.workspaces.create_version* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::CreateContainerVersionRequestVersionOptions; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateContainerVersionRequestVersionOptions::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.accounts().containers_workspaces_create_version(req, "path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceCreateVersionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: CreateContainerVersionRequestVersionOptions, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceCreateVersionCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceCreateVersionCall<'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, CreateContainerVersionResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.create_version", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}:create_version"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CreateContainerVersionRequestVersionOptions) -> AccountContainerWorkspaceCreateVersionCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceCreateVersionCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceCreateVersionCall<'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) -> AccountContainerWorkspaceCreateVersionCall<'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::EditContainerversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceCreateVersionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a Container. +/// +/// A builder for the *containers.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DeleteContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerDeleteCall<'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) -> AccountContainerDeleteCall<'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::DeleteContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a Workspace. +/// +/// A builder for the *containers.workspaces.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Workspace; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Workspace::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.accounts().containers_workspaces_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Workspace, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceCreateCall<'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, Workspace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/workspaces"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Workspace) -> AccountContainerWorkspaceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerWorkspaceCreateCall<'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) -> AccountContainerWorkspaceCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Account. +/// +/// A builder for the *update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Account; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Account::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.accounts().update(req, "path") +/// .fingerprint("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct AccountUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Account, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountUpdateCall<'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, Account)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ManageAccount.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Account) -> AccountUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Accounts's API relative path. Example: accounts/{account_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the account in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountUpdateCall<'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) -> AccountUpdateCall<'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::ManageAccount`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all Container Versions of a GTM Container. +/// +/// A builder for the *containers.version_headers.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_version_headers_list("parent") +/// .page_token("ea") +/// .include_deleted(false) +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionHeaderListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _include_deleted: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionHeaderListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionHeaderListCall<'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, ListContainerVersionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.version_headers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._include_deleted { + params.push(("includeDeleted", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "includeDeleted"].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 = self.hub._base_url.clone() + "{+parent}/version_headers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerVersionHeaderListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerVersionHeaderListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Also retrieve deleted (archived) versions when true. + /// + /// Sets the *include deleted* query property to the given value. + pub fn include_deleted(mut self, new_value: bool) -> AccountContainerVersionHeaderListCall<'a, C, A> { + self._include_deleted = 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) -> AccountContainerVersionHeaderListCall<'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) -> AccountContainerVersionHeaderListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionHeaderListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the enabled Built-In Variables of a GTM Container. +/// +/// A builder for the *containers.workspaces.built_in_variables.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_built_in_variables_list("parent") +/// .page_token("dolor") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableListCall<'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, ListEnabledBuiltInVariablesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.built_in_variables.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/built_in_variables"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceBuiltInVariableListCall<'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) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a user's Account & Container access. +/// +/// A builder for the *user_permissions.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::UserPermission; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UserPermission::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.accounts().user_permissions_update(req, "path") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserPermissionUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: UserPermission, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserPermissionUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountUserPermissionUpdateCall<'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, UserPermission)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.user_permissions.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UserPermission) -> AccountUserPermissionUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountUserPermissionUpdateCall<'a, C, A> { + self._path = 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) -> AccountUserPermissionUpdateCall<'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) -> AccountUserPermissionUpdateCall<'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::ManageUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserPermissionUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Environment. +/// +/// A builder for the *containers.environments.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_environments_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentGetCall<'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, Environment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerEnvironmentGetCall<'a, C, A> { + self._path = 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) -> AccountContainerEnvironmentGetCall<'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) -> AccountContainerEnvironmentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Account. +/// +/// A builder for the *get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountGetCall<'a, C, A> {} + +impl<'a, C, A> AccountGetCall<'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, Account)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Accounts's API relative path. Example: accounts/{account_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountGetCall<'a, C, A> { + self._path = 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) -> AccountGetCall<'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) -> AccountGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the live (i.e. published) container version +/// +/// A builder for the *containers.versions.live* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_versions_live("parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionLiveCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionLiveCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionLiveCall<'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, ContainerVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.live", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/versions:live"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerVersionLiveCall<'a, C, A> { + self._parent = 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) -> AccountContainerVersionLiveCall<'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) -> AccountContainerVersionLiveCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionLiveCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all GTM Accounts that a user has access to. +/// +/// A builder for the *list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().list() +/// .page_token("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct AccountListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountListCall<'a, C, A> {} + +impl<'a, C, A> AccountListCall<'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, ListAccountsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "pageToken"].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 = self.hub._base_url.clone() + "accounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountListCall<'a, C, A> { + self._page_token = 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) -> AccountListCall<'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) -> AccountListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all GTM Variables of a Container. +/// +/// A builder for the *containers.workspaces.variables.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_variables_list("parent") +/// .page_token("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceVariableListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceVariableListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceVariableListCall<'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, ListVariablesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.variables.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/variables"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceVariableListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceVariableListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceVariableListCall<'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) -> AccountContainerWorkspaceVariableListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceVariableListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reverts changes to a GTM Variable in a GTM Workspace. +/// +/// A builder for the *containers.workspaces.variables.revert* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_variables_revert("path") +/// .fingerprint("sit") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceVariableRevertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceVariableRevertCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceVariableRevertCall<'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, RevertVariableResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.variables.revert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}:revert"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the variable in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceVariableRevertCall<'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) -> AccountContainerWorkspaceVariableRevertCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List all entities in a GTM Folder. +/// +/// A builder for the *containers.workspaces.folders.entities* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_folders_entities("path") +/// .page_token("diam") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderEntityCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderEntityCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderEntityCall<'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, FolderEntities)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.entities", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "path", "pageToken"].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 = self.hub._base_url.clone() + "{+path}:entities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceFolderEntityCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerWorkspaceFolderEntityCall<'a, C, A> { + self._page_token = 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) -> AccountContainerWorkspaceFolderEntityCall<'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) -> AccountContainerWorkspaceFolderEntityCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderEntityCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a GTM Folder. +/// +/// A builder for the *containers.workspaces.folders.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Folder; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Folder::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.accounts().containers_workspaces_folders_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Folder, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderCreateCall<'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, Folder)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/folders"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Folder) -> AccountContainerWorkspaceFolderCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceFolderCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerWorkspaceFolderCreateCall<'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) -> AccountContainerWorkspaceFolderCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Finds conflicting and modified entities in the workspace. +/// +/// A builder for the *containers.workspaces.getStatus* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_get_status("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceGetStatuCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceGetStatuCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceGetStatuCall<'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, GetWorkspaceStatusResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.getStatus", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}/status"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceGetStatuCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceGetStatuCall<'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) -> AccountContainerWorkspaceGetStatuCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceGetStatuCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a GTM Tag. +/// +/// A builder for the *containers.workspaces.tags.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_tags_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTagDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTagDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTagDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.tags.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTagDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceTagDeleteCall<'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) -> AccountContainerWorkspaceTagDeleteCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTagDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a Container. +/// +/// A builder for the *containers.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Container; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Container::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.accounts().containers_update(req, "path") +/// .fingerprint("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Container, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerUpdateCall<'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, Container)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Container) -> AccountContainerUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the container in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerUpdateCall<'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) -> AccountContainerUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Environment. This method supports patch semantics. +/// +/// A builder for the *containers.environments.patch* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Environment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Environment::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.accounts().containers_environments_patch(req, "path") +/// .fingerprint("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Environment, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentPatchCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentPatchCall<'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, Environment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Environment) -> AccountContainerEnvironmentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerEnvironmentPatchCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the environment in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerEnvironmentPatchCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerEnvironmentPatchCall<'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) -> AccountContainerEnvironmentPatchCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Folder. +/// +/// A builder for the *containers.workspaces.folders.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Folder; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Folder::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.accounts().containers_workspaces_folders_update(req, "path") +/// .fingerprint("duo") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Folder, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderUpdateCall<'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, Folder)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Folder) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the folder in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceFolderUpdateCall<'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) -> AccountContainerWorkspaceFolderUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates one or more GTM Built-In Variables. +/// +/// A builder for the *containers.workspaces.built_in_variables.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_built_in_variables_create("parent") +/// .add_type("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _type_: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableCreateCall<'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, CreateBuiltInVariableResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.built_in_variables.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if self._type_.len() > 0 { + for f in self._type_.iter() { + params.push(("type", f.to_string())); + } + } + for &field in ["alt", "parent", "type"].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 = self.hub._base_url.clone() + "{+parent}/built_in_variables"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The types of built-in variables to enable. + /// + /// Append the given value to the *type* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_type(mut self, new_value: &str) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> { + self._type_.push(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) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'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) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a GTM Workspace Proposal. +/// +/// A builder for the *containers.workspaces.proposal.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_proposal_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceProposalDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceProposalDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceProposalDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.proposal.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + + 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 [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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::Delete, &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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceProposalDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceProposalDeleteCall<'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) -> AccountContainerWorkspaceProposalDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists all Containers that belongs to a GTM Account. +/// +/// A builder for the *containers.list* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_list("parent") +/// .page_token("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerListCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerListCall<'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, ListContainersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].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 = self.hub._base_url.clone() + "{+parent}/containers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Accounts's API relative path. Example: accounts/{account_id}. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountContainerListCall<'a, C, A> { + self._page_token = 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) -> AccountContainerListCall<'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) -> AccountContainerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a GTM Trigger. +/// +/// A builder for the *containers.workspaces.triggers.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_triggers_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.triggers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceTriggerDeleteCall<'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) -> AccountContainerWorkspaceTriggerDeleteCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities. +/// +/// A builder for the *containers.workspaces.sync* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_sync("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceSyncCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceSyncCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceSyncCall<'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, SyncWorkspaceResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.sync", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}:sync"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceSyncCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceSyncCall<'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) -> AccountContainerWorkspaceSyncCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceSyncCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reverts changes to a GTM Tag in a GTM Workspace. +/// +/// A builder for the *containers.workspaces.tags.revert* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_tags_revert("path") +/// .fingerprint("sanctus") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTagRevertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTagRevertCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTagRevertCall<'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, RevertTagResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.tags.revert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}:revert"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of thetag in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceTagRevertCall<'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) -> AccountContainerWorkspaceTagRevertCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a Container Version. +/// +/// A builder for the *containers.versions.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_versions_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerVersionDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerVersionDeleteCall<'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) -> AccountContainerVersionDeleteCall<'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::EditContainerversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Tag. +/// +/// A builder for the *containers.workspaces.tags.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Tag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Tag::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.accounts().containers_workspaces_tags_update(req, "path") +/// .fingerprint("labore") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTagUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Tag, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTagUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTagUpdateCall<'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, Tag)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.tags.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Tag) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the tag in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceTagUpdateCall<'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) -> AccountContainerWorkspaceTagUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a Container. +/// +/// A builder for the *containers.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Container; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Container::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.accounts().containers_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Container, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerCreateCall<'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, Container)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/containers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Container) -> AccountContainerCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Account's API relative path. Example: accounts/{account_id}. + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerCreateCall<'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) -> AccountContainerCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Trigger. +/// +/// A builder for the *containers.workspaces.triggers.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Trigger; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Trigger::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.accounts().containers_workspaces_triggers_update(req, "path") +/// .fingerprint("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Trigger, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTriggerUpdateCall<'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, Trigger)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.triggers.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Trigger) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the trigger in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceTriggerUpdateCall<'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) -> AccountContainerWorkspaceTriggerUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a GTM Variable. +/// +/// A builder for the *containers.workspaces.variables.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Variable; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Variable::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.accounts().containers_workspaces_variables_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceVariableCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Variable, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceVariableCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceVariableCreateCall<'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, Variable)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.variables.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/variables"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Variable) -> AccountContainerWorkspaceVariableCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceVariableCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerWorkspaceVariableCreateCall<'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) -> AccountContainerWorkspaceVariableCreateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceVariableCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a user's Account & Container access. +/// +/// A builder for the *user_permissions.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().user_permissions_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserPermissionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserPermissionGetCall<'a, C, A> {} + +impl<'a, C, A> AccountUserPermissionGetCall<'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, UserPermission)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.user_permissions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountUserPermissionGetCall<'a, C, A> { + self._path = 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) -> AccountUserPermissionGetCall<'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) -> AccountUserPermissionGetCall<'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::ManageUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserPermissionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reverts changes to a GTM Trigger in a GTM Workspace. +/// +/// A builder for the *containers.workspaces.triggers.revert* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_triggers_revert("path") +/// .fingerprint("sed") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTriggerRevertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTriggerRevertCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTriggerRevertCall<'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, RevertTriggerResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.triggers.revert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}:revert"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the trigger in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceTriggerRevertCall<'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) -> AccountContainerWorkspaceTriggerRevertCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a GTM Variable. +/// +/// A builder for the *containers.workspaces.variables.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_variables_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceVariableDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceVariableDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.variables.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceVariableDeleteCall<'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) -> AccountContainerWorkspaceVariableDeleteCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Tag. +/// +/// A builder for the *containers.workspaces.tags.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_tags_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTagGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTagGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTagGetCall<'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, Tag)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.tags.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTagGetCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceTagGetCall<'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) -> AccountContainerWorkspaceTagGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTagGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request. +/// +/// A builder for the *containers.workspaces.resolve_conflict* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Entity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Entity::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.accounts().containers_workspaces_resolve_conflict(req, "path") +/// .fingerprint("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceResolveConflictCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Entity, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceResolveConflictCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceResolveConflictCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.resolve_conflict", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}:resolve_conflict"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Entity) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceResolveConflictCall<'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) -> AccountContainerWorkspaceResolveConflictCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Environment. +/// +/// A builder for the *containers.environments.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Environment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Environment::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.accounts().containers_environments_update(req, "path") +/// .fingerprint("sed") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerEnvironmentUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Environment, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerEnvironmentUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'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, Environment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.environments.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Environment) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the environment in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerEnvironmentUpdateCall<'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) -> AccountContainerEnvironmentUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerEnvironmentUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a GTM Trigger. +/// +/// A builder for the *containers.workspaces.triggers.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_triggers_get("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceTriggerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceTriggerGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceTriggerGetCall<'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, Trigger)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.triggers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerGetCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceTriggerGetCall<'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) -> AccountContainerWorkspaceTriggerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceTriggerGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reverts changes to a GTM Folder in a GTM Workspace. +/// +/// A builder for the *containers.workspaces.folders.revert* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_workspaces_folders_revert("path") +/// .fingerprint("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceFolderRevertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceFolderRevertCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceFolderRevertCall<'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, RevertFolderResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.folders.revert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}:revert"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the tag in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceFolderRevertCall<'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) -> AccountContainerWorkspaceFolderRevertCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a GTM Workspace Proposal. +/// +/// A builder for the *containers.workspaces.proposal.create* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::CreateWorkspaceProposalRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CreateWorkspaceProposalRequest::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.accounts().containers_workspaces_proposal_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceProposalCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: CreateWorkspaceProposalRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceProposalCreateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceProposalCreateCall<'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, WorkspaceProposal)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.proposal.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].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 = self.hub._base_url.clone() + "{+parent}/proposal"; + + 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 [("{+parent}", "parent")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].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).expect("serde to work"); + 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(d); + 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(d); + 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: CreateWorkspaceProposalRequest) -> AccountContainerWorkspaceProposalCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid} + /// + /// Sets the *parent* 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 parent(mut self, new_value: &str) -> AccountContainerWorkspaceProposalCreateCall<'a, C, A> { + self._parent = 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) -> AccountContainerWorkspaceProposalCreateCall<'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) -> AccountContainerWorkspaceProposalCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Updates a Container Version. +/// +/// A builder for the *containers.versions.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::ContainerVersion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ContainerVersion::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.accounts().containers_versions_update(req, "path") +/// .fingerprint("sea") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: ContainerVersion, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionUpdateCall<'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, ContainerVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ContainerVersion) -> AccountContainerVersionUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerVersionUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the container version in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerVersionUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerVersionUpdateCall<'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) -> AccountContainerVersionUpdateCall<'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::EditContainerversion`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a Container Version. +/// +/// A builder for the *containers.versions.get* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().containers_versions_get("path") +/// .container_version_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerVersionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _container_version_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerVersionGetCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerVersionGetCall<'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, ContainerVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.versions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._container_version_id { + params.push(("containerVersionId", value.to_string())); + } + for &field in ["alt", "path", "containerVersionId"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerVersionGetCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// The GTM ContainerVersion ID. Specify published to retrieve the currently published version. + /// + /// Sets the *container version id* query property to the given value. + pub fn container_version_id(mut self, new_value: &str) -> AccountContainerVersionGetCall<'a, C, A> { + self._container_version_id = 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) -> AccountContainerVersionGetCall<'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) -> AccountContainerVersionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerVersionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a Workspace. +/// +/// A builder for the *containers.workspaces.update* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::Workspace; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Workspace::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.accounts().containers_workspaces_update(req, "path") +/// .fingerprint("dolores") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: Workspace, + _path: String, + _fingerprint: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceUpdateCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceUpdateCall<'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, Workspace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + if let Some(value) = self._fingerprint { + params.push(("fingerprint", value.to_string())); + } + for &field in ["alt", "path", "fingerprint"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Workspace) -> AccountContainerWorkspaceUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceUpdateCall<'a, C, A> { + self._path = new_value.to_string(); + self + } + /// When provided, this fingerprint must match the fingerprint of the workspace in storage. + /// + /// Sets the *fingerprint* query property to the given value. + pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceUpdateCall<'a, C, A> { + self._fingerprint = 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) -> AccountContainerWorkspaceUpdateCall<'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) -> AccountContainerWorkspaceUpdateCall<'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::EditContainer`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountContainerWorkspaceUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a GTM Workspace Proposal. +/// +/// A builder for the *containers.workspaces.updateProposal* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// use tagmanager2::UpdateWorkspaceProposalRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UpdateWorkspaceProposalRequest::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.accounts().containers_workspaces_update_proposal(req, "path") +/// .doit(); +/// # } +/// ``` +pub struct AccountContainerWorkspaceUpdateProposalCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _request: UpdateWorkspaceProposalRequest, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AccountContainerWorkspaceUpdateProposalCall<'a, C, A> {} + +impl<'a, C, A> AccountContainerWorkspaceUpdateProposalCall<'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, WorkspaceProposal)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.containers.workspaces.updateProposal", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["alt", "path"].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 = self.hub._base_url.clone() + "{+path}"; + + 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 [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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).expect("serde to work"); + 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::Put, &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(d); + 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(d); + 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: UpdateWorkspaceProposalRequest) -> AccountContainerWorkspaceUpdateProposalCall<'a, C, A> { + self._request = new_value; + self + } + /// GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountContainerWorkspaceUpdateProposalCall<'a, C, A> { + self._path = 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) -> AccountContainerWorkspaceUpdateProposalCall<'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) -> AccountContainerWorkspaceUpdateProposalCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Removes a user from the account, revoking access to it and all of its containers. +/// +/// A builder for the *user_permissions.delete* method supported by a *account* resource. +/// It is not used directly, but through a `AccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_tagmanager2 as tagmanager2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tagmanager2::TagManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TagManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.accounts().user_permissions_delete("path") +/// .doit(); +/// # } +/// ``` +pub struct AccountUserPermissionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TagManager, + _path: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountUserPermissionDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccountUserPermissionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tagmanager.accounts.user_permissions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("path", self._path.to_string())); + for &field in ["path"].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 = self.hub._base_url.clone() + "{+path}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+path}", "path")].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(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["path"].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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + /// + /// Sets the *path* 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 path(mut self, new_value: &str) -> AccountUserPermissionDeleteCall<'a, C, A> { + self._path = 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) -> AccountUserPermissionDeleteCall<'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) -> AccountUserPermissionDeleteCall<'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::ManageUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> AccountUserPermissionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/testing1-cli/Cargo.toml b/gen/testing1-cli/Cargo.toml new file mode 100644 index 0000000000..f1b431162b --- /dev/null +++ b/gen/testing1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-testing1-cli" +version = "1.0.6+20170922" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with testing (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/testing1-cli" +homepage = "https://developers.google.com/cloud-test-lab/" +documentation = "http://byron.github.io/google-apis-rs/google_testing1_cli" +license = "MIT" +keywords = ["testing", "google", "cli"] + +[[bin]] +name = "testing1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-testing1] +path = "../testing1" +version = "1.0.6+20170922" diff --git a/gen/testing1-cli/LICENSE.md b/gen/testing1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/testing1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/testing1-cli/README.md b/gen/testing1-cli/README.md new file mode 100644 index 0000000000..5fb2b641f3 --- /dev/null +++ b/gen/testing1-cli/README.md @@ -0,0 +1,118 @@ + +The `testing1` command-line interface *(CLI)* allows to use most features of the *Google testing* 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 *testing* API can be found at the +[official documentation site](https://developers.google.com/cloud-test-lab/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-testing1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/testing1-cli). + +# Usage + +This documentation was generated from the *testing* API at revision *20170922*. The CLI is at version *1.0.6*. + +```bash +testing1 [options] + projects + test-matrices-cancel [-p ]... [-o ] + test-matrices-create (-r )... [-p ]... [-o ] + test-matrices-get [-p ]... [-o ] + test-environment-catalog + get [-p ]... [-o ] + testing1 --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 `testing1-`. 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/testing1-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/testing1-secret.json`, assuming that the required *testing* 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. `testing1 --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/testing1-cli/mkdocs.yml b/gen/testing1-cli/mkdocs.yml new file mode 100644 index 0000000000..316167ad26 --- /dev/null +++ b/gen/testing1-cli/mkdocs.yml @@ -0,0 +1,20 @@ +site_name: testing v1.0.6+20170922 +site_url: http://byron.github.io/google-apis-rs/google-testing1-cli +site_description: A complete library to interact with testing (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/testing1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_test-matrices-cancel.md', 'Projects', 'Test Matrices Cancel'] +- ['projects_test-matrices-create.md', 'Projects', 'Test Matrices Create'] +- ['projects_test-matrices-get.md', 'Projects', 'Test Matrices Get'] +- ['test-environment-catalog_get.md', 'Test Environment Catalog', 'Get'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/testing1-cli/src/cmn.rs b/gen/testing1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/testing1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/testing1-cli/src/main.rs b/gen/testing1-cli/src/main.rs new file mode 100644 index 0000000000..359b8e7a46 --- /dev/null +++ b/gen/testing1-cli/src/main.rs @@ -0,0 +1,692 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_testing1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::Testing>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_test_matrices_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().test_matrices_cancel(opt.value_of("project-id").unwrap_or(""), opt.value_of("test-matrix-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_test_matrices_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "client-info.name" => Some(("clientInfo.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "result-storage.tool-results-history.project-id" => Some(("resultStorage.toolResultsHistory.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "result-storage.tool-results-history.history-id" => Some(("resultStorage.toolResultsHistory.historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "result-storage.google-cloud-storage.gcs-path" => Some(("resultStorage.googleCloudStorage.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "result-storage.tool-results-execution.project-id" => Some(("resultStorage.toolResultsExecution.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "result-storage.tool-results-execution.execution-id" => Some(("resultStorage.toolResultsExecution.executionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "result-storage.tool-results-execution.history-id" => Some(("resultStorage.toolResultsExecution.historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.test-timeout" => Some(("testSpecification.testTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.test-setup.directories-to-pull" => Some(("testSpecification.testSetup.directoriesToPull", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "test-specification.test-setup.network-profile" => Some(("testSpecification.testSetup.networkProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.disable-video-recording" => Some(("testSpecification.disableVideoRecording", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "test-specification.android-test-loop.app-package-id" => Some(("testSpecification.androidTestLoop.appPackageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-test-loop.scenarios" => Some(("testSpecification.androidTestLoop.scenarios", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "test-specification.android-test-loop.scenario-labels" => Some(("testSpecification.androidTestLoop.scenarioLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "test-specification.android-test-loop.app-apk.gcs-path" => Some(("testSpecification.androidTestLoop.appApk.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.auto-google-login" => Some(("testSpecification.autoGoogleLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "test-specification.disable-performance-metrics" => Some(("testSpecification.disablePerformanceMetrics", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "test-specification.android-robo-test.app-package-id" => Some(("testSpecification.androidRoboTest.appPackageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-robo-test.app-initial-activity" => Some(("testSpecification.androidRoboTest.appInitialActivity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-robo-test.max-steps" => Some(("testSpecification.androidRoboTest.maxSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "test-specification.android-robo-test.max-depth" => Some(("testSpecification.androidRoboTest.maxDepth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "test-specification.android-robo-test.app-apk.gcs-path" => Some(("testSpecification.androidRoboTest.appApk.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.test-apk.gcs-path" => Some(("testSpecification.androidInstrumentationTest.testApk.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.test-targets" => Some(("testSpecification.androidInstrumentationTest.testTargets", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "test-specification.android-instrumentation-test.test-package-id" => Some(("testSpecification.androidInstrumentationTest.testPackageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.app-apk.gcs-path" => Some(("testSpecification.androidInstrumentationTest.appApk.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.app-package-id" => Some(("testSpecification.androidInstrumentationTest.appPackageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.orchestrator-option" => Some(("testSpecification.androidInstrumentationTest.orchestratorOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.test-runner-class" => Some(("testSpecification.androidInstrumentationTest.testRunnerClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-matrix-id" => Some(("testMatrixId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "timestamp" => Some(("timestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invalid-matrix-details" => Some(("invalidMatrixDetails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-matrix.android-matrix.android-version-ids" => Some(("environmentMatrix.androidMatrix.androidVersionIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "environment-matrix.android-matrix.orientations" => Some(("environmentMatrix.androidMatrix.orientations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "environment-matrix.android-matrix.locales" => Some(("environmentMatrix.androidMatrix.locales", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "environment-matrix.android-matrix.android-model-ids" => Some(("environmentMatrix.androidMatrix.androidModelIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["android-instrumentation-test", "android-matrix", "android-model-ids", "android-robo-test", "android-test-loop", "android-version-ids", "app-apk", "app-initial-activity", "app-package-id", "auto-google-login", "client-info", "directories-to-pull", "disable-performance-metrics", "disable-video-recording", "environment-matrix", "execution-id", "gcs-path", "google-cloud-storage", "history-id", "invalid-matrix-details", "locales", "max-depth", "max-steps", "name", "network-profile", "orchestrator-option", "orientations", "project-id", "result-storage", "scenario-labels", "scenarios", "state", "test-apk", "test-matrix-id", "test-package-id", "test-runner-class", "test-setup", "test-specification", "test-targets", "test-timeout", "timestamp", "tool-results-execution", "tool-results-history"]); + 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::TestMatrix = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().test_matrices_create(request, opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(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(["request-id"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_test_matrices_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().test_matrices_get(opt.value_of("project-id").unwrap_or(""), opt.value_of("test-matrix-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _test_environment_catalog_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.test_environment_catalog().get(opt.value_of("environment-type").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "project-id" => { + call = call.project_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["project-id"].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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("test-matrices-cancel", Some(opt)) => { + call_result = self._projects_test_matrices_cancel(opt, dry_run, &mut err); + }, + ("test-matrices-create", Some(opt)) => { + call_result = self._projects_test_matrices_create(opt, dry_run, &mut err); + }, + ("test-matrices-get", Some(opt)) => { + call_result = self._projects_test_matrices_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("test-environment-catalog", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._test_environment_catalog_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("test-environment-catalog".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<'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, "testing1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "testing1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::Testing::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: 'test-matrices-cancel', 'test-matrices-create' and 'test-matrices-get'", vec![ + ("test-matrices-cancel", + Some(r##"Cancels unfinished test executions in a test matrix. + This call returns immediately and cancellation proceeds asychronously. + If the matrix is already final, this operation will have no effect. + + May return any of the following canonical error codes: + + - PERMISSION_DENIED - if the user is not authorized to read project + - INVALID_ARGUMENT - if the request is malformed + - NOT_FOUND - if the Test Matrix does not exist"##), + "Details at http://byron.github.io/google-apis-rs/google_testing1_cli/projects_test-matrices-cancel", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Cloud project that owns the test."##), + Some(true), + Some(false)), + + (Some(r##"test-matrix-id"##), + None, + Some(r##"Test matrix that will be canceled."##), + 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)), + ]), + ("test-matrices-create", + Some(r##"Request to run a matrix of tests according to the given specifications. + Unsupported environments will be returned in the state UNSUPPORTED. + Matrices are limited to at most 200 supported executions. + + May return any of the following canonical error codes: + + - PERMISSION_DENIED - if the user is not authorized to write to project + - INVALID_ARGUMENT - if the request is malformed or if the matrix expands + to more than 200 supported executions"##), + "Details at http://byron.github.io/google-apis-rs/google_testing1_cli/projects_test-matrices-create", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The GCE project under which this job will run."##), + 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)), + ]), + ("test-matrices-get", + Some(r##"Check the status of a test matrix. + + May return any of the following canonical error codes: + + - PERMISSION_DENIED - if the user is not authorized to read project + - INVALID_ARGUMENT - if the request is malformed + - NOT_FOUND - if the Test Matrix does not exist"##), + "Details at http://byron.github.io/google-apis-rs/google_testing1_cli/projects_test-matrices-get", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Cloud project that owns the test matrix."##), + Some(true), + Some(false)), + + (Some(r##"test-matrix-id"##), + None, + Some(r##"Unique test matrix id which was assigned by the service."##), + 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)), + ]), + ]), + + ("test-environment-catalog", "methods: 'get'", vec![ + ("get", + Some(r##"Get the catalog of supported test environments. + + May return any of the following canonical error codes: + + - INVALID_ARGUMENT - if the request is malformed + - NOT_FOUND - if the environment type does not exist + - INTERNAL - if an internal error occurred"##), + "Details at http://byron.github.io/google-apis-rs/google_testing1_cli/test-environment-catalog_get", + vec![ + (Some(r##"environment-type"##), + None, + Some(r##"The type of environment that should be listed. + 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)), + ]), + ]), + + ]; + + let mut app = App::new("testing1") + .author("Sebastian Thiel ") + .version("1.0.6+20170922") + .about("Allows developers to run automated tests for their mobile applications on Google infrastructure.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_testing1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/testing1/Cargo.toml b/gen/testing1/Cargo.toml new file mode 100644 index 0000000000..0f5e3c6877 --- /dev/null +++ b/gen/testing1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-testing1" +version = "1.0.6+20170922" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with testing (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/testing1" +homepage = "https://developers.google.com/cloud-test-lab/" +documentation = "https://docs.rs/google-testing1/1.0.6+20170922" +license = "MIT" +keywords = ["testing", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/testing1/LICENSE.md b/gen/testing1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/testing1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/testing1/README.md b/gen/testing1/README.md new file mode 100644 index 0000000000..5b0c574042 --- /dev/null +++ b/gen/testing1/README.md @@ -0,0 +1,184 @@ + +The `google-testing1` library allows access to all features of the *Google testing* service. + +This documentation was generated from *testing* crate version *1.0.6+20170922*, where *20170922* is the exact revision of the *testing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *testing* *v1* API can be found at the +[official documentation site](https://developers.google.com/cloud-test-lab/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.Testing.html) ... + +* projects + * [*test matrices cancel*](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.ProjectTestMatriceCancelCall.html), [*test matrices create*](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.ProjectTestMatriceCreateCall.html) and [*test matrices get*](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.ProjectTestMatriceGetCall.html) +* [test environment catalog](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.TestEnvironmentCatalog.html) + * [*get*](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.TestEnvironmentCatalogGetCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/struct.Testing.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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().test_matrices_create(...).doit() +let r = hub.projects().test_matrices_get(...).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-testing1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_testing1 as testing1; +use testing1::TestMatrix; +use testing1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use testing1::Testing; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TestMatrix::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().test_matrices_create(req, "projectId") + .request_id("sit") + .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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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](https://docs.rs/google-testing1/1.0.6+20170922/google_testing1/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 **testing1** 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-rsblob/master/LICENSE.md diff --git a/gen/testing1/src/cmn.rs b/gen/testing1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/testing1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/testing1/src/lib.rs b/gen/testing1/src/lib.rs new file mode 100644 index 0000000000..601ec84b85 --- /dev/null +++ b/gen/testing1/src/lib.rs @@ -0,0 +1,2750 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *testing* crate version *1.0.6+20170922*, where *20170922* is the exact revision of the *testing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *testing* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/cloud-test-lab/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/testing1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Testing.html) ... +//! +//! * projects +//! * [*test matrices cancel*](struct.ProjectTestMatriceCancelCall.html), [*test matrices create*](struct.ProjectTestMatriceCreateCall.html) and [*test matrices get*](struct.ProjectTestMatriceGetCall.html) +//! * [test environment catalog](struct.TestEnvironmentCatalog.html) +//! * [*get*](struct.TestEnvironmentCatalogGetCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Testing.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().test_matrices_create(...).doit() +//! let r = hub.projects().test_matrices_get(...).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-testing1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_testing1 as testing1; +//! use testing1::TestMatrix; +//! use testing1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use testing1::Testing; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TestMatrix::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().test_matrices_create(req, "projectId") +//! .request_id("sed") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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, + + /// View your data across Google Cloud Platform services + CloudPlatformReadOnly, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Testing related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_testing1 as testing1; +/// use testing1::TestMatrix; +/// use testing1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use testing1::Testing; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TestMatrix::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().test_matrices_create(req, "projectId") +/// .request_id("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 Testing { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Testing {} + +impl<'a, C, A> Testing + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Testing { + Testing { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://testing.googleapis.com/".to_string(), + _root_url: "https://testing.googleapis.com/".to_string(), + } + } + + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } + pub fn test_environment_catalog(&'a self) -> TestEnvironmentCatalogMethods<'a, C, A> { + TestEnvironmentCatalogMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://testing.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://testing.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// A single Android device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidDevice { + /// The locale the test device used for testing. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + pub locale: Option, + /// The id of the Android OS version to be used. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + #[serde(rename="androidVersionId")] + pub android_version_id: Option, + /// The id of the Android device to be used. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + #[serde(rename="androidModelId")] + pub android_model_id: Option, + /// How the device is oriented during the test. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + pub orientation: Option, +} + +impl Part for AndroidDevice {} + + +/// Specifies a single test to be executed in a single environment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestExecution { + /// The time this test execution was initially created. + /// @OutputOnly + pub timestamp: Option, + /// Id of the containing TestMatrix. + /// @OutputOnly + #[serde(rename="matrixId")] + pub matrix_id: Option, + /// Indicates the current progress of the test execution (e.g., FINISHED). + /// @OutputOnly + pub state: Option, + /// Unique id set by the backend. + /// @OutputOnly + pub id: Option, + /// How the host machine(s) are configured. + /// @OutputOnly + pub environment: Option, + /// How to run the test. + /// @OutputOnly + #[serde(rename="testSpecification")] + pub test_specification: Option, + /// The cloud project that owns the test execution. + /// @OutputOnly + #[serde(rename="projectId")] + pub project_id: Option, + /// Where the results for this execution are written. + /// @OutputOnly + #[serde(rename="toolResultsStep")] + pub tool_results_step: Option, + /// Additional details about the running test. + /// @OutputOnly + #[serde(rename="testDetails")] + pub test_details: Option, +} + +impl Part for TestExecution {} + + +/// Represents a tool results execution resource. +/// +/// This has the results of a TestMatrix. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ToolResultsExecution { + /// The cloud project that owns the tool results execution. + /// @OutputOnly + #[serde(rename="projectId")] + pub project_id: Option, + /// A tool results execution ID. + /// @OutputOnly + #[serde(rename="executionId")] + pub execution_id: Option, + /// A tool results history ID. + /// @OutputOnly + #[serde(rename="historyId")] + pub history_id: Option, +} + +impl Part for ToolResultsExecution {} + + +/// The environment in which the test is run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Environment { + /// An Android device which must be used with an Android test. + #[serde(rename="androidDevice")] + pub android_device: Option, +} + +impl Part for Environment {} + + +/// A set of Android device configuration permutations is defined by the +/// the cross-product of the given axes. Internally, the given AndroidMatrix +/// will be expanded into a set of AndroidDevices. +/// +/// Only supported permutations will be instantiated. Invalid permutations +/// (e.g., incompatible models/versions) are ignored. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidMatrix { + /// The set of locales the test device will enable for testing. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + pub locales: Option>, + /// The set of orientations to test with. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + pub orientations: Option>, + /// The ids of the set of Android OS version to be used. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + #[serde(rename="androidVersionIds")] + pub android_version_ids: Option>, + /// The ids of the set of Android device to be used. + /// Use the EnvironmentDiscoveryService to get supported options. + /// Required + #[serde(rename="androidModelIds")] + pub android_model_ids: Option>, +} + +impl Part for AndroidMatrix {} + + +/// Response containing the current state of the specified test matrix. +/// +/// # 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*). +/// +/// * [test matrices cancel projects](struct.ProjectTestMatriceCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelTestMatrixResponse { + /// The current rolled-up state of the test matrix. + /// If this state is already final, then the cancelation request will + /// have no effect. + #[serde(rename="testState")] + pub test_state: Option, +} + +impl ResponseResult for CancelTestMatrixResponse {} + + +/// Represents a tool results step resource. +/// +/// This has the results of a TestExecution. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ToolResultsStep { + /// The cloud project that owns the tool results step. + /// @OutputOnly + #[serde(rename="projectId")] + pub project_id: Option, + /// A tool results execution ID. + /// @OutputOnly + #[serde(rename="executionId")] + pub execution_id: Option, + /// A tool results step ID. + /// @OutputOnly + #[serde(rename="stepId")] + pub step_id: Option, + /// A tool results history ID. + /// @OutputOnly + #[serde(rename="historyId")] + pub history_id: Option, +} + +impl Part for ToolResultsStep {} + + +/// Data about the relative number of devices running a +/// given configuration of the Android platform. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Distribution { + /// The time this distribution was measured. + /// @OutputOnly + #[serde(rename="measurementTime")] + pub measurement_time: Option, + /// The estimated fraction (0-1) of the total market with this configuration. + /// @OutputOnly + #[serde(rename="marketShare")] + pub market_share: Option, +} + +impl Part for Distribution {} + + +/// Network emulation parameters +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TrafficRule { + /// Packet delay, must be >= 0 + pub delay: Option, + /// Packet loss ratio (0.0 - 1.0) + #[serde(rename="packetLossRatio")] + pub packet_loss_ratio: Option, + /// Bandwidth in kbits/second + pub bandwidth: Option, + /// Burst size in kbits + pub burst: Option, + /// Packet duplication ratio (0.0 - 1.0) + #[serde(rename="packetDuplicationRatio")] + pub packet_duplication_ratio: Option, +} + +impl Part for TrafficRule {} + + +/// A key-value pair passed as an environment variable to the test +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvironmentVariable { + /// Value for the environment variable + pub value: Option, + /// Key for the environment variable + pub key: Option, +} + +impl Part for EnvironmentVariable {} + + +/// A list of Android device configurations in which the test is to be executed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidDeviceList { + /// A list of Android devices + /// Required + #[serde(rename="androidDevices")] + pub android_devices: Option>, +} + +impl Part for AndroidDeviceList {} + + +/// Information about the client which invoked the test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClientInfo { + /// The list of detailed information about client. + #[serde(rename="clientInfoDetails")] + pub client_info_details: Option>, + /// Client name, such as gcloud. + /// Required + pub name: Option, +} + +impl Part for ClientInfo {} + + +/// Represents a tool results history resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ToolResultsHistory { + /// The cloud project that owns the tool results history. + /// Required + #[serde(rename="projectId")] + pub project_id: Option, + /// A tool results history ID. + /// Required + #[serde(rename="historyId")] + pub history_id: Option, +} + +impl Part for ToolResultsHistory {} + + +/// Locations where the results of running the test are stored. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultStorage { + /// The tool results history that contains the tool results execution that + /// results are written to. + /// + /// Optional, if not provided the service will choose an appropriate value. + #[serde(rename="toolResultsHistory")] + pub tool_results_history: Option, + /// Required. + #[serde(rename="googleCloudStorage")] + pub google_cloud_storage: Option, + /// The tool results execution that results are written to. + /// @OutputOnly + #[serde(rename="toolResultsExecution")] + pub tool_results_execution: Option, +} + +impl Part for ResultStorage {} + + +/// A description of how to set up the device prior to running the test +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestSetup { + /// The directories on the device to upload to GCS at the end of the test; + /// they must be absolute, whitelisted paths. + /// Refer to RegularFile for whitelisted paths. + /// Optional + #[serde(rename="directoriesToPull")] + pub directories_to_pull: Option>, + /// The device will be logged in on this account for the duration of the test. + /// Optional + pub account: Option, + /// Optional + #[serde(rename="filesToPush")] + pub files_to_push: Option>, + /// Environment variables to set for the test (only applicable for + /// instrumentation tests). + #[serde(rename="environmentVariables")] + pub environment_variables: Option>, + /// The network traffic profile used for running the test. + /// Optional + #[serde(rename="networkProfile")] + pub network_profile: Option, +} + +impl Part for TestSetup {} + + +/// The currently supported Android devices. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidDeviceCatalog { + /// The set of supported Android device models. + /// @OutputOnly + pub models: Option>, + /// The set of supported runtime configurations. + /// @OutputOnly + #[serde(rename="runtimeConfiguration")] + pub runtime_configuration: Option, + /// The set of supported Android OS versions. + /// @OutputOnly + pub versions: Option>, +} + +impl Part for AndroidDeviceCatalog {} + + +/// An opaque binary blob file to install on the device before the test starts +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObbFile { + /// OBB file name which must conform to the format as specified by + /// Android + /// e.g. [main|patch].0300110.com.example.android.obb + /// which will be installed into + /// /Android/obb// + /// on the device + /// Required + #[serde(rename="obbFileName")] + pub obb_file_name: Option, + /// Opaque Binary Blob (OBB) file(s) to install on the device + /// Required + pub obb: Option, +} + +impl Part for ObbFile {} + + +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Date { + /// Month of year. Must be from 1 to 12. + pub month: Option, + /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + /// if specifying a year/month where the day is not significant. + pub day: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, +} + +impl Part for Date {} + + +/// The matrix of environments in which the test is to be executed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvironmentMatrix { + /// A list of Android devices; the test will be run only on the specified + /// devices. + #[serde(rename="androidDeviceList")] + pub android_device_list: Option, + /// A matrix of Android devices. + #[serde(rename="androidMatrix")] + pub android_matrix: Option, +} + +impl Part for EnvironmentMatrix {} + + +/// Additional details about the progress of the running test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestDetails { + /// Human-readable, detailed descriptions of the test's progress. + /// For example: "Provisioning a device", "Starting Test". + /// + /// During the course of execution new data may be appended + /// to the end of progress_messages. + /// @OutputOnly + #[serde(rename="progressMessages")] + pub progress_messages: Option>, + /// If the TestState is ERROR, then this string will contain human-readable + /// details about the error. + /// @OutputOnly + #[serde(rename="errorMessage")] + pub error_message: Option, +} + +impl Part for TestDetails {} + + +/// Key-value pair of detailed information about the client which invoked the +/// test. For example {'Version', '1.0'}, {'Release Track', 'BETA'} +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClientInfoDetail { + /// The key of detailed client information. + /// Required + pub key: Option, + /// The value of detailed client information. + /// Required + pub value: Option, +} + +impl Part for ClientInfoDetail {} + + +/// A storage location within Google cloud storage (GCS). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudStorage { + /// The path to a directory in GCS that will + /// eventually contain the results for this test. + /// The requesting user must have write access on the bucket in the supplied + /// path. + /// Required + #[serde(rename="gcsPath")] + pub gcs_path: Option, +} + +impl Part for GoogleCloudStorage {} + + +/// Identifies an account and how to log into it +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Account { + /// An automatic google login account + #[serde(rename="googleAuto")] + pub google_auto: Option, +} + +impl Part for Account {} + + +/// A description of how to run the test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestSpecification { + /// Max time a test execution is allowed to run before it is + /// automatically cancelled. + /// Optional, default is 5 min. + #[serde(rename="testTimeout")] + pub test_timeout: Option, + /// Test setup requirements e.g. files to install, bootstrap scripts + /// Optional + #[serde(rename="testSetup")] + pub test_setup: Option, + /// Disables video recording; may reduce test latency. + #[serde(rename="disableVideoRecording")] + pub disable_video_recording: Option, + /// Disables performance metrics recording; may reduce test latency. + #[serde(rename="disablePerformanceMetrics")] + pub disable_performance_metrics: Option, + /// Enables automatic Google account login. + /// If set, the service will automatically generate a Google test account and + /// add it to the device, before executing the test. Note that test accounts + /// might be reused. + /// Many applications show their full set of functionalities when an account is + /// present on the device. Logging into the device with these generated + /// accounts allows testing more functionalities. + /// Default is false. + /// Optional + #[serde(rename="autoGoogleLogin")] + pub auto_google_login: Option, + /// An Android Application with a Test Loop + #[serde(rename="androidTestLoop")] + pub android_test_loop: Option, + /// An Android robo test. + #[serde(rename="androidRoboTest")] + pub android_robo_test: Option, + /// An Android instrumentation test. + #[serde(rename="androidInstrumentationTest")] + pub android_instrumentation_test: Option, +} + +impl Part for TestSpecification {} + + +/// A test of an android application that explores the application on a virtual +/// or physical Android Device, finding culprits and crashes as it goes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidRoboTest { + /// A set of directives Robo should apply during the crawl. + /// This allows users to customize the crawl. For example, the username and + /// password for a test account can be provided. + /// Optional + #[serde(rename="roboDirectives")] + pub robo_directives: Option>, + /// The max depth of the traversal stack Robo can explore. Needs to be at least + /// 2 to make Robo explore the app beyond the first activity. + /// Default is 50. + /// Optional + #[serde(rename="maxDepth")] + pub max_depth: Option, + /// The APK for the application under test. + /// Required + #[serde(rename="appApk")] + pub app_apk: Option, + /// The java package for the application under test. + /// Optional, default is determined by examining the application's manifest. + #[serde(rename="appPackageId")] + pub app_package_id: Option, + /// The initial activity that should be used to start the app. + /// Optional + #[serde(rename="appInitialActivity")] + pub app_initial_activity: Option, + /// The max number of steps Robo can execute. + /// Default is no limit. + /// Optional + #[serde(rename="maxSteps")] + pub max_steps: Option, +} + +impl Part for AndroidRoboTest {} + + +/// A reference to a file, used for user inputs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileReference { + /// A path to a file in Google Cloud Storage. + /// Example: gs://build-app-1414623860166/app-debug-unaligned.apk + #[serde(rename="gcsPath")] + pub gcs_path: Option, +} + +impl Part for FileReference {} + + +/// A version of the Android OS +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidVersion { + /// The date this Android version became available in the market. + /// @OutputOnly + #[serde(rename="releaseDate")] + pub release_date: Option, + /// A string representing this version of the Android OS. + /// Examples: "4.3", "4.4" + /// @OutputOnly + #[serde(rename="versionString")] + pub version_string: Option, + /// Tags for this dimension. + /// Examples: "default", "preview", "deprecated" + pub tags: Option>, + /// Market share for this version. + /// @OutputOnly + pub distribution: Option, + /// The API level for this Android version. + /// Examples: 18, 19 + /// @OutputOnly + #[serde(rename="apiLevel")] + pub api_level: Option, + /// The code name for this Android version. + /// Examples: "JellyBean", "KitKat" + /// @OutputOnly + #[serde(rename="codeName")] + pub code_name: Option, + /// An opaque id for this Android version. + /// Use this id to invoke the TestExecutionService. + /// @OutputOnly + pub id: Option, +} + +impl Part for AndroidVersion {} + + +/// Directs Robo to interact with a specific UI element if it is encountered +/// during the crawl. Currently, Robo can perform text entry or element click. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RoboDirective { + /// The text that Robo is directed to set. If left empty, the directive will be + /// treated as a CLICK on the element matching the resource_name. + /// Optional + #[serde(rename="inputText")] + pub input_text: Option, + /// The android resource name of the target UI element + /// For example, + /// in Java: R.string.foo + /// in xml: @string/foo + /// Only the “foo” part is needed. + /// Reference doc: + /// https://developer.android.com/guide/topics/resources/accessing-resources.html + /// Required + #[serde(rename="resourceName")] + pub resource_name: Option, + /// The type of action that Robo should perform on the specified element. + /// Required. + #[serde(rename="actionType")] + pub action_type: Option, +} + +impl Part for RoboDirective {} + + +/// A test of an Android application that can control an Android component +/// independently of its normal lifecycle. +/// Android instrumentation tests run an application APK and test APK inside the +/// same process on a virtual or physical AndroidDevice. They also specify +/// a test runner class, such as com.google.GoogleTestRunner, which can vary +/// on the specific instrumentation framework chosen. +/// +/// See for +/// more information on types of Android tests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidInstrumentationTest { + /// The APK containing the test code to be executed. + /// Required + #[serde(rename="testApk")] + pub test_apk: Option, + /// Each target must be fully qualified with the package name or class name, + /// in one of these formats: + /// - "package package_name" + /// - "class package_name.class_name" + /// - "class package_name.class_name#method_name" + /// + /// Optional, if empty, all targets in the module will be run. + #[serde(rename="testTargets")] + pub test_targets: Option>, + /// The java package for the test to be executed. + /// Optional, default is determined by examining the application's manifest. + #[serde(rename="testPackageId")] + pub test_package_id: Option, + /// The APK for the application under test. + /// Required + #[serde(rename="appApk")] + pub app_apk: Option, + /// The java package for the application under test. + /// Optional, default is determined by examining the application's manifest. + #[serde(rename="appPackageId")] + pub app_package_id: Option, + /// The option of whether running each test within its own invocation of + /// instrumentation with Android Test Orchestrator or not. + /// ** Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or + /// higher! ** + /// Orchestrator offers the following benefits: + /// - No shared state + /// - Crashes are isolated + /// - Logs are scoped per test + /// + /// See + /// + /// for more information about Android Test Orchestrator. + /// + /// Optional, if empty, test will be run without orchestrator. + #[serde(rename="orchestratorOption")] + pub orchestrator_option: Option, + /// The InstrumentationTestRunner class. + /// Optional, default is determined by examining the application's manifest. + #[serde(rename="testRunnerClass")] + pub test_runner_class: Option, +} + +impl Part for AndroidInstrumentationTest {} + + +/// 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 NetworkConfiguration { + /// The unique opaque id for this network traffic configuration + /// @OutputOnly + pub id: Option, + /// The emulation rule applying to the download traffic + #[serde(rename="downRule")] + pub down_rule: Option, + /// The emulation rule applying to the upload traffic + #[serde(rename="upRule")] + pub up_rule: Option, +} + +impl Part for NetworkConfiguration {} + + +/// Screen orientation of the device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Orientation { + /// Tags for this dimension. + /// Examples: "default" + pub tags: Option>, + /// The id for this orientation. + /// Example: "portrait" + /// @OutputOnly + pub id: Option, + /// A human-friendly name for this orientation. + /// Example: "portrait" + /// @OutputOnly + pub name: Option, +} + +impl Part for Orientation {} + + +/// A location/region designation for language. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Locale { + /// A human-friendy string representing the region for this locale. + /// Example: "United States" + /// Not present for every locale. + /// @OutputOnly + pub region: Option, + /// Tags for this dimension. + /// Examples: "default" + pub tags: Option>, + /// The id for this locale. + /// Example: "en_US" + /// @OutputOnly + pub id: Option, + /// A human-friendly name for this language/locale. + /// Example: "English" + /// @OutputOnly + pub name: Option, +} + +impl Part for Locale {} + + +/// Configuration that can be selected at the time a test is run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidRuntimeConfiguration { + /// The set of available orientations. + /// @OutputOnly + pub orientations: Option>, + /// The set of available locales. + /// @OutputOnly + pub locales: Option>, +} + +impl Part for AndroidRuntimeConfiguration {} + + +/// A description of a test environment. +/// +/// # 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 test environment catalog](struct.TestEnvironmentCatalogGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestEnvironmentCatalog { + /// Supported network configurations + #[serde(rename="networkConfigurationCatalog")] + pub network_configuration_catalog: Option, + /// Android devices suitable for running Android Instrumentation Tests. + #[serde(rename="androidDeviceCatalog")] + pub android_device_catalog: Option, +} + +impl ResponseResult for TestEnvironmentCatalog {} + + +/// A description of an Android device tests may be run on. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidModel { + /// Screen size in the vertical (Y) dimension measured in pixels. + /// @OutputOnly + #[serde(rename="screenY")] + pub screen_y: Option, + /// The human-readable marketing name for this device model. + /// Examples: "Nexus 5", "Galaxy S5" + /// @OutputOnly + pub name: Option, + /// Whether this device is virtual or physical. + /// @OutputOnly + pub form: Option, + /// Tags for this dimension. + /// Examples: "default", "preview", "deprecated" + pub tags: Option>, + /// Screen density in DPI. + /// This corresponds to ro.sf.lcd_density + /// @OutputOnly + #[serde(rename="screenDensity")] + pub screen_density: Option, + /// The company that this device is branded with. + /// Example: "Google", "Samsung" + /// @OutputOnly + pub brand: Option, + /// The set of Android versions this device supports. + /// @OutputOnly + #[serde(rename="supportedVersionIds")] + pub supported_version_ids: Option>, + /// The list of supported ABIs for this device. + /// This corresponds to either android.os.Build.SUPPORTED_ABIS (for API level + /// 21 and above) or android.os.Build.CPU_ABI/CPU_ABI2. + /// The most preferred ABI is the first element in the list. + /// + /// Elements are optionally prefixed by "version_id:" (where version_id is + /// the id of an AndroidVersion), denoting an ABI that is supported only on + /// a particular version. + /// @OutputOnly + #[serde(rename="supportedAbis")] + pub supported_abis: Option>, + /// Screen size in the horizontal (X) dimension measured in pixels. + /// @OutputOnly + #[serde(rename="screenX")] + pub screen_x: Option, + /// The unique opaque id for this model. + /// Use this for invoking the TestExecutionService. + /// @OutputOnly + pub id: Option, + /// The manufacturer of this device. + /// @OutputOnly + pub manufacturer: Option, + /// The name of the industrial design. + /// This corresponds to android.os.Build.DEVICE + /// @OutputOnly + pub codename: Option, +} + +impl Part for AndroidModel {} + + +/// A group of one or more TestExecutions, built by taking a +/// product of values over a pre-defined set of axes. +/// +/// # 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*). +/// +/// * [test matrices create projects](struct.ProjectTestMatriceCreateCall.html) (request|response) +/// * [test matrices get projects](struct.ProjectTestMatriceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestMatrix { + /// Information about the client which invoked the test. + /// Optional + #[serde(rename="clientInfo")] + pub client_info: Option, + /// The cloud project that owns the test matrix. + /// @OutputOnly + #[serde(rename="projectId")] + pub project_id: Option, + /// Where the results for the matrix are written. + /// Required + #[serde(rename="resultStorage")] + pub result_storage: Option, + /// Indicates the current progress of the test matrix (e.g., FINISHED) + /// @OutputOnly + pub state: Option, + /// The list of test executions that the service creates for this matrix. + /// @OutputOnly + #[serde(rename="testExecutions")] + pub test_executions: Option>, + /// How to run the test. + /// Required + #[serde(rename="testSpecification")] + pub test_specification: Option, + /// Unique id set by the service. + /// @OutputOnly + #[serde(rename="testMatrixId")] + pub test_matrix_id: Option, + /// The time this test matrix was initially created. + /// @OutputOnly + pub timestamp: Option, + /// Describes why the matrix is considered invalid. + /// Only useful for matrices in the INVALID state. + /// @OutputOnly + #[serde(rename="invalidMatrixDetails")] + pub invalid_matrix_details: Option, + /// How the host machine(s) are configured. + /// Required + #[serde(rename="environmentMatrix")] + pub environment_matrix: Option, +} + +impl RequestValue for TestMatrix {} +impl ResponseResult for TestMatrix {} + + +/// A test of an Android Application with a Test Loop. +/// The intent will be implicitly added, since Games is the only +/// user of this api, for the time being. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidTestLoop { + /// The java package for the application under test. + /// Optional, default is determined by examining the application's manifest. + #[serde(rename="appPackageId")] + pub app_package_id: Option, + /// The list of scenarios that should be run during the test. + /// Optional, default is all test loops, derived from the application's + /// manifest. + pub scenarios: Option>, + /// The list of scenario labels that should be run during the test. + /// The scenario labels should map to labels defined in the application's + /// manifest. For example, player_experience and + /// com.google.test.loops.player_experience add all of the loops labeled in the + /// manifest with the com.google.test.loops.player_experience name to the + /// execution. + /// Optional. Scenarios can also be specified in the scenarios field. + #[serde(rename="scenarioLabels")] + pub scenario_labels: Option>, + /// The APK for the application under test. + /// Required + #[serde(rename="appApk")] + pub app_apk: Option, +} + +impl Part for AndroidTestLoop {} + + +/// A single device file 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 DeviceFile { + /// A reference to an opaque binary blob file + #[serde(rename="obbFile")] + pub obb_file: Option, +} + +impl Part for DeviceFile {} + + +/// 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 NetworkConfigurationCatalog { + /// no description provided + pub configurations: Option>, +} + +impl Part for NetworkConfigurationCatalog {} + + +/// Enables automatic Google account login. +/// If set, the service will automatically generate a Google test account and add +/// it to the device, before executing the test. Note that test accounts might be +/// reused. +/// Many applications show their full set of functionalities when an account is +/// present on the device. Logging into the device with these generated accounts +/// allows testing more functionalities. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleAuto { _never_set: Option } + +impl Part for GoogleAuto {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *testEnvironmentCatalog* resources. +/// It is not used directly, but through the `Testing` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_testing1 as testing1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use testing1::Testing; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` +/// // to build up your call. +/// let rb = hub.test_environment_catalog(); +/// # } +/// ``` +pub struct TestEnvironmentCatalogMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Testing, +} + +impl<'a, C, A> MethodsBuilder for TestEnvironmentCatalogMethods<'a, C, A> {} + +impl<'a, C, A> TestEnvironmentCatalogMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Get the catalog of supported test environments. + /// + /// May return any of the following canonical error codes: + /// + /// - INVALID_ARGUMENT - if the request is malformed + /// - NOT_FOUND - if the environment type does not exist + /// - INTERNAL - if an internal error occurred + /// + /// # Arguments + /// + /// * `environmentType` - The type of environment that should be listed. + /// Required + pub fn get(&self, environment_type: &str) -> TestEnvironmentCatalogGetCall<'a, C, A> { + TestEnvironmentCatalogGetCall { + hub: self.hub, + _environment_type: environment_type.to_string(), + _project_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Testing` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_testing1 as testing1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use testing1::Testing; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `test_matrices_cancel(...)`, `test_matrices_create(...)` and `test_matrices_get(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Testing, +} + +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: + /// + /// Request to run a matrix of tests according to the given specifications. + /// Unsupported environments will be returned in the state UNSUPPORTED. + /// Matrices are limited to at most 200 supported executions. + /// + /// May return any of the following canonical error codes: + /// + /// - PERMISSION_DENIED - if the user is not authorized to write to project + /// - INVALID_ARGUMENT - if the request is malformed or if the matrix expands + /// to more than 200 supported executions + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The GCE project under which this job will run. + pub fn test_matrices_create(&self, request: TestMatrix, project_id: &str) -> ProjectTestMatriceCreateCall<'a, C, A> { + ProjectTestMatriceCreateCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancels unfinished test executions in a test matrix. + /// This call returns immediately and cancellation proceeds asychronously. + /// If the matrix is already final, this operation will have no effect. + /// + /// May return any of the following canonical error codes: + /// + /// - PERMISSION_DENIED - if the user is not authorized to read project + /// - INVALID_ARGUMENT - if the request is malformed + /// - NOT_FOUND - if the Test Matrix does not exist + /// + /// # Arguments + /// + /// * `projectId` - Cloud project that owns the test. + /// * `testMatrixId` - Test matrix that will be canceled. + pub fn test_matrices_cancel(&self, project_id: &str, test_matrix_id: &str) -> ProjectTestMatriceCancelCall<'a, C, A> { + ProjectTestMatriceCancelCall { + hub: self.hub, + _project_id: project_id.to_string(), + _test_matrix_id: test_matrix_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Check the status of a test matrix. + /// + /// May return any of the following canonical error codes: + /// + /// - PERMISSION_DENIED - if the user is not authorized to read project + /// - INVALID_ARGUMENT - if the request is malformed + /// - NOT_FOUND - if the Test Matrix does not exist + /// + /// # Arguments + /// + /// * `projectId` - Cloud project that owns the test matrix. + /// * `testMatrixId` - Unique test matrix id which was assigned by the service. + pub fn test_matrices_get(&self, project_id: &str, test_matrix_id: &str) -> ProjectTestMatriceGetCall<'a, C, A> { + ProjectTestMatriceGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _test_matrix_id: test_matrix_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Get the catalog of supported test environments. +/// +/// May return any of the following canonical error codes: +/// +/// - INVALID_ARGUMENT - if the request is malformed +/// - NOT_FOUND - if the environment type does not exist +/// - INTERNAL - if an internal error occurred +/// +/// A builder for the *get* method supported by a *testEnvironmentCatalog* resource. +/// It is not used directly, but through a `TestEnvironmentCatalogMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_testing1 as testing1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use testing1::Testing; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.test_environment_catalog().get("environmentType") +/// .project_id("accusam") +/// .doit(); +/// # } +/// ``` +pub struct TestEnvironmentCatalogGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Testing, + _environment_type: String, + _project_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TestEnvironmentCatalogGetCall<'a, C, A> {} + +impl<'a, C, A> TestEnvironmentCatalogGetCall<'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, TestEnvironmentCatalog)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "testing.testEnvironmentCatalog.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("environmentType", self._environment_type.to_string())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + for &field in ["alt", "environmentType", "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 = self.hub._base_url.clone() + "v1/testEnvironmentCatalog/{environmentType}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{environmentType}", "environmentType")].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 ["environmentType"].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(Bearer { 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(d); + 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(d); + 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 type of environment that should be listed. + /// Required + /// + /// Sets the *environment type* 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 environment_type(mut self, new_value: &str) -> TestEnvironmentCatalogGetCall<'a, C, A> { + self._environment_type = new_value.to_string(); + self + } + /// For authorization, the cloud project requesting the TestEnvironmentCatalog. + /// Optional + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> TestEnvironmentCatalogGetCall<'a, C, A> { + self._project_id = 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) -> TestEnvironmentCatalogGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> TestEnvironmentCatalogGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TestEnvironmentCatalogGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Request to run a matrix of tests according to the given specifications. +/// Unsupported environments will be returned in the state UNSUPPORTED. +/// Matrices are limited to at most 200 supported executions. +/// +/// May return any of the following canonical error codes: +/// +/// - PERMISSION_DENIED - if the user is not authorized to write to project +/// - INVALID_ARGUMENT - if the request is malformed or if the matrix expands +/// to more than 200 supported executions +/// +/// A builder for the *testMatrices.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_testing1 as testing1; +/// use testing1::TestMatrix; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use testing1::Testing; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TestMatrix::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().test_matrices_create(req, "projectId") +/// .request_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTestMatriceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Testing, + _request: TestMatrix, + _project_id: String, + _request_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTestMatriceCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectTestMatriceCreateCall<'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, TestMatrix)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "testing.projects.testMatrices.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "projectId", "requestId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/testMatrices"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: TestMatrix) -> ProjectTestMatriceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The GCE project under which this job will run. + /// + /// 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) -> ProjectTestMatriceCreateCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// A string id used to detect duplicated requests. + /// Ids are automatically scoped to a project, so + /// users should ensure the ID is unique per-project. + /// A UUID is recommended. + /// + /// Optional, but strongly recommended. + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectTestMatriceCreateCall<'a, C, A> { + self._request_id = 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) -> ProjectTestMatriceCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTestMatriceCreateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTestMatriceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Cancels unfinished test executions in a test matrix. +/// This call returns immediately and cancellation proceeds asychronously. +/// If the matrix is already final, this operation will have no effect. +/// +/// May return any of the following canonical error codes: +/// +/// - PERMISSION_DENIED - if the user is not authorized to read project +/// - INVALID_ARGUMENT - if the request is malformed +/// - NOT_FOUND - if the Test Matrix does not exist +/// +/// A builder for the *testMatrices.cancel* 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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_testing1 as testing1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use testing1::Testing; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().test_matrices_cancel("projectId", "testMatrixId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTestMatriceCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Testing, + _project_id: String, + _test_matrix_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTestMatriceCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectTestMatriceCancelCall<'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, CancelTestMatrixResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "testing.projects.testMatrices.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(("testMatrixId", self._test_matrix_id.to_string())); + for &field in ["alt", "projectId", "testMatrixId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{testMatrixId}", "testMatrixId")].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 ["testMatrixId", "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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Cloud project that owns the test. + /// + /// 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) -> ProjectTestMatriceCancelCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Test matrix that will be canceled. + /// + /// Sets the *test matrix 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 test_matrix_id(mut self, new_value: &str) -> ProjectTestMatriceCancelCall<'a, C, A> { + self._test_matrix_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) -> ProjectTestMatriceCancelCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTestMatriceCancelCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTestMatriceCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Check the status of a test matrix. +/// +/// May return any of the following canonical error codes: +/// +/// - PERMISSION_DENIED - if the user is not authorized to read project +/// - INVALID_ARGUMENT - if the request is malformed +/// - NOT_FOUND - if the Test Matrix does not exist +/// +/// A builder for the *testMatrices.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 hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_testing1 as testing1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use testing1::Testing; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Testing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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().test_matrices_get("projectId", "testMatrixId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTestMatriceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Testing, + _project_id: String, + _test_matrix_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTestMatriceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectTestMatriceGetCall<'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, TestMatrix)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "testing.projects.testMatrices.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("testMatrixId", self._test_matrix_id.to_string())); + for &field in ["alt", "projectId", "testMatrixId"].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 = self.hub._base_url.clone() + "v1/projects/{projectId}/testMatrices/{testMatrixId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{testMatrixId}", "testMatrixId")].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 ["testMatrixId", "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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Cloud project that owns the test matrix. + /// + /// 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) -> ProjectTestMatriceGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Unique test matrix id which was assigned by the service. + /// + /// Sets the *test matrix 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 test_matrix_id(mut self, new_value: &str) -> ProjectTestMatriceGetCall<'a, C, A> { + self._test_matrix_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) -> ProjectTestMatriceGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectTestMatriceGetCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> ProjectTestMatriceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/translate2-cli/Cargo.toml b/gen/translate2-cli/Cargo.toml index 41d98dc714..633955d2c8 100644 --- a/gen/translate2-cli/Cargo.toml +++ b/gen/translate2-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-translate2-cli" -version = "1.0.6+20160627" +version = "1.0.6+20170525" authors = ["Sebastian Thiel "] -description = "A complete library to interact with translate (protocol v2)" +description = "A complete library to interact with Translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2-cli" -homepage = "https://developers.google.com/translate/v2/using_rest" +homepage = "https://code.google.com/apis/language/translate/v2/getting_started.html" documentation = "http://byron.github.io/google-apis-rs/google_translate2_cli" license = "MIT" keywords = ["translate", "google", "cli"] @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-translate2] path = "../translate2" -version = "1.0.6+20160627" +version = "1.0.6+20170525" diff --git a/gen/translate2-cli/README.md b/gen/translate2-cli/README.md index f59b368596..3cfa1d6d3b 100644 --- a/gen/translate2-cli/README.md +++ b/gen/translate2-cli/README.md @@ -3,15 +3,15 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `translate2` command-line interface *(CLI)* allows to use most features of the *Google translate* service from the comfort of your terminal. +The `translate2` command-line interface *(CLI)* allows to use most features of the *Google Translate* 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 *translate* API can be found at the -[official documentation site](https://developers.google.com/translate/v2/using_rest). +Everything else about the *Translate* API can be found at the +[official documentation site](https://code.google.com/apis/language/translate/v2/getting_started.html). # Installation and Source Code @@ -25,19 +25,25 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *translate* API at revision *20160627*. The CLI is at version *1.0.6*. +This documentation was generated from the *Translate* API at revision *20170525*. The CLI is at version *1.0.6*. ```bash translate2 [options] detections + detect (-r )... [-p ]... [-o ] list ... [-p ]... [-o ] languages list [-p ]... [-o ] translations list ... [-p ]... [-o ] + translate (-r )... [-p ]... [-o ] translate2 --help Configuration: + [--scope ]... + Specify the authentication a method should be executed in. Each scope + requires the user to grant this application permission to use it. + If unset, it defaults to the shortest scope url for a particular method. --config-dir A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation. diff --git a/gen/translate2-cli/mkdocs.yml b/gen/translate2-cli/mkdocs.yml index 8b91bf65b9..fe28b24327 100644 --- a/gen/translate2-cli/mkdocs.yml +++ b/gen/translate2-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: translate v1.0.6+20160627 +site_name: Translate v1.0.6+20170525 site_url: http://byron.github.io/google-apis-rs/google-translate2-cli -site_description: A complete library to interact with translate (protocol v2) +site_description: A complete library to interact with Translate (protocol v2) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/translate2-cli @@ -9,9 +9,11 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['detections_detect.md', 'Detections', 'Detect'] - ['detections_list.md', 'Detections', 'List'] - ['languages_list.md', 'Languages', 'List'] - ['translations_list.md', 'Translations', 'List'] +- ['translations_translate.md', 'Translations', 'Translate'] theme: readthedocs diff --git a/gen/translate2-cli/src/main.rs b/gen/translate2-cli/src/main.rs index 79dfaa77d5..acef2d0b43 100644 --- a/gen/translate2-cli/src/main.rs +++ b/gen/translate2-cli/src/main.rs @@ -46,6 +46,91 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _detections_detect(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "q" => Some(("q", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["q"]); + 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::DetectLanguageRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.detections().detect(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _detections_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.detections().list(&opt.values_of("q").map(|i|i.collect()).unwrap_or(Vec::new()).iter().map(|&v| v.to_string()).collect::>()); @@ -75,6 +160,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -104,6 +192,9 @@ impl<'n> Engine<'n> { "target" => { call = call.target(value.unwrap_or("")); }, + "model" => { + call = call.model(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -117,7 +208,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["target"].iter().map(|v|*v)); + v.extend(["model", "target"].iter().map(|v|*v)); v } )); } } @@ -128,6 +219,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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)), @@ -157,6 +251,9 @@ impl<'n> Engine<'n> { "source" => { call = call.source(value.unwrap_or("")); }, + "model" => { + call = call.model(value.unwrap_or("")); + }, "format" => { call = call.format(value.unwrap_or("")); }, @@ -176,7 +273,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["source", "cid", "format"].iter().map(|v|*v)); + v.extend(["source", "model", "cid", "format"].iter().map(|v|*v)); v } )); } } @@ -187,6 +284,98 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _translations_translate(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "q" => Some(("q", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "source" => Some(("source", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "model" => Some(("model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["format", "model", "q", "source", "target"]); + 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::TranslateTextRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.translations().translate(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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)), @@ -214,6 +403,9 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("detections", Some(opt)) => { match opt.subcommand() { + ("detect", Some(opt)) => { + call_result = self._detections_detect(opt, dry_run, &mut err); + }, ("list", Some(opt)) => { call_result = self._detections_list(opt, dry_run, &mut err); }, @@ -239,6 +431,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._translations_list(opt, dry_run, &mut err); }, + ("translate", Some(opt)) => { + call_result = self._translations_translate(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("translations".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -300,12 +495,16 @@ impl<'n> Engine<'n> { let engine = Engine { opt: opt, hub: api::Translate::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"), ] }; @@ -327,14 +526,37 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("detections", "methods: 'list'", vec![ + ("detections", "methods: 'detect' and 'list'", vec![ + ("detect", + Some(r##"Detects the language of text within a request."##), + "Details at http://byron.github.io/google-apis-rs/google_translate2_cli/detections_detect", + 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)), + ]), ("list", - Some(r##"Detect the language of text."##), + Some(r##"Detects the language of text within a request."##), "Details at http://byron.github.io/google-apis-rs/google_translate2_cli/detections_list", vec![ (Some(r##"q"##), None, - Some(r##"The text to detect"##), + Some(r##"The input text upon which to perform language detection. Repeat this + parameter to perform language detection on multiple text inputs."##), Some(true), Some(false)), @@ -354,7 +576,7 @@ fn main() { ("languages", "methods: 'list'", vec![ ("list", - Some(r##"List the source/target languages supported by the API"##), + Some(r##"Returns a list of supported languages for translation."##), "Details at http://byron.github.io/google-apis-rs/google_translate2_cli/languages_list", vec![ (Some(r##"v"##), @@ -371,20 +593,22 @@ fn main() { ]), ]), - ("translations", "methods: 'list'", vec![ + ("translations", "methods: 'list' and 'translate'", vec![ ("list", - Some(r##"Returns text translations from one language to another."##), + Some(r##"Translates input text, returning translated text."##), "Details at http://byron.github.io/google-apis-rs/google_translate2_cli/translations_list", vec![ (Some(r##"q"##), None, - Some(r##"The text to translate"##), + Some(r##"The input text to translate. Repeat this parameter to perform translation + operations on multiple text inputs."##), Some(true), Some(false)), (Some(r##"target"##), None, - Some(r##"The target language into which the text should be translated"##), + Some(r##"The language to use for translation of the input text, set to one of the + language codes listed in Language Support."##), Some(true), Some(false)), @@ -394,6 +618,28 @@ 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)), + ]), + ("translate", + Some(r##"Translates input text, returning translated text."##), + "Details at http://byron.github.io/google-apis-rs/google_translate2_cli/translations_translate", + 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"##), @@ -406,9 +652,15 @@ fn main() { let mut app = App::new("translate2") .author("Sebastian Thiel ") - .version("1.0.6+20160627") - .about("Translates text from one language to another.") + .version("1.0.6+20170525") + .about("The Google Cloud Translation API lets websites and programs integrate with + Google Translate programmatically.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_translate2_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") diff --git a/gen/translate2/Cargo.toml b/gen/translate2/Cargo.toml index 6a9697883d..af4ba2317e 100644 --- a/gen/translate2/Cargo.toml +++ b/gen/translate2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-translate2" -version = "1.0.6+20160627" +version = "1.0.6+20170525" authors = ["Sebastian Thiel "] -description = "A complete library to interact with translate (protocol v2)" +description = "A complete library to interact with Translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2" -homepage = "https://developers.google.com/translate/v2/using_rest" -documentation = "https://docs.rs/google-translate2/1.0.6+20160627" +homepage = "https://code.google.com/apis/language/translate/v2/getting_started.html" +documentation = "https://docs.rs/google-translate2/1.0.6+20170525" license = "MIT" keywords = ["translate", "google", "protocol", "web", "api"] diff --git a/gen/translate2/README.md b/gen/translate2/README.md index 9ff8b3ceed..e77ae4831b 100644 --- a/gen/translate2/README.md +++ b/gen/translate2/README.md @@ -3,22 +3,22 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-translate2` library allows access to all features of the *Google translate* service. +The `google-translate2` library allows access to all features of the *Google Translate* service. -This documentation was generated from *translate* crate version *1.0.6+20160627*, where *20160627* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Translate* crate version *1.0.6+20170525*, where *20170525* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. -Everything else about the *translate* *v2* API can be found at the -[official documentation site](https://developers.google.com/translate/v2/using_rest). +Everything else about the *Translate* *v2* API can be found at the +[official documentation site](https://code.google.com/apis/language/translate/v2/getting_started.html). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/struct.Translate.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.Translate.html) ... * detections - * [*list*](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/struct.DetectionListCall.html) + * [*detect*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.DetectionDetectCall.html) and [*list*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.DetectionListCall.html) * languages - * [*list*](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/struct.LanguageListCall.html) + * [*list*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.LanguageListCall.html) * translations - * [*list*](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/struct.TranslationListCall.html) + * [*list*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.TranslationListCall.html) and [*translate*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.TranslationTranslateCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/struct.Translate.html)** +* **[Hub](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/struct.Translate.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.Part.html)** + * **[Parts](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -51,6 +51,7 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.detections().detect(...).doit() let r = hub.detections().list(...).doit() ``` @@ -77,6 +78,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_translate2 as translate2; +use translate2::DetectLanguageRequest; use translate2::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -94,10 +96,15 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DetectLanguageRequest::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.detections().list("q") +let result = hub.detections().detect(req) .doit(); match result { @@ -120,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/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")`. @@ -140,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/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](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/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](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/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](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/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](https://docs.rs/google-translate2/1.0.6+20160627/google_translate2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-translate2/1.0.6+20170525/google_translate2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/translate2/src/lib.rs b/gen/translate2/src/lib.rs index dec066a732..3f87d37f65 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -2,21 +2,21 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *translate* crate version *1.0.6+20160627*, where *20160627* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Translate* crate version *1.0.6+20170525*, where *20170525* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! -//! Everything else about the *translate* *v2* API can be found at the -//! [official documentation site](https://developers.google.com/translate/v2/using_rest). +//! Everything else about the *Translate* *v2* API can be found at the +//! [official documentation site](https://code.google.com/apis/language/translate/v2/getting_started.html). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/translate2). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.Translate.html) ... //! //! * detections -//! * [*list*](struct.DetectionListCall.html) +//! * [*detect*](struct.DetectionDetectCall.html) and [*list*](struct.DetectionListCall.html) //! * languages //! * [*list*](struct.LanguageListCall.html) //! * translations -//! * [*list*](struct.TranslationListCall.html) +//! * [*list*](struct.TranslationListCall.html) and [*translate*](struct.TranslationTranslateCall.html) //! //! //! @@ -51,6 +51,7 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.detections().detect(...).doit() //! let r = hub.detections().list(...).doit() //! ``` //! @@ -77,6 +78,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_translate2 as translate2; +//! use translate2::DetectLanguageRequest; //! use translate2::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -95,10 +97,15 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DetectLanguageRequest::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.detections().list("q") +//! let result = hub.detections().detect(req) //! .doit(); //! //! match result { @@ -216,6 +223,32 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, // UTILITIES ### // ############ +/// Identifies the an OAuth2 authorization scope. +/// A scope is needed when requesting an +/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). +#[derive(PartialEq, Eq, Hash)] +pub enum Scope { + /// Translate text from one language to another using Google Translate + CloudTranslation, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::CloudTranslation => "https://www.googleapis.com/auth/cloud-translation", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} @@ -234,6 +267,7 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_translate2 as translate2; +/// use translate2::DetectLanguageRequest; /// use translate2::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -252,10 +286,15 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DetectLanguageRequest::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.detections().list("q") +/// let result = hub.detections().detect(req) /// .doit(); /// /// match result { @@ -294,8 +333,8 @@ impl<'a, C, A> Translate client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.6".to_string(), - _base_url: "https://www.googleapis.com/language/translate/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), + _base_url: "https://translation.googleapis.com/language/translate/".to_string(), + _root_url: "https://translation.googleapis.com/".to_string(), } } @@ -318,7 +357,7 @@ impl<'a, C, A> Translate } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/language/translate/`. + /// It defaults to `https://translation.googleapis.com/language/translate/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -326,7 +365,7 @@ impl<'a, C, A> Translate } /// Set the root url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/`. + /// It defaults to `https://translation.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { @@ -345,6 +384,7 @@ impl<'a, C, A> Translate /// 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*). /// +/// * [detect detections](struct.DetectionDetectCall.html) (response) /// * [list detections](struct.DetectionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -385,30 +425,32 @@ pub struct DetectionsResource { /// A boolean to indicate is the language detection result reliable. #[serde(rename="isReliable")] pub is_reliable: Option, - /// The confidence of the detection resul of this language. + /// The confidence of the detection result of this language. pub confidence: Option, - /// The language we detect + /// The language we detected. pub language: Option, } impl Part for DetectionsResource {} -/// There is no detailed description. +/// The request message for language detection. /// -/// 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*). +/// +/// * [detect detections](struct.DetectionDetectCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TranslationsResource { - /// Detected source language if source parameter is unspecified. - #[serde(rename="detectedSourceLanguage")] - pub detected_source_language: Option, - /// The translation. - #[serde(rename="translatedText")] - pub translated_text: Option, +pub struct DetectLanguageRequest { + /// The input text upon which to perform language detection. Repeat this + /// parameter to perform language detection on multiple text inputs. + pub q: Option>, } -impl Part for TranslationsResource {} +impl RequestValue for DetectLanguageRequest {} /// There is no detailed description. @@ -417,9 +459,11 @@ impl Part for TranslationsResource {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LanguagesResource { - /// The localized name of the language if target parameter is given. + /// Human readable name of the language localized to the target language. pub name: Option, - /// The language code. + /// Supported language code, generally consisting of its ISO 639-1 + /// identifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 codes including + /// language + region identifiers are returned (e.g. 'zh-TW' and 'zh-CH') pub language: Option, } @@ -435,9 +479,9 @@ pub struct DetectionsResourceNested { /// A boolean to indicate is the language detection result reliable. #[serde(rename="isReliable")] pub is_reliable: Option, - /// The confidence of the detection resul of this language. + /// The confidence of the detection result of this language. pub confidence: Option, - /// The language we detect + /// The language we detected. pub language: Option, } @@ -445,13 +489,71 @@ impl NestedType for DetectionsResourceNested {} impl Part for DetectionsResourceNested {} -/// There is no detailed description. +/// The main translation request message for the Cloud Translation API. /// /// # 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*). /// +/// * [translate translations](struct.TranslationTranslateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TranslateTextRequest { + /// The input text to translate. Repeat this parameter to perform translation + /// operations on multiple text inputs. + pub q: Option>, + /// The language of the source text, set to one of the language codes listed in + /// Language Support. If the source language is not specified, the API will + /// attempt to identify the source language automatically and return it within + /// the response. + pub source: Option, + /// The `model` type requested for this translation. Valid values are + /// listed in public documentation. + pub model: Option, + /// The language to use for translation of the input text, set to one of the + /// language codes listed in Language Support. + pub target: Option, + /// The format of the source text, in either HTML (default) or plain-text. A + /// value of "html" indicates HTML and a value of "text" indicates plain-text. + pub format: Option, +} + +impl RequestValue for TranslateTextRequest {} + + +/// 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 TranslationsResource { + /// The source language of the initial request, detected automatically, if + /// no source language was passed within the initial request. If the + /// source language was passed, auto-detection of the language will not + /// occur and this field will be empty. + #[serde(rename="detectedSourceLanguage")] + pub detected_source_language: Option, + /// The `model` type used for this translation. Valid values are + /// listed in public documentation. Can be different from requested `model`. + /// Present only if specific model type was explicitly requested. + pub model: Option, + /// Text translated into the target language. + #[serde(rename="translatedText")] + pub translated_text: Option, +} + +impl Part for TranslationsResource {} + + +/// The main language translation response message. +/// +/// # 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*). +/// +/// * [translate translations](struct.TranslationTranslateCall.html) (response) /// * [list translations](struct.TranslationListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -509,12 +611,14 @@ impl<'a, C, A> LanguageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List the source/target languages supported by the API + /// Returns a list of supported languages for translation. pub fn list(&self) -> LanguageListCall<'a, C, A> { LanguageListCall { hub: self.hub, _target: Default::default(), + _model: Default::default(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -546,7 +650,7 @@ impl<'a, C, A> LanguageMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `list(...)` +/// // like `detect(...)` and `list(...)` /// // to build up your call. /// let rb = hub.detections(); /// # } @@ -563,16 +667,35 @@ impl<'a, C, A> DetectionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Detect the language of text. + /// Detects the language of text within a request. /// /// # Arguments /// - /// * `q` - The text to detect + /// * `request` - No description provided. + pub fn detect(&self, request: DetectLanguageRequest) -> DetectionDetectCall<'a, C, A> { + DetectionDetectCall { + 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: + /// + /// Detects the language of text within a request. + /// + /// # Arguments + /// + /// * `q` - The input text upon which to perform language detection. Repeat this + /// parameter to perform language detection on multiple text inputs. pub fn list(&self, q: &Vec) -> DetectionListCall<'a, C, A> { DetectionListCall { hub: self.hub, _q: q.clone(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -604,7 +727,7 @@ impl<'a, C, A> DetectionMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `list(...)` +/// // like `list(...)` and `translate(...)` /// // to build up your call. /// let rb = hub.translations(); /// # } @@ -621,21 +744,42 @@ impl<'a, C, A> TranslationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns text translations from one language to another. + /// Translates input text, returning translated text. /// /// # Arguments /// - /// * `q` - The text to translate - /// * `target` - The target language into which the text should be translated + /// * `request` - No description provided. + pub fn translate(&self, request: TranslateTextRequest) -> TranslationTranslateCall<'a, C, A> { + TranslationTranslateCall { + 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: + /// + /// Translates input text, returning translated text. + /// + /// # Arguments + /// + /// * `q` - The input text to translate. Repeat this parameter to perform translation + /// operations on multiple text inputs. + /// * `target` - The language to use for translation of the input text, set to one of the + /// language codes listed in Language Support. pub fn list(&self, q: &Vec, target: &str) -> TranslationListCall<'a, C, A> { TranslationListCall { hub: self.hub, _q: q.clone(), _target: target.to_string(), _source: Default::default(), + _model: Default::default(), _format: Default::default(), _cid: Default::default(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -649,7 +793,7 @@ impl<'a, C, A> TranslationMethods<'a, C, A> { // CallBuilders ### // ################# -/// List the source/target languages supported by the API +/// Returns a list of supported languages for translation. /// /// A builder for the *list* method supported by a *language* resource. /// It is not used directly, but through a `LanguageMethods` instance. @@ -677,7 +821,8 @@ impl<'a, C, A> TranslationMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.languages().list() -/// .target("sed") +/// .target("eirmod") +/// .model("sit") /// .doit(); /// # } /// ``` @@ -686,8 +831,10 @@ pub struct LanguageListCall<'a, C, A> hub: &'a Translate, _target: Option, + _model: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for LanguageListCall<'a, C, A> {} @@ -706,11 +853,14 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "language.languages.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); if let Some(value) = self._target { params.push(("target", value.to_string())); } - for &field in ["alt", "target"].iter() { + if let Some(value) = self._model { + params.push(("model", value.to_string())); + } + for &field in ["alt", "target", "model"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -723,17 +873,8 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v2/languages"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -745,10 +886,24 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: 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(Bearer { 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(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -799,13 +954,21 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: } - /// the language and collation in which the localized results should be returned + /// The language to use to return localized, human readable names of supported + /// languages. /// /// Sets the *target* query property to the given value. pub fn target(mut self, new_value: &str) -> LanguageListCall<'a, C, A> { self._target = Some(new_value.to_string()); self } + /// The model type for which supported languages should be returned. + /// + /// Sets the *model* query property to the given value. + pub fn model(mut self, new_value: &str) -> LanguageListCall<'a, C, A> { + self._model = 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. /// @@ -826,23 +989,299 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: /// /// # 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. + /// * *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. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> LanguageListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> LanguageListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } -/// Detect the language of text. +/// Detects the language of text within a request. +/// +/// A builder for the *detect* method supported by a *detection* resource. +/// It is not used directly, but through a `DetectionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_translate2 as translate2; +/// use translate2::DetectLanguageRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use translate2::Translate; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = DetectLanguageRequest::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.detections().detect(req) +/// .doit(); +/// # } +/// ``` +pub struct DetectionDetectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Translate, + _request: DetectLanguageRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DetectionDetectCall<'a, C, A> {} + +impl<'a, C, A> DetectionDetectCall<'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, DetectionsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "language.detections.detect", + 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 = self.hub._base_url.clone() + "v2/detect"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: DetectLanguageRequest) -> DetectionDetectCall<'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) -> DetectionDetectCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DetectionDetectCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DetectionDetectCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Detects the language of text within a request. /// /// A builder for the *list* method supported by a *detection* resource. /// It is not used directly, but through a `DetectionMethods` instance. @@ -880,6 +1319,7 @@ pub struct DetectionListCall<'a, C, A> _q: Vec, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for DetectionListCall<'a, C, A> {} @@ -917,17 +1357,8 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v2/detect"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -939,10 +1370,24 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: 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(Bearer { 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(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -993,7 +1438,8 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: } - /// The text to detect + /// The input text upon which to perform language detection. Repeat this + /// parameter to perform language detection on multiple text inputs. /// /// Append the given value to the *q* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -1024,25 +1470,54 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: /// /// # 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. + /// * *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. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DetectionListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> DetectionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } -/// Returns text translations from one language to another. +/// Translates input text, returning translated text. /// -/// A builder for the *list* method supported by a *translation* resource. +/// A builder for the *translate* method supported by a *translation* resource. /// It is not used directly, but through a `TranslationMethods` instance. /// /// # Example @@ -1054,6 +1529,7 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_translate2 as translate2; +/// use translate2::TranslateTextRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -1064,32 +1540,31 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = TranslateTextRequest::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.translations().list("q", "target") -/// .source("accusam") -/// .format("takimata") -/// .add_cid("justo") +/// let result = hub.translations().translate(req) /// .doit(); /// # } /// ``` -pub struct TranslationListCall<'a, C, A> +pub struct TranslationTranslateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Translate, - _q: Vec, - _target: String, - _source: Option, - _format: Option, - _cid: Vec, + _request: TranslateTextRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for TranslationListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for TranslationTranslateCall<'a, C, A> {} -impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> TranslationTranslateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -1101,27 +1576,10 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "language.translations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - if self._q.len() > 0 { - for f in self._q.iter() { - params.push(("q", f.to_string())); - } - } - params.push(("target", self._target.to_string())); - if let Some(value) = self._source { - params.push(("source", value.to_string())); - } - if let Some(value) = self._format { - params.push(("format", value.to_string())); - } - if self._cid.len() > 0 { - for f in self._cid.iter() { - params.push(("cid", f.to_string())); - } - } - for &field in ["alt", "q", "target", "source", "format", "cid"].iter() { + dlg.begin(MethodInfo { id: "language.translations.translate", + 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)); @@ -1134,17 +1592,8 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v2"; - - 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) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1153,13 +1602,42 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, 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).expect("serde to work"); + 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(Bearer { 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::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())); + 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() @@ -1210,7 +1688,263 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, } - /// The text to translate + /// + /// 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: TranslateTextRequest) -> TranslationTranslateCall<'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) -> TranslationTranslateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> TranslationTranslateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TranslationTranslateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Translates input text, returning translated text. +/// +/// A builder for the *list* method supported by a *translation* resource. +/// It is not used directly, but through a `TranslationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_translate2 as translate2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use translate2::Translate; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Translate::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.translations().list("q", "target") +/// .source("dolores") +/// .model("kasd") +/// .format("accusam") +/// .add_cid("takimata") +/// .doit(); +/// # } +/// ``` +pub struct TranslationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Translate, + _q: Vec, + _target: String, + _source: Option, + _model: Option, + _format: Option, + _cid: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TranslationListCall<'a, C, A> {} + +impl<'a, C, A> TranslationListCall<'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, TranslationsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "language.translations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + if self._q.len() > 0 { + for f in self._q.iter() { + params.push(("q", f.to_string())); + } + } + params.push(("target", self._target.to_string())); + if let Some(value) = self._source { + params.push(("source", value.to_string())); + } + if let Some(value) = self._model { + params.push(("model", value.to_string())); + } + if let Some(value) = self._format { + params.push(("format", value.to_string())); + } + if self._cid.len() > 0 { + for f in self._cid.iter() { + params.push(("cid", f.to_string())); + } + } + for &field in ["alt", "q", "target", "source", "model", "format", "cid"].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 = self.hub._base_url.clone() + "v2"; + 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(Bearer { 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(d); + 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(d); + 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 input text to translate. Repeat this parameter to perform translation + /// operations on multiple text inputs. /// /// Append the given value to the *q* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -1221,7 +1955,8 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, self._q.push(new_value.to_string()); self } - /// The target language into which the text should be translated + /// The language to use for translation of the input text, set to one of the + /// language codes listed in Language Support. /// /// Sets the *target* query property to the given value. /// @@ -1231,14 +1966,26 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, self._target = new_value.to_string(); self } - /// The source language of the text + /// The language of the source text, set to one of the language codes listed in + /// Language Support. If the source language is not specified, the API will + /// attempt to identify the source language automatically and return it within + /// the response. /// /// Sets the *source* query property to the given value. pub fn source(mut self, new_value: &str) -> TranslationListCall<'a, C, A> { self._source = Some(new_value.to_string()); self } - /// The format of the text + /// The `model` type requested for this translation. Valid values are + /// listed in public documentation. + /// + /// Sets the *model* query property to the given value. + pub fn model(mut self, new_value: &str) -> TranslationListCall<'a, C, A> { + self._model = Some(new_value.to_string()); + self + } + /// The format of the source text, in either HTML (default) or plain-text. A + /// value of "html" indicates HTML and a value of "text" indicates plain-text. /// /// Sets the *format* query property to the given value. pub fn format(mut self, new_value: &str) -> TranslationListCall<'a, C, A> { @@ -1273,19 +2020,48 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, /// /// # 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *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. + /// * *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. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> TranslationListCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> TranslationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } diff --git a/gen/vault1-cli/Cargo.toml b/gen/vault1-cli/Cargo.toml new file mode 100644 index 0000000000..c2360fa6d2 --- /dev/null +++ b/gen/vault1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-vault1-cli" +version = "1.0.6+20170812" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Vault (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/vault1-cli" +homepage = "https://developers.google.com/vault" +documentation = "http://byron.github.io/google-apis-rs/google_vault1_cli" +license = "MIT" +keywords = ["vault", "google", "cli"] + +[[bin]] +name = "vault1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-vault1] +path = "../vault1" +version = "1.0.6+20170812" diff --git a/gen/vault1-cli/LICENSE.md b/gen/vault1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/vault1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/vault1-cli/README.md b/gen/vault1-cli/README.md new file mode 100644 index 0000000000..fb32e5b50d --- /dev/null +++ b/gen/vault1-cli/README.md @@ -0,0 +1,131 @@ + +The `vault1` command-line interface *(CLI)* allows to use most features of the *Google Vault* 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 *Vault* API can be found at the +[official documentation site](https://developers.google.com/vault). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-vault1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/vault1-cli). + +# Usage + +This documentation was generated from the *Vault* API at revision *20170812*. The CLI is at version *1.0.6*. + +```bash +vault1 [options] + matters + add-permissions (-r )... [-p ]... [-o ] + close (-r )... [-p ]... [-o ] + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + holds-accounts-create (-r )... [-p ]... [-o ] + holds-accounts-delete [-p ]... [-o ] + holds-accounts-list [-p ]... [-o ] + holds-create (-r )... [-p ]... [-o ] + holds-delete [-p ]... [-o ] + holds-get [-p ]... [-o ] + holds-list [-p ]... [-o ] + holds-update (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + remove-permissions (-r )... [-p ]... [-o ] + reopen (-r )... [-p ]... [-o ] + undelete (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + vault1 --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 `vault1-`. 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/vault1-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/vault1-secret.json`, assuming that the required *vault* 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. `vault1 --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/vault1-cli/mkdocs.yml b/gen/vault1-cli/mkdocs.yml new file mode 100644 index 0000000000..e166adda15 --- /dev/null +++ b/gen/vault1-cli/mkdocs.yml @@ -0,0 +1,34 @@ +site_name: Vault v1.0.6+20170812 +site_url: http://byron.github.io/google-apis-rs/google-vault1-cli +site_description: A complete library to interact with Vault (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/vault1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['matters_add-permissions.md', 'Matters', 'Add Permissions'] +- ['matters_close.md', 'Matters', 'Close'] +- ['matters_create.md', 'Matters', 'Create'] +- ['matters_delete.md', 'Matters', 'Delete'] +- ['matters_get.md', 'Matters', 'Get'] +- ['matters_holds-accounts-create.md', 'Matters', 'Holds Accounts Create'] +- ['matters_holds-accounts-delete.md', 'Matters', 'Holds Accounts Delete'] +- ['matters_holds-accounts-list.md', 'Matters', 'Holds Accounts List'] +- ['matters_holds-create.md', 'Matters', 'Holds Create'] +- ['matters_holds-delete.md', 'Matters', 'Holds Delete'] +- ['matters_holds-get.md', 'Matters', 'Holds Get'] +- ['matters_holds-list.md', 'Matters', 'Holds List'] +- ['matters_holds-update.md', 'Matters', 'Holds Update'] +- ['matters_list.md', 'Matters', 'List'] +- ['matters_remove-permissions.md', 'Matters', 'Remove Permissions'] +- ['matters_reopen.md', 'Matters', 'Reopen'] +- ['matters_undelete.md', 'Matters', 'Undelete'] +- ['matters_update.md', 'Matters', 'Update'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/vault1-cli/src/cmn.rs b/gen/vault1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/vault1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/vault1-cli/src/main.rs b/gen/vault1-cli/src/main.rs new file mode 100644 index 0000000000..c69c0eec27 --- /dev/null +++ b/gen/vault1-cli/src/main.rs @@ -0,0 +1,2123 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_vault1 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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::Vault>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _matters_add_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "cc-me" => Some(("ccMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "send-emails" => Some(("sendEmails", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "matter-permission.role" => Some(("matterPermission.role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "matter-permission.account-id" => Some(("matterPermission.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "cc-me", "matter-permission", "role", "send-emails"]); + 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::AddMatterPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().add_permissions(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_close(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CloseMatterRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().close(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "matter-id" => Some(("matterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "matter-id", "name", "state"]); + 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::Matter = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().create(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().delete(opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().get(opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(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(["view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_accounts_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "hold-time" => Some(("holdTime", 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", "hold-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::HeldAccount = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().holds_accounts_create(request, opt.value_of("matter-id").unwrap_or(""), opt.value_of("hold-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_accounts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().holds_accounts_delete(opt.value_of("matter-id").unwrap_or(""), opt.value_of("hold-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_accounts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().holds_accounts_list(opt.value_of("matter-id").unwrap_or(""), opt.value_of("hold-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_create(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "org-unit.hold-time" => Some(("orgUnit.holdTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "org-unit.org-unit-id" => Some(("orgUnit.orgUnitId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.drive-query.include-team-drive-files" => Some(("query.driveQuery.includeTeamDriveFiles", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query.mail-query.end-time" => Some(("query.mailQuery.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.mail-query.terms" => Some(("query.mailQuery.terms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.mail-query.start-time" => Some(("query.mailQuery.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.groups-query.end-time" => Some(("query.groupsQuery.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.groups-query.terms" => Some(("query.groupsQuery.terms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.groups-query.start-time" => Some(("query.groupsQuery.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "corpus" => Some(("corpus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hold-id" => Some(("holdId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["corpus", "drive-query", "end-time", "groups-query", "hold-id", "hold-time", "include-team-drive-files", "mail-query", "name", "org-unit", "org-unit-id", "query", "start-time", "terms", "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::Hold = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().holds_create(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().holds_delete(opt.value_of("matter-id").unwrap_or(""), opt.value_of("hold-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().holds_get(opt.value_of("matter-id").unwrap_or(""), opt.value_of("hold-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().holds_list(opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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")); + }, + _ => { + 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(["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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_holds_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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 })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "org-unit.hold-time" => Some(("orgUnit.holdTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "org-unit.org-unit-id" => Some(("orgUnit.orgUnitId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.drive-query.include-team-drive-files" => Some(("query.driveQuery.includeTeamDriveFiles", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query.mail-query.end-time" => Some(("query.mailQuery.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.mail-query.terms" => Some(("query.mailQuery.terms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.mail-query.start-time" => Some(("query.mailQuery.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.groups-query.end-time" => Some(("query.groupsQuery.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.groups-query.terms" => Some(("query.groupsQuery.terms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query.groups-query.start-time" => Some(("query.groupsQuery.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "corpus" => Some(("corpus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hold-id" => Some(("holdId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["corpus", "drive-query", "end-time", "groups-query", "hold-id", "hold-time", "include-team-drive-files", "mail-query", "name", "org-unit", "org-unit-id", "query", "start-time", "terms", "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::Hold = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().holds_update(request, opt.value_of("matter-id").unwrap_or(""), opt.value_of("hold-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.matters().list(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "state" => { + call = call.state(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "state", "page-size", "view"].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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_remove_permissions(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RemoveMatterPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().remove_permissions(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_reopen(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ReopenMatterRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().reopen(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_undelete(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UndeleteMatterRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().undelete(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _matters_update(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "matter-id" => Some(("matterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "matter-id", "name", "state"]); + 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::Matter = json::value::from_value(object).unwrap(); + let mut call = self.hub.matters().update(request, opt.value_of("matter-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("matters", Some(opt)) => { + match opt.subcommand() { + ("add-permissions", Some(opt)) => { + call_result = self._matters_add_permissions(opt, dry_run, &mut err); + }, + ("close", Some(opt)) => { + call_result = self._matters_close(opt, dry_run, &mut err); + }, + ("create", Some(opt)) => { + call_result = self._matters_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._matters_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._matters_get(opt, dry_run, &mut err); + }, + ("holds-accounts-create", Some(opt)) => { + call_result = self._matters_holds_accounts_create(opt, dry_run, &mut err); + }, + ("holds-accounts-delete", Some(opt)) => { + call_result = self._matters_holds_accounts_delete(opt, dry_run, &mut err); + }, + ("holds-accounts-list", Some(opt)) => { + call_result = self._matters_holds_accounts_list(opt, dry_run, &mut err); + }, + ("holds-create", Some(opt)) => { + call_result = self._matters_holds_create(opt, dry_run, &mut err); + }, + ("holds-delete", Some(opt)) => { + call_result = self._matters_holds_delete(opt, dry_run, &mut err); + }, + ("holds-get", Some(opt)) => { + call_result = self._matters_holds_get(opt, dry_run, &mut err); + }, + ("holds-list", Some(opt)) => { + call_result = self._matters_holds_list(opt, dry_run, &mut err); + }, + ("holds-update", Some(opt)) => { + call_result = self._matters_holds_update(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._matters_list(opt, dry_run, &mut err); + }, + ("remove-permissions", Some(opt)) => { + call_result = self._matters_remove_permissions(opt, dry_run, &mut err); + }, + ("reopen", Some(opt)) => { + call_result = self._matters_reopen(opt, dry_run, &mut err); + }, + ("undelete", Some(opt)) => { + call_result = self._matters_undelete(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._matters_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("matters".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<'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, "vault1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "vault1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::Vault::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 = [ + ("matters", "methods: 'add-permissions', 'close', 'create', 'delete', 'get', 'holds-accounts-create', 'holds-accounts-delete', 'holds-accounts-list', 'holds-create', 'holds-delete', 'holds-get', 'holds-list', 'holds-update', 'list', 'remove-permissions', 'reopen', 'undelete' and 'update'", vec![ + ("add-permissions", + Some(r##"Adds an account as a matter collaborator."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_add-permissions", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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)), + ]), + ("close", + Some(r##"Closes the specified matter. Returns matter with updated state."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_close", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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)), + ]), + ("create", + Some(r##"Creates a new matter with the given name and description. The initial state + is open, and the owner is the method caller. Returns the created matter + with default view."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified matter. Returns matter with updated state."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_delete", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets the specified matter."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_get", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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)), + ]), + ("holds-accounts-create", + Some(r##"Adds a HeldAccount to a hold. Accounts can only be added to a hold that + has no held_org_unit set. Attempting to add an account to an OU-based + hold will result in an error."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-accounts-create", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"hold-id"##), + None, + Some(r##"The hold ID."##), + 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)), + ]), + ("holds-accounts-delete", + Some(r##"Removes a HeldAccount from a hold. If this request leaves the hold with + no held accounts, the hold will not apply to any accounts."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-accounts-delete", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"hold-id"##), + None, + Some(r##"The hold ID."##), + Some(true), + Some(false)), + + (Some(r##"account-id"##), + None, + Some(r##"The ID of the account to remove from the hold."##), + 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)), + ]), + ("holds-accounts-list", + Some(r##"Lists HeldAccounts for a hold. This will only list individually specified + held accounts. If the hold is on an OU, then use + Admin SDK + to enumerate its members."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-accounts-list", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"hold-id"##), + None, + Some(r##"The hold ID."##), + 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)), + ]), + ("holds-create", + Some(r##"Creates a hold in the given matter."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-create", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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)), + ]), + ("holds-delete", + Some(r##"Removes a hold by ID. This will release any HeldAccounts on this Hold."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-delete", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"hold-id"##), + None, + Some(r##"The hold ID."##), + 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)), + ]), + ("holds-get", + Some(r##"Gets a hold by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-get", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"hold-id"##), + None, + Some(r##"The hold ID."##), + 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)), + ]), + ("holds-list", + Some(r##"Lists holds within a matter. An empty page token in ListHoldsResponse + denotes no more holds to list."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-list", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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)), + ]), + ("holds-update", + Some(r##"Updates the OU and/or query parameters of a hold. You cannot add accounts + to a hold that covers an OU, nor can you add OUs to a hold that covers + individual accounts. Accounts listed in the hold will be ignored."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_holds-update", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"hold-id"##), + None, + Some(r##"The ID of the hold."##), + 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 matters the user has access to."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_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)), + ]), + ("remove-permissions", + Some(r##"Removes an account as a matter collaborator."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_remove-permissions", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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)), + ]), + ("reopen", + Some(r##"Reopens the specified matter. Returns matter with updated state."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_reopen", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("undelete", + Some(r##"Undeletes the specified matter. Returns matter with updated state."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_undelete", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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 the specified matter. + This updates only the name and description of the matter, identified by + matter id. Changes to any other fields are ignored. + Returns the default view of the matter."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/matters_update", + vec![ + (Some(r##"matter-id"##), + None, + Some(r##"The matter ID."##), + 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("vault1") + .author("Sebastian Thiel ") + .version("1.0.6+20170812") + .about("Archiving and eDiscovery for G Suite.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_vault1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/vault1/Cargo.toml b/gen/vault1/Cargo.toml new file mode 100644 index 0000000000..d96e36364f --- /dev/null +++ b/gen/vault1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-vault1" +version = "1.0.6+20170812" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Vault (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/vault1" +homepage = "https://developers.google.com/vault" +documentation = "https://docs.rs/google-vault1/1.0.6+20170812" +license = "MIT" +keywords = ["vault", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/vault1/LICENSE.md b/gen/vault1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/vault1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/vault1/README.md b/gen/vault1/README.md new file mode 100644 index 0000000000..9df5ed779a --- /dev/null +++ b/gen/vault1/README.md @@ -0,0 +1,195 @@ + +The `google-vault1` library allows access to all features of the *Google Vault* service. + +This documentation was generated from *Vault* crate version *1.0.6+20170812*, where *20170812* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Vault* *v1* API can be found at the +[official documentation site](https://developers.google.com/vault). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.Vault.html) ... + +* [matters](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.Matter.html) + * [*add permissions*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterAddPermissionCall.html), [*close*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterCloseCall.html), [*create*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterCreateCall.html), [*delete*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterDeleteCall.html), [*get*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterGetCall.html), [*holds accounts create*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldAccountCreateCall.html), [*holds accounts delete*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldAccountDeleteCall.html), [*holds accounts list*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldAccountListCall.html), [*holds create*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldCreateCall.html), [*holds delete*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldDeleteCall.html), [*holds get*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldGetCall.html), [*holds list*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldListCall.html), [*holds update*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterHoldUpdateCall.html), [*list*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterListCall.html), [*remove permissions*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterRemovePermissionCall.html), [*reopen*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterReopenCall.html), [*undelete*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterUndeleteCall.html) and [*update*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.MatterUpdateCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/struct.Vault.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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.matters().holds_delete(...).doit() +let r = hub.matters().close(...).doit() +let r = hub.matters().get(...).doit() +let r = hub.matters().holds_accounts_list(...).doit() +let r = hub.matters().holds_create(...).doit() +let r = hub.matters().update(...).doit() +let r = hub.matters().holds_list(...).doit() +let r = hub.matters().holds_accounts_create(...).doit() +let r = hub.matters().holds_get(...).doit() +let r = hub.matters().create(...).doit() +let r = hub.matters().list(...).doit() +let r = hub.matters().reopen(...).doit() +let r = hub.matters().undelete(...).doit() +let r = hub.matters().remove_permissions(...).doit() +let r = hub.matters().holds_accounts_delete(...).doit() +let r = hub.matters().delete(...).doit() +let r = hub.matters().add_permissions(...).doit() +let r = hub.matters().holds_update(...).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-vault1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_vault1 as vault1; +use vault1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use vault1::Vault; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().list() + .view("eirmod") + .state("sit") + .page_token("Stet") + .page_size(-42) + .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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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](https://docs.rs/google-vault1/1.0.6+20170812/google_vault1/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 **vault1** 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-rsblob/master/LICENSE.md diff --git a/gen/vault1/src/cmn.rs b/gen/vault1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/vault1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/vault1/src/lib.rs b/gen/vault1/src/lib.rs new file mode 100644 index 0000000000..4858ece342 --- /dev/null +++ b/gen/vault1/src/lib.rs @@ -0,0 +1,6150 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Vault* crate version *1.0.6+20170812*, where *20170812* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Vault* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/vault). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/vault1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Vault.html) ... +//! +//! * [matters](struct.Matter.html) +//! * [*add permissions*](struct.MatterAddPermissionCall.html), [*close*](struct.MatterCloseCall.html), [*create*](struct.MatterCreateCall.html), [*delete*](struct.MatterDeleteCall.html), [*get*](struct.MatterGetCall.html), [*holds accounts create*](struct.MatterHoldAccountCreateCall.html), [*holds accounts delete*](struct.MatterHoldAccountDeleteCall.html), [*holds accounts list*](struct.MatterHoldAccountListCall.html), [*holds create*](struct.MatterHoldCreateCall.html), [*holds delete*](struct.MatterHoldDeleteCall.html), [*holds get*](struct.MatterHoldGetCall.html), [*holds list*](struct.MatterHoldListCall.html), [*holds update*](struct.MatterHoldUpdateCall.html), [*list*](struct.MatterListCall.html), [*remove permissions*](struct.MatterRemovePermissionCall.html), [*reopen*](struct.MatterReopenCall.html), [*undelete*](struct.MatterUndeleteCall.html) and [*update*](struct.MatterUpdateCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Vault.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.matters().holds_delete(...).doit() +//! let r = hub.matters().close(...).doit() +//! let r = hub.matters().get(...).doit() +//! let r = hub.matters().holds_accounts_list(...).doit() +//! let r = hub.matters().holds_create(...).doit() +//! let r = hub.matters().update(...).doit() +//! let r = hub.matters().holds_list(...).doit() +//! let r = hub.matters().holds_accounts_create(...).doit() +//! let r = hub.matters().holds_get(...).doit() +//! let r = hub.matters().create(...).doit() +//! let r = hub.matters().list(...).doit() +//! let r = hub.matters().reopen(...).doit() +//! let r = hub.matters().undelete(...).doit() +//! let r = hub.matters().remove_permissions(...).doit() +//! let r = hub.matters().holds_accounts_delete(...).doit() +//! let r = hub.matters().delete(...).doit() +//! let r = hub.matters().add_permissions(...).doit() +//! let r = hub.matters().holds_update(...).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-vault1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_vault1 as vault1; +//! use vault1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use vault1::Vault; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().list() +//! .view("et") +//! .state("dolores") +//! .page_token("kasd") +//! .page_size(-22) +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 { + /// Manage your eDiscovery data + Ediscovery, + + /// View your eDiscovery data + EdiscoveryReadonly, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Ediscovery => "https://www.googleapis.com/auth/ediscovery", + Scope::EdiscoveryReadonly => "https://www.googleapis.com/auth/ediscovery.readonly", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::EdiscoveryReadonly + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Vault related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_vault1 as vault1; +/// use vault1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use vault1::Vault; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().list() +/// .view("takimata") +/// .state("justo") +/// .page_token("amet.") +/// .page_size(-81) +/// .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 Vault { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Vault {} + +impl<'a, C, A> Vault + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Vault { + Vault { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://vault.googleapis.com/".to_string(), + _root_url: "https://vault.googleapis.com/".to_string(), + } + } + + pub fn matters(&'a self) -> MatterMethods<'a, C, A> { + MatterMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://vault.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://vault.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Close a matter by ID. +/// +/// # 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*). +/// +/// * [close matters](struct.MatterCloseCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloseMatterRequest { _never_set: Option } + +impl RequestValue for CloseMatterRequest {} + + +/// Response to a ReopenMatterRequest. +/// +/// # 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*). +/// +/// * [reopen matters](struct.MatterReopenCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReopenMatterResponse { + /// The updated matter, with state OPEN. + pub matter: Option, +} + +impl ResponseResult for ReopenMatterResponse {} + + +/// Corpus specific queries. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CorpusQuery { + /// Details pertaining to mail holds. If set, corpus must be mail. + #[serde(rename="mailQuery")] + pub mail_query: Option, + /// Details pertaining to Drive holds. If set, corpus must be Drive. + #[serde(rename="driveQuery")] + pub drive_query: Option, + /// Details pertaining to Groups holds. If set, corpus must be Groups. + #[serde(rename="groupsQuery")] + pub groups_query: Option, +} + +impl Part for CorpusQuery {} + + +/// Represents a matter. +/// +/// # 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*). +/// +/// * [holds delete matters](struct.MatterHoldDeleteCall.html) (none) +/// * [close matters](struct.MatterCloseCall.html) (none) +/// * [get matters](struct.MatterGetCall.html) (response) +/// * [holds accounts list matters](struct.MatterHoldAccountListCall.html) (none) +/// * [holds create matters](struct.MatterHoldCreateCall.html) (none) +/// * [update matters](struct.MatterUpdateCall.html) (request|response) +/// * [holds list matters](struct.MatterHoldListCall.html) (none) +/// * [holds accounts create matters](struct.MatterHoldAccountCreateCall.html) (none) +/// * [holds get matters](struct.MatterHoldGetCall.html) (none) +/// * [create matters](struct.MatterCreateCall.html) (request|response) +/// * [list matters](struct.MatterListCall.html) (none) +/// * [reopen matters](struct.MatterReopenCall.html) (none) +/// * [undelete matters](struct.MatterUndeleteCall.html) (response) +/// * [remove permissions matters](struct.MatterRemovePermissionCall.html) (none) +/// * [holds accounts delete matters](struct.MatterHoldAccountDeleteCall.html) (none) +/// * [delete matters](struct.MatterDeleteCall.html) (response) +/// * [add permissions matters](struct.MatterAddPermissionCall.html) (none) +/// * [holds update matters](struct.MatterHoldUpdateCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Matter { + /// List of users and access to the matter. Currently there is no programmer + /// defined limit on the number of permissions a matter can have. + #[serde(rename="matterPermissions")] + pub matter_permissions: Option>, + /// The matter ID which is generated by the server. + /// Should be blank when creating a new matter. + #[serde(rename="matterId")] + pub matter_id: Option, + /// The state of the matter. + pub state: Option, + /// The name of the matter. + pub name: Option, + /// The description of the matter. + pub description: Option, +} + +impl RequestValue for Matter {} +impl Resource for Matter {} +impl ResponseResult for Matter {} + + +/// The holds for a matter. +/// +/// # 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*). +/// +/// * [holds list matters](struct.MatterHoldListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListHoldsResponse { + /// Page token to retrieve the next page of results in the list. + /// If this is empty, then there are no more holds to list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of holds. + pub holds: Option>, +} + +impl ResponseResult for ListHoldsResponse {} + + +/// A organizational unit being held in a particular hold. +/// This structure is immutable. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HeldOrgUnit { + /// When the org unit was put on hold. This property is immutable. + #[serde(rename="holdTime")] + pub hold_time: Option, + /// The org unit's immutable ID as provided by the admin SDK. + #[serde(rename="orgUnitId")] + pub org_unit_id: Option, +} + +impl Part for HeldOrgUnit {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [holds delete matters](struct.MatterHoldDeleteCall.html) (response) +/// * [holds accounts delete matters](struct.MatterHoldAccountDeleteCall.html) (response) +/// * [remove permissions matters](struct.MatterRemovePermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// Remove an account as a matter collaborator. +/// +/// # 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*). +/// +/// * [remove permissions matters](struct.MatterRemovePermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemoveMatterPermissionsRequest { + /// The account ID. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for RemoveMatterPermissionsRequest {} + + +/// Undelete a matter by ID. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [undelete matters](struct.MatterUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UndeleteMatterRequest { _never_set: Option } + +impl RequestValue for UndeleteMatterRequest {} + + +/// An account being held in a particular hold. This structure is immutable. +/// This can be either a single user or a google group, depending on the corpus. +/// +/// # 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*). +/// +/// * [holds accounts create matters](struct.MatterHoldAccountCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HeldAccount { + /// When the account was put on hold. + #[serde(rename="holdTime")] + pub hold_time: Option, + /// The account's ID as provided by the + /// Admin SDK. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl RequestValue for HeldAccount {} +impl ResponseResult for HeldAccount {} + + +/// Currently each matter only has one owner, and all others are collaborators. +/// When an account is purged, its corresponding MatterPermission resources +/// cease to exist. +/// +/// # 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*). +/// +/// * [add permissions matters](struct.MatterAddPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MatterPermission { + /// The user's role in this matter. + pub role: Option, + /// The account id, as provided by Admin SDK. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl ResponseResult for MatterPermission {} + + +/// Returns a list of held accounts for a hold. +/// +/// # 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*). +/// +/// * [holds accounts list matters](struct.MatterHoldAccountListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListHeldAccountsResponse { + /// The held accounts on a hold. + pub accounts: Option>, +} + +impl ResponseResult for ListHeldAccountsResponse {} + + +/// Query options for mail holds. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HeldMailQuery { + /// The end date range for the search query. These timestamps are in GMT and + /// rounded down to the start of the given date. + #[serde(rename="endTime")] + pub end_time: Option, + /// The search terms for the hold. + pub terms: Option, + /// The start date range for the search query. These timestamps are in GMT and + /// rounded down to the start of the given date. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for HeldMailQuery {} + + +/// Add an account with the permission specified. The role cannot be owner. +/// If an account already has a role in the matter, it will be +/// overwritten. +/// +/// # 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*). +/// +/// * [add permissions matters](struct.MatterAddPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddMatterPermissionsRequest { + /// Only relevant if send_emails is true. + /// True to CC requestor in the email message. + /// False to not CC requestor. + #[serde(rename="ccMe")] + pub cc_me: Option, + /// True to send notification email to the added account. + /// False to not send notification email. + #[serde(rename="sendEmails")] + pub send_emails: Option, + /// The MatterPermission to add. + #[serde(rename="matterPermission")] + pub matter_permission: Option, +} + +impl RequestValue for AddMatterPermissionsRequest {} + + +/// Reopen a matter by ID. +/// +/// # 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*). +/// +/// * [reopen matters](struct.MatterReopenCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReopenMatterRequest { _never_set: Option } + +impl RequestValue for ReopenMatterRequest {} + + +/// Query options for group holds. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HeldGroupsQuery { + /// The end date range for the search query. These timestamps are in GMT and + /// rounded down to the start of the given date. + #[serde(rename="endTime")] + pub end_time: Option, + /// The search terms for the hold. + pub terms: Option, + /// The start date range for the search query. These timestamps are in GMT and + /// rounded down to the start of the given date. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for HeldGroupsQuery {} + + +/// Response to a CloseMatterRequest. +/// +/// # 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*). +/// +/// * [close matters](struct.MatterCloseCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloseMatterResponse { + /// The updated matter, with state CLOSED. + pub matter: Option, +} + +impl ResponseResult for CloseMatterResponse {} + + +/// Represents a hold within Vault. A hold restricts purging of +/// artifacts based on the combination of the query and accounts restrictions. +/// A hold can be configured to either apply to an explicitly configured set +/// of accounts, or can be applied to all members of an organizational unit. +/// +/// # 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*). +/// +/// * [holds get matters](struct.MatterHoldGetCall.html) (response) +/// * [holds create matters](struct.MatterHoldCreateCall.html) (request|response) +/// * [holds update matters](struct.MatterHoldUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Hold { + /// The last time this hold was modified. + #[serde(rename="updateTime")] + pub update_time: Option, + /// If set, the hold applies to the enumerated accounts and org_unit must be + /// empty. + pub accounts: Option>, + /// The name of the hold. + pub name: Option, + /// The corpus-specific query. If set, the corpusQuery must match corpus + /// type. + pub query: Option, + /// The corpus to be searched. + pub corpus: Option, + /// The unique immutable ID of the hold. Assigned during creation. + #[serde(rename="holdId")] + pub hold_id: Option, + /// If set, the hold applies to all members of the organizational unit and + /// accounts must be empty. This property is mutable. For groups holds, + /// set the accounts field. + #[serde(rename="orgUnit")] + pub org_unit: Option, +} + +impl RequestValue for Hold {} +impl ResponseResult for Hold {} + + +/// Provides the list of matters. +/// +/// # 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 matters](struct.MatterListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListMattersResponse { + /// Page token to retrieve the next page of results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of matters. + pub matters: Option>, +} + +impl ResponseResult for ListMattersResponse {} + + +/// Query options for drive holds. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HeldDriveQuery { + /// If true, include files in Team Drives in the hold. + #[serde(rename="includeTeamDriveFiles")] + pub include_team_drive_files: Option, +} + +impl Part for HeldDriveQuery {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *matter* resources. +/// It is not used directly, but through the `Vault` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_vault1 as vault1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use vault1::Vault; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `add_permissions(...)`, `close(...)`, `create(...)`, `delete(...)`, `get(...)`, `holds_accounts_create(...)`, `holds_accounts_delete(...)`, `holds_accounts_list(...)`, `holds_create(...)`, `holds_delete(...)`, `holds_get(...)`, `holds_list(...)`, `holds_update(...)`, `list(...)`, `remove_permissions(...)`, `reopen(...)`, `undelete(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.matters(); +/// # } +/// ``` +pub struct MatterMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, +} + +impl<'a, C, A> MethodsBuilder for MatterMethods<'a, C, A> {} + +impl<'a, C, A> MatterMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Removes a hold by ID. This will release any HeldAccounts on this Hold. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID. + /// * `holdId` - The hold ID. + pub fn holds_delete(&self, matter_id: &str, hold_id: &str) -> MatterHoldDeleteCall<'a, C, A> { + MatterHoldDeleteCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _hold_id: hold_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Closes the specified matter. Returns matter with updated state. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn close(&self, request: CloseMatterRequest, matter_id: &str) -> MatterCloseCall<'a, C, A> { + MatterCloseCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified matter. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID. + pub fn get(&self, matter_id: &str) -> MatterGetCall<'a, C, A> { + MatterGetCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists HeldAccounts for a hold. This will only list individually specified + /// held accounts. If the hold is on an OU, then use + /// Admin SDK + /// to enumerate its members. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID. + /// * `holdId` - The hold ID. + pub fn holds_accounts_list(&self, matter_id: &str, hold_id: &str) -> MatterHoldAccountListCall<'a, C, A> { + MatterHoldAccountListCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _hold_id: hold_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 hold in the given matter. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn holds_create(&self, request: Hold, matter_id: &str) -> MatterHoldCreateCall<'a, C, A> { + MatterHoldCreateCall { + hub: self.hub, + _request: request, + _matter_id: matter_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 specified matter. + /// This updates only the name and description of the matter, identified by + /// matter id. Changes to any other fields are ignored. + /// Returns the default view of the matter. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn update(&self, request: Matter, matter_id: &str) -> MatterUpdateCall<'a, C, A> { + MatterUpdateCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists holds within a matter. An empty page token in ListHoldsResponse + /// denotes no more holds to list. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID. + pub fn holds_list(&self, matter_id: &str) -> MatterHoldListCall<'a, C, A> { + MatterHoldListCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Adds a HeldAccount to a hold. Accounts can only be added to a hold that + /// has no held_org_unit set. Attempting to add an account to an OU-based + /// hold will result in an error. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + /// * `holdId` - The hold ID. + pub fn holds_accounts_create(&self, request: HeldAccount, matter_id: &str, hold_id: &str) -> MatterHoldAccountCreateCall<'a, C, A> { + MatterHoldAccountCreateCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _hold_id: hold_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a hold by ID. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID. + /// * `holdId` - The hold ID. + pub fn holds_get(&self, matter_id: &str, hold_id: &str) -> MatterHoldGetCall<'a, C, A> { + MatterHoldGetCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _hold_id: hold_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 new matter with the given name and description. The initial state + /// is open, and the owner is the method caller. Returns the created matter + /// with default view. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Matter) -> MatterCreateCall<'a, C, A> { + MatterCreateCall { + 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 matters the user has access to. + pub fn list(&self) -> MatterListCall<'a, C, A> { + MatterListCall { + hub: self.hub, + _view: Default::default(), + _state: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reopens the specified matter. Returns matter with updated state. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn reopen(&self, request: ReopenMatterRequest, matter_id: &str) -> MatterReopenCall<'a, C, A> { + MatterReopenCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Undeletes the specified matter. Returns matter with updated state. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn undelete(&self, request: UndeleteMatterRequest, matter_id: &str) -> MatterUndeleteCall<'a, C, A> { + MatterUndeleteCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Removes an account as a matter collaborator. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn remove_permissions(&self, request: RemoveMatterPermissionsRequest, matter_id: &str) -> MatterRemovePermissionCall<'a, C, A> { + MatterRemovePermissionCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Removes a HeldAccount from a hold. If this request leaves the hold with + /// no held accounts, the hold will not apply to any accounts. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID. + /// * `holdId` - The hold ID. + /// * `accountId` - The ID of the account to remove from the hold. + pub fn holds_accounts_delete(&self, matter_id: &str, hold_id: &str, account_id: &str) -> MatterHoldAccountDeleteCall<'a, C, A> { + MatterHoldAccountDeleteCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _hold_id: hold_id.to_string(), + _account_id: account_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified matter. Returns matter with updated state. + /// + /// # Arguments + /// + /// * `matterId` - The matter ID + pub fn delete(&self, matter_id: &str) -> MatterDeleteCall<'a, C, A> { + MatterDeleteCall { + hub: self.hub, + _matter_id: matter_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Adds an account as a matter collaborator. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + pub fn add_permissions(&self, request: AddMatterPermissionsRequest, matter_id: &str) -> MatterAddPermissionCall<'a, C, A> { + MatterAddPermissionCall { + hub: self.hub, + _request: request, + _matter_id: matter_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 OU and/or query parameters of a hold. You cannot add accounts + /// to a hold that covers an OU, nor can you add OUs to a hold that covers + /// individual accounts. Accounts listed in the hold will be ignored. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matterId` - The matter ID. + /// * `holdId` - The ID of the hold. + pub fn holds_update(&self, request: Hold, matter_id: &str, hold_id: &str) -> MatterHoldUpdateCall<'a, C, A> { + MatterHoldUpdateCall { + hub: self.hub, + _request: request, + _matter_id: matter_id.to_string(), + _hold_id: hold_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Removes a hold by ID. This will release any HeldAccounts on this Hold. +/// +/// A builder for the *holds.delete* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().holds_delete("matterId", "holdId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _hold_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldDeleteCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + params.push(("holdId", self._hold_id.to_string())); + for &field in ["alt", "matterId", "holdId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds/{holdId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId"), ("{holdId}", "holdId")].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 ["holdId", "matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldDeleteCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The hold ID. + /// + /// Sets the *hold 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 hold_id(mut self, new_value: &str) -> MatterHoldDeleteCall<'a, C, A> { + self._hold_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) -> MatterHoldDeleteCall<'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) -> MatterHoldDeleteCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Closes the specified matter. Returns matter with updated state. +/// +/// A builder for the *close* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::CloseMatterRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = CloseMatterRequest::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.matters().close(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterCloseCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: CloseMatterRequest, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterCloseCall<'a, C, A> {} + +impl<'a, C, A> MatterCloseCall<'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, CloseMatterResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.close", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}:close"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: CloseMatterRequest) -> MatterCloseCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterCloseCall<'a, C, A> { + self._matter_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) -> MatterCloseCall<'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) -> MatterCloseCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterCloseCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the specified matter. +/// +/// A builder for the *get* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().get("matterId") +/// .view("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct MatterGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterGetCall<'a, C, A> {} + +impl<'a, C, A> MatterGetCall<'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, Matter)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + for &field in ["alt", "matterId", "view"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EdiscoveryReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterGetCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// Specifies which parts of the Matter to return in the response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> MatterGetCall<'a, C, A> { + self._view = 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) -> MatterGetCall<'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) -> MatterGetCall<'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::EdiscoveryReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists HeldAccounts for a hold. This will only list individually specified +/// held accounts. If the hold is on an OU, then use +/// Admin SDK +/// to enumerate its members. +/// +/// A builder for the *holds.accounts.list* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().holds_accounts_list("matterId", "holdId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldAccountListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _hold_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldAccountListCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldAccountListCall<'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, ListHeldAccountsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.accounts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + params.push(("holdId", self._hold_id.to_string())); + for &field in ["alt", "matterId", "holdId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds/{holdId}/accounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EdiscoveryReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId"), ("{holdId}", "holdId")].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 ["holdId", "matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldAccountListCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The hold ID. + /// + /// Sets the *hold 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 hold_id(mut self, new_value: &str) -> MatterHoldAccountListCall<'a, C, A> { + self._hold_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) -> MatterHoldAccountListCall<'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) -> MatterHoldAccountListCall<'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::EdiscoveryReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldAccountListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a hold in the given matter. +/// +/// A builder for the *holds.create* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::Hold; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Hold::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.matters().holds_create(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: Hold, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldCreateCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldCreateCall<'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, Hold)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Hold) -> MatterHoldCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldCreateCall<'a, C, A> { + self._matter_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) -> MatterHoldCreateCall<'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) -> MatterHoldCreateCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified matter. +/// This updates only the name and description of the matter, identified by +/// matter id. Changes to any other fields are ignored. +/// Returns the default view of the matter. +/// +/// A builder for the *update* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::Matter; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Matter::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.matters().update(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: Matter, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterUpdateCall<'a, C, A> {} + +impl<'a, C, A> MatterUpdateCall<'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, Matter)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Matter) -> MatterUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterUpdateCall<'a, C, A> { + self._matter_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) -> MatterUpdateCall<'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) -> MatterUpdateCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists holds within a matter. An empty page token in ListHoldsResponse +/// denotes no more holds to list. +/// +/// A builder for the *holds.list* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().holds_list("matterId") +/// .page_token("justo") +/// .page_size(-34) +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldListCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldListCall<'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, ListHoldsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "matterId", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/matters/{matterId}/holds"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EdiscoveryReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldListCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The pagination token as returned in the response. + /// An empty token means start from the beginning. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> MatterHoldListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The number of holds to return in the response, between 0 and 100 inclusive. + /// Leaving this empty, or as 0, is the same as page_size = 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> MatterHoldListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MatterHoldListCall<'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) -> MatterHoldListCall<'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::EdiscoveryReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Adds a HeldAccount to a hold. Accounts can only be added to a hold that +/// has no held_org_unit set. Attempting to add an account to an OU-based +/// hold will result in an error. +/// +/// A builder for the *holds.accounts.create* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::HeldAccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = HeldAccount::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.matters().holds_accounts_create(req, "matterId", "holdId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldAccountCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: HeldAccount, + _matter_id: String, + _hold_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldAccountCreateCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldAccountCreateCall<'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, HeldAccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.accounts.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + params.push(("holdId", self._hold_id.to_string())); + for &field in ["alt", "matterId", "holdId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds/{holdId}/accounts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId"), ("{holdId}", "holdId")].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 ["holdId", "matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: HeldAccount) -> MatterHoldAccountCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldAccountCreateCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The hold ID. + /// + /// Sets the *hold 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 hold_id(mut self, new_value: &str) -> MatterHoldAccountCreateCall<'a, C, A> { + self._hold_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) -> MatterHoldAccountCreateCall<'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) -> MatterHoldAccountCreateCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldAccountCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a hold by ID. +/// +/// A builder for the *holds.get* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().holds_get("matterId", "holdId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _hold_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldGetCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldGetCall<'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, Hold)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + params.push(("holdId", self._hold_id.to_string())); + for &field in ["alt", "matterId", "holdId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds/{holdId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EdiscoveryReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId"), ("{holdId}", "holdId")].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 ["holdId", "matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldGetCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The hold ID. + /// + /// Sets the *hold 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 hold_id(mut self, new_value: &str) -> MatterHoldGetCall<'a, C, A> { + self._hold_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) -> MatterHoldGetCall<'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) -> MatterHoldGetCall<'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::EdiscoveryReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new matter with the given name and description. The initial state +/// is open, and the owner is the method caller. Returns the created matter +/// with default view. +/// +/// A builder for the *create* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::Matter; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Matter::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.matters().create(req) +/// .doit(); +/// # } +/// ``` +pub struct MatterCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: Matter, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterCreateCall<'a, C, A> {} + +impl<'a, C, A> MatterCreateCall<'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, Matter)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.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 = self.hub._base_url.clone() + "v1/matters"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Matter) -> MatterCreateCall<'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) -> MatterCreateCall<'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) -> MatterCreateCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists matters the user has access to. +/// +/// A builder for the *list* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().list() +/// .view("et") +/// .state("duo") +/// .page_token("aliquyam") +/// .page_size(-9) +/// .doit(); +/// # } +/// ``` +pub struct MatterListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _view: Option, + _state: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterListCall<'a, C, A> {} + +impl<'a, C, A> MatterListCall<'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, ListMattersResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._state { + params.push(("state", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "view", "state", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/matters"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::EdiscoveryReadonly.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(Bearer { 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(d); + 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(d); + 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) + } + } + } + } + + + /// Specifies which parts of the matter to return in response. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> MatterListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// If set, list only matters with that specific state. The default is listing + /// matters of all states. + /// + /// Sets the *state* query property to the given value. + pub fn state(mut self, new_value: &str) -> MatterListCall<'a, C, A> { + self._state = Some(new_value.to_string()); + self + } + /// The pagination token as returned in the response. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> MatterListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The number of matters to return in the response. + /// Default and maximum are 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> MatterListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MatterListCall<'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) -> MatterListCall<'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::EdiscoveryReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reopens the specified matter. Returns matter with updated state. +/// +/// A builder for the *reopen* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::ReopenMatterRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = ReopenMatterRequest::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.matters().reopen(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterReopenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: ReopenMatterRequest, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterReopenCall<'a, C, A> {} + +impl<'a, C, A> MatterReopenCall<'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, ReopenMatterResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.reopen", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}:reopen"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: ReopenMatterRequest) -> MatterReopenCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterReopenCall<'a, C, A> { + self._matter_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) -> MatterReopenCall<'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) -> MatterReopenCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterReopenCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Undeletes the specified matter. Returns matter with updated state. +/// +/// A builder for the *undelete* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::UndeleteMatterRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = UndeleteMatterRequest::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.matters().undelete(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: UndeleteMatterRequest, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterUndeleteCall<'a, C, A> {} + +impl<'a, C, A> MatterUndeleteCall<'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, Matter)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.undelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}:undelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: UndeleteMatterRequest) -> MatterUndeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterUndeleteCall<'a, C, A> { + self._matter_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) -> MatterUndeleteCall<'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) -> MatterUndeleteCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterUndeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Removes an account as a matter collaborator. +/// +/// A builder for the *removePermissions* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::RemoveMatterPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = RemoveMatterPermissionsRequest::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.matters().remove_permissions(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterRemovePermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: RemoveMatterPermissionsRequest, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterRemovePermissionCall<'a, C, A> {} + +impl<'a, C, A> MatterRemovePermissionCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.removePermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}:removePermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: RemoveMatterPermissionsRequest) -> MatterRemovePermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterRemovePermissionCall<'a, C, A> { + self._matter_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) -> MatterRemovePermissionCall<'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) -> MatterRemovePermissionCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterRemovePermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Removes a HeldAccount from a hold. If this request leaves the hold with +/// no held accounts, the hold will not apply to any accounts. +/// +/// A builder for the *holds.accounts.delete* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().holds_accounts_delete("matterId", "holdId", "accountId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldAccountDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _hold_id: String, + _account_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldAccountDeleteCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldAccountDeleteCall<'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, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.accounts.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + params.push(("holdId", self._hold_id.to_string())); + params.push(("accountId", self._account_id.to_string())); + for &field in ["alt", "matterId", "holdId", "accountId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId"), ("{holdId}", "holdId"), ("{accountId}", "accountId")].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 ["accountId", "holdId", "matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldAccountDeleteCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The hold ID. + /// + /// Sets the *hold 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 hold_id(mut self, new_value: &str) -> MatterHoldAccountDeleteCall<'a, C, A> { + self._hold_id = new_value.to_string(); + self + } + /// The ID of the account to remove from the hold. + /// + /// Sets the *account 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 account_id(mut self, new_value: &str) -> MatterHoldAccountDeleteCall<'a, C, A> { + self._account_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) -> MatterHoldAccountDeleteCall<'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) -> MatterHoldAccountDeleteCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldAccountDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified matter. Returns matter with updated state. +/// +/// A builder for the *delete* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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.matters().delete("matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterDeleteCall<'a, C, A> {} + +impl<'a, C, A> MatterDeleteCall<'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, Matter)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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(Bearer { 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(d); + 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(d); + 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 matter ID + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterDeleteCall<'a, C, A> { + self._matter_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) -> MatterDeleteCall<'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) -> MatterDeleteCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Adds an account as a matter collaborator. +/// +/// A builder for the *addPermissions* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::AddMatterPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = AddMatterPermissionsRequest::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.matters().add_permissions(req, "matterId") +/// .doit(); +/// # } +/// ``` +pub struct MatterAddPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: AddMatterPermissionsRequest, + _matter_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterAddPermissionCall<'a, C, A> {} + +impl<'a, C, A> MatterAddPermissionCall<'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, MatterPermission)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.addPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + for &field in ["alt", "matterId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}:addPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId")].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 ["matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: AddMatterPermissionsRequest) -> MatterAddPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterAddPermissionCall<'a, C, A> { + self._matter_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) -> MatterAddPermissionCall<'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) -> MatterAddPermissionCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterAddPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the OU and/or query parameters of a hold. You cannot add accounts +/// to a hold that covers an OU, nor can you add OUs to a hold that covers +/// individual accounts. Accounts listed in the hold will be ignored. +/// +/// A builder for the *holds.update* method supported by a *matter* resource. +/// It is not used directly, but through a `MatterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// use vault1::Hold; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = Hold::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.matters().holds_update(req, "matterId", "holdId") +/// .doit(); +/// # } +/// ``` +pub struct MatterHoldUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _request: Hold, + _matter_id: String, + _hold_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MatterHoldUpdateCall<'a, C, A> {} + +impl<'a, C, A> MatterHoldUpdateCall<'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, Hold)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.matters.holds.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("matterId", self._matter_id.to_string())); + params.push(("holdId", self._hold_id.to_string())); + for &field in ["alt", "matterId", "holdId"].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 = self.hub._base_url.clone() + "v1/matters/{matterId}/holds/{holdId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Ediscovery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matterId}", "matterId"), ("{holdId}", "holdId")].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 ["holdId", "matterId"].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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: Hold) -> MatterHoldUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The matter ID. + /// + /// Sets the *matter 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 matter_id(mut self, new_value: &str) -> MatterHoldUpdateCall<'a, C, A> { + self._matter_id = new_value.to_string(); + self + } + /// The ID of the hold. + /// + /// Sets the *hold 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 hold_id(mut self, new_value: &str) -> MatterHoldUpdateCall<'a, C, A> { + self._hold_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) -> MatterHoldUpdateCall<'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) -> MatterHoldUpdateCall<'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::Ediscovery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> MatterHoldUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/videointelligence1_beta1-cli/Cargo.toml b/gen/videointelligence1_beta1-cli/Cargo.toml new file mode 100644 index 0000000000..fdbd3cdfa6 --- /dev/null +++ b/gen/videointelligence1_beta1-cli/Cargo.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-videointelligence1_beta1-cli" +version = "1.0.6+20170923" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Video Intelligence (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1-cli" +homepage = "https://cloud.google.com/video-intelligence/docs/" +documentation = "http://byron.github.io/google-apis-rs/google_videointelligence1_beta1_cli" +license = "MIT" +keywords = ["videointelligence", "google", "cli"] + +[[bin]] +name = "videointelligence1-beta1" + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-videointelligence1_beta1] +path = "../videointelligence1_beta1" +version = "1.0.6+20170923" diff --git a/gen/videointelligence1_beta1-cli/LICENSE.md b/gen/videointelligence1_beta1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/videointelligence1_beta1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/videointelligence1_beta1-cli/README.md b/gen/videointelligence1_beta1-cli/README.md new file mode 100644 index 0000000000..56ce5cc1ea --- /dev/null +++ b/gen/videointelligence1_beta1-cli/README.md @@ -0,0 +1,114 @@ + +The `videointelligence1-beta1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Video Intelligence* 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 *Cloud Video Intelligence* API can be found at the +[official documentation site](https://cloud.google.com/video-intelligence/docs/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-videointelligence1_beta1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1-cli). + +# Usage + +This documentation was generated from the *Cloud Video Intelligence* API at revision *20170923*. The CLI is at version *1.0.6*. + +```bash +videointelligence1-beta1 [options] + videos + annotate (-r )... [-p ]... [-o ] + videointelligence1-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 `videointelligence1-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/videointelligence1-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/videointelligence1-beta1-secret.json`, assuming that the required *videointelligence* 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. `videointelligence1-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/videointelligence1_beta1-cli/mkdocs.yml b/gen/videointelligence1_beta1-cli/mkdocs.yml new file mode 100644 index 0000000000..aabf96a332 --- /dev/null +++ b/gen/videointelligence1_beta1-cli/mkdocs.yml @@ -0,0 +1,17 @@ +site_name: Cloud Video Intelligence v1.0.6+20170923 +site_url: http://byron.github.io/google-apis-rs/google-videointelligence1_beta1-cli +site_description: A complete library to interact with Cloud Video Intelligence (protocol v1beta1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['videos_annotate.md', 'Videos', 'Annotate'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/videointelligence1_beta1-cli/src/cmn.rs b/gen/videointelligence1_beta1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/videointelligence1_beta1-cli/src/cmn.rs @@ -0,0 +1,799 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as 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::error::Error as StdError; +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.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist"); + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +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) => { + assure_entry(mapping, &field) + } + _ => 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::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "int")) + .expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "uint")) + .expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, + err, + &field, + "float")) + .expect("valid f64")), + 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 *assure_entry(mapping, field) { + 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 *assure_entry(mapping, &field) { + + 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::Io((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)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, + scope_hash: u64, + _: &Vec<&str>, + token: Option) + -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(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(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + } + Err(io_err) => Err(TokenStorageError::Io(io_err)), + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + } + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(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), + Io((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::Io((ref path, ref err)) => + writeln!(f, + "IO operation failed on path '{}' with error: {}.", + path, + err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((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.join(", ")), + 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 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::Io((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(serde_err) => + panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err); + } + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + 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!(); +} diff --git a/gen/videointelligence1_beta1-cli/src/main.rs b/gen/videointelligence1_beta1-cli/src/main.rs new file mode 100644 index 0000000000..1c1e3f1212 --- /dev/null +++ b/gen/videointelligence1_beta1-cli/src/main.rs @@ -0,0 +1,370 @@ +// 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 hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_videointelligence1_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, FlowType}; +use serde_json as json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n> { + opt: ArgMatches<'n>, + hub: api::CloudVideoIntelligence>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _videos_annotate(&self, opt: &ArgMatches<'n>, 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").map(|i|i.collect()).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()[..] { + "video-context.label-detection-mode" => Some(("videoContext.labelDetectionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-context.shot-change-detection-model" => Some(("videoContext.shotChangeDetectionModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-context.stationary-camera" => Some(("videoContext.stationaryCamera", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-context.safe-search-detection-model" => Some(("videoContext.safeSearchDetectionModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "video-context.label-detection-model" => Some(("videoContext.labelDetectionModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "features" => Some(("features", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "input-content" => Some(("inputContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "input-uri" => Some(("inputUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-uri" => Some(("outputUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["features", "input-content", "input-uri", "label-detection-mode", "label-detection-model", "location-id", "output-uri", "safe-search-detection-model", "shot-change-detection-model", "stationary-camera", "video-context"]); + 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::GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.videos().annotate(request); + for parg in opt.values_of("v").map(|i|i.collect()).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").map(|i|i.collect()).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).expect("serde to work"); + 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() { + ("videos", Some(opt)) => { + match opt.subcommand() { + ("annotate", Some(opt)) => { + call_result = self._videos_annotate(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("videos".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<'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, "videointelligence1-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::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }, + JsonTokenStorage { + program_name: "videointelligence1-beta1", + db_dir: config_dir.clone(), + }, Some(FlowType::InstalledRedirect(54324))); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) + }) + } else { + hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) + }; + let engine = Engine { + opt: opt, + hub: api::CloudVideoIntelligence::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 = [ + ("videos", "methods: 'annotate'", vec![ + ("annotate", + Some(r##"Performs asynchronous video annotation. Progress and results can be + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `AnnotateVideoProgress` (progress). + `Operation.response` contains `AnnotateVideoResponse` (results)."##), + "Details at http://byron.github.io/google-apis-rs/google_videointelligence1_beta1_cli/videos_annotate", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ]; + + let mut app = App::new("videointelligence1-beta1") + .author("Sebastian Thiel ") + .version("1.0.6+20170923") + .about("Cloud Video Intelligence API.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_videointelligence1_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, about, ref subcommands) in arg_data.iter() { + let mut mcmd = SubCommand::with_name(main_command_name).about(about); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::with_name(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/videointelligence1_beta1/Cargo.toml b/gen/videointelligence1_beta1/Cargo.toml new file mode 100644 index 0000000000..3ce9658e73 --- /dev/null +++ b/gen/videointelligence1_beta1/Cargo.toml @@ -0,0 +1,31 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-videointelligence1_beta1" +version = "1.0.6+20170923" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Video Intelligence (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1" +homepage = "https://cloud.google.com/video-intelligence/docs/" +documentation = "https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923" +license = "MIT" +keywords = ["videointelligence", "google", "protocol", "web", "api"] + + +[dev-dependencies] +hyper-rustls = "^0.6" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 1.0" +serde_json = "^ 1.0" +serde_derive = "^ 1.0" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/videointelligence1_beta1/LICENSE.md b/gen/videointelligence1_beta1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/videointelligence1_beta1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015-2016` `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/videointelligence1_beta1/README.md b/gen/videointelligence1_beta1/README.md new file mode 100644 index 0000000000..306624fbd4 --- /dev/null +++ b/gen/videointelligence1_beta1/README.md @@ -0,0 +1,180 @@ + +The `google-videointelligence1_beta1` library allows access to all features of the *Google Cloud Video Intelligence* service. + +This documentation was generated from *Cloud Video Intelligence* crate version *1.0.6+20170923*, where *20170923* is the exact revision of the *videointelligence:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud Video Intelligence* *v1_beta1* API can be found at the +[official documentation site](https://cloud.google.com/video-intelligence/docs/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html) ... + +* videos + * [*annotate*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/struct.VideoAnnotateCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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.videos().annotate(...).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-videointelligence1_beta1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_videointelligence1_beta1 as videointelligence1_beta1; +use videointelligence1_beta1::GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest; +use videointelligence1_beta1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use videointelligence1_beta1::CloudVideoIntelligence; + +// 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), + ::default(), None); +let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest::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.videos().annotate(req) + .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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_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 **videointelligence1_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-rsblob/master/LICENSE.md diff --git a/gen/videointelligence1_beta1/src/cmn.rs b/gen/videointelligence1_beta1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/videointelligence1_beta1/src/cmn.rs @@ -0,0 +1,753 @@ +// 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; +use std::time::Duration; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat, Bearer}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde_json as json; + +/// 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()) + } + + fn set_read_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } + + fn set_write_timeout(&self, _dur: Option) -> io::Result<()> { + Ok(()) + } +} + + +/// 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: &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, 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 Request ({}): {}", 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 `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(d); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 + } + 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, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep(d); + 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 json::value::Value) { + match *value { + 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/videointelligence1_beta1/src/lib.rs b/gen/videointelligence1_beta1/src/lib.rs new file mode 100644 index 0000000000..1a9f86edcb --- /dev/null +++ b/gen/videointelligence1_beta1/src/lib.rs @@ -0,0 +1,902 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud Video Intelligence* crate version *1.0.6+20170923*, where *20170923* is the exact revision of the *videointelligence:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud Video Intelligence* *v1_beta1* API can be found at the +//! [official documentation site](https://cloud.google.com/video-intelligence/docs/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudVideoIntelligence.html) ... +//! +//! * videos +//! * [*annotate*](struct.VideoAnnotateCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudVideoIntelligence.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.videos().annotate(...).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-videointelligence1_beta1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_videointelligence1_beta1 as videointelligence1_beta1; +//! use videointelligence1_beta1::GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest; +//! use videointelligence1_beta1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use videointelligence1_beta1::CloudVideoIntelligence; +//! +//! // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +//! ::default(), None); +//! let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest::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.videos().annotate(req) +//! .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](https://docs.rs/yup-oauth2/*/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)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +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 as json; +use std::io; +use std::fs; +use std::mem; +use std::thread::sleep; +use std::time::Duration; + +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 CloudVideoIntelligence related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_videointelligence1_beta1 as videointelligence1_beta1; +/// use videointelligence1_beta1::GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest; +/// use videointelligence1_beta1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use videointelligence1_beta1::CloudVideoIntelligence; +/// +/// // 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::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest::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.videos().annotate(req) +/// .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 CloudVideoIntelligence { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudVideoIntelligence {} + +impl<'a, C, A> CloudVideoIntelligence + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudVideoIntelligence { + CloudVideoIntelligence { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://videointelligence.googleapis.com/".to_string(), + _root_url: "https://videointelligence.googleapis.com/".to_string(), + } + } + + pub fn videos(&'a self) -> VideoMethods<'a, C, A> { + VideoMethods { hub: &self } + } + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/1.0.6`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + mem::replace(&mut self._user_agent, agent_name) + } + + /// Set the base url to use in all requests to the server. + /// It defaults to `https://videointelligence.googleapis.com/`. + /// + /// Returns the previously set base url. + pub fn base_url(&mut self, new_base_url: String) -> String { + mem::replace(&mut self._base_url, new_base_url) + } + + /// Set the root url to use in all requests to the server. + /// It defaults to `https://videointelligence.googleapis.com/`. + /// + /// Returns the previously set root url. + pub fn root_url(&mut self, new_root_url: String) -> String { + mem::replace(&mut self._root_url, new_root_url) + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Video annotation request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [annotate videos](struct.VideoAnnotateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest { + /// Additional video context and/or feature-specific parameters. + #[serde(rename="videoContext")] + pub video_context: Option, + /// Optional cloud region where annotation should take place. Supported cloud + /// regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + /// is specified, a region will be determined based on video file location. + #[serde(rename="locationId")] + pub location_id: Option, + /// Requested video annotation features. + pub features: Option>, + /// The video data bytes. Encoding: base64. If unset, the input video(s) + /// should be specified via `input_uri`. If set, `input_uri` should be unset. + #[serde(rename="inputContent")] + pub input_content: Option, + /// Input video location. Currently, only + /// [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + /// supported, which must be specified in the following format: + /// `gs://bucket-id/object-id` (other URI formats return + /// google.rpc.Code.INVALID_ARGUMENT). For more information, see + /// [Request URIs](/storage/docs/reference-uris). + /// A video URI may include wildcards in `object-id`, and thus identify + /// multiple videos. Supported wildcards: '*' to match 0 or more characters; + /// '?' to match 1 character. If unset, the input video should be embedded + /// in the request as `input_content`. If set, `input_content` should be unset. + #[serde(rename="inputUri")] + pub input_uri: Option, + /// Optional location where the output (in JSON format) should be stored. + /// Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + /// URIs are supported, which must be specified in the following format: + /// `gs://bucket-id/object-id` (other URI formats return + /// google.rpc.Code.INVALID_ARGUMENT). For more information, see + /// [Request URIs](/storage/docs/reference-uris). + #[serde(rename="outputUri")] + pub output_uri: Option, +} + +impl RequestValue for GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [annotate videos](struct.VideoAnnotateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunning_Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should have the format of `operations/some/unique/name`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for GoogleLongrunning_Operation {} + + +/// The `Status` type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. It is used by +/// [gRPC](https://github.com/grpc). The error model is designed to be: +/// +/// - Simple to use and understand for most users +/// - Flexible enough to meet unexpected needs +/// +/// # Overview +/// +/// The `Status` message contains three pieces of data: error code, error message, +/// and error details. The error code should be an enum value of +/// google.rpc.Code, but it may accept additional error codes if needed. The +/// error message should be a developer-facing English message that helps +/// developers *understand* and *resolve* the error. If a localized user-facing +/// error message is needed, put the localized message in the error details or +/// localize it in the client. The optional error details may contain arbitrary +/// information about the error. There is a predefined set of error detail types +/// in the package `google.rpc` that can be used for common error conditions. +/// +/// # Language mapping +/// +/// The `Status` message is the logical representation of the error model, but it +/// is not necessarily the actual wire format. When the `Status` message is +/// exposed in different client libraries and different wire protocols, it can be +/// mapped differently. For example, it will likely be mapped to some exceptions +/// in Java, but more likely mapped to some error codes in C. +/// +/// # Other uses +/// +/// The error model and the `Status` message can be used in a variety of +/// environments, either with or without APIs, to provide a +/// consistent developer experience across different environments. +/// +/// Example uses of this error model include: +/// +/// - Partial errors. If a service needs to return partial errors to the client, +/// it may embed the `Status` in the normal response to indicate the partial +/// errors. +/// +/// - Workflow errors. A typical workflow has multiple steps. Each step may +/// have a `Status` message for error reporting. +/// +/// - Batch operations. If a client uses batch request and batch response, the +/// `Status` message should be used directly inside batch response, one for +/// each error sub-response. +/// +/// - Asynchronous operations. If an API call embeds asynchronous operation +/// results in its response, the status of those operations should be +/// represented directly using the `Status` message. +/// +/// - Logging. If some API errors are stored in logs, the message `Status` could +/// be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleRpc_Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for GoogleRpc_Status {} + + +/// Video segment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudVideointelligenceV1beta1_VideoSegment { + /// End offset in microseconds (inclusive). Unset means 0. + #[serde(rename="endTimeOffset")] + pub end_time_offset: Option, + /// Start offset in microseconds (inclusive). Unset means 0. + #[serde(rename="startTimeOffset")] + pub start_time_offset: Option, +} + +impl Part for GoogleCloudVideointelligenceV1beta1_VideoSegment {} + + +/// Video context and/or feature-specific parameters. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudVideointelligenceV1beta1_VideoContext { + /// If label detection has been requested, what labels should be detected + /// in addition to video-level labels or segment-level labels. If unspecified, + /// defaults to `SHOT_MODE`. + #[serde(rename="labelDetectionMode")] + pub label_detection_mode: Option, + /// Model to use for shot change detection. + /// Supported values: "latest" and "stable" (the default). + #[serde(rename="shotChangeDetectionModel")] + pub shot_change_detection_model: Option, + /// Model to use for label detection. + /// Supported values: "latest" and "stable" (the default). + #[serde(rename="labelDetectionModel")] + pub label_detection_model: Option, + /// Video segments to annotate. The segments may overlap and are not required + /// to be contiguous or span the whole video. If unspecified, each video + /// is treated as a single segment. + pub segments: Option>, + /// Whether the video has been shot from a stationary (i.e. non-moving) camera. + /// When set to true, might improve detection accuracy for moving objects. + #[serde(rename="stationaryCamera")] + pub stationary_camera: Option, + /// Model to use for safe search detection. + /// Supported values: "latest" and "stable" (the default). + #[serde(rename="safeSearchDetectionModel")] + pub safe_search_detection_model: Option, +} + +impl Part for GoogleCloudVideointelligenceV1beta1_VideoContext {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *video* resources. +/// It is not used directly, but through the `CloudVideoIntelligence` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_videointelligence1_beta1 as videointelligence1_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use videointelligence1_beta1::CloudVideoIntelligence; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `annotate(...)` +/// // to build up your call. +/// let rb = hub.videos(); +/// # } +/// ``` +pub struct VideoMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudVideoIntelligence, +} + +impl<'a, C, A> MethodsBuilder for VideoMethods<'a, C, A> {} + +impl<'a, C, A> VideoMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Performs asynchronous video annotation. Progress and results can be + /// retrieved through the `google.longrunning.Operations` interface. + /// `Operation.metadata` contains `AnnotateVideoProgress` (progress). + /// `Operation.response` contains `AnnotateVideoResponse` (results). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn annotate(&self, request: GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest) -> VideoAnnotateCall<'a, C, A> { + VideoAnnotateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Performs asynchronous video annotation. Progress and results can be +/// retrieved through the `google.longrunning.Operations` interface. +/// `Operation.metadata` contains `AnnotateVideoProgress` (progress). +/// `Operation.response` contains `AnnotateVideoResponse` (results). +/// +/// A builder for the *annotate* method supported by a *video* resource. +/// It is not used directly, but through a `VideoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_videointelligence1_beta1 as videointelligence1_beta1; +/// use videointelligence1_beta1::GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use videointelligence1_beta1::CloudVideoIntelligence; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::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 = GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest::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.videos().annotate(req) +/// .doit(); +/// # } +/// ``` +pub struct VideoAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudVideoIntelligence, + _request: GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VideoAnnotateCall<'a, C, A> {} + +impl<'a, C, A> VideoAnnotateCall<'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, GoogleLongrunning_Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "videointelligence.videos.annotate", + 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 = self.hub._base_url.clone() + "v1beta1/videos:annotate"; + 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).expect("serde to work"); + 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(Bearer { 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(d); + 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(d); + 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: GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest) -> VideoAnnotateCall<'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) -> VideoAnnotateCall<'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 + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VideoAnnotateCall<'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. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// 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) -> VideoAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/webmasters3-cli/Cargo.toml b/gen/webmasters3-cli/Cargo.toml index 59d1e94d7a..4189e59106 100644 --- a/gen/webmasters3-cli/Cargo.toml +++ b/gen/webmasters3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webmasters3-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170528" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-webmasters3] path = "../webmasters3" -version = "1.0.6+20170517" +version = "1.0.6+20170528" diff --git a/gen/webmasters3-cli/README.md b/gen/webmasters3-cli/README.md index 12461b236e..73f813c1da 100644 --- a/gen/webmasters3-cli/README.md +++ b/gen/webmasters3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *webmasters* API at revision *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *webmasters* API at revision *20170528*. The CLI is at version *1.0.6*. ```bash webmasters3 [options] diff --git a/gen/webmasters3-cli/mkdocs.yml b/gen/webmasters3-cli/mkdocs.yml index 04e8f9fa7d..68c1c5572f 100644 --- a/gen/webmasters3-cli/mkdocs.yml +++ b/gen/webmasters3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: webmasters v1.0.6+20170517 +site_name: webmasters v1.0.6+20170528 site_url: http://byron.github.io/google-apis-rs/google-webmasters3-cli site_description: A complete library to interact with webmasters (protocol v3) diff --git a/gen/webmasters3-cli/src/main.rs b/gen/webmasters3-cli/src/main.rs index a06b3f56a7..53235d427c 100644 --- a/gen/webmasters3-cli/src/main.rs +++ b/gen/webmasters3-cli/src/main.rs @@ -1244,7 +1244,7 @@ fn main() { let mut app = App::new("webmasters3") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170528") .about("View Google Search Console data for your verified sites.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webmasters3_cli") .arg(Arg::with_name("url") diff --git a/gen/webmasters3/Cargo.toml b/gen/webmasters3/Cargo.toml index 0c21fd3777..d8b1bdde3a 100644 --- a/gen/webmasters3/Cargo.toml +++ b/gen/webmasters3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-webmasters3" -version = "1.0.6+20170517" +version = "1.0.6+20170528" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3" homepage = "https://developers.google.com/webmaster-tools/" -documentation = "https://docs.rs/google-webmasters3/1.0.6+20170517" +documentation = "https://docs.rs/google-webmasters3/1.0.6+20170528" license = "MIT" keywords = ["webmasters", "google", "protocol", "web", "api"] diff --git a/gen/webmasters3/README.md b/gen/webmasters3/README.md index 76421ef1bb..f4633e9331 100644 --- a/gen/webmasters3/README.md +++ b/gen/webmasters3/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-webmasters3` library allows access to all features of the *Google webmasters* service. -This documentation was generated from *webmasters* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *webmasters* crate version *1.0.6+20170528*, where *20170528* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *webmasters* *v3* API can be found at the [official documentation site](https://developers.google.com/webmaster-tools/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.Webmasters.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.Webmasters.html) ... * searchanalytics - * [*query*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SearchanalyticQueryCall.html) + * [*query*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SearchanalyticQueryCall.html) * sitemaps - * [*delete*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SitemapGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SitemapListCall.html) and [*submit*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SitemapSubmitCall.html) + * [*delete*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SitemapGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SitemapListCall.html) and [*submit*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SitemapSubmitCall.html) * sites - * [*add*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SiteAddCall.html), [*delete*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SiteDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SiteGetCall.html) and [*list*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.SiteListCall.html) + * [*add*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SiteAddCall.html), [*delete*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SiteDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SiteGetCall.html) and [*list*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.SiteListCall.html) * urlcrawlerrorscounts - * [*query*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.UrlcrawlerrorscountQueryCall.html) + * [*query*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.UrlcrawlerrorscountQueryCall.html) * urlcrawlerrorssamples - * [*get*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.UrlcrawlerrorssampleGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.UrlcrawlerrorssampleListCall.html) and [*mark as fixed*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.UrlcrawlerrorssampleMarkAsFixedCall.html) + * [*get*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.UrlcrawlerrorssampleGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.UrlcrawlerrorssampleListCall.html) and [*mark as fixed*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.UrlcrawlerrorssampleMarkAsFixedCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/struct.Webmasters.html)** +* **[Hub](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/struct.Webmasters.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.Part.html)** + * **[Parts](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/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")`. @@ -144,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/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](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/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](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/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](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/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](https://docs.rs/google-webmasters3/1.0.6+20170517/google_webmasters3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-webmasters3/1.0.6+20170528/google_webmasters3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/webmasters3/src/lib.rs b/gen/webmasters3/src/lib.rs index 8ad5b85c65..6a86825804 100644 --- a/gen/webmasters3/src/lib.rs +++ b/gen/webmasters3/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 *webmasters* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *webmasters* crate version *1.0.6+20170528*, where *20170528* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *webmasters* *v3* API can be found at the //! [official documentation site](https://developers.google.com/webmaster-tools/). diff --git a/gen/youtube3-cli/Cargo.toml b/gen/youtube3-cli/Cargo.toml index cd15eb490b..e2405650cf 100644 --- a/gen/youtube3-cli/Cargo.toml +++ b/gen/youtube3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3-cli" -version = "1.0.6+20170130" +version = "1.0.6+20170918" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-youtube3] path = "../youtube3" -version = "1.0.6+20170130" +version = "1.0.6+20170918" diff --git a/gen/youtube3-cli/README.md b/gen/youtube3-cli/README.md index 09ed9c5dcb..a7f1695913 100644 --- a/gen/youtube3-cli/README.md +++ b/gen/youtube3-cli/README.md @@ -25,7 +25,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 *20170130*. The CLI is at version *1.0.6*. +This documentation was generated from the *YouTube* API at revision *20170918*. The CLI is at version *1.0.6*. ```bash youtube3 [options] diff --git a/gen/youtube3-cli/mkdocs.yml b/gen/youtube3-cli/mkdocs.yml index bac6a1e43a..4bb510ce26 100644 --- a/gen/youtube3-cli/mkdocs.yml +++ b/gen/youtube3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube v1.0.6+20170130 +site_name: YouTube v1.0.6+20170918 site_url: http://byron.github.io/google-apis-rs/google-youtube3-cli site_description: A complete library to interact with YouTube (protocol v3) diff --git a/gen/youtube3-cli/src/main.rs b/gen/youtube3-cli/src/main.rs index 31a82ea70d..aa0f118541 100644 --- a/gen/youtube3-cli/src/main.rs +++ b/gen/youtube3-cli/src/main.rs @@ -745,6 +745,9 @@ impl<'n> Engine<'n> { "on-behalf-of-content-owner" => { call = call.on_behalf_of_content_owner(value.unwrap_or("")); }, + "channel-id" => { + call = call.channel_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -758,7 +761,7 @@ impl<'n> Engine<'n> { 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.extend(["on-behalf-of-content-owner", "channel-id"].iter().map(|v|*v)); v } )); } } @@ -2543,16 +2546,18 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, 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.closed-captions-type" => Some(("contentDetails.closedCaptionsType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.bound-stream-last-update-time-ms" => Some(("contentDetails.boundStreamLastUpdateTimeMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.start-with-slate" => Some(("contentDetails.startWithSlate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.monitor-stream.broadcast-stream-delay-ms" => Some(("contentDetails.monitorStream.broadcastStreamDelayMs", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "content-details.monitor-stream.embed-html" => Some(("contentDetails.monitorStream.embedHtml", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.monitor-stream.enable-monitor-stream" => Some(("contentDetails.monitorStream.enableMonitorStream", 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.latency-preference" => Some(("contentDetails.latencyPreference", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.mesh" => Some(("contentDetails.mesh", JsonTypeInfo { jtype: JsonType::String, 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.bound-stream-last-update-time-ms" => Some(("contentDetails.boundStreamLastUpdateTimeMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.closed-captions-type" => Some(("contentDetails.closedCaptionsType", JsonTypeInfo { jtype: JsonType::String, 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 })), @@ -2585,7 +2590,7 @@ impl<'n> Engine<'n> { "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", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "channel-id", "closed-captions-type", "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", "live-chat-id", "maxres", "medium", "monitor-stream", "privacy-status", "projection", "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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "channel-id", "closed-captions-type", "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", "latency-preference", "life-cycle-status", "live-broadcast-priority", "live-chat-id", "maxres", "medium", "mesh", "monitor-stream", "privacy-status", "projection", "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 } @@ -2818,16 +2823,18 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, 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.closed-captions-type" => Some(("contentDetails.closedCaptionsType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.bound-stream-last-update-time-ms" => Some(("contentDetails.boundStreamLastUpdateTimeMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.start-with-slate" => Some(("contentDetails.startWithSlate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.monitor-stream.broadcast-stream-delay-ms" => Some(("contentDetails.monitorStream.broadcastStreamDelayMs", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "content-details.monitor-stream.embed-html" => Some(("contentDetails.monitorStream.embedHtml", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.monitor-stream.enable-monitor-stream" => Some(("contentDetails.monitorStream.enableMonitorStream", 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.latency-preference" => Some(("contentDetails.latencyPreference", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.mesh" => Some(("contentDetails.mesh", JsonTypeInfo { jtype: JsonType::String, 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.bound-stream-last-update-time-ms" => Some(("contentDetails.boundStreamLastUpdateTimeMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.closed-captions-type" => Some(("contentDetails.closedCaptionsType", JsonTypeInfo { jtype: JsonType::String, 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 })), @@ -2860,7 +2867,7 @@ impl<'n> Engine<'n> { "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", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "channel-id", "closed-captions-type", "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", "live-chat-id", "maxres", "medium", "monitor-stream", "privacy-status", "projection", "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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "channel-id", "closed-captions-type", "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", "latency-preference", "life-cycle-status", "live-broadcast-priority", "live-chat-id", "maxres", "medium", "mesh", "monitor-stream", "privacy-status", "projection", "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 } @@ -5433,8 +5440,7 @@ impl<'n> Engine<'n> { "content-details.content-rating.nfvcb-rating" => Some(("contentDetails.contentRating.nfvcbRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.bmukk-rating" => Some(("contentDetails.contentRating.bmukkRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.chfilm-rating" => Some(("contentDetails.contentRating.chfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.content-rating.resorteviolencia-rating" => Some(("contentDetails.contentRating.resorteviolenciaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.content-rating.rte-rating" => Some(("contentDetails.contentRating.rteRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.mena-mpaa-rating" => Some(("contentDetails.contentRating.menaMpaaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.csa-rating" => Some(("contentDetails.contentRating.csaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.moctw-rating" => Some(("contentDetails.contentRating.moctwRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.anatel-rating" => Some(("contentDetails.contentRating.anatelRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5459,16 +5465,18 @@ impl<'n> Engine<'n> { "content-details.content-rating.nbc-rating" => Some(("contentDetails.contentRating.nbcRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.djctq-rating" => Some(("contentDetails.contentRating.djctqRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.ifco-rating" => Some(("contentDetails.contentRating.ifcoRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.mpaat-rating" => Some(("contentDetails.contentRating.mpaatRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.fco-rating" => Some(("contentDetails.contentRating.fcoRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.eefilm-rating" => Some(("contentDetails.contentRating.eefilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.medietilsynet-rating" => Some(("contentDetails.contentRating.medietilsynetRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.grfilm-rating" => Some(("contentDetails.contentRating.grfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.ccc-rating" => Some(("contentDetails.contentRating.cccRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.content-rating.lsf-rating" => Some(("contentDetails.contentRating.lsfRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.rte-rating" => Some(("contentDetails.contentRating.rteRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.czfilm-rating" => Some(("contentDetails.contentRating.czfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.ecbmct-rating" => Some(("contentDetails.contentRating.ecbmctRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.fmoc-rating" => Some(("contentDetails.contentRating.fmocRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.eirin-rating" => Some(("contentDetails.contentRating.eirinRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.lsf-rating" => Some(("contentDetails.contentRating.lsfRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.cce-rating" => Some(("contentDetails.contentRating.cceRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.nkclv-rating" => Some(("contentDetails.contentRating.nkclvRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.mtrcb-rating" => Some(("contentDetails.contentRating.mtrcbRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5490,6 +5498,7 @@ impl<'n> Engine<'n> { "content-details.content-rating.moc-rating" => Some(("contentDetails.contentRating.mocRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.rcnof-rating" => Some(("contentDetails.contentRating.rcnofRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.meku-rating" => Some(("contentDetails.contentRating.mekuRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.resorteviolencia-rating" => Some(("contentDetails.contentRating.resorteviolenciaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.fcbm-rating" => Some(("contentDetails.contentRating.fcbmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.kijkwijzer-rating" => Some(("contentDetails.contentRating.kijkwijzerRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.caption" => Some(("contentDetails.caption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5569,7 +5578,7 @@ impl<'n> Engine<'n> { "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", "active-live-chat-id", "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", "cnc-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", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "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", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "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", "mcst-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", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "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-categories", "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", "active-live-chat-id", "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", "cnc-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", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "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", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "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", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mena-mpaa-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mpaat-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", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "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-categories", "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 } @@ -5921,8 +5930,7 @@ impl<'n> Engine<'n> { "content-details.content-rating.nfvcb-rating" => Some(("contentDetails.contentRating.nfvcbRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.bmukk-rating" => Some(("contentDetails.contentRating.bmukkRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.chfilm-rating" => Some(("contentDetails.contentRating.chfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.content-rating.resorteviolencia-rating" => Some(("contentDetails.contentRating.resorteviolenciaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.content-rating.rte-rating" => Some(("contentDetails.contentRating.rteRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.mena-mpaa-rating" => Some(("contentDetails.contentRating.menaMpaaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.csa-rating" => Some(("contentDetails.contentRating.csaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.moctw-rating" => Some(("contentDetails.contentRating.moctwRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.anatel-rating" => Some(("contentDetails.contentRating.anatelRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5947,16 +5955,18 @@ impl<'n> Engine<'n> { "content-details.content-rating.nbc-rating" => Some(("contentDetails.contentRating.nbcRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.djctq-rating" => Some(("contentDetails.contentRating.djctqRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.ifco-rating" => Some(("contentDetails.contentRating.ifcoRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.mpaat-rating" => Some(("contentDetails.contentRating.mpaatRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.fco-rating" => Some(("contentDetails.contentRating.fcoRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.eefilm-rating" => Some(("contentDetails.contentRating.eefilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.medietilsynet-rating" => Some(("contentDetails.contentRating.medietilsynetRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.grfilm-rating" => Some(("contentDetails.contentRating.grfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.ccc-rating" => Some(("contentDetails.contentRating.cccRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.content-rating.lsf-rating" => Some(("contentDetails.contentRating.lsfRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.rte-rating" => Some(("contentDetails.contentRating.rteRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.czfilm-rating" => Some(("contentDetails.contentRating.czfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.ecbmct-rating" => Some(("contentDetails.contentRating.ecbmctRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.fmoc-rating" => Some(("contentDetails.contentRating.fmocRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.eirin-rating" => Some(("contentDetails.contentRating.eirinRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.lsf-rating" => Some(("contentDetails.contentRating.lsfRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.cce-rating" => Some(("contentDetails.contentRating.cceRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.nkclv-rating" => Some(("contentDetails.contentRating.nkclvRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.mtrcb-rating" => Some(("contentDetails.contentRating.mtrcbRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5978,6 +5988,7 @@ impl<'n> Engine<'n> { "content-details.content-rating.moc-rating" => Some(("contentDetails.contentRating.mocRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.rcnof-rating" => Some(("contentDetails.contentRating.rcnofRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.meku-rating" => Some(("contentDetails.contentRating.mekuRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.resorteviolencia-rating" => Some(("contentDetails.contentRating.resorteviolenciaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.fcbm-rating" => Some(("contentDetails.contentRating.fcbmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.kijkwijzer-rating" => Some(("contentDetails.contentRating.kijkwijzerRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.caption" => Some(("contentDetails.caption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6057,7 +6068,7 @@ impl<'n> Engine<'n> { "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", "active-live-chat-id", "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", "cnc-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", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "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", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "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", "mcst-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", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "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-categories", "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", "active-live-chat-id", "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", "cnc-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", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "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", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "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", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mena-mpaa-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mpaat-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", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "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-categories", "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 } @@ -8472,7 +8483,7 @@ fn main() { let mut app = App::new("youtube3") .author("Sebastian Thiel ") - .version("1.0.6+20170130") + .version("1.0.6+20170918") .about("Supports core YouTube features, such as uploading videos, creating and managing playlists, searching for content, and much more.") .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/Cargo.toml b/gen/youtube3/Cargo.toml index 38cd1abdbb..5aca2d544b 100644 --- a/gen/youtube3/Cargo.toml +++ b/gen/youtube3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtube3" -version = "1.0.6+20170130" +version = "1.0.6+20170918" 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" homepage = "https://developers.google.com/youtube/v3" -documentation = "https://docs.rs/google-youtube3/1.0.6+20170130" +documentation = "https://docs.rs/google-youtube3/1.0.6+20170918" license = "MIT" keywords = ["youtube", "google", "protocol", "web", "api"] diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 32a1f9e3e9..959a93f7d5 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -5,86 +5,86 @@ 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 *1.0.6+20170130*, where *20170130* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *YouTube* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *YouTube* *v3* API can be found at the [official documentation site](https://developers.google.com/youtube/v3). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.YouTube.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.YouTube.html) ... -* [activities](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Activity.html) - * [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ActivityListCall.html) -* [captions](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Caption.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionUpdateCall.html) +* [activities](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Activity.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ActivityListCall.html) +* [captions](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Caption.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionUpdateCall.html) * channel banners - * [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelBannerInsertCall.html) -* [channel sections](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelSection.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelSectionUpdateCall.html) -* [channels](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Channel.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelUpdateCall.html) -* [comment threads](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentThread.html) - * [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentThreadUpdateCall.html) -* [comments](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Comment.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CommentUpdateCall.html) -* [fan funding events](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.FanFundingEvent.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.FanFundingEventListCall.html) -* [guide categories](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.GuideCategory.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.GuideCategoryListCall.html) -* [i18n languages](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.I18nLanguage.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.I18nLanguageListCall.html) -* [i18n regions](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.I18nRegion.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.I18nRegionListCall.html) -* [live broadcasts](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcast.html) - * [*bind*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveBroadcastUpdateCall.html) -* [live chat bans](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatBan.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatBanInsertCall.html) -* [live chat messages](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatMessage.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatMessageListCall.html) -* [live chat moderators](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatModerator.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveChatModeratorListCall.html) -* [live streams](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveStream.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.LiveStreamUpdateCall.html) -* [playlist items](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistItem.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistItemUpdateCall.html) -* [playlists](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Playlist.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistUpdateCall.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelBannerInsertCall.html) +* [channel sections](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelSection.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelSectionUpdateCall.html) +* [channels](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Channel.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelUpdateCall.html) +* [comment threads](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentThread.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentThreadUpdateCall.html) +* [comments](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Comment.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CommentUpdateCall.html) +* [fan funding events](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.FanFundingEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.FanFundingEventListCall.html) +* [guide categories](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.GuideCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.GuideCategoryListCall.html) +* [i18n languages](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.I18nLanguage.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.I18nLanguageListCall.html) +* [i18n regions](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.I18nRegion.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.I18nRegionListCall.html) +* [live broadcasts](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcast.html) + * [*bind*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveBroadcastUpdateCall.html) +* [live chat bans](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatBan.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatBanInsertCall.html) +* [live chat messages](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatMessage.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatMessageListCall.html) +* [live chat moderators](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatModerator.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveChatModeratorListCall.html) +* [live streams](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveStream.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.LiveStreamUpdateCall.html) +* [playlist items](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItem.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItemUpdateCall.html) +* [playlists](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Playlist.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistUpdateCall.html) * search - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SearchListCall.html) -* [sponsors](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Sponsor.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SponsorListCall.html) -* [subscriptions](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Subscription.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SubscriptionListCall.html) -* [super chat events](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SuperChatEvent.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.SuperChatEventListCall.html) -* [thumbnails](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Thumbnail.html) - * [*set*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ThumbnailSetCall.html) -* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoAbuseReportReason.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoAbuseReportReasonListCall.html) -* [video categories](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoCategory.html) - * [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoCategoryListCall.html) -* [videos](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.Video.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoUpdateCall.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SearchListCall.html) +* [sponsors](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Sponsor.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SponsorListCall.html) +* [subscriptions](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Subscription.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SubscriptionListCall.html) +* [super chat events](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SuperChatEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.SuperChatEventListCall.html) +* [thumbnails](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Thumbnail.html) + * [*set*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ThumbnailSetCall.html) +* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoAbuseReportReason.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoAbuseReportReasonListCall.html) +* [video categories](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoCategoryListCall.html) +* [videos](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.Video.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoUpdateCall.html) * watermarks - * [*set*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.WatermarkUnsetCall.html) + * [*set*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.WatermarkUnsetCall.html) Upload supported by ... -* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ThumbnailSetCall.html) -* [*insert captions*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionInsertCall.html) -* [*insert videos*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.VideoInsertCall.html) -* [*set watermarks*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.WatermarkSetCall.html) -* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.ChannelBannerInsertCall.html) -* [*update captions*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionUpdateCall.html) +* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ThumbnailSetCall.html) +* [*insert captions*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionInsertCall.html) +* [*insert videos*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.VideoInsertCall.html) +* [*set watermarks*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.WatermarkSetCall.html) +* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.ChannelBannerInsertCall.html) +* [*update captions*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionUpdateCall.html) Download supported by ... -* [*download captions*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.CaptionDownloadCall.html) +* [*download captions*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionDownloadCall.html) Subscription supported by ... -* [*list playlist items*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.PlaylistItemListCall.html) +* [*list playlist items*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItemListCall.html) @@ -92,17 +92,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/struct.YouTube.html)** +* **[Hub](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.YouTube.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -203,17 +203,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/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")`. @@ -223,29 +223,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/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](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/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](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/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](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/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](https://docs.rs/google-youtube3/1.0.6+20170130/google_youtube3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 54fe944c7f..b2949e8f1e 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 *1.0.6+20170130*, where *20170130* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *YouTube* crate version *1.0.6+20170918*, where *20170918* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *YouTube* *v3* API can be found at the //! [official documentation site](https://developers.google.com/youtube/v3). @@ -646,6 +646,48 @@ pub struct VideoFileDetails { impl Part for VideoFileDetails {} +/// A liveChatModerator resource represents a moderator for a YouTube live chat. A chat moderator has the ability to ban/unban users from a chat, remove message, etc. +/// +/// # 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 live chat moderators](struct.LiveChatModeratorInsertCall.html) (request|response) +/// * [list live chat moderators](struct.LiveChatModeratorListCall.html) (none) +/// * [delete live chat moderators](struct.LiveChatModeratorDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LiveChatModerator { + /// The snippet object contains basic details about the moderator. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveChatModerator". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The ID that YouTube assigns to uniquely identify the moderator. + pub id: Option, +} + +impl RequestValue for LiveChatModerator {} +impl Resource for LiveChatModerator {} +impl ResponseResult for LiveChatModerator {} + +impl ToParts for LiveChatModerator { + /// 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 + } +} + /// Basic details about a playlist, including title, description and thumbnails. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2244,47 +2286,6 @@ impl ToParts for VideoCategoryListResponse { } } -/// A liveChatBan resource represents a ban for a YouTube live chat. -/// -/// # 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 live chat bans](struct.LiveChatBanInsertCall.html) (request|response) -/// * [delete live chat bans](struct.LiveChatBanDeleteCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LiveChatBan { - /// The snippet object contains basic details about the ban. - pub snippet: Option, - /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveChatBan". - pub kind: Option, - /// Etag of this resource. - pub etag: Option, - /// The ID that YouTube assigns to uniquely identify the ban. - pub id: Option, -} - -impl RequestValue for LiveChatBan {} -impl Resource for LiveChatBan {} -impl ResponseResult for LiveChatBan {} - -impl ToParts for LiveChatBan { - /// 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 - } -} - /// Video processing progress and completion time estimate. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2727,7 +2728,7 @@ pub struct LiveStreamStatus { impl Part for LiveStreamStatus {} -/// Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 69 +/// Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 71 /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2793,9 +2794,12 @@ pub struct ContentRating { /// The video's Consejo de Calificación Cinematográfica (Chile) rating. #[serde(rename="cccRating")] pub ccc_rating: Option, - /// The video's rating from Indonesia's Lembaga Sensor Film. - #[serde(rename="lsfRating")] - pub lsf_rating: Option, + /// The video's rating from Ireland's Raidió Teilifís Éireann. + #[serde(rename="rteRating")] + pub rte_rating: Option, + /// The rating system for MENA countries, a clone of MPAA. It is needed to + #[serde(rename="menaMpaaRating")] + pub mena_mpaa_rating: Option, /// This property has been deprecated. Use the contentDetails.contentRating.cncRating instead. #[serde(rename="fmocRating")] pub fmoc_rating: Option, @@ -2892,6 +2896,9 @@ pub struct ContentRating { /// The video's Irish Film Classification Office (IFCO - Ireland) rating. See the IFCO website for more information. #[serde(rename="ifcoRating")] pub ifco_rating: Option, + /// The rating system for trailer, DVD, and Ad in the US. See http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html. + #[serde(rename="mpaatRating")] + pub mpaat_rating: Option, /// The video's Australian Classification Board (ACB) or Australian Communications and Media Authority (ACMA) rating. ACMA ratings are used to classify children's television programming. #[serde(rename="acbRating")] pub acb_rating: Option, @@ -2901,9 +2908,9 @@ pub struct ContentRating { /// The video's rating in the Czech Republic. #[serde(rename="czfilmRating")] pub czfilm_rating: Option, - /// The video's rating from Ireland's Raidió Teilifís Éireann. - #[serde(rename="rteRating")] - pub rte_rating: Option, + /// The video's rating from Indonesia's Lembaga Sensor Film. + #[serde(rename="lsfRating")] + pub lsf_rating: Option, /// The video's National Film Registry of the Russian Federation (MKRF - Russia) rating. #[serde(rename="russiaRating")] pub russia_rating: Option, @@ -5020,20 +5027,17 @@ impl ToParts for FanFundingEventListResponse { pub struct LiveBroadcast { /// The status object contains information about the event's status. pub status: Option, - /// no description provided - #[serde(rename="topicDetails")] - pub topic_details: Option, + /// The snippet object contains basic details about the event, including its title, description, start time, and end time. + pub snippet: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveBroadcast". pub kind: 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, + /// Etag of this resource. + pub etag: 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, } @@ -5049,12 +5053,11 @@ impl ToParts for LiveBroadcast { fn to_parts(&self) -> String { let mut r = String::new(); if self.status.is_some() { r = r + "status,"; } - if self.topic_details.is_some() { r = r + "topicDetails,"; } + if self.snippet.is_some() { r = r + "snippet,"; } if self.kind.is_some() { r = r + "kind,"; } 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.content_details.is_some() { r = r + "contentDetails,"; } if self.id.is_some() { r = r + "id,"; } r.pop(); r @@ -5287,19 +5290,6 @@ 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. @@ -5772,29 +5762,34 @@ impl Part for CommentThreadSnippet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveBroadcastContentDetails { - /// The date and time that the live stream referenced by boundStreamId was last updated. - #[serde(rename="boundStreamLastUpdateTimeMs")] - pub bound_stream_last_update_time_ms: Option, + /// no description provided + #[serde(rename="closedCaptionsType")] + pub closed_captions_type: 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, /// The projection format of this broadcast. This defaults to rectangular. pub projection: Option, /// This value uniquely identifies the live stream bound to the broadcast. #[serde(rename="boundStreamId")] pub bound_stream_id: Option, - /// This setting indicates whether the broadcast video can be played in an embedded player. If you choose to archive the video (using the enableArchive property), this setting will also apply to the archived video. - #[serde(rename="enableEmbed")] - pub enable_embed: Option, + /// If both this and enable_low_latency are set, they must match. LATENCY_NORMAL should match enable_low_latency=false LATENCY_LOW should match enable_low_latency=true LATENCY_ULTRA_LOW should have enable_low_latency omitted. + #[serde(rename="latencyPreference")] + pub latency_preference: Option, + /// no description provided + pub mesh: Option, /// This setting indicates whether HTTP POST closed captioning is enabled for this broadcast. The ingestion URL of the closed captions is returned through the liveStreams API. This is mutually exclusive with using the closed_captions_type property, and is equivalent to setting closed_captions_type to CLOSED_CAPTIONS_HTTP_POST. #[serde(rename="enableClosedCaptions")] pub enable_closed_captions: Option, /// Indicates whether this broadcast has low latency enabled. #[serde(rename="enableLowLatency")] pub enable_low_latency: 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, - /// no description provided - #[serde(rename="closedCaptionsType")] - pub closed_captions_type: Option, + /// This setting indicates whether the broadcast video can be played in an embedded player. If you choose to archive the video (using the enableArchive property), this setting will also apply to the archived video. + #[serde(rename="enableEmbed")] + pub enable_embed: 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, @@ -5812,9 +5807,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, + /// The date and time that the live stream referenced by boundStreamId was last updated. + #[serde(rename="boundStreamLastUpdateTimeMs")] + pub bound_stream_last_update_time_ms: Option, } impl Part for LiveBroadcastContentDetails {} @@ -5901,34 +5896,33 @@ impl ToParts for SearchListResponse { } } -/// A liveChatModerator resource represents a moderator for a YouTube live chat. A chat moderator has the ability to ban/unban users from a chat, remove message, etc. +/// A liveChatBan resource represents a ban for a YouTube live chat. /// /// # 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 live chat moderators](struct.LiveChatModeratorInsertCall.html) (request|response) -/// * [list live chat moderators](struct.LiveChatModeratorListCall.html) (none) -/// * [delete live chat moderators](struct.LiveChatModeratorDeleteCall.html) (none) +/// * [insert live chat bans](struct.LiveChatBanInsertCall.html) (request|response) +/// * [delete live chat bans](struct.LiveChatBanDeleteCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LiveChatModerator { - /// The snippet object contains basic details about the moderator. - pub snippet: Option, - /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveChatModerator". +pub struct LiveChatBan { + /// The snippet object contains basic details about the ban. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveChatBan". pub kind: Option, /// Etag of this resource. pub etag: Option, - /// The ID that YouTube assigns to uniquely identify the moderator. + /// The ID that YouTube assigns to uniquely identify the ban. pub id: Option, } -impl RequestValue for LiveChatModerator {} -impl Resource for LiveChatModerator {} -impl ResponseResult for LiveChatModerator {} +impl RequestValue for LiveChatBan {} +impl Resource for LiveChatBan {} +impl ResponseResult for LiveChatBan {} -impl ToParts for LiveChatModerator { +impl ToParts for LiveChatBan { /// 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. @@ -5998,22 +5992,6 @@ 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. @@ -6045,24 +6023,6 @@ pub struct FanFundingEventSnippet { impl Part for FanFundingEventSnippet {} -/// 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 {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -8448,6 +8408,7 @@ impl<'a, C, A> ChannelBannerMethods<'a, C, A> { hub: self.hub, _request: request, _on_behalf_of_content_owner: Default::default(), + _channel_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -25801,8 +25762,8 @@ impl<'a, C, A> LiveBroadcastControlCall<'a, C, A> where C: BorrowMut LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut LiveBroadcastListCall<'a, C, A> where C: BorrowMut /// // Values shown here are possibly random and not representative ! /// let result = hub.channel_banners().insert(req) /// .on_behalf_of_content_owner("consetetur") +/// .channel_id("erat") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -27643,6 +27605,7 @@ pub struct ChannelBannerInsertCall<'a, C, A> hub: &'a YouTube, _request: ChannelBannerResource, _on_behalf_of_content_owner: Option, + _channel_id: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -27665,11 +27628,14 @@ impl<'a, C, A> ChannelBannerInsertCall<'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._on_behalf_of_content_owner { params.push(("onBehalfOfContentOwner", value.to_string())); } - for &field in ["alt", "onBehalfOfContentOwner"].iter() { + if let Some(value) = self._channel_id { + params.push(("channelId", value.to_string())); + } + for &field in ["alt", "onBehalfOfContentOwner", "channelId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -27908,6 +27874,13 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut ChannelBannerInsertCall<'a, C, A> { + self._channel_id = 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. /// @@ -27995,36 +27968,36 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut 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.super_chat_events().list("part") -/// .page_token("ut") -/// .max_results(23) -/// .hl("tempor") +/// .page_token("diam") +/// .max_results(62) +/// .hl("et") /// .doit(); /// # } /// ``` @@ -28872,7 +28845,7 @@ impl<'a, C, A> SuperChatEventListCall<'a, C, A> where C: BorrowMut 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.fan_funding_events().list("part") -/// .page_token("kasd") -/// .max_results(34) -/// .hl("clita") +/// .page_token("et") +/// .max_results(37) +/// .hl("sed") /// .doit(); /// # } /// ``` diff --git a/gen/youtubeanalytics1-cli/Cargo.toml b/gen/youtubeanalytics1-cli/Cargo.toml index 4604d8dad9..b3c2634451 100644 --- a/gen/youtubeanalytics1-cli/Cargo.toml +++ b/gen/youtubeanalytics1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtubeanalytics1-cli" -version = "1.0.6+20170517" +version = "1.0.6+20170925" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Analytics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-youtubeanalytics1] path = "../youtubeanalytics1" -version = "1.0.6+20170517" +version = "1.0.6+20170925" diff --git a/gen/youtubeanalytics1-cli/README.md b/gen/youtubeanalytics1-cli/README.md index f14d09c20b..e721d9300a 100644 --- a/gen/youtubeanalytics1-cli/README.md +++ b/gen/youtubeanalytics1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *YouTube Analytics* API at revision *20170517*. The CLI is at version *1.0.6*. +This documentation was generated from the *YouTube Analytics* API at revision *20170925*. The CLI is at version *1.0.6*. ```bash youtubeanalytics1 [options] diff --git a/gen/youtubeanalytics1-cli/mkdocs.yml b/gen/youtubeanalytics1-cli/mkdocs.yml index 5ebf7f3bd6..5a41dd30b2 100644 --- a/gen/youtubeanalytics1-cli/mkdocs.yml +++ b/gen/youtubeanalytics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Analytics v1.0.6+20170517 +site_name: YouTube Analytics v1.0.6+20170925 site_url: http://byron.github.io/google-apis-rs/google-youtubeanalytics1-cli site_description: A complete library to interact with YouTube Analytics (protocol v1) diff --git a/gen/youtubeanalytics1-cli/src/main.rs b/gen/youtubeanalytics1-cli/src/main.rs index 9cf150d01a..826797159a 100644 --- a/gen/youtubeanalytics1-cli/src/main.rs +++ b/gen/youtubeanalytics1-cli/src/main.rs @@ -947,7 +947,7 @@ fn main() { let mut app = App::new("youtubeanalytics1") .author("Sebastian Thiel ") - .version("1.0.6+20170517") + .version("1.0.6+20170925") .about("Retrieves your YouTube Analytics data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtubeanalytics1_cli") .arg(Arg::with_name("url") diff --git a/gen/youtubeanalytics1/Cargo.toml b/gen/youtubeanalytics1/Cargo.toml index 25a71fe90e..85aec11a7c 100644 --- a/gen/youtubeanalytics1/Cargo.toml +++ b/gen/youtubeanalytics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubeanalytics1" -version = "1.0.6+20170517" +version = "1.0.6+20170925" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Analytics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1" homepage = "http://developers.google.com/youtube/analytics/" -documentation = "https://docs.rs/google-youtubeanalytics1/1.0.6+20170517" +documentation = "https://docs.rs/google-youtubeanalytics1/1.0.6+20170925" license = "MIT" keywords = ["youtubeAnalytics", "google", "protocol", "web", "api"] diff --git a/gen/youtubeanalytics1/README.md b/gen/youtubeanalytics1/README.md index 0bfb5ebfc8..bcccf4b701 100644 --- a/gen/youtubeanalytics1/README.md +++ b/gen/youtubeanalytics1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-youtubeanalytics1` library allows access to all features of the *Google YouTube Analytics* service. -This documentation was generated from *YouTube Analytics* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *YouTube Analytics* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *YouTube Analytics* *v1* API can be found at the [official documentation site](http://developers.google.com/youtube/analytics/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.YouTubeAnalytics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.YouTubeAnalytics.html) ... -* [group items](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupItem.html) - * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupItemDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupItemInsertCall.html) and [*list*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupItemListCall.html) -* [groups](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.Group.html) - * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupListCall.html) and [*update*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.GroupUpdateCall.html) +* [group items](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupItem.html) + * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupItemDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupItemInsertCall.html) and [*list*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupItemListCall.html) +* [groups](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.Group.html) + * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupListCall.html) and [*update*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.GroupUpdateCall.html) * reports - * [*query*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.ReportQueryCall.html) + * [*query*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.ReportQueryCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/struct.YouTubeAnalytics.html)** +* **[Hub](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.YouTubeAnalytics.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/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")`. @@ -147,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/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](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/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](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/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](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/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](https://docs.rs/google-youtubeanalytics1/1.0.6+20170517/google_youtubeanalytics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/youtubeanalytics1/src/lib.rs b/gen/youtubeanalytics1/src/lib.rs index a3d4b9a561..8db476c2d4 100644 --- a/gen/youtubeanalytics1/src/lib.rs +++ b/gen/youtubeanalytics1/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 Analytics* crate version *1.0.6+20170517*, where *20170517* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *YouTube Analytics* crate version *1.0.6+20170925*, where *20170925* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *YouTube Analytics* *v1* API can be found at the //! [official documentation site](http://developers.google.com/youtube/analytics/). diff --git a/gen/youtubereporting1-cli/Cargo.toml b/gen/youtubereporting1-cli/Cargo.toml index 7edf0d7481..acccb9a7c8 100644 --- a/gen/youtubereporting1-cli/Cargo.toml +++ b/gen/youtubereporting1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtubereporting1-cli" -version = "1.0.6+20170520" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Reporting (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubereporting1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-youtubereporting1] path = "../youtubereporting1" -version = "1.0.6+20170520" +version = "1.0.6+20170926" diff --git a/gen/youtubereporting1-cli/README.md b/gen/youtubereporting1-cli/README.md index 2ecdfd5740..0e2c3a30ef 100644 --- a/gen/youtubereporting1-cli/README.md +++ b/gen/youtubereporting1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *YouTube Reporting* API at revision *20170520*. The CLI is at version *1.0.6*. +This documentation was generated from the *YouTube Reporting* API at revision *20170926*. The CLI is at version *1.0.6*. ```bash youtubereporting1 [options] diff --git a/gen/youtubereporting1-cli/mkdocs.yml b/gen/youtubereporting1-cli/mkdocs.yml index 38dd2b6e2a..0add16ba8f 100644 --- a/gen/youtubereporting1-cli/mkdocs.yml +++ b/gen/youtubereporting1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Reporting v1.0.6+20170520 +site_name: YouTube Reporting v1.0.6+20170926 site_url: http://byron.github.io/google-apis-rs/google-youtubereporting1-cli site_description: A complete library to interact with YouTube Reporting (protocol v1) diff --git a/gen/youtubereporting1-cli/src/main.rs b/gen/youtubereporting1-cli/src/main.rs index 52f990cb0d..6287424e1f 100644 --- a/gen/youtubereporting1-cli/src/main.rs +++ b/gen/youtubereporting1-cli/src/main.rs @@ -895,7 +895,7 @@ fn main() { let mut app = App::new("youtubereporting1") .author("Sebastian Thiel ") - .version("1.0.6+20170520") + .version("1.0.6+20170926") .about("Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtubereporting1_cli") .arg(Arg::with_name("url") diff --git a/gen/youtubereporting1/Cargo.toml b/gen/youtubereporting1/Cargo.toml index 2460c83dcd..98f4fe4989 100644 --- a/gen/youtubereporting1/Cargo.toml +++ b/gen/youtubereporting1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubereporting1" -version = "1.0.6+20170520" +version = "1.0.6+20170926" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Reporting (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubereporting1" homepage = "https://developers.google.com/youtube/reporting/v1/reports/" -documentation = "https://docs.rs/google-youtubereporting1/1.0.6+20170520" +documentation = "https://docs.rs/google-youtubereporting1/1.0.6+20170926" license = "MIT" keywords = ["youtubereporting", "google", "protocol", "web", "api"] diff --git a/gen/youtubereporting1/README.md b/gen/youtubereporting1/README.md index 3d212a7963..ca5136b4ee 100644 --- a/gen/youtubereporting1/README.md +++ b/gen/youtubereporting1/README.md @@ -5,25 +5,25 @@ DO NOT EDIT ! --> The `google-youtubereporting1` library allows access to all features of the *Google YouTube Reporting* service. -This documentation was generated from *YouTube Reporting* crate version *1.0.6+20170520*, where *20170520* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *YouTube Reporting* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *YouTube Reporting* *v1* API can be found at the [official documentation site](https://developers.google.com/youtube/reporting/v1/reports/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.YouTubeReporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.YouTubeReporting.html) ... -* [jobs](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.Job.html) - * [*create*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.JobReportListCall.html) -* [media](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.Media.html) - * [*download*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.MediaDownloadCall.html) -* [report types](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.ReportType.html) - * [*list*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.ReportTypeListCall.html) +* [jobs](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.Job.html) + * [*create*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.JobReportListCall.html) +* [media](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.Media.html) + * [*download*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.MediaDownloadCall.html) +* [report types](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.ReportType.html) + * [*list*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.ReportTypeListCall.html) Download supported by ... -* [*download media*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.MediaDownloadCall.html) +* [*download media*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.MediaDownloadCall.html) @@ -31,17 +31,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/struct.YouTubeReporting.html)** +* **[Hub](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.YouTubeReporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/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](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/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")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/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](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/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](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/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](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/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](https://docs.rs/google-youtubereporting1/1.0.6+20170520/google_youtubereporting1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/youtubereporting1/src/lib.rs b/gen/youtubereporting1/src/lib.rs index d991c55c77..41cf458097 100644 --- a/gen/youtubereporting1/src/lib.rs +++ b/gen/youtubereporting1/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 Reporting* crate version *1.0.6+20170520*, where *20170520* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *YouTube Reporting* crate version *1.0.6+20170926*, where *20170926* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *YouTube Reporting* *v1* API can be found at the //! [official documentation site](https://developers.google.com/youtube/reporting/v1/reports/). @@ -533,6 +533,9 @@ impl ResponseResult for ListReportsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReportType { + /// The date/time when this report type was/will be deprecated. + #[serde(rename="deprecateTime")] + pub deprecate_time: Option, /// True if this a system-managed report type; otherwise false. Reporting jobs /// for system-managed report types are created automatically and can thus not /// be used in the `CreateJob` method. @@ -542,9 +545,6 @@ pub struct ReportType { pub id: Option, /// The name of the report type (max. 100 characters). pub name: Option, - /// The date/time when this report type was/will be deprecated. - #[serde(rename="deprecateTime")] - pub deprecate_time: Option, } impl Resource for ReportType {} @@ -1134,12 +1134,12 @@ impl<'a, C, A> MediaDownloadCall<'a, C, A> where C: BorrowMut, A: /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> MediaDownloadCall<'a, C, A> @@ -1405,12 +1405,12 @@ impl<'a, C, A> ReportTypeListCall<'a, C, A> where C: BorrowMut, A /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> ReportTypeListCall<'a, C, A> @@ -1667,12 +1667,12 @@ impl<'a, C, A> JobDeleteCall<'a, C, A> where C: BorrowMut, A: oau /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> JobDeleteCall<'a, C, A> @@ -1941,12 +1941,12 @@ impl<'a, C, A> JobReportGetCall<'a, C, A> where C: BorrowMut, A: /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> JobReportGetCall<'a, C, A> @@ -2203,12 +2203,12 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> JobGetCall<'a, C, A> @@ -2532,12 +2532,12 @@ impl<'a, C, A> JobReportListCall<'a, C, A> where C: BorrowMut, A: /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> JobReportListCall<'a, C, A> @@ -2803,12 +2803,12 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> JobListCall<'a, C, A> @@ -3063,12 +3063,12 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau /// * *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. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial 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) -> JobCreateCall<'a, C, A>